@docmentis/udoc-viewer 0.6.42 → 0.6.43

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