@silurus/ooxml 0.80.2 → 0.81.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.
Files changed (54) hide show
  1. package/README.md +57 -77
  2. package/dist/assets/render-worker-C2ACcLes.js +11 -0
  3. package/dist/assets/render-worker-Cx5uR77k.js +10 -0
  4. package/dist/assets/render-worker-DtU8oQZ7.js +24 -0
  5. package/dist/{canvas-viewer-mechanics-D-r6wHY_.js → canvas-viewer-mechanics-CqxKRGCp.js} +1 -1
  6. package/dist/chart-ex.mjs +1017 -0
  7. package/dist/{document-pull-client-Cukkyojh.js → document-pull-client-Ux4a_ax8.js} +4540 -4412
  8. package/dist/{docx-BlELeDNF.js → docx-SEyQ4gS-.js} +79 -75
  9. package/dist/docx.mjs +5 -4
  10. package/dist/docx_parser_bg.wasm +0 -0
  11. package/dist/index.mjs +3 -3
  12. package/dist/{line-distribute-Bvtp0Gt6.js → line-distribute-BBGvvwLt.js} +17 -16
  13. package/dist/{line-metrics-DdEJYxjx.js → line-metrics-Baz31mML.js} +663 -7488
  14. package/dist/math.mjs +29 -24
  15. package/dist/node.mjs +248 -247
  16. package/dist/plot-area-frame-Dg1VIpUU.js +3669 -0
  17. package/dist/{pptx-JBkXh6Cy.js → pptx-5lQrMvMR.js} +236 -232
  18. package/dist/pptx.mjs +6 -5
  19. package/dist/pptx_parser_bg.wasm +0 -0
  20. package/dist/region-map.mjs +102 -97
  21. package/dist/{render-CoqMHcbF.js → render-DEHjijQD.js} +1 -1
  22. package/dist/{render-worker-host-CM1JXVqg.js → render-worker-host-B1nbV_k7.js} +1 -1
  23. package/dist/{render-worker-host-DFtd9Z-J.js → render-worker-host-Bze5M6k5.js} +1 -1
  24. package/dist/{render-worker-host-Br7ZDyGE.js → render-worker-host-Dg_74V64.js} +1 -1
  25. package/dist/renderer-DuopJE1K.js +5855 -0
  26. package/dist/{renderer-module-contract-BNGz8HvO.js → renderer-module-contract-0bO_5SC0.js} +4 -3
  27. package/dist/{resource-measurement-CgMubiAI.js → resource-measurement-DRLp4nFt.js} +12 -11
  28. package/dist/{session-DkPblDiq.js → session-CNVc3VJ4.js} +8 -8
  29. package/dist/{slide-pull-client-m2blvngt.js → slide-pull-client-CzutXnGc.js} +888 -1082
  30. package/dist/three-d-BYiWCNlz.js +1345 -0
  31. package/dist/three-d.mjs +1238 -798
  32. package/dist/types/chart-ex.d.ts +949 -0
  33. package/dist/types/docx.d.ts +325 -18
  34. package/dist/types/index.d.ts +325 -26
  35. package/dist/types/math.d.ts +1 -1
  36. package/dist/types/node.d.ts +303 -14
  37. package/dist/types/pptx.d.ts +314 -22
  38. package/dist/types/region-map.d.ts +318 -6
  39. package/dist/types/three-d.d.ts +318 -6
  40. package/dist/types/xlsx.d.ts +317 -18
  41. package/dist/{worksheet-pull-client-BntP6RiO.js → worksheet-pull-client-Cxj3Ej0s.js} +19 -19
  42. package/dist/{xlsx-dhsUXUpX.js → xlsx-Bl3TIEVu.js} +1313 -1279
  43. package/dist/xlsx.mjs +6 -5
  44. package/dist/xlsx_parser_bg.wasm +0 -0
  45. package/package.json +7 -1
  46. package/dist/assets/render-worker-BD1_LaFD.js +0 -9
  47. package/dist/assets/render-worker-BIqMQFkZ.js +0 -8
  48. package/dist/assets/render-worker-DuvX4_li.js +0 -22
  49. package/dist/chart-number-format-qLhnk6hj.js +0 -475
  50. package/dist/three-d-C28kqDym.js +0 -1086
  51. /package/dist/{highlight-rect-BuX5rWP4.js → highlight-rect-BqcZMHUE.js} +0 -0
  52. /package/dist/{mathjax-DgAl7Yi5.js → mathjax-DJa-Q93p.js} +0 -0
  53. /package/dist/{transfer-CKZ79zFw.js → transfer-D0U6Uhn4.js} +0 -0
  54. /package/dist/{visible-index-BjesVGhg.js → visible-index-DbDuGMCE.js} +0 -0
package/dist/node.mjs CHANGED
@@ -1,18 +1,19 @@
1
1
  import { t as e } from "./chunk-DmhlhrBa.js";
2
- import { t } from "./slide-pull-client-m2blvngt.js";
3
- import { B as n, F as r, H as i, I as a, Ot as o, P as s, R as c, Rt as l, U as u, W as d, at as f, jt as p, ln as m, ot as h, q as g, rt as _, st as ee, zt as te } from "./line-metrics-DdEJYxjx.js";
4
- import { t as ne } from "./bounded-raw-part-cache-C6ro6Ezf.js";
5
- import { a as re, c as ie, i as ae, l as oe, r as se, u as ce } from "./document-pull-client-Cukkyojh.js";
6
- import { t as le } from "./transfer-CKZ79zFw.js";
7
- import { a as ue, c as de, d as fe, l as pe, o as me, r as he, s as ge, t as _e, u as ve } from "./worksheet-pull-client-BntP6RiO.js";
8
- import { a as ye, i as be, n as xe, r as Se } from "./session-DkPblDiq.js";
9
- import { a as Ce, n as we, r as Te, t as Ee } from "./render-CoqMHcbF.js";
10
- import { existsSync as De, readFileSync as Oe } from "node:fs";
11
- import { fileURLToPath as ke } from "node:url";
12
- import { basename as Ae, dirname as je, resolve as Me } from "node:path";
13
- import { createRequire as Ne } from "node:module";
2
+ import { t } from "./slide-pull-client-CzutXnGc.js";
3
+ import { B as n, Ct as r, Et as i, F as a, H as o, I as s, P as c, R as l, U as u, W as d, Yt as f, at as p, ot as m, q as h, rt as g, st as ee } from "./line-metrics-Baz31mML.js";
4
+ import { t as te } from "./bounded-raw-part-cache-C6ro6Ezf.js";
5
+ import { a as ne, c as re, i as ie, l as ae, r as oe, u as se } from "./document-pull-client-Ux4a_ax8.js";
6
+ import { mn as ce, pn as le } from "./plot-area-frame-Dg1VIpUU.js";
7
+ import { t as ue } from "./transfer-D0U6Uhn4.js";
8
+ import { a as de, c as fe, d as pe, l as me, o as he, r as ge, s as _e, t as ve, u as ye } from "./worksheet-pull-client-Cxj3Ej0s.js";
9
+ import { a as be, i as xe, n as Se, r as Ce } from "./session-CNVc3VJ4.js";
10
+ import { a as we, n as Te, r as Ee, t as De } from "./render-DEHjijQD.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";
14
15
  //#region packages/core/src/internal/owned-session.ts
