@docmentis/udoc-viewer 0.6.42 → 0.7.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 (45) hide show
  1. package/README.md +39 -5
  2. package/dist/package.json +1 -1
  3. package/dist/src/UDocClient.d.ts.map +1 -1
  4. package/dist/src/UDocClient.js +4 -4
  5. package/dist/src/UDocClient.js.map +1 -1
  6. package/dist/src/UDocViewer.d.ts +11 -4
  7. package/dist/src/UDocViewer.d.ts.map +1 -1
  8. package/dist/src/UDocViewer.js +24 -4
  9. package/dist/src/UDocViewer.js.map +1 -1
  10. package/dist/src/index.d.ts +1 -1
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/ui/viewer/actions.d.ts +4 -1
  13. package/dist/src/ui/viewer/actions.d.ts.map +1 -1
  14. package/dist/src/ui/viewer/components/LeftPanel.d.ts.map +1 -1
  15. package/dist/src/ui/viewer/components/LeftPanel.js +16 -11
  16. package/dist/src/ui/viewer/components/LeftPanel.js.map +1 -1
  17. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts +25 -0
  18. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts.map +1 -0
  19. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js +77 -0
  20. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js.map +1 -0
  21. package/dist/src/ui/viewer/components/Toolbar.d.ts.map +1 -1
  22. package/dist/src/ui/viewer/components/Toolbar.js +3 -4
  23. package/dist/src/ui/viewer/components/Toolbar.js.map +1 -1
  24. package/dist/src/ui/viewer/reducer.d.ts.map +1 -1
  25. package/dist/src/ui/viewer/reducer.js +4 -0
  26. package/dist/src/ui/viewer/reducer.js.map +1 -1
  27. package/dist/src/ui/viewer/shell.d.ts.map +1 -1
  28. package/dist/src/ui/viewer/shell.js +5 -0
  29. package/dist/src/ui/viewer/shell.js.map +1 -1
  30. package/dist/src/ui/viewer/state.d.ts +11 -0
  31. package/dist/src/ui/viewer/state.d.ts.map +1 -1
  32. package/dist/src/ui/viewer/state.js +12 -2
  33. package/dist/src/ui/viewer/state.js.map +1 -1
  34. package/dist/src/ui/viewer/styles-inline.d.ts +1 -1
  35. package/dist/src/ui/viewer/styles-inline.d.ts.map +1 -1
  36. package/dist/src/ui/viewer/styles-inline.js +53 -1
  37. package/dist/src/ui/viewer/styles-inline.js.map +1 -1
  38. package/dist/src/wasm/udoc.d.ts +849 -894
  39. package/dist/src/wasm/udoc.js +1887 -2018
  40. package/dist/src/wasm/udoc_bg.wasm +0 -0
  41. package/dist/src/wasm/udoc_bg.wasm.d.ts +5 -9
  42. package/dist/src/worker/worker-inline.js +1 -1
  43. package/dist/src/worker/worker.js +1909 -2039
  44. package/dist/src/worker/worker.js.map +1 -1
  45. package/package.json +1 -1
@@ -1,253 +1,6 @@
1
1
  "use strict";
2
2
  (() => {
3
3
  // dist/src/wasm/udoc.js
4
- var wasm;
5
- function addHeapObject(obj) {
6
- if (heap_next === heap.length) heap.push(heap.length + 1);
7
- const idx = heap_next;
8
- heap_next = heap[idx];
9
- heap[idx] = obj;
10
- return idx;
11
- }
12
- var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
13
- }, unregister: () => {
14
- } } : new FinalizationRegistry((state) => state.dtor(state.a, state.b));
15
- function debugString(val) {
16
- const type = typeof val;
17
- if (type == "number" || type == "boolean" || val == null) {
18
- return `${val}`;
19
- }
20
- if (type == "string") {
21
- return `"${val}"`;
22
- }
23
- if (type == "symbol") {
24
- const description = val.description;
25
- if (description == null) {
26
- return "Symbol";
27
- } else {
28
- return `Symbol(${description})`;
29
- }
30
- }
31
- if (type == "function") {
32
- const name = val.name;
33
- if (typeof name == "string" && name.length > 0) {
34
- return `Function(${name})`;
35
- } else {
36
- return "Function";
37
- }
38
- }
39
- if (Array.isArray(val)) {
40
- const length = val.length;
41
- let debug = "[";
42
- if (length > 0) {
43
- debug += debugString(val[0]);
44
- }
45
- for (let i = 1; i < length; i++) {
46
- debug += ", " + debugString(val[i]);
47
- }
48
- debug += "]";
49
- return debug;
50
- }
51
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
52
- let className;
53
- if (builtInMatches && builtInMatches.length > 1) {
54
- className = builtInMatches[1];
55
- } else {
56
- return toString.call(val);
57
- }
58
- if (className == "Object") {
59
- try {
60
- return "Object(" + JSON.stringify(val) + ")";
61
- } catch (_) {
62
- return "Object";
63
- }
64
- }
65
- if (val instanceof Error) {
66
- return `${val.name}: ${val.message}
67
- ${val.stack}`;
68
- }
69
- return className;
70
- }
71
- function dropObject(idx) {
72
- if (idx < 132) return;
73
- heap[idx] = heap_next;
74
- heap_next = idx;
75
- }
76
- function getArrayJsValueFromWasm0(ptr, len) {
77
- ptr = ptr >>> 0;
78
- const mem = getDataViewMemory0();
79
- const result = [];
80
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
81
- result.push(takeObject(mem.getUint32(i, true)));
82
- }
83
- return result;
84
- }
85
- function getArrayU32FromWasm0(ptr, len) {
86
- ptr = ptr >>> 0;
87
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
88
- }
89
- function getArrayU8FromWasm0(ptr, len) {
90
- ptr = ptr >>> 0;
91
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
92
- }
93
- var cachedDataViewMemory0 = null;
94
- function getDataViewMemory0() {
95
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
96
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
97
- }
98
- return cachedDataViewMemory0;
99
- }
100
- function getStringFromWasm0(ptr, len) {
101
- ptr = ptr >>> 0;
102
- return decodeText(ptr, len);
103
- }
104
- var cachedUint32ArrayMemory0 = null;
105
- function getUint32ArrayMemory0() {
106
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
107
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
108
- }
109
- return cachedUint32ArrayMemory0;
110
- }
111
- var cachedUint8ArrayMemory0 = null;
112
- function getUint8ArrayMemory0() {
113
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
114
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
115
- }
116
- return cachedUint8ArrayMemory0;
117
- }
118
- function getObject(idx) {
119
- return heap[idx];
120
- }
121
- function handleError(f, args) {
122
- try {
123
- return f.apply(this, args);
124
- } catch (e) {
125
- wasm.__wbindgen_export3(addHeapObject(e));
126
- }
127
- }
128
- var heap = new Array(128).fill(void 0);
129
- heap.push(void 0, null, true, false);
130
- var heap_next = heap.length;
131
- function isLikeNone(x) {
132
- return x === void 0 || x === null;
133
- }
134
- function makeMutClosure(arg0, arg1, dtor, f) {
135
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
136
- const real = (...args) => {
137
- state.cnt++;
138
- const a = state.a;
139
- state.a = 0;
140
- try {
141
- return f(a, state.b, ...args);
142
- } finally {
143
- state.a = a;
144
- real._wbg_cb_unref();
145
- }
146
- };
147
- real._wbg_cb_unref = () => {
148
- if (--state.cnt === 0) {
149
- state.dtor(state.a, state.b);
150
- state.a = 0;
151
- CLOSURE_DTORS.unregister(state);
152
- }
153
- };
154
- CLOSURE_DTORS.register(real, state, state);
155
- return real;
156
- }
157
- function passArray8ToWasm0(arg, malloc) {
158
- const ptr = malloc(arg.length * 1, 1) >>> 0;
159
- getUint8ArrayMemory0().set(arg, ptr / 1);
160
- WASM_VECTOR_LEN = arg.length;
161
- return ptr;
162
- }
163
- function passArrayJsValueToWasm0(array, malloc) {
164
- const ptr = malloc(array.length * 4, 4) >>> 0;
165
- const mem = getDataViewMemory0();
166
- for (let i = 0; i < array.length; i++) {
167
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
168
- }
169
- WASM_VECTOR_LEN = array.length;
170
- return ptr;
171
- }
172
- function passStringToWasm0(arg, malloc, realloc) {
173
- if (realloc === void 0) {
174
- const buf = cachedTextEncoder.encode(arg);
175
- const ptr2 = malloc(buf.length, 1) >>> 0;
176
- getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
177
- WASM_VECTOR_LEN = buf.length;
178
- return ptr2;
179
- }
180
- let len = arg.length;
181
- let ptr = malloc(len, 1) >>> 0;
182
- const mem = getUint8ArrayMemory0();
183
- let offset = 0;
184
- for (; offset < len; offset++) {
185
- const code = arg.charCodeAt(offset);
186
- if (code > 127) break;
187
- mem[ptr + offset] = code;
188
- }
189
- if (offset !== len) {
190
- if (offset !== 0) {
191
- arg = arg.slice(offset);
192
- }
193
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
194
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
195
- const ret = cachedTextEncoder.encodeInto(arg, view);
196
- offset += ret.written;
197
- ptr = realloc(ptr, len, offset, 1) >>> 0;
198
- }
199
- WASM_VECTOR_LEN = offset;
200
- return ptr;
201
- }
202
- function takeObject(idx) {
203
- const ret = getObject(idx);
204
- dropObject(idx);
205
- return ret;
206
- }
207
- var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
208
- cachedTextDecoder.decode();
209
- var MAX_SAFARI_DECODE_BYTES = 2146435072;
210
- var numBytesDecoded = 0;
211
- function decodeText(ptr, len) {
212
- numBytesDecoded += len;
213
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
214
- cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
215
- cachedTextDecoder.decode();
216
- numBytesDecoded = len;
217
- }
218
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
219
- }
220
- var cachedTextEncoder = new TextEncoder();
221
- if (!("encodeInto" in cachedTextEncoder)) {
222
- cachedTextEncoder.encodeInto = function(arg, view) {
223
- const buf = cachedTextEncoder.encode(arg);
224
- view.set(buf);
225
- return {
226
- read: arg.length,
227
- written: buf.length
228
- };
229
- };
230
- }
231
- var WASM_VECTOR_LEN = 0;
232
- function __wasm_bindgen_func_elem_4195(arg0, arg1, arg2) {
233
- wasm.__wasm_bindgen_func_elem_4195(arg0, arg1, addHeapObject(arg2));
234
- }
235
- function __wasm_bindgen_func_elem_22595(arg0, arg1, arg2, arg3) {
236
- wasm.__wasm_bindgen_func_elem_22595(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
237
- }
238
- var __wbindgen_enum_GpuBufferBindingType = ["uniform", "storage", "read-only-storage"];
239
- var __wbindgen_enum_GpuPowerPreference = ["low-power", "high-performance"];
240
- var __wbindgen_enum_GpuSamplerBindingType = ["filtering", "non-filtering", "comparison"];
241
- var __wbindgen_enum_GpuStorageTextureAccess = ["write-only", "read-only", "read-write"];
242
- var __wbindgen_enum_GpuTextureAspect = ["all", "stencil-only", "depth-only"];
243
- var __wbindgen_enum_GpuTextureDimension = ["1d", "2d", "3d"];
244
- var __wbindgen_enum_GpuTextureFormat = ["r8unorm", "r8snorm", "r8uint", "r8sint", "r16uint", "r16sint", "r16float", "rg8unorm", "rg8snorm", "rg8uint", "rg8sint", "r32uint", "r32sint", "r32float", "rg16uint", "rg16sint", "rg16float", "rgba8unorm", "rgba8unorm-srgb", "rgba8snorm", "rgba8uint", "rgba8sint", "bgra8unorm", "bgra8unorm-srgb", "rgb9e5ufloat", "rgb10a2uint", "rgb10a2unorm", "rg11b10ufloat", "rg32uint", "rg32sint", "rg32float", "rgba16uint", "rgba16sint", "rgba16float", "rgba32uint", "rgba32sint", "rgba32float", "stencil8", "depth16unorm", "depth24plus", "depth24plus-stencil8", "depth32float", "depth32float-stencil8", "bc1-rgba-unorm", "bc1-rgba-unorm-srgb", "bc2-rgba-unorm", "bc2-rgba-unorm-srgb", "bc3-rgba-unorm", "bc3-rgba-unorm-srgb", "bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm", "bc6h-rgb-ufloat", "bc6h-rgb-float", "bc7-rgba-unorm", "bc7-rgba-unorm-srgb", "etc2-rgb8unorm", "etc2-rgb8unorm-srgb", "etc2-rgb8a1unorm", "etc2-rgb8a1unorm-srgb", "etc2-rgba8unorm", "etc2-rgba8unorm-srgb", "eac-r11unorm", "eac-r11snorm", "eac-rg11unorm", "eac-rg11snorm", "astc-4x4-unorm", "astc-4x4-unorm-srgb", "astc-5x4-unorm", "astc-5x4-unorm-srgb", "astc-5x5-unorm", "astc-5x5-unorm-srgb", "astc-6x5-unorm", "astc-6x5-unorm-srgb", "astc-6x6-unorm", "astc-6x6-unorm-srgb", "astc-8x5-unorm", "astc-8x5-unorm-srgb", "astc-8x6-unorm", "astc-8x6-unorm-srgb", "astc-8x8-unorm", "astc-8x8-unorm-srgb", "astc-10x5-unorm", "astc-10x5-unorm-srgb", "astc-10x6-unorm", "astc-10x6-unorm-srgb", "astc-10x8-unorm", "astc-10x8-unorm-srgb", "astc-10x10-unorm", "astc-10x10-unorm-srgb", "astc-12x10-unorm", "astc-12x10-unorm-srgb", "astc-12x12-unorm", "astc-12x12-unorm-srgb"];
245
- var __wbindgen_enum_GpuTextureSampleType = ["float", "unfilterable-float", "depth", "sint", "uint"];
246
- var __wbindgen_enum_GpuTextureViewDimension = ["1d", "2d", "2d-array", "cube", "cube-array", "3d"];
247
- var __wbindgen_enum_XmlHttpRequestResponseType = ["", "arraybuffer", "blob", "document", "json", "text"];
248
- var WasmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
249
- }, unregister: () => {
250
- } } : new FinalizationRegistry((ptr) => wasm.__wbg_wasm_free(ptr >>> 0, 1));
251
4
  var Wasm = class {
252
5
  __destroy_into_raw() {
253
6
  const ptr = this.__wbg_ptr;
@@ -260,179 +13,192 @@ ${val.stack}`;
260
13
  wasm.__wbg_wasm_free(ptr, 0);
261
14
  }
262
15
  /**
263
- * Load an image file and return its ID.
264
- *
265
- * Supports various image formats: JPEG, PNG, GIF, BMP, TIFF, WebP, etc.
266
- * Multi-page TIFF files will create a document with multiple pages.
267
- *
268
- * # Arguments
269
- * * `bytes` - Raw image file data
16
+ * Get info for all pages in one call.
270
17
  *
271
- * # Returns
272
- * A unique document ID that can be used to reference this document.
273
- * @param {Uint8Array} bytes
274
- * @returns {string}
18
+ * Returns an array of `PageInfo` objects, one per page.
19
+ * More efficient than calling `page_info` for each page.
20
+ * @param {string} id
21
+ * @returns {JsPageInfo[]}
275
22
  */
276
- load_image(bytes) {
277
- let deferred3_0;
278
- let deferred3_1;
23
+ all_page_info(id) {
279
24
  try {
280
25
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
281
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
26
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
282
27
  const len0 = WASM_VECTOR_LEN;
283
- wasm.wasm_load_image(retptr, this.__wbg_ptr, ptr0, len0);
28
+ wasm.wasm_all_page_info(retptr, this.__wbg_ptr, ptr0, len0);
284
29
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
285
30
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
286
31
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
287
32
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
288
- var ptr2 = r0;
289
- var len2 = r1;
290
33
  if (r3) {
291
- ptr2 = 0;
292
- len2 = 0;
293
34
  throw takeObject(r2);
294
35
  }
295
- deferred3_0 = ptr2;
296
- deferred3_1 = len2;
297
- return getStringFromWasm0(ptr2, len2);
36
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
37
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
38
+ return v2;
298
39
  } finally {
299
40
  wasm.__wbindgen_add_to_stack_pointer(16);
300
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
301
41
  }
302
42
  }
303
43
  /**
304
- * Get the page count of a document.
44
+ * Authenticate with a password to unlock an encrypted document.
45
+ *
46
+ * # Arguments
47
+ * * `id` - Document ID
48
+ * * `password` - Password to try
49
+ *
50
+ * # Returns
51
+ * `true` if authentication succeeded, `false` if the password was incorrect.
305
52
  * @param {string} id
306
- * @returns {number}
53
+ * @param {string} password
54
+ * @returns {boolean}
307
55
  */
308
- page_count(id) {
56
+ authenticate(id, password) {
309
57
  try {
310
58
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
311
59
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
312
60
  const len0 = WASM_VECTOR_LEN;
313
- wasm.wasm_page_count(retptr, this.__wbg_ptr, ptr0, len0);
61
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
62
+ const len1 = WASM_VECTOR_LEN;
63
+ wasm.wasm_authenticate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
314
64
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
315
65
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
316
66
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
317
67
  if (r2) {
318
68
  throw takeObject(r1);
319
69
  }
320
- return r0 >>> 0;
70
+ return r0 !== 0;
321
71
  } finally {
322
72
  wasm.__wbindgen_add_to_stack_pointer(16);
323
73
  }
324
74
  }
325
75
  /**
326
- * Get the document outline (bookmarks/table of contents).
76
+ * Disable telemetry reporting.
327
77
  *
328
- * Returns an array of outline items, where each item has:
329
- * - `title`: Display text for the item
330
- * - `destination`: Optional navigation destination with `pageIndex` and display parameters
331
- * - `children`: Nested child items
78
+ * Only takes effect if the current license includes the `no_telemetry`
79
+ * feature flag. Returns `true` if telemetry was disabled, `false` if the
80
+ * license does not permit it.
81
+ * @returns {boolean}
82
+ */
83
+ disable_telemetry() {
84
+ const ret = wasm.wasm_disable_telemetry(this.__wbg_ptr);
85
+ return ret !== 0;
86
+ }
87
+ /**
88
+ * Get the number of documents currently loaded.
89
+ * @returns {number}
90
+ */
91
+ get document_count() {
92
+ const ret = wasm.wasm_document_count(this.__wbg_ptr);
93
+ return ret >>> 0;
94
+ }
95
+ /**
96
+ * Get the format of a loaded document.
332
97
  *
333
- * Returns an empty array if the document has no outline.
98
+ * Returns one of: "pdf", "docx", "pptx", "xlsx", "image".
334
99
  * @param {string} id
335
- * @returns {JsOutlineItem[]}
100
+ * @returns {string}
336
101
  */
337
- get_outline(id) {
102
+ document_format(id) {
103
+ let deferred3_0;
104
+ let deferred3_1;
338
105
  try {
339
106
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
340
107
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
341
108
  const len0 = WASM_VECTOR_LEN;
342
- wasm.wasm_get_outline(retptr, this.__wbg_ptr, ptr0, len0);
109
+ wasm.wasm_document_format(retptr, this.__wbg_ptr, ptr0, len0);
343
110
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
344
111
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
345
112
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
346
113
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
114
+ var ptr2 = r0;
115
+ var len2 = r1;
347
116
  if (r3) {
117
+ ptr2 = 0;
118
+ len2 = 0;
348
119
  throw takeObject(r2);
349
120
  }
350
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
351
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
352
- return v2;
121
+ deferred3_0 = ptr2;
122
+ deferred3_1 = len2;
123
+ return getStringFromWasm0(ptr2, len2);
353
124
  } finally {
354
125
  wasm.__wbindgen_add_to_stack_pointer(16);
126
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
355
127
  }
356
128
  }
357
129
  /**
358
- * Check if a feature is enabled by the current license.
359
- * @param {string} feature
360
- * @returns {boolean}
130
+ * Get all document IDs.
131
+ * @returns {string[]}
361
132
  */
362
- has_feature(feature) {
363
- const ptr0 = passStringToWasm0(feature, wasm.__wbindgen_export, wasm.__wbindgen_export2);
364
- const len0 = WASM_VECTOR_LEN;
365
- const ret = wasm.wasm_has_feature(this.__wbg_ptr, ptr0, len0);
366
- return ret !== 0;
133
+ document_ids() {
134
+ try {
135
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
136
+ wasm.wasm_document_ids(retptr, this.__wbg_ptr);
137
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
138
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
139
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
140
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
141
+ return v1;
142
+ } finally {
143
+ wasm.__wbindgen_add_to_stack_pointer(16);
144
+ }
367
145
  }
368
146
  /**
369
- * Get the page groups for a document.
147
+ * Enable Google Fonts.
370
148
  *
371
- * Each group covers a contiguous range of global page indices with a
372
- * shared stitching layout. Use this to build per-group canvases (e.g.,
373
- * one panel per Excel sheet) and group-named sidebars.
149
+ * When enabled, fonts that are not embedded in the document will be
150
+ * automatically fetched from Google Fonts during rendering. Google Fonts
151
+ * are resolved after any URL fonts registered via `registerFonts`.
374
152
  *
375
- * - PDF/DOCX: one `linear` group covering all pages, no name.
376
- * - PPTX: one `linear` group (per-section groups once sections are modeled).
377
- * - XLSX: one `tiled` group per sheet with the sheet name and page-grid dimensions.
153
+ * Call this before loading documents.
154
+ *
155
+ * # Example (JavaScript)
156
+ * ```js
157
+ * udoc.enableGoogleFonts();
158
+ * const docId = udoc.loadPptx(pptxBytes);
159
+ * const pixels = udoc.renderPageToRgba(docId, 0, 800, 600);
160
+ * ```
161
+ */
162
+ enableGoogleFonts() {
163
+ wasm.wasm_enableGoogleFonts(this.__wbg_ptr);
164
+ }
165
+ /**
166
+ * Get all annotations in the document, grouped by page index.
167
+ *
168
+ * Returns an object mapping page indices (as strings) to arrays of annotations.
378
169
  * @param {string} id
379
- * @returns {JsPageGroup[]}
170
+ * @returns {JsAnnotationsByPage}
380
171
  */
381
- page_groups(id) {
172
+ get_all_annotations(id) {
382
173
  try {
383
174
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
384
175
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
385
176
  const len0 = WASM_VECTOR_LEN;
386
- wasm.wasm_page_groups(retptr, this.__wbg_ptr, ptr0, len0);
177
+ wasm.wasm_get_all_annotations(retptr, this.__wbg_ptr, ptr0, len0);
387
178
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
388
179
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
389
180
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
390
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
391
- if (r3) {
392
- throw takeObject(r2);
181
+ if (r2) {
182
+ throw takeObject(r1);
393
183
  }
394
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
395
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
396
- return v2;
184
+ return takeObject(r0);
397
185
  } finally {
398
186
  wasm.__wbindgen_add_to_stack_pointer(16);
399
187
  }
400
188
  }
401
189
  /**
402
- * Compose new PDF documents by cherry-picking pages from source documents.
403
- *
404
- * The original documents remain unchanged.
405
- *
406
- * # Arguments
407
- * * `compositions` - Array of compositions. Each composition is an array of picks.
408
- * Each pick is `{ doc: docIndex, pages: "0-2,4" }` where `docIndex` is the index
409
- * in the `doc_ids` array and `pages` is a page range string (0-based).
410
- * * `doc_ids` - Array of document IDs to use as sources (order matters for doc indices)
411
- *
412
- * # Example
413
- * ```js
414
- * // Create two documents: first has pages 0-2 from doc A, second has page 0 from A and 1 from B
415
- * const newDocIds = udoc.pdf_compose(
416
- * [
417
- * [{ doc: 0, pages: "0-2" }],
418
- * [{ doc: 0, pages: "0" }, { doc: 1, pages: "1" }]
419
- * ],
420
- * ["doc_0", "doc_1"]
421
- * );
422
- * ```
190
+ * Get the raw file bytes of a document.
423
191
  *
424
- * # Returns
425
- * Array of IDs for the newly created documents (one per composition).
426
- * @param {JsCompositions} compositions
427
- * @param {string[]} doc_ids
428
- * @returns {string[]}
192
+ * Returns the original file data for the document.
193
+ * @param {string} id
194
+ * @returns {Uint8Array}
429
195
  */
430
- pdf_compose(compositions, doc_ids) {
196
+ get_bytes(id) {
431
197
  try {
432
198
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
433
- const ptr0 = passArrayJsValueToWasm0(doc_ids, wasm.__wbindgen_export);
199
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
434
200
  const len0 = WASM_VECTOR_LEN;
435
- wasm.wasm_pdf_compose(retptr, this.__wbg_ptr, addHeapObject(compositions), ptr0, len0);
201
+ wasm.wasm_get_bytes(retptr, this.__wbg_ptr, ptr0, len0);
436
202
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
437
203
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
438
204
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -440,113 +206,114 @@ ${val.stack}`;
440
206
  if (r3) {
441
207
  throw takeObject(r2);
442
208
  }
443
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
444
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
209
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
210
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
445
211
  return v2;
446
212
  } finally {
447
213
  wasm.__wbindgen_add_to_stack_pointer(16);
448
214
  }
449
215
  }
