@knopkem/dicomview 0.1.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.
@@ -0,0 +1,1734 @@
1
+ /* @ts-self-types="./dicomview_wasm.d.ts" */
2
+
3
+ /**
4
+ * One JS-visible viewer instance managing four canvases.
5
+ */
6
+ export class Viewer {
7
+ static __wrap(ptr) {
8
+ ptr = ptr >>> 0;
9
+ const obj = Object.create(Viewer.prototype);
10
+ obj.__wbg_ptr = ptr;
11
+ ViewerFinalization.register(obj, obj.__wbg_ptr, obj);
12
+ return obj;
13
+ }
14
+ __destroy_into_raw() {
15
+ const ptr = this.__wbg_ptr;
16
+ this.__wbg_ptr = 0;
17
+ ViewerFinalization.unregister(this);
18
+ return ptr;
19
+ }
20
+ free() {
21
+ const ptr = this.__destroy_into_raw();
22
+ wasm.__wbg_viewer_free(ptr, 0);
23
+ }
24
+ /**
25
+ * Creates a new viewer bound to four canvas elements.
26
+ * @param {any} config
27
+ * @returns {Promise<Viewer>}
28
+ */
29
+ static create(config) {
30
+ const ret = wasm.viewer_create(config);
31
+ return ret;
32
+ }
33
+ /**
34
+ * Explicitly destroys the viewer and releases its resources.
35
+ */
36
+ destroy() {
37
+ const ptr = this.__destroy_into_raw();
38
+ wasm.viewer_destroy(ptr);
39
+ }
40
+ /**
41
+ * Decodes one DICOM Part 10 payload and uploads its frame data.
42
+ * @param {number} z_index
43
+ * @param {Uint8Array} bytes
44
+ */
45
+ feed_dicom_slice(z_index, bytes) {
46
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
47
+ const len0 = WASM_VECTOR_LEN;
48
+ const ret = wasm.viewer_feed_dicom_slice(this.__wbg_ptr, z_index, ptr0, len0);
49
+ if (ret[1]) {
50
+ throw takeFromExternrefTable0(ret[0]);
51
+ }
52
+ }
53
+ /**
54
+ * Uploads one already-decoded signed 16-bit slice.
55
+ * @param {number} z_index
56
+ * @param {Int16Array} pixels
57
+ */
58
+ feed_pixel_slice(z_index, pixels) {
59
+ const ptr0 = passArray16ToWasm0(pixels, wasm.__wbindgen_malloc);
60
+ const len0 = WASM_VECTOR_LEN;
61
+ const ret = wasm.viewer_feed_pixel_slice(this.__wbg_ptr, z_index, ptr0, len0);
62
+ if (ret[1]) {
63
+ throw takeFromExternrefTable0(ret[0]);
64
+ }
65
+ }
66
+ /**
67
+ * Returns the current loading progress in `[0, 1]`.
68
+ * @returns {number}
69
+ */
70
+ loading_progress() {
71
+ const ret = wasm.viewer_loading_progress(this.__wbg_ptr);
72
+ return ret;
73
+ }
74
+ /**
75
+ * Orbits the 3D volume camera.
76
+ * @param {number} dx
77
+ * @param {number} dy
78
+ */
79
+ orbit(dx, dy) {
80
+ const ret = wasm.viewer_orbit(this.__wbg_ptr, dx, dy);
81
+ if (ret[1]) {
82
+ throw takeFromExternrefTable0(ret[0]);
83
+ }
84
+ }
85
+ /**
86
+ * Pans the 3D volume camera.
87
+ * @param {number} dx
88
+ * @param {number} dy
89
+ */
90
+ pan(dx, dy) {
91
+ const ret = wasm.viewer_pan(this.__wbg_ptr, dx, dy);
92
+ if (ret[1]) {
93
+ throw takeFromExternrefTable0(ret[0]);
94
+ }
95
+ }
96
+ /**
97
+ * Prepares an empty volume with the provided geometry object.
98
+ * @param {any} geometry
99
+ */
100
+ prepare_volume(geometry) {
101
+ const ret = wasm.viewer_prepare_volume(this.__wbg_ptr, geometry);
102
+ if (ret[1]) {
103
+ throw takeFromExternrefTable0(ret[0]);
104
+ }
105
+ }
106
+ /**
107
+ * Renders all four canvases.
108
+ */
109
+ render() {
110
+ const ret = wasm.viewer_render(this.__wbg_ptr);
111
+ if (ret[1]) {
112
+ throw takeFromExternrefTable0(ret[0]);
113
+ }
114
+ }
115
+ /**
116
+ * Resets all viewport state back to defaults.
117
+ */
118
+ reset() {
119
+ const ret = wasm.viewer_reset(this.__wbg_ptr);
120
+ if (ret[1]) {
121
+ throw takeFromExternrefTable0(ret[0]);
122
+ }
123
+ }
124
+ /**
125
+ * Scrolls one of the three slice viewports.
126
+ * @param {number} viewport
127
+ * @param {number} delta
128
+ */
129
+ scroll_slice(viewport, delta) {
130
+ const ret = wasm.viewer_scroll_slice(this.__wbg_ptr, viewport, delta);
131
+ if (ret[1]) {
132
+ throw takeFromExternrefTable0(ret[0]);
133
+ }
134
+ }
135
+ /**
136
+ * Selects the active volume blend mode.
137
+ * @param {number} mode
138
+ */
139
+ set_blend_mode(mode) {
140
+ const ret = wasm.viewer_set_blend_mode(this.__wbg_ptr, mode);
141
+ if (ret[1]) {
142
+ throw takeFromExternrefTable0(ret[0]);
143
+ }
144
+ }
145
+ /**
146
+ * Updates the shared MPR crosshair in world coordinates.
147
+ * @param {number} x
148
+ * @param {number} y
149
+ * @param {number} z
150
+ */
151
+ set_crosshair(x, y, z) {
152
+ const ret = wasm.viewer_set_crosshair(this.__wbg_ptr, x, y, z);
153
+ if (ret[1]) {
154
+ throw takeFromExternrefTable0(ret[0]);
155
+ }
156
+ }
157
+ /**
158
+ * Configures thick-slab rendering for one slice viewport.
159
+ * @param {number} viewport
160
+ * @param {number} thickness
161
+ * @param {number} projection
162
+ */
163
+ set_thick_slab(viewport, thickness, projection) {
164
+ const ret = wasm.viewer_set_thick_slab(this.__wbg_ptr, viewport, thickness, projection);
165
+ if (ret[1]) {
166
+ throw takeFromExternrefTable0(ret[0]);
167
+ }
168
+ }
169
+ /**
170
+ * Switches to one of the built-in volume presets.
171
+ * @param {string} name
172
+ */
173
+ set_volume_preset(name) {
174
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
175
+ const len0 = WASM_VECTOR_LEN;
176
+ const ret = wasm.viewer_set_volume_preset(this.__wbg_ptr, ptr0, len0);
177
+ if (ret[1]) {
178
+ throw takeFromExternrefTable0(ret[0]);
179
+ }
180
+ }
181
+ /**
182
+ * Applies one window/level setting to all viewports.
183
+ * @param {number} center
184
+ * @param {number} width
185
+ */
186
+ set_window_level(center, width) {
187
+ const ret = wasm.viewer_set_window_level(this.__wbg_ptr, center, width);
188
+ if (ret[1]) {
189
+ throw takeFromExternrefTable0(ret[0]);
190
+ }
191
+ }
192
+ /**
193
+ * Zooms the 3D volume camera.
194
+ * @param {number} factor
195
+ */
196
+ zoom(factor) {
197
+ const ret = wasm.viewer_zoom(this.__wbg_ptr, factor);
198
+ if (ret[1]) {
199
+ throw takeFromExternrefTable0(ret[0]);
200
+ }
201
+ }
202
+ }
203
+ if (Symbol.dispose) Viewer.prototype[Symbol.dispose] = Viewer.prototype.free;
204
+
205
+ /**
206
+ * A simple WADO-RS series loader with progress reporting and abort support.
207
+ */
208
+ export class WadoLoader {
209
+ __destroy_into_raw() {
210
+ const ptr = this.__wbg_ptr;
211
+ this.__wbg_ptr = 0;
212
+ WadoLoaderFinalization.unregister(this);
213
+ return ptr;
214
+ }
215
+ free() {
216
+ const ptr = this.__destroy_into_raw();
217
+ wasm.__wbg_wadoloader_free(ptr, 0);
218
+ }
219
+ /**
220
+ * Aborts any active in-flight requests.
221
+ */
222
+ abort() {
223
+ wasm.wadoloader_abort(this.__wbg_ptr);
224
+ }
225
+ /**
226
+ * Loads a single-frame DICOM series through WADO-RS metadata and instance retrieval.
227
+ * @param {Viewer} viewer
228
+ * @param {string} wado_root
229
+ * @param {string} study_uid
230
+ * @param {string} series_uid
231
+ * @returns {Promise<void>}
232
+ */
233
+ load_series(viewer, wado_root, study_uid, series_uid) {
234
+ _assertClass(viewer, Viewer);
235
+ const ptr0 = passStringToWasm0(wado_root, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
236
+ const len0 = WASM_VECTOR_LEN;
237
+ const ptr1 = passStringToWasm0(study_uid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
+ const len1 = WASM_VECTOR_LEN;
239
+ const ptr2 = passStringToWasm0(series_uid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
+ const len2 = WASM_VECTOR_LEN;
241
+ const ret = wasm.wadoloader_load_series(this.__wbg_ptr, viewer.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
242
+ return ret;
243
+ }
244
+ /**
245
+ * Returns how many slices have been loaded so far.
246
+ * @returns {number}
247
+ */
248
+ loaded() {
249
+ const ret = wasm.wadoloader_loaded(this.__wbg_ptr);
250
+ return ret >>> 0;
251
+ }
252
+ /**
253
+ * Creates a new loader.
254
+ */
255
+ constructor() {
256
+ const ret = wasm.wadoloader_new();
257
+ this.__wbg_ptr = ret >>> 0;
258
+ WadoLoaderFinalization.register(this, this.__wbg_ptr, this);
259
+ return this;
260
+ }
261
+ /**
262
+ * Returns the total number of slices expected.
263
+ * @returns {number}
264
+ */
265
+ total() {
266
+ const ret = wasm.wadoloader_total(this.__wbg_ptr);
267
+ return ret >>> 0;
268
+ }
269
+ }
270
+ if (Symbol.dispose) WadoLoader.prototype[Symbol.dispose] = WadoLoader.prototype.free;
271
+
272
+ /**
273
+ * Decodes one single-frame DICOM Part 10 payload into signed 16-bit pixels.
274
+ * @param {Uint8Array} bytes
275
+ * @returns {Int16Array}
276
+ */
277
+ export function decode_dicom_pixels(bytes) {
278
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
279
+ const len0 = WASM_VECTOR_LEN;
280
+ const ret = wasm.decode_dicom_pixels(ptr0, len0);
281
+ if (ret[3]) {
282
+ throw takeFromExternrefTable0(ret[2]);
283
+ }
284
+ var v2 = getArrayI16FromWasm0(ret[0], ret[1]).slice();
285
+ wasm.__wbindgen_free(ret[0], ret[1] * 2, 2);
286
+ return v2;
287
+ }
288
+
289
+ /**
290
+ * Initializes the panic hook used by the wasm facade.
291
+ */
292
+ export function init() {
293
+ wasm.init();
294
+ }
295
+
296
+ function __wbg_get_imports() {
297
+ const import0 = {
298
+ __proto__: null,
299
+ __wbg_Window_5bac5165340af82e: function(arg0) {
300
+ const ret = arg0.Window;
301
+ return ret;
302
+ },
303
+ __wbg_WorkerGlobalScope_d0d150069210a6e8: function(arg0) {
304
+ const ret = arg0.WorkerGlobalScope;
305
+ return ret;
306
+ },
307
+ __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
308
+ const ret = debugString(arg1);
309
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
310
+ const len1 = WASM_VECTOR_LEN;
311
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
312
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
313
+ },
314
+ __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
315
+ const ret = typeof(arg0) === 'function';
316
+ return ret;
317
+ },
318
+ __wbg___wbindgen_is_null_344c8750a8525473: function(arg0) {
319
+ const ret = arg0 === null;
320
+ return ret;
321
+ },
322
+ __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
323
+ const ret = arg0 === undefined;
324
+ return ret;
325
+ },
326
+ __wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
327
+ const obj = arg1;
328
+ const ret = typeof(obj) === 'number' ? obj : undefined;
329
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
330
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
331
+ },
332
+ __wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
333
+ const obj = arg1;
334
+ const ret = typeof(obj) === 'string' ? obj : undefined;
335
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
+ var len1 = WASM_VECTOR_LEN;
337
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
338
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
339
+ },
340
+ __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
341
+ throw new Error(getStringFromWasm0(arg0, arg1));
342
+ },
343
+ __wbg__wbg_cb_unref_3c3b4f651835fbcb: function(arg0) {
344
+ arg0._wbg_cb_unref();
345
+ },
346
+ __wbg_abort_5ee4083ce26e0b01: function(arg0) {
347
+ arg0.abort();
348
+ },
349
+ __wbg_arrayBuffer_dae084a298aa5fe0: function() { return handleError(function (arg0) {
350
+ const ret = arg0.arrayBuffer();
351
+ return ret;
352
+ }, arguments); },
353
+ __wbg_beginRenderPass_a19cc6156a7858b4: function() { return handleError(function (arg0, arg1) {
354
+ const ret = arg0.beginRenderPass(arg1);
355
+ return ret;
356
+ }, arguments); },
357
+ __wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {
358
+ const ret = arg0.call(arg1, arg2);
359
+ return ret;
360
+ }, arguments); },
361
+ __wbg_configure_16541864db644c70: function() { return handleError(function (arg0, arg1) {
362
+ arg0.configure(arg1);
363
+ }, arguments); },
364
+ __wbg_createBindGroupLayout_adb8337a6808ae24: function() { return handleError(function (arg0, arg1) {
365
+ const ret = arg0.createBindGroupLayout(arg1);
366
+ return ret;
367
+ }, arguments); },
368
+ __wbg_createBindGroup_91159ca759115307: function(arg0, arg1) {
369
+ const ret = arg0.createBindGroup(arg1);
370
+ return ret;
371
+ },
372
+ __wbg_createBuffer_59de141e89014140: function() { return handleError(function (arg0, arg1) {
373
+ const ret = arg0.createBuffer(arg1);
374
+ return ret;
375
+ }, arguments); },
376
+ __wbg_createCommandEncoder_dc2b2ca6f09bd4c3: function(arg0, arg1) {
377
+ const ret = arg0.createCommandEncoder(arg1);
378
+ return ret;
379
+ },
380
+ __wbg_createPipelineLayout_a5290f84492f8b1e: function(arg0, arg1) {
381
+ const ret = arg0.createPipelineLayout(arg1);
382
+ return ret;
383
+ },
384
+ __wbg_createRenderPipeline_f7aca470ad8ce865: function() { return handleError(function (arg0, arg1) {
385
+ const ret = arg0.createRenderPipeline(arg1);
386
+ return ret;
387
+ }, arguments); },
388
+ __wbg_createSampler_6b972cd00bcc5dfb: function(arg0, arg1) {
389
+ const ret = arg0.createSampler(arg1);
390
+ return ret;
391
+ },
392
+ __wbg_createShaderModule_bbe0476992dd060e: function(arg0, arg1) {
393
+ const ret = arg0.createShaderModule(arg1);
394
+ return ret;
395
+ },
396
+ __wbg_createTexture_011d4b0badf853e3: function() { return handleError(function (arg0, arg1) {
397
+ const ret = arg0.createTexture(arg1);
398
+ return ret;
399
+ }, arguments); },
400
+ __wbg_createView_1ef8f1ddc16facb0: function() { return handleError(function (arg0, arg1) {
401
+ const ret = arg0.createView(arg1);
402
+ return ret;
403
+ }, arguments); },
404
+ __wbg_document_a28a21ae315de4ea: function(arg0) {
405
+ const ret = arg0.document;
406
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
407
+ },
408
+ __wbg_draw_9a35daa0096c6f2c: function(arg0, arg1, arg2, arg3, arg4) {
409
+ arg0.draw(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
410
+ },
411
+ __wbg_encodeURIComponent_6544b08f22e093a3: function(arg0, arg1) {
412
+ const ret = encodeURIComponent(getStringFromWasm0(arg0, arg1));
413
+ return ret;
414
+ },
415
+ __wbg_end_1db12af2e0ff1235: function(arg0) {
416
+ arg0.end();
417
+ },
418
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
419
+ let deferred0_0;
420
+ let deferred0_1;
421
+ try {
422
+ deferred0_0 = arg0;
423
+ deferred0_1 = arg1;
424
+ console.error(getStringFromWasm0(arg0, arg1));
425
+ } finally {
426
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
427
+ }
428
+ },
429
+ __wbg_fetch_0e70fe3bd20ee8c4: function(arg0, arg1) {
430
+ const ret = arg0.fetch(arg1);
431
+ return ret;
432
+ },
433
+ __wbg_finish_48a7b6da7b76999e: function(arg0) {
434
+ const ret = arg0.finish();
435
+ return ret;
436
+ },
437
+ __wbg_finish_68d7c5925d3fa394: function(arg0, arg1) {
438
+ const ret = arg0.finish(arg1);
439
+ return ret;
440
+ },
441
+ __wbg_getContext_8ab47e12b2ed57e5: function() { return handleError(function (arg0, arg1, arg2) {
442
+ const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
443
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
444
+ }, arguments); },
445
+ __wbg_getContext_8f1ff363618c55da: function() { return handleError(function (arg0, arg1, arg2) {
446
+ const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
447
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
448
+ }, arguments); },
449
+ __wbg_getCurrentTexture_9b00da7f6bc38606: function() { return handleError(function (arg0) {
450
+ const ret = arg0.getCurrentTexture();
451
+ return ret;
452
+ }, arguments); },
453
+ __wbg_getPreferredCanvasFormat_54381f1ef7aec03d: function(arg0) {
454
+ const ret = arg0.getPreferredCanvasFormat();
455
+ return (__wbindgen_enum_GpuTextureFormat.indexOf(ret) + 1 || 96) - 1;
456
+ },
457
+ __wbg_get_4848e350b40afc16: function(arg0, arg1) {
458
+ const ret = arg0[arg1 >>> 0];
459
+ return ret;
460
+ },
461
+ __wbg_get_753152eb19d860b1: function(arg0, arg1) {
462
+ const ret = arg0[arg1 >>> 0];
463
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
464
+ },
465
+ __wbg_get_f96702c6245e4ef9: function() { return handleError(function (arg0, arg1) {
466
+ const ret = Reflect.get(arg0, arg1);
467
+ return ret;
468
+ }, arguments); },
469
+ __wbg_get_unchecked_7d7babe32e9e6a54: function(arg0, arg1) {
470
+ const ret = arg0[arg1 >>> 0];
471
+ return ret;
472
+ },
473
+ __wbg_gpu_3f9d7df9a18237f8: function(arg0) {
474
+ const ret = arg0.gpu;
475
+ return ret;
476
+ },
477
+ __wbg_headers_f82eee91a0c91695: function(arg0) {
478
+ const ret = arg0.headers;
479
+ return ret;
480
+ },
481
+ __wbg_height_734034c3ff2654af: function(arg0) {
482
+ const ret = arg0.height;
483
+ return ret;
484
+ },
485
+ __wbg_instanceof_GpuAdapter_dc7e13c1676da9bd: function(arg0) {
486
+ let result;
487
+ try {
488
+ result = arg0 instanceof GPUAdapter;
489
+ } catch (_) {
490
+ result = false;
491
+ }
492
+ const ret = result;
493
+ return ret;
494
+ },
495
+ __wbg_instanceof_GpuCanvasContext_c2609c698a76a6b6: function(arg0) {
496
+ let result;
497
+ try {
498
+ result = arg0 instanceof GPUCanvasContext;
499
+ } catch (_) {
500
+ result = false;
501
+ }
502
+ const ret = result;
503
+ return ret;
504
+ },
505
+ __wbg_instanceof_HtmlCanvasElement_3cec11b30b0d54e4: function(arg0) {
506
+ let result;
507
+ try {
508
+ result = arg0 instanceof HTMLCanvasElement;
509
+ } catch (_) {
510
+ result = false;
511
+ }
512
+ const ret = result;
513
+ return ret;
514
+ },
515
+ __wbg_instanceof_Response_06795eab66cc4036: function(arg0) {
516
+ let result;
517
+ try {
518
+ result = arg0 instanceof Response;
519
+ } catch (_) {
520
+ result = false;
521
+ }
522
+ const ret = result;
523
+ return ret;
524
+ },
525
+ __wbg_instanceof_Window_c0fee4c064502536: function(arg0) {
526
+ let result;
527
+ try {
528
+ result = arg0 instanceof Window;
529
+ } catch (_) {
530
+ result = false;
531
+ }
532
+ const ret = result;
533
+ return ret;
534
+ },
535
+ __wbg_isArray_db61795ad004c139: function(arg0) {
536
+ const ret = Array.isArray(arg0);
537
+ return ret;
538
+ },
539
+ __wbg_json_f488a10b6520fb79: function() { return handleError(function (arg0) {
540
+ const ret = arg0.json();
541
+ return ret;
542
+ }, arguments); },
543
+ __wbg_label_18cae34ff19933d7: function(arg0, arg1) {
544
+ const ret = arg1.label;
545
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
546
+ const len1 = WASM_VECTOR_LEN;
547
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
548
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
549
+ },
550
+ __wbg_length_0c32cb8543c8e4c8: function(arg0) {
551
+ const ret = arg0.length;
552
+ return ret;
553
+ },
554
+ __wbg_length_6e821edde497a532: function(arg0) {
555
+ const ret = arg0.length;
556
+ return ret;
557
+ },
558
+ __wbg_mapAsync_288e2fddbc3f7f7b: function(arg0, arg1, arg2, arg3) {
559
+ const ret = arg0.mapAsync(arg1 >>> 0, arg2, arg3);
560
+ return ret;
561
+ },
562
+ __wbg_navigator_9b09ea705d03d227: function(arg0) {
563
+ const ret = arg0.navigator;
564
+ return ret;
565
+ },
566
+ __wbg_navigator_af52153252bdf29d: function(arg0) {
567
+ const ret = arg0.navigator;
568
+ return ret;
569
+ },
570
+ __wbg_new_227d7c05414eb861: function() {
571
+ const ret = new Error();
572
+ return ret;
573
+ },
574
+ __wbg_new_4f9fafbb3909af72: function() {
575
+ const ret = new Object();
576
+ return ret;
577
+ },
578
+ __wbg_new_9abbf7148481485e: function() { return handleError(function () {
579
+ const ret = new AbortController();
580
+ return ret;
581
+ }, arguments); },
582
+ __wbg_new_a560378ea1240b14: function(arg0) {
583
+ const ret = new Uint8Array(arg0);
584
+ return ret;
585
+ },
586
+ __wbg_new_f3c9df4f38f3f798: function() {
587
+ const ret = new Array();
588
+ return ret;
589
+ },
590
+ __wbg_new_typed_14d7cc391ce53d2c: function(arg0, arg1) {
591
+ try {
592
+ var state0 = {a: arg0, b: arg1};
593
+ var cb0 = (arg0, arg1) => {
594
+ const a = state0.a;
595
+ state0.a = 0;
596
+ try {
597
+ return wasm_bindgen__convert__closures_____invoke__h6a18030bf0401ad0(a, state0.b, arg0, arg1);
598
+ } finally {
599
+ state0.a = a;
600
+ }
601
+ };
602
+ const ret = new Promise(cb0);
603
+ return ret;
604
+ } finally {
605
+ state0.a = 0;
606
+ }
607
+ },
608
+ __wbg_new_with_str_and_init_f663b6d334baa878: function() { return handleError(function (arg0, arg1, arg2) {
609
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
610
+ return ret;
611
+ }, arguments); },
612
+ __wbg_ok_36f7b13b74596c24: function(arg0) {
613
+ const ret = arg0.ok;
614
+ return ret;
615
+ },
616
+ __wbg_onSubmittedWorkDone_81e152567230130a: function(arg0) {
617
+ const ret = arg0.onSubmittedWorkDone();
618
+ return ret;
619
+ },
620
+ __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
621
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
622
+ },
623
+ __wbg_push_6bdbc990be5ac37b: function(arg0, arg1) {
624
+ const ret = arg0.push(arg1);
625
+ return ret;
626
+ },
627
+ __wbg_querySelectorAll_301982e9e4864dfa: function() { return handleError(function (arg0, arg1, arg2) {
628
+ const ret = arg0.querySelectorAll(getStringFromWasm0(arg1, arg2));
629
+ return ret;
630
+ }, arguments); },
631
+ __wbg_queueMicrotask_abaf92f0bd4e80a4: function(arg0) {
632
+ const ret = arg0.queueMicrotask;
633
+ return ret;
634
+ },
635
+ __wbg_queueMicrotask_df5a6dac26d818f3: function(arg0) {
636
+ queueMicrotask(arg0);
637
+ },
638
+ __wbg_queue_81f5d725809ccd54: function(arg0) {
639
+ const ret = arg0.queue;
640
+ return ret;
641
+ },
642
+ __wbg_requestAdapter_90f7496e67f82c21: function(arg0, arg1) {
643
+ const ret = arg0.requestAdapter(arg1);
644
+ return ret;
645
+ },
646
+ __wbg_requestDevice_5c307ce72228d3f7: function(arg0, arg1) {
647
+ const ret = arg0.requestDevice(arg1);
648
+ return ret;
649
+ },
650
+ __wbg_resolve_0a79de24e9d2267b: function(arg0) {
651
+ const ret = Promise.resolve(arg0);
652
+ return ret;
653
+ },
654
+ __wbg_setBindGroup_58960c4b1bcdd182: function(arg0, arg1, arg2) {
655
+ arg0.setBindGroup(arg1 >>> 0, arg2);
656
+ },
657
+ __wbg_setBindGroup_a62f9de1cb2449b2: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
658
+ arg0.setBindGroup(arg1 >>> 0, arg2, getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
659
+ }, arguments); },
660
+ __wbg_setPipeline_9f6b0a3c5901572d: function(arg0, arg1) {
661
+ arg0.setPipeline(arg1);
662
+ },
663
+ __wbg_setViewport_007a2c7160c6bedb: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
664
+ arg0.setViewport(arg1, arg2, arg3, arg4, arg5, arg6);
665
+ },
666
+ __wbg_set_8ee2d34facb8466e: function() { return handleError(function (arg0, arg1, arg2) {
667
+ const ret = Reflect.set(arg0, arg1, arg2);
668
+ return ret;
669
+ }, arguments); },
670
+ __wbg_set_a_2f4495829c853bba: function(arg0, arg1) {
671
+ arg0.a = arg1;
672
+ },
673
+ __wbg_set_aa391f3af1ff0e9c: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
674
+ arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
675
+ }, arguments); },
676
+ __wbg_set_access_802ef755476d4064: function(arg0, arg1) {
677
+ arg0.access = __wbindgen_enum_GpuStorageTextureAccess[arg1];
678
+ },
679
+ __wbg_set_address_mode_u_c13cdf94d097b16d: function(arg0, arg1) {
680
+ arg0.addressModeU = __wbindgen_enum_GpuAddressMode[arg1];
681
+ },
682
+ __wbg_set_address_mode_v_c09db9861cd052a6: function(arg0, arg1) {
683
+ arg0.addressModeV = __wbindgen_enum_GpuAddressMode[arg1];
684
+ },
685
+ __wbg_set_address_mode_w_0b49c35f3d4322bf: function(arg0, arg1) {
686
+ arg0.addressModeW = __wbindgen_enum_GpuAddressMode[arg1];
687
+ },
688
+ __wbg_set_alpha_29642d2219224544: function(arg0, arg1) {
689
+ arg0.alpha = arg1;
690
+ },
691
+ __wbg_set_alpha_mode_65ba0adaef90e1f3: function(arg0, arg1) {
692
+ arg0.alphaMode = __wbindgen_enum_GpuCanvasAlphaMode[arg1];
693
+ },
694
+ __wbg_set_alpha_to_coverage_enabled_ab6a22e18e338493: function(arg0, arg1) {
695
+ arg0.alphaToCoverageEnabled = arg1 !== 0;
696
+ },
697
+ __wbg_set_array_layer_count_de83f575c3f6d15e: function(arg0, arg1) {
698
+ arg0.arrayLayerCount = arg1 >>> 0;
699
+ },
700
+ __wbg_set_array_stride_2033aeb8a42130f9: function(arg0, arg1) {
701
+ arg0.arrayStride = arg1;
702
+ },
703
+ __wbg_set_aspect_4c0237c8f21de349: function(arg0, arg1) {
704
+ arg0.aspect = __wbindgen_enum_GpuTextureAspect[arg1];
705
+ },
706
+ __wbg_set_aspect_feb0fac859e82372: function(arg0, arg1) {
707
+ arg0.aspect = __wbindgen_enum_GpuTextureAspect[arg1];
708
+ },
709
+ __wbg_set_attributes_39e5a71bf05309a6: function(arg0, arg1) {
710
+ arg0.attributes = arg1;
711
+ },
712
+ __wbg_set_b_7081554879455e65: function(arg0, arg1) {
713
+ arg0.b = arg1;
714
+ },
715
+ __wbg_set_base_array_layer_ab196aad24c8fac6: function(arg0, arg1) {
716
+ arg0.baseArrayLayer = arg1 >>> 0;
717
+ },
718
+ __wbg_set_base_mip_level_15d29fc182e25a82: function(arg0, arg1) {
719
+ arg0.baseMipLevel = arg1 >>> 0;
720
+ },
721
+ __wbg_set_beginning_of_pass_write_index_c2f97408798615ca: function(arg0, arg1) {
722
+ arg0.beginningOfPassWriteIndex = arg1 >>> 0;
723
+ },
724
+ __wbg_set_bind_group_layouts_5c298441f47e30a1: function(arg0, arg1) {
725
+ arg0.bindGroupLayouts = arg1;
726
+ },
727
+ __wbg_set_binding_234b4c508d19a0a8: function(arg0, arg1) {
728
+ arg0.binding = arg1 >>> 0;
729
+ },
730
+ __wbg_set_binding_fd933455b600a07f: function(arg0, arg1) {
731
+ arg0.binding = arg1 >>> 0;
732
+ },
733
+ __wbg_set_blend_1dbdd086fc4fdebf: function(arg0, arg1) {
734
+ arg0.blend = arg1;
735
+ },
736
+ __wbg_set_buffer_8f0ef5be1b92d605: function(arg0, arg1) {
737
+ arg0.buffer = arg1;
738
+ },
739
+ __wbg_set_buffer_b04e4d70b1eb4630: function(arg0, arg1) {
740
+ arg0.buffer = arg1;
741
+ },
742
+ __wbg_set_buffers_3f9c487ea01dddcf: function(arg0, arg1) {
743
+ arg0.buffers = arg1;
744
+ },
745
+ __wbg_set_bytes_per_row_39bcca8e0c25e0ee: function(arg0, arg1) {
746
+ arg0.bytesPerRow = arg1 >>> 0;
747
+ },
748
+ __wbg_set_clear_value_1663cbe7da00e7e4: function(arg0, arg1) {
749
+ arg0.clearValue = arg1;
750
+ },
751
+ __wbg_set_code_3bb44fc02aa17153: function(arg0, arg1, arg2) {
752
+ arg0.code = getStringFromWasm0(arg1, arg2);
753
+ },
754
+ __wbg_set_color_attachments_b740d060dacde5c0: function(arg0, arg1) {
755
+ arg0.colorAttachments = arg1;
756
+ },
757
+ __wbg_set_color_d0208d092af4f2e6: function(arg0, arg1) {
758
+ arg0.color = arg1;
759
+ },
760
+ __wbg_set_compare_00dc33383c873ad5: function(arg0, arg1) {
761
+ arg0.compare = __wbindgen_enum_GpuCompareFunction[arg1];
762
+ },
763
+ __wbg_set_compare_11834994f7d75687: function(arg0, arg1) {
764
+ arg0.compare = __wbindgen_enum_GpuCompareFunction[arg1];
765
+ },
766
+ __wbg_set_count_ab42cbc78635ed91: function(arg0, arg1) {
767
+ arg0.count = arg1 >>> 0;
768
+ },
769
+ __wbg_set_cull_mode_c4f1ef740bd14c40: function(arg0, arg1) {
770
+ arg0.cullMode = __wbindgen_enum_GpuCullMode[arg1];
771
+ },
772
+ __wbg_set_depth_bias_clamp_f573c2dda55692a6: function(arg0, arg1) {
773
+ arg0.depthBiasClamp = arg1;
774
+ },
775
+ __wbg_set_depth_bias_ebe05aecbb98e11f: function(arg0, arg1) {
776
+ arg0.depthBias = arg1;
777
+ },
778
+ __wbg_set_depth_bias_slope_scale_27c8208740c46086: function(arg0, arg1) {
779
+ arg0.depthBiasSlopeScale = arg1;
780
+ },
781
+ __wbg_set_depth_clear_value_57c2283d39fbb181: function(arg0, arg1) {
782
+ arg0.depthClearValue = arg1;
783
+ },
784
+ __wbg_set_depth_compare_a9c538cec0e01535: function(arg0, arg1) {
785
+ arg0.depthCompare = __wbindgen_enum_GpuCompareFunction[arg1];
786
+ },
787
+ __wbg_set_depth_fail_op_42b9d46a7c67baae: function(arg0, arg1) {
788
+ arg0.depthFailOp = __wbindgen_enum_GpuStencilOperation[arg1];
789
+ },
790
+ __wbg_set_depth_load_op_f95fdb158b819261: function(arg0, arg1) {
791
+ arg0.depthLoadOp = __wbindgen_enum_GpuLoadOp[arg1];
792
+ },
793
+ __wbg_set_depth_or_array_layers_7335d3fc04cd5ade: function(arg0, arg1) {
794
+ arg0.depthOrArrayLayers = arg1 >>> 0;
795
+ },
796
+ __wbg_set_depth_read_only_878b741b02a4dd71: function(arg0, arg1) {
797
+ arg0.depthReadOnly = arg1 !== 0;
798
+ },
799
+ __wbg_set_depth_stencil_1c7bed669574dd1e: function(arg0, arg1) {
800
+ arg0.depthStencil = arg1;
801
+ },
802
+ __wbg_set_depth_stencil_attachment_82ce8924f4e0e79b: function(arg0, arg1) {
803
+ arg0.depthStencilAttachment = arg1;
804
+ },
805
+ __wbg_set_depth_store_op_4c56ab1d005c7bf6: function(arg0, arg1) {
806
+ arg0.depthStoreOp = __wbindgen_enum_GpuStoreOp[arg1];
807
+ },
808
+ __wbg_set_depth_write_enabled_f726d4f27a24ff7e: function(arg0, arg1) {
809
+ arg0.depthWriteEnabled = arg1 !== 0;
810
+ },
811
+ __wbg_set_device_f991f8a955db69f7: function(arg0, arg1) {
812
+ arg0.device = arg1;
813
+ },
814
+ __wbg_set_dimension_7ca3d24380d365e4: function(arg0, arg1) {
815
+ arg0.dimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
816
+ },
817
+ __wbg_set_dimension_87dd70a08e54ea98: function(arg0, arg1) {
818
+ arg0.dimension = __wbindgen_enum_GpuTextureDimension[arg1];
819
+ },
820
+ __wbg_set_dst_factor_1382684d97e2aec4: function(arg0, arg1) {
821
+ arg0.dstFactor = __wbindgen_enum_GpuBlendFactor[arg1];
822
+ },
823
+ __wbg_set_end_of_pass_write_index_3476a9a4411846af: function(arg0, arg1) {
824
+ arg0.endOfPassWriteIndex = arg1 >>> 0;
825
+ },
826
+ __wbg_set_entries_44ee8dc60918063d: function(arg0, arg1) {
827
+ arg0.entries = arg1;
828
+ },
829
+ __wbg_set_entries_803b89386febf57c: function(arg0, arg1) {
830
+ arg0.entries = arg1;
831
+ },
832
+ __wbg_set_entry_point_418e5aecbf7f95b4: function(arg0, arg1, arg2) {
833
+ arg0.entryPoint = getStringFromWasm0(arg1, arg2);
834
+ },
835
+ __wbg_set_entry_point_ac45ddee35909233: function(arg0, arg1, arg2) {
836
+ arg0.entryPoint = getStringFromWasm0(arg1, arg2);
837
+ },
838
+ __wbg_set_external_texture_73d5e5303574a1e8: function(arg0, arg1) {
839
+ arg0.externalTexture = arg1;
840
+ },
841
+ __wbg_set_fail_op_6f4612035f584d02: function(arg0, arg1) {
842
+ arg0.failOp = __wbindgen_enum_GpuStencilOperation[arg1];
843
+ },
844
+ __wbg_set_format_2bd90cb220cc6884: function(arg0, arg1) {
845
+ arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
846
+ },
847
+ __wbg_set_format_3cc5d6ead9a8cce0: function(arg0, arg1) {
848
+ arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
849
+ },
850
+ __wbg_set_format_40d793124494a9df: function(arg0, arg1) {
851
+ arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
852
+ },
853
+ __wbg_set_format_723d6bb38a9e71d3: function(arg0, arg1) {
854
+ arg0.format = __wbindgen_enum_GpuVertexFormat[arg1];
855
+ },
856
+ __wbg_set_format_c23f7c142762c3a7: function(arg0, arg1) {
857
+ arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
858
+ },
859
+ __wbg_set_format_e0af83ab86ee58dc: function(arg0, arg1) {
860
+ arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
861
+ },
862
+ __wbg_set_format_fcbaa54d6b5c186a: function(arg0, arg1) {
863
+ arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
864
+ },
865
+ __wbg_set_fragment_9b5673b1b740fe0e: function(arg0, arg1) {
866
+ arg0.fragment = arg1;
867
+ },
868
+ __wbg_set_front_face_bb590812353fd2e0: function(arg0, arg1) {
869
+ arg0.frontFace = __wbindgen_enum_GpuFrontFace[arg1];
870
+ },
871
+ __wbg_set_g_aa23517844bd7f61: function(arg0, arg1) {
872
+ arg0.g = arg1;
873
+ },
874
+ __wbg_set_has_dynamic_offset_ea1fb6bd94b0c904: function(arg0, arg1) {
875
+ arg0.hasDynamicOffset = arg1 !== 0;
876
+ },
877
+ __wbg_set_height_26ab95ff99e2b620: function(arg0, arg1) {
878
+ arg0.height = arg1 >>> 0;
879
+ },
880
+ __wbg_set_height_66583e77881d3a51: function(arg0, arg1) {
881
+ arg0.height = arg1 >>> 0;
882
+ },
883
+ __wbg_set_height_7d0bbaf691aeef8f: function(arg0, arg1) {
884
+ arg0.height = arg1 >>> 0;
885
+ },
886
+ __wbg_set_label_08e9f27a97fdc9f7: function(arg0, arg1, arg2) {
887
+ arg0.label = getStringFromWasm0(arg1, arg2);
888
+ },
889
+ __wbg_set_label_0e9f90ea4e961823: function(arg0, arg1, arg2) {
890
+ arg0.label = getStringFromWasm0(arg1, arg2);
891
+ },
892
+ __wbg_set_label_280bd57b618e4cf6: function(arg0, arg1, arg2) {
893
+ arg0.label = getStringFromWasm0(arg1, arg2);
894
+ },
895
+ __wbg_set_label_34d2766c2203f76a: function(arg0, arg1, arg2) {
896
+ arg0.label = getStringFromWasm0(arg1, arg2);
897
+ },
898
+ __wbg_set_label_4bf9f5458cdc0a68: function(arg0, arg1, arg2) {
899
+ arg0.label = getStringFromWasm0(arg1, arg2);
900
+ },
901
+ __wbg_set_label_797345a8c9c86146: function(arg0, arg1, arg2) {
902
+ arg0.label = getStringFromWasm0(arg1, arg2);
903
+ },
904
+ __wbg_set_label_8fdd5f28eea3ca08: function(arg0, arg1, arg2) {
905
+ arg0.label = getStringFromWasm0(arg1, arg2);
906
+ },
907
+ __wbg_set_label_a4be4acc3510c62f: function(arg0, arg1, arg2) {
908
+ arg0.label = getStringFromWasm0(arg1, arg2);
909
+ },
910
+ __wbg_set_label_bb92451e0d92abf4: function(arg0, arg1, arg2) {
911
+ arg0.label = getStringFromWasm0(arg1, arg2);
912
+ },
913
+ __wbg_set_label_c3405868bd8f6ab5: function(arg0, arg1, arg2) {
914
+ arg0.label = getStringFromWasm0(arg1, arg2);
915
+ },
916
+ __wbg_set_label_d73358f96a62d3bc: function(arg0, arg1, arg2) {
917
+ arg0.label = getStringFromWasm0(arg1, arg2);
918
+ },
919
+ __wbg_set_label_f00eb249a34df7db: function(arg0, arg1, arg2) {
920
+ arg0.label = getStringFromWasm0(arg1, arg2);
921
+ },
922
+ __wbg_set_label_f571593aaa82f18b: function(arg0, arg1, arg2) {
923
+ arg0.label = getStringFromWasm0(arg1, arg2);
924
+ },
925
+ __wbg_set_layout_9590b02a1d72ac45: function(arg0, arg1) {
926
+ arg0.layout = arg1;
927
+ },
928
+ __wbg_set_layout_a065a939d1d05a2d: function(arg0, arg1) {
929
+ arg0.layout = arg1;
930
+ },
931
+ __wbg_set_load_op_07c59d4ab60a3a01: function(arg0, arg1) {
932
+ arg0.loadOp = __wbindgen_enum_GpuLoadOp[arg1];
933
+ },
934
+ __wbg_set_lod_max_clamp_fd1548dc78538913: function(arg0, arg1) {
935
+ arg0.lodMaxClamp = arg1;
936
+ },
937
+ __wbg_set_lod_min_clamp_b489016289e378d2: function(arg0, arg1) {
938
+ arg0.lodMinClamp = arg1;
939
+ },
940
+ __wbg_set_mag_filter_b4e8d7f2fa665d2e: function(arg0, arg1) {
941
+ arg0.magFilter = __wbindgen_enum_GpuFilterMode[arg1];
942
+ },
943
+ __wbg_set_mapped_at_creation_c78869832c67816c: function(arg0, arg1) {
944
+ arg0.mappedAtCreation = arg1 !== 0;
945
+ },
946
+ __wbg_set_mask_cee9de29cbe61459: function(arg0, arg1) {
947
+ arg0.mask = arg1 >>> 0;
948
+ },
949
+ __wbg_set_max_anisotropy_a019fd38d9ba634e: function(arg0, arg1) {
950
+ arg0.maxAnisotropy = arg1;
951
+ },
952
+ __wbg_set_method_1971272fe557e972: function(arg0, arg1, arg2) {
953
+ arg0.method = getStringFromWasm0(arg1, arg2);
954
+ },
955
+ __wbg_set_min_binding_size_26f877007450686c: function(arg0, arg1) {
956
+ arg0.minBindingSize = arg1;
957
+ },
958
+ __wbg_set_min_filter_cd8cf3dcdeebaa5b: function(arg0, arg1) {
959
+ arg0.minFilter = __wbindgen_enum_GpuFilterMode[arg1];
960
+ },
961
+ __wbg_set_mip_level_161666aedb691ca3: function(arg0, arg1) {
962
+ arg0.mipLevel = arg1 >>> 0;
963
+ },
964
+ __wbg_set_mip_level_count_1993f039035d2469: function(arg0, arg1) {
965
+ arg0.mipLevelCount = arg1 >>> 0;
966
+ },
967
+ __wbg_set_mip_level_count_9a86e098393fe360: function(arg0, arg1) {
968
+ arg0.mipLevelCount = arg1 >>> 0;
969
+ },
970
+ __wbg_set_mipmap_filter_a436d61249cfa785: function(arg0, arg1) {
971
+ arg0.mipmapFilter = __wbindgen_enum_GpuMipmapFilterMode[arg1];
972
+ },
973
+ __wbg_set_mode_d1b643087602281a: function(arg0, arg1) {
974
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
975
+ },
976
+ __wbg_set_module_951f2b6e5477a260: function(arg0, arg1) {
977
+ arg0.module = arg1;
978
+ },
979
+ __wbg_set_module_a7b3448454ca8879: function(arg0, arg1) {
980
+ arg0.module = arg1;
981
+ },
982
+ __wbg_set_multisample_bb6537e862d91237: function(arg0, arg1) {
983
+ arg0.multisample = arg1;
984
+ },
985
+ __wbg_set_multisampled_9642e942e4d9d3ee: function(arg0, arg1) {
986
+ arg0.multisampled = arg1 !== 0;
987
+ },
988
+ __wbg_set_offset_3e55dd16ffd7aac5: function(arg0, arg1) {
989
+ arg0.offset = arg1;
990
+ },
991
+ __wbg_set_offset_a3a60cec10207186: function(arg0, arg1) {
992
+ arg0.offset = arg1;
993
+ },
994
+ __wbg_set_offset_debfe602a5fbf272: function(arg0, arg1) {
995
+ arg0.offset = arg1;
996
+ },
997
+ __wbg_set_operation_74a529d361734388: function(arg0, arg1) {
998
+ arg0.operation = __wbindgen_enum_GpuBlendOperation[arg1];
999
+ },
1000
+ __wbg_set_origin_d09654f499e9edb8: function(arg0, arg1) {
1001
+ arg0.origin = arg1;
1002
+ },
1003
+ __wbg_set_pass_op_8abd39478c76666a: function(arg0, arg1) {
1004
+ arg0.passOp = __wbindgen_enum_GpuStencilOperation[arg1];
1005
+ },
1006
+ __wbg_set_power_preference_b8b4ea5da6674cf7: function(arg0, arg1) {
1007
+ arg0.powerPreference = __wbindgen_enum_GpuPowerPreference[arg1];
1008
+ },
1009
+ __wbg_set_primitive_f189fcdcb22d09e0: function(arg0, arg1) {
1010
+ arg0.primitive = arg1;
1011
+ },
1012
+ __wbg_set_query_set_dcf406a51ece8f85: function(arg0, arg1) {
1013
+ arg0.querySet = arg1;
1014
+ },
1015
+ __wbg_set_r_8961014434a7656e: function(arg0, arg1) {
1016
+ arg0.r = arg1;
1017
+ },
1018
+ __wbg_set_required_features_ec67124fd26c4d29: function(arg0, arg1) {
1019
+ arg0.requiredFeatures = arg1;
1020
+ },
1021
+ __wbg_set_required_limits_c9ee7006f1d1f2ab: function(arg0, arg1) {
1022
+ arg0.requiredLimits = arg1;
1023
+ },
1024
+ __wbg_set_resolve_target_cc7a6f0d2973ea34: function(arg0, arg1) {
1025
+ arg0.resolveTarget = arg1;
1026
+ },
1027
+ __wbg_set_resource_86645e7515651c0e: function(arg0, arg1) {
1028
+ arg0.resource = arg1;
1029
+ },
1030
+ __wbg_set_rows_per_image_7203b6e2d244a111: function(arg0, arg1) {
1031
+ arg0.rowsPerImage = arg1 >>> 0;
1032
+ },
1033
+ __wbg_set_sample_count_4d7160817d98838f: function(arg0, arg1) {
1034
+ arg0.sampleCount = arg1 >>> 0;
1035
+ },
1036
+ __wbg_set_sample_type_8d4d5b141ce0f724: function(arg0, arg1) {
1037
+ arg0.sampleType = __wbindgen_enum_GpuTextureSampleType[arg1];
1038
+ },
1039
+ __wbg_set_sampler_35bcbac78bd4356f: function(arg0, arg1) {
1040
+ arg0.sampler = arg1;
1041
+ },
1042
+ __wbg_set_shader_location_3ce5152f6d464a63: function(arg0, arg1) {
1043
+ arg0.shaderLocation = arg1 >>> 0;
1044
+ },
1045
+ __wbg_set_signal_8564a226c5c6853c: function(arg0, arg1) {
1046
+ arg0.signal = arg1;
1047
+ },
1048
+ __wbg_set_size_81a77f7f4f34fbed: function(arg0, arg1) {
1049
+ arg0.size = arg1;
1050
+ },
1051
+ __wbg_set_size_85cb1c2c4c3ea73a: function(arg0, arg1) {
1052
+ arg0.size = arg1;
1053
+ },
1054
+ __wbg_set_size_981550e5d7941340: function(arg0, arg1) {
1055
+ arg0.size = arg1;
1056
+ },
1057
+ __wbg_set_src_factor_9a8e0943a05c9174: function(arg0, arg1) {
1058
+ arg0.srcFactor = __wbindgen_enum_GpuBlendFactor[arg1];
1059
+ },
1060
+ __wbg_set_stencil_back_596ea9628419413d: function(arg0, arg1) {
1061
+ arg0.stencilBack = arg1;
1062
+ },
1063
+ __wbg_set_stencil_clear_value_15afeb03c22cd51d: function(arg0, arg1) {
1064
+ arg0.stencilClearValue = arg1 >>> 0;
1065
+ },
1066
+ __wbg_set_stencil_front_31be994e05be5aaa: function(arg0, arg1) {
1067
+ arg0.stencilFront = arg1;
1068
+ },
1069
+ __wbg_set_stencil_load_op_1cd94e9e8c54f611: function(arg0, arg1) {
1070
+ arg0.stencilLoadOp = __wbindgen_enum_GpuLoadOp[arg1];
1071
+ },
1072
+ __wbg_set_stencil_read_mask_1635f30a0e6539e3: function(arg0, arg1) {
1073
+ arg0.stencilReadMask = arg1 >>> 0;
1074
+ },
1075
+ __wbg_set_stencil_read_only_f071431988182ad8: function(arg0, arg1) {
1076
+ arg0.stencilReadOnly = arg1 !== 0;
1077
+ },
1078
+ __wbg_set_stencil_store_op_a244d5347f386c8c: function(arg0, arg1) {
1079
+ arg0.stencilStoreOp = __wbindgen_enum_GpuStoreOp[arg1];
1080
+ },
1081
+ __wbg_set_stencil_write_mask_7809f82a1debe58f: function(arg0, arg1) {
1082
+ arg0.stencilWriteMask = arg1 >>> 0;
1083
+ },
1084
+ __wbg_set_step_mode_eb762c8c4264418f: function(arg0, arg1) {
1085
+ arg0.stepMode = __wbindgen_enum_GpuVertexStepMode[arg1];
1086
+ },
1087
+ __wbg_set_storage_texture_22f78b5171d1195a: function(arg0, arg1) {
1088
+ arg0.storageTexture = arg1;
1089
+ },
1090
+ __wbg_set_store_op_386596acc7bf2c16: function(arg0, arg1) {
1091
+ arg0.storeOp = __wbindgen_enum_GpuStoreOp[arg1];
1092
+ },
1093
+ __wbg_set_strip_index_format_e76748cd840ab562: function(arg0, arg1) {
1094
+ arg0.stripIndexFormat = __wbindgen_enum_GpuIndexFormat[arg1];
1095
+ },
1096
+ __wbg_set_targets_22473476afe0dabd: function(arg0, arg1) {
1097
+ arg0.targets = arg1;
1098
+ },
1099
+ __wbg_set_texture_2c34d28ab9666948: function(arg0, arg1) {
1100
+ arg0.texture = arg1;
1101
+ },
1102
+ __wbg_set_texture_aeea930400349204: function(arg0, arg1) {
1103
+ arg0.texture = arg1;
1104
+ },
1105
+ __wbg_set_timestamp_writes_0236dfc7ae2b1a03: function(arg0, arg1) {
1106
+ arg0.timestampWrites = arg1;
1107
+ },
1108
+ __wbg_set_topology_e18a15a717ebc912: function(arg0, arg1) {
1109
+ arg0.topology = __wbindgen_enum_GpuPrimitiveTopology[arg1];
1110
+ },
1111
+ __wbg_set_type_31b1662dd5a6144d: function(arg0, arg1) {
1112
+ arg0.type = __wbindgen_enum_GpuSamplerBindingType[arg1];
1113
+ },
1114
+ __wbg_set_type_719f40cf36d314f1: function(arg0, arg1) {
1115
+ arg0.type = __wbindgen_enum_GpuBufferBindingType[arg1];
1116
+ },
1117
+ __wbg_set_unclipped_depth_0f5d142d317e3a7c: function(arg0, arg1) {
1118
+ arg0.unclippedDepth = arg1 !== 0;
1119
+ },
1120
+ __wbg_set_usage_26861a639595cd45: function(arg0, arg1) {
1121
+ arg0.usage = arg1 >>> 0;
1122
+ },
1123
+ __wbg_set_usage_7b79a227ada2f5cc: function(arg0, arg1) {
1124
+ arg0.usage = arg1 >>> 0;
1125
+ },
1126
+ __wbg_set_usage_d9ff4b7757fac246: function(arg0, arg1) {
1127
+ arg0.usage = arg1 >>> 0;
1128
+ },
1129
+ __wbg_set_usage_e8d45decd5c483b3: function(arg0, arg1) {
1130
+ arg0.usage = arg1 >>> 0;
1131
+ },
1132
+ __wbg_set_vertex_b95705590b782671: function(arg0, arg1) {
1133
+ arg0.vertex = arg1;
1134
+ },
1135
+ __wbg_set_view_6ff951d6e3f9e337: function(arg0, arg1) {
1136
+ arg0.view = arg1;
1137
+ },
1138
+ __wbg_set_view_cf298e1e7b6ef38a: function(arg0, arg1) {
1139
+ arg0.view = arg1;
1140
+ },
1141
+ __wbg_set_view_dimension_87c95b0d987a14cd: function(arg0, arg1) {
1142
+ arg0.viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
1143
+ },
1144
+ __wbg_set_view_dimension_e99ec138da7b8f83: function(arg0, arg1) {
1145
+ arg0.viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
1146
+ },
1147
+ __wbg_set_view_formats_733fb624c2f2ef6b: function(arg0, arg1) {
1148
+ arg0.viewFormats = arg1;
1149
+ },
1150
+ __wbg_set_view_formats_c2b27891ca5d2740: function(arg0, arg1) {
1151
+ arg0.viewFormats = arg1;
1152
+ },
1153
+ __wbg_set_visibility_315bcac6427d0ba0: function(arg0, arg1) {
1154
+ arg0.visibility = arg1 >>> 0;
1155
+ },
1156
+ __wbg_set_width_1ae13bf0b65e6395: function(arg0, arg1) {
1157
+ arg0.width = arg1 >>> 0;
1158
+ },
1159
+ __wbg_set_width_63034f88f9905ea3: function(arg0, arg1) {
1160
+ arg0.width = arg1 >>> 0;
1161
+ },
1162
+ __wbg_set_width_81fa781e87b17891: function(arg0, arg1) {
1163
+ arg0.width = arg1 >>> 0;
1164
+ },
1165
+ __wbg_set_write_mask_0b6ca0cb1b797997: function(arg0, arg1) {
1166
+ arg0.writeMask = arg1 >>> 0;
1167
+ },
1168
+ __wbg_set_x_ffcb360b171098d5: function(arg0, arg1) {
1169
+ arg0.x = arg1 >>> 0;
1170
+ },
1171
+ __wbg_set_y_db82e366feb18537: function(arg0, arg1) {
1172
+ arg0.y = arg1 >>> 0;
1173
+ },
1174
+ __wbg_set_z_cec02b76fd208d0e: function(arg0, arg1) {
1175
+ arg0.z = arg1 >>> 0;
1176
+ },
1177
+ __wbg_signal_9172c3282bfba2f5: function(arg0) {
1178
+ const ret = arg0.signal;
1179
+ return ret;
1180
+ },
1181
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
1182
+ const ret = arg1.stack;
1183
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1184
+ const len1 = WASM_VECTOR_LEN;
1185
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1186
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1187
+ },
1188
+ __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
1189
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1190
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1191
+ },
1192
+ __wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
1193
+ const ret = typeof global === 'undefined' ? null : global;
1194
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1195
+ },
1196
+ __wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
1197
+ const ret = typeof self === 'undefined' ? null : self;
1198
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1199
+ },
1200
+ __wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
1201
+ const ret = typeof window === 'undefined' ? null : window;
1202
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1203
+ },
1204
+ __wbg_status_44ecb0ac1da253f4: function(arg0) {
1205
+ const ret = arg0.status;
1206
+ return ret;
1207
+ },
1208
+ __wbg_submit_f39583470d95df20: function(arg0, arg1) {
1209
+ arg0.submit(arg1);
1210
+ },
1211
+ __wbg_then_00eed3ac0b8e82cb: function(arg0, arg1, arg2) {
1212
+ const ret = arg0.then(arg1, arg2);
1213
+ return ret;
1214
+ },
1215
+ __wbg_then_479d77cb064907ee: function(arg0, arg1, arg2) {
1216
+ const ret = arg0.then(arg1, arg2);
1217
+ return ret;
1218
+ },
1219
+ __wbg_then_a0c8db0381c8994c: function(arg0, arg1) {
1220
+ const ret = arg0.then(arg1);
1221
+ return ret;
1222
+ },
1223
+ __wbg_viewer_new: function(arg0) {
1224
+ const ret = Viewer.__wrap(arg0);
1225
+ return ret;
1226
+ },
1227
+ __wbg_width_80cea93fc7f63070: function(arg0) {
1228
+ const ret = arg0.width;
1229
+ return ret;
1230
+ },
1231
+ __wbg_writeBuffer_2384abff9a0faef7: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1232
+ arg0.writeBuffer(arg1, arg2, getArrayU8FromWasm0(arg3, arg4), arg5, arg6);
1233
+ }, arguments); },
1234
+ __wbg_writeTexture_d42ce6ec94b2c6ca: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1235
+ arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
1236
+ }, arguments); },
1237
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1238
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 172, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1239
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4c19ef90e3a2449e);
1240
+ return ret;
1241
+ },
1242
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1243
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 690, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1244
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h77f088fde8c66f5c);
1245
+ return ret;
1246
+ },
1247
+ __wbindgen_cast_0000000000000003: function(arg0) {
1248
+ // Cast intrinsic for `F64 -> Externref`.
1249
+ const ret = arg0;
1250
+ return ret;
1251
+ },
1252
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1253
+ // Cast intrinsic for `Ref(String) -> Externref`.
1254
+ const ret = getStringFromWasm0(arg0, arg1);
1255
+ return ret;
1256
+ },
1257
+ __wbindgen_init_externref_table: function() {
1258
+ const table = wasm.__wbindgen_externrefs;
1259
+ const offset = table.grow(4);
1260
+ table.set(0, undefined);
1261
+ table.set(offset + 0, undefined);
1262
+ table.set(offset + 1, null);
1263
+ table.set(offset + 2, true);
1264
+ table.set(offset + 3, false);
1265
+ },
1266
+ };
1267
+ return {
1268
+ __proto__: null,
1269
+ "./dicomview_wasm_bg.js": import0,
1270
+ };
1271
+ }
1272
+
1273
+ function wasm_bindgen__convert__closures_____invoke__h4c19ef90e3a2449e(arg0, arg1, arg2) {
1274
+ wasm.wasm_bindgen__convert__closures_____invoke__h4c19ef90e3a2449e(arg0, arg1, arg2);
1275
+ }
1276
+
1277
+ function wasm_bindgen__convert__closures_____invoke__h77f088fde8c66f5c(arg0, arg1, arg2) {
1278
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h77f088fde8c66f5c(arg0, arg1, arg2);
1279
+ if (ret[1]) {
1280
+ throw takeFromExternrefTable0(ret[0]);
1281
+ }
1282
+ }
1283
+
1284
+ function wasm_bindgen__convert__closures_____invoke__h6a18030bf0401ad0(arg0, arg1, arg2, arg3) {
1285
+ wasm.wasm_bindgen__convert__closures_____invoke__h6a18030bf0401ad0(arg0, arg1, arg2, arg3);
1286
+ }
1287
+
1288
+
1289
+ const __wbindgen_enum_GpuAddressMode = ["clamp-to-edge", "repeat", "mirror-repeat"];
1290
+
1291
+
1292
+ const __wbindgen_enum_GpuBlendFactor = ["zero", "one", "src", "one-minus-src", "src-alpha", "one-minus-src-alpha", "dst", "one-minus-dst", "dst-alpha", "one-minus-dst-alpha", "src-alpha-saturated", "constant", "one-minus-constant", "src1", "one-minus-src1", "src1-alpha", "one-minus-src1-alpha"];
1293
+
1294
+
1295
+ const __wbindgen_enum_GpuBlendOperation = ["add", "subtract", "reverse-subtract", "min", "max"];
1296
+
1297
+
1298
+ const __wbindgen_enum_GpuBufferBindingType = ["uniform", "storage", "read-only-storage"];
1299
+
1300
+
1301
+ const __wbindgen_enum_GpuCanvasAlphaMode = ["opaque", "premultiplied"];
1302
+
1303
+
1304
+ const __wbindgen_enum_GpuCompareFunction = ["never", "less", "equal", "less-equal", "greater", "not-equal", "greater-equal", "always"];
1305
+
1306
+
1307
+ const __wbindgen_enum_GpuCullMode = ["none", "front", "back"];
1308
+
1309
+
1310
+ const __wbindgen_enum_GpuFilterMode = ["nearest", "linear"];
1311
+
1312
+
1313
+ const __wbindgen_enum_GpuFrontFace = ["ccw", "cw"];
1314
+
1315
+
1316
+ const __wbindgen_enum_GpuIndexFormat = ["uint16", "uint32"];
1317
+
1318
+
1319
+ const __wbindgen_enum_GpuLoadOp = ["load", "clear"];
1320
+
1321
+
1322
+ const __wbindgen_enum_GpuMipmapFilterMode = ["nearest", "linear"];
1323
+
1324
+
1325
+ const __wbindgen_enum_GpuPowerPreference = ["low-power", "high-performance"];
1326
+
1327
+
1328
+ const __wbindgen_enum_GpuPrimitiveTopology = ["point-list", "line-list", "line-strip", "triangle-list", "triangle-strip"];
1329
+
1330
+
1331
+ const __wbindgen_enum_GpuSamplerBindingType = ["filtering", "non-filtering", "comparison"];
1332
+
1333
+
1334
+ const __wbindgen_enum_GpuStencilOperation = ["keep", "zero", "replace", "invert", "increment-clamp", "decrement-clamp", "increment-wrap", "decrement-wrap"];
1335
+
1336
+
1337
+ const __wbindgen_enum_GpuStorageTextureAccess = ["write-only", "read-only", "read-write"];
1338
+
1339
+
1340
+ const __wbindgen_enum_GpuStoreOp = ["store", "discard"];
1341
+
1342
+
1343
+ const __wbindgen_enum_GpuTextureAspect = ["all", "stencil-only", "depth-only"];
1344
+
1345
+
1346
+ const __wbindgen_enum_GpuTextureDimension = ["1d", "2d", "3d"];
1347
+
1348
+
1349
+ 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"];
1350
+
1351
+
1352
+ const __wbindgen_enum_GpuTextureSampleType = ["float", "unfilterable-float", "depth", "sint", "uint"];
1353
+
1354
+
1355
+ const __wbindgen_enum_GpuTextureViewDimension = ["1d", "2d", "2d-array", "cube", "cube-array", "3d"];
1356
+
1357
+
1358
+ const __wbindgen_enum_GpuVertexFormat = ["uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra"];
1359
+
1360
+
1361
+ const __wbindgen_enum_GpuVertexStepMode = ["vertex", "instance"];
1362
+
1363
+
1364
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1365
+ const ViewerFinalization = (typeof FinalizationRegistry === 'undefined')
1366
+ ? { register: () => {}, unregister: () => {} }
1367
+ : new FinalizationRegistry(ptr => wasm.__wbg_viewer_free(ptr >>> 0, 1));
1368
+ const WadoLoaderFinalization = (typeof FinalizationRegistry === 'undefined')
1369
+ ? { register: () => {}, unregister: () => {} }
1370
+ : new FinalizationRegistry(ptr => wasm.__wbg_wadoloader_free(ptr >>> 0, 1));
1371
+
1372
+ function addToExternrefTable0(obj) {
1373
+ const idx = wasm.__externref_table_alloc();
1374
+ wasm.__wbindgen_externrefs.set(idx, obj);
1375
+ return idx;
1376
+ }
1377
+
1378
+ function _assertClass(instance, klass) {
1379
+ if (!(instance instanceof klass)) {
1380
+ throw new Error(`expected instance of ${klass.name}`);
1381
+ }
1382
+ }
1383
+
1384
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1385
+ ? { register: () => {}, unregister: () => {} }
1386
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1387
+
1388
+ function debugString(val) {
1389
+ // primitive types
1390
+ const type = typeof val;
1391
+ if (type == 'number' || type == 'boolean' || val == null) {
1392
+ return `${val}`;
1393
+ }
1394
+ if (type == 'string') {
1395
+ return `"${val}"`;
1396
+ }
1397
+ if (type == 'symbol') {
1398
+ const description = val.description;
1399
+ if (description == null) {
1400
+ return 'Symbol';
1401
+ } else {
1402
+ return `Symbol(${description})`;
1403
+ }
1404
+ }
1405
+ if (type == 'function') {
1406
+ const name = val.name;
1407
+ if (typeof name == 'string' && name.length > 0) {
1408
+ return `Function(${name})`;
1409
+ } else {
1410
+ return 'Function';
1411
+ }
1412
+ }
1413
+ // objects
1414
+ if (Array.isArray(val)) {
1415
+ const length = val.length;
1416
+ let debug = '[';
1417
+ if (length > 0) {
1418
+ debug += debugString(val[0]);
1419
+ }
1420
+ for(let i = 1; i < length; i++) {
1421
+ debug += ', ' + debugString(val[i]);
1422
+ }
1423
+ debug += ']';
1424
+ return debug;
1425
+ }
1426
+ // Test for built-in
1427
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1428
+ let className;
1429
+ if (builtInMatches && builtInMatches.length > 1) {
1430
+ className = builtInMatches[1];
1431
+ } else {
1432
+ // Failed to match the standard '[object ClassName]'
1433
+ return toString.call(val);
1434
+ }
1435
+ if (className == 'Object') {
1436
+ // we're a user defined class or Object
1437
+ // JSON.stringify avoids problems with cycles, and is generally much
1438
+ // easier than looping through ownProperties of `val`.
1439
+ try {
1440
+ return 'Object(' + JSON.stringify(val) + ')';
1441
+ } catch (_) {
1442
+ return 'Object';
1443
+ }
1444
+ }
1445
+ // errors
1446
+ if (val instanceof Error) {
1447
+ return `${val.name}: ${val.message}\n${val.stack}`;
1448
+ }
1449
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1450
+ return className;
1451
+ }
1452
+
1453
+ function getArrayI16FromWasm0(ptr, len) {
1454
+ ptr = ptr >>> 0;
1455
+ return getInt16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len);
1456
+ }
1457
+
1458
+ function getArrayU32FromWasm0(ptr, len) {
1459
+ ptr = ptr >>> 0;
1460
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
1461
+ }
1462
+
1463
+ function getArrayU8FromWasm0(ptr, len) {
1464
+ ptr = ptr >>> 0;
1465
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1466
+ }
1467
+
1468
+ let cachedDataViewMemory0 = null;
1469
+ function getDataViewMemory0() {
1470
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1471
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1472
+ }
1473
+ return cachedDataViewMemory0;
1474
+ }
1475
+
1476
+ let cachedInt16ArrayMemory0 = null;
1477
+ function getInt16ArrayMemory0() {
1478
+ if (cachedInt16ArrayMemory0 === null || cachedInt16ArrayMemory0.byteLength === 0) {
1479
+ cachedInt16ArrayMemory0 = new Int16Array(wasm.memory.buffer);
1480
+ }
1481
+ return cachedInt16ArrayMemory0;
1482
+ }
1483
+
1484
+ function getStringFromWasm0(ptr, len) {
1485
+ ptr = ptr >>> 0;
1486
+ return decodeText(ptr, len);
1487
+ }
1488
+
1489
+ let cachedUint16ArrayMemory0 = null;
1490
+ function getUint16ArrayMemory0() {
1491
+ if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) {
1492
+ cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
1493
+ }
1494
+ return cachedUint16ArrayMemory0;
1495
+ }
1496
+
1497
+ let cachedUint32ArrayMemory0 = null;
1498
+ function getUint32ArrayMemory0() {
1499
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
1500
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
1501
+ }
1502
+ return cachedUint32ArrayMemory0;
1503
+ }
1504
+
1505
+ let cachedUint8ArrayMemory0 = null;
1506
+ function getUint8ArrayMemory0() {
1507
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1508
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1509
+ }
1510
+ return cachedUint8ArrayMemory0;
1511
+ }
1512
+
1513
+ function handleError(f, args) {
1514
+ try {
1515
+ return f.apply(this, args);
1516
+ } catch (e) {
1517
+ const idx = addToExternrefTable0(e);
1518
+ wasm.__wbindgen_exn_store(idx);
1519
+ }
1520
+ }
1521
+
1522
+ function isLikeNone(x) {
1523
+ return x === undefined || x === null;
1524
+ }
1525
+
1526
+ function makeMutClosure(arg0, arg1, f) {
1527
+ const state = { a: arg0, b: arg1, cnt: 1 };
1528
+ const real = (...args) => {
1529
+
1530
+ // First up with a closure we increment the internal reference
1531
+ // count. This ensures that the Rust closure environment won't
1532
+ // be deallocated while we're invoking it.
1533
+ state.cnt++;
1534
+ const a = state.a;
1535
+ state.a = 0;
1536
+ try {
1537
+ return f(a, state.b, ...args);
1538
+ } finally {
1539
+ state.a = a;
1540
+ real._wbg_cb_unref();
1541
+ }
1542
+ };
1543
+ real._wbg_cb_unref = () => {
1544
+ if (--state.cnt === 0) {
1545
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
1546
+ state.a = 0;
1547
+ CLOSURE_DTORS.unregister(state);
1548
+ }
1549
+ };
1550
+ CLOSURE_DTORS.register(real, state, state);
1551
+ return real;
1552
+ }
1553
+
1554
+ function passArray16ToWasm0(arg, malloc) {
1555
+ const ptr = malloc(arg.length * 2, 2) >>> 0;
1556
+ getUint16ArrayMemory0().set(arg, ptr / 2);
1557
+ WASM_VECTOR_LEN = arg.length;
1558
+ return ptr;
1559
+ }
1560
+
1561
+ function passArray8ToWasm0(arg, malloc) {
1562
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1563
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1564
+ WASM_VECTOR_LEN = arg.length;
1565
+ return ptr;
1566
+ }
1567
+
1568
+ function passStringToWasm0(arg, malloc, realloc) {
1569
+ if (realloc === undefined) {
1570
+ const buf = cachedTextEncoder.encode(arg);
1571
+ const ptr = malloc(buf.length, 1) >>> 0;
1572
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1573
+ WASM_VECTOR_LEN = buf.length;
1574
+ return ptr;
1575
+ }
1576
+
1577
+ let len = arg.length;
1578
+ let ptr = malloc(len, 1) >>> 0;
1579
+
1580
+ const mem = getUint8ArrayMemory0();
1581
+
1582
+ let offset = 0;
1583
+
1584
+ for (; offset < len; offset++) {
1585
+ const code = arg.charCodeAt(offset);
1586
+ if (code > 0x7F) break;
1587
+ mem[ptr + offset] = code;
1588
+ }
1589
+ if (offset !== len) {
1590
+ if (offset !== 0) {
1591
+ arg = arg.slice(offset);
1592
+ }
1593
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1594
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1595
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1596
+
1597
+ offset += ret.written;
1598
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1599
+ }
1600
+
1601
+ WASM_VECTOR_LEN = offset;
1602
+ return ptr;
1603
+ }
1604
+
1605
+ function takeFromExternrefTable0(idx) {
1606
+ const value = wasm.__wbindgen_externrefs.get(idx);
1607
+ wasm.__externref_table_dealloc(idx);
1608
+ return value;
1609
+ }
1610
+
1611
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1612
+ cachedTextDecoder.decode();
1613
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1614
+ let numBytesDecoded = 0;
1615
+ function decodeText(ptr, len) {
1616
+ numBytesDecoded += len;
1617
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1618
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1619
+ cachedTextDecoder.decode();
1620
+ numBytesDecoded = len;
1621
+ }
1622
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1623
+ }
1624
+
1625
+ const cachedTextEncoder = new TextEncoder();
1626
+
1627
+ if (!('encodeInto' in cachedTextEncoder)) {
1628
+ cachedTextEncoder.encodeInto = function (arg, view) {
1629
+ const buf = cachedTextEncoder.encode(arg);
1630
+ view.set(buf);
1631
+ return {
1632
+ read: arg.length,
1633
+ written: buf.length
1634
+ };
1635
+ };
1636
+ }
1637
+
1638
+ let WASM_VECTOR_LEN = 0;
1639
+
1640
+ let wasmModule, wasm;
1641
+ function __wbg_finalize_init(instance, module) {
1642
+ wasm = instance.exports;
1643
+ wasmModule = module;
1644
+ cachedDataViewMemory0 = null;
1645
+ cachedInt16ArrayMemory0 = null;
1646
+ cachedUint16ArrayMemory0 = null;
1647
+ cachedUint32ArrayMemory0 = null;
1648
+ cachedUint8ArrayMemory0 = null;
1649
+ wasm.__wbindgen_start();
1650
+ return wasm;
1651
+ }
1652
+
1653
+ async function __wbg_load(module, imports) {
1654
+ if (typeof Response === 'function' && module instanceof Response) {
1655
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1656
+ try {
1657
+ return await WebAssembly.instantiateStreaming(module, imports);
1658
+ } catch (e) {
1659
+ const validResponse = module.ok && expectedResponseType(module.type);
1660
+
1661
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1662
+ 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);
1663
+
1664
+ } else { throw e; }
1665
+ }
1666
+ }
1667
+
1668
+ const bytes = await module.arrayBuffer();
1669
+ return await WebAssembly.instantiate(bytes, imports);
1670
+ } else {
1671
+ const instance = await WebAssembly.instantiate(module, imports);
1672
+
1673
+ if (instance instanceof WebAssembly.Instance) {
1674
+ return { instance, module };
1675
+ } else {
1676
+ return instance;
1677
+ }
1678
+ }
1679
+
1680
+ function expectedResponseType(type) {
1681
+ switch (type) {
1682
+ case 'basic': case 'cors': case 'default': return true;
1683
+ }
1684
+ return false;
1685
+ }
1686
+ }
1687
+
1688
+ function initSync(module) {
1689
+ if (wasm !== undefined) return wasm;
1690
+
1691
+
1692
+ if (module !== undefined) {
1693
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1694
+ ({module} = module)
1695
+ } else {
1696
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1697
+ }
1698
+ }
1699
+
1700
+ const imports = __wbg_get_imports();
1701
+ if (!(module instanceof WebAssembly.Module)) {
1702
+ module = new WebAssembly.Module(module);
1703
+ }
1704
+ const instance = new WebAssembly.Instance(module, imports);
1705
+ return __wbg_finalize_init(instance, module);
1706
+ }
1707
+
1708
+ async function __wbg_init(module_or_path) {
1709
+ if (wasm !== undefined) return wasm;
1710
+
1711
+
1712
+ if (module_or_path !== undefined) {
1713
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1714
+ ({module_or_path} = module_or_path)
1715
+ } else {
1716
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1717
+ }
1718
+ }
1719
+
1720
+ if (module_or_path === undefined) {
1721
+ module_or_path = new URL('dicomview_wasm_bg.wasm', import.meta.url);
1722
+ }
1723
+ const imports = __wbg_get_imports();
1724
+
1725
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1726
+ module_or_path = fetch(module_or_path);
1727
+ }
1728
+
1729
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1730
+
1731
+ return __wbg_finalize_init(instance, module);
1732
+ }
1733
+
1734
+ export { initSync, __wbg_init as default };