bio-forge-wasm 0.3.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,1180 @@
1
+ let wasm;
2
+ export function __wbg_set_wasm(val) {
3
+ wasm = val;
4
+ }
5
+
6
+ function addHeapObject(obj) {
7
+ if (heap_next === heap.length) heap.push(heap.length + 1);
8
+ const idx = heap_next;
9
+ heap_next = heap[idx];
10
+
11
+ heap[idx] = obj;
12
+ return idx;
13
+ }
14
+
15
+ function _assertClass(instance, klass) {
16
+ if (!(instance instanceof klass)) {
17
+ throw new Error(`expected instance of ${klass.name}`);
18
+ }
19
+ }
20
+
21
+ function debugString(val) {
22
+ // primitive types
23
+ const type = typeof val;
24
+ if (type == 'number' || type == 'boolean' || val == null) {
25
+ return `${val}`;
26
+ }
27
+ if (type == 'string') {
28
+ return `"${val}"`;
29
+ }
30
+ if (type == 'symbol') {
31
+ const description = val.description;
32
+ if (description == null) {
33
+ return 'Symbol';
34
+ } else {
35
+ return `Symbol(${description})`;
36
+ }
37
+ }
38
+ if (type == 'function') {
39
+ const name = val.name;
40
+ if (typeof name == 'string' && name.length > 0) {
41
+ return `Function(${name})`;
42
+ } else {
43
+ return 'Function';
44
+ }
45
+ }
46
+ // objects
47
+ if (Array.isArray(val)) {
48
+ const length = val.length;
49
+ let debug = '[';
50
+ if (length > 0) {
51
+ debug += debugString(val[0]);
52
+ }
53
+ for(let i = 1; i < length; i++) {
54
+ debug += ', ' + debugString(val[i]);
55
+ }
56
+ debug += ']';
57
+ return debug;
58
+ }
59
+ // Test for built-in
60
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
61
+ let className;
62
+ if (builtInMatches && builtInMatches.length > 1) {
63
+ className = builtInMatches[1];
64
+ } else {
65
+ // Failed to match the standard '[object ClassName]'
66
+ return toString.call(val);
67
+ }
68
+ if (className == 'Object') {
69
+ // we're a user defined class or Object
70
+ // JSON.stringify avoids problems with cycles, and is generally much
71
+ // easier than looping through ownProperties of `val`.
72
+ try {
73
+ return 'Object(' + JSON.stringify(val) + ')';
74
+ } catch (_) {
75
+ return 'Object';
76
+ }
77
+ }
78
+ // errors
79
+ if (val instanceof Error) {
80
+ return `${val.name}: ${val.message}\n${val.stack}`;
81
+ }
82
+ // TODO we could test for more things here, like `Set`s and `Map`s.
83
+ return className;
84
+ }
85
+
86
+ function dropObject(idx) {
87
+ if (idx < 132) return;
88
+ heap[idx] = heap_next;
89
+ heap_next = idx;
90
+ }
91
+
92
+ function getArrayU8FromWasm0(ptr, len) {
93
+ ptr = ptr >>> 0;
94
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
95
+ }
96
+
97
+ let cachedDataViewMemory0 = null;
98
+ function getDataViewMemory0() {
99
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
100
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
101
+ }
102
+ return cachedDataViewMemory0;
103
+ }
104
+
105
+ function getStringFromWasm0(ptr, len) {
106
+ ptr = ptr >>> 0;
107
+ return decodeText(ptr, len);
108
+ }
109
+
110
+ let cachedUint8ArrayMemory0 = null;
111
+ function getUint8ArrayMemory0() {
112
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
113
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
114
+ }
115
+ return cachedUint8ArrayMemory0;
116
+ }
117
+
118
+ function getObject(idx) { return heap[idx]; }
119
+
120
+ function handleError(f, args) {
121
+ try {
122
+ return f.apply(this, args);
123
+ } catch (e) {
124
+ wasm.__wbindgen_export3(addHeapObject(e));
125
+ }
126
+ }
127
+
128
+ let heap = new Array(128).fill(undefined);
129
+ heap.push(undefined, null, true, false);
130
+
131
+ let heap_next = heap.length;
132
+
133
+ function isLikeNone(x) {
134
+ return x === undefined || x === null;
135
+ }
136
+
137
+ function passArray8ToWasm0(arg, malloc) {
138
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
139
+ getUint8ArrayMemory0().set(arg, ptr / 1);
140
+ WASM_VECTOR_LEN = arg.length;
141
+ return ptr;
142
+ }
143
+
144
+ function passArrayJsValueToWasm0(array, malloc) {
145
+ const ptr = malloc(array.length * 4, 4) >>> 0;
146
+ const mem = getDataViewMemory0();
147
+ for (let i = 0; i < array.length; i++) {
148
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
149
+ }
150
+ WASM_VECTOR_LEN = array.length;
151
+ return ptr;
152
+ }
153
+
154
+ function passStringToWasm0(arg, malloc, realloc) {
155
+ if (realloc === undefined) {
156
+ const buf = cachedTextEncoder.encode(arg);
157
+ const ptr = malloc(buf.length, 1) >>> 0;
158
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
159
+ WASM_VECTOR_LEN = buf.length;
160
+ return ptr;
161
+ }
162
+
163
+ let len = arg.length;
164
+ let ptr = malloc(len, 1) >>> 0;
165
+
166
+ const mem = getUint8ArrayMemory0();
167
+
168
+ let offset = 0;
169
+
170
+ for (; offset < len; offset++) {
171
+ const code = arg.charCodeAt(offset);
172
+ if (code > 0x7F) break;
173
+ mem[ptr + offset] = code;
174
+ }
175
+ if (offset !== len) {
176
+ if (offset !== 0) {
177
+ arg = arg.slice(offset);
178
+ }
179
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
180
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
181
+ const ret = cachedTextEncoder.encodeInto(arg, view);
182
+
183
+ offset += ret.written;
184
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
185
+ }
186
+
187
+ WASM_VECTOR_LEN = offset;
188
+ return ptr;
189
+ }
190
+
191
+ function takeObject(idx) {
192
+ const ret = getObject(idx);
193
+ dropObject(idx);
194
+ return ret;
195
+ }
196
+
197
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
198
+ cachedTextDecoder.decode();
199
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
200
+ let numBytesDecoded = 0;
201
+ function decodeText(ptr, len) {
202
+ numBytesDecoded += len;
203
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
204
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
205
+ cachedTextDecoder.decode();
206
+ numBytesDecoded = len;
207
+ }
208
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
209
+ }
210
+
211
+ const cachedTextEncoder = new TextEncoder();
212
+
213
+ if (!('encodeInto' in cachedTextEncoder)) {
214
+ cachedTextEncoder.encodeInto = function (arg, view) {
215
+ const buf = cachedTextEncoder.encode(arg);
216
+ view.set(buf);
217
+ return {
218
+ read: arg.length,
219
+ written: buf.length
220
+ };
221
+ }
222
+ }
223
+
224
+ let WASM_VECTOR_LEN = 0;
225
+
226
+ const StructureFinalization = (typeof FinalizationRegistry === 'undefined')
227
+ ? { register: () => {}, unregister: () => {} }
228
+ : new FinalizationRegistry(ptr => wasm.__wbg_structure_free(ptr >>> 0, 1));
229
+
230
+ const TemplateFinalization = (typeof FinalizationRegistry === 'undefined')
231
+ ? { register: () => {}, unregister: () => {} }
232
+ : new FinalizationRegistry(ptr => wasm.__wbg_template_free(ptr >>> 0, 1));
233
+
234
+ const TopologyFinalization = (typeof FinalizationRegistry === 'undefined')
235
+ ? { register: () => {}, unregister: () => {} }
236
+ : new FinalizationRegistry(ptr => wasm.__wbg_topology_free(ptr >>> 0, 1));
237
+
238
+ /**
239
+ * A molecular structure for manipulation and export.
240
+ */
241
+ export class Structure {
242
+ static __wrap(ptr) {
243
+ ptr = ptr >>> 0;
244
+ const obj = Object.create(Structure.prototype);
245
+ obj.__wbg_ptr = ptr;
246
+ StructureFinalization.register(obj, obj.__wbg_ptr, obj);
247
+ return obj;
248
+ }
249
+ __destroy_into_raw() {
250
+ const ptr = this.__wbg_ptr;
251
+ this.__wbg_ptr = 0;
252
+ StructureFinalization.unregister(this);
253
+ return ptr;
254
+ }
255
+ free() {
256
+ const ptr = this.__destroy_into_raw();
257
+ wasm.__wbg_structure_free(ptr, 0);
258
+ }
259
+ /**
260
+ * Returns the number of atoms.
261
+ * @returns {number}
262
+ */
263
+ get atomCount() {
264
+ const ret = wasm.structure_atomCount(this.__wbg_ptr);
265
+ return ret >>> 0;
266
+ }
267
+ /**
268
+ * Parses an mmCIF string into a Structure.
269
+ * @param {string} content
270
+ * @returns {Structure}
271
+ */
272
+ static fromMmcif(content) {
273
+ try {
274
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
275
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
276
+ const len0 = WASM_VECTOR_LEN;
277
+ wasm.structure_fromMmcif(retptr, ptr0, len0);
278
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
279
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
280
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
281
+ if (r2) {
282
+ throw takeObject(r1);
283
+ }
284
+ return Structure.__wrap(r0);
285
+ } finally {
286
+ wasm.__wbindgen_add_to_stack_pointer(16);
287
+ }
288
+ }
289
+ /**
290
+ * Centers the center of mass at the origin.
291
+ */
292
+ centerMass() {
293
+ wasm.structure_centerMass(this.__wbg_ptr);
294
+ }
295
+ /**
296
+ * Returns the number of chains.
297
+ * @returns {number}
298
+ */
299
+ get chainCount() {
300
+ const ret = wasm.structure_chainCount(this.__wbg_ptr);
301
+ return ret >>> 0;
302
+ }
303
+ /**
304
+ * Builds a Topology from this structure.
305
+ * @param {TopologyConfig | null} [config]
306
+ * @param {Template[] | null} [templates]
307
+ * @returns {Topology}
308
+ */
309
+ toTopology(config, templates) {
310
+ try {
311
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
312
+ var ptr0 = isLikeNone(templates) ? 0 : passArrayJsValueToWasm0(templates, wasm.__wbindgen_export);
313
+ var len0 = WASM_VECTOR_LEN;
314
+ wasm.structure_toTopology(retptr, this.__wbg_ptr, isLikeNone(config) ? 0 : addHeapObject(config), ptr0, len0);
315
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
316
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
317
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
318
+ if (r2) {
319
+ throw takeObject(r1);
320
+ }
321
+ return Topology.__wrap(r0);
322
+ } finally {
323
+ wasm.__wbindgen_add_to_stack_pointer(16);
324
+ }
325
+ }
326
+ /**
327
+ * Rotates using Euler angles (XYZ convention, all in radians).
328
+ * @param {number} x
329
+ * @param {number} y
330
+ * @param {number} z
331
+ */
332
+ rotateEuler(x, y, z) {
333
+ wasm.structure_rotateEuler(this.__wbg_ptr, x, y, z);
334
+ }
335
+ /**
336
+ * Serializes to PDB format as bytes.
337
+ * @returns {Uint8Array}
338
+ */
339
+ toPdbBytes() {
340
+ try {
341
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
342
+ wasm.structure_toPdbBytes(retptr, this.__wbg_ptr);
343
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
344
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
345
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
346
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
347
+ if (r3) {
348
+ throw takeObject(r2);
349
+ }
350
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
351
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
352
+ return v1;
353
+ } finally {
354
+ wasm.__wbindgen_add_to_stack_pointer(16);
355
+ }
356
+ }
357
+ /**
358
+ * Adds hydrogen atoms.
359
+ * @param {HydroConfig | null} [config]
360
+ */
361
+ addHydrogens(config) {
362
+ try {
363
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
364
+ wasm.structure_addHydrogens(retptr, this.__wbg_ptr, isLikeNone(config) ? 0 : addHeapObject(config));
365
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
366
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
367
+ if (r1) {
368
+ throw takeObject(r0);
369
+ }
370
+ } finally {
371
+ wasm.__wbindgen_add_to_stack_pointer(16);
372
+ }
373
+ }
374
+ /**
375
+ * Returns the number of residues.
376
+ * @returns {number}
377
+ */
378
+ get residueCount() {
379
+ const ret = wasm.structure_residueCount(this.__wbg_ptr);
380
+ return ret >>> 0;
381
+ }
382
+ /**
383
+ * Parses a PDB byte array into a Structure.
384
+ * @param {Uint8Array} content
385
+ * @returns {Structure}
386
+ */
387
+ static fromPdbBytes(content) {
388
+ try {
389
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
390
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
391
+ const len0 = WASM_VECTOR_LEN;
392
+ wasm.structure_fromPdbBytes(retptr, ptr0, len0);
393
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
394
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
395
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
396
+ if (r2) {
397
+ throw takeObject(r1);
398
+ }
399
+ return Structure.__wrap(r0);
400
+ } finally {
401
+ wasm.__wbindgen_add_to_stack_pointer(16);
402
+ }
403
+ }
404
+ /**
405
+ * Serializes to mmCIF format as bytes.
406
+ * @returns {Uint8Array}
407
+ */
408
+ toMmcifBytes() {
409
+ try {
410
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
411
+ wasm.structure_toMmcifBytes(retptr, this.__wbg_ptr);
412
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
413
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
414
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
415
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
416
+ if (r3) {
417
+ throw takeObject(r2);
418
+ }
419
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
420
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
421
+ return v1;
422
+ } finally {
423
+ wasm.__wbindgen_add_to_stack_pointer(16);
424
+ }
425
+ }
426
+ /**
427
+ * Centers the geometric centroid at the origin.
428
+ */
429
+ centerGeometry() {
430
+ wasm.structure_centerGeometry(this.__wbg_ptr);
431
+ }
432
+ /**
433
+ * Creates a deep copy of the structure.
434
+ * @returns {Structure}
435
+ */
436
+ clone() {
437
+ const ret = wasm.structure_clone(this.__wbg_ptr);
438
+ return Structure.__wrap(ret);
439
+ }
440
+ /**
441
+ * Parses an mmCIF byte array into a Structure.
442
+ * @param {Uint8Array} content
443
+ * @returns {Structure}
444
+ */
445
+ static fromMmcifBytes(content) {
446
+ try {
447
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
448
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
449
+ const len0 = WASM_VECTOR_LEN;
450
+ wasm.structure_fromMmcif(retptr, ptr0, len0);
451
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
452
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
453
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
454
+ if (r2) {
455
+ throw takeObject(r1);
456
+ }
457
+ return Structure.__wrap(r0);
458
+ } finally {
459
+ wasm.__wbindgen_add_to_stack_pointer(16);
460
+ }
461
+ }
462
+ /**
463
+ * Returns comprehensive structure statistics.
464
+ * @returns {StructureInfo}
465
+ */
466
+ info() {
467
+ try {
468
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
469
+ wasm.structure_info(retptr, this.__wbg_ptr);
470
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
471
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
472
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
473
+ if (r2) {
474
+ throw takeObject(r1);
475
+ }
476
+ return takeObject(r0);
477
+ } finally {
478
+ wasm.__wbindgen_add_to_stack_pointer(16);
479
+ }
480
+ }
481
+ /**
482
+ * Removes unwanted components (water, ions, hydrogens, hetero residues).
483
+ * @param {CleanConfig | null} [config]
484
+ */
485
+ clean(config) {
486
+ try {
487
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
488
+ wasm.structure_clean(retptr, this.__wbg_ptr, isLikeNone(config) ? 0 : addHeapObject(config));
489
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
490
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
491
+ if (r1) {
492
+ throw takeObject(r0);
493
+ }
494
+ } finally {
495
+ wasm.__wbindgen_add_to_stack_pointer(16);
496
+ }
497
+ }
498
+ /**
499
+ * Reconstructs missing atoms from templates.
500
+ */
501
+ repair() {
502
+ try {
503
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
504
+ wasm.structure_repair(retptr, this.__wbg_ptr);
505
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
506
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
507
+ if (r1) {
508
+ throw takeObject(r0);
509
+ }
510
+ } finally {
511
+ wasm.__wbindgen_add_to_stack_pointer(16);
512
+ }
513
+ }
514
+ /**
515
+ * Serializes to PDB format.
516
+ * @returns {string}
517
+ */
518
+ toPdb() {
519
+ let deferred2_0;
520
+ let deferred2_1;
521
+ try {
522
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
523
+ wasm.structure_toPdb(retptr, this.__wbg_ptr);
524
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
525
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
526
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
527
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
528
+ var ptr1 = r0;
529
+ var len1 = r1;
530
+ if (r3) {
531
+ ptr1 = 0; len1 = 0;
532
+ throw takeObject(r2);
533
+ }
534
+ deferred2_0 = ptr1;
535
+ deferred2_1 = len1;
536
+ return getStringFromWasm0(ptr1, len1);
537
+ } finally {
538
+ wasm.__wbindgen_add_to_stack_pointer(16);
539
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
540
+ }
541
+ }
542
+ /**
543
+ * Solvates the structure with water and ions.
544
+ * @param {SolvateConfig | null} [config]
545
+ */
546
+ solvate(config) {
547
+ try {
548
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
549
+ wasm.structure_solvate(retptr, this.__wbg_ptr, isLikeNone(config) ? 0 : addHeapObject(config));
550
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
551
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
552
+ if (r1) {
553
+ throw takeObject(r0);
554
+ }
555
+ } finally {
556
+ wasm.__wbindgen_add_to_stack_pointer(16);
557
+ }
558
+ }
559
+ /**
560
+ * Parses a PDB string into a Structure.
561
+ * @param {string} content
562
+ * @returns {Structure}
563
+ */
564
+ static fromPdb(content) {
565
+ try {
566
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
567
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
568
+ const len0 = WASM_VECTOR_LEN;
569
+ wasm.structure_fromPdb(retptr, ptr0, len0);
570
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
571
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
572
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
573
+ if (r2) {
574
+ throw takeObject(r1);
575
+ }
576
+ return Structure.__wrap(r0);
577
+ } finally {
578
+ wasm.__wbindgen_add_to_stack_pointer(16);
579
+ }
580
+ }
581
+ /**
582
+ * Rotates around the X axis (angle in radians).
583
+ * @param {number} radians
584
+ */
585
+ rotateX(radians) {
586
+ wasm.structure_rotateX(this.__wbg_ptr, radians);
587
+ }
588
+ /**
589
+ * Rotates around the Y axis (angle in radians).
590
+ * @param {number} radians
591
+ */
592
+ rotateY(radians) {
593
+ wasm.structure_rotateY(this.__wbg_ptr, radians);
594
+ }
595
+ /**
596
+ * Rotates around the Z axis (angle in radians).
597
+ * @param {number} radians
598
+ */
599
+ rotateZ(radians) {
600
+ wasm.structure_rotateZ(this.__wbg_ptr, radians);
601
+ }
602
+ /**
603
+ * Serializes to mmCIF format.
604
+ * @returns {string}
605
+ */
606
+ toMmcif() {
607
+ let deferred2_0;
608
+ let deferred2_1;
609
+ try {
610
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
611
+ wasm.structure_toMmcif(retptr, this.__wbg_ptr);
612
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
613
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
614
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
615
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
616
+ var ptr1 = r0;
617
+ var len1 = r1;
618
+ if (r3) {
619
+ ptr1 = 0; len1 = 0;
620
+ throw takeObject(r2);
621
+ }
622
+ deferred2_0 = ptr1;
623
+ deferred2_1 = len1;
624
+ return getStringFromWasm0(ptr1, len1);
625
+ } finally {
626
+ wasm.__wbindgen_add_to_stack_pointer(16);
627
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
628
+ }
629
+ }
630
+ /**
631
+ * Translates all atoms by the given vector (x, y, z in Å).
632
+ * @param {number} x
633
+ * @param {number} y
634
+ * @param {number} z
635
+ */
636
+ translate(x, y, z) {
637
+ wasm.structure_translate(this.__wbg_ptr, x, y, z);
638
+ }
639
+ }
640
+ if (Symbol.dispose) Structure.prototype[Symbol.dispose] = Structure.prototype.free;
641
+
642
+ /**
643
+ * A residue or ligand template for topology building.
644
+ */
645
+ export class Template {
646
+ static __wrap(ptr) {
647
+ ptr = ptr >>> 0;
648
+ const obj = Object.create(Template.prototype);
649
+ obj.__wbg_ptr = ptr;
650
+ TemplateFinalization.register(obj, obj.__wbg_ptr, obj);
651
+ return obj;
652
+ }
653
+ static __unwrap(jsValue) {
654
+ if (!(jsValue instanceof Template)) {
655
+ return 0;
656
+ }
657
+ return jsValue.__destroy_into_raw();
658
+ }
659
+ __destroy_into_raw() {
660
+ const ptr = this.__wbg_ptr;
661
+ this.__wbg_ptr = 0;
662
+ TemplateFinalization.unregister(this);
663
+ return ptr;
664
+ }
665
+ free() {
666
+ const ptr = this.__destroy_into_raw();
667
+ wasm.__wbg_template_free(ptr, 0);
668
+ }
669
+ /**
670
+ * Parses a MOL2 byte array into a Template.
671
+ * @param {Uint8Array} content
672
+ * @returns {Template}
673
+ */
674
+ static fromMol2Bytes(content) {
675
+ try {
676
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
677
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
678
+ const len0 = WASM_VECTOR_LEN;
679
+ wasm.template_fromMol2(retptr, ptr0, len0);
680
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
681
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
682
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
683
+ if (r2) {
684
+ throw takeObject(r1);
685
+ }
686
+ return Template.__wrap(r0);
687
+ } finally {
688
+ wasm.__wbindgen_add_to_stack_pointer(16);
689
+ }
690
+ }
691
+ /**
692
+ * Returns the template name (residue code).
693
+ * @returns {string}
694
+ */
695
+ get name() {
696
+ let deferred1_0;
697
+ let deferred1_1;
698
+ try {
699
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
700
+ wasm.template_name(retptr, this.__wbg_ptr);
701
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
702
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
703
+ deferred1_0 = r0;
704
+ deferred1_1 = r1;
705
+ return getStringFromWasm0(r0, r1);
706
+ } finally {
707
+ wasm.__wbindgen_add_to_stack_pointer(16);
708
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
709
+ }
710
+ }
711
+ /**
712
+ * Parses a MOL2 string into a Template.
713
+ * @param {string} content
714
+ * @returns {Template}
715
+ */
716
+ static fromMol2(content) {
717
+ try {
718
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
719
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
720
+ const len0 = WASM_VECTOR_LEN;
721
+ wasm.template_fromMol2(retptr, ptr0, len0);
722
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
723
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
724
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
725
+ if (r2) {
726
+ throw takeObject(r1);
727
+ }
728
+ return Template.__wrap(r0);
729
+ } finally {
730
+ wasm.__wbindgen_add_to_stack_pointer(16);
731
+ }
732
+ }
733
+ }
734
+ if (Symbol.dispose) Template.prototype[Symbol.dispose] = Template.prototype.free;
735
+
736
+ /**
737
+ * A structure with bond connectivity information.
738
+ */
739
+ export class Topology {
740
+ static __wrap(ptr) {
741
+ ptr = ptr >>> 0;
742
+ const obj = Object.create(Topology.prototype);
743
+ obj.__wbg_ptr = ptr;
744
+ TopologyFinalization.register(obj, obj.__wbg_ptr, obj);
745
+ return obj;
746
+ }
747
+ __destroy_into_raw() {
748
+ const ptr = this.__wbg_ptr;
749
+ this.__wbg_ptr = 0;
750
+ TopologyFinalization.unregister(this);
751
+ return ptr;
752
+ }
753
+ free() {
754
+ const ptr = this.__destroy_into_raw();
755
+ wasm.__wbg_topology_free(ptr, 0);
756
+ }
757
+ /**
758
+ * Returns the number of bonds.
759
+ * @returns {number}
760
+ */
761
+ get bondCount() {
762
+ const ret = wasm.topology_bondCount(this.__wbg_ptr);
763
+ return ret >>> 0;
764
+ }
765
+ /**
766
+ * Serializes to PDB format as bytes.
767
+ * @returns {Uint8Array}
768
+ */
769
+ toPdbBytes() {
770
+ try {
771
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
772
+ wasm.topology_toPdbBytes(retptr, this.__wbg_ptr);
773
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
774
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
775
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
776
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
777
+ if (r3) {
778
+ throw takeObject(r2);
779
+ }
780
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
781
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
782
+ return v1;
783
+ } finally {
784
+ wasm.__wbindgen_add_to_stack_pointer(16);
785
+ }
786
+ }
787
+ /**
788
+ * Creates a Topology from a Structure.
789
+ * @param {Structure} structure
790
+ * @param {TopologyConfig | null} [config]
791
+ * @param {Template[] | null} [templates]
792
+ * @returns {Topology}
793
+ */
794
+ static fromStructure(structure, config, templates) {
795
+ try {
796
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
797
+ _assertClass(structure, Structure);
798
+ var ptr0 = isLikeNone(templates) ? 0 : passArrayJsValueToWasm0(templates, wasm.__wbindgen_export);
799
+ var len0 = WASM_VECTOR_LEN;
800
+ wasm.topology_fromStructure(retptr, structure.__wbg_ptr, isLikeNone(config) ? 0 : addHeapObject(config), ptr0, len0);
801
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
802
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
803
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
804
+ if (r2) {
805
+ throw takeObject(r1);
806
+ }
807
+ return Topology.__wrap(r0);
808
+ } finally {
809
+ wasm.__wbindgen_add_to_stack_pointer(16);
810
+ }
811
+ }
812
+ /**
813
+ * Serializes to mmCIF format as bytes.
814
+ * @returns {Uint8Array}
815
+ */
816
+ toMmcifBytes() {
817
+ try {
818
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
819
+ wasm.topology_toMmcifBytes(retptr, this.__wbg_ptr);
820
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
821
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
822
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
823
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
824
+ if (r3) {
825
+ throw takeObject(r2);
826
+ }
827
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
828
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
829
+ return v1;
830
+ } finally {
831
+ wasm.__wbindgen_add_to_stack_pointer(16);
832
+ }
833
+ }
834
+ /**
835
+ * Serializes to PDB format with CONECT records.
836
+ * @returns {string}
837
+ */
838
+ toPdb() {
839
+ let deferred2_0;
840
+ let deferred2_1;
841
+ try {
842
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
843
+ wasm.topology_toPdb(retptr, this.__wbg_ptr);
844
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
845
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
846
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
847
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
848
+ var ptr1 = r0;
849
+ var len1 = r1;
850
+ if (r3) {
851
+ ptr1 = 0; len1 = 0;
852
+ throw takeObject(r2);
853
+ }
854
+ deferred2_0 = ptr1;
855
+ deferred2_1 = len1;
856
+ return getStringFromWasm0(ptr1, len1);
857
+ } finally {
858
+ wasm.__wbindgen_add_to_stack_pointer(16);
859
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
860
+ }
861
+ }
862
+ /**
863
+ * Serializes to mmCIF format with struct_conn records.
864
+ * @returns {string}
865
+ */
866
+ toMmcif() {
867
+ let deferred2_0;
868
+ let deferred2_1;
869
+ try {
870
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
871
+ wasm.topology_toMmcif(retptr, this.__wbg_ptr);
872
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
873
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
874
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
875
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
876
+ var ptr1 = r0;
877
+ var len1 = r1;
878
+ if (r3) {
879
+ ptr1 = 0; len1 = 0;
880
+ throw takeObject(r2);
881
+ }
882
+ deferred2_0 = ptr1;
883
+ deferred2_1 = len1;
884
+ return getStringFromWasm0(ptr1, len1);
885
+ } finally {
886
+ wasm.__wbindgen_add_to_stack_pointer(16);
887
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
888
+ }
889
+ }
890
+ /**
891
+ * Returns a copy of the underlying structure.
892
+ * @returns {Structure}
893
+ */
894
+ get structure() {
895
+ const ret = wasm.topology_structure(this.__wbg_ptr);
896
+ return Structure.__wrap(ret);
897
+ }
898
+ }
899
+ if (Symbol.dispose) Topology.prototype[Symbol.dispose] = Topology.prototype.free;
900
+
901
+ /**
902
+ * Initializes panic hook for better error messages in browser console.
903
+ *
904
+ * This function is automatically called when the WASM module is loaded.
905
+ * It sets up `console_error_panic_hook` to provide readable panic messages
906
+ * in the browser's developer console instead of cryptic WASM error codes.
907
+ */
908
+ export function init() {
909
+ wasm.init();
910
+ }
911
+
912
+ export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
913
+ const ret = Error(getStringFromWasm0(arg0, arg1));
914
+ return addHeapObject(ret);
915
+ };
916
+
917
+ export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
918
+ const ret = Number(getObject(arg0));
919
+ return ret;
920
+ };
921
+
922
+ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
923
+ const ret = String(getObject(arg1));
924
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
925
+ const len1 = WASM_VECTOR_LEN;
926
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
927
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
928
+ };
929
+
930
+ export function __wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d(arg0, arg1) {
931
+ const v = getObject(arg1);
932
+ const ret = typeof(v) === 'bigint' ? v : undefined;
933
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
934
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
935
+ };
936
+
937
+ export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
938
+ const v = getObject(arg0);
939
+ const ret = typeof(v) === 'boolean' ? v : undefined;
940
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
941
+ };
942
+
943
+ export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
944
+ const ret = debugString(getObject(arg1));
945
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
946
+ const len1 = WASM_VECTOR_LEN;
947
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
948
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
949
+ };
950
+
951
+ export function __wbg___wbindgen_in_0d3e1e8f0c669317(arg0, arg1) {
952
+ const ret = getObject(arg0) in getObject(arg1);
953
+ return ret;
954
+ };
955
+
956
+ export function __wbg___wbindgen_is_bigint_0e1a2e3f55cfae27(arg0) {
957
+ const ret = typeof(getObject(arg0)) === 'bigint';
958
+ return ret;
959
+ };
960
+
961
+ export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
962
+ const ret = typeof(getObject(arg0)) === 'function';
963
+ return ret;
964
+ };
965
+
966
+ export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
967
+ const val = getObject(arg0);
968
+ const ret = typeof(val) === 'object' && val !== null;
969
+ return ret;
970
+ };
971
+
972
+ export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
973
+ const ret = getObject(arg0) === undefined;
974
+ return ret;
975
+ };
976
+
977
+ export function __wbg___wbindgen_jsval_eq_b6101cc9cef1fe36(arg0, arg1) {
978
+ const ret = getObject(arg0) === getObject(arg1);
979
+ return ret;
980
+ };
981
+
982
+ export function __wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d(arg0, arg1) {
983
+ const ret = getObject(arg0) == getObject(arg1);
984
+ return ret;
985
+ };
986
+
987
+ export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
988
+ const obj = getObject(arg1);
989
+ const ret = typeof(obj) === 'number' ? obj : undefined;
990
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
991
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
992
+ };
993
+
994
+ export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
995
+ const obj = getObject(arg1);
996
+ const ret = typeof(obj) === 'string' ? obj : undefined;
997
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
998
+ var len1 = WASM_VECTOR_LEN;
999
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1000
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1001
+ };
1002
+
1003
+ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
1004
+ throw new Error(getStringFromWasm0(arg0, arg1));
1005
+ };
1006
+
1007
+ export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
1008
+ const ret = getObject(arg0).call(getObject(arg1));
1009
+ return addHeapObject(ret);
1010
+ }, arguments) };
1011
+
1012
+ export function __wbg_done_62ea16af4ce34b24(arg0) {
1013
+ const ret = getObject(arg0).done;
1014
+ return ret;
1015
+ };
1016
+
1017
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
1018
+ let deferred0_0;
1019
+ let deferred0_1;
1020
+ try {
1021
+ deferred0_0 = arg0;
1022
+ deferred0_1 = arg1;
1023
+ console.error(getStringFromWasm0(arg0, arg1));
1024
+ } finally {
1025
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1026
+ }
1027
+ };
1028
+
1029
+ export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(function (arg0, arg1) {
1030
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1031
+ }, arguments) };
1032
+
1033
+ export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
1034
+ const ret = getObject(arg0)[arg1 >>> 0];
1035
+ return addHeapObject(ret);
1036
+ };
1037
+
1038
+ export function __wbg_get_af9dab7e9603ea93() { return handleError(function (arg0, arg1) {
1039
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1040
+ return addHeapObject(ret);
1041
+ }, arguments) };
1042
+
1043
+ export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
1044
+ const ret = getObject(arg0)[getObject(arg1)];
1045
+ return addHeapObject(ret);
1046
+ };
1047
+
1048
+ export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
1049
+ let result;
1050
+ try {
1051
+ result = getObject(arg0) instanceof ArrayBuffer;
1052
+ } catch (_) {
1053
+ result = false;
1054
+ }
1055
+ const ret = result;
1056
+ return ret;
1057
+ };
1058
+
1059
+ export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
1060
+ let result;
1061
+ try {
1062
+ result = getObject(arg0) instanceof Uint8Array;
1063
+ } catch (_) {
1064
+ result = false;
1065
+ }
1066
+ const ret = result;
1067
+ return ret;
1068
+ };
1069
+
1070
+ export function __wbg_isArray_51fd9e6422c0a395(arg0) {
1071
+ const ret = Array.isArray(getObject(arg0));
1072
+ return ret;
1073
+ };
1074
+
1075
+ export function __wbg_isSafeInteger_ae7d3f054d55fa16(arg0) {
1076
+ const ret = Number.isSafeInteger(getObject(arg0));
1077
+ return ret;
1078
+ };
1079
+
1080
+ export function __wbg_iterator_27b7c8b35ab3e86b() {
1081
+ const ret = Symbol.iterator;
1082
+ return addHeapObject(ret);
1083
+ };
1084
+
1085
+ export function __wbg_length_22ac23eaec9d8053(arg0) {
1086
+ const ret = getObject(arg0).length;
1087
+ return ret;
1088
+ };
1089
+
1090
+ export function __wbg_length_d45040a40c570362(arg0) {
1091
+ const ret = getObject(arg0).length;
1092
+ return ret;
1093
+ };
1094
+
1095
+ export function __wbg_new_1ba21ce319a06297() {
1096
+ const ret = new Object();
1097
+ return addHeapObject(ret);
1098
+ };
1099
+
1100
+ export function __wbg_new_25f239778d6112b9() {
1101
+ const ret = new Array();
1102
+ return addHeapObject(ret);
1103
+ };
1104
+
1105
+ export function __wbg_new_6421f6084cc5bc5a(arg0) {
1106
+ const ret = new Uint8Array(getObject(arg0));
1107
+ return addHeapObject(ret);
1108
+ };
1109
+
1110
+ export function __wbg_new_8a6f238a6ece86ea() {
1111
+ const ret = new Error();
1112
+ return addHeapObject(ret);
1113
+ };
1114
+
1115
+ export function __wbg_next_138a17bbf04e926c(arg0) {
1116
+ const ret = getObject(arg0).next;
1117
+ return addHeapObject(ret);
1118
+ };
1119
+
1120
+ export function __wbg_next_3cfe5c0fe2a4cc53() { return handleError(function (arg0) {
1121
+ const ret = getObject(arg0).next();
1122
+ return addHeapObject(ret);
1123
+ }, arguments) };
1124
+
1125
+ export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
1126
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1127
+ };
1128
+
1129
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
1130
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1131
+ };
1132
+
1133
+ export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
1134
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1135
+ };
1136
+
1137
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
1138
+ const ret = getObject(arg1).stack;
1139
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1140
+ const len1 = WASM_VECTOR_LEN;
1141
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1142
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1143
+ };
1144
+
1145
+ export function __wbg_template_unwrap(arg0) {
1146
+ const ret = Template.__unwrap(getObject(arg0));
1147
+ return ret;
1148
+ };
1149
+
1150
+ export function __wbg_value_57b7b035e117f7ee(arg0) {
1151
+ const ret = getObject(arg0).value;
1152
+ return addHeapObject(ret);
1153
+ };
1154
+
1155
+ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
1156
+ // Cast intrinsic for `Ref(String) -> Externref`.
1157
+ const ret = getStringFromWasm0(arg0, arg1);
1158
+ return addHeapObject(ret);
1159
+ };
1160
+
1161
+ export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
1162
+ // Cast intrinsic for `U64 -> Externref`.
1163
+ const ret = BigInt.asUintN(64, arg0);
1164
+ return addHeapObject(ret);
1165
+ };
1166
+
1167
+ export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
1168
+ // Cast intrinsic for `F64 -> Externref`.
1169
+ const ret = arg0;
1170
+ return addHeapObject(ret);
1171
+ };
1172
+
1173
+ export function __wbindgen_object_clone_ref(arg0) {
1174
+ const ret = getObject(arg0);
1175
+ return addHeapObject(ret);
1176
+ };
1177
+
1178
+ export function __wbindgen_object_drop_ref(arg0) {
1179
+ takeObject(arg0);
1180
+ };