oasis-editor 0.0.211 → 0.0.213
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/{OasisEditorApp-BXMn6Cr6.js → OasisEditorApp-BaUyN8HW.js} +1 -1
- package/dist/assets/{importDocxWorker-BacVrzqW.js → importDocxWorker-CttqoLlH.js} +1047 -1010
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/pageNumber.d.ts +14 -0
- package/dist/core/commands/publicCommandTypes.d.ts +1 -0
- package/dist/core/format/pageNumberFormat.d.ts +11 -0
- package/dist/core/model/index.d.ts +1 -1
- package/dist/core/model/types/primitives.d.ts +4 -0
- package/dist/defaultToolbar-BOtwFPtW.js +1 -0
- package/dist/export/docx/text/fieldRunXml.d.ts +2 -2
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/pt-BR.d.ts +2 -0
- package/dist/import/docx/runs/types.d.ts +2 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/plugins/internal/essentialsCapabilities.d.ts +2 -0
- package/package.json +1 -1
- package/dist/defaultToolbar-CNHnpEEU.js +0 -1
|
@@ -8966,8 +8966,37 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
8966
8966
|
if (o.adjustLineHeightInTable) for (const e of i.rows) for (const i of e.cells) Yt(i.blocks, t, r, n, o);
|
|
8967
8967
|
}
|
|
8968
8968
|
}
|
|
8969
|
-
const Qt =
|
|
8970
|
-
|
|
8969
|
+
const Qt = [
|
|
8970
|
+
{
|
|
8971
|
+
id: "decimal",
|
|
8972
|
+
label: "1, 2, 3, …"
|
|
8973
|
+
},
|
|
8974
|
+
{
|
|
8975
|
+
id: "roman",
|
|
8976
|
+
label: "i, ii, iii, …"
|
|
8977
|
+
},
|
|
8978
|
+
{
|
|
8979
|
+
id: "ROMAN",
|
|
8980
|
+
label: "I, II, III, …"
|
|
8981
|
+
},
|
|
8982
|
+
{
|
|
8983
|
+
id: "alphabetic",
|
|
8984
|
+
label: "a, b, c, …"
|
|
8985
|
+
},
|
|
8986
|
+
{
|
|
8987
|
+
id: "ALPHABETIC",
|
|
8988
|
+
label: "A, B, C, …"
|
|
8989
|
+
},
|
|
8990
|
+
{
|
|
8991
|
+
id: "Ordinal",
|
|
8992
|
+
label: "1st, 2nd, 3rd, …"
|
|
8993
|
+
}
|
|
8994
|
+
];
|
|
8995
|
+
function Kt(e) {
|
|
8996
|
+
if (e) return Qt.find((t) => t.id === e)?.id;
|
|
8997
|
+
}
|
|
8998
|
+
const Jt = new b.XMLSerializer();
|
|
8999
|
+
function er(e, t) {
|
|
8971
9000
|
const r = [];
|
|
8972
9001
|
for (let n = 0; n < e.childNodes.length; n += 1) {
|
|
8973
9002
|
const o = e.childNodes[n];
|
|
@@ -8975,23 +9004,23 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
8975
9004
|
}
|
|
8976
9005
|
return r;
|
|
8977
9006
|
}
|
|
8978
|
-
function
|
|
8979
|
-
return
|
|
9007
|
+
function tr(e, t) {
|
|
9008
|
+
return er(e, t)[0];
|
|
8980
9009
|
}
|
|
8981
|
-
function
|
|
9010
|
+
function rr(e, t) {
|
|
8982
9011
|
return e?.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/math", t) ?? e?.getAttribute(`m:${t}`) ?? e?.getAttribute(t) ?? void 0;
|
|
8983
9012
|
}
|
|
8984
|
-
function
|
|
8985
|
-
return e ?
|
|
9013
|
+
function nr(e) {
|
|
9014
|
+
return e ? er(e).map(or) : [];
|
|
8986
9015
|
}
|
|
8987
|
-
function
|
|
9016
|
+
function or(e) {
|
|
8988
9017
|
switch (e.localName) {
|
|
8989
9018
|
case "r": return function(e) {
|
|
8990
|
-
const t =
|
|
8991
|
-
...
|
|
8992
|
-
...
|
|
8993
|
-
...
|
|
8994
|
-
...
|
|
9019
|
+
const t = tr(e, "t")?.textContent ?? "", r = tr(e, "rPr"), n = r ? {
|
|
9020
|
+
...tr(r, "sty") ? { script: rr(tr(r, "sty"), "val") } : {},
|
|
9021
|
+
...tr(r, "nor") ? { normalText: !0 } : {},
|
|
9022
|
+
...tr(r, "b") ? { bold: "0" !== rr(tr(r, "b"), "val") } : {},
|
|
9023
|
+
...tr(r, "i") ? { italic: "0" !== rr(tr(r, "i"), "val") } : {}
|
|
8995
9024
|
} : void 0;
|
|
8996
9025
|
return {
|
|
8997
9026
|
kind: "text",
|
|
@@ -9001,18 +9030,18 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9001
9030
|
}(e);
|
|
9002
9031
|
case "f": return {
|
|
9003
9032
|
kind: "fraction",
|
|
9004
|
-
numerator: tr(
|
|
9005
|
-
denominator: tr(
|
|
9033
|
+
numerator: nr(tr(e, "num")),
|
|
9034
|
+
denominator: nr(tr(e, "den"))
|
|
9006
9035
|
};
|
|
9007
9036
|
case "rad": return {
|
|
9008
9037
|
kind: "radical",
|
|
9009
|
-
radicand: tr(
|
|
9010
|
-
...
|
|
9038
|
+
radicand: nr(tr(e, "e")),
|
|
9039
|
+
...tr(e, "deg") ? { degree: nr(tr(e, "deg")) } : {}
|
|
9011
9040
|
};
|
|
9012
9041
|
case "sSub":
|
|
9013
9042
|
case "sSup":
|
|
9014
9043
|
case "sSubSup": return function(e, t) {
|
|
9015
|
-
const r = tr(
|
|
9044
|
+
const r = nr(tr(e, "e")), n = nr(tr(e, "sub")), o = nr(tr(e, "sup"));
|
|
9016
9045
|
return {
|
|
9017
9046
|
kind: t,
|
|
9018
9047
|
base: r,
|
|
@@ -9021,85 +9050,85 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9021
9050
|
};
|
|
9022
9051
|
}(e, "script");
|
|
9023
9052
|
case "d": {
|
|
9024
|
-
const t =
|
|
9053
|
+
const t = tr(e, "dPr");
|
|
9025
9054
|
return {
|
|
9026
9055
|
kind: "delimiter",
|
|
9027
|
-
children:
|
|
9028
|
-
...
|
|
9029
|
-
...
|
|
9030
|
-
...
|
|
9031
|
-
grow: "0" !==
|
|
9056
|
+
children: er(e, "e").map(nr),
|
|
9057
|
+
...rr(tr(t, "begChr"), "val") ? { begin: rr(tr(t, "begChr"), "val") } : {},
|
|
9058
|
+
...rr(tr(t, "endChr"), "val") ? { end: rr(tr(t, "endChr"), "val") } : {},
|
|
9059
|
+
...rr(tr(t, "sepChr"), "val") ? { separator: rr(tr(t, "sepChr"), "val") } : {},
|
|
9060
|
+
grow: "0" !== rr(tr(t, "grow"), "val")
|
|
9032
9061
|
};
|
|
9033
9062
|
}
|
|
9034
9063
|
case "acc": return {
|
|
9035
9064
|
kind: "accent",
|
|
9036
|
-
accent:
|
|
9037
|
-
children: tr(
|
|
9065
|
+
accent: rr(tr(tr(e, "accPr"), "chr"), "val") ?? "¯",
|
|
9066
|
+
children: nr(tr(e, "e"))
|
|
9038
9067
|
};
|
|
9039
9068
|
case "nary": {
|
|
9040
|
-
const t =
|
|
9069
|
+
const t = tr(e, "naryPr");
|
|
9041
9070
|
return {
|
|
9042
9071
|
kind: "nary",
|
|
9043
|
-
operator:
|
|
9044
|
-
children: tr(
|
|
9045
|
-
...
|
|
9046
|
-
...
|
|
9047
|
-
grow: "0" !==
|
|
9072
|
+
operator: rr(tr(t, "chr"), "val") ?? "∑",
|
|
9073
|
+
children: nr(tr(e, "e")),
|
|
9074
|
+
...er(e, "sub").length > 0 ? { subscript: nr(tr(e, "sub")) } : {},
|
|
9075
|
+
...er(e, "sup").length > 0 ? { superscript: nr(tr(e, "sup")) } : {},
|
|
9076
|
+
grow: "0" !== rr(tr(t, "grow"), "val")
|
|
9048
9077
|
};
|
|
9049
9078
|
}
|
|
9050
9079
|
case "limLow": return {
|
|
9051
9080
|
kind: "limit",
|
|
9052
9081
|
operator: "low",
|
|
9053
|
-
base: tr(
|
|
9054
|
-
limit: tr(
|
|
9082
|
+
base: nr(tr(e, "e")),
|
|
9083
|
+
limit: nr(tr(e, "lim"))
|
|
9055
9084
|
};
|
|
9056
9085
|
case "limUpp": return {
|
|
9057
9086
|
kind: "limit",
|
|
9058
9087
|
operator: "upper",
|
|
9059
|
-
base: tr(
|
|
9060
|
-
limit: tr(
|
|
9088
|
+
base: nr(tr(e, "e")),
|
|
9089
|
+
limit: nr(tr(e, "lim"))
|
|
9061
9090
|
};
|
|
9062
9091
|
case "m": return {
|
|
9063
9092
|
kind: "matrix",
|
|
9064
|
-
rows:
|
|
9093
|
+
rows: er(e, "mr").map((e) => er(e, "e").map(nr))
|
|
9065
9094
|
};
|
|
9066
9095
|
case "box":
|
|
9067
9096
|
case "borderBox": return {
|
|
9068
9097
|
kind: "box",
|
|
9069
|
-
children: tr(
|
|
9098
|
+
children: nr(tr(e, "e")),
|
|
9070
9099
|
border: !0
|
|
9071
9100
|
};
|
|
9072
9101
|
case "phant": return {
|
|
9073
9102
|
kind: "box",
|
|
9074
|
-
children: tr(
|
|
9103
|
+
children: nr(tr(e, "e")),
|
|
9075
9104
|
hidden: !0
|
|
9076
9105
|
};
|
|
9077
9106
|
case "groupChr": return {
|
|
9078
9107
|
kind: "accent",
|
|
9079
|
-
accent:
|
|
9080
|
-
children: tr(
|
|
9108
|
+
accent: rr(tr(tr(e, "groupChrPr"), "chr"), "val") ?? "¯",
|
|
9109
|
+
children: nr(tr(e, "e"))
|
|
9081
9110
|
};
|
|
9082
9111
|
case "func": return {
|
|
9083
9112
|
kind: "group",
|
|
9084
|
-
children: [...tr(
|
|
9113
|
+
children: [...nr(tr(e, "fName")), ...nr(tr(e, "e"))]
|
|
9085
9114
|
};
|
|
9086
9115
|
default: return {
|
|
9087
9116
|
kind: "raw",
|
|
9088
|
-
xml:
|
|
9117
|
+
xml: Jt.serializeToString(e),
|
|
9089
9118
|
fallbackText: e.textContent ?? ""
|
|
9090
9119
|
};
|
|
9091
9120
|
}
|
|
9092
9121
|
}
|
|
9093
|
-
function
|
|
9094
|
-
const t = "oMathPara" === e.localName ?
|
|
9122
|
+
function ir(e) {
|
|
9123
|
+
const t = "oMathPara" === e.localName ? tr(e, "oMath") : e;
|
|
9095
9124
|
return {
|
|
9096
9125
|
version: 1,
|
|
9097
|
-
children: t ?
|
|
9126
|
+
children: t ? er(t).map(or) : [],
|
|
9098
9127
|
display: "oMathPara" === e.localName,
|
|
9099
|
-
sourceXml:
|
|
9128
|
+
sourceXml: Jt.serializeToString(e)
|
|
9100
9129
|
};
|
|
9101
9130
|
}
|
|
9102
|
-
const
|
|
9131
|
+
const ar = /* @__PURE__ */ new Set([
|
|
9103
9132
|
"alias",
|
|
9104
9133
|
"tag",
|
|
9105
9134
|
"id",
|
|
@@ -9122,8 +9151,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9122
9151
|
"equation",
|
|
9123
9152
|
"citation",
|
|
9124
9153
|
"bibliography"
|
|
9125
|
-
]),
|
|
9126
|
-
function
|
|
9154
|
+
]), sr = /* @__PURE__ */ new Set(["repeatingSection", "repeatingSectionItem"]);
|
|
9155
|
+
function lr(e) {
|
|
9127
9156
|
if (!e) return {};
|
|
9128
9157
|
const t = {}, r = Re(e, Ne, "alias");
|
|
9129
9158
|
if (r) {
|
|
@@ -9196,7 +9225,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9196
9225
|
const e = Re(t, Ne, "lastSelectedValue");
|
|
9197
9226
|
return {
|
|
9198
9227
|
kind: "comboBox",
|
|
9199
|
-
listItems:
|
|
9228
|
+
listItems: cr(t),
|
|
9200
9229
|
...e ? { lastSelectedValue: Pe(e, "val") ?? void 0 } : {}
|
|
9201
9230
|
};
|
|
9202
9231
|
}
|
|
@@ -9205,7 +9234,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9205
9234
|
const e = Re(r, Ne, "lastSelectedValue");
|
|
9206
9235
|
return {
|
|
9207
9236
|
kind: "dropDownList",
|
|
9208
|
-
listItems:
|
|
9237
|
+
listItems: cr(r),
|
|
9209
9238
|
...e ? { lastSelectedValue: Pe(e, "val") ?? void 0 } : {}
|
|
9210
9239
|
};
|
|
9211
9240
|
}
|
|
@@ -9265,21 +9294,21 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9265
9294
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
9266
9295
|
const n = e.childNodes[r];
|
|
9267
9296
|
if (n?.nodeType !== n.ELEMENT_NODE) continue;
|
|
9268
|
-
const o = n, i = o.localName && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === o.namespaceURI &&
|
|
9297
|
+
const o = n, i = o.localName && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === o.namespaceURI && ar.has(o.localName), a = o.localName && "http://schemas.microsoft.com/office/word/2012/wordml" === o.namespaceURI && sr.has(o.localName);
|
|
9269
9298
|
i || a || (t += new b.XMLSerializer().serializeToString(o));
|
|
9270
9299
|
}
|
|
9271
9300
|
return t;
|
|
9272
9301
|
}(e);
|
|
9273
9302
|
return f.length > 0 && (t.unknownXml = f), t;
|
|
9274
9303
|
}
|
|
9275
|
-
function
|
|
9304
|
+
function cr(e) {
|
|
9276
9305
|
const t = Ie(e, Ne, "listItem");
|
|
9277
9306
|
if (0 !== t.length) return t.map((e) => ({
|
|
9278
9307
|
displayText: Pe(e, "displayText") ?? void 0,
|
|
9279
9308
|
value: Pe(e, "value") ?? void 0
|
|
9280
9309
|
}));
|
|
9281
9310
|
}
|
|
9282
|
-
const
|
|
9311
|
+
const ur = new Set(Object.keys({
|
|
9283
9312
|
solid: [],
|
|
9284
9313
|
dot: [.75, 2.25],
|
|
9285
9314
|
sysDot: [.75, .75],
|
|
@@ -9307,28 +9336,28 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9307
9336
|
2.25
|
|
9308
9337
|
]
|
|
9309
9338
|
}));
|
|
9310
|
-
function cr(e) {
|
|
9311
|
-
return e && lr.has(e) ? e : void 0;
|
|
9312
|
-
}
|
|
9313
|
-
const ur = /^[0-9a-fA-F]{6}$/;
|
|
9314
9339
|
function dr(e) {
|
|
9340
|
+
return e && ur.has(e) ? e : void 0;
|
|
9341
|
+
}
|
|
9342
|
+
const pr = /^[0-9a-fA-F]{6}$/;
|
|
9343
|
+
function fr(e) {
|
|
9315
9344
|
return e.trim().replace(/^#/, "");
|
|
9316
9345
|
}
|
|
9317
|
-
function
|
|
9346
|
+
function hr(e) {
|
|
9318
9347
|
if (!e) return null;
|
|
9319
|
-
const t =
|
|
9320
|
-
return
|
|
9348
|
+
const t = fr(e);
|
|
9349
|
+
return pr.test(t) ? t.toUpperCase() : null;
|
|
9321
9350
|
}
|
|
9322
|
-
function
|
|
9323
|
-
const t =
|
|
9351
|
+
function mr(e) {
|
|
9352
|
+
const t = gr(e);
|
|
9324
9353
|
return void 0 === t ? void 0 : Math.round(t / I);
|
|
9325
9354
|
}
|
|
9326
|
-
function
|
|
9355
|
+
function gr(e) {
|
|
9327
9356
|
if (null == e || "" === e) return;
|
|
9328
9357
|
const t = parseInt(e, 10);
|
|
9329
9358
|
return Number.isFinite(t) ? t : void 0;
|
|
9330
9359
|
}
|
|
9331
|
-
function
|
|
9360
|
+
function wr(e) {
|
|
9332
9361
|
const t = e?.trim();
|
|
9333
9362
|
if (!t) return null;
|
|
9334
9363
|
const r = t.match(/^(-?\d+(?:\.\d+)?)(pt|px|in|cm|mm|pc)?$/i);
|
|
@@ -9344,11 +9373,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9344
9373
|
default: return Math.round(n);
|
|
9345
9374
|
}
|
|
9346
9375
|
}
|
|
9347
|
-
function
|
|
9348
|
-
const t =
|
|
9376
|
+
function br(e) {
|
|
9377
|
+
const t = hr(e);
|
|
9349
9378
|
return t ? `#${t}` : void 0;
|
|
9350
9379
|
}
|
|
9351
|
-
function
|
|
9380
|
+
function vr(e) {
|
|
9352
9381
|
for (let t = 0; t < e.childNodes.length; t += 1) {
|
|
9353
9382
|
const r = e.childNodes[t];
|
|
9354
9383
|
if (r?.nodeType !== r.ELEMENT_NODE) continue;
|
|
@@ -9359,23 +9388,23 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9359
9388
|
};
|
|
9360
9389
|
}
|
|
9361
9390
|
}
|
|
9362
|
-
function
|
|
9391
|
+
function yr(e) {
|
|
9363
9392
|
return "1" === e || "true" === e || "0" !== e && "false" !== e && void 0;
|
|
9364
9393
|
}
|
|
9365
|
-
function
|
|
9394
|
+
function xr(e, t) {
|
|
9366
9395
|
const r = Me(e, t);
|
|
9367
9396
|
if (!r) return;
|
|
9368
|
-
const n = Me(r, "align")?.textContent?.trim(), o = Me(r, "posOffset")?.textContent?.trim(), i =
|
|
9397
|
+
const n = Me(r, "align")?.textContent?.trim(), o = Me(r, "posOffset")?.textContent?.trim(), i = gr(o), a = {
|
|
9369
9398
|
relativeFrom: r.getAttribute("relativeFrom") ?? void 0,
|
|
9370
9399
|
...n ? { align: n } : {},
|
|
9371
9400
|
...void 0 !== i ? { offset: i } : {}
|
|
9372
9401
|
};
|
|
9373
9402
|
return void 0 !== a.relativeFrom || void 0 !== a.align || void 0 !== a.offset ? a : void 0;
|
|
9374
9403
|
}
|
|
9375
|
-
function
|
|
9376
|
-
const t =
|
|
9404
|
+
function Sr(e) {
|
|
9405
|
+
const t = xr(e, "positionH"), r = xr(e, "positionV"), n = function(e) {
|
|
9377
9406
|
return Me(e, "wrapSquare") ? "square" : Me(e, "wrapTight") ? "tight" : Me(e, "wrapThrough") ? "through" : Me(e, "wrapTopAndBottom") ? "topAndBottom" : Me(e, "wrapNone") ? "none" : void 0;
|
|
9378
|
-
}(e), o =
|
|
9407
|
+
}(e), o = gr(e.getAttribute("distT")), i = gr(e.getAttribute("distB")), a = gr(e.getAttribute("distL")), s = gr(e.getAttribute("distR")), l = yr(e.getAttribute("simplePos")), c = gr(e.getAttribute("relativeHeight")), u = yr(e.getAttribute("behindDoc")), d = yr(e.getAttribute("locked")), p = yr(e.getAttribute("layoutInCell")), f = yr(e.getAttribute("allowOverlap"));
|
|
9379
9408
|
return {
|
|
9380
9409
|
type: "floating",
|
|
9381
9410
|
...void 0 !== o ? { distT: o } : {},
|
|
@@ -9393,7 +9422,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9393
9422
|
...n ? { wrap: n } : {}
|
|
9394
9423
|
};
|
|
9395
9424
|
}
|
|
9396
|
-
async function
|
|
9425
|
+
async function Nr(e, t, r, n) {
|
|
9397
9426
|
const o = Me(e, "blip");
|
|
9398
9427
|
if (!o) return {
|
|
9399
9428
|
text: "",
|
|
@@ -9406,7 +9435,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9406
9435
|
n && ("embed" === n.localName || "r:embed" === n.name ? t.embed = n.value : "link" !== n.localName && "r:link" !== n.name || (t.link = n.value));
|
|
9407
9436
|
}
|
|
9408
9437
|
return t;
|
|
9409
|
-
}(o), s =
|
|
9438
|
+
}(o), s = vr(e), l = s?.element ?? e, c = Me(l, "extent"), u = Me(l, "docPr");
|
|
9410
9439
|
let d = 300, p = 300;
|
|
9411
9440
|
if (c) {
|
|
9412
9441
|
const e = c.getAttribute("cx"), t = c.getAttribute("cy");
|
|
@@ -9463,11 +9492,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9463
9492
|
if (1 !== e?.nodeType) continue;
|
|
9464
9493
|
const t = e;
|
|
9465
9494
|
if ("ln" !== t.localName) continue;
|
|
9466
|
-
const o =
|
|
9495
|
+
const o = br(Me(t, "srgbClr")?.getAttribute("val"));
|
|
9467
9496
|
if (!o) return;
|
|
9468
|
-
const i = { color: o }, a =
|
|
9497
|
+
const i = { color: o }, a = gr(t.getAttribute("w"));
|
|
9469
9498
|
void 0 !== a && (i.widthPt = Ye(a / C, 2));
|
|
9470
|
-
const s =
|
|
9499
|
+
const s = dr(Me(t, "prstDash")?.getAttribute("val"));
|
|
9471
9500
|
return s && (i.dash = s), i;
|
|
9472
9501
|
}
|
|
9473
9502
|
}(e), v = function(e) {
|
|
@@ -9482,7 +9511,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9482
9511
|
"1" !== o && "true" !== o || (r.flipH = !0);
|
|
9483
9512
|
const i = t.getAttribute("flipV");
|
|
9484
9513
|
return "1" !== i && "true" !== i || (r.flipV = !0), r;
|
|
9485
|
-
}(e), y = "anchor" === s?.kind ?
|
|
9514
|
+
}(e), y = "anchor" === s?.kind ? Sr(s.element) : void 0, x = "anchor" === s?.kind ? function(e) {
|
|
9486
9515
|
const t = Me(e, "wrapPolygon");
|
|
9487
9516
|
if (!t) return;
|
|
9488
9517
|
const r = [];
|
|
@@ -9491,7 +9520,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9491
9520
|
if (1 !== e?.nodeType) continue;
|
|
9492
9521
|
const o = e;
|
|
9493
9522
|
if ("start" !== o.localName && "lineTo" !== o.localName) continue;
|
|
9494
|
-
const i =
|
|
9523
|
+
const i = gr(o.getAttribute("x")), a = gr(o.getAttribute("y"));
|
|
9495
9524
|
void 0 !== i && void 0 !== a && r.push({
|
|
9496
9525
|
x: i / 21600,
|
|
9497
9526
|
y: a / 21600
|
|
@@ -9545,7 +9574,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9545
9574
|
image: void 0
|
|
9546
9575
|
};
|
|
9547
9576
|
}
|
|
9548
|
-
function
|
|
9577
|
+
function Er(e) {
|
|
9549
9578
|
const t = e?.trim();
|
|
9550
9579
|
if (!t) return;
|
|
9551
9580
|
if (t.endsWith("%")) {
|
|
@@ -9559,7 +9588,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9559
9588
|
const r = Number(t);
|
|
9560
9589
|
return Number.isFinite(r) && 0 !== r ? r / 65536 : void 0;
|
|
9561
9590
|
}
|
|
9562
|
-
async function
|
|
9591
|
+
async function kr(e, t, r, n) {
|
|
9563
9592
|
const o = Me(e, "imagedata");
|
|
9564
9593
|
if (!o) return;
|
|
9565
9594
|
const i = function(e) {
|
|
@@ -9577,20 +9606,20 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9577
9606
|
if (e < 0) continue;
|
|
9578
9607
|
const n = r.slice(0, e).trim().toLowerCase(), o = r.slice(e + 1).trim();
|
|
9579
9608
|
if ("width" === n) {
|
|
9580
|
-
const e =
|
|
9609
|
+
const e = wr(o);
|
|
9581
9610
|
null !== e && (t.width = e);
|
|
9582
9611
|
} else if ("height" === n) {
|
|
9583
|
-
const e =
|
|
9612
|
+
const e = wr(o);
|
|
9584
9613
|
null !== e && (t.height = e);
|
|
9585
9614
|
}
|
|
9586
9615
|
}
|
|
9587
9616
|
return t;
|
|
9588
9617
|
}(Me(e, "shape")?.getAttribute("style")), l = function(e) {
|
|
9589
9618
|
const t = {
|
|
9590
|
-
left:
|
|
9591
|
-
top:
|
|
9592
|
-
right:
|
|
9593
|
-
bottom:
|
|
9619
|
+
left: Er(Pe(e, "cropleft")),
|
|
9620
|
+
top: Er(Pe(e, "croptop")),
|
|
9621
|
+
right: Er(Pe(e, "cropright")),
|
|
9622
|
+
bottom: Er(Pe(e, "cropbottom"))
|
|
9594
9623
|
};
|
|
9595
9624
|
if (void 0 !== t.left || void 0 !== t.top || void 0 !== t.right || void 0 !== t.bottom) return t;
|
|
9596
9625
|
}(o), c = Pe(o, "title") ?? o.getAttribute("o:title"), u = await qe(t, n, a);
|
|
@@ -9602,10 +9631,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9602
9631
|
...l ? { crop: l } : {}
|
|
9603
9632
|
} : void 0;
|
|
9604
9633
|
}
|
|
9605
|
-
async function
|
|
9634
|
+
async function _r(e, t) {
|
|
9606
9635
|
const r = Me(e, "wsp");
|
|
9607
9636
|
if (!r) return;
|
|
9608
|
-
const n =
|
|
9637
|
+
const n = vr(e), o = n?.element ?? e, i = Me(o, "extent"), a = mr(i?.getAttribute("cx")) ?? 300, s = mr(i?.getAttribute("cy")) ?? 300, l = Me(o, "docPr"), c = l ? Pe(l, "name") : null, u = l ? Pe(l, "descr") ?? Pe(l, "title") : null, d = "anchor" === n?.kind ? Sr(n.element) : void 0, p = Me(r, "txbxContent"), f = p && t ? await t(p) : [], h = function(e) {
|
|
9609
9638
|
const t = Me(e, "spPr");
|
|
9610
9639
|
if (!t) return;
|
|
9611
9640
|
const r = {}, n = Me(t, "prstGeom")?.getAttribute("prst");
|
|
@@ -9615,12 +9644,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9615
9644
|
if (e?.nodeType !== e.ELEMENT_NODE) continue;
|
|
9616
9645
|
const n = e;
|
|
9617
9646
|
if ("solidFill" === n.localName) {
|
|
9618
|
-
const e =
|
|
9647
|
+
const e = br(Me(n, "srgbClr")?.getAttribute("val"));
|
|
9619
9648
|
e && (r.fill = e);
|
|
9620
9649
|
} else if ("ln" === n.localName) {
|
|
9621
|
-
const e =
|
|
9650
|
+
const e = gr(n.getAttribute("w"));
|
|
9622
9651
|
void 0 !== e && (r.borderWidthPt = Ye(e / C, 2));
|
|
9623
|
-
const t =
|
|
9652
|
+
const t = br(Me(n, "srgbClr")?.getAttribute("val"));
|
|
9624
9653
|
t && (r.borderColor = t);
|
|
9625
9654
|
}
|
|
9626
9655
|
}
|
|
@@ -9628,7 +9657,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9628
9657
|
}(r), m = function(e) {
|
|
9629
9658
|
const t = Me(e, "bodyPr");
|
|
9630
9659
|
if (!t) return;
|
|
9631
|
-
const r = {}, n =
|
|
9660
|
+
const r = {}, n = mr(t.getAttribute("lIns")), o = mr(t.getAttribute("tIns")), i = mr(t.getAttribute("rIns")), a = mr(t.getAttribute("bIns"));
|
|
9632
9661
|
void 0 !== n && (r.paddingLeft = n), void 0 !== o && (r.paddingTop = o), void 0 !== i && (r.paddingRight = i), void 0 !== a && (r.paddingBottom = a);
|
|
9633
9662
|
const s = t.getAttribute("anchor");
|
|
9634
9663
|
s && (r.anchor = s);
|
|
@@ -9639,7 +9668,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9639
9668
|
}(r), g = function(e) {
|
|
9640
9669
|
const t = Me(e, "spPr");
|
|
9641
9670
|
if (!t) return;
|
|
9642
|
-
const n =
|
|
9671
|
+
const n = gr(Me(t, "xfrm")?.getAttribute("rot"));
|
|
9643
9672
|
return void 0 !== n && 0 !== n && (Math.round(n / 6e4) % 360 + 360) % 360 || void 0;
|
|
9644
9673
|
}(r);
|
|
9645
9674
|
return {
|
|
@@ -9654,7 +9683,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9654
9683
|
...m ? { body: m } : {}
|
|
9655
9684
|
};
|
|
9656
9685
|
}
|
|
9657
|
-
function
|
|
9686
|
+
function Tr(e) {
|
|
9658
9687
|
let t;
|
|
9659
9688
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
9660
9689
|
const n = e.childNodes[r];
|
|
@@ -9669,7 +9698,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9669
9698
|
}
|
|
9670
9699
|
return t;
|
|
9671
9700
|
}
|
|
9672
|
-
function
|
|
9701
|
+
function Ir(e) {
|
|
9673
9702
|
const t = Pe(e, "id");
|
|
9674
9703
|
if (!t) return;
|
|
9675
9704
|
if ("bookmarkEnd" === e.localName) return {
|
|
@@ -9685,39 +9714,39 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9685
9714
|
...void 0 === a || Number.isNaN(a) ? {} : { colLast: a }
|
|
9686
9715
|
};
|
|
9687
9716
|
}
|
|
9688
|
-
function
|
|
9717
|
+
function Cr(e) {
|
|
9689
9718
|
const t = Pe(e, "id");
|
|
9690
9719
|
if (t) return {
|
|
9691
9720
|
kind: "commentRangeEnd" === e.localName ? "end" : "start",
|
|
9692
9721
|
docxId: t
|
|
9693
9722
|
};
|
|
9694
9723
|
}
|
|
9695
|
-
function
|
|
9724
|
+
function Ar(e) {
|
|
9696
9725
|
const t = new b.XMLSerializer().serializeToString(e);
|
|
9697
9726
|
let r = 2166136261;
|
|
9698
9727
|
for (let n = 0; n < t.length; n += 1) r ^= t.charCodeAt(n), r = Math.imul(r, 16777619);
|
|
9699
9728
|
return `revision:${r >>> 0}`;
|
|
9700
9729
|
}
|
|
9701
|
-
function
|
|
9730
|
+
function Rr(e) {
|
|
9702
9731
|
const t = e.localName;
|
|
9703
9732
|
if ("ins" !== t && "del" !== t && "moveFrom" !== t && "moveTo" !== t) return;
|
|
9704
9733
|
const r = Pe(e, "date"), n = r ? Date.parse(r) : NaN, o = "del" === t || "moveFrom" === t;
|
|
9705
9734
|
return {
|
|
9706
|
-
id: Pe(e, "id") ??
|
|
9735
|
+
id: Pe(e, "id") ?? Ar(e),
|
|
9707
9736
|
type: o ? "delete" : "insert",
|
|
9708
9737
|
author: Pe(e, "author") ?? "Unknown",
|
|
9709
9738
|
date: Number.isFinite(n) ? n : 0,
|
|
9710
9739
|
..."moveFrom" === t ? { move: "from" } : "moveTo" === t ? { move: "to" } : {}
|
|
9711
9740
|
};
|
|
9712
9741
|
}
|
|
9713
|
-
function
|
|
9742
|
+
function $r(e) {
|
|
9714
9743
|
const t = /^move(From|To)Range(Start|End)$/.exec(e.localName ?? "");
|
|
9715
9744
|
if (!t) return;
|
|
9716
9745
|
const r = "From" === t[1] ? "from" : "to", n = "Start" === t[2] ? "start" : "end", o = Pe(e, "date"), i = o ? Date.parse(o) : NaN, a = Pe(e, "colFirst"), s = Pe(e, "colLast"), l = null !== a ? Number.parseInt(a, 10) : NaN, c = null !== s ? Number.parseInt(s, 10) : NaN, u = Pe(e, "name") ?? void 0, d = Pe(e, "author") ?? void 0, p = Pe(e, "displacedByCustomXml") ?? void 0;
|
|
9717
9746
|
return {
|
|
9718
9747
|
move: r,
|
|
9719
9748
|
edge: n,
|
|
9720
|
-
id: Pe(e, "id") ??
|
|
9749
|
+
id: Pe(e, "id") ?? Ar(e),
|
|
9721
9750
|
...void 0 !== u ? { name: u } : {},
|
|
9722
9751
|
...void 0 !== d ? { author: d } : {},
|
|
9723
9752
|
...Number.isFinite(i) ? { date: i } : {},
|
|
@@ -9726,7 +9755,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9726
9755
|
...void 0 !== p ? { displacedByCustomXml: p } : {}
|
|
9727
9756
|
};
|
|
9728
9757
|
}
|
|
9729
|
-
async function
|
|
9758
|
+
async function Dr(e, t, r, n, o) {
|
|
9730
9759
|
const i = [];
|
|
9731
9760
|
let a, s, l, c = 0;
|
|
9732
9761
|
const u = [], d = [], p = (e) => {
|
|
@@ -9744,7 +9773,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9744
9773
|
else {
|
|
9745
9774
|
if ("lastRenderedPageBreak" === i.localName) continue;
|
|
9746
9775
|
if ("bookmarkStart" === i.localName || "bookmarkEnd" === i.localName) {
|
|
9747
|
-
const e =
|
|
9776
|
+
const e = Ir(i);
|
|
9748
9777
|
e && u.push({
|
|
9749
9778
|
offset: c,
|
|
9750
9779
|
marker: e
|
|
@@ -9752,7 +9781,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9752
9781
|
continue;
|
|
9753
9782
|
}
|
|
9754
9783
|
if ("commentRangeStart" === i.localName || "commentRangeEnd" === i.localName) {
|
|
9755
|
-
const e =
|
|
9784
|
+
const e = Cr(i);
|
|
9756
9785
|
e && d.push({
|
|
9757
9786
|
offset: c,
|
|
9758
9787
|
marker: e
|
|
@@ -9762,14 +9791,14 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9762
9791
|
if ("proofErr" === i.localName || "commentReference" === i.localName || "permStart" === i.localName || "permEnd" === i.localName) continue;
|
|
9763
9792
|
if ("cr" === i.localName) p("\n");
|
|
9764
9793
|
else if ("drawing" === i.localName) {
|
|
9765
|
-
const e = await
|
|
9794
|
+
const e = await Nr(i, t, r, n);
|
|
9766
9795
|
if (e.image) p(e.text), a = e.image;
|
|
9767
9796
|
else {
|
|
9768
|
-
const e = await
|
|
9797
|
+
const e = await _r(i, o);
|
|
9769
9798
|
e && (p(""), s = e);
|
|
9770
9799
|
}
|
|
9771
9800
|
} else if ("pict" === i.localName) {
|
|
9772
|
-
const e = await
|
|
9801
|
+
const e = await kr(i, t, r, n);
|
|
9773
9802
|
e && (p(""), a = e);
|
|
9774
9803
|
} else if ("sym" === i.localName) {
|
|
9775
9804
|
const e = Pe(i, "font") ?? "", t = Pe(i, "char") ?? "", r = parseInt(t, 16);
|
|
@@ -9780,9 +9809,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9780
9809
|
}
|
|
9781
9810
|
}
|
|
9782
9811
|
else if ("AlternateContent" === i.localName) {
|
|
9783
|
-
const e =
|
|
9812
|
+
const e = Tr(i);
|
|
9784
9813
|
if (e) {
|
|
9785
|
-
const t = await
|
|
9814
|
+
const t = await _r(e, o);
|
|
9786
9815
|
t && (p(""), s = t);
|
|
9787
9816
|
}
|
|
9788
9817
|
}
|
|
@@ -9796,7 +9825,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9796
9825
|
...l ? { sym: l } : {}
|
|
9797
9826
|
};
|
|
9798
9827
|
}
|
|
9799
|
-
async function
|
|
9828
|
+
async function Pr(e, t, r, n, o, i, a, s) {
|
|
9800
9829
|
const l = [], c = [], u = (e, t) => {
|
|
9801
9830
|
const r = Pe(e, "fldCharType"), n = Pe(e, "fldLock"), o = Pe(e, "dirty"), i = "true" === n || "1" === n, a = "true" === o || "1" === o;
|
|
9802
9831
|
if ("begin" === r) l.push({
|
|
@@ -9827,13 +9856,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9827
9856
|
e && ((e) => {
|
|
9828
9857
|
const t = /\bNUMPAGES\b/i.test(e.instruction) ? "NUMPAGES" : /\bPAGE\b/i.test(e.instruction) ? "PAGE" : null;
|
|
9829
9858
|
if (!t) return;
|
|
9830
|
-
const r = l.slice(e.beginIndex);
|
|
9831
|
-
if (
|
|
9832
|
-
const
|
|
9859
|
+
const r = Kt(/\*\s*([A-Za-z]+)/.exec(e.instruction)?.[1]), n = l.slice(e.beginIndex);
|
|
9860
|
+
if (n.some((e) => e.bookmark)) return;
|
|
9861
|
+
const o = n.filter((e) => !e.fieldChar && void 0 === e.fieldInstruction), i = o.map((e) => e.text).join("") || "1", a = o.find((e) => e.styles)?.styles ?? e.beginStyles;
|
|
9833
9862
|
l.length = e.beginIndex, l.push({
|
|
9834
|
-
text:
|
|
9835
|
-
...
|
|
9836
|
-
field:
|
|
9863
|
+
text: i,
|
|
9864
|
+
...a ? { styles: a } : {},
|
|
9865
|
+
field: r ? {
|
|
9866
|
+
type: t,
|
|
9867
|
+
format: r
|
|
9868
|
+
} : { type: t }
|
|
9837
9869
|
});
|
|
9838
9870
|
})(e);
|
|
9839
9871
|
}
|
|
@@ -9854,13 +9886,13 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9854
9886
|
if ("http://schemas.openxmlformats.org/officeDocument/2006/math" === f.namespaceURI && ("oMath" === f.localName || "oMathPara" === f.localName)) {
|
|
9855
9887
|
l.push({
|
|
9856
9888
|
text: "",
|
|
9857
|
-
math:
|
|
9889
|
+
math: ir(f)
|
|
9858
9890
|
});
|
|
9859
9891
|
continue;
|
|
9860
9892
|
}
|
|
9861
9893
|
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== f.namespaceURI) continue;
|
|
9862
9894
|
if ("bookmarkStart" === f.localName || "bookmarkEnd" === f.localName) {
|
|
9863
|
-
const e =
|
|
9895
|
+
const e = Ir(f);
|
|
9864
9896
|
if (!e) continue;
|
|
9865
9897
|
l.push({
|
|
9866
9898
|
text: "",
|
|
@@ -9869,7 +9901,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9869
9901
|
continue;
|
|
9870
9902
|
}
|
|
9871
9903
|
if ("commentRangeStart" === f.localName || "commentRangeEnd" === f.localName) {
|
|
9872
|
-
const e =
|
|
9904
|
+
const e = Cr(f);
|
|
9873
9905
|
if (!e) continue;
|
|
9874
9906
|
l.push({
|
|
9875
9907
|
text: "",
|
|
@@ -9877,7 +9909,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9877
9909
|
});
|
|
9878
9910
|
continue;
|
|
9879
9911
|
}
|
|
9880
|
-
const h =
|
|
9912
|
+
const h = $r(f);
|
|
9881
9913
|
if (h) {
|
|
9882
9914
|
l.push({
|
|
9883
9915
|
text: "",
|
|
@@ -9885,9 +9917,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9885
9917
|
});
|
|
9886
9918
|
continue;
|
|
9887
9919
|
}
|
|
9888
|
-
const m =
|
|
9920
|
+
const m = Rr(f);
|
|
9889
9921
|
if (m) {
|
|
9890
|
-
const e = await
|
|
9922
|
+
const e = await Pr(f, t, r, n, o, i, a, s);
|
|
9891
9923
|
for (const t of e) l.push({
|
|
9892
9924
|
...t,
|
|
9893
9925
|
revision: t.revision ?? m
|
|
@@ -9899,9 +9931,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9899
9931
|
if (!e) continue;
|
|
9900
9932
|
const c = Re(f, Ne, "sdtPr"), u = Re(f, Ne, "sdtEndPr"), d = {
|
|
9901
9933
|
groupId: v("sdt"),
|
|
9902
|
-
sdtPr:
|
|
9934
|
+
sdtPr: lr(c),
|
|
9903
9935
|
...u ? { sdtEndPrXml: new b.XMLSerializer().serializeToString(u) } : {}
|
|
9904
|
-
}, p = await
|
|
9936
|
+
}, p = await Pr(e, t, r, n, o, i, a, s);
|
|
9905
9937
|
for (const t of p) l.push({
|
|
9906
9938
|
...t,
|
|
9907
9939
|
sdtWrappers: [d, ...t.sdtWrappers ?? []]
|
|
@@ -9951,7 +9983,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9951
9983
|
});
|
|
9952
9984
|
continue;
|
|
9953
9985
|
}
|
|
9954
|
-
const { text: p, image: h, textBox: m, innerBookmarks: g, innerComments: w, sym: b } = await
|
|
9986
|
+
const { text: p, image: h, textBox: m, innerBookmarks: g, innerComments: w, sym: b } = await Dr(f, r, n, o, s);
|
|
9955
9987
|
let v = e;
|
|
9956
9988
|
b && !v?.fontFamily && ((v ??= {}).fontFamily = b.font), a && ((v ??= {}).link = a);
|
|
9957
9989
|
const y = [...(g ?? []).map((e) => ({
|
|
@@ -9998,13 +10030,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
9998
10030
|
continue;
|
|
9999
10031
|
}
|
|
10000
10032
|
if ("fldSimple" === f.localName) {
|
|
10001
|
-
const e = f.getAttribute("w:instr") ?? f.getAttributeNS("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "instr") ?? f.getAttribute("instr") ?? "", c = /\bNUMPAGES\b/i.test(e) ? "NUMPAGES" : /\bPAGE\b/i.test(e) ? "PAGE" : null, u = await
|
|
10033
|
+
const e = f.getAttribute("w:instr") ?? f.getAttributeNS("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "instr") ?? f.getAttribute("instr") ?? "", c = /\bNUMPAGES\b/i.test(e) ? "NUMPAGES" : /\bPAGE\b/i.test(e) ? "PAGE" : null, u = /\*\s*([A-Za-z]+)/.exec(e)?.[1], d = Kt(u), p = await Pr(f, t, r, n, o, i, a, s);
|
|
10002
10034
|
if (c) {
|
|
10003
|
-
const e =
|
|
10035
|
+
const e = p.map((e) => e.text).join("") || "1", t = p.find((e) => e.styles)?.styles;
|
|
10004
10036
|
l.push({
|
|
10005
10037
|
text: e,
|
|
10006
10038
|
styles: t,
|
|
10007
|
-
field:
|
|
10039
|
+
field: d ? {
|
|
10040
|
+
type: c,
|
|
10041
|
+
format: d
|
|
10042
|
+
} : { type: c }
|
|
10008
10043
|
});
|
|
10009
10044
|
} else l.push({
|
|
10010
10045
|
text: "",
|
|
@@ -10015,7 +10050,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10015
10050
|
}), l.push({
|
|
10016
10051
|
text: "",
|
|
10017
10052
|
fieldChar: { kind: "separate" }
|
|
10018
|
-
}), l.push(...
|
|
10053
|
+
}), l.push(...p), l.push({
|
|
10019
10054
|
text: "",
|
|
10020
10055
|
fieldChar: { kind: "end" }
|
|
10021
10056
|
});
|
|
@@ -10027,100 +10062,100 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10027
10062
|
const t = Pe(f, "anchor");
|
|
10028
10063
|
t && (e = `#${t}`);
|
|
10029
10064
|
}
|
|
10030
|
-
l.push(...await
|
|
10065
|
+
l.push(...await Pr(f, t, r, n, o, i, e, s));
|
|
10031
10066
|
}
|
|
10032
10067
|
}
|
|
10033
10068
|
return l;
|
|
10034
10069
|
}
|
|
10035
|
-
const
|
|
10036
|
-
function
|
|
10037
|
-
if (Array.isArray(e)) return e.map(
|
|
10070
|
+
const Mr = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Or = /<w:rPr(?:\s|\/|>)/, Lr = /<w:pPr(?:\s|\/|>)/;
|
|
10071
|
+
function Fr(e) {
|
|
10072
|
+
if (Array.isArray(e)) return e.map(Fr);
|
|
10038
10073
|
if (!e || "object" != typeof e) return e;
|
|
10039
10074
|
const t = e, r = function(e) {
|
|
10040
10075
|
return "string" == typeof e.kind || "string" == typeof e.type || Array.isArray(e.runs) || Array.isArray(e.rows) || Array.isArray(e.cells) || Array.isArray(e.blocks);
|
|
10041
10076
|
}(t), n = {};
|
|
10042
|
-
for (const [o, i] of Object.entries(t).sort(([e], [t]) => e.localeCompare(t))) void 0 === i || "id" === o && r || "ooxmlSource" === o || o.startsWith("__") || (n[o] =
|
|
10077
|
+
for (const [o, i] of Object.entries(t).sort(([e], [t]) => e.localeCompare(t))) void 0 === i || "id" === o && r || "ooxmlSource" === o || o.startsWith("__") || (n[o] = Fr(i));
|
|
10043
10078
|
return n;
|
|
10044
10079
|
}
|
|
10045
|
-
function
|
|
10046
|
-
return JSON.stringify(
|
|
10080
|
+
function Br(e) {
|
|
10081
|
+
return JSON.stringify(Fr(e)) ?? "undefined";
|
|
10047
10082
|
}
|
|
10048
|
-
function
|
|
10083
|
+
function Ur(e) {
|
|
10049
10084
|
return /\br:(?:id|embed|link)\s*=/.test(e);
|
|
10050
10085
|
}
|
|
10051
|
-
function
|
|
10086
|
+
function zr(e, t) {
|
|
10052
10087
|
const r = [];
|
|
10053
10088
|
for (let n = 0; n < e.childNodes.length; n += 1) {
|
|
10054
10089
|
const o = e.childNodes[n];
|
|
10055
|
-
o?.nodeType === o.ELEMENT_NODE && o.namespaceURI ===
|
|
10090
|
+
o?.nodeType === o.ELEMENT_NODE && o.namespaceURI === Mr && o.localName === t && r.push(o);
|
|
10056
10091
|
}
|
|
10057
10092
|
return r;
|
|
10058
10093
|
}
|
|
10059
|
-
function
|
|
10060
|
-
return
|
|
10094
|
+
function Hr(e, t) {
|
|
10095
|
+
return zr(e, t)[0];
|
|
10061
10096
|
}
|
|
10062
|
-
function
|
|
10097
|
+
function jr(e) {
|
|
10063
10098
|
return e ? new b.XMLSerializer().serializeToString(e) : void 0;
|
|
10064
10099
|
}
|
|
10065
|
-
function
|
|
10066
|
-
return
|
|
10100
|
+
function qr(e) {
|
|
10101
|
+
return Br(e);
|
|
10067
10102
|
}
|
|
10068
|
-
function
|
|
10069
|
-
return
|
|
10103
|
+
function Wr(e) {
|
|
10104
|
+
return Br({
|
|
10070
10105
|
...e,
|
|
10071
10106
|
text: void 0
|
|
10072
10107
|
});
|
|
10073
10108
|
}
|
|
10074
|
-
function
|
|
10109
|
+
function Gr(e, t) {
|
|
10075
10110
|
e.ooxmlSource = {
|
|
10076
10111
|
xml: t,
|
|
10077
|
-
semanticSignature:
|
|
10078
|
-
structureSignature:
|
|
10112
|
+
semanticSignature: qr(e),
|
|
10113
|
+
structureSignature: Wr(e)
|
|
10079
10114
|
};
|
|
10080
10115
|
}
|
|
10081
|
-
function
|
|
10116
|
+
function Vr(e) {
|
|
10082
10117
|
return e.ooxmlSource;
|
|
10083
10118
|
}
|
|
10084
|
-
function
|
|
10085
|
-
return
|
|
10119
|
+
function Xr(e) {
|
|
10120
|
+
return Br(e);
|
|
10086
10121
|
}
|
|
10087
|
-
function
|
|
10088
|
-
return
|
|
10122
|
+
function Zr(e) {
|
|
10123
|
+
return Br({
|
|
10089
10124
|
style: e.style,
|
|
10090
10125
|
list: e.list,
|
|
10091
10126
|
numberingRevision: e.numberingRevision
|
|
10092
10127
|
});
|
|
10093
10128
|
}
|
|
10094
|
-
function
|
|
10129
|
+
function Yr(e) {
|
|
10095
10130
|
return e.ooxmlSource;
|
|
10096
10131
|
}
|
|
10097
|
-
function
|
|
10098
|
-
return
|
|
10132
|
+
function Qr(e) {
|
|
10133
|
+
return Br(e);
|
|
10099
10134
|
}
|
|
10100
|
-
function
|
|
10101
|
-
return
|
|
10135
|
+
function Kr(e) {
|
|
10136
|
+
return Br({ style: e.style });
|
|
10102
10137
|
}
|
|
10103
|
-
function
|
|
10104
|
-
return
|
|
10138
|
+
function Jr(e) {
|
|
10139
|
+
return Br({
|
|
10105
10140
|
gridCols: e.gridCols,
|
|
10106
10141
|
gridRevision: e.gridRevision
|
|
10107
10142
|
});
|
|
10108
10143
|
}
|
|
10109
|
-
function
|
|
10110
|
-
return
|
|
10144
|
+
function en(e) {
|
|
10145
|
+
return Br({
|
|
10111
10146
|
isHeader: e.isHeader,
|
|
10112
10147
|
style: e.style,
|
|
10113
10148
|
conditionalStyle: e.conditionalStyle
|
|
10114
10149
|
});
|
|
10115
10150
|
}
|
|
10116
|
-
function
|
|
10117
|
-
return
|
|
10151
|
+
function tn(e) {
|
|
10152
|
+
return Br({
|
|
10118
10153
|
propertyExceptions: e.propertyExceptions,
|
|
10119
10154
|
tblPrExChangeXml: e.tblPrExChangeXml
|
|
10120
10155
|
});
|
|
10121
10156
|
}
|
|
10122
|
-
function
|
|
10123
|
-
return
|
|
10157
|
+
function rn(e) {
|
|
10158
|
+
return Br({
|
|
10124
10159
|
colSpan: e.colSpan,
|
|
10125
10160
|
rowSpan: e.rowSpan,
|
|
10126
10161
|
vMerge: e.vMerge,
|
|
@@ -10129,33 +10164,33 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10129
10164
|
mergeRevisionState: e.mergeRevisionState
|
|
10130
10165
|
});
|
|
10131
10166
|
}
|
|
10132
|
-
function
|
|
10167
|
+
function nn(e) {
|
|
10133
10168
|
return e.ooxmlSource;
|
|
10134
10169
|
}
|
|
10135
|
-
function
|
|
10136
|
-
const r =
|
|
10170
|
+
function on(e, t) {
|
|
10171
|
+
const r = jr(Hr(t, "tblPr")), n = jr(Hr(t, "tblGrid")), o = zr(t, "tr");
|
|
10137
10172
|
return o.length === e.rows.length && o.forEach((t, r) => {
|
|
10138
10173
|
const n = e.rows[r];
|
|
10139
10174
|
(function(e, t) {
|
|
10140
10175
|
const r = {};
|
|
10141
10176
|
t.rowPropertiesXml && (r.rowProperties = {
|
|
10142
10177
|
xml: t.rowPropertiesXml,
|
|
10143
|
-
semanticSignature:
|
|
10178
|
+
semanticSignature: en(e)
|
|
10144
10179
|
}), t.propertyExceptionsXml && (r.propertyExceptions = {
|
|
10145
10180
|
xml: t.propertyExceptionsXml,
|
|
10146
|
-
semanticSignature:
|
|
10181
|
+
semanticSignature: tn(e)
|
|
10147
10182
|
}), (r.rowProperties || r.propertyExceptions) && (e.ooxmlSource = r);
|
|
10148
10183
|
})(n, {
|
|
10149
|
-
rowPropertiesXml:
|
|
10150
|
-
propertyExceptionsXml:
|
|
10184
|
+
rowPropertiesXml: jr(Hr(t, "trPr")),
|
|
10185
|
+
propertyExceptionsXml: jr(Hr(t, "tblPrEx"))
|
|
10151
10186
|
});
|
|
10152
|
-
const o =
|
|
10187
|
+
const o = zr(t, "tc");
|
|
10153
10188
|
o.length === n.cells.length && o.forEach((e, t) => {
|
|
10154
|
-
const r =
|
|
10189
|
+
const r = jr(Hr(e, "tcPr"));
|
|
10155
10190
|
r && function(e, t) {
|
|
10156
10191
|
e.ooxmlSource = { cellProperties: {
|
|
10157
10192
|
xml: t,
|
|
10158
|
-
semanticSignature:
|
|
10193
|
+
semanticSignature: rn(e)
|
|
10159
10194
|
} };
|
|
10160
10195
|
}(n.cells[t], r);
|
|
10161
10196
|
});
|
|
@@ -10164,10 +10199,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10164
10199
|
tableGridXml: n
|
|
10165
10200
|
};
|
|
10166
10201
|
}
|
|
10167
|
-
function
|
|
10202
|
+
function an(e) {
|
|
10168
10203
|
return e.ooxmlSource;
|
|
10169
10204
|
}
|
|
10170
|
-
function
|
|
10205
|
+
function sn(e, t, r) {
|
|
10171
10206
|
const n = new b.XMLSerializer(), o = function(e, t) {
|
|
10172
10207
|
const r = t.serializeToString(e.cloneNode(!1)), n = r.indexOf(">");
|
|
10173
10208
|
if (n < 0) return;
|
|
@@ -10191,7 +10226,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10191
10226
|
...c ? { runXml: c } : {}
|
|
10192
10227
|
};
|
|
10193
10228
|
}
|
|
10194
|
-
function
|
|
10229
|
+
function ln(e) {
|
|
10195
10230
|
const t = {
|
|
10196
10231
|
id: v("run"),
|
|
10197
10232
|
text: e.text
|
|
@@ -10233,8 +10268,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10233
10268
|
const n = r;
|
|
10234
10269
|
return e.footnoteReference && (n.__importedFootnoteRef = { ...e.footnoteReference }), e.endnoteReference && (n.__importedEndnoteRef = { ...e.endnoteReference }), e.bookmark && (n.__importedBookmark = { ...e.bookmark }), e.comment && (n.__importedComment = { ...e.comment }), n;
|
|
10235
10270
|
}
|
|
10236
|
-
function
|
|
10237
|
-
const a = e.length > 0 ? e.map(
|
|
10271
|
+
function cn(e, t, r, n, o, i) {
|
|
10272
|
+
const a = e.length > 0 ? e.map(ln) : [{
|
|
10238
10273
|
id: v("run"),
|
|
10239
10274
|
text: "",
|
|
10240
10275
|
kind: "text",
|
|
@@ -10246,20 +10281,20 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10246
10281
|
};
|
|
10247
10282
|
s.style = t ? { ...t } : void 0;
|
|
10248
10283
|
for (const l of s.runs) l.styles = kt(l.styles, s.style?.styleId);
|
|
10249
|
-
if (s.list = r ? { ...r } : void 0, s.numberingRevision = n ? { ...n } : void 0, i?.runXml?.length === s.runs.length) for (let l = 0; l < s.runs.length; l += 1)
|
|
10284
|
+
if (s.list = r ? { ...r } : void 0, s.numberingRevision = n ? { ...n } : void 0, i?.runXml?.length === s.runs.length) for (let l = 0; l < s.runs.length; l += 1) Gr(s.runs[l], i.runXml[l]);
|
|
10250
10285
|
return i && function(e, t) {
|
|
10251
10286
|
const r = {};
|
|
10252
|
-
t.xml && (r.xml = t.xml, r.semanticSignature =
|
|
10287
|
+
t.xml && (r.xml = t.xml, r.semanticSignature = Xr(e)), t.attributes && (r.attributes = t.attributes), t.paragraphPropertiesXml && (r.paragraphProperties = {
|
|
10253
10288
|
xml: t.paragraphPropertiesXml,
|
|
10254
|
-
semanticSignature:
|
|
10289
|
+
semanticSignature: Zr(e)
|
|
10255
10290
|
}), (r.xml || r.attributes || r.paragraphProperties) && (e.ooxmlSource = r);
|
|
10256
10291
|
}(s, i), s;
|
|
10257
10292
|
}
|
|
10258
|
-
function
|
|
10293
|
+
function un(e) {
|
|
10259
10294
|
return e.some((e) => e.image || e.textBox || e.field || e.fieldChar || void 0 !== e.fieldInstruction || e.bookmark || e.comment || e.revisionRangeMarker || e.text.replace(/\s/g, "").length > 0);
|
|
10260
10295
|
}
|
|
10261
|
-
async function
|
|
10262
|
-
const l = Re(e, Ne, "pPr"), c = await
|
|
10296
|
+
async function dn(e, t, r, n, o, i, a, s) {
|
|
10297
|
+
const l = Re(e, Ne, "pPr"), c = await Pr(e, t, r, n, o, i, void 0, a), u = jt(qt(l, i.colors)), d = _t(Re(l, Ne, "rPr"), i), p = function(e, t) {
|
|
10263
10298
|
if (!e) return;
|
|
10264
10299
|
const r = Re(e, Ne, "numPr");
|
|
10265
10300
|
if (!r) return;
|
|
@@ -10366,29 +10401,29 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10366
10401
|
};
|
|
10367
10402
|
}(c);
|
|
10368
10403
|
if (!v) return {
|
|
10369
|
-
paragraphs: [
|
|
10404
|
+
paragraphs: [cn(c, g, f, h, d, sn(e, l, c))],
|
|
10370
10405
|
pageBreakAfter: !1
|
|
10371
10406
|
};
|
|
10372
10407
|
const y = [];
|
|
10373
10408
|
let x = !1;
|
|
10374
10409
|
for (let S = 0; S < b.length; S += 1) {
|
|
10375
10410
|
const e = b[S];
|
|
10376
|
-
if (S > 0 && (x = !0), !
|
|
10411
|
+
if (S > 0 && (x = !0), !un(e)) continue;
|
|
10377
10412
|
const t = x ? {
|
|
10378
10413
|
...g ?? {},
|
|
10379
10414
|
pageBreakBefore: !0
|
|
10380
10415
|
} : g;
|
|
10381
|
-
y.push(
|
|
10416
|
+
y.push(cn(e, t, f, h, d)), x = !1;
|
|
10382
10417
|
}
|
|
10383
10418
|
return {
|
|
10384
10419
|
paragraphs: y,
|
|
10385
10420
|
pageBreakAfter: x
|
|
10386
10421
|
};
|
|
10387
10422
|
}
|
|
10388
|
-
async function
|
|
10389
|
-
return (await
|
|
10423
|
+
async function pn(e, t, r, n, o, i, a, s) {
|
|
10424
|
+
return (await dn(e, t, r, n, o, i, a, s)).paragraphs[0] ?? E([{ text: "" }]);
|
|
10390
10425
|
}
|
|
10391
|
-
function
|
|
10426
|
+
function fn(e, t, r, n) {
|
|
10392
10427
|
for (const o of Se(e)) {
|
|
10393
10428
|
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== o.namespaceURI) continue;
|
|
10394
10429
|
if (o.localName === t) {
|
|
@@ -10403,17 +10438,17 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10403
10438
|
if (!e) continue;
|
|
10404
10439
|
const i = Re(o, Ne, "sdtPr"), a = Re(o, Ne, "sdtEndPr"), s = {
|
|
10405
10440
|
groupId: v("sdt"),
|
|
10406
|
-
sdtPr:
|
|
10441
|
+
sdtPr: lr(i),
|
|
10407
10442
|
...a ? { sdtEndPrXml: new b.XMLSerializer().serializeToString(a) } : {}
|
|
10408
10443
|
};
|
|
10409
|
-
|
|
10444
|
+
fn(e, t, [...r, s], n);
|
|
10410
10445
|
}
|
|
10411
10446
|
}
|
|
10412
|
-
function
|
|
10447
|
+
function hn(e, t) {
|
|
10413
10448
|
const r = [];
|
|
10414
|
-
return
|
|
10449
|
+
return fn(e, t, [], r), r;
|
|
10415
10450
|
}
|
|
10416
|
-
function
|
|
10451
|
+
function mn(e, t) {
|
|
10417
10452
|
if (!t.every((e) => "paragraph" === e.type)) return;
|
|
10418
10453
|
const r = Ie(e, Ne, "p");
|
|
10419
10454
|
r.length === t.length && function(e, t) {
|
|
@@ -10435,7 +10470,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10435
10470
|
};
|
|
10436
10471
|
}(Re(e, Ne, "pPr"))));
|
|
10437
10472
|
}
|
|
10438
|
-
function
|
|
10473
|
+
function gn(e) {
|
|
10439
10474
|
const t = e.style?.revision, r = "merge" === t?.type ? t.previous?.vMerge : void 0;
|
|
10440
10475
|
if (!t || "merge" !== t.type || !r) return;
|
|
10441
10476
|
const n = e.style ? {
|
|
@@ -10456,7 +10491,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10456
10491
|
previousCells: [o]
|
|
10457
10492
|
};
|
|
10458
10493
|
}
|
|
10459
|
-
async function
|
|
10494
|
+
async function wn(e, t, r, n, o, i, a, s) {
|
|
10460
10495
|
const l = [], c = Re(e, Ne, "tblGrid");
|
|
10461
10496
|
if (c) for (const b of Ie(c, Ne, "gridCol")) {
|
|
10462
10497
|
const e = Ke(Pe(b, "w"));
|
|
@@ -10475,12 +10510,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10475
10510
|
noHBand: r("noHBand") ?? i(512) ?? !1,
|
|
10476
10511
|
noVBand: r("noVBand") ?? i(1024) ?? !1
|
|
10477
10512
|
};
|
|
10478
|
-
}(d), m =
|
|
10513
|
+
}(d), m = hn(e, "tr"), g = [];
|
|
10479
10514
|
for (let v = 0; v < m.length; v += 1) {
|
|
10480
|
-
const e = m[v], t = e.element, r = Re(t, Ne, "trPr"), n = Rt(r), o =
|
|
10515
|
+
const e = m[v], t = e.element, r = Re(t, Ne, "trPr"), n = Rt(r), o = hn(t, "tc"), s = [];
|
|
10481
10516
|
for (let p = 0; p < o.length; p += 1) {
|
|
10482
10517
|
const e = o[p], t = e.element, r = Re(t, Ne, "tcPr"), n = await a(t);
|
|
10483
|
-
|
|
10518
|
+
mn(t, n);
|
|
10484
10519
|
const l = Lt(r);
|
|
10485
10520
|
if ("continue" === Bt(r) && s.length > 0) {
|
|
10486
10521
|
const e = s[s.length - 1];
|
|
@@ -10493,7 +10528,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10493
10528
|
} : c ? { vMerge: c } : void 0);
|
|
10494
10529
|
u && (d.style = u), d.conditionalStyle = Rt(r), e.sdtWrappers?.length && (d.sdtWrappers = [...e.sdtWrappers]);
|
|
10495
10530
|
const f = Oe(t);
|
|
10496
|
-
f && (d.extAttributes = f),
|
|
10531
|
+
f && (d.extAttributes = f), gn(d), "continue" === c && (d.blocks = []), s.push(d);
|
|
10497
10532
|
}
|
|
10498
10533
|
const l = _(s, zt(t) ? { isHeader: !0 } : void 0), c = Ot(r);
|
|
10499
10534
|
c && (l.style = c), l.conditionalStyle = n, e.sdtWrappers?.length && (l.sdtWrappers = [...e.sdtWrappers]);
|
|
@@ -10547,69 +10582,69 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10547
10582
|
let r = "string" == typeof t ? { xml: t } : t;
|
|
10548
10583
|
if ("string" == typeof t) {
|
|
10549
10584
|
const n = new b.DOMParser().parseFromString(t, "application/xml").documentElement;
|
|
10550
|
-
n?.namespaceURI ===
|
|
10585
|
+
n?.namespaceURI === Mr && "tbl" === n.localName && (r = {
|
|
10551
10586
|
...r,
|
|
10552
|
-
...
|
|
10587
|
+
...on(e, n)
|
|
10553
10588
|
});
|
|
10554
10589
|
}
|
|
10555
10590
|
const n = {
|
|
10556
10591
|
xml: r.xml,
|
|
10557
|
-
semanticSignature:
|
|
10592
|
+
semanticSignature: Qr(e)
|
|
10558
10593
|
};
|
|
10559
10594
|
r.tablePropertiesXml && (n.tableProperties = {
|
|
10560
10595
|
xml: r.tablePropertiesXml,
|
|
10561
|
-
semanticSignature:
|
|
10596
|
+
semanticSignature: Kr(e)
|
|
10562
10597
|
}), r.tableGridXml && (n.tableGrid = {
|
|
10563
10598
|
xml: r.tableGridXml,
|
|
10564
|
-
semanticSignature:
|
|
10599
|
+
semanticSignature: Jr(e)
|
|
10565
10600
|
}), e.ooxmlSource = n;
|
|
10566
10601
|
}(w, new b.XMLSerializer().serializeToString(e)), w;
|
|
10567
10602
|
}
|
|
10568
|
-
async function
|
|
10569
|
-
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI ? [] : "p" === e.localName ? (await
|
|
10603
|
+
async function bn(e, t, r, n, o, i, a) {
|
|
10604
|
+
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI ? [] : "p" === e.localName ? (await dn(e, t, r, n, o, i, a)).paragraphs : "tbl" === e.localName ? [await wn(e, 0, 0, 0, 0, i, a)] : "sdt" === e.localName ? vn(e, t, r, n, o, i, a) : [];
|
|
10570
10605
|
}
|
|
10571
|
-
async function
|
|
10606
|
+
async function vn(e, t, r, n, o, i, a) {
|
|
10572
10607
|
const s = Re(e, Ne, "sdtPr"), l = Re(e, Ne, "sdtEndPr"), c = {
|
|
10573
10608
|
groupId: v("sdt"),
|
|
10574
|
-
sdtPr:
|
|
10609
|
+
sdtPr: lr(s),
|
|
10575
10610
|
...l ? { sdtEndPrXml: new b.XMLSerializer().serializeToString(l) } : {}
|
|
10576
10611
|
}, u = Re(e, Ne, "sdtContent"), d = [];
|
|
10577
10612
|
if (u) for (let p = 0; p < u.childNodes.length; p += 1) {
|
|
10578
10613
|
const e = u.childNodes[p];
|
|
10579
|
-
e?.nodeType === e.ELEMENT_NODE && d.push(...await
|
|
10614
|
+
e?.nodeType === e.ELEMENT_NODE && d.push(...await bn(e, t, r, n, o, i, a));
|
|
10580
10615
|
}
|
|
10581
10616
|
for (const p of d) p.sdtWrappers = [c, ...p.sdtWrappers ?? []];
|
|
10582
10617
|
return d;
|
|
10583
10618
|
}
|
|
10584
|
-
function
|
|
10619
|
+
function yn(e, t, r, n, o) {
|
|
10585
10620
|
return (i) => async function(e, t, r, n, o, i) {
|
|
10586
|
-
const a =
|
|
10621
|
+
const a = yn(t, r, n, o, i), s = [];
|
|
10587
10622
|
for (let l = 0; l < e.childNodes.length; l += 1) {
|
|
10588
10623
|
const c = e.childNodes[l];
|
|
10589
|
-
c?.nodeType === c.ELEMENT_NODE && s.push(...await
|
|
10624
|
+
c?.nodeType === c.ELEMENT_NODE && s.push(...await bn(c, t, r, n, o, i, a));
|
|
10590
10625
|
}
|
|
10591
10626
|
return s;
|
|
10592
10627
|
}(i, e, t, r, n, o);
|
|
10593
10628
|
}
|
|
10594
|
-
async function
|
|
10629
|
+
async function xn(e, t, r, n, o, i, a) {
|
|
10595
10630
|
if (!e) return [];
|
|
10596
10631
|
const s = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
10597
10632
|
if (!s) return [];
|
|
10598
|
-
const l =
|
|
10633
|
+
const l = yn(t, r, n, o, i), c = [];
|
|
10599
10634
|
for (let u = 0; u < s.childNodes.length; u += 1) {
|
|
10600
10635
|
const e = s.childNodes[u];
|
|
10601
10636
|
if (e?.nodeType !== e.ELEMENT_NODE) continue;
|
|
10602
10637
|
const a = e;
|
|
10603
|
-
"p" === a.localName && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === a.namespaceURI ? c.push(await
|
|
10638
|
+
"p" === a.localName && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === a.namespaceURI ? c.push(await pn(a, t, r, n, o, i, l)) : "tbl" === a.localName && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === a.namespaceURI && c.push(await wn(a, 0, 0, 0, 0, i, l));
|
|
10604
10639
|
}
|
|
10605
10640
|
return c;
|
|
10606
10641
|
}
|
|
10607
|
-
const
|
|
10642
|
+
const Sn = /* @__PURE__ */ new Set([
|
|
10608
10643
|
"separator",
|
|
10609
10644
|
"continuationSeparator",
|
|
10610
10645
|
"continuationNotice"
|
|
10611
10646
|
]);
|
|
10612
|
-
async function
|
|
10647
|
+
async function Nn(e, t, r, n, o, i, a, s) {
|
|
10613
10648
|
const l = {
|
|
10614
10649
|
byDocxId: /* @__PURE__ */ new Map(),
|
|
10615
10650
|
notes: { items: {} }
|
|
@@ -10621,16 +10656,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10621
10656
|
let p, f;
|
|
10622
10657
|
const h = Ie(c, Ne, e);
|
|
10623
10658
|
let m = 0;
|
|
10624
|
-
const g =
|
|
10659
|
+
const g = yn(r, n, o, i, a);
|
|
10625
10660
|
for (const w of h) {
|
|
10626
10661
|
const t = Pe(w, "id") ?? "", s = Pe(w, "type") ?? "", l = [];
|
|
10627
10662
|
for (let e = 0; e < w.childNodes.length; e += 1) {
|
|
10628
10663
|
const t = w.childNodes[e];
|
|
10629
10664
|
if (t?.nodeType !== t.ELEMENT_NODE) continue;
|
|
10630
10665
|
const s = t;
|
|
10631
|
-
"http://schemas.openxmlformats.org/wordprocessingml/2006/main" === s.namespaceURI && ("p" === s.localName ? l.push(await
|
|
10666
|
+
"http://schemas.openxmlformats.org/wordprocessingml/2006/main" === s.namespaceURI && ("p" === s.localName ? l.push(await pn(s, r, n, o, i, a, g)) : "tbl" === s.localName && l.push(await wn(s, 0, 0, 0, 0, a, g)));
|
|
10632
10667
|
}
|
|
10633
|
-
if (
|
|
10668
|
+
if (Sn.has(s)) {
|
|
10634
10669
|
"separator" === s ? p = l : "continuationSeparator" === s && (f = l);
|
|
10635
10670
|
continue;
|
|
10636
10671
|
}
|
|
@@ -10654,7 +10689,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10654
10689
|
continuationSeparator: f
|
|
10655
10690
|
};
|
|
10656
10691
|
}
|
|
10657
|
-
function*
|
|
10692
|
+
function* En(e, t) {
|
|
10658
10693
|
const r = se(e);
|
|
10659
10694
|
for (const n of r) {
|
|
10660
10695
|
const e = [
|
|
@@ -10672,7 +10707,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10672
10707
|
});
|
|
10673
10708
|
}
|
|
10674
10709
|
}
|
|
10675
|
-
function
|
|
10710
|
+
function kn(e, t, r) {
|
|
10676
10711
|
if (!e) return {
|
|
10677
10712
|
blocks: e,
|
|
10678
10713
|
changed: !1
|
|
@@ -10704,7 +10739,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10704
10739
|
const i = e.rows.map((e) => {
|
|
10705
10740
|
let n = !1;
|
|
10706
10741
|
const i = e.cells.map((e) => {
|
|
10707
|
-
const o =
|
|
10742
|
+
const o = kn(e.blocks, t, r);
|
|
10708
10743
|
return o.changed && o.blocks ? (n = !0, {
|
|
10709
10744
|
...e,
|
|
10710
10745
|
blocks: o.blocks
|
|
@@ -10728,16 +10763,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10728
10763
|
changed: n
|
|
10729
10764
|
};
|
|
10730
10765
|
}
|
|
10731
|
-
function
|
|
10766
|
+
function _n(e, t, r) {
|
|
10732
10767
|
const n = t.settings?.numberFormat ?? "decimal", o = t.settings?.startAt ?? 1, i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
|
|
10733
10768
|
let s = o - 1;
|
|
10734
|
-
for (const { run: p } of
|
|
10769
|
+
for (const { run: p } of En(e, r.runKind)) {
|
|
10735
10770
|
const e = r.getRef(p);
|
|
10736
10771
|
e && (i.add(e.id), e.customMark ? a.set(e.id, e.customMark) : a.has(e.id) || (s += 1, a.set(e.id, r.formatMarker(s, n))));
|
|
10737
10772
|
}
|
|
10738
10773
|
let l = !1;
|
|
10739
10774
|
const c = se(e).map((e) => {
|
|
10740
|
-
const t =
|
|
10775
|
+
const t = kn(e.blocks, r, a), n = kn(e.header, r, a), o = kn(e.firstPageHeader, r, a), i = kn(e.evenPageHeader, r, a), s = kn(e.footer, r, a), c = kn(e.firstPageFooter, r, a), u = kn(e.evenPageFooter, r, a);
|
|
10741
10776
|
return t.changed || n.changed || o.changed || i.changed || s.changed || c.changed || u.changed ? (l = !0, {
|
|
10742
10777
|
...e,
|
|
10743
10778
|
blocks: t.blocks ?? e.blocks,
|
|
@@ -10758,7 +10793,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10758
10793
|
itemsChanged: d
|
|
10759
10794
|
};
|
|
10760
10795
|
}
|
|
10761
|
-
const
|
|
10796
|
+
const Tn = [
|
|
10762
10797
|
[1e3, "m"],
|
|
10763
10798
|
[900, "cm"],
|
|
10764
10799
|
[500, "d"],
|
|
@@ -10773,19 +10808,19 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10773
10808
|
[4, "iv"],
|
|
10774
10809
|
[1, "i"]
|
|
10775
10810
|
];
|
|
10776
|
-
function
|
|
10811
|
+
function In(e) {
|
|
10777
10812
|
if (e <= 0) return String(e);
|
|
10778
10813
|
let t = e, r = "";
|
|
10779
|
-
for (const [n, o] of
|
|
10814
|
+
for (const [n, o] of Tn) for (; t >= n;) r += o, t -= n;
|
|
10780
10815
|
return r;
|
|
10781
10816
|
}
|
|
10782
|
-
function
|
|
10817
|
+
function Cn(e) {
|
|
10783
10818
|
if (e <= 0) return String(e);
|
|
10784
10819
|
let t = e, r = "";
|
|
10785
10820
|
for (; t > 0;) r = "abcdefghijklmnopqrstuvwxyz"[(t - 1) % 26] + r, t = Math.floor((t - 1) / 26);
|
|
10786
10821
|
return r;
|
|
10787
10822
|
}
|
|
10788
|
-
const
|
|
10823
|
+
const An = [
|
|
10789
10824
|
"*",
|
|
10790
10825
|
"†",
|
|
10791
10826
|
"‡",
|
|
@@ -10793,20 +10828,20 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10793
10828
|
"¶",
|
|
10794
10829
|
"#"
|
|
10795
10830
|
];
|
|
10796
|
-
function
|
|
10831
|
+
function Rn(e, t = "decimal") {
|
|
10797
10832
|
switch (t) {
|
|
10798
|
-
case "lowerRoman": return
|
|
10799
|
-
case "upperRoman": return
|
|
10800
|
-
case "lowerLetter": return
|
|
10801
|
-
case "upperLetter": return
|
|
10833
|
+
case "lowerRoman": return In(e);
|
|
10834
|
+
case "upperRoman": return In(e).toUpperCase();
|
|
10835
|
+
case "lowerLetter": return Cn(e);
|
|
10836
|
+
case "upperLetter": return Cn(e).toUpperCase();
|
|
10802
10837
|
case "symbol": {
|
|
10803
|
-
const t = (e - 1) %
|
|
10804
|
-
return
|
|
10838
|
+
const t = (e - 1) % An.length, r = Math.floor((e - 1) / An.length) + 1;
|
|
10839
|
+
return An[t].repeat(r);
|
|
10805
10840
|
}
|
|
10806
10841
|
default: return String(e);
|
|
10807
10842
|
}
|
|
10808
10843
|
}
|
|
10809
|
-
const
|
|
10844
|
+
const $n = {
|
|
10810
10845
|
runKind: "footnoteReference",
|
|
10811
10846
|
getRef: (e) => {
|
|
10812
10847
|
const t = B(e);
|
|
@@ -10815,9 +10850,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10815
10850
|
customMark: t.customMark
|
|
10816
10851
|
} : void 0;
|
|
10817
10852
|
},
|
|
10818
|
-
formatMarker:
|
|
10853
|
+
formatMarker: Rn
|
|
10819
10854
|
};
|
|
10820
|
-
const
|
|
10855
|
+
const Dn = {
|
|
10821
10856
|
runKind: "endnoteReference",
|
|
10822
10857
|
getRef: (e) => {
|
|
10823
10858
|
const t = U(e);
|
|
@@ -10826,10 +10861,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10826
10861
|
customMark: t.customMark
|
|
10827
10862
|
} : void 0;
|
|
10828
10863
|
},
|
|
10829
|
-
formatMarker:
|
|
10864
|
+
formatMarker: Rn
|
|
10830
10865
|
};
|
|
10831
|
-
const
|
|
10832
|
-
function
|
|
10866
|
+
const Pn = /* @__PURE__ */ new Set(["_GoBack"]);
|
|
10867
|
+
function Mn(e, t, r) {
|
|
10833
10868
|
if ("paragraph" === e.type) {
|
|
10834
10869
|
let n = 0;
|
|
10835
10870
|
const o = [];
|
|
@@ -10847,11 +10882,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10847
10882
|
o.length !== e.runs.length && (e.runs = o.length > 0 ? o : [S("")]);
|
|
10848
10883
|
return;
|
|
10849
10884
|
}
|
|
10850
|
-
for (const n of e.rows) for (const e of n.cells) for (const n of e.blocks)
|
|
10885
|
+
for (const n of e.rows) for (const e of n.cells) for (const n of e.blocks) Mn(n, t, r);
|
|
10851
10886
|
}
|
|
10852
|
-
function
|
|
10887
|
+
function On(e) {
|
|
10853
10888
|
const t = [], r = { value: 0 }, n = (e) => {
|
|
10854
|
-
e?.forEach((e) =>
|
|
10889
|
+
e?.forEach((e) => Mn(e, t, r));
|
|
10855
10890
|
};
|
|
10856
10891
|
for (const c of e) n(c.blocks), n(c.header), n(c.firstPageHeader), n(c.evenPageHeader), n(c.footer), n(c.firstPageFooter), n(c.evenPageFooter);
|
|
10857
10892
|
if (0 === t.length) return;
|
|
@@ -10863,7 +10898,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10863
10898
|
const a = {}, s = [], l = t.filter((e) => "start" === e.marker.kind);
|
|
10864
10899
|
for (const c of l) {
|
|
10865
10900
|
const { marker: e, anchor: t } = c, r = e.name;
|
|
10866
|
-
if (!r ||
|
|
10901
|
+
if (!r || Pn.has(r)) continue;
|
|
10867
10902
|
const n = Number.parseInt(e.docxId, 10), o = i.get(e.docxId)?.shift(), l = y(), u = {
|
|
10868
10903
|
id: l,
|
|
10869
10904
|
name: r,
|
|
@@ -10876,7 +10911,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10876
10911
|
order: s
|
|
10877
10912
|
} : void 0;
|
|
10878
10913
|
}
|
|
10879
|
-
function
|
|
10914
|
+
function Ln(e, t, r) {
|
|
10880
10915
|
if ("paragraph" === e.type) {
|
|
10881
10916
|
let n = 0;
|
|
10882
10917
|
const o = [];
|
|
@@ -10894,11 +10929,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10894
10929
|
o.length !== e.runs.length && (e.runs = o.length > 0 ? o : [S("")]);
|
|
10895
10930
|
return;
|
|
10896
10931
|
}
|
|
10897
|
-
for (const n of e.rows) for (const e of n.cells) for (const n of e.blocks)
|
|
10932
|
+
for (const n of e.rows) for (const e of n.cells) for (const n of e.blocks) Ln(n, t, r);
|
|
10898
10933
|
}
|
|
10899
|
-
function
|
|
10934
|
+
function Fn(e) {
|
|
10900
10935
|
const t = [], r = { value: 0 }, n = (e) => {
|
|
10901
|
-
e?.forEach((e) =>
|
|
10936
|
+
e?.forEach((e) => Ln(e, t, r));
|
|
10902
10937
|
};
|
|
10903
10938
|
for (const i of e) n(i.blocks), n(i.header), n(i.firstPageHeader), n(i.evenPageHeader), n(i.footer), n(i.firstPageFooter), n(i.evenPageFooter);
|
|
10904
10939
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -10908,8 +10943,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10908
10943
|
}
|
|
10909
10944
|
return o;
|
|
10910
10945
|
}
|
|
10911
|
-
const
|
|
10912
|
-
function
|
|
10946
|
+
const Bn = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
10947
|
+
function Un(e) {
|
|
10913
10948
|
let t = "";
|
|
10914
10949
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
10915
10950
|
const n = e.childNodes[r];
|
|
@@ -10929,16 +10964,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10929
10964
|
continue;
|
|
10930
10965
|
}
|
|
10931
10966
|
}
|
|
10932
|
-
t +=
|
|
10967
|
+
t += Un(o);
|
|
10933
10968
|
}
|
|
10934
10969
|
return t;
|
|
10935
10970
|
}
|
|
10936
|
-
function
|
|
10971
|
+
function zn(e) {
|
|
10937
10972
|
if (!e) return;
|
|
10938
10973
|
const t = Date.parse(e);
|
|
10939
10974
|
return Number.isNaN(t) ? void 0 : t;
|
|
10940
10975
|
}
|
|
10941
|
-
function
|
|
10976
|
+
function Hn(e, t) {
|
|
10942
10977
|
const r = /* @__PURE__ */ new Map();
|
|
10943
10978
|
if (!e) return r;
|
|
10944
10979
|
const n = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
@@ -10948,10 +10983,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10948
10983
|
if (!e) return t;
|
|
10949
10984
|
const r = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
10950
10985
|
if (!r) return t;
|
|
10951
|
-
for (const n of Ie(r,
|
|
10952
|
-
const e = n.getAttributeNS(
|
|
10986
|
+
for (const n of Ie(r, Bn, "commentEx")) {
|
|
10987
|
+
const e = n.getAttributeNS(Bn, "paraId");
|
|
10953
10988
|
if (!e) continue;
|
|
10954
|
-
const r = n.getAttributeNS(
|
|
10989
|
+
const r = n.getAttributeNS(Bn, "done"), o = n.getAttributeNS(Bn, "paraIdParent") || void 0;
|
|
10955
10990
|
t.set(e, {
|
|
10956
10991
|
resolved: "1" === r || "true" === r,
|
|
10957
10992
|
...o ? { parentParaId: o } : {}
|
|
@@ -10962,7 +10997,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10962
10997
|
for (const i of Ie(n, Ne, "comment")) {
|
|
10963
10998
|
const e = Pe(i, "id");
|
|
10964
10999
|
if (null === e) continue;
|
|
10965
|
-
const t = Pe(i, "author") ?? "", n = Pe(i, "initials") ?? void 0, a =
|
|
11000
|
+
const t = Pe(i, "author") ?? "", n = Pe(i, "initials") ?? void 0, a = zn(Pe(i, "date")), s = zn(i.getAttributeNS("http://schemas.microsoft.com/office/word/2023/wordml/word16du", "dateUtc")), l = Ie(i, Ne, "p"), c = l.map((e) => Un(e)).join("\n").trim(), u = l.length > 0 ? Pe(l[0], "paraId") ?? void 0 : void 0, d = void 0 !== u ? o.get(u) : void 0;
|
|
10966
11001
|
r.set(e, {
|
|
10967
11002
|
author: t,
|
|
10968
11003
|
...n ? { initials: n } : {},
|
|
@@ -10976,7 +11011,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
10976
11011
|
}
|
|
10977
11012
|
return r;
|
|
10978
11013
|
}
|
|
10979
|
-
async function
|
|
11014
|
+
async function jn(e, t = {}) {
|
|
10980
11015
|
t.onProgress?.("opening-docx");
|
|
10981
11016
|
const r = await w.default.loadAsync(e), n = await r.file("word/document.xml")?.async("string");
|
|
10982
11017
|
if (!n) throw new Error("Missing word/document.xml");
|
|
@@ -11168,7 +11203,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11168
11203
|
let C = 0;
|
|
11169
11204
|
const A = () => {
|
|
11170
11205
|
C += 1, I > 0 && t.onProgress?.("parsing-document", C / I);
|
|
11171
|
-
}, R =
|
|
11206
|
+
}, R = yn(i, r, o, v, d);
|
|
11172
11207
|
for (let w = 0; w < g.childNodes.length; w += 1) {
|
|
11173
11208
|
const e = g.childNodes[w];
|
|
11174
11209
|
if (e?.nodeType !== e.ELEMENT_NODE) continue;
|
|
@@ -11176,14 +11211,14 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11176
11211
|
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t.namespaceURI) {
|
|
11177
11212
|
if ("sectPr" === t.localName) S.push(Xt(t)), N.push([]), k = !1;
|
|
11178
11213
|
else if ("p" === t.localName) {
|
|
11179
|
-
const e = await
|
|
11214
|
+
const e = await dn(t, i, r, o, v, d, R);
|
|
11180
11215
|
for (const t of e.paragraphs) T(t);
|
|
11181
11216
|
e.dropCapFrame && (_ = e.dropCapFrame), e.pageBreakAfter && (k = !0);
|
|
11182
11217
|
const n = Re(t, Ne, "pPr"), a = n ? Re(n, Ne, "sectPr") : null;
|
|
11183
11218
|
a && (S.push(Xt(a)), N.push([]), k = !1), A();
|
|
11184
|
-
} else if ("tbl" === t.localName) T(await
|
|
11219
|
+
} else if ("tbl" === t.localName) T(await wn(t, 0, 0, 0, 0, d, R)), A();
|
|
11185
11220
|
else if ("sdt" === t.localName) {
|
|
11186
|
-
for (const e of await
|
|
11221
|
+
for (const e of await vn(t, i, r, o, v, d, R)) T(e);
|
|
11187
11222
|
A();
|
|
11188
11223
|
}
|
|
11189
11224
|
await Ue(50, C);
|
|
@@ -11236,7 +11271,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11236
11271
|
}
|
|
11237
11272
|
}
|
|
11238
11273
|
}
|
|
11239
|
-
const u = await
|
|
11274
|
+
const u = await xn(l ?? null, i, r, c, v, d);
|
|
11240
11275
|
return Yt(u, e.docGridLinePitchPx, e.docGridMode, e.docGridType, a), u;
|
|
11241
11276
|
}, s = await n(e.headerRIds.default), l = await n(e.headerRIds.first), c = await n(e.headerRIds.even), u = await n(e.footerRIds.default), p = await n(e.footerRIds.first), f = await n(e.footerRIds.even);
|
|
11242
11277
|
D(e) && O(), await Ue(2, M);
|
|
@@ -11279,7 +11314,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11279
11314
|
});
|
|
11280
11315
|
}
|
|
11281
11316
|
const L = await r.file("word/footnotes.xml")?.async("string") ?? null, B = await async function(e, t, r, n, o, i) {
|
|
11282
|
-
const a = await
|
|
11317
|
+
const a = await Nn("footnote", e, t, r, n, o, i);
|
|
11283
11318
|
return {
|
|
11284
11319
|
byDocxId: a.byDocxId,
|
|
11285
11320
|
footnotes: a.notes,
|
|
@@ -11310,10 +11345,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11310
11345
|
});
|
|
11311
11346
|
});
|
|
11312
11347
|
};
|
|
11313
|
-
|
|
11348
|
+
qn(e, r);
|
|
11314
11349
|
})($, B.byDocxId);
|
|
11315
11350
|
const z = await r.file("word/endnotes.xml")?.async("string") ?? null, j = await async function(e, t, r, n, o, i) {
|
|
11316
|
-
const a = await
|
|
11351
|
+
const a = await Nn("endnote", e, t, r, n, o, i);
|
|
11317
11352
|
return {
|
|
11318
11353
|
byDocxId: a.byDocxId,
|
|
11319
11354
|
endnotes: a.notes,
|
|
@@ -11344,9 +11379,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11344
11379
|
});
|
|
11345
11380
|
});
|
|
11346
11381
|
};
|
|
11347
|
-
|
|
11382
|
+
qn(e, r);
|
|
11348
11383
|
})($, j.byDocxId);
|
|
11349
|
-
const W =
|
|
11384
|
+
const W = On($), G = function(e, t) {
|
|
11350
11385
|
const r = /* @__PURE__ */ new Set([...e.keys(), ...t.keys()]);
|
|
11351
11386
|
if (0 === r.size) return;
|
|
11352
11387
|
const n = [...r].sort((e, t) => {
|
|
@@ -11382,7 +11417,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11382
11417
|
items: a,
|
|
11383
11418
|
order: s
|
|
11384
11419
|
} : void 0;
|
|
11385
|
-
}(
|
|
11420
|
+
}(Fn($), Hn(await r.file("word/comments.xml")?.async("string") ?? null, await r.file("word/commentsExtended.xml")?.async("string") ?? null)), V = $.length > 1 || $.some((e) => (e.header?.length ?? 0) > 0 || (e.firstPageHeader?.length ?? 0) > 0 || (e.evenPageHeader?.length ?? 0) > 0 || (e.footer?.length ?? 0) > 0 || (e.firstPageFooter?.length ?? 0) > 0 || (e.evenPageFooter?.length ?? 0) > 0 || void 0 !== e.breakType || void 0 !== e.pageNumbering || void 0 !== e.verticalAlignment || void 0 !== e.bidi || void 0 !== e.pageBorder), X = Object.keys(v.assets).length > 0, Y = (e) => {
|
|
11386
11421
|
if (u) {
|
|
11387
11422
|
const t = d.data?.name?.toLowerCase() ?? "", r = [
|
|
11388
11423
|
"oasis",
|
|
@@ -11414,7 +11449,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11414
11449
|
return U && (r.footnotes = U, r = function(e) {
|
|
11415
11450
|
const t = e.footnotes;
|
|
11416
11451
|
if (!t || 0 === Object.keys(t.items).length) return e;
|
|
11417
|
-
const { sections: r, sectionsChanged: n, nextItems: o, itemsChanged: i } =
|
|
11452
|
+
const { sections: r, sectionsChanged: n, nextItems: o, itemsChanged: i } = _n(e, t, $n);
|
|
11418
11453
|
return n || i ? {
|
|
11419
11454
|
...e,
|
|
11420
11455
|
sections: n ? r : e.sections,
|
|
@@ -11426,7 +11461,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11426
11461
|
}(r)), q && (r.endnotes = q, r = function(e) {
|
|
11427
11462
|
const t = e.endnotes;
|
|
11428
11463
|
if (!t || 0 === Object.keys(t.items).length) return e;
|
|
11429
|
-
const { sections: r, sectionsChanged: n, nextItems: o, itemsChanged: i } =
|
|
11464
|
+
const { sections: r, sectionsChanged: n, nextItems: o, itemsChanged: i } = _n(e, t, Dn);
|
|
11430
11465
|
return n || i ? {
|
|
11431
11466
|
...e,
|
|
11432
11467
|
sections: n ? r : e.sections,
|
|
@@ -11444,21 +11479,21 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11444
11479
|
const Q = $[0], K = de(Q?.blocks.length > 0 ? Q.blocks : [E([{ text: "" }])], Q?.pageSettings);
|
|
11445
11480
|
return X && (K.assets = v.assets), p && (K.styles = p), Y(K);
|
|
11446
11481
|
}
|
|
11447
|
-
function
|
|
11482
|
+
function qn(e, t) {
|
|
11448
11483
|
for (const r of e) r.blocks.forEach(t), r.header?.forEach(t), r.firstPageHeader?.forEach(t), r.evenPageHeader?.forEach(t), r.footer?.forEach(t), r.firstPageFooter?.forEach(t), r.evenPageFooter?.forEach(t);
|
|
11449
11484
|
}
|
|
11450
|
-
function
|
|
11485
|
+
function Wn(e) {
|
|
11451
11486
|
return e.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
11452
11487
|
}
|
|
11453
|
-
function
|
|
11488
|
+
function Gn(e) {
|
|
11454
11489
|
return e.replaceAll("\\", "/").replace(/^\/+/, "");
|
|
11455
11490
|
}
|
|
11456
|
-
function
|
|
11491
|
+
function Vn(e) {
|
|
11457
11492
|
if ("_rels/.rels" === e) return null;
|
|
11458
11493
|
const t = e.lastIndexOf("/_rels/");
|
|
11459
11494
|
return t >= 0 && e.endsWith(".rels") ? `${e.slice(0, t)}/${e.slice(t + 7).slice(0, -5)}` : e.startsWith("_rels/") && e.endsWith(".rels") ? e.slice(6, -5) : void 0;
|
|
11460
11495
|
}
|
|
11461
|
-
function
|
|
11496
|
+
function Xn(e) {
|
|
11462
11497
|
if (!e) return [];
|
|
11463
11498
|
const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
11464
11499
|
if (!t) return [];
|
|
@@ -11480,13 +11515,13 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11480
11515
|
}
|
|
11481
11516
|
return r;
|
|
11482
11517
|
}
|
|
11483
|
-
function
|
|
11518
|
+
function Zn(e) {
|
|
11484
11519
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${e.map((e) => {
|
|
11485
11520
|
const t = "External" === e.targetMode ? " TargetMode=\"External\"" : "";
|
|
11486
|
-
return `<Relationship Id="${
|
|
11521
|
+
return `<Relationship Id="${Wn(e.id)}" Type="${Wn(e.type)}" Target="${Wn(e.target)}"${t}/>`;
|
|
11487
11522
|
}).join("")}</Relationships>`;
|
|
11488
11523
|
}
|
|
11489
|
-
function
|
|
11524
|
+
function Yn(e, t, r) {
|
|
11490
11525
|
return t.map((t) => {
|
|
11491
11526
|
if ("External" === t.targetMode) return {
|
|
11492
11527
|
...t,
|
|
@@ -11507,64 +11542,64 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11507
11542
|
} : (r?.(t), t);
|
|
11508
11543
|
});
|
|
11509
11544
|
}
|
|
11510
|
-
const
|
|
11511
|
-
function
|
|
11545
|
+
const Qn = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Kn = "http://schemas.openxmlformats.org/package/2006/relationships", Jn = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", eo = "http://schemas.microsoft.com/office/word/2010/wordml";
|
|
11546
|
+
function to(e) {
|
|
11512
11547
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
11513
11548
|
}
|
|
11514
|
-
function
|
|
11549
|
+
function ro(e, t) {
|
|
11515
11550
|
return Number.isFinite(e) ? Math.max(0, Math.round(e / 96 * A)) : t;
|
|
11516
11551
|
}
|
|
11517
|
-
function
|
|
11552
|
+
function no(e) {
|
|
11518
11553
|
return null != e && Number.isFinite(e) ? Math.round(e / 96 * A) : null;
|
|
11519
11554
|
}
|
|
11520
|
-
function
|
|
11555
|
+
function oo(e) {
|
|
11521
11556
|
return null != e && Number.isFinite(e) ? Math.max(0, Math.round(20 * e)) : null;
|
|
11522
11557
|
}
|
|
11523
|
-
function
|
|
11524
|
-
return
|
|
11558
|
+
function io(e, t = "000000") {
|
|
11559
|
+
return hr(e) ?? t;
|
|
11525
11560
|
}
|
|
11526
|
-
function
|
|
11527
|
-
return `<w:shd w:val="clear" w:color="auto" w:fill="${
|
|
11561
|
+
function ao(e) {
|
|
11562
|
+
return `<w:shd w:val="clear" w:color="auto" w:fill="${io(e, "FFFFFF")}"/>`;
|
|
11528
11563
|
}
|
|
11529
|
-
function
|
|
11564
|
+
function so(e) {
|
|
11530
11565
|
if ("end" === e.kind) return `<w:bookmarkEnd w:id="${e.wId}"/>`;
|
|
11531
11566
|
const t = (void 0 !== e.colFirst ? ` w:colFirst="${e.colFirst}"` : "") + (void 0 !== e.colLast ? ` w:colLast="${e.colLast}"` : "");
|
|
11532
|
-
return `<w:bookmarkStart w:id="${e.wId}" w:name="${
|
|
11567
|
+
return `<w:bookmarkStart w:id="${e.wId}" w:name="${to(e.name ?? "")}"${t}/>`;
|
|
11533
11568
|
}
|
|
11534
|
-
function
|
|
11569
|
+
function lo(e) {
|
|
11535
11570
|
switch (e.kind) {
|
|
11536
11571
|
case "start": return `<w:commentRangeStart w:id="${e.wId}"/>`;
|
|
11537
11572
|
case "end": return `<w:commentRangeEnd w:id="${e.wId}"/>`;
|
|
11538
11573
|
case "reference": return `<w:r><w:commentReference w:id="${e.wId}"/></w:r>`;
|
|
11539
11574
|
}
|
|
11540
11575
|
}
|
|
11541
|
-
const
|
|
11542
|
-
function
|
|
11576
|
+
const co = `xmlns:w="${Qn}" xmlns:w14="${eo}" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16du="http://schemas.microsoft.com/office/word/2023/wordml/word16du"`;
|
|
11577
|
+
function uo(e) {
|
|
11543
11578
|
const t = e.comments.map(({ comment: e, wId: t, paraId: r }) => {
|
|
11544
|
-
const n = void 0 !== e.date ? ` w:date="${new Date(e.date).toISOString().replace(/\.\d{3}Z$/, "Z")}"` : "", o = void 0 !== e.dateUtc ? ` w16du:dateUtc="${new Date(e.dateUtc).toISOString().replace(/\.\d{3}Z$/, "Z")}"` : "", i = e.initials ? ` w:initials="${
|
|
11545
|
-
return `<w:comment w:id="${t}" w:author="${
|
|
11579
|
+
const n = void 0 !== e.date ? ` w:date="${new Date(e.date).toISOString().replace(/\.\d{3}Z$/, "Z")}"` : "", o = void 0 !== e.dateUtc ? ` w16du:dateUtc="${new Date(e.dateUtc).toISOString().replace(/\.\d{3}Z$/, "Z")}"` : "", i = e.initials ? ` w:initials="${to(e.initials)}"` : "";
|
|
11580
|
+
return `<w:comment w:id="${t}" w:author="${to(e.author)}"${n}${o}${i}><w:p w14:paraId="${r}">${a = e.text, `<w:r>${a.split("\n").map((e, t) => `${t > 0 ? "<w:br/>" : ""}<w:t xml:space="preserve">${to(e)}</w:t>`).join("")}</w:r>`}</w:p></w:comment>`;
|
|
11546
11581
|
var a;
|
|
11547
11582
|
}).join("");
|
|
11548
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:comments ${
|
|
11583
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:comments ${co}>${t}</w:comments>`;
|
|
11549
11584
|
}
|
|
11550
|
-
function
|
|
11585
|
+
function po(e) {
|
|
11551
11586
|
return void 0 !== e && Number.isSafeInteger(e) && e >= 1;
|
|
11552
11587
|
}
|
|
11553
|
-
function
|
|
11588
|
+
function fo(e) {
|
|
11554
11589
|
let t = 1;
|
|
11555
|
-
for (const n of Object.values(e))
|
|
11590
|
+
for (const n of Object.values(e)) po(n.docxId) && (t = Math.max(t, n.docxId + 1));
|
|
11556
11591
|
const r = /* @__PURE__ */ new Set();
|
|
11557
11592
|
return (e) => {
|
|
11558
|
-
if (
|
|
11593
|
+
if (po(e.docxId) && !r.has(e.docxId)) return r.add(e.docxId), e.docxId;
|
|
11559
11594
|
for (; r.has(t);) t += 1;
|
|
11560
11595
|
const n = t;
|
|
11561
11596
|
return r.add(n), t += 1, n;
|
|
11562
11597
|
};
|
|
11563
11598
|
}
|
|
11564
|
-
function
|
|
11565
|
-
return "none" === e.type || e.width <= 0 ? "w:val=\"nil\"/>" : `w:val="${"dotted" === e.type ? "dotted" : "dashed" === e.type ? "dashed" : "single"}" w:sz="${Math.max(1, Math.round(8 * e.width))}" w:space="0" w:color="${
|
|
11599
|
+
function ho(e, t = "000000") {
|
|
11600
|
+
return "none" === e.type || e.width <= 0 ? "w:val=\"nil\"/>" : `w:val="${"dotted" === e.type ? "dotted" : "dashed" === e.type ? "dashed" : "single"}" w:sz="${Math.max(1, Math.round(8 * e.width))}" w:space="0" w:color="${io(e.color, t)}"/>`;
|
|
11566
11601
|
}
|
|
11567
|
-
function
|
|
11602
|
+
function mo(e) {
|
|
11568
11603
|
const t = [
|
|
11569
11604
|
["top", e.borderTop],
|
|
11570
11605
|
["left", e.borderLeft],
|
|
@@ -11572,27 +11607,27 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11572
11607
|
["right", e.borderRight],
|
|
11573
11608
|
["between", e.borderBetween],
|
|
11574
11609
|
["bar", e.borderBar]
|
|
11575
|
-
].filter((e) => null != e[1]).map(([e, t]) => `<w:${e} ${
|
|
11610
|
+
].filter((e) => null != e[1]).map(([e, t]) => `<w:${e} ${ho(t)}`);
|
|
11576
11611
|
return t.length > 0 ? `<w:pBdr>${t.join("")}</w:pBdr>` : "";
|
|
11577
11612
|
}
|
|
11578
|
-
const
|
|
11579
|
-
function
|
|
11580
|
-
return e ? Object.entries(e).map(([e, t]) => ` ${e}="${
|
|
11613
|
+
const go = "6F6F6F";
|
|
11614
|
+
function wo(e) {
|
|
11615
|
+
return e ? Object.entries(e).map(([e, t]) => ` ${e}="${to(t)}"`).join("") : "";
|
|
11581
11616
|
}
|
|
11582
|
-
function
|
|
11617
|
+
function bo(e) {
|
|
11583
11618
|
const t = /^\d+$/.test(e.id) ? e.id : String(Array.from(e.id).reduce((e, t) => 31 * e + t.charCodeAt(0) >>> 0, 0)), r = Number.isFinite(e.date) ? new Date(e.date).toISOString() : (/* @__PURE__ */ new Date(0)).toISOString();
|
|
11584
|
-
return `w:id="${t}" w:author="${
|
|
11619
|
+
return `w:id="${t}" w:author="${to(e.author)}" w:date="${r}"`;
|
|
11585
11620
|
}
|
|
11586
|
-
function
|
|
11621
|
+
function vo(e) {
|
|
11587
11622
|
if (!e || 0 === Object.keys(e).length) return "";
|
|
11588
11623
|
const t = Tt.filter(([, t]) => void 0 !== e[t]).map(([t, r]) => `w:${t}="${e[r] ? "1" : "0"}"`).join(" ");
|
|
11589
11624
|
return t ? `<w:cnfStyle ${t}/>` : "";
|
|
11590
11625
|
}
|
|
11591
|
-
function
|
|
11626
|
+
function yo(e, t) {
|
|
11592
11627
|
return void 0 === t ? "" : t ? `<w:${e}/>` : `<w:${e} w:val="0"/>`;
|
|
11593
11628
|
}
|
|
11594
|
-
function
|
|
11595
|
-
if ("number" == typeof t && Number.isFinite(t)) return `<w:${e} w:w="${
|
|
11629
|
+
function xo(e, t, r = {}) {
|
|
11630
|
+
if ("number" == typeof t && Number.isFinite(t)) return `<w:${e} w:w="${oo(t) ?? 0}" w:type="dxa"/>`;
|
|
11596
11631
|
if ("string" == typeof t) {
|
|
11597
11632
|
const r = t.trim();
|
|
11598
11633
|
if ("auto" === r) return `<w:${e} w:w="0" w:type="auto"/>`;
|
|
@@ -11605,142 +11640,142 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11605
11640
|
}
|
|
11606
11641
|
return r.fallbackAuto ? `<w:${e} w:w="0" w:type="auto"/>` : "";
|
|
11607
11642
|
}
|
|
11608
|
-
function
|
|
11609
|
-
return
|
|
11643
|
+
function So(e, t = !0) {
|
|
11644
|
+
return xo("tblW", e, { fallbackAuto: t });
|
|
11610
11645
|
}
|
|
11611
|
-
function
|
|
11612
|
-
return
|
|
11646
|
+
function No(e) {
|
|
11647
|
+
return ho(e ?? {
|
|
11613
11648
|
width: .75,
|
|
11614
11649
|
type: "solid",
|
|
11615
|
-
color: `#${
|
|
11616
|
-
},
|
|
11650
|
+
color: `#${go}`
|
|
11651
|
+
}, go);
|
|
11617
11652
|
}
|
|
11618
|
-
function
|
|
11653
|
+
function Eo(e) {
|
|
11619
11654
|
if (!e) return "";
|
|
11620
11655
|
const t = [], r = (e, r) => {
|
|
11621
|
-
void 0 !== r && Number.isFinite(r) && t.push(`<w:${e} w:w="${
|
|
11656
|
+
void 0 !== r && Number.isFinite(r) && t.push(`<w:${e} w:w="${oo(r) ?? 0}" w:type="dxa"/>`);
|
|
11622
11657
|
};
|
|
11623
11658
|
return r("top", e.top), r("left", e.left), r("bottom", e.bottom), r("right", e.right), r("start", e.start), r("end", e.end), t.length > 0 ? `<w:tblCellMar>${t.join("")}</w:tblCellMar>` : "";
|
|
11624
11659
|
}
|
|
11625
|
-
function
|
|
11626
|
-
const r = Math.max(1, Math.floor(e.colSpan ?? 1)), n = [], o =
|
|
11660
|
+
function ko(e, t) {
|
|
11661
|
+
const r = Math.max(1, Math.floor(e.colSpan ?? 1)), n = [], o = vo(e.conditionalStyle);
|
|
11627
11662
|
o && n.push(o);
|
|
11628
11663
|
const i = function(e) {
|
|
11629
|
-
return
|
|
11664
|
+
return xo("tcW", e);
|
|
11630
11665
|
}(e.style?.width ?? t);
|
|
11631
|
-
i && n.push(i), r > 1 && n.push(`<w:gridSpan w:val="${r}"/>`), "restart" === e.vMerge ? n.push("<w:vMerge w:val=\"restart\"/>") : "continue" === e.vMerge && n.push("<w:vMerge/>"), e.style?.shading && n.push(
|
|
11632
|
-
const a =
|
|
11666
|
+
i && n.push(i), r > 1 && n.push(`<w:gridSpan w:val="${r}"/>`), "restart" === e.vMerge ? n.push("<w:vMerge w:val=\"restart\"/>") : "continue" === e.vMerge && n.push("<w:vMerge/>"), e.style?.shading && n.push(ao(e.style.shading));
|
|
11667
|
+
const a = yo("noWrap", e.style?.noWrap);
|
|
11633
11668
|
a && n.push(a);
|
|
11634
|
-
const s =
|
|
11635
|
-
if (s && n.push(s), e.style?.headers && n.push(`<w:headers w:val="${
|
|
11669
|
+
const s = yo("tcFitText", e.style?.fitText);
|
|
11670
|
+
if (s && n.push(s), e.style?.headers && n.push(`<w:headers w:val="${to(e.style.headers)}"/>`), e.style?.verticalAlign) {
|
|
11636
11671
|
const t = "middle" === e.style.verticalAlign ? "center" : e.style.verticalAlign;
|
|
11637
11672
|
n.push(`<w:vAlign w:val="${t}"/>`);
|
|
11638
11673
|
}
|
|
11639
11674
|
e.style?.textDirection && n.push(`<w:textDirection w:val="${e.style.textDirection}"/>`), n.push(function(e) {
|
|
11640
|
-
const t = e.style, r = t?.padding, n =
|
|
11641
|
-
return `<w:tcMar><w:top w:w="${n ?? 0}" w:type="dxa"/><w:left w:w="${
|
|
11675
|
+
const t = e.style, r = t?.padding, n = oo(r ?? t?.paddingTop ?? 0), o = oo(r ?? t?.paddingBottom ?? 0);
|
|
11676
|
+
return `<w:tcMar><w:top w:w="${n ?? 0}" w:type="dxa"/><w:left w:w="${oo(r ?? t?.paddingLeft ?? 5.4) ?? 0}" w:type="dxa"/><w:bottom w:w="${o ?? 0}" w:type="dxa"/><w:right w:w="${oo(r ?? t?.paddingRight ?? 5.4) ?? 0}" w:type="dxa"/>${void 0 !== t?.paddingStart ? `<w:start w:w="${oo(t.paddingStart) ?? 0}" w:type="dxa"/>` : ""}${void 0 !== t?.paddingEnd ? `<w:end w:w="${oo(t.paddingEnd) ?? 0}" w:type="dxa"/>` : ""}</w:tcMar>`;
|
|
11642
11677
|
}(e)), n.push(function(e) {
|
|
11643
11678
|
const t = [
|
|
11644
|
-
`<w:top ${
|
|
11645
|
-
`<w:left ${
|
|
11646
|
-
`<w:bottom ${
|
|
11647
|
-
`<w:right ${
|
|
11679
|
+
`<w:top ${No(e.style?.borderTop)}`,
|
|
11680
|
+
`<w:left ${No(e.style?.borderLeft)}`,
|
|
11681
|
+
`<w:bottom ${No(e.style?.borderBottom)}`,
|
|
11682
|
+
`<w:right ${No(e.style?.borderRight)}`
|
|
11648
11683
|
];
|
|
11649
|
-
return e.style?.borderStart && t.push(`<w:start ${
|
|
11684
|
+
return e.style?.borderStart && t.push(`<w:start ${No(e.style.borderStart)}`), e.style?.borderEnd && t.push(`<w:end ${No(e.style.borderEnd)}`), e.style?.borderTopLeftToBottomRight && t.push(`<w:tl2br ${No(e.style.borderTopLeftToBottomRight)}`), e.style?.borderTopRightToBottomLeft && t.push(`<w:tr2bl ${No(e.style.borderTopRightToBottomLeft)}`), `<w:tcBorders>${t.join("")}</w:tcBorders>`;
|
|
11650
11685
|
}(e));
|
|
11651
|
-
const l =
|
|
11686
|
+
const l = yo("hideMark", e.style?.hideMark);
|
|
11652
11687
|
if (l && n.push(l), e.style?.propertyRevision) {
|
|
11653
|
-
const t = e.style.propertyRevision, r =
|
|
11688
|
+
const t = e.style.propertyRevision, r = ko({
|
|
11654
11689
|
...e,
|
|
11655
11690
|
style: t.previous
|
|
11656
11691
|
});
|
|
11657
|
-
n.push(`<w:tcPrChange ${
|
|
11692
|
+
n.push(`<w:tcPrChange ${bo(t)}>${r}</w:tcPrChange>`);
|
|
11658
11693
|
}
|
|
11659
11694
|
if (e.style?.revision) {
|
|
11660
11695
|
const t = e.style.revision, r = "insert" === t.type ? "cellIns" : "delete" === t.type ? "cellDel" : "cellMerge", o = "merge" === t.type ? `${t.previous?.vMerge ? ` w:vMergeOrig="${"restart" === t.previous.vMerge ? "rest" : "cont"}"` : ""}${e.vMerge ? ` w:vMerge="${"restart" === e.vMerge ? "rest" : "cont"}"` : ""}` : "";
|
|
11661
|
-
n.push(`<w:${r} ${
|
|
11696
|
+
n.push(`<w:${r} ${bo(t)}${o}/>`);
|
|
11662
11697
|
}
|
|
11663
11698
|
return n.length > 0 ? `<w:tcPr>${n.join("")}</w:tcPr>` : "";
|
|
11664
11699
|
}
|
|
11665
|
-
function
|
|
11700
|
+
function _o(e, t) {
|
|
11666
11701
|
if (void 0 === t || !Number.isFinite(t)) return "";
|
|
11667
11702
|
const r = Math.floor(t);
|
|
11668
11703
|
return r > 0 ? `<w:${e} w:val="${r}"/>` : "";
|
|
11669
11704
|
}
|
|
11670
|
-
function
|
|
11671
|
-
const r = "number" == typeof e ?
|
|
11705
|
+
function To(e, t) {
|
|
11706
|
+
const r = "number" == typeof e ? oo(e) : "string" == typeof e ? Number.parseFloat(e) : null, n = null !== r && Number.isFinite(r);
|
|
11672
11707
|
if (!n && !t) return "";
|
|
11673
11708
|
const o = [];
|
|
11674
11709
|
return n && o.push(`w:val="${Math.round(r)}"`), o.push(`w:hRule="${t ?? "atLeast"}"`), `<w:trHeight ${o.join(" ")}/>`;
|
|
11675
11710
|
}
|
|
11676
|
-
function
|
|
11711
|
+
function Io(e) {
|
|
11677
11712
|
if (!e) return "";
|
|
11678
|
-
const t = [], r =
|
|
11713
|
+
const t = [], r = _o("gridBefore", e.gridBefore);
|
|
11679
11714
|
r && t.push(r);
|
|
11680
|
-
const n =
|
|
11715
|
+
const n = _o("gridAfter", e.gridAfter);
|
|
11681
11716
|
n && t.push(n);
|
|
11682
|
-
const o =
|
|
11717
|
+
const o = xo("wBefore", e.widthBefore);
|
|
11683
11718
|
o && t.push(o);
|
|
11684
|
-
const i =
|
|
11719
|
+
const i = xo("wAfter", e.widthAfter);
|
|
11685
11720
|
i && t.push(i);
|
|
11686
|
-
const a =
|
|
11721
|
+
const a = xo("tblCellSpacing", e.cellSpacing);
|
|
11687
11722
|
a && t.push(a);
|
|
11688
|
-
const s =
|
|
11723
|
+
const s = To(e.height, e.heightRule);
|
|
11689
11724
|
s && t.push(s);
|
|
11690
|
-
const l =
|
|
11725
|
+
const l = yo("cantSplit", e.cantSplit);
|
|
11691
11726
|
l && t.push(l);
|
|
11692
|
-
const c =
|
|
11727
|
+
const c = yo("hidden", e.hidden);
|
|
11693
11728
|
c && t.push(c);
|
|
11694
|
-
const u =
|
|
11729
|
+
const u = yo("tblHeader", e.isHeader);
|
|
11695
11730
|
return u && t.push(u), e.align && t.push(`<w:jc w:val="${e.align}"/>`), t.length > 0 ? `<w:trPr>${t.join("")}</w:trPr>` : "";
|
|
11696
11731
|
}
|
|
11697
|
-
function
|
|
11698
|
-
const t = [], r =
|
|
11732
|
+
function Co(e) {
|
|
11733
|
+
const t = [], r = vo(e.conditionalStyle);
|
|
11699
11734
|
r && t.push(r);
|
|
11700
|
-
const n =
|
|
11735
|
+
const n = _o("gridBefore", e.style?.gridBefore);
|
|
11701
11736
|
n && t.push(n);
|
|
11702
|
-
const o =
|
|
11737
|
+
const o = _o("gridAfter", e.style?.gridAfter);
|
|
11703
11738
|
o && t.push(o);
|
|
11704
|
-
const i =
|
|
11739
|
+
const i = xo("wBefore", e.style?.widthBefore);
|
|
11705
11740
|
i && t.push(i);
|
|
11706
|
-
const a =
|
|
11741
|
+
const a = xo("wAfter", e.style?.widthAfter);
|
|
11707
11742
|
a && t.push(a);
|
|
11708
|
-
const s =
|
|
11743
|
+
const s = xo("tblCellSpacing", e.style?.cellSpacing);
|
|
11709
11744
|
s && t.push(s);
|
|
11710
11745
|
const l = function(e) {
|
|
11711
|
-
return
|
|
11746
|
+
return To(e.style?.height, e.style?.heightRule);
|
|
11712
11747
|
}(e);
|
|
11713
11748
|
l && t.push(l);
|
|
11714
|
-
const c =
|
|
11749
|
+
const c = yo("cantSplit", e.style?.cantSplit);
|
|
11715
11750
|
c && t.push(c), (e.style?.isHeader ?? e.isHeader) && t.push("<w:tblHeader/>");
|
|
11716
|
-
const u =
|
|
11751
|
+
const u = yo("hidden", e.style?.hidden);
|
|
11717
11752
|
if (u && t.push(u), e.style?.align && t.push(`<w:jc w:val="${e.style.align}"/>`), e.style?.propertyRevision) {
|
|
11718
11753
|
const r = e.style.propertyRevision;
|
|
11719
|
-
t.push(`<w:trPrChange ${
|
|
11754
|
+
t.push(`<w:trPrChange ${bo(r)}>${Io(r.previous)}</w:trPrChange>`);
|
|
11720
11755
|
}
|
|
11721
11756
|
if (e.style?.revision && "merge" !== e.style.revision.type) {
|
|
11722
11757
|
const r = e.style.revision, n = "insert" === r.type ? "ins" : "del";
|
|
11723
|
-
t.push(`<w:${n} ${
|
|
11758
|
+
t.push(`<w:${n} ${bo(r)}/>`);
|
|
11724
11759
|
}
|
|
11725
11760
|
return t.length > 0 ? `<w:trPr>${t.join("")}</w:trPr>` : "";
|
|
11726
11761
|
}
|
|
11727
|
-
function
|
|
11762
|
+
function Ao(e) {
|
|
11728
11763
|
const t = e?.borders;
|
|
11729
11764
|
if (!t) return "";
|
|
11730
|
-
const r = It.map(([e, r]) => [e, t[r]]).filter((e) => !!e[1]).map(([e, t]) => `<w:${e} ${
|
|
11765
|
+
const r = It.map(([e, r]) => [e, t[r]]).filter((e) => !!e[1]).map(([e, t]) => `<w:${e} ${ho(t)}`).join("");
|
|
11731
11766
|
return r ? `<w:tblBorders>${r}</w:tblBorders>` : "";
|
|
11732
11767
|
}
|
|
11733
|
-
function
|
|
11768
|
+
function Ro(e) {
|
|
11734
11769
|
const t = [];
|
|
11735
|
-
if (e.style?.styleId && t.push(`<w:tblStyle w:val="${
|
|
11770
|
+
if (e.style?.styleId && t.push(`<w:tblStyle w:val="${to(e.style.styleId)}"/>`), e.style?.tblLook) {
|
|
11736
11771
|
const r = e.style.tblLook;
|
|
11737
11772
|
t.push(`<w:tblLook w:firstRow="${r.firstRow ? "1" : "0"}" w:lastRow="${r.lastRow ? "1" : "0"}" w:firstColumn="${r.firstCol ? "1" : "0"}" w:lastColumn="${r.lastCol ? "1" : "0"}" w:noHBand="${r.noHBand ? "1" : "0"}" w:noVBand="${r.noVBand ? "1" : "0"}"/>`);
|
|
11738
11773
|
}
|
|
11739
|
-
e.style?.altTitle && t.push(`<w:tblCaption w:val="${
|
|
11774
|
+
e.style?.altTitle && t.push(`<w:tblCaption w:val="${to(e.style.altTitle)}"/>`), e.style?.altDescription && t.push(`<w:tblDescription w:val="${to(e.style.altDescription)}"/>`);
|
|
11740
11775
|
const r = function(e) {
|
|
11741
11776
|
if (!e || 0 === Object.keys(e).length) return "";
|
|
11742
11777
|
const t = (e) => {
|
|
11743
|
-
const t =
|
|
11778
|
+
const t = oo(e);
|
|
11744
11779
|
return null === t ? void 0 : String(t);
|
|
11745
11780
|
}, r = {
|
|
11746
11781
|
horzAnchor: e.horizontalAnchor,
|
|
@@ -11754,48 +11789,48 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11754
11789
|
bottomFromText: t(e.distanceBottom),
|
|
11755
11790
|
leftFromText: t(e.distanceLeft)
|
|
11756
11791
|
};
|
|
11757
|
-
return `<w:tblpPr ${Object.entries(r).filter((e) => void 0 !== e[1]).map(([e, t]) => `w:${e}="${
|
|
11792
|
+
return `<w:tblpPr ${Object.entries(r).filter((e) => void 0 !== e[1]).map(([e, t]) => `w:${e}="${to(t)}"`).join(" ")}/>`;
|
|
11758
11793
|
}(e.style?.floating);
|
|
11759
11794
|
r && t.push(r);
|
|
11760
11795
|
const n = e.gridCols && e.gridCols.length > 0 ? e.gridCols.reduce((e, t) => e + t, 0) : void 0;
|
|
11761
|
-
t.push(
|
|
11762
|
-
const o =
|
|
11796
|
+
t.push(So(e.style?.width ?? n)), e.style?.align && t.push(`<w:jc w:val="${e.style.align}"/>`);
|
|
11797
|
+
const o = xo("tblCellSpacing", e.style?.cellSpacing);
|
|
11763
11798
|
o && t.push(o);
|
|
11764
|
-
const i =
|
|
11799
|
+
const i = Eo(e.style?.defaultCellMargins);
|
|
11765
11800
|
i && t.push(i);
|
|
11766
|
-
const a =
|
|
11801
|
+
const a = Ao(e.style);
|
|
11767
11802
|
a && t.push(a);
|
|
11768
|
-
const s =
|
|
11803
|
+
const s = xo("tblInd", e.style?.indentLeft);
|
|
11769
11804
|
s && t.push(s), t.push(`<w:tblLayout w:type="${e.style?.layout ?? "fixed"}"/>`);
|
|
11770
|
-
const l =
|
|
11771
|
-
if (l && t.push(l), e.style?.tblOverlap && t.push(`<w:tblOverlap w:val="${
|
|
11772
|
-
const r = e.style.revision, n =
|
|
11805
|
+
const l = yo("bidiVisual", e.style?.bidiVisual);
|
|
11806
|
+
if (l && t.push(l), e.style?.tblOverlap && t.push(`<w:tblOverlap w:val="${to(e.style.tblOverlap)}"/>`), e.style?.revision) {
|
|
11807
|
+
const r = e.style.revision, n = Ro({
|
|
11773
11808
|
...e,
|
|
11774
11809
|
style: r.previous
|
|
11775
11810
|
});
|
|
11776
|
-
t.push(`<w:tblPrChange ${
|
|
11811
|
+
t.push(`<w:tblPrChange ${bo(r)}>${n}</w:tblPrChange>`);
|
|
11777
11812
|
}
|
|
11778
11813
|
return `<w:tblPr>${t.join("")}</w:tblPr>`;
|
|
11779
11814
|
}
|
|
11780
|
-
function
|
|
11815
|
+
function $o(e, t, r) {
|
|
11781
11816
|
if (!e && !t && !r) return "";
|
|
11782
11817
|
const n = [];
|
|
11783
|
-
void 0 !== e?.width && n.push(
|
|
11784
|
-
const o =
|
|
11818
|
+
void 0 !== e?.width && n.push(So(e.width)), e?.align && n.push(`<w:jc w:val="${e.align}"/>`);
|
|
11819
|
+
const o = xo("tblCellSpacing", e?.cellSpacing);
|
|
11785
11820
|
o && n.push(o);
|
|
11786
|
-
const i =
|
|
11821
|
+
const i = xo("tblInd", e?.indentLeft);
|
|
11787
11822
|
i && n.push(i);
|
|
11788
|
-
const a = e ?
|
|
11823
|
+
const a = e ? Ao(e) : "";
|
|
11789
11824
|
a && n.push(a), e?.layout && n.push(`<w:tblLayout w:type="${e.layout}"/>`);
|
|
11790
|
-
const s =
|
|
11825
|
+
const s = Eo(e?.defaultCellMargins);
|
|
11791
11826
|
if (s && n.push(s), r) n.push(r);
|
|
11792
11827
|
else if (t) {
|
|
11793
|
-
const e =
|
|
11794
|
-
n.push(`<w:tblPrExChange ${
|
|
11828
|
+
const e = $o(t.previous) || "<w:tblPrEx/>";
|
|
11829
|
+
n.push(`<w:tblPrExChange ${bo(t)}>${e}</w:tblPrExChange>`);
|
|
11795
11830
|
}
|
|
11796
11831
|
return n.length > 0 ? `<w:tblPrEx>${n.join("")}</w:tblPrEx>` : "";
|
|
11797
11832
|
}
|
|
11798
|
-
function
|
|
11833
|
+
function Do(e, t) {
|
|
11799
11834
|
const r = function(e) {
|
|
11800
11835
|
const t = [], r = [];
|
|
11801
11836
|
for (let n = 0; n < e.rows.length; n += 1) {
|
|
@@ -11837,21 +11872,21 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11837
11872
|
kind: "text"
|
|
11838
11873
|
}]
|
|
11839
11874
|
}]).map((e) => t(e, r)).join(""), c = "continue" === r.vMerge ? "<w:p/>" : l;
|
|
11840
|
-
return `<w:tc${
|
|
11875
|
+
return `<w:tc${wo(r.extAttributes)}>${ko(r, s)}${c}</w:tc>`;
|
|
11841
11876
|
}).join("");
|
|
11842
|
-
return `<w:tr${
|
|
11843
|
-
}).join(""), i = e.gridCols ? `<w:tblGrid>${e.gridCols.map((e) => `<w:gridCol w:w="${
|
|
11844
|
-
return `<w:tbl>${
|
|
11877
|
+
return `<w:tr${wo(r.extAttributes)}>${$o(r.propertyExceptions, r.propertyExceptionsRevision, r.tblPrExChangeXml)}${Co(r)}${i}</w:tr>`;
|
|
11878
|
+
}).join(""), i = e.gridCols ? `<w:tblGrid>${e.gridCols.map((e) => `<w:gridCol w:w="${oo(e) ?? 0}"/>`).join("")}${e.gridRevision ? `<w:tblGridChange ${bo(e.gridRevision)}><w:tblGrid>${e.gridRevision.previous.map((e) => `<w:gridCol w:w="${oo(e) ?? 0}"/>`).join("")}</w:tblGrid></w:tblGridChange>` : ""}</w:tblGrid>` : "";
|
|
11879
|
+
return `<w:tbl>${Ro(e)}${i}${o}</w:tbl>`;
|
|
11845
11880
|
}
|
|
11846
|
-
const
|
|
11847
|
-
function
|
|
11881
|
+
const Po = "xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\"";
|
|
11882
|
+
function Mo(e) {
|
|
11848
11883
|
if (!(void 0 !== e.alias || void 0 !== e.tag || void 0 !== e.id || void 0 !== e.lock || void 0 !== e.appearance || void 0 !== e.showingPlcHdr || void 0 !== e.temporary || void 0 !== e.color || void 0 !== e.placeholderDocPart || void 0 !== e.dataBinding || void 0 !== e.subtype || void 0 !== e.repeatingSectionProperties || (e.unknownXml ?? "").length > 0)) return "<w:sdtPr/>";
|
|
11849
11884
|
let t = "";
|
|
11850
|
-
return void 0 !== e.alias && (t += `<w:alias w:val="${
|
|
11885
|
+
return void 0 !== e.alias && (t += `<w:alias w:val="${to(e.alias)}"/>`), void 0 !== e.tag && (t += `<w:tag w:val="${to(e.tag)}"/>`), void 0 !== e.id && (t += `<w:id w:val="${to(e.id)}"/>`), void 0 !== e.lock && (t += `<w:lock w:val="${to(e.lock)}"/>`), void 0 !== e.placeholderDocPart && (t += `<w:placeholder><w:docPart w:val="${to(e.placeholderDocPart)}"/></w:placeholder>`), void 0 !== e.dataBinding && (t += function(e) {
|
|
11851
11886
|
const t = [];
|
|
11852
|
-
void 0 !== e.prefixMappings && t.push(`w:prefixMappings="${
|
|
11853
|
-
void 0 !== e.xpath && t.push(`w:xpath="${
|
|
11854
|
-
void 0 !== e.storeItemID && t.push(`w:storeItemID="${
|
|
11887
|
+
void 0 !== e.prefixMappings && t.push(`w:prefixMappings="${to(e.prefixMappings)}"`);
|
|
11888
|
+
void 0 !== e.xpath && t.push(`w:xpath="${to(e.xpath)}"`);
|
|
11889
|
+
void 0 !== e.storeItemID && t.push(`w:storeItemID="${to(e.storeItemID)}"`);
|
|
11855
11890
|
return t.length > 0 ? `<w:dataBinding ${t.join(" ")}/>` : "";
|
|
11856
11891
|
}(e.dataBinding)), void 0 !== e.temporary && (t += `<w:temporary w:val="${e.temporary ? "true" : "false"}"/>`), void 0 !== e.subtype && (t += function(e, t) {
|
|
11857
11892
|
switch (e.kind) {
|
|
@@ -11864,35 +11899,35 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11864
11899
|
case "bibliography": return "<w:bibliography/>";
|
|
11865
11900
|
case "repeatingSection": return function(e) {
|
|
11866
11901
|
let t = "";
|
|
11867
|
-
void 0 !== e?.sectionTitle && (t += `<w15:sectionTitle w15:val="${
|
|
11902
|
+
void 0 !== e?.sectionTitle && (t += `<w15:sectionTitle w15:val="${to(e.sectionTitle)}"/>`);
|
|
11868
11903
|
void 0 !== e?.doNotAllowInsertDeleteSection && (t += `<w15:doNotAllowInsertDeleteSection w15:val="${e.doNotAllowInsertDeleteSection ? "1" : "0"}"/>`);
|
|
11869
|
-
return t ? `<w15:repeatingSection ${
|
|
11904
|
+
return t ? `<w15:repeatingSection ${Po}>${t}</w15:repeatingSection>` : `<w15:repeatingSection ${Po}/>`;
|
|
11870
11905
|
}(t);
|
|
11871
|
-
case "repeatingSectionItem": return `<w15:repeatingSectionItem ${
|
|
11906
|
+
case "repeatingSectionItem": return `<w15:repeatingSectionItem ${Po}/>`;
|
|
11872
11907
|
case "comboBox":
|
|
11873
11908
|
case "dropDownList": {
|
|
11874
|
-
const t = (e.listItems ?? []).map(
|
|
11909
|
+
const t = (e.listItems ?? []).map(Oo).join(""), r = void 0 !== e.lastSelectedValue ? `<w:lastSelectedValue w:val="${to(e.lastSelectedValue)}"/>` : "";
|
|
11875
11910
|
return `<w:${e.kind}>${t}${r}</w:${e.kind}>`;
|
|
11876
11911
|
}
|
|
11877
11912
|
case "date": {
|
|
11878
|
-
const t = void 0 !== e.fullDate ? ` w:fullDate="${
|
|
11913
|
+
const t = void 0 !== e.fullDate ? ` w:fullDate="${to(e.fullDate)}"` : "";
|
|
11879
11914
|
let r = "";
|
|
11880
|
-
return void 0 !== e.dateFormat && (r += `<w:dateFormat w:val="${
|
|
11915
|
+
return void 0 !== e.dateFormat && (r += `<w:dateFormat w:val="${to(e.dateFormat)}"/>`), void 0 !== e.lid && (r += `<w:lid w:val="${to(e.lid)}"/>`), void 0 !== e.calendar && (r += `<w:calendar w:val="${to(e.calendar)}"/>`), void 0 !== e.storeMappedDataAs && (r += `<w:storeMappedDataAs w:val="${to(e.storeMappedDataAs)}"/>`), `<w:date${t}>${r}</w:date>`;
|
|
11881
11916
|
}
|
|
11882
11917
|
case "checkbox": {
|
|
11883
11918
|
let t = "";
|
|
11884
|
-
if (void 0 !== e.checked && (t += `<w14:checked w14:val="${e.checked ? "1" : "0"}"/>`), void 0 !== e.checkedStateFont || void 0 !== e.checkedStateChar) t += `<w14:checkedState${void 0 !== e.checkedStateFont ? ` w14:font="${
|
|
11885
|
-
if (void 0 !== e.uncheckedStateFont || void 0 !== e.uncheckedStateChar) t += `<w14:uncheckedState${void 0 !== e.uncheckedStateFont ? ` w14:font="${
|
|
11919
|
+
if (void 0 !== e.checked && (t += `<w14:checked w14:val="${e.checked ? "1" : "0"}"/>`), void 0 !== e.checkedStateFont || void 0 !== e.checkedStateChar) t += `<w14:checkedState${void 0 !== e.checkedStateFont ? ` w14:font="${to(e.checkedStateFont)}"` : ""}${void 0 !== e.checkedStateChar ? ` w14:char="${to(e.checkedStateChar)}"` : ""}/>`;
|
|
11920
|
+
if (void 0 !== e.uncheckedStateFont || void 0 !== e.uncheckedStateChar) t += `<w14:uncheckedState${void 0 !== e.uncheckedStateFont ? ` w14:font="${to(e.uncheckedStateFont)}"` : ""}${void 0 !== e.uncheckedStateChar ? ` w14:char="${to(e.uncheckedStateChar)}"` : ""}/>`;
|
|
11886
11921
|
return `<w14:checkbox>${t}</w14:checkbox>`;
|
|
11887
11922
|
}
|
|
11888
11923
|
default: return e;
|
|
11889
11924
|
}
|
|
11890
|
-
}(e.subtype, e.repeatingSectionProperties)), void 0 !== e.appearance && (t += `<w:appearance w:val="${
|
|
11925
|
+
}(e.subtype, e.repeatingSectionProperties)), void 0 !== e.appearance && (t += `<w:appearance w:val="${to(e.appearance)}"/>`), void 0 !== e.showingPlcHdr && (t += `<w:showingPlcHdr w:val="${e.showingPlcHdr ? "true" : "false"}"/>`), void 0 !== e.color && (t += `<w:color w:val="${to(e.color)}"/>`), e.unknownXml && (t += e.unknownXml), `<w:sdtPr>${t}</w:sdtPr>`;
|
|
11891
11926
|
}
|
|
11892
|
-
function
|
|
11893
|
-
return `<w:listItem${void 0 !== e.displayText ? ` w:displayText="${
|
|
11927
|
+
function Oo(e) {
|
|
11928
|
+
return `<w:listItem${void 0 !== e.displayText ? ` w:displayText="${to(e.displayText)}"` : ""}${void 0 !== e.value ? ` w:value="${to(e.value)}"` : ""}/>`;
|
|
11894
11929
|
}
|
|
11895
|
-
function
|
|
11930
|
+
function Lo(e, t) {
|
|
11896
11931
|
const r = [];
|
|
11897
11932
|
for (let n = 0; n < e.childNodes.length; n += 1) {
|
|
11898
11933
|
const o = e.childNodes[n];
|
|
@@ -11900,28 +11935,28 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11900
11935
|
}
|
|
11901
11936
|
return r;
|
|
11902
11937
|
}
|
|
11903
|
-
function
|
|
11904
|
-
const r = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${
|
|
11938
|
+
function Fo(e, t) {
|
|
11939
|
+
const r = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${Qn}" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml">${e}</oasis:root>`, "application/xml").documentElement;
|
|
11905
11940
|
if (r) for (let n = 0; n < r.childNodes.length; n += 1) {
|
|
11906
11941
|
const e = r.childNodes[n];
|
|
11907
11942
|
if (e?.nodeType === e.ELEMENT_NODE && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && e.localName === t) return e;
|
|
11908
11943
|
}
|
|
11909
11944
|
}
|
|
11910
|
-
function
|
|
11945
|
+
function Bo(e, t) {
|
|
11911
11946
|
const r = e.ownerDocument;
|
|
11912
11947
|
if (!r) return null;
|
|
11913
|
-
const n = r.createElementNS(
|
|
11948
|
+
const n = r.createElementNS(Qn, "w:sdt"), o = Fo(Mo(t.sdtPr), "sdtPr");
|
|
11914
11949
|
if (o && n.appendChild(o.cloneNode(!0)), t.sdtEndPrXml) {
|
|
11915
|
-
const e =
|
|
11950
|
+
const e = Fo(t.sdtEndPrXml, "sdtEndPr");
|
|
11916
11951
|
e && n.appendChild(e.cloneNode(!0));
|
|
11917
11952
|
}
|
|
11918
|
-
const i = r.createElementNS(
|
|
11953
|
+
const i = r.createElementNS(Qn, "w:sdtContent");
|
|
11919
11954
|
return n.appendChild(i), {
|
|
11920
11955
|
sdt: n,
|
|
11921
11956
|
content: i
|
|
11922
11957
|
};
|
|
11923
11958
|
}
|
|
11924
|
-
function
|
|
11959
|
+
function Uo(e, t) {
|
|
11925
11960
|
let r = 0;
|
|
11926
11961
|
for (; r < t.length;) {
|
|
11927
11962
|
const n = t[r].wrappers[0];
|
|
@@ -11931,7 +11966,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11931
11966
|
}
|
|
11932
11967
|
let o = r + 1;
|
|
11933
11968
|
for (; o < t.length && t[o].wrappers[0]?.groupId === n.groupId;) o += 1;
|
|
11934
|
-
const i =
|
|
11969
|
+
const i = Bo(e, n);
|
|
11935
11970
|
if (!i) {
|
|
11936
11971
|
r = o;
|
|
11937
11972
|
continue;
|
|
@@ -11945,10 +11980,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11945
11980
|
wrappers: r.wrappers.slice(1)
|
|
11946
11981
|
});
|
|
11947
11982
|
}
|
|
11948
|
-
|
|
11983
|
+
Uo(i.content, a), r = o;
|
|
11949
11984
|
}
|
|
11950
11985
|
}
|
|
11951
|
-
function
|
|
11986
|
+
function zo(e) {
|
|
11952
11987
|
const t = [];
|
|
11953
11988
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
11954
11989
|
const n = e.childNodes[r];
|
|
@@ -11956,18 +11991,18 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11956
11991
|
}
|
|
11957
11992
|
return t;
|
|
11958
11993
|
}
|
|
11959
|
-
function
|
|
11994
|
+
function Ho(e) {
|
|
11960
11995
|
return `${e.namespaceURI ?? ""}\0${function(e) {
|
|
11961
11996
|
return e.localName ?? e.tagName;
|
|
11962
11997
|
}(e)}`;
|
|
11963
11998
|
}
|
|
11964
|
-
function
|
|
11965
|
-
const n =
|
|
11999
|
+
function jo(e, t, r) {
|
|
12000
|
+
const n = Ho(e[t]);
|
|
11966
12001
|
let o = 0;
|
|
11967
|
-
for (let i = 0; i < t; i += 1)
|
|
11968
|
-
return r.filter((e) =>
|
|
12002
|
+
for (let i = 0; i < t; i += 1) Ho(e[i]) === n && (o += 1);
|
|
12003
|
+
return r.filter((e) => Ho(e) === n)[o];
|
|
11969
12004
|
}
|
|
11970
|
-
function
|
|
12005
|
+
function qo(e, t) {
|
|
11971
12006
|
(function(e, t) {
|
|
11972
12007
|
for (let r = 0; r < e.attributes.length; r += 1) {
|
|
11973
12008
|
const n = e.attributes[r];
|
|
@@ -11976,16 +12011,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
11976
12011
|
(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));
|
|
11977
12012
|
}
|
|
11978
12013
|
})(e, t);
|
|
11979
|
-
const r =
|
|
12014
|
+
const r = zo(e), n = zo(t);
|
|
11980
12015
|
r.forEach((e, o) => {
|
|
11981
|
-
const i =
|
|
11982
|
-
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI) return void (i &&
|
|
11983
|
-
if (i) return void
|
|
11984
|
-
const a = r.slice(o + 1).map((e, t) =>
|
|
12016
|
+
const i = jo(r, o, n);
|
|
12017
|
+
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI) return void (i && qo(e, i));
|
|
12018
|
+
if (i) return void qo(e, i);
|
|
12019
|
+
const a = r.slice(o + 1).map((e, t) => jo(r, o + t + 1, n)).find((e) => Boolean(e));
|
|
11985
12020
|
t.insertBefore(e.cloneNode(!0), a ?? null);
|
|
11986
12021
|
});
|
|
11987
12022
|
}
|
|
11988
|
-
const
|
|
12023
|
+
const Wo = /* @__PURE__ */ new Set([
|
|
11989
12024
|
"tblStyle",
|
|
11990
12025
|
"tblpPr",
|
|
11991
12026
|
"tblOverlap",
|
|
@@ -12003,7 +12038,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12003
12038
|
"tblCaption",
|
|
12004
12039
|
"tblDescription",
|
|
12005
12040
|
"tblPrChange"
|
|
12006
|
-
]),
|
|
12041
|
+
]), Go = /* @__PURE__ */ new Set(["gridCol", "tblGridChange"]), Vo = /* @__PURE__ */ new Set([
|
|
12007
12042
|
"tblW",
|
|
12008
12043
|
"jc",
|
|
12009
12044
|
"tblCellSpacing",
|
|
@@ -12012,7 +12047,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12012
12047
|
"tblLayout",
|
|
12013
12048
|
"tblCellMar",
|
|
12014
12049
|
"tblPrExChange"
|
|
12015
|
-
]),
|
|
12050
|
+
]), Xo = /* @__PURE__ */ new Set([
|
|
12016
12051
|
"cnfStyle",
|
|
12017
12052
|
"gridBefore",
|
|
12018
12053
|
"gridAfter",
|
|
@@ -12027,7 +12062,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12027
12062
|
"ins",
|
|
12028
12063
|
"del",
|
|
12029
12064
|
"trPrChange"
|
|
12030
|
-
]),
|
|
12065
|
+
]), Zo = /* @__PURE__ */ new Set([
|
|
12031
12066
|
"cnfStyle",
|
|
12032
12067
|
"tcW",
|
|
12033
12068
|
"gridSpan",
|
|
@@ -12047,7 +12082,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12047
12082
|
"cellMerge",
|
|
12048
12083
|
"tcPrChange"
|
|
12049
12084
|
]);
|
|
12050
|
-
function
|
|
12085
|
+
function Yo(e) {
|
|
12051
12086
|
const t = [];
|
|
12052
12087
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
12053
12088
|
const n = e.childNodes[r];
|
|
@@ -12055,27 +12090,27 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12055
12090
|
}
|
|
12056
12091
|
return t;
|
|
12057
12092
|
}
|
|
12058
|
-
function
|
|
12093
|
+
function Qo(e) {
|
|
12059
12094
|
return e.localName ?? e.tagName;
|
|
12060
12095
|
}
|
|
12061
|
-
function
|
|
12062
|
-
return `${e.namespaceURI ?? ""}\0${
|
|
12096
|
+
function Ko(e) {
|
|
12097
|
+
return `${e.namespaceURI ?? ""}\0${Qo(e)}`;
|
|
12063
12098
|
}
|
|
12064
|
-
function
|
|
12099
|
+
function Jo(e, t) {
|
|
12065
12100
|
const r = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
12066
|
-
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === r?.namespaceURI &&
|
|
12101
|
+
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === r?.namespaceURI && Qo(r) === t ? r : void 0;
|
|
12067
12102
|
}
|
|
12068
|
-
function
|
|
12103
|
+
function ei(e, t, r, n, o) {
|
|
12069
12104
|
if (!e || function(e) {
|
|
12070
|
-
return Boolean(e &&
|
|
12105
|
+
return Boolean(e && Ur(e.xml));
|
|
12071
12106
|
}(e)) return t;
|
|
12072
12107
|
if (e.semanticSignature === o) return e.xml;
|
|
12073
|
-
const i =
|
|
12108
|
+
const i = Jo(e.xml, r), a = function(e, t) {
|
|
12074
12109
|
if (e) {
|
|
12075
|
-
const r =
|
|
12110
|
+
const r = Jo(e, t);
|
|
12076
12111
|
if (r) return r;
|
|
12077
12112
|
}
|
|
12078
|
-
return new b.DOMParser().parseFromString(`<w:${t} xmlns:w="${
|
|
12113
|
+
return new b.DOMParser().parseFromString(`<w:${t} xmlns:w="${Qn}"/>`, "application/xml").documentElement;
|
|
12079
12114
|
}(t, r);
|
|
12080
12115
|
if (!i || !a) return t;
|
|
12081
12116
|
(function(e, t) {
|
|
@@ -12086,21 +12121,21 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12086
12121
|
(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));
|
|
12087
12122
|
}
|
|
12088
12123
|
})(i, a);
|
|
12089
|
-
const s =
|
|
12124
|
+
const s = Yo(i), l = Yo(a), c = /* @__PURE__ */ new Map();
|
|
12090
12125
|
for (const f of l) {
|
|
12091
|
-
const e =
|
|
12126
|
+
const e = Ko(f), t = c.get(e) ?? [];
|
|
12092
12127
|
t.push(f), c.set(e, t);
|
|
12093
12128
|
}
|
|
12094
12129
|
const u = /* @__PURE__ */ new Map();
|
|
12095
12130
|
for (const f of s) {
|
|
12096
|
-
const e =
|
|
12131
|
+
const e = Ko(f), t = u.get(e) ?? 0;
|
|
12097
12132
|
u.set(e, t + 1);
|
|
12098
12133
|
const r = c.get(e)?.[t];
|
|
12099
|
-
r &&
|
|
12134
|
+
r && qo(f, r);
|
|
12100
12135
|
}
|
|
12101
|
-
const d = new Set(l.map(
|
|
12136
|
+
const d = new Set(l.map(Ko)), p = s.filter((e) => !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && n.has(Qo(e)) || d.has(Ko(e))));
|
|
12102
12137
|
for (const f of p) {
|
|
12103
|
-
const e = s.indexOf(f), t = s.slice(e + 1).find((e) => d.has(
|
|
12138
|
+
const e = s.indexOf(f), t = s.slice(e + 1).find((e) => d.has(Ko(e))), r = t ? Yo(a).find((e) => Ko(e) === Ko(t)) ?? null : null;
|
|
12104
12139
|
a.insertBefore(f.cloneNode(!0), r);
|
|
12105
12140
|
}
|
|
12106
12141
|
return t || function(e) {
|
|
@@ -12109,9 +12144,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12109
12144
|
if (r && "http://www.w3.org/2000/xmlns/" !== r.namespaceURI) return !0;
|
|
12110
12145
|
}
|
|
12111
12146
|
return !1;
|
|
12112
|
-
}(a) || 0 !==
|
|
12147
|
+
}(a) || 0 !== Yo(a).length ? new b.XMLSerializer().serializeToString(a) : "";
|
|
12113
12148
|
}
|
|
12114
|
-
function
|
|
12149
|
+
function ti(e) {
|
|
12115
12150
|
const t = [];
|
|
12116
12151
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
12117
12152
|
const n = e.childNodes[r];
|
|
@@ -12119,82 +12154,82 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12119
12154
|
}
|
|
12120
12155
|
return t;
|
|
12121
12156
|
}
|
|
12122
|
-
function
|
|
12123
|
-
return
|
|
12157
|
+
function ri(e, t) {
|
|
12158
|
+
return ti(e).filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && e.localName === t);
|
|
12124
12159
|
}
|
|
12125
|
-
function
|
|
12126
|
-
return
|
|
12160
|
+
function ni(e, t) {
|
|
12161
|
+
return ri(e, t)[0];
|
|
12127
12162
|
}
|
|
12128
|
-
function
|
|
12129
|
-
const r = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${
|
|
12130
|
-
if (r) return r ?
|
|
12163
|
+
function oi(e, t) {
|
|
12164
|
+
const r = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${Qn}">${e}</oasis:root>`, "application/xml").documentElement;
|
|
12165
|
+
if (r) return r ? ti(r).find((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && e.localName === t) : void 0;
|
|
12131
12166
|
}
|
|
12132
|
-
function
|
|
12167
|
+
function ii(e) {
|
|
12133
12168
|
return e ? new b.XMLSerializer().serializeToString(e) : "";
|
|
12134
12169
|
}
|
|
12135
|
-
function
|
|
12170
|
+
function ai(e) {
|
|
12136
12171
|
return /\br:(?:id|embed|link)\s*=/.test(e);
|
|
12137
12172
|
}
|
|
12138
|
-
function
|
|
12173
|
+
function si(e) {
|
|
12139
12174
|
const t = /* @__PURE__ */ new Map();
|
|
12140
12175
|
let r = 0;
|
|
12141
12176
|
for (const n of e) "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === n.namespaceURI && ("tblPr" === n.localName || "tblGrid" === n.localName ? t.set(n, n.localName) : "tr" === n.localName && (t.set(n, `tr:${r}`), r += 1));
|
|
12142
12177
|
return t;
|
|
12143
12178
|
}
|
|
12144
|
-
function
|
|
12179
|
+
function li(e, t, r, n, o) {
|
|
12145
12180
|
if (!r) return void (t && e.removeChild(t));
|
|
12146
|
-
const i =
|
|
12181
|
+
const i = oi(r, n);
|
|
12147
12182
|
i && (t ? e.replaceChild(i.cloneNode(!0), t) : e.insertBefore(i.cloneNode(!0), o));
|
|
12148
12183
|
}
|
|
12149
|
-
function
|
|
12150
|
-
const r =
|
|
12151
|
-
|
|
12152
|
-
return
|
|
12153
|
-
}(e,
|
|
12154
|
-
const i =
|
|
12155
|
-
|
|
12156
|
-
return
|
|
12157
|
-
}(e,
|
|
12158
|
-
}
|
|
12159
|
-
function
|
|
12160
|
-
const r =
|
|
12184
|
+
function ci(e, t) {
|
|
12185
|
+
const r = ni(t, "tblPr"), n = ni(t, "tblGrid"), o = ni(t, "tr") ?? null;
|
|
12186
|
+
li(t, r, function(e, t) {
|
|
12187
|
+
return ei(an(e)?.tableProperties, t, "tblPr", Wo, Kr(e));
|
|
12188
|
+
}(e, ii(r)), "tblPr", n ?? o);
|
|
12189
|
+
const i = ni(t, "tblGrid");
|
|
12190
|
+
li(t, i, function(e, t) {
|
|
12191
|
+
return ei(an(e)?.tableGrid, t, "tblGrid", Go, Jr(e));
|
|
12192
|
+
}(e, ii(i)), "tblGrid", ni(t, "tr") ?? null);
|
|
12193
|
+
}
|
|
12194
|
+
function ui(e, t) {
|
|
12195
|
+
const r = ri(t, "tr");
|
|
12161
12196
|
r.length === e.rows.length && r.forEach((t, r) => {
|
|
12162
|
-
const n = e.rows[r], o =
|
|
12163
|
-
|
|
12164
|
-
return
|
|
12165
|
-
}(n,
|
|
12166
|
-
const s =
|
|
12197
|
+
const n = e.rows[r], o = ni(t, "tblPrEx"), i = ni(t, "trPr"), a = ni(t, "tc") ?? null;
|
|
12198
|
+
li(t, o, function(e, t) {
|
|
12199
|
+
return ei(nn(e)?.propertyExceptions, t, "tblPrEx", Vo, tn(e));
|
|
12200
|
+
}(n, ii(o)), "tblPrEx", i ?? a);
|
|
12201
|
+
const s = ni(t, "trPr");
|
|
12167
12202
|
var l;
|
|
12168
|
-
|
|
12169
|
-
return
|
|
12170
|
-
}(n,
|
|
12171
|
-
const c =
|
|
12203
|
+
li(t, s, (l = function(e, t) {
|
|
12204
|
+
return ei(nn(e)?.rowProperties, t, "trPr", Xo, en(e));
|
|
12205
|
+
}(n, ii(s)), l.replace(/(<w:jc\b[^>]*\bw:val=")(?<value>start|end)("[^>]*\/?>)/g, (e, t, r, n) => `${t}${"start" === r ? "left" : "right"}${n}`)), "trPr", ni(t, "tc") ?? null);
|
|
12206
|
+
const c = ri(t, "tc");
|
|
12172
12207
|
c.length === n.cells.length && c.forEach((e, t) => {
|
|
12173
|
-
const r = n.cells[t], o =
|
|
12174
|
-
|
|
12175
|
-
return
|
|
12208
|
+
const r = n.cells[t], o = ni(e, "tcPr");
|
|
12209
|
+
li(e, o, function(e, t) {
|
|
12210
|
+
return ei(function(e) {
|
|
12176
12211
|
return e.ooxmlSource;
|
|
12177
|
-
}(e)?.cellProperties, t, "tcPr",
|
|
12178
|
-
}(r,
|
|
12212
|
+
}(e)?.cellProperties, t, "tcPr", Zo, rn(e));
|
|
12213
|
+
}(r, ii(o)), "tcPr", ni(e, "p") ?? ni(e, "tbl") ?? null);
|
|
12179
12214
|
});
|
|
12180
12215
|
});
|
|
12181
12216
|
}
|
|
12182
|
-
function
|
|
12183
|
-
for (const t of
|
|
12184
|
-
for (const n of
|
|
12185
|
-
const t =
|
|
12217
|
+
function di(e) {
|
|
12218
|
+
for (const t of ri(e, "tr")) for (const e of ri(t, "tc")) {
|
|
12219
|
+
for (const n of ri(e, "tbl")) di(n);
|
|
12220
|
+
const t = ti(e), r = t[t.length - 1];
|
|
12186
12221
|
if ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === r?.namespaceURI && "tbl" === r.localName) {
|
|
12187
12222
|
const t = e.ownerDocument;
|
|
12188
|
-
t && e.appendChild(t.createElementNS(
|
|
12223
|
+
t && e.appendChild(t.createElementNS(Qn, "w:p"));
|
|
12189
12224
|
}
|
|
12190
12225
|
}
|
|
12191
12226
|
}
|
|
12192
|
-
function
|
|
12193
|
-
const r =
|
|
12227
|
+
function pi(e, t) {
|
|
12228
|
+
const r = Do(e, t), n = oi(r, "tbl");
|
|
12194
12229
|
return n ? (function(e, t) {
|
|
12195
|
-
const r =
|
|
12230
|
+
const r = an(e)?.xml;
|
|
12196
12231
|
if (!r) return;
|
|
12197
|
-
const n =
|
|
12232
|
+
const n = oi(r, "tbl");
|
|
12198
12233
|
if (!n) return;
|
|
12199
12234
|
(function(e, t) {
|
|
12200
12235
|
for (let r = 0; r < e.attributes.length; r += 1) {
|
|
@@ -12204,35 +12239,35 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12204
12239
|
(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));
|
|
12205
12240
|
}
|
|
12206
12241
|
})(n, t);
|
|
12207
|
-
const o =
|
|
12242
|
+
const o = ti(n), i = ti(t), a = o.filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "tr" === e.localName), s = i.filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "tr" === e.localName);
|
|
12208
12243
|
if (a.length !== s.length) return;
|
|
12209
|
-
const l =
|
|
12244
|
+
const l = si(o), c = new Map([...si(i)].map(([e, t]) => [t, e]));
|
|
12210
12245
|
for (let u = 0; u < o.length; u += 1) {
|
|
12211
12246
|
const e = o[u];
|
|
12212
12247
|
if (l.has(e)) continue;
|
|
12213
|
-
if (
|
|
12248
|
+
if (ai(ii(e))) continue;
|
|
12214
12249
|
const r = o.slice(u + 1).map((e) => l.get(e)).find((e) => Boolean(e)), n = r ? c.get(r) ?? null : null;
|
|
12215
12250
|
t.insertBefore(e.cloneNode(!0), n);
|
|
12216
12251
|
}
|
|
12217
|
-
}(e, n),
|
|
12218
|
-
const r =
|
|
12252
|
+
}(e, n), ci(e, n), ui(e, n), di(n), function(e, t) {
|
|
12253
|
+
const r = Lo(t, "tr");
|
|
12219
12254
|
if (r.length === e.rows.length) {
|
|
12220
12255
|
for (let t = 0; t < r.length; t += 1) {
|
|
12221
|
-
const n = r[t], o = e.rows[t], i =
|
|
12222
|
-
i.length === o.cells.length &&
|
|
12256
|
+
const n = r[t], o = e.rows[t], i = Lo(n, "tc");
|
|
12257
|
+
i.length === o.cells.length && Uo(n, i.map((e, t) => ({
|
|
12223
12258
|
element: e,
|
|
12224
12259
|
wrappers: o.cells[t].sdtWrappers ?? []
|
|
12225
12260
|
})));
|
|
12226
12261
|
}
|
|
12227
|
-
|
|
12262
|
+
Uo(t, r.map((t, r) => ({
|
|
12228
12263
|
element: t,
|
|
12229
12264
|
wrappers: e.rows[r].sdtWrappers ?? []
|
|
12230
12265
|
})));
|
|
12231
12266
|
}
|
|
12232
|
-
}(e, n), new b.XMLSerializer().serializeToString(n).replace(`<w:tbl xmlns:w="${
|
|
12267
|
+
}(e, n), new b.XMLSerializer().serializeToString(n).replace(`<w:tbl xmlns:w="${Qn}"`, "<w:tbl")) : r;
|
|
12233
12268
|
}
|
|
12234
|
-
const
|
|
12235
|
-
function
|
|
12269
|
+
const fi = `xmlns:oasis="urn:oasis:docx" xmlns:w="${Qn}" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" 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:m="http://schemas.openxmlformats.org/officeDocument/2006/math"`;
|
|
12270
|
+
function hi(e) {
|
|
12236
12271
|
const t = [];
|
|
12237
12272
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
12238
12273
|
const n = e.childNodes[r];
|
|
@@ -12240,10 +12275,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12240
12275
|
}
|
|
12241
12276
|
return t;
|
|
12242
12277
|
}
|
|
12243
|
-
function
|
|
12278
|
+
function mi(e, t, r) {
|
|
12244
12279
|
const n = e.ownerDocument;
|
|
12245
12280
|
if (!n) return;
|
|
12246
|
-
const o = n.createElementNS(
|
|
12281
|
+
const o = n.createElementNS(Qn, `w:${r}`);
|
|
12247
12282
|
for (let i = 0; i < t.attributes.length; i += 1) {
|
|
12248
12283
|
const e = t.attributes.item(i);
|
|
12249
12284
|
e && (e.namespaceURI ? o.setAttributeNS(e.namespaceURI, e.name, e.value) : o.setAttribute(e.name, e.value));
|
|
@@ -12251,72 +12286,72 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12251
12286
|
for (; t.firstChild;) o.appendChild(t.firstChild);
|
|
12252
12287
|
e.replaceChild(o, t);
|
|
12253
12288
|
}
|
|
12254
|
-
function
|
|
12289
|
+
function gi(e) {
|
|
12255
12290
|
const t = function(e) {
|
|
12256
|
-
const t = new b.DOMParser().parseFromString(`<oasis:root ${
|
|
12291
|
+
const t = new b.DOMParser().parseFromString(`<oasis:root ${fi}>${e}</oasis:root>`, "application/xml").documentElement;
|
|
12257
12292
|
if (!t) return;
|
|
12258
|
-
const r =
|
|
12293
|
+
const r = hi(t);
|
|
12259
12294
|
if (1 !== r.length) return;
|
|
12260
12295
|
const n = r[0];
|
|
12261
12296
|
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === n.namespaceURI && "r" === n.localName ? n : void 0;
|
|
12262
12297
|
}(e);
|
|
12263
12298
|
if (!t) return e;
|
|
12264
|
-
const r =
|
|
12299
|
+
const r = hi(t), n = r.filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "t" === e.localName);
|
|
12265
12300
|
if (n.length > 0) {
|
|
12266
12301
|
for (const e of r) "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "delText" === e.localName && t.removeChild(e);
|
|
12267
|
-
for (const e of n)
|
|
12302
|
+
for (const e of n) mi(t, e, "delText");
|
|
12268
12303
|
}
|
|
12269
|
-
const o =
|
|
12304
|
+
const o = hi(t), i = o.filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "instrText" === e.localName);
|
|
12270
12305
|
if (i.length > 0) {
|
|
12271
12306
|
for (const e of o) "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "delInstrText" === e.localName && t.removeChild(e);
|
|
12272
|
-
for (const e of i)
|
|
12307
|
+
for (const e of i) mi(t, e, "delInstrText");
|
|
12273
12308
|
}
|
|
12274
12309
|
return new b.XMLSerializer().serializeToString(t);
|
|
12275
12310
|
}
|
|
12276
|
-
function
|
|
12311
|
+
function wi(e) {
|
|
12277
12312
|
return /^\d+$/.test(e) ? e : String(Array.from(e).reduce((e, t) => 31 * e + t.charCodeAt(0) >>> 0, 0));
|
|
12278
12313
|
}
|
|
12279
|
-
function
|
|
12314
|
+
function bi(e) {
|
|
12280
12315
|
const t = Number.isFinite(e.date) ? new Date(e.date).toISOString() : (/* @__PURE__ */ new Date(0)).toISOString();
|
|
12281
|
-
return `w:id="${
|
|
12316
|
+
return `w:id="${wi(e.id)}" w:author="${to(e.author)}" w:date="${t}"`;
|
|
12282
12317
|
}
|
|
12283
|
-
function
|
|
12318
|
+
function vi(e) {
|
|
12284
12319
|
if (!e || 0 === e.length) return "";
|
|
12285
12320
|
const t = e.map((e) => {
|
|
12286
|
-
const t =
|
|
12321
|
+
const t = oo(e.position);
|
|
12287
12322
|
if (null === t) return "";
|
|
12288
12323
|
const r = [`w:val="${e.type}"`, `w:pos="${t}"`];
|
|
12289
12324
|
return e.leader && "none" !== e.leader ? r.push(`w:leader="${e.leader}"`) : "none" === e.leader && r.push("w:leader=\"none\""), `<w:tab ${r.join(" ")}/>`;
|
|
12290
12325
|
}).filter(Boolean);
|
|
12291
12326
|
return t.length > 0 ? `<w:tabs>${t.join("")}</w:tabs>` : "";
|
|
12292
12327
|
}
|
|
12293
|
-
function
|
|
12328
|
+
function yi(e) {
|
|
12294
12329
|
const t = [];
|
|
12295
12330
|
e.framePrXml && t.push(e.framePrXml), e.suppressLineNumbers && t.push("<w:suppressLineNumbers/>"), e.suppressAutoHyphens && t.push("<w:suppressAutoHyphens/>"), e.bidi && t.push("<w:bidi/>"), !1 === e.kinsoku && t.push("<w:kinsoku w:val=\"0\"/>"), !1 === e.wordWrap && t.push("<w:wordWrap w:val=\"0\"/>"), !1 === e.overflowPunct && t.push("<w:overflowPunct w:val=\"0\"/>"), e.topLinePunct && t.push("<w:topLinePunct/>"), !1 === e.autoSpaceDE && t.push("<w:autoSpaceDE w:val=\"0\"/>"), !1 === e.autoSpaceDN && t.push("<w:autoSpaceDN w:val=\"0\"/>"), !1 === e.adjustRightInd && t.push("<w:adjustRightInd w:val=\"0\"/>"), e.textAlignment && t.push(`<w:textAlignment w:val="${e.textAlignment}"/>`), e.textboxTightWrap && t.push(`<w:textboxTightWrap w:val="${e.textboxTightWrap}"/>`), null != e.divId && t.push(`<w:divId w:val="${e.divId}"/>`);
|
|
12296
12331
|
const r = (n = e.conditionalStyle) ? `<w:cnfStyle w:val="${Tt.map(([, e]) => n[e] ? "1" : "0").join("")}"/>` : "";
|
|
12297
12332
|
var n;
|
|
12298
12333
|
return r && t.push(r), t;
|
|
12299
12334
|
}
|
|
12300
|
-
function
|
|
12301
|
-
const { propertyRevision: t, styleId: r, ...n } = e.previous, o =
|
|
12302
|
-
return `<w:pPrChange ${
|
|
12335
|
+
function xi(e) {
|
|
12336
|
+
const { propertyRevision: t, styleId: r, ...n } = e.previous, o = Si(n), i = o ? o.slice(7, -8) : "", a = r ? `<w:pStyle w:val="${to(r)}"/>` : "";
|
|
12337
|
+
return `<w:pPrChange ${bi(e)}><w:pPr>${a}${i}</w:pPr></w:pPrChange>`;
|
|
12303
12338
|
}
|
|
12304
|
-
function
|
|
12339
|
+
function Si(e) {
|
|
12305
12340
|
const t = [];
|
|
12306
12341
|
if (e.align && t.push(`<w:jc w:val="${e.align}"/>`), void 0 !== e.spacingBefore || void 0 !== e.spacingAfter || void 0 !== e.lineHeight) {
|
|
12307
|
-
const r = [], n =
|
|
12342
|
+
const r = [], n = no(e.spacingBefore), o = no(e.spacingAfter), i = void 0 !== e.lineHeight && null !== e.lineHeight && Number.isFinite(e.lineHeight), a = "exact" === e.lineRule || "atLeast" === e.lineRule, s = i ? a ? ro(e.lineHeight, 0) : Math.round(240 * e.lineHeight) : null;
|
|
12308
12343
|
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(" ")}/>`);
|
|
12309
12344
|
}
|
|
12310
12345
|
if (void 0 !== e.indentLeft || void 0 !== e.indentRight || void 0 !== e.indentFirstLine || void 0 !== e.indentHanging) {
|
|
12311
|
-
const r = [], n =
|
|
12346
|
+
const r = [], n = no(e.indentLeft), o = no(e.indentRight), i = no(e.indentFirstLine), a = no(e.indentHanging);
|
|
12312
12347
|
null !== n && r.push(`w:left="${n}"`), null !== o && r.push(`w:right="${o}"`), null !== i && r.push(`w:firstLine="${i}"`), null !== a && r.push(`w:hanging="${a}"`), r.length > 0 && t.push(`<w:ind ${r.join(" ")}/>`);
|
|
12313
12348
|
}
|
|
12314
|
-
const r =
|
|
12349
|
+
const r = vi(e.tabs);
|
|
12315
12350
|
r && t.push(r), e.pageBreakBefore && t.push("<w:pageBreakBefore/>"), e.keepWithNext && t.push("<w:keepNext/>"), e.keepLinesTogether && t.push("<w:keepLines/>"), !1 === e.widowControl && t.push("<w:widowControl w:val=\"0\"/>"), e.contextualSpacing && t.push("<w:contextualSpacing/>"), e.mirrorIndents && t.push("<w:mirrorIndents/>");
|
|
12316
|
-
const n =
|
|
12317
|
-
return n && t.push(n), e.shading && t.push(
|
|
12351
|
+
const n = mo(e);
|
|
12352
|
+
return n && t.push(n), e.shading && t.push(ao(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(...yi(e)), e.propertyRevision && t.push(xi(e.propertyRevision)), t.length > 0 ? `<w:pPr>${t.join("")}</w:pPr>` : "";
|
|
12318
12353
|
}
|
|
12319
|
-
function
|
|
12354
|
+
function Ni(e, t, r, n) {
|
|
12320
12355
|
const o = [], i = function(e, t) {
|
|
12321
12356
|
const r = ie(e.style, t);
|
|
12322
12357
|
return {
|
|
@@ -12363,26 +12398,26 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12363
12398
|
propertyRevision: e.style?.propertyRevision
|
|
12364
12399
|
};
|
|
12365
12400
|
}(e, r), a = e.style?.align ?? n?.align ?? i.align;
|
|
12366
|
-
if (e.style?.styleId && o.push(`<w:pStyle w:val="${
|
|
12367
|
-
const e = [], t =
|
|
12401
|
+
if (e.style?.styleId && o.push(`<w:pStyle w:val="${to(e.style.styleId)}"/>`), a && o.push(`<w:jc w:val="${a}"/>`), void 0 !== i.spacingBefore || void 0 !== i.spacingAfter || void 0 !== i.lineHeight) {
|
|
12402
|
+
const e = [], t = no(i.spacingBefore), r = no(i.spacingAfter), n = void 0 !== i.lineHeight && null !== i.lineHeight && Number.isFinite(i.lineHeight), a = "exact" === i.lineRule || "atLeast" === i.lineRule, s = n ? a ? ro(i.lineHeight, 0) : Math.round(240 * i.lineHeight) : null;
|
|
12368
12403
|
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(" ")}/>`);
|
|
12369
12404
|
}
|
|
12370
12405
|
if (void 0 !== i.indentLeft || void 0 !== i.indentRight || void 0 !== i.indentFirstLine || void 0 !== i.indentHanging) {
|
|
12371
|
-
const e = [], t =
|
|
12406
|
+
const e = [], t = no(i.indentLeft), r = no(i.indentRight), n = no(i.indentFirstLine), a = no(i.indentHanging);
|
|
12372
12407
|
null !== t && e.push(`w:left="${t}"`), null !== r && e.push(`w:right="${r}"`), null !== n && e.push(`w:firstLine="${n}"`), null !== a && e.push(`w:hanging="${a}"`), e.length > 0 && o.push(`<w:ind ${e.join(" ")}/>`);
|
|
12373
12408
|
}
|
|
12374
|
-
const s =
|
|
12409
|
+
const s = vi(i.tabs);
|
|
12375
12410
|
s && o.push(s), i.pageBreakBefore && o.push("<w:pageBreakBefore/>"), i.keepWithNext && o.push("<w:keepNext/>"), i.keepLinesTogether && o.push("<w:keepLines/>"), !1 === i.widowControl && o.push("<w:widowControl w:val=\"0\"/>"), i.contextualSpacing && o.push("<w:contextualSpacing/>"), i.mirrorIndents && o.push("<w:mirrorIndents/>");
|
|
12376
|
-
const l =
|
|
12377
|
-
l && o.push(l), i.shading && o.push(
|
|
12378
|
-
const c = t.get(e.id), u = e.numberingRevision ? `<w:numberingChange ${
|
|
12411
|
+
const l = mo(i);
|
|
12412
|
+
l && o.push(l), i.shading && o.push(ao(i.shading)), i.textDirection && o.push(`<w:textDirection w:val="${i.textDirection}"/>`), null != i.outlineLevel && o.push(`<w:outlineLvl w:val="${i.outlineLevel}"/>`), o.push(...yi(i));
|
|
12413
|
+
const c = t.get(e.id), u = e.numberingRevision ? `<w:numberingChange ${bi(e.numberingRevision)}${void 0 !== e.numberingRevision.original ? ` w:original="${to(e.numberingRevision.original)}"` : ""}/>` : "";
|
|
12379
12414
|
if (c || u) {
|
|
12380
12415
|
const e = c ? `<w:ilvl w:val="${c.level}"/><w:numId w:val="${c.numId}"/>` : "";
|
|
12381
12416
|
o.push(`<w:numPr>${e}${u}</w:numPr>`);
|
|
12382
12417
|
}
|
|
12383
|
-
return e.style?.propertyRevision && o.push(
|
|
12418
|
+
return e.style?.propertyRevision && o.push(xi(e.style.propertyRevision)), o.length > 0 ? `<w:pPr>${o.join("")}</w:pPr>` : "";
|
|
12384
12419
|
}
|
|
12385
|
-
const
|
|
12420
|
+
const Ei = {
|
|
12386
12421
|
black: [
|
|
12387
12422
|
0,
|
|
12388
12423
|
0,
|
|
@@ -12463,7 +12498,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12463
12498
|
211,
|
|
12464
12499
|
211
|
|
12465
12500
|
]
|
|
12466
|
-
},
|
|
12501
|
+
}, ki = {
|
|
12467
12502
|
ffff00: "yellow",
|
|
12468
12503
|
fef08a: "yellow",
|
|
12469
12504
|
ff0000: "red",
|
|
@@ -12473,43 +12508,43 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12473
12508
|
ff00ff: "magenta",
|
|
12474
12509
|
"000000": "black",
|
|
12475
12510
|
ffffff: "white"
|
|
12476
|
-
},
|
|
12477
|
-
function
|
|
12478
|
-
return `<w14:solidFill><w14:srgbClr w14:val="${
|
|
12511
|
+
}, _i = "http://schemas.openxmlformats.org/markup-compatibility/2006";
|
|
12512
|
+
function Ti(e) {
|
|
12513
|
+
return `<w14:solidFill><w14:srgbClr w14:val="${io(e)}"/></w14:solidFill>`;
|
|
12479
12514
|
}
|
|
12480
|
-
function
|
|
12481
|
-
return "solid" === e.type ?
|
|
12482
|
-
const t =
|
|
12515
|
+
function Ii(e) {
|
|
12516
|
+
return "solid" === e.type ? Ti(e.color) : `<w14:gradFill><w14:gsLst>${e.stops.map((e) => {
|
|
12517
|
+
const t = io(e.color);
|
|
12483
12518
|
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>`;
|
|
12484
12519
|
}).join("")}</w14:gsLst><w14:lin w14:ang="${Math.round((e.angle ?? 0) * $)}" w14:scaled="0"/></w14:gradFill>`;
|
|
12485
12520
|
}
|
|
12486
|
-
function
|
|
12487
|
-
return `<w14:srgbClr w14:val="${
|
|
12521
|
+
function Ci(e, t) {
|
|
12522
|
+
return `<w14:srgbClr w14:val="${io(e)}">${void 0 !== t ? `<w14:alpha w14:val="${Math.round(t * R)}"/>` : ""}</w14:srgbClr>`;
|
|
12488
12523
|
}
|
|
12489
|
-
function
|
|
12490
|
-
return `<mc:AlternateContent xmlns:mc="${
|
|
12524
|
+
function Ai(e) {
|
|
12525
|
+
return `<mc:AlternateContent xmlns:mc="${_i}"><mc:Choice Requires="w14">${e}</mc:Choice><mc:Fallback/></mc:AlternateContent>`;
|
|
12491
12526
|
}
|
|
12492
|
-
function
|
|
12527
|
+
function Ri(e) {
|
|
12493
12528
|
return null != e && Number.isFinite(e) ? Math.round(20 * e) : null;
|
|
12494
12529
|
}
|
|
12495
|
-
const
|
|
12530
|
+
const $i = function(e) {
|
|
12496
12531
|
if (!e) return null;
|
|
12497
|
-
const t =
|
|
12498
|
-
return
|
|
12532
|
+
const t = fr(e);
|
|
12533
|
+
return pr.test(t) ? [
|
|
12499
12534
|
Number.parseInt(t.slice(0, 2), 16),
|
|
12500
12535
|
Number.parseInt(t.slice(2, 4), 16),
|
|
12501
12536
|
Number.parseInt(t.slice(4, 6), 16)
|
|
12502
12537
|
] : null;
|
|
12503
12538
|
};
|
|
12504
|
-
function
|
|
12539
|
+
function Di(e) {
|
|
12505
12540
|
if (!e) return "";
|
|
12506
12541
|
const t = [];
|
|
12507
12542
|
if (e.bold && t.push("<w:b/>", "<w:bCs/>"), e.italic && t.push("<w:i/>", "<w:iCs/>"), e.underline) {
|
|
12508
|
-
const r = e.underlineStyle ?? "single", n = e.underlineColor ? ` w:color="${
|
|
12509
|
-
t.push(`<w:u w:val="${
|
|
12543
|
+
const r = e.underlineStyle ?? "single", n = e.underlineColor ? ` w:color="${to(e.underlineColor.replace(/^#/, ""))}"` : "";
|
|
12544
|
+
t.push(`<w:u w:val="${to(r)}"${n}/>`);
|
|
12510
12545
|
}
|
|
12511
|
-
if (e.strike && t.push("<w:strike/>"), e.doubleStrike && t.push("<w:dstrike/>"), e.outline && t.push("<w:outline/>"), e.shadow && t.push("<w:shadow/>"), e.emboss && t.push("<w:emboss/>"), e.imprint && t.push("<w:imprint/>"), e.smallCaps && t.push("<w:smallCaps/>"), e.allCaps && t.push("<w:caps/>"), e.hidden && t.push("<w:vanish/>"), e.noProof && t.push("<w:noProof/>"), e.webHidden && t.push("<w:webHidden/>"), e.specVanish && t.push("<w:specVanish/>"), !1 === e.snapToGrid && t.push("<w:snapToGrid w:val=\"0\"/>"), e.textEffect && t.push(`<w:effect w:val="${
|
|
12512
|
-
const r =
|
|
12546
|
+
if (e.strike && t.push("<w:strike/>"), e.doubleStrike && t.push("<w:dstrike/>"), e.outline && t.push("<w:outline/>"), e.shadow && t.push("<w:shadow/>"), e.emboss && t.push("<w:emboss/>"), e.imprint && t.push("<w:imprint/>"), e.smallCaps && t.push("<w:smallCaps/>"), e.allCaps && t.push("<w:caps/>"), e.hidden && t.push("<w:vanish/>"), e.noProof && t.push("<w:noProof/>"), e.webHidden && t.push("<w:webHidden/>"), e.specVanish && t.push("<w:specVanish/>"), !1 === e.snapToGrid && t.push("<w:snapToGrid w:val=\"0\"/>"), e.textEffect && t.push(`<w:effect w:val="${to(e.textEffect)}"/>`), e.textBorder && t.push(`<w:bdr ${ho(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) {
|
|
12547
|
+
const r = Ri(e.characterSpacing);
|
|
12513
12548
|
null !== r && t.push(`<w:spacing w:val="${r}"/>`);
|
|
12514
12549
|
}
|
|
12515
12550
|
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))}"/>`);
|
|
@@ -12543,7 +12578,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12543
12578
|
const i = function(e) {
|
|
12544
12579
|
return "number" != typeof e || e < 1 || e > 20 ? null : (1 << e - 1).toString(16).toUpperCase().padStart(8, "0");
|
|
12545
12580
|
}(e.stylisticSet);
|
|
12546
|
-
if (i && t.push(`<w14:stylisticSets w14:val="${i}"/>`), e.contextualAlternates && t.push("<w14:cntxtAlts w14:val=\"1\"/>"), e.superscript ? t.push("<w:vertAlign w:val=\"superscript\"/>") : e.subscript && t.push("<w:vertAlign w:val=\"subscript\"/>"), e.fontFamily && t.push(`<w:rFonts w:ascii="${
|
|
12581
|
+
if (i && t.push(`<w14:stylisticSets w14:val="${i}"/>`), e.contextualAlternates && t.push("<w14:cntxtAlts w14:val=\"1\"/>"), e.superscript ? t.push("<w:vertAlign w:val=\"superscript\"/>") : e.subscript && t.push("<w:vertAlign w:val=\"subscript\"/>"), e.fontFamily && t.push(`<w:rFonts w:ascii="${to(e.fontFamily)}" w:hAnsi="${to(e.fontFamily)}" w:cs="${to(e.fontFamily)}"/>`), void 0 !== e.fontSize && null !== e.fontSize) {
|
|
12547
12582
|
const r = function(e) {
|
|
12548
12583
|
return null != e && Number.isFinite(e) ? Math.round(e / 96 * 72 * 2) : null;
|
|
12549
12584
|
}(e.fontSize);
|
|
@@ -12552,65 +12587,65 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12552
12587
|
if (e.textFill) {
|
|
12553
12588
|
const r = "solid" === e.textFill.type ? e.textFill.color : e.color;
|
|
12554
12589
|
t.push(function(e, t) {
|
|
12555
|
-
const r =
|
|
12556
|
-
return `<mc:AlternateContent xmlns:mc="${
|
|
12590
|
+
const r = Ii(e), n = io(t ?? "000000");
|
|
12591
|
+
return `<mc:AlternateContent xmlns:mc="${_i}"><mc:Choice Requires="w14"><w14:textFill>${r}</w14:textFill></mc:Choice><mc:Fallback><w:color w:val="${n}"/></mc:Fallback></mc:AlternateContent>`;
|
|
12557
12592
|
}(e.textFill, r ?? null));
|
|
12558
|
-
} else e.color && t.push(`<w:color w:val="${
|
|
12593
|
+
} else e.color && t.push(`<w:color w:val="${to(e.color.replace(/^#/, ""))}"/>`);
|
|
12559
12594
|
if (e.textOutline && t.push(function(e) {
|
|
12560
|
-
const t = Math.round(Math.max(0, e.widthPt) * C), r = e.fill ?
|
|
12561
|
-
return `<mc:AlternateContent xmlns:mc="${
|
|
12595
|
+
const t = Math.round(Math.max(0, e.widthPt) * C), r = e.fill ? Ii(e.fill) : e.color ? Ti(e.color) : "";
|
|
12596
|
+
return `<mc:AlternateContent xmlns:mc="${_i}"><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>";
|
|
12562
12597
|
}(e.textOutline)), e.textShadow && t.push(function(e) {
|
|
12563
|
-
const t = Math.round(Math.max(0, e.blurPt) * C), r = Math.round(Math.max(0, e.distPt) * C), n = Math.round(e.dirDeg * $), o =
|
|
12564
|
-
return `<mc:AlternateContent xmlns:mc="${
|
|
12598
|
+
const t = Math.round(Math.max(0, e.blurPt) * C), r = Math.round(Math.max(0, e.distPt) * C), n = Math.round(e.dirDeg * $), o = Ci(e.color, e.alpha);
|
|
12599
|
+
return `<mc:AlternateContent xmlns:mc="${_i}"><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>";
|
|
12565
12600
|
}(e.textShadow)), e.glow && t.push(function(e) {
|
|
12566
|
-
const t = Math.round(Math.max(0, e.radiusPt) * C), r =
|
|
12567
|
-
return `<mc:AlternateContent xmlns:mc="${
|
|
12601
|
+
const t = Math.round(Math.max(0, e.radiusPt) * C), r = Ci(e.color, e.alpha);
|
|
12602
|
+
return `<mc:AlternateContent xmlns:mc="${_i}"><mc:Choice Requires="w14"><w14:glow w14:rad="${t}">${r}</w14:glow></mc:Choice><mc:Fallback/></mc:AlternateContent>`;
|
|
12568
12603
|
}(e.glow)), e.reflection && t.push(function(e) {
|
|
12569
12604
|
const t = Math.round(Math.max(0, e.blurPt) * C), 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) * C);
|
|
12570
|
-
return `<mc:AlternateContent xmlns:mc="${
|
|
12571
|
-
}(e.reflection)), e.scene3dXml && t.push(
|
|
12572
|
-
if (e in
|
|
12573
|
-
const t = e.trim().replace(/^#/, "").toLowerCase(), r =
|
|
12605
|
+
return `<mc:AlternateContent xmlns:mc="${_i}"><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>`;
|
|
12606
|
+
}(e.reflection)), e.scene3dXml && t.push(Ai(e.scene3dXml)), e.props3dXml && t.push(Ai(e.props3dXml)), e.highlight && t.push(`<w:highlight w:val="${to(function(e) {
|
|
12607
|
+
if (e in Ei) return e;
|
|
12608
|
+
const t = e.trim().replace(/^#/, "").toLowerCase(), r = ki[t];
|
|
12574
12609
|
if (r) return r;
|
|
12575
|
-
const n =
|
|
12610
|
+
const n = $i(e);
|
|
12576
12611
|
if (!n) return "yellow";
|
|
12577
12612
|
let o = "yellow", i = Number.POSITIVE_INFINITY;
|
|
12578
|
-
for (const [a, s] of Object.entries(
|
|
12613
|
+
for (const [a, s] of Object.entries(Ei)) {
|
|
12579
12614
|
const e = (s[0] - n[0]) ** 2 + (s[1] - n[1]) ** 2 + (s[2] - n[2]) ** 2;
|
|
12580
12615
|
e < i && (i = e, o = a);
|
|
12581
12616
|
}
|
|
12582
12617
|
return o;
|
|
12583
|
-
}(e.highlight))}"/>`), e.shading && t.push(
|
|
12584
|
-
const r =
|
|
12618
|
+
}(e.highlight))}"/>`), e.shading && t.push(ao(e.shading)), void 0 !== e.fitText && null !== e.fitText && Number.isFinite(e.fitText)) {
|
|
12619
|
+
const r = Ri(e.fitText);
|
|
12585
12620
|
null !== r && r > 0 && t.push(`<w:fitText w:val="${r}"/>`);
|
|
12586
12621
|
}
|
|
12587
|
-
if (e.rtl && t.push("<w:rtl/>"), e.complexScript && t.push("<w:cs/>"), e.emphasisMark && t.push(`<w:em w:val="${
|
|
12622
|
+
if (e.rtl && t.push("<w:rtl/>"), e.complexScript && t.push("<w:cs/>"), e.emphasisMark && t.push(`<w:em w:val="${to(e.emphasisMark)}"/>`), e.language) {
|
|
12588
12623
|
const r = [];
|
|
12589
|
-
e.language.value && r.push(`w:val="${
|
|
12624
|
+
e.language.value && r.push(`w:val="${to(e.language.value)}"`), e.language.eastAsia && r.push(`w:eastAsia="${to(e.language.eastAsia)}"`), e.language.bidi && r.push(`w:bidi="${to(e.language.bidi)}"`), r.length > 0 && t.push(`<w:lang ${r.join(" ")}/>`);
|
|
12590
12625
|
}
|
|
12591
12626
|
return e.propertyRevision && t.push(function(e) {
|
|
12592
|
-
const { propertyRevision: t, styleId: r, ...n } = e.previous, o =
|
|
12593
|
-
return `<w:rPrChange ${
|
|
12627
|
+
const { propertyRevision: t, styleId: r, ...n } = e.previous, o = Di(n), i = o ? o.slice(7, -8) : "", a = r ? `<w:rStyle w:val="${to(r)}"/>` : "";
|
|
12628
|
+
return `<w:rPrChange ${bi(e)}><w:rPr>${a}${i}</w:rPr></w:rPrChange>`;
|
|
12594
12629
|
}(e.propertyRevision)), t.length > 0 ? `<w:rPr>${t.join("")}</w:rPr>` : "";
|
|
12595
12630
|
}
|
|
12596
|
-
function
|
|
12597
|
-
return 0 === e.length ? "" : `<w:t${t = e, /^\s|\s$/.test(t) || t.includes(" ") ? " xml:space=\"preserve\"" : ""}>${
|
|
12631
|
+
function Pi(e) {
|
|
12632
|
+
return 0 === e.length ? "" : `<w:t${t = e, /^\s|\s$/.test(t) || t.includes(" ") ? " xml:space=\"preserve\"" : ""}>${to(e)}</w:t>`;
|
|
12598
12633
|
var t;
|
|
12599
12634
|
}
|
|
12600
|
-
function
|
|
12635
|
+
function Mi(e) {
|
|
12601
12636
|
if (0 === e.length) return "<w:t></w:t>";
|
|
12602
12637
|
let t = "", r = "";
|
|
12603
|
-
for (const n of e) "\n" !== n ? " " !== n ? "‑" !== n ? "" !== n ? r += n : (t +=
|
|
12604
|
-
return t +=
|
|
12638
|
+
for (const n of e) "\n" !== n ? " " !== n ? "‑" !== n ? "" !== n ? r += n : (t += Pi(r), r = "", t += "<w:softHyphen/>") : (t += Pi(r), r = "", t += "<w:noBreakHyphen/>") : (t += Pi(r), r = "", t += "<w:tab/>") : (t += Pi(r), r = "", t += "<w:br/>");
|
|
12639
|
+
return t += Pi(r), t || "<w:t></w:t>";
|
|
12605
12640
|
}
|
|
12606
|
-
function
|
|
12641
|
+
function Oi(e, t) {
|
|
12607
12642
|
return e ?? t ? "1" : "0";
|
|
12608
12643
|
}
|
|
12609
|
-
function
|
|
12610
|
-
const n =
|
|
12611
|
-
return t?.align ? `<wp:${e} relativeFrom="${n}"><wp:align>${
|
|
12644
|
+
function Li(e, t, r) {
|
|
12645
|
+
const n = to(t?.relativeFrom ?? r);
|
|
12646
|
+
return t?.align ? `<wp:${e} relativeFrom="${n}"><wp:align>${to(t.align)}</wp:align></wp:${e}>` : `<wp:${e} relativeFrom="${n}"><wp:posOffset>${t?.offset ?? 0}</wp:posOffset></wp:${e}>`;
|
|
12612
12647
|
}
|
|
12613
|
-
function
|
|
12648
|
+
function Fi(e) {
|
|
12614
12649
|
if (!e || e.length < 3) return "";
|
|
12615
12650
|
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];
|
|
12616
12651
|
return `<wp:wrapPolygon edited="0">${[
|
|
@@ -12619,30 +12654,30 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12619
12654
|
r(n, "lineTo")
|
|
12620
12655
|
].join("")}</wp:wrapPolygon>`;
|
|
12621
12656
|
}
|
|
12622
|
-
function
|
|
12623
|
-
const { cx: t, cy: r, floating: n, docPrId: o, docPrName: i, altAttr: a, graphicXml: s } = e, l =
|
|
12657
|
+
function Bi(e) {
|
|
12658
|
+
const { cx: t, cy: r, floating: n, docPrId: o, docPrName: i, altAttr: a, graphicXml: s } = e, l = to(i);
|
|
12624
12659
|
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>`;
|
|
12625
|
-
const c = n.distT ?? 0, u = n.distB ?? 0, d = n.distL ?? 0, p = n.distR ?? 0, f =
|
|
12660
|
+
const c = n.distT ?? 0, u = n.distB ?? 0, d = n.distL ?? 0, p = n.distR ?? 0, f = Li("positionH", n.positionH, "column"), h = Li("positionV", n.positionV, "paragraph"), m = function(e, t) {
|
|
12626
12661
|
switch (e) {
|
|
12627
12662
|
case "square": return "<wp:wrapSquare wrapText=\"bothSides\"/>";
|
|
12628
12663
|
case "tight": {
|
|
12629
|
-
const e =
|
|
12664
|
+
const e = Fi(t);
|
|
12630
12665
|
return e ? `<wp:wrapTight wrapText="bothSides">${e}</wp:wrapTight>` : "<wp:wrapTight wrapText=\"bothSides\"/>";
|
|
12631
12666
|
}
|
|
12632
12667
|
case "through": {
|
|
12633
|
-
const e =
|
|
12668
|
+
const e = Fi(t);
|
|
12634
12669
|
return e ? `<wp:wrapThrough wrapText="bothSides">${e}</wp:wrapThrough>` : "<wp:wrapThrough wrapText=\"bothSides\"/>";
|
|
12635
12670
|
}
|
|
12636
12671
|
case "topAndBottom": return "<wp:wrapTopAndBottom/>";
|
|
12637
12672
|
default: return "<wp:wrapNone/>";
|
|
12638
12673
|
}
|
|
12639
12674
|
}(n.wrap, e.wrapPolygon);
|
|
12640
|
-
return `<w:drawing><wp:anchor distT="${c}" distB="${u}" distL="${d}" distR="${p}" simplePos="${
|
|
12675
|
+
return `<w:drawing><wp:anchor distT="${c}" distB="${u}" distL="${d}" distR="${p}" simplePos="${Oi(n.simplePos, !1)}" relativeHeight="${n.relativeHeight ?? 0}" behindDoc="${Oi(n.behindDoc, !1)}" locked="${Oi(n.locked, !1)}" layoutInCell="${Oi(n.layoutInCell, !0)}" allowOverlap="${Oi(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>`;
|
|
12641
12676
|
}
|
|
12642
|
-
function
|
|
12677
|
+
function Ui(e, t, r, n) {
|
|
12643
12678
|
const o = r.images.find((e) => e.rId === t);
|
|
12644
12679
|
if (!o) return null;
|
|
12645
|
-
const i = (parseInt(t.replace(/\D+/g, ""), 10) || 0) + 1, a = void 0 !== o.alt ? ` descr="${
|
|
12680
|
+
const i = (parseInt(t.replace(/\D+/g, ""), 10) || 0) + 1, a = void 0 !== o.alt ? ` descr="${to(o.alt)}" title="${to(o.alt)}"` : "", s = function(e) {
|
|
12646
12681
|
let t = "";
|
|
12647
12682
|
if (e.rotation) {
|
|
12648
12683
|
const r = Math.round(e.rotation * $);
|
|
@@ -12653,16 +12688,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12653
12688
|
if (!e) return "";
|
|
12654
12689
|
const t = (e) => e ? Math.round(e * R) : 0, r = t(e.left), n = t(e.top), o = t(e.right), i = t(e.bottom);
|
|
12655
12690
|
return 0 === r && 0 === n && 0 === o && 0 === i ? "" : `<a:srcRect l="${r}" t="${n}" r="${o}" b="${i}"/>`;
|
|
12656
|
-
}(o.crop), c = (u = o.border) ? `<a:ln${void 0 !== u.widthPt ? ` w="${Math.round(u.widthPt * C)}"` : ""}><a:solidFill><a:srgbClr val="${
|
|
12691
|
+
}(o.crop), c = (u = o.border) ? `<a:ln${void 0 !== u.widthPt ? ` w="${Math.round(u.widthPt * C)}"` : ""}><a:solidFill><a:srgbClr val="${to(u.color.replace(/^#/, ""))}"/></a:solidFill>${u.dash ? `<a:prstDash val="${u.dash}"/>` : ""}</a:ln>` : "";
|
|
12657
12692
|
var u;
|
|
12658
12693
|
const d = "tile" === o.fillMode ? "<a:tile/>" : "<a:stretch><a:fillRect/></a:stretch>", p = "linked" === o.kind ? `r:link="${t}"` : `r:embed="${t}"`, f = function(e) {
|
|
12659
12694
|
if (!e) return "<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>";
|
|
12660
12695
|
if (e.rawXml && !e.adjustments) return e.rawXml;
|
|
12661
|
-
const t = Object.entries(e.adjustments ?? {}).map(([e, t]) => `<a:gd name="${
|
|
12662
|
-
return `<a:prstGeom prst="${
|
|
12696
|
+
const t = Object.entries(e.adjustments ?? {}).map(([e, t]) => `<a:gd name="${to(e)}" fmla="val ${Number.isFinite(t) ? t : 0}"/>`).join(""), r = t ? `<a:avLst>${t}</a:avLst>` : "<a:avLst/>";
|
|
12697
|
+
return `<a:prstGeom prst="${to(e.preset)}">${r}</a:prstGeom>`;
|
|
12663
12698
|
}(o.cropShape);
|
|
12664
12699
|
return `<w:r>${n}${function(e, t, r, n) {
|
|
12665
|
-
return
|
|
12700
|
+
return Bi({
|
|
12666
12701
|
cx: e.cx,
|
|
12667
12702
|
cy: e.cy,
|
|
12668
12703
|
floating: e.floating,
|
|
@@ -12672,19 +12707,19 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12672
12707
|
graphicXml: n,
|
|
12673
12708
|
wrapPolygon: e.wrapPolygon
|
|
12674
12709
|
});
|
|
12675
|
-
}(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="${
|
|
12710
|
+
}(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="${Jn}"/>${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>${f}${c}</pic:spPr></pic:pic></a:graphicData></a:graphic>`)}</w:r>`;
|
|
12676
12711
|
}
|
|
12677
|
-
function
|
|
12678
|
-
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="${
|
|
12679
|
-
const a = e.shape, s =
|
|
12712
|
+
function zi(e, t, r, n, o, i) {
|
|
12713
|
+
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="${to(t.alt)}" title="${to(t.alt)}"` : "", d = function(e, t, r, n, o, i) {
|
|
12714
|
+
const a = e.shape, s = to(a?.preset ?? "rect"), l = e.rotation ? Math.round(e.rotation * $) : 0, c = 0 !== l ? ` rot="${l}"` : "", u = a?.fill ? `<a:solidFill><a:srgbClr val="${to(a.fill.replace(/^#/, ""))}"/></a:solidFill>` : "";
|
|
12680
12715
|
let d = "";
|
|
12681
|
-
(a?.borderColor || void 0 !== a?.borderWidthPt) && (d = `<a:ln${void 0 !== a?.borderWidthPt ? ` w="${Math.round(a.borderWidthPt * C)}"` : ""}>${a?.borderColor ? `<a:solidFill><a:srgbClr val="${
|
|
12682
|
-
const p = e.body, f = ["rot=\"0\"", `vert="${
|
|
12683
|
-
f.push(`wrap="${
|
|
12716
|
+
(a?.borderColor || void 0 !== a?.borderWidthPt) && (d = `<a:ln${void 0 !== a?.borderWidthPt ? ` w="${Math.round(a.borderWidthPt * C)}"` : ""}>${a?.borderColor ? `<a:solidFill><a:srgbClr val="${to(a.borderColor.replace(/^#/, ""))}"/></a:solidFill>` : ""}<a:miter lim="800000"/></a:ln>`);
|
|
12717
|
+
const p = e.body, f = ["rot=\"0\"", `vert="${to(p?.vert ?? "horz")}"`];
|
|
12718
|
+
f.push(`wrap="${to(p?.wrap ?? "square")}"`), void 0 !== p?.paddingLeft && f.push(`lIns="${Math.round(p.paddingLeft * I)}"`), void 0 !== p?.paddingTop && f.push(`tIns="${Math.round(p.paddingTop * I)}"`), void 0 !== p?.paddingRight && f.push(`rIns="${Math.round(p.paddingRight * I)}"`), void 0 !== p?.paddingBottom && f.push(`bIns="${Math.round(p.paddingBottom * I)}"`), f.push(`anchor="${to(p?.anchor ?? "t")}"`), f.push("anchorCtr=\"0\"");
|
|
12684
12719
|
const h = p?.autoFit ? "<a:spAutoFit/>" : "", m = e.blocks.length > 0, g = m ? i(e.blocks, n, o) : "";
|
|
12685
12720
|
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>`;
|
|
12686
12721
|
}(t, a, s, r, n, i);
|
|
12687
|
-
return `<w:r>${o}${
|
|
12722
|
+
return `<w:r>${o}${Bi({
|
|
12688
12723
|
cx: a,
|
|
12689
12724
|
cy: s,
|
|
12690
12725
|
floating: t.floating,
|
|
@@ -12694,61 +12729,61 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12694
12729
|
graphicXml: d
|
|
12695
12730
|
})}</w:r>`;
|
|
12696
12731
|
}
|
|
12697
|
-
const
|
|
12732
|
+
const Hi = {
|
|
12698
12733
|
footnote: "FootnoteReference",
|
|
12699
12734
|
endnote: "EndnoteReference"
|
|
12700
12735
|
};
|
|
12701
|
-
function
|
|
12702
|
-
return `<w:r><w:rPr><w:rStyle w:val="${
|
|
12736
|
+
function ji(e) {
|
|
12737
|
+
return `<w:r><w:rPr><w:rStyle w:val="${Hi[e]}"/><w:vertAlign w:val="superscript"/></w:rPr><w:${e}Ref/></w:r>`;
|
|
12703
12738
|
}
|
|
12704
|
-
function
|
|
12739
|
+
function qi(e, t, r, n) {
|
|
12705
12740
|
if (!t) return null;
|
|
12706
12741
|
const o = ("footnote" === e ? n.footnoteIdMap : n.endnoteIdMap)?.get(t.noteId);
|
|
12707
12742
|
if (void 0 === o) return null;
|
|
12708
12743
|
const i = {
|
|
12709
12744
|
...r ?? {},
|
|
12710
|
-
styleId:
|
|
12745
|
+
styleId: Hi[e],
|
|
12711
12746
|
superscript: !0
|
|
12712
|
-
}, a = t.customMark ? " w:customMarkFollows=\"1\"" : "", s = t.customMark ? `<w:t xml:space="preserve">${
|
|
12713
|
-
return `<w:r>${
|
|
12747
|
+
}, a = t.customMark ? " w:customMarkFollows=\"1\"" : "", s = t.customMark ? `<w:t xml:space="preserve">${to(t.customMark)}</w:t>` : "";
|
|
12748
|
+
return `<w:r>${Di(i)}<w:${e}Reference${a} w:id="${o}"/>${s}</w:r>`;
|
|
12714
12749
|
}
|
|
12715
|
-
function
|
|
12716
|
-
return void 0 === t ? "" : ` m:${e}="${
|
|
12750
|
+
function Wi(e, t) {
|
|
12751
|
+
return void 0 === t ? "" : ` m:${e}="${to(String(t))}"`;
|
|
12717
12752
|
}
|
|
12718
|
-
function
|
|
12719
|
-
return e.map(
|
|
12753
|
+
function Gi(e) {
|
|
12754
|
+
return e.map(Vi).join("");
|
|
12720
12755
|
}
|
|
12721
|
-
function
|
|
12756
|
+
function Vi(e) {
|
|
12722
12757
|
switch (e.kind) {
|
|
12723
12758
|
case "text": return function(e) {
|
|
12724
12759
|
const t = e.style;
|
|
12725
|
-
return `<m:r>${t ? `<m:rPr>${t.bold ? "<m:b/>" : ""}${t.italic ? "<m:i/>" : ""}${t.normalText ? "<m:nor/>" : ""}${t.script ? `<m:sty m:val="${
|
|
12760
|
+
return `<m:r>${t ? `<m:rPr>${t.bold ? "<m:b/>" : ""}${t.italic ? "<m:i/>" : ""}${t.normalText ? "<m:nor/>" : ""}${t.script ? `<m:sty m:val="${to(t.script)}"/>` : ""}</m:rPr>` : ""}<m:t xml:space="preserve">${to(e.value)}</m:t></m:r>`;
|
|
12726
12761
|
}(e);
|
|
12727
|
-
case "fraction": return `<m:f>${!1 === e.bar ? "<m:fPr><m:type m:val=\"noBar\"/></m:fPr>" : ""}<m:num>${
|
|
12728
|
-
case "radical": return e.degree ? `<m:rad><m:deg>${
|
|
12762
|
+
case "fraction": return `<m:f>${!1 === e.bar ? "<m:fPr><m:type m:val=\"noBar\"/></m:fPr>" : ""}<m:num>${Gi(e.numerator)}</m:num><m:den>${Gi(e.denominator)}</m:den></m:f>`;
|
|
12763
|
+
case "radical": return e.degree ? `<m:rad><m:deg>${Gi(e.degree)}</m:deg><m:e>${Gi(e.radicand)}</m:e></m:rad>` : `<m:rad><m:e>${Gi(e.radicand)}</m:e></m:rad>`;
|
|
12729
12764
|
case "script": {
|
|
12730
12765
|
const t = e.subscript && e.superscript ? "sSubSup" : e.subscript ? "sSub" : "sSup";
|
|
12731
|
-
return `<m:${t}><m:e>${
|
|
12732
|
-
}
|
|
12733
|
-
case "delimiter": return `<m:d><m:dPr>${
|
|
12734
|
-
case "accent": return `<m:acc><m:accPr><m:chr${
|
|
12735
|
-
case "nary": return `<m:nary><m:naryPr><m:chr${
|
|
12736
|
-
case "limit": return "low" === e.operator ? `<m:limLow><m:e>${
|
|
12737
|
-
case "matrix": return `<m:m>${e.rows.map((e) => `<m:mr>${e.map((e) => `<m:e>${
|
|
12738
|
-
case "box": return `<m:${e.hidden ? "phant" : e.border ? "borderBox" : "box"}><m:e>${
|
|
12739
|
-
case "group": return
|
|
12766
|
+
return `<m:${t}><m:e>${Gi(e.base)}</m:e>${e.subscript ? `<m:sub>${Gi(e.subscript)}</m:sub>` : ""}${e.superscript ? `<m:sup>${Gi(e.superscript)}</m:sup>` : ""}</m:${t}>`;
|
|
12767
|
+
}
|
|
12768
|
+
case "delimiter": return `<m:d><m:dPr>${Wi("begChr", e.begin)}${Wi("endChr", e.end)}${Wi("sepChr", e.separator)}${!1 === e.grow ? "<m:grow m:val=\"0\"/>" : ""}</m:dPr>${e.children.map((e) => `<m:e>${Gi(e)}</m:e>`).join("")}</m:d>`;
|
|
12769
|
+
case "accent": return `<m:acc><m:accPr><m:chr${Wi("val", e.accent)}/></m:accPr><m:e>${Gi(e.children)}</m:e></m:acc>`;
|
|
12770
|
+
case "nary": return `<m:nary><m:naryPr><m:chr${Wi("val", e.operator)}/>${!1 === e.grow ? "<m:grow m:val=\"0\"/>" : ""}</m:naryPr>${e.subscript ? `<m:sub>${Gi(e.subscript)}</m:sub>` : ""}${e.superscript ? `<m:sup>${Gi(e.superscript)}</m:sup>` : ""}<m:e>${Gi(e.children)}</m:e></m:nary>`;
|
|
12771
|
+
case "limit": return "low" === e.operator ? `<m:limLow><m:e>${Gi(e.base)}</m:e><m:lim>${Gi(e.limit)}</m:lim></m:limLow>` : `<m:limUpp><m:e>${Gi(e.base)}</m:e><m:lim>${Gi(e.limit)}</m:lim></m:limUpp>`;
|
|
12772
|
+
case "matrix": return `<m:m>${e.rows.map((e) => `<m:mr>${e.map((e) => `<m:e>${Gi(e)}</m:e>`).join("")}</m:mr>`).join("")}</m:m>`;
|
|
12773
|
+
case "box": return `<m:${e.hidden ? "phant" : e.border ? "borderBox" : "box"}><m:e>${Gi(e.children)}</m:e></m:${e.hidden ? "phant" : e.border ? "borderBox" : "box"}>`;
|
|
12774
|
+
case "group": return Gi(e.children);
|
|
12740
12775
|
case "raw": return e.xml;
|
|
12741
12776
|
}
|
|
12742
12777
|
}
|
|
12743
|
-
const
|
|
12778
|
+
const Xi = "http://schemas.openxmlformats.org/markup-compatibility/2006", Zi = /* @__PURE__ */ new Set([
|
|
12744
12779
|
"t",
|
|
12745
12780
|
"tab",
|
|
12746
12781
|
"br",
|
|
12747
12782
|
"cr",
|
|
12748
12783
|
"noBreakHyphen",
|
|
12749
12784
|
"softHyphen"
|
|
12750
|
-
]),
|
|
12751
|
-
...
|
|
12785
|
+
]), Yi = /* @__PURE__ */ new Set([
|
|
12786
|
+
...Zi,
|
|
12752
12787
|
"drawing",
|
|
12753
12788
|
"pict",
|
|
12754
12789
|
"sym",
|
|
@@ -12758,7 +12793,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12758
12793
|
"endnoteReference",
|
|
12759
12794
|
"separator",
|
|
12760
12795
|
"continuationSeparator"
|
|
12761
|
-
]),
|
|
12796
|
+
]), Qi = /* @__PURE__ */ new Set([
|
|
12762
12797
|
"rStyle",
|
|
12763
12798
|
"rFonts",
|
|
12764
12799
|
"b",
|
|
@@ -12798,7 +12833,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12798
12833
|
"eastAsianLayout",
|
|
12799
12834
|
"specVanish",
|
|
12800
12835
|
"oMath"
|
|
12801
|
-
]),
|
|
12836
|
+
]), Ki = /* @__PURE__ */ new Set([
|
|
12802
12837
|
"ligatures",
|
|
12803
12838
|
"numSpacing",
|
|
12804
12839
|
"numForm",
|
|
@@ -12812,10 +12847,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12812
12847
|
"scene3d",
|
|
12813
12848
|
"props3d"
|
|
12814
12849
|
]);
|
|
12815
|
-
function
|
|
12850
|
+
function Ji(e) {
|
|
12816
12851
|
return /\br:(?:id|embed|link)\s*=/.test(e);
|
|
12817
12852
|
}
|
|
12818
|
-
function
|
|
12853
|
+
function ea(e) {
|
|
12819
12854
|
const t = [];
|
|
12820
12855
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
12821
12856
|
const n = e.childNodes[r];
|
|
@@ -12823,93 +12858,93 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12823
12858
|
}
|
|
12824
12859
|
return t;
|
|
12825
12860
|
}
|
|
12826
|
-
function
|
|
12861
|
+
function ta(e) {
|
|
12827
12862
|
return e.localName ?? e.tagName;
|
|
12828
12863
|
}
|
|
12829
|
-
function
|
|
12830
|
-
return
|
|
12864
|
+
function ra(e, t, r) {
|
|
12865
|
+
return ea(e).find((e) => e.namespaceURI === t && ta(e) === r);
|
|
12831
12866
|
}
|
|
12832
|
-
function
|
|
12833
|
-
return `${e.namespaceURI ?? ""}\0${
|
|
12867
|
+
function na(e) {
|
|
12868
|
+
return `${e.namespaceURI ?? ""}\0${ta(e)}`;
|
|
12834
12869
|
}
|
|
12835
|
-
function
|
|
12870
|
+
function oa(e) {
|
|
12836
12871
|
const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
12837
|
-
return t && "r" ===
|
|
12872
|
+
return t && "r" === ta(t) ? t : void 0;
|
|
12838
12873
|
}
|
|
12839
|
-
function
|
|
12840
|
-
const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${
|
|
12874
|
+
function ia(e) {
|
|
12875
|
+
const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${Qn}" xmlns:w14="${eo}" xmlns:r="${Jn}" xmlns:mc="${Xi}" 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;
|
|
12841
12876
|
if (!t) return;
|
|
12842
|
-
const r =
|
|
12843
|
-
return 1 === r.length && "r" ===
|
|
12877
|
+
const r = ea(t);
|
|
12878
|
+
return 1 === r.length && "r" === ta(r[0]) ? r[0] : void 0;
|
|
12844
12879
|
}
|
|
12845
|
-
function
|
|
12880
|
+
function aa(e) {
|
|
12846
12881
|
return "http://www.w3.org/2000/xmlns/" === e.namespaceURI || "xmlns" === e.prefix || "xmlns" === e.name;
|
|
12847
12882
|
}
|
|
12848
|
-
function
|
|
12883
|
+
function sa(e) {
|
|
12849
12884
|
for (let t = 0; t < e.attributes.length; t += 1) {
|
|
12850
12885
|
const r = e.attributes[t];
|
|
12851
|
-
if (r && !
|
|
12886
|
+
if (r && !aa(r) && "http://schemas.openxmlformats.org/officeDocument/2006/relationships" !== r.namespaceURI) return !0;
|
|
12852
12887
|
}
|
|
12853
12888
|
return !1;
|
|
12854
12889
|
}
|
|
12855
|
-
function
|
|
12856
|
-
const t =
|
|
12857
|
-
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI ?
|
|
12890
|
+
function la(e) {
|
|
12891
|
+
const t = ta(e);
|
|
12892
|
+
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI ? Qi.has(t) : "http://schemas.microsoft.com/office/word/2010/wordml" === e.namespaceURI ? Ki.has(t) : e.namespaceURI === Xi && "AlternateContent" === t;
|
|
12858
12893
|
}
|
|
12859
|
-
function
|
|
12860
|
-
const r =
|
|
12894
|
+
function ca(e, t) {
|
|
12895
|
+
const r = ra(e, Qn, "rPr");
|
|
12861
12896
|
if (!r) return;
|
|
12862
|
-
const n =
|
|
12897
|
+
const n = ea(r), o = ra(t, Qn, "rPr"), i = o ? ea(o) : [], a = new Set(i.map(na)), s = n.filter((e) => !la(e) && !a.has(na(e)));
|
|
12863
12898
|
if (0 === s.length) return;
|
|
12864
12899
|
const l = function(e) {
|
|
12865
|
-
const t =
|
|
12900
|
+
const t = ra(e, Qn, "rPr");
|
|
12866
12901
|
if (t) return t;
|
|
12867
|
-
const r = e.ownerDocument.createElementNS(
|
|
12902
|
+
const r = e.ownerDocument.createElementNS(Qn, "w:rPr");
|
|
12868
12903
|
return e.insertBefore(r, e.firstChild), r;
|
|
12869
12904
|
}(t);
|
|
12870
12905
|
for (const c of s) {
|
|
12871
|
-
const e = n.indexOf(c), t = n.slice(e + 1).find((e) => a.has(
|
|
12906
|
+
const e = n.indexOf(c), t = n.slice(e + 1).find((e) => a.has(na(e))), r = t ? ea(l).find((e) => na(e) === na(t)) ?? null : null;
|
|
12872
12907
|
l.insertBefore(c.cloneNode(!0), r);
|
|
12873
12908
|
}
|
|
12874
12909
|
}
|
|
12875
|
-
function
|
|
12876
|
-
const t =
|
|
12877
|
-
return e.namespaceURI ===
|
|
12878
|
-
const t = (e) =>
|
|
12879
|
-
const r =
|
|
12880
|
-
return !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !
|
|
12910
|
+
function ua(e) {
|
|
12911
|
+
const t = ta(e);
|
|
12912
|
+
return e.namespaceURI === Xi && "AlternateContent" === t ? function(e) {
|
|
12913
|
+
const t = (e) => ea(e).some((e) => {
|
|
12914
|
+
const r = ta(e);
|
|
12915
|
+
return !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !Yi.has(r)) || t(e);
|
|
12881
12916
|
});
|
|
12882
12917
|
return t(e);
|
|
12883
|
-
}(e) : "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && ("rPr" === t ||
|
|
12918
|
+
}(e) : "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && ("rPr" === t || Yi.has(t));
|
|
12884
12919
|
}
|
|
12885
|
-
function
|
|
12886
|
-
const t =
|
|
12887
|
-
if (t && !
|
|
12920
|
+
function da(e) {
|
|
12921
|
+
const t = Vr(e);
|
|
12922
|
+
if (t && !Ji(t.xml) && (r = t.xml, !Or.test(r))) {
|
|
12888
12923
|
var r;
|
|
12889
|
-
if (t.semanticSignature ===
|
|
12890
|
-
if (t.structureSignature ===
|
|
12924
|
+
if (t.semanticSignature === qr(e)) return t.xml;
|
|
12925
|
+
if (t.structureSignature === Wr(e)) return function(e, t) {
|
|
12891
12926
|
if ("text" !== e.kind) return;
|
|
12892
|
-
const r =
|
|
12927
|
+
const r = oa(t);
|
|
12893
12928
|
if (!r) return;
|
|
12894
|
-
const n =
|
|
12929
|
+
const n = ea(r), o = n.filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && Zi.has(ta(e))), i = o[0] ?? n.find((e) => !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "rPr" === ta(e))) ?? null, a = ia(`<w:r>${Mi(e.text)}</w:r>`);
|
|
12895
12930
|
if (!a) return;
|
|
12896
|
-
const s =
|
|
12931
|
+
const s = ea(a);
|
|
12897
12932
|
for (const l of s) r.insertBefore(l.cloneNode(!0), i);
|
|
12898
12933
|
for (const l of o) r.removeChild(l);
|
|
12899
12934
|
return new b.XMLSerializer().serializeToString(r);
|
|
12900
12935
|
}(e, t.xml);
|
|
12901
12936
|
}
|
|
12902
12937
|
}
|
|
12903
|
-
function
|
|
12904
|
-
const r =
|
|
12905
|
-
if (!r ||
|
|
12906
|
-
const n =
|
|
12938
|
+
function pa(e, t) {
|
|
12939
|
+
const r = Vr(e);
|
|
12940
|
+
if (!r || Ji(r.xml)) return t;
|
|
12941
|
+
const n = oa(r.xml);
|
|
12907
12942
|
if (!n || !function(e) {
|
|
12908
|
-
if (
|
|
12909
|
-
const t =
|
|
12910
|
-
return !(!t || !
|
|
12943
|
+
if (sa(e)) return !0;
|
|
12944
|
+
const t = ra(e, Qn, "rPr");
|
|
12945
|
+
return !(!t || !sa(t) && !ea(t).some((e) => !la(e))) || ea(e).some((e) => !ua(e));
|
|
12911
12946
|
}(n)) return t;
|
|
12912
|
-
const o =
|
|
12947
|
+
const o = ia(t);
|
|
12913
12948
|
return o ? (function(e, t) {
|
|
12914
12949
|
for (let r = 0; r < e.attributes.length; r += 1) {
|
|
12915
12950
|
const n = e.attributes[r];
|
|
@@ -12917,22 +12952,22 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12917
12952
|
const o = n.localName ?? n.name;
|
|
12918
12953
|
(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));
|
|
12919
12954
|
}
|
|
12920
|
-
}(n, o),
|
|
12921
|
-
const r =
|
|
12955
|
+
}(n, o), ca(n, o), function(e, t) {
|
|
12956
|
+
const r = ea(e), n = ea(t), o = new Set(n.map(na)), i = r.filter((e) => !ua(e) && !o.has(na(e)));
|
|
12922
12957
|
for (const a of i) {
|
|
12923
|
-
const e = r.indexOf(a), n = r.slice(e + 1).find((e) =>
|
|
12958
|
+
const e = r.indexOf(a), n = r.slice(e + 1).find((e) => ua(e)), o = n ? ea(t).find((e) => na(e) === na(n)) ?? null : null;
|
|
12924
12959
|
t.insertBefore(a.cloneNode(!0), o);
|
|
12925
12960
|
}
|
|
12926
12961
|
}(n, o), new b.XMLSerializer().serializeToString(o)) : t;
|
|
12927
12962
|
}
|
|
12928
|
-
function
|
|
12963
|
+
function fa(e, t, r, n, o) {
|
|
12929
12964
|
if (e.revisionRangeMarker) return function(e) {
|
|
12930
|
-
const t = `move${"from" === e.move ? "From" : "To"}Range${"start" === e.edge ? "Start" : "End"}`, r = [`w:id="${
|
|
12931
|
-
return void 0 !== e.displacedByCustomXml && r.push(`w:displacedByCustomXml="${
|
|
12965
|
+
const t = `move${"from" === e.move ? "From" : "To"}Range${"start" === e.edge ? "Start" : "End"}`, r = [`w:id="${wi(e.id)}"`];
|
|
12966
|
+
return void 0 !== e.displacedByCustomXml && r.push(`w:displacedByCustomXml="${to(e.displacedByCustomXml)}"`), "start" === e.edge && (void 0 !== e.name && r.push(`w:name="${to(e.name)}"`), void 0 !== e.author && r.push(`w:author="${to(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(" ")}/>`;
|
|
12932
12967
|
}(e.revisionRangeMarker);
|
|
12933
|
-
if (e.__isFootnoteRefMarker) return
|
|
12934
|
-
if (e.__isEndnoteRefMarker) return
|
|
12935
|
-
const i =
|
|
12968
|
+
if (e.__isFootnoteRefMarker) return ji("footnote");
|
|
12969
|
+
if (e.__isEndnoteRefMarker) return ji("endnote");
|
|
12970
|
+
const i = da(e);
|
|
12936
12971
|
if (i) return i;
|
|
12937
12972
|
const a = function(e, t, r) {
|
|
12938
12973
|
const n = oe(e.styles, t, r), o = {
|
|
@@ -12987,18 +13022,18 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
12987
13022
|
propertyRevision: e.styles?.propertyRevision
|
|
12988
13023
|
};
|
|
12989
13024
|
return e.styles?.link && (o.link = e.styles.link), o;
|
|
12990
|
-
}(e, r, n), s = () =>
|
|
12991
|
-
return
|
|
13025
|
+
}(e, r, n), s = () => Di(a), l = () => `<w:r>${s()}${Mi(e.text)}</w:r>`;
|
|
13026
|
+
return pa(e, z(e, {
|
|
12992
13027
|
footnoteReference: (e) => function(e, t, r) {
|
|
12993
13028
|
const n = B(e);
|
|
12994
|
-
return
|
|
13029
|
+
return qi("footnote", n ? {
|
|
12995
13030
|
noteId: n.footnoteId,
|
|
12996
13031
|
customMark: n.customMark
|
|
12997
13032
|
} : void 0, t, r);
|
|
12998
13033
|
}(e, a, t) ?? l(),
|
|
12999
13034
|
endnoteReference: (e) => function(e, t, r) {
|
|
13000
13035
|
const n = U(e);
|
|
13001
|
-
return
|
|
13036
|
+
return qi("endnote", n ? {
|
|
13002
13037
|
noteId: n.endnoteId,
|
|
13003
13038
|
customMark: n.customMark
|
|
13004
13039
|
} : void 0, t, r);
|
|
@@ -13008,47 +13043,49 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13008
13043
|
return `<w:r>${t}<w:fldChar w:fldCharType="${e.kind}"${r}/></w:r>`;
|
|
13009
13044
|
}(e.fieldChar, s()),
|
|
13010
13045
|
fieldInstruction: (e) => {
|
|
13011
|
-
return t = e.fieldInstruction, `<w:r>${s()}<w:instrText xml:space="preserve">${
|
|
13046
|
+
return t = e.fieldInstruction, `<w:r>${s()}<w:instrText xml:space="preserve">${to(t)}</w:instrText></w:r>`;
|
|
13012
13047
|
var t;
|
|
13013
13048
|
},
|
|
13014
|
-
field: (e) => {
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13049
|
+
field: (e) => function(e, t, r) {
|
|
13050
|
+
const n = "PAGE" === e ? " PAGE " : " NUMPAGES ", o = function(e) {
|
|
13051
|
+
if (e && "decimal" !== e) return e;
|
|
13052
|
+
}(t);
|
|
13053
|
+
return `<w:fldSimple w:instr="${o ? ` ${n.trim()} \\* ${o} ` : n}"><w:r>${r}<w:t>1</w:t></w:r></w:fldSimple>`;
|
|
13054
|
+
}(e.field.type, e.field.format, s()),
|
|
13055
|
+
textBox: (e) => zi(e, e.textBox, t, n, s(), o),
|
|
13019
13056
|
image: (e) => {
|
|
13020
13057
|
const r = t.imageMap.get(e.id);
|
|
13021
13058
|
if (r) {
|
|
13022
|
-
const n =
|
|
13059
|
+
const n = Ui(e.id, r, t, s());
|
|
13023
13060
|
if (null !== n) return n;
|
|
13024
13061
|
}
|
|
13025
13062
|
return l();
|
|
13026
13063
|
},
|
|
13027
|
-
sym: (e) => `<w:r>${s()}<w:sym w:font="${
|
|
13064
|
+
sym: (e) => `<w:r>${s()}<w:sym w:font="${to(e.sym.font)}" w:char="${e.sym.char}"/></w:r>`,
|
|
13028
13065
|
math: (e) => function(e) {
|
|
13029
|
-
const t = `<m:oMath>${
|
|
13066
|
+
const t = `<m:oMath>${Gi(e.children)}</m:oMath>`;
|
|
13030
13067
|
return e.display ? `<m:oMathPara>${t}</m:oMathPara>` : t;
|
|
13031
13068
|
}(e.math),
|
|
13032
13069
|
text: () => l()
|
|
13033
13070
|
}));
|
|
13034
13071
|
}
|
|
13035
|
-
function
|
|
13036
|
-
let i =
|
|
13072
|
+
function ha(e, t, r, n, o) {
|
|
13073
|
+
let i = fa(e, t, r, n, o);
|
|
13037
13074
|
if (e.revisionRangeMarker) return i;
|
|
13038
|
-
"delete" === e.revision?.type && (i =
|
|
13075
|
+
"delete" === e.revision?.type && (i = gi(i));
|
|
13039
13076
|
const a = e.styles?.link, s = a ? function(e, t, r) {
|
|
13040
|
-
if (t.startsWith("#")) return `<w:hyperlink w:anchor="${
|
|
13077
|
+
if (t.startsWith("#")) return `<w:hyperlink w:anchor="${to(t.slice(1))}">${e}</w:hyperlink>`;
|
|
13041
13078
|
const n = r.hyperlinkMap.get(t);
|
|
13042
13079
|
return n ? `<w:hyperlink r:id="${n}">${e}</w:hyperlink>` : e;
|
|
13043
13080
|
}(i, a, t) : i;
|
|
13044
13081
|
return e.revision ? function(e, t) {
|
|
13045
|
-
const r =
|
|
13082
|
+
const r = bi(t), n = function(e) {
|
|
13046
13083
|
return "from" === e.move ? "moveFrom" : "to" === e.move ? "moveTo" : "delete" === e.type ? "del" : "ins";
|
|
13047
13084
|
}(t);
|
|
13048
13085
|
return `<w:${n} ${r}>${e}</w:${n}>`;
|
|
13049
13086
|
}(s, e.revision) : s;
|
|
13050
13087
|
}
|
|
13051
|
-
function
|
|
13088
|
+
function ma(e, t) {
|
|
13052
13089
|
let r = "", n = 0;
|
|
13053
13090
|
for (; n < e.length;) {
|
|
13054
13091
|
const o = e[n], i = o.sdtWrappers?.[0];
|
|
@@ -13065,12 +13102,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13065
13102
|
sdtWrappers: r.length > 0 ? r : void 0
|
|
13066
13103
|
}), s += 1;
|
|
13067
13104
|
}
|
|
13068
|
-
const l =
|
|
13069
|
-
r += `<w:sdt>${
|
|
13105
|
+
const l = ma(a, t);
|
|
13106
|
+
r += `<w:sdt>${Mo(i.sdtPr)}${i.sdtEndPrXml ?? ""}<w:sdtContent>${l}</w:sdtContent></w:sdt>`, n = s;
|
|
13070
13107
|
}
|
|
13071
13108
|
return r;
|
|
13072
13109
|
}
|
|
13073
|
-
const
|
|
13110
|
+
const ga = /* @__PURE__ */ new Set([
|
|
13074
13111
|
"pStyle",
|
|
13075
13112
|
"keepNext",
|
|
13076
13113
|
"keepLines",
|
|
@@ -13108,10 +13145,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13108
13145
|
"sectPr",
|
|
13109
13146
|
"pPrChange"
|
|
13110
13147
|
]);
|
|
13111
|
-
function
|
|
13148
|
+
function wa(e) {
|
|
13112
13149
|
return /\br:(?:id|embed|link)\s*=/.test(e);
|
|
13113
13150
|
}
|
|
13114
|
-
function
|
|
13151
|
+
function ba(e) {
|
|
13115
13152
|
const t = [];
|
|
13116
13153
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
13117
13154
|
const n = e.childNodes[r];
|
|
@@ -13119,23 +13156,23 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13119
13156
|
}
|
|
13120
13157
|
return t;
|
|
13121
13158
|
}
|
|
13122
|
-
function
|
|
13159
|
+
function va(e) {
|
|
13123
13160
|
return e.localName ?? e.tagName;
|
|
13124
13161
|
}
|
|
13125
|
-
function
|
|
13126
|
-
return `${e.namespaceURI ?? ""}\0${
|
|
13162
|
+
function ya(e) {
|
|
13163
|
+
return `${e.namespaceURI ?? ""}\0${va(e)}`;
|
|
13127
13164
|
}
|
|
13128
|
-
function
|
|
13129
|
-
if (!e ||
|
|
13165
|
+
function xa(e, t) {
|
|
13166
|
+
if (!e || wa(e)) return t;
|
|
13130
13167
|
const r = function(e) {
|
|
13131
13168
|
const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
13132
|
-
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "pPr" ===
|
|
13169
|
+
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "pPr" === va(t) ? t : void 0;
|
|
13133
13170
|
}(e), n = function(e) {
|
|
13134
13171
|
if (e) {
|
|
13135
|
-
const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${
|
|
13136
|
-
if (1 === r.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === r[0].namespaceURI && "pPr" ===
|
|
13172
|
+
const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${Qn}">${e}</oasis:root>`, "application/xml").documentElement, r = t ? ba(t) : [];
|
|
13173
|
+
if (1 === r.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === r[0].namespaceURI && "pPr" === va(r[0])) return r[0];
|
|
13137
13174
|
}
|
|
13138
|
-
return new b.DOMParser().parseFromString(`<w:pPr xmlns:w="${
|
|
13175
|
+
return new b.DOMParser().parseFromString(`<w:pPr xmlns:w="${Qn}"/>`, "application/xml").documentElement;
|
|
13139
13176
|
}(t);
|
|
13140
13177
|
if (!r || !n) return t;
|
|
13141
13178
|
(function(e, t) {
|
|
@@ -13146,29 +13183,29 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13146
13183
|
(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));
|
|
13147
13184
|
}
|
|
13148
13185
|
})(r, n);
|
|
13149
|
-
const o =
|
|
13186
|
+
const o = ba(r), i = ba(n), a = /* @__PURE__ */ new Map();
|
|
13150
13187
|
for (const u of i) {
|
|
13151
|
-
const e =
|
|
13188
|
+
const e = ya(u), t = a.get(e) ?? [];
|
|
13152
13189
|
t.push(u), a.set(e, t);
|
|
13153
13190
|
}
|
|
13154
13191
|
const s = /* @__PURE__ */ new Map();
|
|
13155
13192
|
for (const u of o) {
|
|
13156
|
-
const e =
|
|
13193
|
+
const e = ya(u), t = s.get(e) ?? 0;
|
|
13157
13194
|
s.set(e, t + 1);
|
|
13158
13195
|
const r = a.get(e)?.[t];
|
|
13159
|
-
r &&
|
|
13196
|
+
r && qo(u, r);
|
|
13160
13197
|
}
|
|
13161
|
-
const l = new Set(i.map(
|
|
13162
|
-
return !(t = e, "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t.namespaceURI &&
|
|
13198
|
+
const l = new Set(i.map(ya)), c = o.filter((e) => {
|
|
13199
|
+
return !(t = e, "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t.namespaceURI && ga.has(va(t)) || l.has(ya(e)));
|
|
13163
13200
|
var t;
|
|
13164
13201
|
});
|
|
13165
13202
|
for (const u of c) {
|
|
13166
|
-
const e = o.indexOf(u), t = o.slice(e + 1).find((e) => l.has(
|
|
13203
|
+
const e = o.indexOf(u), t = o.slice(e + 1).find((e) => l.has(ya(e))), r = t ? ba(n).find((e) => ya(e) === ya(t)) ?? null : null;
|
|
13167
13204
|
n.insertBefore(u.cloneNode(!0), r);
|
|
13168
13205
|
}
|
|
13169
|
-
return t || 1 !== n.attributes.length || 0 !==
|
|
13206
|
+
return t || 1 !== n.attributes.length || 0 !== ba(n).length ? new b.XMLSerializer().serializeToString(n) : "";
|
|
13170
13207
|
}
|
|
13171
|
-
const
|
|
13208
|
+
const Sa = /* @__PURE__ */ new Set([
|
|
13172
13209
|
"pPr",
|
|
13173
13210
|
"r",
|
|
13174
13211
|
"hyperlink",
|
|
@@ -13178,7 +13215,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13178
13215
|
"commentRangeStart",
|
|
13179
13216
|
"commentRangeEnd"
|
|
13180
13217
|
]);
|
|
13181
|
-
function
|
|
13218
|
+
function Na(e) {
|
|
13182
13219
|
const t = [];
|
|
13183
13220
|
for (let r = 0; r < e.childNodes.length; r += 1) {
|
|
13184
13221
|
const n = e.childNodes[r];
|
|
@@ -13186,90 +13223,90 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13186
13223
|
}
|
|
13187
13224
|
return t;
|
|
13188
13225
|
}
|
|
13189
|
-
function
|
|
13226
|
+
function Ea(e) {
|
|
13190
13227
|
return e.localName ?? e.tagName;
|
|
13191
13228
|
}
|
|
13192
|
-
function
|
|
13193
|
-
const r = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${
|
|
13229
|
+
function ka(e, t) {
|
|
13230
|
+
const r = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${Qn}" xmlns:w14="${eo}" xmlns:r="${Jn}" 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;
|
|
13194
13231
|
if (!r) return;
|
|
13195
|
-
const n =
|
|
13196
|
-
return 1 === n.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === n[0].namespaceURI &&
|
|
13232
|
+
const n = Na(r);
|
|
13233
|
+
return 1 === n.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === n[0].namespaceURI && Ea(n[0]) === t ? n[0] : void 0;
|
|
13197
13234
|
}
|
|
13198
|
-
function
|
|
13235
|
+
function _a(e) {
|
|
13199
13236
|
return "http://www.w3.org/2000/xmlns/" === e.namespaceURI || "xmlns" === e.prefix || "xmlns" === e.name;
|
|
13200
13237
|
}
|
|
13201
|
-
function
|
|
13202
|
-
const r = (n = "pPr",
|
|
13238
|
+
function Ta(e, t) {
|
|
13239
|
+
const r = (n = "pPr", Na(e).find((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && Ea(e) === n));
|
|
13203
13240
|
var n;
|
|
13204
13241
|
if (!t) return r && e.removeChild(r), !0;
|
|
13205
|
-
const o =
|
|
13242
|
+
const o = ka(t, "pPr");
|
|
13206
13243
|
if (!o) return !1;
|
|
13207
13244
|
const i = o.cloneNode(!0);
|
|
13208
13245
|
return r ? e.replaceChild(i, r) : e.insertBefore(i, e.firstChild), !0;
|
|
13209
13246
|
}
|
|
13210
|
-
function
|
|
13211
|
-
const o =
|
|
13247
|
+
function Ia(e, t, r, n) {
|
|
13248
|
+
const o = Yr(e)?.xml;
|
|
13212
13249
|
if (!o || n.hasOverrides || n.hasBoundaryTokens || e.dropCap || /\br:(?:id|embed|link)\s*=/.test(o)) return;
|
|
13213
13250
|
const i = function(e) {
|
|
13214
13251
|
const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
|
|
13215
|
-
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "p" ===
|
|
13252
|
+
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "p" === Ea(t) ? t : void 0;
|
|
13216
13253
|
}(o);
|
|
13217
13254
|
if (!i || !function(e) {
|
|
13218
13255
|
for (let t = 0; t < e.attributes.length; t += 1) {
|
|
13219
13256
|
const r = e.attributes[t];
|
|
13220
|
-
if (r && !
|
|
13257
|
+
if (r && !_a(r) && "http://schemas.openxmlformats.org/officeDocument/2006/relationships" !== r.namespaceURI) return !0;
|
|
13221
13258
|
}
|
|
13222
|
-
return
|
|
13223
|
-
const t =
|
|
13224
|
-
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !
|
|
13259
|
+
return Na(e).some((e) => {
|
|
13260
|
+
const t = Ea(e);
|
|
13261
|
+
return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !Sa.has(t);
|
|
13225
13262
|
});
|
|
13226
13263
|
}(i)) return;
|
|
13227
13264
|
const a = function(e) {
|
|
13228
13265
|
const t = [], r = (e) => {
|
|
13229
|
-
for (const n of
|
|
13230
|
-
const e =
|
|
13266
|
+
for (const n of Na(e)) {
|
|
13267
|
+
const e = Ea(n);
|
|
13231
13268
|
"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);
|
|
13232
13269
|
}
|
|
13233
13270
|
};
|
|
13234
13271
|
return r(e), t;
|
|
13235
13272
|
}(i);
|
|
13236
13273
|
if (a.length !== r.length) return;
|
|
13237
|
-
const s = r.map((e) =>
|
|
13238
|
-
if (!s.some((e) => !e) &&
|
|
13274
|
+
const s = r.map((e) => ka(e, "r"));
|
|
13275
|
+
if (!s.some((e) => !e) && Ta(i, t)) {
|
|
13239
13276
|
for (let e = 0; e < a.length; e += 1) a[e].parentNode?.replaceChild(s[e].cloneNode(!0), a[e]);
|
|
13240
13277
|
return new b.XMLSerializer().serializeToString(i);
|
|
13241
13278
|
}
|
|
13242
13279
|
}
|
|
13243
|
-
function
|
|
13280
|
+
function Ca(e, t) {
|
|
13244
13281
|
return e.rows.some((e) => e.cells.some((e) => e.blocks.some((e) => function(e, t) {
|
|
13245
13282
|
switch (e.type) {
|
|
13246
13283
|
case "paragraph": return Boolean(t.bookmarkEventsByParagraph?.has(e.id) || t.commentEventsByParagraph?.has(e.id));
|
|
13247
|
-
case "table": return
|
|
13284
|
+
case "table": return Ca(e, t);
|
|
13248
13285
|
default: return F(e, "block");
|
|
13249
13286
|
}
|
|
13250
13287
|
}(e, t))));
|
|
13251
13288
|
}
|
|
13252
|
-
function
|
|
13289
|
+
function Aa(e, t, r) {
|
|
13253
13290
|
switch (e.type) {
|
|
13254
|
-
case "paragraph": return
|
|
13291
|
+
case "paragraph": return $a(e, t, r);
|
|
13255
13292
|
case "table": return (e.style?.pageBreakBefore ? "<w:p><w:r><w:br w:type=\"page\"/></w:r></w:p>" : "") + ((function(e) {
|
|
13256
|
-
const t =
|
|
13293
|
+
const t = an(e)?.xml;
|
|
13257
13294
|
return Boolean(t && /<w:trPr(?:\s|>)[\s\S]*?<w:jc\b[^>]*\bw:val="(?:start|end)"/.test(t));
|
|
13258
13295
|
}(e) ? void 0 : function(e, t) {
|
|
13259
|
-
const r =
|
|
13260
|
-
if (r && !t.hasBoundaryTokens && !
|
|
13261
|
-
}(e, { hasBoundaryTokens:
|
|
13262
|
-
return "paragraph" === e.type ?
|
|
13296
|
+
const r = an(e);
|
|
13297
|
+
if (r && !t.hasBoundaryTokens && !Ur(r.xml)) return r.semanticSignature === Qr(e) ? r.xml : void 0;
|
|
13298
|
+
}(e, { hasBoundaryTokens: Ca(e, t) })) ?? pi(e, (e, n) => function(e, t, r, n) {
|
|
13299
|
+
return "paragraph" === e.type ? $a(e, r, n, { align: t.style?.horizontalAlign }) : Aa(e, r, n);
|
|
13263
13300
|
}(e, n, t, r)));
|
|
13264
13301
|
default: return F(e, "block");
|
|
13265
13302
|
}
|
|
13266
13303
|
}
|
|
13267
|
-
function
|
|
13304
|
+
function Ra(e, t, r) {
|
|
13268
13305
|
let n = "", o = 0;
|
|
13269
13306
|
for (; o < e.length;) {
|
|
13270
13307
|
const i = e[o], a = i.sdtWrappers?.[0];
|
|
13271
13308
|
if (!a) {
|
|
13272
|
-
n +=
|
|
13309
|
+
n += Aa(i, t, r), o += 1;
|
|
13273
13310
|
continue;
|
|
13274
13311
|
}
|
|
13275
13312
|
const s = [];
|
|
@@ -13281,39 +13318,39 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13281
13318
|
sdtWrappers: t.length > 0 ? t : void 0
|
|
13282
13319
|
}), l += 1;
|
|
13283
13320
|
}
|
|
13284
|
-
const c =
|
|
13285
|
-
n += `<w:sdt>${
|
|
13321
|
+
const c = Ra(s, t, r);
|
|
13322
|
+
n += `<w:sdt>${Mo(a.sdtPr)}${a.sdtEndPrXml ?? ""}<w:sdtContent>${c}</w:sdtContent></w:sdt>`, o = l;
|
|
13286
13323
|
}
|
|
13287
13324
|
return n;
|
|
13288
13325
|
}
|
|
13289
|
-
function
|
|
13326
|
+
function $a(e, t, r, n) {
|
|
13290
13327
|
const o = e.runs.length > 0 ? e.runs : [{
|
|
13291
13328
|
id: "",
|
|
13292
13329
|
text: "",
|
|
13293
13330
|
kind: "text"
|
|
13294
13331
|
}], i = e.dropCap ? function(e) {
|
|
13295
|
-
const t =
|
|
13296
|
-
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}${
|
|
13332
|
+
const t = Di(e.style);
|
|
13333
|
+
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}${Mi(e.text)}</w:r></w:p>`;
|
|
13297
13334
|
var r;
|
|
13298
13335
|
}(e.dropCap) : "", a = t.bookmarkEventsByParagraph?.get(e.id), s = t.commentEventsByParagraph?.get(e.id), l = [...(a ?? []).map((e) => ({
|
|
13299
13336
|
offset: e.offset,
|
|
13300
13337
|
seq: e.seq,
|
|
13301
|
-
xml:
|
|
13338
|
+
xml: so(e)
|
|
13302
13339
|
})), ...(s ?? []).map((e) => ({
|
|
13303
13340
|
offset: e.offset,
|
|
13304
13341
|
seq: e.seq,
|
|
13305
|
-
xml:
|
|
13342
|
+
xml: lo(e)
|
|
13306
13343
|
}))], c = function(e, t) {
|
|
13307
|
-
const r =
|
|
13308
|
-
if (!(!r?.xml || !r.semanticSignature || t.hasOverrides || t.hasBoundaryTokens ||
|
|
13344
|
+
const r = Yr(e);
|
|
13345
|
+
if (!(!r?.xml || !r.semanticSignature || t.hasOverrides || t.hasBoundaryTokens || Ur(r.xml) || Or.test(r.xml) || Lr.test(r.xml))) return r.semanticSignature === Xr(e) ? r.xml : void 0;
|
|
13309
13346
|
}(e, {
|
|
13310
13347
|
hasOverrides: Boolean(n),
|
|
13311
13348
|
hasBoundaryTokens: l.length > 0
|
|
13312
13349
|
});
|
|
13313
13350
|
if (c) return c;
|
|
13314
|
-
const u = (n) =>
|
|
13351
|
+
const u = (n) => ha(n, t, e.style?.styleId, r, Ra), d = 0 === l.length ? o.map(u) : void 0, p = 0 === l.length ? ma(o, u) : function(e, t, r, n, o) {
|
|
13315
13352
|
const i = [...t].sort((e, t) => e.offset - t.offset || e.seq - t.seq);
|
|
13316
|
-
let a = 0, s = 0, l =
|
|
13353
|
+
let a = 0, s = 0, l = ma(e, (e) => {
|
|
13317
13354
|
let t = "";
|
|
13318
13355
|
const l = s, c = l + e.text.length;
|
|
13319
13356
|
for (; a < i.length && i[a].offset <= l;) t += i[a].xml, a += 1;
|
|
@@ -13323,28 +13360,28 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13323
13360
|
let s = l;
|
|
13324
13361
|
for (; a < i.length && i[a].offset < c;) {
|
|
13325
13362
|
const c = i[a];
|
|
13326
|
-
c.offset > s && (t +=
|
|
13363
|
+
c.offset > s && (t += ha({
|
|
13327
13364
|
...e,
|
|
13328
13365
|
text: e.text.slice(s - l, c.offset - l)
|
|
13329
|
-
}, r, n, o,
|
|
13366
|
+
}, r, n, o, Ra)), t += c.xml, a += 1, s = c.offset;
|
|
13330
13367
|
}
|
|
13331
|
-
s < c && (t +=
|
|
13368
|
+
s < c && (t += ha({
|
|
13332
13369
|
...e,
|
|
13333
13370
|
text: e.text.slice(s - l)
|
|
13334
|
-
}, r, n, o,
|
|
13335
|
-
} else t +=
|
|
13371
|
+
}, r, n, o, Ra));
|
|
13372
|
+
} else t += ha(e, r, n, o, Ra);
|
|
13336
13373
|
return s = c, t;
|
|
13337
13374
|
});
|
|
13338
13375
|
for (; a < i.length;) l += i[a].xml, a += 1;
|
|
13339
13376
|
return l;
|
|
13340
13377
|
}(o, l, t, e.style?.styleId, r), f = function(e) {
|
|
13341
|
-
return
|
|
13378
|
+
return Yr(e)?.attributes;
|
|
13342
13379
|
}(e), h = f ? ` ${f}` : "", g = function(e, t, r) {
|
|
13343
|
-
const n =
|
|
13344
|
-
return !n ||
|
|
13345
|
-
}(e,
|
|
13380
|
+
const n = Yr(e)?.paragraphProperties;
|
|
13381
|
+
return !n || wa(n.xml) ? t : r || e.list || n.semanticSignature !== Zr(e) ? xa(n.xml, t) : n.xml;
|
|
13382
|
+
}(e, Ni(e, t.numberingInfo, r, n), Boolean(n));
|
|
13346
13383
|
if (d) {
|
|
13347
|
-
const t =
|
|
13384
|
+
const t = Ia(e, g, d, {
|
|
13348
13385
|
hasOverrides: Boolean(n),
|
|
13349
13386
|
hasBoundaryTokens: !1
|
|
13350
13387
|
});
|
|
@@ -13352,12 +13389,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13352
13389
|
}
|
|
13353
13390
|
return `${i}<w:p${h}>${g}${p}</w:p>`;
|
|
13354
13391
|
}
|
|
13355
|
-
function
|
|
13392
|
+
function Da(e) {
|
|
13356
13393
|
const t = e.footnotes?.items;
|
|
13357
13394
|
if (!t) return [];
|
|
13358
|
-
const r = /* @__PURE__ */ new Map(), n =
|
|
13395
|
+
const r = /* @__PURE__ */ new Map(), n = fo(t);
|
|
13359
13396
|
for (const { run: o } of function(e) {
|
|
13360
|
-
return
|
|
13397
|
+
return En(e, "footnoteReference");
|
|
13361
13398
|
}(e)) {
|
|
13362
13399
|
const e = B(o);
|
|
13363
13400
|
if (!e || r.has(e.footnoteId)) continue;
|
|
@@ -13370,11 +13407,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13370
13407
|
}
|
|
13371
13408
|
return Array.from(r.values());
|
|
13372
13409
|
}
|
|
13373
|
-
function
|
|
13374
|
-
if (0 === e.length) return [
|
|
13410
|
+
function Pa(e) {
|
|
13411
|
+
if (0 === e.length) return [Ma()];
|
|
13375
13412
|
const [t, ...r] = e;
|
|
13376
13413
|
return "paragraph" !== t.type ? [
|
|
13377
|
-
|
|
13414
|
+
Ma(!0),
|
|
13378
13415
|
t,
|
|
13379
13416
|
...r
|
|
13380
13417
|
] : [(n = t, {
|
|
@@ -13396,7 +13433,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13396
13433
|
}), ...r];
|
|
13397
13434
|
var n;
|
|
13398
13435
|
}
|
|
13399
|
-
function
|
|
13436
|
+
function Ma(e = !0) {
|
|
13400
13437
|
return {
|
|
13401
13438
|
id: "synthetic:footnote-body-empty",
|
|
13402
13439
|
type: "paragraph",
|
|
@@ -13417,12 +13454,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13417
13454
|
style: { styleId: "FootnoteText" }
|
|
13418
13455
|
};
|
|
13419
13456
|
}
|
|
13420
|
-
function
|
|
13457
|
+
function Oa(e) {
|
|
13421
13458
|
const t = e.endnotes?.items;
|
|
13422
13459
|
if (!t) return [];
|
|
13423
|
-
const r = /* @__PURE__ */ new Map(), n =
|
|
13460
|
+
const r = /* @__PURE__ */ new Map(), n = fo(t);
|
|
13424
13461
|
for (const { run: o } of function(e) {
|
|
13425
|
-
return
|
|
13462
|
+
return En(e, "endnoteReference");
|
|
13426
13463
|
}(e)) {
|
|
13427
13464
|
const e = U(o);
|
|
13428
13465
|
if (!e || r.has(e.endnoteId)) continue;
|
|
@@ -13435,11 +13472,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13435
13472
|
}
|
|
13436
13473
|
return Array.from(r.values());
|
|
13437
13474
|
}
|
|
13438
|
-
function
|
|
13439
|
-
if (0 === e.length) return [
|
|
13475
|
+
function La(e) {
|
|
13476
|
+
if (0 === e.length) return [Fa()];
|
|
13440
13477
|
const [t, ...r] = e;
|
|
13441
13478
|
return "paragraph" !== t.type ? [
|
|
13442
|
-
|
|
13479
|
+
Fa(!0),
|
|
13443
13480
|
t,
|
|
13444
13481
|
...r
|
|
13445
13482
|
] : [(n = t, {
|
|
@@ -13461,7 +13498,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13461
13498
|
}), ...r];
|
|
13462
13499
|
var n;
|
|
13463
13500
|
}
|
|
13464
|
-
function
|
|
13501
|
+
function Fa(e = !0) {
|
|
13465
13502
|
return {
|
|
13466
13503
|
id: "synthetic:endnote-body-empty",
|
|
13467
13504
|
type: "paragraph",
|
|
@@ -13482,7 +13519,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13482
13519
|
style: { styleId: "EndnoteText" }
|
|
13483
13520
|
};
|
|
13484
13521
|
}
|
|
13485
|
-
const
|
|
13522
|
+
const Ba = [
|
|
13486
13523
|
"wholeTable",
|
|
13487
13524
|
"band1Horz",
|
|
13488
13525
|
"band2Horz",
|
|
@@ -13497,7 +13534,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13497
13534
|
"swCell",
|
|
13498
13535
|
"seCell"
|
|
13499
13536
|
];
|
|
13500
|
-
function
|
|
13537
|
+
function Ua(e) {
|
|
13501
13538
|
const t = {
|
|
13502
13539
|
...e.borders ? {
|
|
13503
13540
|
...e.borders.borderTop ? { borderTop: e.borders.borderTop } : {},
|
|
@@ -13508,77 +13545,77 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13508
13545
|
...e.shading ? { shading: e.shading } : {},
|
|
13509
13546
|
...e.cellStyle
|
|
13510
13547
|
};
|
|
13511
|
-
return Object.keys(t).length > 0 ?
|
|
13548
|
+
return Object.keys(t).length > 0 ? ko({
|
|
13512
13549
|
id: "table-style-cell",
|
|
13513
13550
|
blocks: [],
|
|
13514
13551
|
style: t
|
|
13515
13552
|
}) : "";
|
|
13516
13553
|
}
|
|
13517
|
-
function
|
|
13518
|
-
if ("number" == typeof t) return `<w:${e} w:w="${
|
|
13554
|
+
function za(e, t) {
|
|
13555
|
+
if ("number" == typeof t) return `<w:${e} w:w="${oo(t) ?? 0}" w:type="dxa"/>`;
|
|
13519
13556
|
if ("string" == typeof t && t.endsWith("%")) {
|
|
13520
13557
|
const r = Number.parseFloat(t);
|
|
13521
13558
|
return Number.isFinite(r) ? `<w:${e} w:w="${Math.round(50 * r)}" w:type="pct"/>` : "";
|
|
13522
13559
|
}
|
|
13523
13560
|
return "auto" === t ? `<w:${e} w:w="0" w:type="auto"/>` : "";
|
|
13524
13561
|
}
|
|
13525
|
-
function
|
|
13562
|
+
function Ha(e) {
|
|
13526
13563
|
if (!e) return "";
|
|
13527
13564
|
const t = [];
|
|
13528
13565
|
void 0 !== e.rowBandSize && t.push(`<w:tblStyleRowBandSize w:val="${e.rowBandSize}"/>`), void 0 !== e.colBandSize && t.push(`<w:tblStyleColBandSize w:val="${e.colBandSize}"/>`);
|
|
13529
|
-
const r =
|
|
13566
|
+
const r = za("tblW", e.width);
|
|
13530
13567
|
r && t.push(r);
|
|
13531
|
-
const n =
|
|
13568
|
+
const n = za("tblInd", e.indentLeft);
|
|
13532
13569
|
n && t.push(n);
|
|
13533
|
-
const o =
|
|
13570
|
+
const o = za("tblCellSpacing", e.cellSpacing);
|
|
13534
13571
|
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) {
|
|
13535
|
-
const r = Object.entries(e.defaultCellMargins).map(([e, t]) => `<w:${e} w:w="${
|
|
13572
|
+
const r = Object.entries(e.defaultCellMargins).map(([e, t]) => `<w:${e} w:w="${oo(t) ?? 0}" w:type="dxa"/>`).join("");
|
|
13536
13573
|
r && t.push(`<w:tblCellMar>${r}</w:tblCellMar>`);
|
|
13537
13574
|
}
|
|
13538
13575
|
if (e.borders) {
|
|
13539
|
-
const { borders: r } = e, n = It.filter(([, e]) => !!r[e]).map(([e, t]) => `<w:${e} ${
|
|
13576
|
+
const { borders: r } = e, n = It.filter(([, e]) => !!r[e]).map(([e, t]) => `<w:${e} ${ho(r[t])}`).join("");
|
|
13540
13577
|
n && t.push(`<w:tblBorders>${n}</w:tblBorders>`);
|
|
13541
13578
|
}
|
|
13542
13579
|
return t.length > 0 ? `<w:tblPr>${t.join("")}</w:tblPr>` : "";
|
|
13543
13580
|
}
|
|
13544
|
-
function
|
|
13545
|
-
const r = [], n = t.paragraphStyle ?
|
|
13581
|
+
function ja(e, t) {
|
|
13582
|
+
const r = [], n = t.paragraphStyle ? Si(t.paragraphStyle) : "";
|
|
13546
13583
|
n && r.push(n);
|
|
13547
|
-
const o = t.textStyle ?
|
|
13584
|
+
const o = t.textStyle ? Di(t.textStyle) : "";
|
|
13548
13585
|
o && r.push(o);
|
|
13549
|
-
const i =
|
|
13586
|
+
const i = Ha(t.tableStyle);
|
|
13550
13587
|
i && r.push(i);
|
|
13551
|
-
const a = t.rowStyle ?
|
|
13588
|
+
const a = t.rowStyle ? Io(t.rowStyle) : "";
|
|
13552
13589
|
a && r.push(a);
|
|
13553
|
-
const s =
|
|
13554
|
-
return s && r.push(s), 0 === r.length ? "" : `<w:tblStylePr w:type="${
|
|
13590
|
+
const s = Ua(t);
|
|
13591
|
+
return s && r.push(s), 0 === r.length ? "" : `<w:tblStylePr w:type="${to(e)}">${r.join("")}</w:tblStylePr>`;
|
|
13555
13592
|
}
|
|
13556
|
-
function
|
|
13593
|
+
function qa(e) {
|
|
13557
13594
|
const t = [];
|
|
13558
|
-
if (t.push(`<w:name w:val="${
|
|
13559
|
-
const r =
|
|
13595
|
+
if (t.push(`<w:name w:val="${to(e.name)}"/>`), e.basedOn && t.push(`<w:basedOn w:val="${to(e.basedOn)}"/>`), e.nextStyle && t.push(`<w:next w:val="${to(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) {
|
|
13596
|
+
const r = Si(e.paragraphStyle);
|
|
13560
13597
|
r && t.push(r);
|
|
13561
13598
|
}
|
|
13562
13599
|
if (e.textStyle) {
|
|
13563
|
-
const r =
|
|
13600
|
+
const r = Di(e.textStyle);
|
|
13564
13601
|
r && t.push(r);
|
|
13565
13602
|
}
|
|
13566
13603
|
if ("table" === e.type && e.tableStyle) {
|
|
13567
|
-
const r = e.tableStyle, n =
|
|
13604
|
+
const r = e.tableStyle, n = Ha(r);
|
|
13568
13605
|
if (n && t.push(n), r.conditionalFormats) {
|
|
13569
|
-
const e = [...
|
|
13606
|
+
const e = [...Ba.filter((e) => e in r.conditionalFormats), ...Object.keys(r.conditionalFormats).filter((e) => !Ba.includes(e))];
|
|
13570
13607
|
for (const n of e) {
|
|
13571
13608
|
const e = r.conditionalFormats[n];
|
|
13572
13609
|
if (e) {
|
|
13573
|
-
const r =
|
|
13610
|
+
const r = ja(n, e);
|
|
13574
13611
|
r && t.push(r);
|
|
13575
13612
|
}
|
|
13576
13613
|
}
|
|
13577
13614
|
}
|
|
13578
13615
|
}
|
|
13579
|
-
return `<w:style w:type="${"character" === e.type ? "character" : "table" === e.type ? "table" : "paragraph"}" w:styleId="${
|
|
13616
|
+
return `<w:style w:type="${"character" === e.type ? "character" : "table" === e.type ? "table" : "paragraph"}" w:styleId="${to(e.id)}"${e.isDefault ? " w:default=\"1\"" : ""}>${t.join("")}</w:style>`;
|
|
13580
13617
|
}
|
|
13581
|
-
function
|
|
13618
|
+
function Wa(e, t, r, n, o, i, a, s, l, c = !1) {
|
|
13582
13619
|
const u = n.map((e) => {
|
|
13583
13620
|
const t = "header" === e.kind ? "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml" : "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
|
|
13584
13621
|
return `<Override PartName="/word/${e.path}" ContentType="${t}"/>`;
|
|
@@ -13595,89 +13632,89 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13595
13632
|
return r;
|
|
13596
13633
|
}(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>`;
|
|
13597
13634
|
}
|
|
13598
|
-
const
|
|
13635
|
+
const Ga = {
|
|
13599
13636
|
decimal: "decimal",
|
|
13600
13637
|
lowerRoman: "lowerRoman",
|
|
13601
13638
|
upperRoman: "upperRoman",
|
|
13602
13639
|
lowerLetter: "lowerLetter",
|
|
13603
13640
|
upperLetter: "upperLetter",
|
|
13604
13641
|
symbol: "symbol"
|
|
13605
|
-
},
|
|
13642
|
+
}, Va = {
|
|
13606
13643
|
continuous: "continuous",
|
|
13607
13644
|
eachSection: "eachSect"
|
|
13608
13645
|
};
|
|
13609
|
-
function
|
|
13646
|
+
function Xa(e, t) {
|
|
13610
13647
|
if (!t) return null;
|
|
13611
13648
|
const r = [];
|
|
13612
|
-
return t.numberFormat && r.push(`<w:numFmt w:val="${
|
|
13649
|
+
return t.numberFormat && r.push(`<w:numFmt w:val="${Ga[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="${Va[t.restart]}"/>`), r.length > 0 ? `<w:${e}>${r.join("")}</w:${e}>` : null;
|
|
13613
13650
|
}
|
|
13614
|
-
function
|
|
13651
|
+
function Za(e, t) {
|
|
13615
13652
|
let r = "";
|
|
13616
|
-
for (const n of t) r += `<Relationship Id="${n.rId}" Type="${
|
|
13653
|
+
for (const n of t) r += `<Relationship Id="${n.rId}" Type="${Jn}/hyperlink" Target="${to(n.href)}" TargetMode="External"/>`;
|
|
13617
13654
|
for (const n of e) {
|
|
13618
13655
|
const e = "linked" === n.kind ? " TargetMode=\"External\"" : "";
|
|
13619
|
-
r += `<Relationship Id="${n.rId}" Type="${
|
|
13656
|
+
r += `<Relationship Id="${n.rId}" Type="${Jn}/image" Target="${to(n.target)}"${e}/>`;
|
|
13620
13657
|
}
|
|
13621
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${
|
|
13658
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Kn}">${r}</Relationships>`;
|
|
13622
13659
|
}
|
|
13623
|
-
function
|
|
13660
|
+
function Ya(e, t) {
|
|
13624
13661
|
t(e);
|
|
13625
|
-
for (const r of e.runs) "textBox" === r.kind &&
|
|
13662
|
+
for (const r of e.runs) "textBox" === r.kind && Qa(r.textBox.blocks, t);
|
|
13626
13663
|
}
|
|
13627
|
-
function
|
|
13664
|
+
function Qa(e, t) {
|
|
13628
13665
|
for (const r of e) switch (r.type) {
|
|
13629
13666
|
case "paragraph":
|
|
13630
|
-
|
|
13667
|
+
Ya(r, t);
|
|
13631
13668
|
break;
|
|
13632
13669
|
case "table":
|
|
13633
|
-
for (const e of r.rows) for (const r of e.cells)
|
|
13670
|
+
for (const e of r.rows) for (const r of e.cells) Qa(r.blocks, t);
|
|
13634
13671
|
break;
|
|
13635
13672
|
default: F(r, "block");
|
|
13636
13673
|
}
|
|
13637
13674
|
}
|
|
13638
|
-
function
|
|
13675
|
+
function Ka(e, t) {
|
|
13639
13676
|
for (let r = 0; r < e.attributes.length; r += 1) {
|
|
13640
13677
|
const n = e.attributes.item(r);
|
|
13641
13678
|
if (n?.localName === t) return n.value;
|
|
13642
13679
|
}
|
|
13643
13680
|
}
|
|
13644
|
-
function
|
|
13681
|
+
function Ja(e, t, r) {
|
|
13645
13682
|
if (!e) return 0;
|
|
13646
13683
|
const n = new b.DOMParser().parseFromString(e, "application/xml");
|
|
13647
13684
|
let o = 0;
|
|
13648
|
-
for (const i of Array.from(n.getElementsByTagNameNS(
|
|
13649
|
-
const e =
|
|
13685
|
+
for (const i of Array.from(n.getElementsByTagNameNS(Qn, t))) {
|
|
13686
|
+
const e = Ka(i, r);
|
|
13650
13687
|
if (!e || !/^\d+$/.test(e)) continue;
|
|
13651
13688
|
const t = Number.parseInt(e, 10);
|
|
13652
13689
|
Number.isSafeInteger(t) && (o = Math.max(o, t));
|
|
13653
13690
|
}
|
|
13654
13691
|
return o;
|
|
13655
13692
|
}
|
|
13656
|
-
function
|
|
13693
|
+
function es(e, t) {
|
|
13657
13694
|
return void 0 !== e && Number.isSafeInteger(e) && e >= t;
|
|
13658
13695
|
}
|
|
13659
|
-
function
|
|
13696
|
+
function ts(e) {
|
|
13660
13697
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), n = [], o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = function(e) {
|
|
13661
13698
|
const t = e.sourcePackage;
|
|
13662
13699
|
if (!t) return;
|
|
13663
13700
|
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;
|
|
13664
13701
|
return "xml" === n?.kind ? n.data : void 0;
|
|
13665
13702
|
}(e);
|
|
13666
|
-
let s = Math.max(1,
|
|
13703
|
+
let s = Math.max(1, Ja(a, "abstractNum", "abstractNumId") + 1), l = Math.max(1, Ja(a, "num", "numId") + 1);
|
|
13667
13704
|
const c = (e) => {
|
|
13668
|
-
if (
|
|
13705
|
+
if (es(e, 0) && !o.has(e)) return o.add(e), e;
|
|
13669
13706
|
for (; o.has(s);) s += 1;
|
|
13670
13707
|
const t = s;
|
|
13671
13708
|
return s += 1, o.add(t), t;
|
|
13672
13709
|
}, u = (e) => {
|
|
13673
|
-
if (
|
|
13710
|
+
if (es(e, 1) && !i.has(e)) return i.add(e), e;
|
|
13674
13711
|
for (; i.has(l);) l += 1;
|
|
13675
13712
|
const t = l;
|
|
13676
13713
|
return l += 1, i.add(t), t;
|
|
13677
13714
|
}, d = [], p = (e) => {
|
|
13678
13715
|
e.list && d.push(e);
|
|
13679
13716
|
};
|
|
13680
|
-
for (const f of le(e))
|
|
13717
|
+
for (const f of le(e)) Qa(f.blocks, p), f.header && Qa(f.header, p), f.firstPageHeader && Qa(f.firstPageHeader, p), f.evenPageHeader && Qa(f.evenPageHeader, p), f.footer && Qa(f.footer, p), f.firstPageFooter && Qa(f.firstPageFooter, p), f.evenPageFooter && Qa(f.evenPageFooter, p);
|
|
13681
13718
|
for (const f of d) {
|
|
13682
13719
|
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}`;
|
|
13683
13720
|
let s = r.get(a);
|
|
@@ -13718,9 +13755,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13718
13755
|
definitions: n
|
|
13719
13756
|
};
|
|
13720
13757
|
}
|
|
13721
|
-
const
|
|
13722
|
-
function
|
|
13723
|
-
const o =
|
|
13758
|
+
const rs = `xmlns:w="${Qn}" xmlns:w14="${eo}" 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="${Jn}"`;
|
|
13759
|
+
function ns(e, t, r, n) {
|
|
13760
|
+
const o = ro(e.width, 12240), i = ro(e.height, 15840), a = e.margins, s = "landscape" === e.orientation ? " w:orient=\"landscape\"" : "", l = [
|
|
13724
13761
|
t?.header?.first ? `<w:headerReference w:type="first" r:id="${t.header.first.relId}"/>` : "",
|
|
13725
13762
|
t?.header?.even ? `<w:headerReference w:type="even" r:id="${t.header.even.relId}"/>` : "",
|
|
13726
13763
|
t?.header?.default ? `<w:headerReference w:type="default" r:id="${t.header.default.relId}"/>` : "",
|
|
@@ -13730,9 +13767,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13730
13767
|
].join(""), c = t?.header?.first || t?.footer?.first ? "<w:titlePg/>" : "", u = n && "nextPage" !== n ? `<w:type w:val="${n}"/>` : "", d = e.columns;
|
|
13731
13768
|
let p = "";
|
|
13732
13769
|
if (d && d.count > 1) {
|
|
13733
|
-
const e =
|
|
13770
|
+
const e = ro(d.space, 0), t = d.separator ? " w:sep=\"1\"" : "";
|
|
13734
13771
|
if (!1 === d.equalWidth && d.columns?.length) {
|
|
13735
|
-
const r = d.columns.map((e) => `<w:col w:w="${
|
|
13772
|
+
const r = d.columns.map((e) => `<w:col w:w="${ro(e.width, 0)}" w:space="${ro(e.space, 0)}"/>`).join("");
|
|
13736
13773
|
p = `<w:cols w:num="${d.count}" w:space="${e}" w:equalWidth="0"${t}>${r}</w:cols>`;
|
|
13737
13774
|
} else p = `<w:cols w:num="${d.count}" w:space="${e}"${t}/>`;
|
|
13738
13775
|
}
|
|
@@ -13740,9 +13777,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13740
13777
|
let h = "";
|
|
13741
13778
|
if (f) {
|
|
13742
13779
|
const e = [];
|
|
13743
|
-
void 0 !== f.start && e.push(`w:start="${f.start}"`), f.format && e.push(`w:fmt="${
|
|
13780
|
+
void 0 !== f.start && e.push(`w:start="${f.start}"`), f.format && e.push(`w:fmt="${to(f.format)}"`), f.chapterStyle && e.push(`w:chapStyle="${to(f.chapterStyle)}"`), f.chapterSeparator && e.push(`w:chapSep="${to(f.chapterSeparator)}"`), e.length > 0 && (h = `<w:pgNumType ${e.join(" ")}/>`);
|
|
13744
13781
|
}
|
|
13745
|
-
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 ${
|
|
13782
|
+
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 ${bi(r.propertyRevision)}>${ns(r.propertyRevision.previous.pageSettings, void 0, (x = r.propertyRevision.previous, {
|
|
13746
13783
|
id: "section:revision",
|
|
13747
13784
|
blocks: [],
|
|
13748
13785
|
pageSettings: x.pageSettings,
|
|
@@ -13752,49 +13789,49 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13752
13789
|
...void 0 !== x.bidi ? { bidi: x.bidi } : {}
|
|
13753
13790
|
}), r.propertyRevision.previous.nextBreakType)}</w:sectPrChange>` : "";
|
|
13754
13791
|
var x;
|
|
13755
|
-
return `<w:sectPr>${l}${c}${u}<w:pgSz w:w="${o}" w:h="${i}"${s}/><w:pgMar w:top="${
|
|
13792
|
+
return `<w:sectPr>${l}${c}${u}<w:pgSz w:w="${o}" w:h="${i}"${s}/><w:pgMar w:top="${ro(a.top, 1440)}" w:right="${ro(a.right, 1440)}" w:bottom="${ro(a.bottom, 1440)}" w:left="${ro(a.left, 1440)}" w:header="${ro(a.header, 720)}" w:footer="${ro(a.footer, 720)}" w:gutter="${ro(a.gutter, 0)}"/>${h}${p}${m}${g}${v}${y}</w:sectPr>`;
|
|
13756
13793
|
}
|
|
13757
|
-
function
|
|
13758
|
-
const n = le(e), o = n.map((o, i) =>
|
|
13759
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document ${
|
|
13794
|
+
function os(e, t, r) {
|
|
13795
|
+
const n = le(e), o = n.map((o, i) => Ra(o.blocks, t, e.styles) + ns(o.pageSettings, r[i], o, n[i + 1]?.breakType)).join(""), i = e.design?.pageColor?.replace("#", "").toUpperCase();
|
|
13796
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document ${rs}>${i ? `<w:background w:color="${i}"/>` : ""}<w:body>${o}</w:body></w:document>`;
|
|
13760
13797
|
}
|
|
13761
|
-
function
|
|
13762
|
-
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="${
|
|
13763
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${i} ${
|
|
13798
|
+
function is(e, t, r, n, o) {
|
|
13799
|
+
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="${to(o.text)}" style="font-family:${to(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>` : "";
|
|
13800
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${i} ${rs}>${a}${Ra(t, r, n)}</w:${i}>`;
|
|
13764
13801
|
}
|
|
13765
|
-
function
|
|
13802
|
+
function as(e) {
|
|
13766
13803
|
if (e) return {
|
|
13767
13804
|
...e,
|
|
13768
13805
|
propertyRevision: e.propertyRevision ? {
|
|
13769
13806
|
...e.propertyRevision,
|
|
13770
|
-
previous:
|
|
13807
|
+
previous: as(e.propertyRevision.previous) ?? {}
|
|
13771
13808
|
} : void 0
|
|
13772
13809
|
};
|
|
13773
13810
|
}
|
|
13774
|
-
function
|
|
13811
|
+
function ss(e) {
|
|
13775
13812
|
if (e) return {
|
|
13776
13813
|
...e,
|
|
13777
13814
|
tabs: e.tabs ? e.tabs.map((e) => ({ ...e })) : e.tabs,
|
|
13778
13815
|
propertyRevision: e.propertyRevision ? {
|
|
13779
13816
|
...e.propertyRevision,
|
|
13780
|
-
previous:
|
|
13817
|
+
previous: ss(e.propertyRevision.previous) ?? {}
|
|
13781
13818
|
} : void 0
|
|
13782
13819
|
};
|
|
13783
13820
|
}
|
|
13784
|
-
function
|
|
13785
|
-
return Array.isArray(e) ? e.map(
|
|
13821
|
+
function ls(e) {
|
|
13822
|
+
return Array.isArray(e) ? e.map(ls) : e && "object" == typeof e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, ls(t)])) : e;
|
|
13786
13823
|
}
|
|
13787
|
-
function
|
|
13824
|
+
function cs(e) {
|
|
13788
13825
|
const t = {
|
|
13789
13826
|
id: e.id,
|
|
13790
13827
|
text: e.text,
|
|
13791
|
-
styles:
|
|
13828
|
+
styles: as(e.styles),
|
|
13792
13829
|
revision: e.revision ? { ...e.revision } : void 0,
|
|
13793
13830
|
revisionRangeMarker: e.revisionRangeMarker ? { ...e.revisionRangeMarker } : void 0,
|
|
13794
13831
|
sdtWrappers: e.sdtWrappers ? [...e.sdtWrappers] : void 0
|
|
13795
13832
|
};
|
|
13796
13833
|
return function(e, t) {
|
|
13797
|
-
const r =
|
|
13834
|
+
const r = Vr(e);
|
|
13798
13835
|
return r && (t.ooxmlSource = { ...r }), t;
|
|
13799
13836
|
}(e, z(e, {
|
|
13800
13837
|
text: () => ({
|
|
@@ -13819,7 +13856,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13819
13856
|
} : void 0,
|
|
13820
13857
|
shape: r.shape ? { ...r.shape } : void 0,
|
|
13821
13858
|
body: r.body ? { ...r.body } : void 0,
|
|
13822
|
-
blocks:
|
|
13859
|
+
blocks: ds(r.blocks)
|
|
13823
13860
|
})
|
|
13824
13861
|
};
|
|
13825
13862
|
var r;
|
|
@@ -13858,25 +13895,25 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13858
13895
|
return {
|
|
13859
13896
|
...t,
|
|
13860
13897
|
kind: "math",
|
|
13861
|
-
math: (r = e.math,
|
|
13898
|
+
math: (r = e.math, ls(r))
|
|
13862
13899
|
};
|
|
13863
13900
|
var r;
|
|
13864
13901
|
}
|
|
13865
13902
|
}));
|
|
13866
13903
|
}
|
|
13867
|
-
function
|
|
13904
|
+
function us(e) {
|
|
13868
13905
|
return {
|
|
13869
13906
|
...e,
|
|
13870
|
-
runs: e.runs.map(
|
|
13871
|
-
style:
|
|
13907
|
+
runs: e.runs.map(cs),
|
|
13908
|
+
style: ss(e.style),
|
|
13872
13909
|
list: e.list ? { ...e.list } : void 0,
|
|
13873
13910
|
numberingRevision: e.numberingRevision ? { ...e.numberingRevision } : void 0
|
|
13874
13911
|
};
|
|
13875
13912
|
}
|
|
13876
|
-
function
|
|
13913
|
+
function ds(e) {
|
|
13877
13914
|
return e.map((e) => {
|
|
13878
13915
|
switch (e.type) {
|
|
13879
|
-
case "paragraph": return
|
|
13916
|
+
case "paragraph": return us(e);
|
|
13880
13917
|
case "table": return {
|
|
13881
13918
|
...e,
|
|
13882
13919
|
style: e.style ? {
|
|
@@ -13912,7 +13949,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13912
13949
|
...e,
|
|
13913
13950
|
mergeRevisionState: void 0,
|
|
13914
13951
|
style: e.style ? { ...e.style } : void 0,
|
|
13915
|
-
blocks:
|
|
13952
|
+
blocks: ds(e.blocks)
|
|
13916
13953
|
}))
|
|
13917
13954
|
} : void 0,
|
|
13918
13955
|
style: e.style ? {
|
|
@@ -13923,7 +13960,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13923
13960
|
previous: { ...e.style.propertyRevision.previous }
|
|
13924
13961
|
} : void 0
|
|
13925
13962
|
} : void 0,
|
|
13926
|
-
blocks:
|
|
13963
|
+
blocks: ds(e.blocks)
|
|
13927
13964
|
}))
|
|
13928
13965
|
}))
|
|
13929
13966
|
};
|
|
@@ -13931,7 +13968,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13931
13968
|
}
|
|
13932
13969
|
});
|
|
13933
13970
|
}
|
|
13934
|
-
function
|
|
13971
|
+
function ps(e) {
|
|
13935
13972
|
return !!e && "caption" === e.style?.styleId?.toLowerCase() && e.runs.some((e) => {
|
|
13936
13973
|
const t = function(e) {
|
|
13937
13974
|
return "fieldInstruction" === e.kind ? e.fieldInstruction : void 0;
|
|
@@ -13939,11 +13976,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13939
13976
|
return void 0 !== t && (/* @__PURE__ */ new RegExp("\\bSEQ\\s+Figure\\b", "i")).test(t);
|
|
13940
13977
|
});
|
|
13941
13978
|
}
|
|
13942
|
-
function
|
|
13979
|
+
function fs(e, t) {
|
|
13943
13980
|
return e.map((e) => {
|
|
13944
13981
|
switch (e.type) {
|
|
13945
|
-
case "paragraph": return
|
|
13946
|
-
if (!
|
|
13982
|
+
case "paragraph": return ps(e) ? function(e, t) {
|
|
13983
|
+
if (!ps(e)) return us(e);
|
|
13947
13984
|
let r = !1, n = !1;
|
|
13948
13985
|
const o = e.runs.map((e) => "fieldChar" === e.kind && "separate" === e.fieldChar.kind ? (r = !0, {
|
|
13949
13986
|
...e,
|
|
@@ -13956,17 +13993,17 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13956
13993
|
text: String(t)
|
|
13957
13994
|
}) : { ...e });
|
|
13958
13995
|
return n ? {
|
|
13959
|
-
...
|
|
13996
|
+
...us(e),
|
|
13960
13997
|
runs: o
|
|
13961
|
-
} :
|
|
13962
|
-
}(e, t.next++) :
|
|
13998
|
+
} : us(e);
|
|
13999
|
+
}(e, t.next++) : us(e);
|
|
13963
14000
|
case "table": return {
|
|
13964
14001
|
...e,
|
|
13965
14002
|
rows: e.rows.map((e) => ({
|
|
13966
14003
|
...e,
|
|
13967
14004
|
cells: e.cells.map((e) => ({
|
|
13968
14005
|
...e,
|
|
13969
|
-
blocks:
|
|
14006
|
+
blocks: fs(e.blocks, t)
|
|
13970
14007
|
}))
|
|
13971
14008
|
}))
|
|
13972
14009
|
};
|
|
@@ -13974,7 +14011,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
13974
14011
|
}
|
|
13975
14012
|
});
|
|
13976
14013
|
}
|
|
13977
|
-
const
|
|
14014
|
+
const hs = {
|
|
13978
14015
|
oasis: {
|
|
13979
14016
|
accent: "0F766E",
|
|
13980
14017
|
heading: "115E59",
|
|
@@ -14006,9 +14043,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14006
14043
|
body: "1F2937"
|
|
14007
14044
|
}
|
|
14008
14045
|
};
|
|
14009
|
-
function
|
|
14046
|
+
function ms(e, t, r, n) {
|
|
14010
14047
|
const o = [], i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), s = [], l = /* @__PURE__ */ new Map();
|
|
14011
|
-
return
|
|
14048
|
+
return Qa(e, (e) => {
|
|
14012
14049
|
for (const t of e.runs) {
|
|
14013
14050
|
const e = t.styles?.link;
|
|
14014
14051
|
if (e && !e.startsWith("#") && !l.has(e)) {
|
|
@@ -14066,23 +14103,23 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14066
14103
|
hyperlinkMap: l
|
|
14067
14104
|
};
|
|
14068
14105
|
}
|
|
14069
|
-
function
|
|
14070
|
-
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`,
|
|
14106
|
+
function gs(e, t, r) {
|
|
14107
|
+
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`, Za(r.partContext.images, r.partContext.hyperlinks)));
|
|
14071
14108
|
}
|
|
14072
|
-
async function
|
|
14109
|
+
async function ws(e) {
|
|
14073
14110
|
e = function(e) {
|
|
14074
14111
|
const t = { next: 1 }, r = le(e).map((e) => ({
|
|
14075
14112
|
...e,
|
|
14076
|
-
blocks:
|
|
14077
|
-
header: e.header ?
|
|
14078
|
-
footer: e.footer ?
|
|
14113
|
+
blocks: fs(e.blocks, t),
|
|
14114
|
+
header: e.header ? ds(e.header) : void 0,
|
|
14115
|
+
footer: e.footer ? ds(e.footer) : void 0
|
|
14079
14116
|
}));
|
|
14080
14117
|
return {
|
|
14081
14118
|
...e,
|
|
14082
14119
|
sections: r
|
|
14083
14120
|
};
|
|
14084
14121
|
}(e);
|
|
14085
|
-
const t = new w.default(), r =
|
|
14122
|
+
const t = new w.default(), r = ts(e), n = {
|
|
14086
14123
|
nextImageId: 1,
|
|
14087
14124
|
nextTextBoxDocPrId: 1000001
|
|
14088
14125
|
}, o = le(e), i = function(e) {
|
|
@@ -14100,11 +14137,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14100
14137
|
cx: 1,
|
|
14101
14138
|
cy: 1
|
|
14102
14139
|
} : void 0;
|
|
14103
|
-
}(e), a =
|
|
14140
|
+
}(e), a = Da(e), s = function(e) {
|
|
14104
14141
|
const t = /* @__PURE__ */ new Map();
|
|
14105
14142
|
for (const r of e) t.set(r.footnoteId, r.docxId);
|
|
14106
14143
|
return t;
|
|
14107
|
-
}(a), l = a.length > 0, c =
|
|
14144
|
+
}(a), l = a.length > 0, c = Oa(e), u = function(e) {
|
|
14108
14145
|
const t = /* @__PURE__ */ new Map();
|
|
14109
14146
|
for (const r of e) t.set(r.endnoteId, r.docxId);
|
|
14110
14147
|
return t;
|
|
@@ -14194,12 +14231,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14194
14231
|
eventsByParagraph: i,
|
|
14195
14232
|
comments: s
|
|
14196
14233
|
};
|
|
14197
|
-
}(e), h = (e) => (e.footnoteIdMap = s, e.endnoteIdMap = u, e.bookmarkEventsByParagraph = p, e.commentEventsByParagraph = f?.eventsByParagraph, e), m = h(
|
|
14234
|
+
}(e), h = (e) => (e.footnoteIdMap = s, e.endnoteIdMap = u, e.bookmarkEventsByParagraph = p, e.commentEventsByParagraph = f?.eventsByParagraph, e), m = h(ms(o.flatMap((e) => e.blocks), r, n, e)), g = void 0 !== f, b = [], v = o.map(() => ({}));
|
|
14198
14235
|
let y = 1, x = 1;
|
|
14199
14236
|
o.forEach((t, o) => {
|
|
14200
14237
|
const a = (t, a, s) => {
|
|
14201
14238
|
if (!(s && 0 !== s.length || "header" === t && "text" === e.design?.watermark?.kind || "header" === t && void 0 !== i)) return;
|
|
14202
|
-
const l = s ?? [], c = "header" === t ? y : x, u = `${t}${c}.xml`, d = `rId${"header" === t ? "Header" : "Footer"}${c}`, p = h(
|
|
14239
|
+
const l = s ?? [], c = "header" === t ? y : x, u = `${t}${c}.xml`, d = `rId${"header" === t ? "Header" : "Footer"}${c}`, p = h(ms(l, r, n, e));
|
|
14203
14240
|
"header" === t && i && p.images.push({ ...i }), b.push({
|
|
14204
14241
|
kind: t,
|
|
14205
14242
|
type: a,
|
|
@@ -14214,68 +14251,68 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14214
14251
|
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);
|
|
14215
14252
|
});
|
|
14216
14253
|
const S = r.definitions.length > 0, N = o.some((e) => (e.evenPageHeader?.length ?? 0) > 0 || (e.evenPageFooter?.length ?? 0) > 0), E = N || 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) {
|
|
14217
|
-
const s = o(t.flatMap((e) =>
|
|
14254
|
+
const s = o(t.flatMap((e) => Pa(e.footnote.blocks)));
|
|
14218
14255
|
s.footnoteIdMap = a;
|
|
14219
14256
|
const l = t.map((e) => {
|
|
14220
|
-
const t =
|
|
14257
|
+
const t = Ra(Pa(e.footnote.blocks), s, i);
|
|
14221
14258
|
return `<w:footnote w:id="${e.docxId}">${t}</w:footnote>`;
|
|
14222
14259
|
}).join("");
|
|
14223
14260
|
return {
|
|
14224
|
-
xml: `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:footnotes xmlns:w="${
|
|
14261
|
+
xml: `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:footnotes xmlns:w="${Qn}" xmlns:w14="${eo}" 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="${Jn}"><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>`,
|
|
14225
14262
|
partContext: s
|
|
14226
14263
|
};
|
|
14227
|
-
}(0, a, 0, 0, (t) =>
|
|
14264
|
+
}(0, a, 0, 0, (t) => ms(t, r, n, e), e.styles, s) : null;
|
|
14228
14265
|
_ && k.push(..._.partContext.images);
|
|
14229
14266
|
const T = d ? function(e, t, r, n, o, i, a) {
|
|
14230
|
-
const s = o(t.flatMap((e) =>
|
|
14267
|
+
const s = o(t.flatMap((e) => La(e.endnote.blocks)));
|
|
14231
14268
|
s.endnoteIdMap = a;
|
|
14232
14269
|
const l = t.map((e) => {
|
|
14233
|
-
const t =
|
|
14270
|
+
const t = Ra(La(e.endnote.blocks), s, i);
|
|
14234
14271
|
return `<w:endnote w:id="${e.docxId}">${t}</w:endnote>`;
|
|
14235
14272
|
}).join("");
|
|
14236
14273
|
return {
|
|
14237
|
-
xml: `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:endnotes xmlns:w="${
|
|
14274
|
+
xml: `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:endnotes xmlns:w="${Qn}" xmlns:w14="${eo}" 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="${Jn}"><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>`,
|
|
14238
14275
|
partContext: s
|
|
14239
14276
|
};
|
|
14240
|
-
}(0, c, 0, 0, (t) =>
|
|
14277
|
+
}(0, c, 0, 0, (t) => ms(t, r, n, e), e.styles, u) : null;
|
|
14241
14278
|
T && k.push(...T.partContext.images);
|
|
14242
14279
|
const I = k.filter((e) => "embedded" === e.kind).map((e) => e.target.split(".").pop()?.toLowerCase()).filter((e) => Boolean(e)), C = null != e.styles && Object.keys(e.styles).length > 0, A = (e.fontTable?.length ?? 0) > 0, R = void 0 !== e.design;
|
|
14243
|
-
t.file("[Content_Types].xml",
|
|
14244
|
-
const t = Object.values(e).map(
|
|
14245
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="${
|
|
14280
|
+
t.file("[Content_Types].xml", Wa(S, I, E, b, l, d, C, g, A, R)), t.file("_rels/.rels", `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Kn}"><Relationship Id="rId1" Type="${Jn}/officeDocument" Target="word/document.xml"/></Relationships>`), t.file("word/document.xml", os(e, m, v)), C && t.file("word/styles.xml", function(e) {
|
|
14281
|
+
const t = Object.values(e).map(qa).join("");
|
|
14282
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="${eo}">${t}</w:styles>`;
|
|
14246
14283
|
}(e.styles)), S && t.file("word/numbering.xml", function(e) {
|
|
14247
14284
|
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 }) => {
|
|
14248
|
-
const d = "bullet" === e ? "bullet" : u?.format ?? r ?? "decimal", p = o ?? ("bullet" === e ? l ?? "" : `%${t + 1}.`), f = n ?? 1, h = "bullet" === e ? c ?? "Symbol" : void 0, m = h ? `<w:rPr><w:rFonts w:ascii="${
|
|
14249
|
-
return `<w:lvl w:ilvl="${t}"><w:start w:val="${f}"/><w:numFmt w:val="${
|
|
14285
|
+
const d = "bullet" === e ? "bullet" : u?.format ?? r ?? "decimal", p = o ?? ("bullet" === e ? l ?? "" : `%${t + 1}.`), f = n ?? 1, h = "bullet" === e ? c ?? "Symbol" : void 0, m = h ? `<w:rPr><w:rFonts w:ascii="${to(h)}" w:hAnsi="${to(h)}" w:hint="default"/></w:rPr>` : "", g = i && "tab" !== i ? `<w:suff w:val="${i}"/>` : "", w = s ? "<w:isLgl/>" : "", b = void 0 !== u?.restartAfterLevel ? `<w:lvlRestart w:val="${u.restartAfterLevel}"/>` : "", v = u?.paragraphStyleId ? `<w:pStyle w:val="${to(u.paragraphStyleId)}"/>` : "";
|
|
14286
|
+
return `<w:lvl w:ilvl="${t}"><w:start w:val="${f}"/><w:numFmt w:val="${to(d)}"/>${b}${v}<w:lvlText w:val="${to(p)}"/><w:lvlJc w:val="${a ?? "left"}"/>${g}${w}${m}</w:lvl>`;
|
|
14250
14287
|
}).join("")}</w:abstractNum>`).join(""), r = e.map(({ abstractNumId: e, numId: t }) => `<w:num w:numId="${t}"><w:abstractNumId w:val="${e}"/></w:num>`).join("");
|
|
14251
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:numbering xmlns:w="${
|
|
14288
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:numbering xmlns:w="${Qn}">${t}${r}</w:numbering>`;
|
|
14252
14289
|
}(r.definitions)), (C || S || E || m.images.length > 0 || m.hyperlinks.length > 0 || b.length > 0 || l || d || g || A || R) && t.file("word/_rels/document.xml.rels", function(e, t, r, n, o, i, a, s, l, c, u = !1) {
|
|
14253
14290
|
let d = "";
|
|
14254
|
-
s && (d += `<Relationship Id="rIdStyles" Type="${
|
|
14255
|
-
for (const p of n) d += `<Relationship Id="${p.rId}" Type="${
|
|
14291
|
+
s && (d += `<Relationship Id="rIdStyles" Type="${Jn}/styles" Target="styles.xml"/>`), e && (d += `<Relationship Id="rIdNum" Type="${Jn}/numbering" Target="numbering.xml"/>`), t && (d += `<Relationship Id="rIdSettings" Type="${Jn}/settings" Target="settings.xml"/>`);
|
|
14292
|
+
for (const p of n) d += `<Relationship Id="${p.rId}" Type="${Jn}/hyperlink" Target="${to(p.href)}" TargetMode="External"/>`;
|
|
14256
14293
|
for (const p of r) {
|
|
14257
14294
|
const e = "linked" === p.kind ? " TargetMode=\"External\"" : "";
|
|
14258
|
-
d += `<Relationship Id="${p.rId}" Type="${
|
|
14295
|
+
d += `<Relationship Id="${p.rId}" Type="${Jn}/image" Target="${to(p.target)}"${e}/>`;
|
|
14259
14296
|
}
|
|
14260
14297
|
for (const p of o) {
|
|
14261
14298
|
const e = "header" === p.kind ? "header" : "footer";
|
|
14262
|
-
d += `<Relationship Id="${p.relId}" Type="${
|
|
14299
|
+
d += `<Relationship Id="${p.relId}" Type="${Jn}/${e}" Target="${p.path}"/>`;
|
|
14263
14300
|
}
|
|
14264
|
-
return i && (d += `<Relationship Id="rIdFootnotes" Type="${
|
|
14301
|
+
return i && (d += `<Relationship Id="rIdFootnotes" Type="${Jn}/footnotes" Target="footnotes.xml"/>`), a && (d += `<Relationship Id="rIdEndnotes" Type="${Jn}/endnotes" Target="endnotes.xml"/>`), l && (d += `<Relationship Id="rIdComments" Type="${Jn}/comments" Target="comments.xml"/>`, d += "<Relationship Id=\"rIdCommentsExtended\" Type=\"http://schemas.microsoft.com/office/2011/relationships/commentsExtended\" Target=\"commentsExtended.xml\"/>"), c && (d += `<Relationship Id="rIdFontTable" Type="${Jn}/fontTable" Target="fontTable.xml"/>`), u && (d += `<Relationship Id="rIdTheme" Type="${Jn}/theme" Target="theme/theme1.xml"/>`), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Kn}">${d}</Relationships>`;
|
|
14265
14302
|
}(S, E, m.images, m.hyperlinks, b, l, d, C, g, A, R)), A && t.file("word/fontTable.xml", function(e) {
|
|
14266
14303
|
const t = e.map((e) => {
|
|
14267
14304
|
const t = [];
|
|
14268
|
-
if (e.altName && t.push(`<w:altName w:val="${
|
|
14269
|
-
const r = Object.entries(e.sig).map(([e, t]) => `w:${e}="${
|
|
14305
|
+
if (e.altName && t.push(`<w:altName w:val="${to(e.altName)}"/>`), e.panose1 && t.push(`<w:panose1 w:val="${to(e.panose1)}"/>`), e.charset && t.push(`<w:charset w:val="${to(e.charset)}"/>`), e.family && t.push(`<w:family w:val="${to(e.family)}"/>`), e.pitch && t.push(`<w:pitch w:val="${to(e.pitch)}"/>`), e.sig) {
|
|
14306
|
+
const r = Object.entries(e.sig).map(([e, t]) => `w:${e}="${to(t)}"`).join(" ");
|
|
14270
14307
|
r && t.push(`<w:sig ${r}/>`);
|
|
14271
14308
|
}
|
|
14272
|
-
return `<w:font w:name="${
|
|
14309
|
+
return `<w:font w:name="${to(e.name)}">${t.join("")}</w:font>`;
|
|
14273
14310
|
}).join("");
|
|
14274
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:fonts xmlns:w="${
|
|
14311
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:fonts xmlns:w="${Qn}">${t}</w:fonts>`;
|
|
14275
14312
|
}(e.fontTable)), R && t.file("word/theme/theme1.xml", function(e) {
|
|
14276
14313
|
const t = e?.themeData?.sourceXml;
|
|
14277
14314
|
if (t) return t;
|
|
14278
|
-
const r =
|
|
14315
|
+
const r = hs[e?.themeId ?? "oasis"] ?? hs.oasis, n = e?.themeData, o = (e, t) => (n?.colors?.[e] ?? t).replace(/^#/, "").toUpperCase(), i = {
|
|
14279
14316
|
dk1: o("dk1", "000000"),
|
|
14280
14317
|
lt1: o("lt1", "FFFFFF"),
|
|
14281
14318
|
dk2: o("dk2", r.body),
|
|
@@ -14288,62 +14325,62 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14288
14325
|
accent6: o("accent6", "A5A5A5"),
|
|
14289
14326
|
hlink: o("hlink", "0563C1"),
|
|
14290
14327
|
folHlink: o("folHlink", "954F72")
|
|
14291
|
-
}, a = Object.entries(i).map(([e, t]) => `<a:${e}><a:srgbClr val="${t}"/></a:${e}>`).join(""), s = (e, t, r) =>
|
|
14328
|
+
}, a = Object.entries(i).map(([e, t]) => `<a:${e}><a:srgbClr val="${t}"/></a:${e}>`).join(""), s = (e, t, r) => to(n?.fonts?.[e]?.[t] ?? r), l = to(n?.name ?? `${(e?.themeId ?? "oasis")[0].toUpperCase()}${(e?.themeId ?? "oasis").slice(1)}`), c = n?.effectsXml ?? "<a:fillStyleLst/><a:lnStyleLst/><a:effectStyleLst/><a:bgFillStyleLst/>";
|
|
14292
14329
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="${l}"><a:themeElements><a:clrScheme name="${l}">${a}</a:clrScheme><a:fontScheme name="${l}"><a:majorFont><a:latin typeface="${s("major", "majorHAnsi", "Aptos Display")}"/><a:ea typeface="${s("major", "majorEastAsia", "Aptos Display")}"/><a:cs typeface="${s("major", "majorBidi", "Aptos Display")}"/></a:majorFont><a:minorFont><a:latin typeface="${s("minor", "minorHAnsi", "Aptos")}"/><a:ea typeface="${s("minor", "minorEastAsia", "Aptos")}"/><a:cs typeface="${s("minor", "minorBidi", "Aptos")}"/></a:minorFont></a:fontScheme><a:fmtScheme name="${l}">${c}</a:fmtScheme></a:themeElements></a:theme>`;
|
|
14293
14330
|
}(e.design)), E && t.file("word/settings.xml", function(e, t, r, n, o, i) {
|
|
14294
|
-
const a = [], s =
|
|
14331
|
+
const a = [], s = oo(t);
|
|
14295
14332
|
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}"/>`);
|
|
14296
|
-
const l =
|
|
14333
|
+
const l = oo(i?.hyphenationZone);
|
|
14297
14334
|
null !== l && a.push(`<w:hyphenationZone w:val="${l}"/>`), i?.doNotHyphenateCaps && a.push("<w:doNotHyphenateCaps/>");
|
|
14298
|
-
const c =
|
|
14335
|
+
const c = Xa("footnotePr", r);
|
|
14299
14336
|
c && a.push(c);
|
|
14300
|
-
const u =
|
|
14301
|
-
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="${
|
|
14337
|
+
const u = Xa("endnotePr", n);
|
|
14338
|
+
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="${Qn}">${a.join("")}</w:settings>`;
|
|
14302
14339
|
}(N, e.settings?.defaultTabStop, e.footnotes?.settings, e.endnotes?.settings, e.settings?.allowSpaceOfSameStyleInTable, {
|
|
14303
14340
|
autoHyphenation: e.settings?.autoHyphenation,
|
|
14304
14341
|
consecutiveHyphenLimit: e.settings?.consecutiveHyphenLimit,
|
|
14305
14342
|
hyphenationZone: e.settings?.hyphenationZone,
|
|
14306
14343
|
doNotHyphenateCaps: e.settings?.doNotHyphenateCaps
|
|
14307
14344
|
}));
|
|
14308
|
-
for (const w of b) t.file(`word/${w.path}`,
|
|
14309
|
-
|
|
14345
|
+
for (const w of b) t.file(`word/${w.path}`, is(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`, Za(w.context.images, w.context.hyperlinks));
|
|
14346
|
+
gs(t, "footnotes", _), gs(t, "endnotes", T), f && (t.file("word/comments.xml", uo(f)), t.file("word/commentsExtended.xml", function(e) {
|
|
14310
14347
|
const t = new Map(e.comments.map(({ comment: e, paraId: t }) => [e.id, t])), r = e.comments.map(({ comment: e, paraId: r }) => {
|
|
14311
14348
|
const n = e.parentId ? t.get(e.parentId) : void 0;
|
|
14312
14349
|
return `<w15:commentEx w15:paraId="${r}"${n ? ` w15:paraIdParent="${n}"` : ""} w15:done="${e.resolved ? "1" : "0"}"/>`;
|
|
14313
14350
|
}).join("");
|
|
14314
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w15:commentsEx ${
|
|
14351
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w15:commentsEx ${co}>${r}</w15:commentsEx>`;
|
|
14315
14352
|
}(f)));
|
|
14316
14353
|
for (const w of k) "embedded" === w.kind && w.base64 && t.file(`word/${w.target}`, w.base64, { base64: !0 });
|
|
14317
14354
|
return t.generateAsync({ type: "arraybuffer" });
|
|
14318
14355
|
}
|
|
14319
|
-
function
|
|
14356
|
+
function bs(e) {
|
|
14320
14357
|
let t = 2166136261;
|
|
14321
14358
|
for (const r of e) t ^= r, t = Math.imul(t, 16777619);
|
|
14322
14359
|
return (t >>> 0).toString(16).padStart(8, "0");
|
|
14323
14360
|
}
|
|
14324
|
-
async function
|
|
14361
|
+
async function vs(e) {
|
|
14325
14362
|
return async function(e) {
|
|
14326
14363
|
const t = await w.default.loadAsync(e), r = {};
|
|
14327
|
-
for (const [n, o] of Object.entries(t.files)) o.dir || (r[
|
|
14364
|
+
for (const [n, o] of Object.entries(t.files)) o.dir || (r[Gn(n)] = bs(await o.async("uint8array")));
|
|
14328
14365
|
return r;
|
|
14329
|
-
}(await
|
|
14366
|
+
}(await ws(e));
|
|
14330
14367
|
}
|
|
14331
|
-
const
|
|
14332
|
-
function
|
|
14368
|
+
const ys = "word/document.xml";
|
|
14369
|
+
function xs(e) {
|
|
14333
14370
|
let t = 2166136261;
|
|
14334
14371
|
for (let r = 0; r < e.length; r += 1) t ^= e.charCodeAt(r), t = Math.imul(t, 16777619);
|
|
14335
14372
|
return (t >>> 0).toString(16).padStart(8, "0");
|
|
14336
14373
|
}
|
|
14337
|
-
function
|
|
14374
|
+
function Ss(e, t) {
|
|
14338
14375
|
const r = t.overrides[e];
|
|
14339
14376
|
if (r) return r;
|
|
14340
14377
|
const n = e.includes(".") ? e.slice(e.lastIndexOf(".") + 1).toLowerCase() : "";
|
|
14341
14378
|
return t.defaults[n];
|
|
14342
14379
|
}
|
|
14343
|
-
function
|
|
14380
|
+
function Ns(e, t) {
|
|
14344
14381
|
return !(!e.endsWith(".xml") && !e.endsWith(".rels")) || "application/xml" === t || Boolean(t?.endsWith("+xml"));
|
|
14345
14382
|
}
|
|
14346
|
-
async function
|
|
14383
|
+
async function Es(e) {
|
|
14347
14384
|
const t = await w.default.loadAsync(e), r = [], n = await t.file("[Content_Types].xml")?.async("string"), o = function(e) {
|
|
14348
14385
|
const t = {
|
|
14349
14386
|
defaults: {},
|
|
@@ -14361,7 +14398,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14361
14398
|
e && r && (t.defaults[e] = r);
|
|
14362
14399
|
} else if ("Override" === o.localName) {
|
|
14363
14400
|
const e = o.getAttribute("PartName"), r = o.getAttribute("ContentType");
|
|
14364
|
-
e && r && (t.overrides[
|
|
14401
|
+
e && r && (t.overrides[Gn(e)] = r);
|
|
14365
14402
|
}
|
|
14366
14403
|
}
|
|
14367
14404
|
return t;
|
|
@@ -14374,21 +14411,21 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14374
14411
|
const i = {};
|
|
14375
14412
|
for (const [l, c] of Object.entries(t.files)) {
|
|
14376
14413
|
if (c.dir) continue;
|
|
14377
|
-
const e =
|
|
14414
|
+
const e = Gn(l), t = Ss(e, o), r = Ns(e, t) ? "xml" : "binary", n = "xml" === r ? await c.async("string") : await c.async("base64");
|
|
14378
14415
|
i[e] = {
|
|
14379
14416
|
path: e,
|
|
14380
14417
|
...t ? { contentType: t } : {},
|
|
14381
14418
|
kind: r,
|
|
14382
14419
|
data: n,
|
|
14383
14420
|
encoding: "xml" === r ? "utf8" : "base64",
|
|
14384
|
-
originalHash:
|
|
14421
|
+
originalHash: xs(n)
|
|
14385
14422
|
};
|
|
14386
14423
|
}
|
|
14387
14424
|
let a = [];
|
|
14388
14425
|
for (const [l, c] of Object.entries(i)) {
|
|
14389
|
-
const e =
|
|
14426
|
+
const e = Vn(l);
|
|
14390
14427
|
if (void 0 === e || "xml" !== c.kind) continue;
|
|
14391
|
-
const t =
|
|
14428
|
+
const t = Yn(e, Xn(c.data), (t) => {
|
|
14392
14429
|
r.push({
|
|
14393
14430
|
level: "warning",
|
|
14394
14431
|
code: "unsafe-relationship-target",
|
|
@@ -14411,8 +14448,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14411
14448
|
}
|
|
14412
14449
|
let s = a.find((e) => "External" !== e.targetMode && e.type.endsWith("/officeDocument"))?.resolvedTarget;
|
|
14413
14450
|
if (!s || !i[s]) {
|
|
14414
|
-
if (!i[
|
|
14415
|
-
s =
|
|
14451
|
+
if (!i[ys]) throw new Error("DOCX package has no resolvable officeDocument relationship or word/document.xml fallback.");
|
|
14452
|
+
s = ys, r.push({
|
|
14416
14453
|
level: "warning",
|
|
14417
14454
|
code: "main-document-fallback",
|
|
14418
14455
|
message: "The officeDocument relationship was absent or invalid; word/document.xml was used as a compatibility fallback."
|
|
@@ -14427,7 +14464,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14427
14464
|
...r.length > 0 ? { diagnostics: r } : {}
|
|
14428
14465
|
};
|
|
14429
14466
|
}
|
|
14430
|
-
const
|
|
14467
|
+
const ks = "word/document.xml", _s = {
|
|
14431
14468
|
"/styles": "word/styles.xml",
|
|
14432
14469
|
"/numbering": "word/numbering.xml",
|
|
14433
14470
|
"/settings": "word/settings.xml",
|
|
@@ -14438,67 +14475,67 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14438
14475
|
"/comments": "word/comments.xml",
|
|
14439
14476
|
"/commentsExtended": "word/commentsExtended.xml"
|
|
14440
14477
|
};
|
|
14441
|
-
function
|
|
14478
|
+
function Ts(e) {
|
|
14442
14479
|
const t = e.lastIndexOf("/"), r = t >= 0 ? e.slice(0, t) : "", n = t >= 0 ? e.slice(t + 1) : e;
|
|
14443
14480
|
return r ? `${r}/_rels/${n}.rels` : `_rels/${n}.rels`;
|
|
14444
14481
|
}
|
|
14445
|
-
function
|
|
14482
|
+
function Is(e, t, r) {
|
|
14446
14483
|
"base64" === r.encoding ? e.file(t, r.data, { base64: !0 }) : e.file(t, r.data);
|
|
14447
14484
|
}
|
|
14448
|
-
function
|
|
14485
|
+
function Cs(e) {
|
|
14449
14486
|
return `word/__oasis_source__/${e}`;
|
|
14450
14487
|
}
|
|
14451
|
-
function
|
|
14488
|
+
function As(e) {
|
|
14452
14489
|
return e ? e.map((e) => "External" !== e.targetMode && e.resolvedTarget ? {
|
|
14453
14490
|
...e,
|
|
14454
|
-
target: `/${
|
|
14491
|
+
target: `/${Cs(e.resolvedTarget)}`,
|
|
14455
14492
|
resolvedTarget: void 0
|
|
14456
14493
|
} : e) : [];
|
|
14457
14494
|
}
|
|
14458
|
-
function
|
|
14459
|
-
for (const [t, r] of Object.entries(
|
|
14495
|
+
function Rs(e) {
|
|
14496
|
+
for (const [t, r] of Object.entries(_s)) if (e.type.endsWith(t)) return r;
|
|
14460
14497
|
}
|
|
14461
|
-
async function
|
|
14498
|
+
async function $s(e, t) {
|
|
14462
14499
|
if (!function(e) {
|
|
14463
|
-
if (e.mainDocumentPart !==
|
|
14500
|
+
if (e.mainDocumentPart !== ks) return !0;
|
|
14464
14501
|
const t = e.parts[e.mainDocumentPart];
|
|
14465
14502
|
return Boolean(t?.relationships?.some((e) => {
|
|
14466
|
-
const t =
|
|
14503
|
+
const t = Rs(e);
|
|
14467
14504
|
return Boolean(t && e.resolvedTarget && e.resolvedTarget !== t);
|
|
14468
14505
|
}));
|
|
14469
14506
|
}(t)) return e;
|
|
14470
14507
|
const r = new w.default();
|
|
14471
|
-
for (const i of Object.values(t.parts))
|
|
14508
|
+
for (const i of Object.values(t.parts)) Is(r, i.path, i);
|
|
14472
14509
|
for (const i of Object.values(t.parts)) {
|
|
14473
14510
|
if (i.path.endsWith(".rels") || "[Content_Types].xml" === i.path) continue;
|
|
14474
|
-
const e =
|
|
14475
|
-
|
|
14476
|
-
const t =
|
|
14477
|
-
t.length > 0 && r.file(
|
|
14511
|
+
const e = Cs(i.path);
|
|
14512
|
+
Is(r, e, i);
|
|
14513
|
+
const t = As(i.relationships);
|
|
14514
|
+
t.length > 0 && r.file(Ts(e), Zn(t));
|
|
14478
14515
|
}
|
|
14479
14516
|
const n = t.parts[t.mainDocumentPart];
|
|
14480
14517
|
if (!n) throw new Error(`DOCX source package is missing its main part: ${t.mainDocumentPart}`);
|
|
14481
|
-
|
|
14482
|
-
const o =
|
|
14483
|
-
o.length > 0 && r.file(ks
|
|
14518
|
+
Is(r, ks, n);
|
|
14519
|
+
const o = As(n.relationships);
|
|
14520
|
+
o.length > 0 && r.file(Ts(ks), Zn(o));
|
|
14484
14521
|
for (const i of n.relationships ?? []) {
|
|
14485
14522
|
if ("External" === i.targetMode || !i.resolvedTarget) continue;
|
|
14486
|
-
const e =
|
|
14523
|
+
const e = Rs(i), n = t.parts[i.resolvedTarget];
|
|
14487
14524
|
if (!e || !n) continue;
|
|
14488
|
-
|
|
14489
|
-
const o =
|
|
14490
|
-
o.length > 0 && r.file(
|
|
14525
|
+
Is(r, e, n);
|
|
14526
|
+
const o = As(n.relationships);
|
|
14527
|
+
o.length > 0 && r.file(Ts(e), Zn(o));
|
|
14491
14528
|
}
|
|
14492
14529
|
return r.generateAsync({ type: "arraybuffer" });
|
|
14493
14530
|
}
|
|
14494
|
-
function
|
|
14531
|
+
function Ds(e) {
|
|
14495
14532
|
globalThis.postMessage(e);
|
|
14496
14533
|
}
|
|
14497
14534
|
globalThis.addEventListener("message", async (e) => {
|
|
14498
14535
|
const t = e.data;
|
|
14499
14536
|
if ("import-docx" === t?.type) try {
|
|
14500
|
-
const e = await
|
|
14501
|
-
|
|
14537
|
+
const e = await Es(t.buffer), n = await jn(await $s(t.buffer, e), { onProgress: (e, r) => {
|
|
14538
|
+
Ds({
|
|
14502
14539
|
type: "progress",
|
|
14503
14540
|
id: t.id,
|
|
14504
14541
|
stage: e,
|
|
@@ -14507,7 +14544,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14507
14544
|
} });
|
|
14508
14545
|
await async function(e, t) {
|
|
14509
14546
|
try {
|
|
14510
|
-
t.rebuiltPartHashes = await
|
|
14547
|
+
t.rebuiltPartHashes = await vs(e);
|
|
14511
14548
|
} catch (r) {
|
|
14512
14549
|
(t.diagnostics ??= []).push({
|
|
14513
14550
|
level: "warning",
|
|
@@ -14515,13 +14552,13 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
14515
14552
|
message: `The imported document could not be fingerprinted for granular source-part preservation: ${r instanceof Error ? r.message : String(r)}`
|
|
14516
14553
|
});
|
|
14517
14554
|
}
|
|
14518
|
-
}(n, e), n.sourcePackage = e,
|
|
14555
|
+
}(n, e), n.sourcePackage = e, Ds({
|
|
14519
14556
|
type: "done",
|
|
14520
14557
|
id: t.id,
|
|
14521
14558
|
document: n
|
|
14522
14559
|
});
|
|
14523
14560
|
} catch (r) {
|
|
14524
|
-
|
|
14561
|
+
Ds({
|
|
14525
14562
|
type: "error",
|
|
14526
14563
|
id: t.id,
|
|
14527
14564
|
error: r instanceof Error ? r.message : String(r)
|