@silurus/ooxml 0.82.1 → 0.83.1

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.
Files changed (42) hide show
  1. package/README.md +74 -5
  2. package/dist/assets/render-worker-4GSYWsM3.js +11 -0
  3. package/dist/assets/{render-worker-Cy-QsDge.js → render-worker-DwFpY197.js} +4 -4
  4. package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
  5. package/dist/{comment-ui-runtime-C1RV_3iu.js → comment-ui-runtime-BelHJt73.js} +2 -2
  6. package/dist/{comment-ui-runtime-DgCZpPR0.js → comment-ui-runtime-DD5a3x3k.js} +2 -2
  7. package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
  8. package/dist/{document-pull-client-B1WOjA0z.js → document-pull-client-DSx36ZsB.js} +4519 -3952
  9. package/dist/docx-BF-WKW73.js +2784 -0
  10. package/dist/docx.mjs +6 -6
  11. package/dist/docx_parser_bg.wasm +0 -0
  12. package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
  13. package/dist/index.mjs +4 -4
  14. package/dist/line-distribute-D7A_wnJg.js +1003 -0
  15. package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
  16. package/dist/node.mjs +308 -308
  17. package/dist/pptx-CA-Q09yW.js +3010 -0
  18. package/dist/pptx.mjs +5 -5
  19. package/dist/pptx_parser_bg.wasm +0 -0
  20. package/dist/{render-BC8p7vZQ.js → render-DtbFbO5c.js} +1 -1
  21. package/dist/{render-worker-host-BNnXCtAu.js → render-worker-host-D1jcACJV.js} +1 -1
  22. package/dist/{render-worker-host-DhnkTyjj.js → render-worker-host-DCLyw6UR.js} +1 -1
  23. package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
  24. package/dist/{session-Da7LEQUB.js → session-CxT-t0BX.js} +107 -94
  25. package/dist/{slide-pull-client-Bg9DusLX.js → slide-pull-client-B9rcJdO4.js} +1190 -937
  26. package/dist/types/docx.d.ts +103 -8
  27. package/dist/types/index.d.ts +195 -13
  28. package/dist/types/node.d.ts +2 -2
  29. package/dist/types/pptx.d.ts +100 -5
  30. package/dist/types/xlsx.d.ts +2 -2
  31. package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
  32. package/dist/{xlsx-DMWeXT-c.js → xlsx-BibrHQ52.js} +476 -476
  33. package/dist/xlsx.mjs +5 -5
  34. package/dist/xlsx_parser_bg.wasm +0 -0
  35. package/package.json +3 -1
  36. package/dist/assets/render-worker-aHayzR7v.js +0 -11
  37. package/dist/docx-HoZXZUPA.js +0 -2162
  38. package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
  39. package/dist/line-distribute-iXsUCIH-.js +0 -1003
  40. package/dist/pptx-DEUP4Yq5.js +0 -2432
  41. /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
  42. /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
package/dist/pptx.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { c as e } from "./slide-pull-client-Bg9DusLX.js";
2
- import { Jt as t, Yt as n, a as r } from "./line-metrics-B3syvDn2.js";
3
- import { w as i } from "./canvas-viewer-mechanics-CS_qbr6T.js";
1
+ import { u as e } from "./slide-pull-client-B9rcJdO4.js";
2
+ import { Qt as t, Zt as n, a as r } from "./line-metrics-Bpn7OeZD.js";
3
+ import { w as i } from "./canvas-viewer-mechanics-h07vpVOQ.js";
4
4
  import { cn as a, ln as o } from "./plot-area-frame-DHV02PJU.js";
