@kent-tokyo/chematic 1.2.1 → 1.2.3

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.
package/chematic_wasm.js CHANGED
@@ -183,9 +183,10 @@ export class DepictOptions {
183
183
  * @param {string} color
184
184
  */
185
185
  set_atom_color(idx, color) {
186
+ const val2 = +idx;
186
187
  const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
187
188
  const len0 = WASM_VECTOR_LEN;
188
- wasm.depictoptions_set_atom_color(this.__wbg_ptr, idx, ptr0, len0);
189
+ wasm.depictoptions_set_atom_color(this.__wbg_ptr, val2, ptr0, len0);
189
190
  }
190
191
  /**
191
192
  * @param {boolean} v
@@ -214,7 +215,7 @@ export class DepictOptions {
214
215
  wasm.depictoptions_set_height(this.__wbg_ptr, h);
215
216
  }
216
217
  /**
217
- * @param {Uint32Array} atoms
218
+ * @param {Uint32Array | number[]} atoms
218
219
  */
219
220
  set_highlight_atoms(atoms) {
220
221
  const ptr0 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
@@ -222,7 +223,7 @@ export class DepictOptions {
222
223
  wasm.depictoptions_set_highlight_atoms(this.__wbg_ptr, ptr0, len0);
223
224
  }
224
225
  /**
225
- * @param {Uint32Array} bonds
226
+ * @param {Uint32Array | number[]} bonds
226
227
  */
227
228
  set_highlight_bonds(bonds) {
228
229
  const ptr0 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
@@ -327,23 +328,24 @@ export class MhfpLshHandle {
327
328
  * @returns {string}
328
329
  */
329
330
  query_json(query_smiles, threshold) {
330
- let deferred3_0;
331
- let deferred3_1;
331
+ let deferred4_0;
332
+ let deferred4_1;
332
333
  try {
334
+ const val2 = +threshold;
333
335
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
336
  const len0 = WASM_VECTOR_LEN;
335
- const ret = wasm.mhfplshhandle_query_json(this.__wbg_ptr, ptr0, len0, threshold);
336
- var ptr2 = ret[0];
337
- var len2 = ret[1];
337
+ const ret = wasm.mhfplshhandle_query_json(this.__wbg_ptr, ptr0, len0, val2);
338
+ var ptr3 = ret[0];
339
+ var len3 = ret[1];
338
340
  if (ret[3]) {
339
- ptr2 = 0; len2 = 0;
341
+ ptr3 = 0; len3 = 0;
340
342
  throw takeFromExternrefTable0(ret[2]);
341
343
  }
342
- deferred3_0 = ptr2;
343
- deferred3_1 = len2;
344
- return getStringFromWasm0(ptr2, len2);
344
+ deferred4_0 = ptr3;
345
+ deferred4_1 = len3;
346
+ return getStringFromWasm0(ptr3, len3);
345
347
  } finally {
346
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
348
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
347
349
  }
348
350
  }
349
351
  }
@@ -694,6 +696,23 @@ export class MolHandle {
694
696
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
695
697
  }
696
698
  }
699
+ /**
700
+ * Total formula with explicit isotope labels, hydrogens and net charge.
701
+ * D/T use [2H]/[3H]; maps/stereo and isotope locations are not encoded.
702
+ * @returns {string}
703
+ */
704
+ formula_with_isotopes() {
705
+ let deferred1_0;
706
+ let deferred1_1;
707
+ try {
708
+ const ret = wasm.molhandle_formula_with_isotopes(this.__wbg_ptr);
709
+ deferred1_0 = ret[0];
710
+ deferred1_1 = ret[1];
711
+ return getStringFromWasm0(ret[0], ret[1]);
712
+ } finally {
713
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
714
+ }
715
+ }
697
716
  /**
698
717
  * Fraction of sp3 carbons (Fsp3).
699
718
  * @returns {number}
@@ -1067,29 +1086,40 @@ export class MolHandle {
1067
1086
  * @returns {string}
1068
1087
  */
1069
1088
  rdkit_align_json(probe_coords_json, reference_coords_json, atom_map_json, weights_json, reflect, max_iterations) {
1070
- let deferred6_0;
1071
- let deferred6_1;
1089
+ let deferred8_0;
1090
+ let deferred8_1;
1072
1091
  try {
1073
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1074
- const len0 = WASM_VECTOR_LEN;
1075
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1076
- const len1 = WASM_VECTOR_LEN;
1077
- var ptr2 = isLikeNone(atom_map_json) ? 0 : passStringToWasm0(atom_map_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1078
- var len2 = WASM_VECTOR_LEN;
1079
- var ptr3 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1080
- var len3 = WASM_VECTOR_LEN;
1081
- const ret = wasm.molhandle_rdkit_align_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, reflect, max_iterations);
1082
- var ptr5 = ret[0];
1083
- var len5 = ret[1];
1092
+ const val5 = +reflect;
1093
+ const val6 = +max_iterations;
1094
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
1095
+ try {
1096
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1097
+ len0 = WASM_VECTOR_LEN;
1098
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1099
+ len1 = WASM_VECTOR_LEN;
1100
+ ptr2 = isLikeNone(atom_map_json) ? 0 : passStringToWasm0(atom_map_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1101
+ len2 = WASM_VECTOR_LEN;
1102
+ ptr3 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1103
+ len3 = WASM_VECTOR_LEN;
1104
+ } catch (e) {
1105
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
1106
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1107
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1108
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1109
+ throw e;
1110
+ }
1111
+ const ret = wasm.molhandle_rdkit_align_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5, val6);
1112
+ var ptr7 = ret[0];
1113
+ var len7 = ret[1];
1084
1114
  if (ret[3]) {
1085
- ptr5 = 0; len5 = 0;
1115
+ ptr7 = 0; len7 = 0;
1086
1116
  throw takeFromExternrefTable0(ret[2]);
1087
1117
  }
1088
- deferred6_0 = ptr5;
1089
- deferred6_1 = len5;
1090
- return getStringFromWasm0(ptr5, len5);
1118
+ deferred8_0 = ptr7;
1119
+ deferred8_1 = len7;
1120
+ return getStringFromWasm0(ptr7, len7);
1091
1121
  } finally {
1092
- wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
1122
+ wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
1093
1123
  }
1094
1124
  }
1095
1125
  /**
@@ -1103,25 +1133,34 @@ export class MolHandle {
1103
1133
  * @returns {string}
1104
1134
  */
1105
1135
  rdkit_all_conformer_best_rms_json(conformers_json, max_matches, symmetrize, weights_json) {
1106
- let deferred4_0;
1107
- let deferred4_1;
1136
+ let deferred6_0;
1137
+ let deferred6_1;
1108
1138
  try {
1109
- const ptr0 = passStringToWasm0(conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1110
- const len0 = WASM_VECTOR_LEN;
1111
- var ptr1 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1112
- var len1 = WASM_VECTOR_LEN;
1113
- const ret = wasm.molhandle_rdkit_all_conformer_best_rms_json(this.__wbg_ptr, ptr0, len0, max_matches, symmetrize, ptr1, len1);
1114
- var ptr3 = ret[0];
1115
- var len3 = ret[1];
1139
+ const val3 = +max_matches;
1140
+ const val4 = +symmetrize;
1141
+ let ptr0, len0, ptr1, len1;
1142
+ try {
1143
+ ptr0 = passStringToWasm0(conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1144
+ len0 = WASM_VECTOR_LEN;
1145
+ ptr1 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1146
+ len1 = WASM_VECTOR_LEN;
1147
+ } catch (e) {
1148
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1149
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1150
+ throw e;
1151
+ }
1152
+ const ret = wasm.molhandle_rdkit_all_conformer_best_rms_json(this.__wbg_ptr, ptr0, len0, val3, val4, ptr1, len1);
1153
+ var ptr5 = ret[0];
1154
+ var len5 = ret[1];
1116
1155
  if (ret[3]) {
1117
- ptr3 = 0; len3 = 0;
1156
+ ptr5 = 0; len5 = 0;
1118
1157
  throw takeFromExternrefTable0(ret[2]);
1119
1158
  }
1120
- deferred4_0 = ptr3;
1121
- deferred4_1 = len3;
1122
- return getStringFromWasm0(ptr3, len3);
1159
+ deferred6_0 = ptr5;
1160
+ deferred6_1 = len5;
1161
+ return getStringFromWasm0(ptr5, len5);
1123
1162
  } finally {
1124
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1163
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
1125
1164
  }
1126
1165
  }
1127
1166
  /**
@@ -1137,28 +1176,38 @@ export class MolHandle {
1137
1176
  * @returns {string}
1138
1177
  */
1139
1178
  rdkit_all_conformer_best_rms_to_reference_json(reference, probe_conformers_json, reference_conformers_json, max_matches, symmetrize, weights_json) {
1140
- let deferred5_0;
1141
- let deferred5_1;
1179
+ let deferred7_0;
1180
+ let deferred7_1;
1142
1181
  try {
1143
1182
  _assertClass(reference, MolHandle);
1144
- const ptr0 = passStringToWasm0(probe_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1145
- const len0 = WASM_VECTOR_LEN;
1146
- const ptr1 = passStringToWasm0(reference_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1147
- const len1 = WASM_VECTOR_LEN;
1148
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1149
- var len2 = WASM_VECTOR_LEN;
1150
- const ret = wasm.molhandle_rdkit_all_conformer_best_rms_to_reference_json(this.__wbg_ptr, reference.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1151
- var ptr4 = ret[0];
1152
- var len4 = ret[1];
1183
+ const val4 = +max_matches;
1184
+ const val5 = +symmetrize;
1185
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1186
+ try {
1187
+ ptr0 = passStringToWasm0(probe_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1188
+ len0 = WASM_VECTOR_LEN;
1189
+ ptr1 = passStringToWasm0(reference_conformers_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1190
+ len1 = WASM_VECTOR_LEN;
1191
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1192
+ len2 = WASM_VECTOR_LEN;
1193
+ } catch (e) {
1194
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1195
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1196
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1197
+ throw e;
1198
+ }
1199
+ const ret = wasm.molhandle_rdkit_all_conformer_best_rms_to_reference_json(this.__wbg_ptr, reference.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1200
+ var ptr6 = ret[0];
1201
+ var len6 = ret[1];
1153
1202
  if (ret[3]) {
1154
- ptr4 = 0; len4 = 0;
1203
+ ptr6 = 0; len6 = 0;
1155
1204
  throw takeFromExternrefTable0(ret[2]);
1156
1205
  }
1157
- deferred5_0 = ptr4;
1158
- deferred5_1 = len4;
1159
- return getStringFromWasm0(ptr4, len4);
1206
+ deferred7_0 = ptr6;
1207
+ deferred7_1 = len6;
1208
+ return getStringFromWasm0(ptr6, len6);
1160
1209
  } finally {
1161
- wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
1210
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
1162
1211
  }
1163
1212
  }
1164
1213
  /**
@@ -1171,27 +1220,37 @@ export class MolHandle {
1171
1220
  * @returns {string}
1172
1221
  */
1173
1222
  rdkit_best_alignment_json(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
1174
- let deferred5_0;
1175
- let deferred5_1;
1223
+ let deferred7_0;
1224
+ let deferred7_1;
1176
1225
  try {
1177
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1178
- const len0 = WASM_VECTOR_LEN;
1179
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1180
- const len1 = WASM_VECTOR_LEN;
1181
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1182
- var len2 = WASM_VECTOR_LEN;
1183
- const ret = wasm.molhandle_rdkit_best_alignment_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1184
- var ptr4 = ret[0];
1185
- var len4 = ret[1];
1226
+ const val4 = +max_matches;
1227
+ const val5 = +symmetrize;
1228
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1229
+ try {
1230
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1231
+ len0 = WASM_VECTOR_LEN;
1232
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1233
+ len1 = WASM_VECTOR_LEN;
1234
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1235
+ len2 = WASM_VECTOR_LEN;
1236
+ } catch (e) {
1237
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1238
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1239
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1240
+ throw e;
1241
+ }
1242
+ const ret = wasm.molhandle_rdkit_best_alignment_json(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1243
+ var ptr6 = ret[0];
1244
+ var len6 = ret[1];
1186
1245
  if (ret[3]) {
1187
- ptr4 = 0; len4 = 0;
1246
+ ptr6 = 0; len6 = 0;
1188
1247
  throw takeFromExternrefTable0(ret[2]);
1189
1248
  }
1190
- deferred5_0 = ptr4;
1191
- deferred5_1 = len4;
1192
- return getStringFromWasm0(ptr4, len4);
1249
+ deferred7_0 = ptr6;
1250
+ deferred7_1 = len6;
1251
+ return getStringFromWasm0(ptr6, len6);
1193
1252
  } finally {
1194
- wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
1253
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
1195
1254
  }
1196
1255
  }
1197
1256
  /**
@@ -1204,13 +1263,23 @@ export class MolHandle {
1204
1263
  * @returns {number}
1205
1264
  */
1206
1265
  rdkit_best_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
1207
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1208
- const len0 = WASM_VECTOR_LEN;
1209
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1210
- const len1 = WASM_VECTOR_LEN;
1211
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1212
- var len2 = WASM_VECTOR_LEN;
1213
- const ret = wasm.molhandle_rdkit_best_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1266
+ const val4 = +max_matches;
1267
+ const val5 = +symmetrize;
1268
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1269
+ try {
1270
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1271
+ len0 = WASM_VECTOR_LEN;
1272
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1273
+ len1 = WASM_VECTOR_LEN;
1274
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1275
+ len2 = WASM_VECTOR_LEN;
1276
+ } catch (e) {
1277
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1278
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1279
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1280
+ throw e;
1281
+ }
1282
+ const ret = wasm.molhandle_rdkit_best_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1214
1283
  if (ret[2]) {
1215
1284
  throw takeFromExternrefTable0(ret[1]);
1216
1285
  }
@@ -1257,23 +1326,26 @@ export class MolHandle {
1257
1326
  * @returns {string}
1258
1327
  */
1259
1328
  rdkit_bounds_matrix_with_constraints_json(constraints_json, set15bounds, do_triangle_smoothing, use_macrocycle_14_config) {
1260
- let deferred3_0;
1261
- let deferred3_1;
1329
+ let deferred6_0;
1330
+ let deferred6_1;
1262
1331
  try {
1332
+ const val2 = +set15bounds;
1333
+ const val3 = +do_triangle_smoothing;
1334
+ const val4 = +use_macrocycle_14_config;
1263
1335
  const ptr0 = passStringToWasm0(constraints_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1264
1336
  const len0 = WASM_VECTOR_LEN;
1265
- const ret = wasm.molhandle_rdkit_bounds_matrix_with_constraints_json(this.__wbg_ptr, ptr0, len0, set15bounds, do_triangle_smoothing, use_macrocycle_14_config);
1266
- var ptr2 = ret[0];
1267
- var len2 = ret[1];
1337
+ const ret = wasm.molhandle_rdkit_bounds_matrix_with_constraints_json(this.__wbg_ptr, ptr0, len0, val2, val3, val4);
1338
+ var ptr5 = ret[0];
1339
+ var len5 = ret[1];
1268
1340
  if (ret[3]) {
1269
- ptr2 = 0; len2 = 0;
1341
+ ptr5 = 0; len5 = 0;
1270
1342
  throw takeFromExternrefTable0(ret[2]);
1271
1343
  }
1272
- deferred3_0 = ptr2;
1273
- deferred3_1 = len2;
1274
- return getStringFromWasm0(ptr2, len2);
1344
+ deferred6_0 = ptr5;
1345
+ deferred6_1 = len5;
1346
+ return getStringFromWasm0(ptr5, len5);
1275
1347
  } finally {
1276
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1348
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
1277
1349
  }
1278
1350
  }
1279
1351
  /**
@@ -1286,13 +1358,23 @@ export class MolHandle {
1286
1358
  * @returns {number}
1287
1359
  */
1288
1360
  rdkit_calc_rms(probe_coords_json, reference_coords_json, max_matches, symmetrize, weights_json) {
1289
- const ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1290
- const len0 = WASM_VECTOR_LEN;
1291
- const ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1292
- const len1 = WASM_VECTOR_LEN;
1293
- var ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1294
- var len2 = WASM_VECTOR_LEN;
1295
- const ret = wasm.molhandle_rdkit_calc_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_matches, symmetrize, ptr2, len2);
1361
+ const val4 = +max_matches;
1362
+ const val5 = +symmetrize;
1363
+ let ptr0, len0, ptr1, len1, ptr2, len2;
1364
+ try {
1365
+ ptr0 = passStringToWasm0(probe_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1366
+ len0 = WASM_VECTOR_LEN;
1367
+ ptr1 = passStringToWasm0(reference_coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1368
+ len1 = WASM_VECTOR_LEN;
1369
+ ptr2 = isLikeNone(weights_json) ? 0 : passStringToWasm0(weights_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1370
+ len2 = WASM_VECTOR_LEN;
1371
+ } catch (e) {
1372
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
1373
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
1374
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
1375
+ throw e;
1376
+ }
1377
+ const ret = wasm.molhandle_rdkit_calc_rms(this.__wbg_ptr, ptr0, len0, ptr1, len1, val4, val5, ptr2, len2);
1296
1378
  if (ret[2]) {
1297
1379
  throw takeFromExternrefTable0(ret[1]);
1298
1380
  }
@@ -1351,23 +1433,24 @@ export class MolHandle {
1351
1433
  * @returns {string}
1352
1434
  */
1353
1435
  rdkit_distance_matrix_3d_checked_json(coords_json, use_atom_wts) {
1354
- let deferred3_0;
1355
- let deferred3_1;
1436
+ let deferred4_0;
1437
+ let deferred4_1;
1356
1438
  try {
1439
+ const val2 = +use_atom_wts;
1357
1440
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1358
1441
  const len0 = WASM_VECTOR_LEN;
1359
- const ret = wasm.molhandle_rdkit_distance_matrix_3d_checked_json(this.__wbg_ptr, ptr0, len0, use_atom_wts);
1360
- var ptr2 = ret[0];
1361
- var len2 = ret[1];
1442
+ const ret = wasm.molhandle_rdkit_distance_matrix_3d_checked_json(this.__wbg_ptr, ptr0, len0, val2);
1443
+ var ptr3 = ret[0];
1444
+ var len3 = ret[1];
1362
1445
  if (ret[3]) {
1363
- ptr2 = 0; len2 = 0;
1446
+ ptr3 = 0; len3 = 0;
1364
1447
  throw takeFromExternrefTable0(ret[2]);
1365
1448
  }
1366
- deferred3_0 = ptr2;
1367
- deferred3_1 = len2;
1368
- return getStringFromWasm0(ptr2, len2);
1449
+ deferred4_0 = ptr3;
1450
+ deferred4_1 = len3;
1451
+ return getStringFromWasm0(ptr3, len3);
1369
1452
  } finally {
1370
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1453
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1371
1454
  }
1372
1455
  }
1373
1456
  /**
@@ -1404,23 +1487,25 @@ export class MolHandle {
1404
1487
  * @returns {string}
1405
1488
  */
1406
1489
  rdkit_embed_with_constraints_json(constraints_json, random_seed, max_iterations) {
1407
- let deferred3_0;
1408
- let deferred3_1;
1490
+ let deferred5_0;
1491
+ let deferred5_1;
1409
1492
  try {
1493
+ const val2 = +random_seed;
1494
+ const val3 = +max_iterations;
1410
1495
  const ptr0 = passStringToWasm0(constraints_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1411
1496
  const len0 = WASM_VECTOR_LEN;
1412
- const ret = wasm.molhandle_rdkit_embed_with_constraints_json(this.__wbg_ptr, ptr0, len0, random_seed, max_iterations);
1413
- var ptr2 = ret[0];
1414
- var len2 = ret[1];
1497
+ const ret = wasm.molhandle_rdkit_embed_with_constraints_json(this.__wbg_ptr, ptr0, len0, val2, val3);
1498
+ var ptr4 = ret[0];
1499
+ var len4 = ret[1];
1415
1500
  if (ret[3]) {
1416
- ptr2 = 0; len2 = 0;
1501
+ ptr4 = 0; len4 = 0;
1417
1502
  throw takeFromExternrefTable0(ret[2]);
1418
1503
  }
1419
- deferred3_0 = ptr2;
1420
- deferred3_1 = len2;
1421
- return getStringFromWasm0(ptr2, len2);
1504
+ deferred5_0 = ptr4;
1505
+ deferred5_1 = len4;
1506
+ return getStringFromWasm0(ptr4, len4);
1422
1507
  } finally {
1423
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1508
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
1424
1509
  }
1425
1510
  }
1426
1511
  /**
@@ -1430,23 +1515,24 @@ export class MolHandle {
1430
1515
  * @returns {string}
1431
1516
  */
1432
1517
  rdkit_mol_hash(_function, use_cx_smiles) {
1433
- let deferred3_0;
1434
- let deferred3_1;
1518
+ let deferred4_0;
1519
+ let deferred4_1;
1435
1520
  try {
1521
+ const val2 = +use_cx_smiles;
1436
1522
  const ptr0 = passStringToWasm0(_function, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1437
1523
  const len0 = WASM_VECTOR_LEN;
1438
- const ret = wasm.molhandle_rdkit_mol_hash(this.__wbg_ptr, ptr0, len0, use_cx_smiles);
1439
- var ptr2 = ret[0];
1440
- var len2 = ret[1];
1524
+ const ret = wasm.molhandle_rdkit_mol_hash(this.__wbg_ptr, ptr0, len0, val2);
1525
+ var ptr3 = ret[0];
1526
+ var len3 = ret[1];
1441
1527
  if (ret[3]) {
1442
- ptr2 = 0; len2 = 0;
1528
+ ptr3 = 0; len3 = 0;
1443
1529
  throw takeFromExternrefTable0(ret[2]);
1444
1530
  }
1445
- deferred3_0 = ptr2;
1446
- deferred3_1 = len2;
1447
- return getStringFromWasm0(ptr2, len2);
1531
+ deferred4_0 = ptr3;
1532
+ deferred4_1 = len3;
1533
+ return getStringFromWasm0(ptr3, len3);
1448
1534
  } finally {
1449
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1535
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1450
1536
  }
1451
1537
  }
1452
1538
  /**
@@ -1496,6 +1582,19 @@ export class MolHandle {
1496
1582
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1497
1583
  }
1498
1584
  }
1585
+ /**
1586
+ * Copy the molecule with RDKit's SMILES reader conventions, including
1587
+ * its stereo tags and hydrogen suppression. Throws when conversion
1588
+ * cannot represent the input.
1589
+ * @returns {MolHandle}
1590
+ */
1591
+ rdkit_parsed() {
1592
+ const ret = wasm.molhandle_rdkit_parsed(this.__wbg_ptr);
1593
+ if (ret[2]) {
1594
+ throw takeFromExternrefTable0(ret[1]);
1595
+ }
1596
+ return MolHandle.__wrap(ret[0]);
1597
+ }
1499
1598
  /**
1500
1599
  * RDKit-compatible PDB block. Optional coordinates are a JSON array in
1501
1600
  * zero-based molecule atom order; omit them to write zero coordinates.
@@ -1906,17 +2005,18 @@ export class RdkitSearchIndex {
1906
2005
  * @returns {string}
1907
2006
  */
1908
2007
  search_json(query_smiles, k) {
1909
- let deferred2_0;
1910
- let deferred2_1;
2008
+ let deferred3_0;
2009
+ let deferred3_1;
1911
2010
  try {
2011
+ const val2 = +k;
1912
2012
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1913
2013
  const len0 = WASM_VECTOR_LEN;
1914
- const ret = wasm.rdkitsearchindex_search_json(this.__wbg_ptr, ptr0, len0, k);
1915
- deferred2_0 = ret[0];
1916
- deferred2_1 = ret[1];
2014
+ const ret = wasm.rdkitsearchindex_search_json(this.__wbg_ptr, ptr0, len0, val2);
2015
+ deferred3_0 = ret[0];
2016
+ deferred3_1 = ret[1];
1917
2017
  return getStringFromWasm0(ret[0], ret[1]);
1918
2018
  } finally {
1919
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2019
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1920
2020
  }
1921
2021
  }
1922
2022
  /**
@@ -1930,17 +2030,18 @@ export class RdkitSearchIndex {
1930
2030
  * @returns {string}
1931
2031
  */
1932
2032
  search_json_precise(query_smiles, k) {
1933
- let deferred2_0;
1934
- let deferred2_1;
2033
+ let deferred3_0;
2034
+ let deferred3_1;
1935
2035
  try {
2036
+ const val2 = +k;
1936
2037
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1937
2038
  const len0 = WASM_VECTOR_LEN;
1938
- const ret = wasm.rdkitsearchindex_search_json_precise(this.__wbg_ptr, ptr0, len0, k);
1939
- deferred2_0 = ret[0];
1940
- deferred2_1 = ret[1];
2039
+ const ret = wasm.rdkitsearchindex_search_json_precise(this.__wbg_ptr, ptr0, len0, val2);
2040
+ deferred3_0 = ret[0];
2041
+ deferred3_1 = ret[1];
1941
2042
  return getStringFromWasm0(ret[0], ret[1]);
1942
2043
  } finally {
1943
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2044
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1944
2045
  }
1945
2046
  }
1946
2047
  /**
@@ -1952,17 +2053,19 @@ export class RdkitSearchIndex {
1952
2053
  * @returns {string}
1953
2054
  */
1954
2055
  search_json_threshold_precise(query_smiles, threshold, k) {
1955
- let deferred2_0;
1956
- let deferred2_1;
2056
+ let deferred4_0;
2057
+ let deferred4_1;
1957
2058
  try {
2059
+ const val2 = +threshold;
2060
+ const val3 = +k;
1958
2061
  const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1959
2062
  const len0 = WASM_VECTOR_LEN;
1960
- const ret = wasm.rdkitsearchindex_search_json_threshold_precise(this.__wbg_ptr, ptr0, len0, threshold, k);
1961
- deferred2_0 = ret[0];
1962
- deferred2_1 = ret[1];
2063
+ const ret = wasm.rdkitsearchindex_search_json_threshold_precise(this.__wbg_ptr, ptr0, len0, val2, val3);
2064
+ deferred4_0 = ret[0];
2065
+ deferred4_1 = ret[1];
1963
2066
  return getStringFromWasm0(ret[0], ret[1]);
1964
2067
  } finally {
1965
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2068
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1966
2069
  }
1967
2070
  }
1968
2071
  }
@@ -2304,6 +2407,56 @@ export function batch_report_html(smiles_lines) {
2304
2407
  }
2305
2408
  }
2306
2409
 
2410
+ /**
2411
+ * @param {string} json
2412
+ * @returns {string}
2413
+ */
2414
+ export function bgf_from_record_json(json) {
2415
+ let deferred3_0;
2416
+ let deferred3_1;
2417
+ try {
2418
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2419
+ const len0 = WASM_VECTOR_LEN;
2420
+ const ret = wasm.bgf_from_record_json(ptr0, len0);
2421
+ var ptr2 = ret[0];
2422
+ var len2 = ret[1];
2423
+ if (ret[3]) {
2424
+ ptr2 = 0; len2 = 0;
2425
+ throw takeFromExternrefTable0(ret[2]);
2426
+ }
2427
+ deferred3_0 = ptr2;
2428
+ deferred3_1 = len2;
2429
+ return getStringFromWasm0(ptr2, len2);
2430
+ } finally {
2431
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2432
+ }
2433
+ }
2434
+
2435
+ /**
2436
+ * @param {string} text
2437
+ * @returns {string}
2438
+ */
2439
+ export function bgf_record_json(text) {
2440
+ let deferred3_0;
2441
+ let deferred3_1;
2442
+ try {
2443
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2444
+ const len0 = WASM_VECTOR_LEN;
2445
+ const ret = wasm.bgf_record_json(ptr0, len0);
2446
+ var ptr2 = ret[0];
2447
+ var len2 = ret[1];
2448
+ if (ret[3]) {
2449
+ ptr2 = 0; len2 = 0;
2450
+ throw takeFromExternrefTable0(ret[2]);
2451
+ }
2452
+ deferred3_0 = ptr2;
2453
+ deferred3_1 = len2;
2454
+ return getStringFromWasm0(ptr2, len2);
2455
+ } finally {
2456
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2457
+ }
2458
+ }
2459
+
2307
2460
  /**
2308
2461
  * Predict GI absorption and BBB penetration using the BOILED-Egg method
2309
2462
  * (Daina & Zoete 2016).
@@ -2431,23 +2584,24 @@ export function brics_fragments_json(mol) {
2431
2584
  * @returns {string}
2432
2585
  */
2433
2586
  export function butina_cluster_ecfp4_json(smiles_json, cutoff) {
2434
- let deferred3_0;
2435
- let deferred3_1;
2587
+ let deferred4_0;
2588
+ let deferred4_1;
2436
2589
  try {
2590
+ const val2 = +cutoff;
2437
2591
  const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2438
2592
  const len0 = WASM_VECTOR_LEN;
2439
- const ret = wasm.butina_cluster_ecfp4_json(ptr0, len0, cutoff);
2440
- var ptr2 = ret[0];
2441
- var len2 = ret[1];
2593
+ const ret = wasm.butina_cluster_ecfp4_json(ptr0, len0, val2);
2594
+ var ptr3 = ret[0];
2595
+ var len3 = ret[1];
2442
2596
  if (ret[3]) {
2443
- ptr2 = 0; len2 = 0;
2597
+ ptr3 = 0; len3 = 0;
2444
2598
  throw takeFromExternrefTable0(ret[2]);
2445
2599
  }
2446
- deferred3_0 = ptr2;
2447
- deferred3_1 = len2;
2448
- return getStringFromWasm0(ptr2, len2);
2600
+ deferred4_0 = ptr3;
2601
+ deferred4_1 = len3;
2602
+ return getStringFromWasm0(ptr3, len3);
2449
2603
  } finally {
2450
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2604
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2451
2605
  }
2452
2606
  }
2453
2607
 
@@ -2503,26 +2657,35 @@ export function canonical_tautomer_with_blocked_atoms_json(mol, blocked_atom_ind
2503
2657
  * @returns {string}
2504
2658
  */
2505
2659
  export function canonicalize_conformer_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
2506
- let deferred4_0;
2507
- let deferred4_1;
2660
+ let deferred6_0;
2661
+ let deferred6_1;
2508
2662
  try {
2509
2663
  _assertClass(mol, MolHandle);
2510
- const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2511
- const len0 = WASM_VECTOR_LEN;
2512
- var ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2513
- var len1 = WASM_VECTOR_LEN;
2514
- const ret = wasm.canonicalize_conformer_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, normalize_covar, ignore_hs);
2515
- var ptr3 = ret[0];
2516
- var len3 = ret[1];
2664
+ const val3 = +normalize_covar;
2665
+ const val4 = +ignore_hs;
2666
+ let ptr0, len0, ptr1, len1;
2667
+ try {
2668
+ ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2669
+ len0 = WASM_VECTOR_LEN;
2670
+ ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2671
+ len1 = WASM_VECTOR_LEN;
2672
+ } catch (e) {
2673
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
2674
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
2675
+ throw e;
2676
+ }
2677
+ const ret = wasm.canonicalize_conformer_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, val3, val4);
2678
+ var ptr5 = ret[0];
2679
+ var len5 = ret[1];
2517
2680
  if (ret[3]) {
2518
- ptr3 = 0; len3 = 0;
2681
+ ptr5 = 0; len5 = 0;
2519
2682
  throw takeFromExternrefTable0(ret[2]);
2520
2683
  }
2521
- deferred4_0 = ptr3;
2522
- deferred4_1 = len3;
2523
- return getStringFromWasm0(ptr3, len3);
2684
+ deferred6_0 = ptr5;
2685
+ deferred6_1 = len5;
2686
+ return getStringFromWasm0(ptr5, len5);
2524
2687
  } finally {
2525
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2688
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
2526
2689
  }
2527
2690
  }
2528
2691
 
@@ -2542,10 +2705,17 @@ export function canonicalize_smiles_batch_json(smiles_batch, delimiter) {
2542
2705
  let deferred4_0;
2543
2706
  let deferred4_1;
2544
2707
  try {
2545
- const ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2546
- const len0 = WASM_VECTOR_LEN;
2547
- const ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2548
- const len1 = WASM_VECTOR_LEN;
2708
+ let ptr0, len0, ptr1, len1;
2709
+ try {
2710
+ ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2711
+ len0 = WASM_VECTOR_LEN;
2712
+ ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2713
+ len1 = WASM_VECTOR_LEN;
2714
+ } catch (e) {
2715
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
2716
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
2717
+ throw e;
2718
+ }
2549
2719
  const ret = wasm.canonicalize_smiles_batch_json(ptr0, len0, ptr1, len1);
2550
2720
  var ptr3 = ret[0];
2551
2721
  var len3 = ret[1];
@@ -2713,23 +2883,24 @@ export function cdxml_to_smiles_json(cdxml) {
2713
2883
  * @returns {string}
2714
2884
  */
2715
2885
  export function cdxml_to_smiles_json_with_options(cdxml, infer_nondirectional_stereo) {
2716
- let deferred3_0;
2717
- let deferred3_1;
2886
+ let deferred4_0;
2887
+ let deferred4_1;
2718
2888
  try {
2889
+ const val2 = +infer_nondirectional_stereo;
2719
2890
  const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2720
2891
  const len0 = WASM_VECTOR_LEN;
2721
- const ret = wasm.cdxml_to_smiles_json_with_options(ptr0, len0, infer_nondirectional_stereo);
2722
- var ptr2 = ret[0];
2723
- var len2 = ret[1];
2892
+ const ret = wasm.cdxml_to_smiles_json_with_options(ptr0, len0, val2);
2893
+ var ptr3 = ret[0];
2894
+ var len3 = ret[1];
2724
2895
  if (ret[3]) {
2725
- ptr2 = 0; len2 = 0;
2896
+ ptr3 = 0; len3 = 0;
2726
2897
  throw takeFromExternrefTable0(ret[2]);
2727
2898
  }
2728
- deferred3_0 = ptr2;
2729
- deferred3_1 = len2;
2730
- return getStringFromWasm0(ptr2, len2);
2899
+ deferred4_0 = ptr3;
2900
+ deferred4_1 = len3;
2901
+ return getStringFromWasm0(ptr3, len3);
2731
2902
  } finally {
2732
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2903
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2733
2904
  }
2734
2905
  }
2735
2906
 
@@ -2776,31 +2947,39 @@ export function chematic_version() {
2776
2947
  /**
2777
2948
  * Exact source bytes, projected XML, fragment coordinates and CDX omission tags.
2778
2949
  * CDXML uses the existing graph projection; omissions lists CDX tags only.
2779
- * @param {Uint8Array} data
2950
+ * @param {Uint8Array | number[]} data
2780
2951
  * @param {string} format
2781
2952
  * @param {boolean} allow_metadata_loss
2782
2953
  * @returns {string}
2783
2954
  */
2784
2955
  export function chemdraw_block_report_json(data, format, allow_metadata_loss) {
2785
- let deferred4_0;
2786
- let deferred4_1;
2956
+ let deferred5_0;
2957
+ let deferred5_1;
2787
2958
  try {
2788
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
2789
- const len0 = WASM_VECTOR_LEN;
2790
- const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2791
- const len1 = WASM_VECTOR_LEN;
2792
- const ret = wasm.chemdraw_block_report_json(ptr0, len0, ptr1, len1, allow_metadata_loss);
2793
- var ptr3 = ret[0];
2794
- var len3 = ret[1];
2959
+ const val3 = +allow_metadata_loss;
2960
+ let ptr0, len0, ptr1, len1;
2961
+ try {
2962
+ ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
2963
+ len0 = WASM_VECTOR_LEN;
2964
+ ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2965
+ len1 = WASM_VECTOR_LEN;
2966
+ } catch (e) {
2967
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
2968
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
2969
+ throw e;
2970
+ }
2971
+ const ret = wasm.chemdraw_block_report_json(ptr0, len0, ptr1, len1, val3);
2972
+ var ptr4 = ret[0];
2973
+ var len4 = ret[1];
2795
2974
  if (ret[3]) {
2796
- ptr3 = 0; len3 = 0;
2975
+ ptr4 = 0; len4 = 0;
2797
2976
  throw takeFromExternrefTable0(ret[2]);
2798
2977
  }
2799
- deferred4_0 = ptr3;
2800
- deferred4_1 = len3;
2801
- return getStringFromWasm0(ptr3, len3);
2978
+ deferred5_0 = ptr4;
2979
+ deferred5_1 = len4;
2980
+ return getStringFromWasm0(ptr4, len4);
2802
2981
  } finally {
2803
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2982
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
2804
2983
  }
2805
2984
  }
2806
2985
 
@@ -2813,9 +2992,9 @@ export function chemdraw_block_report_json(data, format, allow_metadata_loss) {
2813
2992
  * [`cip_unresolved_json`] -- never a silently-guessed label. A phosphorus on an
2814
2993
  * unsaturated ring (cyclophosphazene) gets RDKit's CIPLabeler label, which flips
2815
2994
  * with the ring's Kekulé spelling; its object carries `"kekuleDependent": true`.
2816
- * A ring centre with three single bonds and a lone pair (bridgehead amine)
2817
- * gets RDKit's label for the parsed SMILES spelling and carries
2818
- * `"spellingDependent": true`.
2995
+ * `seqCis` and `seqTrans` entries carry `bondIdx` and `bondAtoms`.
2996
+ * Configured odd cumulenes carry the full path as `cumuleneAtoms`, from `atomIdx`.
2997
+ * Saturated ring lone-pair centres use the molecule's recorded ligand order.
2819
2998
  * Returns `"null"` on an internal engine error (budget-independent computations
2820
2999
  * should not normally hit this).
2821
3000
  * @param {MolHandle} mol
@@ -2880,6 +3059,20 @@ export function cip_unresolved_json(mol) {
2880
3059
  }
2881
3060
  }
2882
3061
 
3062
+ /**
3063
+ * Apply Cleanup and return a new molecule with all fragments retained.
3064
+ * @param {MolHandle} mol
3065
+ * @returns {MolHandle}
3066
+ */
3067
+ export function cleanup_mol(mol) {
3068
+ _assertClass(mol, MolHandle);
3069
+ const ret = wasm.cleanup_mol(mol.__wbg_ptr);
3070
+ if (ret[2]) {
3071
+ throw takeFromExternrefTable0(ret[1]);
3072
+ }
3073
+ return MolHandle.__wrap(ret[0]);
3074
+ }
3075
+
2883
3076
  /**
2884
3077
  * Compare multiple SMILES strings (up to 256 by default).
2885
3078
  * Accepts a delimiter-separated list (e.g., newline or comma).
@@ -2900,10 +3093,17 @@ export function compare_molecules_batch_json(smiles_batch, delimiter) {
2900
3093
  let deferred4_0;
2901
3094
  let deferred4_1;
2902
3095
  try {
2903
- const ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2904
- const len0 = WASM_VECTOR_LEN;
2905
- const ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2906
- const len1 = WASM_VECTOR_LEN;
3096
+ let ptr0, len0, ptr1, len1;
3097
+ try {
3098
+ ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3099
+ len0 = WASM_VECTOR_LEN;
3100
+ ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3101
+ len1 = WASM_VECTOR_LEN;
3102
+ } catch (e) {
3103
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3104
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3105
+ throw e;
3106
+ }
2907
3107
  const ret = wasm.compare_molecules_batch_json(ptr0, len0, ptr1, len1);
2908
3108
  var ptr3 = ret[0];
2909
3109
  var len3 = ret[1];
@@ -2937,10 +3137,17 @@ export function compare_molecules_json(smiles1, smiles2) {
2937
3137
  let deferred4_0;
2938
3138
  let deferred4_1;
2939
3139
  try {
2940
- const ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2941
- const len0 = WASM_VECTOR_LEN;
2942
- const ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2943
- const len1 = WASM_VECTOR_LEN;
3140
+ let ptr0, len0, ptr1, len1;
3141
+ try {
3142
+ ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3143
+ len0 = WASM_VECTOR_LEN;
3144
+ ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3145
+ len1 = WASM_VECTOR_LEN;
3146
+ } catch (e) {
3147
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3148
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3149
+ throw e;
3150
+ }
2944
3151
  const ret = wasm.compare_molecules_json(ptr0, len0, ptr1, len1);
2945
3152
  var ptr3 = ret[0];
2946
3153
  var len3 = ret[1];
@@ -2969,26 +3176,35 @@ export function compare_molecules_json(smiles1, smiles2) {
2969
3176
  * @returns {string}
2970
3177
  */
2971
3178
  export function compute_canonical_transform_from_coords_json(mol, coords_json, center_json, normalize_covar, ignore_hs) {
2972
- let deferred4_0;
2973
- let deferred4_1;
3179
+ let deferred6_0;
3180
+ let deferred6_1;
2974
3181
  try {
2975
3182
  _assertClass(mol, MolHandle);
2976
- const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2977
- const len0 = WASM_VECTOR_LEN;
2978
- var ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2979
- var len1 = WASM_VECTOR_LEN;
2980
- const ret = wasm.compute_canonical_transform_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, normalize_covar, ignore_hs);
2981
- var ptr3 = ret[0];
2982
- var len3 = ret[1];
3183
+ const val3 = +normalize_covar;
3184
+ const val4 = +ignore_hs;
3185
+ let ptr0, len0, ptr1, len1;
3186
+ try {
3187
+ ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3188
+ len0 = WASM_VECTOR_LEN;
3189
+ ptr1 = isLikeNone(center_json) ? 0 : passStringToWasm0(center_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3190
+ len1 = WASM_VECTOR_LEN;
3191
+ } catch (e) {
3192
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3193
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3194
+ throw e;
3195
+ }
3196
+ const ret = wasm.compute_canonical_transform_from_coords_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1, val3, val4);
3197
+ var ptr5 = ret[0];
3198
+ var len5 = ret[1];
2983
3199
  if (ret[3]) {
2984
- ptr3 = 0; len3 = 0;
3200
+ ptr5 = 0; len5 = 0;
2985
3201
  throw takeFromExternrefTable0(ret[2]);
2986
3202
  }
2987
- deferred4_0 = ptr3;
2988
- deferred4_1 = len3;
2989
- return getStringFromWasm0(ptr3, len3);
3203
+ deferred6_0 = ptr5;
3204
+ deferred6_1 = len5;
3205
+ return getStringFromWasm0(ptr5, len5);
2990
3206
  } finally {
2991
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
3207
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
2992
3208
  }
2993
3209
  }
2994
3210
 
@@ -3023,7 +3239,11 @@ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
3023
3239
  * GJF/COM supports only
3024
3240
  * same-format retention of a bounded single Cartesian job, including opaque
3025
3241
  * job sections (not a Gaussian job validator).
3026
- * V3000-to-CJSON also
3242
+ * V2000/V3000-to-CJSON also
3243
+ * CJSON-to-CML retains the local indexed graph, source XYZ and name after reparse;
3244
+ * opaque fields/stereo/unit cells, partial charges and conflicting names throw.
3245
+ * Source chemistry and coordinate-derived stereo are not validated.
3246
+ * V2000/V3000-to-CJSON also
3027
3247
  * carries source-order x/y/z values; it does not retain opaque metadata or
3028
3248
  * verify cross-format stereo.
3029
3249
  * MOL2-to-CJSON checks
@@ -3033,10 +3253,17 @@ export function conformer_ensemble_json(mol, n, rmsd_threshold) {
3033
3253
  * NO_CHARGES zero placeholders are omitted as explicitly unassigned values.
3034
3254
  * Other conversions use
3035
3255
  * the topology-only bridge and do not carry format-specific metadata.
3256
+ * CML-to-CML retains one bounded XML 1.0 CML-namespace molecule document exactly;
3257
+ * chemistry/references/stereo remain opaque, with no edits or validation promised.
3036
3258
  * SDF-to-SDF retains every validated source record. Other MOL/SDF input routes
3037
3259
  * require exactly one CTAB and omit SD fields; SDF output is one framed record.
3038
- * CML-to-CJSON carries complete source Cartesian coordinates, leaving absent
3039
- * 3D geometry absent and refusing partial/nonfinite data and multiple molecules.
3260
+ * CML-to-CJSON verifies a bounded graph/Cartesian/name profile on reparse,
3261
+ * including inferred H counts, and refuses unrepresented payload (2D, stereo,
3262
+ * aromatic/query/zero bonds, unknown attributes/elements).
3263
+ * Molecule/atom/bond IDs are document-local references; their spelling and
3264
+ * lexical XML are omitted.
3265
+ * Graph-projected CJSON output refuses in-memory properties outside the local
3266
+ * profile. MOL2 projection and exact CJSON retention keep separate contracts.
3040
3267
  * @param {string} text
3041
3268
  * @param {string} input_format
3042
3269
  * @param {string} output_format
@@ -3046,12 +3273,20 @@ export function convert_common_format(text, input_format, output_format) {
3046
3273
  let deferred5_0;
3047
3274
  let deferred5_1;
3048
3275
  try {
3049
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3050
- const len0 = WASM_VECTOR_LEN;
3051
- const ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3052
- const len1 = WASM_VECTOR_LEN;
3053
- const ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3054
- const len2 = WASM_VECTOR_LEN;
3276
+ let ptr0, len0, ptr1, len1, ptr2, len2;
3277
+ try {
3278
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3279
+ len0 = WASM_VECTOR_LEN;
3280
+ ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3281
+ len1 = WASM_VECTOR_LEN;
3282
+ ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3283
+ len2 = WASM_VECTOR_LEN;
3284
+ } catch (e) {
3285
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
3286
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3287
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3288
+ throw e;
3289
+ }
3055
3290
  const ret = wasm.convert_common_format(ptr0, len0, ptr1, len1, ptr2, len2);
3056
3291
  var ptr4 = ret[0];
3057
3292
  var len4 = ret[1];
@@ -3079,14 +3314,23 @@ export function convert_with_report_json(text, input_format, output_format, poli
3079
3314
  let deferred6_0;
3080
3315
  let deferred6_1;
3081
3316
  try {
3082
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3083
- const len0 = WASM_VECTOR_LEN;
3084
- const ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3085
- const len1 = WASM_VECTOR_LEN;
3086
- const ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3087
- const len2 = WASM_VECTOR_LEN;
3088
- const ptr3 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3089
- const len3 = WASM_VECTOR_LEN;
3317
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
3318
+ try {
3319
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3320
+ len0 = WASM_VECTOR_LEN;
3321
+ ptr1 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3322
+ len1 = WASM_VECTOR_LEN;
3323
+ ptr2 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3324
+ len2 = WASM_VECTOR_LEN;
3325
+ ptr3 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3326
+ len3 = WASM_VECTOR_LEN;
3327
+ } catch (e) {
3328
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
3329
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
3330
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3331
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3332
+ throw e;
3333
+ }
3090
3334
  const ret = wasm.convert_with_report_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
3091
3335
  var ptr5 = ret[0];
3092
3336
  var len5 = ret[1];
@@ -3294,17 +3538,18 @@ export function depict_reaction_svg(rxn_smiles) {
3294
3538
  * @returns {string}
3295
3539
  */
3296
3540
  export function depict_svg_grid(smiles_block, cols) {
3297
- let deferred2_0;
3298
- let deferred2_1;
3541
+ let deferred3_0;
3542
+ let deferred3_1;
3299
3543
  try {
3544
+ const val2 = +cols;
3300
3545
  const ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3301
3546
  const len0 = WASM_VECTOR_LEN;
3302
- const ret = wasm.depict_svg_grid(ptr0, len0, cols);
3303
- deferred2_0 = ret[0];
3304
- deferred2_1 = ret[1];
3547
+ const ret = wasm.depict_svg_grid(ptr0, len0, val2);
3548
+ deferred3_0 = ret[0];
3549
+ deferred3_1 = ret[1];
3305
3550
  return getStringFromWasm0(ret[0], ret[1]);
3306
3551
  } finally {
3307
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3552
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3308
3553
  }
3309
3554
  }
3310
3555
 
@@ -3327,19 +3572,27 @@ export function depict_svg_grid(smiles_block, cols) {
3327
3572
  * @returns {string}
3328
3573
  */
3329
3574
  export function depict_svg_grid_highlighted(smiles_block, cols, match_smarts) {
3330
- let deferred3_0;
3331
- let deferred3_1;
3575
+ let deferred4_0;
3576
+ let deferred4_1;
3332
3577
  try {
3333
- const ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3334
- const len0 = WASM_VECTOR_LEN;
3335
- const ptr1 = passStringToWasm0(match_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3336
- const len1 = WASM_VECTOR_LEN;
3337
- const ret = wasm.depict_svg_grid_highlighted(ptr0, len0, cols, ptr1, len1);
3338
- deferred3_0 = ret[0];
3339
- deferred3_1 = ret[1];
3578
+ const val3 = +cols;
3579
+ let ptr0, len0, ptr1, len1;
3580
+ try {
3581
+ ptr0 = passStringToWasm0(smiles_block, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3582
+ len0 = WASM_VECTOR_LEN;
3583
+ ptr1 = passStringToWasm0(match_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3584
+ len1 = WASM_VECTOR_LEN;
3585
+ } catch (e) {
3586
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3587
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3588
+ throw e;
3589
+ }
3590
+ const ret = wasm.depict_svg_grid_highlighted(ptr0, len0, val3, ptr1, len1);
3591
+ deferred4_0 = ret[0];
3592
+ deferred4_1 = ret[1];
3340
3593
  return getStringFromWasm0(ret[0], ret[1]);
3341
3594
  } finally {
3342
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3595
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
3343
3596
  }
3344
3597
  }
3345
3598
 
@@ -3406,6 +3659,106 @@ export function dice_maccs(a, b) {
3406
3659
  return ret;
3407
3660
  }
3408
3661
 
3662
+ /**
3663
+ * @param {string} json
3664
+ * @returns {string}
3665
+ */
3666
+ export function dlpoly_config_from_record_json(json) {
3667
+ let deferred3_0;
3668
+ let deferred3_1;
3669
+ try {
3670
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3671
+ const len0 = WASM_VECTOR_LEN;
3672
+ const ret = wasm.dlpoly_config_from_record_json(ptr0, len0);
3673
+ var ptr2 = ret[0];
3674
+ var len2 = ret[1];
3675
+ if (ret[3]) {
3676
+ ptr2 = 0; len2 = 0;
3677
+ throw takeFromExternrefTable0(ret[2]);
3678
+ }
3679
+ deferred3_0 = ptr2;
3680
+ deferred3_1 = len2;
3681
+ return getStringFromWasm0(ptr2, len2);
3682
+ } finally {
3683
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3684
+ }
3685
+ }
3686
+
3687
+ /**
3688
+ * @param {string} text
3689
+ * @returns {string}
3690
+ */
3691
+ export function dlpoly_config_record_json(text) {
3692
+ let deferred3_0;
3693
+ let deferred3_1;
3694
+ try {
3695
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3696
+ const len0 = WASM_VECTOR_LEN;
3697
+ const ret = wasm.dlpoly_config_record_json(ptr0, len0);
3698
+ var ptr2 = ret[0];
3699
+ var len2 = ret[1];
3700
+ if (ret[3]) {
3701
+ ptr2 = 0; len2 = 0;
3702
+ throw takeFromExternrefTable0(ret[2]);
3703
+ }
3704
+ deferred3_0 = ptr2;
3705
+ deferred3_1 = len2;
3706
+ return getStringFromWasm0(ptr2, len2);
3707
+ } finally {
3708
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3709
+ }
3710
+ }
3711
+
3712
+ /**
3713
+ * @param {string} json
3714
+ * @returns {string}
3715
+ */
3716
+ export function dlpoly_history_from_json(json) {
3717
+ let deferred3_0;
3718
+ let deferred3_1;
3719
+ try {
3720
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3721
+ const len0 = WASM_VECTOR_LEN;
3722
+ const ret = wasm.dlpoly_history_from_json(ptr0, len0);
3723
+ var ptr2 = ret[0];
3724
+ var len2 = ret[1];
3725
+ if (ret[3]) {
3726
+ ptr2 = 0; len2 = 0;
3727
+ throw takeFromExternrefTable0(ret[2]);
3728
+ }
3729
+ deferred3_0 = ptr2;
3730
+ deferred3_1 = len2;
3731
+ return getStringFromWasm0(ptr2, len2);
3732
+ } finally {
3733
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3734
+ }
3735
+ }
3736
+
3737
+ /**
3738
+ * @param {string} text
3739
+ * @returns {string}
3740
+ */
3741
+ export function dlpoly_history_json(text) {
3742
+ let deferred3_0;
3743
+ let deferred3_1;
3744
+ try {
3745
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3746
+ const len0 = WASM_VECTOR_LEN;
3747
+ const ret = wasm.dlpoly_history_json(ptr0, len0);
3748
+ var ptr2 = ret[0];
3749
+ var len2 = ret[1];
3750
+ if (ret[3]) {
3751
+ ptr2 = 0; len2 = 0;
3752
+ throw takeFromExternrefTable0(ret[2]);
3753
+ }
3754
+ deferred3_0 = ptr2;
3755
+ deferred3_1 = len2;
3756
+ return getStringFromWasm0(ptr2, len2);
3757
+ } finally {
3758
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3759
+ }
3760
+ }
3761
+
3409
3762
  /**
3410
3763
  * Compute the ECFP4 fingerprint as a bit-packed byte vector (256 bytes = 2048 bits).
3411
3764
  * @param {MolHandle} mol
@@ -3507,10 +3860,17 @@ export function edit_cdxml_document_json(cdxml, edit_json) {
3507
3860
  let deferred4_0;
3508
3861
  let deferred4_1;
3509
3862
  try {
3510
- const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3511
- const len0 = WASM_VECTOR_LEN;
3512
- const ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3513
- const len1 = WASM_VECTOR_LEN;
3863
+ let ptr0, len0, ptr1, len1;
3864
+ try {
3865
+ ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3866
+ len0 = WASM_VECTOR_LEN;
3867
+ ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3868
+ len1 = WASM_VECTOR_LEN;
3869
+ } catch (e) {
3870
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3871
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3872
+ throw e;
3873
+ }
3514
3874
  const ret = wasm.edit_cdxml_document_json(ptr0, len0, ptr1, len1);
3515
3875
  var ptr3 = ret[0];
3516
3876
  var len3 = ret[1];
@@ -3538,10 +3898,17 @@ export function edit_cdxml_document_json_v1(document_json, edit_json) {
3538
3898
  let deferred4_0;
3539
3899
  let deferred4_1;
3540
3900
  try {
3541
- const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3542
- const len0 = WASM_VECTOR_LEN;
3543
- const ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3544
- const len1 = WASM_VECTOR_LEN;
3901
+ let ptr0, len0, ptr1, len1;
3902
+ try {
3903
+ ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3904
+ len0 = WASM_VECTOR_LEN;
3905
+ ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3906
+ len1 = WASM_VECTOR_LEN;
3907
+ } catch (e) {
3908
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3909
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3910
+ throw e;
3911
+ }
3545
3912
  const ret = wasm.edit_cdxml_document_json_v1(ptr0, len0, ptr1, len1);
3546
3913
  var ptr3 = ret[0];
3547
3914
  var len3 = ret[1];
@@ -3567,10 +3934,17 @@ export function edit_reaction_document_json_v1(document_json, edit_json) {
3567
3934
  let deferred4_0;
3568
3935
  let deferred4_1;
3569
3936
  try {
3570
- const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3571
- const len0 = WASM_VECTOR_LEN;
3572
- const ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3573
- const len1 = WASM_VECTOR_LEN;
3937
+ let ptr0, len0, ptr1, len1;
3938
+ try {
3939
+ ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3940
+ len0 = WASM_VECTOR_LEN;
3941
+ ptr1 = passStringToWasm0(edit_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3942
+ len1 = WASM_VECTOR_LEN;
3943
+ } catch (e) {
3944
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
3945
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
3946
+ throw e;
3947
+ }
3574
3948
  const ret = wasm.edit_reaction_document_json_v1(ptr0, len0, ptr1, len1);
3575
3949
  var ptr3 = ret[0];
3576
3950
  var len3 = ret[1];
@@ -3702,12 +4076,20 @@ export function enumerate_library_2way(template, scaffolds_smiles, building_bloc
3702
4076
  let deferred5_0;
3703
4077
  let deferred5_1;
3704
4078
  try {
3705
- const ptr0 = passStringToWasm0(template, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3706
- const len0 = WASM_VECTOR_LEN;
3707
- const ptr1 = passStringToWasm0(scaffolds_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3708
- const len1 = WASM_VECTOR_LEN;
3709
- const ptr2 = passStringToWasm0(building_blocks_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3710
- const len2 = WASM_VECTOR_LEN;
4079
+ let ptr0, len0, ptr1, len1, ptr2, len2;
4080
+ try {
4081
+ ptr0 = passStringToWasm0(template, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4082
+ len0 = WASM_VECTOR_LEN;
4083
+ ptr1 = passStringToWasm0(scaffolds_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4084
+ len1 = WASM_VECTOR_LEN;
4085
+ ptr2 = passStringToWasm0(building_blocks_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4086
+ len2 = WASM_VECTOR_LEN;
4087
+ } catch (e) {
4088
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
4089
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
4090
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
4091
+ throw e;
4092
+ }
3711
4093
  const ret = wasm.enumerate_library_2way(ptr0, len0, ptr1, len1, ptr2, len2);
3712
4094
  var ptr4 = ret[0];
3713
4095
  var len4 = ret[1];
@@ -3847,23 +4229,24 @@ export function explain_rdkit_atom_code_json(code) {
3847
4229
  * @returns {string}
3848
4230
  */
3849
4231
  export function explain_rdkit_topological_torsion_code_json(code_decimal, size) {
3850
- let deferred3_0;
3851
- let deferred3_1;
4232
+ let deferred4_0;
4233
+ let deferred4_1;
3852
4234
  try {
4235
+ const val2 = +size;
3853
4236
  const ptr0 = passStringToWasm0(code_decimal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3854
4237
  const len0 = WASM_VECTOR_LEN;
3855
- const ret = wasm.explain_rdkit_topological_torsion_code_json(ptr0, len0, size);
3856
- var ptr2 = ret[0];
3857
- var len2 = ret[1];
4238
+ const ret = wasm.explain_rdkit_topological_torsion_code_json(ptr0, len0, val2);
4239
+ var ptr3 = ret[0];
4240
+ var len3 = ret[1];
3858
4241
  if (ret[3]) {
3859
- ptr2 = 0; len2 = 0;
4242
+ ptr3 = 0; len3 = 0;
3860
4243
  throw takeFromExternrefTable0(ret[2]);
3861
4244
  }
3862
- deferred3_0 = ptr2;
3863
- deferred3_1 = len2;
3864
- return getStringFromWasm0(ptr2, len2);
4245
+ deferred4_0 = ptr3;
4246
+ deferred4_1 = len3;
4247
+ return getStringFromWasm0(ptr3, len3);
3865
4248
  } finally {
3866
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4249
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
3867
4250
  }
3868
4251
  }
3869
4252
 
@@ -3880,7 +4263,8 @@ export function explain_rdkit_topological_torsion_code_json(code_decimal, size)
3880
4263
  * "info":{"key":"value", ...}}`.
3881
4264
  *
3882
4265
  * Returns a JS error on parse failure or if the frame exceeds the WASM
3883
- * atom-count limit.
4266
+ * atom-count limit. Coordinates, cell entries and R atom data must be finite;
4267
+ * nonzero decimals that round to binary64 zero are refused.
3884
4268
  * @param {string} text
3885
4269
  * @returns {string}
3886
4270
  */
@@ -3914,23 +4298,25 @@ export function extxyz_frame_json(text) {
3914
4298
  * @returns {string}
3915
4299
  */
3916
4300
  export function extxyz_frames_batch_json(text, offset, batch_size) {
3917
- let deferred3_0;
3918
- let deferred3_1;
4301
+ let deferred5_0;
4302
+ let deferred5_1;
3919
4303
  try {
4304
+ const val2 = +offset;
4305
+ const val3 = +batch_size;
3920
4306
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3921
4307
  const len0 = WASM_VECTOR_LEN;
3922
- const ret = wasm.extxyz_frames_batch_json(ptr0, len0, offset, batch_size);
3923
- var ptr2 = ret[0];
3924
- var len2 = ret[1];
4308
+ const ret = wasm.extxyz_frames_batch_json(ptr0, len0, val2, val3);
4309
+ var ptr4 = ret[0];
4310
+ var len4 = ret[1];
3925
4311
  if (ret[3]) {
3926
- ptr2 = 0; len2 = 0;
4312
+ ptr4 = 0; len4 = 0;
3927
4313
  throw takeFromExternrefTable0(ret[2]);
3928
4314
  }
3929
- deferred3_0 = ptr2;
3930
- deferred3_1 = len2;
3931
- return getStringFromWasm0(ptr2, len2);
4315
+ deferred5_0 = ptr4;
4316
+ deferred5_1 = len4;
4317
+ return getStringFromWasm0(ptr4, len4);
3932
4318
  } finally {
3933
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4319
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
3934
4320
  }
3935
4321
  }
3936
4322
 
@@ -4270,9 +4656,12 @@ export function get_atom_info(mol, idx) {
4270
4656
  */
4271
4657
  export function get_bond_angle_from_coords_json(mol, coords_json, i, j, k) {
4272
4658
  _assertClass(mol, MolHandle);
4659
+ const val2 = +i;
4660
+ const val3 = +j;
4661
+ const val4 = +k;
4273
4662
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4274
4663
  const len0 = WASM_VECTOR_LEN;
4275
- const ret = wasm.get_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k);
4664
+ const ret = wasm.get_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4);
4276
4665
  if (ret[2]) {
4277
4666
  throw takeFromExternrefTable0(ret[1]);
4278
4667
  }
@@ -4345,9 +4734,11 @@ export function get_bond_info(mol, idx) {
4345
4734
  */
4346
4735
  export function get_bond_length_from_coords_json(mol, coords_json, i, j) {
4347
4736
  _assertClass(mol, MolHandle);
4737
+ const val2 = +i;
4738
+ const val3 = +j;
4348
4739
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4349
4740
  const len0 = WASM_VECTOR_LEN;
4350
- const ret = wasm.get_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j);
4741
+ const ret = wasm.get_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3);
4351
4742
  if (ret[2]) {
4352
4743
  throw takeFromExternrefTable0(ret[1]);
4353
4744
  }
@@ -4373,9 +4764,11 @@ export function get_bond_length_from_coords_json(mol, coords_json, i, j) {
4373
4764
  * @returns {number}
4374
4765
  */
4375
4766
  export function get_bond_length_json(smiles, a, b) {
4767
+ const val2 = +a;
4768
+ const val3 = +b;
4376
4769
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4377
4770
  const len0 = WASM_VECTOR_LEN;
4378
- const ret = wasm.get_bond_length_json(ptr0, len0, a, b);
4771
+ const ret = wasm.get_bond_length_json(ptr0, len0, val2, val3);
4379
4772
  return ret;
4380
4773
  }
4381
4774
 
@@ -4413,9 +4806,13 @@ export function get_descriptors_json(mol) {
4413
4806
  */
4414
4807
  export function get_dihedral_from_coords_json(mol, coords_json, i, j, k, l) {
4415
4808
  _assertClass(mol, MolHandle);
4809
+ const val2 = +i;
4810
+ const val3 = +j;
4811
+ const val4 = +k;
4812
+ const val5 = +l;
4416
4813
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4417
4814
  const len0 = WASM_VECTOR_LEN;
4418
- const ret = wasm.get_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, l);
4815
+ const ret = wasm.get_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
4419
4816
  if (ret[2]) {
4420
4817
  throw takeFromExternrefTable0(ret[1]);
4421
4818
  }
@@ -4442,9 +4839,13 @@ export function get_dihedral_from_coords_json(mol, coords_json, i, j, k, l) {
4442
4839
  * @returns {any}
4443
4840
  */
4444
4841
  export function get_dihedral_json(smiles, a, b, c, d) {
4842
+ const val2 = +a;
4843
+ const val3 = +b;
4844
+ const val4 = +c;
4845
+ const val5 = +d;
4445
4846
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4446
4847
  const len0 = WASM_VECTOR_LEN;
4447
- const ret = wasm.get_dihedral_json(ptr0, len0, a, b, c, d);
4848
+ const ret = wasm.get_dihedral_json(ptr0, len0, val2, val3, val4, val5);
4448
4849
  return ret;
4449
4850
  }
4450
4851
 
@@ -4500,6 +4901,32 @@ export function getaway_descriptors_json(mol) {
4500
4901
  }
4501
4902
  }
4502
4903
 
4904
+ /**
4905
+ * Explicit checked binary64 Angstrom positions; raw parse/write is independent.
4906
+ * @param {string} text
4907
+ * @returns {string}
4908
+ */
4909
+ export function gromos96_geometry_angstrom_json(text) {
4910
+ let deferred3_0;
4911
+ let deferred3_1;
4912
+ try {
4913
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4914
+ const len0 = WASM_VECTOR_LEN;
4915
+ const ret = wasm.gromos96_geometry_angstrom_json(ptr0, len0);
4916
+ var ptr2 = ret[0];
4917
+ var len2 = ret[1];
4918
+ if (ret[3]) {
4919
+ ptr2 = 0; len2 = 0;
4920
+ throw takeFromExternrefTable0(ret[2]);
4921
+ }
4922
+ deferred3_0 = ptr2;
4923
+ deferred3_1 = len2;
4924
+ return getStringFromWasm0(ptr2, len2);
4925
+ } finally {
4926
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4927
+ }
4928
+ }
4929
+
4503
4930
  /**
4504
4931
  * Parse a ChemDraw XML (CDXML) string into a `MolHandle`.
4505
4932
  *
@@ -4722,10 +5149,17 @@ export function lammps_data_to_json(text, atom_style) {
4722
5149
  let deferred4_0;
4723
5150
  let deferred4_1;
4724
5151
  try {
4725
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4726
- const len0 = WASM_VECTOR_LEN;
4727
- const ptr1 = passStringToWasm0(atom_style, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4728
- const len1 = WASM_VECTOR_LEN;
5152
+ let ptr0, len0, ptr1, len1;
5153
+ try {
5154
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5155
+ len0 = WASM_VECTOR_LEN;
5156
+ ptr1 = passStringToWasm0(atom_style, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5157
+ len1 = WASM_VECTOR_LEN;
5158
+ } catch (e) {
5159
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5160
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5161
+ throw e;
5162
+ }
4729
5163
  const ret = wasm.lammps_data_to_json(ptr0, len0, ptr1, len1);
4730
5164
  var ptr3 = ret[0];
4731
5165
  var len3 = ret[1];
@@ -4943,6 +5377,32 @@ export function logp_per_atom_json(mol) {
4943
5377
  }
4944
5378
  }
4945
5379
 
5380
+ /**
5381
+ * Explicit checked binary64 Angstrom positions; raw parse/write is independent.
5382
+ * @param {string} text
5383
+ * @returns {string}
5384
+ */
5385
+ export function lpmd_positions_angstrom_json(text) {
5386
+ let deferred3_0;
5387
+ let deferred3_1;
5388
+ try {
5389
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5390
+ const len0 = WASM_VECTOR_LEN;
5391
+ const ret = wasm.lpmd_positions_angstrom_json(ptr0, len0);
5392
+ var ptr2 = ret[0];
5393
+ var len2 = ret[1];
5394
+ if (ret[3]) {
5395
+ ptr2 = 0; len2 = 0;
5396
+ throw takeFromExternrefTable0(ret[2]);
5397
+ }
5398
+ deferred3_0 = ptr2;
5399
+ deferred3_1 = len2;
5400
+ return getStringFromWasm0(ptr2, len2);
5401
+ } finally {
5402
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5403
+ }
5404
+ }
5405
+
4946
5406
  /**
4947
5407
  * MACCS 166-bit structural keys fingerprint as a byte array (21 bytes, LSB-first).
4948
5408
  *
@@ -4972,10 +5432,17 @@ export function match_smarts_smiles(smiles, smarts) {
4972
5432
  let deferred4_0;
4973
5433
  let deferred4_1;
4974
5434
  try {
4975
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4976
- const len0 = WASM_VECTOR_LEN;
4977
- const ptr1 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4978
- const len1 = WASM_VECTOR_LEN;
5435
+ let ptr0, len0, ptr1, len1;
5436
+ try {
5437
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5438
+ len0 = WASM_VECTOR_LEN;
5439
+ ptr1 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5440
+ len1 = WASM_VECTOR_LEN;
5441
+ } catch (e) {
5442
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5443
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5444
+ throw e;
5445
+ }
4979
5446
  const ret = wasm.match_smarts_smiles(ptr0, len0, ptr1, len1);
4980
5447
  var ptr3 = ret[0];
4981
5448
  var len3 = ret[1];
@@ -5002,23 +5469,66 @@ export function match_smarts_smiles(smiles, smarts) {
5002
5469
  * @returns {string}
5003
5470
  */
5004
5471
  export function maxmin_picks_ecfp4_json(smiles_json, n) {
5005
- let deferred3_0;
5006
- let deferred3_1;
5472
+ let deferred4_0;
5473
+ let deferred4_1;
5007
5474
  try {
5475
+ const val2 = +n;
5008
5476
  const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5009
5477
  const len0 = WASM_VECTOR_LEN;
5010
- const ret = wasm.maxmin_picks_ecfp4_json(ptr0, len0, n);
5011
- var ptr2 = ret[0];
5012
- var len2 = ret[1];
5478
+ const ret = wasm.maxmin_picks_ecfp4_json(ptr0, len0, val2);
5479
+ var ptr3 = ret[0];
5480
+ var len3 = ret[1];
5013
5481
  if (ret[3]) {
5014
- ptr2 = 0; len2 = 0;
5482
+ ptr3 = 0; len3 = 0;
5015
5483
  throw takeFromExternrefTable0(ret[2]);
5016
5484
  }
5017
- deferred3_0 = ptr2;
5018
- deferred3_1 = len2;
5019
- return getStringFromWasm0(ptr2, len2);
5485
+ deferred4_0 = ptr3;
5486
+ deferred4_1 = len3;
5487
+ return getStringFromWasm0(ptr3, len3);
5020
5488
  } finally {
5021
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5489
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
5490
+ }
5491
+ }
5492
+
5493
+ /**
5494
+ * MCS SMARTS with status, preserving atom and bond query alternatives.
5495
+ *
5496
+ * Uses the same JSON input and configuration as `mcs_smiles_json_with_config`.
5497
+ * Set `bondCountFirst` to maximize bonds first, then atoms.
5498
+ * Charge and isotope predicates are preserved. `matchChiralTag` retains
5499
+ * absolute tetrahedral orientation with at least three common bonds and
5500
+ * chirality presence on smaller frames. Other stereo raises a serialization error.
5501
+ * @param {string} smiles_json
5502
+ * @param {string} config_json
5503
+ * @returns {string}
5504
+ */
5505
+ export function mcs_smarts_json_with_config(smiles_json, config_json) {
5506
+ let deferred4_0;
5507
+ let deferred4_1;
5508
+ try {
5509
+ let ptr0, len0, ptr1, len1;
5510
+ try {
5511
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5512
+ len0 = WASM_VECTOR_LEN;
5513
+ ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5514
+ len1 = WASM_VECTOR_LEN;
5515
+ } catch (e) {
5516
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5517
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5518
+ throw e;
5519
+ }
5520
+ const ret = wasm.mcs_smarts_json_with_config(ptr0, len0, ptr1, len1);
5521
+ var ptr3 = ret[0];
5522
+ var len3 = ret[1];
5523
+ if (ret[3]) {
5524
+ ptr3 = 0; len3 = 0;
5525
+ throw takeFromExternrefTable0(ret[2]);
5526
+ }
5527
+ deferred4_0 = ptr3;
5528
+ deferred4_1 = len3;
5529
+ return getStringFromWasm0(ptr3, len3);
5530
+ } finally {
5531
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
5022
5532
  }
5023
5533
  }
5024
5534
 
@@ -5078,10 +5588,17 @@ export function mcs_smiles_json_with_config(smiles_json, config_json) {
5078
5588
  let deferred4_0;
5079
5589
  let deferred4_1;
5080
5590
  try {
5081
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5082
- const len0 = WASM_VECTOR_LEN;
5083
- const ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5084
- const len1 = WASM_VECTOR_LEN;
5591
+ let ptr0, len0, ptr1, len1;
5592
+ try {
5593
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5594
+ len0 = WASM_VECTOR_LEN;
5595
+ ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5596
+ len1 = WASM_VECTOR_LEN;
5597
+ } catch (e) {
5598
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5599
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5600
+ throw e;
5601
+ }
5085
5602
  const ret = wasm.mcs_smiles_json_with_config(ptr0, len0, ptr1, len1);
5086
5603
  var ptr3 = ret[0];
5087
5604
  var len3 = ret[1];
@@ -5110,23 +5627,25 @@ export function mcs_smiles_json_with_config(smiles_json, config_json) {
5110
5627
  * @returns {string}
5111
5628
  */
5112
5629
  export function mcs_smiles_json_with_ring_config(smiles_json, ring_matches_ring_only, complete_rings_only) {
5113
- let deferred3_0;
5114
- let deferred3_1;
5630
+ let deferred5_0;
5631
+ let deferred5_1;
5115
5632
  try {
5633
+ const val2 = +ring_matches_ring_only;
5634
+ const val3 = +complete_rings_only;
5116
5635
  const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5117
5636
  const len0 = WASM_VECTOR_LEN;
5118
- const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0, ring_matches_ring_only, complete_rings_only);
5119
- var ptr2 = ret[0];
5120
- var len2 = ret[1];
5637
+ const ret = wasm.mcs_smiles_json_with_ring_config(ptr0, len0, val2, val3);
5638
+ var ptr4 = ret[0];
5639
+ var len4 = ret[1];
5121
5640
  if (ret[3]) {
5122
- ptr2 = 0; len2 = 0;
5641
+ ptr4 = 0; len4 = 0;
5123
5642
  throw takeFromExternrefTable0(ret[2]);
5124
5643
  }
5125
- deferred3_0 = ptr2;
5126
- deferred3_1 = len2;
5127
- return getStringFromWasm0(ptr2, len2);
5644
+ deferred5_0 = ptr4;
5645
+ deferred5_1 = len4;
5646
+ return getStringFromWasm0(ptr4, len4);
5128
5647
  } finally {
5129
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5648
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
5130
5649
  }
5131
5650
  }
5132
5651
 
@@ -5242,19 +5761,27 @@ export function minimize_mmff94_lbfgs_json(mol, max_iter) {
5242
5761
  * @returns {string}
5243
5762
  */
5244
5763
  export function minimize_uff_json(smiles, coords_json, max_iter) {
5245
- let deferred3_0;
5246
- let deferred3_1;
5764
+ let deferred4_0;
5765
+ let deferred4_1;
5247
5766
  try {
5248
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5249
- const len0 = WASM_VECTOR_LEN;
5250
- const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5251
- const len1 = WASM_VECTOR_LEN;
5252
- const ret = wasm.minimize_uff_json(ptr0, len0, ptr1, len1, max_iter);
5253
- deferred3_0 = ret[0];
5254
- deferred3_1 = ret[1];
5767
+ const val3 = +max_iter;
5768
+ let ptr0, len0, ptr1, len1;
5769
+ try {
5770
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5771
+ len0 = WASM_VECTOR_LEN;
5772
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5773
+ len1 = WASM_VECTOR_LEN;
5774
+ } catch (e) {
5775
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
5776
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
5777
+ throw e;
5778
+ }
5779
+ const ret = wasm.minimize_uff_json(ptr0, len0, ptr1, len1, val3);
5780
+ deferred4_0 = ret[0];
5781
+ deferred4_1 = ret[1];
5255
5782
  return getStringFromWasm0(ret[0], ret[1]);
5256
5783
  } finally {
5257
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5784
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
5258
5785
  }
5259
5786
  }
5260
5787
 
@@ -5435,18 +5962,19 @@ export function mmff94_energy_breakdown_from_coords_json(mol, coords_json) {
5435
5962
  * @returns {string}
5436
5963
  */
5437
5964
  export function mmff94_energy_breakdown_from_coords_json_with_options(mol, coords_json, ignore_interfrag_interactions) {
5438
- let deferred2_0;
5439
- let deferred2_1;
5965
+ let deferred3_0;
5966
+ let deferred3_1;
5440
5967
  try {
5441
5968
  _assertClass(mol, MolHandle);
5969
+ const val2 = +ignore_interfrag_interactions;
5442
5970
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5443
5971
  const len0 = WASM_VECTOR_LEN;
5444
- const ret = wasm.mmff94_energy_breakdown_from_coords_json_with_options(mol.__wbg_ptr, ptr0, len0, ignore_interfrag_interactions);
5445
- deferred2_0 = ret[0];
5446
- deferred2_1 = ret[1];
5972
+ const ret = wasm.mmff94_energy_breakdown_from_coords_json_with_options(mol.__wbg_ptr, ptr0, len0, val2);
5973
+ deferred3_0 = ret[0];
5974
+ deferred3_1 = ret[1];
5447
5975
  return getStringFromWasm0(ret[0], ret[1]);
5448
5976
  } finally {
5449
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
5977
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
5450
5978
  }
5451
5979
  }
5452
5980
 
@@ -5680,9 +6208,10 @@ export function mol_block_stereo_loss_json(mol) {
5680
6208
  * @returns {MolHandle}
5681
6209
  */
5682
6210
  export function mol_from_ccd(text, allow_stereo_loss) {
6211
+ const val2 = +allow_stereo_loss;
5683
6212
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5684
6213
  const len0 = WASM_VECTOR_LEN;
5685
- const ret = wasm.mol_from_ccd(ptr0, len0, allow_stereo_loss);
6214
+ const ret = wasm.mol_from_ccd(ptr0, len0, val2);
5686
6215
  if (ret[2]) {
5687
6216
  throw takeFromExternrefTable0(ret[1]);
5688
6217
  }
@@ -5714,9 +6243,10 @@ export function mol_from_cdxml(cdxml) {
5714
6243
  * @returns {MolHandle}
5715
6244
  */
5716
6245
  export function mol_from_cdxml_with_options(cdxml, infer_nondirectional_stereo) {
6246
+ const val2 = +infer_nondirectional_stereo;
5717
6247
  const ptr0 = passStringToWasm0(cdxml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5718
6248
  const len0 = WASM_VECTOR_LEN;
5719
- const ret = wasm.mol_from_cdxml_with_options(ptr0, len0, infer_nondirectional_stereo);
6249
+ const ret = wasm.mol_from_cdxml_with_options(ptr0, len0, val2);
5720
6250
  if (ret[2]) {
5721
6251
  throw takeFromExternrefTable0(ret[1]);
5722
6252
  }
@@ -5804,7 +6334,8 @@ export function mol_from_cube(text) {
5804
6334
  * too. Only the first frame of a multi-frame file is read.
5805
6335
  *
5806
6336
  * Returns a JS error on parse failure or if the frame exceeds the WASM
5807
- * atom-count limit.
6337
+ * atom-count limit. Coordinates, cell entries and R atom data must be finite;
6338
+ * nonzero decimals that round to binary64 zero are refused.
5808
6339
  * @param {string} text
5809
6340
  * @returns {MolHandle}
5810
6341
  */
@@ -5838,10 +6369,10 @@ export function mol_from_mmcif(text) {
5838
6369
  }
5839
6370
 
5840
6371
  /**
5841
- * Parse a MolJSON string into a `MolHandle`.
5842
- *
5843
- * MolJSON is a JSON-based molecular representation designed for LLM
5844
- * (large language model) compatibility. Returns a JS error on invalid input.
6372
+ * Parse chematic's atom-record MolJSON graph dialect, not oxpig MolJSON.
6373
+ * Range/type checks, exact bond orders (4 = quadruple), unique keys/IDs and
6374
+ * valid nonduplicate bonds are enforced. Throws on invalid input; source
6375
+ * metadata and stereochemistry are outside this graph profile.
5845
6376
  * @param {string} json
5846
6377
  * @returns {MolHandle}
5847
6378
  */
@@ -5903,9 +6434,10 @@ export function mol_from_pdb(pdb) {
5903
6434
  * @returns {MolHandle}
5904
6435
  */
5905
6436
  export function mol_from_pdb_conect(input, allow_extended_targets) {
6437
+ const val2 = +allow_extended_targets;
5906
6438
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5907
6439
  const len0 = WASM_VECTOR_LEN;
5908
- const ret = wasm.mol_from_pdb_conect(ptr0, len0, allow_extended_targets);
6440
+ const ret = wasm.mol_from_pdb_conect(ptr0, len0, val2);
5909
6441
  if (ret[2]) {
5910
6442
  throw takeFromExternrefTable0(ret[1]);
5911
6443
  }
@@ -6022,7 +6554,9 @@ export function mol_from_v3000_block(block) {
6022
6554
  /**
6023
6555
  * Parse an XYZ file and return a `MolHandle` (topology only; coordinates are discarded).
6024
6556
  *
6025
- * Returns a JS error on parse failure.
6557
+ * Returns a JS error on parse failure, nonfinite coordinates or a nonzero
6558
+ * decimal coordinate that rounds to binary64 zero. Literal signed zero and
6559
+ * finite subnormals remain valid.
6026
6560
  * @param {string} xyz
6027
6561
  * @returns {MolHandle}
6028
6562
  */
@@ -6124,9 +6658,10 @@ export function mol_with_atom_charge(mol, idx, charge) {
6124
6658
  */
6125
6659
  export function mol_with_atom_element(mol, idx, element_symbol) {
6126
6660
  _assertClass(mol, MolHandle);
6661
+ const val2 = +idx;
6127
6662
  const ptr0 = passStringToWasm0(element_symbol, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6128
6663
  const len0 = WASM_VECTOR_LEN;
6129
- const ret = wasm.mol_with_atom_element(mol.__wbg_ptr, idx, ptr0, len0);
6664
+ const ret = wasm.mol_with_atom_element(mol.__wbg_ptr, val2, ptr0, len0);
6130
6665
  if (ret[2]) {
6131
6666
  throw takeFromExternrefTable0(ret[1]);
6132
6667
  }
@@ -6142,9 +6677,10 @@ export function mol_with_atom_element(mol, idx, element_symbol) {
6142
6677
  */
6143
6678
  export function mol_with_atom_pseudo_label(mol, idx, label) {
6144
6679
  _assertClass(mol, MolHandle);
6680
+ const val2 = +idx;
6145
6681
  const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6146
6682
  const len0 = WASM_VECTOR_LEN;
6147
- const ret = wasm.mol_with_atom_pseudo_label(mol.__wbg_ptr, idx, ptr0, len0);
6683
+ const ret = wasm.mol_with_atom_pseudo_label(mol.__wbg_ptr, val2, ptr0, len0);
6148
6684
  if (ret[2]) {
6149
6685
  throw takeFromExternrefTable0(ret[1]);
6150
6686
  }
@@ -6207,6 +6743,56 @@ export function mol_with_bond_removed(mol, idx) {
6207
6743
  return MolHandle.__wrap(ret[0]);
6208
6744
  }
6209
6745
 
6746
+ /**
6747
+ * @param {string} json
6748
+ * @returns {string}
6749
+ */
6750
+ export function molden_from_record_json(json) {
6751
+ let deferred3_0;
6752
+ let deferred3_1;
6753
+ try {
6754
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6755
+ const len0 = WASM_VECTOR_LEN;
6756
+ const ret = wasm.molden_from_record_json(ptr0, len0);
6757
+ var ptr2 = ret[0];
6758
+ var len2 = ret[1];
6759
+ if (ret[3]) {
6760
+ ptr2 = 0; len2 = 0;
6761
+ throw takeFromExternrefTable0(ret[2]);
6762
+ }
6763
+ deferred3_0 = ptr2;
6764
+ deferred3_1 = len2;
6765
+ return getStringFromWasm0(ptr2, len2);
6766
+ } finally {
6767
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
6768
+ }
6769
+ }
6770
+
6771
+ /**
6772
+ * @param {string} text
6773
+ * @returns {string}
6774
+ */
6775
+ export function molden_record_json(text) {
6776
+ let deferred3_0;
6777
+ let deferred3_1;
6778
+ try {
6779
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6780
+ const len0 = WASM_VECTOR_LEN;
6781
+ const ret = wasm.molden_record_json(ptr0, len0);
6782
+ var ptr2 = ret[0];
6783
+ var len2 = ret[1];
6784
+ if (ret[3]) {
6785
+ ptr2 = 0; len2 = 0;
6786
+ throw takeFromExternrefTable0(ret[2]);
6787
+ }
6788
+ deferred3_0 = ptr2;
6789
+ deferred3_1 = len2;
6790
+ return getStringFromWasm0(ptr2, len2);
6791
+ } finally {
6792
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
6793
+ }
6794
+ }
6795
+
6210
6796
  /**
6211
6797
  * Generate a complete molecular report (JSON string) from a SMILES.
6212
6798
  * Returns the JSON representation of a `MoleculeReport` struct.
@@ -6243,23 +6829,31 @@ export function molecule_report_json(smiles) {
6243
6829
 
6244
6830
  /**
6245
6831
  * Concrete CDX/CDXML fragment handles, in source fragment order.
6246
- * @param {Uint8Array} data
6832
+ * @param {Uint8Array | number[]} data
6247
6833
  * @param {string} format
6248
6834
  * @param {boolean} allow_metadata_loss
6249
6835
  * @returns {MolHandle[]}
6250
6836
  */
6251
6837
  export function mols_from_chemdraw_block(data, format, allow_metadata_loss) {
6252
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6253
- const len0 = WASM_VECTOR_LEN;
6254
- const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6255
- const len1 = WASM_VECTOR_LEN;
6256
- const ret = wasm.mols_from_chemdraw_block(ptr0, len0, ptr1, len1, allow_metadata_loss);
6838
+ const val3 = +allow_metadata_loss;
6839
+ let ptr0, len0, ptr1, len1;
6840
+ try {
6841
+ ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6842
+ len0 = WASM_VECTOR_LEN;
6843
+ ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6844
+ len1 = WASM_VECTOR_LEN;
6845
+ } catch (e) {
6846
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
6847
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
6848
+ throw e;
6849
+ }
6850
+ const ret = wasm.mols_from_chemdraw_block(ptr0, len0, ptr1, len1, val3);
6257
6851
  if (ret[3]) {
6258
6852
  throw takeFromExternrefTable0(ret[2]);
6259
6853
  }
6260
- var v3 = getArrayJsValueFromWasm0(ret[0], ret[1]);
6854
+ var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]);
6261
6855
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6262
- return v3;
6856
+ return v4;
6263
6857
  }
6264
6858
 
6265
6859
  /**
@@ -6325,19 +6919,27 @@ export function murcko_scaffold(mol) {
6325
6919
  * @returns {string}
6326
6920
  */
6327
6921
  export function nearest_neighbors_json(query_smiles, db_smiles_json, k) {
6328
- let deferred3_0;
6329
- let deferred3_1;
6922
+ let deferred4_0;
6923
+ let deferred4_1;
6330
6924
  try {
6331
- const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6332
- const len0 = WASM_VECTOR_LEN;
6333
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6334
- const len1 = WASM_VECTOR_LEN;
6335
- const ret = wasm.nearest_neighbors_json(ptr0, len0, ptr1, len1, k);
6336
- deferred3_0 = ret[0];
6337
- deferred3_1 = ret[1];
6925
+ const val3 = +k;
6926
+ let ptr0, len0, ptr1, len1;
6927
+ try {
6928
+ ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6929
+ len0 = WASM_VECTOR_LEN;
6930
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6931
+ len1 = WASM_VECTOR_LEN;
6932
+ } catch (e) {
6933
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
6934
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
6935
+ throw e;
6936
+ }
6937
+ const ret = wasm.nearest_neighbors_json(ptr0, len0, ptr1, len1, val3);
6938
+ deferred4_0 = ret[0];
6939
+ deferred4_1 = ret[1];
6338
6940
  return getStringFromWasm0(ret[0], ret[1]);
6339
6941
  } finally {
6340
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
6942
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
6341
6943
  }
6342
6944
  }
6343
6945
 
@@ -6381,6 +6983,35 @@ export function normalize_cxsmiles(s) {
6381
6983
  }
6382
6984
  }
6383
6985
 
6986
+ /**
6987
+ * Enhanced-atom-stereo reaction CXSMILES with group indices remapped after
6988
+ * component/atom ordering (RDKit #9732). Other CX fields are rejected.
6989
+ * @param {string} text
6990
+ * @param {boolean} canonical
6991
+ * @returns {string}
6992
+ */
6993
+ export function normalize_reaction_cxsmiles(text, canonical) {
6994
+ let deferred4_0;
6995
+ let deferred4_1;
6996
+ try {
6997
+ const val2 = +canonical;
6998
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6999
+ const len0 = WASM_VECTOR_LEN;
7000
+ const ret = wasm.normalize_reaction_cxsmiles(ptr0, len0, val2);
7001
+ var ptr3 = ret[0];
7002
+ var len3 = ret[1];
7003
+ if (ret[3]) {
7004
+ ptr3 = 0; len3 = 0;
7005
+ throw takeFromExternrefTable0(ret[2]);
7006
+ }
7007
+ deferred4_0 = ptr3;
7008
+ deferred4_1 = len3;
7009
+ return getStringFromWasm0(ptr3, len3);
7010
+ } finally {
7011
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7012
+ }
7013
+ }
7014
+
6384
7015
  /**
6385
7016
  * Parse and re-serialise a reaction SMILES string, returning the normalised form.
6386
7017
  *
@@ -6421,10 +7052,17 @@ export function nucleic_acid_apply_json_command(document_json, command_json) {
6421
7052
  let deferred3_0;
6422
7053
  let deferred3_1;
6423
7054
  try {
6424
- const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6425
- const len0 = WASM_VECTOR_LEN;
6426
- const ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6427
- const len1 = WASM_VECTOR_LEN;
7055
+ let ptr0, len0, ptr1, len1;
7056
+ try {
7057
+ ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7058
+ len0 = WASM_VECTOR_LEN;
7059
+ ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7060
+ len1 = WASM_VECTOR_LEN;
7061
+ } catch (e) {
7062
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7063
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7064
+ throw e;
7065
+ }
6428
7066
  const ret = wasm.nucleic_acid_apply_json_command(ptr0, len0, ptr1, len1);
6429
7067
  deferred3_0 = ret[0];
6430
7068
  deferred3_1 = ret[1];
@@ -6470,22 +7108,72 @@ export function num_hydrogens(mol) {
6470
7108
  }
6471
7109
 
6472
7110
  /**
6473
- * Parse an OpenDX (APBS scalar-field subset) file and return its full
6474
- * [`chematic_mol::VolumetricGrid`] as JSON (same shape as
6475
- * [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
6476
- * section). No `mol_from_opendx` is provided: an OpenDX grid never carries
6477
- * atoms, so a `MolHandle` from one would always be empty and is not a
6478
- * useful binding.
6479
- * @param {string} text
7111
+ * @param {string} json
6480
7112
  * @returns {string}
6481
7113
  */
6482
- export function opendx_grid_json(text) {
7114
+ export function nwchem_geometry_from_json(json) {
6483
7115
  let deferred3_0;
6484
7116
  let deferred3_1;
6485
7117
  try {
6486
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7118
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6487
7119
  const len0 = WASM_VECTOR_LEN;
6488
- const ret = wasm.opendx_grid_json(ptr0, len0);
7120
+ const ret = wasm.nwchem_geometry_from_json(ptr0, len0);
7121
+ var ptr2 = ret[0];
7122
+ var len2 = ret[1];
7123
+ if (ret[3]) {
7124
+ ptr2 = 0; len2 = 0;
7125
+ throw takeFromExternrefTable0(ret[2]);
7126
+ }
7127
+ deferred3_0 = ptr2;
7128
+ deferred3_1 = len2;
7129
+ return getStringFromWasm0(ptr2, len2);
7130
+ } finally {
7131
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7132
+ }
7133
+ }
7134
+
7135
+ /**
7136
+ * @param {string} text
7137
+ * @returns {string}
7138
+ */
7139
+ export function nwchem_geometry_json(text) {
7140
+ let deferred3_0;
7141
+ let deferred3_1;
7142
+ try {
7143
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7144
+ const len0 = WASM_VECTOR_LEN;
7145
+ const ret = wasm.nwchem_geometry_json(ptr0, len0);
7146
+ var ptr2 = ret[0];
7147
+ var len2 = ret[1];
7148
+ if (ret[3]) {
7149
+ ptr2 = 0; len2 = 0;
7150
+ throw takeFromExternrefTable0(ret[2]);
7151
+ }
7152
+ deferred3_0 = ptr2;
7153
+ deferred3_1 = len2;
7154
+ return getStringFromWasm0(ptr2, len2);
7155
+ } finally {
7156
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7157
+ }
7158
+ }
7159
+
7160
+ /**
7161
+ * Parse an OpenDX (APBS scalar-field subset) file and return its full
7162
+ * [`chematic_mol::VolumetricGrid`] as JSON (same shape as
7163
+ * [`cube_grid_json`]; `atoms` is always empty -- OpenDX has no atom
7164
+ * section). No `mol_from_opendx` is provided: an OpenDX grid never carries
7165
+ * atoms, so a `MolHandle` from one would always be empty and is not a
7166
+ * useful binding.
7167
+ * @param {string} text
7168
+ * @returns {string}
7169
+ */
7170
+ export function opendx_grid_json(text) {
7171
+ let deferred3_0;
7172
+ let deferred3_1;
7173
+ try {
7174
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7175
+ const len0 = WASM_VECTOR_LEN;
7176
+ const ret = wasm.opendx_grid_json(ptr0, len0);
6489
7177
  var ptr2 = ret[0];
6490
7178
  var len2 = ret[1];
6491
7179
  if (ret[3]) {
@@ -6788,6 +7476,33 @@ export function parse_cxsmiles_json(s) {
6788
7476
  }
6789
7477
  }
6790
7478
 
7479
+ /**
7480
+ * Read a bounded fract record as editable JSON. All numeric fields are strings
7481
+ * retaining nominal precision and optional opaque uncertainty digits.
7482
+ * @param {string} text
7483
+ * @returns {string}
7484
+ */
7485
+ export function parse_fract_json(text) {
7486
+ let deferred3_0;
7487
+ let deferred3_1;
7488
+ try {
7489
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7490
+ const len0 = WASM_VECTOR_LEN;
7491
+ const ret = wasm.parse_fract_json(ptr0, len0);
7492
+ var ptr2 = ret[0];
7493
+ var len2 = ret[1];
7494
+ if (ret[3]) {
7495
+ ptr2 = 0; len2 = 0;
7496
+ throw takeFromExternrefTable0(ret[2]);
7497
+ }
7498
+ deferred3_0 = ptr2;
7499
+ deferred3_1 = len2;
7500
+ return getStringFromWasm0(ptr2, len2);
7501
+ } finally {
7502
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7503
+ }
7504
+ }
7505
+
6791
7506
  /**
6792
7507
  * Inspect every ordered Cartesian job with UTF-8 byte ranges in the original source.
6793
7508
  * Coordinate units are unchanged; no inferred bonds or external resource reads.
@@ -6815,6 +7530,69 @@ export function parse_gjf_document_json(text) {
6815
7530
  }
6816
7531
  }
6817
7532
 
7533
+ /**
7534
+ * Read gpr 100 / one coordinate set as editable JSON. Coordinates stay in nm;
7535
+ * partial charges and all decimal tokens retain source representation.
7536
+ * @param {string} text
7537
+ * @returns {string}
7538
+ */
7539
+ export function parse_gpr_json(text) {
7540
+ let deferred3_0;
7541
+ let deferred3_1;
7542
+ try {
7543
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7544
+ const len0 = WASM_VECTOR_LEN;
7545
+ const ret = wasm.parse_gpr_json(ptr0, len0);
7546
+ var ptr2 = ret[0];
7547
+ var len2 = ret[1];
7548
+ if (ret[3]) {
7549
+ ptr2 = 0; len2 = 0;
7550
+ throw takeFromExternrefTable0(ret[2]);
7551
+ }
7552
+ deferred3_0 = ptr2;
7553
+ deferred3_1 = len2;
7554
+ return getStringFromWasm0(ptr2, len2);
7555
+ } finally {
7556
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7557
+ }
7558
+ }
7559
+
7560
+ /**
7561
+ * Read geometry as editable JSON, with all blocks, fixed-width payload and caller-owned length-unit context.
7562
+ * @param {string} text
7563
+ * @param {string} length_unit
7564
+ * @returns {string}
7565
+ */
7566
+ export function parse_gromos96_json(text, length_unit) {
7567
+ let deferred4_0;
7568
+ let deferred4_1;
7569
+ try {
7570
+ let ptr0, len0, ptr1, len1;
7571
+ try {
7572
+ ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7573
+ len0 = WASM_VECTOR_LEN;
7574
+ ptr1 = passStringToWasm0(length_unit, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7575
+ len1 = WASM_VECTOR_LEN;
7576
+ } catch (e) {
7577
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7578
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7579
+ throw e;
7580
+ }
7581
+ const ret = wasm.parse_gromos96_json(ptr0, len0, ptr1, len1);
7582
+ var ptr3 = ret[0];
7583
+ var len3 = ret[1];
7584
+ if (ret[3]) {
7585
+ ptr3 = 0; len3 = 0;
7586
+ throw takeFromExternrefTable0(ret[2]);
7587
+ }
7588
+ deferred4_0 = ptr3;
7589
+ deferred4_1 = len3;
7590
+ return getStringFromWasm0(ptr3, len3);
7591
+ } finally {
7592
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7593
+ }
7594
+ }
7595
+
6818
7596
  /**
6819
7597
  * Inspect the bounded HIN record, including literal aromatic bonds and charges.
6820
7598
  * @param {string} text
@@ -6841,6 +7619,32 @@ export function parse_hin_record_json(text) {
6841
7619
  }
6842
7620
  }
6843
7621
 
7622
+ /**
7623
+ * Read geometry as editable JSON, with raw decimal fields, all frames and column order.
7624
+ * @param {string} text
7625
+ * @returns {string}
7626
+ */
7627
+ export function parse_lpmd_json(text) {
7628
+ let deferred3_0;
7629
+ let deferred3_1;
7630
+ try {
7631
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7632
+ const len0 = WASM_VECTOR_LEN;
7633
+ const ret = wasm.parse_lpmd_json(ptr0, len0);
7634
+ var ptr2 = ret[0];
7635
+ var len2 = ret[1];
7636
+ if (ret[3]) {
7637
+ ptr2 = 0; len2 = 0;
7638
+ throw takeFromExternrefTable0(ret[2]);
7639
+ }
7640
+ deferred3_0 = ptr2;
7641
+ deferred3_1 = len2;
7642
+ return getStringFromWasm0(ptr2, len2);
7643
+ } finally {
7644
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7645
+ }
7646
+ }
7647
+
6844
7648
  /**
6845
7649
  * Inspect partial charges, atom types and source retention for MOL2.
6846
7650
  * @param {string} text
@@ -6885,19 +7689,18 @@ export function parse_smiles(s) {
6885
7689
  }
6886
7690
 
6887
7691
  /**
6888
- * Indexed atoms/charges, bonds, coordinates and source serials for the same
6889
- * explicit CONECT projection. Molecular identity and coordinate order agree.
6890
- * @param {string} input
6891
- * @param {boolean} allow_extended_targets
7692
+ * Read a bounded UniChem XYZ record as editable JSON. Coordinate fields are decimal strings
7693
+ * retaining precision and signed zero in Angstrom.
7694
+ * @param {string} text
6892
7695
  * @returns {string}
6893
7696
  */
6894
- export function pdb_conect_frame_json(input, allow_extended_targets) {
7697
+ export function parse_unixyz_json(text) {
6895
7698
  let deferred3_0;
6896
7699
  let deferred3_1;
6897
7700
  try {
6898
- const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7701
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6899
7702
  const len0 = WASM_VECTOR_LEN;
6900
- const ret = wasm.pdb_conect_frame_json(ptr0, len0, allow_extended_targets);
7703
+ const ret = wasm.parse_unixyz_json(ptr0, len0);
6901
7704
  var ptr2 = ret[0];
6902
7705
  var len2 = ret[1];
6903
7706
  if (ret[3]) {
@@ -6912,6 +7715,61 @@ export function pdb_conect_frame_json(input, allow_extended_targets) {
6912
7715
  }
6913
7716
  }
6914
7717
 
7718
+ /**
7719
+ * Read geometry as editable JSON, with raw factor/coordinate strings and fixed axes.
7720
+ * @param {string} text
7721
+ * @returns {string}
7722
+ */
7723
+ export function parse_viewmol_json(text) {
7724
+ let deferred3_0;
7725
+ let deferred3_1;
7726
+ try {
7727
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7728
+ const len0 = WASM_VECTOR_LEN;
7729
+ const ret = wasm.parse_viewmol_json(ptr0, len0);
7730
+ var ptr2 = ret[0];
7731
+ var len2 = ret[1];
7732
+ if (ret[3]) {
7733
+ ptr2 = 0; len2 = 0;
7734
+ throw takeFromExternrefTable0(ret[2]);
7735
+ }
7736
+ deferred3_0 = ptr2;
7737
+ deferred3_1 = len2;
7738
+ return getStringFromWasm0(ptr2, len2);
7739
+ } finally {
7740
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
7741
+ }
7742
+ }
7743
+
7744
+ /**
7745
+ * Indexed atoms/charges, bonds, coordinates and source serials for the same
7746
+ * explicit CONECT projection. Molecular identity and coordinate order agree.
7747
+ * @param {string} input
7748
+ * @param {boolean} allow_extended_targets
7749
+ * @returns {string}
7750
+ */
7751
+ export function pdb_conect_frame_json(input, allow_extended_targets) {
7752
+ let deferred4_0;
7753
+ let deferred4_1;
7754
+ try {
7755
+ const val2 = +allow_extended_targets;
7756
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7757
+ const len0 = WASM_VECTOR_LEN;
7758
+ const ret = wasm.pdb_conect_frame_json(ptr0, len0, val2);
7759
+ var ptr3 = ret[0];
7760
+ var len3 = ret[1];
7761
+ if (ret[3]) {
7762
+ ptr3 = 0; len3 = 0;
7763
+ throw takeFromExternrefTable0(ret[2]);
7764
+ }
7765
+ deferred4_0 = ptr3;
7766
+ deferred4_1 = len3;
7767
+ return getStringFromWasm0(ptr3, len3);
7768
+ } finally {
7769
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7770
+ }
7771
+ }
7772
+
6915
7773
  /**
6916
7774
  * Extract the atomic coordinates from a PDB block, in the SAME atom order
6917
7775
  * `mol_from_pdb` returns topology for (both read the identical underlying
@@ -7001,10 +7859,17 @@ export function periodic_structure_fingerprint_json(json, source) {
7001
7859
  let deferred3_0;
7002
7860
  let deferred3_1;
7003
7861
  try {
7004
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7005
- const len0 = WASM_VECTOR_LEN;
7006
- const ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7007
- const len1 = WASM_VECTOR_LEN;
7862
+ let ptr0, len0, ptr1, len1;
7863
+ try {
7864
+ ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7865
+ len0 = WASM_VECTOR_LEN;
7866
+ ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7867
+ len1 = WASM_VECTOR_LEN;
7868
+ } catch (e) {
7869
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7870
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7871
+ throw e;
7872
+ }
7008
7873
  const ret = wasm.periodic_structure_fingerprint_json(ptr0, len0, ptr1, len1);
7009
7874
  deferred3_0 = ret[0];
7010
7875
  deferred3_1 = ret[1];
@@ -7103,10 +7968,17 @@ export function pipeline_v2_stereo_safe_config_json(force_field, ring_torsion_po
7103
7968
  let deferred3_0;
7104
7969
  let deferred3_1;
7105
7970
  try {
7106
- const ptr0 = passStringToWasm0(force_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7107
- const len0 = WASM_VECTOR_LEN;
7108
- const ptr1 = passStringToWasm0(ring_torsion_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7109
- const len1 = WASM_VECTOR_LEN;
7971
+ let ptr0, len0, ptr1, len1;
7972
+ try {
7973
+ ptr0 = passStringToWasm0(force_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7974
+ len0 = WASM_VECTOR_LEN;
7975
+ ptr1 = passStringToWasm0(ring_torsion_policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7976
+ len1 = WASM_VECTOR_LEN;
7977
+ } catch (e) {
7978
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
7979
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
7980
+ throw e;
7981
+ }
7110
7982
  const ret = wasm.pipeline_v2_stereo_safe_config_json(ptr0, len0, ptr1, len1);
7111
7983
  deferred3_0 = ret[0];
7112
7984
  deferred3_1 = ret[1];
@@ -7153,12 +8025,20 @@ export function pqr_coords_json(text) {
7153
8025
  * @returns {string | undefined}
7154
8026
  */
7155
8027
  export function pqr_infer_element(group_pdb, res_name, atom_name) {
7156
- const ptr0 = passStringToWasm0(group_pdb, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7157
- const len0 = WASM_VECTOR_LEN;
7158
- const ptr1 = passStringToWasm0(res_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7159
- const len1 = WASM_VECTOR_LEN;
7160
- const ptr2 = passStringToWasm0(atom_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7161
- const len2 = WASM_VECTOR_LEN;
8028
+ let ptr0, len0, ptr1, len1, ptr2, len2;
8029
+ try {
8030
+ ptr0 = passStringToWasm0(group_pdb, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8031
+ len0 = WASM_VECTOR_LEN;
8032
+ ptr1 = passStringToWasm0(res_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8033
+ len1 = WASM_VECTOR_LEN;
8034
+ ptr2 = passStringToWasm0(atom_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8035
+ len2 = WASM_VECTOR_LEN;
8036
+ } catch (e) {
8037
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
8038
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
8039
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
8040
+ throw e;
8041
+ }
7162
8042
  const ret = wasm.pqr_infer_element(ptr0, len0, ptr1, len1, ptr2, len2);
7163
8043
  let v4;
7164
8044
  if (ret[0] !== 0) {
@@ -7233,17 +8113,19 @@ export function predict_pka_json(smiles) {
7233
8113
  * @returns {string}
7234
8114
  */
7235
8115
  export function preflight_smiles_json(smiles, width, height) {
7236
- let deferred2_0;
7237
- let deferred2_1;
8116
+ let deferred4_0;
8117
+ let deferred4_1;
7238
8118
  try {
8119
+ const val2 = +width;
8120
+ const val3 = +height;
7239
8121
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7240
8122
  const len0 = WASM_VECTOR_LEN;
7241
- const ret = wasm.preflight_smiles_json(ptr0, len0, width, height);
7242
- deferred2_0 = ret[0];
7243
- deferred2_1 = ret[1];
8123
+ const ret = wasm.preflight_smiles_json(ptr0, len0, val2, val3);
8124
+ deferred4_0 = ret[0];
8125
+ deferred4_1 = ret[1];
7244
8126
  return getStringFromWasm0(ret[0], ret[1]);
7245
8127
  } finally {
7246
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
8128
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7247
8129
  }
7248
8130
  }
7249
8131
 
@@ -7265,6 +8147,59 @@ export function prepare_rdkit_ecfp4(mol) {
7265
8147
  return PreparedRdkitEcfp4Handle.__wrap(ret[0]);
7266
8148
  }
7267
8149
 
8150
+ /**
8151
+ * Checked local CJSON graph/Cartesian/name projection; throws on opaque
8152
+ * fields, partial charges or conflicting names. No source chemistry validation.
8153
+ * @param {string} text
8154
+ * @returns {string}
8155
+ */
8156
+ export function project_cjson_to_cml(text) {
8157
+ let deferred3_0;
8158
+ let deferred3_1;
8159
+ try {
8160
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8161
+ const len0 = WASM_VECTOR_LEN;
8162
+ const ret = wasm.project_cjson_to_cml(ptr0, len0);
8163
+ var ptr2 = ret[0];
8164
+ var len2 = ret[1];
8165
+ if (ret[3]) {
8166
+ ptr2 = 0; len2 = 0;
8167
+ throw takeFromExternrefTable0(ret[2]);
8168
+ }
8169
+ deferred3_0 = ptr2;
8170
+ deferred3_1 = len2;
8171
+ return getStringFromWasm0(ptr2, len2);
8172
+ } finally {
8173
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8174
+ }
8175
+ }
8176
+
8177
+ /**
8178
+ * Checked CML graph/Cartesian/name profile; refuses unrepresented payload.
8179
+ * @param {string} text
8180
+ * @returns {string}
8181
+ */
8182
+ export function project_cml_to_cjson(text) {
8183
+ let deferred3_0;
8184
+ let deferred3_1;
8185
+ try {
8186
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8187
+ const len0 = WASM_VECTOR_LEN;
8188
+ const ret = wasm.project_cml_to_cjson(ptr0, len0);
8189
+ var ptr2 = ret[0];
8190
+ var len2 = ret[1];
8191
+ if (ret[3]) {
8192
+ ptr2 = 0; len2 = 0;
8193
+ throw takeFromExternrefTable0(ret[2]);
8194
+ }
8195
+ deferred3_0 = ptr2;
8196
+ deferred3_1 = len2;
8197
+ return getStringFromWasm0(ptr2, len2);
8198
+ } finally {
8199
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8200
+ }
8201
+ }
8202
+
7268
8203
  /**
7269
8204
  * Amino-acid-only mmCIF projection in the same schema as
7270
8205
  * [`protein_from_pdb_json`].
@@ -7430,23 +8365,25 @@ export function qcschema_validate_atomic_result(json) {
7430
8365
  * @returns {string}
7431
8366
  */
7432
8367
  export function random_smiles_json(smiles, count, seed) {
7433
- let deferred3_0;
7434
- let deferred3_1;
8368
+ let deferred5_0;
8369
+ let deferred5_1;
7435
8370
  try {
8371
+ const val2 = +count;
8372
+ const val3 = BigInt.asIntN(64, seed);
7436
8373
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7437
8374
  const len0 = WASM_VECTOR_LEN;
7438
- const ret = wasm.random_smiles_json(ptr0, len0, count, seed);
7439
- var ptr2 = ret[0];
7440
- var len2 = ret[1];
8375
+ const ret = wasm.random_smiles_json(ptr0, len0, val2, val3);
8376
+ var ptr4 = ret[0];
8377
+ var len4 = ret[1];
7441
8378
  if (ret[3]) {
7442
- ptr2 = 0; len2 = 0;
8379
+ ptr4 = 0; len4 = 0;
7443
8380
  throw takeFromExternrefTable0(ret[2]);
7444
8381
  }
7445
- deferred3_0 = ptr2;
7446
- deferred3_1 = len2;
7447
- return getStringFromWasm0(ptr2, len2);
8382
+ deferred5_0 = ptr4;
8383
+ deferred5_1 = len4;
8384
+ return getStringFromWasm0(ptr4, len4);
7448
8385
  } finally {
7449
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8386
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
7450
8387
  }
7451
8388
  }
7452
8389
 
@@ -7469,6 +8406,36 @@ export function rdkit_atom_code(mol, atom_index, branch_subtract) {
7469
8406
  return ret[0] >>> 0;
7470
8407
  }
7471
8408
 
8409
+ /**
8410
+ * Return packed bits, folded counts and unhashed counts for 2D Atom Pair.
8411
+ * The JSON options are optional. Set `countBounds` to null to disable count
8412
+ * simulation. Counts are returned as sorted [identifier, count] arrays.
8413
+ * @param {MolHandle} mol
8414
+ * @param {string} options_json
8415
+ * @returns {string}
8416
+ */
8417
+ export function rdkit_atom_pair_config_detail_json(mol, options_json) {
8418
+ let deferred3_0;
8419
+ let deferred3_1;
8420
+ try {
8421
+ _assertClass(mol, MolHandle);
8422
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8423
+ const len0 = WASM_VECTOR_LEN;
8424
+ const ret = wasm.rdkit_atom_pair_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8425
+ var ptr2 = ret[0];
8426
+ var len2 = ret[1];
8427
+ if (ret[3]) {
8428
+ ptr2 = 0; len2 = 0;
8429
+ throw takeFromExternrefTable0(ret[2]);
8430
+ }
8431
+ deferred3_0 = ptr2;
8432
+ deferred3_1 = len2;
8433
+ return getStringFromWasm0(ptr2, len2);
8434
+ } finally {
8435
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8436
+ }
8437
+ }
8438
+
7472
8439
  /**
7473
8440
  * RDKit-bit-exact ECFP4 (radius=2, 2048 bits, `useChirality=false`, `useBondTypes=true`,
7474
8441
  * RDKit's default atom invariant) as a bit-packed byte vector (256 bytes = 2048 bits).
@@ -7638,9 +8605,12 @@ export function rdkit_ecfp_config_detail_json(mol, radius, nbits) {
7638
8605
  * @returns {RdkitReadResult}
7639
8606
  */
7640
8607
  export function rdkit_from_mol2_block(text, sanitize, remove_hs, cleanup_substructures) {
8608
+ const val2 = +sanitize;
8609
+ const val3 = +remove_hs;
8610
+ const val4 = +cleanup_substructures;
7641
8611
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7642
8612
  const len0 = WASM_VECTOR_LEN;
7643
- const ret = wasm.rdkit_from_mol2_block(ptr0, len0, sanitize, remove_hs, cleanup_substructures);
8613
+ const ret = wasm.rdkit_from_mol2_block(ptr0, len0, val2, val3, val4);
7644
8614
  if (ret[2]) {
7645
8615
  throw takeFromExternrefTable0(ret[1]);
7646
8616
  }
@@ -7657,9 +8627,13 @@ export function rdkit_from_mol2_block(text, sanitize, remove_hs, cleanup_substru
7657
8627
  * @returns {RdkitReadResult}
7658
8628
  */
7659
8629
  export function rdkit_from_pdb_block(text, sanitize, remove_hs, flavor, proximity_bonding) {
8630
+ const val2 = +sanitize;
8631
+ const val3 = +remove_hs;
8632
+ const val4 = +flavor;
8633
+ const val5 = +proximity_bonding;
7660
8634
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7661
8635
  const len0 = WASM_VECTOR_LEN;
7662
- const ret = wasm.rdkit_from_pdb_block(ptr0, len0, sanitize, remove_hs, flavor, proximity_bonding);
8636
+ const ret = wasm.rdkit_from_pdb_block(ptr0, len0, val2, val3, val4, val5);
7663
8637
  if (ret[2]) {
7664
8638
  throw takeFromExternrefTable0(ret[1]);
7665
8639
  }
@@ -7681,6 +8655,36 @@ export function rdkit_from_xyz_block(text) {
7681
8655
  return RdkitReadResult.__wrap(ret[0]);
7682
8656
  }
7683
8657
 
8658
+ /**
8659
+ * Return the configured RDKit Layered fingerprint and per-atom counters as JSON.
8660
+ * Pass `{}` for defaults. `setOnlyBits` is an optional LSB-first packed byte
8661
+ * array, and `atomCounts` optionally seeds the returned u32 counters.
8662
+ * @param {MolHandle} mol
8663
+ * @param {string} options_json
8664
+ * @returns {string}
8665
+ */
8666
+ export function rdkit_layered_config_detail_json(mol, options_json) {
8667
+ let deferred3_0;
8668
+ let deferred3_1;
8669
+ try {
8670
+ _assertClass(mol, MolHandle);
8671
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8672
+ const len0 = WASM_VECTOR_LEN;
8673
+ const ret = wasm.rdkit_layered_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8674
+ var ptr2 = ret[0];
8675
+ var len2 = ret[1];
8676
+ if (ret[3]) {
8677
+ ptr2 = 0; len2 = 0;
8678
+ throw takeFromExternrefTable0(ret[2]);
8679
+ }
8680
+ deferred3_0 = ptr2;
8681
+ deferred3_1 = len2;
8682
+ return getStringFromWasm0(ptr2, len2);
8683
+ } finally {
8684
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8685
+ }
8686
+ }
8687
+
7684
8688
  /**
7685
8689
  * Find the k nearest neighbours using the RDKit-compatible Morgan/ECFP4
7686
8690
  * profile. This is intentionally separate from [`nearest_neighbors_json`],
@@ -7695,19 +8699,27 @@ export function rdkit_from_xyz_block(text) {
7695
8699
  * @returns {string}
7696
8700
  */
7697
8701
  export function rdkit_nearest_neighbors_json(query_smiles, db_smiles_json, k) {
7698
- let deferred3_0;
7699
- let deferred3_1;
8702
+ let deferred4_0;
8703
+ let deferred4_1;
7700
8704
  try {
7701
- const ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7702
- const len0 = WASM_VECTOR_LEN;
7703
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7704
- const len1 = WASM_VECTOR_LEN;
7705
- const ret = wasm.rdkit_nearest_neighbors_json(ptr0, len0, ptr1, len1, k);
7706
- deferred3_0 = ret[0];
7707
- deferred3_1 = ret[1];
8705
+ const val3 = +k;
8706
+ let ptr0, len0, ptr1, len1;
8707
+ try {
8708
+ ptr0 = passStringToWasm0(query_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8709
+ len0 = WASM_VECTOR_LEN;
8710
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8711
+ len1 = WASM_VECTOR_LEN;
8712
+ } catch (e) {
8713
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
8714
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
8715
+ throw e;
8716
+ }
8717
+ const ret = wasm.rdkit_nearest_neighbors_json(ptr0, len0, ptr1, len1, val3);
8718
+ deferred4_0 = ret[0];
8719
+ deferred4_1 = ret[1];
7708
8720
  return getStringFromWasm0(ret[0], ret[1]);
7709
8721
  } finally {
7710
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8722
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7711
8723
  }
7712
8724
  }
7713
8725
 
@@ -7747,7 +8759,7 @@ export function rdkit_rdk_bitvec(mol) {
7747
8759
  * containing one of `ignored_atoms` is excluded. Invalid indices return a JS
7748
8760
  * error; an empty list is bit-identical to [`rdkit_rdk_bitvec`].
7749
8761
  * @param {MolHandle} mol
7750
- * @param {Uint32Array} ignored_atoms
8762
+ * @param {Uint32Array | number[]} ignored_atoms
7751
8763
  * @returns {Uint8Array}
7752
8764
  */
7753
8765
  export function rdkit_rdk_bitvec_ignoring_atoms(mol, ignored_atoms) {
@@ -7763,6 +8775,36 @@ export function rdkit_rdk_bitvec_ignoring_atoms(mol, ignored_atoms) {
7763
8775
  return v2;
7764
8776
  }
7765
8777
 
8778
+ /**
8779
+ * Packed RDK bits and folded and sparse counts, using input atom indices.
8780
+ * A supplied `countBounds` array enables count simulation for the bit vector.
8781
+ * Packed bytes are LSB-first and counts are sorted [identifier, count] pairs.
8782
+ * @param {MolHandle} mol
8783
+ * @param {string} options_json
8784
+ * @returns {string}
8785
+ */
8786
+ export function rdkit_rdk_config_detail_json(mol, options_json) {
8787
+ let deferred3_0;
8788
+ let deferred3_1;
8789
+ try {
8790
+ _assertClass(mol, MolHandle);
8791
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8792
+ const len0 = WASM_VECTOR_LEN;
8793
+ const ret = wasm.rdkit_rdk_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8794
+ var ptr2 = ret[0];
8795
+ var len2 = ret[1];
8796
+ if (ret[3]) {
8797
+ ptr2 = 0; len2 = 0;
8798
+ throw takeFromExternrefTable0(ret[2]);
8799
+ }
8800
+ deferred3_0 = ptr2;
8801
+ deferred3_1 = len2;
8802
+ return getStringFromWasm0(ptr2, len2);
8803
+ } finally {
8804
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8805
+ }
8806
+ }
8807
+
7766
8808
  /**
7767
8809
  * Pack a JSON array of atom indices into RDKit's legacy torsion code.
7768
8810
  *
@@ -7809,6 +8851,36 @@ export function rdkit_torsion_bitvec(mol) {
7809
8851
  return v1;
7810
8852
  }
7811
8853
 
8854
+ /**
8855
+ * Return packed bits, folded counts and unhashed Topological Torsion counts.
8856
+ * Pass JSON options or `{}` for defaults. A null `countBounds` disables
8857
+ * simulation. Sparse identifiers are decimal strings to retain all 64 bits.
8858
+ * @param {MolHandle} mol
8859
+ * @param {string} options_json
8860
+ * @returns {string}
8861
+ */
8862
+ export function rdkit_torsion_config_detail_json(mol, options_json) {
8863
+ let deferred3_0;
8864
+ let deferred3_1;
8865
+ try {
8866
+ _assertClass(mol, MolHandle);
8867
+ const ptr0 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8868
+ const len0 = WASM_VECTOR_LEN;
8869
+ const ret = wasm.rdkit_torsion_config_detail_json(mol.__wbg_ptr, ptr0, len0);
8870
+ var ptr2 = ret[0];
8871
+ var len2 = ret[1];
8872
+ if (ret[3]) {
8873
+ ptr2 = 0; len2 = 0;
8874
+ throw takeFromExternrefTable0(ret[2]);
8875
+ }
8876
+ deferred3_0 = ptr2;
8877
+ deferred3_1 = len2;
8878
+ return getStringFromWasm0(ptr2, len2);
8879
+ } finally {
8880
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8881
+ }
8882
+ }
8883
+
7812
8884
  /**
7813
8885
  * Validate and deterministically serialize a rich reaction document JSON.
7814
8886
  *
@@ -7878,10 +8950,17 @@ export function reaction_document_to_rxn_v1(document_json) {
7878
8950
  * @returns {boolean}
7879
8951
  */
7880
8952
  export function reaction_smarts_match(smarts, reaction_smiles) {
7881
- const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7882
- const len0 = WASM_VECTOR_LEN;
7883
- const ptr1 = passStringToWasm0(reaction_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7884
- const len1 = WASM_VECTOR_LEN;
8953
+ let ptr0, len0, ptr1, len1;
8954
+ try {
8955
+ ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8956
+ len0 = WASM_VECTOR_LEN;
8957
+ ptr1 = passStringToWasm0(reaction_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8958
+ len1 = WASM_VECTOR_LEN;
8959
+ } catch (e) {
8960
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
8961
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
8962
+ throw e;
8963
+ }
7885
8964
  const ret = wasm.reaction_smarts_match(ptr0, len0, ptr1, len1);
7886
8965
  if (ret[2]) {
7887
8966
  throw takeFromExternrefTable0(ret[1]);
@@ -7947,24 +9026,25 @@ export function remove_redundant_tetrahedral_stereo(mol, atom_index, max_visits)
7947
9026
  * @returns {string}
7948
9027
  */
7949
9028
  export function retro_disconnect_json(mol, max_results, reaction_class) {
7950
- let deferred3_0;
7951
- let deferred3_1;
9029
+ let deferred4_0;
9030
+ let deferred4_1;
7952
9031
  try {
7953
9032
  _assertClass(mol, MolHandle);
9033
+ const val2 = +max_results;
7954
9034
  const ptr0 = passStringToWasm0(reaction_class, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7955
9035
  const len0 = WASM_VECTOR_LEN;
7956
- const ret = wasm.retro_disconnect_json(mol.__wbg_ptr, max_results, ptr0, len0);
7957
- var ptr2 = ret[0];
7958
- var len2 = ret[1];
9036
+ const ret = wasm.retro_disconnect_json(mol.__wbg_ptr, val2, ptr0, len0);
9037
+ var ptr3 = ret[0];
9038
+ var len3 = ret[1];
7959
9039
  if (ret[3]) {
7960
- ptr2 = 0; len2 = 0;
9040
+ ptr3 = 0; len3 = 0;
7961
9041
  throw takeFromExternrefTable0(ret[2]);
7962
9042
  }
7963
- deferred3_0 = ptr2;
7964
- deferred3_1 = len2;
7965
- return getStringFromWasm0(ptr2, len2);
9043
+ deferred4_0 = ptr3;
9044
+ deferred4_1 = len3;
9045
+ return getStringFromWasm0(ptr3, len3);
7966
9046
  } finally {
7967
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9047
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
7968
9048
  }
7969
9049
  }
7970
9050
 
@@ -7985,10 +9065,17 @@ export function rgroup_decompose_columns_json(smiles_json, core_smarts) {
7985
9065
  let deferred4_0;
7986
9066
  let deferred4_1;
7987
9067
  try {
7988
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7989
- const len0 = WASM_VECTOR_LEN;
7990
- const ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7991
- const len1 = WASM_VECTOR_LEN;
9068
+ let ptr0, len0, ptr1, len1;
9069
+ try {
9070
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9071
+ len0 = WASM_VECTOR_LEN;
9072
+ ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9073
+ len1 = WASM_VECTOR_LEN;
9074
+ } catch (e) {
9075
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9076
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9077
+ throw e;
9078
+ }
7992
9079
  const ret = wasm.rgroup_decompose_columns_json(ptr0, len0, ptr1, len1);
7993
9080
  var ptr3 = ret[0];
7994
9081
  var len3 = ret[1];
@@ -8032,10 +9119,17 @@ export function rgroup_decompose_json(smiles_json, core_smarts) {
8032
9119
  let deferred4_0;
8033
9120
  let deferred4_1;
8034
9121
  try {
8035
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8036
- const len0 = WASM_VECTOR_LEN;
8037
- const ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8038
- const len1 = WASM_VECTOR_LEN;
9122
+ let ptr0, len0, ptr1, len1;
9123
+ try {
9124
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9125
+ len0 = WASM_VECTOR_LEN;
9126
+ ptr1 = passStringToWasm0(core_smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9127
+ len1 = WASM_VECTOR_LEN;
9128
+ } catch (e) {
9129
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9130
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9131
+ throw e;
9132
+ }
8039
9133
  const ret = wasm.rgroup_decompose_json(ptr0, len0, ptr1, len1);
8040
9134
  var ptr3 = ret[0];
8041
9135
  var len3 = ret[1];
@@ -8066,29 +9160,57 @@ export function ring_families_json(mol) {
8066
9160
  var ptr1 = ret[0];
8067
9161
  var len1 = ret[1];
8068
9162
  if (ret[3]) {
8069
- ptr1 = 0; len1 = 0;
9163
+ ptr1 = 0; len1 = 0;
9164
+ throw takeFromExternrefTable0(ret[2]);
9165
+ }
9166
+ deferred2_0 = ptr1;
9167
+ deferred2_1 = len1;
9168
+ return getStringFromWasm0(ptr1, len1);
9169
+ } finally {
9170
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
9171
+ }
9172
+ }
9173
+
9174
+ /**
9175
+ * Validate the local CJSON profile and retain the exact UTF-8 source.
9176
+ * @param {string} text
9177
+ * @returns {string}
9178
+ */
9179
+ export function roundtrip_cjson_record(text) {
9180
+ let deferred3_0;
9181
+ let deferred3_1;
9182
+ try {
9183
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9184
+ const len0 = WASM_VECTOR_LEN;
9185
+ const ret = wasm.roundtrip_cjson_record(ptr0, len0);
9186
+ var ptr2 = ret[0];
9187
+ var len2 = ret[1];
9188
+ if (ret[3]) {
9189
+ ptr2 = 0; len2 = 0;
8070
9190
  throw takeFromExternrefTable0(ret[2]);
8071
9191
  }
8072
- deferred2_0 = ptr1;
8073
- deferred2_1 = len1;
8074
- return getStringFromWasm0(ptr1, len1);
9192
+ deferred3_0 = ptr2;
9193
+ deferred3_1 = len2;
9194
+ return getStringFromWasm0(ptr2, len2);
8075
9195
  } finally {
8076
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
9196
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
8077
9197
  }
8078
9198
  }
8079
9199
 
8080
9200
  /**
8081
- * Validate the local CJSON profile and retain the exact UTF-8 source.
9201
+ * Exact bounded XML 1.0 CML source retention. Requires one CML-namespace
9202
+ * molecule root; rejects nested molecules/DTDs. Chemistry, references and
9203
+ * stereo remain opaque, with no interpretation or schema validation promised.
8082
9204
  * @param {string} text
8083
9205
  * @returns {string}
8084
9206
  */
8085
- export function roundtrip_cjson_record(text) {
9207
+ export function roundtrip_cml_source(text) {
8086
9208
  let deferred3_0;
8087
9209
  let deferred3_1;
8088
9210
  try {
8089
9211
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8090
9212
  const len0 = WASM_VECTOR_LEN;
8091
- const ret = wasm.roundtrip_cjson_record(ptr0, len0);
9213
+ const ret = wasm.roundtrip_cml_source(ptr0, len0);
8092
9214
  var ptr2 = ret[0];
8093
9215
  var len2 = ret[1];
8094
9216
  if (ret[3]) {
@@ -8285,10 +9407,17 @@ export function run_reactants(smirks, reactants_smiles) {
8285
9407
  let deferred4_0;
8286
9408
  let deferred4_1;
8287
9409
  try {
8288
- const ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8289
- const len0 = WASM_VECTOR_LEN;
8290
- const ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8291
- const len1 = WASM_VECTOR_LEN;
9410
+ let ptr0, len0, ptr1, len1;
9411
+ try {
9412
+ ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9413
+ len0 = WASM_VECTOR_LEN;
9414
+ ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9415
+ len1 = WASM_VECTOR_LEN;
9416
+ } catch (e) {
9417
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9418
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9419
+ throw e;
9420
+ }
8292
9421
  const ret = wasm.run_reactants(ptr0, len0, ptr1, len1);
8293
9422
  var ptr3 = ret[0];
8294
9423
  var len3 = ret[1];
@@ -8328,19 +9457,27 @@ export function run_reactants(smirks, reactants_smiles) {
8328
9457
  * @returns {string}
8329
9458
  */
8330
9459
  export function run_reactants_checked(smirks, reactants_smiles, rdkit_compat) {
8331
- let deferred3_0;
8332
- let deferred3_1;
9460
+ let deferred4_0;
9461
+ let deferred4_1;
8333
9462
  try {
8334
- const ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8335
- const len0 = WASM_VECTOR_LEN;
8336
- const ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8337
- const len1 = WASM_VECTOR_LEN;
8338
- const ret = wasm.run_reactants_checked(ptr0, len0, ptr1, len1, rdkit_compat);
8339
- deferred3_0 = ret[0];
8340
- deferred3_1 = ret[1];
9463
+ const val3 = +rdkit_compat;
9464
+ let ptr0, len0, ptr1, len1;
9465
+ try {
9466
+ ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9467
+ len0 = WASM_VECTOR_LEN;
9468
+ ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9469
+ len1 = WASM_VECTOR_LEN;
9470
+ } catch (e) {
9471
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9472
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9473
+ throw e;
9474
+ }
9475
+ const ret = wasm.run_reactants_checked(ptr0, len0, ptr1, len1, val3);
9476
+ deferred4_0 = ret[0];
9477
+ deferred4_1 = ret[1];
8341
9478
  return getStringFromWasm0(ret[0], ret[1]);
8342
9479
  } finally {
8343
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9480
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
8344
9481
  }
8345
9482
  }
8346
9483
 
@@ -8433,10 +9570,17 @@ export function screen_smiles_json(smiles_batch, delimiter) {
8433
9570
  let deferred3_0;
8434
9571
  let deferred3_1;
8435
9572
  try {
8436
- const ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8437
- const len0 = WASM_VECTOR_LEN;
8438
- const ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8439
- const len1 = WASM_VECTOR_LEN;
9573
+ let ptr0, len0, ptr1, len1;
9574
+ try {
9575
+ ptr0 = passStringToWasm0(smiles_batch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9576
+ len0 = WASM_VECTOR_LEN;
9577
+ ptr1 = passStringToWasm0(delimiter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9578
+ len1 = WASM_VECTOR_LEN;
9579
+ } catch (e) {
9580
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9581
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9582
+ throw e;
9583
+ }
8440
9584
  const ret = wasm.screen_smiles_json(ptr0, len0, ptr1, len1);
8441
9585
  deferred3_0 = ret[0];
8442
9586
  deferred3_1 = ret[1];
@@ -8470,12 +9614,20 @@ export function sdf_from_records_json(smiles_json, names_json, props_json) {
8470
9614
  let deferred5_0;
8471
9615
  let deferred5_1;
8472
9616
  try {
8473
- const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8474
- const len0 = WASM_VECTOR_LEN;
8475
- const ptr1 = passStringToWasm0(names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8476
- const len1 = WASM_VECTOR_LEN;
8477
- const ptr2 = passStringToWasm0(props_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8478
- const len2 = WASM_VECTOR_LEN;
9617
+ let ptr0, len0, ptr1, len1, ptr2, len2;
9618
+ try {
9619
+ ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9620
+ len0 = WASM_VECTOR_LEN;
9621
+ ptr1 = passStringToWasm0(names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9622
+ len1 = WASM_VECTOR_LEN;
9623
+ ptr2 = passStringToWasm0(props_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9624
+ len2 = WASM_VECTOR_LEN;
9625
+ } catch (e) {
9626
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
9627
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9628
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9629
+ throw e;
9630
+ }
8479
9631
  const ret = wasm.sdf_from_records_json(ptr0, len0, ptr1, len1, ptr2, len2);
8480
9632
  var ptr4 = ret[0];
8481
9633
  var len4 = ret[1];
@@ -8504,23 +9656,25 @@ export function sdf_from_records_json(smiles_json, names_json, props_json) {
8504
9656
  * @returns {string}
8505
9657
  */
8506
9658
  export function sdf_records_batch_json(sdf, offset, batch_size) {
8507
- let deferred3_0;
8508
- let deferred3_1;
9659
+ let deferred5_0;
9660
+ let deferred5_1;
8509
9661
  try {
9662
+ const val2 = +offset;
9663
+ const val3 = +batch_size;
8510
9664
  const ptr0 = passStringToWasm0(sdf, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8511
9665
  const len0 = WASM_VECTOR_LEN;
8512
- const ret = wasm.sdf_records_batch_json(ptr0, len0, offset, batch_size);
8513
- var ptr2 = ret[0];
8514
- var len2 = ret[1];
9666
+ const ret = wasm.sdf_records_batch_json(ptr0, len0, val2, val3);
9667
+ var ptr4 = ret[0];
9668
+ var len4 = ret[1];
8515
9669
  if (ret[3]) {
8516
- ptr2 = 0; len2 = 0;
9670
+ ptr4 = 0; len4 = 0;
8517
9671
  throw takeFromExternrefTable0(ret[2]);
8518
9672
  }
8519
- deferred3_0 = ptr2;
8520
- deferred3_1 = len2;
8521
- return getStringFromWasm0(ptr2, len2);
9673
+ deferred5_0 = ptr4;
9674
+ deferred5_1 = len4;
9675
+ return getStringFromWasm0(ptr4, len4);
8522
9676
  } finally {
8523
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9677
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
8524
9678
  }
8525
9679
  }
8526
9680
 
@@ -8588,10 +9742,17 @@ export function semantic_apply_json_command(model_json, command_json) {
8588
9742
  let deferred4_0;
8589
9743
  let deferred4_1;
8590
9744
  try {
8591
- const ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8592
- const len0 = WASM_VECTOR_LEN;
8593
- const ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8594
- const len1 = WASM_VECTOR_LEN;
9745
+ let ptr0, len0, ptr1, len1;
9746
+ try {
9747
+ ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9748
+ len0 = WASM_VECTOR_LEN;
9749
+ ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9750
+ len1 = WASM_VECTOR_LEN;
9751
+ } catch (e) {
9752
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9753
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9754
+ throw e;
9755
+ }
8595
9756
  const ret = wasm.semantic_apply_json_command(ptr0, len0, ptr1, len1);
8596
9757
  var ptr3 = ret[0];
8597
9758
  var len3 = ret[1];
@@ -8618,10 +9779,17 @@ export function semantic_expand_json(base_smiles, model_json) {
8618
9779
  let deferred4_0;
8619
9780
  let deferred4_1;
8620
9781
  try {
8621
- const ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8622
- const len0 = WASM_VECTOR_LEN;
8623
- const ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8624
- const len1 = WASM_VECTOR_LEN;
9782
+ let ptr0, len0, ptr1, len1;
9783
+ try {
9784
+ ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9785
+ len0 = WASM_VECTOR_LEN;
9786
+ ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9787
+ len1 = WASM_VECTOR_LEN;
9788
+ } catch (e) {
9789
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9790
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9791
+ throw e;
9792
+ }
8625
9793
  const ret = wasm.semantic_expand_json(ptr0, len0, ptr1, len1);
8626
9794
  var ptr3 = ret[0];
8627
9795
  var len3 = ret[1];
@@ -8646,25 +9814,34 @@ export function semantic_expand_json(base_smiles, model_json) {
8646
9814
  * @returns {string}
8647
9815
  */
8648
9816
  export function semantic_expand_json_with_limits(base_smiles, model_json, max_atoms, max_repeat_count) {
8649
- let deferred4_0;
8650
- let deferred4_1;
9817
+ let deferred6_0;
9818
+ let deferred6_1;
8651
9819
  try {
8652
- const ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8653
- const len0 = WASM_VECTOR_LEN;
8654
- const ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8655
- const len1 = WASM_VECTOR_LEN;
8656
- const ret = wasm.semantic_expand_json_with_limits(ptr0, len0, ptr1, len1, max_atoms, max_repeat_count);
8657
- var ptr3 = ret[0];
8658
- var len3 = ret[1];
9820
+ const val3 = +max_atoms;
9821
+ const val4 = +max_repeat_count;
9822
+ let ptr0, len0, ptr1, len1;
9823
+ try {
9824
+ ptr0 = passStringToWasm0(base_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9825
+ len0 = WASM_VECTOR_LEN;
9826
+ ptr1 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9827
+ len1 = WASM_VECTOR_LEN;
9828
+ } catch (e) {
9829
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
9830
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
9831
+ throw e;
9832
+ }
9833
+ const ret = wasm.semantic_expand_json_with_limits(ptr0, len0, ptr1, len1, val3, val4);
9834
+ var ptr5 = ret[0];
9835
+ var len5 = ret[1];
8659
9836
  if (ret[3]) {
8660
- ptr3 = 0; len3 = 0;
9837
+ ptr5 = 0; len5 = 0;
8661
9838
  throw takeFromExternrefTable0(ret[2]);
8662
9839
  }
8663
- deferred4_0 = ptr3;
8664
- deferred4_1 = len3;
8665
- return getStringFromWasm0(ptr3, len3);
9840
+ deferred6_0 = ptr5;
9841
+ deferred6_1 = len5;
9842
+ return getStringFromWasm0(ptr5, len5);
8666
9843
  } finally {
8667
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
9844
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
8668
9845
  }
8669
9846
  }
8670
9847
 
@@ -8708,24 +9885,28 @@ export function semantic_model_json(model_json) {
8708
9885
  * @returns {string}
8709
9886
  */
8710
9887
  export function set_bond_angle_from_coords_json(mol, coords_json, i, j, k, angle_deg) {
8711
- let deferred3_0;
8712
- let deferred3_1;
9888
+ let deferred7_0;
9889
+ let deferred7_1;
8713
9890
  try {
8714
9891
  _assertClass(mol, MolHandle);
9892
+ const val2 = +i;
9893
+ const val3 = +j;
9894
+ const val4 = +k;
9895
+ const val5 = +angle_deg;
8715
9896
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8716
9897
  const len0 = WASM_VECTOR_LEN;
8717
- const ret = wasm.set_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, angle_deg);
8718
- var ptr2 = ret[0];
8719
- var len2 = ret[1];
9898
+ const ret = wasm.set_bond_angle_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
9899
+ var ptr6 = ret[0];
9900
+ var len6 = ret[1];
8720
9901
  if (ret[3]) {
8721
- ptr2 = 0; len2 = 0;
9902
+ ptr6 = 0; len6 = 0;
8722
9903
  throw takeFromExternrefTable0(ret[2]);
8723
9904
  }
8724
- deferred3_0 = ptr2;
8725
- deferred3_1 = len2;
8726
- return getStringFromWasm0(ptr2, len2);
9905
+ deferred7_0 = ptr6;
9906
+ deferred7_1 = len6;
9907
+ return getStringFromWasm0(ptr6, len6);
8727
9908
  } finally {
8728
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9909
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
8729
9910
  }
8730
9911
  }
8731
9912
 
@@ -8742,24 +9923,27 @@ export function set_bond_angle_from_coords_json(mol, coords_json, i, j, k, angle
8742
9923
  * @returns {string}
8743
9924
  */
8744
9925
  export function set_bond_length_from_coords_json(mol, coords_json, i, j, length) {
8745
- let deferred3_0;
8746
- let deferred3_1;
9926
+ let deferred6_0;
9927
+ let deferred6_1;
8747
9928
  try {
8748
9929
  _assertClass(mol, MolHandle);
9930
+ const val2 = +i;
9931
+ const val3 = +j;
9932
+ const val4 = +length;
8749
9933
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8750
9934
  const len0 = WASM_VECTOR_LEN;
8751
- const ret = wasm.set_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, length);
8752
- var ptr2 = ret[0];
8753
- var len2 = ret[1];
9935
+ const ret = wasm.set_bond_length_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4);
9936
+ var ptr5 = ret[0];
9937
+ var len5 = ret[1];
8754
9938
  if (ret[3]) {
8755
- ptr2 = 0; len2 = 0;
9939
+ ptr5 = 0; len5 = 0;
8756
9940
  throw takeFromExternrefTable0(ret[2]);
8757
9941
  }
8758
- deferred3_0 = ptr2;
8759
- deferred3_1 = len2;
8760
- return getStringFromWasm0(ptr2, len2);
9942
+ deferred6_0 = ptr5;
9943
+ deferred6_1 = len5;
9944
+ return getStringFromWasm0(ptr5, len5);
8761
9945
  } finally {
8762
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9946
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
8763
9947
  }
8764
9948
  }
8765
9949
 
@@ -8777,24 +9961,29 @@ export function set_bond_length_from_coords_json(mol, coords_json, i, j, length)
8777
9961
  * @returns {string}
8778
9962
  */
8779
9963
  export function set_dihedral_from_coords_json(mol, coords_json, i, j, k, l, angle_deg) {
8780
- let deferred3_0;
8781
- let deferred3_1;
9964
+ let deferred8_0;
9965
+ let deferred8_1;
8782
9966
  try {
8783
9967
  _assertClass(mol, MolHandle);
9968
+ const val2 = +i;
9969
+ const val3 = +j;
9970
+ const val4 = +k;
9971
+ const val5 = +l;
9972
+ const val6 = +angle_deg;
8784
9973
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8785
9974
  const len0 = WASM_VECTOR_LEN;
8786
- const ret = wasm.set_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, i, j, k, l, angle_deg);
8787
- var ptr2 = ret[0];
8788
- var len2 = ret[1];
9975
+ const ret = wasm.set_dihedral_from_coords_json(mol.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6);
9976
+ var ptr7 = ret[0];
9977
+ var len7 = ret[1];
8789
9978
  if (ret[3]) {
8790
- ptr2 = 0; len2 = 0;
9979
+ ptr7 = 0; len7 = 0;
8791
9980
  throw takeFromExternrefTable0(ret[2]);
8792
9981
  }
8793
- deferred3_0 = ptr2;
8794
- deferred3_1 = len2;
8795
- return getStringFromWasm0(ptr2, len2);
9982
+ deferred8_0 = ptr7;
9983
+ deferred8_1 = len7;
9984
+ return getStringFromWasm0(ptr7, len7);
8796
9985
  } finally {
8797
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9986
+ wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
8798
9987
  }
8799
9988
  }
8800
9989
 
@@ -8821,23 +10010,28 @@ export function set_dihedral_from_coords_json(mol, coords_json, i, j, k, l, angl
8821
10010
  * @returns {string}
8822
10011
  */
8823
10012
  export function set_dihedral_json(smiles, a, b, c, d, angle_deg) {
8824
- let deferred3_0;
8825
- let deferred3_1;
8826
- try {
10013
+ let deferred8_0;
10014
+ let deferred8_1;
10015
+ try {
10016
+ const val2 = +a;
10017
+ const val3 = +b;
10018
+ const val4 = +c;
10019
+ const val5 = +d;
10020
+ const val6 = +angle_deg;
8827
10021
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8828
10022
  const len0 = WASM_VECTOR_LEN;
8829
- const ret = wasm.set_dihedral_json(ptr0, len0, a, b, c, d, angle_deg);
8830
- var ptr2 = ret[0];
8831
- var len2 = ret[1];
10023
+ const ret = wasm.set_dihedral_json(ptr0, len0, val2, val3, val4, val5, val6);
10024
+ var ptr7 = ret[0];
10025
+ var len7 = ret[1];
8832
10026
  if (ret[3]) {
8833
- ptr2 = 0; len2 = 0;
10027
+ ptr7 = 0; len7 = 0;
8834
10028
  throw takeFromExternrefTable0(ret[2]);
8835
10029
  }
8836
- deferred3_0 = ptr2;
8837
- deferred3_1 = len2;
8838
- return getStringFromWasm0(ptr2, len2);
10030
+ deferred8_0 = ptr7;
10031
+ deferred8_1 = len7;
10032
+ return getStringFromWasm0(ptr7, len7);
8839
10033
  } finally {
8840
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
10034
+ wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
8841
10035
  }
8842
10036
  }
8843
10037
 
@@ -8897,9 +10091,9 @@ export function smarts_match_atoms(smarts, mol) {
8897
10091
  let deferred3_0;
8898
10092
  let deferred3_1;
8899
10093
  try {
10094
+ _assertClass(mol, MolHandle);
8900
10095
  const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8901
10096
  const len0 = WASM_VECTOR_LEN;
8902
- _assertClass(mol, MolHandle);
8903
10097
  const ret = wasm.smarts_match_atoms(ptr0, len0, mol.__wbg_ptr);
8904
10098
  var ptr2 = ret[0];
8905
10099
  var len2 = ret[1];
@@ -8927,24 +10121,65 @@ export function smarts_match_atoms(smarts, mol) {
8927
10121
  * @returns {string}
8928
10122
  */
8929
10123
  export function smarts_match_atoms_with_chirality(smarts, mol, use_chirality) {
8930
- let deferred3_0;
8931
- let deferred3_1;
10124
+ let deferred4_0;
10125
+ let deferred4_1;
8932
10126
  try {
10127
+ _assertClass(mol, MolHandle);
10128
+ const val2 = +use_chirality;
8933
10129
  const ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8934
10130
  const len0 = WASM_VECTOR_LEN;
10131
+ const ret = wasm.smarts_match_atoms_with_chirality(ptr0, len0, mol.__wbg_ptr, val2);
10132
+ var ptr3 = ret[0];
10133
+ var len3 = ret[1];
10134
+ if (ret[3]) {
10135
+ ptr3 = 0; len3 = 0;
10136
+ throw takeFromExternrefTable0(ret[2]);
10137
+ }
10138
+ deferred4_0 = ptr3;
10139
+ deferred4_1 = len3;
10140
+ return getStringFromWasm0(ptr3, len3);
10141
+ } finally {
10142
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
10143
+ }
10144
+ }
10145
+
10146
+ /**
10147
+ * Match SMARTS with optional `useChirality` and `useIsotopes` JSON flags.
10148
+ * Returns sorted atom indices for each hit. The existing WASM match and visit
10149
+ * limits apply. Pass `{}` to use the default settings.
10150
+ * @param {string} smarts
10151
+ * @param {MolHandle} mol
10152
+ * @param {string} config_json
10153
+ * @returns {string}
10154
+ */
10155
+ export function smarts_match_atoms_with_config(smarts, mol, config_json) {
10156
+ let deferred4_0;
10157
+ let deferred4_1;
10158
+ try {
8935
10159
  _assertClass(mol, MolHandle);
8936
- const ret = wasm.smarts_match_atoms_with_chirality(ptr0, len0, mol.__wbg_ptr, use_chirality);
8937
- var ptr2 = ret[0];
8938
- var len2 = ret[1];
10160
+ let ptr0, len0, ptr1, len1;
10161
+ try {
10162
+ ptr0 = passStringToWasm0(smarts, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10163
+ len0 = WASM_VECTOR_LEN;
10164
+ ptr1 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10165
+ len1 = WASM_VECTOR_LEN;
10166
+ } catch (e) {
10167
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10168
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10169
+ throw e;
10170
+ }
10171
+ const ret = wasm.smarts_match_atoms_with_config(ptr0, len0, mol.__wbg_ptr, ptr1, len1);
10172
+ var ptr3 = ret[0];
10173
+ var len3 = ret[1];
8939
10174
  if (ret[3]) {
8940
- ptr2 = 0; len2 = 0;
10175
+ ptr3 = 0; len3 = 0;
8941
10176
  throw takeFromExternrefTable0(ret[2]);
8942
10177
  }
8943
- deferred3_0 = ptr2;
8944
- deferred3_1 = len2;
8945
- return getStringFromWasm0(ptr2, len2);
10178
+ deferred4_0 = ptr3;
10179
+ deferred4_1 = len3;
10180
+ return getStringFromWasm0(ptr3, len3);
8946
10181
  } finally {
8947
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
10182
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
8948
10183
  }
8949
10184
  }
8950
10185
 
@@ -9020,14 +10255,23 @@ export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
9020
10255
  let deferred5_0;
9021
10256
  let deferred5_1;
9022
10257
  try {
9023
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9024
- const len0 = WASM_VECTOR_LEN;
9025
- const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9026
- const len1 = WASM_VECTOR_LEN;
9027
- const ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9028
- const len2 = WASM_VECTOR_LEN;
9029
- const ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9030
- const len3 = WASM_VECTOR_LEN;
10258
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10259
+ try {
10260
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10261
+ len0 = WASM_VECTOR_LEN;
10262
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10263
+ len1 = WASM_VECTOR_LEN;
10264
+ ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10265
+ len2 = WASM_VECTOR_LEN;
10266
+ ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10267
+ len3 = WASM_VECTOR_LEN;
10268
+ } catch (e) {
10269
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10270
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
10271
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10272
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10273
+ throw e;
10274
+ }
9031
10275
  const ret = wasm.smiles_to_pdbqt(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
9032
10276
  deferred5_0 = ret[0];
9033
10277
  deferred5_1 = ret[1];
@@ -9043,6 +10287,7 @@ export function smiles_to_pdbqt(smiles, coords_json, charges_json, name) {
9043
10287
  * contain exactly one value per graph atom, including explicit H. No defaults,
9044
10288
  * charge calculation, atom removal or ligand torsion preparation are applied.
9045
10289
  * AutoDock types retain the legacy heuristic, with unknown `X` types rejected.
10290
+ * Isotopes are refused; smiles_to_pdbqt_isotope_projection records their omission.
9046
10291
  * @param {string} smiles
9047
10292
  * @param {string} coords_json
9048
10293
  * @param {string} charges_json
@@ -9053,14 +10298,23 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
9053
10298
  let deferred6_0;
9054
10299
  let deferred6_1;
9055
10300
  try {
9056
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9057
- const len0 = WASM_VECTOR_LEN;
9058
- const ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9059
- const len1 = WASM_VECTOR_LEN;
9060
- const ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9061
- const len2 = WASM_VECTOR_LEN;
9062
- const ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9063
- const len3 = WASM_VECTOR_LEN;
10301
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10302
+ try {
10303
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10304
+ len0 = WASM_VECTOR_LEN;
10305
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10306
+ len1 = WASM_VECTOR_LEN;
10307
+ ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10308
+ len2 = WASM_VECTOR_LEN;
10309
+ ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10310
+ len3 = WASM_VECTOR_LEN;
10311
+ } catch (e) {
10312
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10313
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
10314
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10315
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10316
+ throw e;
10317
+ }
9064
10318
  const ret = wasm.smiles_to_pdbqt_checked(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
9065
10319
  var ptr5 = ret[0];
9066
10320
  var len5 = ret[1];
@@ -9076,6 +10330,53 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
9076
10330
  }
9077
10331
  }
9078
10332
 
10333
+ /**
10334
+ * Explicit isotope projection. Returns JSON {pdbqt, isotopes_omitted} with
10335
+ * zero-based source_atom_index, one-based pdbqt_serial, atomic_number and
10336
+ * mass_number for each label omitted from PDBQT. Retains all explicit atoms,
10337
+ * without H merging, charge recalculation or ligand torsion preparation.
10338
+ * @param {string} smiles
10339
+ * @param {string} coords_json
10340
+ * @param {string} charges_json
10341
+ * @param {string} name
10342
+ * @returns {string}
10343
+ */
10344
+ export function smiles_to_pdbqt_isotope_projection(smiles, coords_json, charges_json, name) {
10345
+ let deferred6_0;
10346
+ let deferred6_1;
10347
+ try {
10348
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10349
+ try {
10350
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10351
+ len0 = WASM_VECTOR_LEN;
10352
+ ptr1 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10353
+ len1 = WASM_VECTOR_LEN;
10354
+ ptr2 = passStringToWasm0(charges_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10355
+ len2 = WASM_VECTOR_LEN;
10356
+ ptr3 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10357
+ len3 = WASM_VECTOR_LEN;
10358
+ } catch (e) {
10359
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10360
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
10361
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10362
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10363
+ throw e;
10364
+ }
10365
+ const ret = wasm.smiles_to_pdbqt_isotope_projection(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
10366
+ var ptr5 = ret[0];
10367
+ var len5 = ret[1];
10368
+ if (ret[3]) {
10369
+ ptr5 = 0; len5 = 0;
10370
+ throw takeFromExternrefTable0(ret[2]);
10371
+ }
10372
+ deferred6_0 = ptr5;
10373
+ deferred6_1 = len5;
10374
+ return getStringFromWasm0(ptr5, len5);
10375
+ } finally {
10376
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
10377
+ }
10378
+ }
10379
+
9079
10380
  /**
9080
10381
  * Render a highlighted SVG from a SMILES string in one call.
9081
10382
  *
@@ -9085,8 +10386,8 @@ export function smiles_to_pdbqt_checked(smiles, coords_json, charges_json, name)
9085
10386
  *
9086
10387
  * Returns a JS error on SMILES parse failure.
9087
10388
  * @param {string} smiles
9088
- * @param {Uint32Array} atoms
9089
- * @param {Uint32Array} bonds
10389
+ * @param {Uint32Array | number[]} atoms
10390
+ * @param {Uint32Array | number[]} bonds
9090
10391
  * @param {string} color
9091
10392
  * @returns {string}
9092
10393
  */
@@ -9094,14 +10395,23 @@ export function smiles_to_svg_highlighted(smiles, atoms, bonds, color) {
9094
10395
  let deferred6_0;
9095
10396
  let deferred6_1;
9096
10397
  try {
9097
- const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9098
- const len0 = WASM_VECTOR_LEN;
9099
- const ptr1 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
9100
- const len1 = WASM_VECTOR_LEN;
9101
- const ptr2 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
9102
- const len2 = WASM_VECTOR_LEN;
9103
- const ptr3 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9104
- const len3 = WASM_VECTOR_LEN;
10398
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
10399
+ try {
10400
+ ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10401
+ len0 = WASM_VECTOR_LEN;
10402
+ ptr1 = passArray32ToWasm0(atoms, wasm.__wbindgen_malloc);
10403
+ len1 = WASM_VECTOR_LEN;
10404
+ ptr2 = passArray32ToWasm0(bonds, wasm.__wbindgen_malloc);
10405
+ len2 = WASM_VECTOR_LEN;
10406
+ ptr3 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10407
+ len3 = WASM_VECTOR_LEN;
10408
+ } catch (e) {
10409
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
10410
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 4, 4); }
10411
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 4, 4); }
10412
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10413
+ throw e;
10414
+ }
9105
10415
  const ret = wasm.smiles_to_svg_highlighted(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
9106
10416
  var ptr5 = ret[0];
9107
10417
  var len5 = ret[1];
@@ -9194,17 +10504,21 @@ export function standardize_smiles(smiles) {
9194
10504
  * @returns {string}
9195
10505
  */
9196
10506
  export function standardize_smiles_report_json(smiles, largest_fragment_only, neutralize_charges, remove_explicit_h, canonical_tautomer) {
9197
- let deferred2_0;
9198
- let deferred2_1;
10507
+ let deferred6_0;
10508
+ let deferred6_1;
9199
10509
  try {
10510
+ const val2 = +largest_fragment_only;
10511
+ const val3 = +neutralize_charges;
10512
+ const val4 = +remove_explicit_h;
10513
+ const val5 = +canonical_tautomer;
9200
10514
  const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9201
10515
  const len0 = WASM_VECTOR_LEN;
9202
- const ret = wasm.standardize_smiles_report_json(ptr0, len0, largest_fragment_only, neutralize_charges, remove_explicit_h, canonical_tautomer);
9203
- deferred2_0 = ret[0];
9204
- deferred2_1 = ret[1];
10516
+ const ret = wasm.standardize_smiles_report_json(ptr0, len0, val2, val3, val4, val5);
10517
+ deferred6_0 = ret[0];
10518
+ deferred6_1 = ret[1];
9205
10519
  return getStringFromWasm0(ret[0], ret[1]);
9206
10520
  } finally {
9207
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
10521
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
9208
10522
  }
9209
10523
  }
9210
10524
 
@@ -9383,10 +10697,17 @@ export function tanimoto_maccs(a, b) {
9383
10697
  * @returns {number}
9384
10698
  */
9385
10699
  export function tanimoto_mhfp_smiles(smi1, smi2) {
9386
- const ptr0 = passStringToWasm0(smi1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9387
- const len0 = WASM_VECTOR_LEN;
9388
- const ptr1 = passStringToWasm0(smi2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9389
- const len1 = WASM_VECTOR_LEN;
10700
+ let ptr0, len0, ptr1, len1;
10701
+ try {
10702
+ ptr0 = passStringToWasm0(smi1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10703
+ len0 = WASM_VECTOR_LEN;
10704
+ ptr1 = passStringToWasm0(smi2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10705
+ len1 = WASM_VECTOR_LEN;
10706
+ } catch (e) {
10707
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10708
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10709
+ throw e;
10710
+ }
9390
10711
  const ret = wasm.tanimoto_mhfp_smiles(ptr0, len0, ptr1, len1);
9391
10712
  if (ret[2]) {
9392
10713
  throw takeFromExternrefTable0(ret[1]);
@@ -9410,10 +10731,17 @@ export function tanimoto_row_json(query_smi, db_smiles_json) {
9410
10731
  let deferred3_0;
9411
10732
  let deferred3_1;
9412
10733
  try {
9413
- const ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9414
- const len0 = WASM_VECTOR_LEN;
9415
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9416
- const len1 = WASM_VECTOR_LEN;
10734
+ let ptr0, len0, ptr1, len1;
10735
+ try {
10736
+ ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10737
+ len0 = WASM_VECTOR_LEN;
10738
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10739
+ len1 = WASM_VECTOR_LEN;
10740
+ } catch (e) {
10741
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10742
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10743
+ throw e;
10744
+ }
9417
10745
  const ret = wasm.tanimoto_row_json(ptr0, len0, ptr1, len1);
9418
10746
  deferred3_0 = ret[0];
9419
10747
  deferred3_1 = ret[1];
@@ -9432,10 +10760,17 @@ export function tanimoto_row_json(query_smi, db_smiles_json) {
9432
10760
  * @returns {number}
9433
10761
  */
9434
10762
  export function tanimoto_smiles(smiles1, smiles2) {
9435
- const ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9436
- const len0 = WASM_VECTOR_LEN;
9437
- const ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9438
- const len1 = WASM_VECTOR_LEN;
10763
+ let ptr0, len0, ptr1, len1;
10764
+ try {
10765
+ ptr0 = passStringToWasm0(smiles1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10766
+ len0 = WASM_VECTOR_LEN;
10767
+ ptr1 = passStringToWasm0(smiles2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10768
+ len1 = WASM_VECTOR_LEN;
10769
+ } catch (e) {
10770
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10771
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10772
+ throw e;
10773
+ }
9439
10774
  const ret = wasm.tanimoto_smiles(ptr0, len0, ptr1, len1);
9440
10775
  if (ret[2]) {
9441
10776
  throw takeFromExternrefTable0(ret[1]);
@@ -9490,7 +10825,59 @@ export function tautomer_parent_json(mol, max_transforms, max_tautomers, timeout
9490
10825
  deferred1_1 = ret[1];
9491
10826
  return getStringFromWasm0(ret[0], ret[1]);
9492
10827
  } finally {
9493
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
10828
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
10829
+ }
10830
+ }
10831
+
10832
+ /**
10833
+ * Write an edited record, refusing unsupported keys rather than dropping them.
10834
+ * @param {string} json
10835
+ * @returns {string}
10836
+ */
10837
+ export function tinker_xyz_from_record_json(json) {
10838
+ let deferred3_0;
10839
+ let deferred3_1;
10840
+ try {
10841
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10842
+ const len0 = WASM_VECTOR_LEN;
10843
+ const ret = wasm.tinker_xyz_from_record_json(ptr0, len0);
10844
+ var ptr2 = ret[0];
10845
+ var len2 = ret[1];
10846
+ if (ret[3]) {
10847
+ ptr2 = 0; len2 = 0;
10848
+ throw takeFromExternrefTable0(ret[2]);
10849
+ }
10850
+ deferred3_0 = ptr2;
10851
+ deferred3_1 = len2;
10852
+ return getStringFromWasm0(ptr2, len2);
10853
+ } finally {
10854
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
10855
+ }
10856
+ }
10857
+
10858
+ /**
10859
+ * Read one Tinker XYZ frame. Names/types and declared adjacency remain opaque.
10860
+ * @param {string} text
10861
+ * @returns {string}
10862
+ */
10863
+ export function tinker_xyz_record_json(text) {
10864
+ let deferred3_0;
10865
+ let deferred3_1;
10866
+ try {
10867
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10868
+ const len0 = WASM_VECTOR_LEN;
10869
+ const ret = wasm.tinker_xyz_record_json(ptr0, len0);
10870
+ var ptr2 = ret[0];
10871
+ var len2 = ret[1];
10872
+ if (ret[3]) {
10873
+ ptr2 = 0; len2 = 0;
10874
+ throw takeFromExternrefTable0(ret[2]);
10875
+ }
10876
+ deferred3_0 = ptr2;
10877
+ deferred3_1 = len2;
10878
+ return getStringFromWasm0(ptr2, len2);
10879
+ } finally {
10880
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
9494
10881
  }
9495
10882
  }
9496
10883
 
@@ -9531,7 +10918,11 @@ export function to_cml(mol) {
9531
10918
  *
9532
10919
  * Returns a JS error if `coords_json`/`options_json` are malformed, if
9533
10920
  * `coords_json`'s length doesn't match `mol`'s atom count, or if a
9534
- * `properties` column's row count doesn't match it.
10921
+ * `properties` column's row count doesn't match it. Options must be an object
10922
+ * with only lattice/properties/info; duplicate keys and malformed values fail.
10923
+ * Nonfinite values, ambiguous/reserved names and invalid frame data fail before
10924
+ * output. Bare empty info values require explicit typed metadata encoding.
10925
+ * Molecular bonds, formal charges, isotope and stereo are not projected.
9535
10926
  * @param {MolHandle} mol
9536
10927
  * @param {string} coords_json
9537
10928
  * @param {string} options_json
@@ -9542,10 +10933,17 @@ export function to_extxyz_json(mol, coords_json, options_json) {
9542
10933
  let deferred4_1;
9543
10934
  try {
9544
10935
  _assertClass(mol, MolHandle);
9545
- const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9546
- const len0 = WASM_VECTOR_LEN;
9547
- const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9548
- const len1 = WASM_VECTOR_LEN;
10936
+ let ptr0, len0, ptr1, len1;
10937
+ try {
10938
+ ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10939
+ len0 = WASM_VECTOR_LEN;
10940
+ ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10941
+ len1 = WASM_VECTOR_LEN;
10942
+ } catch (e) {
10943
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
10944
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
10945
+ throw e;
10946
+ }
9549
10947
  const ret = wasm.to_extxyz_json(mol.__wbg_ptr, ptr0, len0, ptr1, len1);
9550
10948
  var ptr3 = ret[0];
9551
10949
  var len3 = ret[1];
@@ -9669,24 +11067,26 @@ export function to_moljson(mol) {
9669
11067
  * @returns {string}
9670
11068
  */
9671
11069
  export function to_qcschema_molecule_json(mol, coords_json, charge, multiplicity) {
9672
- let deferred3_0;
9673
- let deferred3_1;
11070
+ let deferred5_0;
11071
+ let deferred5_1;
9674
11072
  try {
9675
11073
  _assertClass(mol, MolHandle);
11074
+ const val2 = +charge;
11075
+ const val3 = BigInt.asIntN(64, multiplicity);
9676
11076
  const ptr0 = passStringToWasm0(coords_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9677
11077
  const len0 = WASM_VECTOR_LEN;
9678
- const ret = wasm.to_qcschema_molecule_json(mol.__wbg_ptr, ptr0, len0, charge, multiplicity);
9679
- var ptr2 = ret[0];
9680
- var len2 = ret[1];
11078
+ const ret = wasm.to_qcschema_molecule_json(mol.__wbg_ptr, ptr0, len0, val2, val3);
11079
+ var ptr4 = ret[0];
11080
+ var len4 = ret[1];
9681
11081
  if (ret[3]) {
9682
- ptr2 = 0; len2 = 0;
11082
+ ptr4 = 0; len4 = 0;
9683
11083
  throw takeFromExternrefTable0(ret[2]);
9684
11084
  }
9685
- deferred3_0 = ptr2;
9686
- deferred3_1 = len2;
9687
- return getStringFromWasm0(ptr2, len2);
11085
+ deferred5_0 = ptr4;
11086
+ deferred5_1 = len4;
11087
+ return getStringFromWasm0(ptr4, len4);
9688
11088
  } finally {
9689
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11089
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
9690
11090
  }
9691
11091
  }
9692
11092
 
@@ -9815,6 +11215,32 @@ export function validate_nmr_spectrum_json(json) {
9815
11215
  }
9816
11216
  }
9817
11217
 
11218
+ /**
11219
+ * Explicit checked binary64 Angstrom positions; raw parse/write is independent.
11220
+ * @param {string} text
11221
+ * @returns {string}
11222
+ */
11223
+ export function viewmol_positions_angstrom_json(text) {
11224
+ let deferred3_0;
11225
+ let deferred3_1;
11226
+ try {
11227
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11228
+ const len0 = WASM_VECTOR_LEN;
11229
+ const ret = wasm.viewmol_positions_angstrom_json(ptr0, len0);
11230
+ var ptr2 = ret[0];
11231
+ var len2 = ret[1];
11232
+ if (ret[3]) {
11233
+ ptr2 = 0; len2 = 0;
11234
+ throw takeFromExternrefTable0(ret[2]);
11235
+ }
11236
+ deferred3_0 = ptr2;
11237
+ deferred3_1 = len2;
11238
+ return getStringFromWasm0(ptr2, len2);
11239
+ } finally {
11240
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11241
+ }
11242
+ }
11243
+
9818
11244
  /**
9819
11245
  * Virtual screen a query SMILES against a database of SMILES using ECFP4 Tanimoto.
9820
11246
  *
@@ -9829,19 +11255,27 @@ export function validate_nmr_spectrum_json(json) {
9829
11255
  * @returns {string}
9830
11256
  */
9831
11257
  export function virtual_screen_ecfp4_json(query_smi, db_smiles_json, k) {
9832
- let deferred3_0;
9833
- let deferred3_1;
11258
+ let deferred4_0;
11259
+ let deferred4_1;
9834
11260
  try {
9835
- const ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9836
- const len0 = WASM_VECTOR_LEN;
9837
- const ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9838
- const len1 = WASM_VECTOR_LEN;
9839
- const ret = wasm.virtual_screen_ecfp4_json(ptr0, len0, ptr1, len1, k);
9840
- deferred3_0 = ret[0];
9841
- deferred3_1 = ret[1];
11261
+ const val3 = +k;
11262
+ let ptr0, len0, ptr1, len1;
11263
+ try {
11264
+ ptr0 = passStringToWasm0(query_smi, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11265
+ len0 = WASM_VECTOR_LEN;
11266
+ ptr1 = passStringToWasm0(db_smiles_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11267
+ len1 = WASM_VECTOR_LEN;
11268
+ } catch (e) {
11269
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
11270
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
11271
+ throw e;
11272
+ }
11273
+ const ret = wasm.virtual_screen_ecfp4_json(ptr0, len0, ptr1, len1, val3);
11274
+ deferred4_0 = ret[0];
11275
+ deferred4_1 = ret[1];
9842
11276
  return getStringFromWasm0(ret[0], ret[1]);
9843
11277
  } finally {
9844
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11278
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
9845
11279
  }
9846
11280
  }
9847
11281
 
@@ -9929,6 +11363,84 @@ export function write_cube_json(grid_json) {
9929
11363
  }
9930
11364
  }
9931
11365
 
11366
+ /**
11367
+ * Serialize validated edited fields; duplicate/unknown JSON keys refuse.
11368
+ * @param {string} json
11369
+ * @returns {string}
11370
+ */
11371
+ export function write_fract_from_json(json) {
11372
+ let deferred3_0;
11373
+ let deferred3_1;
11374
+ try {
11375
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11376
+ const len0 = WASM_VECTOR_LEN;
11377
+ const ret = wasm.write_fract_from_json(ptr0, len0);
11378
+ var ptr2 = ret[0];
11379
+ var len2 = ret[1];
11380
+ if (ret[3]) {
11381
+ ptr2 = 0; len2 = 0;
11382
+ throw takeFromExternrefTable0(ret[2]);
11383
+ }
11384
+ deferred3_0 = ptr2;
11385
+ deferred3_1 = len2;
11386
+ return getStringFromWasm0(ptr2, len2);
11387
+ } finally {
11388
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11389
+ }
11390
+ }
11391
+
11392
+ /**
11393
+ * Write current fields. Duplicate/unknown keys and unsupported semantics refuse.
11394
+ * @param {string} json
11395
+ * @returns {string}
11396
+ */
11397
+ export function write_gpr_from_json(json) {
11398
+ let deferred3_0;
11399
+ let deferred3_1;
11400
+ try {
11401
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11402
+ const len0 = WASM_VECTOR_LEN;
11403
+ const ret = wasm.write_gpr_from_json(ptr0, len0);
11404
+ var ptr2 = ret[0];
11405
+ var len2 = ret[1];
11406
+ if (ret[3]) {
11407
+ ptr2 = 0; len2 = 0;
11408
+ throw takeFromExternrefTable0(ret[2]);
11409
+ }
11410
+ deferred3_0 = ptr2;
11411
+ deferred3_1 = len2;
11412
+ return getStringFromWasm0(ptr2, len2);
11413
+ } finally {
11414
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11415
+ }
11416
+ }
11417
+
11418
+ /**
11419
+ * Write current fields without rescaling; unknown or duplicate keys refuse.
11420
+ * @param {string} text
11421
+ * @returns {string}
11422
+ */
11423
+ export function write_gromos96_from_json(text) {
11424
+ let deferred3_0;
11425
+ let deferred3_1;
11426
+ try {
11427
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11428
+ const len0 = WASM_VECTOR_LEN;
11429
+ const ret = wasm.write_gromos96_from_json(ptr0, len0);
11430
+ var ptr2 = ret[0];
11431
+ var len2 = ret[1];
11432
+ if (ret[3]) {
11433
+ ptr2 = 0; len2 = 0;
11434
+ throw takeFromExternrefTable0(ret[2]);
11435
+ }
11436
+ deferred3_0 = ptr2;
11437
+ deferred3_1 = len2;
11438
+ return getStringFromWasm0(ptr2, len2);
11439
+ } finally {
11440
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11441
+ }
11442
+ }
11443
+
9932
11444
  /**
9933
11445
  * Write a LAMMPS data file from the JSON shape [`lammps_data_to_json`]
9934
11446
  * returns.
@@ -10011,6 +11523,32 @@ export function write_lammps_trajectory_json(json) {
10011
11523
  }
10012
11524
  }
10013
11525
 
11526
+ /**
11527
+ * Write current fields without rescaling; unknown or duplicate keys refuse.
11528
+ * @param {string} text
11529
+ * @returns {string}
11530
+ */
11531
+ export function write_lpmd_from_json(text) {
11532
+ let deferred3_0;
11533
+ let deferred3_1;
11534
+ try {
11535
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11536
+ const len0 = WASM_VECTOR_LEN;
11537
+ const ret = wasm.write_lpmd_from_json(ptr0, len0);
11538
+ var ptr2 = ret[0];
11539
+ var len2 = ret[1];
11540
+ if (ret[3]) {
11541
+ ptr2 = 0; len2 = 0;
11542
+ throw takeFromExternrefTable0(ret[2]);
11543
+ }
11544
+ deferred3_0 = ptr2;
11545
+ deferred3_1 = len2;
11546
+ return getStringFromWasm0(ptr2, len2);
11547
+ } finally {
11548
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11549
+ }
11550
+ }
11551
+
10014
11552
  /**
10015
11553
  * Write an mmCIF file from atom records in the JSON shape
10016
11554
  * [`mmcif_to_json`]'s `"atoms"` array uses (a full record per atom, not
@@ -10020,6 +11558,8 @@ export function write_lammps_trajectory_json(json) {
10020
11558
  *
10021
11559
  * `cell_json`: `"null"` or `{"a":...,"b":...,"c":...,"alpha":...,"beta":...,"gamma":...}`.
10022
11560
  * `space_group`: pass `""` for none.
11561
+ * Finite numeric fields retain their binary64 values without fixed decimal
11562
+ * rounding. This does not retain original spelling or uncertainty suffixes.
10023
11563
  * @param {string} records_json
10024
11564
  * @param {string} cell_json
10025
11565
  * @param {string} space_group
@@ -10030,14 +11570,23 @@ export function write_mmcif_json(records_json, cell_json, space_group, data_bloc
10030
11570
  let deferred6_0;
10031
11571
  let deferred6_1;
10032
11572
  try {
10033
- const ptr0 = passStringToWasm0(records_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10034
- const len0 = WASM_VECTOR_LEN;
10035
- const ptr1 = passStringToWasm0(cell_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10036
- const len1 = WASM_VECTOR_LEN;
10037
- const ptr2 = passStringToWasm0(space_group, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10038
- const len2 = WASM_VECTOR_LEN;
10039
- const ptr3 = passStringToWasm0(data_block_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10040
- const len3 = WASM_VECTOR_LEN;
11573
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
11574
+ try {
11575
+ ptr0 = passStringToWasm0(records_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11576
+ len0 = WASM_VECTOR_LEN;
11577
+ ptr1 = passStringToWasm0(cell_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11578
+ len1 = WASM_VECTOR_LEN;
11579
+ ptr2 = passStringToWasm0(space_group, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11580
+ len2 = WASM_VECTOR_LEN;
11581
+ ptr3 = passStringToWasm0(data_block_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11582
+ len3 = WASM_VECTOR_LEN;
11583
+ } catch (e) {
11584
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
11585
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
11586
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
11587
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
11588
+ throw e;
11589
+ }
10041
11590
  const ret = wasm.write_mmcif_json(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
10042
11591
  var ptr5 = ret[0];
10043
11592
  var len5 = ret[1];
@@ -10141,6 +11690,35 @@ export function write_orca_input_json(json) {
10141
11690
  }
10142
11691
  }
10143
11692
 
11693
+ /**
11694
+ * Write represented ORCA input fields with exact finite Cartesian values.
11695
+ * Requires explicit fields, rejects unknown/duplicate JSON fields, unit
11696
+ * conflicts, %coords and any metadata that would change on structured reparse.
11697
+ * Accepts either kind or type coordinate tags, never both. No job validation.
11698
+ * @param {string} input_json
11699
+ * @returns {string}
11700
+ */
11701
+ export function write_orca_input_json_checked(input_json) {
11702
+ let deferred3_0;
11703
+ let deferred3_1;
11704
+ try {
11705
+ const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11706
+ const len0 = WASM_VECTOR_LEN;
11707
+ const ret = wasm.write_orca_input_json_checked(ptr0, len0);
11708
+ var ptr2 = ret[0];
11709
+ var len2 = ret[1];
11710
+ if (ret[3]) {
11711
+ ptr2 = 0; len2 = 0;
11712
+ throw takeFromExternrefTable0(ret[2]);
11713
+ }
11714
+ deferred3_0 = ptr2;
11715
+ deferred3_1 = len2;
11716
+ return getStringFromWasm0(ptr2, len2);
11717
+ } finally {
11718
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11719
+ }
11720
+ }
11721
+
10144
11722
  /**
10145
11723
  * Write a PQR file from atom records in the JSON shape [`pqr_to_json`]'s
10146
11724
  * `"atoms"` array uses. Each atom's `chain_id` independently controls
@@ -10221,6 +11799,58 @@ export function write_smiles(mol) {
10221
11799
  }
10222
11800
  }
10223
11801
 
11802
+ /**
11803
+ * Serialize validated edited fields; duplicate/unknown JSON keys refuse.
11804
+ * @param {string} json
11805
+ * @returns {string}
11806
+ */
11807
+ export function write_unixyz_from_json(json) {
11808
+ let deferred3_0;
11809
+ let deferred3_1;
11810
+ try {
11811
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11812
+ const len0 = WASM_VECTOR_LEN;
11813
+ const ret = wasm.write_unixyz_from_json(ptr0, len0);
11814
+ var ptr2 = ret[0];
11815
+ var len2 = ret[1];
11816
+ if (ret[3]) {
11817
+ ptr2 = 0; len2 = 0;
11818
+ throw takeFromExternrefTable0(ret[2]);
11819
+ }
11820
+ deferred3_0 = ptr2;
11821
+ deferred3_1 = len2;
11822
+ return getStringFromWasm0(ptr2, len2);
11823
+ } finally {
11824
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11825
+ }
11826
+ }
11827
+
11828
+ /**
11829
+ * Write current fields without rescaling; unknown or duplicate keys refuse.
11830
+ * @param {string} text
11831
+ * @returns {string}
11832
+ */
11833
+ export function write_viewmol_from_json(text) {
11834
+ let deferred3_0;
11835
+ let deferred3_1;
11836
+ try {
11837
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11838
+ const len0 = WASM_VECTOR_LEN;
11839
+ const ret = wasm.write_viewmol_from_json(ptr0, len0);
11840
+ var ptr2 = ret[0];
11841
+ var len2 = ret[1];
11842
+ if (ret[3]) {
11843
+ ptr2 = 0; len2 = 0;
11844
+ throw takeFromExternrefTable0(ret[2]);
11845
+ }
11846
+ deferred3_0 = ptr2;
11847
+ deferred3_1 = len2;
11848
+ return getStringFromWasm0(ptr2, len2);
11849
+ } finally {
11850
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11851
+ }
11852
+ }
11853
+
10224
11854
  /**
10225
11855
  * XLogP3 partition coefficient (alternative to Crippen LogP).
10226
11856
  * Returns JSON: `{"xlogp3": float}`.
@@ -10270,61 +11900,63 @@ export function xlogp3_per_atom_json(mol) {
10270
11900
  * @returns {string}
10271
11901
  */
10272
11902
  export function xyz_frames_batch_json(text, offset, batch_size) {
10273
- let deferred3_0;
10274
- let deferred3_1;
11903
+ let deferred5_0;
11904
+ let deferred5_1;
10275
11905
  try {
11906
+ const val2 = +offset;
11907
+ const val3 = +batch_size;
10276
11908
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10277
11909
  const len0 = WASM_VECTOR_LEN;
10278
- const ret = wasm.xyz_frames_batch_json(ptr0, len0, offset, batch_size);
10279
- var ptr2 = ret[0];
10280
- var len2 = ret[1];
11910
+ const ret = wasm.xyz_frames_batch_json(ptr0, len0, val2, val3);
11911
+ var ptr4 = ret[0];
11912
+ var len4 = ret[1];
10281
11913
  if (ret[3]) {
10282
- ptr2 = 0; len2 = 0;
11914
+ ptr4 = 0; len4 = 0;
10283
11915
  throw takeFromExternrefTable0(ret[2]);
10284
11916
  }
10285
- deferred3_0 = ptr2;
10286
- deferred3_1 = len2;
10287
- return getStringFromWasm0(ptr2, len2);
11917
+ deferred5_0 = ptr4;
11918
+ deferred5_1 = len4;
11919
+ return getStringFromWasm0(ptr4, len4);
10288
11920
  } finally {
10289
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
11921
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
10290
11922
  }
10291
11923
  }
10292
11924
  function __wbg_get_imports() {
10293
11925
  const import0 = {
10294
11926
  __proto__: null,
10295
- __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
11927
+ __wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
10296
11928
  const ret = arg0 === undefined;
10297
11929
  return ret;
10298
11930
  },
10299
- __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
11931
+ __wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
10300
11932
  const obj = arg1;
10301
11933
  const ret = typeof(obj) === 'number' ? obj : undefined;
10302
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
10303
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
11934
+ getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
11935
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
10304
11936
  },
10305
- __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
11937
+ __wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
10306
11938
  const obj = arg1;
10307
11939
  const ret = typeof(obj) === 'string' ? obj : undefined;
10308
11940
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10309
11941
  var len1 = WASM_VECTOR_LEN;
10310
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
10311
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
11942
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
11943
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
10312
11944
  },
10313
- __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
11945
+ __wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
10314
11946
  throw new Error(getStringFromWasm0(arg0, arg1));
10315
11947
  },
10316
- __wbg_error_c9cf3fc2064683a9: function(arg0) {
11948
+ __wbg_error_d1fc0193610e0e39: function(arg0) {
10317
11949
  console.error(arg0);
10318
11950
  },
10319
11951
  __wbg_molhandle_new: function(arg0) {
10320
11952
  const ret = MolHandle.__wrap(arg0);
10321
11953
  return ret;
10322
11954
  },
10323
- __wbg_new_from_slice_37a3c3a194266cb8: function(arg0, arg1) {
11955
+ __wbg_new_from_slice_3512352010266e02: function(arg0, arg1) {
10324
11956
  const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
10325
11957
  return ret;
10326
11958
  },
10327
- __wbg_new_from_slice_f545fd22ddc142b8: function(arg0, arg1) {
11959
+ __wbg_new_from_slice_aaf85a9746711968: function(arg0, arg1) {
10328
11960
  const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
10329
11961
  return ret;
10330
11962
  },
@@ -10332,24 +11964,24 @@ function __wbg_get_imports() {
10332
11964
  const ret = arg0.now();
10333
11965
  return ret;
10334
11966
  },
10335
- __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
11967
+ __wbg_performance_7e4e4494fdc9d07a: function(arg0) {
10336
11968
  const ret = arg0.performance;
10337
11969
  return ret;
10338
11970
  },
10339
- __wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
10340
- const ret = typeof global === 'undefined' ? null : global;
11971
+ __wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc: function() {
11972
+ const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
10341
11973
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10342
11974
  },
10343
- __wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
10344
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
11975
+ __wbg_static_accessor_GLOBAL_e4293fb22cbe77da: function() {
11976
+ const ret = typeof global === 'undefined' ? undefined : global;
10345
11977
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10346
11978
  },
10347
- __wbg_static_accessor_SELF_0b583911f537483a: function() {
10348
- const ret = typeof self === 'undefined' ? null : self;
11979
+ __wbg_static_accessor_SELF_53bb20457401453d: function() {
11980
+ const ret = typeof self === 'undefined' ? undefined : self;
10349
11981
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10350
11982
  },
10351
- __wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
10352
- const ret = typeof window === 'undefined' ? null : window;
11983
+ __wbg_static_accessor_WINDOW_b5e0810bfecb7feb: function() {
11984
+ const ret = typeof window === 'undefined' ? undefined : window;
10353
11985
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
10354
11986
  },
10355
11987
  __wbindgen_generic_0000000000000001: function(arg0) {
@@ -10364,12 +11996,11 @@ function __wbg_get_imports() {
10364
11996
  },
10365
11997
  __wbindgen_init_externref_table: function() {
10366
11998
  const table = wasm.__wbindgen_externrefs;
10367
- const offset = table.grow(4);
10368
11999
  table.set(0, undefined);
10369
- table.set(offset + 0, undefined);
10370
- table.set(offset + 1, null);
10371
- table.set(offset + 2, true);
10372
- table.set(offset + 3, false);
12000
+ table.set(1024, undefined);
12001
+ table.set(1025, null);
12002
+ table.set(1026, true);
12003
+ table.set(1027, false);
10373
12004
  },
10374
12005
  };
10375
12006
  return {
@@ -10461,7 +12092,8 @@ function getFloat64ArrayMemory0() {
10461
12092
  }
10462
12093
 
10463
12094
  function getStringFromWasm0(ptr, len) {
10464
- return decodeText(ptr >>> 0, len);
12095
+ ptr = ptr >>> 0;
12096
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
10465
12097
  }
10466
12098
 
10467
12099
  let cachedUint32ArrayMemory0 = null;
@@ -10541,18 +12173,18 @@ function takeFromExternrefTable0(idx) {
10541
12173
  return value;
10542
12174
  }
10543
12175
 
10544
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
12176
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
10545
12177
  cachedTextDecoder.decode();
10546
12178
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
10547
12179
  let numBytesDecoded = 0;
10548
- function decodeText(ptr, len) {
10549
- numBytesDecoded += len;
12180
+ function decodeText(bytes) {
12181
+ numBytesDecoded += bytes.length;
10550
12182
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
10551
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
12183
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
10552
12184
  cachedTextDecoder.decode();
10553
- numBytesDecoded = len;
12185
+ numBytesDecoded = bytes.length;
10554
12186
  }
10555
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
12187
+ return cachedTextDecoder.decode(bytes);
10556
12188
  }
10557
12189
 
10558
12190
  const cachedTextEncoder = new TextEncoder();
@@ -10642,9 +12274,17 @@ function initSync(module) {
10642
12274
  return __wbg_finalize_init(instance, module);
10643
12275
  }
10644
12276
 
12277
+ let __wbg_init_promise;
10645
12278
  async function __wbg_init(module_or_path) {
10646
12279
  if (wasm !== undefined) return wasm;
12280
+ if (__wbg_init_promise === undefined) {
12281
+ __wbg_init_promise = __wbg_init_once(module_or_path);
12282
+ __wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
12283
+ }
12284
+ return __wbg_init_promise;
12285
+ }
10647
12286
 
12287
+ async function __wbg_init_once(module_or_path) {
10648
12288
 
10649
12289
  if (module_or_path !== undefined) {
10650
12290
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {