@silurus/ooxml 0.82.1 → 0.83.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +74 -5
  2. package/dist/assets/render-worker-4GSYWsM3.js +11 -0
  3. package/dist/assets/{render-worker-Cy-QsDge.js → render-worker-DwFpY197.js} +4 -4
  4. package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
  5. package/dist/{comment-ui-runtime-C1RV_3iu.js → comment-ui-runtime-BelHJt73.js} +2 -2
  6. package/dist/{comment-ui-runtime-DgCZpPR0.js → comment-ui-runtime-DD5a3x3k.js} +2 -2
  7. package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
  8. package/dist/{document-pull-client-B1WOjA0z.js → document-pull-client-DSx36ZsB.js} +4519 -3952
  9. package/dist/docx-BF-WKW73.js +2784 -0
  10. package/dist/docx.mjs +6 -6
  11. package/dist/docx_parser_bg.wasm +0 -0
  12. package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
  13. package/dist/index.mjs +4 -4
  14. package/dist/line-distribute-D7A_wnJg.js +1003 -0
  15. package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
  16. package/dist/node.mjs +308 -308
  17. package/dist/pptx-CA-Q09yW.js +3010 -0
  18. package/dist/pptx.mjs +5 -5
  19. package/dist/pptx_parser_bg.wasm +0 -0
  20. package/dist/{render-BC8p7vZQ.js → render-DtbFbO5c.js} +1 -1
  21. package/dist/{render-worker-host-BNnXCtAu.js → render-worker-host-D1jcACJV.js} +1 -1
  22. package/dist/{render-worker-host-DhnkTyjj.js → render-worker-host-DCLyw6UR.js} +1 -1
  23. package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
  24. package/dist/{session-Da7LEQUB.js → session-CxT-t0BX.js} +107 -94
  25. package/dist/{slide-pull-client-Bg9DusLX.js → slide-pull-client-B9rcJdO4.js} +1190 -937
  26. package/dist/types/docx.d.ts +103 -8
  27. package/dist/types/index.d.ts +195 -13
  28. package/dist/types/node.d.ts +2 -2
  29. package/dist/types/pptx.d.ts +100 -5
  30. package/dist/types/xlsx.d.ts +2 -2
  31. package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
  32. package/dist/{xlsx-DMWeXT-c.js → xlsx-BibrHQ52.js} +476 -476
  33. package/dist/xlsx.mjs +5 -5
  34. package/dist/xlsx_parser_bg.wasm +0 -0
  35. package/package.json +3 -1
  36. package/dist/assets/render-worker-aHayzR7v.js +0 -11
  37. package/dist/docx-HoZXZUPA.js +0 -2162
  38. package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
  39. package/dist/line-distribute-iXsUCIH-.js +0 -1003
  40. package/dist/pptx-DEUP4Yq5.js +0 -2432
  41. /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
  42. /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
@@ -1275,7 +1275,7 @@ interface ChartRegionMapRenderer {
1275
1275
  render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
1276
1276
  }
1277
1277
  //#endregion
1278
- //#region dist/.types-work/hyperlink-CZoV-4B8.d.ts
1278
+ //#region dist/.types-work/hyperlink-Bk5fiM_m.d.ts
1279
1279
  type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
1280
1280
  type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