5
- import { a as s, i as c, n as l, o as u, r as d, s as f } from "./pptx-DEUP4Yq5.js";
6
- export { a as OoxmlDecodedImageLimitError, t as OoxmlError, n as OoxmlResourceLimitError, s as PptxPresentation, l as PptxScrollViewer, d as PptxViewer, i as autoResize, u as buildPptxHighlightLayer, f as buildPptxTextLayer, o as isOoxmlDecodedImageLimitError, r as openExternalHyperlink, c as readPptxTextSelectionContext, e as renderSlide };
5
+ import { a as s, i as c, n as l, o as u, r as d, s as f } from "./pptx-CA-Q09yW.js";
6
+ export { a as OoxmlDecodedImageLimitError, n as OoxmlError, t as OoxmlResourceLimitError, s as PptxPresentation, l as PptxScrollViewer, d as PptxViewer, i as autoResize, u as buildPptxHighlightLayer, f as buildPptxTextLayer, o as isOoxmlDecodedImageLimitError, r as openExternalHyperlink, c as readPptxTextSelectionContext, e as renderSlide };
Binary file
@@ -43,7 +43,7 @@ function a(e, t) {
43
43
  return n = o.then(() => void 0, () => void 0), o;
44
44
  }
45
45
  async function o(e, t, n, r = {}) {
46
- let { renderSlide: i } = await import("./session-Da7LEQUB.js").then((e) => e.t), o = t.slides[n];
46
+ let { renderSlide: i } = await import("./session-CxT-t0BX.js").then((e) => e.t), o = t.slides[n];
47
47
  if (!o) throw Error(`Slide index ${n} out of range`);
48
48
  let s = r.width ?? 960, c = r.dpr ?? 2, l = r.fetchImage ?? (async () => new Blob([])), u = async () => {
49
49
  await i(e, o, t.slideWidth, t.slideHeight, {
@@ -1,5 +1,5 @@
1
1
  //#region packages/pptx/src/render-worker.ts?worker&url
2
- var e = "" + new URL("assets/render-worker-aHayzR7v.js", import.meta.url).href;
2
+ var e = "" + new URL("assets/render-worker-4GSYWsM3.js", import.meta.url).href;
3
3
  //#endregion
4
4
  //#region packages/pptx/src/render-worker-host.ts
5
5
  function t() {
@@ -1,5 +1,5 @@
1
1
  //#region packages/docx/src/render-worker.ts?worker&url
2
- var e = "" + new URL("assets/render-worker-Cy-QsDge.js", import.meta.url).href;
2
+ var e = "" + new URL("assets/render-worker-DwFpY197.js", import.meta.url).href;
3
3
  //#endregion
4
4
  //#region packages/docx/src/render-worker-host.ts
5
5
  function t() {
@@ -1,4 +1,4 @@
1
- import { Dt as e, bt as t, kt as n } from "./line-metrics-B3syvDn2.js";
1
+ import { ht as e, ot as t, pt as n } from "./line-metrics-Bpn7OeZD.js";
2
2
  import { rn as r } from "./plot-area-frame-DHV02PJU.js";
3
3
  //#region packages/core/src/image/duotone-bitmap-by-path.ts
4
4
  function i(e, t) {
@@ -6,8 +6,8 @@ function i(e, t) {
6
6
  }
7
7
  var a = "duotone";
8
8
  async function o(o, s, c, l, u = {}) {
9
- let { offscreenFactory: d, failClosedOnDuotoneFailure: f = !1, ...p } = u, m = await e(o, s, l, p);
10
- return !c || !m ? m : n(a, `${i(o, c)}${f ? "|strict" : ""}`, l, async () => {
9
+ let { offscreenFactory: d, failClosedOnDuotoneFailure: f = !1, ...p } = u, m = await n(o, s, l, p);
10
+ return !c || !m ? m : e(a, `${i(o, c)}${f ? "|strict" : ""}`, l, async () => {
11
11
  let { w: e, h: n } = r(m);
12
12
  if (e <= 0 || n <= 0) return {
13
13
  bitmap: f ? null : m,
@@ -1,22 +1,22 @@
1
1
  import { t as e } from "./chunk-DmhlhrBa.js";
2
- import { c as t, i as n } from "./slide-pull-client-Bg9DusLX.js";
3
- import { B as r, F as i, H as a, I as o, K as s, P as c, R as l, Yt as u, at as d, dt as f, ft as p, it as m, lt as h, ot as g, rt as _, st as v, ut as y } from "./line-metrics-B3syvDn2.js";
4
- import { t as b } from "./transfer-R6NjgBKD.js";
2
+ import { a as t, u as n } from "./slide-pull-client-B9rcJdO4.js";
3
+ import { B as r, Bt as i, F as a, G as o, H as s, I as c, K as l, P as u, Q as d, Qt as f, R as p, U as ee, W as m, X as h, Y as g, Z as _, q as v } from "./line-metrics-Bpn7OeZD.js";
4
+ import { t as y } from "./transfer-R6NjgBKD.js";
5
5
  //#region packages/pptx/src/slide-cursor-operation.ts
6
- function x(e) {
6
+ function b(e) {
7
7
  try {
8
- return _(e((e) => e.slide_cursor_resource_usage()));
8
+ return ee(e((e) => e.slide_cursor_resource_usage()));
9
9
  } catch (e) {
10
10
  if (String(e).includes("slide cursor usage is unavailable")) return;
11
11
  throw e;
12
12
  }
13
13
  }
14
- function ee(e, t, n, r, i) {
14
+ function x(e, t, n, r, i) {
15
15
  let a, o;
16
16
  try {
17
17
  if (i) {
18
18
  if (!r) throw Error("slide payload is missing before acknowledgement");
19
- let t = i(n, r, x(e));
19
+ let t = i(n, r, b(e));
20
20
  typeof t == "function" ? a = t : t && ({rollback: a, commit: o} = t);
21
21
  }
22
22
  e((e) => e.acknowledge_slide(t.operationId, t.generation)), o?.();
@@ -29,8 +29,8 @@ function ee(e, t, n, r, i) {
29
29
  }
30
30
  //#endregion
31
31
  //#region packages/pptx/src/slide-pull-worker.ts
32
- var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
33
- coordinatorGeneration = new o();
32
+ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
33
+ coordinatorGeneration = new c();
34
34
  sessions = /* @__PURE__ */ new Map();
35
35
  pendingOpens = /* @__PURE__ */ new Map();
36
36
  operationTail = Promise.resolve();
@@ -45,7 +45,7 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
45
45
  return this.coordinatorGeneration;
46
46
  }
47
47
  reserveOpen(e) {
48
- if (this.assertReady(), re(e), this.pendingOpens.has(e.sessionId) || this.sessions.has(e.sessionId)) throw Error("slide pull session id is already reserved");
48
+ if (this.assertReady(), ie(e), this.pendingOpens.has(e.sessionId) || this.sessions.has(e.sessionId)) throw Error("slide pull session id is already reserved");
49
49
  this.pendingOpens.set(e.sessionId, {
50
50
  identity: e,
51
51
  canceled: !1
@@ -61,14 +61,14 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
61
61
  if (this.assertReady(), this.resourceFailure) throw this.resourceFailure;
62
62
  if (!Number.isSafeInteger(e) || e < 0) throw RangeError("slide index must be a non-negative safe integer");
63
63
  let n = this.pendingOpens.get(t.sessionId);
64
- if (!n || !C(n.identity, t)) throw Error("slide pull session open reservation is stale or missing");
65
- let r, a = new Promise((e) => {
64
+ if (!n || !S(n.identity, t)) throw Error("slide pull session open reservation is stale or missing");
65
+ let r, o = new Promise((e) => {
66
66
  r = e;
67
- }), o = this.operationTail.then(() => this.coordinator.enqueue(async () => {
67
+ }), s = this.operationTail.then(() => this.coordinator.enqueue(async () => {
68
68
  if (n.canceled) throw Error("slide pull session open was canceled");
69
- let a, o = !1, c = new i({
69
+ let o, s = !1, c = new a({
70
70
  ...t,
71
- maxByteCredit: s,
71
+ maxByteCredit: i,
72
72
  coordinator: this.coordinator,
73
73
  driver: {
74
74
  pull: (n) => {
@@ -76,38 +76,38 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
76
76
  try {
77
77
  r = this.executeArchive((r) => r.pull_slide(e, t.operationId, t.generation, n));
78
78
  } catch (e) {
79
- throw v(e, n, s) || (this.latchResourceFailure(e), e);
79
+ throw v(e, n, i) || (this.latchResourceFailure(e), e);
80
80
  }
81
- let i = b(r);
82
- return this.acceptSlide && (a = JSON.parse(new TextDecoder().decode(new Uint8Array(i)))), o = !0, {
83
- payload: i,
84
- byteLength: i.byteLength,
81
+ let a = y(r);
82
+ return this.acceptSlide && (o = JSON.parse(new TextDecoder().decode(new Uint8Array(a)))), s = !0, {
83
+ payload: a,
84
+ byteLength: a.byteLength,
85
85
  done: !0,
86
- transfer: [i]
86
+ transfer: [a]
87
87
  };
88
88
  },
89
89
  measureChunk: ({ payload: e }) => e.byteLength,
90
90
  acknowledge: () => {
91
- if (!o) throw Error("slide unit is not awaiting acknowledgement");
91
+ if (!s) throw Error("slide unit is not awaiting acknowledgement");
92
92
  try {
93
- ee(this.executeArchive, t, e, a, this.acceptSlide);
93
+ x(this.executeArchive, t, e, o, this.acceptSlide);
94
94
  } catch (e) {
95
95
  throw this.latchResourceFailure(e), e;
96
96
  }
97
- o = !1, a = void 0, this.sessions.delete(t.sessionId), r();
97
+ s = !1, o = void 0, this.sessions.delete(t.sessionId), r();
98
98
  },
99
99
  cancel: async () => {
100
100
  try {
101
101
  this.archive() && await this.executeArchive((e) => e.cancel_slide());
102
102
  } finally {
103
- a = void 0, o = !1, this.sessions.delete(t.sessionId), r();
103
+ o = void 0, s = !1, this.sessions.delete(t.sessionId), r();
104
104
  }
105
105
  },
106
106
  close: async () => {
107
107
  try {
108
108
  this.archive() && await this.executeArchive((e) => e.cancel_slide());
109
109
  } finally {
110
- a = void 0, o = !1, this.sessions.delete(t.sessionId), r();
110
+ o = void 0, s = !1, this.sessions.delete(t.sessionId), r();
111
111
  }
112
112
  },
113
113
  resourceUsage: () => {
@@ -124,9 +124,9 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
124
124
  identity: t
125
125
  }), this.pendingOpens.delete(t.sessionId);
126
126
  }));
127
- this.operationTail = o.then(() => a, () => void 0);
127
+ this.operationTail = s.then(() => o, () => void 0);
128
128
  try {
129
- await o;
129
+ await s;
130
130
  } catch (e) {
131
131
  throw this.pendingOpens.delete(t.sessionId), r(), e;
132
132
  }
@@ -153,9 +153,9 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
153
153
  if (n) return n.host.dispatch(e, t);
154
154
  let r = this.pendingOpens.get(e.sessionId);
155
155
  if (r && (e.kind === "cancel" || e.kind === "close")) {
156
- let n = C(r.identity, e);
156
+ let n = S(r.identity, e);
157
157
  return n && (r.canceled = !0), t(n ? {
158
- protocol: c,
158
+ protocol: u,
159
159
  kind: "accepted",
160
160
  sessionId: e.sessionId,
161
161
  operationId: e.operationId,
@@ -165,7 +165,7 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
165
165
  } : this.staleLifecycleResponse(e)), Promise.resolve();
166
166
  }
167
167
  return e.kind === "cancel" || e.kind === "close" ? (t({
168
- protocol: c,
168
+ protocol: u,
169
169
  kind: "accepted",
170
170
  sessionId: e.sessionId,
171
171
  operationId: e.operationId,
@@ -173,13 +173,13 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
173
173
  requestId: e.requestId,
174
174
  command: e.kind
175
175
  }), Promise.resolve()) : (t({
176
- protocol: c,
176
+ protocol: u,
177
177
  kind: "error",
178
178
  sessionId: e.sessionId,
179
179
  operationId: e.operationId,
180
180
  generation: e.generation,
181
181
  requestId: e.requestId,
182
- error: g(/* @__PURE__ */ Error("slide pull session is not open"))
182
+ error: l(/* @__PURE__ */ Error("slide pull session is not open"))
183
183
  }), Promise.resolve());
184
184
  }
185
185
  async dispatchSafely(e, t) {
@@ -188,13 +188,13 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
188
188
  } catch (n) {
189
189
  try {
190
190
  t({
191
- protocol: c,
191
+ protocol: u,
192
192
  kind: "error",
193
193
  sessionId: e.sessionId,
194
194
  operationId: e.operationId,
195
195
  generation: e.generation,
196
196
  requestId: e.requestId,
197
- error: g(n)
197
+ error: l(n)
198
198
  });
199
199
  } catch {}
200
200
  }
@@ -227,7 +227,7 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
227
227
  for (let { host: t, identity: n } of [...this.sessions.values()]) {
228
228
  let r;
229
229
  if (await t.dispatch({
230
- protocol: c,
230
+ protocol: u,
231
231
  kind: "close",
232
232
  ...n,
233
233
  requestId: e++
@@ -235,14 +235,14 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
235
235
  e.kind === "error" && (r = m(e.error));
236
236
  }), r) throw r;
237
237
  }
238
- this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.archive() && await this.executeArchive((e) => e.close_presentation_session()), this.coordinatorGeneration = new o(), this.resourceFailure = void 0;
238
+ this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.archive() && await this.executeArchive((e) => e.close_presentation_session()), this.coordinatorGeneration = new c(), this.resourceFailure = void 0;
239
239
  }
240
240
  assertReady() {
241
241
  if (this.lifecycleState !== "ready") throw this.lifecycleError();
242
242
  }
243
243
  lifecycleError() {
244
244
  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");
245
- return t.name = "PullSessionLifecycleError", Object.assign(t, { code: e ? S : te });
245
+ return t.name = "PullSessionLifecycleError", Object.assign(t, { code: e ? ne : te });
246
246
  }
247
247
  captureResetIdentities() {
248
248
  for (let { identity: e } of this.sessions.values()) this.resetIdentities.set(e.sessionId, e);
@@ -251,8 +251,8 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
251
251
  responseDuringReset(e) {
252
252
  if (e.kind === "cancel" || e.kind === "close") {
253
253
  let t = this.resetIdentities.get(e.sessionId);
254
- return t && !C(t, e) ? this.staleLifecycleResponse(e) : {
255
- protocol: c,
254
+ return t && !S(t, e) ? this.staleLifecycleResponse(e) : {
255
+ protocol: u,
256
256
  kind: "accepted",
257
257
  sessionId: e.sessionId,
258
258
  operationId: e.operationId,
@@ -262,13 +262,13 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
262
262
  };
263
263
  }
264
264
  return {
265
- protocol: c,
265
+ protocol: u,
266
266
  kind: "error",
267
267
  sessionId: e.sessionId,
268
268
  operationId: e.operationId,
269
269
  generation: e.generation,
270
270
  requestId: e.requestId,
271
- error: g(this.lifecycleError())
271
+ error: l(this.lifecycleError())
272
272
  };
273
273
  }
274
274
  requireArchive() {
@@ -281,7 +281,7 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
281
281
  let t = this.sessions.get(e.sessionId);
282
282
  if (t) {
283
283
  await t.host.dispatch({
284
- protocol: c,
284
+ protocol: u,
285
285
  kind: "close",
286
286
  ...e,
287
287
  requestId: 1
@@ -289,18 +289,18 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
289
289
  return;
290
290
  }
291
291
  let n = this.pendingOpens.get(e.sessionId);
292
- n && C(n.identity, e) && (n.canceled = !0);
292
+ n && S(n.identity, e) && (n.canceled = !0);
293
293
  }
294
294
  readResourceUsage() {
295
- return x(this.executeArchive);
295
+ return b(this.executeArchive);
296
296
  }
297
297
  latchResourceFailure(e) {
298
- let t = e instanceof u ? e : d(e);
298
+ let t = e instanceof f ? e : o(e);
299
299
  t && (this.resourceFailure ??= t);
300
300
  }
301
301
  staleLifecycleResponse(e) {
302
302
  return {
303
- protocol: c,
303
+ protocol: u,
304
304
  kind: "error",
305
305
  sessionId: e.sessionId,
306
306
  operationId: e.operationId,
@@ -314,24 +314,24 @@ var te = "ooxml-pull-resetting", S = "ooxml-pull-reset-failed", ne = class {
314
314
  };
315
315
  }
316
316
  };
317
- function re(e) {
317
+ function ie(e) {
318
318
  if (!Number.isSafeInteger(e.sessionId) || e.sessionId <= 0) throw RangeError("session id must be a positive safe integer");
319
319
  if (!Number.isSafeInteger(e.operationId) || e.operationId <= 0) throw RangeError("operation id must be a positive safe integer");
320
320
  if (!Number.isSafeInteger(e.generation) || e.generation <= 0) throw RangeError("generation must be a positive safe integer");
321
321
  }
322
- function C(e, t) {
322
+ function S(e, t) {
323
323
  return e.sessionId === t.sessionId && e.operationId === t.operationId && e.generation === t.generation;
324
324
  }
325
325
  //#endregion
326
326
  //#region packages/core/src/internal/wasm-runtime-generation.ts
327
- function ie(e) {
328
- return f(e) ? new h(`WASM parser trapped and was recycled: ${e instanceof Error ? e.message : String(e)}`) : null;
327
+ function C(e) {
328
+ return _(e) ? new g(`WASM parser trapped and was recycled: ${e instanceof Error ? e.message : String(e)}`) : null;
329
329
  }
330
330
  var w = class {
331
331
  realm;
332
332
  live = /* @__PURE__ */ new Set();
333
333
  constructor(e, t) {
334
- this.realm = new p(() => e.initSync({ module: t }), () => e.reinit({ module_or_path: t }), ie), this.realm.onPoison((e) => {
334
+ this.realm = new d(() => e.initSync({ module: t }), () => e.reinit({ module_or_path: t }), C), this.realm.onPoison((e) => {
335
335
  for (let t of this.live) t.poison(e);
336
336
  this.live.clear();
337
337
  });
@@ -341,7 +341,7 @@ var w = class {
341
341
  this.throwIfOpenAborted(t), await this.awaitReadyOrAbort(t), this.throwIfOpenAborted(t);
342
342
  let n = this.realm.tryRunReady(e);
343
343
  if (!n.current) continue;
344
- let r = new ae(this, n.value, n.generation);
344
+ let r = new T(this, n.value, n.generation);
345
345
  if (this.live.add(r), t?.signal?.aborted) throw r.close(t.disposeOnAbort), t.abortError?.() ?? new DOMException("The operation was aborted", "AbortError");
346
346
  return r;
347
347
  }
@@ -373,7 +373,7 @@ var w = class {
373
373
  let n = e.detachForClose();
374
374
  this.live.delete(e), n && this.realm.run(() => t(n));
375
375
  }
376
- }, ae = class {
376
+ }, T = class {
377
377
  archive;
378
378
  failure;
379
379
  proxy;
@@ -403,18 +403,19 @@ var w = class {
403
403
  }
404
404
  poison(e) {
405
405
  let t = this.archive;
406
- this.failure = e, this.archive = void 0, y(t);
406
+ this.failure = e, this.archive = void 0, h(t);
407
407
  }
408
- }, oe = /* @__PURE__ */ e({
409
- PptxArchive: () => T,
408
+ }, E = /* @__PURE__ */ e({
409
+ PptxArchive: () => D,
410
410
  default: () => Y,
411
- extract_image: () => se,
412
- extract_media: () => E,
413
- initSync: () => le,
414
- parse_pptx: () => D,
415
- pptx_to_markdown: () => O,
416
- reinit: () => ue
417
- }), T = class {
411
+ extract_font: () => ae,
412
+ extract_image: () => oe,
413
+ extract_media: () => se,
414
+ initSync: () => ue,
415
+ parse_pptx: () => O,
416
+ pptx_to_markdown: () => ce,
417
+ reinit: () => de
418
+ }), D = class {
418
419
  __destroy_into_raw() {
419
420
  let e = this.__wbg_ptr;
420
421
  return this.__wbg_ptr = 0, A.unregister(this), e;
@@ -437,6 +438,12 @@ var w = class {
437
438
  close_presentation_session() {
438
439
  q.pptxarchive_close_presentation_session(this.__wbg_ptr);
439
440
  }
441
+ extract_font(e) {
442
+ let t = z(e, q.__wbindgen_malloc, q.__wbindgen_realloc), n = K, r = q.pptxarchive_extract_font(this.__wbg_ptr, t, n);
443
+ if (r[3]) throw B(r[2]);
444
+ var i = j(r[0], r[1]).slice();
445
+ return q.__wbindgen_free(r[0], r[1] * 1, 1), i;
446
+ }
440
447
  extract_image(e) {
441
448
  let t = z(e, q.__wbindgen_malloc, q.__wbindgen_realloc), n = K, r = q.pptxarchive_extract_image(this.__wbg_ptr, t, n);
442
449
  if (r[3]) throw B(r[2]);
@@ -496,26 +503,32 @@ var w = class {
496
503
  }
497
504
  }
498
505
  };
499
- Symbol.dispose && (T.prototype[Symbol.dispose] = T.prototype.free);
500
- function se(e, t, n, r) {
506
+ Symbol.dispose && (D.prototype[Symbol.dispose] = D.prototype.free);
507
+ function ae(e, t, n, r) {
508
+ let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_font(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
509
+ if (c[3]) throw B(c[2]);
510
+ var l = j(c[0], c[1]).slice();
511
+ return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
512
+ }
513
+ function oe(e, t, n, r) {
501
514
  let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_image(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
502
515
  if (c[3]) throw B(c[2]);
503
516
  var l = j(c[0], c[1]).slice();
504
517
  return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
505
518
  }
506
- function E(e, t, n, r) {
519
+ function se(e, t, n, r) {
507
520
  let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_media(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
508
521
  if (c[3]) throw B(c[2]);
509
522
  var l = j(c[0], c[1]).slice();
510
523
  return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
511
524
  }
512
- function D(e, t, n) {
525
+ function O(e, t, n) {
513
526
  let r = R(e, q.__wbindgen_malloc), i = K, a = q.parse_pptx(r, i, !L(t), L(t) ? BigInt(0) : t, !L(n), L(n) ? BigInt(0) : n);
514
527
  if (a[3]) throw B(a[2]);
515
528
  var o = j(a[0], a[1]).slice();
516
529
  return q.__wbindgen_free(a[0], a[1] * 1, 1), o;
517
530
  }
518
- function O(e, t, n) {
531
+ function ce(e, t, n) {
519
532
  let r, i;
520
533
  try {
521
534
  let s = R(e, q.__wbindgen_malloc), c = K, l = q.pptx_to_markdown(s, c, !L(t), L(t) ? BigInt(0) : t, !L(n), L(n) ? BigInt(0) : n);
@@ -630,7 +643,7 @@ var K = 0, q;
630
643
  function J(e, t) {
631
644
  return q = e.exports, M = null, F = null, q.__wbindgen_start(), q;
632
645
  }
633
- async function ce(e, t) {
646
+ async function le(e, t) {
634
647
  if (typeof Response == "function" && e instanceof Response) {
635
648
  if (typeof WebAssembly.instantiateStreaming == "function") try {
636
649
  return await WebAssembly.instantiateStreaming(e, t);
@@ -656,7 +669,7 @@ async function ce(e, t) {
656
669
  return !1;
657
670
  }
658
671
  }
659
- function le(e) {
672
+ function ue(e) {
660
673
  if (q !== void 0) return q;
661
674
  e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module: e} = e : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
662
675
  let t = k();
@@ -667,53 +680,53 @@ async function Y(e) {
667
680
  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"));
668
681
  let t = k();
669
682
  (typeof e == "string" || typeof Request == "function" && e instanceof Request || typeof URL == "function" && e instanceof URL) && (e = fetch(e));
670
- let { instance: n, module: r } = await ce(await e, t);
683
+ let { instance: n, module: r } = await le(await e, t);
671
684
  return J(n, r);
672
685
  }
673
- async function ue(e) {
686
+ async function de(e) {
674
687
  return q = void 0, M = null, F = null, Y(e);
675
688
  }
676
689
  //#endregion
677
690
  //#region packages/pptx/src/internal/node-acquisition.ts
678
691
  var X, Z;
679
- function de(e) {
680
- if (!Z) X = e, Z = new w(oe, e);
692
+ function fe(e) {
693
+ if (!Z) X = e, Z = new w(E, e);
681
694
  else if (X !== e) throw Error("PPTX runtime was already initialized with another WebAssembly.Module");
682
695
  return Z;
683
696
  }
684
- async function fe(e, t, i = {}) {
685
- let o = r(i), s = new l({
686
- enabled: o.debug || o.onResourceMetrics !== void 0,
697
+ async function pe(e, n, i = {}) {
698
+ let a = r(i), c = new p({
699
+ enabled: a.debug || a.onResourceMetrics !== void 0,
687
700
  format: "pptx",
688
701
  mode: "node",
689
702
  scope: "session",
690
- policy: o.policy,
691
- onMetrics: o.onResourceMetrics,
692
- emitToConsole: o.debug
703
+ policy: a.policy,
704
+ onMetrics: a.onResourceMetrics,
705
+ emitToConsole: a.debug
693
706
  });
694
- s.setSourceBytes(e.byteLength);
695
- let c;
707
+ c.setSourceBytes(e.byteLength);
708
+ let l;
696
709
  try {
697
710
  Q(i.signal);
698
- let [r, l, u] = a(o.policy), d = T;
699
- c = await de(t).open(() => new d(e, r, l, u), {
711
+ let [r, o, u] = s(a.policy), d = D;
712
+ l = await fe(n).open(() => new d(e, r, o, u), {
700
713
  signal: i.signal,
701
714
  abortError: $,
702
715
  disposeOnAbort: (e) => e.free()
703
716
  }), Q(i.signal);
704
- let f = c.proxy, p = n(JSON.parse(new TextDecoder().decode(f.presentation_bootstrap())));
705
- return s.checkpoint("presentation bootstrap ready"), {
717
+ let f = l.proxy, p = t(JSON.parse(new TextDecoder().decode(f.presentation_bootstrap())));
718
+ return c.checkpoint("presentation bootstrap ready"), {
706
719
  archive: f,
707
720
  bootstrap: p,
708
- metrics: s,
709
- closeArchive: () => c?.close((e) => e.free())
721
+ metrics: c,
722
+ closeArchive: () => l?.close((e) => e.free())
710
723
  };
711
724
  } catch (e) {
712
725
  try {
713
- c?.close((e) => e.free());
726
+ l?.close((e) => e.free());
714
727
  } catch {}
715
- let t = d(e) ?? e;
716
- throw s.fail(t), t;
728
+ let t = o(e) ?? e;
729
+ throw c.fail(t), t;
717
730
  }
718
731
  }
719
732
  function Q(e) {
@@ -725,6 +738,6 @@ function $() {
725
738
  }
726
739
  //#endregion
727
740
  //#region packages/pptx/src/internal/session.ts
728
- var pe = /* @__PURE__ */ e({ renderSlide: () => t });
741
+ var me = /* @__PURE__ */ e({ renderSlide: () => n });
729
742
  //#endregion
730
- export { x as a, ne as i, fe as n, w as r, pe as t };
743
+ export { b as a, re as i, pe as n, w as r, me as t };