@wireapp/core-crypto 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -74,28 +74,6 @@ function getStringFromWasm0(ptr, len) {
74
74
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
75
75
  }
76
76
 
77
- function isLikeNone(x) {
78
- return x === undefined || x === null;
79
- }
80
-
81
- let cachedFloat64Memory0 = new Float64Array();
82
-
83
- function getFloat64Memory0() {
84
- if (cachedFloat64Memory0.byteLength === 0) {
85
- cachedFloat64Memory0 = new Float64Array(wasm$1.memory.buffer);
86
- }
87
- return cachedFloat64Memory0;
88
- }
89
-
90
- let cachedInt32Memory0 = new Int32Array();
91
-
92
- function getInt32Memory0() {
93
- if (cachedInt32Memory0.byteLength === 0) {
94
- cachedInt32Memory0 = new Int32Array(wasm$1.memory.buffer);
95
- }
96
- return cachedInt32Memory0;
97
- }
98
-
99
77
  let WASM_VECTOR_LEN = 0;
100
78
 
101
79
  const cachedTextEncoder = new TextEncoder('utf-8');
@@ -151,6 +129,28 @@ function passStringToWasm0(arg, malloc, realloc) {
151
129
  return ptr;
152
130
  }
153
131
 
132
+ function isLikeNone(x) {
133
+ return x === undefined || x === null;
134
+ }
135
+
136
+ let cachedInt32Memory0 = new Int32Array();
137
+
138
+ function getInt32Memory0() {
139
+ if (cachedInt32Memory0.byteLength === 0) {
140
+ cachedInt32Memory0 = new Int32Array(wasm$1.memory.buffer);
141
+ }
142
+ return cachedInt32Memory0;
143
+ }
144
+
145
+ let cachedFloat64Memory0 = new Float64Array();
146
+
147
+ function getFloat64Memory0() {
148
+ if (cachedFloat64Memory0.byteLength === 0) {
149
+ cachedFloat64Memory0 = new Float64Array(wasm$1.memory.buffer);
150
+ }
151
+ return cachedFloat64Memory0;
152
+ }
153
+
154
154
  function debugString(val) {
155
155
  // primitive types
156
156
  const type = typeof val;
@@ -243,7 +243,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
243
243
  function __wbg_adapter_40(arg0, arg1, arg2) {
244
244
  try {
245
245
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
246
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbae3a5a03bcd9ebb(retptr, arg0, arg1, addHeapObject(arg2));
246
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9a15da7f71febc51(retptr, arg0, arg1, addHeapObject(arg2));
247
247
  var r0 = getInt32Memory0()[retptr / 4 + 0];
248
248
  var r1 = getInt32Memory0()[retptr / 4 + 1];
249
249
  if (r1) {
@@ -255,7 +255,7 @@ function __wbg_adapter_40(arg0, arg1, arg2) {
255
255
  }
256
256
 
257
257
  function __wbg_adapter_43(arg0, arg1, arg2) {
258
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h04f9c855c75e5606(arg0, arg1, addHeapObject(arg2));
258
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hef97d77a2199c9e8(arg0, arg1, addHeapObject(arg2));
259
259
  }
260
260
 
261
261
  /**
@@ -319,7 +319,7 @@ function getArrayU8FromWasm0(ptr, len) {
319
319
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
320
320
  }
321
321
  function __wbg_adapter_176(arg0, arg1, arg2, arg3) {
322
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h4791cbe418449d5d(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
322
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__hc9af8652362195d0(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
323
323
  }
324
324
 
325
325
  /**
@@ -956,10 +956,10 @@ class CoreCryptoWasmCallbacks {
956
956
  }
957
957
  /**
958
958
  * @param {Function} authorize
959
- * @param {Function} is_user_in_group
959
+ * @param {Function} client_id_belongs_to_one_of
960
960
  */
961
- constructor(authorize, is_user_in_group) {
962
- const ret = wasm$1.corecryptowasmcallbacks_new(addHeapObject(authorize), addHeapObject(is_user_in_group));
961
+ constructor(authorize, client_id_belongs_to_one_of) {
962
+ const ret = wasm$1.corecryptowasmcallbacks_new(addHeapObject(authorize), addHeapObject(client_id_belongs_to_one_of));
963
963
  return CoreCryptoWasmCallbacks.__wrap(ret);
964
964
  }
965
965
  }
@@ -1236,26 +1236,23 @@ function getImports() {
1236
1236
  const ret = typeof(val) === 'object' && val !== null;
1237
1237
  return ret;
1238
1238
  };
1239
- imports.wbg.__wbg_new_e6a9fecc2bf26696 = function() {
1239
+ imports.wbg.__wbg_new_0b9bfdd97583284e = function() {
1240
1240
  const ret = new Object();
1241
1241
  return addHeapObject(ret);
1242
1242
  };
1243
- imports.wbg.__wbg_set_e93b31d47b90bff6 = function(arg0, arg1, arg2) {
1244
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1245
- };
1246
1243
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1247
1244
  const ret = new Error(getStringFromWasm0(arg0, arg1));
1248
1245
  return addHeapObject(ret);
1249
1246
  };
1250
- imports.wbg.__wbg_new0_adda2d4bcb124f0a = function() {
1247
+ imports.wbg.__wbg_new0_a57059d72c5b7aee = function() {
1251
1248
  const ret = new Date();
1252
1249
  return addHeapObject(ret);
1253
1250
  };
1254
- imports.wbg.__wbg_getTime_58b0bdbebd4ef11d = function(arg0) {
1251
+ imports.wbg.__wbg_getTime_cb82adb2556ed13e = function(arg0) {
1255
1252
  const ret = getObject(arg0).getTime();
1256
1253
  return ret;
1257
1254
  };
1258
- imports.wbg.__wbg_new_cda198d9dbc6d7ea = function(arg0) {
1255
+ imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) {
1259
1256
  const ret = new Uint8Array(getObject(arg0));
1260
1257
  return addHeapObject(ret);
1261
1258
  };
@@ -1267,32 +1264,28 @@ function getImports() {
1267
1264
  const ret = arg0;
1268
1265
  return addHeapObject(ret);
1269
1266
  };
1270
- imports.wbg.__wbindgen_bigint_new = function(arg0, arg1) {
1271
- const ret = BigInt(getStringFromWasm0(arg0, arg1));
1267
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1268
+ const ret = BigInt.asUintN(64, arg0);
1272
1269
  return addHeapObject(ret);
1273
1270
  };
1274
1271
  imports.wbg.__wbg_decryptedmessage_new = function(arg0) {
1275
1272
  const ret = DecryptedMessage.__wrap(arg0);
1276
1273
  return addHeapObject(ret);
1277
1274
  };
1278
- imports.wbg.__wbg_new_ee1a3da85465d621 = function() {
1275
+ imports.wbg.__wbg_new_1d9a920c6bfc44a8 = function() {
1279
1276
  const ret = new Array();
1280
1277
  return addHeapObject(ret);
1281
1278
  };
1282
- imports.wbg.__wbg_push_0bc7fce4a139a883 = function(arg0, arg1) {
1279
+ imports.wbg.__wbg_push_740e4b286702d964 = function(arg0, arg1) {
1283
1280
  const ret = getObject(arg0).push(getObject(arg1));
1284
1281
  return ret;
1285
1282
  };
1286
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1287
- const ret = getStringFromWasm0(arg0, arg1);
1288
- return addHeapObject(ret);
1289
- };
1290
1283
  imports.wbg.__wbindgen_boolean_get = function(arg0) {
1291
1284
  const v = getObject(arg0);
1292
1285
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1293
1286
  return ret;
1294
1287
  };
1295
- imports.wbg.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
1288
+ imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
1296
1289
  try {
1297
1290
  var state0 = {a: arg0, b: arg1};
1298
1291
  var cb0 = (arg0, arg1) => {
@@ -1314,23 +1307,34 @@ function getImports() {
1314
1307
  const ret = ProposalBundle.__wrap(arg0);
1315
1308
  return addHeapObject(ret);
1316
1309
  };
1317
- imports.wbg.__wbg_get_093fe3cdafaf8976 = function(arg0, arg1) {
1310
+ imports.wbg.__wbg_set_c943d600fa71e4dd = function(arg0, arg1, arg2) {
1311
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1312
+ };
1313
+ imports.wbg.__wbg_get_2268d91a19a98b92 = function(arg0, arg1) {
1318
1314
  const ret = getObject(arg0)[takeObject(arg1)];
1319
1315
  return addHeapObject(ret);
1320
1316
  };
1321
- imports.wbg.__wbg_isArray_a1a8c3a8ac24bdf1 = function(arg0) {
1317
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1318
+ const obj = getObject(arg1);
1319
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1320
+ var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1321
+ var len0 = WASM_VECTOR_LEN;
1322
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
1323
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
1324
+ };
1325
+ imports.wbg.__wbg_isArray_27c46c67f498e15d = function(arg0) {
1322
1326
  const ret = Array.isArray(getObject(arg0));
1323
1327
  return ret;
1324
1328
  };
1325
- imports.wbg.__wbg_length_a73bfd4c96dd97ef = function(arg0) {
1329
+ imports.wbg.__wbg_length_6e3bbe7c8bd4dbd8 = function(arg0) {
1326
1330
  const ret = getObject(arg0).length;
1327
1331
  return ret;
1328
1332
  };
1329
- imports.wbg.__wbg_iterator_22ed2b976832ff0c = function() {
1333
+ imports.wbg.__wbg_iterator_6f9d4f28845f426c = function() {
1330
1334
  const ret = Symbol.iterator;
1331
1335
  return addHeapObject(ret);
1332
1336
  };
1333
- imports.wbg.__wbg_get_72332cd2bc57924c = function() { return handleError(function (arg0, arg1) {
1337
+ imports.wbg.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
1334
1338
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1335
1339
  return addHeapObject(ret);
1336
1340
  }, arguments) };
@@ -1338,23 +1342,23 @@ function getImports() {
1338
1342
  const ret = typeof(getObject(arg0)) === 'function';
1339
1343
  return ret;
1340
1344
  };
1341
- imports.wbg.__wbg_call_33d7bcddbbfa394a = function() { return handleError(function (arg0, arg1) {
1345
+ imports.wbg.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) {
1342
1346
  const ret = getObject(arg0).call(getObject(arg1));
1343
1347
  return addHeapObject(ret);
1344
1348
  }, arguments) };
1345
- imports.wbg.__wbg_next_726d1c2255989269 = function(arg0) {
1349
+ imports.wbg.__wbg_next_579e583d33566a86 = function(arg0) {
1346
1350
  const ret = getObject(arg0).next;
1347
1351
  return addHeapObject(ret);
1348
1352
  };
1349
- imports.wbg.__wbg_next_3d0c4cc33e7418c9 = function() { return handleError(function (arg0) {
1353
+ imports.wbg.__wbg_next_aaef7c8aa5e212ac = function() { return handleError(function (arg0) {
1350
1354
  const ret = getObject(arg0).next();
1351
1355
  return addHeapObject(ret);
1352
1356
  }, arguments) };
1353
- imports.wbg.__wbg_done_e5655b169bb04f60 = function(arg0) {
1357
+ imports.wbg.__wbg_done_1b73b0672e15f234 = function(arg0) {
1354
1358
  const ret = getObject(arg0).done;
1355
1359
  return ret;
1356
1360
  };
1357
- imports.wbg.__wbg_value_8f901bca1014f843 = function(arg0) {
1361
+ imports.wbg.__wbg_value_1ccc36bc03462d71 = function(arg0) {
1358
1362
  const ret = getObject(arg0).value;
1359
1363
  return addHeapObject(ret);
1360
1364
  };
@@ -1364,22 +1368,14 @@ function getImports() {
1364
1368
  getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1365
1369
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1366
1370
  };
1367
- imports.wbg.__wbg_isSafeInteger_f6dd91807e9c4d35 = function(arg0) {
1371
+ imports.wbg.__wbg_isSafeInteger_dfa0593e8d7ac35a = function(arg0) {
1368
1372
  const ret = Number.isSafeInteger(getObject(arg0));
1369
1373
  return ret;
1370
1374
  };
1371
- imports.wbg.__wbg_get_ad41fee29b7e0f53 = function(arg0, arg1) {
1375
+ imports.wbg.__wbg_get_57245cc7d7c7619d = function(arg0, arg1) {
1372
1376
  const ret = getObject(arg0)[arg1 >>> 0];
1373
1377
  return addHeapObject(ret);
1374
1378
  };
1375
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1376
- const obj = getObject(arg1);
1377
- const ret = typeof(obj) === 'string' ? obj : undefined;
1378
- var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1379
- var len0 = WASM_VECTOR_LEN;
1380
- getInt32Memory0()[arg0 / 4 + 1] = len0;
1381
- getInt32Memory0()[arg0 / 4 + 0] = ptr0;
1382
- };
1383
1379
  imports.wbg.__wbindgen_is_null = function(arg0) {
1384
1380
  const ret = getObject(arg0) === null;
1385
1381
  return ret;
@@ -1388,18 +1384,22 @@ function getImports() {
1388
1384
  const ret = getObject(arg0) === undefined;
1389
1385
  return ret;
1390
1386
  };
1391
- imports.wbg.__wbg_name_f232931b09239ddb = function(arg0, arg1) {
1387
+ imports.wbg.__wbg_name_ebb75bfad2bf6938 = function(arg0, arg1) {
1392
1388
  const ret = getObject(arg1).name;
1393
1389
  const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1394
1390
  const len0 = WASM_VECTOR_LEN;
1395
1391
  getInt32Memory0()[arg0 / 4 + 1] = len0;
1396
1392
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
1397
1393
  };
1398
- imports.wbg.__wbg_transaction_0dcffc72158c7b6f = function() { return handleError(function (arg0, arg1, arg2) {
1394
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1395
+ const ret = getStringFromWasm0(arg0, arg1);
1396
+ return addHeapObject(ret);
1397
+ };
1398
+ imports.wbg.__wbg_transaction_83b53b72aa710599 = function() { return handleError(function (arg0, arg1, arg2) {
1399
1399
  const ret = getObject(arg0).transaction(getObject(arg1), takeObject(arg2));
1400
1400
  return addHeapObject(ret);
1401
1401
  }, arguments) };
1402
- imports.wbg.__wbg_set_64cc39858b2ec3f1 = function(arg0, arg1, arg2) {
1402
+ imports.wbg.__wbg_set_a68214f35c417fa9 = function(arg0, arg1, arg2) {
1403
1403
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1404
1404
  };
1405
1405
  imports.wbg.__wbindgen_cb_drop = function(arg0) {
@@ -1411,106 +1411,106 @@ function getImports() {
1411
1411
  const ret = false;
1412
1412
  return ret;
1413
1413
  };
1414
- imports.wbg.__wbg_setonsuccess_bb91afe1f8110021 = function(arg0, arg1) {
1414
+ imports.wbg.__wbg_openCursor_e036069f0e326708 = function() { return handleError(function (arg0, arg1) {
1415
+ const ret = getObject(arg0).openCursor(getObject(arg1));
1416
+ return addHeapObject(ret);
1417
+ }, arguments) };
1418
+ imports.wbg.__wbg_openCursor_f055654a98eeab7f = function() { return handleError(function (arg0) {
1419
+ const ret = getObject(arg0).openCursor();
1420
+ return addHeapObject(ret);
1421
+ }, arguments) };
1422
+ imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
1415
1423
  getObject(arg0).onsuccess = getObject(arg1);
1416
1424
  };
1417
- imports.wbg.__wbg_setonerror_db491b84dd45e918 = function(arg0, arg1) {
1425
+ imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
1426
+ const ret = getObject(arg0).delete(getObject(arg1));
1427
+ return addHeapObject(ret);
1428
+ }, arguments) };
1429
+ imports.wbg.__wbg_setonerror_d5771cc5bf9ea74c = function(arg0, arg1) {
1418
1430
  getObject(arg0).onerror = getObject(arg1);
1419
1431
  };
1420
- imports.wbg.__wbg_commit_6211fe2744b83edc = function() { return handleError(function (arg0) {
1432
+ imports.wbg.__wbg_commit_73ecc83e291e455b = function() { return handleError(function (arg0) {
1421
1433
  getObject(arg0).commit();
1422
1434
  }, arguments) };
1423
- imports.wbg.__wbg_setoncomplete_8bfbade4ed628fd0 = function(arg0, arg1) {
1435
+ imports.wbg.__wbg_setoncomplete_3e57a8cec8327f66 = function(arg0, arg1) {
1424
1436
  getObject(arg0).oncomplete = getObject(arg1);
1425
1437
  };
1426
- imports.wbg.__wbg_setonerror_9d842115702fd223 = function(arg0, arg1) {
1438
+ imports.wbg.__wbg_setonerror_00051c0213f27b2c = function(arg0, arg1) {
1427
1439
  getObject(arg0).onerror = getObject(arg1);
1428
1440
  };
1429
- imports.wbg.__wbg_put_e193e5c9c96e937f = function() { return handleError(function (arg0, arg1, arg2) {
1441
+ imports.wbg.__wbg_put_84e7fc93eee27b28 = function() { return handleError(function (arg0, arg1, arg2) {
1430
1442
  const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
1431
1443
  return addHeapObject(ret);
1432
1444
  }, arguments) };
1433
- imports.wbg.__wbg_put_a727d1fdb5788ec1 = function() { return handleError(function (arg0, arg1) {
1445
+ imports.wbg.__wbg_put_f2763b05a07f3233 = function() { return handleError(function (arg0, arg1) {
1434
1446
  const ret = getObject(arg0).put(getObject(arg1));
1435
1447
  return addHeapObject(ret);
1436
1448
  }, arguments) };
1437
- imports.wbg.__wbg_delete_1ca98818fdc40291 = function() { return handleError(function (arg0, arg1) {
1438
- const ret = getObject(arg0).delete(getObject(arg1));
1449
+ imports.wbg.__wbg_get_3c3e41997e95952c = function() { return handleError(function (arg0, arg1) {
1450
+ const ret = getObject(arg0).get(getObject(arg1));
1439
1451
  return addHeapObject(ret);
1440
1452
  }, arguments) };
1441
- imports.wbg.__wbg_deleteDatabase_7b98d08298856363 = function() { return handleError(function (arg0, arg1, arg2) {
1442
- const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1453
+ imports.wbg.__wbg_openCursor_2262d905dc81d11b = function() { return handleError(function (arg0) {
1454
+ const ret = getObject(arg0).openCursor();
1443
1455
  return addHeapObject(ret);
1444
1456
  }, arguments) };
1445
- imports.wbg.__wbg_close_87495affacd7f79d = function(arg0) {
1446
- getObject(arg0).close();
1447
- };
1448
- imports.wbg.__wbg_openCursor_4292a52d0e6d4246 = function() { return handleError(function (arg0, arg1) {
1457
+ imports.wbg.__wbg_openCursor_e1660ef8b1f4662f = function() { return handleError(function (arg0, arg1) {
1449
1458
  const ret = getObject(arg0).openCursor(getObject(arg1));
1450
1459
  return addHeapObject(ret);
1451
1460
  }, arguments) };
1452
- imports.wbg.__wbg_openCursor_10a7a7a41fce054c = function() { return handleError(function (arg0) {
1453
- const ret = getObject(arg0).openCursor();
1454
- return addHeapObject(ret);
1455
- }, arguments) };
1456
- imports.wbg.__wbg_count_6f4c35312ff0234d = function() { return handleError(function (arg0) {
1461
+ imports.wbg.__wbg_count_b0e88953a0ea909c = function() { return handleError(function (arg0) {
1457
1462
  const ret = getObject(arg0).count();
1458
1463
  return addHeapObject(ret);
1459
1464
  }, arguments) };
1460
- imports.wbg.__wbg_count_ea5300005a5f227d = function() { return handleError(function (arg0, arg1) {
1465
+ imports.wbg.__wbg_count_46eda68a16dbe30e = function() { return handleError(function (arg0, arg1) {
1461
1466
  const ret = getObject(arg0).count(getObject(arg1));
1462
1467
  return addHeapObject(ret);
1463
1468
  }, arguments) };
1464
- imports.wbg.__wbg_get_28f9ffc7eb5802f3 = function() { return handleError(function (arg0, arg1) {
1465
- const ret = getObject(arg0).get(getObject(arg1));
1466
- return addHeapObject(ret);
1467
- }, arguments) };
1468
- imports.wbg.__wbg_get_a06b4198f86b037d = function() { return handleError(function (arg0, arg1) {
1469
+ imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
1469
1470
  const ret = getObject(arg0).get(getObject(arg1));
1470
1471
  return addHeapObject(ret);
1471
1472
  }, arguments) };
1472
- imports.wbg.__wbg_openCursor_a9656bd0901e39c0 = function() { return handleError(function (arg0) {
1473
- const ret = getObject(arg0).openCursor();
1474
- return addHeapObject(ret);
1475
- }, arguments) };
1476
- imports.wbg.__wbg_openCursor_2cfe2e04de0b6b91 = function() { return handleError(function (arg0, arg1) {
1477
- const ret = getObject(arg0).openCursor(getObject(arg1));
1473
+ imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
1474
+ getObject(arg0).close();
1475
+ };
1476
+ imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
1477
+ const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1478
1478
  return addHeapObject(ret);
1479
1479
  }, arguments) };
1480
- imports.wbg.__wbg_open_2a1e9120d3d8897d = function() { return handleError(function (arg0, arg1, arg2) {
1480
+ imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
1481
1481
  const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
1482
1482
  return addHeapObject(ret);
1483
1483
  }, arguments) };
1484
- imports.wbg.__wbg_open_3384efa97bde264f = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1484
+ imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1485
1485
  const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
1486
1486
  return addHeapObject(ret);
1487
1487
  }, arguments) };
1488
- imports.wbg.__wbg_setonupgradeneeded_8956d6214819f478 = function(arg0, arg1) {
1488
+ imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
1489
1489
  getObject(arg0).onupgradeneeded = getObject(arg1);
1490
1490
  };
1491
- imports.wbg.__wbg_randomFillSync_91e2b39becca6147 = function() { return handleError(function (arg0, arg1, arg2) {
1491
+ imports.wbg.__wbg_randomFillSync_065afffde01daa66 = function() { return handleError(function (arg0, arg1, arg2) {
1492
1492
  getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
1493
1493
  }, arguments) };
1494
- imports.wbg.__wbg_subarray_270ff8dd5582c1ac = function(arg0, arg1, arg2) {
1494
+ imports.wbg.__wbg_subarray_58ad4efbb5bcb886 = function(arg0, arg1, arg2) {
1495
1495
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1496
1496
  return addHeapObject(ret);
1497
1497
  };
1498
- imports.wbg.__wbg_getRandomValues_b14734aa289bc356 = function() { return handleError(function (arg0, arg1) {
1498
+ imports.wbg.__wbg_getRandomValues_b99eec4244a475bb = function() { return handleError(function (arg0, arg1) {
1499
1499
  getObject(arg0).getRandomValues(getObject(arg1));
1500
1500
  }, arguments) };
1501
- imports.wbg.__wbg_length_51f19f73d6d9eff3 = function(arg0) {
1501
+ imports.wbg.__wbg_length_9e1ae1900cb0fbd5 = function(arg0) {
1502
1502
  const ret = getObject(arg0).length;
1503
1503
  return ret;
1504
1504
  };
1505
- imports.wbg.__wbg_process_e56fd54cf6319b6c = function(arg0) {
1505
+ imports.wbg.__wbg_process_0cc2ada8524d6f83 = function(arg0) {
1506
1506
  const ret = getObject(arg0).process;
1507
1507
  return addHeapObject(ret);
1508
1508
  };
1509
- imports.wbg.__wbg_versions_77e21455908dad33 = function(arg0) {
1509
+ imports.wbg.__wbg_versions_c11acceab27a6c87 = function(arg0) {
1510
1510
  const ret = getObject(arg0).versions;
1511
1511
  return addHeapObject(ret);
1512
1512
  };
1513
- imports.wbg.__wbg_node_0dd25d832e4785d5 = function(arg0) {
1513
+ imports.wbg.__wbg_node_7ff1ce49caf23815 = function(arg0) {
1514
1514
  const ret = getObject(arg0).node;
1515
1515
  return addHeapObject(ret);
1516
1516
  };
@@ -1518,55 +1518,55 @@ function getImports() {
1518
1518
  const ret = typeof(getObject(arg0)) === 'string';
1519
1519
  return ret;
1520
1520
  };
1521
- imports.wbg.__wbg_static_accessor_NODE_MODULE_26b231378c1be7dd = function() {
1521
+ imports.wbg.__wbg_static_accessor_NODE_MODULE_cf6401cc1091279e = function() {
1522
1522
  const ret = module;
1523
1523
  return addHeapObject(ret);
1524
1524
  };
1525
- imports.wbg.__wbg_require_0db1598d9ccecb30 = function() { return handleError(function (arg0, arg1, arg2) {
1525
+ imports.wbg.__wbg_require_a746e79b322b9336 = function() { return handleError(function (arg0, arg1, arg2) {
1526
1526
  const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
1527
1527
  return addHeapObject(ret);
1528
1528
  }, arguments) };
1529
- imports.wbg.__wbg_crypto_b95d7173266618a9 = function(arg0) {
1529
+ imports.wbg.__wbg_crypto_2036bed7c44c25e7 = function(arg0) {
1530
1530
  const ret = getObject(arg0).crypto;
1531
1531
  return addHeapObject(ret);
1532
1532
  };
1533
- imports.wbg.__wbg_msCrypto_5a86d77a66230f81 = function(arg0) {
1533
+ imports.wbg.__wbg_msCrypto_a21fc88caf1ecdc8 = function(arg0) {
1534
1534
  const ret = getObject(arg0).msCrypto;
1535
1535
  return addHeapObject(ret);
1536
1536
  };
1537
- imports.wbg.__wbg_newwithlength_66e5530e7079ea1b = function(arg0) {
1537
+ imports.wbg.__wbg_newwithlength_f5933855e4f48a19 = function(arg0) {
1538
1538
  const ret = new Uint8Array(arg0 >>> 0);
1539
1539
  return addHeapObject(ret);
1540
1540
  };
1541
- imports.wbg.__wbg_self_fd00a1ef86d1b2ed = function() { return handleError(function () {
1541
+ imports.wbg.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () {
1542
1542
  const ret = self.self;
1543
1543
  return addHeapObject(ret);
1544
1544
  }, arguments) };
1545
- imports.wbg.__wbg_window_6f6e346d8bbd61d7 = function() { return handleError(function () {
1545
+ imports.wbg.__wbg_window_f2557cc78490aceb = function() { return handleError(function () {
1546
1546
  const ret = window.window;
1547
1547
  return addHeapObject(ret);
1548
1548
  }, arguments) };
1549
- imports.wbg.__wbg_globalThis_3348936ac49df00a = function() { return handleError(function () {
1549
+ imports.wbg.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () {
1550
1550
  const ret = globalThis.globalThis;
1551
1551
  return addHeapObject(ret);
1552
1552
  }, arguments) };
1553
- imports.wbg.__wbg_global_67175caf56f55ca9 = function() { return handleError(function () {
1553
+ imports.wbg.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () {
1554
1554
  const ret = global.global;
1555
1555
  return addHeapObject(ret);
1556
1556
  }, arguments) };
1557
- imports.wbg.__wbg_newnoargs_971e9a5abe185139 = function(arg0, arg1) {
1557
+ imports.wbg.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) {
1558
1558
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1559
1559
  return addHeapObject(ret);
1560
1560
  };
1561
- imports.wbg.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
1561
+ imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
1562
1562
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1563
1563
  return addHeapObject(ret);
1564
1564
  }, arguments) };
1565
- imports.wbg.__wbg_call_187e4e7f6f4285fb = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1565
+ imports.wbg.__wbg_call_3999bee59e9f7719 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1566
1566
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1567
1567
  return addHeapObject(ret);
1568
1568
  }, arguments) };
1569
- imports.wbg.__wbg_set_2762e698c2f5b7e0 = function() { return handleError(function (arg0, arg1, arg2) {
1569
+ imports.wbg.__wbg_set_bf3f89b92d5a34bf = function() { return handleError(function (arg0, arg1, arg2) {
1570
1570
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1571
1571
  return ret;
1572
1572
  }, arguments) };
@@ -1574,99 +1574,117 @@ function getImports() {
1574
1574
  const ret = wasm$1.memory;
1575
1575
  return addHeapObject(ret);
1576
1576
  };
1577
- imports.wbg.__wbg_buffer_34f5ec9f8a838ba0 = function(arg0) {
1577
+ imports.wbg.__wbg_buffer_3f3d764d4747d564 = function(arg0) {
1578
1578
  const ret = getObject(arg0).buffer;
1579
1579
  return addHeapObject(ret);
1580
1580
  };
1581
- imports.wbg.__wbg_newwithbyteoffsetandlength_88fdad741db1b182 = function(arg0, arg1, arg2) {
1581
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d9aa266703cb98be = function(arg0, arg1, arg2) {
1582
1582
  const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1583
1583
  return addHeapObject(ret);
1584
1584
  };
1585
- imports.wbg.__wbg_set_1a930cfcda1a8067 = function(arg0, arg1, arg2) {
1585
+ imports.wbg.__wbg_set_83db9690f9353e79 = function(arg0, arg1, arg2) {
1586
1586
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1587
1587
  };
1588
- imports.wbg.__wbg_now_1b6e18d94ce2c037 = function() {
1588
+ imports.wbg.__wbg_now_58886682b7e790d7 = function() {
1589
1589
  const ret = Date.now();
1590
1590
  return ret;
1591
1591
  };
1592
- imports.wbg.__wbg_target_68a5c10e2732a79e = function(arg0) {
1592
+ imports.wbg.__wbg_target_bf704b7db7ad1387 = function(arg0) {
1593
1593
  const ret = getObject(arg0).target;
1594
1594
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1595
1595
  };
1596
- imports.wbg.__wbg_objectStoreNames_d11a3d06e3226638 = function(arg0) {
1596
+ imports.wbg.__wbg_error_aacf5ac191e54ed0 = function() { return handleError(function (arg0) {
1597
+ const ret = getObject(arg0).error;
1598
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1599
+ }, arguments) };
1600
+ imports.wbg.__wbg_objectStoreNames_8c06c40d2b05141c = function(arg0) {
1597
1601
  const ret = getObject(arg0).objectStoreNames;
1598
1602
  return addHeapObject(ret);
1599
1603
  };
1600
- imports.wbg.__wbg_contains_bcaf1388e1ca982c = function(arg0, arg1, arg2) {
1604
+ imports.wbg.__wbg_contains_6cf516181cd86571 = function(arg0, arg1, arg2) {
1601
1605
  const ret = getObject(arg0).contains(getStringFromWasm0(arg1, arg2));
1602
1606
  return ret;
1603
1607
  };
1604
- imports.wbg.__wbg_createObjectStore_454d7cf701faa545 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1608
+ imports.wbg.__wbg_createObjectStore_f4c2f030bc994158 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1605
1609
  const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2), getObject(arg3));
1606
1610
  return addHeapObject(ret);
1607
1611
  }, arguments) };
1608
- imports.wbg.__wbg_transaction_0ba302b35542323f = function(arg0) {
1612
+ imports.wbg.__wbg_transaction_2a414baad674f8d4 = function(arg0) {
1609
1613
  const ret = getObject(arg0).transaction;
1610
1614
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1611
1615
  };
1612
- imports.wbg.__wbg_indexNames_8f97f1f79bc278bf = function(arg0) {
1616
+ imports.wbg.__wbg_indexNames_e6ea7f4d67313c8c = function(arg0) {
1613
1617
  const ret = getObject(arg0).indexNames;
1614
1618
  return addHeapObject(ret);
1615
1619
  };
1616
- imports.wbg.__wbg_createIndex_20c39366f6b22548 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1620
+ imports.wbg.__wbg_createIndex_2e6761d6cd83a0d6 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1617
1621
  const ret = getObject(arg0).createIndex(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4));
1618
1622
  return addHeapObject(ret);
1619
1623
  }, arguments) };
1620
- imports.wbg.__wbg_length_580a8f6d9757b9da = function(arg0) {
1624
+ imports.wbg.__wbg_length_b59f358f797fd9f4 = function(arg0) {
1621
1625
  const ret = getObject(arg0).length;
1622
1626
  return ret;
1623
1627
  };
1624
- imports.wbg.__wbg_deleteIndex_9d33d4fd04e9038c = function() { return handleError(function (arg0, arg1, arg2) {
1628
+ imports.wbg.__wbg_deleteIndex_2f8e18b00c1554e1 = function() { return handleError(function (arg0, arg1, arg2) {
1625
1629
  getObject(arg0).deleteIndex(getStringFromWasm0(arg1, arg2));
1626
1630
  }, arguments) };
1627
- imports.wbg.__wbg_deleteObjectStore_ec34033b22e0c4e1 = function() { return handleError(function (arg0, arg1, arg2) {
1631
+ imports.wbg.__wbg_deleteObjectStore_1b698c5fd1bc077d = function() { return handleError(function (arg0, arg1, arg2) {
1628
1632
  getObject(arg0).deleteObjectStore(getStringFromWasm0(arg1, arg2));
1629
1633
  }, arguments) };
1630
- imports.wbg.__wbg_error_c872d3f7251736f1 = function() { return handleError(function (arg0) {
1631
- const ret = getObject(arg0).error;
1632
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1633
- }, arguments) };
1634
1634
  imports.wbg.__wbindgen_is_falsy = function(arg0) {
1635
1635
  const ret = !getObject(arg0);
1636
1636
  return ret;
1637
1637
  };
1638
- imports.wbg.__wbg_key_3ce14c27a234543a = function() { return handleError(function (arg0) {
1638
+ imports.wbg.__wbg_key_1a7ac8cd4fa1c7a1 = function() { return handleError(function (arg0) {
1639
1639
  const ret = getObject(arg0).key;
1640
1640
  return addHeapObject(ret);
1641
1641
  }, arguments) };
1642
- imports.wbg.__wbg_advance_5da26ebf2f15b82e = function() { return handleError(function (arg0, arg1) {
1642
+ imports.wbg.__wbg_advance_ca3cc2aceae7ca47 = function() { return handleError(function (arg0, arg1) {
1643
1643
  getObject(arg0).advance(arg1 >>> 0);
1644
1644
  }, arguments) };
1645
- imports.wbg.__wbg_instanceof_IdbFactory_acaddaa9df3f73bc = function(arg0) {
1646
- const ret = getObject(arg0) instanceof IDBFactory;
1645
+ imports.wbg.__wbg_instanceof_IdbFactory_52a891270c686e1c = function(arg0) {
1646
+ let result;
1647
+ try {
1648
+ result = getObject(arg0) instanceof IDBFactory;
1649
+ } catch {
1650
+ result = false;
1651
+ }
1652
+ const ret = result;
1647
1653
  return ret;
1648
1654
  };
1649
- imports.wbg.__wbg_index_49e22b15910e16d4 = function() { return handleError(function (arg0, arg1, arg2) {
1655
+ imports.wbg.__wbg_index_86861edf1478f49c = function() { return handleError(function (arg0, arg1, arg2) {
1650
1656
  const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
1651
1657
  return addHeapObject(ret);
1652
1658
  }, arguments) };
1653
- imports.wbg.__wbg_toString_dc4768002eeae1b0 = function(arg0) {
1659
+ imports.wbg.__wbg_toString_73c9b562dccf34bd = function(arg0) {
1654
1660
  const ret = getObject(arg0).toString();
1655
1661
  return addHeapObject(ret);
1656
1662
  };
1657
- imports.wbg.__wbg_new_3ee7ebe9952c1fbd = function(arg0, arg1) {
1663
+ imports.wbg.__wbg_new_8d2af00bc1e329ee = function(arg0, arg1) {
1658
1664
  const ret = new Error(getStringFromWasm0(arg0, arg1));
1659
1665
  return addHeapObject(ret);
1660
1666
  };
1661
- imports.wbg.__wbg_instanceof_Uint8Array_36c37b9ca15e3e0a = function(arg0) {
1662
- const ret = getObject(arg0) instanceof Uint8Array;
1667
+ imports.wbg.__wbg_instanceof_Uint8Array_971eeda69eb75003 = function(arg0) {
1668
+ let result;
1669
+ try {
1670
+ result = getObject(arg0) instanceof Uint8Array;
1671
+ } catch {
1672
+ result = false;
1673
+ }
1674
+ const ret = result;
1663
1675
  return ret;
1664
1676
  };
1665
- imports.wbg.__wbg_instanceof_ArrayBuffer_02bbeeb60438c785 = function(arg0) {
1666
- const ret = getObject(arg0) instanceof ArrayBuffer;
1677
+ imports.wbg.__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b = function(arg0) {
1678
+ let result;
1679
+ try {
1680
+ result = getObject(arg0) instanceof ArrayBuffer;
1681
+ } catch {
1682
+ result = false;
1683
+ }
1684
+ const ret = result;
1667
1685
  return ret;
1668
1686
  };
1669
- imports.wbg.__wbg_String_7462bcc0fcdbaf7d = function(arg0, arg1) {
1687
+ imports.wbg.__wbg_String_c9c0f9be374874ba = function(arg0, arg1) {
1670
1688
  const ret = String(getObject(arg1));
1671
1689
  const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1672
1690
  const len0 = WASM_VECTOR_LEN;
@@ -1683,50 +1701,50 @@ function getImports() {
1683
1701
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1684
1702
  throw new Error(getStringFromWasm0(arg0, arg1));
1685
1703
  };
1686
- imports.wbg.__wbg_then_18da6e5453572fc8 = function(arg0, arg1) {
1704
+ imports.wbg.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
1687
1705
  const ret = getObject(arg0).then(getObject(arg1));
1688
1706
  return addHeapObject(ret);
1689
1707
  };
1690
- imports.wbg.__wbg_resolve_0107b3a501450ba0 = function(arg0) {
1708
+ imports.wbg.__wbg_resolve_99fe17964f31ffc0 = function(arg0) {
1691
1709
  const ret = Promise.resolve(getObject(arg0));
1692
1710
  return addHeapObject(ret);
1693
1711
  };
1694
- imports.wbg.__wbg_get_50220f3428ca7e51 = function(arg0, arg1, arg2) {
1712
+ imports.wbg.__wbg_get_0ab855454881e5cf = function(arg0, arg1, arg2) {
1695
1713
  const ret = getObject(arg1)[arg2 >>> 0];
1696
1714
  var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1697
1715
  var len0 = WASM_VECTOR_LEN;
1698
1716
  getInt32Memory0()[arg0 / 4 + 1] = len0;
1699
1717
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
1700
1718
  };
1701
- imports.wbg.__wbg_continue_43562ff8da972056 = function() { return handleError(function (arg0) {
1719
+ imports.wbg.__wbg_continue_3ff6a82c48409f45 = function() { return handleError(function (arg0) {
1702
1720
  getObject(arg0).continue();
1703
1721
  }, arguments) };
1704
- imports.wbg.__wbg_value_a3a782e66c6935d3 = function() { return handleError(function (arg0) {
1722
+ imports.wbg.__wbg_value_b663fab9801b9d19 = function() { return handleError(function (arg0) {
1705
1723
  const ret = getObject(arg0).value;
1706
1724
  return addHeapObject(ret);
1707
1725
  }, arguments) };
1708
- imports.wbg.__wbg_openCursor_48949b0ae4868b31 = function() { return handleError(function (arg0, arg1, arg2) {
1726
+ imports.wbg.__wbg_openCursor_3b7256b00a9b7d9f = function() { return handleError(function (arg0, arg1, arg2) {
1709
1727
  const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
1710
1728
  return addHeapObject(ret);
1711
1729
  }, arguments) };
1712
- imports.wbg.__wbg_openCursor_abefd2bc54b71e0f = function() { return handleError(function (arg0, arg1, arg2) {
1730
+ imports.wbg.__wbg_openCursor_4fee2b2ca0f3ed32 = function() { return handleError(function (arg0, arg1, arg2) {
1713
1731
  const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
1714
1732
  return addHeapObject(ret);
1715
1733
  }, arguments) };
1716
- imports.wbg.__wbg_result_4b44b0d900b4ab6f = function() { return handleError(function (arg0) {
1734
+ imports.wbg.__wbg_result_9e399c14676970d9 = function() { return handleError(function (arg0) {
1717
1735
  const ret = getObject(arg0).result;
1718
1736
  return addHeapObject(ret);
1719
1737
  }, arguments) };
1720
- imports.wbg.__wbg_objectStore_76c268be095ec9a5 = function() { return handleError(function (arg0, arg1, arg2) {
1738
+ imports.wbg.__wbg_objectStore_f17976b0e6377830 = function() { return handleError(function (arg0, arg1, arg2) {
1721
1739
  const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
1722
1740
  return addHeapObject(ret);
1723
1741
  }, arguments) };
1724
- imports.wbg.__wbindgen_closure_wrapper2517 = function(arg0, arg1, arg2) {
1725
- const ret = makeMutClosure(arg0, arg1, 105, __wbg_adapter_40);
1742
+ imports.wbg.__wbindgen_closure_wrapper2438 = function(arg0, arg1, arg2) {
1743
+ const ret = makeMutClosure(arg0, arg1, 106, __wbg_adapter_40);
1726
1744
  return addHeapObject(ret);
1727
1745
  };
1728
- imports.wbg.__wbindgen_closure_wrapper4457 = function(arg0, arg1, arg2) {
1729
- const ret = makeMutClosure(arg0, arg1, 113, __wbg_adapter_43);
1746
+ imports.wbg.__wbindgen_closure_wrapper4416 = function(arg0, arg1, arg2) {
1747
+ const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_43);
1730
1748
  return addHeapObject(ret);
1731
1749
  };
1732
1750
 
@@ -1745,10 +1763,13 @@ function finalizeInit(instance, module) {
1745
1763
  return wasm$1;
1746
1764
  }
1747
1765
 
1748
- function initSync(bytes) {
1766
+ function initSync(module) {
1749
1767
  const imports = getImports();
1750
1768
 
1751
- const module = new WebAssembly.Module(bytes);
1769
+ if (!(module instanceof WebAssembly.Module)) {
1770
+ module = new WebAssembly.Module(module);
1771
+ }
1772
+
1752
1773
  const instance = new WebAssembly.Instance(module, imports);
1753
1774
 
1754
1775
  return finalizeInit(instance, module);
@@ -1787,25 +1808,57 @@ var exports = /*#__PURE__*/Object.freeze({
1787
1808
  });
1788
1809
 
1789
1810
  var wasm = async (opt = {}) => {
1790
- let {importHook, serverPath} = opt;
1811
+ let {importHook, serverPath} = opt;
1791
1812
 
1792
- let path = "assets/core_crypto_ffi-0df6a73f.wasm";
1813
+ let path = "assets/core_crypto_ffi-9e5ae25f.wasm";
1793
1814
 
1794
- if (serverPath != null) {
1795
- path = serverPath + /[^\/\\]*$/.exec(path)[0];
1796
- }
1815
+ if (serverPath != null) {
1816
+ path = serverPath + /[^\/\\]*$/.exec(path)[0];
1817
+ }
1797
1818
 
1798
- if (importHook != null) {
1799
- path = importHook(path);
1800
- }
1819
+ if (importHook != null) {
1820
+ path = importHook(path);
1821
+ }
1801
1822
 
1802
- await init(path);
1803
- return exports;
1804
- };
1823
+ await init(path);
1824
+ return exports;
1825
+ };
1805
1826
 
1806
1827
  // Wire
1807
1828
  // Copyright (C) 2022 Wire Swiss GmbH
1808
1829
  var _a, _CoreCrypto_module, _CoreCrypto_cc;
1830
+ /**
1831
+ * MLS Proposal type
1832
+ */
1833
+ var ProposalType;
1834
+ (function (ProposalType) {
1835
+ /**
1836
+ * This allows to propose the addition of other clients to the MLS group/conversation
1837
+ */
1838
+ ProposalType[ProposalType["Add"] = 0] = "Add";
1839
+ /**
1840
+ * This allows to propose the removal of clients from the MLS group/conversation
1841
+ */
1842
+ ProposalType[ProposalType["Remove"] = 1] = "Remove";
1843
+ /**
1844
+ * This allows to propose to update the client keying material (i.e. keypackage rotation) and the group root key
1845
+ */
1846
+ ProposalType[ProposalType["Update"] = 2] = "Update";
1847
+ })(ProposalType || (ProposalType = {}));
1848
+ /**
1849
+ * MLS External Proposal type
1850
+ */
1851
+ var ExternalProposalType;
1852
+ (function (ExternalProposalType) {
1853
+ /**
1854
+ * This allows to propose the addition of other clients to the MLS group/conversation
1855
+ */
1856
+ ExternalProposalType[ExternalProposalType["Add"] = 0] = "Add";
1857
+ /**
1858
+ * This allows to propose the removal of clients from the MLS group/conversation
1859
+ */
1860
+ ExternalProposalType[ExternalProposalType["Remove"] = 1] = "Remove";
1861
+ })(ExternalProposalType || (ExternalProposalType = {}));
1809
1862
  /**
1810
1863
  * Wrapper for the WASM-compiled version of CoreCrypto
1811
1864
  */
@@ -1874,6 +1927,15 @@ class CoreCrypto {
1874
1927
  async close() {
1875
1928
  await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").close();
1876
1929
  }
1930
+ /**
1931
+ * Registers the callbacks for CoreCrypto to use in order to gain additional information
1932
+ *
1933
+ * @param callbacks - Any interface following the {@link CoreCryptoCallbacks} interface
1934
+ */
1935
+ registerCallbacks(callbacks) {
1936
+ const wasmCallbacks = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).CoreCryptoWasmCallbacks)(callbacks.authorize, callbacks.clientIdBelongsToOneOf);
1937
+ __classPrivateFieldGet(this, _CoreCrypto_cc, "f").set_callbacks(wasmCallbacks);
1938
+ }
1877
1939
  /**
1878
1940
  * Checks if the Client is member of a given conversation and if the MLS Group is loaded up
1879
1941
  *
@@ -1927,7 +1989,7 @@ class CoreCrypto {
1927
1989
  * @param configuration.externalSenders - Array of Client IDs that are qualified as external senders within the group
1928
1990
  */
1929
1991
  async createConversation(conversationId, configuration = {}) {
1930
- const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration !== null && configuration !== void 0 ? configuration : {};
1992
+ const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration || {};
1931
1993
  const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(admins, ciphersuite, keyRotationSpan, externalSenders);
1932
1994
  const ret = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").create_conversation(conversationId, config);
1933
1995
  return ret;
@@ -1938,7 +2000,7 @@ class CoreCrypto {
1938
2000
  * @param conversationId - The ID of the conversation
1939
2001
  * @param payload - The encrypted message buffer
1940
2002
  *
1941
- * @returns Either a {@link DecryptedMessage} payload or `undefined` - This happens when the encrypted payload contains a system message such a proposal or commit
2003
+ * @returns a {@link DecryptedMessage}. Note that {@link DecryptedMessage#message} is `undefined` when the encrypted payload contains a system message such a proposal or commit
1942
2004
  */
1943
2005
  async decryptMessage(conversationId, payload) {
1944
2006
  const ffiDecryptedMessage = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").decrypt_message(conversationId, payload);
@@ -2028,7 +2090,7 @@ class CoreCrypto {
2028
2090
  * @param conversationId - The ID of the conversation
2029
2091
  * @param clientIds - Array of Client IDs to remove.
2030
2092
  *
2031
- * @returns A {@link CommitBundle}, or `undefined` if for any reason, the operation would result in an empty commit
2093
+ * @returns A {@link CommitBundle}
2032
2094
  */
2033
2095
  async removeClientsFromConversation(conversationId, clientIds) {
2034
2096
  const ffiRet = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").remove_clients_from_conversation(conversationId, clientIds);
@@ -2068,7 +2130,7 @@ class CoreCrypto {
2068
2130
  *
2069
2131
  * @param conversationId - The ID of the conversation
2070
2132
  *
2071
- * @returns A {@link CommitBundle}
2133
+ * @returns A {@link CommitBundle} or `undefined` when there was no pending proposal to commit
2072
2134
  */
2073
2135
  async commitPendingProposals(conversationId) {
2074
2136
  const ffiCommitBundle = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_pending_proposals(conversationId);
@@ -2151,7 +2213,7 @@ class CoreCrypto {
2151
2213
  *
2152
2214
  * @param conversationId - The ID of the conversation
2153
2215
  *
2154
- * @returns A {@link CommitBundle} byte array to fan out to the Delivery Service
2216
+ * @returns A {@link CommitBundle} byte array to fan out to the Delivery Service or `undefined` when there was no pending proposal to commit
2155
2217
  */
2156
2218
  async finalCommitPendingProposals(conversationId) {
2157
2219
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_pending_proposals(conversationId);
@@ -2166,19 +2228,19 @@ class CoreCrypto {
2166
2228
  */
2167
2229
  async newProposal(proposalType, args) {
2168
2230
  switch (proposalType) {
2169
- case 0 /* ProposalType.Add */: {
2231
+ case ProposalType.Add: {
2170
2232
  if (!args.kp) {
2171
2233
  throw new Error("kp is not contained in the proposal arguments");
2172
2234
  }
2173
2235
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_add_proposal(args.conversationId, args.kp);
2174
2236
  }
2175
- case 1 /* ProposalType.Remove */: {
2237
+ case ProposalType.Remove: {
2176
2238
  if (!args.clientId) {
2177
2239
  throw new Error("clientId is not contained in the proposal arguments");
2178
2240
  }
2179
2241
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_remove_proposal(args.conversationId, args.clientId);
2180
2242
  }
2181
- case 2 /* ProposalType.Update */: {
2243
+ case ProposalType.Update: {
2182
2244
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_update_proposal(args.conversationId);
2183
2245
  }
2184
2246
  default:
@@ -2187,10 +2249,10 @@ class CoreCrypto {
2187
2249
  }
2188
2250
  async newExternalProposal(externalProposalType, args) {
2189
2251
  switch (externalProposalType) {
2190
- case 0 /* ExternalProposalType.Add */: {
2252
+ case ExternalProposalType.Add: {
2191
2253
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_external_add_proposal(args.conversationId, args.epoch);
2192
2254
  }
2193
- case 1 /* ExternalProposalType.Remove */: {
2255
+ case ExternalProposalType.Remove: {
2194
2256
  if (!args.keyPackageRef) {
2195
2257
  throw new Error("keyPackageRef is not contained in the external proposal arguments");
2196
2258
  }
@@ -2234,7 +2296,7 @@ class CoreCrypto {
2234
2296
  * @param configuration - Configuration of the group, see {@link ConversationConfiguration}
2235
2297
  */
2236
2298
  async mergePendingGroupFromExternalCommit(conversationId, configuration) {
2237
- const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration !== null && configuration !== void 0 ? configuration : {};
2299
+ const { admins, ciphersuite, keyRotationSpan, externalSenders } = configuration || {};
2238
2300
  const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(admins, ciphersuite, keyRotationSpan, externalSenders);
2239
2301
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").merge_pending_group_from_external_commit(conversationId, config);
2240
2302
  }
@@ -2247,28 +2309,6 @@ class CoreCrypto {
2247
2309
  async commitAccepted(conversationId) {
2248
2310
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_accepted(conversationId);
2249
2311
  }
2250
- /**
2251
- * Allows {@link CoreCrypto} to act as a CSPRNG provider
2252
- * @note The underlying CSPRNG algorithm is ChaCha20 and takes in account the external seed provider either at init time or provided with {@link CoreCrypto.reseedRng}
2253
- *
2254
- * @param length - The number of bytes to be returned in the `Uint8Array`
2255
- *
2256
- * @returns A `Uint8Array` buffer that contains `length` cryptographically-secure random bytes
2257
- */
2258
- async randomBytes(length) {
2259
- return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").random_bytes(length);
2260
- }
2261
- /**
2262
- * Allows to reseed {@link CoreCrypto}'s internal CSPRNG with a new seed.
2263
- *
2264
- * @param seed - **exactly 32** bytes buffer seed
2265
- */
2266
- async reseedRng(seed) {
2267
- if (seed.length !== 32) {
2268
- throw new Error(`The seed length needs to be exactly 32 bytes. ${seed.length} bytes provided.`);
2269
- }
2270
- return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").reseed_rng(seed);
2271
- }
2272
2312
  /**
2273
2313
  * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions
2274
2314
  * have changed meanwhile.
@@ -2279,7 +2319,7 @@ class CoreCrypto {
2279
2319
  * @param conversationId - The group's ID
2280
2320
  * @param proposalRef - A reference to the proposal to delete. You get one when using {@link CoreCrypto.newProposal}
2281
2321
  */
2282
- async clear_pending_proposal(conversationId, proposalRef) {
2322
+ async clearPendingProposal(conversationId, proposalRef) {
2283
2323
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_proposal(conversationId, proposalRef);
2284
2324
  }
2285
2325
  /**
@@ -2293,9 +2333,31 @@ class CoreCrypto {
2293
2333
  *
2294
2334
  * @param conversationId - The group's ID
2295
2335
  */
2296
- async clear_pending_commit(conversationId) {
2336
+ async clearPendingCommit(conversationId) {
2297
2337
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_commit(conversationId);
2298
2338
  }
2339
+ /**
2340
+ * Allows {@link CoreCrypto} to act as a CSPRNG provider
2341
+ * @note The underlying CSPRNG algorithm is ChaCha20 and takes in account the external seed provider either at init time or provided with {@link CoreCrypto.reseedRng}
2342
+ *
2343
+ * @param length - The number of bytes to be returned in the `Uint8Array`
2344
+ *
2345
+ * @returns A `Uint8Array` buffer that contains `length` cryptographically-secure random bytes
2346
+ */
2347
+ async randomBytes(length) {
2348
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").random_bytes(length);
2349
+ }
2350
+ /**
2351
+ * Allows to reseed {@link CoreCrypto}'s internal CSPRNG with a new seed.
2352
+ *
2353
+ * @param seed - **exactly 32** bytes buffer seed
2354
+ */
2355
+ async reseedRng(seed) {
2356
+ if (seed.length !== 32) {
2357
+ throw new Error(`The seed length needs to be exactly 32 bytes. ${seed.length} bytes provided.`);
2358
+ }
2359
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").reseed_rng(seed);
2360
+ }
2299
2361
  /**
2300
2362
  * Returns the current version of {@link CoreCrypto}
2301
2363
  *
@@ -2312,4 +2374,4 @@ _a = CoreCrypto, _CoreCrypto_cc = new WeakMap();
2312
2374
  /** @hidden */
2313
2375
  _CoreCrypto_module = { value: void 0 };
2314
2376
 
2315
- export { CoreCrypto };
2377
+ export { CoreCrypto, ExternalProposalType, ProposalType };