@docmentis/udoc-viewer 0.6.42 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +39 -5
  2. package/dist/package.json +1 -1
  3. package/dist/src/UDocClient.d.ts.map +1 -1
  4. package/dist/src/UDocClient.js +4 -4
  5. package/dist/src/UDocClient.js.map +1 -1
  6. package/dist/src/UDocViewer.d.ts +11 -4
  7. package/dist/src/UDocViewer.d.ts.map +1 -1
  8. package/dist/src/UDocViewer.js +24 -4
  9. package/dist/src/UDocViewer.js.map +1 -1
  10. package/dist/src/index.d.ts +1 -1
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/ui/viewer/actions.d.ts +4 -1
  13. package/dist/src/ui/viewer/actions.d.ts.map +1 -1
  14. package/dist/src/ui/viewer/components/LeftPanel.d.ts.map +1 -1
  15. package/dist/src/ui/viewer/components/LeftPanel.js +16 -11
  16. package/dist/src/ui/viewer/components/LeftPanel.js.map +1 -1
  17. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts +25 -0
  18. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts.map +1 -0
  19. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js +77 -0
  20. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js.map +1 -0
  21. package/dist/src/ui/viewer/components/Toolbar.d.ts.map +1 -1
  22. package/dist/src/ui/viewer/components/Toolbar.js +3 -4
  23. package/dist/src/ui/viewer/components/Toolbar.js.map +1 -1
  24. package/dist/src/ui/viewer/reducer.d.ts.map +1 -1
  25. package/dist/src/ui/viewer/reducer.js +4 -0
  26. package/dist/src/ui/viewer/reducer.js.map +1 -1
  27. package/dist/src/ui/viewer/shell.d.ts.map +1 -1
  28. package/dist/src/ui/viewer/shell.js +5 -0
  29. package/dist/src/ui/viewer/shell.js.map +1 -1
  30. package/dist/src/ui/viewer/state.d.ts +11 -0
  31. package/dist/src/ui/viewer/state.d.ts.map +1 -1
  32. package/dist/src/ui/viewer/state.js +12 -2
  33. package/dist/src/ui/viewer/state.js.map +1 -1
  34. package/dist/src/ui/viewer/styles-inline.d.ts +1 -1
  35. package/dist/src/ui/viewer/styles-inline.d.ts.map +1 -1
  36. package/dist/src/ui/viewer/styles-inline.js +53 -1
  37. package/dist/src/ui/viewer/styles-inline.js.map +1 -1
  38. package/dist/src/wasm/udoc.d.ts +849 -894
  39. package/dist/src/wasm/udoc.js +1887 -2018
  40. package/dist/src/wasm/udoc_bg.wasm +0 -0
  41. package/dist/src/wasm/udoc_bg.wasm.d.ts +5 -9
  42. package/dist/src/worker/worker-inline.js +1 -1
  43. package/dist/src/worker/worker.js +1909 -2039
  44. package/dist/src/worker/worker.js.map +1 -1
  45. package/package.json +1 -1
@@ -1,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);
212
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
213
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
409
214
  return v2;
410
215
  } finally {
411
216
  wasm.__wbindgen_add_to_stack_pointer(16);
412
217
  }
413
218
  }
414
219
  /**
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.
220
+ * Get font usage information for a document.
431
221
  *
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);
453
- return v2;
454
- } finally {
455
- wasm.__wbindgen_add_to_stack_pointer(16);
456
- }
457
- }
458
- /**
459
- * Compose new PDF documents by cherry-picking pages from source documents.
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.
460
225
  *
461
- * The original documents remain unchanged.
226
+ * This information is populated during layout — call after rendering at
227
+ * least one page to get results.
462
228
  *
463
229
  * # 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)
468
- *
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
- * ```
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,168 +400,196 @@ export class Wasm {
693
400
  }
694
401
  }
695
402
  /**
696
- * Get current license status.
697
- * @returns {LicenseResult}
403
+ * Check if a document with the given ID exists.
404
+ * @param {string} id
405
+ * @returns {boolean}
698
406
  */
699
- license_status() {
700
- const ret = wasm.wasm_license_status(this.__wbg_ptr);
701
- return takeObject(ret);
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;
702
412
  }
703
413
  /**
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.
708
- * @param {string} id
414
+ * Check if a feature is enabled by the current license.
415
+ * @param {string} feature
709
416
  * @returns {boolean}
710
417
  */
711
- needs_password(id) {
712
- try {
713
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
714
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
715
- const len0 = WASM_VECTOR_LEN;
716
- wasm.wasm_needs_password(retptr, this.__wbg_ptr, ptr0, len0);
717
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
718
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
719
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
720
- if (r2) {
721
- throw takeObject(r1);
722
- }
723
- return r0 !== 0;
724
- } finally {
725
- wasm.__wbindgen_add_to_stack_pointer(16);
726
- }
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;
727
423
  }
728
424
  /**
729
- * Decompress a PDF document.
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).
730
434
  *
731
- * Removes all filter encodings from streams, resulting in raw,
732
- * uncompressed stream data. Useful for debugging or inspection.
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
733
460
  *
734
461
  * # Arguments
735
- * * `doc_id` - Document ID to decompress
462
+ * * `bytes` - Raw file data
736
463
  *
737
464
  * # Returns
738
- * Decompressed PDF data as Uint8Array
739
- * @param {string} doc_id
740
- * @returns {Uint8Array}
465
+ * A unique document ID that can be used to reference this document.
466
+ *
467
+ * # Permit enforcement
468
+ * This is the single, gated document-open entry point. For
469
+ * free/unlicensed usage it requires a valid server-signed permit (fetched
470
+ * and verified inside WASM) before the document is opened; commercial
471
+ * licensed usage skips the permit entirely. The per-format loaders are
472
+ * private so there is no ungated open path.
473
+ * @param {Uint8Array} bytes
474
+ * @returns {Promise<string>}
741
475
  */
