@silurus/ooxml 0.86.0 → 0.86.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 (36) hide show
  1. package/dist/assets/render-worker-D21h5TGR.js +10 -0
  2. package/dist/assets/render-worker-Dsfekaht.js +11 -0
  3. package/dist/assets/{render-worker-CB4DxjXg.js → render-worker-DxU7IrKo.js} +18 -18
  4. package/dist/bounded-raw-part-cache-BfbSxRIL.js +119 -0
  5. package/dist/{canvas-viewer-mechanics-B3A7KLLi.js → canvas-viewer-mechanics-DN5SqWGS.js} +329 -192
  6. package/dist/{comment-ui-runtime-ssI6IE39.js → comment-ui-runtime-lXwVOgjW.js} +1 -1
  7. package/dist/{document-pull-client-xZrA2IjM.js → document-pull-client-uopDjRde.js} +4501 -4456
  8. package/dist/{docx-DzDiGvqe.js → docx-wPzeF76A.js} +492 -307
  9. package/dist/docx.mjs +6 -6
  10. package/dist/docx_parser_bg.wasm +0 -0
  11. package/dist/{dom-interaction-boundary-DK1JLkrz.js → dom-interaction-boundary-CswB9Tzi.js} +60 -57
  12. package/dist/{hyperlink-enyPbflR.js → hyperlink-BR1NCO7S.js} +934 -885
  13. package/dist/index.mjs +4 -4
  14. package/dist/line-distribute-IsUGfHXm.js +1023 -0
  15. package/dist/node.mjs +272 -272
  16. package/dist/{pptx-D_U62nl-.js → pptx-BxJ_RBSY.js} +169 -161
  17. package/dist/pptx.mjs +5 -5
  18. package/dist/pptx_parser_bg.wasm +0 -0
  19. package/dist/{render-DSn0d35X.js → render-DEiun_AH.js} +1 -1
  20. package/dist/{render-worker-host-CO0UYoQh.js → render-worker-host-BEfLZvSL.js} +1 -1
  21. package/dist/{render-worker-host-CbYDBg7U.js → render-worker-host-Ba6Fchqr.js} +1 -1
  22. package/dist/{render-worker-host-BHz9vjxB.js → render-worker-host-C3xwtHnv.js} +1 -1
  23. package/dist/{resource-measurement-Do07ZRcR.js → resource-measurement-CclArDRs.js} +9 -9
  24. package/dist/{session-C1GYhr6n.js → session-BuJL_xcp.js} +87 -87
  25. package/dist/{slide-pull-client-DuEaUxPw.js → slide-pull-client-Ck8wfRT_.js} +977 -903
  26. package/dist/types/docx.d.ts +1 -2
  27. package/dist/types/index.d.ts +1 -2
  28. package/dist/{worksheet-pull-client-eDiHHEG2.js → worksheet-pull-client-CAvuf22q.js} +78 -78
  29. package/dist/{xlsx-CMHmYTHP.js → xlsx-Bblm5r1h.js} +574 -574
  30. package/dist/xlsx.mjs +5 -5
  31. package/package.json +1 -1
  32. package/dist/assets/render-worker-BCGnuBLj.js +0 -10
  33. package/dist/assets/render-worker-CHW0F0n6.js +0 -11
  34. package/dist/bounded-raw-part-cache-DVx3Camo.js +0 -256
  35. package/dist/line-distribute-BFB575d6.js +0 -1023
  36. /package/dist/{comment-occurrence-Dhdplprg.js → comment-occurrence-CqejEuts.js} +0 -0
package/dist/node.mjs CHANGED
@@ -1,19 +1,19 @@
1
1
  import { t as e } from "./chunk-DmhlhrBa.js";
2
- import { t } from "./slide-pull-client-DuEaUxPw.js";
3
- import { B as n, G as r, Gt as i, I as a, M as o, N as s, P as c, R as l, U as u, V as d, W as f, Wt as p, Xt as m, ct as h, dt as g, sn as _ } from "./hyperlink-enyPbflR.js";
4
- import { t as ee } from "./bounded-raw-part-cache-DVx3Camo.js";
5
- import { a as te, c as ne, i as re, l as ie, r as ae, u as oe } from "./document-pull-client-xZrA2IjM.js";
2
+ import { t } from "./slide-pull-client-Ck8wfRT_.js";
3
+ import { F as n, G as r, Gt as i, H as a, K as o, Kt as s, L as c, N as l, P as u, V as ee, W as d, Zt as f, cn as p, ft as m, lt as h, z as g } from "./hyperlink-BR1NCO7S.js";
4
+ import { a as te, c as ne, i as re, l as ie, r as ae, u as oe } from "./document-pull-client-uopDjRde.js";
6
5
  import { l as se, s as ce } from "./pixel-budget-Dgjw269h.js";
7
6
  import { t as le } from "./transfer-mIj7E7NB.js";
8
- import { c as ue, d as de, f as fe, l as pe, o as me, r as he, s as ge, t as _e, u as ve } from "./worksheet-pull-client-eDiHHEG2.js";
9
- import { a as ye, i as be, n as xe, r as Se } from "./session-C1GYhr6n.js";
10
- import { a as Ce, n as we, r as Te, t as Ee } from "./render-DSn0d35X.js";
11
- import { existsSync as De, readFileSync as Oe } from "node:fs";
12
- import { fileURLToPath as ke } from "node:url";
13
- import { basename as Ae, dirname as je, resolve as Me } from "node:path";
14
- import { createRequire as Ne } from "node:module";
7
+ import { t as ue } from "./bounded-raw-part-cache-BfbSxRIL.js";
8
+ import { c as de, d as fe, f as pe, l as me, o as he, r as ge, s as _e, t as ve, u as ye } from "./worksheet-pull-client-CAvuf22q.js";
9
+ import { a as be, i as xe, n as Se, r as Ce } from "./session-BuJL_xcp.js";
10
+ import { a as we, n as Te, r as Ee, t as De } from "./render-DEiun_AH.js";
11
+ import { existsSync as Oe, readFileSync as ke } from "node:fs";
12
+ import { fileURLToPath as Ae } from "node:url";
13
+ import { basename as je, dirname as Me, resolve as Ne } from "node:path";
14
+ import { createRequire as Pe } from "node:module";
15
15
  //#region packages/core/src/internal/owned-session.ts
