@silurus/ooxml 0.89.2 → 0.89.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/{abort-VrnK7mdP.js → abort-JztSoyw2.js} +0 -2
- package/dist/assets/render-worker-BUa1gyCE.js +15 -0
- package/dist/{bounded-raw-part-cache-C3daknU-.js → bounded-raw-part-cache-Bi_VqXmg.js} +7 -115
- package/dist/{bundled-asset-url-E2nXURF9.js → bundled-asset-url-BMJ8vNHP.js} +0 -2
- package/dist/{canvas-viewer-mechanics-SZWSnn6j.js → canvas-viewer-mechanics-ycCX6v-z.js} +3 -25
- package/dist/{cfb-guard-dNeUiANF.js → cfb-guard-BIaHdonq.js} +1 -13
- package/dist/chart-ex.mjs +4 -7
- package/dist/{chunk-Dy4uBu1J.js → chunk-D5OxutzX.js} +0 -2
- package/dist/{comment-overlay-controller-CHDxT0e7.js → comment-overlay-controller-CR5ySvki.js} +2 -22
- package/dist/{comment-ui-runtime-Dk2qrPy_.js → comment-ui-runtime-BWhLz4gq.js} +5 -7
- package/dist/comment-ui-runtime-BtP_TpvT.js +2 -0
- package/dist/{comment-ui-runtime-BcwaRnMR.js → comment-ui-runtime-CwTOCwA8.js} +5 -7
- package/dist/{delimited-text-worker-host-CikWU6_m.js → delimited-text-worker-host-RwvuSsP2.js} +0 -4
- package/dist/{document-model-source-BD2VSd2L.js → document-model-source-Csow9uxO.js} +9 -11
- package/dist/{document-pull-client-DhSGspvi.js → document-pull-client-CHpz0Q1p.js} +7572 -7285
- package/dist/{document-pull-worker-D-E0Iz3P.js → document-pull-worker-1ZJv9f9W.js} +3 -7
- package/dist/{docx-CXfILbzI.js → docx-D9E0vCq-.js} +12 -18
- package/dist/{docx-CCZBO1WQ.js → docx-GXxH0AwW.js} +13 -65
- package/dist/{docx-model-source-Ci6xb487.js → docx-model-source-aKx2gZH9.js} +7 -9
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{drawingml-shape-Bp0yEZHC.js → drawingml-shape-BwELUfNW.js} +2 -6
- package/dist/{duotone-DN8P4aXe.js → duotone-BI7CoghW.js} +2 -6
- package/dist/{emf-CGFQIz6c.js → emf-DgUBx9BU.js} +2 -4
- package/dist/{font-preload-demand-CGOB-MoE.js → font-preload-demand-BuMy4iJ1.js} +2 -8
- package/dist/{grid-geometry-C3IG20ut.js → grid-geometry-CqTDvpDr.js} +1 -6
- package/dist/{host-layout-DVMw8hDY.js → host-layout-Cz_lCuTZ.js} +0 -1
- package/dist/{host-layout-measure-BAysJILu.js → host-layout-measure-GU0oJ4Me.js} +1 -3
- package/dist/{in-process-pull-transport-DuXcPZng.js → in-process-pull-transport-BPJ7M0uC.js} +0 -2
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +3 -5
- package/dist/{line-distribute-DhQqysA2.js → line-distribute-C_CJisnJ.js} +2 -18
- package/dist/math.mjs +2 -8
- package/dist/{mathjax-BhwN6ilc.js → mathjax-DvwccQ8e.js} +0 -2
- package/dist/{model-source-kz_NkZqT.js → model-source-COXegBNA.js} +1 -3
- package/dist/{model-source-BkmyX_r-.js → model-source-DLXFe4_2.js} +3 -5
- package/dist/{model-source-session-CnPCTRDD.js → model-source-session-B3WVQCM5.js} +5 -9
- package/dist/{model-source-session-CF4iXav8.js → model-source-session-BVZBHZ04.js} +5 -11
- package/dist/{model-source-session-CJmkItIK.js → model-source-session-DfUgVpr1.js} +4 -8
- package/dist/node.mjs +6 -6
- package/dist/{pixel-budget-BpTYrepD.js → pixel-budget-DI82Hn3R.js} +0 -2
- package/dist/{plot-area-frame-Bs_j4uu7.js → plot-area-frame-D3JtHvov.js} +1 -167
- package/dist/{pptx-BhmLP_Ed.js → pptx-BD0jwWs6.js} +9 -11
- package/dist/{pptx-Bo9hCGQU.js → pptx-CLyebeF_.js} +16 -62
- package/dist/{pptx-model-source-J0SrVkO6.js → pptx-model-source-D_2mnSxI.js} +5 -7
- package/dist/pptx.mjs +7 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{presentation-model-source-CebYmrOD.js → presentation-model-source-rWZ3Y-S_.js} +8 -10
- package/dist/{raster-target-YQ4G6rxo.js → raster-target-Ca3tyA0L.js} +0 -2
- package/dist/{read-only-comment-decoration-PidH0wnP.js → read-only-comment-decoration-B06YO2zk.js} +0 -4
- package/dist/{read-only-comment-margin-B52rDVKo.js → read-only-comment-margin-Ee9Y6vPg.js} +0 -2
- package/dist/region-map.mjs +4 -7
- package/dist/{render-hT2OVZUi.js → render-Cs1bgbEm.js} +3 -5
- package/dist/{render-worker-host-Desevuoc.js → render-worker-host-BR7n4xKy.js} +0 -4
- package/dist/render-worker-host-BxsA-yJo.js +5 -0
- package/dist/{render-worker-host-BmAQ-sWT.js → render-worker-host-CZC0WOn8.js} +0 -4
- package/dist/{renderer-CvZ4JmoL.js → renderer-DFDF48zw.js} +7 -55
- package/dist/{renderer-module-contract-CWM7jv6d.js → renderer-module-contract-BuTx2FWJ.js} +0 -2
- package/dist/{renderer-BFWqhLEt.js → renderer-xdugdcMd.js} +6 -70
- package/dist/{resource-measurement-DBiUwblM.js → resource-measurement-CTGrNAsD.js} +2 -18
- package/dist/{session-CWDKFWCh.js → session-B5CgMc2N.js} +7 -17
- package/dist/{slide-pull-client-BuBvXMyc.js → slide-pull-client-43mS9T70.js} +9 -63
- package/dist/{three-d-BKwNPAP4.js → three-d-ByHGsYrX.js} +1 -11
- package/dist/three-d.mjs +4 -17
- package/dist/{tiff-contract-C6M3QcPp.js → tiff-contract-DEd8CGuz.js} +0 -2
- package/dist/tiff.mjs +5 -8
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +12 -11
- package/dist/types/index.d.ts +16 -15
- package/dist/types/internal-companion.d.ts +1 -1
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +7 -6
- package/dist/types/pptx.d.ts +11 -11
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +11 -11
- package/dist/{visible-index-FeVA0mGE.js → visible-index-vN-4BNn7.js} +0 -2
- package/dist/{wasm-loader-rlgHmcSv.js → wasm-loader-KAOyLXzf.js} +0 -4
- package/dist/{wasm-runtime-generation-BWGfM44b.js → wasm-runtime-generation-BsWKRY7U.js} +1 -3
- package/dist/{workbook-model-source-Che8Zbjw.js → workbook-model-source-ChIQjX9a.js} +9 -11
- package/dist/{worker-source-UAi3GNcM.js → worker-source-C29EQNUj.js} +0 -2
- package/dist/{worker-source-SbudzjYL.js → worker-source-D3NwPe6l.js} +0 -2
- package/dist/{worker-source-DrwhR9fw.js → worker-source-ZQE9C1j6.js} +0 -2
- package/dist/{worksheet-pull-client-Cxzj6uuB.js → worksheet-pull-client-D5zAevQv.js} +4 -18
- package/dist/{xlsx-CUVUep5I.js → xlsx-DelYm4VZ.js} +17 -61
- package/dist/{xlsx-C5BSwMUd.js → xlsx-S6orTmKI.js} +8 -16
- package/dist/{xlsx-model-source-C3_PiPBo.js → xlsx-model-source-Cm9ocDgT.js} +8 -12
- package/dist/xlsx.mjs +7 -7
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +2 -2
- package/dist/assets/render-worker-D_SMt5nl.js +0 -15
- package/dist/comment-ui-runtime-B7ZvovcS.js +0 -2
- package/dist/render-worker-host-Cz224I38.js +0 -9
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { vo as e } from "./plot-area-frame-
|
|
2
|
-
import { B as t, D as n, G as r, O as i, k as a, ln as o, q as s, un as c } from "./bounded-raw-part-cache-
|
|
3
|
-
import { S as l } from "./worksheet-pull-client-
|
|
4
|
-
//#region packages/docx/src/internal/parser-errors.ts
|
|
1
|
+
import { vo as e } from "./plot-area-frame-D3JtHvov.js";
|
|
2
|
+
import { B as t, D as n, G as r, O as i, k as a, ln as o, q as s, un as c } from "./bounded-raw-part-cache-Bi_VqXmg.js";
|
|
3
|
+
import { S as l } from "./worksheet-pull-client-D5zAevQv.js";
|
|
5
4
|
var u = "OOXML_DOCX_ILVL:";
|
|
6
5
|
function d(t) {
|
|
7
6
|
let n = t instanceof Error ? t.message : String(t);
|
|
@@ -24,8 +23,6 @@ function p(e) {
|
|
|
24
23
|
throw f(e);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region packages/docx/src/document-pull-worker.ts
|
|
29
26
|
function m(e) {
|
|
30
27
|
let n = e((e) => e.document_cursor_resource_usage?.());
|
|
31
28
|
return n ? t(n) : void 0;
|
|
@@ -100,5 +97,4 @@ var h = Math.max(o, c), g = class {
|
|
|
100
97
|
return e;
|
|
101
98
|
}
|
|
102
99
|
};
|
|
103
|
-
//#endregion
|
|
104
100
|
export { m as n, f as r, g as t };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { t as e } from "./chunk-
|
|
2
|
-
import { yo as t } from "./plot-area-frame-
|
|
3
|
-
import { B as n, F as r, H as i, N as a, U as o, j as s, qt as c, st as l, ut as u } from "./bounded-raw-part-cache-
|
|
4
|
-
import { a as d, c as f, g as p, i as m, l as h, r as g } from "./document-pull-client-
|
|
5
|
-
import { n as _, t as ee } from "./abort-
|
|
6
|
-
import { n as v, r as te, t as y } from "./wasm-loader-
|
|
7
|
-
import { t as b } from "./wasm-runtime-generation-
|
|
8
|
-
import { t as x } from "./in-process-pull-transport-
|
|
9
|
-
import { n as S, r as ne, t as re } from "./document-pull-worker-
|
|
10
|
-
import { a as ie } from "./render-
|
|
11
|
-
//#region packages/docx/src/wasm/docx_parser.js
|
|
1
|
+
import { t as e } from "./chunk-D5OxutzX.js";
|
|
2
|
+
import { yo as t } from "./plot-area-frame-D3JtHvov.js";
|
|
3
|
+
import { B as n, F as r, H as i, N as a, U as o, j as s, qt as c, st as l, ut as u } from "./bounded-raw-part-cache-Bi_VqXmg.js";
|
|
4
|
+
import { a as d, c as f, g as p, i as m, l as h, r as g } from "./document-pull-client-CHpz0Q1p.js";
|
|
5
|
+
import { n as _, t as ee } from "./abort-JztSoyw2.js";
|
|
6
|
+
import { n as v, r as te, t as y } from "./wasm-loader-KAOyLXzf.js";
|
|
7
|
+
import { t as b } from "./wasm-runtime-generation-BsWKRY7U.js";
|
|
8
|
+
import { t as x } from "./in-process-pull-transport-BPJ7M0uC.js";
|
|
9
|
+
import { n as S, r as ne, t as re } from "./document-pull-worker-1ZJv9f9W.js";
|
|
10
|
+
import { a as ie } from "./render-Cs1bgbEm.js";
|
|
12
11
|
var C = /* @__PURE__ */ e({
|
|
13
12
|
DocxArchive: () => w,
|
|
14
13
|
default: () => q,
|
|
@@ -267,8 +266,6 @@ async function q(e) {
|
|
|
267
266
|
async function ce(e) {
|
|
268
267
|
return W = void 0, A = null, N = null, q(e);
|
|
269
268
|
}
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region packages/docx/src/internal/node-acquisition.ts
|
|
272
269
|
var J = "DOCX document session was aborted", le = b(C, "DOCX");
|
|
273
270
|
async function Y(e, t, n, i) {
|
|
274
271
|
let c = a(n), l = new s({
|
|
@@ -320,13 +317,11 @@ async function Y(e, t, n, i) {
|
|
|
320
317
|
throw l.fail(t), t;
|
|
321
318
|
}
|
|
322
319
|
}
|
|
323
|
-
//#endregion
|
|
324
|
-
//#region packages/node/src/docx.ts
|
|
325
320
|
var X = "DOCX document session was aborted", Z = y(() => v(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
|
|
326
321
|
async function ue(e, t) {
|
|
327
322
|
if (!t?.factory) throw TypeError("openDocxDocument requires a canvas factory");
|
|
328
323
|
if (t.legacyDoc !== void 0) {
|
|
329
|
-
let { openDocxSource: n } = await import("./docx-model-source-
|
|
324
|
+
let { openDocxSource: n } = await import("./docx-model-source-aKx2gZH9.js");
|
|
330
325
|
return n(e, t, Z);
|
|
331
326
|
}
|
|
332
327
|
let n = c(t.cjkFallback), r = await Y($(e), Z(), t, (e, t, n) => g(e, t, n));
|
|
@@ -348,7 +343,7 @@ async function ue(e, t) {
|
|
|
348
343
|
}
|
|
349
344
|
async function de(e, t = {}) {
|
|
350
345
|
if (t.legacyDoc !== void 0) {
|
|
351
|
-
let { materializeDocxSource: n } = await import("./docx-model-source-
|
|
346
|
+
let { materializeDocxSource: n } = await import("./docx-model-source-aKx2gZH9.js");
|
|
352
347
|
return n(e, t, Z);
|
|
353
348
|
}
|
|
354
349
|
return te(async () => {
|
|
@@ -491,5 +486,4 @@ function fe(e) {
|
|
|
491
486
|
function $(e) {
|
|
492
487
|
return e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
493
488
|
}
|
|
494
|
-
//#endregion
|
|
495
489
|
export { Y as i, de as n, ue as r, Q as t };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { t as e } from "./chunk-
|
|
2
|
-
import { _o as t, ja as n, vo as r, yo as i } from "./plot-area-frame-
|
|
3
|
-
import { n as a, t as o } from "./cfb-guard-
|
|
4
|
-
import { Dn as s, En as c, H as l, M as u, N as d, On as f, V as p, Xt as m, Y as h, Yt as g, hn as _, ht as v, j as y, qt as b, st as x, t as S, u as C, ut as ee } from "./bounded-raw-part-cache-
|
|
5
|
-
import { A as te, C as w, D as ne, E as T, M as re, N as ie, P as E, S as ae, T as D, _ as oe, a as se, b as ce, c as le, d as ue, f as de, g as fe, h as pe, i as me, j as he, k as ge, l as _e, m as ve, n as ye, o as be, p as xe, r as Se, t as Ce, u as we, v as Te, w as Ee, x as De, y as Oe } from "./comment-overlay-controller-
|
|
6
|
-
import { A as ke, B as Ae, C as je, D as O, E as Me, F as Ne, I as Pe, L as k, M as Fe, N as A, O as Ie, P as Le, R as Re, S as ze, T as Be, V as j, _ as Ve, a as He, b as Ue, c as We, f as Ge, h as Ke, j as M, k as qe, l as Je, m as Ye, n as Xe, o as Ze, p as Qe, s as $e, t as et, u as tt, v as nt, w as rt, x as it, y as N, z as at } from "./document-pull-client-
|
|
7
|
-
import { f as ot, u as st } from "./pixel-budget-
|
|
8
|
-
import { i as ct, t as lt } from "./tiff-contract-
|
|
9
|
-
import { D as ut, E as dt, T as ft, a as pt, b as mt, c as ht, d as gt, f as _t, i as vt, l as yt, n as bt, o as xt, p as St, r as Ct, s as wt, t as Tt, u as Et, v as Dt, w as Ot, x as kt, y as At } from "./canvas-viewer-mechanics-
|
|
10
|
-
import { n as jt } from "./renderer-module-contract-
|
|
11
|
-
//#region packages/core/src/fonts/open-type-metrics.ts
|
|
1
|
+
import { t as e } from "./chunk-D5OxutzX.js";
|
|
2
|
+
import { _o as t, ja as n, vo as r, yo as i } from "./plot-area-frame-D3JtHvov.js";
|
|
3
|
+
import { n as a, t as o } from "./cfb-guard-BIaHdonq.js";
|
|
4
|
+
import { Dn as s, En as c, H as l, M as u, N as d, On as f, V as p, Xt as m, Y as h, Yt as g, hn as _, ht as v, j as y, qt as b, st as x, t as S, u as C, ut as ee } from "./bounded-raw-part-cache-Bi_VqXmg.js";
|
|
5
|
+
import { A as te, C as w, D as ne, E as T, M as re, N as ie, P as E, S as ae, T as D, _ as oe, a as se, b as ce, c as le, d as ue, f as de, g as fe, h as pe, i as me, j as he, k as ge, l as _e, m as ve, n as ye, o as be, p as xe, r as Se, t as Ce, u as we, v as Te, w as Ee, x as De, y as Oe } from "./comment-overlay-controller-CR5ySvki.js";
|
|
6
|
+
import { A as ke, B as Ae, C as je, D as O, E as Me, F as Ne, I as Pe, L as k, M as Fe, N as A, O as Ie, P as Le, R as Re, S as ze, T as Be, V as j, _ as Ve, a as He, b as Ue, c as We, f as Ge, h as Ke, j as M, k as qe, l as Je, m as Ye, n as Xe, o as Ze, p as Qe, s as $e, t as et, u as tt, v as nt, w as rt, x as it, y as N, z as at } from "./document-pull-client-CHpz0Q1p.js";
|
|
7
|
+
import { f as ot, u as st } from "./pixel-budget-DI82Hn3R.js";
|
|
8
|
+
import { i as ct, t as lt } from "./tiff-contract-DEd8CGuz.js";
|
|
9
|
+
import { D as ut, E as dt, T as ft, a as pt, b as mt, c as ht, d as gt, f as _t, i as vt, l as yt, n as bt, o as xt, p as St, r as Ct, s as wt, t as Tt, u as Et, v as Dt, w as Ot, x as kt, y as At } from "./canvas-viewer-mechanics-ycCX6v-z.js";
|
|
10
|
+
import { n as jt } from "./renderer-module-contract-BuTx2FWJ.js";
|
|
12
11
|
var P = (e) => (e.charCodeAt(0) << 24 >>> 0 | e.charCodeAt(1) << 16 | e.charCodeAt(2) << 8 | e.charCodeAt(3)) >>> 0, Mt = P("ttcf"), Nt = P("OTTO"), Pt = P("true"), Ft = P("typ1"), It = P("head"), Lt = P("hhea"), Rt = P("OS/2"), zt = P("cmap"), Bt = P("fvar"), F = [
|
|
13
12
|
[4352, 4607],
|
|
14
13
|
[11904, 12287],
|
|
@@ -250,8 +249,6 @@ function $t(e, t, n) {
|
|
|
250
249
|
} : {}
|
|
251
250
|
});
|
|
252
251
|
}
|
|
253
|
-
//#endregion
|
|
254
|
-
//#region packages/docx/src/host-font-line-metrics.ts
|
|
255
252
|
function en(e, n) {
|
|
256
253
|
if (e.metric.lineHeightRatio != null || !n) return e.metric;
|
|
257
254
|
let r = t(e.requestedFamily, {
|
|
@@ -340,8 +337,6 @@ async function on(e, t, n) {
|
|
|
340
337
|
async function sn(...e) {
|
|
341
338
|
return on(await g(...e), e[1] === void 0 ? c() : e[1]);
|
|
342
339
|
}
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region packages/docx/src/resource-diagnostics.ts
|
|
345
340
|
var cn = /* @__PURE__ */ new WeakMap();
|
|
346
341
|
function L(e, t = []) {
|
|
347
342
|
let n = cn.get(e) ?? [], r = new Map(n.map((e) => [JSON.stringify(e), e]));
|
|
@@ -351,8 +346,6 @@ function L(e, t = []) {
|
|
|
351
346
|
function ln(e) {
|
|
352
347
|
return cn.get(e) ?? [];
|
|
353
348
|
}
|
|
354
|
-
//#endregion
|
|
355
|
-
//#region packages/docx/src/worker.ts?worker&inline
|
|
356
349
|
var un = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t);function t(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var n,r,i=e((()=>{n=class e extends Error{code;details;constructor(t,n,r){super(n),this.name=`OoxmlError`,this.code=t,t===`unsupported-content`&&r&&(this.details=Object.freeze({format:r.format,reason:r.reason})),Object.setPrototypeOf(this,e.prototype)}},r=class e extends Error{code=`ooxml-resource-limit`;details;constructor(t,n){super(t),this.name=`OoxmlResourceLimitError`;let r=n.violation,i=Object.freeze({format:r.format,operation:r.operation,resource:r.resource,metric:r.metric,...r.part===void 0?{}:{part:r.part},limit:r.limit,observed:r.observed,configurable:r.configurable,usage:Object.freeze({archiveEntryCount:r.usage.archiveEntryCount,declaredInflatedBytes:r.usage.declaredInflatedBytes,...r.usage.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:r.usage.largestInflatedEntryBytes},distinctInflatedBytes:r.usage.distinctInflatedBytes,operationInflatedBytes:r.usage.operationInflatedBytes})});this.details=Object.freeze({stage:n.stage,violation:i}),Object.setPrototypeOf(this,e.prototype)}}}));function a(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`||e===`image-effect-count`||e===`image-effect-work`||e===`tiff-lzw-work`||e===`metafile-path-commands`||e===`metafile-record-points`||e===`metafile-record-polygons`||e===`metafile-record-rectangles`||e===`metafile-record-text-units`}function o(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function s(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,r=t.metric,i=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!a(r)||!o(i)||!o(s)||s<=i?void 0:{metric:r,limit:i,observed:s}}catch{return}}var c,l,u,d,f,ee=e((()=>{c=1<<25,l=1<<27,c*4,l*4,u=Math.floor(c/4),d=l,d/u,f=class e extends RangeError{metric;limit;observed;code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}}}));function te(e){if(!(typeof e!=`object`||!e))try{let t=e,n=t.code,r=t.message;return n===`ooxml-tiff-decode`&&typeof r==`string`?{message:r}:void 0}catch{return}}var ne=e((()=>{}));function p(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function re(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return p(t.requiredBytes)&&p(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var m=class e extends RangeError{code=`ooxml-insufficient-credit`;requiredBytes;offeredBytes;constructor(t){super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`),this.name=`PullSessionInsufficientCreditError`,this.requiredBytes=t.requiredBytes,this.offeredBytes=t.offeredBytes,Object.setPrototypeOf(this,e.prototype)}};function h(e){if(e instanceof m)return e;let t=e instanceof Error?e.message:String(e);if(!t.startsWith(`OOXML_INSUFFICIENT_CREDIT:`))return;let n;try{n=JSON.parse(t.slice(26))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(!(r.code!==`ooxml-insufficient-credit`||!re(r)))return new m(r)}function ie(e,t,n){let r=h(e);if(!(!r||r.offeredBytes!==t||r.requiredBytes>n))return r}i(),ee(),ne();const g=`OOXML_RESOURCE_LIMIT:`;function _(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function v(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return _(t.archiveEntryCount)&&_(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||_(t.largestInflatedEntryBytes))&&_(t.distinctInflatedBytes)&&_(t.operationInflatedBytes)}function y(e){let t;try{t=JSON.parse(new TextDecoder().decode(e))}catch{throw TypeError(`OOXML resource usage checkpoint is not valid JSON`)}if(!v(t))throw TypeError(`OOXML resource usage checkpoint is invalid`);return t}function ae(e){return e===`docx`||e===`xlsx`||e===`pptx`}function oe(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function b(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function x(e){return b(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function se(e){return!b(e,4096)||e.startsWith(`/`)||e.startsWith(`\\\\`)||e.includes(`\\\\`)||e.includes(`?`)||e.includes(`#`)||e.includes(`://`)||/^[a-z]:/iu.test(e)?!1:e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}const S=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`image-effect:work`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:elements`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chartex-allocation:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-cache:points`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`numbering-marker:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`chart-style-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-custom-number-formats:entries`,{stage:`parsing`,part:`required`,configurable:!1}],[`chart-number-format-bytes:bytes`,{stage:`parsing`,part:`required`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`theme-style-reparse:bytes`,{stage:`parsing`,part:`forbidden`,configurable:!1}],[`style-inheritance:depth`,{stage:`parsing`,part:`required`,configurable:!1}],[`complex-field:depth`,{stage:`parsing`,part:`forbidden`,configurable:!1}]]),ce=new Set([...S.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),le=new Set([...S.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function ue(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!ae(t.format)||!b(t.operation,256)||!x(t.resource)||!x(t.metric)||!_(t.limit)||!_(t.observed)||typeof t.configurable!=`boolean`||!v(t.usage)?!1:!(`part`in t)||se(t.part)}function C(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!oe(t.stage)||!ue(t.violation))return!1;let n=t.violation,r=S.get(`${n.resource}:${n.metric}`);return r?t.stage!==r.stage||r.configurable===!1&&n.configurable!==!1?!1:r.part===`required`?n.part!==void 0:r.part===`forbidden`?n.part===void 0:!0:!(ce.has(n.resource)&&le.has(n.metric))}function de(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function fe(e){if(!C(e))return;let t=e.violation,n={stage:e.stage,violation:{format:t.format,operation:t.operation,resource:t.resource,metric:t.metric,...t.part===void 0?{}:{part:t.part},limit:t.limit,observed:t.observed,configurable:t.configurable,usage:de(t.usage)}};return C(n)?n:void 0}function pe(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``} (${t.resource}, ${e.stage}): ${t.metric} ${t.observed} > ${t.limit}`}function w(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(g))return;let n;try{n=JSON.parse(t.slice(21))}catch{return}if(!n||typeof n!=`object`)return;let i=n;if(!(i.code!==`ooxml-resource-limit`||!C(i.details)))return new r(pe(i.details),i.details)}function me(e){try{return e()}catch(e){throw e instanceof r||typeof e!=`string`&&!(e instanceof Error)?e:w(e)??e}}function he(e){let t=e instanceof Error?e.message:String(e);if(t.startsWith(`OOXML_NOT_OOXML:`))return new n(`not-ooxml`,`This file is not an Office Open XML document: ${t.slice(16)}`)}function T(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.format,r=t.reason;if(!(!x(n)||r!==`source-subset`))return{format:n,reason:r}}function E(e){return new n(`unsupported-content`,`Input is outside the source’s supported subset.`,e)}function ge(e){let t=typeof e==`string`?e:e instanceof Error?e.message:``;if(!(!t.startsWith(`MODEL_SOURCE_UNSUPPORTED:`)||t.length>1024))try{let e=T(JSON.parse(t.slice(25)));return e?E(e):void 0}catch{return}}function _e(e){return e===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`||e instanceof Error&&e.message===`OOXML_SOURCE_UNSUPPORTED_ENCRYPTION`?new n(`unsupported-encryption`,`The configured source cannot decrypt this input.`):ge(e)??w(e)??he(e)}function ve(e){let t=s(e);if(t){let e=new f(t.metric,t.limit,t.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:t}}let i=te(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let a=h(e);if(a)return{message:a.message,errorName:a.name,code:a.code,insufficientCredit:{requiredBytes:a.requiredBytes,offeredBytes:a.offeredBytes}};let o=e instanceof n||e instanceof r?e:_e(e),c=o??e;if(o instanceof r||c&&typeof c==`object`&&c.code===`ooxml-resource-limit`){let e=c,t=fe(e.details);return t?{message:typeof e.message==`string`?e.message:pe(t),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:t}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(c&&typeof c==`object`&&c.code===`unsupported-content`){let e=T(c.details);return e?{message:E(e).message,code:`unsupported-content`,unsupportedContent:e}:{message:`Invalid unsupported-content error payload`,errorName:`Error`}}if(o instanceof n)return{message:typeof o.message==`string`?o.message:String(o.message),errorName:b(o.name,128)?o.name:`OoxmlError`,...x(o.code)?{code:o.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(g))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let u=e instanceof Error?e:Error(l),d=u;return{message:typeof u.message==`string`?u.message:String(u.message),errorName:b(u.name,128)?u.name:`Error`,...typeof d.code==`string`?{code:d.code}:{}}}function D(e){try{return ve(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}var ye=class{initialize;reinitialize;normalizeFailure;state=`uninitialized`;generationValue=0;readiness;poisonListeners=new Set;constructor(e,t,n){this.initialize=e,this.reinitialize=t,this.normalizeFailure=n}get generation(){return this.generationValue}get poisoned(){return this.state===`poisoned`}onPoison(e){return this.poisonListeners.add(e),()=>this.poisonListeners.delete(e)}async ensureReady(){if(this.state!==`ready`){if(!this.readiness){let e=this.state===`uninitialized`?this.initialize:this.reinitialize;this.readiness=Promise.resolve().then(e).then(()=>{this.generationValue+=1,this.state=`ready`,this.readiness=void 0},e=>{throw this.readiness=void 0,e})}await this.readiness}}run(e){try{return e()}catch(e){let t=this.normalizeFailure(e);throw t?(this.poison(t),t):e}}tryRunReady(e){if(this.state!==`ready`)return{current:!1};let t=this.generationValue,n=this.run(e);return this.state!==`ready`||t!==this.generationValue?{current:!1}:{current:!0,generation:t,value:n}}poison(e){this.state=`poisoned`,this.readiness=void 0;for(let t of this.poisonListeners)t(e)}assertCurrent(e){if(this.state!==`ready`||e!==this.generationValue)throw Error(`WASM archive session belongs to a discarded runtime generation`)}},O=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function be(e){let t=globalThis.WebAssembly?.RuntimeError;return t&&e instanceof t||e instanceof RangeError?!0:e instanceof Error?e.name===`RuntimeError`||e.name===`CompileError`||e.name===`LinkError`||e.name===`InternalError`||e.name===`OOMError`:!1}function xe(e){try{if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let t=Reflect.get(e,`__destroy_into_raw`);typeof t==`function`&&Reflect.apply(t,e,[])}catch{}}function Se(e,t){return e({module_or_path:t})}var Ce=class{init;options;runtime;wasmInput=null;currentArchive=null;constructor(e,t={}){this.init=e,this.options=t,this.runtime=new ye(()=>this.invokeConfigured(this.init),()=>this.invokeConfigured(this.options.reinit??this.init),we),this.runtime.onPoison(()=>this.dropPoisonedArchive())}setWasmInput(e){this.wasmInput=e,this.runtime.ensureReady().catch(()=>void 0)}setWasmUrl(e){this.setWasmInput(e)}get archive(){return this.currentArchive}setArchive(e){this.freeArchive(),this.currentArchive=e}disposeArchive(){this.freeArchive()}get poisoned(){return this.runtime.poisoned}async ensureReady(){await this.runtime.ensureReady()}run(e){return me(()=>this.runtime.run(e))}poison(){this.runtime.poison(new O(`WASM parser was recycled`))}invokeConfigured(e){return this.wasmInput===null?Promise.reject(Error(`WasmParserHost: setWasmInput was never called`)):Se(e,this.wasmInput)}freeArchive(){this.currentArchive!==null&&this.options.freeArchive&&this.options.freeArchive(this.currentArchive),this.currentArchive=null}dropPoisonedArchive(){let e=this.currentArchive;this.currentArchive=null,xe(e)}};function we(e){return be(e)?new O(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`):null}function Te(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer instanceof ArrayBuffer?e.buffer:e.slice().buffer}Object.freeze({maxArchiveEntryBytes:134217728,maxTotalInflatedBytes:268435456,maxArchiveEntries:4096});function Ee(e){return[e.maxArchiveEntryBytes===null?0n:BigInt(e.maxArchiveEntryBytes),e.maxTotalInflatedBytes===null?0n:BigInt(e.maxTotalInflatedBytes),e.maxArchiveEntries===null?0n:BigInt(e.maxArchiveEntries)]}const k=`ooxml-pull-v1`;function A(e,t){if(!Number.isSafeInteger(e)||e<=0)throw RangeError(`${t} must be a positive safe integer`)}function De(e){if(!(typeof e==`string`&&e.length>0||typeof e==`number`&&Number.isSafeInteger(e)&&e>0))throw RangeError(`session id must be a non-empty string or positive safe integer`)}var j=class{owner;queue=Promise.resolve();leases=new Map;retainedBytes=0;retainedCount=0;maxRetainedBytes;maxRetainedCount;cleanups=new Set;pendingFatalCleanups=[];poisonRunning=!1;fatal;constructor(e){this.maxRetainedBytes=e?.maxRetainedBytes??64*1024*1024,this.maxRetainedCount=e?.maxRetainedCount??256,A(this.maxRetainedBytes,`max retained lease bytes`),A(this.maxRetainedCount,`max retained lease count`)}enqueue(e){let t=this.queue.then(e,e);return this.queue=t.then(()=>void 0,()=>void 0),t}acquire(e){return this.owner===void 0?(this.owner=e,!0):this.owner===e}release(e){this.owner===e&&(this.owner=void 0)}retainLease(e,t,n){if(!Number.isSafeInteger(n)||n<0)throw RangeError(`retained lease bytes are invalid`);let r=this.leases.get(e)??new Map;if(r.has(t))throw Error(`driver returned a duplicate lease id`);if(this.retainedCount+1>this.maxRetainedCount)throw RangeError(`retained lease count exceeds limit`);if(this.retainedBytes+n>this.maxRetainedBytes)throw RangeError(`retained lease bytes exceed limit`);r.set(t,n),this.leases.set(e,r),this.retainedCount++,this.retainedBytes+=n}releaseLease(e,t){let n=this.leases.get(e),r=n?.get(t);r!==void 0&&(n?.delete(t),n?.size===0&&this.leases.delete(e),this.retainedCount--,this.retainedBytes-=r)}registerCleanup(e){return this.fatal?(this.poisonRunning?this.pendingFatalCleanups.push(e):this.enqueue(e).catch(()=>void 0),()=>void 0):(this.cleanups.add(e),()=>this.cleanups.delete(e))}get fatalError(){return this.fatal}get registeredHostCount(){return this.cleanups.size}async poison(e){if(this.fatal??=e,this.poisonRunning)return this.fatal;this.poisonRunning=!0,this.pendingFatalCleanups.push(...this.cleanups);try{let e;for(;(e=this.pendingFatalCleanups.shift())!==void 0;)await e().catch(()=>void 0)}finally{this.poisonRunning=!1}return this.fatal}},Oe=class{options;coordinator;coordinatorOwner=Symbol(`pull-session-host`);unregisterCleanup;sequence=0;unacked;leases=new Map;activeDriverLeases=new Set;nextWireLeaseId;cancelRequested=!1;cancelComplete=!1;closeRequested=!1;closeComplete=!1;driverCancelComplete=!1;driverCloseComplete=!1;completed=!1;constructor(e){De(e.sessionId),A(e.operationId,`operation id`),A(e.generation,`generation`),A(e.maxByteCredit,`max byte credit`),e.wireLeaseIdStart!==void 0&&A(e.wireLeaseIdStart,`wire lease id start`),this.options=e,this.coordinator=e.coordinator,this.nextWireLeaseId=e.wireLeaseIdStart??1,this.unregisterCleanup=this.coordinator.registerCleanup(()=>this.forceFatalCleanup())}dispatch(e,t){return this.coordinator.enqueue(async()=>{let n=await this.execute(e);try{t(n.response,n.transfer)}catch(e){throw await this.rollbackFailedPost(n),e}})}async rollbackFailedPost(e){let t=e.response;if(t.kind===`chunk`){let n=t.leaseId===void 0?void 0:this.leases.get(t.leaseId);try{await this.options.driver.disposeInvalidChunk?.({payload:t.payload,byteLength:t.byteLength,done:t.done,leaseId:n?.driverLeaseId,retainedBytes:n?.retainedBytes,transfer:e.transfer})}catch{}}this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);for(let[e,t]of[...this.leases])try{await this.options.driver.releaseLease?.(t.driverLeaseId)}catch{}finally{this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e)}if(this.cancelRequested=!0,!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch{}this.unregisterCleanup()}async execute(e){try{if(this.isStaleLifecycle(e)){let t=e.kind===`cancel`?`cancel`:`close`;return this.sameOperationIdentity(e)?{response:this.accepted(e,t,!0)}:{response:this.errorResponse(e,{message:`stale lifecycle targets another session or operation`,errorName:`PullSessionProtocolError`,code:`ooxml-stale-lifecycle`})}}this.validateCommandIdentity(e);let t=this.coordinator.fatalError;if(t)return e.kind===`pull`?{response:this.errorResponse(e,t)}:(e.kind===`cancel`?await this.cancel():e.kind===`close`?await this.close():e.kind===`release`&&await this.release(e.leaseId),{response:this.accepted(e,e.kind)});switch(e.kind){case`pull`:return await this.pull(e);case`ack`:return await this.ack(e.sequence),{response:this.accepted(e,`ack`)};case`release`:return await this.release(e.leaseId),{response:this.accepted(e,`release`)};case`cancel`:return await this.cancel(),{response:this.accepted(e,`cancel`)};case`close`:return await this.close(),{response:this.accepted(e,`close`)}}}catch(t){let n=D(t);return n.code===`ooxml-resource-limit`&&(n=await this.coordinator.poison(n)),{response:this.errorResponse(e,n)}}}async pull(e){if(this.closeRequested||this.cancelRequested||this.completed)throw Error(`pull session is closed`);if(this.unacked)throw Error(`previous chunk is not acknowledged`);if(!Number.isSafeInteger(e.sequence)||e.sequence<0||e.sequence!==this.sequence)throw Error(`pull command sequence mismatch`);if(this.validateHostCredit(e.byteCredit),!this.coordinator.acquire(this.coordinatorOwner))throw Error(`another operation has an unacknowledged package chunk`);let t;try{t=await this.options.driver.pull(e.byteCredit)}catch(e){throw this.coordinator.release(this.coordinatorOwner),e}let n=!1,r=!1,i,a;try{let o=this.options.driver.measureChunk(t),s=this.arrayBufferTransferBytes(t.transfer);if(o<s)throw RangeError(`measured chunk bytes are below ArrayBuffer transfer bytes`);if(a=Math.max(o,s),t.leaseId!==void 0){if(A(t.leaseId,`lease id`),t.retainedBytes===void 0)throw Error(`retained lease bytes are required`);if(this.activeDriverLeases.has(t.leaseId))throw r=!0,Error(`driver returned an active duplicate lease id`);i=this.allocateWireLeaseId(),this.coordinator.retainLease(this.coordinatorOwner,i,t.retainedBytes),this.leases.set(i,{driverLeaseId:t.leaseId,retainedBytes:t.retainedBytes}),this.activeDriverLeases.add(t.leaseId),n=!0}else if(t.retainedBytes!==void 0)throw Error(`retained lease bytes require a lease id`);if(!Number.isSafeInteger(a)||a<0)throw RangeError(`host chunk byte length must be a non-negative safe integer`);if(a>e.byteCredit)throw RangeError(`host chunk exceeds byte credit`)}catch(e){let a;try{await this.options.driver.disposeInvalidChunk?.(t)}catch(e){a=e}if(n&&i!==void 0)try{await this.release(i)}catch(e){a??=e}else if(t.leaseId!==void 0&&!r)try{await this.options.driver.releaseLease?.(t.leaseId)}catch(e){a??=e}if(r)try{await this.cancel()}catch(e){a??=e}throw this.coordinator.release(this.coordinatorOwner),a||e}return this.unacked={sequence:this.sequence,done:t.done},{response:{kind:`chunk`,protocol:k,...this.identity(),requestId:e.requestId,sequence:this.sequence,byteLength:a,done:t.done,payload:t.payload,leaseId:i,usage:this.resourceUsage()},transfer:t.transfer}}async ack(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`invalid ack sequence`);if(e<this.sequence)return;if(!this.unacked||e!==this.sequence)throw Error(`ack sequence mismatch`);let t=this.unacked.done;await this.options.driver.acknowledge?.(e),this.unacked=void 0,this.coordinator.release(this.coordinatorOwner),this.sequence++,t&&(this.completed=!0,this.maybeUnregisterCompleted())}async release(e){A(e,`wire lease id`);let t=this.leases.get(e);t&&(await this.options.driver.releaseLease?.(t.driverLeaseId),this.leases.delete(e),this.activeDriverLeases.delete(t.driverLeaseId),this.coordinator.releaseLease(this.coordinatorOwner,e),this.maybeUnregisterCompleted())}async cancel(){if(this.cancelComplete)return;this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.cancelComplete=!0,this.unregisterCleanup()}async close(){if(this.closeComplete)return;this.closeRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;try{await this.releaseAllLeases()}catch(t){e=t}if(!this.driverCloseComplete)try{await this.options.driver.close?.(),this.driverCloseComplete=!0}catch(t){e??=t}if(e)throw e;this.closeComplete=!0,this.unregisterCleanup()}async releaseAllLeases(){let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(e)throw e}validateCommandIdentity(e){if(e.protocol!==`ooxml-pull-v1`||e.sessionId!==this.options.sessionId||e.operationId!==this.options.operationId||e.generation!==this.options.generation||!Number.isSafeInteger(e.requestId)||e.requestId<=0)throw Error(`stale or mismatched pull session command`)}validateHostCredit(e){if(A(e,`byte credit`),e>this.options.maxByteCredit)throw RangeError(`byte credit exceeds host maximum`)}accepted(e,t,n=!1){return{kind:`accepted`,protocol:k,...n?{sessionId:e.sessionId,operationId:e.operationId,generation:e.generation}:this.identity(),requestId:e.requestId,command:t,usage:this.resourceUsage()}}identity(){return{sessionId:this.options.sessionId,operationId:this.options.operationId,generation:this.options.generation}}isStaleLifecycle(e){return(e.kind===`cancel`||e.kind===`close`)&&e.protocol===`ooxml-pull-v1`&&Number.isSafeInteger(e.requestId)&&e.requestId>0&&Number.isSafeInteger(e.generation)&&e.generation>0&&e.generation<this.options.generation}sameOperationIdentity(e){return e.sessionId===this.options.sessionId&&e.operationId===this.options.operationId}errorResponse(e,t){return{kind:`error`,protocol:k,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:t,usage:this.errorResourceUsage()}}async forceFatalCleanup(){this.cancelRequested=!0,this.unacked=void 0,this.coordinator.release(this.coordinatorOwner);let e;for(let t of[...this.leases.keys()])try{await this.release(t)}catch(t){e??=t}if(!this.driverCancelComplete)try{await this.options.driver.cancel?.(),this.driverCancelComplete=!0}catch(t){e??=t}if(e)throw e;this.unregisterCleanup()}allocateWireLeaseId(){if(!Number.isSafeInteger(this.nextWireLeaseId)||this.nextWireLeaseId<=0)throw RangeError(`wire lease id space exhausted`);return this.nextWireLeaseId++}arrayBufferTransferBytes(e){let t=0;for(let n of e??[])if(n instanceof ArrayBuffer&&(t+=n.byteLength,!Number.isSafeInteger(t)))throw RangeError(`ArrayBuffer transfer bytes overflow`);return t}maybeUnregisterCompleted(){this.completed&&this.leases.size===0&&this.unregisterCleanup()}resourceUsage(){return this.options.driver.resourceUsage?.()}errorResourceUsage(){try{return this.resourceUsage()}catch{return}}};i();function ke(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(`OOXML_DOCX_ILVL:`))return;let r=t.slice(16);if(r===`repair-required:level-definition`)return new n(`invalid-numbering`,`The DOCX defines a numbering level outside Word’s supported 0–8 range and requires repair.`);if(r===`cannot-open:whitespace`||r===`cannot-open:non-decimal`)return new n(`invalid-numbering`,`Word cannot open this DOCX numbering level (${r.slice(12)}).`)}function M(e){try{return ke(e)??e}catch{return e}}function Ae(e){try{return e()}catch(e){throw M(e)}}var N=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){let e=this.__destroy_into_raw();J.__wbg_docxarchive_free(e,0)}acknowledge_document_chunk(e,t,n){let r=J.docxarchive_acknowledge_document_chunk(this.__wbg_ptr,e,t,n);if(r[1])throw U(r[0])}assert_healthy(){let e=J.docxarchive_assert_healthy(this.__wbg_ptr);if(e[1])throw U(e[0])}cancel_document_cursor(){J.docxarchive_cancel_document_cursor(this.__wbg_ptr)}close_document_session(){J.docxarchive_close_document_session(this.__wbg_ptr)}document_chunk_done(){let e=J.docxarchive_document_chunk_done(this.__wbg_ptr);if(e[2])throw U(e[1]);return e[0]!==0}document_cursor_resource_usage(){let e=J.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);if(e[3])throw U(e[2]);let t;return e[0]!==0&&(t=F(e[0],e[1]).slice(),J.__wbindgen_free(e[0],e[1]*1,1)),t}extract_image(e){let t=H(e,J.__wbindgen_malloc,J.__wbindgen_realloc),n=q,r=J.docxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw U(r[2]);var i=F(r[0],r[1]).slice();return J.__wbindgen_free(r[0],r[1]*1,1),i}constructor(e,t,n,r){let i=Me(e,J.__wbindgen_malloc),a=q,o=J.docxarchive_new(i,a,!V(t),V(t)?BigInt(0):t,!V(n),V(n)?BigInt(0):n,!V(r),V(r)?BigInt(0):r);if(o[2])throw U(o[1]);return this.__wbg_ptr=o[0]>>>0,P.register(this,this.__wbg_ptr,this),this}open_document_cursor(e,t){let n=J.docxarchive_open_document_cursor(this.__wbg_ptr,e,t);if(n[1])throw U(n[0])}parse(){let e=J.docxarchive_parse(this.__wbg_ptr);if(e[3])throw U(e[2]);var t=F(e[0],e[1]).slice();return J.__wbindgen_free(e[0],e[1]*1,1),t}pull_document_chunk(e,t,n,r){let i=J.docxarchive_pull_document_chunk(this.__wbg_ptr,e,t,n,r);if(i[3])throw U(i[2]);var a=F(i[0],i[1]).slice();return J.__wbindgen_free(i[0],i[1]*1,1),a}resource_usage(){let e=J.docxarchive_resource_usage(this.__wbg_ptr);if(e[3])throw U(e[2]);var t=F(e[0],e[1]).slice();return J.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=J.docxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,U(i[2]);return e=n,t=r,R(n,r)}finally{J.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(N.prototype[Symbol.dispose]=N.prototype.free);function je(){return{__proto__:null,\"./docx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(R(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(R(e,t))}finally{J.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=H(n,J.__wbindgen_malloc,J.__wbindgen_realloc),i=q;L().setInt32(e+4,i,!0),L().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return R(e,t)},__wbindgen_init_externref_table:function(){let e=J.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const P=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>J.__wbg_docxarchive_free(e>>>0,1));function F(e,t){return e>>>=0,B().subarray(e/1,e/1+t)}let I=null;function L(){return(I===null||I.buffer.detached===!0||I.buffer.detached===void 0&&I.buffer!==J.memory.buffer)&&(I=new DataView(J.memory.buffer)),I}function R(e,t){return e>>>=0,Ne(e,t)}let z=null;function B(){return(z===null||z.byteLength===0)&&(z=new Uint8Array(J.memory.buffer)),z}function V(e){return e==null}function Me(e,t){let n=t(e.length*1,1)>>>0;return B().set(e,n/1),q=e.length,n}function H(e,t,n){if(n===void 0){let n=K.encode(e),r=t(n.length,1)>>>0;return B().subarray(r,r+n.length).set(n),q=n.length,r}let r=e.length,i=t(r,1)>>>0,a=B(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=B().subarray(i+o,i+r),a=K.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return q=o,i}function U(e){let t=J.__wbindgen_externrefs.get(e);return J.__externref_table_dealloc(e),t}let W=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});W.decode();let G=0;function Ne(e,t){return G+=t,G>=2146435072&&(W=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),W.decode(),G=t),W.decode(B().subarray(e,e+t))}const K=new TextEncoder;`encodeInto`in K||(K.encodeInto=function(e,t){let n=K.encode(e);return t.set(n),{read:e.length,written:n.length}});let q=0,J;function Pe(e,t){return J=e.exports,I=null,z=null,J.__wbindgen_start(),J}async function Fe(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function Y(e){if(J!==void 0)return J;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=je();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Fe(await e,t);return Pe(n,r)}async function Ie(e){return J=void 0,I=null,z=null,Y(e)}function Le(e){let t=e(e=>e.document_cursor_resource_usage?.());return t?y(t):void 0}const Re=67108864;var ze=class{archive;coordinator=new j;host=null;identity=null;executeArchive;constructor(e,t=e=>e(this.requireArchive())){this.archive=e,this.executeArchive=e=>Ae(()=>t(e))}open(e){if(this.host)throw Error(`a DOCX document pull session is already active`);this.executeArchive(t=>{t.open_document_cursor(e.operationId,e.generation)});let t=0;this.identity=e,this.host=new Oe({...e,maxByteCredit:Re,coordinator:this.coordinator,driver:{pull:n=>{let r;try{r=this.executeArchive(r=>r.pull_document_chunk(t,e.operationId,e.generation,n))}catch(e){throw ie(e,n,Re)||e}let i=Te(r);return{payload:i,byteLength:i.byteLength,done:this.executeArchive(e=>e.document_chunk_done()),transfer:[i]}},measureChunk:({payload:e})=>e.byteLength,acknowledge:n=>{if(n!==t)throw Error(`DOCX document acknowledgement sequence mismatch`);this.executeArchive(n=>n.acknowledge_document_chunk(t,e.operationId,e.generation)),t+=1},cancel:()=>this.executeArchive(e=>e.cancel_document_cursor()),close:()=>this.executeArchive(e=>e.close_document_session()),resourceUsage:()=>Le(this.executeArchive)}})}dispatch(e,t){return!this.host||!this.identity?(t({protocol:k,kind:`error`,sessionId:e.sessionId,operationId:e.operationId,generation:e.generation,requestId:e.requestId,error:D(Error(`DOCX document pull session is not open`))}),Promise.resolve()):this.host.dispatch(e,t)}async reset(){if(this.host)try{this.archive()&&this.executeArchive(e=>e.close_document_session())}finally{this.host=null,this.identity=null,this.coordinator=new j}}requireArchive(){let e=this.archive();if(!e)throw Error(`No docx loaded`);return e}};function Be(e){return!!e&&typeof e==`object`&&e.protocol===`ooxml-pull-v1`}const X=new Ce(Y,{freeArchive:e=>e.free(),reinit:Ie}),Z=new ze(()=>X.archive,e=>X.run(()=>{let t=X.archive;if(!t)throw Error(`No docx loaded`);return e(t)}));let Q=0;const $=(e,t)=>self.postMessage(e,t);self.onmessage=async e=>{let n=e.data;if(Be(n)){try{await Z.dispatch(n,$)}catch(e){$({protocol:k,kind:`error`,sessionId:n.sessionId,operationId:n.operationId,generation:n.generation,requestId:n.requestId,error:D(M(e))})}return}if(n.type===`init`){X.setWasmInput(t(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await X.ensureReady(),n.type!==`parse`&&X.archive){let e=X.archive;X.run(()=>e.assert_healthy())}if(n.type===`parse`){await Z.reset();let[e,t,i]=Ee(n.resourcePolicy),a=new Uint8Array(n.data);X.run(()=>{let n=new N(a,e,t,i);X.setArchive(n)}),Q+=1;let o={sessionId:Q,operationId:Q,generation:Q};Z.open(o),$({type:`documentSessionOpened`,id:r,...o});return}let e=X.archive;if(n.type===`extractImage`){if(!e)throw Error(`No docx loaded`);let t=X.run(()=>e.extract_image(n.path).buffer),i={type:`imageExtracted`,id:r,bytes:t};self.postMessage(i,[t]);return}if(n.type===`resourceUsage`){if(!e)throw Error(`No docx loaded`);$({type:`resourceUsage`,id:r,usage:y(X.run(()=>e.resource_usage()))});return}if(n.type===`toMarkdown`){if(!e)throw Error(`No docx loaded`);$({type:`markdownRendered`,id:r,markdown:X.run(()=>e.to_markdown())});return}}catch(e){$({type:`error`,id:r,...D(M(e))})}};", dn = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", un], { type: "text/javascript;charset=utf-8" });
|
|
357
350
|
function fn(e) {
|
|
358
351
|
let t;
|
|
@@ -372,23 +365,15 @@ function fn(e) {
|
|
|
372
365
|
});
|
|
373
366
|
}
|
|
374
367
|
}
|
|
375
|
-
//#endregion
|
|
376
|
-
//#region packages/docx/src/wasm/docx_parser_bg.wasm?url
|
|
377
368
|
var pn = new URL("docx_parser_bg.wasm", import.meta.url).href;
|
|
378
|
-
//#endregion
|
|
379
|
-
//#region packages/docx/src/main-thread-fallback.ts
|
|
380
369
|
function mn(e) {
|
|
381
370
|
return e === "nativeRouteSentinels" ? "[ooxml] mode: 'worker' fell back to main-thread rendering because the worker cannot register the font probes that size absent-font lines." : "[ooxml] mode: 'worker' fell back to main-thread rendering because this document requires DOM OpenType vertical glyph selection.";
|
|
382
371
|
}
|
|
383
|
-
//#endregion
|
|
384
|
-
//#region packages/docx/src/bookmark-nav.ts
|
|
385
372
|
function hn(e) {
|
|
386
373
|
let t = /* @__PURE__ */ new Map();
|
|
387
374
|
for (let n of e.pages) for (let e of n.bookmarkStarts) e.name !== "" && !t.has(e.name) && t.set(e.name, n.pageIndex);
|
|
388
375
|
return t;
|
|
389
376
|
}
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region packages/core/src/crypto/sha256.ts
|
|
392
377
|
var gn = new Uint32Array([
|
|
393
378
|
1116352408,
|
|
394
379
|
1899447441,
|
|
@@ -485,8 +470,6 @@ function _n(e) {
|
|
|
485
470
|
let s = new Uint8Array(32), c = new DataView(s.buffer);
|
|
486
471
|
return t.forEach((e, t) => c.setUint32(t * 4, e)), s;
|
|
487
472
|
}
|
|
488
|
-
//#endregion
|
|
489
|
-
//#region packages/docx/src/embedded-fonts.ts
|
|
490
473
|
var vn = _, yn = 64, R = 2;
|
|
491
474
|
async function bn(e, t) {
|
|
492
475
|
let n;
|
|
@@ -621,8 +604,6 @@ function Sn(e) {
|
|
|
621
604
|
function Cn(e) {
|
|
622
605
|
return e === "italic" || e === "boldItalic" ? "italic" : "normal";
|
|
623
606
|
}
|
|
624
|
-
//#endregion
|
|
625
|
-
//#region packages/docx/src/element-context.ts
|
|
626
607
|
var wn = gt, Tn = 16384;
|
|
627
608
|
function En(e, t) {
|
|
628
609
|
let n = [], r = 0, i = !1;
|
|
@@ -796,8 +777,6 @@ function zn(e, t) {
|
|
|
796
777
|
maxTextCharacters: n
|
|
797
778
|
};
|
|
798
779
|
}
|
|
799
|
-
//#endregion
|
|
800
|
-
//#region packages/docx/src/review-id.ts
|
|
801
780
|
function Bn(e) {
|
|
802
781
|
if (e === void 0) return;
|
|
803
782
|
let t = e.replace(/^[\t\n\r ]+|[\t\n\r ]+$/g, "");
|
|
@@ -807,8 +786,6 @@ function Bn(e) {
|
|
|
807
786
|
return;
|
|
808
787
|
}
|
|
809
788
|
}
|
|
810
|
-
//#endregion
|
|
811
|
-
//#region packages/docx/src/comments.ts
|
|
812
789
|
function Vn(e) {
|
|
813
790
|
return Object.freeze({
|
|
814
791
|
...e,
|
|
@@ -1040,8 +1017,6 @@ function $n(e, t, n, r = {}) {
|
|
|
1040
1017
|
})] : [];
|
|
1041
1018
|
}));
|
|
1042
1019
|
}
|
|
1043
|
-
//#endregion
|
|
1044
|
-
//#region packages/docx/src/revisions.ts
|
|
1045
1020
|
function er(e) {
|
|
1046
1021
|
let t = Bn(e.id);
|
|
1047
1022
|
return t === void 0 ? void 0 : `${e.kind}\u0000${t}`;
|
|
@@ -1154,8 +1129,6 @@ function sr(e, t) {
|
|
|
1154
1129
|
let r = e.geometryFallback;
|
|
1155
1130
|
return r === void 0 ? [] : t.filter((e) => e.sourceRunIndex === r.sourceRunIndex && tr(e.source, r.source));
|
|
1156
1131
|
}
|
|
1157
|
-
//#endregion
|
|
1158
|
-
//#region packages/docx/src/layout/progressive.ts
|
|
1159
1132
|
var cr = 12;
|
|
1160
1133
|
async function lr(e, t, n, r = {}) {
|
|
1161
1134
|
let { onPreview: i, scheduler: a } = r;
|
|
@@ -1167,8 +1140,6 @@ async function lr(e, t, n, r = {}) {
|
|
|
1167
1140
|
}));
|
|
1168
1141
|
} } : void 0), a);
|
|
1169
1142
|
}
|
|
1170
|
-
//#endregion
|
|
1171
|
-
//#region packages/docx/src/document-layout-events.ts
|
|
1172
1143
|
var K = /* @__PURE__ */ new WeakMap();
|
|
1173
1144
|
function q(e, t) {
|
|
1174
1145
|
let n = Object.freeze({ ...t });
|
|
@@ -1199,8 +1170,6 @@ function ur(e, t, n, r) {
|
|
|
1199
1170
|
i?.delete(a), i?.size === 0 && K.delete(e);
|
|
1200
1171
|
};
|
|
1201
1172
|
}
|
|
1202
|
-
//#endregion
|
|
1203
|
-
//#region packages/docx/src/layout/unchanged-pages.ts
|
|
1204
1173
|
function dr(e, t) {
|
|
1205
1174
|
if (!e) return 0;
|
|
1206
1175
|
let n = Math.min(e.length, t.length), r = 0;
|
|
@@ -1221,8 +1190,6 @@ function fr(e, t) {
|
|
|
1221
1190
|
for (let r of n) if (!Object.prototype.hasOwnProperty.call(t, r) || !fr(e[r], t[r])) return !1;
|
|
1222
1191
|
return !0;
|
|
1223
1192
|
}
|
|
1224
|
-
//#endregion
|
|
1225
|
-
//#region packages/docx/src/document-layout-view.ts
|
|
1226
1193
|
var J = /* @__PURE__ */ new WeakMap(), pr = /* @__PURE__ */ new WeakMap(), mr = Symbol("docxLayoutViewRequester");
|
|
1227
1194
|
function Y(e) {
|
|
1228
1195
|
let t = A(e), n = t.activeLayoutOptions;
|
|
@@ -1293,8 +1260,6 @@ function _r(e, t, n) {
|
|
|
1293
1260
|
r?.delete(i), r?.size === 0 && J.delete(e);
|
|
1294
1261
|
};
|
|
1295
1262
|
}
|
|
1296
|
-
//#endregion
|
|
1297
|
-
//#region packages/docx/src/document.ts
|
|
1298
1263
|
var vr = Symbol("docxViewerLoadSignal");
|
|
1299
1264
|
function yr(e, t) {
|
|
1300
1265
|
return e !== null && e.currentDateMs === t.currentDateMs && e.showTrackedChanges === !0 == (t.showTrackedChanges === !0);
|
|
@@ -1379,7 +1344,7 @@ var Q = class e {
|
|
|
1379
1344
|
if (i?.aborted) throw new N();
|
|
1380
1345
|
};
|
|
1381
1346
|
if (l(), n.legacyDoc !== void 0) {
|
|
1382
|
-
let { loadDocxModelSource: e } = await import("./document-model-source-
|
|
1347
|
+
let { loadDocxModelSource: e } = await import("./document-model-source-Csow9uxO.js"), a = await e(t, n, r);
|
|
1383
1348
|
if (i?.aborted) throw a.destroy(), new N();
|
|
1384
1349
|
return a;
|
|
1385
1350
|
}
|
|
@@ -1400,7 +1365,7 @@ var Q = class e {
|
|
|
1400
1365
|
d = await e.arrayBuffer();
|
|
1401
1366
|
} else d = t;
|
|
1402
1367
|
l(), d = a(await o(d, n.password)), l(), _.setSourceBytes(d.byteLength), _.checkpoint("container ready");
|
|
1403
|
-
let v = g === "worker" ? (await import("./render-worker-host-
|
|
1368
|
+
let v = g === "worker" ? (await import("./render-worker-host-BxsA-yJo.js")).createRenderWorker() : new fn(), y = g === "worker" ? jt(n) : void 0, b = g === "worker" && !!n.progressiveLayout, x, S = !1, C = () => {
|
|
1404
1369
|
S || !x || (S = !0, x.destroy());
|
|
1405
1370
|
};
|
|
1406
1371
|
try {
|
|
@@ -2021,15 +1986,11 @@ var Q = class e {
|
|
|
2021
1986
|
});
|
|
2022
1987
|
}
|
|
2023
1988
|
};
|
|
2024
|
-
//#endregion
|
|
2025
|
-
//#region packages/docx/src/tate-chu-yoko-overlay.ts
|
|
2026
1989
|
function Cr(e, t) {
|
|
2027
1990
|
if (!e.eastAsianVert) return 1;
|
|
2028
1991
|
let n = t(e.text);
|
|
2029
1992
|
return !(n > 0) || e.w >= n ? 1 : e.w / n;
|
|
2030
1993
|
}
|
|
2031
|
-
//#endregion
|
|
2032
|
-
//#region packages/docx/src/text-layer.ts
|
|
2033
1994
|
function wr(e, t, n, r, i, a, o) {
|
|
2034
1995
|
e.innerHTML = "", D(e, "ooxmlSelectionSurface", "docx"), D(e, "pageIndex", o === void 0 ? void 0 : String(o));
|
|
2035
1996
|
let s = e.ownerDocument ?? document;
|
|
@@ -2062,8 +2023,6 @@ function Tr(e, t, n, r, i, a, o = {}) {
|
|
|
2062
2023
|
}
|
|
2063
2024
|
}
|
|
2064
2025
|
}
|
|
2065
|
-
//#endregion
|
|
2066
|
-
//#region packages/docx/src/find.ts
|
|
2067
2026
|
var Er = class extends w {
|
|
2068
2027
|
constructor(e, t) {
|
|
2069
2028
|
super(e, t, (e) => ({ page: e }));
|
|
@@ -2081,8 +2040,6 @@ var Er = class extends w {
|
|
|
2081
2040
|
return this.activeUnit();
|
|
2082
2041
|
}
|
|
2083
2042
|
};
|
|
2084
|
-
//#endregion
|
|
2085
|
-
//#region packages/docx/src/selection-context.ts
|
|
2086
2043
|
function Dr(e, t, n, r, i = {}) {
|
|
2087
2044
|
let a = e.find((e) => e.id === n && e.parentId === void 0);
|
|
2088
2045
|
if (!a) return null;
|
|
@@ -2184,13 +2141,9 @@ function $(e, t, n = {}) {
|
|
|
2184
2141
|
maxRunLocators: r.maxLocators
|
|
2185
2142
|
};
|
|
2186
2143
|
}
|
|
2187
|
-
//#endregion
|
|
2188
|
-
//#region packages/docx/src/focused-view-runtime.ts
|
|
2189
2144
|
function jr(e, t, n, r, i) {
|
|
2190
2145
|
return r === "worker" ? e.renderPageToBitmap(n, i) : e.renderPage(t, n, i);
|
|
2191
2146
|
}
|
|
2192
|
-
//#endregion
|
|
2193
|
-
//#region packages/docx/src/viewer.ts
|
|
2194
2147
|
var Mr = Symbol("DocxViewer.borrowedDocument"), Nr = class e {
|
|
2195
2148
|
_pendingLoadAbort = null;
|
|
2196
2149
|
_pendingRequestedView;
|
|
@@ -2807,7 +2760,7 @@ var Mr = Symbol("DocxViewer.borrowedDocument"), Nr = class e {
|
|
|
2807
2760
|
}
|
|
2808
2761
|
}, Ir = 12, Lr = 13, Rr = Symbol("DocxScrollViewer.borrowedDocument"), zr;
|
|
2809
2762
|
function Br() {
|
|
2810
|
-
return zr ??= import("./comment-ui-runtime-
|
|
2763
|
+
return zr ??= import("./comment-ui-runtime-BWhLz4gq.js");
|
|
2811
2764
|
}
|
|
2812
2765
|
var Vr = class e {
|
|
2813
2766
|
_pendingLoadAbort = null;
|
|
@@ -3525,8 +3478,6 @@ var Vr = class e {
|
|
|
3525
3478
|
this._destroyed || (this._destroyed = !0, this._pendingLoadAbort?.abort(), this._pendingLoadAbort = null, this._pendingViewChanged = null, this._findRequestGeneration++, this._errorRouter.close(), this._layout.unbind(), this._layoutViewGeneration++, this._commentNavigation.reset(), this._find.invalidate(), this._findActive = !1, this._selection.destroy(), this._highlights.destroy(), this._commentOverlay.destroy(), this._selection.clearElementContext(), this._scroller.destroy(), this._zoom.destroy(), this._commentMargin.destroy(), this._documentOwner.close(), this._shell.destroy());
|
|
3526
3479
|
}
|
|
3527
3480
|
};
|
|
3528
|
-
//#endregion
|
|
3529
|
-
//#region packages/docx/src/types.ts
|
|
3530
3481
|
function Hr(e) {
|
|
3531
3482
|
let t = [];
|
|
3532
3483
|
for (let n of e.content) {
|
|
@@ -3537,8 +3488,6 @@ function Hr(e) {
|
|
|
3537
3488
|
}
|
|
3538
3489
|
return t.join(" ");
|
|
3539
3490
|
}
|
|
3540
|
-
//#endregion
|
|
3541
|
-
//#region src/docx.ts
|
|
3542
3491
|
var Ur = /* @__PURE__ */ e({
|
|
3543
3492
|
DocxDocument: () => Q,
|
|
3544
3493
|
DocxScrollViewer: () => Vr,
|
|
@@ -3559,5 +3508,4 @@ var Ur = /* @__PURE__ */ e({
|
|
|
3559
3508
|
resolveDocxCommentThreads: () => $n,
|
|
3560
3509
|
resolveRevisionAnchorRuns: () => sr
|
|
3561
3510
|
});
|
|
3562
|
-
//#endregion
|
|
3563
3511
|
export { sn as _, $ as a, Q as c, sr as d, W as f, L as g, mn as h, Nr as i, q as l, xn as m, Hr as n, Tr as o, $n as p, Vr as r, wr as s, Ur as t, lr as u };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { H as e, U as t, qt as n } from "./bounded-raw-part-cache-
|
|
2
|
-
import { a as r, g as i, i as a, j as o, l as s, r as c } from "./document-pull-client-
|
|
3
|
-
import { r as l } from "./wasm-loader-
|
|
4
|
-
import { r as u } from "./document-pull-worker-
|
|
5
|
-
import { i as d, t as f } from "./docx-
|
|
6
|
-
import { t as p } from "./model-source-
|
|
7
|
-
//#region packages/node/src/docx-model-source.ts
|
|
1
|
+
import { H as e, U as t, qt as n } from "./bounded-raw-part-cache-Bi_VqXmg.js";
|
|
2
|
+
import { a as r, g as i, i as a, j as o, l as s, r as c } from "./document-pull-client-CHpz0Q1p.js";
|
|
3
|
+
import { r as l } from "./wasm-loader-KAOyLXzf.js";
|
|
4
|
+
import { r as u } from "./document-pull-worker-1ZJv9f9W.js";
|
|
5
|
+
import { i as d, t as f } from "./docx-D9E0vCq-.js";
|
|
6
|
+
import { t as p } from "./model-source-DLXFe4_2.js";
|
|
8
7
|
var m = class extends f {
|
|
9
8
|
constructor(...e) {
|
|
10
9
|
super(...e);
|
|
@@ -68,7 +67,7 @@ function _(e) {
|
|
|
68
67
|
return t;
|
|
69
68
|
}
|
|
70
69
|
async function v(e, n, r, i) {
|
|
71
|
-
let { acquireDocxSessionFromArchive: a, validateDocxModelSourceArchive: o, validateDocxModelSourceViewDefaults: s } = await import("./model-source-session-
|
|
70
|
+
let { acquireDocxSessionFromArchive: a, validateDocxModelSourceArchive: o, validateDocxModelSourceViewDefaults: s } = await import("./model-source-session-B3WVQCM5.js"), c = await p(e, "docx", {
|
|
72
71
|
...n,
|
|
73
72
|
source: n.legacyDoc
|
|
74
73
|
}, o, (e) => t(e) ?? u(e));
|
|
@@ -94,5 +93,4 @@ async function v(e, n, r, i) {
|
|
|
94
93
|
viewDefaults: l
|
|
95
94
|
};
|
|
96
95
|
}
|
|
97
|
-
//#endregion
|
|
98
96
|
export { g as materializeDocxSource, h as openDocxSource };
|
package/dist/docx.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { vo as e, yo as t } from "./plot-area-frame-
|
|
2
|
-
import { u as n } from "./bounded-raw-part-cache-
|
|
3
|
-
import { a as r, c as i, d as a, f as o, i as s, n as c, o as l, p as u, r as d, s as f } from "./docx-
|
|
4
|
-
import { f as p, u as m } from "./pixel-budget-
|
|
5
|
-
import { i as h, t as g } from "./tiff-contract-
|
|
6
|
-
import { D as _ } from "./canvas-viewer-mechanics-
|
|
1
|
+
import { vo as e, yo as t } from "./plot-area-frame-D3JtHvov.js";
|
|
2
|
+
import { u as n } from "./bounded-raw-part-cache-Bi_VqXmg.js";
|
|
3
|
+
import { a as r, c as i, d as a, f as o, i as s, n as c, o as l, p as u, r as d, s as f } from "./docx-GXxH0AwW.js";
|
|
4
|
+
import { f as p, u as m } from "./pixel-budget-DI82Hn3R.js";
|
|
5
|
+
import { i as h, t as g } from "./tiff-contract-DEd8CGuz.js";
|
|
6
|
+
import { D as _ } from "./canvas-viewer-mechanics-ycCX6v-z.js";
|
|
7
7
|
export { i as DocxDocument, d as DocxScrollViewer, s as DocxViewer, m as OoxmlDecodedImageLimitError, e as OoxmlError, t as OoxmlResourceLimitError, g as TiffDecodeError, _ as autoResize, l as buildDocxHighlightLayer, f as buildDocxTextLayer, p as isOoxmlDecodedImageLimitError, h as isTiffDecodeError, c as noteText, n as openExternalHyperlink, r as readDocxTextSelectionContext, o as resolveCommentAnchorRuns, u as resolveDocxCommentThreads, a as resolveRevisionAnchorRuns };
|
package/dist/docx_parser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ar as e, cr as t, fr as n, hr as r, or as i, pr as a, tr as o, vr as s } from "./plot-area-frame-
|
|
2
|
-
import { At as c, Bt as l, Ct as u, Dt as d, Ft as f, Ht as p, It as m, Mt as h, Ot as g, St as _, Ut as v, Vt as y, Wt as b, jt as x, kt as S, zt as C } from "./bounded-raw-part-cache-
|
|
3
|
-
//#region packages/core/src/shape/drawingml-geometry.ts
|
|
1
|
+
import { ar as e, cr as t, fr as n, hr as r, or as i, pr as a, tr as o, vr as s } from "./plot-area-frame-D3JtHvov.js";
|
|
2
|
+
import { At as c, Bt as l, Ct as u, Dt as d, Ft as f, Ht as p, It as m, Mt as h, Ot as g, St as _, Ut as v, Vt as y, Wt as b, jt as x, kt as S, zt as C } from "./bounded-raw-part-cache-Bi_VqXmg.js";
|
|
4
3
|
var w = new Set([
|
|
5
4
|
"line",
|
|
6
5
|
"straightconnector1",
|
|
@@ -251,8 +250,6 @@ function F(e, t = M) {
|
|
|
251
250
|
if (!Object.values(v).every(Number.isFinite)) throw RangeError("Non-finite DrawingML enclosure");
|
|
252
251
|
return v;
|
|
253
252
|
}
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region packages/core/src/shape/drawingml-shape.ts
|
|
256
253
|
var I = 1;
|
|
257
254
|
function L(e, t, n) {
|
|
258
255
|
let { x: r, y: i, w: a, h: o } = t.rect, { rotationDeg: s, flipH: c, flipV: l } = t.transform;
|
|
@@ -306,5 +303,4 @@ function V(e, n, r) {
|
|
|
306
303
|
}
|
|
307
304
|
});
|
|
308
305
|
}
|
|
309
|
-
//#endregion
|
|
310
306
|
export { A as a, F as i, V as n, k as o, L as r, z as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Zr as e, ni as t } from "./plot-area-frame-
|
|
2
|
-
import { r as n } from "./raster-target-
|
|
3
|
-
//#region packages/core/src/shape/color-space.ts
|
|
1
|
+
import { Zr as e, ni as t } from "./plot-area-frame-D3JtHvov.js";
|
|
2
|
+
import { r as n } from "./raster-target-Ca3tyA0L.js";
|
|
4
3
|
function r([e, t, n], r = [
|
|
5
4
|
0,
|
|
6
5
|
0,
|
|
@@ -46,8 +45,6 @@ function i(e, t, n, r = [
|
|
|
46
45
|
function a(e, t, n) {
|
|
47
46
|
return Math.round(Math.max(0, Math.min(255, e + (t - e) * n)));
|
|
48
47
|
}
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region packages/core/src/image/duotone.ts
|
|
51
48
|
function o(e) {
|
|
52
49
|
return /^[0-9a-fA-F]{6}$/.test(e) ? [
|
|
53
50
|
parseInt(e.slice(0, 2), 16),
|
|
@@ -122,5 +119,4 @@ async function d(e, r, i) {
|
|
|
122
119
|
c || (s.width = 0);
|
|
123
120
|
}
|
|
124
121
|
}
|
|
125
|
-
//#endregion
|
|
126
122
|
export { o as a, a as c, c as i, r as l, d as n, s as o, l as r, i as s, u as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Ar as e, Jr as t, Xr as n, Yr as r, Zr as i, kr as a } from "./plot-area-frame-
|
|
2
|
-
import { f as o, o as s, s as c, t as l, u } from "./pixel-budget-
|
|
3
|
-
//#region packages/core/src/image/emf-plus.ts
|
|
1
|
+
import { Ar as e, Jr as t, Xr as n, Yr as r, Zr as i, kr as a } from "./plot-area-frame-D3JtHvov.js";
|
|
2
|
+
import { f as o, o as s, s as c, t as l, u } from "./pixel-budget-DI82Hn3R.js";
|
|
4
3
|
var d = {
|
|
5
4
|
HEADER: 16385,
|
|
6
5
|
EOF: 16386,
|
|
@@ -1786,5 +1785,4 @@ async function ct(t, n, r) {
|
|
|
1786
1785
|
unsupported: c
|
|
1787
1786
|
};
|
|
1788
1787
|
}
|
|
1789
|
-
//#endregion
|
|
1790
1788
|
export { at as playEmf, ct as renderEmfToBitmap };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { m as e } from "./slide-pull-client-
|
|
2
|
-
import { Kr as t } from "./plot-area-frame-
|
|
3
|
-
//#region packages/pptx/src/font-preload-inert-ranges.ts
|
|
1
|
+
import { m as e } from "./slide-pull-client-43mS9T70.js";
|
|
2
|
+
import { Kr as t } from "./plot-area-frame-D3JtHvov.js";
|
|
4
3
|
var n;
|
|
5
4
|
function r() {
|
|
6
5
|
return n ??= [
|
|
@@ -2008,8 +2007,6 @@ function r() {
|
|
|
2008
2007
|
1114109
|
|
2009
2008
|
];
|
|
2010
2009
|
}
|
|
2011
|
-
//#endregion
|
|
2012
|
-
//#region packages/pptx/src/font-preload-inert-text.ts
|
|
2013
2010
|
function i(e) {
|
|
2014
2011
|
if (!Number.isInteger(e)) return !1;
|
|
2015
2012
|
let t = r(), n = 0, i = t.length / 2 - 1;
|
|
@@ -2021,8 +2018,6 @@ function i(e) {
|
|
|
2021
2018
|
}
|
|
2022
2019
|
return !1;
|
|
2023
2020
|
}
|
|
2024
|
-
//#endregion
|
|
2025
|
-
//#region packages/pptx/src/font-preload-demand.ts
|
|
2026
2021
|
function a(n, r, a) {
|
|
2027
2022
|
let o = /* @__PURE__ */ new Set(), s = 2;
|
|
2028
2023
|
if (s > a) return "all";
|
|
@@ -2054,5 +2049,4 @@ function a(n, r, a) {
|
|
|
2054
2049
|
} else return "all";
|
|
2055
2050
|
return [...o];
|
|
2056
2051
|
}
|
|
2057
|
-
//#endregion
|
|
2058
2052
|
export { a as collectSlideFontDemand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ja as e } from "./plot-area-frame-
|
|
1
|
+
import { ja as e } from "./plot-area-frame-D3JtHvov.js";
|
|
2
2
|
function t(e, t = 8) {
|
|
3
3
|
return Math.trunc((256 * e + Math.trunc(128 / t)) / 256 * t);
|
|
4
4
|
}
|
|
@@ -17,8 +17,6 @@ function a(t) {
|
|
|
17
17
|
function o(t) {
|
|
18
18
|
return t / e;
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region packages/xlsx/src/internal/grid-axis-geometry.ts
|
|
22
20
|
var s = class e {
|
|
23
21
|
maxIndex;
|
|
24
22
|
indices;
|
|
@@ -193,8 +191,6 @@ function y(e, t) {
|
|
|
193
191
|
columns: n.columns && new Map(n.columns)
|
|
194
192
|
}) : c.delete(t);
|
|
195
193
|
}
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region packages/xlsx/src/internal/grid-geometry.ts
|
|
198
194
|
var b = 1048576, x = 16384, S = class e {
|
|
199
195
|
static cache = /* @__PURE__ */ new WeakMap();
|
|
200
196
|
static forWorksheet(t, n) {
|
|
@@ -380,5 +376,4 @@ var b = 1048576, x = 16384, S = class e {
|
|
|
380
376
|
return a === "start" ? e : a === "center" ? e - (i - r - t) / 2 : a === "end" ? e - (i - r - t) : o < r ? e : o + t > i ? e - (i - r - t) : n;
|
|
381
377
|
}
|
|
382
378
|
};
|
|
383
|
-
//#endregion
|
|
384
379
|
export { f as a, m as c, _ as d, i as f, g as i, p as l, a as m, x as n, y as o, o as p, b as r, h as s, S as t, v as u };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { a as e } from "./renderer-
|
|
2
|
-
//#region packages/xlsx/src/internal/host-layout-measure.ts
|
|
1
|
+
import { a as e } from "./renderer-DFDF48zw.js";
|
|
3
2
|
function t(t, n) {
|
|
4
3
|
return e(t.family, t.sizePt, void 0, !1, t.bold ? 700 : 400, t.italic ? "italic" : "normal", n);
|
|
5
4
|
}
|
|
6
|
-
//#endregion
|
|
7
5
|
export { t as measureHostLayoutFont };
|
package/dist/{in-process-pull-transport-DuXcPZng.js → in-process-pull-transport-BPJ7M0uC.js}
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region packages/core/src/internal/in-process-pull-transport.ts
|
|
2
1
|
var e = class {
|
|
3
2
|
dispatch;
|
|
4
3
|
terminateHost;
|
|
@@ -25,5 +24,4 @@ var e = class {
|
|
|
25
24
|
this.terminated || (this.terminated = !0, this.terminateHost());
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
//#endregion
|
|
29
27
|
export { e as t };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./docx-
|
|
2
|
-
import { t } from "./pptx-
|
|
3
|
-
import { t as n } from "./xlsx-
|
|
1
|
+
import { t as e } from "./docx-GXxH0AwW.js";
|
|
2
|
+
import { t } from "./pptx-CLyebeF_.js";
|
|
3
|
+
import { t as n } from "./xlsx-DelYm4VZ.js";
|
|
4
4
|
export { e as docx, t as pptx, n as xlsx };
|