742
- pdf_decompress(doc_id) {
476
+ load(bytes) {
477
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
478
+ const len0 = WASM_VECTOR_LEN;
479
+ const ret = wasm.wasm_load(this.__wbg_ptr, ptr0, len0);
480
+ return takeObject(ret);
481
+ }
482
+ /**
483
+ * Check if a document requires a password to open.
484
+ *
485
+ * Returns `true` if the document is encrypted and requires authentication
486
+ * before pages can be loaded or rendered.
487
+ * @param {string} id
488
+ * @returns {boolean}
489
+ */
490
+ needs_password(id) {
743
491
  try {
744
492
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
745
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
493
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
746
494
  const len0 = WASM_VECTOR_LEN;
747
- wasm.wasm_pdf_decompress(retptr, this.__wbg_ptr, ptr0, len0);
495
+ wasm.wasm_needs_password(retptr, this.__wbg_ptr, ptr0, len0);
748
496
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
749
497
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
750
498
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
751
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
752
- if (r3) {
753
- throw takeObject(r2);
499
+ if (r2) {
500
+ throw takeObject(r1);
754
501
  }
755
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
756
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
757
- return v2;
502
+ return r0 !== 0;
758
503
  } finally {
759
504
  wasm.__wbindgen_add_to_stack_pointer(16);
760
505
  }
761
506
  }
762
507
  /**
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.
768
- *
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.
508
+ * Create a new document viewer.
772
509
  *
773
510
  * # 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
- * ]);
783
- *
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
511
+ * * `domain` - Hostname of the embedding page (e.g. from `window.location.hostname`)
512
+ * * `viewer_version` - SDK version string
513
+ * @param {string} domain
514
+ * @param {string} viewer_version
789
515
  */
790
- registerFonts(fonts) {
516
+ constructor(domain, viewer_version) {
517
+ const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_export, wasm.__wbindgen_export2);
518
+ const len0 = WASM_VECTOR_LEN;
519
+ const ptr1 = passStringToWasm0(viewer_version, wasm.__wbindgen_export, wasm.__wbindgen_export2);
520
+ const len1 = WASM_VECTOR_LEN;
521
+ const ret = wasm.wasm_new(ptr0, len0, ptr1, len1);
522
+ this.__wbg_ptr = ret;
523
+ WasmFinalization.register(this, this.__wbg_ptr, this);
524
+ return this;
525
+ }
526
+ /**
527
+ * Get the page count of a document.
528
+ * @param {string} id
529
+ * @returns {number}
530
+ */
531
+ page_count(id) {
791
532
  try {
792
533
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
793
- const ptr0 = passArrayJsValueToWasm0(fonts, wasm.__wbindgen_export);
534
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
794
535
  const len0 = WASM_VECTOR_LEN;
795
- wasm.wasm_registerFonts(retptr, this.__wbg_ptr, ptr0, len0);
536
+ wasm.wasm_page_count(retptr, this.__wbg_ptr, ptr0, len0);
796
537
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
797
538
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
798
- if (r1) {
799
- throw takeObject(r0);
539
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
540
+ if (r2) {
541
+ throw takeObject(r1);
800
542
  }
543
+ return r0 >>> 0;
801
544
  } finally {
802
545
  wasm.__wbindgen_add_to_stack_pointer(16);
803
546
  }
804
547
  }
805
548
  /**
806
- * Get the format of a loaded document.
549
+ * Get the page groups for a document.
807
550
  *
808
- * Returns one of: "pdf", "docx", "pptx", "xlsx", "image".
551
+ * Each group covers a contiguous range of global page indices with a
552
+ * shared stitching layout. Use this to build per-group canvases (e.g.,
553
+ * one panel per Excel sheet) and group-named sidebars.
554
+ *
555
+ * - PDF/DOCX: one `linear` group covering all pages, no name.
556
+ * - PPTX: one `linear` group (per-section groups once sections are modeled).
557
+ * - XLSX: one `tiled` group per sheet with the sheet name and page-grid dimensions.
809
558
  * @param {string} id
810
- * @returns {string}
559
+ * @returns {JsPageGroup[]}
811
560
  */
812
- document_format(id) {
813
- let deferred3_0;
814
- let deferred3_1;
561
+ page_groups(id) {
815
562
  try {
816
563
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
817
564
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
818
565
  const len0 = WASM_VECTOR_LEN;
819
- wasm.wasm_document_format(retptr, this.__wbg_ptr, ptr0, len0);
566
+ wasm.wasm_page_groups(retptr, this.__wbg_ptr, ptr0, len0);
820
567
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
821
568
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
822
569
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
823
570
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
824
- var ptr2 = r0;
825
- var len2 = r1;
826
571
  if (r3) {
827
- ptr2 = 0; len2 = 0;
828
572
  throw takeObject(r2);
829
573
  }
830
- deferred3_0 = ptr2;
831
- deferred3_1 = len2;
832
- return getStringFromWasm0(ptr2, len2);
574
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
575
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
576
+ return v2;
833
577
  } finally {
834
578
  wasm.__wbindgen_add_to_stack_pointer(16);
835
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
836
579
  }
837
580
  }
838
581
  /**
839
- * Get the layout model for a specific page.
840
- *
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.).
845
- *
846
- * All coordinates are in points (1/72 inch). The viewer should scale by
847
- * `canvasWidth / layoutPage.width` to convert to pixels.
582
+ * Get info for a specific page.
848
583
  * @param {string} id
849
584
  * @param {number} page_index
850
- * @returns {JsLayoutPage}
585
+ * @returns {JsPageInfo}
851
586
  */
852
- get_layout_page(id, page_index) {
587
+ page_info(id, page_index) {
853
588
  try {
854
589
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
855
590
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
856
591
  const len0 = WASM_VECTOR_LEN;
857
- wasm.wasm_get_layout_page(retptr, this.__wbg_ptr, ptr0, len0, page_index);
592
+ wasm.wasm_page_info(retptr, this.__wbg_ptr, ptr0, len0, page_index);
858
593
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
859
594
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
860
595
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -867,89 +602,77 @@ export class Wasm {
867
602
  }
868
603
  }
869
604
  /**
870
- * Remove a document by ID.
605
+ * Compose new PDF documents by cherry-picking pages from source documents.
871
606
  *
872
- * Returns true if the document was removed, false if it didn't exist.
873
- * @param {string} id
874
- * @returns {boolean}
607
+ * The original documents remain unchanged.
608
+ *
609
+ * # Arguments
610
+ * * `compositions` - Array of compositions. Each composition is an array of picks.
611
+ * Each pick is `{ doc: docIndex, pages: "0-2,4" }` where `docIndex` is the index
612
+ * in the `doc_ids` array and `pages` is a page range string (0-based).
613
+ * * `doc_ids` - Array of document IDs to use as sources (order matters for doc indices)
614
+ *
615
+ * # Example
616
+ * ```js
617
+ * // Create two documents: first has pages 0-2 from doc A, second has page 0 from A and 1 from B
618
+ * const newDocIds = udoc.pdf_compose(
619
+ * [
620
+ * [{ doc: 0, pages: "0-2" }],
621
+ * [{ doc: 0, pages: "0" }, { doc: 1, pages: "1" }]
622
+ * ],
623
+ * ["doc_0", "doc_1"]
624
+ * );
625
+ * ```
626
+ *
627
+ * # Returns
628
+ * Array of IDs for the newly created documents (one per composition).
629
+ * @param {JsCompositions} compositions
630
+ * @param {string[]} doc_ids
631
+ * @returns {string[]}
875
632
  */
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;
633
+ pdf_compose(compositions, doc_ids) {
634
+ try {
635
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
636
+ const ptr0 = passArrayJsValueToWasm0(doc_ids, wasm.__wbindgen_export);
637
+ const len0 = WASM_VECTOR_LEN;
638
+ wasm.wasm_pdf_compose(retptr, this.__wbg_ptr, addHeapObject(compositions), ptr0, len0);
639
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
640
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
641
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
642
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
643
+ if (r3) {
644
+ throw takeObject(r2);
645
+ }
646
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
647
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
648
+ return v2;
649
+ } finally {
650
+ wasm.__wbindgen_add_to_stack_pointer(16);
651
+ }
881
652
  }
882
653
  /**
883
- * Render a page using the GPU backend (Vello + WebGPU).
654
+ * Compress a PDF document.
884
655
  *
885
- * Returns raw RGBA pixel data in premultiplied alpha format,
886
- * identical to `render_page_to_rgba` but GPU-accelerated.
887
- *
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>}
897
- */
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);
919
- }
920
- /**
921
- * Disable telemetry reporting.
922
- *
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.
926
- * @returns {boolean}
927
- */
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.
656
+ * Saves the document with full compression options enabled:
657
+ * - Compress stream data using FlateDecode
658
+ * - Pack objects into compressed object streams (PDF 1.5+)
659
+ * - Use compressed xref streams (PDF 1.5+)
660
+ * - Remove unreferenced objects
934
661
  *
935
662
  * # Arguments
936
- * * `doc_id` - Document ID to extract fonts from
663
+ * * `doc_id` - Document ID to compress
937
664
  *
938
665
  * # 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
666
+ * Compressed PDF data as Uint8Array
944
667
  * @param {string} doc_id
945
- * @returns {JsExtractedFont[]}
668
+ * @returns {Uint8Array}
946
669
  */
947
- pdf_extract_fonts(doc_id) {
670
+ pdf_compress(doc_id) {
948
671
  try {
949
672
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
950
673
  const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
951
674
  const len0 = WASM_VECTOR_LEN;
952
- wasm.wasm_pdf_extract_fonts(retptr, this.__wbg_ptr, ptr0, len0);
675
+ wasm.wasm_pdf_compress(retptr, this.__wbg_ptr, ptr0, len0);
953
676
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
954
677
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
955
678
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -957,74 +680,33 @@ export class Wasm {
957
680
  if (r3) {
958
681
  throw takeObject(r2);
959
682
  }
960
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
961
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
683
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
684
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
962
685
  return v2;
963
686
  } finally {
964
687
  wasm.__wbindgen_add_to_stack_pointer(16);
965
688
  }
966
689
  }
967
690
  /**
968
- * Extract all embedded images from a PDF document.
969
- *
970
- * # Arguments
971
- * * `doc_id` - Document ID to extract images from
972
- * * `convert_raw_to_png` - When true, converts raw pixel data to PNG format
691
+ * Decompress a PDF document.
973
692
  *
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[]}
984
- */
985
- pdf_extract_images(doc_id, convert_raw_to_png) {
986
- try {
987
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
988
- const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
989
- const len0 = WASM_VECTOR_LEN;
990
- wasm.wasm_pdf_extract_images(retptr, this.__wbg_ptr, ptr0, len0, convert_raw_to_png);
991
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
992
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
993
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
994
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
995
- if (r3) {
996
- throw takeObject(r2);
997
- }
998
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
999
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
1000
- return v2;
1001
- } finally {
1002
- wasm.__wbindgen_add_to_stack_pointer(16);
1003
- }
1004
- }
1005
- /**
1006
- * Render a page to PNG bytes.
693
+ * Removes all filter encodings from streams, resulting in raw,
694
+ * uncompressed stream data. Useful for debugging or inspection.
1007
695
  *
1008
696
  * # Arguments
1009
- * * `id` - Document ID
1010
- * * `page_index` - Zero-based page index
1011
- * * `width` - Output width in pixels
1012
- * * `height` - Output height in pixels
697
+ * * `doc_id` - Document ID to decompress
1013
698
  *
1014
699
  * # Returns
1015
- * PNG-encoded image data as a byte array.
1016
- * @param {string} id
1017
- * @param {number} page_index
1018
- * @param {number} width
1019
- * @param {number} height
700
+ * Decompressed PDF data as Uint8Array
701
+ * @param {string} doc_id
1020
702
  * @returns {Uint8Array}
1021
703
  */
1022
- render_page_to_png(id, page_index, width, height) {
704
+ pdf_decompress(doc_id) {
1023
705
  try {
1024
706
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1025
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
707
+ const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1026
708
  const len0 = WASM_VECTOR_LEN;
1027
- wasm.wasm_render_page_to_png(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
709
+ wasm.wasm_pdf_decompress(retptr, this.__wbg_ptr, ptr0, len0);
1028
710
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1029
711
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1030
712
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1040,100 +722,26 @@ export class Wasm {
1040
722
  }
1041
723
  }
1042
724
  /**
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"`
1048
- * @param {string} id
1049
- * @returns {JsViewerPreferences}
1050
- */
1051
- viewer_preferences(id) {
1052
- try {
1053
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1054
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1055
- const len0 = WASM_VECTOR_LEN;
1056
- wasm.wasm_viewer_preferences(retptr, this.__wbg_ptr, ptr0, len0);
1057
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1058
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1059
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1060
- if (r2) {
1061
- throw takeObject(r1);
1062
- }
1063
- return takeObject(r0);
1064
- } finally {
1065
- wasm.__wbindgen_add_to_stack_pointer(16);
1066
- }
1067
- }
1068
- /**
1069
- * Enable Google Fonts.
1070
- *
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`.
1074
- *
1075
- * Call this before loading documents.
1076
- *
1077
- * # Example (JavaScript)
1078
- * ```js
1079
- * udoc.enableGoogleFonts();
1080
- * const docId = udoc.loadPptx(pptxBytes);
1081
- * const pixels = udoc.renderPageToRgba(docId, 0, 800, 600);
1082
- * ```
1083
- */
1084
- enableGoogleFonts() {
1085
- wasm.wasm_enableGoogleFonts(this.__wbg_ptr);
1086
- }
1087
- /**
1088
- * Get all annotations in the document, grouped by page index.
1089
- *
1090
- * Returns an object mapping page indices (as strings) to arrays of annotations.
1091
- * @param {string} id
1092
- * @returns {JsAnnotationsByPage}
1093
- */
1094
- get_all_annotations(id) {
1095
- try {
1096
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1097
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1098
- const len0 = WASM_VECTOR_LEN;
1099
- wasm.wasm_get_all_annotations(retptr, this.__wbg_ptr, ptr0, len0);
1100
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1101
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1102
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1103
- if (r2) {
1104
- throw takeObject(r1);
1105
- }
1106
- return takeObject(r0);
1107
- } finally {
1108
- wasm.__wbindgen_add_to_stack_pointer(16);
1109
- }
1110
- }
1111
- /**
1112
- * Render a page to raw RGBA pixel data.
1113
- *
1114
- * The returned data is in premultiplied alpha format, suitable for
1115
- * use with `ImageData` and canvas rendering.
725
+ * Extract all embedded fonts from a PDF document.
1116
726
  *
1117
727
  * # Arguments
1118
- * * `id` - Document ID
1119
- * * `page_index` - Zero-based page index
1120
- * * `width` - Output width in pixels
1121
- * * `height` - Output height in pixels
728
+ * * `doc_id` - Document ID to extract fonts from
1122
729
  *
1123
730
  * # 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
1129
- * @returns {Uint8Array}
731
+ * Array of extracted font objects, each with:
732
+ * - `name`: Font name from the resource dictionary
733
+ * - `fontType`: Font type (Type1, TrueType, etc.)
734
+ * - `extension`: File extension (ttf, cff, t1, etc.)
735
+ * - `data`: Raw font data as Uint8Array
736
+ * @param {string} doc_id
737
+ * @returns {JsExtractedFont[]}
1130
738
  */
1131
- render_page_to_rgba(id, page_index, width, height) {
739
+ pdf_extract_fonts(doc_id) {
1132
740
  try {
1133
741
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1134
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
742
+ const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1135
743
  const len0 = WASM_VECTOR_LEN;
1136
- wasm.wasm_render_page_to_rgba(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
744
+ wasm.wasm_pdf_extract_fonts(retptr, this.__wbg_ptr, ptr0, len0);
1137
745
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1138
746
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1139
747
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1141,35 +749,37 @@ export class Wasm {
1141
749
  if (r3) {
1142
750
  throw takeObject(r2);
1143
751
  }
1144
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
1145
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
752
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
753
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
1146
754
  return v2;
1147
755
  } finally {
1148
756
  wasm.__wbindgen_add_to_stack_pointer(16);
1149
757
  }
1150
758
  }
1151
759
  /**
1152
- * Get annotations for a specific page.
760
+ * Extract all embedded images from a PDF document.
1153
761
  *
1154
- * Returns an array of annotation objects for the given page.
1155
- * Uses per-page loading for efficiency (only loads the requested page).
762
+ * # Arguments
763
+ * * `doc_id` - Document ID to extract images from
764
+ * * `convert_raw_to_png` - When true, converts raw pixel data to PNG format
1156
765
  *
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[]}
766
+ * # Returns
767
+ * Array of extracted image objects, each with:
768
+ * - `name`: Image name from the resource dictionary
769
+ * - `format`: Image format (jpeg, png, jp2, etc.)
770
+ * - `width`: Width in pixels
771
+ * - `height`: Height in pixels
772
+ * - `data`: Raw image data as Uint8Array
773
+ * @param {string} doc_id
774
+ * @param {boolean} convert_raw_to_png
775
+ * @returns {JsExtractedImage[]}
1166
776
  */
1167
- get_page_annotations(id, page_index) {
777
+ pdf_extract_images(doc_id, convert_raw_to_png) {
1168
778
  try {
1169
779
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1170
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
780
+ const ptr0 = passStringToWasm0(doc_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1171
781
  const len0 = WASM_VECTOR_LEN;
1172
- wasm.wasm_get_page_annotations(retptr, this.__wbg_ptr, ptr0, len0, page_index);
782
+ wasm.wasm_pdf_extract_images(retptr, this.__wbg_ptr, ptr0, len0, convert_raw_to_png);
1173
783
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1174
784
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1175
785
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1287,202 +897,146 @@ export class Wasm {
1287
897
  }
1288
898
  }
1289
899
  /**
1290
- * Get all visibility groups for a document.
900
+ * Register font URLs.
1291
901
  *
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
902
+ * The caller provides a list of all available fonts with their download
903
+ * URLs. During layout, when the engine needs a font, it is fetched from
904
+ * the URL, parsed, and cached for reuse.
1296
905
  *
1297
- * Returns an empty array for documents without visibility groups.
1298
- * @param {string} id
1299
- * @returns {JsVisibilityGroup[]}
906
+ * Call this before loading documents. Registered fonts are automatically
907
+ * applied to every document loaded afterward. URL fonts are always
908
+ * resolved before Google Fonts.
909
+ *
910
+ * # Arguments
911
+ * * `fonts` - Array of font entries: `[{ typeface: "Roboto", bold: false, italic: false, url: "https://..." }, ...]`
912
+ *
913
+ * # Example (JavaScript)
914
+ * ```js
915
+ * // Register available fonts before loading documents
916
+ * udoc.registerFonts([
917
+ * { typeface: "Roboto", bold: false, italic: false, url: "https://cdn.example.com/Roboto-Regular.woff2" },
918
+ * { typeface: "Roboto", bold: true, italic: false, url: "https://cdn.example.com/Roboto-Bold.woff2" },
919
+ * ]);
920
+ *
921
+ * // Load and render - fonts are fetched on demand during layout
922
+ * const docId = udoc.loadPptx(pptxBytes);
923
+ * const pixels = udoc.renderPageToRgba(docId, 0, 800, 600);
924
+ * ```
925
+ * @param {JsFontRegistration[]} fonts
1300
926
  */
1301
- get_visibility_groups(id) {
927
+ registerFonts(fonts) {
1302
928
  try {
1303
929
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1304
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
930
+ const ptr0 = passArrayJsValueToWasm0(fonts, wasm.__wbindgen_export);
1305
931
  const len0 = WASM_VECTOR_LEN;
1306
- wasm.wasm_get_visibility_groups(retptr, this.__wbg_ptr, ptr0, len0);
932
+ wasm.wasm_registerFonts(retptr, this.__wbg_ptr, ptr0, len0);
1307
933
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1308
934
  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);
935
+ if (r1) {
936
+ throw takeObject(r0);
1313
937
  }
1314
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1315
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
1316
- return v2;
1317
938
  } finally {
1318
939
  wasm.__wbindgen_add_to_stack_pointer(16);
1319
940
  }
1320
941
  }
1321
942
  /**
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
943
+ * Remove a document by ID.
1328
944
  *
1329
- * Returns `true` if the group was found and updated, `false` if not found.
945
+ * Returns true if the document was removed, false if it didn't exist.
1330
946
  * @param {string} id
1331
- * @param {string} group_id
1332
- * @param {boolean} visible
1333
947
  * @returns {boolean}
1334
948
  */
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
- }
949
+ remove_document(id) {
950
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
951
+ const len0 = WASM_VECTOR_LEN;
952
+ const ret = wasm.wasm_remove_document(this.__wbg_ptr, ptr0, len0);
953
+ return ret !== 0;
1353
954
  }
1354
955
  /**
1355
- * Create a new document viewer.
956
+ * Render a page using the GPU backend (Vello + WebGPU).
1356
957
  *
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
958
+ * Returns raw RGBA pixel data in premultiplied alpha format,
959
+ * identical to `render_page_to_rgba` but GPU-accelerated.
960
+ *
961
+ * # Errors
962
+ * Returns an error if the GPU backend is not initialized
963
+ * (call `init_gpu()` first), if the document is not found,
964
+ * or if rendering fails.
965
+ * @param {string} id
966
+ * @param {number} page_index
967
+ * @param {number} width
968
+ * @param {number} height
969
+ * @returns {Promise<Uint8Array>}
1362
970
  */
1363
- constructor(domain, viewer_version) {
1364
- const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_export, wasm.__wbindgen_export2);
971
+ render_page_gpu(id, page_index, width, height) {
972
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1365
973
  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;
974
+ const ret = wasm.wasm_render_page_gpu(this.__wbg_ptr, ptr0, len0, page_index, width, height);
975
+ return takeObject(ret);
1372
976
  }
1373
977
  /**
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
978
+ * Render a page to PNG bytes.
1380
979
  *
1381
980
  * # Arguments
1382
- * * `bytes` - Raw file data
981
+ * * `id` - Document ID
982
+ * * `page_index` - Zero-based page index
983
+ * * `width` - Output width in pixels
984
+ * * `height` - Output height in pixels
1383
985
  *
1384
986
  * # Returns
1385
- * A unique document ID that can be used to reference this document.
1386
- * @param {Uint8Array} bytes
1387
- * @returns {string}
987
+ * PNG-encoded image data as a byte array.
988
+ * @param {string} id
989
+ * @param {number} page_index
990
+ * @param {number} width
991
+ * @param {number} height
992
+ * @returns {Uint8Array}
1388
993
  */
1389
- load(bytes) {
1390
- let deferred3_0;
1391
- let deferred3_1;
994
+ render_page_to_png(id, page_index, width, height) {
1392
995
  try {
1393
996
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1394
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
997
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1395
998
  const len0 = WASM_VECTOR_LEN;
1396
- wasm.wasm_load(retptr, this.__wbg_ptr, ptr0, len0);
999
+ wasm.wasm_render_page_to_png(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
1397
1000
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1398
1001
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1399
1002
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1400
1003
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1401
- var ptr2 = r0;
1402
- var len2 = r1;
1403
1004
  if (r3) {
1404
- ptr2 = 0; len2 = 0;
1405
1005
  throw takeObject(r2);
1406
1006
  }
1407
- deferred3_0 = ptr2;
1408
- deferred3_1 = len2;
1409
- return getStringFromWasm0(ptr2, len2);
1007
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
1008
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1009
+ return v2;
1410
1010
  } finally {
1411
1011
  wasm.__wbindgen_add_to_stack_pointer(16);
1412
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1413
1012
  }
1414
1013
  }
1415
1014
  /**
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).
1015
+ * Render a page to raw RGBA pixel data.
1425
1016
  *
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.
1017
+ * The returned data is in premultiplied alpha format, suitable for
1018
+ * use with `ImageData` and canvas rendering.
1438
1019
  *
1439
1020
  * # Arguments
1440
- * * `bytes` - Raw PDF file data
1021
+ * * `id` - Document ID
1022
+ * * `page_index` - Zero-based page index
1023
+ * * `width` - Output width in pixels
1024
+ * * `height` - Output height in pixels
1441
1025
  *
1442
1026
  * # 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.
1027
+ * Raw RGBA pixel data (width * height * 4 bytes).
1477
1028
  * @param {string} id
1029
+ * @param {number} page_index
1030
+ * @param {number} width
1031
+ * @param {number} height
1478
1032
  * @returns {Uint8Array}
1479
1033
  */
1480
- get_bytes(id) {
1034
+ render_page_to_rgba(id, page_index, width, height) {
1481
1035
  try {
1482
1036
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1483
1037
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1484
1038
  const len0 = WASM_VECTOR_LEN;
1485
- wasm.wasm_get_bytes(retptr, this.__wbg_ptr, ptr0, len0);
1039
+ wasm.wasm_render_page_to_rgba(retptr, this.__wbg_ptr, ptr0, len0, page_index, width, height);
1486
1040
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1487
1041
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1488
1042
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1498,142 +1052,86 @@ export class Wasm {
1498
1052
  }
1499
1053
  }
1500
1054
  /**
1501
- * Get a numeric limit from the current license.
1055
+ * Set the license key.
1502
1056
  *
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}
1057
+ * # Arguments
1058
+ * * `license_key` - The license key string
1059
+ *
1060
+ * # Returns
1061
+ * License validation result as JSON.
1062
+ * @param {string} license_key
1063
+ * @returns {LicenseResult}
1507
1064
  */
1508
- get_limit(limit_name, _default) {
1509
- const ptr0 = passStringToWasm0(limit_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1065
+ set_license(license_key) {
1066
+ const ptr0 = passStringToWasm0(license_key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1510
1067
  const len0 = WASM_VECTOR_LEN;
1511
- const ret = wasm.wasm_get_limit(this.__wbg_ptr, ptr0, len0, _default);
1512
- return BigInt.asUintN(64, ret);
1068
+ const ret = wasm.wasm_set_license(this.__wbg_ptr, ptr0, len0);
1069
+ return takeObject(ret);
1513
1070
  }
1514
1071
  /**
1515
- * Load a DOCX document and return its ID.
1072
+ * Set the visibility of a specific visibility group.
1516
1073
  *
1517
1074
  * # Arguments
1518
- * * `bytes` - Raw DOCX file data
1075
+ * * `id` - Document ID
1076
+ * * `group_id` - Visibility group ID
1077
+ * * `visible` - Whether the group should be visible
1519
1078
  *
1520
- * # Returns
1521
- * A unique document ID that can be used to reference this document.
1522
- * @param {Uint8Array} bytes
1523
- * @returns {string}
1079
+ * Returns `true` if the group was found and updated, `false` if not found.
1080
+ * @param {string} id
1081
+ * @param {string} group_id
1082
+ * @param {boolean} visible
1083
+ * @returns {boolean}
1524
1084
  */
1525
- load_docx(bytes) {
1526
- let deferred3_0;
1527
- let deferred3_1;
1085
+ set_visibility_group_visible(id, group_id, visible) {
1528
1086
  try {
1529
1087
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1530
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
1088
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1531
1089
  const len0 = WASM_VECTOR_LEN;
1532
- wasm.wasm_load_docx(retptr, this.__wbg_ptr, ptr0, len0);
1090
+ const ptr1 = passStringToWasm0(group_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1091
+ const len1 = WASM_VECTOR_LEN;
1092
+ wasm.wasm_set_visibility_group_visible(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, visible);
1533
1093
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1534
1094
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1535
1095
  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);
1096
+ if (r2) {
1097
+ throw takeObject(r1);
1542
1098
  }
1543
- deferred3_0 = ptr2;
1544
- deferred3_1 = len2;
1545
- return getStringFromWasm0(ptr2, len2);
1099
+ return r0 !== 0;
1546
1100
  } finally {
1547
1101
  wasm.__wbindgen_add_to_stack_pointer(16);
1548
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1549
1102
  }
1550
1103
  }
1551
1104
  /**
1552
- * Load a PPTX (PowerPoint) document and return its ID.
1553
- *
1554
- * # Arguments
1555
- * * `bytes` - Raw PPTX file data
1105
+ * Set the anonymous distinct ID for telemetry tracking.
1556
1106
  *
1557
- * # Returns
1558
- * A unique document ID that can be used to reference this document.
1559
- * @param {Uint8Array} bytes
1560
- * @returns {string}
1561
- */
1562
- load_pptx(bytes) {
1563
- let deferred3_0;
1564
- let deferred3_1;
1565
- try {
1566
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1567
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
1568
- const len0 = WASM_VECTOR_LEN;
1569
- wasm.wasm_load_pptx(retptr, this.__wbg_ptr, ptr0, len0);
1570
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1571
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1572
- 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);
1579
- }
1580
- deferred3_0 = ptr2;
1581
- deferred3_1 = len2;
1582
- return getStringFromWasm0(ptr2, len2);
1583
- } finally {
1584
- wasm.__wbindgen_add_to_stack_pointer(16);
1585
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
1586
- }
1587
- }
1588
- /**
1589
- * Load an XLSX document and return its ID.
1107
+ * Call this after `new()` once the ID has been read from localStorage
1108
+ * (or generated). Must be called before loading documents so that
1109
+ * telemetry events include the correct metadata.
1590
1110
  *
1591
1111
  * # Arguments
1592
- * * `bytes` - Raw XLSX file data
1593
- *
1594
- * # Returns
1595
- * A unique document ID that can be used to reference this document.
1596
- * @param {Uint8Array} bytes
1597
- * @returns {string}
1112
+ * * `distinct_id` - Anonymous UUID for per-user tracking (persisted in localStorage)
1113
+ * @param {string} distinct_id
1598
1114
  */
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
- }
1115
+ setup_telemetry(distinct_id) {
1116
+ const ptr0 = passStringToWasm0(distinct_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1117
+ const len0 = WASM_VECTOR_LEN;
1118
+ wasm.wasm_setup_telemetry(this.__wbg_ptr, ptr0, len0);
1624
1119
  }
1625
1120
  /**
1626
- * Get info for a specific page.
1121
+ * Get viewer preferences embedded in the document.
1122
+ *
1123
+ * Returns a `JsViewerPreferences` with optional fields:
1124
+ * - `layoutMode`: `"single-page"` | `"double-page-odd-right"` | `"double-page-odd-left"`
1125
+ * - `scrollMode`: `"spread"` | `"continuous"`
1627
1126
  * @param {string} id
1628
- * @param {number} page_index
1629
- * @returns {JsPageInfo}
1127
+ * @returns {JsViewerPreferences}
1630
1128
  */
1631
- page_info(id, page_index) {
1129
+ viewer_preferences(id) {
1632
1130
  try {
1633
1131
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1634
1132
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1635
1133
  const len0 = WASM_VECTOR_LEN;
1636
- wasm.wasm_page_info(retptr, this.__wbg_ptr, ptr0, len0, page_index);
1134
+ wasm.wasm_viewer_preferences(retptr, this.__wbg_ptr, ptr0, len0);
1637
1135
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1638
1136
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1639
1137
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1693,8 +1191,1293 @@ export function parseFontInfo(data) {
1693
1191
  wasm.__wbindgen_add_to_stack_pointer(16);
1694
1192
  }
1695
1193
  }
1194
+ function __wbg_get_imports() {
1195
+ const import0 = {
1196
+ __proto__: null,
1197
+ __wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
1198
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1199
+ return addHeapObject(ret);
1200
+ },
1201
+ __wbg_Number_6b506e6536831eaa: function(arg0) {
1202
+ const ret = Number(getObject(arg0));
1203
+ return ret;
1204
+ },
1205
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1206
+ const ret = String(getObject(arg1));
1207
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1208
+ const len1 = WASM_VECTOR_LEN;
1209
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1210
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1211
+ },
1212
+ __wbg_Window_defb2c76b3875a73: function(arg0) {
1213
+ const ret = getObject(arg0).Window;
1214
+ return addHeapObject(ret);
1215
+ },
1216
+ __wbg_WorkerGlobalScope_184e45d6565eb3f0: function(arg0) {
1217
+ const ret = getObject(arg0).WorkerGlobalScope;
1218
+ return addHeapObject(ret);
1219
+ },
1220
+ __wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d: function(arg0, arg1) {
1221
+ const v = getObject(arg1);
1222
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1223
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1224
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1225
+ },
1226
+ __wbg___wbindgen_boolean_get_1a45e2c38d4d41b9: function(arg0) {
1227
+ const v = getObject(arg0);
1228
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1229
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1230
+ },
1231
+ __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(arg0, arg1) {
1232
+ const ret = debugString(getObject(arg1));
1233
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1234
+ const len1 = WASM_VECTOR_LEN;
1235
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1236
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1237
+ },
1238
+ __wbg___wbindgen_in_70a403a56e771704: function(arg0, arg1) {
1239
+ const ret = getObject(arg0) in getObject(arg1);
1240
+ return ret;
1241
+ },
1242
+ __wbg___wbindgen_is_bigint_6ffd6468a9bc44b9: function(arg0) {
1243
+ const ret = typeof(getObject(arg0)) === 'bigint';
1244
+ return ret;
1245
+ },
1246
+ __wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
1247
+ const ret = typeof(getObject(arg0)) === 'function';
1248
+ return ret;
1249
+ },
1250
+ __wbg___wbindgen_is_null_87c3bfe968c6a5ad: function(arg0) {
1251
+ const ret = getObject(arg0) === null;
1252
+ return ret;
1253
+ },
1254
+ __wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
1255
+ const val = getObject(arg0);
1256
+ const ret = typeof(val) === 'object' && val !== null;
1257
+ return ret;
1258
+ },
1259
+ __wbg___wbindgen_is_string_c236cabd84a4d769: function(arg0) {
1260
+ const ret = typeof(getObject(arg0)) === 'string';
1261
+ return ret;
1262
+ },
1263
+ __wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
1264
+ const ret = getObject(arg0) === undefined;
1265
+ return ret;
1266
+ },
1267
+ __wbg___wbindgen_jsval_eq_1068e624fa87f6ab: function(arg0, arg1) {
1268
+ const ret = getObject(arg0) === getObject(arg1);
1269
+ return ret;
1270
+ },
1271
+ __wbg___wbindgen_jsval_loose_eq_2c56564c75129511: function(arg0, arg1) {
1272
+ const ret = getObject(arg0) == getObject(arg1);
1273
+ return ret;
1274
+ },
1275
+ __wbg___wbindgen_number_get_9bb1761122181af2: function(arg0, arg1) {
1276
+ const obj = getObject(arg1);
1277
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1278
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1279
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1280
+ },
1281
+ __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
1282
+ const obj = getObject(arg1);
1283
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1284
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1285
+ var len1 = WASM_VECTOR_LEN;
1286
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1287
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1288
+ },
1289
+ __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
1290
+ throw new Error(getStringFromWasm0(arg0, arg1));
1291
+ },
1292
+ __wbg__wbg_cb_unref_61db23ac97f16c31: function(arg0) {
1293
+ getObject(arg0)._wbg_cb_unref();
1294
+ },
1295
+ __wbg_beginComputePass_1fc169dd9fc89475: function(arg0, arg1) {
1296
+ const ret = getObject(arg0).beginComputePass(getObject(arg1));
1297
+ return addHeapObject(ret);
1298
+ },
1299
+ __wbg_buffer_d370c8cae5692933: function(arg0) {
1300
+ const ret = getObject(arg0).buffer;
1301
+ return addHeapObject(ret);
1302
+ },
1303
+ __wbg_call_40e4174f169eaca7: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1304
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1305
+ return addHeapObject(ret);
1306
+ }, arguments); },
1307
+ __wbg_call_8a89609d89f6608a: function() { return handleError(function (arg0, arg1) {
1308
+ const ret = getObject(arg0).call(getObject(arg1));
1309
+ return addHeapObject(ret);
1310
+ }, arguments); },
1311
+ __wbg_call_9c758de292015997: function() { return handleError(function (arg0, arg1, arg2) {
1312
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1313
+ return addHeapObject(ret);
1314
+ }, arguments); },
1315
+ __wbg_clearBuffer_5c4f30438f07155a: function(arg0, arg1, arg2, arg3) {
1316
+ getObject(arg0).clearBuffer(getObject(arg1), arg2, arg3);
1317
+ },
1318
+ __wbg_clearBuffer_de7e8cd418b56c30: function(arg0, arg1, arg2) {
1319
+ getObject(arg0).clearBuffer(getObject(arg1), arg2);
1320
+ },
1321
+ __wbg_copyBufferToBuffer_55e9540007aef863: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1322
+ getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4);
1323
+ }, arguments); },
1324
+ __wbg_copyBufferToBuffer_7adcb79ef87447dc: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1325
+ getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
1326
+ }, arguments); },
1327
+ __wbg_copyTextureToBuffer_09ba100a04b1b001: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1328
+ getObject(arg0).copyTextureToBuffer(getObject(arg1), getObject(arg2), getObject(arg3));
1329
+ }, arguments); },
1330
+ __wbg_copyTextureToTexture_66ab51b863dec546: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1331
+ getObject(arg0).copyTextureToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
1332
+ }, arguments); },
1333
+ __wbg_createBindGroupLayout_1dad97f44fda2929: function() { return handleError(function (arg0, arg1) {
1334
+ const ret = getObject(arg0).createBindGroupLayout(getObject(arg1));
1335
+ return addHeapObject(ret);
1336
+ }, arguments); },
1337
+ __wbg_createBindGroup_0ee0646375643dfb: function(arg0, arg1) {
1338
+ const ret = getObject(arg0).createBindGroup(getObject(arg1));
1339
+ return addHeapObject(ret);
1340
+ },
1341
+ __wbg_createBuffer_474baee88e74f68a: function() { return handleError(function (arg0, arg1) {
1342
+ const ret = getObject(arg0).createBuffer(getObject(arg1));
1343
+ return addHeapObject(ret);
1344
+ }, arguments); },
1345
+ __wbg_createCommandEncoder_5229e112300218b4: function(arg0, arg1) {
1346
+ const ret = getObject(arg0).createCommandEncoder(getObject(arg1));
1347
+ return addHeapObject(ret);
1348
+ },
1349
+ __wbg_createComputePipeline_1cd8bf7e02a1a06d: function(arg0, arg1) {
1350
+ const ret = getObject(arg0).createComputePipeline(getObject(arg1));
1351
+ return addHeapObject(ret);
1352
+ },
1353
+ __wbg_createPipelineLayout_bf0deba7918ca157: function(arg0, arg1) {
1354
+ const ret = getObject(arg0).createPipelineLayout(getObject(arg1));
1355
+ return addHeapObject(ret);
1356
+ },
1357
+ __wbg_createShaderModule_744311a1dd685c14: function(arg0, arg1) {
1358
+ const ret = getObject(arg0).createShaderModule(getObject(arg1));
1359
+ return addHeapObject(ret);
1360
+ },
1361
+ __wbg_createTexture_f357c38256411287: function() { return handleError(function (arg0, arg1) {
1362
+ const ret = getObject(arg0).createTexture(getObject(arg1));
1363
+ return addHeapObject(ret);
1364
+ }, arguments); },
1365
+ __wbg_createView_e7a36ec95c4190f3: function() { return handleError(function (arg0, arg1) {
1366
+ const ret = getObject(arg0).createView(getObject(arg1));
1367
+ return addHeapObject(ret);
1368
+ }, arguments); },
1369
+ __wbg_crypto_48300657fced39f9: function(arg0) {
1370
+ const ret = getObject(arg0).crypto;
1371
+ return addHeapObject(ret);
1372
+ },
1373
+ __wbg_debug_78b457f1effb3792: function(arg0) {
1374
+ console.debug(getObject(arg0));
1375
+ },
1376
+ __wbg_dispatchWorkgroupsIndirect_cdb624732570d2ab: function(arg0, arg1, arg2) {
1377
+ getObject(arg0).dispatchWorkgroupsIndirect(getObject(arg1), arg2);
1378
+ },
1379
+ __wbg_dispatchWorkgroups_727fa35f9c69d73c: function(arg0, arg1, arg2, arg3) {
1380
+ getObject(arg0).dispatchWorkgroups(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
1381
+ },
1382
+ __wbg_done_60cf307fcc680536: function(arg0) {
1383
+ const ret = getObject(arg0).done;
1384
+ return ret;
1385
+ },
1386
+ __wbg_end_2398df10208cf1ee: function(arg0) {
1387
+ getObject(arg0).end();
1388
+ },
1389
+ __wbg_entries_04b37a02507f1713: function(arg0) {
1390
+ const ret = Object.entries(getObject(arg0));
1391
+ return addHeapObject(ret);
1392
+ },
1393
+ __wbg_error_78ff5b3a29b770e0: function(arg0) {
1394
+ console.error(getObject(arg0));
1395
+ },
1396
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
1397
+ let deferred0_0;
1398
+ let deferred0_1;
1399
+ try {
1400
+ deferred0_0 = arg0;
1401
+ deferred0_1 = arg1;
1402
+ console.error(getStringFromWasm0(arg0, arg1));
1403
+ } finally {
1404
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1405
+ }
1406
+ },
1407
+ __wbg_fetch_38c2afdf0e494736: function(arg0) {
1408
+ const ret = fetch(getObject(arg0));
1409
+ return addHeapObject(ret);
1410
+ },
1411
+ __wbg_finish_7370ad1c0e62b448: function(arg0) {
1412
+ const ret = getObject(arg0).finish();
1413
+ return addHeapObject(ret);
1414
+ },
1415
+ __wbg_finish_797b32d15bab2338: function(arg0, arg1) {
1416
+ const ret = getObject(arg0).finish(getObject(arg1));
1417
+ return addHeapObject(ret);
1418
+ },
1419
+ __wbg_getDate_3d2f964145b3449d: function(arg0) {
1420
+ const ret = getObject(arg0).getDate();
1421
+ return ret;
1422
+ },
1423
+ __wbg_getFullYear_8b1ba9a648a4de7f: function(arg0) {
1424
+ const ret = getObject(arg0).getFullYear();
1425
+ return ret;
1426
+ },
1427
+ __wbg_getHours_91ac680ae491b8ea: function(arg0) {
1428
+ const ret = getObject(arg0).getHours();
1429
+ return ret;
1430
+ },
1431
+ __wbg_getMappedRange_9f13d158ba3946fd: function() { return handleError(function (arg0, arg1, arg2) {
1432
+ const ret = getObject(arg0).getMappedRange(arg1, arg2);
1433
+ return addHeapObject(ret);
1434
+ }, arguments); },
1435
+ __wbg_getMinutes_c1c2573becc0c7b5: function(arg0) {
1436
+ const ret = getObject(arg0).getMinutes();
1437
+ return ret;
1438
+ },
1439
+ __wbg_getMonth_44bdf67c99f2ed79: function(arg0) {
1440
+ const ret = getObject(arg0).getMonth();
1441
+ return ret;
1442
+ },
1443
+ __wbg_getRandomValues_263d0aa5464054ee: function() { return handleError(function (arg0, arg1) {
1444
+ getObject(arg0).getRandomValues(getObject(arg1));
1445
+ }, arguments); },
1446
+ __wbg_getSeconds_2716239745eecd0a: function(arg0) {
1447
+ const ret = getObject(arg0).getSeconds();
1448
+ return ret;
1449
+ },
1450
+ __wbg_get_1f8f054ddbaa7db2: function() { return handleError(function (arg0, arg1) {
1451
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1452
+ return addHeapObject(ret);
1453
+ }, arguments); },
1454
+ __wbg_get_2b48c7d0d006a781: function(arg0, arg1) {
1455
+ const ret = getObject(arg0)[arg1 >>> 0];
1456
+ return addHeapObject(ret);
1457
+ },
1458
+ __wbg_get_de6a0f7d4d18a304: function() { return handleError(function (arg0, arg1) {
1459
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1460
+ return addHeapObject(ret);
1461
+ }, arguments); },
1462
+ __wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
1463
+ const ret = getObject(arg0)[arg1 >>> 0];
1464
+ return addHeapObject(ret);
1465
+ },
1466
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1467
+ const ret = getObject(arg0)[getObject(arg1)];
1468
+ return addHeapObject(ret);
1469
+ },
1470
+ __wbg_gpu_ac6dc8fb638a26c3: function(arg0) {
1471
+ const ret = getObject(arg0).gpu;
1472
+ return addHeapObject(ret);
1473
+ },
1474
+ __wbg_info_af7f45292ba9b0ea: function(arg0) {
1475
+ console.info(getObject(arg0));
1476
+ },
1477
+ __wbg_instanceof_ArrayBuffer_8f49811467741499: function(arg0) {
1478
+ let result;
1479
+ try {
1480
+ result = getObject(arg0) instanceof ArrayBuffer;
1481
+ } catch (_) {
1482
+ result = false;
1483
+ }
1484
+ const ret = result;
1485
+ return ret;
1486
+ },
1487
+ __wbg_instanceof_GpuAdapter_fb230cdccb184887: function(arg0) {
1488
+ let result;
1489
+ try {
1490
+ result = getObject(arg0) instanceof GPUAdapter;
1491
+ } catch (_) {
1492
+ result = false;
1493
+ }
1494
+ const ret = result;
1495
+ return ret;
1496
+ },
1497
+ __wbg_instanceof_Map_9fc06d9a951bcee6: function(arg0) {
1498
+ let result;
1499
+ try {
1500
+ result = getObject(arg0) instanceof Map;
1501
+ } catch (_) {
1502
+ result = false;
1503
+ }
1504
+ const ret = result;
1505
+ return ret;
1506
+ },
1507
+ __wbg_instanceof_Response_cb984bd66d7bd408: function(arg0) {
1508
+ let result;
1509
+ try {
1510
+ result = getObject(arg0) instanceof Response;
1511
+ } catch (_) {
1512
+ result = false;
1513
+ }
1514
+ const ret = result;
1515
+ return ret;
1516
+ },
1517
+ __wbg_instanceof_Uint8Array_86f30649f63ef9c2: function(arg0) {
1518
+ let result;
1519
+ try {
1520
+ result = getObject(arg0) instanceof Uint8Array;
1521
+ } catch (_) {
1522
+ result = false;
1523
+ }
1524
+ const ret = result;
1525
+ return ret;
1526
+ },
1527
+ __wbg_isArray_67c2c9c4313f4448: function(arg0) {
1528
+ const ret = Array.isArray(getObject(arg0));
1529
+ return ret;
1530
+ },
1531
+ __wbg_isSafeInteger_66acec27e09e99a7: function(arg0) {
1532
+ const ret = Number.isSafeInteger(getObject(arg0));
1533
+ return ret;
1534
+ },
1535
+ __wbg_iterator_8732428d309e270e: function() {
1536
+ const ret = Symbol.iterator;
1537
+ return addHeapObject(ret);
1538
+ },
1539
+ __wbg_label_84abde6506fa15b7: function(arg0, arg1) {
1540
+ const ret = getObject(arg1).label;
1541
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1542
+ const len1 = WASM_VECTOR_LEN;
1543
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1544
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1545
+ },
1546
+ __wbg_length_4a591ecaa01354d9: function(arg0) {
1547
+ const ret = getObject(arg0).length;
1548
+ return ret;
1549
+ },
1550
+ __wbg_length_66f1a4b2e9026940: function(arg0) {
1551
+ const ret = getObject(arg0).length;
1552
+ return ret;
1553
+ },
1554
+ __wbg_log_cf2e968649f3384e: function(arg0) {
1555
+ console.log(getObject(arg0));
1556
+ },
1557
+ __wbg_mapAsync_3546b4b874e14738: function(arg0, arg1, arg2, arg3) {
1558
+ const ret = getObject(arg0).mapAsync(arg1 >>> 0, arg2, arg3);
1559
+ return addHeapObject(ret);
1560
+ },
1561
+ __wbg_msCrypto_8c6d45a75ef1d3da: function(arg0) {
1562
+ const ret = getObject(arg0).msCrypto;
1563
+ return addHeapObject(ret);
1564
+ },
1565
+ __wbg_navigator_3833ecdbc19d2757: function(arg0) {
1566
+ const ret = getObject(arg0).navigator;
1567
+ return addHeapObject(ret);
1568
+ },
1569
+ __wbg_navigator_391291470f58c650: function(arg0) {
1570
+ const ret = getObject(arg0).navigator;
1571
+ return addHeapObject(ret);
1572
+ },
1573
+ __wbg_new_0_445c13a750296eb6: function() {
1574
+ const ret = new Date();
1575
+ return addHeapObject(ret);
1576
+ },
1577
+ __wbg_new_227d7c05414eb861: function() {
1578
+ const ret = new Error();
1579
+ return addHeapObject(ret);
1580
+ },
1581
+ __wbg_new_2ee370dca414d926: function() { return handleError(function () {
1582
+ const ret = new XMLHttpRequest();
1583
+ return addHeapObject(ret);
1584
+ }, arguments); },
1585
+ __wbg_new_578aeef4b6b94378: function(arg0) {
1586
+ const ret = new Uint8Array(getObject(arg0));
1587
+ return addHeapObject(ret);
1588
+ },
1589
+ __wbg_new_622fc80556be2e26: function() {
1590
+ const ret = new Map();
1591
+ return addHeapObject(ret);
1592
+ },
1593
+ __wbg_new_b682b81e8eaaf027: function(arg0, arg1) {
1594
+ try {
1595
+ var state0 = {a: arg0, b: arg1};
1596
+ var cb0 = (arg0, arg1) => {
1597
+ const a = state0.a;
1598
+ state0.a = 0;
1599
+ try {
1600
+ return __wasm_bindgen_func_elem_22816(a, state0.b, arg0, arg1);
1601
+ } finally {
1602
+ state0.a = a;
1603
+ }
1604
+ };
1605
+ const ret = new Promise(cb0);
1606
+ return addHeapObject(ret);
1607
+ } finally {
1608
+ state0.a = 0;
1609
+ }
1610
+ },
1611
+ __wbg_new_ce1ab61c1c2b300d: function() {
1612
+ const ret = new Object();
1613
+ return addHeapObject(ret);
1614
+ },
1615
+ __wbg_new_d90091b82fdf5b91: function() {
1616
+ const ret = new Array();
1617
+ return addHeapObject(ret);
1618
+ },
1619
+ __wbg_new_e436d06bc8e77460: function() { return handleError(function () {
1620
+ const ret = new Headers();
1621
+ return addHeapObject(ret);
1622
+ }, arguments); },
1623
+ __wbg_new_from_slice_18fa1f71286d66b8: function(arg0, arg1) {
1624
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1625
+ return addHeapObject(ret);
1626
+ },
1627
+ __wbg_new_typed_bf31d18f92484486: function(arg0, arg1) {
1628
+ try {
1629
+ var state0 = {a: arg0, b: arg1};
1630
+ var cb0 = (arg0, arg1) => {
1631
+ const a = state0.a;
1632
+ state0.a = 0;
1633
+ try {
1634
+ return __wasm_bindgen_func_elem_22816(a, state0.b, arg0, arg1);
1635
+ } finally {
1636
+ state0.a = a;
1637
+ }
1638
+ };
1639
+ const ret = new Promise(cb0);
1640
+ return addHeapObject(ret);
1641
+ } finally {
1642
+ state0.a = 0;
1643
+ }
1644
+ },
1645
+ __wbg_new_with_byte_offset_and_length_d836f26d916dd9ad: function(arg0, arg1, arg2) {
1646
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1647
+ return addHeapObject(ret);
1648
+ },
1649
+ __wbg_new_with_length_36a4998e27b014c5: function(arg0) {
1650
+ const ret = new Uint8Array(arg0 >>> 0);
1651
+ return addHeapObject(ret);
1652
+ },
1653
+ __wbg_new_with_str_and_init_bcd02b79a793d27f: function() { return handleError(function (arg0, arg1, arg2) {
1654
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1655
+ return addHeapObject(ret);
1656
+ }, arguments); },
1657
+ __wbg_next_9e03acdf51c4960d: function(arg0) {
1658
+ const ret = getObject(arg0).next;
1659
+ return addHeapObject(ret);
1660
+ },
1661
+ __wbg_next_eb8ca7351fa27906: function() { return handleError(function (arg0) {
1662
+ const ret = getObject(arg0).next();
1663
+ return addHeapObject(ret);
1664
+ }, arguments); },
1665
+ __wbg_node_95beb7570492fd97: function(arg0) {
1666
+ const ret = getObject(arg0).node;
1667
+ return addHeapObject(ret);
1668
+ },
1669
+ __wbg_now_190933fa139cc119: function() {
1670
+ const ret = Date.now();
1671
+ return ret;
1672
+ },
1673
+ __wbg_open_837bab9ccb9e06da: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1674
+ getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
1675
+ }, arguments); },
1676
+ __wbg_process_b2fea42461d03994: function(arg0) {
1677
+ const ret = getObject(arg0).process;
1678
+ return addHeapObject(ret);
1679
+ },
1680
+ __wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
1681
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1682
+ },
1683
+ __wbg_push_a6822215aa43e71c: function(arg0, arg1) {
1684
+ const ret = getObject(arg0).push(getObject(arg1));
1685
+ return ret;
1686
+ },
1687
+ __wbg_queueMicrotask_35c611f4a14830b2: function(arg0) {
1688
+ queueMicrotask(getObject(arg0));
1689
+ },
1690
+ __wbg_queueMicrotask_404ed0a58e0b63cc: function(arg0) {
1691
+ const ret = getObject(arg0).queueMicrotask;
1692
+ return addHeapObject(ret);
1693
+ },
1694
+ __wbg_queue_8cb065d04b06cb13: function(arg0) {
1695
+ const ret = getObject(arg0).queue;
1696
+ return addHeapObject(ret);
1697
+ },
1698
+ __wbg_randomFillSync_ca9f178fb14c88cb: function() { return handleError(function (arg0, arg1) {
1699
+ getObject(arg0).randomFillSync(takeObject(arg1));
1700
+ }, arguments); },
1701
+ __wbg_requestAdapter_4814cb479d2dcf15: function(arg0, arg1) {
1702
+ const ret = getObject(arg0).requestAdapter(getObject(arg1));
1703
+ return addHeapObject(ret);
1704
+ },
1705
+ __wbg_requestDevice_1b8f321791aa8b00: function(arg0, arg1) {
1706
+ const ret = getObject(arg0).requestDevice(getObject(arg1));
1707
+ return addHeapObject(ret);
1708
+ },
1709
+ __wbg_require_7a9419e39d796c95: function() { return handleError(function () {
1710
+ const ret = module.require;
1711
+ return addHeapObject(ret);
1712
+ }, arguments); },
1713
+ __wbg_resolve_25a7e548d5881dca: function(arg0) {
1714
+ const ret = Promise.resolve(getObject(arg0));
1715
+ return addHeapObject(ret);
1716
+ },
1717
+ __wbg_responseText_266ec252b6be1e56: function() { return handleError(function (arg0, arg1) {
1718
+ const ret = getObject(arg1).responseText;
1719
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1720
+ var len1 = WASM_VECTOR_LEN;
1721
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1722
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1723
+ }, arguments); },
1724
+ __wbg_response_8ec82c168e320475: function() { return handleError(function (arg0) {
1725
+ const ret = getObject(arg0).response;
1726
+ return addHeapObject(ret);
1727
+ }, arguments); },
1728
+ __wbg_send_dce79f146638dfda: function() { return handleError(function (arg0) {
1729
+ getObject(arg0).send();
1730
+ }, arguments); },
1731
+ __wbg_setBindGroup_67bd9a0c57486387: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1732
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
1733
+ }, arguments); },
1734
+ __wbg_setBindGroup_a2a4442ac2a0be99: function(arg0, arg1, arg2) {
1735
+ getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
1736
+ },
1737
+ __wbg_setPipeline_50cfc53a5d0eb1d7: function(arg0, arg1) {
1738
+ getObject(arg0).setPipeline(getObject(arg1));
1739
+ },
1740
+ __wbg_set_25ef40a9aeff260d: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1741
+ getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1742
+ }, arguments); },
1743
+ __wbg_set_52b1e1eb5bed906a: function(arg0, arg1, arg2) {
1744
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1745
+ return addHeapObject(ret);
1746
+ },
1747
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1748
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1749
+ },
1750
+ __wbg_set_6e30c9374c26414c: function() { return handleError(function (arg0, arg1, arg2) {
1751
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1752
+ return ret;
1753
+ }, arguments); },
1754
+ __wbg_set_access_67a4b0ae1c0f32f5: function(arg0, arg1) {
1755
+ getObject(arg0).access = __wbindgen_enum_GpuStorageTextureAccess[arg1];
1756
+ },
1757
+ __wbg_set_array_layer_count_c2e975f5b62596bb: function(arg0, arg1) {
1758
+ getObject(arg0).arrayLayerCount = arg1 >>> 0;
1759
+ },
1760
+ __wbg_set_aspect_a453970e75d8e849: function(arg0, arg1) {
1761
+ getObject(arg0).aspect = __wbindgen_enum_GpuTextureAspect[arg1];
1762
+ },
1763
+ __wbg_set_base_array_layer_b67db9750fbc7053: function(arg0, arg1) {
1764
+ getObject(arg0).baseArrayLayer = arg1 >>> 0;
1765
+ },
1766
+ __wbg_set_base_mip_level_35f2fc3293e96083: function(arg0, arg1) {
1767
+ getObject(arg0).baseMipLevel = arg1 >>> 0;
1768
+ },
1769
+ __wbg_set_beginning_of_pass_write_index_ddfc55f615254cc1: function(arg0, arg1) {
1770
+ getObject(arg0).beginningOfPassWriteIndex = arg1 >>> 0;
1771
+ },
1772
+ __wbg_set_bind_group_layouts_436bd62a9b35e1ab: function(arg0, arg1) {
1773
+ getObject(arg0).bindGroupLayouts = getObject(arg1);
1774
+ },
1775
+ __wbg_set_binding_b575483e08d5ba4a: function(arg0, arg1) {
1776
+ getObject(arg0).binding = arg1 >>> 0;
1777
+ },
1778
+ __wbg_set_binding_c9feebb53a130ebe: function(arg0, arg1) {
1779
+ getObject(arg0).binding = arg1 >>> 0;
1780
+ },
1781
+ __wbg_set_body_36614c7e61546809: function(arg0, arg1) {
1782
+ getObject(arg0).body = getObject(arg1);
1783
+ },
1784
+ __wbg_set_buffer_468874ee2bc9df02: function(arg0, arg1) {
1785
+ getObject(arg0).buffer = getObject(arg1);
1786
+ },
1787
+ __wbg_set_buffer_6c45652fb024e808: function(arg0, arg1) {
1788
+ getObject(arg0).buffer = getObject(arg1);
1789
+ },
1790
+ __wbg_set_buffer_83041e80a2b2c1b9: function(arg0, arg1) {
1791
+ getObject(arg0).buffer = getObject(arg1);
1792
+ },
1793
+ __wbg_set_bytes_per_row_c127092e4fe9be22: function(arg0, arg1) {
1794
+ getObject(arg0).bytesPerRow = arg1 >>> 0;
1795
+ },
1796
+ __wbg_set_bytes_per_row_fecf7d0d8d5038d0: function(arg0, arg1) {
1797
+ getObject(arg0).bytesPerRow = arg1 >>> 0;
1798
+ },
1799
+ __wbg_set_c775d84916be79ea: function(arg0, arg1, arg2) {
1800
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1801
+ },
1802
+ __wbg_set_code_0a82fa86cf58ca3b: function(arg0, arg1, arg2) {
1803
+ getObject(arg0).code = getStringFromWasm0(arg1, arg2);
1804
+ },
1805
+ __wbg_set_compute_dc74d722ba27aa5b: function(arg0, arg1) {
1806
+ getObject(arg0).compute = getObject(arg1);
1807
+ },
1808
+ __wbg_set_dca99999bba88a9a: function(arg0, arg1, arg2) {
1809
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1810
+ },
1811
+ __wbg_set_depth_or_array_layers_17284e1eac0007a1: function(arg0, arg1) {
1812
+ getObject(arg0).depthOrArrayLayers = arg1 >>> 0;
1813
+ },
1814
+ __wbg_set_dimension_3144c827eb67b110: function(arg0, arg1) {
1815
+ getObject(arg0).dimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
1816
+ },
1817
+ __wbg_set_dimension_9054f7ab0acbfd31: function(arg0, arg1) {
1818
+ getObject(arg0).dimension = __wbindgen_enum_GpuTextureDimension[arg1];
1819
+ },
1820
+ __wbg_set_end_of_pass_write_index_786588764311c9aa: function(arg0, arg1) {
1821
+ getObject(arg0).endOfPassWriteIndex = arg1 >>> 0;
1822
+ },
1823
+ __wbg_set_entries_247b5e665db79583: function(arg0, arg1) {
1824
+ getObject(arg0).entries = getObject(arg1);
1825
+ },
1826
+ __wbg_set_entries_bfbb6a7f04b96709: function(arg0, arg1) {
1827
+ getObject(arg0).entries = getObject(arg1);
1828
+ },
1829
+ __wbg_set_entry_point_3b13db51cfe0c5d6: function(arg0, arg1, arg2) {
1830
+ getObject(arg0).entryPoint = getStringFromWasm0(arg1, arg2);
1831
+ },
1832
+ __wbg_set_external_texture_a0db2eb13c76e01c: function(arg0, arg1) {
1833
+ getObject(arg0).externalTexture = getObject(arg1);
1834
+ },
1835
+ __wbg_set_format_237b3e4047d1be9a: function(arg0, arg1) {
1836
+ getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1837
+ },
1838
+ __wbg_set_format_c9dcecebf9c1e619: function(arg0, arg1) {
1839
+ getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1840
+ },
1841
+ __wbg_set_format_d9d3420c1a9d1c59: function(arg0, arg1) {
1842
+ getObject(arg0).format = __wbindgen_enum_GpuTextureFormat[arg1];
1843
+ },
1844
+ __wbg_set_has_dynamic_offset_0c8a607543be8069: function(arg0, arg1) {
1845
+ getObject(arg0).hasDynamicOffset = arg1 !== 0;
1846
+ },
1847
+ __wbg_set_headers_7c1e39ece7826bec: function(arg0, arg1) {
1848
+ getObject(arg0).headers = getObject(arg1);
1849
+ },
1850
+ __wbg_set_height_96611e96eee67c44: function(arg0, arg1) {
1851
+ getObject(arg0).height = arg1 >>> 0;
1852
+ },
1853
+ __wbg_set_label_01228663ea03b92f: function(arg0, arg1, arg2) {
1854
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1855
+ },
1856
+ __wbg_set_label_22e57f4c5b38215f: function(arg0, arg1, arg2) {
1857
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1858
+ },
1859
+ __wbg_set_label_382417d222111912: function(arg0, arg1, arg2) {
1860
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1861
+ },
1862
+ __wbg_set_label_4d049edb707ba31c: function(arg0, arg1, arg2) {
1863
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1864
+ },
1865
+ __wbg_set_label_66fc1d23dd10d4f5: function(arg0, arg1, arg2) {
1866
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1867
+ },
1868
+ __wbg_set_label_806446f85d68e201: function(arg0, arg1, arg2) {
1869
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1870
+ },
1871
+ __wbg_set_label_8354c6463558484f: function(arg0, arg1, arg2) {
1872
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1873
+ },
1874
+ __wbg_set_label_b3da7636c69f1a4c: function(arg0, arg1, arg2) {
1875
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1876
+ },
1877
+ __wbg_set_label_b7f797c13bc822c4: function(arg0, arg1, arg2) {
1878
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1879
+ },
1880
+ __wbg_set_label_e026aa2aea731594: function(arg0, arg1, arg2) {
1881
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1882
+ },
1883
+ __wbg_set_label_e6bc3b86ef6deeb8: function(arg0, arg1, arg2) {
1884
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1885
+ },
1886
+ __wbg_set_label_e7f76bba99d72971: function(arg0, arg1, arg2) {
1887
+ getObject(arg0).label = getStringFromWasm0(arg1, arg2);
1888
+ },
1889
+ __wbg_set_layout_44943c4c7d78f826: function(arg0, arg1) {
1890
+ getObject(arg0).layout = getObject(arg1);
1891
+ },
1892
+ __wbg_set_layout_726c6ae6f5919730: function(arg0, arg1) {
1893
+ getObject(arg0).layout = getObject(arg1);
1894
+ },
1895
+ __wbg_set_mapped_at_creation_12773dff1bb6ea0f: function(arg0, arg1) {
1896
+ getObject(arg0).mappedAtCreation = arg1 !== 0;
1897
+ },
1898
+ __wbg_set_method_7a6811dec7a4feff: function(arg0, arg1, arg2) {
1899
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1900
+ },
1901
+ __wbg_set_min_binding_size_164df827e02821e1: function(arg0, arg1) {
1902
+ getObject(arg0).minBindingSize = arg1;
1903
+ },
1904
+ __wbg_set_mip_level_7f56c1c607dda5cf: function(arg0, arg1) {
1905
+ getObject(arg0).mipLevel = arg1 >>> 0;
1906
+ },
1907
+ __wbg_set_mip_level_count_3402f5315a423b69: function(arg0, arg1) {
1908
+ getObject(arg0).mipLevelCount = arg1 >>> 0;
1909
+ },
1910
+ __wbg_set_mip_level_count_ed029120a0ee12b8: function(arg0, arg1) {
1911
+ getObject(arg0).mipLevelCount = arg1 >>> 0;
1912
+ },
1913
+ __wbg_set_module_af2f871a0bed003c: function(arg0, arg1) {
1914
+ getObject(arg0).module = getObject(arg1);
1915
+ },
1916
+ __wbg_set_multisampled_e9d7bed0e68d1d6f: function(arg0, arg1) {
1917
+ getObject(arg0).multisampled = arg1 !== 0;
1918
+ },
1919
+ __wbg_set_offset_01c04218a4ccfa08: function(arg0, arg1) {
1920
+ getObject(arg0).offset = arg1;
1921
+ },
1922
+ __wbg_set_offset_bd11f79890456c6f: function(arg0, arg1) {
1923
+ getObject(arg0).offset = arg1;
1924
+ },
1925
+ __wbg_set_offset_f07a73165707eb4c: function(arg0, arg1) {
1926
+ getObject(arg0).offset = arg1;
1927
+ },
1928
+ __wbg_set_origin_6be40076fb0623f4: function(arg0, arg1) {
1929
+ getObject(arg0).origin = getObject(arg1);
1930
+ },
1931
+ __wbg_set_power_preference_0721cf46746c0c7d: function(arg0, arg1) {
1932
+ getObject(arg0).powerPreference = __wbindgen_enum_GpuPowerPreference[arg1];
1933
+ },
1934
+ __wbg_set_query_set_aadbb433c8390a5c: function(arg0, arg1) {
1935
+ getObject(arg0).querySet = getObject(arg1);
1936
+ },
1937
+ __wbg_set_required_features_5202fa8cd082e531: function(arg0, arg1) {
1938
+ getObject(arg0).requiredFeatures = getObject(arg1);
1939
+ },
1940
+ __wbg_set_resource_c73d0c2d815f7211: function(arg0, arg1) {
1941
+ getObject(arg0).resource = getObject(arg1);
1942
+ },
1943
+ __wbg_set_responseType_cfb49ea8269f8317: function(arg0, arg1) {
1944
+ getObject(arg0).responseType = __wbindgen_enum_XmlHttpRequestResponseType[arg1];
1945
+ },
1946
+ __wbg_set_rows_per_image_00c8e938dae40dae: function(arg0, arg1) {
1947
+ getObject(arg0).rowsPerImage = arg1 >>> 0;
1948
+ },
1949
+ __wbg_set_rows_per_image_e6e2c0c4a7e4fa8d: function(arg0, arg1) {
1950
+ getObject(arg0).rowsPerImage = arg1 >>> 0;
1951
+ },
1952
+ __wbg_set_sample_count_05dcc9952f4fa7ac: function(arg0, arg1) {
1953
+ getObject(arg0).sampleCount = arg1 >>> 0;
1954
+ },
1955
+ __wbg_set_sample_type_93886b8f9794f85c: function(arg0, arg1) {
1956
+ getObject(arg0).sampleType = __wbindgen_enum_GpuTextureSampleType[arg1];
1957
+ },
1958
+ __wbg_set_sampler_02989e99b27a50db: function(arg0, arg1) {
1959
+ getObject(arg0).sampler = getObject(arg1);
1960
+ },
1961
+ __wbg_set_size_b3e6b2bf58d62082: function(arg0, arg1) {
1962
+ getObject(arg0).size = getObject(arg1);
1963
+ },
1964
+ __wbg_set_size_c2a556d5571231f5: function(arg0, arg1) {
1965
+ getObject(arg0).size = arg1;
1966
+ },
1967
+ __wbg_set_size_f7b29f6cb1669c4d: function(arg0, arg1) {
1968
+ getObject(arg0).size = arg1;
1969
+ },
1970
+ __wbg_set_storage_texture_50af47fec531be02: function(arg0, arg1) {
1971
+ getObject(arg0).storageTexture = getObject(arg1);
1972
+ },
1973
+ __wbg_set_texture_884f2777c0fe1e91: function(arg0, arg1) {
1974
+ getObject(arg0).texture = getObject(arg1);
1975
+ },
1976
+ __wbg_set_texture_a1baf7da91d20351: function(arg0, arg1) {
1977
+ getObject(arg0).texture = getObject(arg1);
1978
+ },
1979
+ __wbg_set_timestamp_writes_7fa18118aa24ddc1: function(arg0, arg1) {
1980
+ getObject(arg0).timestampWrites = getObject(arg1);
1981
+ },
1982
+ __wbg_set_type_109702a7ec65b49d: function(arg0, arg1) {
1983
+ getObject(arg0).type = __wbindgen_enum_GpuSamplerBindingType[arg1];
1984
+ },
1985
+ __wbg_set_type_55112c374bcc5a9d: function(arg0, arg1) {
1986
+ getObject(arg0).type = __wbindgen_enum_GpuBufferBindingType[arg1];
1987
+ },
1988
+ __wbg_set_usage_ac04cadda4108c1a: function(arg0, arg1) {
1989
+ getObject(arg0).usage = arg1 >>> 0;
1990
+ },
1991
+ __wbg_set_usage_ad30cd3b0e0f4244: function(arg0, arg1) {
1992
+ getObject(arg0).usage = arg1 >>> 0;
1993
+ },
1994
+ __wbg_set_usage_cc34543608cf3335: function(arg0, arg1) {
1995
+ getObject(arg0).usage = arg1 >>> 0;
1996
+ },
1997
+ __wbg_set_view_dimension_50f3edb06107948f: function(arg0, arg1) {
1998
+ getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
1999
+ },
2000
+ __wbg_set_view_dimension_925bb358df1f2b9d: function(arg0, arg1) {
2001
+ getObject(arg0).viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
2002
+ },
2003
+ __wbg_set_view_formats_3d2a72ffb1f55a75: function(arg0, arg1) {
2004
+ getObject(arg0).viewFormats = getObject(arg1);
2005
+ },
2006
+ __wbg_set_visibility_bdebc70a7c0f236d: function(arg0, arg1) {
2007
+ getObject(arg0).visibility = arg1 >>> 0;
2008
+ },
2009
+ __wbg_set_width_40592253da7b2113: function(arg0, arg1) {
2010
+ getObject(arg0).width = arg1 >>> 0;
2011
+ },
2012
+ __wbg_set_x_3c1cb8191b848172: function(arg0, arg1) {
2013
+ getObject(arg0).x = arg1 >>> 0;
2014
+ },
2015
+ __wbg_set_y_9024331910317eff: function(arg0, arg1) {
2016
+ getObject(arg0).y = arg1 >>> 0;
2017
+ },
2018
+ __wbg_set_z_b6182f4c230116a7: function(arg0, arg1) {
2019
+ getObject(arg0).z = arg1 >>> 0;
2020
+ },
2021
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
2022
+ const ret = getObject(arg1).stack;
2023
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2024
+ const len1 = WASM_VECTOR_LEN;
2025
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2026
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2027
+ },
2028
+ __wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
2029
+ const ret = typeof global === 'undefined' ? null : global;
2030
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2031
+ },
2032
+ __wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a: function() {
2033
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
2034
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2035
+ },
2036
+ __wbg_static_accessor_SELF_4c59f6c7ea29a144: function() {
2037
+ const ret = typeof self === 'undefined' ? null : self;
2038
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2039
+ },
2040
+ __wbg_static_accessor_WINDOW_e70ae9f2eb052253: function() {
2041
+ const ret = typeof window === 'undefined' ? null : window;
2042
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2043
+ },
2044
+ __wbg_status_214edd0820ca76fc: function() { return handleError(function (arg0) {
2045
+ const ret = getObject(arg0).status;
2046
+ return ret;
2047
+ }, arguments); },
2048
+ __wbg_subarray_4aa221f6a4f5ab22: function(arg0, arg1, arg2) {
2049
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2050
+ return addHeapObject(ret);
2051
+ },
2052
+ __wbg_submit_fc5b9a1154201a58: function(arg0, arg1) {
2053
+ getObject(arg0).submit(getObject(arg1));
2054
+ },
2055
+ __wbg_text_a17febec76d36501: function() { return handleError(function (arg0) {
2056
+ const ret = getObject(arg0).text();
2057
+ return addHeapObject(ret);
2058
+ }, arguments); },
2059
+ __wbg_then_18f476d590e58992: function(arg0, arg1, arg2) {
2060
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2061
+ return addHeapObject(ret);
2062
+ },
2063
+ __wbg_then_529ea37d9bdbf95d: function(arg0, arg1, arg2) {
2064
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2065
+ return addHeapObject(ret);
2066
+ },
2067
+ __wbg_then_ac7b025999b52837: function(arg0, arg1) {
2068
+ const ret = getObject(arg0).then(getObject(arg1));
2069
+ return addHeapObject(ret);
2070
+ },
2071
+ __wbg_toISOString_d485be0388a74494: function(arg0) {
2072
+ const ret = getObject(arg0).toISOString();
2073
+ return addHeapObject(ret);
2074
+ },
2075
+ __wbg_value_f3625092ee4b37f4: function(arg0) {
2076
+ const ret = getObject(arg0).value;
2077
+ return addHeapObject(ret);
2078
+ },
2079
+ __wbg_versions_215a3ab1c9d5745a: function(arg0) {
2080
+ const ret = getObject(arg0).versions;
2081
+ return addHeapObject(ret);
2082
+ },
2083
+ __wbg_warn_410c3261e3c6d686: function(arg0) {
2084
+ console.warn(getObject(arg0));
2085
+ },
2086
+ __wbg_writeBuffer_7d54524c36f1c7e2: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
2087
+ getObject(arg0).writeBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
2088
+ }, arguments); },
2089
+ __wbg_writeTexture_9d4c493be748d189: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2090
+ getObject(arg0).writeTexture(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2091
+ }, arguments); },
2092
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2093
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1846, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2094
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_22803);
2095
+ return addHeapObject(ret);
2096
+ },
2097
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2098
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 256, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2099
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3624);
2100
+ return addHeapObject(ret);
2101
+ },
2102
+ __wbindgen_cast_0000000000000003: function(arg0) {
2103
+ // Cast intrinsic for `F64 -> Externref`.
2104
+ const ret = arg0;
2105
+ return addHeapObject(ret);
2106
+ },
2107
+ __wbindgen_cast_0000000000000004: function(arg0) {
2108
+ // Cast intrinsic for `I64 -> Externref`.
2109
+ const ret = arg0;
2110
+ return addHeapObject(ret);
2111
+ },
2112
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
2113
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
2114
+ const ret = getArrayU8FromWasm0(arg0, arg1);
2115
+ return addHeapObject(ret);
2116
+ },
2117
+ __wbindgen_cast_0000000000000006: function(arg0, arg1) {
2118
+ // Cast intrinsic for `Ref(String) -> Externref`.
2119
+ const ret = getStringFromWasm0(arg0, arg1);
2120
+ return addHeapObject(ret);
2121
+ },
2122
+ __wbindgen_cast_0000000000000007: function(arg0) {
2123
+ // Cast intrinsic for `U64 -> Externref`.
2124
+ const ret = BigInt.asUintN(64, arg0);
2125
+ return addHeapObject(ret);
2126
+ },
2127
+ __wbindgen_cast_0000000000000008: function(arg0, arg1) {
2128
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
2129
+ wasm.__wbindgen_export4(arg0, arg1 * 1, 1);
2130
+ // Cast intrinsic for `Vector(U8) -> Externref`.
2131
+ const ret = v0;
2132
+ return addHeapObject(ret);
2133
+ },
2134
+ __wbindgen_object_clone_ref: function(arg0) {
2135
+ const ret = getObject(arg0);
2136
+ return addHeapObject(ret);
2137
+ },
2138
+ __wbindgen_object_drop_ref: function(arg0) {
2139
+ takeObject(arg0);
2140
+ },
2141
+ };
2142
+ return {
2143
+ __proto__: null,
2144
+ "./udoc_bg.js": import0,
2145
+ };
2146
+ }
2147
+
2148
+ function __wasm_bindgen_func_elem_3624(arg0, arg1, arg2) {
2149
+ wasm.__wasm_bindgen_func_elem_3624(arg0, arg1, addHeapObject(arg2));
2150
+ }
2151
+
2152
+ function __wasm_bindgen_func_elem_22803(arg0, arg1, arg2) {
2153
+ try {
2154
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2155
+ wasm.__wasm_bindgen_func_elem_22803(retptr, arg0, arg1, addHeapObject(arg2));
2156
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2157
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2158
+ if (r1) {
2159
+ throw takeObject(r0);
2160
+ }
2161
+ } finally {
2162
+ wasm.__wbindgen_add_to_stack_pointer(16);
2163
+ }
2164
+ }
2165
+
2166
+ function __wasm_bindgen_func_elem_22816(arg0, arg1, arg2, arg3) {
2167
+ wasm.__wasm_bindgen_func_elem_22816(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2168
+ }
2169
+
2170
+
2171
+ const __wbindgen_enum_GpuBufferBindingType = ["uniform", "storage", "read-only-storage"];
2172
+
2173
+
2174
+ const __wbindgen_enum_GpuPowerPreference = ["low-power", "high-performance"];
2175
+
2176
+
2177
+ const __wbindgen_enum_GpuSamplerBindingType = ["filtering", "non-filtering", "comparison"];
2178
+
2179
+
2180
+ const __wbindgen_enum_GpuStorageTextureAccess = ["write-only", "read-only", "read-write"];
2181
+
2182
+
2183
+ const __wbindgen_enum_GpuTextureAspect = ["all", "stencil-only", "depth-only"];
2184
+
2185
+
2186
+ const __wbindgen_enum_GpuTextureDimension = ["1d", "2d", "3d"];
2187
+
2188
+
2189
+ 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"];
2190
+
2191
+
2192
+ const __wbindgen_enum_GpuTextureSampleType = ["float", "unfilterable-float", "depth", "sint", "uint"];
2193
+
2194
+
2195
+ const __wbindgen_enum_GpuTextureViewDimension = ["1d", "2d", "2d-array", "cube", "cube-array", "3d"];
2196
+
2197
+
2198
+ const __wbindgen_enum_XmlHttpRequestResponseType = ["", "arraybuffer", "blob", "document", "json", "text"];
2199
+ const WasmFinalization = (typeof FinalizationRegistry === 'undefined')
2200
+ ? { register: () => {}, unregister: () => {} }
2201
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasm_free(ptr, 1));
2202
+
2203
+ function addHeapObject(obj) {
2204
+ if (heap_next === heap.length) heap.push(heap.length + 1);
2205
+ const idx = heap_next;
2206
+ heap_next = heap[idx];
2207
+
2208
+ heap[idx] = obj;
2209
+ return idx;
2210
+ }
2211
+
2212
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
2213
+ ? { register: () => {}, unregister: () => {} }
2214
+ : new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
2215
+
2216
+ function debugString(val) {
2217
+ // primitive types
2218
+ const type = typeof val;
2219
+ if (type == 'number' || type == 'boolean' || val == null) {
2220
+ return `${val}`;
2221
+ }
2222
+ if (type == 'string') {
2223
+ return `"${val}"`;
2224
+ }
2225
+ if (type == 'symbol') {
2226
+ const description = val.description;
2227
+ if (description == null) {
2228
+ return 'Symbol';
2229
+ } else {
2230
+ return `Symbol(${description})`;
2231
+ }
2232
+ }
2233
+ if (type == 'function') {
2234
+ const name = val.name;
2235
+ if (typeof name == 'string' && name.length > 0) {
2236
+ return `Function(${name})`;
2237
+ } else {
2238
+ return 'Function';
2239
+ }
2240
+ }
2241
+ // objects
2242
+ if (Array.isArray(val)) {
2243
+ const length = val.length;
2244
+ let debug = '[';
2245
+ if (length > 0) {
2246
+ debug += debugString(val[0]);
2247
+ }
2248
+ for(let i = 1; i < length; i++) {
2249
+ debug += ', ' + debugString(val[i]);
2250
+ }
2251
+ debug += ']';
2252
+ return debug;
2253
+ }
2254
+ // Test for built-in
2255
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2256
+ let className;
2257
+ if (builtInMatches && builtInMatches.length > 1) {
2258
+ className = builtInMatches[1];
2259
+ } else {
2260
+ // Failed to match the standard '[object ClassName]'
2261
+ return toString.call(val);
2262
+ }
2263
+ if (className == 'Object') {
2264
+ // we're a user defined class or Object
2265
+ // JSON.stringify avoids problems with cycles, and is generally much
2266
+ // easier than looping through ownProperties of `val`.
2267
+ try {
2268
+ return 'Object(' + JSON.stringify(val) + ')';
2269
+ } catch (_) {
2270
+ return 'Object';
2271
+ }
2272
+ }
2273
+ // errors
2274
+ if (val instanceof Error) {
2275
+ return `${val.name}: ${val.message}\n${val.stack}`;
2276
+ }
2277
+ // TODO we could test for more things here, like `Set`s and `Map`s.
2278
+ return className;
2279
+ }
2280
+
2281
+ function dropObject(idx) {
2282
+ if (idx < 1028) return;
2283
+ heap[idx] = heap_next;
2284
+ heap_next = idx;
2285
+ }
2286
+
2287
+ function getArrayJsValueFromWasm0(ptr, len) {
2288
+ ptr = ptr >>> 0;
2289
+ const mem = getDataViewMemory0();
2290
+ const result = [];
2291
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
2292
+ result.push(takeObject(mem.getUint32(i, true)));
2293
+ }
2294
+ return result;
2295
+ }
2296
+
2297
+ function getArrayU32FromWasm0(ptr, len) {
2298
+ ptr = ptr >>> 0;
2299
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
2300
+ }
2301
+
2302
+ function getArrayU8FromWasm0(ptr, len) {
2303
+ ptr = ptr >>> 0;
2304
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2305
+ }
2306
+
2307
+ let cachedDataViewMemory0 = null;
2308
+ function getDataViewMemory0() {
2309
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
2310
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2311
+ }
2312
+ return cachedDataViewMemory0;
2313
+ }
2314
+
2315
+ function getStringFromWasm0(ptr, len) {
2316
+ return decodeText(ptr >>> 0, len);
2317
+ }
2318
+
2319
+ let cachedUint32ArrayMemory0 = null;
2320
+ function getUint32ArrayMemory0() {
2321
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
2322
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
2323
+ }
2324
+ return cachedUint32ArrayMemory0;
2325
+ }
2326
+
2327
+ let cachedUint8ArrayMemory0 = null;
2328
+ function getUint8ArrayMemory0() {
2329
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2330
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2331
+ }
2332
+ return cachedUint8ArrayMemory0;
2333
+ }
2334
+
2335
+ function getObject(idx) { return heap[idx]; }
2336
+
2337
+ function handleError(f, args) {
2338
+ try {
2339
+ return f.apply(this, args);
2340
+ } catch (e) {
2341
+ wasm.__wbindgen_export3(addHeapObject(e));
2342
+ }
2343
+ }
2344
+
2345
+ let heap = new Array(1024).fill(undefined);
2346
+ heap.push(undefined, null, true, false);
2347
+
2348
+ let heap_next = heap.length;
2349
+
2350
+ function isLikeNone(x) {
2351
+ return x === undefined || x === null;
2352
+ }
2353
+
2354
+ function makeMutClosure(arg0, arg1, f) {
2355
+ const state = { a: arg0, b: arg1, cnt: 1 };
2356
+ const real = (...args) => {
2357
+
2358
+ // First up with a closure we increment the internal reference
2359
+ // count. This ensures that the Rust closure environment won't
2360
+ // be deallocated while we're invoking it.
2361
+ state.cnt++;
2362
+ const a = state.a;
2363
+ state.a = 0;
2364
+ try {
2365
+ return f(a, state.b, ...args);
2366
+ } finally {
2367
+ state.a = a;
2368
+ real._wbg_cb_unref();
2369
+ }
2370
+ };
2371
+ real._wbg_cb_unref = () => {
2372
+ if (--state.cnt === 0) {
2373
+ wasm.__wbindgen_export5(state.a, state.b);
2374
+ state.a = 0;
2375
+ CLOSURE_DTORS.unregister(state);
2376
+ }
2377
+ };
2378
+ CLOSURE_DTORS.register(real, state, state);
2379
+ return real;
2380
+ }
2381
+
2382
+ function passArray8ToWasm0(arg, malloc) {
2383
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
2384
+ getUint8ArrayMemory0().set(arg, ptr / 1);
2385
+ WASM_VECTOR_LEN = arg.length;
2386
+ return ptr;
2387
+ }
2388
+
2389
+ function passArrayJsValueToWasm0(array, malloc) {
2390
+ const ptr = malloc(array.length * 4, 4) >>> 0;
2391
+ const mem = getDataViewMemory0();
2392
+ for (let i = 0; i < array.length; i++) {
2393
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
2394
+ }
2395
+ WASM_VECTOR_LEN = array.length;
2396
+ return ptr;
2397
+ }
2398
+
2399
+ function passStringToWasm0(arg, malloc, realloc) {
2400
+ if (realloc === undefined) {
2401
+ const buf = cachedTextEncoder.encode(arg);
2402
+ const ptr = malloc(buf.length, 1) >>> 0;
2403
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
2404
+ WASM_VECTOR_LEN = buf.length;
2405
+ return ptr;
2406
+ }
2407
+
2408
+ let len = arg.length;
2409
+ let ptr = malloc(len, 1) >>> 0;
2410
+
2411
+ const mem = getUint8ArrayMemory0();
2412
+
2413
+ let offset = 0;
2414
+
2415
+ for (; offset < len; offset++) {
2416
+ const code = arg.charCodeAt(offset);
2417
+ if (code > 0x7F) break;
2418
+ mem[ptr + offset] = code;
2419
+ }
2420
+ if (offset !== len) {
2421
+ if (offset !== 0) {
2422
+ arg = arg.slice(offset);
2423
+ }
2424
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2425
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2426
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2427
+
2428
+ offset += ret.written;
2429
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2430
+ }
2431
+
2432
+ WASM_VECTOR_LEN = offset;
2433
+ return ptr;
2434
+ }
2435
+
2436
+ function takeObject(idx) {
2437
+ const ret = getObject(idx);
2438
+ dropObject(idx);
2439
+ return ret;
2440
+ }
2441
+
2442
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2443
+ cachedTextDecoder.decode();
2444
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
2445
+ let numBytesDecoded = 0;
2446
+ function decodeText(ptr, len) {
2447
+ numBytesDecoded += len;
2448
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
2449
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2450
+ cachedTextDecoder.decode();
2451
+ numBytesDecoded = len;
2452
+ }
2453
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2454
+ }
2455
+
2456
+ const cachedTextEncoder = new TextEncoder();
2457
+
2458
+ if (!('encodeInto' in cachedTextEncoder)) {
2459
+ cachedTextEncoder.encodeInto = function (arg, view) {
2460
+ const buf = cachedTextEncoder.encode(arg);
2461
+ view.set(buf);
2462
+ return {
2463
+ read: arg.length,
2464
+ written: buf.length
2465
+ };
2466
+ };
2467
+ }
1696
2468
 