15
- async function v(e, t) {
16
+ async function _(e, t) {
16
17
  let n = await e(), r;
17
18
  try {
18
19
  return await t(n);
@@ -28,7 +29,7 @@ async function v(e, t) {
28
29
  }
29
30
  //#endregion
30
31
  //#region packages/core/src/internal/in-process-pull-transport.ts
31
- var y = class {
32
+ var v = class {
32
33
  nextRequestId = 1;
33
34
  terminated = !1;
34
35
  constructor(e, t) {
@@ -54,30 +55,30 @@ var y = class {
54
55
  };
55
56
  //#endregion
56
57
  //#region packages/node/src/wasm-loader.ts
57
- function Pe(e) {
58
- return new WebAssembly.Module(Oe(e));
58
+ function Fe(e) {
59
+ return new WebAssembly.Module(ke(e));
59
60
  }
60
- function b(e, t = Pe) {
61
+ function Ie(e, t = Fe) {
61
62
  let n = {};
62
63
  return () => n.value ??= t(e());
63
64
  }
64
- function Fe(e, t, n) {
65
- let r = je(ke(e)), i = Me(r, t);
66
- if (De(i)) return i;
67
- let a = Me(r, Ae(t));
68
- return De(a) || !n ? a : Ne(e).resolve(n);
65
+ function y(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);
69
70
  }
70
71
  //#endregion
71
72
  //#region packages/node/src/pptx.ts
72
- var Ie = b(() => Fe(import.meta.url, "pptx_parser_bg.wasm", "@silurus/ooxml-pptx/wasm-binary"));
73
- async function Le(e, t = {}) {
74
- return Re(e, t);
75
- }
73
+ var Le = Ie(() => y(import.meta.url, "pptx_parser_bg.wasm", "@silurus/ooxml-pptx/wasm-binary"));
76
74
  async function Re(e, t = {}) {
77
- let n = await xe(Ve(e), Ie(), t);
78
- return new ze(n.closeArchive, n.archive, n.bootstrap, n.metrics, t.signal);
75
+ return ze(e, t);
76
+ }
77
+ async function ze(e, t = {}) {
78
+ let n = await Se(He(e), Le(), t);
79
+ return new Be(n.closeArchive, n.archive, n.bootstrap, n.metrics, t.signal);
79
80
  }
80
- var ze = class {
81
+ var Be = class {
81
82
  slideCount;
82
83
  slideWidth;
83
84
  slideHeight;
@@ -93,12 +94,12 @@ var ze = class {
93
94
  renderTail = Promise.resolve();
94
95
  fetchImage = (e, t) => this.getPartInternal(e, t, (t) => t.extract_image(e));
95
96
  fetchMedia = (e) => this.getPartInternal(e, "application/octet-stream", (t) => t.extract_media(e));
96
- rawParts = new ne({
97
+ rawParts = new te({
97
98
  maxEntries: 64,
98
- maxBytes: g
99
+ maxBytes: h
99
100
  });
100
101
  constructor(e, n, r, i, a) {
101
- 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({
102
103
  slideCount: this.slideCount,
103
104
  transport: this.transport,
104
105
  open: async (e, t) => {
@@ -132,8 +133,8 @@ var ze = class {
132
133
  }
133
134
  async renderSlide(e, t, n) {
134
135
  return this.assertOpen(), this.enqueueRender(async () => {
135
- x(this.signal);
136
- let { renderSlideNode: r } = await import("./render-CoqMHcbF.js").then((e) => e.i);
136
+ b(this.signal);
137
+ let { renderSlideNode: r } = await import("./render-DEHjijQD.js").then((e) => e.i);
137
138
  await r(e, {
138
139
  slideWidth: this.slideWidth,
139
140
  slideHeight: this.slideHeight,
@@ -147,7 +148,7 @@ var ze = class {
147
148
  ...n,
148
149
  fetchImage: this.fetchImage,
149
150
  fetchMedia: this.fetchMedia
150
- }), x(this.signal);
151
+ }), b(this.signal);
151
152
  }).catch((e) => this.failOperation(e));
152
153
  }
153
154
  [Symbol.asyncIterator]() {
@@ -160,13 +161,13 @@ var ze = class {
160
161
  let e;
161
162
  try {
162
163
  for (let e = 0; e < this.slideCount; e += 1) {
163
- x(this.signal);
164
+ b(this.signal);
164
165
  let t = await this.slideClient.load(e);
165
166
  if (!t) throw Error(`PPTX slide ${e} was not decoded`);
166
- 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;
167
168
  }
168
169
  } catch (t) {
169
- throw e = f(t) ?? t, this.metrics.fail(e), e;
170
+ throw e = p(t) ?? t, this.metrics.fail(e), e;
170
171
  } finally {
171
172
  try {
172
173
  await this.close();
@@ -180,17 +181,17 @@ var ze = class {
180
181
  }
181
182
  async release() {
182
183
  let e;
183
- await this.renderTail, p(this.fetchImage), o(this.fetchImage);
184
+ await this.renderTail, i(this.fetchImage), r(this.fetchImage);
184
185
  try {
185
186
  await this.slidePull.reset();
186
187
  } catch (t) {
187
- e = f(t) ?? t;
188
+ e = p(t) ?? t;
188
189
  }
189
190
  this.transport.terminate(), this.rawParts.clear();
190
191
  try {
191
192
  this.closeArchive();
192
193
  } catch (t) {
193
- e ??= f(t) ?? t;
194
+ e ??= p(t) ?? t;
194
195
  }
195
196
  if (e !== void 0) throw this.metrics.fail(e), e;
196
197
  this.metrics.checkpoint("presentation session closed"), this.metrics.succeed({ slides: this.consumedSlides });
@@ -201,14 +202,14 @@ var ze = class {
201
202
  }
202
203
  getPartInternal(e, t, n) {
203
204
  return this.rawParts.get(e, t, () => {
204
- x(this.signal);
205
+ b(this.signal);
205
206
  let e = n(this.archive);
206
207
  return this.refreshResourceUsage(), new Blob([e], { type: t });
207
208
  });
208
209
  }
209
210
  refreshResourceUsage() {
210
211
  try {
211
- this.usage = _(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
212
+ this.usage = g(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
212
213
  } catch {}
213
214
  return this.usage;
214
215
  }
@@ -217,29 +218,29 @@ var ze = class {
217
218
  if (this.resourceFailure) throw this.resourceFailure;
218
219
  }
219
220
  failOperation(e) {
220
- let t = f(e) ?? e;
221
- throw t instanceof m && (this.resourceFailure ??= t), this.metrics.fail(t), t;
221
+ let t = p(e) ?? e;
222
+ throw t instanceof f && (this.resourceFailure ??= t), this.metrics.fail(t), t;
222
223
  }
223
224
  };
224
- async function Be(e, t = {}) {
225
- return v(() => Re(e, t), async (e) => {
225
+ async function Ve(e, t = {}) {
226
+ return _(() => ze(e, t), async (e) => {
226
227
  let t = [];
227
228
  for await (let n of e.slides()) t.push(n);
228
229
  return e.materialize(t);
229
230
  });
230
231
  }
231
- function Ve(e) {
232
+ function He(e) {
232
233
  return e instanceof Uint8Array ? e : new Uint8Array(e);
233
234
  }
234
- function x(e) {
235
+ function b(e) {
235
236
  if (!e?.aborted) return;
236
237
  let t = /* @__PURE__ */ Error("PPTX presentation session was aborted");
237
238
  throw t.name = "AbortError", t;
238
239
  }
239
240
  //#endregion
240
241
  //#region packages/docx/src/document-pull-worker.ts
241
- var He = Math.max(u, d), Ue = class {
242
- coordinator = new a();
242
+ var Ue = Math.max(u, d), We = class {
243
+ coordinator = new s();
243
244
  host = null;
244
245
  identity = null;
245
246
  constructor(e, t = (e) => e(this.requireArchive())) {
@@ -251,9 +252,9 @@ var He = Math.max(u, d), Ue = class {
251
252
  t.open_document_cursor(e.operationId, e.generation);
252
253
  });
253
254
  let t = 0;
254
- this.identity = e, this.host = new r({
255
+ this.identity = e, this.host = new a({
255
256
  ...e,
256
- maxByteCredit: He,
257
+ maxByteCredit: Ue,
257
258
  coordinator: this.coordinator,
258
259
  driver: {
259
260
  pull: (n) => {
@@ -261,9 +262,9 @@ var He = Math.max(u, d), Ue = class {
261
262
  try {
262
263
  r = this.executeArchive((r) => r.pull_document_chunk(t, e.operationId, e.generation, n));
263
264
  } catch (e) {
264
- throw ee(e, n, He) || e;
265
+ throw ee(e, n, Ue) || e;
265
266
  }
266
- let i = le(r);
267
+ let i = ue(r);
267
268
  return {
268
269
  payload: i,
269
270
  byteLength: i.byteLength,
@@ -280,27 +281,27 @@ var He = Math.max(u, d), Ue = class {
280
281
  close: () => this.executeArchive((e) => e.close_document_session()),
281
282
  resourceUsage: () => {
282
283
  let e = this.executeArchive((e) => e.document_cursor_resource_usage?.());
283
- return e ? _(e) : void 0;
284
+ return e ? g(e) : void 0;
284
285
  }
285
286
  }
286
287
  });
287
288
  }
288
289
  dispatch(e, t) {
289
290
  return !this.host || !this.identity ? (t({
290
- protocol: s,
291
+ protocol: c,
291
292
  kind: "error",
292
293
  sessionId: e.sessionId,
293
294
  operationId: e.operationId,
294
295
  generation: e.generation,
295
296
  requestId: e.requestId,
296
- error: h(/* @__PURE__ */ Error("DOCX document pull session is not open"))
297
+ error: m(/* @__PURE__ */ Error("DOCX document pull session is not open"))
297
298
  }), Promise.resolve()) : this.host.dispatch(e, t);
298
299
  }
299
300
  async reset() {
300
301
  if (this.host) try {
301
302
  this.archive() && this.executeArchive((e) => e.close_document_session());
302
303
  } finally {
303
- this.host = null, this.identity = null, this.coordinator = new a();
304
+ this.host = null, this.identity = null, this.coordinator = new s();
304
305
  }
305
306
  }
306
307
  requireArchive() {
@@ -308,181 +309,181 @@ var He = Math.max(u, d), Ue = class {
308
309
  if (!e) throw Error("No docx loaded");
309
310
  return e;
310
311
  }
311
- }, We = /* @__PURE__ */ e({
312
- DocxArchive: () => S,
313
- default: () => nt,
314
- docx_to_markdown: () => Ge,
315
- extract_image: () => Ke,
316
- initSync: () => tt,
317
- parse_docx: () => qe,
318
- reinit: () => rt
319
- }), S = class {
312
+ }, Ge = /* @__PURE__ */ e({
313
+ DocxArchive: () => x,
314
+ default: () => rt,
315
+ docx_to_markdown: () => Ke,
316
+ extract_image: () => qe,
317
+ initSync: () => nt,
318
+ parse_docx: () => Je,
319
+ reinit: () => it
320
+ }), x = class {
320
321
  __destroy_into_raw() {
321
322
  let e = this.__wbg_ptr;
322
- return this.__wbg_ptr = 0, Ye.unregister(this), e;
323
+ return this.__wbg_ptr = 0, Xe.unregister(this), e;
323
324
  }
324
325
  free() {
325
326
  let e = this.__destroy_into_raw();
326
- I.__wbg_docxarchive_free(e, 0);
327
+ F.__wbg_docxarchive_free(e, 0);
327
328
  }
328
329
  acknowledge_document_chunk(e, t, n) {
329
- let r = I.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
330
- if (r[1]) throw j(r[0]);
330
+ let r = F.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
331
+ if (r[1]) throw A(r[0]);
331
332
  }
332
333
  assert_healthy() {
333
- let e = I.docxarchive_assert_healthy(this.__wbg_ptr);
334
- if (e[1]) throw j(e[0]);
334
+ let e = F.docxarchive_assert_healthy(this.__wbg_ptr);
335
+ if (e[1]) throw A(e[0]);
335
336
  }
336
337
  cancel_document_cursor() {
337
- I.docxarchive_cancel_document_cursor(this.__wbg_ptr);
338
+ F.docxarchive_cancel_document_cursor(this.__wbg_ptr);
338
339
  }
339
340
  close_document_session() {
340
- I.docxarchive_close_document_session(this.__wbg_ptr);
341
+ F.docxarchive_close_document_session(this.__wbg_ptr);
341
342
  }
342
343
  document_chunk_done() {
343
- let e = I.docxarchive_document_chunk_done(this.__wbg_ptr);
344
- if (e[2]) throw j(e[1]);
344
+ let e = F.docxarchive_document_chunk_done(this.__wbg_ptr);
345
+ if (e[2]) throw A(e[1]);
345
346
  return e[0] !== 0;
346
347
  }
347
348
  document_cursor_resource_usage() {
348
- let e = I.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);
349
- if (e[3]) throw j(e[2]);
350
- var t = C(e[0], e[1]).slice();
351
- return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
349
+ let e = F.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);
350
+ if (e[3]) throw A(e[2]);
351
+ var t = S(e[0], e[1]).slice();
352
+ return F.__wbindgen_free(e[0], e[1] * 1, 1), t;
352
353
  }
353
354
  extract_image(e) {
354
- let t = A(e, I.__wbindgen_malloc, I.__wbindgen_realloc), n = F, r = I.docxarchive_extract_image(this.__wbg_ptr, t, n);
355
- if (r[3]) throw j(r[2]);
356
- var i = C(r[0], r[1]).slice();
357
- return I.__wbindgen_free(r[0], r[1] * 1, 1), i;
355
+ let t = k(e, F.__wbindgen_malloc, F.__wbindgen_realloc), n = P, r = F.docxarchive_extract_image(this.__wbg_ptr, t, n);
356
+ if (r[3]) throw A(r[2]);
357
+ var i = S(r[0], r[1]).slice();
358
+ return F.__wbindgen_free(r[0], r[1] * 1, 1), i;
358
359
  }
359
360
  constructor(e, t, n, r) {
360
- 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);
361
- if (o[2]) throw j(o[1]);
362
- return this.__wbg_ptr = o[0] >>> 0, Ye.register(this, this.__wbg_ptr, this), this;
361
+ let i = O(e, F.__wbindgen_malloc), a = P, o = F.docxarchive_new(i, a, !D(t), D(t) ? BigInt(0) : t, !D(n), D(n) ? BigInt(0) : n, !D(r), D(r) ? BigInt(0) : r);
362
+ if (o[2]) throw A(o[1]);
363
+ return this.__wbg_ptr = o[0] >>> 0, Xe.register(this, this.__wbg_ptr, this), this;
363
364
  }
364
365
  open_document_cursor(e, t) {
365
- let n = I.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
366
- if (n[1]) throw j(n[0]);
366
+ let n = F.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
367
+ if (n[1]) throw A(n[0]);
367
368
  }
368
369
  parse() {
369
- let e = I.docxarchive_parse(this.__wbg_ptr);
370
- if (e[3]) throw j(e[2]);
371
- var t = C(e[0], e[1]).slice();
372
- return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
370
+ let e = F.docxarchive_parse(this.__wbg_ptr);
371
+ if (e[3]) throw A(e[2]);
372
+ var t = S(e[0], e[1]).slice();
373
+ return F.__wbindgen_free(e[0], e[1] * 1, 1), t;
373
374
  }
374
375
  pull_document_chunk(e, t, n, r) {
375
- let i = I.docxarchive_pull_document_chunk(this.__wbg_ptr, e, t, n, r);
376
- if (i[3]) throw j(i[2]);
377
- var a = C(i[0], i[1]).slice();
378
- return I.__wbindgen_free(i[0], i[1] * 1, 1), a;
376
+ let i = F.docxarchive_pull_document_chunk(this.__wbg_ptr, e, t, n, r);
377
+ if (i[3]) throw A(i[2]);
378
+ var a = S(i[0], i[1]).slice();
379
+ return F.__wbindgen_free(i[0], i[1] * 1, 1), a;
379
380
  }
380
381
  resource_usage() {
381
- let e = I.docxarchive_resource_usage(this.__wbg_ptr);
382
- if (e[3]) throw j(e[2]);
383
- var t = C(e[0], e[1]).slice();
384
- return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
382
+ let e = F.docxarchive_resource_usage(this.__wbg_ptr);
383
+ if (e[3]) throw A(e[2]);
384
+ var t = S(e[0], e[1]).slice();
385
+ return F.__wbindgen_free(e[0], e[1] * 1, 1), t;
385
386
  }
386
387
  to_markdown() {
387
388
  let e, t;
388
389
  try {
389
- let i = I.docxarchive_to_markdown(this.__wbg_ptr);
390
+ let i = F.docxarchive_to_markdown(this.__wbg_ptr);
390
391
  var n = i[0], r = i[1];
391
- if (i[3]) throw n = 0, r = 0, j(i[2]);
392
- return e = n, t = r, T(n, r);
392
+ if (i[3]) throw n = 0, r = 0, A(i[2]);
393
+ return e = n, t = r, w(n, r);
393
394
  } finally {
394
- I.__wbindgen_free(e, t, 1);
395
+ F.__wbindgen_free(e, t, 1);
395
396
  }
396
397
  }
397
398
  };
398
- Symbol.dispose && (S.prototype[Symbol.dispose] = S.prototype.free);
399
- function Ge(e, t, n) {
399
+ Symbol.dispose && (x.prototype[Symbol.dispose] = x.prototype.free);
400
+ function Ke(e, t, n) {
400
401
  let r, i;
401
402
  try {
402
- 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);
403
+ let s = O(e, F.__wbindgen_malloc), c = P, l = F.docx_to_markdown(s, c, !D(t), D(t) ? BigInt(0) : t, !D(n), D(n) ? BigInt(0) : n);
403
404
  var a = l[0], o = l[1];
404
- if (l[3]) throw a = 0, o = 0, j(l[2]);
405
- return r = a, i = o, T(a, o);
405
+ if (l[3]) throw a = 0, o = 0, A(l[2]);
406
+ return r = a, i = o, w(a, o);
406
407
  } finally {
407
- I.__wbindgen_free(r, i, 1);
408
+ F.__wbindgen_free(r, i, 1);
408
409
  }
409
410
  }
410
- function Ke(e, t, n, r) {
411
- 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);
412
- if (c[3]) throw j(c[2]);
413
- var l = C(c[0], c[1]).slice();
414
- return I.__wbindgen_free(c[0], c[1] * 1, 1), l;
411
+ function qe(e, t, n, r) {
412
+ let i = O(e, F.__wbindgen_malloc), a = P, o = k(t, F.__wbindgen_malloc, F.__wbindgen_realloc), s = P, c = F.extract_image(i, a, o, s, !D(n), D(n) ? BigInt(0) : n, !D(r), D(r) ? BigInt(0) : r);
413
+ if (c[3]) throw A(c[2]);
414
+ var l = S(c[0], c[1]).slice();
415
+ return F.__wbindgen_free(c[0], c[1] * 1, 1), l;
415
416
  }
416
- function qe(e, t, n) {
417
- 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);
418
- if (a[3]) throw j(a[2]);
419
- var o = C(a[0], a[1]).slice();
420
- return I.__wbindgen_free(a[0], a[1] * 1, 1), o;
417
+ function Je(e, t, n) {
418
+ let r = O(e, F.__wbindgen_malloc), i = P, a = F.parse_docx(r, i, !D(t), D(t) ? BigInt(0) : t, !D(n), D(n) ? BigInt(0) : n);
419
+ if (a[3]) throw A(a[2]);
420
+ var o = S(a[0], a[1]).slice();
421
+ return F.__wbindgen_free(a[0], a[1] * 1, 1), o;
421
422
  }
422
- function Je() {
423
+ function Ye() {
423
424
  return {
424
425
  __proto__: null,
425
426
  "./docx_parser_bg.js": {
426
427
  __proto__: null,
427
428
  __wbg___wbindgen_throw_6b64449b9b9ed33c: function(e, t) {
428
- throw Error(T(e, t));
429
+ throw Error(w(e, t));
429
430
  },
430
431
  __wbg_error_a6fa202b58aa1cd3: function(e, t) {
431
432
  let n, r;
432
433
  try {
433
- n = e, r = t, console.error(T(e, t));
434
+ n = e, r = t, console.error(w(e, t));
434
435
  } finally {
435
- I.__wbindgen_free(n, r, 1);
436
+ F.__wbindgen_free(n, r, 1);
436
437
  }
437
438
  },
438
439
  __wbg_new_227d7c05414eb861: function() {
439
440
  return /* @__PURE__ */ Error();
440
441
  },
441
442
  __wbg_stack_3b0d974bbf31e44f: function(e, t) {
442
- let n = t.stack, r = A(n, I.__wbindgen_malloc, I.__wbindgen_realloc), i = F;
443
- Xe().setInt32(e + 4, i, !0), Xe().setInt32(e + 0, r, !0);
443
+ let n = t.stack, r = k(n, F.__wbindgen_malloc, F.__wbindgen_realloc), i = P;
444
+ Ze().setInt32(e + 4, i, !0), Ze().setInt32(e + 0, r, !0);
444
445
  },
445
446
  __wbindgen_cast_0000000000000001: function(e, t) {
446
- return T(e, t);
447
+ return w(e, t);
447
448
  },
448
449
  __wbindgen_init_externref_table: function() {
449
- let e = I.__wbindgen_externrefs, t = e.grow(4);
450
+ let e = F.__wbindgen_externrefs, t = e.grow(4);
450
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);
451
452
  }
452
453
  }
453
454
  };
454
455
  }
455
- var Ye = typeof FinalizationRegistry > "u" ? {
456
+ var Xe = typeof FinalizationRegistry > "u" ? {
456
457
  register: () => {},
457
458
  unregister: () => {}
458
- } : new FinalizationRegistry((e) => I.__wbg_docxarchive_free(e >>> 0, 1));
459
- function C(e, t) {
460
- return e >>>= 0, D().subarray(e / 1, e / 1 + t);
459
+ } : new FinalizationRegistry((e) => F.__wbg_docxarchive_free(e >>> 0, 1));
460
+ function S(e, t) {
461
+ return e >>>= 0, E().subarray(e / 1, e / 1 + t);
461
462
  }
462
- var w = null;
463
- function Xe() {
464
- return (w === null || w.buffer.detached === !0 || w.buffer.detached === void 0 && w.buffer !== I.memory.buffer) && (w = new DataView(I.memory.buffer)), w;
463
+ var C = null;
464
+ function Ze() {
465
+ return (C === null || C.buffer.detached === !0 || C.buffer.detached === void 0 && C.buffer !== F.memory.buffer) && (C = new DataView(F.memory.buffer)), C;
465
466
  }
466
- function T(e, t) {
467
- return e >>>= 0, Qe(e, t);
467
+ function w(e, t) {
468
+ return e >>>= 0, $e(e, t);
468
469
  }
469
- var E = null;
470
- function D() {
471
- return (E === null || E.byteLength === 0) && (E = new Uint8Array(I.memory.buffer)), E;
470
+ var T = null;
471
+ function E() {
472
+ return (T === null || T.byteLength === 0) && (T = new Uint8Array(F.memory.buffer)), T;
472
473
  }
473
- function O(e) {
474
+ function D(e) {
474
475
  return e == null;
475
476
  }
476
- function k(e, t) {
477
+ function O(e, t) {
477
478
  let n = t(e.length * 1, 1) >>> 0;
478
- return D().set(e, n / 1), F = e.length, n;
479
+ return E().set(e, n / 1), P = e.length, n;
479
480
  }
480
- function A(e, t, n) {
481
+ function k(e, t, n) {
481
482
  if (n === void 0) {
482
- let n = P.encode(e), r = t(n.length, 1) >>> 0;
483
- return D().subarray(r, r + n.length).set(n), F = n.length, r;
483
+ let n = N.encode(e), r = t(n.length, 1) >>> 0;
484
+ return E().subarray(r, r + n.length).set(n), P = n.length, r;
484
485
  }
485
- let r = e.length, i = t(r, 1) >>> 0, a = D(), o = 0;
486
+ let r = e.length, i = t(r, 1) >>> 0, a = E(), o = 0;
486
487
  for (; o < r; o++) {
487
488
  let t = e.charCodeAt(o);
488
489
  if (t > 127) break;
@@ -490,40 +491,40 @@ function A(e, t, n) {
490
491
  }
491
492
  if (o !== r) {
492
493
  o !== 0 && (e = e.slice(o)), i = n(i, r, r = o + e.length * 3, 1) >>> 0;
493
- let t = D().subarray(i + o, i + r), a = P.encodeInto(e, t);
494
+ let t = E().subarray(i + o, i + r), a = N.encodeInto(e, t);
494
495
  o += a.written, i = n(i, r, o, 1) >>> 0;
495
496
  }
496
- return F = o, i;
497
+ return P = o, i;
497
498
  }
498
- function j(e) {
499
- let t = I.__wbindgen_externrefs.get(e);
500
- return I.__externref_table_dealloc(e), t;
499
+ function A(e) {
500
+ let t = F.__wbindgen_externrefs.get(e);
501
+ return F.__externref_table_dealloc(e), t;
501
502
  }
502
- var M = new TextDecoder("utf-8", {
503
+ var j = new TextDecoder("utf-8", {
503
504
  ignoreBOM: !0,
504
505
  fatal: !0
505
506
  });
506
- M.decode();
507
- var Ze = 2146435072, N = 0;
508
- function Qe(e, t) {
509
- return N += t, N >= Ze && (M = new TextDecoder("utf-8", {
507
+ j.decode();
508
+ var Qe = 2146435072, M = 0;
509
+ function $e(e, t) {
510
+ return M += t, M >= Qe && (j = new TextDecoder("utf-8", {
510
511
  ignoreBOM: !0,
511
512
  fatal: !0
512
- }), M.decode(), N = t), M.decode(D().subarray(e, e + t));
513
+ }), j.decode(), M = t), j.decode(E().subarray(e, e + t));
513
514
  }
514
- var P = new TextEncoder();
515
- "encodeInto" in P || (P.encodeInto = function(e, t) {
516
- let n = P.encode(e);
515
+ var N = new TextEncoder();
516
+ "encodeInto" in N || (N.encodeInto = function(e, t) {
517
+ let n = N.encode(e);
517
518
  return t.set(n), {
518
519
  read: e.length,
519
520
  written: n.length
520
521
  };
521
522
  });
522
- var F = 0, I;
523
- function $e(e, t) {
524
- return I = e.exports, w = null, E = null, I.__wbindgen_start(), I;
523
+ var P = 0, F;
524
+ function et(e, t) {
525
+ return F = e.exports, C = null, T = null, F.__wbindgen_start(), F;
525
526
  }
526
- async function et(e, t) {
527
+ async function tt(e, t) {
527
528
  if (typeof Response == "function" && e instanceof Response) {
528
529
  if (typeof WebAssembly.instantiateStreaming == "function") try {
529
530
  return await WebAssembly.instantiateStreaming(e, t);
@@ -549,60 +550,60 @@ async function et(e, t) {
549
550
  return !1;
550
551
  }
551
552
  }
552
- function tt(e) {
553
- if (I !== void 0) return I;
553
+ function nt(e) {
554
+ if (F !== void 0) return F;
554
555
  e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module: e} = e : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
555
- let t = Je();
556
- return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), $e(new WebAssembly.Instance(e, t), e);
556
+ let t = Ye();
557
+ return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), et(new WebAssembly.Instance(e, t), e);
557
558
  }
558
- async function nt(e) {
559
- if (I !== void 0) return I;
559
+ async function rt(e) {
560
+ if (F !== void 0) return F;
560
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"));
561
- let t = Je();
562
+ let t = Ye();
562
563
  (typeof e == "string" || typeof Request == "function" && e instanceof Request || typeof URL == "function" && e instanceof URL) && (e = fetch(e));
563
- let { instance: n, module: r } = await et(await e, t);
564
- return $e(n, r);
564
+ let { instance: n, module: r } = await tt(await e, t);
565
+ return et(n, r);
565
566
  }
566
- async function rt(e) {
567
- return I = void 0, w = null, E = null, nt(e);
567
+ async function it(e) {
568
+ return F = void 0, C = null, T = null, rt(e);
568
569
  }
569
570
  //#endregion
570
571
  //#region packages/docx/src/internal/node-acquisition.ts
571
- var it, at;
572
+ var at, I;
572
573
  function ot(e) {
573
- if (!at) it = e, at = new Se(We, e);
574
- else if (it !== e) throw Error("DOCX runtime was already initialized with another WebAssembly.Module");
575
- return at;
574
+ if (!I) at = e, I = new Ce(Ge, e);
575
+ else if (at !== e) throw Error("DOCX runtime was already initialized with another WebAssembly.Module");
576
+ return I;
576
577
  }
577
- async function st(e, t, r, a) {
578
- let o = n(r), s = new c({
579
- enabled: o.debug || o.onResourceMetrics !== void 0,
578
+ async function st(e, t, r, i) {
579
+ let a = n(r), s = new l({
580
+ enabled: a.debug || a.onResourceMetrics !== void 0,
580
581
  format: "docx",
581
582
  mode: "node",
582
583
  scope: "session",
583
- policy: o.policy,
584
- onMetrics: o.onResourceMetrics,
585
- emitToConsole: o.debug
584
+ policy: a.policy,
585
+ onMetrics: a.onResourceMetrics,
586
+ emitToConsole: a.debug
586
587
  });
587
588
  s.setSourceBytes(e.byteLength);
588
- let l, u, d;
589
+ let c, u, d;
589
590
  try {
590
591
  lt(r.signal);
591
- let [n, c, f] = i(o.policy), p = S;
592
- l = await ot(t).open(() => new p(e, n, c, f), {
592
+ let [n, l, f] = o(a.policy), p = x;
593
+ c = await ot(t).open(() => new p(e, n, l, f), {
593
594
  signal: r.signal,
594
595
  abortError: ut,
595
596
  disposeOnAbort: (e) => e.free()
596
597
  }), lt(r.signal);
597
- let m = l.proxy;
598
- s.checkpoint("container ready"), u = new Ue(() => m);
598
+ let m = c.proxy;
599
+ s.checkpoint("container ready"), u = new We(() => m);
599
600
  let h = {
600
601
  sessionId: 1,
601
602
  operationId: 1,
602
603
  generation: 1
603
604
  };
604
- u.open(h), d = new y((e, t) => u?.dispatch(e, t), () => void 0);
605
- let g, _ = await a(d, h, {
605
+ u.open(h), d = new v((e, t) => u?.dispatch(e, t), () => void 0);
606
+ let g, ee = await i(d, h, {
606
607
  signal: r.signal,
607
608
  onUsage: (e) => {
608
609
  g = e, s.observeUsage(e);
@@ -610,23 +611,23 @@ async function st(e, t, r, a) {
610
611
  });
611
612
  return g ??= ct(m.document_cursor_resource_usage()), s.observeUsage(g), s.checkpoint("model streamed"), await u.reset(), d.terminate(), {
612
613
  archive: m,
613
- result: _,
614
+ result: ee,
614
615
  usage: g,
615
616
  metrics: s,
616
- closeArchive: () => l?.close((e) => e.free())
617
+ closeArchive: () => c?.close((e) => e.free())
617
618
  };
618
619
  } catch (e) {
619
620
  await u?.reset().catch(() => void 0), d?.terminate();
620
621
  try {
621
- l?.close((e) => e.free());
622
+ c?.close((e) => e.free());
622
623
  } catch {}
623
- let t = f(e) ?? e;
624
+ let t = p(e) ?? e;
624
625
  throw s.fail(t), t;
625
626
  }
626
627
  }
627
628
  function ct(e) {
628
629
  try {
629
- return _(e);
630
+ return g(e);
630
631
  } catch {
631
632
  return;
632
633
  }
@@ -640,25 +641,25 @@ function ut() {
640
641
  }
641
642
  //#endregion
642
643
  //#region packages/node/src/docx.ts
643
- var dt = b(() => Fe(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
644
+ var dt = Ie(() => y(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
644
645
  async function ft(e, t) {
645
646
  if (!t?.factory) throw TypeError("openDocxDocument requires a canvas factory");
646
- let n = await st(gt(e), dt(), t, (e, t, n) => se(e, t, n));
647
+ let n = await st(gt(e), dt(), t, (e, t, n) => oe(e, t, n));
647
648
  try {
648
649
  L(t.signal);
649
- let e = t.factory.createCanvas(1, 1), r = oe(n.result, { measureContext: e.getContext("2d") }), i = ht(t.currentDate), a = re(n.result, r, i).layoutVariants.defaultLayout, o = new mt(n.closeArchive, n.archive, n.result, r, a, t.factory, i, n.usage, n.metrics, t.signal);
650
+ let e = t.factory.createCanvas(1, 1), r = ae(n.result, { measureContext: e.getContext("2d") }), i = ht(t.currentDate), a = ne(n.result, r, i).layoutVariants.defaultLayout, o = new mt(n.closeArchive, n.archive, n.result, r, a, t.factory, i, n.usage, n.metrics, t.signal);
650
651
  return n.metrics.observeUsage(o.resourceUsage), n.metrics.checkpoint("pagination ready"), o;
651
652
  } catch (e) {
652
653
  try {
653
654
  n.closeArchive();
654
655
  } catch {}
655
- let t = f(e) ?? e;
656
+ let t = p(e) ?? e;
656
657
  throw n.metrics.fail(t), t;
657
658
  }
658
659
  }
659
660
  async function pt(e, t = {}) {
660
- return v(async () => {
661
- let n = await st(gt(e), dt(), t, (e, t, n) => ae(e, t, n)), r = !1;
661
+ return _(async () => {
662
+ let n = await st(gt(e), dt(), t, (e, t, n) => ie(e, t, n)), r = !1;
662
663
  return {
663
664
  acquired: n,
664
665
  markSucceeded: () => {
@@ -674,7 +675,7 @@ async function pt(e, t = {}) {
674
675
  };
675
676
  }, async ({ acquired: e, markSucceeded: t }) => {
676
677
  try {
677
- let n = ce(e.result);
678
+ let n = se(e.result);
678
679
  return e.metrics.checkpoint("document materialized", e.usage), t(), n;
679
680
  } catch (t) {
680
681
  throw e.metrics.fail(t), t;
@@ -709,7 +710,7 @@ var mt = class {
709
710
  }
710
711
  refreshResourceUsage() {
711
712
  try {
712
- this.lastResourceUsage = _(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
713
+ this.lastResourceUsage = g(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
713
714
  } catch {}
714
715
  return this.lastResourceUsage;
715
716
  }
@@ -725,7 +726,7 @@ var mt = class {
725
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 () => {
726
727
  L(this.signal);
727
728
  let n = this.requireState(), r = this.factory.createCanvas(1, 1);
728
- return await Ce(this.factory, () => ie(n.source, r, e, {
729
+ return await we(this.factory, () => re(n.source, r, e, {
729
730
  ...t,
730
731
  currentDate: this.defaultCurrentDateMs,
731
732
  defaultCurrentDateMs: this.defaultCurrentDateMs,
@@ -733,8 +734,8 @@ var mt = class {
733
734
  fetchImage: this.fetchImage
734
735
  })), L(this.signal), r;
735
736
  }).catch((e) => {
736
- let t = f(e) ?? e;
737
- throw t instanceof m && (this.resourceFailure ??= t), this.metrics.fail(t), t;
737
+ let t = p(e) ?? e;
738
+ throw t instanceof f && (this.resourceFailure ??= t), this.metrics.fail(t), t;
738
739
  }));
739
740
  }
740
741
  async *pages(e = {}) {
@@ -752,7 +753,7 @@ var mt = class {
752
753
  };
753
754
  }
754
755
  } catch (e) {
755
- throw t = f(e) ?? e, t;
756
+ throw t = p(e) ?? e, t;
756
757
  } finally {
757
758
  try {
758
759
  await this.close();
@@ -769,11 +770,11 @@ var mt = class {
769
770
  return this.renderTail = t.then(() => void 0, () => void 0), t;
770
771
  }
771
772
  async release() {
772
- await this.renderTail, p(this.fetchImage), o(this.fetchImage), this.state = null;
773
+ await this.renderTail, i(this.fetchImage), r(this.fetchImage), this.state = null;
773
774
  try {
774
775
  this.closeArchive();
775
776
  } catch (e) {
776
- let t = f(e) ?? e;
777
+ let t = p(e) ?? e;
777
778
  throw this.metrics.fail(t), t;
778
779
  }
779
780
  this.metrics.checkpoint("document session closed", this.lastResourceUsage), this.metrics.succeed({ pages: this.pageCount });
@@ -1058,49 +1059,49 @@ async function At(e) {
1058
1059
  //#region packages/xlsx/src/internal/node-acquisition.ts
1059
1060
  var jt, Mt;
1060
1061
  function Nt(e) {
1061
- if (!Mt) jt = e, Mt = new Se(_t, e);
1062
+ if (!Mt) jt = e, Mt = new Ce(_t, e);
1062
1063
  else if (jt !== e) throw Error("XLSX runtime was already initialized with another WebAssembly.Module");
1063
1064
  return Mt;
1064
1065
  }
1065
1066
  async function Pt(e, t, r = {}) {
1066
- let a = n(r), o = new c({
1067
- enabled: a.debug || a.onResourceMetrics !== void 0,
1067
+ let i = n(r), a = new l({
1068
+ enabled: i.debug || i.onResourceMetrics !== void 0,
1068
1069
  format: "xlsx",
1069
1070
  mode: "node",
1070
1071
  scope: "session",
1071
- policy: a.policy,
1072
- onMetrics: a.onResourceMetrics,
1073
- emitToConsole: a.debug
1072
+ policy: i.policy,
1073
+ onMetrics: i.onResourceMetrics,
1074
+ emitToConsole: i.debug
1074
1075
  });
1075
- o.setSourceBytes(e.byteLength);
1076
+ a.setSourceBytes(e.byteLength);
1076
1077
  let s;
1077
1078
  try {
1078
1079
  It(r.signal);
1079
- let [n, c, l] = i(a.policy), u = R;
1080
+ let [n, c, l] = o(i.policy), u = R;
1080
1081
  s = await Nt(t).open(() => new u(e, n, c, l), {
1081
1082
  signal: r.signal,
1082
1083
  abortError: Lt,
1083
1084
  disposeOnAbort: (e) => e.free()
1084
1085
  }), It(r.signal);
1085
1086
  let d = s.proxy, f = JSON.parse(new TextDecoder().decode(d.parse())), p = Ft(d.resource_usage());
1086
- return o.observeUsage(p), o.checkpoint("workbook index ready"), {
1087
+ return a.observeUsage(p), a.checkpoint("workbook index ready"), {
1087
1088
  archive: d,
1088
1089
  workbookIndex: f,
1089
1090
  usage: p,
1090
- metrics: o,
1091
+ metrics: a,
1091
1092
  closeArchive: () => s?.close((e) => e.free())
1092
1093
  };
1093
1094
  } catch (e) {
1094
1095
  try {
1095
1096
  s?.close((e) => e.free());
1096
1097
  } catch {}
1097
- let t = f(e) ?? e;
1098
- throw o.fail(t), t;
1098
+ let t = p(e) ?? e;
1099
+ throw a.fail(t), t;
1099
1100
  }
1100
1101
  }
1101
1102
  function Ft(e) {
1102
1103
  try {
1103
- return _(e);
1104
+ return g(e);
1104
1105
  } catch (e) {
1105
1106
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
1106
1107
  throw e;
@@ -1115,7 +1116,7 @@ function Lt() {
1115
1116
  }
1116
1117
  //#endregion
1117
1118
  //#region packages/node/src/xlsx.ts
1118
- var Rt = b(() => Fe(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1119
+ var Rt = Ie(() => y(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1119
1120
  async function $(e, t = {}) {
1120
1121
  let n = await Pt(Kt(e), Rt(), t);
1121
1122
  return new zt(n.closeArchive, n.archive, n.workbookIndex, n.metrics, n.usage, t.signal);
@@ -1135,7 +1136,7 @@ var zt = class {
1135
1136
  rowBatches = 0;
1136
1137
  emittedRows = 0;
1137
1138
  constructor(e, t, n, r, i, a) {
1138
- this.closeArchive = e, this.archive = t, this.metrics = r, this.signal = a, this.workbookIndex = Wt(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({
1139
+ this.closeArchive = e, this.archive = t, this.metrics = r, this.signal = a, this.workbookIndex = Wt(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({
1139
1140
  transport: this.transport,
1140
1141
  sharedStrings: n.sharedStrings,
1141
1142
  open: async (e, t, n) => {
@@ -1183,13 +1184,13 @@ var zt = class {
1183
1184
  }
1184
1185
  this.completedWorksheets += 1, this.metrics.checkpoint("worksheet stream complete", this.lastUsage);
1185
1186
  } catch (e) {
1186
- throw r = f(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1187
+ throw r = p(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1187
1188
  } finally {
1188
1189
  try {
1189
1190
  await this.cleanupOperation(n, r === void 0 ? "closed" : "request-error");
1190
1191
  } catch (e) {
1191
1192
  if (r === void 0) {
1192
- let t = f(e) ?? e;
1193
+ let t = p(e) ?? e;
1193
1194
  throw this.metrics.fail(t), await this.close().catch(() => void 0), t;
1194
1195
  }
1195
1196
  }
@@ -1204,12 +1205,12 @@ var zt = class {
1204
1205
  try {
1205
1206
  await this.worksheetPullClient.cancelAll(t);
1206
1207
  } catch (e) {
1207
- n = f(e) ?? e;
1208
+ n = p(e) ?? e;
1208
1209
  }
1209
1210
  try {
1210
1211
  await this.pull.reset();
1211
1212
  } catch (e) {
1212
- n ??= f(e) ?? e;
1213
+ n ??= p(e) ?? e;
1213
1214
  }
1214
1215
  if (this.active === e && (this.active = void 0), n !== void 0) throw n;
1215
1216
  })(), e.cleanupPromise;
@@ -1219,13 +1220,13 @@ var zt = class {
1219
1220
  if (this.active) try {
1220
1221
  await this.cleanupOperation(this.active, "closed");
1221
1222
  } catch (t) {
1222
- e = f(t) ?? t;
1223
+ e = p(t) ?? t;
1223
1224
  }
1224
1225
  this.transport.terminate();
1225
1226
  try {
1226
1227
  this.closeArchive();
1227
1228
  } catch (t) {
1228
- e ??= f(t) ?? t;
1229
+ e ??= p(t) ?? t;
1229
1230
  }
1230
1231
  if (e !== void 0) throw this.metrics.fail(e), e;
1231
1232
  this.metrics.checkpoint("workbook session closed", this.lastUsage), this.metrics.succeed({
@@ -1241,13 +1242,13 @@ var zt = class {
1241
1242
  }
1242
1243
  };
1243
1244
  async function Bt(e, t = {}) {
1244
- return v(() => $(e, t), async (e) => structuredClone(e.workbookIndex));
1245
+ return _(() => $(e, t), async (e) => structuredClone(e.workbookIndex));
1245
1246
  }
1246
1247
  async function Vt(e, t, n = {}) {
1247
- return v(() => $(e, n), async (e) => (await Ut(e, t)).worksheet);
1248
+ return _(() => $(e, n), async (e) => (await Ut(e, t)).worksheet);
1248
1249
  }
1249
1250
  async function Ht(e, t = {}) {
1250
- return v(() => $(e, t), async (e) => {
1251
+ return _(() => $(e, t), async (e) => {
1251
1252
  let t = [], n = {
1252
1253
  rows: 0,
1253
1254
  cells: 0,
@@ -1255,8 +1256,8 @@ async function Ht(e, t = {}) {
1255
1256
  jsonBytes: 0
1256
1257
  };
1257
1258
  for (let r = 0; r < e.sheetCount; r += 1) {
1258
- let i = await Ut(e, r), a = ue(n, i.usage);
1259
- ge(a, "materialize-workbook", void 0, i.resourceUsage), n = a, t.push(i.worksheet);
1259
+ let i = await Ut(e, r), a = de(n, i.usage);
1260
+ _e(a, "materialize-workbook", void 0, i.resourceUsage), n = a, t.push(i.worksheet);
1260
1261
  }
1261
1262
  return {
1262
1263
  workbookIndex: structuredClone(e.workbookIndex),
@@ -1271,16 +1272,16 @@ async function Ut(e, t) {
1271
1272
  ownedUtf8Bytes: 0
1272
1273
  }, i, a, o;
1273
1274
  for await (let s of e.worksheetRows(t)) if (o = s.usage ?? o, s.kind === "rows") {
1274
- let e = me(r, fe(s.rows));
1275
- pe(e, "materialize-worksheet", void 0, o), n.push(...s.rows), r = e;
1275
+ let e = he(r, pe(s.rows));
1276
+ me(e, "materialize-worksheet", void 0, o), n.push(...s.rows), r = e;
1276
1277
  } else {
1277
1278
  a = s.worksheet, a.rows = a.parseError ? [] : n;
1278
- let e = ve(a, a.parseError ? {
1279
+ let e = ye(a, a.parseError ? {
1279
1280
  rows: 0,
1280
1281
  cells: 0,
1281
1282
  ownedUtf8Bytes: 0
1282
1283
  } : r);
1283
- pe(e, "materialize-worksheet", void 0, o), de(e.jsonBytes, "materialize-worksheet", void 0, o), r = e, i = e;
1284
+ me(e, "materialize-worksheet", void 0, o), fe(e.jsonBytes, "materialize-worksheet", void 0, o), r = e, i = e;
1284
1285
  }
1285
1286
  if (!a || !i) throw Error(`XLSX worksheet ${t} did not produce a terminal model`);
1286
1287
  return {
@@ -1299,7 +1300,7 @@ function Wt(e, t = /* @__PURE__ */ new WeakSet()) {
1299
1300
  }
1300
1301
  function Gt(e) {
1301
1302
  try {
1302
- return _(e);
1303
+ return g(e);
1303
1304
  } catch (e) {
1304
1305
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
1305
1306
  throw e;
@@ -1309,4 +1310,4 @@ function Kt(e) {
1309
1310
  return e instanceof Uint8Array ? e : new Uint8Array(e);
1310
1311
  }
1311
1312
  //#endregion
1312
- export { l as OoxmlDecodedImageLimitError, m as OoxmlResourceLimitError, Ee as installImageBitmapShim, we as installOffscreenCanvasShim, te as isOoxmlDecodedImageLimitError, pt as materializeDocxDocument, Be as materializePptxPresentation, Ht as materializeXlsxWorkbook, Bt as materializeXlsxWorkbookIndex, Vt as materializeXlsxWorksheet, ft as openDocxDocument, Le as openPptxPresentation, $ as openXlsxWorkbook, Te as renderSlideNode };
1313
+ export { le as OoxmlDecodedImageLimitError, f as OoxmlResourceLimitError, De as installImageBitmapShim, Te as installOffscreenCanvasShim, ce as isOoxmlDecodedImageLimitError, pt as materializeDocxDocument, Ve as materializePptxPresentation, Ht as materializeXlsxWorkbook, Bt as materializeXlsxWorkbookIndex, Vt as materializeXlsxWorksheet, ft as openDocxDocument, Re as openPptxPresentation, $ as openXlsxWorkbook, Ee as renderSlideNode };