450
216
  /**
451
- * Set the license key.
217
+ * Get font usage information for a document.
452
218
  *
453
- * # Arguments
454
- * * `license_key` - The license key string
219
+ * Returns an array of `FontUsageEntry` objects describing how each font
220
+ * spec in the document was resolved, including primary resolution and
221
+ * any glyph-fallback fonts used during text shaping.
455
222
  *
456
- * # Returns
457
- * License validation result as JSON.
458
- * @param {string} license_key
459
- * @returns {LicenseResult}
460
- */
461
- set_license(license_key) {
462
- const ptr0 = passStringToWasm0(license_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
463
- const len0 = WASM_VECTOR_LEN;
464
- const ret = wasm.wasm_set_license(this.__wbg_ptr, ptr0, len0);
465
- return takeObject(ret);
466
- }
467
- /**
468
- * Authenticate with a password to unlock an encrypted document.
223
+ * This information is populated during layout — call after rendering at
224
+ * least one page to get results.
469
225
  *
470
226
  * # Arguments
471
227
  * * `id` - Document ID
472
- * * `password` - Password to try
473
228
  *
474
229
  * # Returns
475
- * `true` if authentication succeeded, `false` if the password was incorrect.
230
+ * `FontUsageEntry[]` see TypeScript types for shape.
476
231
  * @param {string} id
477
- * @param {string} password
478
- * @returns {boolean}
232
+ * @returns {JsFontUsageEntry[]}
479
233
  */
480
- authenticate(id, password) {
234
+ get_font_usage(id) {
481
235
  try {
482
236
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
483
237
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
484
238
  const len0 = WASM_VECTOR_LEN;
485
- const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
486
- const len1 = WASM_VECTOR_LEN;
487
- wasm.wasm_authenticate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
239
+ wasm.wasm_get_font_usage(retptr, this.__wbg_ptr, ptr0, len0);
488
240
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
489
241
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
490
242
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
491
- if (r2) {
492
- throw takeObject(r1);
243
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
244
+ if (r3) {
245
+ throw takeObject(r2);
493
246
  }
494
- return r0 !== 0;
247
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
248
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
249
+ return v2;
495
250
  } finally {
496
251
  wasm.__wbindgen_add_to_stack_pointer(16);
497
252
  }
498
253
  }
499
254
  /**
500
- * Get all document IDs.
501
- * @returns {string[]}
255
+ * Get the layout model for a specific page.
256
+ *
257
+ * Returns the hierarchical layout structure (frames, parcels, lines, runs,
258
+ * glyphs, tables, grids) without building the full display list. This is
259
+ * more efficient than `get_page_text` for text selection/search and
260
+ * preserves semantic structure (paragraphs, tables, etc.).
261
+ *
262
+ * All coordinates are in points (1/72 inch). The viewer should scale by
263
+ * `canvasWidth / layoutPage.width` to convert to pixels.
264
+ * @param {string} id
265
+ * @param {number} page_index
266
+ * @returns {JsLayoutPage}
502
267
  */
503
- document_ids() {
268
+ get_layout_page(id, page_index) {
504
269
  try {
505
270
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
506
- wasm.wasm_document_ids(retptr, this.__wbg_ptr);
271
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
272
+ const len0 = WASM_VECTOR_LEN;
273
+ wasm.wasm_get_layout_page(retptr, this.__wbg_ptr, ptr0, len0, page_index);
507
274
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
508
275
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
509
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
510
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
511
- return v1;
276
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
277
+ if (r2) {
278
+ throw takeObject(r1);
279
+ }
280
+ return takeObject(r0);
512
281
  } finally {
513
282
  wasm.__wbindgen_add_to_stack_pointer(16);
514
283
  }
515
284
  }
516
285
  /**
517
- * Check if a document with the given ID exists.
518
- * @param {string} id
519
- * @returns {boolean}
520
- */
521
- has_document(id) {
522
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
523
- const len0 = WASM_VECTOR_LEN;
524
- const ret = wasm.wasm_has_document(this.__wbg_ptr, ptr0, len0);
525
- return ret !== 0;
286
+ * Get a numeric limit from the current license.
287
+ *
288
+ * Returns the limit value if set in the license, otherwise returns the default.
289
+ * @param {string} limit_name
290
+ * @param {bigint} _default
291
+ * @returns {bigint}
292
+ */
293
+ get_limit(limit_name, _default) {
294
+ const ptr0 = passStringToWasm0(limit_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
295
+ const len0 = WASM_VECTOR_LEN;
296
+ const ret = wasm.wasm_get_limit(this.__wbg_ptr, ptr0, len0, _default);
297
+ return BigInt.asUintN(64, ret);
526
298
  }
527
299
  /**
528
- * Compress a PDF document.
529
- *
530
- * Saves the document with full compression options enabled:
531
- * - Compress stream data using FlateDecode
532
- * - Pack objects into compressed object streams (PDF 1.5+)
533
- * - Use compressed xref streams (PDF 1.5+)
534
- * - Remove unreferenced objects
300
+ * Get the document outline (bookmarks/table of contents).
535
301
  *
536
- * # Arguments
537
- * * `doc_id` - Document ID to compress
302
+ * Returns an array of outline items, where each item has:
303
+ * - `title`: Display text for the item
304
+ * - `destination`: Optional navigation destination with `pageIndex` and display parameters
305
+ * - `children`: Nested child items
538
306
  *
539
- * # Returns
540
- * Compressed PDF data as Uint8Array
541
- * @param {string} doc_id
542
- * @returns {Uint8Array}
307
+ * Returns an empty array if the document has no outline.
308
+ * @param {string} id
309
+ * @returns {JsOutlineItem[]}
543
310
  */
544
- pdf_compress(doc_id) {
311
+ get_outline(id) {
545
312
  try {
546
313
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
547
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
314
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
548
315
  const len0 = WASM_VECTOR_LEN;
549
- wasm.wasm_pdf_compress(retptr, this.__wbg_ptr, ptr0, len0);
316
+ wasm.wasm_get_outline(retptr, this.__wbg_ptr, ptr0, len0);
550
317
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
551
318
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
552
319
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -554,27 +321,35 @@ ${val.stack}`;
554
321
  if (r3) {
555
322
  throw takeObject(r2);
556
323
  }
557
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
558
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
324
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
325
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
559
326
  return v2;
560
327
  } finally {
561
328
  wasm.__wbindgen_add_to_stack_pointer(16);
562
329
  }
563
330
  }
564
331
  /**
565
- * Get info for all pages in one call.
332
+ * Get annotations for a specific page.
566
333
  *
567
- * Returns an array of `PageInfo` objects, one per page.
568
- * More efficient than calling `page_info` for each page.
334
+ * Returns an array of annotation objects for the given page.
335
+ * Uses per-page loading for efficiency (only loads the requested page).
336
+ *
337
+ * All geometry fields on the returned annotations (`bounds`, `quads`,
338
+ * `vertices`, `inkList`, `start`/`end`, …) are in the page's unrotated
339
+ * MediaBox coordinate space — origin top-left, PDF points, +y downward
340
+ * — regardless of the page's `/Rotate` value. The viewer applies
341
+ * rotation as a display transform on top. This matches the input space
342
+ * expected by `pdf_save_annotations`, so the round-trip is consistent.
569
343
  * @param {string} id
570
- * @returns {JsPageInfo[]}
344
+ * @param {number} page_index
345
+ * @returns {JsAnnotation[]}
571
346
  */
572
- all_page_info(id) {
347
+ get_page_annotations(id, page_index) {
573
348
  try {
574
349
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
575
350
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
576
351
  const len0 = WASM_VECTOR_LEN;
577
- wasm.wasm_all_page_info(retptr, this.__wbg_ptr, ptr0, len0);
352
+ wasm.wasm_get_page_annotations(retptr, this.__wbg_ptr, ptr0, len0, page_index);
578
353
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
579
354
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
580
355
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -590,37 +365,23 @@ ${val.stack}`;
590
365
  }
591
366
  }
592
367
  /**
593
- * Get the number of documents currently loaded.
594
- * @returns {number}
595
- */
596
- get document_count() {
597
- const ret = wasm.wasm_document_count(this.__wbg_ptr);
598
- return ret >>> 0;
599
- }
600
- /**
601
- * Get font usage information for a document.
602
- *
603
- * Returns an array of `FontUsageEntry` objects describing how each font
604
- * spec in the document was resolved, including primary resolution and
605
- * any glyph-fallback fonts used during text shaping.
606
- *
607
- * This information is populated during layout — call after rendering at
608
- * least one page to get results.
368
+ * Get all visibility groups for a document.
609
369
  *
610
- * # Arguments
611
- * * `id` - Document ID
370
+ * Returns an array of objects, each containing:
371
+ * - `id`: Unique identifier string
372
+ * - `name`: Display name for UI
373
+ * - `visible`: Whether the group is currently visible
612
374
  *
613
- * # Returns
614
- * `FontUsageEntry[]` — see TypeScript types for shape.
375
+ * Returns an empty array for documents without visibility groups.
615
376
  * @param {string} id
616
- * @returns {JsFontUsageEntry[]}
377
+ * @returns {JsVisibilityGroup[]}
617
378
  */
618
- get_font_usage(id) {
379
+ get_visibility_groups(id) {
619
380
  try {
620
381
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
621
382
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
622
383
  const len0 = WASM_VECTOR_LEN;
623
- wasm.wasm_get_font_usage(retptr, this.__wbg_ptr, ptr0, len0);
384
+ wasm.wasm_get_visibility_groups(retptr, this.__wbg_ptr, ptr0, len0);
624
385
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
625
386
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
626
387
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -635,6 +396,49 @@ ${val.stack}`;
635
396
  wasm.__wbindgen_add_to_stack_pointer(16);
636
397
  }
637
398
  }
399
+ /**
400
+ * Check if a document with the given ID exists.
401
+ * @param {string} id
402
+ * @returns {boolean}
403
+ */
404
+ has_document(id) {
405
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
406
+ const len0 = WASM_VECTOR_LEN;
407
+ const ret = wasm.wasm_has_document(this.__wbg_ptr, ptr0, len0);
408
+ return ret !== 0;
409
+ }
410
+ /**
411
+ * Check if a feature is enabled by the current license.
412
+ * @param {string} feature
413
+ * @returns {boolean}
414
+ */
415
+ has_feature(feature) {
416
+ const ptr0 = passStringToWasm0(feature, wasm.__wbindgen_export, wasm.__wbindgen_export2);
417
+ const len0 = WASM_VECTOR_LEN;
418
+ const ret = wasm.wasm_has_feature(this.__wbg_ptr, ptr0, len0);
419
+ return ret !== 0;
420
+ }
421
+ /**
422
+ * Check whether the GPU render backend is available.
423
+ * @returns {boolean}
424
+ */
425
+ has_gpu() {
426
+ const ret = wasm.wasm_has_gpu(this.__wbg_ptr);
427
+ return ret !== 0;
428
+ }
429
+ /**
430
+ * Initialize the GPU render backend (Vello + WebGPU).
431
+ *
432
+ * This is async because wgpu device initialization requires yielding
433
+ * to the browser event loop. Call this once after construction.
434
+ * Returns `true` if GPU initialization succeeded, `false` if no
435
+ * WebGPU adapter is available (the CPU backend remains usable).
436
+ * @returns {Promise<boolean>}
437
+ */
438
+ init_gpu() {
439
+ const ret = wasm.wasm_init_gpu(this.__wbg_ptr);
440
+ return takeObject(ret);
441
+ }
638
442
  /**
639
443
  * Get current license status.
640
444
  * @returns {LicenseResult}
@@ -643,6 +447,35 @@ ${val.stack}`;
643
447
  const ret = wasm.wasm_license_status(this.__wbg_ptr);
644
448
  return takeObject(ret);
645
449
  }
450
+ /**
451
+ * Load a document by auto-detecting its format from the file contents.
452
+ *
453
+ * Inspects magic bytes to determine the format:
454
+ * - `%PDF` → PDF
455
+ * - `PK\x03\x04` (ZIP) → inspects ZIP entries for `word/` (DOCX), `ppt/` (PPTX), or `xl/` (XLSX)
456
+ * - Image magic bytes (JPEG, PNG, GIF, BMP, TIFF, WebP) → Image
457
+ *
458
+ * # Arguments
459
+ * * `bytes` - Raw file data
460
+ *
461
+ * # Returns
462
+ * A unique document ID that can be used to reference this document.
463
+ *
464
+ * # Permit enforcement
465
+ * This is the single, gated document-open entry point. For
466
+ * free/unlicensed usage it requires a valid server-signed permit (fetched
467
+ * and verified inside WASM) before the document is opened; commercial
468
+ * licensed usage skips the permit entirely. The per-format loaders are
469
+ * private so there is no ungated open path.
470
+ * @param {Uint8Array} bytes
471
+ * @returns {Promise<string>}
472
+ */
473
+ load(bytes) {
474
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
475
+ const len0 = WASM_VECTOR_LEN;
476
+ const ret = wasm.wasm_load(this.__wbg_ptr, ptr0, len0);
477
+ return takeObject(ret);
478
+ }
646
479
  /**
647
480
  * Check if a document requires a password to open.
648
481
  *
@@ -669,209 +502,221 @@ ${val.stack}`;
669
502
  }
670
503
  }
671
504
  /**
672
- * Decompress a PDF document.
673
- *
674
- * Removes all filter encodings from streams, resulting in raw,
675
- * uncompressed stream data. Useful for debugging or inspection.
505
+ * Create a new document viewer.
676
506
  *
677
507
  * # Arguments
678
- * * `doc_id` - Document ID to decompress
679
- *
680
- * # Returns
681
- * Decompressed PDF data as Uint8Array
682
- * @param {string} doc_id
683
- * @returns {Uint8Array}
508
+ * * `domain` - Hostname of the embedding page (e.g. from `window.location.hostname`)
509
+ * * `viewer_version` - SDK version string
510
+ * @param {string} domain
511
+ * @param {string} viewer_version
684
512
  */
685
- pdf_decompress(doc_id) {
513
+ constructor(domain, viewer_version) {
514
+ const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_export, wasm.__wbindgen_export2);
515
+ const len0 = WASM_VECTOR_LEN;
516
+ const ptr1 = passStringToWasm0(viewer_version, wasm.__wbindgen_export, wasm.__wbindgen_export2);
517
+ const len1 = WASM_VECTOR_LEN;
518
+ const ret = wasm.wasm_new(ptr0, len0, ptr1, len1);
519
+ this.__wbg_ptr = ret;
520
+ WasmFinalization.register(this, this.__wbg_ptr, this);
521
+ return this;
522
+ }
523
+ /**
524
+ * Get the page count of a document.
525
+ * @param {string} id
526
+ * @returns {number}
527
+ */
528
+ page_count(id) {
686
529
  try {
687
530
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
688
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
531
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
689
532
  const len0 = WASM_VECTOR_LEN;
690
- wasm.wasm_pdf_decompress(retptr, this.__wbg_ptr, ptr0, len0);
533
+ wasm.wasm_page_count(retptr, this.__wbg_ptr, ptr0, len0);
691
534
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
692
535
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
693
536
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
694
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
695
- if (r3) {
696
- throw takeObject(r2);
537
+ if (r2) {
538
+ throw takeObject(r1);
697
539
  }
698
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
699
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
700
- return v2;
540
+ return r0 >>> 0;
701
541
  } finally {
702
542
  wasm.__wbindgen_add_to_stack_pointer(16);
703
543
  }
704
544
  }
705
545
  /**
706
- * Register font URLs.
707
- *
708
- * The caller provides a list of all available fonts with their download
709
- * URLs. During layout, when the engine needs a font, it is fetched from
710
- * the URL, parsed, and cached for reuse.
711
- *
712
- * Call this before loading documents. Registered fonts are automatically
713
- * applied to every document loaded afterward. URL fonts are always
714
- * resolved before Google Fonts.
715
- *
716
- * # Arguments
717
- * * `fonts` - Array of font entries: `[{ typeface: "Roboto", bold: false, italic: false, url: "https://..." }, ...]`
546
+ * Get the page groups for a document.
718
547
  *
719
- * # Example (JavaScript)
720
- * ```js
721
- * // Register available fonts before loading documents
722
- * udoc.registerFonts([
723
- * { typeface: "Roboto", bold: false, italic: false, url: "https://cdn.example.com/Roboto-Regular.woff2" },
724
- * { typeface: "Roboto", bold: true, italic: false, url: "https://cdn.example.com/Roboto-Bold.woff2" },
725
- * ]);
548
+ * Each group covers a contiguous range of global page indices with a
549
+ * shared stitching layout. Use this to build per-group canvases (e.g.,
550
+ * one panel per Excel sheet) and group-named sidebars.
726
551
  *
727
- * // Load and render - fonts are fetched on demand during layout
728
- * const docId = udoc.loadPptx(pptxBytes);
729
- * const pixels = udoc.renderPageToRgba(docId, 0, 800, 600);
730
- * ```
731
- * @param {JsFontRegistration[]} fonts
552
+ * - PDF/DOCX: one `linear` group covering all pages, no name.
553
+ * - PPTX: one `linear` group (per-section groups once sections are modeled).
554
+ * - XLSX: one `tiled` group per sheet with the sheet name and page-grid dimensions.
555
+ * @param {string} id
556
+ * @returns {JsPageGroup[]}
732
557
  */
733
- registerFonts(fonts) {
558
+ page_groups(id) {
734
559
  try {
735
560
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
736
- const ptr0 = passArrayJsValueToWasm0(fonts, wasm.__wbindgen_export);
561
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
737
562
  const len0 = WASM_VECTOR_LEN;
738
- wasm.wasm_registerFonts(retptr, this.__wbg_ptr, ptr0, len0);
563
+ wasm.wasm_page_groups(retptr, this.__wbg_ptr, ptr0, len0);
739
564
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
740
565
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
741
- if (r1) {
742
- throw takeObject(r0);
566
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
567
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
568
+ if (r3) {
569
+ throw takeObject(r2);
743
570
  }
571
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
572
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
573
+ return v2;
744
574
  } finally {
745
575
  wasm.__wbindgen_add_to_stack_pointer(16);
746
576
  }
747
577
  }
748
578
  /**
749
- * Get the format of a loaded document.
750
- *
751
- * Returns one of: "pdf", "docx", "pptx", "xlsx", "image".
579
+ * Get info for a specific page.
752
580
  * @param {string} id
753
- * @returns {string}
581
+ * @param {number} page_index
582
+ * @returns {JsPageInfo}
754
583
  */
755
- document_format(id) {
756
- let deferred3_0;
757
- let deferred3_1;
584
+ page_info(id, page_index) {
758
585
  try {
759
586
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
760
587
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
761
588
  const len0 = WASM_VECTOR_LEN;
762
- wasm.wasm_document_format(retptr, this.__wbg_ptr, ptr0, len0);
589
+ wasm.wasm_page_info(retptr, this.__wbg_ptr, ptr0, len0, page_index);
763
590
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
764
591
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
765
592
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
766
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
767
- var ptr2 = r0;
768
- var len2 = r1;
769
- if (r3) {
770
- ptr2 = 0;
771
- len2 = 0;
772
- throw takeObject(r2);
593
+ if (r2) {
594
+ throw takeObject(r1);
773
595
  }
774
- deferred3_0 = ptr2;
775
- deferred3_1 = len2;
776
- return getStringFromWasm0(ptr2, len2);
596
+ return takeObject(r0);
777
597
  } finally {
778
598
  wasm.__wbindgen_add_to_stack_pointer(16);
779
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
780
599
  }
781
600
  }
782
601
  /**
783
- * Get the layout model for a specific page.
602
+ * Compose new PDF documents by cherry-picking pages from source documents.
784
603
  *
785
- * Returns the hierarchical layout structure (frames, parcels, lines, runs,
786
- * glyphs, tables, grids) without building the full display list. This is
787
- * more efficient than `get_page_text` for text selection/search and
788
- * preserves semantic structure (paragraphs, tables, etc.).
604
+ * The original documents remain unchanged.
789
605
  *
790
- * All coordinates are in points (1/72 inch). The viewer should scale by
791
- * `canvasWidth / layoutPage.width` to convert to pixels.
792
- * @param {string} id
793
- * @param {number} page_index
794
- * @returns {JsLayoutPage}
606
+ * # Arguments
607
+ * * `compositions` - Array of compositions. Each composition is an array of picks.
608
+ * Each pick is `{ doc: docIndex, pages: "0-2,4" }` where `docIndex` is the index
609
+ * in the `doc_ids` array and `pages` is a page range string (0-based).
610
+ * * `doc_ids` - Array of document IDs to use as sources (order matters for doc indices)
611
+ *
612
+ * # Example
613
+ * ```js
614
+ * // Create two documents: first has pages 0-2 from doc A, second has page 0 from A and 1 from B
615
+ * const newDocIds = udoc.pdf_compose(
616
+ * [
617
+ * [{ doc: 0, pages: "0-2" }],
618
+ * [{ doc: 0, pages: "0" }, { doc: 1, pages: "1" }]
619
+ * ],
620
+ * ["doc_0", "doc_1"]
621
+ * );
622
+ * ```
623
+ *
624
+ * # Returns
625
+ * Array of IDs for the newly created documents (one per composition).
626
+ * @param {JsCompositions} compositions
627
+ * @param {string[]} doc_ids
628
+ * @returns {string[]}
795
629
  */
796
- get_layout_page(id, page_index) {
630
+ pdf_compose(compositions, doc_ids) {
797
631
  try {
798
632
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
799
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
633
+ const ptr0 = passArrayJsValueToWasm0(doc_ids, wasm.__wbindgen_export);
800
634
  const len0 = WASM_VECTOR_LEN;
801
- wasm.wasm_get_layout_page(retptr, this.__wbg_ptr, ptr0, len0, page_index);
635
+ wasm.wasm_pdf_compose(retptr, this.__wbg_ptr, addHeapObject(compositions), ptr0, len0);
802
636
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
803
637
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
804
638
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
805
- if (r2) {
806
- throw takeObject(r1);
639
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
640
+ if (r3) {
641
+ throw takeObject(r2);
807
642
  }
808
- return takeObject(r0);
643
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
644
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
645
+ return v2;
809
646
  } finally {
810
647
  wasm.__wbindgen_add_to_stack_pointer(16);
811
648
  }
812
649
  }
813
650
  /**
814
- * Remove a document by ID.
651
+ * Compress a PDF document.
815
652
  *
816
- * Returns true if the document was removed, false if it didn't exist.
817
- * @param {string} id
818
- * @returns {boolean}
819
- */
820
- remove_document(id) {
821
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
822
- const len0 = WASM_VECTOR_LEN;
823
- const ret = wasm.wasm_remove_document(this.__wbg_ptr, ptr0, len0);
824
- return ret !== 0;
825
- }
826
- /**
827
- * Render a page using the GPU backend (Vello + WebGPU).
653
+ * Saves the document with full compression options enabled:
654
+ * - Compress stream data using FlateDecode
655
+ * - Pack objects into compressed object streams (PDF 1.5+)
656
+ * - Use compressed xref streams (PDF 1.5+)
657
+ * - Remove unreferenced objects
828
658
  *
829
- * Returns raw RGBA pixel data in premultiplied alpha format,
830
- * identical to `render_page_to_rgba` but GPU-accelerated.
659
+ * # Arguments
660
+ * * `doc_id` - Document ID to compress
831
661
  *
832
- * # Errors
833
- * Returns an error if the GPU backend is not initialized
834
- * (call `init_gpu()` first), if the document is not found,
835
- * or if rendering fails.
836
- * @param {string} id
837
- * @param {number} page_index
838
- * @param {number} width
839
- * @param {number} height
840
- * @returns {Promise<Uint8Array>}
662
+ * # Returns
663
+ * Compressed PDF data as Uint8Array
664
+ * @param {string} doc_id
665
+ * @returns {Uint8Array}
841
666
  */
842
- render_page_gpu(id, page_index, width, height) {
843
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
844
- const len0 = WASM_VECTOR_LEN;
845
- const ret = wasm.wasm_render_page_gpu(this.__wbg_ptr, ptr0, len0, page_index, width, height);
846
- return takeObject(ret);
667
+ pdf_compress(doc_id) {
668
+ try {
669
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
670
+ const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
671
+ const len0 = WASM_VECTOR_LEN;
672
+ wasm.wasm_pdf_compress(retptr, this.__wbg_ptr, ptr0, len0);
673
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
674
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
675
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
676
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
677
+ if (r3) {
678
+ throw takeObject(r2);
679
+ }
680
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
681
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
682
+ return v2;
683
+ } finally {
684
+ wasm.__wbindgen_add_to_stack_pointer(16);
685
+ }
847
686
  }
848
687
  /**
849
- * Set the anonymous distinct ID for telemetry tracking.
688
+ * Decompress a PDF document.
850
689
  *
851
- * Call this after `new()` once the ID has been read from localStorage
852
- * (or generated). Must be called before loading documents so that
853
- * telemetry events include the correct metadata.
690
+ * Removes all filter encodings from streams, resulting in raw,
691
+ * uncompressed stream data. Useful for debugging or inspection.
854
692
  *
855
693
  * # Arguments
856
- * * `distinct_id` - Anonymous UUID for per-user tracking (persisted in localStorage)
857
- * @param {string} distinct_id
858
- */
859
- setup_telemetry(distinct_id) {
860
- const ptr0 = passStringToWasm0(distinct_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
861
- const len0 = WASM_VECTOR_LEN;
862
- wasm.wasm_setup_telemetry(this.__wbg_ptr, ptr0, len0);
863
- }
864
- /**
865
- * Disable telemetry reporting.
694
+ * * `doc_id` - Document ID to decompress
866
695
  *
867
- * Only takes effect if the current license includes the `no_telemetry`
868
- * feature flag. Returns `true` if telemetry was disabled, `false` if the
869
- * license does not permit it.
870
- * @returns {boolean}
696
+ * # Returns
697
+ * Decompressed PDF data as Uint8Array
698
+ * @param {string} doc_id
699
+ * @returns {Uint8Array}
871
700
  */
872
- disable_telemetry() {
873
- const ret = wasm.wasm_disable_telemetry(this.__wbg_ptr);
874
- return ret !== 0;
701
+ pdf_decompress(doc_id) {
702
+ try {
703
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
704
+ const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
705
+ const len0 = WASM_VECTOR_LEN;
706
+ wasm.wasm_pdf_decompress(retptr, this.__wbg_ptr, ptr0, len0);
707
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
708
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
709
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
710
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
711
+ if (r3) {
712
+ throw takeObject(r2);
713
+ }
714
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
715
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
716
+ return v2;
717
+ } finally {
718
+ wasm.__wbindgen_add_to_stack_pointer(16);
719
+ }
875
720
  }
876
721
  /**
877
722
  * Extract all embedded fonts from a PDF document.
@@ -947,28 +792,57 @@ ${val.stack}`;
947
792
  }
948
793
  }
949
794
  /**
950
- * Render a page to PNG bytes.
795
+ * Save annotations back to a PDF document.
796
+ *
797
+ * Takes the current document and a set of annotations (grouped by page),
798
+ * writes them into the PDF's annotation structures, and returns the
799
+ * modified PDF bytes.
800
+ *
801
+ * # Coordinate space
802
+ *
803
+ * Every geometry field on the supplied annotations (`bounds`, `quads`,
804
+ * `vertices`, `inkList`, `start`/`end`, `calloutLine`, …) must be in
805
+ * the page's **unrotated MediaBox** coordinate space:
806
+ *
807
+ * - Origin = MediaBox top-left of the page in its natural (pre-`/Rotate`)
808
+ * orientation. `(0, 0)` does not move when the page is displayed
809
+ * rotated 90°/180°/270°.
810
+ * - Units = PDF points (1/72 inch).
811
+ * - Axes = `+x` right, `+y` downward (Y-flipped relative to PDF's native
812
+ * bottom-up `/Rect`; this function performs the flip on the way out).
813
+ * - `CropBox` is ignored — coordinates are MediaBox-relative even when
814
+ * the page's CropBox trims the visible area.
815
+ *
816
+ * This is the same space returned by `get_page_annotations` /
817
+ * `get_all_annotations`, so a load-edit-save round-trip is consistent.
818
+ * Pages with no existing `/Annots` array are handled automatically: any
819
+ * pre-existing array is cleared and a fresh one is created.
951
820
  *
952
821
  * # Arguments
953
- * * `id` - Document ID
954
- * * `page_index` - Zero-based page index
955
- * * `width` - Output width in pixels
956
- * * `height` - Output height in pixels
822
+ * * `doc_id` - Document ID
823
+ * * `annotations_by_page` - Object mapping page indices (as strings) to
824
+ * arrays of annotation objects. Same schema as returned by
825
+ * `get_all_annotations`.
957
826
  *
958
827
  * # Returns
959
- * PNG-encoded image data as a byte array.
960
- * @param {string} id
961
- * @param {number} page_index
962
- * @param {number} width
963
- * @param {number} height
828
+ * The modified PDF file bytes with annotations saved.
829
+ *
830
+ * # Example (JavaScript)
831
+ * ```js
832
+ * const annotations = udoc.get_all_annotations(docId);
833
+ * // ... viewer edits annotations ...
834
+ * const pdfBytes = udoc.pdf_save_annotations(docId, annotations);
835
+ * ```
836
+ * @param {string} doc_id
837
+ * @param {JsAnnotationsByPage} annotations_by_page
964
838
  * @returns {Uint8Array}
965
839
  */
966
- render_page_to_png(id, page_index, width, height) {
840
+ pdf_save_annotations(doc_id, annotations_by_page) {
967
841
  try {
968
842
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
969
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
843
+ const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
970
844
  const len0 = WASM_VECTOR_LEN;
971
- wasm.wasm_render_page_to_png(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
845
+ wasm.wasm_pdf_save_annotations(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(annotations_by_page));
972
846
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
973
847
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
974
848
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -984,79 +858,121 @@ ${val.stack}`;
984
858
  }
985
859
  }
986
860
  /**
987
- * Get viewer preferences embedded in the document.
861
+ * Split a PDF document by its outline (bookmarks) structure.
988
862
  *
989
- * Returns a `JsViewerPreferences` with optional fields:
990
- * - `layoutMode`: `"single-page"` | `"double-page-odd-right"` | `"double-page-odd-left"`
991
- * - `scrollMode`: `"spread"` | `"continuous"`
992
- * @param {string} id
993
- * @returns {JsViewerPreferences}
994
- */
995
- viewer_preferences(id) {
996
- try {
997
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
998
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
999
- const len0 = WASM_VECTOR_LEN;
1000
- wasm.wasm_viewer_preferences(retptr, this.__wbg_ptr, ptr0, len0);
1001
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1002
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1003
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1004
- if (r2) {
1005
- throw takeObject(r1);
1006
- }
1007
- return takeObject(r0);
863
+ * Creates multiple documents, one for each outline section at the specified level.
864
+ *
865
+ * # Arguments
866
+ * * `doc_id` - Document ID to split
867
+ * * `max_level` - Maximum outline level to consider (1 = top level only)
868
+ * * `split_mid_page` - When true, filters page content when sections share a page
869
+ *
870
+ * # Returns
871
+ * Object with:
872
+ * - `documentIds`: Array of IDs for the newly created documents
873
+ * - `sections`: Array of section info objects with `title`, `startPage`, `level`
874
+ * @param {string} doc_id
875
+ * @param {number} max_level
876
+ * @param {boolean} split_mid_page
877
+ * @returns {JsSplitByOutlineResult}
878
+ */
879
+ pdf_split_by_outline(doc_id, max_level, split_mid_page) {
880
+ try {
881
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
882
+ const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
883
+ const len0 = WASM_VECTOR_LEN;
884
+ wasm.wasm_pdf_split_by_outline(retptr, this.__wbg_ptr, ptr0, len0, max_level, split_mid_page);
885
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
886
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
887
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
888
+ if (r2) {
889
+ throw takeObject(r1);
890
+ }
891
+ return takeObject(r0);
1008
892
  } finally {
1009
893
  wasm.__wbindgen_add_to_stack_pointer(16);
1010
894
  }
1011
895
  }
1012
896
  /**
1013
- * Enable Google Fonts.
897
+ * Register font URLs.
1014
898
  *
1015
- * When enabled, fonts that are not embedded in the document will be
1016
- * automatically fetched from Google Fonts during rendering. Google Fonts
1017
- * are resolved after any URL fonts registered via `registerFonts`.
899
+ * The caller provides a list of all available fonts with their download
900
+ * URLs. During layout, when the engine needs a font, it is fetched from
901
+ * the URL, parsed, and cached for reuse.
1018
902
  *
1019
- * Call this before loading documents.
903
+ * Call this before loading documents. Registered fonts are automatically
904
+ * applied to every document loaded afterward. URL fonts are always
905
+ * resolved before Google Fonts.
906
+ *
907
+ * # Arguments
908
+ * * `fonts` - Array of font entries: `[{ typeface: "Roboto", bold: false, italic: false, url: "https://..." }, ...]`
1020
909
  *
1021
910
  * # Example (JavaScript)
1022
911
  * ```js
1023
- * udoc.enableGoogleFonts();
912
+ * // Register available fonts before loading documents
913
+ * udoc.registerFonts([
914
+ * { typeface: "Roboto", bold: false, italic: false, url: "https://cdn.example.com/Roboto-Regular.woff2" },
915
+ * { typeface: "Roboto", bold: true, italic: false, url: "https://cdn.example.com/Roboto-Bold.woff2" },
916
+ * ]);
917
+ *
918
+ * // Load and render - fonts are fetched on demand during layout
1024
919
  * const docId = udoc.loadPptx(pptxBytes);
1025
920
  * const pixels = udoc.renderPageToRgba(docId, 0, 800, 600);
1026
921
  * ```
922
+ * @param {JsFontRegistration[]} fonts
1027
923
  */
1028
- enableGoogleFonts() {
1029
- wasm.wasm_enableGoogleFonts(this.__wbg_ptr);
1030
- }
1031
- /**
1032
- * Get all annotations in the document, grouped by page index.
1033
- *
1034
- * Returns an object mapping page indices (as strings) to arrays of annotations.
1035
- * @param {string} id
1036
- * @returns {JsAnnotationsByPage}
1037
- */
1038
- get_all_annotations(id) {
924
+ registerFonts(fonts) {
1039
925
  try {
1040
926
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1041
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
927
+ const ptr0 = passArrayJsValueToWasm0(fonts, wasm.__wbindgen_export);
1042
928
  const len0 = WASM_VECTOR_LEN;
1043
- wasm.wasm_get_all_annotations(retptr, this.__wbg_ptr, ptr0, len0);
929
+ wasm.wasm_registerFonts(retptr, this.__wbg_ptr, ptr0, len0);
1044
930
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1045
931
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1046
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1047
- if (r2) {
1048
- throw takeObject(r1);
932
+ if (r1) {
933
+ throw takeObject(r0);
1049
934
  }
1050
- return takeObject(r0);
1051
935
  } finally {
1052
936
  wasm.__wbindgen_add_to_stack_pointer(16);
1053
937
  }
1054
938
  }
1055
939
  /**
1056
- * Render a page to raw RGBA pixel data.
940
+ * Remove a document by ID.
1057
941
  *
1058
- * The returned data is in premultiplied alpha format, suitable for
1059
- * use with `ImageData` and canvas rendering.
942
+ * Returns true if the document was removed, false if it didn't exist.
943
+ * @param {string} id
944
+ * @returns {boolean}
945
+ */
946
+ remove_document(id) {
947
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
948
+ const len0 = WASM_VECTOR_LEN;
949
+ const ret = wasm.wasm_remove_document(this.__wbg_ptr, ptr0, len0);
950
+ return ret !== 0;
951
+ }
952
+ /**
953
+ * Render a page using the GPU backend (Vello + WebGPU).
954
+ *
955
+ * Returns raw RGBA pixel data in premultiplied alpha format,
956
+ * identical to `render_page_to_rgba` but GPU-accelerated.
957
+ *
958
+ * # Errors
959
+ * Returns an error if the GPU backend is not initialized
960
+ * (call `init_gpu()` first), if the document is not found,
961
+ * or if rendering fails.
962
+ * @param {string} id
963
+ * @param {number} page_index
964
+ * @param {number} width
965
+ * @param {number} height
966
+ * @returns {Promise<Uint8Array>}
967
+ */
968
+ render_page_gpu(id, page_index, width, height) {
969
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
970
+ const len0 = WASM_VECTOR_LEN;
971
+ const ret = wasm.wasm_render_page_gpu(this.__wbg_ptr, ptr0, len0, page_index, width, height);
972
+ return takeObject(ret);
973
+ }
974
+ /**
975
+ * Render a page to PNG bytes.
1060
976
  *
1061
977
  * # Arguments
1062
978
  * * `id` - Document ID
@@ -1065,19 +981,19 @@ ${val.stack}`;
1065
981
  * * `height` - Output height in pixels
1066
982
  *
1067
983
  * # Returns
1068
- * Raw RGBA pixel data (width * height * 4 bytes).
984
+ * PNG-encoded image data as a byte array.
1069
985
  * @param {string} id
1070
986
  * @param {number} page_index
1071
987
  * @param {number} width
1072
988
  * @param {number} height
1073
989
  * @returns {Uint8Array}
1074
990
  */
1075
- render_page_to_rgba(id, page_index, width, height) {
991
+ render_page_to_png(id, page_index, width, height) {
1076
992
  try {
1077
993
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1078
994
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1079
995
  const len0 = WASM_VECTOR_LEN;
1080
- wasm.wasm_render_page_to_rgba(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
996
+ wasm.wasm_render_page_to_png(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
1081
997
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1082
998
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1083
999
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1093,27 +1009,31 @@ ${val.stack}`;
1093
1009
  }
1094
1010
  }
1095
1011
  /**
1096
- * Get annotations for a specific page.
1012
+ * Render a page to raw RGBA pixel data.
1097
1013
  *
1098
- * Returns an array of annotation objects for the given page.
1099
- * Uses per-page loading for efficiency (only loads the requested page).
1014
+ * The returned data is in premultiplied alpha format, suitable for
1015
+ * use with `ImageData` and canvas rendering.
1100
1016
  *
1101
- * All geometry fields on the returned annotations (`bounds`, `quads`,
1102
- * `vertices`, `inkList`, `start`/`end`, …) are in the page's unrotated
1103
- * MediaBox coordinate space — origin top-left, PDF points, +y downward
1104
- * regardless of the page's `/Rotate` value. The viewer applies
1105
- * rotation as a display transform on top. This matches the input space
1106
- * expected by `pdf_save_annotations`, so the round-trip is consistent.
1017
+ * # Arguments
1018
+ * * `id` - Document ID
1019
+ * * `page_index` - Zero-based page index
1020
+ * * `width` - Output width in pixels
1021
+ * * `height` - Output height in pixels
1022
+ *
1023
+ * # Returns
1024
+ * Raw RGBA pixel data (width * height * 4 bytes).
1107
1025
  * @param {string} id
1108
1026
  * @param {number} page_index
1109
- * @returns {JsAnnotation[]}
1027
+ * @param {number} width
1028
+ * @param {number} height
1029
+ * @returns {Uint8Array}
1110
1030
  */
1111
- get_page_annotations(id, page_index) {
1031
+ render_page_to_rgba(id, page_index, width, height) {
1112
1032
  try {
1113
1033
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1114
1034
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1115
1035
  const len0 = WASM_VECTOR_LEN;
1116
- wasm.wasm_get_page_annotations(retptr, this.__wbg_ptr, ptr0, len0, page_index);
1036
+ wasm.wasm_render_page_to_rgba(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
1117
1037
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1118
1038
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1119
1039
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1121,1499 +1041,1447 @@ ${val.stack}`;
1121
1041
  if (r3) {
1122
1042
  throw takeObject(r2);
1123
1043
  }
1124
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1125
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
1044
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
1045
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1126
1046
  return v2;
1127
1047
  } finally {
1128
1048
  wasm.__wbindgen_add_to_stack_pointer(16);
1129
1049
  }
1130
1050
  }
1131
1051
  /**
1132
- * Save annotations back to a PDF document.
1133
- *
1134
- * Takes the current document and a set of annotations (grouped by page),
1135
- * writes them into the PDF's annotation structures, and returns the
1136
- * modified PDF bytes.
1137
- *
1138
- * # Coordinate space
1139
- *
1140
- * Every geometry field on the supplied annotations (`bounds`, `quads`,
1141
- * `vertices`, `inkList`, `start`/`end`, `calloutLine`, …) must be in
1142
- * the page's **unrotated MediaBox** coordinate space:
1143
- *
1144
- * - Origin = MediaBox top-left of the page in its natural (pre-`/Rotate`)
1145
- * orientation. `(0, 0)` does not move when the page is displayed
1146
- * rotated 90°/180°/270°.
1147
- * - Units = PDF points (1/72 inch).
1148
- * - Axes = `+x` right, `+y` downward (Y-flipped relative to PDF's native
1149
- * bottom-up `/Rect`; this function performs the flip on the way out).
1150
- * - `CropBox` is ignored — coordinates are MediaBox-relative even when
1151
- * the page's CropBox trims the visible area.
1152
- *
1153
- * This is the same space returned by `get_page_annotations` /
1154
- * `get_all_annotations`, so a load-edit-save round-trip is consistent.
1155
- * Pages with no existing `/Annots` array are handled automatically: any
1156
- * pre-existing array is cleared and a fresh one is created.
1052
+ * Set the license key.
1157
1053
  *
1158
1054
  * # Arguments
1159
- * * `doc_id` - Document ID
1160
- * * `annotations_by_page` - Object mapping page indices (as strings) to
1161
- * arrays of annotation objects. Same schema as returned by
1162
- * `get_all_annotations`.
1055
+ * * `license_key` - The license key string
1163
1056
  *
1164
1057
  * # Returns
1165
- * The modified PDF file bytes with annotations saved.
1166
- *
1167
- * # Example (JavaScript)
1168
- * ```js
1169
- * const annotations = udoc.get_all_annotations(docId);
1170
- * // ... viewer edits annotations ...
1171
- * const pdfBytes = udoc.pdf_save_annotations(docId, annotations);
1172
- * ```
1173
- * @param {string} doc_id
1174
- * @param {JsAnnotationsByPage} annotations_by_page
1175
- * @returns {Uint8Array}
1058
+ * License validation result as JSON.
1059
+ * @param {string} license_key
1060
+ * @returns {LicenseResult}
1176
1061
  */
1177
- pdf_save_annotations(doc_id, annotations_by_page) {
1178
- try {
1179
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1180
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1181
- const len0 = WASM_VECTOR_LEN;
1182
- wasm.wasm_pdf_save_annotations(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(annotations_by_page));
1183
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1184
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1185
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1186
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1187
- if (r3) {
1188
- throw takeObject(r2);
1189
- }
1190
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
1191
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
1192
- return v2;
1193
- } finally {
1194
- wasm.__wbindgen_add_to_stack_pointer(16);
1195
- }
1062
+ set_license(license_key) {
1063
+ const ptr0 = passStringToWasm0(license_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1064
+ const len0 = WASM_VECTOR_LEN;
1065
+ const ret = wasm.wasm_set_license(this.__wbg_ptr, ptr0, len0);
1066
+ return takeObject(ret);
1196
1067
  }
1197
1068
  /**
1198
- * Split a PDF document by its outline (bookmarks) structure.
1199
- *
1200
- * Creates multiple documents, one for each outline section at the specified level.
1069
+ * Set the visibility of a specific visibility group.
1201
1070
  *
1202
1071
  * # Arguments
1203
- * * `doc_id` - Document ID to split
1204
- * * `max_level` - Maximum outline level to consider (1 = top level only)
1205
- * * `split_mid_page` - When true, filters page content when sections share a page
1072
+ * * `id` - Document ID
1073
+ * * `group_id` - Visibility group ID
1074
+ * * `visible` - Whether the group should be visible
1206
1075
  *
1207
- * # Returns
1208
- * Object with:
1209
- * - `documentIds`: Array of IDs for the newly created documents
1210
- * - `sections`: Array of section info objects with `title`, `startPage`, `level`
1211
- * @param {string} doc_id
1212
- * @param {number} max_level
1213
- * @param {boolean} split_mid_page
1214
- * @returns {JsSplitByOutlineResult}
1076
+ * Returns `true` if the group was found and updated, `false` if not found.
1077
+ * @param {string} id
1078
+ * @param {string} group_id
1079
+ * @param {boolean} visible
1080
+ * @returns {boolean}
1215
1081
  */
1216
- pdf_split_by_outline(doc_id, max_level, split_mid_page) {
1082
+ set_visibility_group_visible(id, group_id, visible) {
1217
1083
  try {
1218
1084
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1219
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1085
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1220
1086
  const len0 = WASM_VECTOR_LEN;
1221
- wasm.wasm_pdf_split_by_outline(retptr, this.__wbg_ptr, ptr0, len0, max_level, split_mid_page);
1087
+ const ptr1 = passStringToWasm0(group_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1088
+ const len1 = WASM_VECTOR_LEN;
1089
+ wasm.wasm_set_visibility_group_visible(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, visible);
1222
1090
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1223
1091
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1224
1092
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1225
1093
  if (r2) {
1226
1094
  throw takeObject(r1);
1227
1095
  }
1228
- return takeObject(r0);
1096
+ return r0 !== 0;
1229
1097
  } finally {
1230
1098
  wasm.__wbindgen_add_to_stack_pointer(16);
1231
1099
  }
1232
1100
  }
1233
1101
  /**
1234
- * Get all visibility groups for a document.
1102
+ * Set the anonymous distinct ID for telemetry tracking.
1235
1103
  *
1236
- * Returns an array of objects, each containing:
1237
- * - `id`: Unique identifier string
1238
- * - `name`: Display name for UI
1239
- * - `visible`: Whether the group is currently visible
1104
+ * Call this after `new()` once the ID has been read from localStorage
1105
+ * (or generated). Must be called before loading documents so that
1106
+ * telemetry events include the correct metadata.
1240
1107
  *
1241
- * Returns an empty array for documents without visibility groups.
1242
- * @param {string} id
1243
- * @returns {JsVisibilityGroup[]}
1108
+ * # Arguments
1109
+ * * `distinct_id` - Anonymous UUID for per-user tracking (persisted in localStorage)
1110
+ * @param {string} distinct_id
1244
1111
  */
1245
- get_visibility_groups(id) {
1246
- try {
1247
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1248
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1249
- const len0 = WASM_VECTOR_LEN;
1250
- wasm.wasm_get_visibility_groups(retptr, this.__wbg_ptr, ptr0, len0);
1251
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1252
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1253
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1254
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1255
- if (r3) {
1256
- throw takeObject(r2);
1257
- }
1258
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1259
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
1260
- return v2;
1261
- } finally {
1262
- wasm.__wbindgen_add_to_stack_pointer(16);
1263
- }
1112
+ setup_telemetry(distinct_id) {
1113
+ const ptr0 = passStringToWasm0(distinct_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1114
+ const len0 = WASM_VECTOR_LEN;
1115
+ wasm.wasm_setup_telemetry(this.__wbg_ptr, ptr0, len0);
1264
1116
  }
1265
1117
  /**
1266
- * Set the visibility of a specific visibility group.
1267
- *
1268
- * # Arguments
1269
- * * `id` - Document ID
1270
- * * `group_id` - Visibility group ID
1271
- * * `visible` - Whether the group should be visible
1118
+ * Get viewer preferences embedded in the document.
1272
1119
  *
1273
- * Returns `true` if the group was found and updated, `false` if not found.
1120
+ * Returns a `JsViewerPreferences` with optional fields:
1121
+ * - `layoutMode`: `"single-page"` | `"double-page-odd-right"` | `"double-page-odd-left"`
1122
+ * - `scrollMode`: `"spread"` | `"continuous"`
1274
1123
  * @param {string} id
1275
- * @param {string} group_id
1276
- * @param {boolean} visible
1277
- * @returns {boolean}
1124
+ * @returns {JsViewerPreferences}
1278
1125
  */
1279
- set_visibility_group_visible(id, group_id, visible) {
1126
+ viewer_preferences(id) {
1280
1127
  try {
1281
1128
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1282
1129
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1283
1130
  const len0 = WASM_VECTOR_LEN;
1284
- const ptr1 = passStringToWasm0(group_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1285
- const len1 = WASM_VECTOR_LEN;
1286
- wasm.wasm_set_visibility_group_visible(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, visible);
1131
+ wasm.wasm_viewer_preferences(retptr, this.__wbg_ptr, ptr0, len0);
1287
1132
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1288
1133
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1289
1134
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1290
1135
  if (r2) {
1291
1136
  throw takeObject(r1);
1292
1137
  }
1293
- return r0 !== 0;
1138
+ return takeObject(r0);
1294
1139
  } finally {
1295
1140
  wasm.__wbindgen_add_to_stack_pointer(16);
1296
1141
  }
1297
1142
  }
1298
- /**
1299
- * Create a new document viewer.
1300
- *
1301
- * # Arguments
1302
- * * `domain` - Hostname of the embedding page (e.g. from `window.location.hostname`)
1303
- * * `viewer_version` - SDK version string
1304
- * @param {string} domain
1305
- * @param {string} viewer_version
1306
- */
1307
- constructor(domain, viewer_version) {
1308
- const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1143
+ };
1144
+ if (Symbol.dispose) Wasm.prototype[Symbol.dispose] = Wasm.prototype.free;
1145
+ function parseFontInfo(data) {
1146
+ try {
1147
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1148
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
1309
1149
  const len0 = WASM_VECTOR_LEN;
1310
- const ptr1 = passStringToWasm0(viewer_version, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1311
- const len1 = WASM_VECTOR_LEN;
1312
- const ret = wasm.wasm_new(ptr0, len0, ptr1, len1);
1313
- this.__wbg_ptr = ret >>> 0;
1314
- WasmFinalization.register(this, this.__wbg_ptr, this);
1315
- return this;
1316
- }
1317
- /**
1318
- * Load a document by auto-detecting its format from the file contents.
1319
- *
1320
- * Inspects magic bytes to determine the format:
1321
- * - `%PDF` → PDF
1322
- * - `PK\x03\x04` (ZIP) → inspects ZIP entries for `word/` (DOCX), `ppt/` (PPTX), or `xl/` (XLSX)
1323
- * - Image magic bytes (JPEG, PNG, GIF, BMP, TIFF, WebP) → Image
1324
- *
1325
- * # Arguments
1326
- * * `bytes` - Raw file data
1327
- *
1328
- * # Returns
1329
- * A unique document ID that can be used to reference this document.
1330
- * @param {Uint8Array} bytes
1331
- * @returns {string}
1332
- */
1333
- load(bytes) {
1334
- let deferred3_0;
1335
- let deferred3_1;
1336
- try {
1337
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1338
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
1339
- const len0 = WASM_VECTOR_LEN;
1340
- wasm.wasm_load(retptr, this.__wbg_ptr, ptr0, len0);
1341
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1342
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1343
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1344
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1345
- var ptr2 = r0;
1346
- var len2 = r1;
1347
- if (r3) {
1348
- ptr2 = 0;
1349
- len2 = 0;
1350
- throw takeObject(r2);
1351
- }
1352
- deferred3_0 = ptr2;
1353
- deferred3_1 = len2;
1354
- return getStringFromWasm0(ptr2, len2);
1355
- } finally {
1356
- wasm.__wbindgen_add_to_stack_pointer(16);
1357
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1150
+ wasm.parseFontInfo(retptr, ptr0, len0);
1151
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1152
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1153
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1154
+ if (r2) {
1155
+ throw takeObject(r1);
1358
1156
  }
1157
+ return takeObject(r0);
1158
+ } finally {
1159
+ wasm.__wbindgen_add_to_stack_pointer(16);
1359
1160
  }
1360
- /**
1361
- * Check whether the GPU render backend is available.
1362
- * @returns {boolean}
1363
- */
1364
- has_gpu() {
1365
- const ret = wasm.wasm_has_gpu(this.__wbg_ptr);
1366
- return ret !== 0;
1367
- }
1368
- /**
1369
- * Initialize the GPU render backend (Vello + WebGPU).
1370
- *
1371
- * This is async because wgpu device initialization requires yielding
1372
- * to the browser event loop. Call this once after construction.
1373
- * Returns `true` if GPU initialization succeeded, `false` if no
1374
- * WebGPU adapter is available (the CPU backend remains usable).
1375
- * @returns {Promise<boolean>}
1376
- */
1377
- init_gpu() {
1378
- const ret = wasm.wasm_init_gpu(this.__wbg_ptr);
1379
- return takeObject(ret);
1380
- }
1381
- /**
1382
- * Load a PDF document and return its ID.
1383
- *
1384
- * # Arguments
1385
- * * `bytes` - Raw PDF file data
1386
- *
1387
- * # Returns
1388
- * A unique document ID that can be used to reference this document.
1389
- * @param {Uint8Array} bytes
1390
- * @returns {string}
1391
- */
1392
- load_pdf(bytes) {
1393
- let deferred3_0;
1394
- let deferred3_1;
1395
- try {
1396
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1397
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
1398
- const len0 = WASM_VECTOR_LEN;
1399
- wasm.wasm_load_pdf(retptr, this.__wbg_ptr, ptr0, len0);
1400
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1401
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1402
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1403
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1404
- var ptr2 = r0;
1405
- var len2 = r1;
1406
- if (r3) {
1407
- ptr2 = 0;
1408
- len2 = 0;
1409
- throw takeObject(r2);
1161
+ }
1162
+ function __wbg_get_imports() {
1163
+ const import0 = {
1164
+ __proto__: null,
1165
+ __wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
1166
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1167
+ return addHeapObject(ret);
1168
+ },
1169
+ __wbg_Number_6b506e6536831eaa: function(arg0) {
1170
+ const ret = Number(getObject(arg0));
1171
+ return ret;
1172
+ },
1173
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1174
+ const ret = String(getObject(arg1));
1175
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1176
+ const len1 = WASM_VECTOR_LEN;
1177
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1178
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1179
+ },
1180
+ __wbg_Window_defb2c76b3875a73: function(arg0) {
1181
+ const ret = getObject(arg0).Window;
1182
+ return addHeapObject(ret);
1183
+ },
1184
+ __wbg_WorkerGlobalScope_184e45d6565eb3f0: function(arg0) {
1185
+ const ret = getObject(arg0).WorkerGlobalScope;
1186
+ return addHeapObject(ret);
1187
+ },
1188
+ __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: function(arg0, arg1) {
1189
+ const v = getObject(arg1);
1190
+ const ret = typeof v === "bigint" ? v : void 0;
1191
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1192
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1193
+ },
1194
+ __wbg___wbindgen_boolean_get_1a45e2c38d4d41b9: function(arg0) {
1195
+ const v = getObject(arg0);
1196
+ const ret = typeof v === "boolean" ? v : void 0;
1197
+ return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
1198
+ },
1199
+ __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(arg0, arg1) {
1200
+ const ret = debugString(getObject(arg1));
1201
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1202
+ const len1 = WASM_VECTOR_LEN;
1203
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1204
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1205
+ },
1206
+ __wbg___wbindgen_in_70a403a56e771704: function(arg0, arg1) {
1207
+ const ret = getObject(arg0) in getObject(arg1);
1208
+ return ret;
1209
+ },
1210
+ __wbg___wbindgen_is_bigint_6ffd6468a9bc44b9: function(arg0) {
1211
+ const ret = typeof getObject(arg0) === "bigint";
1212
+ return ret;
1213
+ },
1214
+ __wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
1215
+ const ret = typeof getObject(arg0) === "function";
1216
+ return ret;
1217
+ },
1218
+ __wbg___wbindgen_is_null_87c3bfe968c6a5ad: function(arg0) {
1219
+ const ret = getObject(arg0) === null;
1220
+ return ret;
1221
+ },
1222
+ __wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
1223
+ const val = getObject(arg0);
1224
+ const ret = typeof val === "object" && val !== null;
1225
+ return ret;
1226
+ },
1227
+ __wbg___wbindgen_is_string_c236cabd84a4d769: function(arg0) {
1228
+ const ret = typeof getObject(arg0) === "string";
1229
+ return ret;
1230
+ },
1231
+ __wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
1232
+ const ret = getObject(arg0) === void 0;
1233
+ return ret;
1234
+ },
1235
+ __wbg___wbindgen_jsval_eq_1068e624fa87f6ab: function(arg0, arg1) {
1236
+ const ret = getObject(arg0) === getObject(arg1);
1237
+ return ret;
1238
+ },
1239
+ __wbg___wbindgen_jsval_loose_eq_2c56564c75129511: function(arg0, arg1) {
1240
+ const ret = getObject(arg0) == getObject(arg1);
1241
+ return ret;
1242
+ },
1243
+ __wbg___wbindgen_number_get_9bb1761122181af2: function(arg0, arg1) {
1244
+ const obj = getObject(arg1);
1245
+ const ret = typeof obj === "number" ? obj : void 0;
1246
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1247
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1248
+ },
1249
+ __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
1250
+ const obj = getObject(arg1);
1251
+ const ret = typeof obj === "string" ? obj : void 0;
1252
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1253
+ var len1 = WASM_VECTOR_LEN;
1254
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1255
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1256
+ },
1257
+ __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
1258
+ throw new Error(getStringFromWasm0(arg0, arg1));
1259
+ },
1260
+ __wbg__wbg_cb_unref_61db23ac97f16c31: function(arg0) {
1261
+ getObject(arg0)._wbg_cb_unref();
1262
+ },
1263
+ __wbg_beginComputePass_1fc169dd9fc89475: function(arg0, arg1) {
1264
+ const ret = getObject(arg0).beginComputePass(getObject(arg1));
1265
+ return addHeapObject(ret);
1266
+ },
1267
+ __wbg_buffer_d370c8cae5692933: function(arg0) {
1268
+ const ret = getObject(arg0).buffer;
1269
+ return addHeapObject(ret);
1270
+ },
1271
+ __wbg_call_40e4174f169eaca7: function() {
1272
+ return handleError(function(arg0, arg1, arg2, arg3) {
1273
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1274
+ return addHeapObject(ret);
1275
+ }, arguments);
1276
+ },
1277
+ __wbg_call_8a89609d89f6608a: function() {
1278
+ return handleError(function(arg0, arg1) {
1279
+ const ret = getObject(arg0).call(getObject(arg1));
1280
+ return addHeapObject(ret);
1281
+ }, arguments);
1282
+ },
1283
+ __wbg_call_9c758de292015997: function() {
1284
+ return handleError(function(arg0, arg1, arg2) {
1285
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1286
+ return addHeapObject(ret);
1287
+ }, arguments);
1288
+ },
1289
+ __wbg_clearBuffer_5c4f30438f07155a: function(arg0, arg1, arg2, arg3) {
1290
+ getObject(arg0).clearBuffer(getObject(arg1), arg2, arg3);
1291
+ },
1292
+ __wbg_clearBuffer_de7e8cd418b56c30: function(arg0, arg1, arg2) {
1293
+ getObject(arg0).clearBuffer(getObject(arg1), arg2);
1294
+ },
1295
+ __wbg_copyBufferToBuffer_55e9540007aef863: function() {
1296
+ return handleError(function(arg0, arg1, arg2, arg3, arg4) {
1297
+ getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4);
1298
+ }, arguments);
1299
+ },
1300
+ __wbg_copyBufferToBuffer_7adcb79ef87447dc: function() {
1301
+ return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
1302
+ getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
1303
+ }, arguments);
1304
+ },
1305
+ __wbg_copyTextureToBuffer_09ba100a04b1b001: function() {
1306
+ return handleError(function(arg0, arg1, arg2, arg3) {
1307
+ getObject(arg0).copyTextureToBuffer(getObject(arg1), getObject(arg2), getObject(arg3));
1308
+ }, arguments);
1309
+ },
1310
+ __wbg_copyTextureToTexture_66ab51b863dec546: function() {
1311
+ return handleError(function(arg0, arg1, arg2, arg3) {
1312
+ getObject(arg0).copyTextureToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
1313
+ }, arguments);
1314
+ },
1315
+ __wbg_createBindGroupLayout_1dad97f44fda2929: function() {
1316
+ return handleError(function(arg0, arg1) {
1317
+ const ret = getObject(arg0).createBindGroupLayout(getObject(arg1));
1318
+ return addHeapObject(ret);
1319
+ }, arguments);
1320
+ },
1321
+ __wbg_createBindGroup_0ee0646375643dfb: function(arg0, arg1) {
1322
+ const ret = getObject(arg0).createBindGroup(getObject(arg1));
1323
+ return addHeapObject(ret);
1324
+ },
1325
+ __wbg_createBuffer_474baee88e74f68a: function() {
1326
+ return handleError(function(arg0, arg1) {
1327
+ const ret = getObject(arg0).createBuffer(getObject(arg1));
1328
+ return addHeapObject(ret);
1329
+ }, arguments);
1330
+ },
1331
+ __wbg_createCommandEncoder_5229e112300218b4: function(arg0, arg1) {
1332
+ const ret = getObject(arg0).createCommandEncoder(getObject(arg1));
1333
+ return addHeapObject(ret);
1334
+ },
1335
+ __wbg_createComputePipeline_1cd8bf7e02a1a06d: function(arg0, arg1) {
1336
+ const ret = getObject(arg0).createComputePipeline(getObject(arg1));
1337
+ return addHeapObject(ret);
1338
+ },
1339
+ __wbg_createPipelineLayout_bf0deba7918ca157: function(arg0, arg1) {
1340
+ const ret = getObject(arg0).createPipelineLayout(getObject(arg1));
1341
+ return addHeapObject(ret);
1342
+ },
1343
+ __wbg_createShaderModule_744311a1dd685c14: function(arg0, arg1) {
1344
+ const ret = getObject(arg0).createShaderModule(getObject(arg1));
1345
+ return addHeapObject(ret);
1346
+ },
1347
+ __wbg_createTexture_f357c38256411287: function() {
1348
+ return handleError(function(arg0, arg1) {
1349
+ const ret = getObject(arg0).createTexture(getObject(arg1));
1350
+ return addHeapObject(ret);
1351
+ }, arguments);
1352
+ },
1353
+ __wbg_createView_e7a36ec95c4190f3: function() {
1354
+ return handleError(function(arg0, arg1) {
1355
+ const ret = getObject(arg0).createView(getObject(arg1));
1356
+ return addHeapObject(ret);
1357
+ }, arguments);
1358
+ },
1359
+ __wbg_crypto_48300657fced39f9: function(arg0) {
1360
+ const ret = getObject(arg0).crypto;
1361
+ return addHeapObject(ret);
1362
+ },
1363
+ __wbg_debug_78b457f1effb3792: function(arg0) {
1364
+ console.debug(getObject(arg0));
1365
+ },
1366
+ __wbg_dispatchWorkgroupsIndirect_cdb624732570d2ab: function(arg0, arg1, arg2) {
1367
+ getObject(arg0).dispatchWorkgroupsIndirect(getObject(arg1), arg2);
1368
+ },
1369
+ __wbg_dispatchWorkgroups_727fa35f9c69d73c: function(arg0, arg1, arg2, arg3) {
1370
+ getObject(arg0).dispatchWorkgroups(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
1371
+ },
1372
+ __wbg_done_60cf307fcc680536: function(arg0) {
1373
+ const ret = getObject(arg0).done;
1374
+ return ret;
1375
+ },
1376
+ __wbg_end_2398df10208cf1ee: function(arg0) {
1377
+ getObject(arg0).end();
1378
+ },
1379
+ __wbg_entries_04b37a02507f1713: function(arg0) {
1380
+ const ret = Object.entries(getObject(arg0));
1381
+ return addHeapObject(ret);
1382
+ },
1383
+ __wbg_error_78ff5b3a29b770e0: function(arg0) {
1384
+ console.error(getObject(arg0));
1385
+ },
1386
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
1387
+ let deferred0_0;
1388
+ let deferred0_1;
1389
+ try {
1390
+ deferred0_0 = arg0;
1391
+ deferred0_1 = arg1;
1392
+ console.error(getStringFromWasm0(arg0, arg1));
1393
+ } finally {
1394
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1395
+ }
1396
+ },
1397
+ __wbg_fetch_38c2afdf0e494736: function(arg0) {
1398
+ const ret = fetch(getObject(arg0));
1399
+ return addHeapObject(ret);
1400
+ },
1401
+ __wbg_finish_7370ad1c0e62b448: function(arg0) {
1402
+ const ret = getObject(arg0).finish();
1403
+ return addHeapObject(ret);
1404
+ },
1405
+ __wbg_finish_797b32d15bab2338: function(arg0, arg1) {
1406
+ const ret = getObject(arg0).finish(getObject(arg1));
1407
+ return addHeapObject(ret);
1408
+ },
1409
+ __wbg_getDate_3d2f964145b3449d: function(arg0) {
1410
+ const ret = getObject(arg0).getDate();
1411
+ return ret;
1412
+ },
1413
+ __wbg_getFullYear_8b1ba9a648a4de7f: function(arg0) {
1414
+ const ret = getObject(arg0).getFullYear();
1415
+ return ret;
1416
+ },
1417
+ __wbg_getHours_91ac680ae491b8ea: function(arg0) {
1418
+ const ret = getObject(arg0).getHours();
1419
+ return ret;
1420
+ },
1421
+ __wbg_getMappedRange_9f13d158ba3946fd: function() {
1422
+ return handleError(function(arg0, arg1, arg2) {
1423
+ const ret = getObject(arg0).getMappedRange(arg1, arg2);
1424
+ return addHeapObject(ret);
1425
+ }, arguments);
1426
+ },
1427
+ __wbg_getMinutes_c1c2573becc0c7b5: function(arg0) {
1428
+ const ret = getObject(arg0).getMinutes();
1429
+ return ret;
1430
+ },
1431
+ __wbg_getMonth_44bdf67c99f2ed79: function(arg0) {
1432
+ const ret = getObject(arg0).getMonth();
1433
+ return ret;
1434
+ },
1435
+ __wbg_getRandomValues_263d0aa5464054ee: function() {
1436
+ return handleError(function(arg0, arg1) {
1437
+ getObject(arg0).getRandomValues(getObject(arg1));
1438
+ }, arguments);
1439
+ },
1440
+ __wbg_getSeconds_2716239745eecd0a: function(arg0) {
1441
+ const ret = getObject(arg0).getSeconds();
1442
+ return ret;
1443
+ },
1444
+ __wbg_get_1f8f054ddbaa7db2: function() {
1445
+ return handleError(function(arg0, arg1) {
1446
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1447
+ return addHeapObject(ret);
1448
+ }, arguments);
1449
+ },
1450
+ __wbg_get_2b48c7d0d006a781: function(arg0, arg1) {
1451
+ const ret = getObject(arg0)[arg1 >>> 0];
1452
+ return addHeapObject(ret);
1453
+ },
1454
+ __wbg_get_de6a0f7d4d18a304: function() {
1455
+ return handleError(function(arg0, arg1) {
1456
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1457
+ return addHeapObject(ret);
1458
+ }, arguments);
1459
+ },
1460
+ __wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
1461
+ const ret = getObject(arg0)[arg1 >>> 0];
1462
+ return addHeapObject(ret);
1463
+ },
1464
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1465
+ const ret = getObject(arg0)[getObject(arg1)];
1466
+ return addHeapObject(ret);
1467
+ },
1468
+ __wbg_gpu_ac6dc8fb638a26c3: function(arg0) {
1469
+ const ret = getObject(arg0).gpu;
1470
+ return addHeapObject(ret);
1471
+ },
1472
+ __wbg_info_af7f45292ba9b0ea: function(arg0) {
1473
+ console.info(getObject(arg0));
1474
+ },
1475
+ __wbg_instanceof_ArrayBuffer_8f49811467741499: function(arg0) {
1476
+ let result;
1477
+ try {
1478
+ result = getObject(arg0) instanceof ArrayBuffer;
1479
+ } catch (_) {
1480
+ result = false;
1410
1481
  }
1411
- deferred3_0 = ptr2;
1412
- deferred3_1 = len2;
1413
- return getStringFromWasm0(ptr2, len2);
1414
- } finally {
1415
- wasm.__wbindgen_add_to_stack_pointer(16);
1416
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1417
- }
1418
- }
1419
- /**
1420
- * Get the raw file bytes of a document.
1421
- *
1422
- * Returns the original file data for the document.
1423
- * @param {string} id
1424
- * @returns {Uint8Array}
1425
- */
1426
- get_bytes(id) {
1427
- try {
1428
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1429
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1430
- const len0 = WASM_VECTOR_LEN;
1431
- wasm.wasm_get_bytes(retptr, this.__wbg_ptr, ptr0, len0);
1432
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1433
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1434
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1435
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1436
- if (r3) {
1437
- throw takeObject(r2);
1482
+ const ret = result;
1483
+ return ret;
1484
+ },
1485
+ __wbg_instanceof_GpuAdapter_fb230cdccb184887: function(arg0) {
1486
+ let result;
1487
+ try {
1488
+ result = getObject(arg0) instanceof GPUAdapter;
1489
+ } catch (_) {
1490
+ result = false;
1438
1491
  }
1439
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
1440
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
1441
- return v2;
1442
- } finally {
1443
- wasm.__wbindgen_add_to_stack_pointer(16);
1444
- }
1445
- }
1446
- /**
1447
- * Get a numeric limit from the current license.
1448
- *
1449
- * Returns the limit value if set in the license, otherwise returns the default.
1450
- * @param {string} limit_name
1451
- * @param {bigint} _default
1452
- * @returns {bigint}
1453
- */
1454
- get_limit(limit_name, _default) {
1455
- const ptr0 = passStringToWasm0(limit_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1456
- const len0 = WASM_VECTOR_LEN;
1457
- const ret = wasm.wasm_get_limit(this.__wbg_ptr, ptr0, len0, _default);
1458
- return BigInt.asUintN(64, ret);
1459
- }
1460
- /**
1461
- * Load a DOCX document and return its ID.
1462
- *
1463
- * # Arguments
1464
- * * `bytes` - Raw DOCX file data
1465
- *
1466
- * # Returns
1467
- * A unique document ID that can be used to reference this document.
1468
- * @param {Uint8Array} bytes
1469
- * @returns {string}
1470
- */
1471
- load_docx(bytes) {
1472
- let deferred3_0;
1473
- let deferred3_1;
1474
- try {
1475
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1476
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
1477
- const len0 = WASM_VECTOR_LEN;
1478
- wasm.wasm_load_docx(retptr, this.__wbg_ptr, ptr0, len0);
1479
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1480
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1481
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1482
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1483
- var ptr2 = r0;
1484
- var len2 = r1;
1485
- if (r3) {
1486
- ptr2 = 0;
1487
- len2 = 0;
1488
- throw takeObject(r2);
1492
+ const ret = result;
1493
+ return ret;
1494
+ },
1495
+ __wbg_instanceof_Map_9fc06d9a951bcee6: function(arg0) {
1496
+ let result;
1497
+ try {
1498
+ result = getObject(arg0) instanceof Map;
1499
+ } catch (_) {
1500
+ result = false;
1489
1501
  }
1490
- deferred3_0 = ptr2;
1491
- deferred3_1 = len2;
1492
- return getStringFromWasm0(ptr2, len2);
1493
- } finally {
1494
- wasm.__wbindgen_add_to_stack_pointer(16);
1495
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1496
- }
1497
- }
1498
- /**
1499
- * Load a PPTX (PowerPoint) document and return its ID.
1500
- *
1501
- * # Arguments
1502
- * * `bytes` - Raw PPTX file data
1503
- *
1504
- * # Returns
1505
- * A unique document ID that can be used to reference this document.
1506
- * @param {Uint8Array} bytes
1507
- * @returns {string}
1508
- */
1509
- load_pptx(bytes) {
1510
- let deferred3_0;
1511
- let deferred3_1;
1512
- try {
1513
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1514
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
1515
- const len0 = WASM_VECTOR_LEN;
1516
- wasm.wasm_load_pptx(retptr, this.__wbg_ptr, ptr0, len0);
1517
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1518
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1519
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1520
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1521
- var ptr2 = r0;
1522
- var len2 = r1;
1523
- if (r3) {
1524
- ptr2 = 0;
1525
- len2 = 0;
1526
- throw takeObject(r2);
1502
+ const ret = result;
1503
+ return ret;
1504
+ },
1505
+ __wbg_instanceof_Response_cb984bd66d7bd408: function(arg0) {
1506
+ let result;
1507
+ try {
1508
+ result = getObject(arg0) instanceof Response;
1509
+ } catch (_) {
1510
+ result = false;
1527
1511
  }
1528
- deferred3_0 = ptr2;
1529
- deferred3_1 = len2;
1530
- return getStringFromWasm0(ptr2, len2);
1531
- } finally {
1532
- wasm.__wbindgen_add_to_stack_pointer(16);
1533
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1534
- }
1535
- }
1536
- /**
1537
- * Load an XLSX document and return its ID.
1538
- *
1539
- * # Arguments
1540
- * * `bytes` - Raw XLSX file data
1541
- *
1542
- * # Returns
1543
- * A unique document ID that can be used to reference this document.
1544
- * @param {Uint8Array} bytes
1545
- * @returns {string}
1546
- */
1547
- load_xlsx(bytes) {
1548
- let deferred3_0;
1549
- let deferred3_1;
1550
- try {
1551
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1552
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
1553
- const len0 = WASM_VECTOR_LEN;
1554
- wasm.wasm_load_xlsx(retptr, this.__wbg_ptr, ptr0, len0);
1555
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1556
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1557
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1558
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1559
- var ptr2 = r0;
1560
- var len2 = r1;
1561
- if (r3) {
1562
- ptr2 = 0;
1563
- len2 = 0;
1564
- throw takeObject(r2);
1512
+ const ret = result;
1513
+ return ret;
1514
+ },
1515
+ __wbg_instanceof_Uint8Array_86f30649f63ef9c2: function(arg0) {
1516
+ let result;
1517
+ try {
1518
+ result = getObject(arg0) instanceof Uint8Array;
1519
+ } catch (_) {
1520
+ result = false;
1565
1521
  }
1566
- deferred3_0 = ptr2;
1567
- deferred3_1 = len2;
1568
- return getStringFromWasm0(ptr2, len2);
1569
- } finally {
1570
- wasm.__wbindgen_add_to_stack_pointer(16);
1571
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1572
- }
1573
- }
1574
- /**
1575
- * Get info for a specific page.
1576
- * @param {string} id
1577
- * @param {number} page_index
1578
- * @returns {JsPageInfo}
1579
- */
1580
- page_info(id, page_index) {
1581
- try {
1582
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1583
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1584
- const len0 = WASM_VECTOR_LEN;
1585
- wasm.wasm_page_info(retptr, this.__wbg_ptr, ptr0, len0, page_index);
1586
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1587
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1588
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1589
- if (r2) {
1590
- throw takeObject(r1);
1522
+ const ret = result;
1523
+ return ret;
1524
+ },
1525
+ __wbg_isArray_67c2c9c4313f4448: function(arg0) {
1526
+ const ret = Array.isArray(getObject(arg0));
1527
+ return ret;
1528
+ },
1529
+ __wbg_isSafeInteger_66acec27e09e99a7: function(arg0) {
1530
+ const ret = Number.isSafeInteger(getObject(arg0));
1531
+ return ret;
1532
+ },
1533
+ __wbg_iterator_8732428d309e270e: function() {
1534
+ const ret = Symbol.iterator;
1535
+ return addHeapObject(ret);
1536
+ },
1537
+ __wbg_label_84abde6506fa15b7: function(arg0, arg1) {
1538
+ const ret = getObject(arg1).label;
1539
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1540
+ const len1 = WASM_VECTOR_LEN;
1541
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1542
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1543
+ },
1544
+ __wbg_length_4a591ecaa01354d9: function(arg0) {
1545
+ const ret = getObject(arg0).length;
1546
+ return ret;
1547
+ },
1548
+ __wbg_length_66f1a4b2e9026940: function(arg0) {
1549
+ const ret = getObject(arg0).length;
1550
+ return ret;
1551
+ },
1552
+ __wbg_log_cf2e968649f3384e: function(arg0) {
1553
+ console.log(getObject(arg0));
1554
+ },
1555
+ __wbg_mapAsync_3546b4b874e14738: function(arg0, arg1, arg2, arg3) {
1556
+ const ret = getObject(arg0).mapAsync(arg1 >>> 0, arg2, arg3);
1557
+ return addHeapObject(ret);
1558
+ },
1559
+ __wbg_msCrypto_8c6d45a75ef1d3da: function(arg0) {
1560
+ const ret = getObject(arg0).msCrypto;
1561
+ return addHeapObject(ret);
1562
+ },
1563
+ __wbg_navigator_3833ecdbc19d2757: function(arg0) {
1564
+ const ret = getObject(arg0).navigator;
1565
+ return addHeapObject(ret);
1566
+ },
1567
+ __wbg_navigator_391291470f58c650: function(arg0) {
1568
+ const ret = getObject(arg0).navigator;
1569
+ return addHeapObject(ret);
1570
+ },
1571
+ __wbg_new_0_445c13a750296eb6: function() {
1572
+ const ret = /* @__PURE__ */ new Date();
1573
+ return addHeapObject(ret);
1574
+ },
1575
+ __wbg_new_227d7c05414eb861: function() {
1576
+ const ret = new Error();
1577
+ return addHeapObject(ret);
1578
+ },
1579
+ __wbg_new_2ee370dca414d926: function() {
1580
+ return handleError(function() {
1581
+ const ret = new XMLHttpRequest();
1582
+ return addHeapObject(ret);
1583
+ }, arguments);
1584
+ },
1585
+ __wbg_new_578aeef4b6b94378: function(arg0) {
1586
+ const ret = new Uint8Array(getObject(arg0));
1587
+ return addHeapObject(ret);
1588
+ },
1589
+ __wbg_new_622fc80556be2e26: function() {
1590
+ const ret = /* @__PURE__ */ new Map();
1591
+ return addHeapObject(ret);
1592
+ },
1593
+ __wbg_new_b682b81e8eaaf027: function(arg0, arg1) {
1594
+ try {
1595
+ var state0 = { a: arg0, b: arg1 };
1596
+ var cb0 = (arg02, arg12) => {
1597
+ const a = state0.a;
1598
+ state0.a = 0;
1599
+ try {
1600
+ return __wasm_bindgen_func_elem_22816(a, state0.b, arg02, arg12);
1601
+ } finally {
1602
+ state0.a = a;
1603
+ }
1604
+ };
1605
+ const ret = new Promise(cb0);
1606
+ return addHeapObject(ret);
1607
+ } finally {
1608
+ state0.a = 0;
1591
1609
  }
1592
- return takeObject(r0);
1593
- } finally {
1594
- wasm.__wbindgen_add_to_stack_pointer(16);
1610
+ },
1611
+ __wbg_new_ce1ab61c1c2b300d: function() {
1612
+ const ret = new Object();
1613
+ return addHeapObject(ret);
1614
+ },
1615
+ __wbg_new_d90091b82fdf5b91: function() {
1616
+ const ret = new Array();
1617
+ return addHeapObject(ret);
1618
+ },
1619
+ __wbg_new_e436d06bc8e77460: function() {
1620
+ return handleError(function() {
1621
+ const ret = new Headers();
1622
+ return addHeapObject(ret);
1623
+ }, arguments);
1624
+ },
1625
+ __wbg_new_from_slice_18fa1f71286d66b8: function(arg0, arg1) {
1626
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1627
+ return addHeapObject(ret);
1628
+ },
1629
+ __wbg_new_typed_bf31d18f92484486: function(arg0, arg1) {
1630
+ try {
1631
+ var state0 = { a: arg0, b: arg1 };
1632
+ var cb0 = (arg02, arg12) => {
1633
+ const a = state0.a;
1634
+ state0.a = 0;
1635
+ try {
1636
+ return __wasm_bindgen_func_elem_22816(a, state0.b, arg02, arg12);
1637
+ } finally {
1638
+ state0.a = a;
1639
+ }
1640
+ };
1641
+ const ret = new Promise(cb0);
1642
+ return addHeapObject(ret);
1643
+ } finally {
1644
+ state0.a = 0;
1645
+ }
1646
+ },
1647
+ __wbg_new_with_byte_offset_and_length_d836f26d916dd9ad: function(arg0, arg1, arg2) {
1648
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1649
+ return addHeapObject(ret);
1650
+ },
1651
+ __wbg_new_with_length_36a4998e27b014c5: function(arg0) {
1652
+ const ret = new Uint8Array(arg0 >>> 0);
1653
+ return addHeapObject(ret);
1654
+ },
1655
+ __wbg_new_with_str_and_init_bcd02b79a793d27f: function() {
1656
+ return handleError(function(arg0, arg1, arg2) {
1657
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1658
+ return addHeapObject(ret);
1659
+ }, arguments);
1660
+ },
1661
+ __wbg_next_9e03acdf51c4960d: function(arg0) {
1662
+ const ret = getObject(arg0).next;
1663
+ return addHeapObject(ret);
1664
+ },
1665
+ __wbg_next_eb8ca7351fa27906: function() {
1666
+ return handleError(function(arg0) {
1667
+ const ret = getObject(arg0).next();
1668
+ return addHeapObject(ret);
1669
+ }, arguments);
1670
+ },
1671
+ __wbg_node_95beb7570492fd97: function(arg0) {
1672
+ const ret = getObject(arg0).node;
1673
+ return addHeapObject(ret);
1674
+ },
1675
+ __wbg_now_190933fa139cc119: function() {
1676
+ const ret = Date.now();
1677
+ return ret;
1678
+ },
1679
+ __wbg_open_837bab9ccb9e06da: function() {
1680
+ return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
1681
+ getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
1682
+ }, arguments);
1683
+ },
1684
+ __wbg_process_b2fea42461d03994: function(arg0) {
1685
+ const ret = getObject(arg0).process;
1686
+ return addHeapObject(ret);
1687
+ },
1688
+ __wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
1689
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1690
+ },
1691
+ __wbg_push_a6822215aa43e71c: function(arg0, arg1) {
1692
+ const ret = getObject(arg0).push(getObject(arg1));
1693
+ return ret;
1694
+ },
1695
+ __wbg_queueMicrotask_35c611f4a14830b2: function(arg0) {
1696
+ queueMicrotask(getObject(arg0));
1697
+ },
1698
+ __wbg_queueMicrotask_404ed0a58e0b63cc: function(arg0) {
1699
+ const ret = getObject(arg0).queueMicrotask;
1700
+ return addHeapObject(ret);
1701
+ },
1702
+ __wbg_queue_8cb065d04b06cb13: function(arg0) {
1703
+ const ret = getObject(arg0).queue;
1704
+ return addHeapObject(ret);
1705
+ },
1706
+ __wbg_randomFillSync_ca9f178fb14c88cb: function() {
1707
+ return handleError(function(arg0, arg1) {
1708
+ getObject(arg0).randomFillSync(takeObject(arg1));
1709
+ }, arguments);
1710
+ },
1711
+ __wbg_requestAdapter_4814cb479d2dcf15: function(arg0, arg1) {
1712
+ const ret = getObject(arg0).requestAdapter(getObject(arg1));
1713
+ return addHeapObject(ret);
1714
+ },
1715
+ __wbg_requestDevice_1b8f321791aa8b00: function(arg0, arg1) {
1716
+ const ret = getObject(arg0).requestDevice(getObject(arg1));
1717
+ return addHeapObject(ret);
1718
+ },
1719
+ __wbg_require_7a9419e39d796c95: function() {
1720
+ return handleError(function() {
1721
+ const ret = module.require;
1722
+ return addHeapObject(ret);
1723
+ }, arguments);
1724
+ },
1725
+ __wbg_resolve_25a7e548d5881dca: function(arg0) {
1726
+ const ret = Promise.resolve(getObject(arg0));
1727
+ return addHeapObject(ret);
1728
+ },
1729
+ __wbg_responseText_266ec252b6be1e56: function() {
1730
+ return handleError(function(arg0, arg1) {
1731
+ const ret = getObject(arg1).responseText;
1732
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1733
+ var len1 = WASM_VECTOR_LEN;
1734
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1735
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1736
+ }, arguments);
1737
+ },
1738
+ __wbg_response_8ec82c168e320475: function() {
1739
+ return handleError(function(arg0) {
1740
+ const ret = getObject(arg0).response;
1741
+ return addHeapObject(ret);
1742
+ }, arguments);
1743
+ },
1744
+ __wbg_send_dce79f146638dfda: function() {
1745
+ return handleError(function(arg0) {
1746
+ getObject(arg0).send();
1747
+ }, arguments);
1748
+ },
1749
+ __wbg_setBindGroup_67bd9a0c57486387: function() {
1750
+ return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1751
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
1752
+ }, arguments);
1753
+ },
1754
+ __wbg_setBindGroup_a2a4442ac2a0be99: function(arg0, arg1, arg2) {
1755
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
1756
+ },
1757
+ __wbg_setPipeline_50cfc53a5d0eb1d7: function(arg0, arg1) {
1758
+ getObject(arg0).setPipeline(getObject(arg1));
1759
+ },
1760
+ __wbg_set_25ef40a9aeff260d: function() {
1761
+ return handleError(function(arg0, arg1, arg2, arg3, arg4) {
1762
+ getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1763
+ }, arguments);
1764
+ },
1765
+ __wbg_set_52b1e1eb5bed906a: function(arg0, arg1, arg2) {
1766
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1767
+ return addHeapObject(ret);
1768
+ },
1769
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1770
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1771
+ },
1772
+ __wbg_set_6e30c9374c26414c: function() {
1773
+ return handleError(function(arg0, arg1, arg2) {
1774
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1775
+ return ret;
1776
+ }, arguments);
1777
+ },
1778
+ __wbg_set_access_67a4b0ae1c0f32f5: function(arg0, arg1) {
1779
+ getObject(arg0).access = __wbindgen_enum_GpuStorageTextureAccess[arg1];
1780
+ },
1781
+ __wbg_set_array_layer_count_c2e975f5b62596bb: function(arg0, arg1) {
1782
+ getObject(arg0).arrayLayerCount = arg1 >>> 0;
1783
+ },
1784
+ __wbg_set_aspect_a453970e75d8e849: function(arg0, arg1) {
1785
+ getObject(arg0).aspect = __wbindgen_enum_GpuTextureAspect[arg1];
1786
+ },
1787
+ __wbg_set_base_array_layer_b67db9750fbc7053: function(arg0, arg1) {
1788
+ getObject(arg0).baseArrayLayer = arg1 >>> 0;
1789
+ },
1790
+ __wbg_set_base_mip_level_35f2fc3293e96083: function(arg0, arg1) {
1791
+ getObject(arg0).baseMipLevel = arg1 >>> 0;
1792
+ },
1793
+ __wbg_set_beginning_of_pass_write_index_ddfc55f615254cc1: function(arg0, arg1) {
1794
+ getObject(arg0).beginningOfPassWriteIndex = arg1 >>> 0;
1795
+ },
1796
+ __wbg_set_bind_group_layouts_436bd62a9b35e1ab: function(arg0, arg1) {
1797
+ getObject(arg0).bindGroupLayouts = getObject(arg1);
1798
+ },
1799
+ __wbg_set_binding_b575483e08d5ba4a: function(arg0, arg1) {
1800
+ getObject(arg0).binding = arg1 >>> 0;
1801
+ },
1802
+ __wbg_set_binding_c9feebb53a130ebe: function(arg0, arg1) {
1803
+ getObject(arg0).binding = arg1 >>> 0;
1804
+ },
1805
+ __wbg_set_body_36614c7e61546809: function(arg0, arg1) {
1806
+ getObject(arg0).body = getObject(arg1);
1807
+ },
1808
+ __wbg_set_buffer_468874ee2bc9df02: function(arg0, arg1) {
1809
+ getObject(arg0).buffer = getObject(arg1);
1810
+ },
1811
+ __wbg_set_buffer_6c45652fb024e808: function(arg0, arg1) {
1812
+ getObject(arg0).buffer = getObject(arg1);
1813
+ },
1814
+ __wbg_set_buffer_83041e80a2b2c1b9: function(arg0, arg1) {
1815
+ getObject(arg0).buffer = getObject(arg1);
1816
+ },
1817
+ __wbg_set_bytes_per_row_c127092e4fe9be22: function(arg0, arg1) {
1818
+ getObject(arg0).bytesPerRow = arg1 >>> 0;
1819
+ },
1820
+ __wbg_set_bytes_per_row_fecf7d0d8d5038d0: function(arg0, arg1) {
1821
+ getObject(arg0).bytesPerRow = arg1 >>> 0;
1822
+ },
1823
+ __wbg_set_c775d84916be79ea: function(arg0, arg1, arg2) {
1824
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1825
+ },
1826
+ __wbg_set_code_0a82fa86cf58ca3b: function(arg0, arg1, arg2) {
1827
+ getObject(arg0).code = getStringFromWasm0(arg1, arg2);
1828
+ },
1829
+ __wbg_set_compute_dc74d722ba27aa5b: function(arg0, arg1) {
1830
+ getObject(arg0).compute = getObject(arg1);
1831
+ },
1832
+ __wbg_set_dca99999bba88a9a: function(arg0, arg1, arg2) {
1833
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1834
+ },
1835
+ __wbg_set_depth_or_array_layers_17284e1eac0007a1: function(arg0, arg1) {
1836
+ getObject(arg0).depthOrArrayLayers = arg1 >>> 0;
1837
+ },
1838
+ __wbg_set_dimension_3144c827eb67b110: function(arg0, arg1) {
1839
+ getObject(arg0).dimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
1840
+ },
1841
+ __wbg_set_dimension_9054f7ab0acbfd31: function(arg0, arg1) {
1842
+ getObject(arg0).dimension = __wbindgen_enum_GpuTextureDimension[arg1];
1843
+ },
1844
+ __wbg_set_end_of_pass_write_index_786588764311c9aa: function(arg0, arg1) {
1845
+ getObject(arg0).endOfPassWriteIndex = arg1 >>> 0;
1846
+ },
1847
+ __wbg_set_entries_247b5e665db79583: function(arg0, arg1) {
1848
+ getObject(arg0).entries = getObject(arg1);
1849
+ },
1850
+ __wbg_set_entries_bfbb6a7f04b96709: function(arg0, arg1) {
1851
+ getObject(arg0).entries = getObject(arg1);
1852
+ },
1853
+ __wbg_set_entry_point_3b13db51cfe0c5d6: function(arg0, arg1, arg2) {
1854
+ getObject(arg0).entryPoint = getStringFromWasm0(arg1, arg2);
1855
+ },
1856
+ __wbg_set_external_texture_a0db2eb13c76e01c: function(arg0, arg1) {
1857
+ getObject(arg0).externalTexture = getObject(arg1);
1858
+ },
1859
+ __wbg_set_format_237b3e4047d1be9a: function(arg0, arg1) {
1860
+ getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1861
+ },
1862
+ __wbg_set_format_c9dcecebf9c1e619: function(arg0, arg1) {
1863
+ getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1864
+ },
1865
+ __wbg_set_format_d9d3420c1a9d1c59: function(arg0, arg1) {
1866
+ getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1867
+ },
1868
+ __wbg_set_has_dynamic_offset_0c8a607543be8069: function(arg0, arg1) {
1869
+ getObject(arg0).hasDynamicOffset = arg1 !== 0;
1870
+ },
1871
+ __wbg_set_headers_7c1e39ece7826bec: function(arg0, arg1) {
1872
+ getObject(arg0).headers = getObject(arg1);
1873
+ },
1874
+ __wbg_set_height_96611e96eee67c44: function(arg0, arg1) {
1875
+ getObject(arg0).height = arg1 >>> 0;
1876
+ },
1877
+ __wbg_set_label_01228663ea03b92f: function(arg0, arg1, arg2) {
1878
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1879
+ },
1880
+ __wbg_set_label_22e57f4c5b38215f: function(arg0, arg1, arg2) {
1881
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1882
+ },
1883
+ __wbg_set_label_382417d222111912: function(arg0, arg1, arg2) {
1884
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1885
+ },
1886
+ __wbg_set_label_4d049edb707ba31c: function(arg0, arg1, arg2) {
1887
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1888
+ },
1889
+ __wbg_set_label_66fc1d23dd10d4f5: function(arg0, arg1, arg2) {
1890
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1891
+ },
1892
+ __wbg_set_label_806446f85d68e201: function(arg0, arg1, arg2) {
1893
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1894
+ },
1895
+ __wbg_set_label_8354c6463558484f: function(arg0, arg1, arg2) {
1896
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1897
+ },
1898
+ __wbg_set_label_b3da7636c69f1a4c: function(arg0, arg1, arg2) {
1899
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1900
+ },
1901
+ __wbg_set_label_b7f797c13bc822c4: function(arg0, arg1, arg2) {
1902
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1903
+ },
1904
+ __wbg_set_label_e026aa2aea731594: function(arg0, arg1, arg2) {
1905
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1906
+ },
1907
+ __wbg_set_label_e6bc3b86ef6deeb8: function(arg0, arg1, arg2) {
1908
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1909
+ },
1910
+ __wbg_set_label_e7f76bba99d72971: function(arg0, arg1, arg2) {
1911
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1912
+ },
1913
+ __wbg_set_layout_44943c4c7d78f826: function(arg0, arg1) {
1914
+ getObject(arg0).layout = getObject(arg1);
1915
+ },
1916
+ __wbg_set_layout_726c6ae6f5919730: function(arg0, arg1) {
1917
+ getObject(arg0).layout = getObject(arg1);
1918
+ },
1919
+ __wbg_set_mapped_at_creation_12773dff1bb6ea0f: function(arg0, arg1) {
1920
+ getObject(arg0).mappedAtCreation = arg1 !== 0;
1921
+ },
1922
+ __wbg_set_method_7a6811dec7a4feff: function(arg0, arg1, arg2) {
1923
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1924
+ },
1925
+ __wbg_set_min_binding_size_164df827e02821e1: function(arg0, arg1) {
1926
+ getObject(arg0).minBindingSize = arg1;
1927
+ },
1928
+ __wbg_set_mip_level_7f56c1c607dda5cf: function(arg0, arg1) {
1929
+ getObject(arg0).mipLevel = arg1 >>> 0;
1930
+ },
1931
+ __wbg_set_mip_level_count_3402f5315a423b69: function(arg0, arg1) {
1932
+ getObject(arg0).mipLevelCount = arg1 >>> 0;
1933
+ },
1934
+ __wbg_set_mip_level_count_ed029120a0ee12b8: function(arg0, arg1) {
1935
+ getObject(arg0).mipLevelCount = arg1 >>> 0;
1936
+ },
1937
+ __wbg_set_module_af2f871a0bed003c: function(arg0, arg1) {
1938
+ getObject(arg0).module = getObject(arg1);
1939
+ },
1940
+ __wbg_set_multisampled_e9d7bed0e68d1d6f: function(arg0, arg1) {
1941
+ getObject(arg0).multisampled = arg1 !== 0;
1942
+ },
1943
+ __wbg_set_offset_01c04218a4ccfa08: function(arg0, arg1) {
1944
+ getObject(arg0).offset = arg1;
1945
+ },
1946
+ __wbg_set_offset_bd11f79890456c6f: function(arg0, arg1) {
1947
+ getObject(arg0).offset = arg1;
1948
+ },
1949
+ __wbg_set_offset_f07a73165707eb4c: function(arg0, arg1) {
1950
+ getObject(arg0).offset = arg1;
1951
+ },
1952
+ __wbg_set_origin_6be40076fb0623f4: function(arg0, arg1) {
1953
+ getObject(arg0).origin = getObject(arg1);
1954
+ },
1955
+ __wbg_set_power_preference_0721cf46746c0c7d: function(arg0, arg1) {
1956
+ getObject(arg0).powerPreference = __wbindgen_enum_GpuPowerPreference[arg1];
1957
+ },
1958
+ __wbg_set_query_set_aadbb433c8390a5c: function(arg0, arg1) {
1959
+ getObject(arg0).querySet = getObject(arg1);
1960
+ },
1961
+ __wbg_set_required_features_5202fa8cd082e531: function(arg0, arg1) {
1962
+ getObject(arg0).requiredFeatures = getObject(arg1);
1963
+ },
1964
+ __wbg_set_resource_c73d0c2d815f7211: function(arg0, arg1) {
1965
+ getObject(arg0).resource = getObject(arg1);
1966
+ },
1967
+ __wbg_set_responseType_cfb49ea8269f8317: function(arg0, arg1) {
1968
+ getObject(arg0).responseType = __wbindgen_enum_XmlHttpRequestResponseType[arg1];
1969
+ },
1970
+ __wbg_set_rows_per_image_00c8e938dae40dae: function(arg0, arg1) {
1971
+ getObject(arg0).rowsPerImage = arg1 >>> 0;
1972
+ },
1973
+ __wbg_set_rows_per_image_e6e2c0c4a7e4fa8d: function(arg0, arg1) {
1974
+ getObject(arg0).rowsPerImage = arg1 >>> 0;
1975
+ },
1976
+ __wbg_set_sample_count_05dcc9952f4fa7ac: function(arg0, arg1) {
1977
+ getObject(arg0).sampleCount = arg1 >>> 0;
1978
+ },
1979
+ __wbg_set_sample_type_93886b8f9794f85c: function(arg0, arg1) {
1980
+ getObject(arg0).sampleType = __wbindgen_enum_GpuTextureSampleType[arg1];
1981
+ },
1982
+ __wbg_set_sampler_02989e99b27a50db: function(arg0, arg1) {
1983
+ getObject(arg0).sampler = getObject(arg1);
1984
+ },
1985
+ __wbg_set_size_b3e6b2bf58d62082: function(arg0, arg1) {
1986
+ getObject(arg0).size = getObject(arg1);
1987
+ },
1988
+ __wbg_set_size_c2a556d5571231f5: function(arg0, arg1) {
1989
+ getObject(arg0).size = arg1;
1990
+ },
1991
+ __wbg_set_size_f7b29f6cb1669c4d: function(arg0, arg1) {
1992
+ getObject(arg0).size = arg1;
1993
+ },
1994
+ __wbg_set_storage_texture_50af47fec531be02: function(arg0, arg1) {
1995
+ getObject(arg0).storageTexture = getObject(arg1);
1996
+ },
1997
+ __wbg_set_texture_884f2777c0fe1e91: function(arg0, arg1) {
1998
+ getObject(arg0).texture = getObject(arg1);
1999
+ },
2000
+ __wbg_set_texture_a1baf7da91d20351: function(arg0, arg1) {
2001
+ getObject(arg0).texture = getObject(arg1);
2002
+ },
2003
+ __wbg_set_timestamp_writes_7fa18118aa24ddc1: function(arg0, arg1) {
2004
+ getObject(arg0).timestampWrites = getObject(arg1);
2005
+ },
2006
+ __wbg_set_type_109702a7ec65b49d: function(arg0, arg1) {
2007
+ getObject(arg0).type = __wbindgen_enum_GpuSamplerBindingType[arg1];
2008
+ },
2009
+ __wbg_set_type_55112c374bcc5a9d: function(arg0, arg1) {
2010
+ getObject(arg0).type = __wbindgen_enum_GpuBufferBindingType[arg1];
2011
+ },
2012
+ __wbg_set_usage_ac04cadda4108c1a: function(arg0, arg1) {
2013
+ getObject(arg0).usage = arg1 >>> 0;
2014
+ },
2015
+ __wbg_set_usage_ad30cd3b0e0f4244: function(arg0, arg1) {
2016
+ getObject(arg0).usage = arg1 >>> 0;
2017
+ },
2018
+ __wbg_set_usage_cc34543608cf3335: function(arg0, arg1) {
2019
+ getObject(arg0).usage = arg1 >>> 0;
2020
+ },
2021
+ __wbg_set_view_dimension_50f3edb06107948f: function(arg0, arg1) {
2022
+ getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2023
+ },
2024
+ __wbg_set_view_dimension_925bb358df1f2b9d: function(arg0, arg1) {
2025
+ getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2026
+ },
2027
+ __wbg_set_view_formats_3d2a72ffb1f55a75: function(arg0, arg1) {
2028
+ getObject(arg0).viewFormats = getObject(arg1);
2029
+ },
2030
+ __wbg_set_visibility_bdebc70a7c0f236d: function(arg0, arg1) {
2031
+ getObject(arg0).visibility = arg1 >>> 0;
2032
+ },
2033
+ __wbg_set_width_40592253da7b2113: function(arg0, arg1) {
2034
+ getObject(arg0).width = arg1 >>> 0;
2035
+ },
2036
+ __wbg_set_x_3c1cb8191b848172: function(arg0, arg1) {
2037
+ getObject(arg0).x = arg1 >>> 0;
2038
+ },
2039
+ __wbg_set_y_9024331910317eff: function(arg0, arg1) {
2040
+ getObject(arg0).y = arg1 >>> 0;
2041
+ },
2042
+ __wbg_set_z_b6182f4c230116a7: function(arg0, arg1) {
2043
+ getObject(arg0).z = arg1 >>> 0;
2044
+ },
2045
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
2046
+ const ret = getObject(arg1).stack;
2047
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2048
+ const len1 = WASM_VECTOR_LEN;
2049
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2050
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2051
+ },
2052
+ __wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
2053
+ const ret = typeof global === "undefined" ? null : global;
2054
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2055
+ },
2056
+ __wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a: function() {
2057
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
2058
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2059
+ },
2060
+ __wbg_static_accessor_SELF_4c59f6c7ea29a144: function() {
2061
+ const ret = typeof self === "undefined" ? null : self;
2062
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2063
+ },
2064
+ __wbg_static_accessor_WINDOW_e70ae9f2eb052253: function() {
2065
+ const ret = typeof window === "undefined" ? null : window;
2066
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2067
+ },
2068
+ __wbg_status_214edd0820ca76fc: function() {
2069
+ return handleError(function(arg0) {
2070
+ const ret = getObject(arg0).status;
2071
+ return ret;
2072
+ }, arguments);
2073
+ },
2074
+ __wbg_subarray_4aa221f6a4f5ab22: function(arg0, arg1, arg2) {
2075
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2076
+ return addHeapObject(ret);
2077
+ },
2078
+ __wbg_submit_fc5b9a1154201a58: function(arg0, arg1) {
2079
+ getObject(arg0).submit(getObject(arg1));
2080
+ },
2081
+ __wbg_text_a17febec76d36501: function() {
2082
+ return handleError(function(arg0) {
2083
+ const ret = getObject(arg0).text();
2084
+ return addHeapObject(ret);
2085
+ }, arguments);
2086
+ },
2087
+ __wbg_then_18f476d590e58992: function(arg0, arg1, arg2) {
2088
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2089
+ return addHeapObject(ret);
2090
+ },
2091
+ __wbg_then_529ea37d9bdbf95d: function(arg0, arg1, arg2) {
2092
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2093
+ return addHeapObject(ret);
2094
+ },
2095
+ __wbg_then_ac7b025999b52837: function(arg0, arg1) {
2096
+ const ret = getObject(arg0).then(getObject(arg1));
2097
+ return addHeapObject(ret);
2098
+ },
2099
+ __wbg_toISOString_d485be0388a74494: function(arg0) {
2100
+ const ret = getObject(arg0).toISOString();
2101
+ return addHeapObject(ret);
2102
+ },
2103
+ __wbg_value_f3625092ee4b37f4: function(arg0) {
2104
+ const ret = getObject(arg0).value;
2105
+ return addHeapObject(ret);
2106
+ },
2107
+ __wbg_versions_215a3ab1c9d5745a: function(arg0) {
2108
+ const ret = getObject(arg0).versions;
2109
+ return addHeapObject(ret);
2110
+ },
2111
+ __wbg_warn_410c3261e3c6d686: function(arg0) {
2112
+ console.warn(getObject(arg0));
2113
+ },
2114
+ __wbg_writeBuffer_7d54524c36f1c7e2: function() {
2115
+ return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
2116
+ getObject(arg0).writeBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
2117
+ }, arguments);
2118
+ },
2119
+ __wbg_writeTexture_9d4c493be748d189: function() {
2120
+ return handleError(function(arg0, arg1, arg2, arg3, arg4) {
2121
+ getObject(arg0).writeTexture(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2122
+ }, arguments);
2123
+ },
2124
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2125
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_22803);
2126
+ return addHeapObject(ret);
2127
+ },
2128
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2129
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3624);
2130
+ return addHeapObject(ret);
2131
+ },
2132
+ __wbindgen_cast_0000000000000003: function(arg0) {
2133
+ const ret = arg0;
2134
+ return addHeapObject(ret);
2135
+ },
2136
+ __wbindgen_cast_0000000000000004: function(arg0) {
2137
+ const ret = arg0;
2138
+ return addHeapObject(ret);
2139
+ },
2140
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
2141
+ const ret = getArrayU8FromWasm0(arg0, arg1);
2142
+ return addHeapObject(ret);
2143
+ },
2144
+ __wbindgen_cast_0000000000000006: function(arg0, arg1) {
2145
+ const ret = getStringFromWasm0(arg0, arg1);
2146
+ return addHeapObject(ret);
2147
+ },
2148
+ __wbindgen_cast_0000000000000007: function(arg0) {
2149
+ const ret = BigInt.asUintN(64, arg0);
2150
+ return addHeapObject(ret);
2151
+ },
2152
+ __wbindgen_cast_0000000000000008: function(arg0, arg1) {
2153
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
2154
+ wasm.__wbindgen_export4(arg0, arg1 * 1, 1);
2155
+ const ret = v0;
2156
+ return addHeapObject(ret);
2157
+ },
2158
+ __wbindgen_object_clone_ref: function(arg0) {
2159
+ const ret = getObject(arg0);
2160
+ return addHeapObject(ret);
2161
+ },
2162
+ __wbindgen_object_drop_ref: function(arg0) {
2163
+ takeObject(arg0);
1595
2164
  }
1596
- }
1597
- };
1598
- if (Symbol.dispose) Wasm.prototype[Symbol.dispose] = Wasm.prototype.free;
1599
- function parseFontInfo(data) {
2165
+ };
2166
+ return {
2167
+ __proto__: null,
2168
+ "./udoc_bg.js": import0
2169
+ };
2170
+ }
2171
+ function __wasm_bindgen_func_elem_3624(arg0, arg1, arg2) {
2172
+ wasm.__wasm_bindgen_func_elem_3624(arg0, arg1, addHeapObject(arg2));
2173
+ }
2174
+ function __wasm_bindgen_func_elem_22803(arg0, arg1, arg2) {
1600
2175
  try {
1601
2176
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1602
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
1603
- const len0 = WASM_VECTOR_LEN;
1604
- wasm.parseFontInfo(retptr, ptr0, len0);
2177
+ wasm.__wasm_bindgen_func_elem_22803(retptr, arg0, arg1, addHeapObject(arg2));
1605
2178
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1606
2179
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1607
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1608
- if (r2) {
1609
- throw takeObject(r1);
2180
+ if (r1) {
2181
+ throw takeObject(r0);
1610
2182
  }
1611
- return takeObject(r0);
1612
2183
  } finally {
1613
2184
  wasm.__wbindgen_add_to_stack_pointer(16);
1614
2185
  }
1615
2186
  }
1616
- var EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
1617
- async function __wbg_load(module2, imports) {
1618
- if (typeof Response === "function" && module2 instanceof Response) {
1619
- if (typeof WebAssembly.instantiateStreaming === "function") {
1620
- try {
1621
- return await WebAssembly.instantiateStreaming(module2, imports);
1622
- } catch (e) {
1623
- const validResponse = module2.ok && EXPECTED_RESPONSE_TYPES.has(module2.type);
1624
- if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
1625
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1626
- } else {
1627
- throw e;
1628
- }
1629
- }
1630
- }
1631
- const bytes = await module2.arrayBuffer();
1632
- return await WebAssembly.instantiate(bytes, imports);
1633
- } else {
1634
- const instance = await WebAssembly.instantiate(module2, imports);
1635
- if (instance instanceof WebAssembly.Instance) {
1636
- return { instance, module: module2 };
1637
- } else {
1638
- return instance;
1639
- }
1640
- }
2187
+ function __wasm_bindgen_func_elem_22816(arg0, arg1, arg2, arg3) {
2188
+ wasm.__wasm_bindgen_func_elem_22816(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1641
2189
  }
1642
- function __wbg_get_imports() {
1643
- const imports = {};
1644
- imports.wbg = {};
1645
- imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
1646
- const ret = Error(getStringFromWasm0(arg0, arg1));
1647
- return addHeapObject(ret);
1648
- };
1649
- imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
1650
- const ret = Number(getObject(arg0));
1651
- return ret;
1652
- };
1653
- imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1654
- const ret = String(getObject(arg1));
1655
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1656
- const len1 = WASM_VECTOR_LEN;
1657
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1658
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1659
- };
1660
- imports.wbg.__wbg_Window_a4c5a48392f234ba = function(arg0) {
1661
- const ret = getObject(arg0).Window;
1662
- return addHeapObject(ret);
1663
- };
1664
- imports.wbg.__wbg_WorkerGlobalScope_2b2b89e1ac952b50 = function(arg0) {
1665
- const ret = getObject(arg0).WorkerGlobalScope;
1666
- return addHeapObject(ret);
1667
- };
1668
- imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
1669
- const v = getObject(arg1);
1670
- const ret = typeof v === "bigint" ? v : void 0;
1671
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1672
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1673
- };
1674
- imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
1675
- const v = getObject(arg0);
1676
- const ret = typeof v === "boolean" ? v : void 0;
1677
- return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
1678
- };
1679
- imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
1680
- const ret = debugString(getObject(arg1));
1681
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1682
- const len1 = WASM_VECTOR_LEN;
1683
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1684
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1685
- };
1686
- imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
1687
- const ret = getObject(arg0) in getObject(arg1);
1688
- return ret;
1689
- };
1690
- imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
1691
- const ret = typeof getObject(arg0) === "bigint";
1692
- return ret;
1693
- };
1694
- imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
1695
- const ret = typeof getObject(arg0) === "function";
1696
- return ret;
1697
- };
1698
- imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
1699
- const ret = getObject(arg0) === null;
1700
- return ret;
1701
- };
1702
- imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
1703
- const val = getObject(arg0);
1704
- const ret = typeof val === "object" && val !== null;
1705
- return ret;
1706
- };
1707
- imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
1708
- const ret = typeof getObject(arg0) === "string";
1709
- return ret;
1710
- };
1711
- imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
1712
- const ret = getObject(arg0) === void 0;
1713
- return ret;
1714
- };
1715
- imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
1716
- const ret = getObject(arg0) === getObject(arg1);
1717
- return ret;
1718
- };
1719
- imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
1720
- const ret = getObject(arg0) == getObject(arg1);
1721
- return ret;
1722
- };
1723
- imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
1724
- const obj = getObject(arg1);
1725
- const ret = typeof obj === "number" ? obj : void 0;
1726
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1727
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1728
- };
1729
- imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
1730
- const obj = getObject(arg1);
1731
- const ret = typeof obj === "string" ? obj : void 0;
1732
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1733
- var len1 = WASM_VECTOR_LEN;
1734
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1735
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1736
- };
1737
- imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
1738
- throw new Error(getStringFromWasm0(arg0, arg1));
1739
- };
1740
- imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
1741
- getObject(arg0)._wbg_cb_unref();
1742
- };
1743
- imports.wbg.__wbg_beginComputePass_304dccb30a4db2cc = function(arg0, arg1) {
1744
- const ret = getObject(arg0).beginComputePass(getObject(arg1));
1745
- return addHeapObject(ret);
1746
- };
1747
- imports.wbg.__wbg_buffer_6cb2fecb1f253d71 = function(arg0) {
1748
- const ret = getObject(arg0).buffer;
1749
- return addHeapObject(ret);
1750
- };
1751
- imports.wbg.__wbg_call_3020136f7a2d6e44 = function() {
1752
- return handleError(function(arg0, arg1, arg2) {
1753
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1754
- return addHeapObject(ret);
1755
- }, arguments);
1756
- };
1757
- imports.wbg.__wbg_call_abb4ff46ce38be40 = function() {
1758
- return handleError(function(arg0, arg1) {
1759
- const ret = getObject(arg0).call(getObject(arg1));
1760
- return addHeapObject(ret);
1761
- }, arguments);
1762
- };
1763
- imports.wbg.__wbg_call_c8baa5c5e72d274e = function() {
1764
- return handleError(function(arg0, arg1, arg2, arg3) {
1765
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1766
- return addHeapObject(ret);
1767
- }, arguments);
1768
- };
1769
- imports.wbg.__wbg_clearBuffer_b7d0381b50c8f5bb = function(arg0, arg1, arg2, arg3) {
1770
- getObject(arg0).clearBuffer(getObject(arg1), arg2, arg3);
1771
- };
1772
- imports.wbg.__wbg_clearBuffer_e3fa352fcc8ecc67 = function(arg0, arg1, arg2) {
1773
- getObject(arg0).clearBuffer(getObject(arg1), arg2);
1774
- };
1775
- imports.wbg.__wbg_copyBufferToBuffer_38cb6919320bd451 = function() {
1776
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
1777
- getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
1778
- }, arguments);
1779
- };
1780
- imports.wbg.__wbg_copyBufferToBuffer_8db6b1d1ef2bcea4 = function() {
1781
- return handleError(function(arg0, arg1, arg2, arg3, arg4) {
1782
- getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4);
1783
- }, arguments);
1784
- };
1785
- imports.wbg.__wbg_copyTextureToBuffer_21b9dc9b4d87baf0 = function() {
1786
- return handleError(function(arg0, arg1, arg2, arg3) {
1787
- getObject(arg0).copyTextureToBuffer(getObject(arg1), getObject(arg2), getObject(arg3));
1788
- }, arguments);
1789
- };
1790
- imports.wbg.__wbg_copyTextureToTexture_0eb51a215ab2cc31 = function() {
1791
- return handleError(function(arg0, arg1, arg2, arg3) {
1792
- getObject(arg0).copyTextureToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
1793
- }, arguments);
1794
- };
1795
- imports.wbg.__wbg_createBindGroupLayout_3fb59c14aed4b64e = function() {
1796
- return handleError(function(arg0, arg1) {
1797
- const ret = getObject(arg0).createBindGroupLayout(getObject(arg1));
1798
- return addHeapObject(ret);
1799
- }, arguments);
1800
- };
1801
- imports.wbg.__wbg_createBindGroup_03f26b8770895116 = function(arg0, arg1) {
1802
- const ret = getObject(arg0).createBindGroup(getObject(arg1));
1803
- return addHeapObject(ret);
1804
- };
1805
- imports.wbg.__wbg_createBuffer_76f7598789ecc3d7 = function() {
1806
- return handleError(function(arg0, arg1) {
1807
- const ret = getObject(arg0).createBuffer(getObject(arg1));
1808
- return addHeapObject(ret);
1809
- }, arguments);
1810
- };
1811
- imports.wbg.__wbg_createCommandEncoder_f8056019328bd192 = function(arg0, arg1) {
1812
- const ret = getObject(arg0).createCommandEncoder(getObject(arg1));
1813
- return addHeapObject(ret);
1814
- };
1815
- imports.wbg.__wbg_createComputePipeline_e6192c920efba35b = function(arg0, arg1) {
1816
- const ret = getObject(arg0).createComputePipeline(getObject(arg1));
1817
- return addHeapObject(ret);
1818
- };
1819
- imports.wbg.__wbg_createPipelineLayout_5039b0679b6b7f36 = function(arg0, arg1) {
1820
- const ret = getObject(arg0).createPipelineLayout(getObject(arg1));
1821
- return addHeapObject(ret);
1822
- };
1823
- imports.wbg.__wbg_createShaderModule_3facfe98356b79a9 = function(arg0, arg1) {
1824
- const ret = getObject(arg0).createShaderModule(getObject(arg1));
1825
- return addHeapObject(ret);
1826
- };
1827
- imports.wbg.__wbg_createTexture_49002c91188f6137 = function() {
1828
- return handleError(function(arg0, arg1) {
1829
- const ret = getObject(arg0).createTexture(getObject(arg1));
1830
- return addHeapObject(ret);
1831
- }, arguments);
1832
- };
1833
- imports.wbg.__wbg_createView_0ce5c82d78f482df = function() {
1834
- return handleError(function(arg0, arg1) {
1835
- const ret = getObject(arg0).createView(getObject(arg1));
1836
- return addHeapObject(ret);
1837
- }, arguments);
1838
- };
1839
- imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1840
- const ret = getObject(arg0).crypto;
1841
- return addHeapObject(ret);
1842
- };
1843
- imports.wbg.__wbg_debug_9d0c87ddda3dc485 = function(arg0) {
1844
- console.debug(getObject(arg0));
1845
- };
1846
- imports.wbg.__wbg_dispatchWorkgroupsIndirect_6594fbc416b287d6 = function(arg0, arg1, arg2) {
1847
- getObject(arg0).dispatchWorkgroupsIndirect(getObject(arg1), arg2);
1848
- };
1849
- imports.wbg.__wbg_dispatchWorkgroups_4e59e078119b5bab = function(arg0, arg1, arg2, arg3) {
1850
- getObject(arg0).dispatchWorkgroups(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
1851
- };
1852
- imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
1853
- const ret = getObject(arg0).done;
1854
- return ret;
1855
- };
1856
- imports.wbg.__wbg_end_ece2bf3a25678f12 = function(arg0) {
1857
- getObject(arg0).end();
1858
- };
1859
- imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
1860
- const ret = Object.entries(getObject(arg0));
1861
- return addHeapObject(ret);
1862
- };
1863
- imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1864
- let deferred0_0;
1865
- let deferred0_1;
1866
- try {
1867
- deferred0_0 = arg0;
1868
- deferred0_1 = arg1;
1869
- console.error(getStringFromWasm0(arg0, arg1));
1870
- } finally {
1871
- wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2190
+ var __wbindgen_enum_GpuBufferBindingType = ["uniform", "storage", "read-only-storage"];
2191
+ var __wbindgen_enum_GpuPowerPreference = ["low-power", "high-performance"];
2192
+ var __wbindgen_enum_GpuSamplerBindingType = ["filtering", "non-filtering", "comparison"];
2193
+ var __wbindgen_enum_GpuStorageTextureAccess = ["write-only", "read-only", "read-write"];
2194
+ var __wbindgen_enum_GpuTextureAspect = ["all", "stencil-only", "depth-only"];
2195
+ var __wbindgen_enum_GpuTextureDimension = ["1d", "2d", "3d"];
2196
+ var __wbindgen_enum_GpuTextureFormat = ["r8unorm", "r8snorm", "r8uint", "r8sint", "r16uint", "r16sint", "r16float", "rg8unorm", "rg8snorm", "rg8uint", "rg8sint", "r32uint", "r32sint", "r32float", "rg16uint", "rg16sint", "rg16float", "rgba8unorm", "rgba8unorm-srgb", "rgba8snorm", "rgba8uint", "rgba8sint", "bgra8unorm", "bgra8unorm-srgb", "rgb9e5ufloat", "rgb10a2uint", "rgb10a2unorm", "rg11b10ufloat", "rg32uint", "rg32sint", "rg32float", "rgba16uint", "rgba16sint", "rgba16float", "rgba32uint", "rgba32sint", "rgba32float", "stencil8", "depth16unorm", "depth24plus", "depth24plus-stencil8", "depth32float", "depth32float-stencil8", "bc1-rgba-unorm", "bc1-rgba-unorm-srgb", "bc2-rgba-unorm", "bc2-rgba-unorm-srgb", "bc3-rgba-unorm", "bc3-rgba-unorm-srgb", "bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm", "bc6h-rgb-ufloat", "bc6h-rgb-float", "bc7-rgba-unorm", "bc7-rgba-unorm-srgb", "etc2-rgb8unorm", "etc2-rgb8unorm-srgb", "etc2-rgb8a1unorm", "etc2-rgb8a1unorm-srgb", "etc2-rgba8unorm", "etc2-rgba8unorm-srgb", "eac-r11unorm", "eac-r11snorm", "eac-rg11unorm", "eac-rg11snorm", "astc-4x4-unorm", "astc-4x4-unorm-srgb", "astc-5x4-unorm", "astc-5x4-unorm-srgb", "astc-5x5-unorm", "astc-5x5-unorm-srgb", "astc-6x5-unorm", "astc-6x5-unorm-srgb", "astc-6x6-unorm", "astc-6x6-unorm-srgb", "astc-8x5-unorm", "astc-8x5-unorm-srgb", "astc-8x6-unorm", "astc-8x6-unorm-srgb", "astc-8x8-unorm", "astc-8x8-unorm-srgb", "astc-10x5-unorm", "astc-10x5-unorm-srgb", "astc-10x6-unorm", "astc-10x6-unorm-srgb", "astc-10x8-unorm", "astc-10x8-unorm-srgb", "astc-10x10-unorm", "astc-10x10-unorm-srgb", "astc-12x10-unorm", "astc-12x10-unorm-srgb", "astc-12x12-unorm", "astc-12x12-unorm-srgb"];
2197
+ var __wbindgen_enum_GpuTextureSampleType = ["float", "unfilterable-float", "depth", "sint", "uint"];
2198
+ var __wbindgen_enum_GpuTextureViewDimension = ["1d", "2d", "2d-array", "cube", "cube-array", "3d"];
2199
+ var __wbindgen_enum_XmlHttpRequestResponseType = ["", "arraybuffer", "blob", "document", "json", "text"];
2200
+ var WasmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2201
+ }, unregister: () => {
2202
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_wasm_free(ptr, 1));
2203
+ function addHeapObject(obj) {
2204
+ if (heap_next === heap.length) heap.push(heap.length + 1);
2205
+ const idx = heap_next;
2206
+ heap_next = heap[idx];
2207
+ heap[idx] = obj;
2208
+ return idx;
2209
+ }
2210
+ var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
2211
+ }, unregister: () => {
2212
+ } } : new FinalizationRegistry((state) => wasm.__wbindgen_export5(state.a, state.b));
2213
+ function debugString(val) {
2214
+ const type = typeof val;
2215
+ if (type == "number" || type == "boolean" || val == null) {
2216
+ return `${val}`;
2217
+ }
2218
+ if (type == "string") {
2219
+ return `"${val}"`;
2220
+ }
2221
+ if (type == "symbol") {
2222
+ const description = val.description;
2223
+ if (description == null) {
2224
+ return "Symbol";
2225
+ } else {
2226
+ return `Symbol(${description})`;
1872
2227
  }
1873
- };
1874
- imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
1875
- console.error(getObject(arg0));
1876
- };
1877
- imports.wbg.__wbg_fetch_cd0acd3c15ec5b5d = function(arg0) {
1878
- const ret = fetch(getObject(arg0));
1879
- return addHeapObject(ret);
1880
- };
1881
- imports.wbg.__wbg_finish_17a0b297901010d5 = function(arg0) {
1882
- const ret = getObject(arg0).finish();
1883
- return addHeapObject(ret);
1884
- };
1885
- imports.wbg.__wbg_finish_ab9e01a922269f3a = function(arg0, arg1) {
1886
- const ret = getObject(arg0).finish(getObject(arg1));
1887
- return addHeapObject(ret);
1888
- };
1889
- imports.wbg.__wbg_getDate_b8071ea9fc4f6838 = function(arg0) {
1890
- const ret = getObject(arg0).getDate();
1891
- return ret;
1892
- };
1893
- imports.wbg.__wbg_getFullYear_6ac412e8eee86879 = function(arg0) {
1894
- const ret = getObject(arg0).getFullYear();
1895
- return ret;
1896
- };
1897
- imports.wbg.__wbg_getHours_52eb417ad6e924e8 = function(arg0) {
1898
- const ret = getObject(arg0).getHours();
1899
- return ret;
1900
- };
1901
- imports.wbg.__wbg_getMappedRange_1229810ff58e27ce = function() {
1902
- return handleError(function(arg0, arg1, arg2) {
1903
- const ret = getObject(arg0).getMappedRange(arg1, arg2);
1904
- return addHeapObject(ret);
1905
- }, arguments);
1906
- };
1907
- imports.wbg.__wbg_getMinutes_4097cef8e08622f9 = function(arg0) {
1908
- const ret = getObject(arg0).getMinutes();
1909
- return ret;
1910
- };
1911
- imports.wbg.__wbg_getMonth_48a392071f9e5017 = function(arg0) {
1912
- const ret = getObject(arg0).getMonth();
1913
- return ret;
1914
- };
1915
- imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() {
1916
- return handleError(function(arg0, arg1) {
1917
- getObject(arg0).getRandomValues(getObject(arg1));
1918
- }, arguments);
1919
- };
1920
- imports.wbg.__wbg_getSeconds_d94762aec8103802 = function(arg0) {
1921
- const ret = getObject(arg0).getSeconds();
1922
- return ret;
1923
- };
1924
- imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
1925
- const ret = getObject(arg0)[arg1 >>> 0];
1926
- return addHeapObject(ret);
1927
- };
1928
- imports.wbg.__wbg_get_af9dab7e9603ea93 = function() {
1929
- return handleError(function(arg0, arg1) {
1930
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1931
- return addHeapObject(ret);
1932
- }, arguments);
1933
- };
1934
- imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
1935
- const ret = getObject(arg0)[getObject(arg1)];
1936
- return addHeapObject(ret);
1937
- };
1938
- imports.wbg.__wbg_gpu_a6bce2913fb8f574 = function(arg0) {
1939
- const ret = getObject(arg0).gpu;
1940
- return addHeapObject(ret);
1941
- };
1942
- imports.wbg.__wbg_info_ce6bcc489c22f6f0 = function(arg0) {
1943
- console.info(getObject(arg0));
1944
- };
1945
- imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
1946
- let result;
1947
- try {
1948
- result = getObject(arg0) instanceof ArrayBuffer;
1949
- } catch (_) {
1950
- result = false;
2228
+ }
2229
+ if (type == "function") {
2230
+ const name = val.name;
2231
+ if (typeof name == "string" && name.length > 0) {
2232
+ return `Function(${name})`;
2233
+ } else {
2234
+ return "Function";
1951
2235
  }
1952
- const ret = result;
1953
- return ret;
1954
- };
1955
- imports.wbg.__wbg_instanceof_GpuAdapter_fb230cdccb184887 = function(arg0) {
1956
- let result;
1957
- try {
1958
- result = getObject(arg0) instanceof GPUAdapter;
1959
- } catch (_) {
1960
- result = false;
2236
+ }
2237
+ if (Array.isArray(val)) {
2238
+ const length = val.length;
2239
+ let debug = "[";
2240
+ if (length > 0) {
2241
+ debug += debugString(val[0]);
1961
2242
  }
1962
- const ret = result;
1963
- return ret;
1964
- };
1965
- imports.wbg.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
1966
- let result;
1967
- try {
1968
- result = getObject(arg0) instanceof Map;
1969
- } catch (_) {
1970
- result = false;
2243
+ for (let i = 1; i < length; i++) {
2244
+ debug += ", " + debugString(val[i]);
1971
2245
  }
1972
- const ret = result;
1973
- return ret;
1974
- };
1975
- imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
1976
- let result;
2246
+ debug += "]";
2247
+ return debug;
2248
+ }
2249
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2250
+ let className;
2251
+ if (builtInMatches && builtInMatches.length > 1) {
2252
+ className = builtInMatches[1];
2253
+ } else {
2254
+ return toString.call(val);
2255
+ }
2256
+ if (className == "Object") {
1977
2257
  try {
1978
- result = getObject(arg0) instanceof Uint8Array;
2258
+ return "Object(" + JSON.stringify(val) + ")";
1979
2259
  } catch (_) {
1980
- result = false;
2260
+ return "Object";
1981
2261
  }
1982
- const ret = result;
1983
- return ret;
1984
- };
1985
- imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
1986
- const ret = Array.isArray(getObject(arg0));
1987
- return ret;
1988
- };
1989
- imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
1990
- const ret = Number.isSafeInteger(getObject(arg0));
1991
- return ret;
1992
- };
1993
- imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
1994
- const ret = Symbol.iterator;
1995
- return addHeapObject(ret);
1996
- };
1997
- imports.wbg.__wbg_label_cda985b32d44cee0 = function(arg0, arg1) {
1998
- const ret = getObject(arg1).label;
1999
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2000
- const len1 = WASM_VECTOR_LEN;
2001
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2002
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2003
- };
2004
- imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
2005
- const ret = getObject(arg0).length;
2006
- return ret;
2007
- };
2008
- imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
2009
- const ret = getObject(arg0).length;
2010
- return ret;
2011
- };
2012
- imports.wbg.__wbg_log_1d990106d99dacb7 = function(arg0) {
2013
- console.log(getObject(arg0));
2014
- };
2015
- imports.wbg.__wbg_mapAsync_4a34082bad283ccf = function(arg0, arg1, arg2, arg3) {
2016
- const ret = getObject(arg0).mapAsync(arg1 >>> 0, arg2, arg3);
2017
- return addHeapObject(ret);
2018
- };
2019
- imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
2020
- const ret = getObject(arg0).msCrypto;
2021
- return addHeapObject(ret);
2022
- };
2023
- imports.wbg.__wbg_navigator_11b7299bb7886507 = function(arg0) {
2024
- const ret = getObject(arg0).navigator;
2025
- return addHeapObject(ret);
2026
- };
2027
- imports.wbg.__wbg_navigator_b49edef831236138 = function(arg0) {
2028
- const ret = getObject(arg0).navigator;
2029
- return addHeapObject(ret);
2030
- };
2031
- imports.wbg.__wbg_new_0_23cedd11d9b40c9d = function() {
2032
- const ret = /* @__PURE__ */ new Date();
2033
- return addHeapObject(ret);
2034
- };
2035
- imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
2036
- const ret = new Object();
2037
- return addHeapObject(ret);
2038
- };
2039
- imports.wbg.__wbg_new_25f239778d6112b9 = function() {
2040
- const ret = new Array();
2041
- return addHeapObject(ret);
2042
- };
2043
- imports.wbg.__wbg_new_3c79b3bb1b32b7d3 = function() {
2044
- return handleError(function() {
2045
- const ret = new Headers();
2046
- return addHeapObject(ret);
2047
- }, arguments);
2048
- };
2049
- imports.wbg.__wbg_new_4fe05c96062a8385 = function() {
2050
- return handleError(function() {
2051
- const ret = new XMLHttpRequest();
2052
- return addHeapObject(ret);
2053
- }, arguments);
2054
- };
2055
- imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
2056
- const ret = new Uint8Array(getObject(arg0));
2057
- return addHeapObject(ret);
2058
- };
2059
- imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
2060
- const ret = new Error();
2061
- return addHeapObject(ret);
2062
- };
2063
- imports.wbg.__wbg_new_b546ae120718850e = function() {
2064
- const ret = /* @__PURE__ */ new Map();
2065
- return addHeapObject(ret);
2066
- };
2067
- imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
2262
+ }
2263
+ if (val instanceof Error) {
2264
+ return `${val.name}: ${val.message}
2265
+ ${val.stack}`;
2266
+ }
2267
+ return className;
2268
+ }
2269
+ function dropObject(idx) {
2270
+ if (idx < 1028) return;
2271
+ heap[idx] = heap_next;
2272
+ heap_next = idx;
2273
+ }
2274
+ function getArrayJsValueFromWasm0(ptr, len) {
2275
+ ptr = ptr >>> 0;
2276
+ const mem = getDataViewMemory0();
2277
+ const result = [];
2278
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
2279
+ result.push(takeObject(mem.getUint32(i, true)));
2280
+ }
2281
+ return result;
2282
+ }
2283
+ function getArrayU32FromWasm0(ptr, len) {
2284
+ ptr = ptr >>> 0;
2285
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
2286
+ }
2287
+ function getArrayU8FromWasm0(ptr, len) {
2288
+ ptr = ptr >>> 0;
2289
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2290
+ }
2291
+ var cachedDataViewMemory0 = null;
2292
+ function getDataViewMemory0() {
2293
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
2294
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2295
+ }
2296
+ return cachedDataViewMemory0;
2297
+ }
2298
+ function getStringFromWasm0(ptr, len) {
2299
+ return decodeText(ptr >>> 0, len);
2300
+ }
2301
+ var cachedUint32ArrayMemory0 = null;
2302
+ function getUint32ArrayMemory0() {
2303
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
2304
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
2305
+ }
2306
+ return cachedUint32ArrayMemory0;
2307
+ }
2308
+ var cachedUint8ArrayMemory0 = null;
2309
+ function getUint8ArrayMemory0() {
2310
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2311
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2312
+ }
2313
+ return cachedUint8ArrayMemory0;
2314
+ }
2315
+ function getObject(idx) {
2316
+ return heap[idx];
2317
+ }
2318
+ function handleError(f, args) {
2319
+ try {
2320
+ return f.apply(this, args);
2321
+ } catch (e) {
2322
+ wasm.__wbindgen_export3(addHeapObject(e));
2323
+ }
2324
+ }
2325
+ var heap = new Array(1024).fill(void 0);
2326
+ heap.push(void 0, null, true, false);
2327
+ var heap_next = heap.length;
2328
+ function isLikeNone(x) {
2329
+ return x === void 0 || x === null;
2330
+ }
2331
+ function makeMutClosure(arg0, arg1, f) {
2332
+ const state = { a: arg0, b: arg1, cnt: 1 };
2333
+ const real = (...args) => {
2334
+ state.cnt++;
2335
+ const a = state.a;
2336
+ state.a = 0;
2068
2337
  try {
2069
- var state0 = { a: arg0, b: arg1 };
2070
- var cb0 = (arg02, arg12) => {
2071
- const a = state0.a;
2072
- state0.a = 0;
2073
- try {
2074
- return __wasm_bindgen_func_elem_22595(a, state0.b, arg02, arg12);
2075
- } finally {
2076
- state0.a = a;
2077
- }
2078
- };
2079
- const ret = new Promise(cb0);
2080
- return addHeapObject(ret);
2338
+ return f(a, state.b, ...args);
2081
2339
  } finally {
2082
- state0.a = state0.b = 0;
2340
+ state.a = a;
2341
+ real._wbg_cb_unref();
2083
2342
  }
2084
2343
  };
2085
- imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
2086
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2087
- return addHeapObject(ret);
2088
- };
2089
- imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
2090
- const ret = new Function(getStringFromWasm0(arg0, arg1));
2091
- return addHeapObject(ret);
2092
- };
2093
- imports.wbg.__wbg_new_with_byte_offset_and_length_d85c3da1fd8df149 = function(arg0, arg1, arg2) {
2094
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
2095
- return addHeapObject(ret);
2096
- };
2097
- imports.wbg.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
2098
- const ret = new Uint8Array(arg0 >>> 0);
2099
- return addHeapObject(ret);
2100
- };
2101
- imports.wbg.__wbg_new_with_str_and_init_c5748f76f5108934 = function() {
2102
- return handleError(function(arg0, arg1, arg2) {
2103
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
2104
- return addHeapObject(ret);
2105
- }, arguments);
2106
- };
2107
- imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
2108
- const ret = getObject(arg0).next;
2109
- return addHeapObject(ret);
2110
- };
2111
- imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() {
2112
- return handleError(function(arg0) {
2113
- const ret = getObject(arg0).next();
2114
- return addHeapObject(ret);
2115
- }, arguments);
2116
- };
2117
- imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
2118
- const ret = getObject(arg0).node;
2119
- return addHeapObject(ret);
2120
- };
2121
- imports.wbg.__wbg_now_69d776cd24f5215b = function() {
2122
- const ret = Date.now();
2123
- return ret;
2124
- };
2125
- imports.wbg.__wbg_open_bfb661c1c2740586 = function() {
2126
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
2127
- getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
2128
- }, arguments);
2129
- };
2130
- imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
2131
- const ret = getObject(arg0).process;
2132
- return addHeapObject(ret);
2133
- };
2134
- imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
2135
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2136
- };
2137
- imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
2138
- const ret = getObject(arg0).push(getObject(arg1));
2139
- return ret;
2140
- };
2141
- imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
2142
- const ret = getObject(arg0).queueMicrotask;
2143
- return addHeapObject(ret);
2144
- };
2145
- imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
2146
- queueMicrotask(getObject(arg0));
2147
- };
2148
- imports.wbg.__wbg_queue_39d4f3bda761adef = function(arg0) {
2149
- const ret = getObject(arg0).queue;
2150
- return addHeapObject(ret);
2151
- };
2152
- imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() {
2153
- return handleError(function(arg0, arg1) {
2154
- getObject(arg0).randomFillSync(takeObject(arg1));
2155
- }, arguments);
2156
- };
2157
- imports.wbg.__wbg_requestAdapter_55d15e6d14e8392c = function(arg0, arg1) {
2158
- const ret = getObject(arg0).requestAdapter(getObject(arg1));
2159
- return addHeapObject(ret);
2160
- };
2161
- imports.wbg.__wbg_requestDevice_66e864eaf1ffbb38 = function(arg0, arg1) {
2162
- const ret = getObject(arg0).requestDevice(getObject(arg1));
2163
- return addHeapObject(ret);
2164
- };
2165
- imports.wbg.__wbg_require_60cc747a6bc5215a = function() {
2166
- return handleError(function() {
2167
- const ret = module.require;
2168
- return addHeapObject(ret);
2169
- }, arguments);
2170
- };
2171
- imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
2172
- const ret = Promise.resolve(getObject(arg0));
2173
- return addHeapObject(ret);
2174
- };
2175
- imports.wbg.__wbg_responseText_7a33f62863958740 = function() {
2176
- return handleError(function(arg0, arg1) {
2177
- const ret = getObject(arg1).responseText;
2178
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2179
- var len1 = WASM_VECTOR_LEN;
2180
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2181
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2182
- }, arguments);
2183
- };
2184
- imports.wbg.__wbg_response_19d1d96c8fc76878 = function() {
2185
- return handleError(function(arg0) {
2186
- const ret = getObject(arg0).response;
2187
- return addHeapObject(ret);
2188
- }, arguments);
2189
- };
2190
- imports.wbg.__wbg_send_3accfe4b9b207011 = function() {
2191
- return handleError(function(arg0) {
2192
- getObject(arg0).send();
2193
- }, arguments);
2194
- };
2195
- imports.wbg.__wbg_setBindGroup_250647fe6341e1db = function() {
2196
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
2197
- getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
2198
- }, arguments);
2199
- };
2200
- imports.wbg.__wbg_setBindGroup_92f5fbfaea0311a0 = function(arg0, arg1, arg2) {
2201
- getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
2202
- };
2203
- imports.wbg.__wbg_setPipeline_95448e1c3bb1e875 = function(arg0, arg1) {
2204
- getObject(arg0).setPipeline(getObject(arg1));
2205
- };
2206
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
2207
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2208
- };
2209
- imports.wbg.__wbg_set_425eb8b710d5beee = function() {
2210
- return handleError(function(arg0, arg1, arg2, arg3, arg4) {
2211
- getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2212
- }, arguments);
2213
- };
2214
- imports.wbg.__wbg_set_781438a03c0c3c81 = function() {
2215
- return handleError(function(arg0, arg1, arg2) {
2216
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2217
- return ret;
2218
- }, arguments);
2219
- };
2220
- imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
2221
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2222
- };
2223
- imports.wbg.__wbg_set_access_c87a9bdb5c449e6b = function(arg0, arg1) {
2224
- getObject(arg0).access = __wbindgen_enum_GpuStorageTextureAccess[arg1];
2225
- };
2226
- imports.wbg.__wbg_set_array_layer_count_3a8ad1adab3aded1 = function(arg0, arg1) {
2227
- getObject(arg0).arrayLayerCount = arg1 >>> 0;
2228
- };
2229
- imports.wbg.__wbg_set_aspect_4066a62e6528c589 = function(arg0, arg1) {
2230
- getObject(arg0).aspect = __wbindgen_enum_GpuTextureAspect[arg1];
2231
- };
2232
- imports.wbg.__wbg_set_base_array_layer_85c4780859e3e025 = function(arg0, arg1) {
2233
- getObject(arg0).baseArrayLayer = arg1 >>> 0;
2234
- };
2235
- imports.wbg.__wbg_set_base_mip_level_f90525112a282a1d = function(arg0, arg1) {
2236
- getObject(arg0).baseMipLevel = arg1 >>> 0;
2237
- };
2238
- imports.wbg.__wbg_set_bc3a432bdcd60886 = function(arg0, arg1, arg2) {
2239
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
2240
- };
2241
- imports.wbg.__wbg_set_beginning_of_pass_write_index_1175eec9e005d722 = function(arg0, arg1) {
2242
- getObject(arg0).beginningOfPassWriteIndex = arg1 >>> 0;
2243
- };
2244
- imports.wbg.__wbg_set_bind_group_layouts_54f980eb55071c87 = function(arg0, arg1) {
2245
- getObject(arg0).bindGroupLayouts = getObject(arg1);
2246
- };
2247
- imports.wbg.__wbg_set_binding_1ddbf5eebabdc48c = function(arg0, arg1) {
2248
- getObject(arg0).binding = arg1 >>> 0;
2249
- };
2250
- imports.wbg.__wbg_set_binding_5ea4d52c77434dfa = function(arg0, arg1) {
2251
- getObject(arg0).binding = arg1 >>> 0;
2252
- };
2253
- imports.wbg.__wbg_set_body_8e743242d6076a4f = function(arg0, arg1) {
2254
- getObject(arg0).body = getObject(arg1);
2255
- };
2256
- imports.wbg.__wbg_set_buffer_2dac3e64a7099038 = function(arg0, arg1) {
2257
- getObject(arg0).buffer = getObject(arg1);
2258
- };
2259
- imports.wbg.__wbg_set_buffer_489d923366e1f63a = function(arg0, arg1) {
2260
- getObject(arg0).buffer = getObject(arg1);
2261
- };
2262
- imports.wbg.__wbg_set_buffer_a3a7f00fa797e1d1 = function(arg0, arg1) {
2263
- getObject(arg0).buffer = getObject(arg1);
2264
- };
2265
- imports.wbg.__wbg_set_bytes_per_row_61fdc31fb1e978f4 = function(arg0, arg1) {
2266
- getObject(arg0).bytesPerRow = arg1 >>> 0;
2267
- };
2268
- imports.wbg.__wbg_set_bytes_per_row_7eb4ea50ad336975 = function(arg0, arg1) {
2269
- getObject(arg0).bytesPerRow = arg1 >>> 0;
2270
- };
2271
- imports.wbg.__wbg_set_code_e66de35c80aa100f = function(arg0, arg1, arg2) {
2272
- getObject(arg0).code = getStringFromWasm0(arg1, arg2);
2273
- };
2274
- imports.wbg.__wbg_set_compute_7e84d836a17ec8dc = function(arg0, arg1) {
2275
- getObject(arg0).compute = getObject(arg1);
2276
- };
2277
- imports.wbg.__wbg_set_depth_or_array_layers_57e35a31ded46b97 = function(arg0, arg1) {
2278
- getObject(arg0).depthOrArrayLayers = arg1 >>> 0;
2279
- };
2280
- imports.wbg.__wbg_set_dimension_1e40af745768ac00 = function(arg0, arg1) {
2281
- getObject(arg0).dimension = __wbindgen_enum_GpuTextureDimension[arg1];
2282
- };
2283
- imports.wbg.__wbg_set_dimension_8523a7df804e7839 = function(arg0, arg1) {
2284
- getObject(arg0).dimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2285
- };
2286
- imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
2287
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2288
- return addHeapObject(ret);
2289
- };
2290
- imports.wbg.__wbg_set_end_of_pass_write_index_c9e77fba223f5e64 = function(arg0, arg1) {
2291
- getObject(arg0).endOfPassWriteIndex = arg1 >>> 0;
2292
- };
2293
- imports.wbg.__wbg_set_entries_5ebe60dce5e74a0b = function(arg0, arg1) {
2294
- getObject(arg0).entries = getObject(arg1);
2295
- };
2296
- imports.wbg.__wbg_set_entries_9e330e1730f04662 = function(arg0, arg1) {
2297
- getObject(arg0).entries = getObject(arg1);
2298
- };
2299
- imports.wbg.__wbg_set_entry_point_0dd252068a92e7b1 = function(arg0, arg1, arg2) {
2300
- getObject(arg0).entryPoint = getStringFromWasm0(arg1, arg2);
2301
- };
2302
- imports.wbg.__wbg_set_external_texture_c45a65eda8f1c7e7 = function(arg0, arg1) {
2303
- getObject(arg0).externalTexture = getObject(arg1);
2304
- };
2305
- imports.wbg.__wbg_set_format_071b082598e71ae2 = function(arg0, arg1) {
2306
- getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
2307
- };
2308
- imports.wbg.__wbg_set_format_45c59d08eefdcb12 = function(arg0, arg1) {
2309
- getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
2310
- };
2311
- imports.wbg.__wbg_set_format_726ed8f81a287fdc = function(arg0, arg1) {
2312
- getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
2313
- };
2314
- imports.wbg.__wbg_set_has_dynamic_offset_dcbae080558be467 = function(arg0, arg1) {
2315
- getObject(arg0).hasDynamicOffset = arg1 !== 0;
2316
- };
2317
- imports.wbg.__wbg_set_headers_5671cf088e114d2b = function(arg0, arg1) {
2318
- getObject(arg0).headers = getObject(arg1);
2319
- };
2320
- imports.wbg.__wbg_set_height_28e79506f626af82 = function(arg0, arg1) {
2321
- getObject(arg0).height = arg1 >>> 0;
2322
- };
2323
- imports.wbg.__wbg_set_label_03ef288b104476b5 = function(arg0, arg1, arg2) {
2324
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2325
- };
2326
- imports.wbg.__wbg_set_label_1183ccaccddf4c32 = function(arg0, arg1, arg2) {
2327
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2328
- };
2329
- imports.wbg.__wbg_set_label_3d8a20f328073061 = function(arg0, arg1, arg2) {
2330
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2331
- };
2332
- imports.wbg.__wbg_set_label_491466139034563c = function(arg0, arg1, arg2) {
2333
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2334
- };
2335
- imports.wbg.__wbg_set_label_53b47ffdebccf638 = function(arg0, arg1, arg2) {
2336
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2337
- };
2338
- imports.wbg.__wbg_set_label_7ffda3ed69c72b85 = function(arg0, arg1, arg2) {
2339
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2340
- };
2341
- imports.wbg.__wbg_set_label_828e6fe16c83ad61 = function(arg0, arg1, arg2) {
2342
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2343
- };
2344
- imports.wbg.__wbg_set_label_95bae3d54f33d3c6 = function(arg0, arg1, arg2) {
2345
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2346
- };
2347
- imports.wbg.__wbg_set_label_a1c8caea9f6c17d7 = function(arg0, arg1, arg2) {
2348
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2349
- };
2350
- imports.wbg.__wbg_set_label_a3e682ef8c10c947 = function(arg0, arg1, arg2) {
2351
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2352
- };
2353
- imports.wbg.__wbg_set_label_c880c612e67bf9d9 = function(arg0, arg1, arg2) {
2354
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2355
- };
2356
- imports.wbg.__wbg_set_label_eb73d9dd282c005a = function(arg0, arg1, arg2) {
2357
- getObject(arg0).label = getStringFromWasm0(arg1, arg2);
2358
- };
2359
- imports.wbg.__wbg_set_layout_934f9127172b906e = function(arg0, arg1) {
2360
- getObject(arg0).layout = getObject(arg1);
2361
- };
2362
- imports.wbg.__wbg_set_layout_a9aebce493b15bfb = function(arg0, arg1) {
2363
- getObject(arg0).layout = getObject(arg1);
2364
- };
2365
- imports.wbg.__wbg_set_mapped_at_creation_37dd8bbd1a910924 = function(arg0, arg1) {
2366
- getObject(arg0).mappedAtCreation = arg1 !== 0;
2367
- };
2368
- imports.wbg.__wbg_set_method_76c69e41b3570627 = function(arg0, arg1, arg2) {
2369
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
2370
- };
2371
- imports.wbg.__wbg_set_min_binding_size_f7d3351b78c71fbc = function(arg0, arg1) {
2372
- getObject(arg0).minBindingSize = arg1;
2373
- };
2374
- imports.wbg.__wbg_set_mip_level_4adfe9f0872d052d = function(arg0, arg1) {
2375
- getObject(arg0).mipLevel = arg1 >>> 0;
2376
- };
2377
- imports.wbg.__wbg_set_mip_level_count_3368440f1c3c34b9 = function(arg0, arg1) {
2378
- getObject(arg0).mipLevelCount = arg1 >>> 0;
2379
- };
2380
- imports.wbg.__wbg_set_mip_level_count_9de96fe0db85420d = function(arg0, arg1) {
2381
- getObject(arg0).mipLevelCount = arg1 >>> 0;
2382
- };
2383
- imports.wbg.__wbg_set_module_0700e7e0b7b4f128 = function(arg0, arg1) {
2384
- getObject(arg0).module = getObject(arg1);
2385
- };
2386
- imports.wbg.__wbg_set_multisampled_dc1cdd807d0170e1 = function(arg0, arg1) {
2387
- getObject(arg0).multisampled = arg1 !== 0;
2388
- };
2389
- imports.wbg.__wbg_set_offset_49dfc93674b6347b = function(arg0, arg1) {
2390
- getObject(arg0).offset = arg1;
2391
- };
2392
- imports.wbg.__wbg_set_offset_51eb43b37f1e9525 = function(arg0, arg1) {
2393
- getObject(arg0).offset = arg1;
2394
- };
2395
- imports.wbg.__wbg_set_offset_a90a41961b1df9b4 = function(arg0, arg1) {
2396
- getObject(arg0).offset = arg1;
2397
- };
2398
- imports.wbg.__wbg_set_origin_154a83d3703121d7 = function(arg0, arg1) {
2399
- getObject(arg0).origin = getObject(arg1);
2400
- };
2401
- imports.wbg.__wbg_set_power_preference_229fffedb859fda8 = function(arg0, arg1) {
2402
- getObject(arg0).powerPreference = __wbindgen_enum_GpuPowerPreference[arg1];
2403
- };
2404
- imports.wbg.__wbg_set_query_set_5d767886356c7b79 = function(arg0, arg1) {
2405
- getObject(arg0).querySet = getObject(arg1);
2406
- };
2407
- imports.wbg.__wbg_set_required_features_8135f6ab89e06b58 = function(arg0, arg1) {
2408
- getObject(arg0).requiredFeatures = getObject(arg1);
2409
- };
2410
- imports.wbg.__wbg_set_resource_97233a9ead07e4bc = function(arg0, arg1) {
2411
- getObject(arg0).resource = getObject(arg1);
2412
- };
2413
- imports.wbg.__wbg_set_responseType_df7a5fa93f0dd4be = function(arg0, arg1) {
2414
- getObject(arg0).responseType = __wbindgen_enum_XmlHttpRequestResponseType[arg1];
2415
- };
2416
- imports.wbg.__wbg_set_rows_per_image_b2e56467282d270a = function(arg0, arg1) {
2417
- getObject(arg0).rowsPerImage = arg1 >>> 0;
2418
- };
2419
- imports.wbg.__wbg_set_rows_per_image_ca194ae8c040a0d0 = function(arg0, arg1) {
2420
- getObject(arg0).rowsPerImage = arg1 >>> 0;
2421
- };
2422
- imports.wbg.__wbg_set_sample_count_df26d31cf04a57d8 = function(arg0, arg1) {
2423
- getObject(arg0).sampleCount = arg1 >>> 0;
2424
- };
2425
- imports.wbg.__wbg_set_sample_type_5671a405c6474494 = function(arg0, arg1) {
2426
- getObject(arg0).sampleType = __wbindgen_enum_GpuTextureSampleType[arg1];
2427
- };
2428
- imports.wbg.__wbg_set_sampler_43a3dd77c3b0a5ba = function(arg0, arg1) {
2429
- getObject(arg0).sampler = getObject(arg1);
2430
- };
2431
- imports.wbg.__wbg_set_size_1a3d1e3a2e547ec1 = function(arg0, arg1) {
2432
- getObject(arg0).size = getObject(arg1);
2433
- };
2434
- imports.wbg.__wbg_set_size_a45dd219534f95ed = function(arg0, arg1) {
2435
- getObject(arg0).size = arg1;
2436
- };
2437
- imports.wbg.__wbg_set_size_e0576eacd9f11fed = function(arg0, arg1) {
2438
- getObject(arg0).size = arg1;
2439
- };
2440
- imports.wbg.__wbg_set_storage_texture_4853479f6eb61a57 = function(arg0, arg1) {
2441
- getObject(arg0).storageTexture = getObject(arg1);
2442
- };
2443
- imports.wbg.__wbg_set_texture_5f219a723eb7db43 = function(arg0, arg1) {
2444
- getObject(arg0).texture = getObject(arg1);
2445
- };
2446
- imports.wbg.__wbg_set_texture_84c4ac5434a9ddb5 = function(arg0, arg1) {
2447
- getObject(arg0).texture = getObject(arg1);
2448
- };
2449
- imports.wbg.__wbg_set_timestamp_writes_db44391e390948e2 = function(arg0, arg1) {
2450
- getObject(arg0).timestampWrites = getObject(arg1);
2451
- };
2452
- imports.wbg.__wbg_set_type_0a9fcee42b714ba8 = function(arg0, arg1) {
2453
- getObject(arg0).type = __wbindgen_enum_GpuBufferBindingType[arg1];
2454
- };
2455
- imports.wbg.__wbg_set_type_ba111b7f1813a222 = function(arg0, arg1) {
2456
- getObject(arg0).type = __wbindgen_enum_GpuSamplerBindingType[arg1];
2457
- };
2458
- imports.wbg.__wbg_set_usage_0f3970011718ab12 = function(arg0, arg1) {
2459
- getObject(arg0).usage = arg1 >>> 0;
2460
- };
2461
- imports.wbg.__wbg_set_usage_49bed7c9b47e7849 = function(arg0, arg1) {
2462
- getObject(arg0).usage = arg1 >>> 0;
2463
- };
2464
- imports.wbg.__wbg_set_usage_8a5ac4564d826d9d = function(arg0, arg1) {
2465
- getObject(arg0).usage = arg1 >>> 0;
2466
- };
2467
- imports.wbg.__wbg_set_view_dimension_2e3a58d96671f97a = function(arg0, arg1) {
2468
- getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2469
- };
2470
- imports.wbg.__wbg_set_view_dimension_88c1a47ce71f7839 = function(arg0, arg1) {
2471
- getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2472
- };
2473
- imports.wbg.__wbg_set_view_formats_dbd4d0d50ed403ff = function(arg0, arg1) {
2474
- getObject(arg0).viewFormats = getObject(arg1);
2475
- };
2476
- imports.wbg.__wbg_set_visibility_f4f66940005e5c39 = function(arg0, arg1) {
2477
- getObject(arg0).visibility = arg1 >>> 0;
2478
- };
2479
- imports.wbg.__wbg_set_width_64c5783b064042bc = function(arg0, arg1) {
2480
- getObject(arg0).width = arg1 >>> 0;
2481
- };
2482
- imports.wbg.__wbg_set_x_d5236bf9391eb053 = function(arg0, arg1) {
2483
- getObject(arg0).x = arg1 >>> 0;
2484
- };
2485
- imports.wbg.__wbg_set_y_413262ade3cc0d56 = function(arg0, arg1) {
2486
- getObject(arg0).y = arg1 >>> 0;
2487
- };
2488
- imports.wbg.__wbg_set_z_a136ba9bd16085f0 = function(arg0, arg1) {
2489
- getObject(arg0).z = arg1 >>> 0;
2490
- };
2491
- imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2492
- const ret = getObject(arg1).stack;
2493
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2494
- const len1 = WASM_VECTOR_LEN;
2495
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2496
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2497
- };
2498
- imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
2499
- const ret = typeof global === "undefined" ? null : global;
2500
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2501
- };
2502
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
2503
- const ret = typeof globalThis === "undefined" ? null : globalThis;
2504
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2505
- };
2506
- imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
2507
- const ret = typeof self === "undefined" ? null : self;
2508
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2509
- };
2510
- imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
2511
- const ret = typeof window === "undefined" ? null : window;
2512
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2513
- };
2514
- imports.wbg.__wbg_status_c547ab1614ba835e = function() {
2515
- return handleError(function(arg0) {
2516
- const ret = getObject(arg0).status;
2517
- return ret;
2518
- }, arguments);
2519
- };
2520
- imports.wbg.__wbg_subarray_845f2f5bce7d061a = function(arg0, arg1, arg2) {
2521
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2522
- return addHeapObject(ret);
2523
- };
2524
- imports.wbg.__wbg_submit_068b03683463d934 = function(arg0, arg1) {
2525
- getObject(arg0).submit(getObject(arg1));
2526
- };
2527
- imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
2528
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2529
- return addHeapObject(ret);
2530
- };
2531
- imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
2532
- const ret = getObject(arg0).then(getObject(arg1));
2533
- return addHeapObject(ret);
2534
- };
2535
- imports.wbg.__wbg_toISOString_eca15cbe422eeea5 = function(arg0) {
2536
- const ret = getObject(arg0).toISOString();
2537
- return addHeapObject(ret);
2538
- };
2539
- imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
2540
- const ret = getObject(arg0).value;
2541
- return addHeapObject(ret);
2542
- };
2543
- imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
2544
- const ret = getObject(arg0).versions;
2545
- return addHeapObject(ret);
2546
- };
2547
- imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
2548
- console.warn(getObject(arg0));
2549
- };
2550
- imports.wbg.__wbg_writeBuffer_b479dd5b90cd43eb = function() {
2551
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) {
2552
- getObject(arg0).writeBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
2553
- }, arguments);
2554
- };
2555
- imports.wbg.__wbg_writeTexture_c70826cc2ae8e127 = function() {
2556
- return handleError(function(arg0, arg1, arg2, arg3, arg4) {
2557
- getObject(arg0).writeTexture(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2558
- }, arguments);
2559
- };
2560
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
2561
- const ret = getStringFromWasm0(arg0, arg1);
2562
- return addHeapObject(ret);
2563
- };
2564
- imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
2565
- const ret = BigInt.asUintN(64, arg0);
2566
- return addHeapObject(ret);
2567
- };
2568
- imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
2569
- var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
2570
- wasm.__wbindgen_export4(arg0, arg1 * 1, 1);
2571
- const ret = v0;
2572
- return addHeapObject(ret);
2573
- };
2574
- imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
2575
- const ret = arg0;
2576
- return addHeapObject(ret);
2577
- };
2578
- imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
2579
- const ret = getArrayU8FromWasm0(arg0, arg1);
2580
- return addHeapObject(ret);
2581
- };
2582
- imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
2583
- const ret = arg0;
2584
- return addHeapObject(ret);
2585
- };
2586
- imports.wbg.__wbindgen_cast_e9aaf3c74dd8443a = function(arg0, arg1) {
2587
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4179, __wasm_bindgen_func_elem_4195);
2588
- return addHeapObject(ret);
2589
- };
2590
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2591
- const ret = getObject(arg0);
2592
- return addHeapObject(ret);
2344
+ real._wbg_cb_unref = () => {
2345
+ if (--state.cnt === 0) {
2346
+ wasm.__wbindgen_export5(state.a, state.b);
2347
+ state.a = 0;
2348
+ CLOSURE_DTORS.unregister(state);
2349
+ }
2593
2350
  };
