@silurus/ooxml 0.87.0 → 0.89.0
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 +118 -23
- package/THIRD_PARTY_NOTICES.md +7 -6
- package/dist/abort-VrnK7mdP.js +10 -0
- package/dist/assets/render-worker-CUOU6mL2.js +16 -0
- package/dist/assets/render-worker-DOqrFhSU.js +15 -0
- package/dist/assets/render-worker-DvWUdZUN.js +35 -0
- package/dist/bounded-raw-part-cache-B7JoC1CD.js +64586 -0
- package/dist/bundled-asset-url-E2nXURF9.js +15 -0
- package/dist/canvas-viewer-mechanics-DfQqRKkD.js +675 -0
- package/dist/cfb-guard-9QTRTg7f.js +528 -0
- package/dist/chart-ex.mjs +708 -739
- package/dist/comment-overlay-controller-B5_zGgG5.js +994 -0
- package/dist/comment-ui-runtime-B7ZvovcS.js +2 -0
- package/dist/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-D_sb2K6s.js} +5 -5
- package/dist/{comment-ui-runtime-BfE7MJZn.js → comment-ui-runtime-Jy-3goA9.js} +5 -5
- package/dist/delimited-text-worker-host-CikWU6_m.js +27 -0
- package/dist/document-model-source-BKNrXjAL.js +249 -0
- package/dist/document-pull-client-CxONDGbk.js +37833 -0
- package/dist/document-pull-worker-AMyXYpPq.js +104 -0
- package/dist/docx-D91ER1_S.js +495 -0
- package/dist/docx-DhDnKEI6.js +3563 -0
- package/dist/docx-model-source-CdrSt3hF.js +98 -0
- package/dist/docx-source-worker.mjs +455 -0
- package/dist/docx.mjs +7 -7
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/drawingml-shape-ChcGZNd8.js +310 -0
- package/dist/duotone-ekYik4ix.js +126 -0
- package/dist/emf-UT6I8rVi.js +1790 -0
- package/dist/font-preload-demand-CdJZUMCT.js +2058 -0
- package/dist/grid-geometry-uQOgViJU.js +384 -0
- package/dist/host-layout-DVMw8hDY.js +56 -0
- package/dist/host-layout-measure-CCEgaC_v.js +7 -0
- package/dist/in-process-pull-transport-DuXcPZng.js +29 -0
- package/dist/index.mjs +4 -4
- package/dist/internal-companion.mjs +12 -0
- package/dist/line-distribute-CPOV6csk.js +2716 -0
- package/dist/math.mjs +2 -2
- package/dist/mathjax-stix2.js +10 -10
- package/dist/model-source-DJGzDtGb.js +61 -0
- package/dist/model-source-kz_NkZqT.js +179 -0
- package/dist/model-source-session-Bu9CHFHc.js +71 -0
- package/dist/model-source-session-CDuijwv1.js +85 -0
- package/dist/model-source-session-sKpNiIJI.js +58 -0
- package/dist/node.mjs +7 -1327
- package/dist/{pixel-budget-Dgjw269h.js → pixel-budget-BpTYrepD.js} +13 -10
- package/dist/plot-area-frame-CaJFvZ7p.js +8502 -0
- package/dist/pptx-CDP9dZHe.js +2936 -0
- package/dist/pptx-C_uxLVKB.js +183 -0
- package/dist/pptx-model-source-O7LhpOjz.js +37 -0
- package/dist/pptx-source-worker.mjs +446 -0
- package/dist/pptx.mjs +8 -7
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/presentation-model-source-tmROzteR.js +77 -0
- package/dist/raster-target-YQ4G6rxo.js +42 -0
- package/dist/region-map.mjs +114 -150
- package/dist/{render-8Zo7dnds.js → render-CJVglUHl.js} +3 -3
- package/dist/{render-worker-host-BfbnEChF.js → render-worker-host-BseIaVvm.js} +1 -1
- package/dist/{render-worker-host-DNL9dWRh.js → render-worker-host-CyxPU4JU.js} +1 -1
- package/dist/{render-worker-host-IkHrYOci.js → render-worker-host-aF6aWkC0.js} +1 -1
- package/dist/renderer-CkGLj0CC.js +5170 -0
- package/dist/renderer-Czw1cCC7.js +5823 -0
- package/dist/resource-measurement-mXw-WjMF.js +771 -0
- package/dist/session-Csv9maad.js +656 -0
- package/dist/slide-pull-client-DRZYwBTu.js +6515 -0
- package/dist/three-d-BK5siJgJ.js +878 -0
- package/dist/three-d.mjs +871 -764
- package/dist/{raster-target-ojDdQizC.js → tiff-contract-C6M3QcPp.js} +1 -42
- package/dist/tiff.mjs +401 -248
- package/dist/types/chart-ex.d.ts +289 -4
- package/dist/types/docx.d.ts +473 -98
- package/dist/types/index.d.ts +674 -303
- package/dist/types/internal-companion.d.ts +11 -0
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +530 -11
- package/dist/types/pptx.d.ts +410 -97
- package/dist/types/region-map.d.ts +289 -4
- package/dist/types/three-d.d.ts +289 -4
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +483 -134
- package/dist/wasm-loader-rlgHmcSv.js +35 -0
- package/dist/wasm-runtime-generation-DX4y0Ecl.js +97 -0
- package/dist/workbook-model-source-BTC4ISTS.js +94 -0
- package/dist/worker-source-I1cIYBel.js +22 -0
- package/dist/worker-source-SbudzjYL.js +22 -0
- package/dist/worker-source-UAi3GNcM.js +22 -0
- package/dist/worksheet-pull-client-CkHgbtyM.js +579 -0
- package/dist/xlsx-CpSDPAEU.js +5809 -0
- package/dist/xlsx-D5569TPf.js +534 -0
- package/dist/xlsx-model-source-DPSkjFic.js +309 -0
- package/dist/xlsx-source-worker.mjs +525 -0
- package/dist/xlsx.mjs +8 -7
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +42 -16
- package/dist/assets/render-worker-CeK_iqK3.js +0 -10
- package/dist/assets/render-worker-DusrDhPk.js +0 -11
- package/dist/assets/render-worker-n2ZG0lrQ.js +0 -31
- package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
- package/dist/canvas-viewer-mechanics-Cpk0YFvM.js +0 -1384
- package/dist/cjk-fallback-bLI3z70h.js +0 -46
- package/dist/comment-occurrence-C8Y2uoVr.js +0 -6
- package/dist/comment-ui-runtime-BsK8pmUT.js +0 -2
- package/dist/comments-Diid5ujN.js +0 -246
- package/dist/delimited-text-worker-host-BVY-Ecni.js +0 -27
- package/dist/document-pull-client-yKxI8aDH.js +0 -27251
- package/dist/docx-BkSRiy07.js +0 -2995
- package/dist/dom-interaction-boundary-CBUQJsIM.js +0 -223
- package/dist/highlight-rect-C5hkRqUr.js +0 -13
- package/dist/hyperlink-ArrU3ArU.js +0 -36447
- package/dist/line-distribute-Dtudnqhs.js +0 -1023
- package/dist/line-metrics-B60C86uh.js +0 -60
- package/dist/plot-area-frame-D5hEOgkJ.js +0 -2903
- package/dist/pptx-62MmVbYB.js +0 -3063
- package/dist/renderer-XFSCOT6m.js +0 -5857
- package/dist/resource-measurement-CJsgolre.js +0 -150
- package/dist/session-CrU8f8DI.js +0 -743
- package/dist/slide-pull-client-B9KA8bU6.js +0 -6253
- package/dist/source-key-DIJG8BA0.js +0 -42
- package/dist/three-d-YYghQndN.js +0 -1346
- package/dist/transfer-p6iCC2R7.js +0 -6
- package/dist/units-EJdC96r6.js +0 -4
- package/dist/worksheet-pull-client-eIcQ-xlD.js +0 -458
- package/dist/xlsx-CRcSzZNq.js +0 -8482
- /package/dist/{chunk-DmhlhrBa.js → chunk-Dy4uBu1J.js} +0 -0
- /package/dist/{mathjax-DoyWZbSp.js → mathjax-BhwN6ilc.js} +0 -0
- /package/dist/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-PidH0wnP.js} +0 -0
- /package/dist/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-B52rDVKo.js} +0 -0
- /package/dist/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-CWM7jv6d.js} +0 -0
- /package/dist/{visible-index-BgiHEc1z.js → visible-index-FeVA0mGE.js} +0 -0
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
import { t as e } from "./chunk-Dy4uBu1J.js";
|
|
2
|
+
import { a as t, l as n } from "./slide-pull-client-DRZYwBTu.js";
|
|
3
|
+
import { eo as r } from "./plot-area-frame-CaJFvZ7p.js";
|
|
4
|
+
import { A as i, An as a, F as o, G as s, H as c, L as l, N as u, U as d, W as f, Y as p, j as m, k as h, q as g } from "./bounded-raw-part-cache-B7JoC1CD.js";
|
|
5
|
+
import { n as _, t as v } from "./abort-VrnK7mdP.js";
|
|
6
|
+
import { S as y } from "./worksheet-pull-client-CkHgbtyM.js";
|
|
7
|
+
import { t as b } from "./wasm-runtime-generation-DX4y0Ecl.js";
|
|
8
|
+
//#region packages/pptx/src/slide-cursor-operation.ts
|
|
9
|
+
function x(e) {
|
|
10
|
+
try {
|
|
11
|
+
return c(e((e) => e.slide_cursor_resource_usage()));
|
|
12
|
+
} catch (e) {
|
|
13
|
+
if (String(e).includes("slide cursor usage is unavailable")) return;
|
|
14
|
+
throw e;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function S(e, t, n, r, i) {
|
|
18
|
+
let a, o;
|
|
19
|
+
try {
|
|
20
|
+
if (i) {
|
|
21
|
+
if (!r) throw Error("slide payload is missing before acknowledgement");
|
|
22
|
+
let t = i(n, r, x(e));
|
|
23
|
+
typeof t == "function" ? a = t : t && ({rollback: a, commit: o} = t);
|
|
24
|
+
}
|
|
25
|
+
e((e) => e.acknowledge_slide(t.operationId, t.generation)), o?.();
|
|
26
|
+
} catch (e) {
|
|
27
|
+
try {
|
|
28
|
+
a?.();
|
|
29
|
+
} catch {}
|
|
30
|
+
throw e;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region packages/pptx/src/slide-pull-worker.ts
|
|
35
|
+
var C = "ooxml-pull-resetting", w = "ooxml-pull-reset-failed", T = class {
|
|
36
|
+
archive;
|
|
37
|
+
acceptSlide;
|
|
38
|
+
executeArchive;
|
|
39
|
+
coordinatorGeneration = new m();
|
|
40
|
+
sessions = /* @__PURE__ */ new Map();
|
|
41
|
+
pendingOpens = /* @__PURE__ */ new Map();
|
|
42
|
+
operationTail = Promise.resolve();
|
|
43
|
+
resourceFailure;
|
|
44
|
+
lifecycleState = "ready";
|
|
45
|
+
resetBarrier;
|
|
46
|
+
resetIdentities = /* @__PURE__ */ new Map();
|
|
47
|
+
constructor(e, t, n = (e) => e(this.requireArchive())) {
|
|
48
|
+
this.archive = e, this.acceptSlide = t, this.executeArchive = n;
|
|
49
|
+
}
|
|
50
|
+
get coordinator() {
|
|
51
|
+
return this.coordinatorGeneration;
|
|
52
|
+
}
|
|
53
|
+
reserveOpen(e) {
|
|
54
|
+
if (this.assertReady(), E(e), this.pendingOpens.has(e.sessionId) || this.sessions.has(e.sessionId)) throw Error("slide pull session id is already reserved");
|
|
55
|
+
this.pendingOpens.set(e.sessionId, {
|
|
56
|
+
identity: e,
|
|
57
|
+
canceled: !1
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
abandonOpen(e) {
|
|
61
|
+
this.pendingOpens.delete(e);
|
|
62
|
+
}
|
|
63
|
+
get pendingOpenCount() {
|
|
64
|
+
return this.pendingOpens.size;
|
|
65
|
+
}
|
|
66
|
+
async open(e, t) {
|
|
67
|
+
if (this.assertReady(), this.resourceFailure) throw this.resourceFailure;
|
|
68
|
+
if (!Number.isSafeInteger(e) || e < 0) throw RangeError("slide index must be a non-negative safe integer");
|
|
69
|
+
let n = this.pendingOpens.get(t.sessionId);
|
|
70
|
+
if (!n || !D(n.identity, t)) throw Error("slide pull session open reservation is stale or missing");
|
|
71
|
+
let r, o = new Promise((e) => {
|
|
72
|
+
r = e;
|
|
73
|
+
}), s = this.operationTail.then(() => this.coordinator.enqueue(async () => {
|
|
74
|
+
if (n.canceled) throw Error("slide pull session open was canceled");
|
|
75
|
+
let o, s = !1, c = new i({
|
|
76
|
+
...t,
|
|
77
|
+
maxByteCredit: a,
|
|
78
|
+
coordinator: this.coordinator,
|
|
79
|
+
driver: {
|
|
80
|
+
pull: (n) => {
|
|
81
|
+
let r;
|
|
82
|
+
try {
|
|
83
|
+
r = this.executeArchive((r) => r.pull_slide(e, t.operationId, t.generation, n));
|
|
84
|
+
} catch (e) {
|
|
85
|
+
throw p(e, n, a) || (this.latchResourceFailure(e), e);
|
|
86
|
+
}
|
|
87
|
+
let i = y(r);
|
|
88
|
+
return this.acceptSlide && (o = JSON.parse(new TextDecoder().decode(new Uint8Array(i)))), s = !0, {
|
|
89
|
+
payload: i,
|
|
90
|
+
byteLength: i.byteLength,
|
|
91
|
+
done: !0,
|
|
92
|
+
transfer: [i]
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
measureChunk: ({ payload: e }) => e.byteLength,
|
|
96
|
+
acknowledge: () => {
|
|
97
|
+
if (!s) throw Error("slide unit is not awaiting acknowledgement");
|
|
98
|
+
try {
|
|
99
|
+
S(this.executeArchive, t, e, o, this.acceptSlide);
|
|
100
|
+
} catch (e) {
|
|
101
|
+
throw this.latchResourceFailure(e), e;
|
|
102
|
+
}
|
|
103
|
+
s = !1, o = void 0, this.sessions.delete(t.sessionId), r();
|
|
104
|
+
},
|
|
105
|
+
cancel: async () => {
|
|
106
|
+
try {
|
|
107
|
+
this.archive() && await this.executeArchive((e) => e.cancel_slide());
|
|
108
|
+
} finally {
|
|
109
|
+
o = void 0, s = !1, this.sessions.delete(t.sessionId), r();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
close: async () => {
|
|
113
|
+
try {
|
|
114
|
+
this.archive() && await this.executeArchive((e) => e.cancel_slide());
|
|
115
|
+
} finally {
|
|
116
|
+
o = void 0, s = !1, this.sessions.delete(t.sessionId), r();
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
resourceUsage: () => {
|
|
120
|
+
try {
|
|
121
|
+
return this.readResourceUsage();
|
|
122
|
+
} catch (e) {
|
|
123
|
+
throw this.latchResourceFailure(e), e;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
this.sessions.set(t.sessionId, {
|
|
129
|
+
host: c,
|
|
130
|
+
identity: t
|
|
131
|
+
}), this.pendingOpens.delete(t.sessionId);
|
|
132
|
+
}));
|
|
133
|
+
this.operationTail = s.then(() => o, () => void 0);
|
|
134
|
+
try {
|
|
135
|
+
await s;
|
|
136
|
+
} catch (e) {
|
|
137
|
+
throw this.pendingOpens.delete(t.sessionId), r(), e;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async postOpenedSafely(e, t, n) {
|
|
141
|
+
if (this.lifecycleState !== "ready") {
|
|
142
|
+
try {
|
|
143
|
+
n(this.lifecycleError());
|
|
144
|
+
} catch {}
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
t();
|
|
149
|
+
} catch (t) {
|
|
150
|
+
await this.closeIdentity(e);
|
|
151
|
+
try {
|
|
152
|
+
n(t);
|
|
153
|
+
} catch {}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
dispatch(e, t) {
|
|
157
|
+
if (this.lifecycleState !== "ready") return t(this.responseDuringReset(e)), Promise.resolve();
|
|
158
|
+
let n = this.sessions.get(e.sessionId);
|
|
159
|
+
if (n) return n.host.dispatch(e, t);
|
|
160
|
+
let r = this.pendingOpens.get(e.sessionId);
|
|
161
|
+
if (r && (e.kind === "cancel" || e.kind === "close")) {
|
|
162
|
+
let n = D(r.identity, e);
|
|
163
|
+
return n && (r.canceled = !0), t(n ? {
|
|
164
|
+
protocol: h,
|
|
165
|
+
kind: "accepted",
|
|
166
|
+
sessionId: e.sessionId,
|
|
167
|
+
operationId: e.operationId,
|
|
168
|
+
generation: e.generation,
|
|
169
|
+
requestId: e.requestId,
|
|
170
|
+
command: e.kind
|
|
171
|
+
} : this.staleLifecycleResponse(e)), Promise.resolve();
|
|
172
|
+
}
|
|
173
|
+
return e.kind === "cancel" || e.kind === "close" ? (t({
|
|
174
|
+
protocol: h,
|
|
175
|
+
kind: "accepted",
|
|
176
|
+
sessionId: e.sessionId,
|
|
177
|
+
operationId: e.operationId,
|
|
178
|
+
generation: e.generation,
|
|
179
|
+
requestId: e.requestId,
|
|
180
|
+
command: e.kind
|
|
181
|
+
}), Promise.resolve()) : (t({
|
|
182
|
+
protocol: h,
|
|
183
|
+
kind: "error",
|
|
184
|
+
sessionId: e.sessionId,
|
|
185
|
+
operationId: e.operationId,
|
|
186
|
+
generation: e.generation,
|
|
187
|
+
requestId: e.requestId,
|
|
188
|
+
error: g(/* @__PURE__ */ Error("slide pull session is not open"))
|
|
189
|
+
}), Promise.resolve());
|
|
190
|
+
}
|
|
191
|
+
async dispatchSafely(e, t) {
|
|
192
|
+
try {
|
|
193
|
+
await this.dispatch(e, t);
|
|
194
|
+
} catch (n) {
|
|
195
|
+
try {
|
|
196
|
+
t({
|
|
197
|
+
protocol: h,
|
|
198
|
+
kind: "error",
|
|
199
|
+
sessionId: e.sessionId,
|
|
200
|
+
operationId: e.operationId,
|
|
201
|
+
generation: e.generation,
|
|
202
|
+
requestId: e.requestId,
|
|
203
|
+
error: g(n)
|
|
204
|
+
});
|
|
205
|
+
} catch {}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
run(e) {
|
|
209
|
+
if (this.lifecycleState !== "ready") return Promise.reject(this.lifecycleError());
|
|
210
|
+
let t = this.operationTail.then(() => this.coordinator.enqueue(async () => {
|
|
211
|
+
if (this.resourceFailure) throw this.resourceFailure;
|
|
212
|
+
return e();
|
|
213
|
+
})).catch((e) => {
|
|
214
|
+
throw this.latchResourceFailure(e), e;
|
|
215
|
+
});
|
|
216
|
+
return this.operationTail = t.then(() => void 0, () => void 0), t;
|
|
217
|
+
}
|
|
218
|
+
reset() {
|
|
219
|
+
if (this.resetBarrier) return this.resetBarrier;
|
|
220
|
+
this.lifecycleState = "resetting", this.captureResetIdentities();
|
|
221
|
+
let e = this.performReset().then(() => {
|
|
222
|
+
this.resetIdentities.clear(), this.lifecycleState = "ready";
|
|
223
|
+
}, (e) => {
|
|
224
|
+
throw this.lifecycleState = "reset-failed", e;
|
|
225
|
+
}).finally(() => {
|
|
226
|
+
this.resetBarrier === e && (this.resetBarrier = void 0);
|
|
227
|
+
});
|
|
228
|
+
return this.resetBarrier = e, e;
|
|
229
|
+
}
|
|
230
|
+
async performReset() {
|
|
231
|
+
for (let e of this.pendingOpens.values()) e.canceled = !0;
|
|
232
|
+
let e = 1;
|
|
233
|
+
for (let { host: t, identity: n } of [...this.sessions.values()]) {
|
|
234
|
+
let r;
|
|
235
|
+
if (await t.dispatch({
|
|
236
|
+
protocol: h,
|
|
237
|
+
kind: "close",
|
|
238
|
+
...n,
|
|
239
|
+
requestId: e++
|
|
240
|
+
}, (e) => {
|
|
241
|
+
e.kind === "error" && (r = d(e.error));
|
|
242
|
+
}), r) throw r;
|
|
243
|
+
}
|
|
244
|
+
this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.archive() && await this.executeArchive((e) => e.close_presentation_session()), this.coordinatorGeneration = new m(), this.resourceFailure = void 0;
|
|
245
|
+
}
|
|
246
|
+
assertReady() {
|
|
247
|
+
if (this.lifecycleState !== "ready") throw this.lifecycleError();
|
|
248
|
+
}
|
|
249
|
+
lifecycleError() {
|
|
250
|
+
let e = this.lifecycleState === "reset-failed", t = /* @__PURE__ */ Error(e ? "slide pull worker reset failed; retry reset before new work" : "slide pull worker reset is in progress");
|
|
251
|
+
return t.name = "PullSessionLifecycleError", Object.assign(t, { code: e ? w : C });
|
|
252
|
+
}
|
|
253
|
+
captureResetIdentities() {
|
|
254
|
+
for (let { identity: e } of this.sessions.values()) this.resetIdentities.set(e.sessionId, e);
|
|
255
|
+
for (let { identity: e } of this.pendingOpens.values()) this.resetIdentities.set(e.sessionId, e);
|
|
256
|
+
}
|
|
257
|
+
responseDuringReset(e) {
|
|
258
|
+
if (e.kind === "cancel" || e.kind === "close") {
|
|
259
|
+
let t = this.resetIdentities.get(e.sessionId);
|
|
260
|
+
return t && !D(t, e) ? this.staleLifecycleResponse(e) : {
|
|
261
|
+
protocol: h,
|
|
262
|
+
kind: "accepted",
|
|
263
|
+
sessionId: e.sessionId,
|
|
264
|
+
operationId: e.operationId,
|
|
265
|
+
generation: e.generation,
|
|
266
|
+
requestId: e.requestId,
|
|
267
|
+
command: e.kind
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
protocol: h,
|
|
272
|
+
kind: "error",
|
|
273
|
+
sessionId: e.sessionId,
|
|
274
|
+
operationId: e.operationId,
|
|
275
|
+
generation: e.generation,
|
|
276
|
+
requestId: e.requestId,
|
|
277
|
+
error: g(this.lifecycleError())
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
requireArchive() {
|
|
281
|
+
let e = this.archive();
|
|
282
|
+
if (!e) throw Error("Presentation not loaded");
|
|
283
|
+
return e;
|
|
284
|
+
}
|
|
285
|
+
async closeIdentity(e) {
|
|
286
|
+
if (this.lifecycleState !== "ready") return;
|
|
287
|
+
let t = this.sessions.get(e.sessionId);
|
|
288
|
+
if (t) {
|
|
289
|
+
await t.host.dispatch({
|
|
290
|
+
protocol: h,
|
|
291
|
+
kind: "close",
|
|
292
|
+
...e,
|
|
293
|
+
requestId: 1
|
|
294
|
+
}, () => void 0);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
let n = this.pendingOpens.get(e.sessionId);
|
|
298
|
+
n && D(n.identity, e) && (n.canceled = !0);
|
|
299
|
+
}
|
|
300
|
+
readResourceUsage() {
|
|
301
|
+
return x(this.executeArchive);
|
|
302
|
+
}
|
|
303
|
+
latchResourceFailure(e) {
|
|
304
|
+
let t = e instanceof r ? e : f(e);
|
|
305
|
+
t && (this.resourceFailure ??= t);
|
|
306
|
+
}
|
|
307
|
+
staleLifecycleResponse(e) {
|
|
308
|
+
return {
|
|
309
|
+
protocol: h,
|
|
310
|
+
kind: "error",
|
|
311
|
+
sessionId: e.sessionId,
|
|
312
|
+
operationId: e.operationId,
|
|
313
|
+
generation: e.generation,
|
|
314
|
+
requestId: e.requestId,
|
|
315
|
+
error: {
|
|
316
|
+
message: "stale lifecycle targets another slide operation",
|
|
317
|
+
errorName: "PullSessionProtocolError",
|
|
318
|
+
code: "ooxml-stale-lifecycle"
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
function E(e) {
|
|
324
|
+
if (!Number.isSafeInteger(e.sessionId) || e.sessionId <= 0) throw RangeError("session id must be a positive safe integer");
|
|
325
|
+
if (!Number.isSafeInteger(e.operationId) || e.operationId <= 0) throw RangeError("operation id must be a positive safe integer");
|
|
326
|
+
if (!Number.isSafeInteger(e.generation) || e.generation <= 0) throw RangeError("generation must be a positive safe integer");
|
|
327
|
+
}
|
|
328
|
+
function D(e, t) {
|
|
329
|
+
return e.sessionId === t.sessionId && e.operationId === t.operationId && e.generation === t.generation;
|
|
330
|
+
}
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region packages/pptx/src/wasm/pptx_parser.js
|
|
333
|
+
var O = /* @__PURE__ */ e({
|
|
334
|
+
PptxArchive: () => k,
|
|
335
|
+
default: () => Q,
|
|
336
|
+
extract_font: () => ee,
|
|
337
|
+
extract_image: () => te,
|
|
338
|
+
extract_media: () => ne,
|
|
339
|
+
initSync: () => ie,
|
|
340
|
+
parse_pptx: () => A,
|
|
341
|
+
pptx_to_markdown: () => re,
|
|
342
|
+
reinit: () => ae
|
|
343
|
+
}), k = class {
|
|
344
|
+
__destroy_into_raw() {
|
|
345
|
+
let e = this.__wbg_ptr;
|
|
346
|
+
return this.__wbg_ptr = 0, M.unregister(this), e;
|
|
347
|
+
}
|
|
348
|
+
free() {
|
|
349
|
+
let e = this.__destroy_into_raw();
|
|
350
|
+
Y.__wbg_pptxarchive_free(e, 0);
|
|
351
|
+
}
|
|
352
|
+
acknowledge_slide(e, t) {
|
|
353
|
+
let n = Y.pptxarchive_acknowledge_slide(this.__wbg_ptr, e, t);
|
|
354
|
+
if (n[1]) throw H(n[0]);
|
|
355
|
+
}
|
|
356
|
+
assert_healthy() {
|
|
357
|
+
let e = Y.pptxarchive_assert_healthy(this.__wbg_ptr);
|
|
358
|
+
if (e[1]) throw H(e[0]);
|
|
359
|
+
}
|
|
360
|
+
cancel_slide() {
|
|
361
|
+
Y.pptxarchive_cancel_slide(this.__wbg_ptr);
|
|
362
|
+
}
|
|
363
|
+
close_presentation_session() {
|
|
364
|
+
Y.pptxarchive_close_presentation_session(this.__wbg_ptr);
|
|
365
|
+
}
|
|
366
|
+
extract_font(e) {
|
|
367
|
+
let t = V(e, Y.__wbindgen_malloc, Y.__wbindgen_realloc), n = J, r = Y.pptxarchive_extract_font(this.__wbg_ptr, t, n);
|
|
368
|
+
if (r[3]) throw H(r[2]);
|
|
369
|
+
var i = N(r[0], r[1]).slice();
|
|
370
|
+
return Y.__wbindgen_free(r[0], r[1] * 1, 1), i;
|
|
371
|
+
}
|
|
372
|
+
extract_image(e) {
|
|
373
|
+
let t = V(e, Y.__wbindgen_malloc, Y.__wbindgen_realloc), n = J, r = Y.pptxarchive_extract_image(this.__wbg_ptr, t, n);
|
|
374
|
+
if (r[3]) throw H(r[2]);
|
|
375
|
+
var i = N(r[0], r[1]).slice();
|
|
376
|
+
return Y.__wbindgen_free(r[0], r[1] * 1, 1), i;
|
|
377
|
+
}
|
|
378
|
+
extract_media(e) {
|
|
379
|
+
let t = V(e, Y.__wbindgen_malloc, Y.__wbindgen_realloc), n = J, r = Y.pptxarchive_extract_media(this.__wbg_ptr, t, n);
|
|
380
|
+
if (r[3]) throw H(r[2]);
|
|
381
|
+
var i = N(r[0], r[1]).slice();
|
|
382
|
+
return Y.__wbindgen_free(r[0], r[1] * 1, 1), i;
|
|
383
|
+
}
|
|
384
|
+
constructor(e, t, n, r) {
|
|
385
|
+
let i = B(e, Y.__wbindgen_malloc), a = J, o = Y.pptxarchive_new(i, a, !z(t), z(t) ? BigInt(0) : t, !z(n), z(n) ? BigInt(0) : n, !z(r), z(r) ? BigInt(0) : r);
|
|
386
|
+
if (o[2]) throw H(o[1]);
|
|
387
|
+
return this.__wbg_ptr = o[0] >>> 0, M.register(this, this.__wbg_ptr, this), this;
|
|
388
|
+
}
|
|
389
|
+
parse() {
|
|
390
|
+
let e = Y.pptxarchive_parse(this.__wbg_ptr);
|
|
391
|
+
if (e[3]) throw H(e[2]);
|
|
392
|
+
var t = N(e[0], e[1]).slice();
|
|
393
|
+
return Y.__wbindgen_free(e[0], e[1] * 1, 1), t;
|
|
394
|
+
}
|
|
395
|
+
presentation_bootstrap() {
|
|
396
|
+
let e = Y.pptxarchive_presentation_bootstrap(this.__wbg_ptr);
|
|
397
|
+
if (e[3]) throw H(e[2]);
|
|
398
|
+
var t = N(e[0], e[1]).slice();
|
|
399
|
+
return Y.__wbindgen_free(e[0], e[1] * 1, 1), t;
|
|
400
|
+
}
|
|
401
|
+
pull_slide(e, t, n, r) {
|
|
402
|
+
let i = Y.pptxarchive_pull_slide(this.__wbg_ptr, e, t, n, r);
|
|
403
|
+
if (i[3]) throw H(i[2]);
|
|
404
|
+
var a = N(i[0], i[1]).slice();
|
|
405
|
+
return Y.__wbindgen_free(i[0], i[1] * 1, 1), a;
|
|
406
|
+
}
|
|
407
|
+
resource_usage() {
|
|
408
|
+
let e = Y.pptxarchive_resource_usage(this.__wbg_ptr);
|
|
409
|
+
if (e[3]) throw H(e[2]);
|
|
410
|
+
var t = N(e[0], e[1]).slice();
|
|
411
|
+
return Y.__wbindgen_free(e[0], e[1] * 1, 1), t;
|
|
412
|
+
}
|
|
413
|
+
slide_cursor_resource_usage() {
|
|
414
|
+
let e = Y.pptxarchive_slide_cursor_resource_usage(this.__wbg_ptr);
|
|
415
|
+
if (e[3]) throw H(e[2]);
|
|
416
|
+
var t = N(e[0], e[1]).slice();
|
|
417
|
+
return Y.__wbindgen_free(e[0], e[1] * 1, 1), t;
|
|
418
|
+
}
|
|
419
|
+
to_markdown() {
|
|
420
|
+
let e, t;
|
|
421
|
+
try {
|
|
422
|
+
let i = Y.pptxarchive_to_markdown(this.__wbg_ptr);
|
|
423
|
+
var n = i[0], r = i[1];
|
|
424
|
+
if (i[3]) throw n = 0, r = 0, H(i[2]);
|
|
425
|
+
return e = n, t = r, I(n, r);
|
|
426
|
+
} finally {
|
|
427
|
+
Y.__wbindgen_free(e, t, 1);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
Symbol.dispose && (k.prototype[Symbol.dispose] = k.prototype.free);
|
|
432
|
+
function ee(e, t, n, r) {
|
|
433
|
+
let i = B(e, Y.__wbindgen_malloc), a = J, o = V(t, Y.__wbindgen_malloc, Y.__wbindgen_realloc), s = J, c = Y.extract_font(i, a, o, s, !z(n), z(n) ? BigInt(0) : n, !z(r), z(r) ? BigInt(0) : r);
|
|
434
|
+
if (c[3]) throw H(c[2]);
|
|
435
|
+
var l = N(c[0], c[1]).slice();
|
|
436
|
+
return Y.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
437
|
+
}
|
|
438
|
+
function te(e, t, n, r) {
|
|
439
|
+
let i = B(e, Y.__wbindgen_malloc), a = J, o = V(t, Y.__wbindgen_malloc, Y.__wbindgen_realloc), s = J, c = Y.extract_image(i, a, o, s, !z(n), z(n) ? BigInt(0) : n, !z(r), z(r) ? BigInt(0) : r);
|
|
440
|
+
if (c[3]) throw H(c[2]);
|
|
441
|
+
var l = N(c[0], c[1]).slice();
|
|
442
|
+
return Y.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
443
|
+
}
|
|
444
|
+
function ne(e, t, n, r) {
|
|
445
|
+
let i = B(e, Y.__wbindgen_malloc), a = J, o = V(t, Y.__wbindgen_malloc, Y.__wbindgen_realloc), s = J, c = Y.extract_media(i, a, o, s, !z(n), z(n) ? BigInt(0) : n, !z(r), z(r) ? BigInt(0) : r);
|
|
446
|
+
if (c[3]) throw H(c[2]);
|
|
447
|
+
var l = N(c[0], c[1]).slice();
|
|
448
|
+
return Y.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
449
|
+
}
|
|
450
|
+
function A(e, t, n) {
|
|
451
|
+
let r = B(e, Y.__wbindgen_malloc), i = J, a = Y.parse_pptx(r, i, !z(t), z(t) ? BigInt(0) : t, !z(n), z(n) ? BigInt(0) : n);
|
|
452
|
+
if (a[3]) throw H(a[2]);
|
|
453
|
+
var o = N(a[0], a[1]).slice();
|
|
454
|
+
return Y.__wbindgen_free(a[0], a[1] * 1, 1), o;
|
|
455
|
+
}
|
|
456
|
+
function re(e, t, n) {
|
|
457
|
+
let r, i;
|
|
458
|
+
try {
|
|
459
|
+
let s = B(e, Y.__wbindgen_malloc), c = J, l = Y.pptx_to_markdown(s, c, !z(t), z(t) ? BigInt(0) : t, !z(n), z(n) ? BigInt(0) : n);
|
|
460
|
+
var a = l[0], o = l[1];
|
|
461
|
+
if (l[3]) throw a = 0, o = 0, H(l[2]);
|
|
462
|
+
return r = a, i = o, I(a, o);
|
|
463
|
+
} finally {
|
|
464
|
+
Y.__wbindgen_free(r, i, 1);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
function j() {
|
|
468
|
+
return {
|
|
469
|
+
__proto__: null,
|
|
470
|
+
"./pptx_parser_bg.js": {
|
|
471
|
+
__proto__: null,
|
|
472
|
+
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(e, t) {
|
|
473
|
+
throw Error(I(e, t));
|
|
474
|
+
},
|
|
475
|
+
__wbg_error_a6fa202b58aa1cd3: function(e, t) {
|
|
476
|
+
let n, r;
|
|
477
|
+
try {
|
|
478
|
+
n = e, r = t, console.error(I(e, t));
|
|
479
|
+
} finally {
|
|
480
|
+
Y.__wbindgen_free(n, r, 1);
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
484
|
+
return /* @__PURE__ */ Error();
|
|
485
|
+
},
|
|
486
|
+
__wbg_stack_3b0d974bbf31e44f: function(e, t) {
|
|
487
|
+
let n = t.stack, r = V(n, Y.__wbindgen_malloc, Y.__wbindgen_realloc), i = J;
|
|
488
|
+
F().setInt32(e + 4, i, !0), F().setInt32(e + 0, r, !0);
|
|
489
|
+
},
|
|
490
|
+
__wbindgen_cast_0000000000000001: function(e, t) {
|
|
491
|
+
return I(e, t);
|
|
492
|
+
},
|
|
493
|
+
__wbindgen_init_externref_table: function() {
|
|
494
|
+
let e = Y.__wbindgen_externrefs, t = e.grow(4);
|
|
495
|
+
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);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
var M = typeof FinalizationRegistry > "u" ? {
|
|
501
|
+
register: () => {},
|
|
502
|
+
unregister: () => {}
|
|
503
|
+
} : new FinalizationRegistry((e) => Y.__wbg_pptxarchive_free(e >>> 0, 1));
|
|
504
|
+
function N(e, t) {
|
|
505
|
+
return e >>>= 0, R().subarray(e / 1, e / 1 + t);
|
|
506
|
+
}
|
|
507
|
+
var P = null;
|
|
508
|
+
function F() {
|
|
509
|
+
return (P === null || P.buffer.detached === !0 || P.buffer.detached === void 0 && P.buffer !== Y.memory.buffer) && (P = new DataView(Y.memory.buffer)), P;
|
|
510
|
+
}
|
|
511
|
+
function I(e, t) {
|
|
512
|
+
return e >>>= 0, K(e, t);
|
|
513
|
+
}
|
|
514
|
+
var L = null;
|
|
515
|
+
function R() {
|
|
516
|
+
return (L === null || L.byteLength === 0) && (L = new Uint8Array(Y.memory.buffer)), L;
|
|
517
|
+
}
|
|
518
|
+
function z(e) {
|
|
519
|
+
return e == null;
|
|
520
|
+
}
|
|
521
|
+
function B(e, t) {
|
|
522
|
+
let n = t(e.length * 1, 1) >>> 0;
|
|
523
|
+
return R().set(e, n / 1), J = e.length, n;
|
|
524
|
+
}
|
|
525
|
+
function V(e, t, n) {
|
|
526
|
+
if (n === void 0) {
|
|
527
|
+
let n = q.encode(e), r = t(n.length, 1) >>> 0;
|
|
528
|
+
return R().subarray(r, r + n.length).set(n), J = n.length, r;
|
|
529
|
+
}
|
|
530
|
+
let r = e.length, i = t(r, 1) >>> 0, a = R(), o = 0;
|
|
531
|
+
for (; o < r; o++) {
|
|
532
|
+
let t = e.charCodeAt(o);
|
|
533
|
+
if (t > 127) break;
|
|
534
|
+
a[i + o] = t;
|
|
535
|
+
}
|
|
536
|
+
if (o !== r) {
|
|
537
|
+
o !== 0 && (e = e.slice(o)), i = n(i, r, r = o + e.length * 3, 1) >>> 0;
|
|
538
|
+
let t = R().subarray(i + o, i + r), a = q.encodeInto(e, t);
|
|
539
|
+
o += a.written, i = n(i, r, o, 1) >>> 0;
|
|
540
|
+
}
|
|
541
|
+
return J = o, i;
|
|
542
|
+
}
|
|
543
|
+
function H(e) {
|
|
544
|
+
let t = Y.__wbindgen_externrefs.get(e);
|
|
545
|
+
return Y.__externref_table_dealloc(e), t;
|
|
546
|
+
}
|
|
547
|
+
var U = new TextDecoder("utf-8", {
|
|
548
|
+
ignoreBOM: !0,
|
|
549
|
+
fatal: !0
|
|
550
|
+
});
|
|
551
|
+
U.decode();
|
|
552
|
+
var W = 2146435072, G = 0;
|
|
553
|
+
function K(e, t) {
|
|
554
|
+
return G += t, G >= W && (U = new TextDecoder("utf-8", {
|
|
555
|
+
ignoreBOM: !0,
|
|
556
|
+
fatal: !0
|
|
557
|
+
}), U.decode(), G = t), U.decode(R().subarray(e, e + t));
|
|
558
|
+
}
|
|
559
|
+
var q = new TextEncoder();
|
|
560
|
+
"encodeInto" in q || (q.encodeInto = function(e, t) {
|
|
561
|
+
let n = q.encode(e);
|
|
562
|
+
return t.set(n), {
|
|
563
|
+
read: e.length,
|
|
564
|
+
written: n.length
|
|
565
|
+
};
|
|
566
|
+
});
|
|
567
|
+
var J = 0, Y;
|
|
568
|
+
function X(e, t) {
|
|
569
|
+
return Y = e.exports, P = null, L = null, Y.__wbindgen_start(), Y;
|
|
570
|
+
}
|
|
571
|
+
async function Z(e, t) {
|
|
572
|
+
if (typeof Response == "function" && e instanceof Response) {
|
|
573
|
+
if (typeof WebAssembly.instantiateStreaming == "function") try {
|
|
574
|
+
return await WebAssembly.instantiateStreaming(e, t);
|
|
575
|
+
} catch (t) {
|
|
576
|
+
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);
|
|
577
|
+
else throw t;
|
|
578
|
+
}
|
|
579
|
+
let r = await e.arrayBuffer();
|
|
580
|
+
return await WebAssembly.instantiate(r, t);
|
|
581
|
+
} else {
|
|
582
|
+
let n = await WebAssembly.instantiate(e, t);
|
|
583
|
+
return n instanceof WebAssembly.Instance ? {
|
|
584
|
+
instance: n,
|
|
585
|
+
module: e
|
|
586
|
+
} : n;
|
|
587
|
+
}
|
|
588
|
+
function n(e) {
|
|
589
|
+
switch (e) {
|
|
590
|
+
case "basic":
|
|
591
|
+
case "cors":
|
|
592
|
+
case "default": return !0;
|
|
593
|
+
}
|
|
594
|
+
return !1;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
function ie(e) {
|
|
598
|
+
if (Y !== void 0) return Y;
|
|
599
|
+
e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module: e} = e : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
|
|
600
|
+
let t = j();
|
|
601
|
+
return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), X(new WebAssembly.Instance(e, t), e);
|
|
602
|
+
}
|
|
603
|
+
async function Q(e) {
|
|
604
|
+
if (Y !== void 0) return Y;
|
|
605
|
+
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"));
|
|
606
|
+
let t = j();
|
|
607
|
+
(typeof e == "string" || typeof Request == "function" && e instanceof Request || typeof URL == "function" && e instanceof URL) && (e = fetch(e));
|
|
608
|
+
let { instance: n, module: r } = await Z(await e, t);
|
|
609
|
+
return X(n, r);
|
|
610
|
+
}
|
|
611
|
+
async function ae(e) {
|
|
612
|
+
return Y = void 0, P = null, L = null, Q(e);
|
|
613
|
+
}
|
|
614
|
+
//#endregion
|
|
615
|
+
//#region packages/pptx/src/internal/node-acquisition.ts
|
|
616
|
+
var $ = "PPTX presentation session was aborted", oe = b(O, "PPTX");
|
|
617
|
+
async function se(e, n, r = {}) {
|
|
618
|
+
let i = o(r), a = new u({
|
|
619
|
+
enabled: i.debug || i.onResourceMetrics !== void 0,
|
|
620
|
+
format: "pptx",
|
|
621
|
+
mode: "node",
|
|
622
|
+
scope: "session",
|
|
623
|
+
policy: i.policy,
|
|
624
|
+
onMetrics: i.onResourceMetrics,
|
|
625
|
+
emitToConsole: i.debug
|
|
626
|
+
});
|
|
627
|
+
a.setSourceBytes(e.byteLength);
|
|
628
|
+
let c;
|
|
629
|
+
try {
|
|
630
|
+
_(r.signal, $);
|
|
631
|
+
let [o, s, u] = l(i.policy), d = k;
|
|
632
|
+
c = await oe(n).open(() => new d(e, o, s, u), {
|
|
633
|
+
signal: r.signal,
|
|
634
|
+
abortError: () => v($),
|
|
635
|
+
disposeOnAbort: (e) => e.free()
|
|
636
|
+
}), _(r.signal, $);
|
|
637
|
+
let f = c.proxy, p = t(JSON.parse(new TextDecoder().decode(f.presentation_bootstrap())));
|
|
638
|
+
return a.checkpoint("presentation bootstrap ready"), {
|
|
639
|
+
archive: f,
|
|
640
|
+
bootstrap: p,
|
|
641
|
+
metrics: a,
|
|
642
|
+
closeArchive: () => c?.close((e) => e.free())
|
|
643
|
+
};
|
|
644
|
+
} catch (e) {
|
|
645
|
+
try {
|
|
646
|
+
c?.close((e) => e.free());
|
|
647
|
+
} catch {}
|
|
648
|
+
let t = s(e) ?? e;
|
|
649
|
+
throw a.fail(t), t;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region packages/pptx/src/internal/session.ts
|
|
654
|
+
var ce = /* @__PURE__ */ e({ renderSlide: () => n });
|
|
655
|
+
//#endregion
|
|
656
|
+
export { x as i, se as n, T as r, ce as t };
|