1697
- const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
2469
+ let WASM_VECTOR_LEN = 0;
2470
+
2471
+ let wasmModule, wasmInstance, wasm;
2472
+ function __wbg_finalize_init(instance, module) {
2473
+ wasmInstance = instance;
2474
+ wasm = instance.exports;
2475
+ wasmModule = module;
2476
+ cachedDataViewMemory0 = null;
2477
+ cachedUint32ArrayMemory0 = null;
2478
+ cachedUint8ArrayMemory0 = null;
2479
+ return wasm;
2480
+ }
1698
2481
 
1699
2482
  async function __wbg_load(module, imports) {
1700
2483
  if (typeof Response === 'function' && module instanceof Response) {
@@ -1702,14 +2485,12 @@ async function __wbg_load(module, imports) {
1702
2485
  try {
1703
2486
  return await WebAssembly.instantiateStreaming(module, imports);
1704
2487
  } catch (e) {
1705
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
2488
+ const validResponse = module.ok && expectedResponseType(module.type);
1706
2489
 
1707
2490
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1708
2491
  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
2492
 
1710
- } else {
1711
- throw e;
1712
- }
2493
+ } else { throw e; }
1713
2494
  }
1714
2495
  }
1715
2496
 
@@ -1724,931 +2505,20 @@ async function __wbg_load(module, imports) {
1724
2505
  return instance;
1725
2506
  }
