@silurus/ooxml 0.89.7 → 0.89.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/assets/render-worker-CSJJ7vFD.js +15 -0
- package/dist/assets/render-worker-Ck21oePL.js +16 -0
- package/dist/assets/render-worker-jGsxSIGb.js +35 -0
- package/dist/{bounded-raw-part-cache-B8t03tSP.js → bounded-raw-part-cache-B5a6cGKO.js} +1713 -1515
- package/dist/{canvas-viewer-mechanics-DI38gHNV.js → canvas-viewer-mechanics-BsqaoYgK.js} +2 -2
- package/dist/{cfb-guard-BIaHdonq.js → cfb-guard-DzYlucez.js} +1 -1
- package/dist/chart-ex.mjs +367 -367
- package/dist/{comment-overlay-controller-Crm5Syhx.js → comment-overlay-controller-b3tKmzMa.js} +29 -25
- package/dist/{comment-ui-runtime-DKlEfBPp.js → comment-ui-runtime-BlgDzQx_.js} +3 -3
- package/dist/{comment-ui-runtime-BfEPgl5r.js → comment-ui-runtime-Bp37ytDC.js} +3 -3
- package/dist/{document-model-source-xnkMoTZ_.js → document-model-source-BlMfm6po.js} +37 -37
- package/dist/{document-pull-client-CzhPbnY_.js → document-pull-client-_G-DIh2T.js} +17071 -13819
- package/dist/{document-pull-worker-Bkewz-So.js → document-pull-worker-hMKJ5RdB.js} +14 -14
- package/dist/{docx-BWyACb-n.js → docx-DE-Di6SH.js} +33 -33
- package/dist/{docx-BgCQiuuN.js → docx-Do90Z4L7.js} +593 -593
- package/dist/{docx-model-source-DCRFgO7-.js → docx-model-source-zYIufUjR.js} +6 -6
- package/dist/docx.mjs +4 -4
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{drawingml-shape-BcXkRayC.js → drawingml-shape-B1_kg4BV.js} +55 -55
- package/dist/{duotone-BI7CoghW.js → duotone-GK4Hqn7f.js} +1 -1
- package/dist/{emf-DgUBx9BU.js → emf--QWY-UlT.js} +50 -50
- package/dist/{font-preload-demand-B6HPFxDp.js → font-preload-demand-NqcVKIpX.js} +2 -2
- package/dist/{grid-geometry-CqTDvpDr.js → grid-geometry-DpMAiSZb.js} +1 -1
- package/dist/{host-layout-measure-CXKOWA5J.js → host-layout-measure-IFLllYwV.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +2 -2
- package/dist/{line-distribute-DR9Qwd3u.js → line-distribute-CwtditQo.js} +31 -25
- package/dist/{model-source-DcI3vC00.js → model-source-Cch44xsb.js} +2 -2
- package/dist/{model-source-session-BlQWNyj2.js → model-source-session-ClNCRDOg.js} +21 -21
- package/dist/{model-source-session-D0LF49Ve.js → model-source-session-DRcqFGfM.js} +2 -2
- package/dist/{model-source-session-BCteVilS.js → model-source-session-DSABX94B.js} +2 -2
- package/dist/node.mjs +5 -5
- package/dist/{plot-area-frame-D3JtHvov.js → plot-area-frame-DNYMd9Pf.js} +1914 -1890
- package/dist/{pptx-SmjDGyub.js → pptx-C1CiFW1D.js} +35 -33
- package/dist/{pptx-CfCiVlNB.js → pptx-DbjWegUB.js} +283 -266
- package/dist/{pptx-model-source-B2Irk68a.js → pptx-model-source-C9TuBisH.js} +18 -12
- package/dist/pptx-parsed-slides-BMGr4khe.js +8 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{presentation-model-source-DL6duh5l.js → presentation-model-source-DLNioq7T.js} +6 -6
- package/dist/region-map.mjs +39 -39
- package/dist/{render-CMUEAeHp.js → render-Bf_Gywxw.js} +32 -30
- package/dist/{render-worker-host-CZHIKTtZ.js → render-worker-host-CVr53kg0.js} +1 -1
- package/dist/{render-worker-host-CtlBbau5.js → render-worker-host-EgUrirnQ.js} +1 -1
- package/dist/{render-worker-host-G1fnymI8.js → render-worker-host-pKls3F_t.js} +1 -1
- package/dist/renderer-DpTePxGq.js +5887 -0
- package/dist/{renderer-B4KIpz-2.js → renderer-DuYC3xXi.js} +1336 -1224
- package/dist/{resource-measurement-D2bu0Qfx.js → resource-measurement-CfJtbwiR.js} +129 -129
- package/dist/{session-KIWcCCP2.js → session-DPXK_lpI.js} +64 -64
- package/dist/{slide-pull-client-BUuJQQVE.js → slide-pull-client-3g6TxaKa.js} +1421 -1421
- package/dist/{three-d-ByHGsYrX.js → three-d-BfMZVR0w.js} +98 -98
- package/dist/three-d.mjs +678 -678
- package/dist/types/chart-ex.d.ts +5 -2
- package/dist/types/docx.d.ts +30 -8
- package/dist/types/index.d.ts +37 -12
- package/dist/types/node.d.ts +28 -6
- package/dist/types/pptx.d.ts +13 -7
- package/dist/types/region-map.d.ts +5 -2
- package/dist/types/three-d.d.ts +5 -2
- package/dist/types/xlsx.d.ts +10 -7
- package/dist/{wasm-runtime-generation-BLweKv8r.js → wasm-runtime-generation-D97yoAXz.js} +17 -17
- package/dist/{workbook-model-source-J9ir5Kov.js → workbook-model-source-D1dmkDMP.js} +6 -6
- package/dist/{worksheet-pull-client-Du0MuIro.js → worksheet-pull-client-BudfclVl.js} +84 -84
- package/dist/{xlsx-BbQ7RcNc.js → xlsx-DA0uR1B1.js} +44 -44
- package/dist/{xlsx-ClQiNSrr.js → xlsx-DBhYlJKp.js} +728 -716
- package/dist/{xlsx-model-source-C-Riw89p.js → xlsx-model-source-zemVDAfl.js} +36 -36
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-B3hF7Akg.js +0 -35
- package/dist/assets/render-worker-B5HWxkbU.js +0 -16
- package/dist/assets/render-worker-DNGf06QT.js +0 -15
- package/dist/renderer-xdugdcMd.js +0 -5769
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region dist/.types-work/chart-
|
|
1
|
+
//#region dist/.types-work/chart-B0uBdtRL.d.ts
|
|
2
2
|
type DecodedImageBudgetStrategy = 'adaptive' | 'strict';
|
|
3
3
|
interface ImageResourceOptions {
|
|
4
4
|
decodedByteBudget?: number;
|
|
@@ -1278,6 +1278,9 @@ interface SecondaryValueAxis {
|
|
|
1278
1278
|
labelOffsetPercent?: number | null;
|
|
1279
1279
|
tickLabelSkip?: number | null;
|
|
1280
1280
|
tickMarkSkip?: number | null;
|
|
1281
|
+
dateAxis?: boolean | null;
|
|
1282
|
+
crossBetween?: 'between' | 'midCat' | string | null;
|
|
1283
|
+
pairedBesidePrimary?: boolean | null;
|
|
1281
1284
|
crosses?: string | null;
|
|
1282
1285
|
crossesAt?: number | null;
|
|
1283
1286
|
titleFontSizeHpt?: number | null;
|
|
@@ -1345,7 +1348,7 @@ interface ChartRect {
|
|
|
1345
1348
|
h: number;
|
|
1346
1349
|
}
|
|
1347
1350
|
//#endregion
|
|
1348
|
-
//#region dist/.types-work/chart-ex-contract-
|
|
1351
|
+
//#region dist/.types-work/chart-ex-contract-BY4iemK6.d.ts
|
|
1349
1352
|
interface ChartExRenderer {
|
|
1350
1353
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1351
1354
|
}
|
|
@@ -1362,12 +1365,12 @@ interface MathRenderer {
|
|
|
1362
1365
|
mathMLToSvg(mathml: string): Promise<MathSvg>;
|
|
1363
1366
|
}
|
|
1364
1367
|
//#endregion
|
|
1365
|
-
//#region dist/.types-work/three-d-contract-
|
|
1368
|
+
//#region dist/.types-work/three-d-contract-Cf8KM98H.d.ts
|
|
1366
1369
|
interface ChartThreeDRenderer {
|
|
1367
1370
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1368
1371
|
}
|
|
1369
1372
|
//#endregion
|
|
1370
|
-
//#region dist/.types-work/region-map-contract-
|
|
1373
|
+
//#region dist/.types-work/region-map-contract-aXULsqfm.d.ts
|
|
1371
1374
|
interface ChartRegionMapRenderer {
|
|
1372
1375
|
render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
|
|
1373
1376
|
}
|
|
@@ -1387,7 +1390,7 @@ interface TiffRenderer {
|
|
|
1387
1390
|
render(bytes: Uint8Array, options?: Readonly<TiffRenderOptions>): Promise<ImageBitmap | null>;
|
|
1388
1391
|
}
|
|
1389
1392
|
//#endregion
|
|
1390
|
-
//#region dist/.types-work/hyperlink-
|
|
1393
|
+
//#region dist/.types-work/hyperlink-DaRDzuH7.d.ts
|
|
1391
1394
|
type CjkLang = 'kr' | 'sc' | 'tc' | 'hk' | 'jp';
|
|
1392
1395
|
type CjkFallback = 'auto' | CjkLang;
|
|
1393
1396
|
type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml' | 'unsupported-image-effect' | 'invalid-numbering' | 'unsupported-content';
|
|
@@ -1589,7 +1592,7 @@ interface ModelSourceModule<TArchive = unknown> {
|
|
|
1589
1592
|
openModelSource(bytes: Uint8Array, config: ModelSourceConfig, signal?: AbortSignal, transfer?: readonly Transferable[]): Promise<OpenedModelSource<TArchive>>;
|
|
1590
1593
|
}
|
|
1591
1594
|
//#endregion
|
|
1592
|
-
//#region dist/.types-work/types-
|
|
1595
|
+
//#region dist/.types-work/types-C5OCblCo.d.ts
|
|
1593
1596
|
type ShapeFill = Exclude<Fill, {
|
|
1594
1597
|
fillType: 'image';
|
|
1595
1598
|
} | {
|
|
@@ -2426,7 +2429,7 @@ interface XlsxRenderViewportOptions {
|
|
|
2426
2429
|
} | null;
|
|
2427
2430
|
}
|
|
2428
2431
|
//#endregion
|
|
2429
|
-
//#region dist/.types-work/xlsx-
|
|
2432
|
+
//#region dist/.types-work/xlsx-CKa7EVjE.d.ts
|
|
2430
2433
|
type ResolvedList = {
|
|
2431
2434
|
kind: 'values';
|
|
2432
2435
|
values: string[];
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function a(
|
|
3
|
-
return
|
|
1
|
+
import { B as e, H as t, V as n, Y as r, z as i } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
2
|
+
function a(e) {
|
|
3
|
+
return n(e) ? new i(`WASM parser trapped and was recycled: ${e instanceof Error ? e.message : String(e)}`) : null;
|
|
4
4
|
}
|
|
5
5
|
var o = class {
|
|
6
6
|
realm;
|
|
7
7
|
live = /* @__PURE__ */ new Set();
|
|
8
|
-
constructor(e,
|
|
9
|
-
this.realm = new
|
|
8
|
+
constructor(e, n) {
|
|
9
|
+
this.realm = new t(() => e.initSync({ module: n }), () => e.reinit({ module_or_path: n }), a), this.realm.onPoison((e) => {
|
|
10
10
|
for (let t of this.live) t.poison(e);
|
|
11
11
|
this.live.clear();
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
async open(e,
|
|
14
|
+
async open(e, t) {
|
|
15
15
|
for (;;) {
|
|
16
|
-
this.throwIfOpenAborted(
|
|
17
|
-
let
|
|
18
|
-
if (!
|
|
19
|
-
let i = new c(this,
|
|
20
|
-
if (this.live.add(i),
|
|
16
|
+
this.throwIfOpenAborted(t), await this.awaitReadyOrAbort(t), this.throwIfOpenAborted(t);
|
|
17
|
+
let n = this.realm.tryRunReady(() => r(e));
|
|
18
|
+
if (!n.current) continue;
|
|
19
|
+
let i = new c(this, n.value, n.generation);
|
|
20
|
+
if (this.live.add(i), t?.signal?.aborted) throw i.close(t.disposeOnAbort), t.abortError?.() ?? new DOMException("The operation was aborted", "AbortError");
|
|
21
21
|
return i;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -40,9 +40,9 @@ var o = class {
|
|
|
40
40
|
async ensureReady() {
|
|
41
41
|
await this.realm.ensureReady();
|
|
42
42
|
}
|
|
43
|
-
run(e,
|
|
44
|
-
let
|
|
45
|
-
return
|
|
43
|
+
run(e, t) {
|
|
44
|
+
let n = e.requireLive(this.realm);
|
|
45
|
+
return r(() => this.realm.run(() => t(n)));
|
|
46
46
|
}
|
|
47
47
|
close(e, t) {
|
|
48
48
|
let n = e.detachForClose();
|
|
@@ -87,9 +87,9 @@ var c = class {
|
|
|
87
87
|
let e = this.archive;
|
|
88
88
|
return this.archive = void 0, this.failure ? void 0 : e;
|
|
89
89
|
}
|
|
90
|
-
poison(
|
|
91
|
-
let
|
|
92
|
-
this.failure =
|
|
90
|
+
poison(t) {
|
|
91
|
+
let n = this.archive;
|
|
92
|
+
this.failure = t, this.archive = void 0, e(n);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
export { s as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { T as r } from "./canvas-viewer-mechanics-
|
|
3
|
-
import { a as i, g as a } from "./renderer-
|
|
4
|
-
import { b as o } from "./worksheet-pull-client-
|
|
5
|
-
import { c as s, l as c } from "./xlsx-
|
|
1
|
+
import { I as e, P as t, Xt as n } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
2
|
+
import { T as r } from "./canvas-viewer-mechanics-BsqaoYgK.js";
|
|
3
|
+
import { a as i, g as a } from "./renderer-DuYC3xXi.js";
|
|
4
|
+
import { b as o } from "./worksheet-pull-client-BudfclVl.js";
|
|
5
|
+
import { c as s, l as c } from "./xlsx-DBhYlJKp.js";
|
|
6
6
|
import { n as l, o as u, r as d } from "./model-source-COXegBNA.js";
|
|
7
7
|
import { t as f } from "./bundled-asset-url-BMJ8vNHP.js";
|
|
8
8
|
import { n as p } from "./host-layout-Cz_lCuTZ.js";
|
|
@@ -52,7 +52,7 @@ async function m(i, d, f) {
|
|
|
52
52
|
let p = l(t, "xlsx");
|
|
53
53
|
try {
|
|
54
54
|
_.setSourceBytes(e.byteLength), _.checkpoint("container ready");
|
|
55
|
-
let t = g === "worker" ? (await import("./render-worker-host-
|
|
55
|
+
let t = g === "worker" ? (await import("./render-worker-host-pKls3F_t.js")).createRenderWorker() : new (await (import("./worker-source-C29EQNUj.js"))).default(), n, i = h(t, p, d, (e) => {
|
|
56
56
|
n && (n.sourceMdw = e);
|
|
57
57
|
});
|
|
58
58
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { wo as e } from "./plot-area-frame-DNYMd9Pf.js";
|
|
2
|
+
import { A as t, Cn as n, Dn as r, En as i, J as a, M as o, Sn as s, Tn as c, U as l, bn as u, j as d, k as f, q as p, wn as m, xn as h, yn as g } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
3
3
|
import { n as _ } from "./abort-JztSoyw2.js";
|
|
4
|
-
import { n as v, r as y, t as b } from "./resource-measurement-
|
|
4
|
+
import { n as v, r as y, t as b } from "./resource-measurement-CfJtbwiR.js";
|
|
5
5
|
function x(e) {
|
|
6
6
|
return e.byteOffset === 0 && e.byteLength === e.buffer.byteLength && e.buffer instanceof ArrayBuffer ? e.buffer : e.slice().buffer;
|
|
7
7
|
}
|
|
@@ -16,18 +16,18 @@ function C(e) {
|
|
|
16
16
|
}
|
|
17
17
|
var w = Object.freeze({
|
|
18
18
|
worksheet: C({
|
|
19
|
-
maxRows:
|
|
20
|
-
maxCells:
|
|
21
|
-
maxOwnedUtf8Bytes:
|
|
22
|
-
maxJsonBytes:
|
|
19
|
+
maxRows: r,
|
|
20
|
+
maxCells: m,
|
|
21
|
+
maxOwnedUtf8Bytes: c,
|
|
22
|
+
maxJsonBytes: i
|
|
23
23
|
}),
|
|
24
24
|
cache: C({
|
|
25
|
-
maxRows:
|
|
26
|
-
maxCells:
|
|
27
|
-
maxOwnedUtf8Bytes:
|
|
28
|
-
maxJsonBytes:
|
|
25
|
+
maxRows: n,
|
|
26
|
+
maxCells: u,
|
|
27
|
+
maxOwnedUtf8Bytes: h,
|
|
28
|
+
maxJsonBytes: s
|
|
29
29
|
}),
|
|
30
|
-
maxCoordinateIndexEntries:
|
|
30
|
+
maxCoordinateIndexEntries: g
|
|
31
31
|
});
|
|
32
32
|
function T(e, t) {
|
|
33
33
|
let n = e[t];
|
|
@@ -79,7 +79,7 @@ function j(e, t) {
|
|
|
79
79
|
let n = O.get(e);
|
|
80
80
|
n === void 0 ? O.delete(t) : O.set(t, n);
|
|
81
81
|
}
|
|
82
|
-
var M =
|
|
82
|
+
var M = i, N = Object.freeze({
|
|
83
83
|
archiveEntryCount: 0,
|
|
84
84
|
declaredInflatedBytes: 0,
|
|
85
85
|
distinctInflatedBytes: 0,
|
|
@@ -124,10 +124,10 @@ function R(e, t, n = {}, r = w) {
|
|
|
124
124
|
jsonBytes: b(c, t.jsonBytes, i.maxJsonBytes)
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function z(t, n, r, i, a, o, s,
|
|
128
|
-
let
|
|
129
|
-
return new e(
|
|
130
|
-
stage:
|
|
127
|
+
function z(t, n, r, i, a, o, s, c = r !== "delimited-text-source") {
|
|
128
|
+
let l = r === "worksheet-json" ? "serialization" : "parsing";
|
|
129
|
+
return new e(p({
|
|
130
|
+
stage: l,
|
|
131
131
|
violation: {
|
|
132
132
|
part: n,
|
|
133
133
|
resource: r,
|
|
@@ -136,7 +136,7 @@ function z(t, n, r, i, a, o, s, l = r !== "delimited-text-source") {
|
|
|
136
136
|
limit: a
|
|
137
137
|
}
|
|
138
138
|
}), {
|
|
139
|
-
stage:
|
|
139
|
+
stage: l,
|
|
140
140
|
violation: {
|
|
141
141
|
format: "xlsx",
|
|
142
142
|
operation: t,
|
|
@@ -145,7 +145,7 @@ function z(t, n, r, i, a, o, s, l = r !== "delimited-text-source") {
|
|
|
145
145
|
...n === void 0 ? {} : { part: n },
|
|
146
146
|
limit: a,
|
|
147
147
|
observed: Math.min(o, a + 1),
|
|
148
|
-
configurable:
|
|
148
|
+
configurable: c,
|
|
149
149
|
usage: s ?? N
|
|
150
150
|
}
|
|
151
151
|
});
|
|
@@ -243,7 +243,7 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
243
243
|
prepareRows;
|
|
244
244
|
provisional;
|
|
245
245
|
worksheetPolicy;
|
|
246
|
-
coordinator = new
|
|
246
|
+
coordinator = new o();
|
|
247
247
|
sessions = /* @__PURE__ */ new Map();
|
|
248
248
|
operationTail = Promise.resolve();
|
|
249
249
|
pendingOpens = /* @__PURE__ */ new Map();
|
|
@@ -277,16 +277,16 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
277
277
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
278
278
|
let i = this.pendingOpens.get(r.sessionId);
|
|
279
279
|
if (!i || i.identity.operationId !== r.operationId || i.identity.generation !== r.generation) throw Error("worksheet pull session open reservation is stale or missing");
|
|
280
|
-
let a = this.worksheetPolicy(),
|
|
281
|
-
|
|
282
|
-
}),
|
|
280
|
+
let a = this.worksheetPolicy(), o, s = new Promise((e) => {
|
|
281
|
+
o = e;
|
|
282
|
+
}), c = this.operationTail.then(() => this.coordinator.enqueue(async () => {
|
|
283
283
|
if (i.canceled) throw Error("worksheet pull session open was canceled");
|
|
284
284
|
this.executeArchive((e) => e.open_sheet_cursor(t, n));
|
|
285
|
-
let
|
|
285
|
+
let s = [], c = {
|
|
286
286
|
rows: 0,
|
|
287
287
|
cells: 0,
|
|
288
288
|
ownedUtf8Bytes: 0
|
|
289
|
-
},
|
|
289
|
+
}, l, u = !1, f = new d({
|
|
290
290
|
...r,
|
|
291
291
|
maxByteCredit: q,
|
|
292
292
|
coordinator: this.coordinator,
|
|
@@ -296,16 +296,16 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
296
296
|
if (this.acceptWorksheet) {
|
|
297
297
|
let i = K(n, r, void 0, this.prepareRows);
|
|
298
298
|
try {
|
|
299
|
-
if (i.kind === "preview") i.worksheet && (i.worksheet.rows =
|
|
299
|
+
if (i.kind === "preview") i.worksheet && (i.worksheet.rows = s, k(i.worksheet, a), this.provisional?.preview(t, i.worksheet));
|
|
300
300
|
else if (i.kind === "rows") {
|
|
301
|
-
let e = L(
|
|
302
|
-
B(e, "get-worksheet-worker", void 0, this.readResourceUsage(), a),
|
|
303
|
-
} else i.kind === "finished" && (
|
|
301
|
+
let e = L(c, P(i.rows, a), a);
|
|
302
|
+
B(e, "get-worksheet-worker", void 0, this.readResourceUsage(), a), s.push(...i.rows), c = e;
|
|
303
|
+
} else i.kind === "finished" && (l = i.worksheet);
|
|
304
304
|
} catch (t) {
|
|
305
305
|
throw t instanceof e && (this.resourceFailure ??= t), t;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
|
|
308
|
+
u = r;
|
|
309
309
|
let i = x(n);
|
|
310
310
|
return {
|
|
311
311
|
payload: i,
|
|
@@ -316,39 +316,39 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
316
316
|
},
|
|
317
317
|
measureChunk: ({ payload: e }) => e.byteLength,
|
|
318
318
|
acknowledge: () => {
|
|
319
|
-
if (!
|
|
319
|
+
if (!u) return;
|
|
320
320
|
let n, i;
|
|
321
321
|
try {
|
|
322
322
|
if (this.acceptWorksheet) {
|
|
323
|
-
if (!
|
|
324
|
-
|
|
325
|
-
let e =
|
|
323
|
+
if (!l) throw Error("worksheet terminal payload is missing");
|
|
324
|
+
l.rows = l.parseError ? [] : s;
|
|
325
|
+
let e = l.parseError ? {
|
|
326
326
|
rows: 0,
|
|
327
327
|
cells: 0,
|
|
328
328
|
ownedUtf8Bytes: 0
|
|
329
|
-
} :
|
|
330
|
-
B(r, "get-worksheet-worker", void 0, o, a), V(r.jsonBytes, "get-worksheet-worker", void 0, o, a), k(
|
|
331
|
-
let
|
|
332
|
-
typeof
|
|
329
|
+
} : c, r = I(l, e, a), o = this.readResourceUsage();
|
|
330
|
+
B(r, "get-worksheet-worker", void 0, o, a), V(r.jsonBytes, "get-worksheet-worker", void 0, o, a), k(l, a);
|
|
331
|
+
let u = this.acceptWorksheet(t, l, r, o);
|
|
332
|
+
typeof u == "function" ? n = u : u && ({rollback: n, commit: i} = u);
|
|
333
333
|
}
|
|
334
334
|
this.executeArchive((e) => e.acknowledge_sheet_cursor_terminal()), i?.();
|
|
335
335
|
} catch (t) {
|
|
336
336
|
throw n?.(), t instanceof e && (this.resourceFailure ??= t), t;
|
|
337
337
|
}
|
|
338
|
-
|
|
338
|
+
u = !1, this.sessions.delete(r.sessionId), this.provisional?.stop(t), o();
|
|
339
339
|
},
|
|
340
340
|
cancel: () => {
|
|
341
341
|
try {
|
|
342
342
|
this.archive() && this.executeArchive((e) => e.cancel_sheet_cursor());
|
|
343
343
|
} finally {
|
|
344
|
-
this.sessions.delete(r.sessionId), this.provisional?.stop(t),
|
|
344
|
+
this.sessions.delete(r.sessionId), this.provisional?.stop(t), o();
|
|
345
345
|
}
|
|
346
346
|
},
|
|
347
347
|
close: () => {
|
|
348
348
|
try {
|
|
349
349
|
this.archive() && this.executeArchive((e) => e.close_sheet_cursor());
|
|
350
350
|
} finally {
|
|
351
|
-
this.sessions.delete(r.sessionId), this.provisional?.stop(t),
|
|
351
|
+
this.sessions.delete(r.sessionId), this.provisional?.stop(t), o();
|
|
352
352
|
}
|
|
353
353
|
},
|
|
354
354
|
resourceUsage: () => this.readResourceUsage()
|
|
@@ -359,11 +359,11 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
359
359
|
identity: r
|
|
360
360
|
}), this.pendingOpens.delete(r.sessionId);
|
|
361
361
|
}));
|
|
362
|
-
this.operationTail =
|
|
362
|
+
this.operationTail = c.then(() => s, () => void 0);
|
|
363
363
|
try {
|
|
364
|
-
await
|
|
364
|
+
await c;
|
|
365
365
|
} catch (e) {
|
|
366
|
-
throw this.pendingOpens.delete(r.sessionId),
|
|
366
|
+
throw this.pendingOpens.delete(r.sessionId), o(), e;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
async postOpenedSafely(e, t, n) {
|
|
@@ -376,14 +376,14 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
376
376
|
} catch {}
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
dispatch(e,
|
|
380
|
-
let
|
|
381
|
-
if (
|
|
379
|
+
dispatch(e, n) {
|
|
380
|
+
let r = this.sessions.get(e.sessionId);
|
|
381
|
+
if (r) return r.host.dispatch(e, n);
|
|
382
382
|
let i = this.pendingOpens.get(e.sessionId);
|
|
383
383
|
if (i && (e.kind === "cancel" || e.kind === "close")) {
|
|
384
|
-
let
|
|
385
|
-
return
|
|
386
|
-
protocol:
|
|
384
|
+
let r = i.identity.operationId === e.operationId && i.identity.generation === e.generation;
|
|
385
|
+
return r && (i.canceled = !0), n(r ? {
|
|
386
|
+
protocol: t,
|
|
387
387
|
kind: "accepted",
|
|
388
388
|
sessionId: e.sessionId,
|
|
389
389
|
operationId: e.operationId,
|
|
@@ -391,7 +391,7 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
391
391
|
requestId: e.requestId,
|
|
392
392
|
command: e.kind
|
|
393
393
|
} : {
|
|
394
|
-
protocol:
|
|
394
|
+
protocol: t,
|
|
395
395
|
kind: "error",
|
|
396
396
|
sessionId: e.sessionId,
|
|
397
397
|
operationId: e.operationId,
|
|
@@ -404,16 +404,16 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
404
404
|
}
|
|
405
405
|
}), Promise.resolve();
|
|
406
406
|
}
|
|
407
|
-
return e.kind === "cancel" || e.kind === "close" ? (
|
|
408
|
-
protocol:
|
|
407
|
+
return e.kind === "cancel" || e.kind === "close" ? (n({
|
|
408
|
+
protocol: t,
|
|
409
409
|
kind: "accepted",
|
|
410
410
|
sessionId: e.sessionId,
|
|
411
411
|
operationId: e.operationId,
|
|
412
412
|
generation: e.generation,
|
|
413
413
|
requestId: e.requestId,
|
|
414
414
|
command: e.kind
|
|
415
|
-
}), Promise.resolve()) : (
|
|
416
|
-
protocol:
|
|
415
|
+
}), Promise.resolve()) : (n({
|
|
416
|
+
protocol: t,
|
|
417
417
|
kind: "error",
|
|
418
418
|
sessionId: e.sessionId,
|
|
419
419
|
operationId: e.operationId,
|
|
@@ -422,19 +422,19 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
422
422
|
error: a(/* @__PURE__ */ Error("worksheet pull session is not open"))
|
|
423
423
|
}), Promise.resolve());
|
|
424
424
|
}
|
|
425
|
-
async dispatchSafely(e,
|
|
425
|
+
async dispatchSafely(e, n) {
|
|
426
426
|
try {
|
|
427
|
-
await this.dispatch(e,
|
|
428
|
-
} catch (
|
|
427
|
+
await this.dispatch(e, n);
|
|
428
|
+
} catch (r) {
|
|
429
429
|
try {
|
|
430
|
-
|
|
431
|
-
protocol:
|
|
430
|
+
n({
|
|
431
|
+
protocol: t,
|
|
432
432
|
kind: "error",
|
|
433
433
|
sessionId: e.sessionId,
|
|
434
434
|
operationId: e.operationId,
|
|
435
435
|
generation: e.generation,
|
|
436
436
|
requestId: e.requestId,
|
|
437
|
-
error: a(
|
|
437
|
+
error: a(r)
|
|
438
438
|
});
|
|
439
439
|
} catch {}
|
|
440
440
|
}
|
|
@@ -451,10 +451,10 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
451
451
|
async reset() {
|
|
452
452
|
for (let e of this.pendingOpens.values()) e.canceled = !0;
|
|
453
453
|
let e = 1;
|
|
454
|
-
for (let { host:
|
|
455
|
-
protocol:
|
|
454
|
+
for (let { host: n, identity: r } of [...this.sessions.values()]) await n.dispatch({
|
|
455
|
+
protocol: t,
|
|
456
456
|
kind: "close",
|
|
457
|
-
...
|
|
457
|
+
...r,
|
|
458
458
|
requestId: e++
|
|
459
459
|
}, () => void 0);
|
|
460
460
|
this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.resourceFailure = void 0;
|
|
@@ -465,21 +465,21 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
465
465
|
return e;
|
|
466
466
|
}
|
|
467
467
|
async closeIdentity(e) {
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
470
|
-
await
|
|
471
|
-
protocol:
|
|
468
|
+
let n = this.sessions.get(e.sessionId);
|
|
469
|
+
if (n) {
|
|
470
|
+
await n.host.dispatch({
|
|
471
|
+
protocol: t,
|
|
472
472
|
kind: "close",
|
|
473
473
|
...e,
|
|
474
474
|
requestId: 1
|
|
475
475
|
}, () => void 0);
|
|
476
476
|
return;
|
|
477
477
|
}
|
|
478
|
-
let
|
|
479
|
-
|
|
478
|
+
let r = this.pendingOpens.get(e.sessionId);
|
|
479
|
+
r && r.identity.operationId === e.operationId && r.identity.generation === e.generation && (r.canceled = !0);
|
|
480
480
|
}
|
|
481
481
|
readResourceUsage() {
|
|
482
|
-
return
|
|
482
|
+
return l(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
|
|
483
483
|
}
|
|
484
484
|
}, Y = "XLSX workbook session was aborted", X = class {
|
|
485
485
|
options;
|
|
@@ -492,24 +492,24 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
492
492
|
if (!Number.isSafeInteger(e) || e < 0) throw RangeError("sheetIndex must be a non-negative safe integer");
|
|
493
493
|
if (!t) throw TypeError("sheetName must be non-empty");
|
|
494
494
|
_(n, Y);
|
|
495
|
-
let r = this.nextSessionId++,
|
|
495
|
+
let r = this.nextSessionId++, i = {
|
|
496
496
|
sessionId: r,
|
|
497
497
|
operationId: r,
|
|
498
498
|
generation: this.options.generation ?? 1
|
|
499
|
-
},
|
|
500
|
-
...
|
|
499
|
+
}, a = new f(this.options.transport, {
|
|
500
|
+
...i,
|
|
501
501
|
maxByteCredit: q,
|
|
502
502
|
timeoutMs: this.options.timeoutMs,
|
|
503
503
|
disposeTransferred: this.options.disposeTransferred
|
|
504
504
|
});
|
|
505
|
-
this.active.add(
|
|
506
|
-
let
|
|
505
|
+
this.active.add(a);
|
|
506
|
+
let o = !1, s;
|
|
507
507
|
try {
|
|
508
|
-
for (await this.options.open(e, t,
|
|
508
|
+
for (await this.options.open(e, t, i, this.options.timeoutMs);;) {
|
|
509
509
|
_(n, Y);
|
|
510
|
-
let e = await
|
|
510
|
+
let e = await a.pull(q, { signal: n });
|
|
511
511
|
try {
|
|
512
|
-
let t = e.usage ??
|
|
512
|
+
let t = e.usage ?? a.usageCheckpoint;
|
|
513
513
|
t && this.options.onUsage?.(t);
|
|
514
514
|
let r = K(e.payload, e.done, this.options.sharedStrings);
|
|
515
515
|
if (yield r.kind === "preview" ? {
|
|
@@ -530,7 +530,7 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
530
530
|
wireBytes: e.byteLength,
|
|
531
531
|
usage: t
|
|
532
532
|
}, await e.ack({ signal: n }), r.kind === "finished") {
|
|
533
|
-
|
|
533
|
+
o = !0;
|
|
534
534
|
return;
|
|
535
535
|
}
|
|
536
536
|
} finally {
|
|
@@ -538,17 +538,17 @@ var q = 64 * 1024 * 1024, J = class {
|
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
} catch (e) {
|
|
541
|
-
throw
|
|
541
|
+
throw s = e, e;
|
|
542
542
|
} finally {
|
|
543
543
|
let e;
|
|
544
544
|
try {
|
|
545
|
-
|
|
545
|
+
o || await a.cancel(Q(s));
|
|
546
546
|
} catch (t) {
|
|
547
547
|
e = t;
|
|
548
548
|
} finally {
|
|
549
|
-
this.active.delete(
|
|
549
|
+
this.active.delete(a);
|
|
550
550
|
}
|
|
551
|
-
if (
|
|
551
|
+
if (s === void 0 && e !== void 0) throw e;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
async cancelAll(e = "closed") {
|