1281
1281
  declare class OoxmlError extends Error {
@@ -1348,6 +1348,14 @@ interface OoxmlResourceLimits {
1348
1348
  maxTotalInflatedBytes?: OoxmlResourceLimit;
1349
1349
  maxArchiveEntries?: OoxmlResourceLimit;
1350
1350
  }
1351
+ interface ProgressiveLayoutProgress {
1352
+ committedUnits: number;
1353
+ }
1354
+ interface ProgressiveLayoutPartial {
1355
+ availableUnits: number;
1356
+ totalUnits?: number;
1357
+ exact: boolean;
1358
+ }
1351
1359
  interface LoadOptions$1 {
1352
1360
  useGoogleFonts?: boolean;
1353
1361
  password?: string;
@@ -1704,7 +1712,7 @@ interface PictureElement {
1704
1712
  sp3d?: Sp3d;
1705
1713
  }
1706
1714
  //#endregion
1707
- //#region dist/.types-work/pptx-CZHOWYdz.d.ts
1715
+ //#region dist/.types-work/pptx-BODJIDql.d.ts
1708
1716
  interface PptxTextRunInfo {
1709
1717
  elementIndex?: number;
1710
1718
  origin?: SlideElementOrigin;
@@ -1721,6 +1729,12 @@ interface PptxTextRunInfo {
1721
1729
  shapeW: number;
1722
1730
  shapeH: number;
1723
1731
  rotation: number;
1732
+ shapeFlipH?: boolean;
1733
+ shapeFlipV?: boolean;
1734
+ tableCell?: Readonly<{
1735
+ row: number;
1736
+ column: number;
1737
+ }>;
1724
1738
  textBodyRotation?: number;
1725
1739
  hyperlink?: HyperlinkTarget;
1726
1740
  }
@@ -1829,6 +1843,10 @@ interface PptxElementBounds {
1829
1843
  type PptxSelectionContext = PptxTextSelectionContext | PptxCommentSelectionContext | PptxElementContext;
1830
1844
  type LoadOptions = LoadOptions$1 & {
1831
1845
  mode?: 'main' | 'worker';
1846
+ progressiveLayout?: boolean;
1847
+ onLayoutProgress?: (progress: Readonly<ProgressiveLayoutProgress>) => void;
1848
+ onLayoutPartial?: (progress: Readonly<ProgressiveLayoutPartial>) => void;
1849
+ onLayoutComplete?: (error?: unknown) => void;
1832
1850
  };
1833
1851
  interface RenderSlideToBitmapOptions {
1834
1852
  width?: number;
@@ -1851,13 +1869,27 @@ declare class PptxPresentation {
1851
1869
  private readonly _worker;
1852
1870
  private readonly _bridge;
1853
1871
  private _mode;
1872
+ private _bootstrap;
1854
1873
  private _preflight;
1874
+ private _availableSlideCount;
1875
+ private readonly _layoutLifecycle;
1876
+ private readonly _layoutObservers;
1877
+ private _layoutCompletion;
1878
+ private _parseRequestId;
1879
+ private _progressive;
1880
+ private _progressiveWatchdog;
1881
+ private _progressiveWatchdogMs;
1882
+ private readonly _layoutWaiters;
1855
1883
  private _slides;
1856
1884
  private _slidePullClient;
1857
1885
  private _resourceFailure;
1858
1886
  private _slidePartIndex;
1859
1887
  private readonly _rawParts;
1860
1888
  private _googleFontFaces;
1889
+ private _embeddedFontFaces;
1890
+ private _embeddedFontAliases;
1891
+ private _embeddedFontAuthoredFamilies;
1892
+ private _destroyed;
1861
1893
  private readonly _fetchImage;
1862
1894
  private readonly _fetchMedia;
1863
1895
  private _math;
@@ -1869,7 +1901,22 @@ declare class PptxPresentation {
1869
1901
  private _rethrowWithResourceFailure;
1870
1902
  static load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<PptxPresentation>;
1871
1903
  private _parse;
1904
+ private _parseMainProgressively;
1905
+ private _parseWorkerProgressively;
1906
+ private _createSlidePullClient;
1907
+ private _onWorkerLayoutPush;
1908
+ private _applyProgressivePrefix;
1909
+ private _finishProgressiveLayout;
1910
+ private _failProgressiveLayout;
1911
+ private _wakeLayoutWaiters;
1912
+ private _rearmProgressiveWatchdog;
1913
+ private _clearProgressiveWatchdog;
1914
+ private _waitForSlide;
1915
+ private _assertSlideIndex;
1872
1916
  get slideCount(): number;
1917
+ get availableSlideCount(): number;
1918
+ get layoutComplete(): boolean;
1919
+ waitUntilLayoutComplete(): Promise<void>;
1873
1920
  get slideWidth(): number;
1874
1921
  get slideHeight(): number;
1875
1922
  get mode(): 'main' | 'worker';
@@ -1888,6 +1935,7 @@ declare class PptxPresentation {
1888
1935
  getMedia(mediaPath: string): Promise<Blob>;
1889
1936
  private _findMimeTypeForPath;
1890
1937
  getImage(imagePath: string, mimeType: string): Promise<Blob>;
1938
+ private getFontBytes;
1891
1939
  getResourceMetrics(): Promise<OoxmlResourceMetrics>;
1892
1940
  toMarkdown(): Promise<string>;
1893
1941
  presentSlide(canvas: HTMLCanvasElement, slideIndex: number, opts?: PresentSlideOptions): Promise<PresentationHandle>;
@@ -1895,7 +1943,7 @@ declare class PptxPresentation {
1895
1943
  }
1896
1944
  type HiddenSlideMode = 'show' | 'skip' | 'dim';
1897
1945
  interface PptxViewerOptions extends Pick<RenderOptions, 'width' | 'dpr'>, LoadOptions {
1898
- onSlideChange?: (index: number, total: number) => void;
1946
+ onSlideChange?: (index: number, total: number, layoutComplete: boolean) => void;
1899
1947
  onError?: (err: Error) => void;
1900
1948
  zoomMin?: number;
1901
1949
  zoomMax?: number;
@@ -1921,6 +1969,7 @@ declare class PptxViewer implements ZoomableViewer {
1921
1969
  private highlightLayer;
1922
1970
  private elementLayer;
1923
1971
  private _find;
1972
+ private _findGeneration;
1924
1973
  private _measureCtx;
1925
1974
  private readonly presentationOwner;
1926
1975
  private get engine();
@@ -1928,6 +1977,7 @@ declare class PptxViewer implements ZoomableViewer {
1928
1977
  private readonly hostWindow;
1929
1978
  private readonly opts;
1930
1979
  private currentSlide;
1980
+ private _renderedSlide;
1931
1981
  private _hiddenMode;
1932
1982
  private handle;
1933
1983
  private readonly _mode;
@@ -1941,10 +1991,21 @@ declare class PptxViewer implements ZoomableViewer {
1941
1991
  private elementContext;
1942
1992
  private elementHitGeneration;
1943
1993
  private readonly elementHitTolerance;
1994
+ private readonly _loadingLayer;
1995
+ private _layoutUnsubscribe;
1996
+ private readonly _layoutWaiters;
1997
+ private _layoutFailed;
1998
+ private _navigationGeneration;
1999
+ private _renderProgressGeneration;
2000
+ private _lastReportedSlide;
2001
+ private _lastReportedTotal;
2002
+ private _lastReportedAvailable;
2003
+ private _lastReportedLayoutComplete;
1944
2004
  static fromPresentation(canvas: HTMLCanvasElement, presentation: PptxPresentation, opts?: Omit<PptxViewerOptions, keyof LoadOptions>): Omit<PptxViewer, 'load'>;
1945
2005
  constructor(canvas: HTMLCanvasElement, opts?: PptxViewerOptions);
1946
2006
  load(source: string | ArrayBuffer): Promise<void>;
1947
2007
  goToSlide(index: number): Promise<void>;
2008
+ private _goToSlide;
1948
2009
  nextSlide(): Promise<void>;
1949
2010
  prevSlide(): Promise<void>;
1950
2011
  private _step;
@@ -1955,6 +2016,9 @@ declare class PptxViewer implements ZoomableViewer {
1955
2016
  get visibleSlideCount(): number;
1956
2017
  get slideIndex(): number;
1957
2018
  get slideCount(): number;
2019
+ get availableSlideCount(): number;
2020
+ get layoutComplete(): boolean;
2021
+ waitUntilLayoutComplete(): Promise<void>;
1958
2022
  getNotes(slideIndex: number): string | null;
1959
2023
  get canvasElement(): HTMLCanvasElement;
1960
2024
  private _naturalWidthPx;
@@ -1969,6 +2033,14 @@ declare class PptxViewer implements ZoomableViewer {
1969
2033
  fitPage(): Promise<void>;
1970
2034
  private _fit;
1971
2035
  private renderCurrentSlide;
2036
+ private _bindLayoutPresentation;
2037
+ private _unbindLayoutPresentation;
2038
+ private _beginNavigation;
2039
+ private _onLayoutPublication;
2040
+ private _waitForSlide;
2041
+ private _wakeLayoutWaiters;
2042
+ private _emitSlideChange;
2043
+ private _setLoading;
1972
2044
  private _buildHighlightLayer;
1973
2045
  private _measureForFont;
1974
2046
  private _collectSlideRuns;
@@ -1976,6 +2048,7 @@ declare class PptxViewer implements ZoomableViewer {
1976
2048
  findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
1977
2049
  findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
1978
2050
  clearFind(): void;
2051
+ private _invalidateFind;
1979
2052
  private _activateMatch;
1980
2053
  private _redrawHighlights;
1981
2054
  private _buildTextLayer;
@@ -2023,7 +2096,7 @@ interface PptxScrollViewerOptions extends Pick<RenderSlideOptions, 'width' | 'dp
2023
2096
  refitOnResize?: boolean;
2024
2097
  background?: string;
2025
2098
  pageShadow?: string | false;
2026
- onVisibleSlideChange?: (topIndex: number, total: number) => void;
2099
+ onVisibleSlideChange?: (topIndex: number, total: number, layoutComplete: boolean) => void;
2027
2100
  onScaleChange?: (scale: number) => void;
2028
2101
  onError?: (err: Error) => void;
2029
2102
  onHyperlinkClick?: (target: HyperlinkTarget) => void;
@@ -2034,6 +2107,7 @@ declare class PptxScrollViewer implements ZoomableViewer {
2034
2107
  private get _pres();
2035
2108
  private readonly _borrowed;
2036
2109
  private readonly _opts;
2110
+ private readonly _errorRouter;
2037
2111
  private readonly _container;
2038
2112
  private readonly _wrapper;
2039
2113
  private readonly _scrollHost;
@@ -2047,6 +2121,9 @@ declare class PptxScrollViewer implements ZoomableViewer {
2047
2121
  private _uniformSlideHeight;
2048
2122
  private _lastRange;
2049
2123
  private _lastTopIndex;
2124
+ private _lastReportedTotal;
2125
+ private _lastReportedLayoutComplete;
2126
+ private _layoutUnsubscribe;
2050
2127
  private _scrollListener;
2051
2128
  private _selectionChangeListener;
2052
2129
  private _selectionContextKey;
@@ -2062,6 +2139,10 @@ declare class PptxScrollViewer implements ZoomableViewer {
2062
2139
  private _commentGeometryFrame;
2063
2140
  private readonly _pendingCommentGeometry;
2064
2141
  private _hasComments;
2142
+ private _reviewOriginPx;
2143
+ private _commentScanFrontier;
2144
+ private readonly _layoutWaiters;
2145
+ private _layoutFailed;
2065
2146
  private _elementHitGeneration;
2066
2147
  private readonly _elementHitTolerance;
2067
2148
  private _destroyed;
@@ -2075,12 +2156,16 @@ declare class PptxScrollViewer implements ZoomableViewer {
2075
2156
  private _lastFitWidth;
2076
2157
  private readonly _pageShadow;
2077
2158
  private readonly _find;
2159
+ private _findGeneration;
2078
2160
  private _findActive;
2079
2161
  private _findMeasureCtx;
2080
2162
  static fromPresentation(container: HTMLElement, presentation: PptxPresentation, opts?: Omit<PptxScrollViewerOptions, keyof LoadOptions>): Omit<PptxScrollViewer, 'load'>;
2081
2163
  constructor(container: HTMLElement, opts?: PptxScrollViewerOptions);
2082
2164
  load(source: string | ArrayBuffer): Promise<void>;
2083
2165
  get slideCount(): number;
2166
+ get availableSlideCount(): number;
2167
+ get layoutComplete(): boolean;
2168
+ waitUntilLayoutComplete(): Promise<void>;
2084
2169
  private _slideWidthPx;
2085
2170
  private _slideHeightPx;
2086
2171
  private _fitWidthPx;
@@ -2091,7 +2176,8 @@ declare class PptxScrollViewer implements ZoomableViewer {
2091
2176
  private _commentsOptions;
2092
2177
  private _commentSide;
2093
2178
  private _syncCommentMarginGeometry;
2094
- private _presentationHasComments;
2179
+ private _scanAvailableComments;
2180
+ private _refreshDiscoveredComments;
2095
2181
  private _baseScale;
2096
2182
  relayout(): void;
2097
2183
  private _relayout;
@@ -2117,6 +2203,14 @@ declare class PptxScrollViewer implements ZoomableViewer {
2117
2203
  private _positionSlot;
2118
2204
  private _dpr;
2119
2205
  private _renderSlot;
2206
+ private _trackSlotLoading;
2207
+ private _bindLayoutPresentation;
2208
+ private _unbindLayoutPresentation;
2209
+ private _onLayoutPublication;
2210
+ private _wakeLayoutWaiters;
2211
+ private _beginCommentNavigation;
2212
+ private _waitForSlideMetadata;
2213
+ private _emitVisibleSlideChange;
2120
2214
  private _renderInteractiveSlot;
2121
2215
  private _syncMediaPlayback;
2122
2216
  private _reportRenderError;
@@ -2146,6 +2240,7 @@ declare class PptxScrollViewer implements ZoomableViewer {
2146
2240
  findNext(): Promise<FindMatch<PptxMatchLocation> | null>;
2147
2241
  findPrev(): Promise<FindMatch<PptxMatchLocation> | null>;
2148
2242
  clearFind(): void;
2243
+ private _invalidateFind;
2149
2244
  private _activateMatch;
2150
2245
  private _collectSlideRuns;
2151
2246
  private _redrawHighlights;
@@ -1081,7 +1081,7 @@ interface ChartRegionMapRenderer {
1081
1081
  render(ctx: CanvasRenderingContext2D, chart: ChartModel, rect: ChartRect, ptToPx: number, shapeRotationDeg?: number): boolean;
1082
1082
  }
1083
1083
  //#endregion
1084
- //#region dist/.types-work/hyperlink-CZoV-4B8.d.ts
1084
+ //#region dist/.types-work/hyperlink-Bk5fiM_m.d.ts
1085
1085
  type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
1086
1086
  type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
1087
1087
  declare class OoxmlError extends Error {
@@ -1984,7 +1984,7 @@ interface XlsxRenderViewportOptions {
1984
1984
  } | null;
1985
1985
  }
1986
1986
  //#endregion
1987
- //#region dist/.types-work/xlsx-_-beyOtw.d.ts
1987
+ //#region dist/.types-work/xlsx-BjLUPERo.d.ts
1988
1988
  type ResolvedList = {
1989
1989
  kind: 'values';
1990
1990
  values: string[];
@@ -1,8 +1,8 @@
1
- import { $ as e, F as t, I as n, N as r, P as i, Q as a, X as o, Y as s, Yt as c, Z as l, et as u, nt as d, ot as f, rt as p, tt as m } from "./line-metrics-B3syvDn2.js";
2
- import { n as h, r as g, t as _ } from "./resource-measurement-CsW4_eYt.js";
1
+ import { F as e, Gt as t, I as n, Jt as r, K as i, Kt as a, N as o, P as s, Qt as c, U as l, Ut as u, Wt as d, Xt as f, Yt as p, qt as m } from "./line-metrics-Bpn7OeZD.js";
2
+ import { n as h, r as g, t as _ } from "./resource-measurement-DuiFWzam.js";
3
3
  import { t as v } from "./transfer-R6NjgBKD.js";
4
4
  //#region packages/xlsx/src/worksheet-resource-limits.ts
5
- var y = d, b = e, x = u, S = m, C = a, w = s, T = o, E = l, D = Object.freeze({
5
+ var y = f, b = m, x = r, S = p, C = a, w = u, T = d, E = t, D = Object.freeze({
6
6
  archiveEntryCount: 0,
7
7
  declaredInflatedBytes: 0,
8
8
  distinctInflatedBytes: 0,
@@ -159,7 +159,7 @@ var z = 64 * 1024 * 1024, B = class {
159
159
  get pendingOpenCount() {
160
160
  return this.pendingOpens.size;
161
161
  }
162
- async open(e, n, r) {
162
+ async open(t, n, r) {
163
163
  if (this.resourceFailure) throw this.resourceFailure;
164
164
  let i = this.pendingOpens.get(r.sessionId);
165
165
  if (!i || i.identity.operationId !== r.operationId || i.identity.generation !== r.generation) throw Error("worksheet pull session open reservation is stale or missing");
@@ -167,12 +167,12 @@ var z = 64 * 1024 * 1024, B = class {
167
167
  a = e;
168
168
  }), s = this.operationTail.then(() => this.coordinator.enqueue(async () => {
169
169
  if (i.canceled) throw Error("worksheet pull session open was canceled");
170
- this.executeArchive((t) => t.open_sheet_cursor(e, n));
170
+ this.executeArchive((e) => e.open_sheet_cursor(t, n));
171
171
  let o = [], s = {
172
172
  rows: 0,
173
173
  cells: 0,
174
174
  ownedUtf8Bytes: 0
175
- }, l, u = !1, d = new t({
175
+ }, l, u = !1, d = new e({
176
176
  ...r,
177
177
  maxByteCredit: z,
178
178
  coordinator: this.coordinator,
@@ -202,7 +202,7 @@ var z = 64 * 1024 * 1024, B = class {
202
202
  measureChunk: ({ payload: e }) => e.byteLength,
203
203
  acknowledge: () => {
204
204
  if (!u) return;
205
- let t, n;
205
+ let e, n;
206
206
  try {
207
207
  if (this.acceptWorksheet) {
208
208
  if (!l) throw Error("worksheet terminal payload is missing");
@@ -213,12 +213,12 @@ var z = 64 * 1024 * 1024, B = class {
213
213
  ownedUtf8Bytes: 0
214
214
  } : s, i = k(l, r), a = this.readResourceUsage();
215
215
  N(i, "get-worksheet-worker", void 0, a), P(i.jsonBytes, "get-worksheet-worker", void 0, a);
216
- let c = this.acceptWorksheet(e, l, i, a);
217
- typeof c == "function" ? t = c : c && ({rollback: t, commit: n} = c);
216
+ let c = this.acceptWorksheet(t, l, i, a);
217
+ typeof c == "function" ? e = c : c && ({rollback: e, commit: n} = c);
218
218
  }
219
219
  this.executeArchive((e) => e.acknowledge_sheet_cursor_terminal()), n?.();
220
- } catch (e) {
221
- throw t?.(), e instanceof c && (this.resourceFailure ??= e), e;
220
+ } catch (t) {
221
+ throw e?.(), t instanceof c && (this.resourceFailure ??= t), t;
222
222
  }
223
223
  u = !1, this.sessions.delete(r.sessionId), a();
224
224
  },
@@ -268,7 +268,7 @@ var z = 64 * 1024 * 1024, B = class {
268
268
  if (r && (e.kind === "cancel" || e.kind === "close")) {
269
269
  let n = r.identity.operationId === e.operationId && r.identity.generation === e.generation;
270
270
  return n && (r.canceled = !0), t(n ? {
271
- protocol: i,
271
+ protocol: s,
272
272
  kind: "accepted",
273
273
  sessionId: e.sessionId,
274
274
  operationId: e.operationId,
@@ -276,7 +276,7 @@ var z = 64 * 1024 * 1024, B = class {
276
276
  requestId: e.requestId,
277
277
  command: e.kind
278
278
  } : {
279
- protocol: i,
279
+ protocol: s,
280
280
  kind: "error",
281
281
  sessionId: e.sessionId,
282
282
  operationId: e.operationId,
@@ -290,7 +290,7 @@ var z = 64 * 1024 * 1024, B = class {
290
290
  }), Promise.resolve();
291
291
  }
292
292
  return e.kind === "cancel" || e.kind === "close" ? (t({
293
- protocol: i,
293
+ protocol: s,
294
294
  kind: "accepted",
295
295
  sessionId: e.sessionId,
296
296
  operationId: e.operationId,
@@ -298,13 +298,13 @@ var z = 64 * 1024 * 1024, B = class {
298
298
  requestId: e.requestId,
299
299
  command: e.kind
300
300
  }), Promise.resolve()) : (t({
301
- protocol: i,
301
+ protocol: s,
302
302
  kind: "error",
303
303
  sessionId: e.sessionId,
304
304
  operationId: e.operationId,
305
305
  generation: e.generation,
306
306
  requestId: e.requestId,
307
- error: f(/* @__PURE__ */ Error("worksheet pull session is not open"))
307
+ error: i(/* @__PURE__ */ Error("worksheet pull session is not open"))
308
308
  }), Promise.resolve());
309
309
  }
310
310
  async dispatchSafely(e, t) {
@@ -313,13 +313,13 @@ var z = 64 * 1024 * 1024, B = class {
313
313
  } catch (n) {
314
314
  try {
315
315
  t({
316
- protocol: i,
316
+ protocol: s,
317
317
  kind: "error",
318
318
  sessionId: e.sessionId,
319
319
  operationId: e.operationId,
320
320
  generation: e.generation,
321
321
  requestId: e.requestId,
322
- error: f(n)
322
+ error: i(n)
323
323
  });
324
324
  } catch {}
325
325
  }
@@ -337,7 +337,7 @@ var z = 64 * 1024 * 1024, B = class {
337
337
  for (let e of this.pendingOpens.values()) e.canceled = !0;
338
338
  let e = 1;
339
339
  for (let { host: t, identity: n } of [...this.sessions.values()]) await t.dispatch({
340
- protocol: i,
340
+ protocol: s,
341
341
  kind: "close",
342
342
  ...n,
343
343
  requestId: e++
@@ -353,7 +353,7 @@ var z = 64 * 1024 * 1024, B = class {
353
353
  let t = this.sessions.get(e.sessionId);
354
354
  if (t) {
355
355
  await t.host.dispatch({
356
- protocol: i,
356
+ protocol: s,
357
357
  kind: "close",
358
358
  ...e,
359
359
  requestId: 1
@@ -365,7 +365,7 @@ var z = 64 * 1024 * 1024, B = class {
365
365
  }
366
366
  readResourceUsage() {
367
367
  try {
368
- return p(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
368
+ return l(this.executeArchive((e) => e.sheet_cursor_resource_usage()));
369
369
  } catch (e) {
370
370
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
371
371
  throw e;
@@ -381,24 +381,24 @@ var z = 64 * 1024 * 1024, B = class {
381
381
  if (!Number.isSafeInteger(e) || e < 0) throw RangeError("sheetIndex must be a non-negative safe integer");
382
382
  if (!t) throw TypeError("sheetName must be non-empty");
383
383
  W(n);
384
- let i = this.nextSessionId++, a = {
385
- sessionId: i,
386
- operationId: i,
384
+ let r = this.nextSessionId++, i = {
385
+ sessionId: r,
386
+ operationId: r,
387
387
  generation: this.options.generation ?? 1
388
- }, o = new r(this.options.transport, {
389
- ...a,
388
+ }, a = new o(this.options.transport, {
389
+ ...i,
390
390
  maxByteCredit: z,
391
391
  timeoutMs: this.options.timeoutMs,
392
392
  disposeTransferred: this.options.disposeTransferred
393
393
  });
394
- this.active.add(o);
394
+ this.active.add(a);
395
395
  let s = !1, c;
396
396
  try {
397
- for (await this.options.open(e, t, a, this.options.timeoutMs);;) {
397
+ for (await this.options.open(e, t, i, this.options.timeoutMs);;) {
398
398
  W(n);
399
- let e = await o.pull(z, { signal: n });
399
+ let e = await a.pull(z, { signal: n });
400
400
  try {
401
- let t = e.usage ?? o.usageCheckpoint;
401
+ let t = e.usage ?? a.usageCheckpoint;
402
402
  t && this.options.onUsage?.(t);
403
403
  let r = R(e.payload, e.done, this.options.sharedStrings);
404
404
  if (yield r.kind === "rows" ? {
@@ -426,11 +426,11 @@ var z = 64 * 1024 * 1024, B = class {
426
426
  } finally {
427
427
  let e;
428
428
  try {
429
- s || await o.cancel(U(c));
429
+ s || await a.cancel(U(c));
430
430
  } catch (t) {
431
431
  e = t;
432
432
  } finally {
433
- this.active.delete(o);
433
+ this.active.delete(a);
434
434
  }
435
435
  if (c === void 0 && e !== void 0) throw e;
436
436
  }