1726
2507
  }
1727
- }
1728
2508
 
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;
2509
+ function expectedResponseType(type) {
2510
+ switch (type) {
2511
+ case 'basic': case 'cors': case 'default': return true;
2138
2512
  }
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;
2513
+ return false;
2514
+ }
2645
2515
  }
2646
2516
 
2647
2517
  function initSync(module) {
2648
2518
  if (wasm !== undefined) return wasm;
2649
2519
 
2650
2520
 
2651
- if (typeof module !== 'undefined') {
2521
+ if (module !== undefined) {
2652
2522
  if (Object.getPrototypeOf(module) === Object.prototype) {
2653
2523
  ({module} = module)
2654
2524
  } else {
@@ -2668,7 +2538,7 @@ async function __wbg_init(module_or_path) {
2668
2538
  if (wasm !== undefined) return wasm;
2669
2539
 
2670
2540
 
2671
- if (typeof module_or_path !== 'undefined') {
2541
+ if (module_or_path !== undefined) {
2672
2542
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2673
2543
  ({module_or_path} = module_or_path)
2674
2544
  } else {
@@ -2676,7 +2546,7 @@ async function __wbg_init(module_or_path) {
2676
2546
  }
2677
2547
  }
2678
2548
 
2679
- if (typeof module_or_path === 'undefined') {
2549
+ if (module_or_path === undefined) {
2680
2550
  module_or_path = new URL('udoc_bg.wasm', import.meta.url);
2681
2551
  }
2682
2552
  const imports = __wbg_get_imports();
@@ -2690,5 +2560,4 @@ async function __wbg_init(module_or_path) {
2690
2560
  return __wbg_finalize_init(instance, module);
2691
2561
  }
2692
2562
 
2693
- export { initSync };
2694
- export default __wbg_init;
2563
+ export { initSync, __wbg_init as default };