2594
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2595
- takeObject(arg0);
2351
+ CLOSURE_DTORS.register(real, state, state);
2352
+ return real;
2353
+ }
2354
+ function passArray8ToWasm0(arg, malloc) {
2355
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
2356
+ getUint8ArrayMemory0().set(arg, ptr / 1);
2357
+ WASM_VECTOR_LEN = arg.length;
2358
+ return ptr;
2359
+ }
2360
+ function passArrayJsValueToWasm0(array, malloc) {
2361
+ const ptr = malloc(array.length * 4, 4) >>> 0;
2362
+ const mem = getDataViewMemory0();
2363
+ for (let i = 0; i < array.length; i++) {
2364
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
2365
+ }
2366
+ WASM_VECTOR_LEN = array.length;
2367
+ return ptr;
2368
+ }
2369
+ function passStringToWasm0(arg, malloc, realloc) {
2370
+ if (realloc === void 0) {
2371
+ const buf = cachedTextEncoder.encode(arg);
2372
+ const ptr2 = malloc(buf.length, 1) >>> 0;
2373
+ getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
2374
+ WASM_VECTOR_LEN = buf.length;
2375
+ return ptr2;
2376
+ }
2377
+ let len = arg.length;
2378
+ let ptr = malloc(len, 1) >>> 0;
2379
+ const mem = getUint8ArrayMemory0();
2380
+ let offset = 0;
2381
+ for (; offset < len; offset++) {
2382
+ const code = arg.charCodeAt(offset);
2383
+ if (code > 127) break;
2384
+ mem[ptr + offset] = code;
2385
+ }
2386
+ if (offset !== len) {
2387
+ if (offset !== 0) {
2388
+ arg = arg.slice(offset);
2389
+ }
2390
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2391
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2392
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2393
+ offset += ret.written;
2394
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2395
+ }
2396
+ WASM_VECTOR_LEN = offset;
2397
+ return ptr;
2398
+ }
2399
+ function takeObject(idx) {
2400
+ const ret = getObject(idx);
2401
+ dropObject(idx);
2402
+ return ret;
2403
+ }
2404
+ var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
2405
+ cachedTextDecoder.decode();
2406
+ var MAX_SAFARI_DECODE_BYTES = 2146435072;
2407
+ var numBytesDecoded = 0;
2408
+ function decodeText(ptr, len) {
2409
+ numBytesDecoded += len;
2410
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
2411
+ cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
2412
+ cachedTextDecoder.decode();
2413
+ numBytesDecoded = len;
2414
+ }
2415
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2416
+ }
2417
+ var cachedTextEncoder = new TextEncoder();
2418
+ if (!("encodeInto" in cachedTextEncoder)) {
2419
+ cachedTextEncoder.encodeInto = function(arg, view) {
2420
+ const buf = cachedTextEncoder.encode(arg);
2421
+ view.set(buf);
2422
+ return {
2423
+ read: arg.length,
2424
+ written: buf.length
2425
+ };
2596
2426
  };
2597
- return imports;
2598
2427
  }