16
- async function v(e, t) {
16
+ async function _(e, t) {
17
17
  let n = await e(), r;
18
18
  try {
19
19
  return await t(n);
@@ -29,7 +29,7 @@ async function v(e, t) {
29
29
  }
30
30
  //#endregion
31
31
  //#region packages/core/src/internal/in-process-pull-transport.ts
32
- var y = class {
32
+ var v = class {
33
33
  nextRequestId = 1;
34
34
  terminated = !1;
35
35
  constructor(e, t) {
@@ -55,30 +55,30 @@ var y = class {
55
55
  };
56
56
  //#endregion
57
57
  //#region packages/node/src/wasm-loader.ts
58
- function Pe(e) {
59
- return new WebAssembly.Module(Oe(e));
58
+ function Fe(e) {
59
+ return new WebAssembly.Module(ke(e));
60
60
  }
61
- function b(e, t = Pe) {
61
+ function y(e, t = Fe) {
62
62
  let n = {};
63
63
  return () => n.value ??= t(e());
64
64
  }
65
- function x(e, t, n) {
66
- let r = je(ke(e)), i = Me(r, t);
67
- if (De(i)) return i;
68
- let a = Me(r, Ae(t));
69
- return De(a) || !n ? a : Ne(e).resolve(n);
65
+ function b(e, t, n) {
66
+ let r = Me(Ae(e)), i = Ne(r, t);
67
+ if (Oe(i)) return i;
68
+ let a = Ne(r, je(t));
69
+ return Oe(a) || !n ? a : Pe(e).resolve(n);
70
70
  }
71
71
  //#endregion
72
72
  //#region packages/node/src/pptx.ts
73
- var Fe = b(() => x(import.meta.url, "pptx_parser_bg.wasm", "@silurus/ooxml-pptx/wasm-binary"));
74
- async function Ie(e, t = {}) {
75
- return Le(e, t);
76
- }
73
+ var Ie = y(() => b(import.meta.url, "pptx_parser_bg.wasm", "@silurus/ooxml-pptx/wasm-binary"));
77
74
  async function Le(e, t = {}) {
78
- let n = await xe(Be(e), Fe(), t);
79
- return new Re(n.closeArchive, n.archive, n.bootstrap, n.metrics, t.signal);
75
+ return Re(e, t);
76
+ }
77
+ async function Re(e, t = {}) {
78
+ let n = await Se(Ve(e), Ie(), t);
79
+ return new ze(n.closeArchive, n.archive, n.bootstrap, n.metrics, t.signal);
80
80
  }
81
- var Re = class {
81
+ var ze = class {
82
82
  slideCount;
83
83
  slideWidth;
84
84
  slideHeight;
@@ -94,12 +94,12 @@ var Re = class {
94
94
  renderTail = Promise.resolve();
95
95
  fetchImage = (e, t) => this.getPartInternal(e, t, (t) => t.extract_image(e));
96
96
  fetchMedia = (e) => this.getPartInternal(e, "application/octet-stream", (t) => t.extract_media(e));
97
- rawParts = new ee({
97
+ rawParts = new ue({
98
98
  maxEntries: 64,
99
- maxBytes: m
99
+ maxBytes: f
100
100
  });
101
101
  constructor(e, n, r, i, a) {
102
- this.closeArchive = e, this.archive = n, this.bootstrap = r, this.metrics = i, this.signal = a, this.slideCount = r.slideCount, this.slideWidth = r.slideWidth, this.slideHeight = r.slideHeight, this.slidePull = new be(() => this.archive), this.transport = new y((e, t) => this.slidePull.dispatchSafely(e, t), () => void 0), this.slideClient = new t({
102
+ this.closeArchive = e, this.archive = n, this.bootstrap = r, this.metrics = i, this.signal = a, this.slideCount = r.slideCount, this.slideWidth = r.slideWidth, this.slideHeight = r.slideHeight, this.slidePull = new xe(() => this.archive), this.transport = new v((e, t) => this.slidePull.dispatchSafely(e, t), () => void 0), this.slideClient = new t({
103
103
  slideCount: this.slideCount,
104
104
  transport: this.transport,
105
105
  open: async (e, t) => {
@@ -133,8 +133,8 @@ var Re = class {
133
133
  }
134
134
  async renderSlide(e, t, n) {
135
135
  return this.assertOpen(), this.enqueueRender(async () => {
136
- S(this.signal);
137
- let { renderSlideNode: r } = await import("./render-DSn0d35X.js").then((e) => e.i);
136
+ x(this.signal);
137
+ let { renderSlideNode: r } = await import("./render-DEiun_AH.js").then((e) => e.i);
138
138
  await r(e, {
139
139
  slideWidth: this.slideWidth,
140
140
  slideHeight: this.slideHeight,
@@ -148,7 +148,7 @@ var Re = class {
148
148
  ...n,
149
149
  fetchImage: this.fetchImage,
150
150
  fetchMedia: this.fetchMedia
151
- }), S(this.signal);
151
+ }), x(this.signal);
152
152
  }).catch((e) => this.failOperation(e));
153
153
  }
154
154
  [Symbol.asyncIterator]() {
@@ -161,13 +161,13 @@ var Re = class {
161
161
  let e;
162
162
  try {
163
163
  for (let e = 0; e < this.slideCount; e += 1) {
164
- S(this.signal);
164
+ x(this.signal);
165
165
  let t = await this.slideClient.load(e);
166
166
  if (!t) throw Error(`PPTX slide ${e} was not decoded`);
167
- this.usage ??= await this.slidePull.run(() => ye((e) => e(this.archive))), this.metrics.observeUsage(this.usage), this.consumedSlides = e + 1, yield t;
167
+ this.usage ??= await this.slidePull.run(() => be((e) => e(this.archive))), this.metrics.observeUsage(this.usage), this.consumedSlides = e + 1, yield t;
168
168
  }
169
169
  } catch (t) {
170
- throw e = u(t) ?? t, this.metrics.fail(e), e;
170
+ throw e = d(t) ?? t, this.metrics.fail(e), e;
171
171
  } finally {
172
172
  try {
173
173
  await this.close();
@@ -181,17 +181,17 @@ var Re = class {
181
181
  }
182
182
  async release() {
183
183
  let e;
184
- await this.renderTail, g(this.fetchImage), h(this.fetchImage);
184
+ await this.renderTail, m(this.fetchImage), h(this.fetchImage);
185
185
  try {
186
186
  await this.slidePull.reset();
187
187
  } catch (t) {
188
- e = u(t) ?? t;
188
+ e = d(t) ?? t;
189
189
  }
190
190
  this.transport.terminate(), this.rawParts.clear();
191
191
  try {
192
192
  this.closeArchive();
193
193
  } catch (t) {
194
- e ??= u(t) ?? t;
194
+ e ??= d(t) ?? t;
195
195
  }
196
196
  if (e !== void 0) throw this.metrics.fail(e), e;
197
197
  this.metrics.checkpoint("presentation session closed"), this.metrics.succeed({ slides: this.consumedSlides });
@@ -202,14 +202,14 @@ var Re = class {
202
202
  }
203
203
  getPartInternal(e, t, n) {
204
204
  return this.rawParts.get(e, t, () => {
205
- S(this.signal);
205
+ x(this.signal);
206
206
  let e = n(this.archive);
207
207
  return this.refreshResourceUsage(), new Blob([e], { type: t });
208
208
  });
209
209
  }
210
210
  refreshResourceUsage() {
211
211
  try {
212
- this.usage = d(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
212
+ this.usage = a(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
213
213
  } catch {}
214
214
  return this.usage;
215
215
  }
@@ -218,29 +218,29 @@ var Re = class {
218
218
  if (this.resourceFailure) throw this.resourceFailure;
219
219
  }
220
220
  failOperation(e) {
221
- let t = u(e) ?? e;
222
- throw t instanceof _ && (this.resourceFailure ??= t), this.metrics.fail(t), t;
221
+ let t = d(e) ?? e;
222
+ throw t instanceof p && (this.resourceFailure ??= t), this.metrics.fail(t), t;
223
223
  }
224
224
  };
225
- async function ze(e, t = {}) {
226
- return v(() => Le(e, t), async (e) => {
225
+ async function Be(e, t = {}) {
226
+ return _(() => Re(e, t), async (e) => {
227
227
  let t = [];
228
228
  for await (let n of e.slides()) t.push(n);
229
229
  return e.materialize(t);
230
230
  });
231
231
  }
232
- function Be(e) {
232
+ function Ve(e) {
233
233
  return e instanceof Uint8Array ? e : new Uint8Array(e);
234
234
  }
235
- function S(e) {
235
+ function x(e) {
236
236
  if (!e?.aborted) return;
237
237
  let t = /* @__PURE__ */ Error("PPTX presentation session was aborted");
238
238
  throw t.name = "AbortError", t;
239
239
  }
240
240
  //#endregion
241
241
  //#region packages/docx/src/document-pull-worker.ts
242
- var Ve = Math.max(p, i), He = class {
243
- coordinator = new c();
242
+ var He = Math.max(i, s), Ue = class {
243
+ coordinator = new n();
244
244
  host = null;
245
245
  identity = null;
246
246
  constructor(e, t = (e) => e(this.requireArchive())) {
@@ -252,24 +252,24 @@ var Ve = Math.max(p, i), He = class {
252
252
  t.open_document_cursor(e.operationId, e.generation);
253
253
  });
254
254
  let t = 0;
255
- this.identity = e, this.host = new s({
255
+ this.identity = e, this.host = new u({
256
256
  ...e,
257
- maxByteCredit: Ve,
257
+ maxByteCredit: He,
258
258
  coordinator: this.coordinator,
259
259
  driver: {
260
260
  pull: (n) => {
261
- let i;
261
+ let r;
262
262
  try {
263
- i = this.executeArchive((r) => r.pull_document_chunk(t, e.operationId, e.generation, n));
263
+ r = this.executeArchive((r) => r.pull_document_chunk(t, e.operationId, e.generation, n));
264
264
  } catch (e) {
265
- throw r(e, n, Ve) || e;
265
+ throw o(e, n, He) || e;
266
266
  }
267
- let a = le(i);
267
+ let i = le(r);
268
268
  return {
269
- payload: a,
270
- byteLength: a.byteLength,
269
+ payload: i,
270
+ byteLength: i.byteLength,
271
271
  done: this.executeArchive((e) => e.document_chunk_done()),
272
- transfer: [a]
272
+ transfer: [i]
273
273
  };
274
274
  },
275
275
  measureChunk: ({ payload: e }) => e.byteLength,
@@ -281,27 +281,27 @@ var Ve = Math.max(p, i), He = class {
281
281
  close: () => this.executeArchive((e) => e.close_document_session()),
282
282
  resourceUsage: () => {
283
283
  let e = this.executeArchive((e) => e.document_cursor_resource_usage?.());
284
- return e ? d(e) : void 0;
284
+ return e ? a(e) : void 0;
285
285
  }
286
286
  }
287
287
  });
288
288
  }
289
289
  dispatch(e, t) {
290
290
  return !this.host || !this.identity ? (t({
291
- protocol: o,
291
+ protocol: l,
292
292
  kind: "error",
293
293
  sessionId: e.sessionId,
294
294
  operationId: e.operationId,
295
295
  generation: e.generation,
296
296
  requestId: e.requestId,
297
- error: f(/* @__PURE__ */ Error("DOCX document pull session is not open"))
297
+ error: r(/* @__PURE__ */ Error("DOCX document pull session is not open"))
298
298
  }), Promise.resolve()) : this.host.dispatch(e, t);
299
299
  }
300
300
  async reset() {
301
301
  if (this.host) try {
302
302
  this.archive() && this.executeArchive((e) => e.close_document_session());
303
303
  } finally {
304
- this.host = null, this.identity = null, this.coordinator = new c();
304
+ this.host = null, this.identity = null, this.coordinator = new n();
305
305
  }
306
306
  }
307
307
  requireArchive() {
@@ -309,181 +309,181 @@ var Ve = Math.max(p, i), He = class {
309
309
  if (!e) throw Error("No docx loaded");
310
310
  return e;
311
311
  }
312
- }, Ue = /* @__PURE__ */ e({
313
- DocxArchive: () => C,
314
- default: () => tt,
315
- docx_to_markdown: () => We,
316
- extract_image: () => Ge,
317
- initSync: () => et,
318
- parse_docx: () => Ke,
319
- reinit: () => nt
320
- }), C = class {
312
+ }, We = /* @__PURE__ */ e({
313
+ DocxArchive: () => S,
314
+ default: () => nt,
315
+ docx_to_markdown: () => Ge,
316
+ extract_image: () => Ke,
317
+ initSync: () => tt,
318
+ parse_docx: () => qe,
319
+ reinit: () => rt
320
+ }), S = class {
321
321
  __destroy_into_raw() {
322
322
  let e = this.__wbg_ptr;
323
- return this.__wbg_ptr = 0, Je.unregister(this), e;
323
+ return this.__wbg_ptr = 0, Ye.unregister(this), e;
324
324
  }
325
325
  free() {
326
326
  let e = this.__destroy_into_raw();
327
- L.__wbg_docxarchive_free(e, 0);
327
+ I.__wbg_docxarchive_free(e, 0);
328
328
  }
329
329
  acknowledge_document_chunk(e, t, n) {
330
- let r = L.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
331
- if (r[1]) throw M(r[0]);
330
+ let r = I.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
331
+ if (r[1]) throw j(r[0]);
332
332
  }
333
333
  assert_healthy() {
334
- let e = L.docxarchive_assert_healthy(this.__wbg_ptr);
335
- if (e[1]) throw M(e[0]);
334
+ let e = I.docxarchive_assert_healthy(this.__wbg_ptr);
335
+ if (e[1]) throw j(e[0]);
336
336
  }
337
337
  cancel_document_cursor() {
338
- L.docxarchive_cancel_document_cursor(this.__wbg_ptr);
338
+ I.docxarchive_cancel_document_cursor(this.__wbg_ptr);
339
339
  }
340
340
  close_document_session() {
341
- L.docxarchive_close_document_session(this.__wbg_ptr);
341
+ I.docxarchive_close_document_session(this.__wbg_ptr);
342
342
  }
343
343
  document_chunk_done() {
344
- let e = L.docxarchive_document_chunk_done(this.__wbg_ptr);
345
- if (e[2]) throw M(e[1]);
344
+ let e = I.docxarchive_document_chunk_done(this.__wbg_ptr);
345
+ if (e[2]) throw j(e[1]);
346
346
  return e[0] !== 0;
347
347
  }
348
348
  document_cursor_resource_usage() {
349
- let e = L.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);
350
- if (e[3]) throw M(e[2]);
351
- var t = w(e[0], e[1]).slice();
352
- return L.__wbindgen_free(e[0], e[1] * 1, 1), t;
349
+ let e = I.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);
350
+ if (e[3]) throw j(e[2]);
351
+ var t = C(e[0], e[1]).slice();
352
+ return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
353
353
  }
354
354
  extract_image(e) {
355
- let t = j(e, L.__wbindgen_malloc, L.__wbindgen_realloc), n = I, r = L.docxarchive_extract_image(this.__wbg_ptr, t, n);
356
- if (r[3]) throw M(r[2]);
357
- var i = w(r[0], r[1]).slice();
358
- return L.__wbindgen_free(r[0], r[1] * 1, 1), i;
355
+ let t = A(e, I.__wbindgen_malloc, I.__wbindgen_realloc), n = F, r = I.docxarchive_extract_image(this.__wbg_ptr, t, n);
356
+ if (r[3]) throw j(r[2]);
357
+ var i = C(r[0], r[1]).slice();
358
+ return I.__wbindgen_free(r[0], r[1] * 1, 1), i;
359
359
  }
360
360
  constructor(e, t, n, r) {
361
- let i = A(e, L.__wbindgen_malloc), a = I, o = L.docxarchive_new(i, a, !k(t), k(t) ? BigInt(0) : t, !k(n), k(n) ? BigInt(0) : n, !k(r), k(r) ? BigInt(0) : r);
362
- if (o[2]) throw M(o[1]);
363
- return this.__wbg_ptr = o[0] >>> 0, Je.register(this, this.__wbg_ptr, this), this;
361
+ let i = k(e, I.__wbindgen_malloc), a = F, o = I.docxarchive_new(i, a, !O(t), O(t) ? BigInt(0) : t, !O(n), O(n) ? BigInt(0) : n, !O(r), O(r) ? BigInt(0) : r);
362
+ if (o[2]) throw j(o[1]);
363
+ return this.__wbg_ptr = o[0] >>> 0, Ye.register(this, this.__wbg_ptr, this), this;
364
364
  }
365
365
  open_document_cursor(e, t) {
366
- let n = L.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
367
- if (n[1]) throw M(n[0]);
366
+ let n = I.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
367
+ if (n[1]) throw j(n[0]);
368
368
  }
369
369
  parse() {
370
- let e = L.docxarchive_parse(this.__wbg_ptr);
371
- if (e[3]) throw M(e[2]);
372
- var t = w(e[0], e[1]).slice();
373
- return L.__wbindgen_free(e[0], e[1] * 1, 1), t;
370
+ let e = I.docxarchive_parse(this.__wbg_ptr);
371
+ if (e[3]) throw j(e[2]);
372
+ var t = C(e[0], e[1]).slice();
373
+ return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
374
374
  }
375
375
  pull_document_chunk(e, t, n, r) {
376
- let i = L.docxarchive_pull_document_chunk(this.__wbg_ptr, e, t, n, r);
377
- if (i[3]) throw M(i[2]);
378
- var a = w(i[0], i[1]).slice();
379
- return L.__wbindgen_free(i[0], i[1] * 1, 1), a;
376
+ let i = I.docxarchive_pull_document_chunk(this.__wbg_ptr, e, t, n, r);
377
+ if (i[3]) throw j(i[2]);
378
+ var a = C(i[0], i[1]).slice();
379
+ return I.__wbindgen_free(i[0], i[1] * 1, 1), a;
380
380
  }
381
381
  resource_usage() {
382
- let e = L.docxarchive_resource_usage(this.__wbg_ptr);
383
- if (e[3]) throw M(e[2]);
384
- var t = w(e[0], e[1]).slice();
385
- return L.__wbindgen_free(e[0], e[1] * 1, 1), t;
382
+ let e = I.docxarchive_resource_usage(this.__wbg_ptr);
383
+ if (e[3]) throw j(e[2]);
384
+ var t = C(e[0], e[1]).slice();
385
+ return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
386
386
  }
387
387
  to_markdown() {
388
388
  let e, t;
389
389
  try {
390
- let i = L.docxarchive_to_markdown(this.__wbg_ptr);
390
+ let i = I.docxarchive_to_markdown(this.__wbg_ptr);
391
391
  var n = i[0], r = i[1];
392
- if (i[3]) throw n = 0, r = 0, M(i[2]);
393
- return e = n, t = r, E(n, r);
392
+ if (i[3]) throw n = 0, r = 0, j(i[2]);
393
+ return e = n, t = r, T(n, r);
394
394
  } finally {
395
- L.__wbindgen_free(e, t, 1);
395
+ I.__wbindgen_free(e, t, 1);
396
396
  }
397
397
  }
398
398
  };
399
- Symbol.dispose && (C.prototype[Symbol.dispose] = C.prototype.free);
400
- function We(e, t, n) {
399
+ Symbol.dispose && (S.prototype[Symbol.dispose] = S.prototype.free);
400
+ function Ge(e, t, n) {
401
401
  let r, i;
402
402
  try {
403
- let s = A(e, L.__wbindgen_malloc), c = I, l = L.docx_to_markdown(s, c, !k(t), k(t) ? BigInt(0) : t, !k(n), k(n) ? BigInt(0) : n);
403
+ let s = k(e, I.__wbindgen_malloc), c = F, l = I.docx_to_markdown(s, c, !O(t), O(t) ? BigInt(0) : t, !O(n), O(n) ? BigInt(0) : n);
404
404
  var a = l[0], o = l[1];
405
- if (l[3]) throw a = 0, o = 0, M(l[2]);
406
- return r = a, i = o, E(a, o);
405
+ if (l[3]) throw a = 0, o = 0, j(l[2]);
406
+ return r = a, i = o, T(a, o);
407
407
  } finally {
408
- L.__wbindgen_free(r, i, 1);
408
+ I.__wbindgen_free(r, i, 1);
409
409
  }
410
410
  }
411
- function Ge(e, t, n, r) {
412
- let i = A(e, L.__wbindgen_malloc), a = I, o = j(t, L.__wbindgen_malloc, L.__wbindgen_realloc), s = I, c = L.extract_image(i, a, o, s, !k(n), k(n) ? BigInt(0) : n, !k(r), k(r) ? BigInt(0) : r);
413
- if (c[3]) throw M(c[2]);
414
- var l = w(c[0], c[1]).slice();
415
- return L.__wbindgen_free(c[0], c[1] * 1, 1), l;
411
+ function Ke(e, t, n, r) {
412
+ let i = k(e, I.__wbindgen_malloc), a = F, o = A(t, I.__wbindgen_malloc, I.__wbindgen_realloc), s = F, c = I.extract_image(i, a, o, s, !O(n), O(n) ? BigInt(0) : n, !O(r), O(r) ? BigInt(0) : r);
413
+ if (c[3]) throw j(c[2]);
414
+ var l = C(c[0], c[1]).slice();
415
+ return I.__wbindgen_free(c[0], c[1] * 1, 1), l;
416
416
  }
417
- function Ke(e, t, n) {
418
- let r = A(e, L.__wbindgen_malloc), i = I, a = L.parse_docx(r, i, !k(t), k(t) ? BigInt(0) : t, !k(n), k(n) ? BigInt(0) : n);
419
- if (a[3]) throw M(a[2]);
420
- var o = w(a[0], a[1]).slice();
421
- return L.__wbindgen_free(a[0], a[1] * 1, 1), o;
417
+ function qe(e, t, n) {
418
+ let r = k(e, I.__wbindgen_malloc), i = F, a = I.parse_docx(r, i, !O(t), O(t) ? BigInt(0) : t, !O(n), O(n) ? BigInt(0) : n);
419
+ if (a[3]) throw j(a[2]);
420
+ var o = C(a[0], a[1]).slice();
421
+ return I.__wbindgen_free(a[0], a[1] * 1, 1), o;
422
422
  }
423
- function qe() {
423
+ function Je() {
424
424
  return {
425
425
  __proto__: null,
426
426
  "./docx_parser_bg.js": {
427
427
  __proto__: null,
428
428
  __wbg___wbindgen_throw_6b64449b9b9ed33c: function(e, t) {
429
- throw Error(E(e, t));
429
+ throw Error(T(e, t));
430
430
  },
431
431
  __wbg_error_a6fa202b58aa1cd3: function(e, t) {
432
432
  let n, r;
433
433
  try {
434
- n = e, r = t, console.error(E(e, t));
434
+ n = e, r = t, console.error(T(e, t));
435
435
  } finally {
436
- L.__wbindgen_free(n, r, 1);
436
+ I.__wbindgen_free(n, r, 1);
437
437
  }
438
438
  },
439
439
  __wbg_new_227d7c05414eb861: function() {
440
440
  return /* @__PURE__ */ Error();
441
441
  },
442
442
  __wbg_stack_3b0d974bbf31e44f: function(e, t) {
443
- let n = t.stack, r = j(n, L.__wbindgen_malloc, L.__wbindgen_realloc), i = I;
444
- Ye().setInt32(e + 4, i, !0), Ye().setInt32(e + 0, r, !0);
443
+ let n = t.stack, r = A(n, I.__wbindgen_malloc, I.__wbindgen_realloc), i = F;
444
+ Xe().setInt32(e + 4, i, !0), Xe().setInt32(e + 0, r, !0);
445
445
  },
446
446
  __wbindgen_cast_0000000000000001: function(e, t) {
447
- return E(e, t);
447
+ return T(e, t);
448
448
  },
449
449
  __wbindgen_init_externref_table: function() {
450
- let e = L.__wbindgen_externrefs, t = e.grow(4);
450
+ let e = I.__wbindgen_externrefs, t = e.grow(4);
451
451
  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);
452
452
  }
453
453
  }
454
454
  };
455
455
  }
456
- var Je = typeof FinalizationRegistry > "u" ? {
456
+ var Ye = typeof FinalizationRegistry > "u" ? {
457
457
  register: () => {},
458
458
  unregister: () => {}
459
- } : new FinalizationRegistry((e) => L.__wbg_docxarchive_free(e >>> 0, 1));
460
- function w(e, t) {
461
- return e >>>= 0, O().subarray(e / 1, e / 1 + t);
459
+ } : new FinalizationRegistry((e) => I.__wbg_docxarchive_free(e >>> 0, 1));
460
+ function C(e, t) {
461
+ return e >>>= 0, D().subarray(e / 1, e / 1 + t);
462
462
  }
463
- var T = null;
464
- function Ye() {
465
- return (T === null || T.buffer.detached === !0 || T.buffer.detached === void 0 && T.buffer !== L.memory.buffer) && (T = new DataView(L.memory.buffer)), T;
463
+ var w = null;
464
+ function Xe() {
465
+ return (w === null || w.buffer.detached === !0 || w.buffer.detached === void 0 && w.buffer !== I.memory.buffer) && (w = new DataView(I.memory.buffer)), w;
466
466
  }
467
- function E(e, t) {
468
- return e >>>= 0, Ze(e, t);
467
+ function T(e, t) {
468
+ return e >>>= 0, Qe(e, t);
469
469
  }
470
- var D = null;
471
- function O() {
472
- return (D === null || D.byteLength === 0) && (D = new Uint8Array(L.memory.buffer)), D;
470
+ var E = null;
471
+ function D() {
472
+ return (E === null || E.byteLength === 0) && (E = new Uint8Array(I.memory.buffer)), E;
473
473
  }
474
- function k(e) {
474
+ function O(e) {
475
475
  return e == null;
476
476
  }
477
- function A(e, t) {
477
+ function k(e, t) {
478
478
  let n = t(e.length * 1, 1) >>> 0;
479
- return O().set(e, n / 1), I = e.length, n;
479
+ return D().set(e, n / 1), F = e.length, n;
480
480
  }
481
- function j(e, t, n) {
481
+ function A(e, t, n) {
482
482
  if (n === void 0) {
483
- let n = F.encode(e), r = t(n.length, 1) >>> 0;
484
- return O().subarray(r, r + n.length).set(n), I = n.length, r;
483
+ let n = P.encode(e), r = t(n.length, 1) >>> 0;
484
+ return D().subarray(r, r + n.length).set(n), F = n.length, r;
485
485
  }
486
- let r = e.length, i = t(r, 1) >>> 0, a = O(), o = 0;
486
+ let r = e.length, i = t(r, 1) >>> 0, a = D(), o = 0;
487
487
  for (; o < r; o++) {
488
488
  let t = e.charCodeAt(o);
489
489
  if (t > 127) break;
@@ -491,40 +491,40 @@ function j(e, t, n) {
491
491
  }
492
492
  if (o !== r) {
493
493
  o !== 0 && (e = e.slice(o)), i = n(i, r, r = o + e.length * 3, 1) >>> 0;
494
- let t = O().subarray(i + o, i + r), a = F.encodeInto(e, t);
494
+ let t = D().subarray(i + o, i + r), a = P.encodeInto(e, t);
495
495
  o += a.written, i = n(i, r, o, 1) >>> 0;
496
496
  }
497
- return I = o, i;
497
+ return F = o, i;
498
498
  }
499
- function M(e) {
500
- let t = L.__wbindgen_externrefs.get(e);
501
- return L.__externref_table_dealloc(e), t;
499
+ function j(e) {
500
+ let t = I.__wbindgen_externrefs.get(e);
501
+ return I.__externref_table_dealloc(e), t;
502
502
  }
503
- var N = new TextDecoder("utf-8", {
503
+ var M = new TextDecoder("utf-8", {
504
504
  ignoreBOM: !0,
505
505
  fatal: !0
506
506
  });
507
- N.decode();
508
- var Xe = 2146435072, P = 0;
509
- function Ze(e, t) {
510
- return P += t, P >= Xe && (N = new TextDecoder("utf-8", {
507
+ M.decode();
508
+ var Ze = 2146435072, N = 0;
509
+ function Qe(e, t) {
510
+ return N += t, N >= Ze && (M = new TextDecoder("utf-8", {
511
511
  ignoreBOM: !0,
512
512
  fatal: !0
513
- }), N.decode(), P = t), N.decode(O().subarray(e, e + t));
513
+ }), M.decode(), N = t), M.decode(D().subarray(e, e + t));
514
514
  }
515
- var F = new TextEncoder();
516
- "encodeInto" in F || (F.encodeInto = function(e, t) {
517
- let n = F.encode(e);
515
+ var P = new TextEncoder();
516
+ "encodeInto" in P || (P.encodeInto = function(e, t) {
517
+ let n = P.encode(e);
518
518
  return t.set(n), {
519
519
  read: e.length,
520
520
  written: n.length
521
521
  };
522
522
  });
523
- var I = 0, L;
524
- function Qe(e, t) {
525
- return L = e.exports, T = null, D = null, L.__wbindgen_start(), L;
523
+ var F = 0, I;
524
+ function $e(e, t) {
525
+ return I = e.exports, w = null, E = null, I.__wbindgen_start(), I;
526
526
  }
527
- async function $e(e, t) {
527
+ async function et(e, t) {
528
528
  if (typeof Response == "function" && e instanceof Response) {
529
529
  if (typeof WebAssembly.instantiateStreaming == "function") try {
530
530
  return await WebAssembly.instantiateStreaming(e, t);
@@ -550,84 +550,84 @@ async function $e(e, t) {
550
550
  return !1;
551
551
  }
552
552
  }
553
- function et(e) {
554
- if (L !== void 0) return L;
553
+ function tt(e) {
554
+ if (I !== void 0) return I;
555
555
  e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module: e} = e : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
556
- let t = qe();
557
- return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), Qe(new WebAssembly.Instance(e, t), e);
556
+ let t = Je();
557
+ return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), $e(new WebAssembly.Instance(e, t), e);
558
558
  }
559
- async function tt(e) {
560
- if (L !== void 0) return L;
559
+ async function nt(e) {
560
+ if (I !== void 0) return I;
561
561
  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"));
562
- let t = qe();
562
+ let t = Je();
563
563
  (typeof e == "string" || typeof Request == "function" && e instanceof Request || typeof URL == "function" && e instanceof URL) && (e = fetch(e));
564
- let { instance: n, module: r } = await $e(await e, t);
565
- return Qe(n, r);
564
+ let { instance: n, module: r } = await et(await e, t);
565
+ return $e(n, r);
566
566
  }
567
- async function nt(e) {
568
- return L = void 0, T = null, D = null, tt(e);
567
+ async function rt(e) {
568
+ return I = void 0, w = null, E = null, nt(e);
569
569
  }
570
570
  //#endregion
571
571
  //#region packages/docx/src/internal/node-acquisition.ts
572
- var rt, it;
572
+ var it, L;
573
573
  function at(e) {
574
- if (!it) rt = e, it = new Se(Ue, e);
575
- else if (rt !== e) throw Error("DOCX runtime was already initialized with another WebAssembly.Module");
576
- return it;
574
+ if (!L) it = e, L = new Ce(We, e);
575
+ else if (it !== e) throw Error("DOCX runtime was already initialized with another WebAssembly.Module");
576
+ return L;
577
577
  }
578
- async function ot(e, t, r, i) {
579
- let o = l(r), s = new a({
580
- enabled: o.debug || o.onResourceMetrics !== void 0,
578
+ async function ot(e, t, n, r) {
579
+ let i = g(n), a = new c({
580
+ enabled: i.debug || i.onResourceMetrics !== void 0,
581
581
  format: "docx",
582
582
  mode: "node",
583
583
  scope: "session",
584
- policy: o.policy,
585
- onMetrics: o.onResourceMetrics,
586
- emitToConsole: o.debug
584
+ policy: i.policy,
585
+ onMetrics: i.onResourceMetrics,
586
+ emitToConsole: i.debug
587
587
  });
588
- s.setSourceBytes(e.byteLength);
589
- let c, d, f;
588
+ a.setSourceBytes(e.byteLength);
589
+ let o, s, l;
590
590
  try {
591
- ct(r.signal);
592
- let [a, l, u] = n(o.policy), p = C;
593
- c = await at(t).open(() => new p(e, a, l, u), {
594
- signal: r.signal,
591
+ ct(n.signal);
592
+ let [c, u, d] = ee(i.policy), f = S;
593
+ o = await at(t).open(() => new f(e, c, u, d), {
594
+ signal: n.signal,
595
595
  abortError: lt,
596
596
  disposeOnAbort: (e) => e.free()
597
- }), ct(r.signal);
598
- let m = c.proxy;
599
- s.checkpoint("container ready"), d = new He(() => m);
600
- let h = {
597
+ }), ct(n.signal);
598
+ let p = o.proxy;
599
+ a.checkpoint("container ready"), s = new Ue(() => p);
600
+ let m = {
601
601
  sessionId: 1,
602
602
  operationId: 1,
603
603
  generation: 1
604
604
  };
605
- d.open(h), f = new y((e, t) => d?.dispatch(e, t), () => void 0);
606
- let g, _ = await i(f, h, {
607
- signal: r.signal,
605
+ s.open(m), l = new v((e, t) => s?.dispatch(e, t), () => void 0);
606
+ let h, g = await r(l, m, {
607
+ signal: n.signal,
608
608
  onUsage: (e) => {
609
- g = e, s.observeUsage(e);
609
+ h = e, a.observeUsage(e);
610
610
  }
611
611
  });
612
- return g ??= st(m.document_cursor_resource_usage()), s.observeUsage(g), s.checkpoint("model streamed"), await d.reset(), f.terminate(), {
613
- archive: m,
614
- result: _,
615
- usage: g,
616
- metrics: s,
617
- closeArchive: () => c?.close((e) => e.free())
612
+ return h ??= st(p.document_cursor_resource_usage()), a.observeUsage(h), a.checkpoint("model streamed"), await s.reset(), l.terminate(), {
613
+ archive: p,
614
+ result: g,
615
+ usage: h,
616
+ metrics: a,
617
+ closeArchive: () => o?.close((e) => e.free())
618
618
  };
619
619
  } catch (e) {
620
- await d?.reset().catch(() => void 0), f?.terminate();
620
+ await s?.reset().catch(() => void 0), l?.terminate();
621
621
  try {
622
- c?.close((e) => e.free());
622
+ o?.close((e) => e.free());
623
623
  } catch {}
624
- let t = u(e) ?? e;
625
- throw s.fail(t), t;
624
+ let t = d(e) ?? e;
625
+ throw a.fail(t), t;
626
626
  }
627
627
  }
628
628
  function st(e) {
629
629
  try {
630
- return d(e);
630
+ return a(e);
631
631
  } catch {
632
632
  return;
633
633
  }
@@ -641,7 +641,7 @@ function lt() {
641
641
  }
642
642
  //#endregion
643
643
  //#region packages/node/src/docx.ts
644
- var ut = b(() => x(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
644
+ var ut = y(() => b(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
645
645
  async function dt(e, t) {
646
646
  if (!t?.factory) throw TypeError("openDocxDocument requires a canvas factory");
647
647
  let n = await ot(ht(e), ut(), t, (e, t, n) => ae(e, t, n));
@@ -653,12 +653,12 @@ async function dt(e, t) {
653
653
  try {
654
654
  n.closeArchive();
655
655
  } catch {}
656
- let t = u(e) ?? e;
656
+ let t = d(e) ?? e;
657
657
  throw n.metrics.fail(t), t;
658
658
  }
659
659
  }
660
660
  async function ft(e, t = {}) {
661
- return v(async () => {
661
+ return _(async () => {
662
662
  let n = await ot(ht(e), ut(), t, (e, t, n) => re(e, t, n)), r = !1;
663
663
  return {
664
664
  acquired: n,
@@ -710,7 +710,7 @@ var pt = class {
710
710
  }
711
711
  refreshResourceUsage() {
712
712
  try {
713
- this.lastResourceUsage = d(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
713
+ this.lastResourceUsage = a(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
714
714
  } catch {}
715
715
  return this.lastResourceUsage;
716
716
  }
@@ -726,7 +726,7 @@ var pt = class {
726
726
  return this.closed ? Promise.reject(/* @__PURE__ */ Error("DOCX document session is closed")) : this.resourceFailure ? Promise.reject(this.resourceFailure) : (this.pageSize(e), this.enqueueRender(async () => {
727
727
  gt(this.signal);
728
728
  let n = this.requireState(), r = this.factory.createCanvas(1, 1);
729
- return await Ce(this.factory, () => ne(n.source, r, e, {
729
+ return await we(this.factory, () => ne(n.source, r, e, {
730
730
  ...t,
731
731
  currentDate: this.defaultCurrentDateMs,
732
732
  defaultCurrentDateMs: this.defaultCurrentDateMs,
@@ -734,8 +734,8 @@ var pt = class {
734
734
  fetchImage: this.fetchImage
735
735
  })), gt(this.signal), r;
736
736
  }).catch((e) => {
737
- let t = u(e) ?? e;
738
- throw t instanceof _ && (this.resourceFailure ??= t), this.metrics.fail(t), t;
737
+ let t = d(e) ?? e;
738
+ throw t instanceof p && (this.resourceFailure ??= t), this.metrics.fail(t), t;
739
739
  }));
740
740
  }
741
741
  async *pages(e = {}) {
@@ -753,7 +753,7 @@ var pt = class {
753
753
  };
754
754
  }
755
755
  } catch (e) {
756
- throw t = u(e) ?? e, t;
756
+ throw t = d(e) ?? e, t;
757
757
  } finally {
758
758
  try {
759
759
  await this.close();
@@ -770,11 +770,11 @@ var pt = class {
770
770
  return this.renderTail = t.then(() => void 0, () => void 0), t;
771
771
  }
772
772
  async release() {
773
- await this.renderTail, g(this.fetchImage), h(this.fetchImage), this.state = null;
773
+ await this.renderTail, m(this.fetchImage), h(this.fetchImage), this.state = null;
774
774
  try {
775
775
  this.closeArchive();
776
776
  } catch (e) {
777
- let t = u(e) ?? e;
777
+ let t = d(e) ?? e;
778
778
  throw this.metrics.fail(t), t;
779
779
  }
780
780
  this.metrics.checkpoint("document session closed", this.lastResourceUsage), this.metrics.succeed({ pages: this.pageCount });
@@ -805,7 +805,7 @@ function vt(e, t) {
805
805
  try {
806
806
  return {
807
807
  workbook: n,
808
- usage: d(t())
808
+ usage: a(t())
809
809
  };
810
810
  } catch (e) {
811
811
  if ((e instanceof Error ? e.message : String(e)) === _t) return {
@@ -1077,44 +1077,44 @@ async function Nt(e) {
1077
1077
  //#region packages/xlsx/src/internal/node-acquisition.ts
1078
1078
  var Pt, Q;
1079
1079
  function Ft(e) {
1080
- if (!Q) Pt = e, Q = new Se(yt, e);
1080
+ if (!Q) Pt = e, Q = new Ce(yt, e);
1081
1081
  else if (Pt !== e) throw Error("XLSX runtime was already initialized with another WebAssembly.Module");
1082
1082
  return Q;
1083
1083
  }
1084
- async function It(e, t, r = {}) {
1085
- let i = l(r), o = new a({
1086
- enabled: i.debug || i.onResourceMetrics !== void 0,
1084
+ async function It(e, t, n = {}) {
1085
+ let r = g(n), i = new c({
1086
+ enabled: r.debug || r.onResourceMetrics !== void 0,
1087
1087
  format: "xlsx",
1088
1088
  mode: "node",
1089
1089
  scope: "session",
1090
- policy: i.policy,
1091
- onMetrics: i.onResourceMetrics,
1092
- emitToConsole: i.debug
1090
+ policy: r.policy,
1091
+ onMetrics: r.onResourceMetrics,
1092
+ emitToConsole: r.debug
1093
1093
  });
1094
- o.setSourceBytes(e.byteLength);
1095
- let s;
1094
+ i.setSourceBytes(e.byteLength);
1095
+ let a;
1096
1096
  try {
1097
- Lt(r.signal);
1098
- let [a, c, l] = n(i.policy), u = R;
1099
- s = await Ft(t).open(() => new u(e, a, c, l), {
1100
- signal: r.signal,
1097
+ Lt(n.signal);
1098
+ let [o, s, c] = ee(r.policy), l = R;
1099
+ a = await Ft(t).open(() => new l(e, o, s, c), {
1100
+ signal: n.signal,
1101
1101
  abortError: Rt,
1102
1102
  disposeOnAbort: (e) => e.free()
1103
- }), Lt(r.signal);
1104
- let d = s.proxy, { workbook: f, usage: p } = vt(() => JSON.parse(new TextDecoder().decode(d.parse())), () => d.resource_usage());
1105
- return o.observeUsage(p), o.checkpoint("workbook index ready"), {
1106
- archive: d,
1107
- workbookIndex: f,
1108
- usage: p,
1109
- metrics: o,
1110
- closeArchive: () => s?.close((e) => e.free())
1103
+ }), Lt(n.signal);
1104
+ let u = a.proxy, { workbook: d, usage: f } = vt(() => JSON.parse(new TextDecoder().decode(u.parse())), () => u.resource_usage());
1105
+ return i.observeUsage(f), i.checkpoint("workbook index ready"), {
1106
+ archive: u,
1107
+ workbookIndex: d,
1108
+ usage: f,
1109
+ metrics: i,
1110
+ closeArchive: () => a?.close((e) => e.free())
1111
1111
  };
1112
1112
  } catch (e) {
1113
1113
  try {
1114
- s?.close((e) => e.free());
1114
+ a?.close((e) => e.free());
1115
1115
  } catch {}
1116
- let t = u(e) ?? e;
1117
- throw o.fail(t), t;
1116
+ let t = d(e) ?? e;
1117
+ throw i.fail(t), t;
1118
1118
  }
1119
1119
  }
1120
1120
  function Lt(e) {
@@ -1126,7 +1126,7 @@ function Rt() {
1126
1126
  }
1127
1127
  //#endregion
1128
1128
  //#region packages/node/src/xlsx.ts
1129
- var zt = b(() => x(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1129
+ var zt = y(() => b(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1130
1130
  async function $(e, t = {}) {
1131
1131
  let n = await It(qt(e), zt(), t);
1132
1132
  return new Bt(n.closeArchive, n.archive, n.workbookIndex, n.metrics, n.usage, t.signal);
@@ -1146,7 +1146,7 @@ var Bt = class {
1146
1146
  rowBatches = 0;
1147
1147
  emittedRows = 0;
1148
1148
  constructor(e, t, n, r, i, a) {
1149
- this.closeArchive = e, this.archive = t, this.metrics = r, this.signal = a, this.workbookIndex = Gt(n), this.sheetNames = Object.freeze(this.workbookIndex.workbook.sheets.map((e) => e.name)), this.sheetCount = this.sheetNames.length, this.lastUsage = i, this.pull = new he(() => this.archive), this.transport = new y((e, t) => this.pull.dispatchSafely(e, t), () => void 0), this.worksheetPullClient = new _e({
1149
+ this.closeArchive = e, this.archive = t, this.metrics = r, this.signal = a, this.workbookIndex = Gt(n), this.sheetNames = Object.freeze(this.workbookIndex.workbook.sheets.map((e) => e.name)), this.sheetCount = this.sheetNames.length, this.lastUsage = i, this.pull = new ge(() => this.archive), this.transport = new v((e, t) => this.pull.dispatchSafely(e, t), () => void 0), this.worksheetPullClient = new ve({
1150
1150
  transport: this.transport,
1151
1151
  sharedStrings: n.sharedStrings,
1152
1152
  open: async (e, t, n) => {
@@ -1194,13 +1194,13 @@ var Bt = class {
1194
1194
  }
1195
1195
  this.completedWorksheets += 1, this.metrics.checkpoint("worksheet stream complete", this.lastUsage);
1196
1196
  } catch (e) {
1197
- throw r = u(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1197
+ throw r = d(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1198
1198
  } finally {
1199
1199
  try {
1200
1200
  await this.cleanupOperation(n, r === void 0 ? "closed" : "request-error");
1201
1201
  } catch (e) {
1202
1202
  if (r === void 0) {
1203
- let t = u(e) ?? e;
1203
+ let t = d(e) ?? e;
1204
1204
  throw this.metrics.fail(t), await this.close().catch(() => void 0), t;
1205
1205
  }
1206
1206
  }
@@ -1215,12 +1215,12 @@ var Bt = class {
1215
1215
  try {
1216
1216
  await this.worksheetPullClient.cancelAll(t);
1217
1217
  } catch (e) {
1218
- n = u(e) ?? e;
1218
+ n = d(e) ?? e;
1219
1219
  }
1220
1220
  try {
1221
1221
  await this.pull.reset();
1222
1222
  } catch (e) {
1223
- n ??= u(e) ?? e;
1223
+ n ??= d(e) ?? e;
1224
1224
  }
1225
1225
  if (this.active === e && (this.active = void 0), n !== void 0) throw n;
1226
1226
  })(), e.cleanupPromise;
@@ -1230,13 +1230,13 @@ var Bt = class {
1230
1230
  if (this.active) try {
1231
1231
  await this.cleanupOperation(this.active, "closed");
1232
1232
  } catch (t) {
1233
- e = u(t) ?? t;
1233
+ e = d(t) ?? t;
1234
1234
  }
1235
1235
  this.transport.terminate();
1236
1236
  try {
1237
1237
  this.closeArchive();
1238
1238
  } catch (t) {
1239
- e ??= u(t) ?? t;
1239
+ e ??= d(t) ?? t;
1240
1240
  }
1241
1241
  if (e !== void 0) throw this.metrics.fail(e), e;
1242
1242
  this.metrics.checkpoint("workbook session closed", this.lastUsage), this.metrics.succeed({
@@ -1252,13 +1252,13 @@ var Bt = class {
1252
1252
  }
1253
1253
  };
1254
1254
  async function Vt(e, t = {}) {
1255
- return v(() => $(e, t), async (e) => structuredClone(e.workbookIndex));
1255
+ return _(() => $(e, t), async (e) => structuredClone(e.workbookIndex));
1256
1256
  }
1257
1257
  async function Ht(e, t, n = {}) {
1258
- return v(() => $(e, n), async (e) => (await Wt(e, t)).worksheet);
1258
+ return _(() => $(e, n), async (e) => (await Wt(e, t)).worksheet);
1259
1259
  }
1260
1260
  async function Ut(e, t = {}) {
1261
- return v(() => $(e, t), async (e) => {
1261
+ return _(() => $(e, t), async (e) => {
1262
1262
  let t = [], n = {
1263
1263
  rows: 0,
1264
1264
  cells: 0,
@@ -1266,8 +1266,8 @@ async function Ut(e, t = {}) {
1266
1266
  jsonBytes: 0
1267
1267
  };
1268
1268
  for (let r = 0; r < e.sheetCount; r += 1) {
1269
- let i = await Wt(e, r), a = me(n, i.usage);
1270
- ue(a, "materialize-workbook", void 0, i.resourceUsage), n = a, t.push(i.worksheet);
1269
+ let i = await Wt(e, r), a = he(n, i.usage);
1270
+ de(a, "materialize-workbook", void 0, i.resourceUsage), n = a, t.push(i.worksheet);
1271
1271
  }
1272
1272
  return {
1273
1273
  workbookIndex: structuredClone(e.workbookIndex),
@@ -1282,16 +1282,16 @@ async function Wt(e, t) {
1282
1282
  ownedUtf8Bytes: 0
1283
1283
  }, i, a, o;
1284
1284
  for await (let s of e.worksheetRows(t)) if (o = s.usage ?? o, s.kind === "rows") {
1285
- let e = ge(r, fe(s.rows));
1286
- ve(e, "materialize-worksheet", void 0, o), n.push(...s.rows), r = e;
1285
+ let e = _e(r, pe(s.rows));
1286
+ ye(e, "materialize-worksheet", void 0, o), n.push(...s.rows), r = e;
1287
1287
  } else {
1288
1288
  a = s.worksheet, a.rows = a.parseError ? [] : n;
1289
- let e = de(a, a.parseError ? {
1289
+ let e = fe(a, a.parseError ? {
1290
1290
  rows: 0,
1291
1291
  cells: 0,
1292
1292
  ownedUtf8Bytes: 0
1293
1293
  } : r);
1294
- ve(e, "materialize-worksheet", void 0, o), pe(e.jsonBytes, "materialize-worksheet", void 0, o), r = e, i = e;
1294
+ ye(e, "materialize-worksheet", void 0, o), me(e.jsonBytes, "materialize-worksheet", void 0, o), r = e, i = e;
1295
1295
  }
1296
1296
  if (!a || !i) throw Error(`XLSX worksheet ${t} did not produce a terminal model`);
1297
1297
  return {
@@ -1310,7 +1310,7 @@ function Gt(e, t = /* @__PURE__ */ new WeakSet()) {
1310
1310
  }
1311
1311
  function Kt(e) {
1312
1312
  try {
1313
- return d(e);
1313
+ return a(e);
1314
1314
  } catch (e) {
1315
1315
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
1316
1316
  throw e;
@@ -1320,4 +1320,4 @@ function qt(e) {
1320
1320
  return e instanceof Uint8Array ? e : new Uint8Array(e);
1321
1321
  }
1322
1322
  //#endregion
1323
- export { ce as OoxmlDecodedImageLimitError, _ as OoxmlResourceLimitError, Ee as installImageBitmapShim, we as installOffscreenCanvasShim, se as isOoxmlDecodedImageLimitError, ft as materializeDocxDocument, ze as materializePptxPresentation, Ut as materializeXlsxWorkbook, Vt as materializeXlsxWorkbookIndex, Ht as materializeXlsxWorksheet, dt as openDocxDocument, Ie as openPptxPresentation, $ as openXlsxWorkbook, Te as renderSlideNode };
1323
+ export { ce as OoxmlDecodedImageLimitError, p as OoxmlResourceLimitError, De as installImageBitmapShim, Te as installOffscreenCanvasShim, se as isOoxmlDecodedImageLimitError, ft as materializeDocxDocument, Be as materializePptxPresentation, Ut as materializeXlsxWorkbook, Vt as materializeXlsxWorkbookIndex, Ht as materializeXlsxWorksheet, dt as openDocxDocument, Le as openPptxPresentation, $ as openXlsxWorkbook, Ee as renderSlideNode };