2428
+ var WASM_VECTOR_LEN = 0;
2429
+ var wasmModule;
2430
+ var wasmInstance;
2431
+ var wasm;
2599
2432
  function __wbg_finalize_init(instance, module2) {
2433
+ wasmInstance = instance;
2600
2434
  wasm = instance.exports;
2601
- __wbg_init.__wbindgen_wasm_module = module2;
2435
+ wasmModule = module2;
2602
2436
  cachedDataViewMemory0 = null;
2603
2437
  cachedUint32ArrayMemory0 = null;
2604
2438
  cachedUint8ArrayMemory0 = null;
2605
2439
  return wasm;
2606
2440
  }
2441
+ async function __wbg_load(module2, imports) {
2442
+ if (typeof Response === "function" && module2 instanceof Response) {
2443
+ if (typeof WebAssembly.instantiateStreaming === "function") {
2444
+ try {
2445
+ return await WebAssembly.instantiateStreaming(module2, imports);
2446
+ } catch (e) {
2447
+ const validResponse = module2.ok && expectedResponseType(module2.type);
2448
+ if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
2449
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
2450
+ } else {
2451
+ throw e;
2452
+ }
2453
+ }
2454
+ }
2455
+ const bytes = await module2.arrayBuffer();
2456
+ return await WebAssembly.instantiate(bytes, imports);
2457
+ } else {
2458
+ const instance = await WebAssembly.instantiate(module2, imports);
2459
+ if (instance instanceof WebAssembly.Instance) {
2460
+ return { instance, module: module2 };
2461
+ } else {
2462
+ return instance;
2463
+ }
2464
+ }
2465
+ function expectedResponseType(type) {
2466
+ switch (type) {
2467
+ case "basic":
2468
+ case "cors":
2469
+ case "default":
2470
+ return true;
2471
+ }
2472
+ return false;
2473
+ }
2474
+ }
2607
2475
  async function __wbg_init(module_or_path) {
2608
2476
  if (wasm !== void 0) return wasm;
2609
- if (typeof module_or_path !== "undefined") {
2477
+ if (module_or_path !== void 0) {
2610
2478
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2611
2479
  ({ module_or_path } = module_or_path);
2612
2480
  } else {
2613
2481
  console.warn("using deprecated parameters for the initialization function; pass a single object instead");
2614
2482
  }
2615
2483
  }
2616
- if (typeof module_or_path === "undefined") {
2484
+ if (module_or_path === void 0) {
2617
2485
  module_or_path = new URL("udoc_bg.wasm", "about:blank");
2618
2486
  }
2619
2487
  const imports = __wbg_get_imports();
@@ -2623,7 +2491,6 @@ ${val.stack}`;
2623
2491
  const { instance, module: module2 } = await __wbg_load(await module_or_path, imports);
2624
2492
  return __wbg_finalize_init(instance, module2);
2625
2493
  }
2626
- var udoc_default = __wbg_init;
2627
2494
 
2628
2495
  // dist/src/worker/worker.js
2629
2496
  var wasm2 = null;
@@ -2652,7 +2519,7 @@ ${val.stack}`;
2652
2519
  try {
2653
2520
  switch (request.type) {
2654
2521
  case "init": {
2655
- const exports = await udoc_default(request.wasmUrl ? { module_or_path: request.wasmUrl } : void 0);
2522
+ const exports = await __wbg_init(request.wasmUrl ? { module_or_path: request.wasmUrl } : void 0);
2656
2523
  wasmMemory = exports.memory ?? null;
2657
2524
  wasm2 = new Wasm(request.domain, request.viewerVersion);
2658
2525
  if (request.gpu) {
@@ -2691,7 +2558,7 @@ ${val.stack}`;
2691
2558
  }
2692
2559
  case "load": {
2693
2560
  ensureInitialized();
2694
- const documentId = wasm2.load(request.bytes);
2561
+ const documentId = await wasm2.load(request.bytes);
2695
2562
  respond({ type: "load", success: true, documentId });
2696
2563
  break;
2697
2564
  }
@@ -2701,33 +2568,36 @@ ${val.stack}`;
2701
2568
  respond({ type: "getDocumentFormat", success: true, format });
2702
2569
  break;
2703
2570
  }
2571
+ // The format-specific load entry points all route through the single
2572
+ // permit-gated async `load` (format is auto-detected in WASM); there
2573
+ // is intentionally no ungated open path.
2704
2574
  case "loadPdf": {
2705
2575
  ensureInitialized();
2706
- const documentId = wasm2.load_pdf(request.bytes);
2576
+ const documentId = await wasm2.load(request.bytes);
2707
2577
  respond({ type: "loadPdf", success: true, documentId });
2708
2578
  break;
2709
2579
  }
2710
2580
  case "loadImage": {
2711
2581
  ensureInitialized();
2712
- const documentId = wasm2.load_image(request.bytes);
2582
+ const documentId = await wasm2.load(request.bytes);
2713
2583
  respond({ type: "loadImage", success: true, documentId });
2714
2584
  break;
2715
2585
  }
2716
2586
  case "loadPptx": {
2717
2587
  ensureInitialized();
2718
- const documentId = wasm2.load_pptx(request.bytes);
2588
+ const documentId = await wasm2.load(request.bytes);
2719
2589
  respond({ type: "loadPptx", success: true, documentId });
2720
2590
  break;
2721
2591
  }
2722
2592
  case "loadDocx": {
2723
2593
  ensureInitialized();
2724
- const documentId = wasm2.load_docx(request.bytes);
2594
+ const documentId = await wasm2.load(request.bytes);
2725
2595
  respond({ type: "loadDocx", success: true, documentId });
2726
2596
  break;
2727
2597
  }
2728
2598
  case "loadXlsx": {
2729
2599
  ensureInitialized();
2730
- const documentId = wasm2.load_xlsx(request.bytes);
2600
+ const documentId = await wasm2.load(request.bytes);
2731
2601
  respond({ type: "loadXlsx", success: true, documentId });
2732
2602
  break;
2733
2603
  }