@keyhive/keyhive 0.0.0-alpha.8 → 0.1.0-alpha.2

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.
@@ -1,317 +1,20 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- let cachedUint8ArrayMemory0 = null;
8
-
9
- function getUint8ArrayMemory0() {
10
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
- }
13
- return cachedUint8ArrayMemory0;
14
- }
15
-
16
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
17
-
18
- cachedTextDecoder.decode();
19
-
20
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
21
- let numBytesDecoded = 0;
22
- function decodeText(ptr, len) {
23
- numBytesDecoded += len;
24
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
25
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
26
- cachedTextDecoder.decode();
27
- numBytesDecoded = len;
28
- }
29
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
30
- }
31
-
32
- function getStringFromWasm0(ptr, len) {
33
- ptr = ptr >>> 0;
34
- return decodeText(ptr, len);
35
- }
36
-
37
- function addToExternrefTable0(obj) {
38
- const idx = wasm.__externref_table_alloc();
39
- wasm.__wbindgen_export_2.set(idx, obj);
40
- return idx;
41
- }
42
-
43
- function handleError(f, args) {
44
- try {
45
- return f.apply(this, args);
46
- } catch (e) {
47
- const idx = addToExternrefTable0(e);
48
- wasm.__wbindgen_exn_store(idx);
49
- }
50
- }
51
-
52
- function getArrayU8FromWasm0(ptr, len) {
53
- ptr = ptr >>> 0;
54
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
55
- }
56
-
57
- let WASM_VECTOR_LEN = 0;
58
-
59
- const cachedTextEncoder = new TextEncoder();
60
-
61
- if (!('encodeInto' in cachedTextEncoder)) {
62
- cachedTextEncoder.encodeInto = function (arg, view) {
63
- const buf = cachedTextEncoder.encode(arg);
64
- view.set(buf);
65
- return {
66
- read: arg.length,
67
- written: buf.length
68
- };
69
- }
70
- }
71
-
72
- function passStringToWasm0(arg, malloc, realloc) {
73
-
74
- if (realloc === undefined) {
75
- const buf = cachedTextEncoder.encode(arg);
76
- const ptr = malloc(buf.length, 1) >>> 0;
77
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
78
- WASM_VECTOR_LEN = buf.length;
79
- return ptr;
80
- }
81
-
82
- let len = arg.length;
83
- let ptr = malloc(len, 1) >>> 0;
84
-
85
- const mem = getUint8ArrayMemory0();
86
-
87
- let offset = 0;
88
-
89
- for (; offset < len; offset++) {
90
- const code = arg.charCodeAt(offset);
91
- if (code > 0x7F) break;
92
- mem[ptr + offset] = code;
93
- }
94
-
95
- if (offset !== len) {
96
- if (offset !== 0) {
97
- arg = arg.slice(offset);
98
- }
99
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
100
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
101
- const ret = cachedTextEncoder.encodeInto(arg, view);
102
-
103
- offset += ret.written;
104
- ptr = realloc(ptr, len, offset, 1) >>> 0;
105
- }
106
-
107
- WASM_VECTOR_LEN = offset;
108
- return ptr;
109
- }
110
-
111
- let cachedDataViewMemory0 = null;
112
-
113
- function getDataViewMemory0() {
114
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
115
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
116
- }
117
- return cachedDataViewMemory0;
118
- }
119
-
120
- function isLikeNone(x) {
121
- return x === undefined || x === null;
122
- }
123
-
124
- function debugString(val) {
125
- // primitive types
126
- const type = typeof val;
127
- if (type == 'number' || type == 'boolean' || val == null) {
128
- return `${val}`;
129
- }
130
- if (type == 'string') {
131
- return `"${val}"`;
132
- }
133
- if (type == 'symbol') {
134
- const description = val.description;
135
- if (description == null) {
136
- return 'Symbol';
137
- } else {
138
- return `Symbol(${description})`;
139
- }
140
- }
141
- if (type == 'function') {
142
- const name = val.name;
143
- if (typeof name == 'string' && name.length > 0) {
144
- return `Function(${name})`;
145
- } else {
146
- return 'Function';
147
- }
148
- }
149
- // objects
150
- if (Array.isArray(val)) {
151
- const length = val.length;
152
- let debug = '[';
153
- if (length > 0) {
154
- debug += debugString(val[0]);
155
- }
156
- for(let i = 1; i < length; i++) {
157
- debug += ', ' + debugString(val[i]);
158
- }
159
- debug += ']';
160
- return debug;
161
- }
162
- // Test for built-in
163
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
164
- let className;
165
- if (builtInMatches && builtInMatches.length > 1) {
166
- className = builtInMatches[1];
167
- } else {
168
- // Failed to match the standard '[object ClassName]'
169
- return toString.call(val);
170
- }
171
- if (className == 'Object') {
172
- // we're a user defined class or Object
173
- // JSON.stringify avoids problems with cycles, and is generally much
174
- // easier than looping through ownProperties of `val`.
175
- try {
176
- return 'Object(' + JSON.stringify(val) + ')';
177
- } catch (_) {
178
- return 'Object';
179
- }
180
- }
181
- // errors
182
- if (val instanceof Error) {
183
- return `${val.name}: ${val.message}\n${val.stack}`;
184
- }
185
- // TODO we could test for more things here, like `Set`s and `Map`s.
186
- return className;
187
- }
188
-
189
- function getArrayJsValueFromWasm0(ptr, len) {
190
- ptr = ptr >>> 0;
191
- const mem = getDataViewMemory0();
192
- const result = [];
193
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
194
- result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
195
- }
196
- wasm.__externref_drop_slice(ptr, len);
197
- return result;
198
- }
199
-
200
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
201
- ? { register: () => {}, unregister: () => {} }
202
- : new FinalizationRegistry(
203
- state => {
204
- wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b);
205
- }
206
- );
207
-
208
- function makeMutClosure(arg0, arg1, dtor, f) {
209
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
210
- const real = (...args) => {
211
-
212
- // First up with a closure we increment the internal reference
213
- // count. This ensures that the Rust closure environment won't
214
- // be deallocated while we're invoking it.
215
- state.cnt++;
216
- const a = state.a;
217
- state.a = 0;
218
- try {
219
- return f(a, state.b, ...args);
220
- } finally {
221
- if (--state.cnt === 0) {
222
- wasm.__wbindgen_export_7.get(state.dtor)(a, state.b);
223
- CLOSURE_DTORS.unregister(state);
224
- } else {
225
- state.a = a;
226
- }
227
- }
228
- };
229
- real.original = state;
230
- CLOSURE_DTORS.register(real, state, state);
231
- return real;
232
- }
233
-
234
- function passArray8ToWasm0(arg, malloc) {
235
- const ptr = malloc(arg.length * 1, 1) >>> 0;
236
- getUint8ArrayMemory0().set(arg, ptr / 1);
237
- WASM_VECTOR_LEN = arg.length;
238
- return ptr;
239
- }
240
-
241
- function takeFromExternrefTable0(idx) {
242
- const value = wasm.__wbindgen_export_2.get(idx);
243
- wasm.__externref_table_dealloc(idx);
244
- return value;
245
- }
246
-
247
- function _assertClass(instance, klass) {
248
- if (!(instance instanceof klass)) {
249
- throw new Error(`expected instance of ${klass.name}`);
250
- }
251
- }
252
-
253
- function passArrayJsValueToWasm0(array, malloc) {
254
- const ptr = malloc(array.length * 4, 4) >>> 0;
255
- for (let i = 0; i < array.length; i++) {
256
- const add = addToExternrefTable0(array[i]);
257
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
258
- }
259
- WASM_VECTOR_LEN = array.length;
260
- return ptr;
261
- }
262
- /**
263
- * Panic hook lets us get better error messages if our Rust code ever panics.
264
- *
265
- * This function needs to be called at least once during initialisation.
266
- * https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/template-deep-dive/src-utils-rs.html#2-what-is-console_error_panic_hook
267
- */
268
- export function setPanicHook() {
269
- wasm.setPanicHook();
270
- }
271
-
272
- function __wbg_adapter_10(arg0, arg1, arg2) {
273
- wasm.closure429_externref_shim(arg0, arg1, arg2);
274
- }
275
-
276
- function __wbg_adapter_272(arg0, arg1, arg2, arg3) {
277
- wasm.closure570_externref_shim(arg0, arg1, arg2, arg3);
278
- }
279
-
280
- const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
281
- ? { register: () => {}, unregister: () => {} }
282
- : new FinalizationRegistry(ptr => wasm.__wbg_access_free(ptr >>> 0, 1));
283
-
284
1
  export class Access {
285
-
286
2
  static __wrap(ptr) {
287
- ptr = ptr >>> 0;
288
3
  const obj = Object.create(Access.prototype);
289
4
  obj.__wbg_ptr = ptr;
290
5
  AccessFinalization.register(obj, obj.__wbg_ptr, obj);
291
6
  return obj;
292
7
  }
293
-
294
8
  __destroy_into_raw() {
295
9
  const ptr = this.__wbg_ptr;
296
10
  this.__wbg_ptr = 0;
297
11
  AccessFinalization.unregister(this);
298
12
  return ptr;
299
13
  }
300
-
301
14
  free() {
302
15
  const ptr = this.__destroy_into_raw();
303
16
  wasm.__wbg_access_free(ptr, 0);
304
17
  }
305
- /**
306
- * @param {string} s
307
- * @returns {Access | undefined}
308
- */
309
- static tryFromString(s) {
310
- const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
311
- const len0 = WASM_VECTOR_LEN;
312
- const ret = wasm.access_tryFromString(ptr0, len0);
313
- return ret === 0 ? undefined : Access.__wrap(ret);
314
- }
315
18
  /**
316
19
  * @returns {string}
317
20
  */
@@ -327,42 +30,137 @@ export class Access {
327
30
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
328
31
  }
329
32
  }
33
+ /**
34
+ * @param {string} s
35
+ * @returns {Access | undefined}
36
+ */
37
+ static tryFromString(s) {
38
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
39
+ const len0 = WASM_VECTOR_LEN;
40
+ const ret = wasm.access_tryFromString(ptr0, len0);
41
+ return ret === 0 ? undefined : Access.__wrap(ret);
42
+ }
330
43
  }
331
44
  if (Symbol.dispose) Access.prototype[Symbol.dispose] = Access.prototype.free;
332
45
 
333
- const AddMemberErrorFinalization = (typeof FinalizationRegistry === 'undefined')
334
- ? { register: () => {}, unregister: () => {} }
335
- : new FinalizationRegistry(ptr => wasm.__wbg_addmembererror_free(ptr >>> 0, 1));
336
-
337
- export class AddMemberError {
46
+ /**
47
+ * The result of adding a member: the membership delegation, plus any new leaf
48
+ * secrets produced by auto-rekeying a non-forward-secret document on add.
49
+ */
50
+ export class AddMemberUpdate {
51
+ static __wrap(ptr) {
52
+ const obj = Object.create(AddMemberUpdate.prototype);
53
+ obj.__wbg_ptr = ptr;
54
+ AddMemberUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
55
+ return obj;
56
+ }
57
+ __destroy_into_raw() {
58
+ const ptr = this.__wbg_ptr;
59
+ this.__wbg_ptr = 0;
60
+ AddMemberUpdateFinalization.unregister(this);
61
+ return ptr;
62
+ }
63
+ free() {
64
+ const ptr = this.__destroy_into_raw();
65
+ wasm.__wbg_addmemberupdate_free(ptr, 0);
66
+ }
67
+ /**
68
+ * @returns {SignedDelegation}
69
+ */
70
+ get delegation() {
71
+ const ret = wasm.addmemberupdate_delegation(this.__wbg_ptr);
72
+ return SignedDelegation.__wrap(ret);
73
+ }
74
+ /**
75
+ * New leaf secret keypairs from auto-rekeying a non-forward-secret document
76
+ * when this reader was added, serialized as a
77
+ * `BTreeMap<ShareKey, ShareSecretKey>` (the format `importPrekeySecrets`
78
+ * accepts). A sibling instance of this identity (e.g. a tab and its
79
+ * SharedWorker) installs them to derive the rotated key. `undefined` when
80
+ * no rotation occurred (a forward-secret document).
81
+ * @returns {Uint8Array | undefined}
82
+ */
83
+ get leafSecrets() {
84
+ const ret = wasm.addmemberupdate_leafSecrets(this.__wbg_ptr);
85
+ let v1;
86
+ if (ret[0] !== 0) {
87
+ v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
88
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
89
+ }
90
+ return v1;
91
+ }
92
+ }
93
+ if (Symbol.dispose) AddMemberUpdate.prototype[Symbol.dispose] = AddMemberUpdate.prototype.free;
338
94
 
95
+ export class Agent {
339
96
  static __wrap(ptr) {
340
- ptr = ptr >>> 0;
341
- const obj = Object.create(AddMemberError.prototype);
97
+ const obj = Object.create(Agent.prototype);
342
98
  obj.__wbg_ptr = ptr;
343
- AddMemberErrorFinalization.register(obj, obj.__wbg_ptr, obj);
99
+ AgentFinalization.register(obj, obj.__wbg_ptr, obj);
344
100
  return obj;
345
101
  }
346
-
347
102
  __destroy_into_raw() {
348
103
  const ptr = this.__wbg_ptr;
349
104
  this.__wbg_ptr = 0;
350
- AddMemberErrorFinalization.unregister(this);
105
+ AgentFinalization.unregister(this);
351
106
  return ptr;
352
107
  }
353
-
354
108
  free() {
355
109
  const ptr = this.__destroy_into_raw();
356
- wasm.__wbg_addmembererror_free(ptr, 0);
110
+ wasm.__wbg_agent_free(ptr, 0);
111
+ }
112
+ /**
113
+ * @returns {Identifier}
114
+ */
115
+ get id() {
116
+ const ret = wasm.agent_id(this.__wbg_ptr);
117
+ return Identifier.__wrap(ret);
118
+ }
119
+ /**
120
+ * @returns {boolean}
121
+ */
122
+ isDocument() {
123
+ const ret = wasm.agent_isDocument(this.__wbg_ptr);
124
+ return ret !== 0;
125
+ }
126
+ /**
127
+ * @returns {boolean}
128
+ */
129
+ isGroup() {
130
+ const ret = wasm.agent_isGroup(this.__wbg_ptr);
131
+ return ret !== 0;
132
+ }
133
+ /**
134
+ * @returns {boolean}
135
+ */
136
+ isIndividual() {
137
+ const ret = wasm.agent_isIndividual(this.__wbg_ptr);
138
+ return ret !== 0;
139
+ }
140
+ /**
141
+ * Returns prekey operation hashes for this [`Agent`] as an array of hash bytes.
142
+ * @returns {Promise<Uint8Array[]>}
143
+ */
144
+ keyOpHashes() {
145
+ const ret = wasm.agent_keyOpHashes(this.__wbg_ptr);
146
+ return ret;
147
+ }
148
+ /**
149
+ * Returns prekey operations for this agent as a Map of hash -> serialized bytes for [`StaticEvent`]
150
+ * @returns {Promise<Map<any, any>>}
151
+ */
152
+ keyOps() {
153
+ const ret = wasm.agent_keyOps(this.__wbg_ptr);
154
+ return ret;
357
155
  }
358
156
  /**
359
157
  * @returns {string}
360
158
  */
361
- message() {
159
+ toString() {
362
160
  let deferred1_0;
363
161
  let deferred1_1;
364
162
  try {
365
- const ret = wasm.addmembererror_message(this.__wbg_ptr);
163
+ const ret = wasm.agent_toString(this.__wbg_ptr);
366
164
  deferred1_0 = ret[0];
367
165
  deferred1_1 = ret[1];
368
166
  return getStringFromWasm0(ret[0], ret[1]);
@@ -371,118 +169,100 @@ export class AddMemberError {
371
169
  }
372
170
  }
373
171
  }
374
- if (Symbol.dispose) AddMemberError.prototype[Symbol.dispose] = AddMemberError.prototype.free;
375
-
376
- const AgentFinalization = (typeof FinalizationRegistry === 'undefined')
377
- ? { register: () => {}, unregister: () => {} }
378
- : new FinalizationRegistry(ptr => wasm.__wbg_agent_free(ptr >>> 0, 1));
379
-
380
- export class Agent {
172
+ if (Symbol.dispose) Agent.prototype[Symbol.dispose] = Agent.prototype.free;
381
173
 
174
+ /**
175
+ * Result of [`JsKeyhive::all_agent_events`], containing all events for all agents
176
+ * with deduplicated storage and two-tier indirection for membership, prekey, and CGKA ops.
177
+ *
178
+ * The consumer follows: agent -> source IDs -> hashes -> event bytes.
179
+ */
180
+ export class AllAgentEvents {
382
181
  static __wrap(ptr) {
383
- ptr = ptr >>> 0;
384
- const obj = Object.create(Agent.prototype);
182
+ const obj = Object.create(AllAgentEvents.prototype);
385
183
  obj.__wbg_ptr = ptr;
386
- AgentFinalization.register(obj, obj.__wbg_ptr, obj);
184
+ AllAgentEventsFinalization.register(obj, obj.__wbg_ptr, obj);
387
185
  return obj;
388
186
  }
389
-
390
187
  __destroy_into_raw() {
391
188
  const ptr = this.__wbg_ptr;
392
189
  this.__wbg_ptr = 0;
393
- AgentFinalization.unregister(this);
190
+ AllAgentEventsFinalization.unregister(this);
394
191
  return ptr;
395
192
  }
396
-
397
193
  free() {
398
194
  const ptr = this.__destroy_into_raw();
399
- wasm.__wbg_agent_free(ptr, 0);
195
+ wasm.__wbg_allagentevents_free(ptr, 0);
400
196
  }
401
197
  /**
402
- * @returns {string}
198
+ * @returns {Map<any, any>}
403
199
  */
404
- toString() {
405
- let deferred1_0;
406
- let deferred1_1;
407
- try {
408
- const ret = wasm.agent_toString(this.__wbg_ptr);
409
- deferred1_0 = ret[0];
410
- deferred1_1 = ret[1];
411
- return getStringFromWasm0(ret[0], ret[1]);
412
- } finally {
413
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
414
- }
200
+ get agentCgkaSources() {
201
+ const ret = wasm.allagentevents_agentCgkaSources(this.__wbg_ptr);
202
+ return ret;
415
203
  }
416
204
  /**
417
- * @returns {boolean}
205
+ * @returns {Map<any, any>}
418
206
  */
419
- isIndividual() {
420
- const ret = wasm.agent_isIndividual(this.__wbg_ptr);
421
- return ret !== 0;
207
+ get agentMembershipSources() {
208
+ const ret = wasm.allagentevents_agentMembershipSources(this.__wbg_ptr);
209
+ return ret;
422
210
  }
423
211
  /**
424
- * @returns {boolean}
212
+ * @returns {Map<any, any>}
425
213
  */
426
- isGroup() {
427
- const ret = wasm.agent_isGroup(this.__wbg_ptr);
428
- return ret !== 0;
214
+ get agentPrekeySources() {
215
+ const ret = wasm.allagentevents_agentPrekeySources(this.__wbg_ptr);
216
+ return ret;
429
217
  }
430
218
  /**
431
- * @returns {boolean}
219
+ * @returns {Map<any, any>}
432
220
  */
433
- isDocument() {
434
- const ret = wasm.agent_isDocument(this.__wbg_ptr);
435
- return ret !== 0;
221
+ get cgkaSources() {
222
+ const ret = wasm.allagentevents_cgkaSources(this.__wbg_ptr);
223
+ return ret;
436
224
  }
437
225
  /**
438
- * @returns {Identifier}
226
+ * @returns {Map<any, any>}
439
227
  */
440
- get id() {
441
- const ret = wasm.agent_id(this.__wbg_ptr);
442
- return Identifier.__wrap(ret);
228
+ get events() {
229
+ const ret = wasm.allagentevents_events(this.__wbg_ptr);
230
+ return ret;
231
+ }
232
+ /**
233
+ * @returns {Map<any, any>}
234
+ */
235
+ get membershipSources() {
236
+ const ret = wasm.allagentevents_membershipSources(this.__wbg_ptr);
237
+ return ret;
238
+ }
239
+ /**
240
+ * @returns {Map<any, any>}
241
+ */
242
+ get prekeySources() {
243
+ const ret = wasm.allagentevents_prekeySources(this.__wbg_ptr);
244
+ return ret;
443
245
  }
444
246
  }
445
- if (Symbol.dispose) Agent.prototype[Symbol.dispose] = Agent.prototype.free;
446
-
447
- const ArchiveFinalization = (typeof FinalizationRegistry === 'undefined')
448
- ? { register: () => {}, unregister: () => {} }
449
- : new FinalizationRegistry(ptr => wasm.__wbg_archive_free(ptr >>> 0, 1));
247
+ if (Symbol.dispose) AllAgentEvents.prototype[Symbol.dispose] = AllAgentEvents.prototype.free;
450
248
 
451
249
  export class Archive {
452
-
453
250
  static __wrap(ptr) {
454
- ptr = ptr >>> 0;
455
251
  const obj = Object.create(Archive.prototype);
456
252
  obj.__wbg_ptr = ptr;
457
253
  ArchiveFinalization.register(obj, obj.__wbg_ptr, obj);
458
254
  return obj;
459
255
  }
460
-
461
256
  __destroy_into_raw() {
462
257
  const ptr = this.__wbg_ptr;
463
258
  this.__wbg_ptr = 0;
464
259
  ArchiveFinalization.unregister(this);
465
260
  return ptr;
466
261
  }
467
-
468
262
  free() {
469
263
  const ptr = this.__destroy_into_raw();
470
264
  wasm.__wbg_archive_free(ptr, 0);
471
265
  }
472
- /**
473
- * @param {Uint8Array} bytes
474
- */
475
- constructor(bytes) {
476
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
477
- const len0 = WASM_VECTOR_LEN;
478
- const ret = wasm.archive_try_from_bytes(ptr0, len0);
479
- if (ret[2]) {
480
- throw takeFromExternrefTable0(ret[1]);
481
- }
482
- this.__wbg_ptr = ret[0] >>> 0;
483
- ArchiveFinalization.register(this, this.__wbg_ptr, this);
484
- return this;
485
- }
486
266
  /**
487
267
  * @returns {Uint8Array}
488
268
  */
@@ -499,42 +279,45 @@ export class Archive {
499
279
  * @param {CiphertextStore} ciphertext_store
500
280
  * @param {Signer} signer
501
281
  * @param {Function} event_handler
502
- * @returns {Keyhive}
282
+ * @returns {Promise<Keyhive>}
503
283
  */
504
284
  tryToKeyhive(ciphertext_store, signer, event_handler) {
505
285
  _assertClass(ciphertext_store, CiphertextStore);
506
286
  var ptr0 = ciphertext_store.__destroy_into_raw();
507
287
  _assertClass(signer, Signer);
508
288
  const ret = wasm.archive_tryToKeyhive(this.__wbg_ptr, ptr0, signer.__wbg_ptr, event_handler);
289
+ return ret;
290
+ }
291
+ /**
292
+ * @param {Uint8Array} bytes
293
+ */
294
+ constructor(bytes) {
295
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
296
+ const len0 = WASM_VECTOR_LEN;
297
+ const ret = wasm.archive_try_from_bytes(ptr0, len0);
509
298
  if (ret[2]) {
510
299
  throw takeFromExternrefTable0(ret[1]);
511
300
  }
512
- return Keyhive.__wrap(ret[0]);
301
+ this.__wbg_ptr = ret[0];
302
+ ArchiveFinalization.register(this, this.__wbg_ptr, this);
303
+ return this;
513
304
  }
514
305
  }
515
306
  if (Symbol.dispose) Archive.prototype[Symbol.dispose] = Archive.prototype.free;
516
307
 
517
- const CannotParseEd25519SigningKeyFinalization = (typeof FinalizationRegistry === 'undefined')
518
- ? { register: () => {}, unregister: () => {} }
519
- : new FinalizationRegistry(ptr => wasm.__wbg_cannotparseed25519signingkey_free(ptr >>> 0, 1));
520
-
521
308
  export class CannotParseEd25519SigningKey {
522
-
523
309
  static __wrap(ptr) {
524
- ptr = ptr >>> 0;
525
310
  const obj = Object.create(CannotParseEd25519SigningKey.prototype);
526
311
  obj.__wbg_ptr = ptr;
527
312
  CannotParseEd25519SigningKeyFinalization.register(obj, obj.__wbg_ptr, obj);
528
313
  return obj;
529
314
  }
530
-
531
315
  __destroy_into_raw() {
532
316
  const ptr = this.__wbg_ptr;
533
317
  this.__wbg_ptr = 0;
534
318
  CannotParseEd25519SigningKeyFinalization.unregister(this);
535
319
  return ptr;
536
320
  }
537
-
538
321
  free() {
539
322
  const ptr = this.__destroy_into_raw();
540
323
  wasm.__wbg_cannotparseed25519signingkey_free(ptr, 0);
@@ -542,27 +325,19 @@ export class CannotParseEd25519SigningKey {
542
325
  }
543
326
  if (Symbol.dispose) CannotParseEd25519SigningKey.prototype[Symbol.dispose] = CannotParseEd25519SigningKey.prototype.free;
544
327
 
545
- const CannotParseIdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
546
- ? { register: () => {}, unregister: () => {} }
547
- : new FinalizationRegistry(ptr => wasm.__wbg_cannotparseidentifier_free(ptr >>> 0, 1));
548
-
549
328
  export class CannotParseIdentifier {
550
-
551
329
  static __wrap(ptr) {
552
- ptr = ptr >>> 0;
553
330
  const obj = Object.create(CannotParseIdentifier.prototype);
554
331
  obj.__wbg_ptr = ptr;
555
332
  CannotParseIdentifierFinalization.register(obj, obj.__wbg_ptr, obj);
556
333
  return obj;
557
334
  }
558
-
559
335
  __destroy_into_raw() {
560
336
  const ptr = this.__wbg_ptr;
561
337
  this.__wbg_ptr = 0;
562
338
  CannotParseIdentifierFinalization.unregister(this);
563
339
  return ptr;
564
340
  }
565
-
566
341
  free() {
567
342
  const ptr = this.__destroy_into_raw();
568
343
  wasm.__wbg_cannotparseidentifier_free(ptr, 0);
@@ -570,38 +345,23 @@ export class CannotParseIdentifier {
570
345
  }
571
346
  if (Symbol.dispose) CannotParseIdentifier.prototype[Symbol.dispose] = CannotParseIdentifier.prototype.free;
572
347
 
573
- const CapabilityFinalization = (typeof FinalizationRegistry === 'undefined')
574
- ? { register: () => {}, unregister: () => {} }
575
- : new FinalizationRegistry(ptr => wasm.__wbg_capability_free(ptr >>> 0, 1));
576
-
577
348
  export class Capability {
578
-
579
349
  static __wrap(ptr) {
580
- ptr = ptr >>> 0;
581
350
  const obj = Object.create(Capability.prototype);
582
351
  obj.__wbg_ptr = ptr;
583
352
  CapabilityFinalization.register(obj, obj.__wbg_ptr, obj);
584
353
  return obj;
585
354
  }
586
-
587
355
  __destroy_into_raw() {
588
356
  const ptr = this.__wbg_ptr;
589
357
  this.__wbg_ptr = 0;
590
358
  CapabilityFinalization.unregister(this);
591
359
  return ptr;
592
360
  }
593
-
594
361
  free() {
595
362
  const ptr = this.__destroy_into_raw();
596
363
  wasm.__wbg_capability_free(ptr, 0);
597
364
  }
598
- /**
599
- * @returns {Agent}
600
- */
601
- get who() {
602
- const ret = wasm.capability_who(this.__wbg_ptr);
603
- return Agent.__wrap(ret);
604
- }
605
365
  /**
606
366
  * @returns {Access}
607
367
  */
@@ -616,30 +376,29 @@ export class Capability {
616
376
  const ret = wasm.capability_proof(this.__wbg_ptr);
617
377
  return SignedDelegation.__wrap(ret);
618
378
  }
379
+ /**
380
+ * @returns {Agent}
381
+ */
382
+ get who() {
383
+ const ret = wasm.capability_who(this.__wbg_ptr);
384
+ return Agent.__wrap(ret);
385
+ }
619
386
  }
620
387
  if (Symbol.dispose) Capability.prototype[Symbol.dispose] = Capability.prototype.free;
621
388
 
622
- const CgkaOperationFinalization = (typeof FinalizationRegistry === 'undefined')
623
- ? { register: () => {}, unregister: () => {} }
624
- : new FinalizationRegistry(ptr => wasm.__wbg_cgkaoperation_free(ptr >>> 0, 1));
625
-
626
389
  export class CgkaOperation {
627
-
628
390
  static __wrap(ptr) {
629
- ptr = ptr >>> 0;
630
391
  const obj = Object.create(CgkaOperation.prototype);
631
392
  obj.__wbg_ptr = ptr;
632
393
  CgkaOperationFinalization.register(obj, obj.__wbg_ptr, obj);
633
394
  return obj;
634
395
  }
635
-
636
396
  __destroy_into_raw() {
637
397
  const ptr = this.__wbg_ptr;
638
398
  this.__wbg_ptr = 0;
639
399
  CgkaOperationFinalization.unregister(this);
640
400
  return ptr;
641
401
  }
642
-
643
402
  free() {
644
403
  const ptr = this.__destroy_into_raw();
645
404
  wasm.__wbg_cgkaoperation_free(ptr, 0);
@@ -662,136 +421,146 @@ export class CgkaOperation {
662
421
  }
663
422
  if (Symbol.dispose) CgkaOperation.prototype[Symbol.dispose] = CgkaOperation.prototype.free;
664
423
 
665
- const ChangeRefFinalization = (typeof FinalizationRegistry === 'undefined')
666
- ? { register: () => {}, unregister: () => {} }
667
- : new FinalizationRegistry(ptr => wasm.__wbg_changeref_free(ptr >>> 0, 1));
668
-
669
- export class ChangeRef {
670
-
424
+ export class ChangeId {
671
425
  static __wrap(ptr) {
672
- ptr = ptr >>> 0;
673
- const obj = Object.create(ChangeRef.prototype);
426
+ const obj = Object.create(ChangeId.prototype);
674
427
  obj.__wbg_ptr = ptr;
675
- ChangeRefFinalization.register(obj, obj.__wbg_ptr, obj);
428
+ ChangeIdFinalization.register(obj, obj.__wbg_ptr, obj);
676
429
  return obj;
677
430
  }
678
-
679
431
  static __unwrap(jsValue) {
680
- if (!(jsValue instanceof ChangeRef)) {
432
+ if (!(jsValue instanceof ChangeId)) {
681
433
  return 0;
682
434
  }
683
435
  return jsValue.__destroy_into_raw();
684
436
  }
685
-
686
437
  __destroy_into_raw() {
687
438
  const ptr = this.__wbg_ptr;
688
439
  this.__wbg_ptr = 0;
689
- ChangeRefFinalization.unregister(this);
440
+ ChangeIdFinalization.unregister(this);
690
441
  return ptr;
691
442
  }
692
-
693
443
  free() {
694
444
  const ptr = this.__destroy_into_raw();
695
- wasm.__wbg_changeref_free(ptr, 0);
445
+ wasm.__wbg_changeid_free(ptr, 0);
696
446
  }
697
447
  /**
698
- * @param {Uint8Array} bytes
448
+ * Upcasts; to the JS-import type for [`JsChangeId`].
449
+ * @returns {ChangeId}
699
450
  */
700
- constructor(bytes) {
701
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
702
- const len0 = WASM_VECTOR_LEN;
703
- const ret = wasm.changeref_new(ptr0, len0);
704
- this.__wbg_ptr = ret >>> 0;
705
- ChangeRefFinalization.register(this, this.__wbg_ptr, this);
706
- return this;
451
+ __wasm_refgen_toJsChangeId() {
452
+ const ret = wasm.changeid___wasm_refgen_toJsChangeId(this.__wbg_ptr);
453
+ return ChangeId.__wrap(ret);
707
454
  }
708
455
  /**
709
456
  * @returns {Uint8Array}
710
457
  */
711
458
  get bytes() {
712
- const ret = wasm.changeref_bytes(this.__wbg_ptr);
459
+ const ret = wasm.changeid_bytes(this.__wbg_ptr);
713
460
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
714
461
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
715
462
  return v1;
716
463
  }
464
+ /**
465
+ * @param {Uint8Array} bytes
466
+ */
467
+ constructor(bytes) {
468
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
469
+ const len0 = WASM_VECTOR_LEN;
470
+ const ret = wasm.changeid_new(ptr0, len0);
471
+ this.__wbg_ptr = ret;
472
+ ChangeIdFinalization.register(this, this.__wbg_ptr, this);
473
+ return this;
474
+ }
717
475
  }
718
- if (Symbol.dispose) ChangeRef.prototype[Symbol.dispose] = ChangeRef.prototype.free;
719
-
720
- const CiphertextStoreFinalization = (typeof FinalizationRegistry === 'undefined')
721
- ? { register: () => {}, unregister: () => {} }
722
- : new FinalizationRegistry(ptr => wasm.__wbg_ciphertextstore_free(ptr >>> 0, 1));
476
+ if (Symbol.dispose) ChangeId.prototype[Symbol.dispose] = ChangeId.prototype.free;
723
477
 
724
478
  export class CiphertextStore {
725
-
726
479
  static __wrap(ptr) {
727
- ptr = ptr >>> 0;
728
480
  const obj = Object.create(CiphertextStore.prototype);
729
481
  obj.__wbg_ptr = ptr;
730
482
  CiphertextStoreFinalization.register(obj, obj.__wbg_ptr, obj);
731
483
  return obj;
732
484
  }
733
-
734
485
  __destroy_into_raw() {
735
486
  const ptr = this.__wbg_ptr;
736
487
  this.__wbg_ptr = 0;
737
488
  CiphertextStoreFinalization.unregister(this);
738
489
  return ptr;
739
490
  }
740
-
741
491
  free() {
742
492
  const ptr = this.__destroy_into_raw();
743
493
  wasm.__wbg_ciphertextstore_free(ptr, 0);
744
494
  }
745
495
  /**
496
+ * @param {Storage} storage
746
497
  * @returns {CiphertextStore}
747
498
  */
748
- static newInMemory() {
749
- const ret = wasm.ciphertextstore_newInMemory();
499
+ static newFromWebStorage(storage) {
500
+ const ret = wasm.ciphertextstore_newFromWebStorage(storage);
750
501
  return CiphertextStore.__wrap(ret);
751
502
  }
752
503
  /**
753
- * @param {Storage} storage
754
504
  * @returns {CiphertextStore}
755
505
  */
756
- static newFromWebStorage(storage) {
757
- const ret = wasm.ciphertextstore_newFromWebStorage(storage);
506
+ static newInMemory() {
507
+ const ret = wasm.ciphertextstore_newInMemory();
758
508
  return CiphertextStore.__wrap(ret);
759
509
  }
760
510
  }
761
511
  if (Symbol.dispose) CiphertextStore.prototype[Symbol.dispose] = CiphertextStore.prototype.free;
762
512
 
763
- const ContactCardFinalization = (typeof FinalizationRegistry === 'undefined')
764
- ? { register: () => {}, unregister: () => {} }
765
- : new FinalizationRegistry(ptr => wasm.__wbg_contactcard_free(ptr >>> 0, 1));
766
-
767
513
  export class ContactCard {
768
-
769
514
  static __wrap(ptr) {
770
- ptr = ptr >>> 0;
771
515
  const obj = Object.create(ContactCard.prototype);
772
516
  obj.__wbg_ptr = ptr;
773
517
  ContactCardFinalization.register(obj, obj.__wbg_ptr, obj);
774
518
  return obj;
775
519
  }
776
-
777
520
  __destroy_into_raw() {
778
521
  const ptr = this.__wbg_ptr;
779
522
  this.__wbg_ptr = 0;
780
523
  ContactCardFinalization.unregister(this);
781
524
  return ptr;
782
525
  }
783
-
784
526
  free() {
785
527
  const ptr = this.__destroy_into_raw();
786
528
  wasm.__wbg_contactcard_free(ptr, 0);
787
529
  }
788
530
  /**
789
- * @returns {IndividualId}
531
+ * @param {string} json
532
+ * @returns {ContactCard}
533
+ */
534
+ static fromJson(json) {
535
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
536
+ const len0 = WASM_VECTOR_LEN;
537
+ const ret = wasm.contactcard_fromJson(ptr0, len0);
538
+ if (ret[2]) {
539
+ throw takeFromExternrefTable0(ret[1]);
540
+ }
541
+ return ContactCard.__wrap(ret[0]);
542
+ }
543
+ /**
544
+ * @returns {Identifier}
790
545
  */
791
546
  get id() {
792
547
  const ret = wasm.contactcard_id(this.__wbg_ptr);
548
+ return Identifier.__wrap(ret);
549
+ }
550
+ /**
551
+ * @returns {IndividualId}
552
+ */
553
+ get individualId() {
554
+ const ret = wasm.contactcard_individualId(this.__wbg_ptr);
793
555
  return IndividualId.__wrap(ret);
794
556
  }
557
+ /**
558
+ * @returns {Event}
559
+ */
560
+ get op() {
561
+ const ret = wasm.contactcard_op(this.__wbg_ptr);
562
+ return Event.__wrap(ret);
563
+ }
795
564
  /**
796
565
  * @returns {ShareKey}
797
566
  */
@@ -808,19 +577,6 @@ export class ContactCard {
808
577
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
809
578
  return v1;
810
579
  }
811
- /**
812
- * @param {string} json
813
- * @returns {ContactCard}
814
- */
815
- static fromJson(json) {
816
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
817
- const len0 = WASM_VECTOR_LEN;
818
- const ret = wasm.contactcard_fromJson(ptr0, len0);
819
- if (ret[2]) {
820
- throw takeFromExternrefTable0(ret[1]);
821
- }
822
- return ContactCard.__wrap(ret[0]);
823
- }
824
580
  /**
825
581
  * @returns {string}
826
582
  */
@@ -845,37 +601,29 @@ export class ContactCard {
845
601
  }
846
602
  if (Symbol.dispose) ContactCard.prototype[Symbol.dispose] = ContactCard.prototype.free;
847
603
 
848
- const DelegationFinalization = (typeof FinalizationRegistry === 'undefined')
849
- ? { register: () => {}, unregister: () => {} }
850
- : new FinalizationRegistry(ptr => wasm.__wbg_delegation_free(ptr >>> 0, 1));
851
-
852
604
  export class Delegation {
853
-
854
605
  static __wrap(ptr) {
855
- ptr = ptr >>> 0;
856
606
  const obj = Object.create(Delegation.prototype);
857
607
  obj.__wbg_ptr = ptr;
858
608
  DelegationFinalization.register(obj, obj.__wbg_ptr, obj);
859
609
  return obj;
860
610
  }
861
-
862
611
  __destroy_into_raw() {
863
612
  const ptr = this.__wbg_ptr;
864
613
  this.__wbg_ptr = 0;
865
614
  DelegationFinalization.unregister(this);
866
615
  return ptr;
867
616
  }
868
-
869
617
  free() {
870
618
  const ptr = this.__destroy_into_raw();
871
619
  wasm.__wbg_delegation_free(ptr, 0);
872
620
  }
873
621
  /**
874
- * @returns {Agent}
622
+ * @returns {History}
875
623
  */
876
- get delegate() {
877
- const ret = wasm.delegation_delegate(this.__wbg_ptr);
878
- return Agent.__wrap(ret);
624
+ get after() {
625
+ const ret = wasm.delegation_after(this.__wbg_ptr);
626
+ return History.__wrap(ret);
879
627
  }
880
628
  /**
881
629
  * @returns {Access}
@@ -884,6 +632,13 @@ export class Delegation {
884
632
  const ret = wasm.delegation_can(this.__wbg_ptr);
885
633
  return Access.__wrap(ret);
886
634
  }
635
+ /**
636
+ * @returns {Agent}
637
+ */
638
+ get delegate() {
639
+ const ret = wasm.delegation_delegate(this.__wbg_ptr);
640
+ return Agent.__wrap(ret);
641
+ }
887
642
  /**
888
643
  * @returns {SignedDelegation | undefined}
889
644
  */
@@ -891,85 +646,42 @@ export class Delegation {
891
646
  const ret = wasm.delegation_proof(this.__wbg_ptr);
892
647
  return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
893
648
  }
894
- /**
895
- * @returns {History}
896
- */
897
- get after() {
898
- const ret = wasm.delegation_after(this.__wbg_ptr);
899
- return History.__wrap(ret);
900
- }
901
649
  }
902
650
  if (Symbol.dispose) Delegation.prototype[Symbol.dispose] = Delegation.prototype.free;
903
651
 
904
- const DelegationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
905
- ? { register: () => {}, unregister: () => {} }
906
- : new FinalizationRegistry(ptr => wasm.__wbg_delegationerror_free(ptr >>> 0, 1));
907
-
908
- export class DelegationError {
909
-
910
- __destroy_into_raw() {
911
- const ptr = this.__wbg_ptr;
912
- this.__wbg_ptr = 0;
913
- DelegationErrorFinalization.unregister(this);
914
- return ptr;
915
- }
916
-
917
- free() {
918
- const ptr = this.__destroy_into_raw();
919
- wasm.__wbg_delegationerror_free(ptr, 0);
920
- }
921
- }
922
- if (Symbol.dispose) DelegationError.prototype[Symbol.dispose] = DelegationError.prototype.free;
923
-
924
- const DocContentRefsFinalization = (typeof FinalizationRegistry === 'undefined')
925
- ? { register: () => {}, unregister: () => {} }
926
- : new FinalizationRegistry(ptr => wasm.__wbg_doccontentrefs_free(ptr >>> 0, 1));
927
-
928
652
  export class DocContentRefs {
929
-
930
653
  static __wrap(ptr) {
931
- ptr = ptr >>> 0;
932
654
  const obj = Object.create(DocContentRefs.prototype);
933
655
  obj.__wbg_ptr = ptr;
934
656
  DocContentRefsFinalization.register(obj, obj.__wbg_ptr, obj);
935
657
  return obj;
936
658
  }
937
-
938
659
  __destroy_into_raw() {
939
660
  const ptr = this.__wbg_ptr;
940
661
  this.__wbg_ptr = 0;
941
662
  DocContentRefsFinalization.unregister(this);
942
663
  return ptr;
943
664
  }
944
-
945
665
  free() {
946
666
  const ptr = this.__destroy_into_raw();
947
667
  wasm.__wbg_doccontentrefs_free(ptr, 0);
948
668
  }
949
669
  /**
950
- * @param {DocumentId} doc_id
951
- * @param {ChangeRef[]} change_hashes
670
+ * @param {ChangeId} hash
671
+ * @returns {Promise<void>}
952
672
  */
953
- constructor(doc_id, change_hashes) {
954
- _assertClass(doc_id, DocumentId);
955
- var ptr0 = doc_id.__destroy_into_raw();
956
- const ptr1 = passArrayJsValueToWasm0(change_hashes, wasm.__wbindgen_malloc);
957
- const len1 = WASM_VECTOR_LEN;
958
- const ret = wasm.doccontentrefs_new(ptr0, ptr1, len1);
959
- if (ret[2]) {
960
- throw takeFromExternrefTable0(ret[1]);
961
- }
962
- this.__wbg_ptr = ret[0] >>> 0;
963
- DocContentRefsFinalization.register(this, this.__wbg_ptr, this);
964
- return this;
673
+ addChangeId(hash) {
674
+ _assertClass(hash, ChangeId);
675
+ var ptr0 = hash.__destroy_into_raw();
676
+ const ret = wasm.doccontentrefs_addChangeId(this.__wbg_ptr, ptr0);
677
+ return ret;
965
678
  }
966
679
  /**
967
- * @param {ChangeRef} hash
680
+ * @returns {Promise<ChangeId[]>}
968
681
  */
969
- addChangeRef(hash) {
970
- _assertClass(hash, ChangeRef);
971
- var ptr0 = hash.__destroy_into_raw();
972
- wasm.doccontentrefs_addChangeRef(this.__wbg_ptr, ptr0);
682
+ get change_hashes() {
683
+ const ret = wasm.doccontentrefs_change_hashes(this.__wbg_ptr);
684
+ return ret;
973
685
  }
974
686
  /**
975
687
  * @returns {DocumentId}
@@ -979,55 +691,49 @@ export class DocContentRefs {
979
691
  return DocumentId.__wrap(ret);
980
692
  }
981
693
  /**
982
- * @returns {ChangeRef[]}
694
+ * @param {DocumentId} doc_id
695
+ * @param {ChangeId[]} change_hashes
983
696
  */
984
- get change_hashes() {
985
- const ret = wasm.doccontentrefs_change_hashes(this.__wbg_ptr);
986
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
987
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
988
- return v1;
697
+ constructor(doc_id, change_hashes) {
698
+ _assertClass(doc_id, DocumentId);
699
+ var ptr0 = doc_id.__destroy_into_raw();
700
+ const ptr1 = passArrayJsValueToWasm0(change_hashes, wasm.__wbindgen_malloc);
701
+ const len1 = WASM_VECTOR_LEN;
702
+ const ret = wasm.doccontentrefs_new(ptr0, ptr1, len1);
703
+ if (ret[2]) {
704
+ throw takeFromExternrefTable0(ret[1]);
705
+ }
706
+ this.__wbg_ptr = ret[0];
707
+ DocContentRefsFinalization.register(this, this.__wbg_ptr, this);
708
+ return this;
989
709
  }
990
710
  }
991
711
  if (Symbol.dispose) DocContentRefs.prototype[Symbol.dispose] = DocContentRefs.prototype.free;
992
712
 
993
- const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
994
- ? { register: () => {}, unregister: () => {} }
995
- : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr >>> 0, 1));
996
-
997
713
  export class Document {
998
-
999
714
  static __wrap(ptr) {
1000
- ptr = ptr >>> 0;
1001
715
  const obj = Object.create(Document.prototype);
1002
716
  obj.__wbg_ptr = ptr;
1003
717
  DocumentFinalization.register(obj, obj.__wbg_ptr, obj);
1004
718
  return obj;
1005
719
  }
1006
-
1007
- static __unwrap(jsValue) {
1008
- if (!(jsValue instanceof Document)) {
1009
- return 0;
1010
- }
1011
- return jsValue.__destroy_into_raw();
1012
- }
1013
-
1014
720
  __destroy_into_raw() {
1015
721
  const ptr = this.__wbg_ptr;
1016
722
  this.__wbg_ptr = 0;
1017
723
  DocumentFinalization.unregister(this);
1018
724
  return ptr;
1019
725
  }
1020
-
1021
726
  free() {
1022
727
  const ptr = this.__destroy_into_raw();
1023
728
  wasm.__wbg_document_free(ptr, 0);
1024
729
  }
1025
730
  /**
1026
- * @returns {Identifier}
731
+ * Upcasts; to the JS-import type for [`JsDocument`].
732
+ * @returns {Document}
1027
733
  */
1028
- get id() {
1029
- const ret = wasm.document_id(this.__wbg_ptr);
1030
- return Identifier.__wrap(ret);
734
+ __wasm_refgen_toJsDocument() {
735
+ const ret = wasm.document___wasm_refgen_toJsDocument(this.__wbg_ptr);
736
+ return Document.__wrap(ret);
1031
737
  }
1032
738
  /**
1033
739
  * @returns {DocumentId}
@@ -1037,11 +743,18 @@ export class Document {
1037
743
  return DocumentId.__wrap(ret);
1038
744
  }
1039
745
  /**
1040
- * @returns {Peer}
746
+ * @returns {Identifier}
1041
747
  */
1042
- toPeer() {
1043
- const ret = wasm.document_toPeer(this.__wbg_ptr);
1044
- return Peer.__wrap(ret);
748
+ get id() {
749
+ const ret = wasm.document_id(this.__wbg_ptr);
750
+ return Identifier.__wrap(ret);
751
+ }
752
+ /**
753
+ * @returns {Promise<Capability[]>}
754
+ */
755
+ members() {
756
+ const ret = wasm.document_members(this.__wbg_ptr);
757
+ return ret;
1045
758
  }
1046
759
  /**
1047
760
  * @returns {Agent}
@@ -1057,30 +770,29 @@ export class Document {
1057
770
  const ret = wasm.document_toMembered(this.__wbg_ptr);
1058
771
  return Membered.__wrap(ret);
1059
772
  }
773
+ /**
774
+ * @returns {Peer}
775
+ */
776
+ toPeer() {
777
+ const ret = wasm.document_toPeer(this.__wbg_ptr);
778
+ return Peer.__wrap(ret);
779
+ }
1060
780
  }
1061
781
  if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
1062
782
 
1063
- const DocumentIdFinalization = (typeof FinalizationRegistry === 'undefined')
1064
- ? { register: () => {}, unregister: () => {} }
1065
- : new FinalizationRegistry(ptr => wasm.__wbg_documentid_free(ptr >>> 0, 1));
1066
-
1067
783
  export class DocumentId {
1068
-
1069
784
  static __wrap(ptr) {
1070
- ptr = ptr >>> 0;
1071
785
  const obj = Object.create(DocumentId.prototype);
1072
786
  obj.__wbg_ptr = ptr;
1073
787
  DocumentIdFinalization.register(obj, obj.__wbg_ptr, obj);
1074
788
  return obj;
1075
789
  }
1076
-
1077
790
  __destroy_into_raw() {
1078
791
  const ptr = this.__wbg_ptr;
1079
792
  this.__wbg_ptr = 0;
1080
793
  DocumentIdFinalization.unregister(this);
1081
794
  return ptr;
1082
795
  }
1083
-
1084
796
  free() {
1085
797
  const ptr = this.__destroy_into_raw();
1086
798
  wasm.__wbg_documentid_free(ptr, 0);
@@ -1095,10 +807,26 @@ export class DocumentId {
1095
807
  if (ret[2]) {
1096
808
  throw takeFromExternrefTable0(ret[1]);
1097
809
  }
1098
- this.__wbg_ptr = ret[0] >>> 0;
810
+ this.__wbg_ptr = ret[0];
1099
811
  DocumentIdFinalization.register(this, this.__wbg_ptr, this);
1100
812
  return this;
1101
813
  }
814
+ /**
815
+ * @returns {Uint8Array}
816
+ */
817
+ toBytes() {
818
+ const ret = wasm.documentid_toBytes(this.__wbg_ptr);
819
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
820
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
821
+ return v1;
822
+ }
823
+ /**
824
+ * @returns {any}
825
+ */
826
+ toJsValue() {
827
+ const ret = wasm.documentid_toJsValue(this.__wbg_ptr);
828
+ return ret;
829
+ }
1102
830
  /**
1103
831
  * @returns {string}
1104
832
  */
@@ -1114,46 +842,22 @@ export class DocumentId {
1114
842
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1115
843
  }
1116
844
  }
1117
- /**
1118
- * @returns {any}
1119
- */
1120
- toJsValue() {
1121
- const ret = wasm.documentid_toJsValue(this.__wbg_ptr);
1122
- return ret;
1123
- }
1124
- /**
1125
- * @returns {Uint8Array}
1126
- */
1127
- toBytes() {
1128
- const ret = wasm.documentid_toBytes(this.__wbg_ptr);
1129
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1130
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1131
- return v1;
1132
- }
1133
845
  }
1134
846
  if (Symbol.dispose) DocumentId.prototype[Symbol.dispose] = DocumentId.prototype.free;
1135
847
 
1136
- const EncryptedFinalization = (typeof FinalizationRegistry === 'undefined')
1137
- ? { register: () => {}, unregister: () => {} }
1138
- : new FinalizationRegistry(ptr => wasm.__wbg_encrypted_free(ptr >>> 0, 1));
1139
-
1140
848
  export class Encrypted {
1141
-
1142
849
  static __wrap(ptr) {
1143
- ptr = ptr >>> 0;
1144
850
  const obj = Object.create(Encrypted.prototype);
1145
851
  obj.__wbg_ptr = ptr;
1146
852
  EncryptedFinalization.register(obj, obj.__wbg_ptr, obj);
1147
853
  return obj;
1148
854
  }
1149
-
1150
855
  __destroy_into_raw() {
1151
856
  const ptr = this.__wbg_ptr;
1152
857
  this.__wbg_ptr = 0;
1153
858
  EncryptedFinalization.unregister(this);
1154
859
  return ptr;
1155
860
  }
1156
-
1157
861
  free() {
1158
862
  const ptr = this.__destroy_into_raw();
1159
863
  wasm.__wbg_encrypted_free(ptr, 0);
@@ -1161,8 +865,8 @@ export class Encrypted {
1161
865
  /**
1162
866
  * @returns {Uint8Array}
1163
867
  */
1164
- toBytes() {
1165
- const ret = wasm.encrypted_toBytes(this.__wbg_ptr);
868
+ get ciphertext() {
869
+ const ret = wasm.encrypted_ciphertext(this.__wbg_ptr);
1166
870
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1167
871
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1168
872
  return v1;
@@ -1170,12 +874,25 @@ export class Encrypted {
1170
874
  /**
1171
875
  * @returns {Uint8Array}
1172
876
  */
1173
- get ciphertext() {
1174
- const ret = wasm.encrypted_ciphertext(this.__wbg_ptr);
877
+ get content_ref() {
878
+ const ret = wasm.encrypted_content_ref(this.__wbg_ptr);
1175
879
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1176
880
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1177
881
  return v1;
1178
882
  }
883
+ /**
884
+ * @param {Uint8Array} bytes
885
+ * @returns {Encrypted}
886
+ */
887
+ static fromBytes(bytes) {
888
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
889
+ const len0 = WASM_VECTOR_LEN;
890
+ const ret = wasm.encrypted_fromBytes(ptr0, len0);
891
+ if (ret[2]) {
892
+ throw takeFromExternrefTable0(ret[1]);
893
+ }
894
+ return Encrypted.__wrap(ret[0]);
895
+ }
1179
896
  /**
1180
897
  * @returns {Uint8Array}
1181
898
  */
@@ -1197,8 +914,8 @@ export class Encrypted {
1197
914
  /**
1198
915
  * @returns {Uint8Array}
1199
916
  */
1200
- get content_ref() {
1201
- const ret = wasm.encrypted_content_ref(this.__wbg_ptr);
917
+ get pred_refs() {
918
+ const ret = wasm.encrypted_pred_refs(this.__wbg_ptr);
1202
919
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1203
920
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1204
921
  return v1;
@@ -1206,8 +923,20 @@ export class Encrypted {
1206
923
  /**
1207
924
  * @returns {Uint8Array}
1208
925
  */
1209
- get pred_refs() {
1210
- const ret = wasm.encrypted_pred_refs(this.__wbg_ptr);
926
+ serialize() {
927
+ const ret = wasm.encrypted_serialize(this.__wbg_ptr);
928
+ if (ret[3]) {
929
+ throw takeFromExternrefTable0(ret[2]);
930
+ }
931
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
932
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
933
+ return v1;
934
+ }
935
+ /**
936
+ * @returns {Uint8Array}
937
+ */
938
+ toBytes() {
939
+ const ret = wasm.encrypted_toBytes(this.__wbg_ptr);
1211
940
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1212
941
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1213
942
  return v1;
@@ -1215,27 +944,19 @@ export class Encrypted {
1215
944
  }
1216
945
  if (Symbol.dispose) Encrypted.prototype[Symbol.dispose] = Encrypted.prototype.free;
1217
946
 
1218
- const EncryptedContentWithUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
1219
- ? { register: () => {}, unregister: () => {} }
1220
- : new FinalizationRegistry(ptr => wasm.__wbg_encryptedcontentwithupdate_free(ptr >>> 0, 1));
1221
-
1222
947
  export class EncryptedContentWithUpdate {
1223
-
1224
948
  static __wrap(ptr) {
1225
- ptr = ptr >>> 0;
1226
949
  const obj = Object.create(EncryptedContentWithUpdate.prototype);
1227
950
  obj.__wbg_ptr = ptr;
1228
951
  EncryptedContentWithUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
1229
952
  return obj;
1230
953
  }
1231
-
1232
954
  __destroy_into_raw() {
1233
955
  const ptr = this.__wbg_ptr;
1234
956
  this.__wbg_ptr = 0;
1235
957
  EncryptedContentWithUpdateFinalization.unregister(this);
1236
958
  return ptr;
1237
959
  }
1238
-
1239
960
  free() {
1240
961
  const ptr = this.__destroy_into_raw();
1241
962
  wasm.__wbg_encryptedcontentwithupdate_free(ptr, 0);
@@ -1257,46 +978,23 @@ export class EncryptedContentWithUpdate {
1257
978
  }
1258
979
  if (Symbol.dispose) EncryptedContentWithUpdate.prototype[Symbol.dispose] = EncryptedContentWithUpdate.prototype.free;
1259
980
 
1260
- const EventFinalization = (typeof FinalizationRegistry === 'undefined')
1261
- ? { register: () => {}, unregister: () => {} }
1262
- : new FinalizationRegistry(ptr => wasm.__wbg_event_free(ptr >>> 0, 1));
1263
-
1264
981
  export class Event {
1265
-
1266
982
  static __wrap(ptr) {
1267
- ptr = ptr >>> 0;
1268
983
  const obj = Object.create(Event.prototype);
1269
984
  obj.__wbg_ptr = ptr;
1270
985
  EventFinalization.register(obj, obj.__wbg_ptr, obj);
1271
986
  return obj;
1272
987
  }
1273
-
1274
988
  __destroy_into_raw() {
1275
989
  const ptr = this.__wbg_ptr;
1276
990
  this.__wbg_ptr = 0;
1277
991
  EventFinalization.unregister(this);
1278
992
  return ptr;
1279
993
  }
1280
-
1281
994
  free() {
1282
995
  const ptr = this.__destroy_into_raw();
1283
996
  wasm.__wbg_event_free(ptr, 0);
1284
997
  }
1285
- /**
1286
- * @returns {string}
1287
- */
1288
- get variant() {
1289
- let deferred1_0;
1290
- let deferred1_1;
1291
- try {
1292
- const ret = wasm.event_variant(this.__wbg_ptr);
1293
- deferred1_0 = ret[0];
1294
- deferred1_1 = ret[1];
1295
- return getStringFromWasm0(ret[0], ret[1]);
1296
- } finally {
1297
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1298
- }
1299
- }
1300
998
  /**
1301
999
  * @returns {boolean}
1302
1000
  */
@@ -1312,55 +1010,41 @@ export class Event {
1312
1010
  return ret !== 0;
1313
1011
  }
1314
1012
  /**
1315
- * @returns {SignedDelegation | undefined}
1316
- */
1317
- tryIntoSignedDelegation() {
1318
- const ret = wasm.event_tryIntoSignedDelegation(this.__wbg_ptr);
1319
- return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
1320
- }
1321
- /**
1322
- * @returns {SignedRevocation | undefined}
1013
+ * Converts the underlying [`Event`] to a [`StaticEvent`] and then
1014
+ * serializes it.
1015
+ * @returns {Uint8Array}
1323
1016
  */
1324
- tryIntoSignedRevocation() {
1325
- const ret = wasm.event_tryIntoSignedRevocation(this.__wbg_ptr);
1326
- return ret === 0 ? undefined : SignedRevocation.__wrap(ret);
1327
- }
1328
- }
1329
- if (Symbol.dispose) Event.prototype[Symbol.dispose] = Event.prototype.free;
1330
-
1331
- const GenerateDocErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1332
- ? { register: () => {}, unregister: () => {} }
1333
- : new FinalizationRegistry(ptr => wasm.__wbg_generatedocerror_free(ptr >>> 0, 1));
1334
-
1335
- export class GenerateDocError {
1336
-
1337
- static __wrap(ptr) {
1338
- ptr = ptr >>> 0;
1339
- const obj = Object.create(GenerateDocError.prototype);
1340
- obj.__wbg_ptr = ptr;
1341
- GenerateDocErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1342
- return obj;
1343
- }
1344
-
1345
- __destroy_into_raw() {
1346
- const ptr = this.__wbg_ptr;
1347
- this.__wbg_ptr = 0;
1348
- GenerateDocErrorFinalization.unregister(this);
1349
- return ptr;
1017
+ toBytes() {
1018
+ const ret = wasm.event_toBytes(this.__wbg_ptr);
1019
+ if (ret[3]) {
1020
+ throw takeFromExternrefTable0(ret[2]);
1021
+ }
1022
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1023
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1024
+ return v1;
1350
1025
  }
1351
-
1352
- free() {
1353
- const ptr = this.__destroy_into_raw();
1354
- wasm.__wbg_generatedocerror_free(ptr, 0);
1026
+ /**
1027
+ * @returns {SignedDelegation | undefined}
1028
+ */
1029
+ tryIntoSignedDelegation() {
1030
+ const ret = wasm.event_tryIntoSignedDelegation(this.__wbg_ptr);
1031
+ return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
1032
+ }
1033
+ /**
1034
+ * @returns {SignedRevocation | undefined}
1035
+ */
1036
+ tryIntoSignedRevocation() {
1037
+ const ret = wasm.event_tryIntoSignedRevocation(this.__wbg_ptr);
1038
+ return ret === 0 ? undefined : SignedRevocation.__wrap(ret);
1355
1039
  }
1356
1040
  /**
1357
1041
  * @returns {string}
1358
1042
  */
1359
- message() {
1043
+ get variant() {
1360
1044
  let deferred1_0;
1361
1045
  let deferred1_1;
1362
1046
  try {
1363
- const ret = wasm.generatedocerror_message(this.__wbg_ptr);
1047
+ const ret = wasm.event_variant(this.__wbg_ptr);
1364
1048
  deferred1_0 = ret[0];
1365
1049
  deferred1_1 = ret[1];
1366
1050
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1369,29 +1053,21 @@ export class GenerateDocError {
1369
1053
  }
1370
1054
  }
1371
1055
  }
1372
- if (Symbol.dispose) GenerateDocError.prototype[Symbol.dispose] = GenerateDocError.prototype.free;
1373
-
1374
- const GenerateWebCryptoErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1375
- ? { register: () => {}, unregister: () => {} }
1376
- : new FinalizationRegistry(ptr => wasm.__wbg_generatewebcryptoerror_free(ptr >>> 0, 1));
1056
+ if (Symbol.dispose) Event.prototype[Symbol.dispose] = Event.prototype.free;
1377
1057
 
1378
1058
  export class GenerateWebCryptoError {
1379
-
1380
1059
  static __wrap(ptr) {
1381
- ptr = ptr >>> 0;
1382
1060
  const obj = Object.create(GenerateWebCryptoError.prototype);
1383
1061
  obj.__wbg_ptr = ptr;
1384
1062
  GenerateWebCryptoErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1385
1063
  return obj;
1386
1064
  }
1387
-
1388
1065
  __destroy_into_raw() {
1389
1066
  const ptr = this.__wbg_ptr;
1390
1067
  this.__wbg_ptr = 0;
1391
1068
  GenerateWebCryptoErrorFinalization.unregister(this);
1392
1069
  return ptr;
1393
1070
  }
1394
-
1395
1071
  free() {
1396
1072
  const ptr = this.__destroy_into_raw();
1397
1073
  wasm.__wbg_generatewebcryptoerror_free(ptr, 0);
@@ -1414,72 +1090,30 @@ export class GenerateWebCryptoError {
1414
1090
  }
1415
1091
  if (Symbol.dispose) GenerateWebCryptoError.prototype[Symbol.dispose] = GenerateWebCryptoError.prototype.free;
1416
1092
 
1417
- const GetCiphertextErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1418
- ? { register: () => {}, unregister: () => {} }
1419
- : new FinalizationRegistry(ptr => wasm.__wbg_getciphertexterror_free(ptr >>> 0, 1));
1420
-
1421
- export class GetCiphertextError {
1422
-
1423
- __destroy_into_raw() {
1424
- const ptr = this.__wbg_ptr;
1425
- this.__wbg_ptr = 0;
1426
- GetCiphertextErrorFinalization.unregister(this);
1427
- return ptr;
1428
- }
1429
-
1430
- free() {
1431
- const ptr = this.__destroy_into_raw();
1432
- wasm.__wbg_getciphertexterror_free(ptr, 0);
1433
- }
1434
- /**
1435
- * @returns {string}
1436
- */
1437
- get message() {
1438
- let deferred1_0;
1439
- let deferred1_1;
1440
- try {
1441
- const ret = wasm.getciphertexterror_message(this.__wbg_ptr);
1442
- deferred1_0 = ret[0];
1443
- deferred1_1 = ret[1];
1444
- return getStringFromWasm0(ret[0], ret[1]);
1445
- } finally {
1446
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1447
- }
1448
- }
1449
- }
1450
- if (Symbol.dispose) GetCiphertextError.prototype[Symbol.dispose] = GetCiphertextError.prototype.free;
1451
-
1452
- const GroupFinalization = (typeof FinalizationRegistry === 'undefined')
1453
- ? { register: () => {}, unregister: () => {} }
1454
- : new FinalizationRegistry(ptr => wasm.__wbg_group_free(ptr >>> 0, 1));
1455
-
1456
1093
  export class Group {
1457
-
1458
1094
  static __wrap(ptr) {
1459
- ptr = ptr >>> 0;
1460
1095
  const obj = Object.create(Group.prototype);
1461
1096
  obj.__wbg_ptr = ptr;
1462
1097
  GroupFinalization.register(obj, obj.__wbg_ptr, obj);
1463
1098
  return obj;
1464
1099
  }
1465
-
1466
1100
  __destroy_into_raw() {
1467
1101
  const ptr = this.__wbg_ptr;
1468
1102
  this.__wbg_ptr = 0;
1469
1103
  GroupFinalization.unregister(this);
1470
1104
  return ptr;
1471
1105
  }
1472
-
1473
1106
  free() {
1474
1107
  const ptr = this.__destroy_into_raw();
1475
1108
  wasm.__wbg_group_free(ptr, 0);
1476
1109
  }
1477
1110
  /**
1478
- * @returns {Identifier}
1111
+ * Upcasts; to the JS-import type for [`JsGroup`].
1112
+ * @returns {Group}
1479
1113
  */
1480
- get id() {
1481
- const ret = wasm.group_id(this.__wbg_ptr);
1482
- return Identifier.__wrap(ret);
1114
+ __wasm_refgen_toJsGroup() {
1115
+ const ret = wasm.group___wasm_refgen_toJsGroup(this.__wbg_ptr);
1116
+ return Group.__wrap(ret);
1483
1117
  }
1484
1118
  /**
1485
1119
  * @returns {GroupId}
@@ -1489,20 +1123,18 @@ export class Group {
1489
1123
  return GroupId.__wrap(ret);
1490
1124
  }
1491
1125
  /**
1492
- * @returns {Capability[]}
1126
+ * @returns {Identifier}
1493
1127
  */
1494
- get members() {
1495
- const ret = wasm.group_members(this.__wbg_ptr);
1496
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1497
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1498
- return v1;
1128
+ get id() {
1129
+ const ret = wasm.group_id(this.__wbg_ptr);
1130
+ return Identifier.__wrap(ret);
1499
1131
  }
1500
1132
  /**
1501
- * @returns {Peer}
1133
+ * @returns {Promise<Capability[]>}
1502
1134
  */
1503
- toPeer() {
1504
- const ret = wasm.group_toPeer(this.__wbg_ptr);
1505
- return Peer.__wrap(ret);
1135
+ members() {
1136
+ const ret = wasm.group_members(this.__wbg_ptr);
1137
+ return ret;
1506
1138
  }
1507
1139
  /**
1508
1140
  * @returns {Agent}
@@ -1518,30 +1150,29 @@ export class Group {
1518
1150
  const ret = wasm.group_toMembered(this.__wbg_ptr);
1519
1151
  return Membered.__wrap(ret);
1520
1152
  }
1153
+ /**
1154
+ * @returns {Peer}
1155
+ */
1156
+ toPeer() {
1157
+ const ret = wasm.group_toPeer(this.__wbg_ptr);
1158
+ return Peer.__wrap(ret);
1159
+ }
1521
1160
  }
1522
1161
  if (Symbol.dispose) Group.prototype[Symbol.dispose] = Group.prototype.free;
1523
1162
 
1524
- const GroupIdFinalization = (typeof FinalizationRegistry === 'undefined')
1525
- ? { register: () => {}, unregister: () => {} }
1526
- : new FinalizationRegistry(ptr => wasm.__wbg_groupid_free(ptr >>> 0, 1));
1527
-
1528
1163
  export class GroupId {
1529
-
1530
1164
  static __wrap(ptr) {
1531
- ptr = ptr >>> 0;
1532
1165
  const obj = Object.create(GroupId.prototype);
1533
1166
  obj.__wbg_ptr = ptr;
1534
1167
  GroupIdFinalization.register(obj, obj.__wbg_ptr, obj);
1535
1168
  return obj;
1536
1169
  }
1537
-
1538
1170
  __destroy_into_raw() {
1539
1171
  const ptr = this.__wbg_ptr;
1540
1172
  this.__wbg_ptr = 0;
1541
1173
  GroupIdFinalization.unregister(this);
1542
1174
  return ptr;
1543
1175
  }
1544
-
1545
1176
  free() {
1546
1177
  const ptr = this.__destroy_into_raw();
1547
1178
  wasm.__wbg_groupid_free(ptr, 0);
@@ -1564,54 +1195,46 @@ export class GroupId {
1564
1195
  }
1565
1196
  if (Symbol.dispose) GroupId.prototype[Symbol.dispose] = GroupId.prototype.free;
1566
1197
 
1567
- const HistoryFinalization = (typeof FinalizationRegistry === 'undefined')
1568
- ? { register: () => {}, unregister: () => {} }
1569
- : new FinalizationRegistry(ptr => wasm.__wbg_history_free(ptr >>> 0, 1));
1570
-
1571
1198
  export class History {
1572
-
1573
1199
  static __wrap(ptr) {
1574
- ptr = ptr >>> 0;
1575
1200
  const obj = Object.create(History.prototype);
1576
1201
  obj.__wbg_ptr = ptr;
1577
1202
  HistoryFinalization.register(obj, obj.__wbg_ptr, obj);
1578
1203
  return obj;
1579
1204
  }
1580
-
1581
1205
  __destroy_into_raw() {
1582
1206
  const ptr = this.__wbg_ptr;
1583
1207
  this.__wbg_ptr = 0;
1584
1208
  HistoryFinalization.unregister(this);
1585
1209
  return ptr;
1586
1210
  }
1587
-
1588
1211
  free() {
1589
1212
  const ptr = this.__destroy_into_raw();
1590
1213
  wasm.__wbg_history_free(ptr, 0);
1591
1214
  }
1592
1215
  /**
1593
- * @returns {SignedDelegation[]}
1216
+ * @returns {DocContentRefs[]}
1594
1217
  */
1595
- delegations() {
1596
- const ret = wasm.history_delegations(this.__wbg_ptr);
1218
+ contentRefs() {
1219
+ const ret = wasm.history_contentRefs(this.__wbg_ptr);
1597
1220
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1598
1221
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1599
1222
  return v1;
1600
1223
  }
1601
1224
  /**
1602
- * @returns {SignedRevocation[]}
1225
+ * @returns {SignedDelegation[]}
1603
1226
  */
1604
- revocations() {
1605
- const ret = wasm.history_revocations(this.__wbg_ptr);
1227
+ delegations() {
1228
+ const ret = wasm.history_delegations(this.__wbg_ptr);
1606
1229
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1607
1230
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1608
1231
  return v1;
1609
1232
  }
1610
1233
  /**
1611
- * @returns {DocContentRefs[]}
1234
+ * @returns {SignedRevocation[]}
1612
1235
  */
1613
- contentRefs() {
1614
- const ret = wasm.history_contentRefs(this.__wbg_ptr);
1236
+ revocations() {
1237
+ const ret = wasm.history_revocations(this.__wbg_ptr);
1615
1238
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1616
1239
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1617
1240
  return v1;
@@ -1619,27 +1242,19 @@ export class History {
1619
1242
  }
1620
1243
  if (Symbol.dispose) History.prototype[Symbol.dispose] = History.prototype.free;
1621
1244
 
1622
- const IdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
1623
- ? { register: () => {}, unregister: () => {} }
1624
- : new FinalizationRegistry(ptr => wasm.__wbg_identifier_free(ptr >>> 0, 1));
1625
-
1626
1245
  export class Identifier {
1627
-
1628
1246
  static __wrap(ptr) {
1629
- ptr = ptr >>> 0;
1630
1247
  const obj = Object.create(Identifier.prototype);
1631
1248
  obj.__wbg_ptr = ptr;
1632
1249
  IdentifierFinalization.register(obj, obj.__wbg_ptr, obj);
1633
1250
  return obj;
1634
1251
  }
1635
-
1636
1252
  __destroy_into_raw() {
1637
1253
  const ptr = this.__wbg_ptr;
1638
1254
  this.__wbg_ptr = 0;
1639
1255
  IdentifierFinalization.unregister(this);
1640
1256
  return ptr;
1641
1257
  }
1642
-
1643
1258
  free() {
1644
1259
  const ptr = this.__destroy_into_raw();
1645
1260
  wasm.__wbg_identifier_free(ptr, 0);
@@ -1654,10 +1269,17 @@ export class Identifier {
1654
1269
  if (ret[2]) {
1655
1270
  throw takeFromExternrefTable0(ret[1]);
1656
1271
  }
1657
- this.__wbg_ptr = ret[0] >>> 0;
1272
+ this.__wbg_ptr = ret[0];
1658
1273
  IdentifierFinalization.register(this, this.__wbg_ptr, this);
1659
1274
  return this;
1660
1275
  }
1276
+ /**
1277
+ * @returns {Identifier}
1278
+ */
1279
+ static publicId() {
1280
+ const ret = wasm.identifier_publicId();
1281
+ return Identifier.__wrap(ret);
1282
+ }
1661
1283
  /**
1662
1284
  * @returns {Uint8Array}
1663
1285
  */
@@ -1670,45 +1292,23 @@ export class Identifier {
1670
1292
  }
1671
1293
  if (Symbol.dispose) Identifier.prototype[Symbol.dispose] = Identifier.prototype.free;
1672
1294
 
1673
- const IndividualFinalization = (typeof FinalizationRegistry === 'undefined')
1674
- ? { register: () => {}, unregister: () => {} }
1675
- : new FinalizationRegistry(ptr => wasm.__wbg_individual_free(ptr >>> 0, 1));
1676
-
1677
1295
  export class Individual {
1678
-
1679
1296
  static __wrap(ptr) {
1680
- ptr = ptr >>> 0;
1681
1297
  const obj = Object.create(Individual.prototype);
1682
1298
  obj.__wbg_ptr = ptr;
1683
1299
  IndividualFinalization.register(obj, obj.__wbg_ptr, obj);
1684
1300
  return obj;
1685
1301
  }
1686
-
1687
1302
  __destroy_into_raw() {
1688
1303
  const ptr = this.__wbg_ptr;
1689
1304
  this.__wbg_ptr = 0;
1690
1305
  IndividualFinalization.unregister(this);
1691
1306
  return ptr;
1692
1307
  }
1693
-
1694
1308
  free() {
1695
1309
  const ptr = this.__destroy_into_raw();
1696
1310
  wasm.__wbg_individual_free(ptr, 0);
1697
1311
  }
1698
- /**
1699
- * @returns {Peer}
1700
- */
1701
- toPeer() {
1702
- const ret = wasm.individual_toPeer(this.__wbg_ptr);
1703
- return Peer.__wrap(ret);
1704
- }
1705
- /**
1706
- * @returns {Agent}
1707
- */
1708
- toAgent() {
1709
- const ret = wasm.individual_toAgent(this.__wbg_ptr);
1710
- return Agent.__wrap(ret);
1711
- }
1712
1312
  /**
1713
1313
  * @returns {Identifier}
1714
1314
  */
@@ -1725,38 +1325,44 @@ export class Individual {
1725
1325
  }
1726
1326
  /**
1727
1327
  * @param {DocumentId} doc_id
1728
- * @returns {ShareKey}
1328
+ * @returns {Promise<ShareKey>}
1729
1329
  */
1730
1330
  pickPrekey(doc_id) {
1731
1331
  _assertClass(doc_id, DocumentId);
1732
1332
  var ptr0 = doc_id.__destroy_into_raw();
1733
1333
  const ret = wasm.individual_pickPrekey(this.__wbg_ptr, ptr0);
1734
- return ShareKey.__wrap(ret);
1334
+ return ret;
1335
+ }
1336
+ /**
1337
+ * @returns {Agent}
1338
+ */
1339
+ toAgent() {
1340
+ const ret = wasm.individual_toAgent(this.__wbg_ptr);
1341
+ return Agent.__wrap(ret);
1342
+ }
1343
+ /**
1344
+ * @returns {Peer}
1345
+ */
1346
+ toPeer() {
1347
+ const ret = wasm.individual_toPeer(this.__wbg_ptr);
1348
+ return Peer.__wrap(ret);
1735
1349
  }
1736
1350
  }
1737
1351
  if (Symbol.dispose) Individual.prototype[Symbol.dispose] = Individual.prototype.free;
1738
1352
 
1739
- const IndividualIdFinalization = (typeof FinalizationRegistry === 'undefined')
1740
- ? { register: () => {}, unregister: () => {} }
1741
- : new FinalizationRegistry(ptr => wasm.__wbg_individualid_free(ptr >>> 0, 1));
1742
-
1743
1353
  export class IndividualId {
1744
-
1745
1354
  static __wrap(ptr) {
1746
- ptr = ptr >>> 0;
1747
1355
  const obj = Object.create(IndividualId.prototype);
1748
1356
  obj.__wbg_ptr = ptr;
1749
1357
  IndividualIdFinalization.register(obj, obj.__wbg_ptr, obj);
1750
1358
  return obj;
1751
1359
  }
1752
-
1753
1360
  __destroy_into_raw() {
1754
1361
  const ptr = this.__wbg_ptr;
1755
1362
  this.__wbg_ptr = 0;
1756
1363
  IndividualIdFinalization.unregister(this);
1757
1364
  return ptr;
1758
1365
  }
1759
-
1760
1366
  free() {
1761
1367
  const ptr = this.__destroy_into_raw();
1762
1368
  wasm.__wbg_individualid_free(ptr, 0);
@@ -1773,187 +1379,210 @@ export class IndividualId {
1773
1379
  }
1774
1380
  if (Symbol.dispose) IndividualId.prototype[Symbol.dispose] = IndividualId.prototype.free;
1775
1381
 
1776
- const InvocationFinalization = (typeof FinalizationRegistry === 'undefined')
1777
- ? { register: () => {}, unregister: () => {} }
1778
- : new FinalizationRegistry(ptr => wasm.__wbg_invocation_free(ptr >>> 0, 1));
1779
-
1780
1382
  export class Invocation {
1781
-
1782
1383
  __destroy_into_raw() {
1783
1384
  const ptr = this.__wbg_ptr;
1784
1385
  this.__wbg_ptr = 0;
1785
1386
  InvocationFinalization.unregister(this);
1786
1387
  return ptr;
1787
1388
  }
1788
-
1789
1389
  free() {
1790
1390
  const ptr = this.__destroy_into_raw();
1791
1391
  wasm.__wbg_invocation_free(ptr, 0);
1792
- }
1793
- }
1794
- if (Symbol.dispose) Invocation.prototype[Symbol.dispose] = Invocation.prototype.free;
1795
-
1796
- const JsDecryptErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1797
- ? { register: () => {}, unregister: () => {} }
1798
- : new FinalizationRegistry(ptr => wasm.__wbg_jsdecrypterror_free(ptr >>> 0, 1));
1799
-
1800
- export class JsDecryptError {
1801
-
1802
- static __wrap(ptr) {
1803
- ptr = ptr >>> 0;
1804
- const obj = Object.create(JsDecryptError.prototype);
1805
- obj.__wbg_ptr = ptr;
1806
- JsDecryptErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1807
- return obj;
1808
- }
1809
-
1810
- __destroy_into_raw() {
1811
- const ptr = this.__wbg_ptr;
1812
- this.__wbg_ptr = 0;
1813
- JsDecryptErrorFinalization.unregister(this);
1814
- return ptr;
1815
- }
1816
-
1817
- free() {
1818
- const ptr = this.__destroy_into_raw();
1819
- wasm.__wbg_jsdecrypterror_free(ptr, 0);
1820
- }
1821
- }
1822
- if (Symbol.dispose) JsDecryptError.prototype[Symbol.dispose] = JsDecryptError.prototype.free;
1823
-
1824
- const JsEncryptErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1825
- ? { register: () => {}, unregister: () => {} }
1826
- : new FinalizationRegistry(ptr => wasm.__wbg_jsencrypterror_free(ptr >>> 0, 1));
1827
-
1828
- export class JsEncryptError {
1829
-
1830
- static __wrap(ptr) {
1831
- ptr = ptr >>> 0;
1832
- const obj = Object.create(JsEncryptError.prototype);
1833
- obj.__wbg_ptr = ptr;
1834
- JsEncryptErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1835
- return obj;
1836
- }
1837
-
1838
- __destroy_into_raw() {
1839
- const ptr = this.__wbg_ptr;
1840
- this.__wbg_ptr = 0;
1841
- JsEncryptErrorFinalization.unregister(this);
1842
- return ptr;
1843
- }
1844
-
1845
- free() {
1846
- const ptr = this.__destroy_into_raw();
1847
- wasm.__wbg_jsencrypterror_free(ptr, 0);
1848
- }
1849
- }
1850
- if (Symbol.dispose) JsEncryptError.prototype[Symbol.dispose] = JsEncryptError.prototype.free;
1851
-
1852
- const JsReceivePreKeyOpErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1853
- ? { register: () => {}, unregister: () => {} }
1854
- : new FinalizationRegistry(ptr => wasm.__wbg_jsreceiveprekeyoperror_free(ptr >>> 0, 1));
1855
-
1856
- export class JsReceivePreKeyOpError {
1857
-
1858
- static __wrap(ptr) {
1859
- ptr = ptr >>> 0;
1860
- const obj = Object.create(JsReceivePreKeyOpError.prototype);
1861
- obj.__wbg_ptr = ptr;
1862
- JsReceivePreKeyOpErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1863
- return obj;
1864
- }
1865
-
1866
- __destroy_into_raw() {
1867
- const ptr = this.__wbg_ptr;
1868
- this.__wbg_ptr = 0;
1869
- JsReceivePreKeyOpErrorFinalization.unregister(this);
1870
- return ptr;
1871
- }
1872
-
1873
- free() {
1874
- const ptr = this.__destroy_into_raw();
1875
- wasm.__wbg_jsreceiveprekeyoperror_free(ptr, 0);
1876
- }
1877
- }
1878
- if (Symbol.dispose) JsReceivePreKeyOpError.prototype[Symbol.dispose] = JsReceivePreKeyOpError.prototype.free;
1879
-
1880
- const JsReceiveStaticEventErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1881
- ? { register: () => {}, unregister: () => {} }
1882
- : new FinalizationRegistry(ptr => wasm.__wbg_jsreceivestaticeventerror_free(ptr >>> 0, 1));
1883
-
1884
- export class JsReceiveStaticEventError {
1885
-
1886
- static __wrap(ptr) {
1887
- ptr = ptr >>> 0;
1888
- const obj = Object.create(JsReceiveStaticEventError.prototype);
1889
- obj.__wbg_ptr = ptr;
1890
- JsReceiveStaticEventErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1891
- return obj;
1892
- }
1893
-
1894
- __destroy_into_raw() {
1895
- const ptr = this.__wbg_ptr;
1896
- this.__wbg_ptr = 0;
1897
- JsReceiveStaticEventErrorFinalization.unregister(this);
1898
- return ptr;
1899
- }
1900
-
1901
- free() {
1902
- const ptr = this.__destroy_into_raw();
1903
- wasm.__wbg_jsreceivestaticeventerror_free(ptr, 0);
1904
- }
1905
- }
1906
- if (Symbol.dispose) JsReceiveStaticEventError.prototype[Symbol.dispose] = JsReceiveStaticEventError.prototype.free;
1907
-
1908
- const KeyhiveFinalization = (typeof FinalizationRegistry === 'undefined')
1909
- ? { register: () => {}, unregister: () => {} }
1910
- : new FinalizationRegistry(ptr => wasm.__wbg_keyhive_free(ptr >>> 0, 1));
1392
+ }
1393
+ }
1394
+ if (Symbol.dispose) Invocation.prototype[Symbol.dispose] = Invocation.prototype.free;
1911
1395
 
1912
1396
  export class Keyhive {
1913
-
1914
1397
  static __wrap(ptr) {
1915
- ptr = ptr >>> 0;
1916
1398
  const obj = Object.create(Keyhive.prototype);
1917
1399
  obj.__wbg_ptr = ptr;
1918
1400
  KeyhiveFinalization.register(obj, obj.__wbg_ptr, obj);
1919
1401
  return obj;
1920
1402
  }
1921
-
1922
1403
  __destroy_into_raw() {
1923
1404
  const ptr = this.__wbg_ptr;
1924
1405
  this.__wbg_ptr = 0;
1925
1406
  KeyhiveFinalization.unregister(this);
1926
1407
  return ptr;
1927
1408
  }
1928
-
1929
1409
  free() {
1930
1410
  const ptr = this.__destroy_into_raw();
1931
1411
  wasm.__wbg_keyhive_free(ptr, 0);
1932
1412
  }
1933
1413
  /**
1934
- * @param {Signer} signer
1935
- * @param {CiphertextStore} ciphertext_store
1936
- * @param {Function} event_handler
1937
- * @returns {Promise<Keyhive>}
1414
+ * @param {Identifier} id
1415
+ * @param {DocumentId} doc_id
1416
+ * @returns {Promise<Access | undefined>}
1938
1417
  */
1939
- static init(signer, ciphertext_store, event_handler) {
1940
- _assertClass(signer, Signer);
1941
- _assertClass(ciphertext_store, CiphertextStore);
1942
- var ptr0 = ciphertext_store.__destroy_into_raw();
1943
- const ret = wasm.keyhive_init(signer.__wbg_ptr, ptr0, event_handler);
1418
+ accessForDoc(id, doc_id) {
1419
+ _assertClass(id, Identifier);
1420
+ _assertClass(doc_id, DocumentId);
1421
+ const ret = wasm.keyhive_accessForDoc(this.__wbg_ptr, id.__wbg_ptr, doc_id.__wbg_ptr);
1944
1422
  return ret;
1945
1423
  }
1946
1424
  /**
1947
- * @returns {IndividualId}
1425
+ * @param {Agent} to_add
1426
+ * @param {Membered} membered
1427
+ * @param {Access} access
1428
+ * @param {Document[]} other_relevant_docs
1429
+ * @returns {Promise<AddMemberUpdate>}
1948
1430
  */
1949
- get id() {
1950
- const ret = wasm.keyhive_id(this.__wbg_ptr);
1951
- return IndividualId.__wrap(ret);
1431
+ addMember(to_add, membered, access, other_relevant_docs) {
1432
+ _assertClass(to_add, Agent);
1433
+ _assertClass(membered, Membered);
1434
+ _assertClass(access, Access);
1435
+ const ptr0 = passArrayJsValueToWasm0(other_relevant_docs, wasm.__wbindgen_malloc);
1436
+ const len0 = WASM_VECTOR_LEN;
1437
+ const ret = wasm.keyhive_addMember(this.__wbg_ptr, to_add.__wbg_ptr, membered.__wbg_ptr, access.__wbg_ptr, ptr0, len0);
1438
+ return ret;
1439
+ }
1440
+ /**
1441
+ * Returns all agent events with deduplicated storage and two-tier indirection
1442
+ * for membership, prekey, and CGKA ops.
1443
+ * @returns {Promise<AllAgentEvents>}
1444
+ */
1445
+ allAgentEvents() {
1446
+ const ret = wasm.keyhive_allAgentEvents(this.__wbg_ptr);
1447
+ return ret;
1448
+ }
1449
+ /**
1450
+ * @returns {Promise<ContactCard>}
1451
+ */
1452
+ contactCard() {
1453
+ const ret = wasm.keyhive_contactCard(this.__wbg_ptr);
1454
+ return ret;
1455
+ }
1456
+ /**
1457
+ * @param {DocumentId} doc_id
1458
+ * @returns {Promise<Membership[]>}
1459
+ */
1460
+ docMemberCapabilities(doc_id) {
1461
+ _assertClass(doc_id, DocumentId);
1462
+ const ret = wasm.keyhive_docMemberCapabilities(this.__wbg_ptr, doc_id.__wbg_ptr);
1463
+ return ret;
1464
+ }
1465
+ /**
1466
+ * Returns event hashes for provided [`JsAgent`] as an array of hash bytes.
1467
+ * @param {Agent} agent
1468
+ * @returns {Promise<Array<any>>}
1469
+ */
1470
+ eventHashesForAgent(agent) {
1471
+ _assertClass(agent, Agent);
1472
+ const ret = wasm.keyhive_eventHashesForAgent(this.__wbg_ptr, agent.__wbg_ptr);
1473
+ return ret;
1474
+ }
1475
+ /**
1476
+ * Returns events for provided [`Agent`] as a map from hash to serialized [`StaticEvent`] bytes.
1477
+ * @param {Agent} agent
1478
+ * @returns {Promise<Map<any, any>>}
1479
+ */
1480
+ eventsForAgent(agent) {
1481
+ _assertClass(agent, Agent);
1482
+ const ret = wasm.keyhive_eventsForAgent(this.__wbg_ptr, agent.__wbg_ptr);
1483
+ return ret;
1484
+ }
1485
+ /**
1486
+ * @returns {Promise<ShareKey>}
1487
+ */
1488
+ expandPrekeys() {
1489
+ const ret = wasm.keyhive_expandPrekeys(this.__wbg_ptr);
1490
+ return ret;
1491
+ }
1492
+ /**
1493
+ * @returns {Promise<Uint8Array>}
1494
+ */
1495
+ exportPrekeySecrets() {
1496
+ const ret = wasm.keyhive_exportPrekeySecrets(this.__wbg_ptr);
1497
+ return ret;
1498
+ }
1499
+ /**
1500
+ * Force a PCS key rotation and return the new leaf secret, serialized as a
1501
+ * one-entry `BTreeMap<ShareKey, ShareSecretKey>` (the exact format
1502
+ * `importPrekeySecrets` accepts). A sibling instance of this identity can
1503
+ * install it to derive the rotated key without re-importing the whole bundle.
1504
+ * @param {Document} doc
1505
+ * @returns {Promise<Uint8Array>}
1506
+ */
1507
+ forcePcsUpdate(doc) {
1508
+ _assertClass(doc, Document);
1509
+ const ret = wasm.keyhive_forcePcsUpdate(this.__wbg_ptr, doc.__wbg_ptr);
1510
+ return ret;
1511
+ }
1512
+ /**
1513
+ * Generate a document. Whether it provides forward secrecy is determined by
1514
+ * this peer's forward-secrecy policy (chosen at `Keyhive.init`).
1515
+ * @param {Peer[]} coparents
1516
+ * @param {ChangeId} initial_content_ref_head
1517
+ * @param {ChangeId[]} more_initial_content_refs
1518
+ * @returns {Promise<Document>}
1519
+ */
1520
+ generateDocument(coparents, initial_content_ref_head, more_initial_content_refs) {
1521
+ const ptr0 = passArrayJsValueToWasm0(coparents, wasm.__wbindgen_malloc);
1522
+ const len0 = WASM_VECTOR_LEN;
1523
+ _assertClass(initial_content_ref_head, ChangeId);
1524
+ const ptr1 = passArrayJsValueToWasm0(more_initial_content_refs, wasm.__wbindgen_malloc);
1525
+ const len1 = WASM_VECTOR_LEN;
1526
+ const ret = wasm.keyhive_generateDocument(this.__wbg_ptr, ptr0, len0, initial_content_ref_head.__wbg_ptr, ptr1, len1);
1527
+ return ret;
1528
+ }
1529
+ /**
1530
+ * @param {Peer[]} js_coparents
1531
+ * @returns {Promise<Group>}
1532
+ */
1533
+ generateGroup(js_coparents) {
1534
+ const ptr0 = passArrayJsValueToWasm0(js_coparents, wasm.__wbindgen_malloc);
1535
+ const len0 = WASM_VECTOR_LEN;
1536
+ const ret = wasm.keyhive_generateGroup(this.__wbg_ptr, ptr0, len0);
1537
+ return ret;
1538
+ }
1539
+ /**
1540
+ * @param {Identifier} id
1541
+ * @returns {Promise<Agent | undefined>}
1542
+ */
1543
+ getAgent(id) {
1544
+ _assertClass(id, Identifier);
1545
+ const ret = wasm.keyhive_getAgent(this.__wbg_ptr, id.__wbg_ptr);
1546
+ return ret;
1547
+ }
1548
+ /**
1549
+ * @param {DocumentId} doc_id
1550
+ * @returns {Promise<Document | undefined>}
1551
+ */
1552
+ getDocument(doc_id) {
1553
+ _assertClass(doc_id, DocumentId);
1554
+ const ret = wasm.keyhive_getDocument(this.__wbg_ptr, doc_id.__wbg_ptr);
1555
+ return ret;
1556
+ }
1557
+ /**
1558
+ * @returns {Promise<ContactCard>}
1559
+ */
1560
+ getExistingContactCard() {
1561
+ const ret = wasm.keyhive_getExistingContactCard(this.__wbg_ptr);
1562
+ return ret;
1563
+ }
1564
+ /**
1565
+ * @param {GroupId} group_id
1566
+ * @returns {Promise<Group | undefined>}
1567
+ */
1568
+ getGroup(group_id) {
1569
+ _assertClass(group_id, GroupId);
1570
+ const ret = wasm.keyhive_getGroup(this.__wbg_ptr, group_id.__wbg_ptr);
1571
+ return ret;
1572
+ }
1573
+ /**
1574
+ * @param {IndividualId} id
1575
+ * @returns {Promise<Individual | undefined>}
1576
+ */
1577
+ getIndividual(id) {
1578
+ _assertClass(id, IndividualId);
1579
+ const ret = wasm.keyhive_getIndividual(this.__wbg_ptr, id.__wbg_ptr);
1580
+ return ret;
1952
1581
  }
1953
1582
  /**
1954
1583
  * @returns {IndividualId}
1955
1584
  */
1956
- get whoami() {
1585
+ get id() {
1957
1586
  const ret = wasm.keyhive_id(this.__wbg_ptr);
1958
1587
  return IndividualId.__wrap(ret);
1959
1588
  }
@@ -1973,108 +1602,97 @@ export class Keyhive {
1973
1602
  }
1974
1603
  }
1975
1604
  /**
1976
- * @param {Peer[]} coparents
1977
- * @returns {Promise<Group>}
1605
+ * @param {Uint8Array} bytes
1606
+ * @returns {Promise<void>}
1978
1607
  */
1979
- generateGroup(coparents) {
1980
- const ptr0 = passArrayJsValueToWasm0(coparents, wasm.__wbindgen_malloc);
1608
+ importPrekeySecrets(bytes) {
1609
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1981
1610
  const len0 = WASM_VECTOR_LEN;
1982
- const ret = wasm.keyhive_generateGroup(this.__wbg_ptr, ptr0, len0);
1611
+ const ret = wasm.keyhive_importPrekeySecrets(this.__wbg_ptr, ptr0, len0);
1983
1612
  return ret;
1984
1613
  }
1985
1614
  /**
1986
- * @param {Peer[]} coparents
1987
- * @param {ChangeRef} initial_content_ref_head
1988
- * @param {ChangeRef[]} more_initial_content_refs
1989
- * @returns {Promise<Document>}
1615
+ * @returns {Promise<Individual>}
1990
1616
  */
1991
- generateDocument(coparents, initial_content_ref_head, more_initial_content_refs) {
1992
- const ptr0 = passArrayJsValueToWasm0(coparents, wasm.__wbindgen_malloc);
1993
- const len0 = WASM_VECTOR_LEN;
1994
- _assertClass(initial_content_ref_head, ChangeRef);
1995
- var ptr1 = initial_content_ref_head.__destroy_into_raw();
1996
- const ptr2 = passArrayJsValueToWasm0(more_initial_content_refs, wasm.__wbindgen_malloc);
1997
- const len2 = WASM_VECTOR_LEN;
1998
- const ret = wasm.keyhive_generateDocument(this.__wbg_ptr, ptr0, len0, ptr1, ptr2, len2);
1617
+ get individual() {
1618
+ const ret = wasm.keyhive_individual(this.__wbg_ptr);
1999
1619
  return ret;
2000
1620
  }
2001
1621
  /**
2002
- * @param {Uint8Array} data
2003
- * @returns {Promise<Signed>}
1622
+ * @param {Archive} archive
1623
+ * @returns {Promise<void>}
2004
1624
  */
2005
- trySign(data) {
2006
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
2007
- const len0 = WASM_VECTOR_LEN;
2008
- const ret = wasm.keyhive_trySign(this.__wbg_ptr, ptr0, len0);
1625
+ ingestArchive(archive) {
1626
+ _assertClass(archive, Archive);
1627
+ const ret = wasm.keyhive_ingestArchive(this.__wbg_ptr, archive.__wbg_ptr);
2009
1628
  return ret;
2010
1629
  }
2011
1630
  /**
2012
- * @param {Document} doc
2013
- * @param {ChangeRef} content_ref
2014
- * @param {ChangeRef[]} pred_refs
2015
- * @param {Uint8Array} content
2016
- * @returns {Promise<EncryptedContentWithUpdate>}
1631
+ * @param {Array<any>} events_bytes_array
1632
+ * @returns {Promise<Array<any>>}
2017
1633
  */
2018
- tryEncrypt(doc, content_ref, pred_refs, content) {
2019
- _assertClass(doc, Document);
2020
- _assertClass(content_ref, ChangeRef);
2021
- var ptr0 = content_ref.__destroy_into_raw();
2022
- const ptr1 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
2023
- const len1 = WASM_VECTOR_LEN;
2024
- const ptr2 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
2025
- const len2 = WASM_VECTOR_LEN;
2026
- const ret = wasm.keyhive_tryEncrypt(this.__wbg_ptr, doc.__wbg_ptr, ptr0, ptr1, len1, ptr2, len2);
1634
+ ingestEventsBytes(events_bytes_array) {
1635
+ const ret = wasm.keyhive_ingestEventsBytes(this.__wbg_ptr, events_bytes_array);
2027
1636
  return ret;
2028
1637
  }
2029
1638
  /**
2030
- * @param {Document} doc
2031
- * @param {ChangeRef} content_ref
2032
- * @param {ChangeRef[]} pred_refs
2033
- * @param {Uint8Array} content
2034
- * @returns {Promise<EncryptedContentWithUpdate>}
1639
+ * Initialize a peer.
1640
+ *
1641
+ * `forward_secrecy` is this peer's policy for all documents it creates or
1642
+ * receives. When `false`, documents carry the CGKA predecessor key chain
1643
+ * (a member added later reads the whole prior history) and adding a reader
1644
+ * auto-rekeys (see `addMember`'s `leafSecrets`). When `true`, a member
1645
+ * added later cannot read content from before they joined.
1646
+ * @param {Signer} signer
1647
+ * @param {CiphertextStore} ciphertext_store
1648
+ * @param {Function} event_handler
1649
+ * @param {boolean} forward_secrecy
1650
+ * @returns {Promise<Keyhive>}
2035
1651
  */
2036
- tryEncryptArchive(doc, content_ref, pred_refs, content) {
2037
- _assertClass(doc, Document);
2038
- _assertClass(content_ref, ChangeRef);
2039
- var ptr0 = content_ref.__destroy_into_raw();
2040
- const ptr1 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
2041
- const len1 = WASM_VECTOR_LEN;
2042
- const ptr2 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
2043
- const len2 = WASM_VECTOR_LEN;
2044
- const ret = wasm.keyhive_tryEncryptArchive(this.__wbg_ptr, doc.__wbg_ptr, ptr0, ptr1, len1, ptr2, len2);
1652
+ static init(signer, ciphertext_store, event_handler, forward_secrecy) {
1653
+ _assertClass(signer, Signer);
1654
+ _assertClass(ciphertext_store, CiphertextStore);
1655
+ const ret = wasm.keyhive_init(signer.__wbg_ptr, ciphertext_store.__wbg_ptr, event_handler, forward_secrecy);
2045
1656
  return ret;
2046
1657
  }
2047
1658
  /**
2048
- * @param {Document} doc
2049
- * @param {Encrypted} encrypted
2050
- * @returns {Uint8Array}
1659
+ * @returns {Promise<Archive>}
2051
1660
  */
2052
- tryDecrypt(doc, encrypted) {
2053
- _assertClass(doc, Document);
2054
- _assertClass(encrypted, Encrypted);
2055
- const ret = wasm.keyhive_tryDecrypt(this.__wbg_ptr, doc.__wbg_ptr, encrypted.__wbg_ptr);
2056
- if (ret[3]) {
2057
- throw takeFromExternrefTable0(ret[2]);
2058
- }
2059
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2060
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2061
- return v1;
1661
+ intoArchive() {
1662
+ const ptr = this.__destroy_into_raw();
1663
+ const ret = wasm.keyhive_intoArchive(ptr);
1664
+ return ret;
2062
1665
  }
2063
1666
  /**
2064
- * @param {Agent} to_add
2065
- * @param {Membered} membered
2066
- * @param {Access} access
2067
- * @param {Document[]} other_relevant_docs
2068
- * @returns {Promise<SignedDelegation>}
1667
+ * @param {Agent} agent
1668
+ * @returns {Promise<Map<any, any>>}
2069
1669
  */
2070
- addMember(to_add, membered, access, other_relevant_docs) {
2071
- _assertClass(to_add, Agent);
2072
- _assertClass(membered, Membered);
2073
- _assertClass(access, Access);
2074
- var ptr0 = access.__destroy_into_raw();
2075
- const ptr1 = passArrayJsValueToWasm0(other_relevant_docs, wasm.__wbindgen_malloc);
2076
- const len1 = WASM_VECTOR_LEN;
2077
- const ret = wasm.keyhive_addMember(this.__wbg_ptr, to_add.__wbg_ptr, membered.__wbg_ptr, ptr0, ptr1, len1);
1670
+ membershipOpsForAgent(agent) {
1671
+ _assertClass(agent, Agent);
1672
+ const ret = wasm.keyhive_membershipOpsForAgent(this.__wbg_ptr, agent.__wbg_ptr);
1673
+ return ret;
1674
+ }
1675
+ /**
1676
+ * @returns {Promise<Set<any>>}
1677
+ */
1678
+ pendingEventHashes() {
1679
+ const ret = wasm.keyhive_pendingEventHashes(this.__wbg_ptr);
1680
+ return ret;
1681
+ }
1682
+ /**
1683
+ * @returns {Promise<Summary[]>}
1684
+ */
1685
+ reachableDocs() {
1686
+ const ret = wasm.keyhive_reachableDocs(this.__wbg_ptr);
1687
+ return ret;
1688
+ }
1689
+ /**
1690
+ * @param {ContactCard} contact_card
1691
+ * @returns {Promise<Individual>}
1692
+ */
1693
+ receiveContactCard(contact_card) {
1694
+ _assertClass(contact_card, ContactCard);
1695
+ const ret = wasm.keyhive_receiveContactCard(this.__wbg_ptr, contact_card.__wbg_ptr);
2078
1696
  return ret;
2079
1697
  }
2080
1698
  /**
@@ -2090,21 +1708,12 @@ export class Keyhive {
2090
1708
  return ret;
2091
1709
  }
2092
1710
  /**
2093
- * @returns {Summary[]}
2094
- */
2095
- reachableDocs() {
2096
- const ret = wasm.keyhive_reachableDocs(this.__wbg_ptr);
2097
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2098
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2099
- return v1;
2100
- }
2101
- /**
2102
- * @param {Document} doc
2103
- * @returns {Promise<void>}
1711
+ * @param {DocumentId} doc_id
1712
+ * @returns {Promise<Membership[]>}
2104
1713
  */
2105
- forcePcsUpdate(doc) {
2106
- _assertClass(doc, Document);
2107
- const ret = wasm.keyhive_forcePcsUpdate(this.__wbg_ptr, doc.__wbg_ptr);
1714
+ revokedMembersForDoc(doc_id) {
1715
+ _assertClass(doc_id, DocumentId);
1716
+ const ret = wasm.keyhive_revokedMembersForDoc(this.__wbg_ptr, doc_id.__wbg_ptr);
2108
1717
  return ret;
2109
1718
  }
2110
1719
  /**
@@ -2113,133 +1722,110 @@ export class Keyhive {
2113
1722
  */
2114
1723
  rotatePrekey(prekey) {
2115
1724
  _assertClass(prekey, ShareKey);
2116
- var ptr0 = prekey.__destroy_into_raw();
2117
- const ret = wasm.keyhive_rotatePrekey(this.__wbg_ptr, ptr0);
1725
+ const ret = wasm.keyhive_rotatePrekey(this.__wbg_ptr, prekey.__wbg_ptr);
2118
1726
  return ret;
2119
1727
  }
2120
1728
  /**
2121
- * @returns {Promise<ShareKey>}
1729
+ * @returns {Promise<Stats>}
2122
1730
  */
2123
- expandPrekeys() {
2124
- const ret = wasm.keyhive_expandPrekeys(this.__wbg_ptr);
1731
+ stats() {
1732
+ const ret = wasm.keyhive_stats(this.__wbg_ptr);
2125
1733
  return ret;
2126
1734
  }
2127
1735
  /**
2128
- * @returns {Promise<ContactCard>}
1736
+ * @returns {Promise<Archive>}
2129
1737
  */
2130
- contactCard() {
2131
- const ret = wasm.keyhive_contactCard(this.__wbg_ptr);
1738
+ toArchive() {
1739
+ const ret = wasm.keyhive_toArchive(this.__wbg_ptr);
2132
1740
  return ret;
2133
1741
  }
2134
1742
  /**
2135
- * @param {ContactCard} contact_card
2136
- * @returns {Individual}
2137
- */
2138
- receiveContactCard(contact_card) {
2139
- _assertClass(contact_card, ContactCard);
2140
- const ret = wasm.keyhive_receiveContactCard(this.__wbg_ptr, contact_card.__wbg_ptr);
2141
- if (ret[2]) {
2142
- throw takeFromExternrefTable0(ret[1]);
2143
- }
2144
- return Individual.__wrap(ret[0]);
2145
- }
2146
- /**
2147
- * @param {Identifier} id
2148
- * @returns {Agent | undefined}
2149
- */
2150
- getAgent(id) {
2151
- _assertClass(id, Identifier);
2152
- const ret = wasm.keyhive_getAgent(this.__wbg_ptr, id.__wbg_ptr);
2153
- return ret === 0 ? undefined : Agent.__wrap(ret);
2154
- }
2155
- /**
2156
- * @param {Identifier} id
2157
- * @returns {Group | undefined}
2158
- */
2159
- getGroup(id) {
2160
- _assertClass(id, Identifier);
2161
- const ret = wasm.keyhive_getGroup(this.__wbg_ptr, id.__wbg_ptr);
2162
- return ret === 0 ? undefined : Group.__wrap(ret);
2163
- }
2164
- /**
2165
- * @param {Identifier} id
2166
- * @returns {Document | undefined}
1743
+ * @param {Document} doc
1744
+ * @param {Encrypted} encrypted
1745
+ * @returns {Promise<Uint8Array>}
2167
1746
  */
2168
- getDocument(id) {
2169
- _assertClass(id, Identifier);
2170
- const ret = wasm.keyhive_getDocument(this.__wbg_ptr, id.__wbg_ptr);
2171
- return ret === 0 ? undefined : Document.__wrap(ret);
1747
+ tryDecrypt(doc, encrypted) {
1748
+ _assertClass(doc, Document);
1749
+ _assertClass(encrypted, Encrypted);
1750
+ const ret = wasm.keyhive_tryDecrypt(this.__wbg_ptr, doc.__wbg_ptr, encrypted.__wbg_ptr);
1751
+ return ret;
2172
1752
  }
2173
1753
  /**
2174
- * @param {DocumentId} doc_id
2175
- * @returns {SimpleCapability[]}
1754
+ * @param {Document} doc
1755
+ * @param {ChangeId} content_ref
1756
+ * @param {ChangeId[]} js_pred_refs
1757
+ * @param {Uint8Array} content
1758
+ * @returns {Promise<EncryptedContentWithUpdate>}
2176
1759
  */
2177
- docMemberCapabilities(doc_id) {
2178
- _assertClass(doc_id, DocumentId);
2179
- const ret = wasm.keyhive_docMemberCapabilities(this.__wbg_ptr, doc_id.__wbg_ptr);
2180
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2181
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2182
- return v1;
1760
+ tryEncrypt(doc, content_ref, js_pred_refs, content) {
1761
+ _assertClass(doc, Document);
1762
+ _assertClass(content_ref, ChangeId);
1763
+ const ptr0 = passArrayJsValueToWasm0(js_pred_refs, wasm.__wbindgen_malloc);
1764
+ const len0 = WASM_VECTOR_LEN;
1765
+ const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
1766
+ const len1 = WASM_VECTOR_LEN;
1767
+ const ret = wasm.keyhive_tryEncrypt(this.__wbg_ptr, doc.__wbg_ptr, content_ref.__wbg_ptr, ptr0, len0, ptr1, len1);
1768
+ return ret;
2183
1769
  }
2184
1770
  /**
2185
- * @param {Identifier} id
2186
- * @param {DocumentId} doc_id
2187
- * @returns {Access | undefined}
1771
+ * @param {Document} doc
1772
+ * @param {ChangeId} content_ref
1773
+ * @param {ChangeId[]} pred_refs
1774
+ * @param {Uint8Array} content
1775
+ * @returns {Promise<EncryptedContentWithUpdate>}
2188
1776
  */
2189
- accessForDoc(id, doc_id) {
2190
- _assertClass(id, Identifier);
2191
- _assertClass(doc_id, DocumentId);
2192
- const ret = wasm.keyhive_accessForDoc(this.__wbg_ptr, id.__wbg_ptr, doc_id.__wbg_ptr);
2193
- return ret === 0 ? undefined : Access.__wrap(ret);
1777
+ tryEncryptArchive(doc, content_ref, pred_refs, content) {
1778
+ _assertClass(doc, Document);
1779
+ _assertClass(content_ref, ChangeId);
1780
+ const ptr0 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
1781
+ const len0 = WASM_VECTOR_LEN;
1782
+ const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
1783
+ const len1 = WASM_VECTOR_LEN;
1784
+ const ret = wasm.keyhive_tryEncryptArchive(this.__wbg_ptr, doc.__wbg_ptr, content_ref.__wbg_ptr, ptr0, len0, ptr1, len1);
1785
+ return ret;
2194
1786
  }
2195
1787
  /**
2196
- * @returns {Archive}
1788
+ * @param {Document} doc
1789
+ * @returns {Promise<Uint8Array | undefined>}
2197
1790
  */
2198
- intoArchive() {
2199
- const ptr = this.__destroy_into_raw();
2200
- const ret = wasm.keyhive_intoArchive(ptr);
2201
- return Archive.__wrap(ret);
1791
+ tryPcsKeyHash(doc) {
1792
+ _assertClass(doc, Document);
1793
+ const ret = wasm.keyhive_tryPcsKeyHash(this.__wbg_ptr, doc.__wbg_ptr);
1794
+ return ret;
2202
1795
  }
2203
1796
  /**
2204
- * @returns {Archive}
1797
+ * @param {Uint8Array} data
1798
+ * @returns {Promise<Signed>}
2205
1799
  */
2206
- toArchive() {
2207
- const ret = wasm.keyhive_toArchive(this.__wbg_ptr);
2208
- return Archive.__wrap(ret);
1800
+ trySign(data) {
1801
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1802
+ const len0 = WASM_VECTOR_LEN;
1803
+ const ret = wasm.keyhive_trySign(this.__wbg_ptr, ptr0, len0);
1804
+ return ret;
2209
1805
  }
2210
1806
  /**
2211
- * @param {Archive} archive
2212
- * @returns {Promise<void>}
1807
+ * @returns {IndividualId}
2213
1808
  */
2214
- ingestArchive(archive) {
2215
- _assertClass(archive, Archive);
2216
- const ret = wasm.keyhive_ingestArchive(this.__wbg_ptr, archive.__wbg_ptr);
2217
- return ret;
1809
+ get whoami() {
1810
+ const ret = wasm.keyhive_whoami(this.__wbg_ptr);
1811
+ return IndividualId.__wrap(ret);
2218
1812
  }
2219
1813
  }
2220
1814
  if (Symbol.dispose) Keyhive.prototype[Symbol.dispose] = Keyhive.prototype.free;
2221
1815
 
2222
- const MemberedFinalization = (typeof FinalizationRegistry === 'undefined')
2223
- ? { register: () => {}, unregister: () => {} }
2224
- : new FinalizationRegistry(ptr => wasm.__wbg_membered_free(ptr >>> 0, 1));
2225
-
2226
1816
  export class Membered {
2227
-
2228
1817
  static __wrap(ptr) {
2229
- ptr = ptr >>> 0;
2230
1818
  const obj = Object.create(Membered.prototype);
2231
1819
  obj.__wbg_ptr = ptr;
2232
1820
  MemberedFinalization.register(obj, obj.__wbg_ptr, obj);
2233
1821
  return obj;
2234
1822
  }
2235
-
2236
1823
  __destroy_into_raw() {
2237
1824
  const ptr = this.__wbg_ptr;
2238
1825
  this.__wbg_ptr = 0;
2239
1826
  MemberedFinalization.unregister(this);
2240
1827
  return ptr;
2241
1828
  }
2242
-
2243
1829
  free() {
2244
1830
  const ptr = this.__destroy_into_raw();
2245
1831
  wasm.__wbg_membered_free(ptr, 0);
@@ -2247,186 +1833,101 @@ export class Membered {
2247
1833
  }
2248
1834
  if (Symbol.dispose) Membered.prototype[Symbol.dispose] = Membered.prototype.free;
2249
1835
 
2250
- const PeerFinalization = (typeof FinalizationRegistry === 'undefined')
2251
- ? { register: () => {}, unregister: () => {} }
2252
- : new FinalizationRegistry(ptr => wasm.__wbg_peer_free(ptr >>> 0, 1));
2253
-
2254
- export class Peer {
2255
-
1836
+ export class Membership {
2256
1837
  static __wrap(ptr) {
2257
- ptr = ptr >>> 0;
2258
- const obj = Object.create(Peer.prototype);
1838
+ const obj = Object.create(Membership.prototype);
2259
1839
  obj.__wbg_ptr = ptr;
2260
- PeerFinalization.register(obj, obj.__wbg_ptr, obj);
1840
+ MembershipFinalization.register(obj, obj.__wbg_ptr, obj);
2261
1841
  return obj;
2262
1842
  }
2263
-
2264
- static __unwrap(jsValue) {
2265
- if (!(jsValue instanceof Peer)) {
2266
- return 0;
2267
- }
2268
- return jsValue.__destroy_into_raw();
2269
- }
2270
-
2271
1843
  __destroy_into_raw() {
2272
1844
  const ptr = this.__wbg_ptr;
2273
1845
  this.__wbg_ptr = 0;
2274
- PeerFinalization.unregister(this);
1846
+ MembershipFinalization.unregister(this);
2275
1847
  return ptr;
2276
1848
  }
2277
-
2278
1849
  free() {
2279
1850
  const ptr = this.__destroy_into_raw();
2280
- wasm.__wbg_peer_free(ptr, 0);
2281
- }
2282
- /**
2283
- * @returns {string}
2284
- */
2285
- toString() {
2286
- let deferred1_0;
2287
- let deferred1_1;
2288
- try {
2289
- const ret = wasm.peer_toString(this.__wbg_ptr);
2290
- deferred1_0 = ret[0];
2291
- deferred1_1 = ret[1];
2292
- return getStringFromWasm0(ret[0], ret[1]);
2293
- } finally {
2294
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2295
- }
2296
- }
2297
- /**
2298
- * @returns {boolean}
2299
- */
2300
- isIndividual() {
2301
- const ret = wasm.peer_isIndividual(this.__wbg_ptr);
2302
- return ret !== 0;
1851
+ wasm.__wbg_membership_free(ptr, 0);
2303
1852
  }
2304
1853
  /**
2305
- * @returns {boolean}
1854
+ * @returns {Access}
2306
1855
  */
2307
- isGroup() {
2308
- const ret = wasm.peer_isGroup(this.__wbg_ptr);
2309
- return ret !== 0;
1856
+ get can() {
1857
+ const ret = wasm.membership_can(this.__wbg_ptr);
1858
+ return Access.__wrap(ret);
2310
1859
  }
2311
1860
  /**
2312
- * @returns {boolean}
1861
+ * @returns {Agent}
2313
1862
  */
2314
- isDocument() {
2315
- const ret = wasm.peer_isDocument(this.__wbg_ptr);
2316
- return ret !== 0;
2317
- }
2318
- }
2319
- if (Symbol.dispose) Peer.prototype[Symbol.dispose] = Peer.prototype.free;
2320
-
2321
- const RemoveCiphertextErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2322
- ? { register: () => {}, unregister: () => {} }
2323
- : new FinalizationRegistry(ptr => wasm.__wbg_removeciphertexterror_free(ptr >>> 0, 1));
2324
-
2325
- export class RemoveCiphertextError {
2326
-
2327
- __destroy_into_raw() {
2328
- const ptr = this.__wbg_ptr;
2329
- this.__wbg_ptr = 0;
2330
- RemoveCiphertextErrorFinalization.unregister(this);
2331
- return ptr;
2332
- }
2333
-
2334
- free() {
2335
- const ptr = this.__destroy_into_raw();
2336
- wasm.__wbg_removeciphertexterror_free(ptr, 0);
1863
+ get who() {
1864
+ const ret = wasm.membership_who(this.__wbg_ptr);
1865
+ return Agent.__wrap(ret);
2337
1866
  }
2338
1867
  }
2339
- if (Symbol.dispose) RemoveCiphertextError.prototype[Symbol.dispose] = RemoveCiphertextError.prototype.free;
2340
-
2341
- const RevocationFinalization = (typeof FinalizationRegistry === 'undefined')
2342
- ? { register: () => {}, unregister: () => {} }
2343
- : new FinalizationRegistry(ptr => wasm.__wbg_revocation_free(ptr >>> 0, 1));
2344
-
2345
- export class Revocation {
1868
+ if (Symbol.dispose) Membership.prototype[Symbol.dispose] = Membership.prototype.free;
2346
1869
 
1870
+ export class Peer {
2347
1871
  static __wrap(ptr) {
2348
- ptr = ptr >>> 0;
2349
- const obj = Object.create(Revocation.prototype);
1872
+ const obj = Object.create(Peer.prototype);
2350
1873
  obj.__wbg_ptr = ptr;
2351
- RevocationFinalization.register(obj, obj.__wbg_ptr, obj);
1874
+ PeerFinalization.register(obj, obj.__wbg_ptr, obj);
2352
1875
  return obj;
2353
1876
  }
2354
-
2355
1877
  __destroy_into_raw() {
2356
1878
  const ptr = this.__wbg_ptr;
2357
1879
  this.__wbg_ptr = 0;
2358
- RevocationFinalization.unregister(this);
1880
+ PeerFinalization.unregister(this);
2359
1881
  return ptr;
2360
1882
  }
2361
-
2362
1883
  free() {
2363
1884
  const ptr = this.__destroy_into_raw();
2364
- wasm.__wbg_revocation_free(ptr, 0);
1885
+ wasm.__wbg_peer_free(ptr, 0);
1886
+ }
1887
+ /**
1888
+ * Upcasts; to the JS-import type for [`JsPeer`].
1889
+ * @returns {Peer}
1890
+ */
1891
+ __wasm_refgen_toJsPeer() {
1892
+ const ret = wasm.peer___wasm_refgen_toJsPeer(this.__wbg_ptr);
1893
+ return Peer.__wrap(ret);
2365
1894
  }
2366
1895
  /**
2367
1896
  * @returns {Identifier}
2368
1897
  */
2369
- get subject_id() {
2370
- const ret = wasm.revocation_subject_id(this.__wbg_ptr);
1898
+ get id() {
1899
+ const ret = wasm.peer_id(this.__wbg_ptr);
2371
1900
  return Identifier.__wrap(ret);
2372
1901
  }
2373
1902
  /**
2374
- * @returns {SignedDelegation}
1903
+ * @returns {boolean}
2375
1904
  */
2376
- get revoked() {
2377
- const ret = wasm.revocation_revoked(this.__wbg_ptr);
2378
- return SignedDelegation.__wrap(ret);
1905
+ isDocument() {
1906
+ const ret = wasm.peer_isDocument(this.__wbg_ptr);
1907
+ return ret !== 0;
2379
1908
  }
2380
1909
  /**
2381
- * @returns {SignedDelegation | undefined}
1910
+ * @returns {boolean}
2382
1911
  */
2383
- get proof() {
2384
- const ret = wasm.revocation_proof(this.__wbg_ptr);
2385
- return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
1912
+ isGroup() {
1913
+ const ret = wasm.peer_isGroup(this.__wbg_ptr);
1914
+ return ret !== 0;
2386
1915
  }
2387
1916
  /**
2388
- * @returns {History}
1917
+ * @returns {boolean}
2389
1918
  */
2390
- get after() {
2391
- const ret = wasm.revocation_after(this.__wbg_ptr);
2392
- return History.__wrap(ret);
2393
- }
2394
- }
2395
- if (Symbol.dispose) Revocation.prototype[Symbol.dispose] = Revocation.prototype.free;
2396
-
2397
- const RevokeMemberErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2398
- ? { register: () => {}, unregister: () => {} }
2399
- : new FinalizationRegistry(ptr => wasm.__wbg_revokemembererror_free(ptr >>> 0, 1));
2400
-
2401
- export class RevokeMemberError {
2402
-
2403
- static __wrap(ptr) {
2404
- ptr = ptr >>> 0;
2405
- const obj = Object.create(RevokeMemberError.prototype);
2406
- obj.__wbg_ptr = ptr;
2407
- RevokeMemberErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2408
- return obj;
2409
- }
2410
-
2411
- __destroy_into_raw() {
2412
- const ptr = this.__wbg_ptr;
2413
- this.__wbg_ptr = 0;
2414
- RevokeMemberErrorFinalization.unregister(this);
2415
- return ptr;
2416
- }
2417
-
2418
- free() {
2419
- const ptr = this.__destroy_into_raw();
2420
- wasm.__wbg_revokemembererror_free(ptr, 0);
1919
+ isIndividual() {
1920
+ const ret = wasm.peer_isIndividual(this.__wbg_ptr);
1921
+ return ret !== 0;
2421
1922
  }
2422
1923
  /**
2423
1924
  * @returns {string}
2424
1925
  */
2425
- get message() {
1926
+ toString() {
2426
1927
  let deferred1_0;
2427
1928
  let deferred1_1;
2428
1929
  try {
2429
- const ret = wasm.revokemembererror_message(this.__wbg_ptr);
1930
+ const ret = wasm.peer_toString(this.__wbg_ptr);
2430
1931
  deferred1_0 = ret[0];
2431
1932
  deferred1_1 = ret[1];
2432
1933
  return getStringFromWasm0(ret[0], ret[1]);
@@ -2435,93 +1936,89 @@ export class RevokeMemberError {
2435
1936
  }
2436
1937
  }
2437
1938
  }
2438
- if (Symbol.dispose) RevokeMemberError.prototype[Symbol.dispose] = RevokeMemberError.prototype.free;
2439
-
2440
- const SerializationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2441
- ? { register: () => {}, unregister: () => {} }
2442
- : new FinalizationRegistry(ptr => wasm.__wbg_serializationerror_free(ptr >>> 0, 1));
2443
-
2444
- export class SerializationError {
1939
+ if (Symbol.dispose) Peer.prototype[Symbol.dispose] = Peer.prototype.free;
2445
1940
 
1941
+ export class Revocation {
2446
1942
  static __wrap(ptr) {
2447
- ptr = ptr >>> 0;
2448
- const obj = Object.create(SerializationError.prototype);
1943
+ const obj = Object.create(Revocation.prototype);
2449
1944
  obj.__wbg_ptr = ptr;
2450
- SerializationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1945
+ RevocationFinalization.register(obj, obj.__wbg_ptr, obj);
2451
1946
  return obj;
2452
1947
  }
2453
-
2454
1948
  __destroy_into_raw() {
2455
1949
  const ptr = this.__wbg_ptr;
2456
1950
  this.__wbg_ptr = 0;
2457
- SerializationErrorFinalization.unregister(this);
1951
+ RevocationFinalization.unregister(this);
2458
1952
  return ptr;
2459
1953
  }
2460
-
2461
1954
  free() {
2462
1955
  const ptr = this.__destroy_into_raw();
2463
- wasm.__wbg_serializationerror_free(ptr, 0);
1956
+ wasm.__wbg_revocation_free(ptr, 0);
2464
1957
  }
2465
1958
  /**
2466
- * @returns {any}
1959
+ * @returns {History}
2467
1960
  */
2468
- toError() {
2469
- const ptr = this.__destroy_into_raw();
2470
- const ret = wasm.serializationerror_toError(ptr);
2471
- return ret;
1961
+ get after() {
1962
+ const ret = wasm.revocation_after(this.__wbg_ptr);
1963
+ return History.__wrap(ret);
1964
+ }
1965
+ /**
1966
+ * @returns {SignedDelegation | undefined}
1967
+ */
1968
+ get proof() {
1969
+ const ret = wasm.revocation_proof(this.__wbg_ptr);
1970
+ return ret === 0 ? undefined : SignedDelegation.__wrap(ret);
1971
+ }
1972
+ /**
1973
+ * @returns {SignedDelegation}
1974
+ */
1975
+ get revoked() {
1976
+ const ret = wasm.revocation_revoked(this.__wbg_ptr);
1977
+ return SignedDelegation.__wrap(ret);
1978
+ }
1979
+ /**
1980
+ * @returns {Identifier}
1981
+ */
1982
+ get subject_id() {
1983
+ const ret = wasm.revocation_subject_id(this.__wbg_ptr);
1984
+ return Identifier.__wrap(ret);
2472
1985
  }
2473
1986
  }
2474
- if (Symbol.dispose) SerializationError.prototype[Symbol.dispose] = SerializationError.prototype.free;
2475
-
2476
- const ShareKeyFinalization = (typeof FinalizationRegistry === 'undefined')
2477
- ? { register: () => {}, unregister: () => {} }
2478
- : new FinalizationRegistry(ptr => wasm.__wbg_sharekey_free(ptr >>> 0, 1));
1987
+ if (Symbol.dispose) Revocation.prototype[Symbol.dispose] = Revocation.prototype.free;
2479
1988
 
2480
1989
  export class ShareKey {
2481
-
2482
1990
  static __wrap(ptr) {
2483
- ptr = ptr >>> 0;
2484
1991
  const obj = Object.create(ShareKey.prototype);
2485
1992
  obj.__wbg_ptr = ptr;
2486
1993
  ShareKeyFinalization.register(obj, obj.__wbg_ptr, obj);
2487
1994
  return obj;
2488
1995
  }
2489
-
2490
1996
  __destroy_into_raw() {
2491
1997
  const ptr = this.__wbg_ptr;
2492
1998
  this.__wbg_ptr = 0;
2493
1999
  ShareKeyFinalization.unregister(this);
2494
2000
  return ptr;
2495
2001
  }
2496
-
2497
2002
  free() {
2498
2003
  const ptr = this.__destroy_into_raw();
2499
2004
  wasm.__wbg_sharekey_free(ptr, 0);
2500
2005
  }
2501
- }
2502
- if (Symbol.dispose) ShareKey.prototype[Symbol.dispose] = ShareKey.prototype.free;
2503
-
2504
- const SignedFinalization = (typeof FinalizationRegistry === 'undefined')
2505
- ? { register: () => {}, unregister: () => {} }
2506
- : new FinalizationRegistry(ptr => wasm.__wbg_signed_free(ptr >>> 0, 1));
2006
+ }
2007
+ if (Symbol.dispose) ShareKey.prototype[Symbol.dispose] = ShareKey.prototype.free;
2507
2008
 
2508
2009
  export class Signed {
2509
-
2510
2010
  static __wrap(ptr) {
2511
- ptr = ptr >>> 0;
2512
2011
  const obj = Object.create(Signed.prototype);
2513
2012
  obj.__wbg_ptr = ptr;
2514
2013
  SignedFinalization.register(obj, obj.__wbg_ptr, obj);
2515
2014
  return obj;
2516
2015
  }
2517
-
2518
2016
  __destroy_into_raw() {
2519
2017
  const ptr = this.__wbg_ptr;
2520
2018
  this.__wbg_ptr = 0;
2521
2019
  SignedFinalization.unregister(this);
2522
2020
  return ptr;
2523
2021
  }
2524
-
2525
2022
  free() {
2526
2023
  const ptr = this.__destroy_into_raw();
2527
2024
  wasm.__wbg_signed_free(ptr, 0);
@@ -2534,29 +2031,25 @@ export class Signed {
2534
2031
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2535
2032
  const len0 = WASM_VECTOR_LEN;
2536
2033
  const ret = wasm.signed_fromBytes(ptr0, len0);
2537
- return Signed.__wrap(ret);
2034
+ if (ret[2]) {
2035
+ throw takeFromExternrefTable0(ret[1]);
2036
+ }
2037
+ return Signed.__wrap(ret[0]);
2538
2038
  }
2539
2039
  /**
2540
2040
  * @returns {Uint8Array}
2541
2041
  */
2542
- toBytes() {
2543
- const ret = wasm.signed_toBytes(this.__wbg_ptr);
2042
+ get payload() {
2043
+ const ret = wasm.signed_payload(this.__wbg_ptr);
2544
2044
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2545
2045
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2546
2046
  return v1;
2547
2047
  }
2548
- /**
2549
- * @returns {boolean}
2550
- */
2551
- verify() {
2552
- const ret = wasm.signed_verify(this.__wbg_ptr);
2553
- return ret !== 0;
2554
- }
2555
2048
  /**
2556
2049
  * @returns {Uint8Array}
2557
2050
  */
2558
- get payload() {
2559
- const ret = wasm.signed_payload(this.__wbg_ptr);
2051
+ get signature() {
2052
+ const ret = wasm.signed_signature(this.__wbg_ptr);
2560
2053
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2561
2054
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2562
2055
  return v1;
@@ -2564,17 +2057,27 @@ export class Signed {
2564
2057
  /**
2565
2058
  * @returns {Uint8Array}
2566
2059
  */
2567
- get verifyingKey() {
2568
- const ret = wasm.signed_verifyingKey(this.__wbg_ptr);
2060
+ toBytes() {
2061
+ const ret = wasm.signed_toBytes(this.__wbg_ptr);
2062
+ if (ret[3]) {
2063
+ throw takeFromExternrefTable0(ret[2]);
2064
+ }
2569
2065
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2570
2066
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2571
2067
  return v1;
2572
2068
  }
2069
+ /**
2070
+ * @returns {boolean}
2071
+ */
2072
+ verify() {
2073
+ const ret = wasm.signed_verify(this.__wbg_ptr);
2074
+ return ret !== 0;
2075
+ }
2573
2076
  /**
2574
2077
  * @returns {Uint8Array}
2575
2078
  */
2576
- get signature() {
2577
- const ret = wasm.signed_signature(this.__wbg_ptr);
2079
+ get verifyingKey() {
2080
+ const ret = wasm.signed_verifyingKey(this.__wbg_ptr);
2578
2081
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2579
2082
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2580
2083
  return v1;
@@ -2582,38 +2085,23 @@ export class Signed {
2582
2085
  }
2583
2086
  if (Symbol.dispose) Signed.prototype[Symbol.dispose] = Signed.prototype.free;
2584
2087
 
2585
- const SignedCgkaOperationFinalization = (typeof FinalizationRegistry === 'undefined')
2586
- ? { register: () => {}, unregister: () => {} }
2587
- : new FinalizationRegistry(ptr => wasm.__wbg_signedcgkaoperation_free(ptr >>> 0, 1));
2588
-
2589
2088
  export class SignedCgkaOperation {
2590
-
2591
2089
  static __wrap(ptr) {
2592
- ptr = ptr >>> 0;
2593
2090
  const obj = Object.create(SignedCgkaOperation.prototype);
2594
2091
  obj.__wbg_ptr = ptr;
2595
2092
  SignedCgkaOperationFinalization.register(obj, obj.__wbg_ptr, obj);
2596
2093
  return obj;
2597
2094
  }
2598
-
2599
2095
  __destroy_into_raw() {
2600
2096
  const ptr = this.__wbg_ptr;
2601
2097
  this.__wbg_ptr = 0;
2602
2098
  SignedCgkaOperationFinalization.unregister(this);
2603
2099
  return ptr;
2604
2100
  }
2605
-
2606
2101
  free() {
2607
2102
  const ptr = this.__destroy_into_raw();
2608
2103
  wasm.__wbg_signedcgkaoperation_free(ptr, 0);
2609
2104
  }
2610
- /**
2611
- * @returns {boolean}
2612
- */
2613
- verify() {
2614
- const ret = wasm.signedcgkaoperation_verify(this.__wbg_ptr);
2615
- return ret !== 0;
2616
- }
2617
2105
  /**
2618
2106
  * @returns {CgkaOperation}
2619
2107
  */
@@ -2624,17 +2112,24 @@ export class SignedCgkaOperation {
2624
2112
  /**
2625
2113
  * @returns {Uint8Array}
2626
2114
  */
2627
- get verifyingKey() {
2628
- const ret = wasm.signedcgkaoperation_verifyingKey(this.__wbg_ptr);
2115
+ get signature() {
2116
+ const ret = wasm.signedcgkaoperation_signature(this.__wbg_ptr);
2629
2117
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2630
2118
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2631
2119
  return v1;
2632
2120
  }
2121
+ /**
2122
+ * @returns {boolean}
2123
+ */
2124
+ verify() {
2125
+ const ret = wasm.signedcgkaoperation_verify(this.__wbg_ptr);
2126
+ return ret !== 0;
2127
+ }
2633
2128
  /**
2634
2129
  * @returns {Uint8Array}
2635
2130
  */
2636
- get signature() {
2637
- const ret = wasm.signedcgkaoperation_signature(this.__wbg_ptr);
2131
+ get verifyingKey() {
2132
+ const ret = wasm.signedcgkaoperation_verifyingKey(this.__wbg_ptr);
2638
2133
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2639
2134
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2640
2135
  return v1;
@@ -2642,38 +2137,23 @@ export class SignedCgkaOperation {
2642
2137
  }
2643
2138
  if (Symbol.dispose) SignedCgkaOperation.prototype[Symbol.dispose] = SignedCgkaOperation.prototype.free;
2644
2139
 
2645
- const SignedDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
2646
- ? { register: () => {}, unregister: () => {} }
2647
- : new FinalizationRegistry(ptr => wasm.__wbg_signeddelegation_free(ptr >>> 0, 1));
2648
-
2649
2140
  export class SignedDelegation {
2650
-
2651
2141
  static __wrap(ptr) {
2652
- ptr = ptr >>> 0;
2653
2142
  const obj = Object.create(SignedDelegation.prototype);
2654
2143
  obj.__wbg_ptr = ptr;
2655
2144
  SignedDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
2656
2145
  return obj;
2657
2146
  }
2658
-
2659
2147
  __destroy_into_raw() {
2660
2148
  const ptr = this.__wbg_ptr;
2661
2149
  this.__wbg_ptr = 0;
2662
2150
  SignedDelegationFinalization.unregister(this);
2663
2151
  return ptr;
2664
2152
  }
2665
-
2666
2153
  free() {
2667
2154
  const ptr = this.__destroy_into_raw();
2668
2155
  wasm.__wbg_signeddelegation_free(ptr, 0);
2669
2156
  }
2670
- /**
2671
- * @returns {boolean}
2672
- */
2673
- verify() {
2674
- const ret = wasm.signeddelegation_verify(this.__wbg_ptr);
2675
- return ret !== 0;
2676
- }
2677
2157
  /**
2678
2158
  * @returns {Delegation}
2679
2159
  */
@@ -2684,17 +2164,31 @@ export class SignedDelegation {
2684
2164
  /**
2685
2165
  * @returns {Uint8Array}
2686
2166
  */
2687
- get verifyingKey() {
2688
- const ret = wasm.signeddelegation_verifyingKey(this.__wbg_ptr);
2167
+ get signature() {
2168
+ const ret = wasm.signeddelegation_signature(this.__wbg_ptr);
2689
2169
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2690
2170
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2691
2171
  return v1;
2692
2172
  }
2173
+ /**
2174
+ * @returns {Identifier}
2175
+ */
2176
+ get subjectId() {
2177
+ const ret = wasm.signeddelegation_subjectId(this.__wbg_ptr);
2178
+ return Identifier.__wrap(ret);
2179
+ }
2180
+ /**
2181
+ * @returns {boolean}
2182
+ */
2183
+ verify() {
2184
+ const ret = wasm.signeddelegation_verify(this.__wbg_ptr);
2185
+ return ret !== 0;
2186
+ }
2693
2187
  /**
2694
2188
  * @returns {Uint8Array}
2695
2189
  */
2696
- get signature() {
2697
- const ret = wasm.signeddelegation_signature(this.__wbg_ptr);
2190
+ get verifyingKey() {
2191
+ const ret = wasm.signeddelegation_verifyingKey(this.__wbg_ptr);
2698
2192
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2699
2193
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2700
2194
  return v1;
@@ -2702,19 +2196,13 @@ export class SignedDelegation {
2702
2196
  }
2703
2197
  if (Symbol.dispose) SignedDelegation.prototype[Symbol.dispose] = SignedDelegation.prototype.free;
2704
2198
 
2705
- const SignedInvocationFinalization = (typeof FinalizationRegistry === 'undefined')
2706
- ? { register: () => {}, unregister: () => {} }
2707
- : new FinalizationRegistry(ptr => wasm.__wbg_signedinvocation_free(ptr >>> 0, 1));
2708
-
2709
2199
  export class SignedInvocation {
2710
-
2711
2200
  __destroy_into_raw() {
2712
2201
  const ptr = this.__wbg_ptr;
2713
2202
  this.__wbg_ptr = 0;
2714
2203
  SignedInvocationFinalization.unregister(this);
2715
2204
  return ptr;
2716
2205
  }
2717
-
2718
2206
  free() {
2719
2207
  const ptr = this.__destroy_into_raw();
2720
2208
  wasm.__wbg_signedinvocation_free(ptr, 0);
@@ -2722,38 +2210,23 @@ export class SignedInvocation {
2722
2210
  }
2723
2211
  if (Symbol.dispose) SignedInvocation.prototype[Symbol.dispose] = SignedInvocation.prototype.free;
2724
2212
 
2725
- const SignedRevocationFinalization = (typeof FinalizationRegistry === 'undefined')
2726
- ? { register: () => {}, unregister: () => {} }
2727
- : new FinalizationRegistry(ptr => wasm.__wbg_signedrevocation_free(ptr >>> 0, 1));
2728
-
2729
2213
  export class SignedRevocation {
2730
-
2731
2214
  static __wrap(ptr) {
2732
- ptr = ptr >>> 0;
2733
2215
  const obj = Object.create(SignedRevocation.prototype);
2734
2216
  obj.__wbg_ptr = ptr;
2735
2217
  SignedRevocationFinalization.register(obj, obj.__wbg_ptr, obj);
2736
2218
  return obj;
2737
2219
  }
2738
-
2739
2220
  __destroy_into_raw() {
2740
2221
  const ptr = this.__wbg_ptr;
2741
2222
  this.__wbg_ptr = 0;
2742
2223
  SignedRevocationFinalization.unregister(this);
2743
2224
  return ptr;
2744
2225
  }
2745
-
2746
2226
  free() {
2747
2227
  const ptr = this.__destroy_into_raw();
2748
2228
  wasm.__wbg_signedrevocation_free(ptr, 0);
2749
2229
  }
2750
- /**
2751
- * @returns {boolean}
2752
- */
2753
- verify() {
2754
- const ret = wasm.signedrevocation_verify(this.__wbg_ptr);
2755
- return ret !== 0;
2756
- }
2757
2230
  /**
2758
2231
  * @returns {Revocation}
2759
2232
  */
@@ -2764,17 +2237,24 @@ export class SignedRevocation {
2764
2237
  /**
2765
2238
  * @returns {Uint8Array}
2766
2239
  */
2767
- get verifyingKey() {
2768
- const ret = wasm.signedrevocation_verifyingKey(this.__wbg_ptr);
2240
+ get signature() {
2241
+ const ret = wasm.signedrevocation_signature(this.__wbg_ptr);
2769
2242
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2770
2243
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2771
2244
  return v1;
2772
2245
  }
2246
+ /**
2247
+ * @returns {boolean}
2248
+ */
2249
+ verify() {
2250
+ const ret = wasm.signedrevocation_verify(this.__wbg_ptr);
2251
+ return ret !== 0;
2252
+ }
2773
2253
  /**
2774
2254
  * @returns {Uint8Array}
2775
2255
  */
2776
- get signature() {
2777
- const ret = wasm.signedrevocation_signature(this.__wbg_ptr);
2256
+ get verifyingKey() {
2257
+ const ret = wasm.signedrevocation_verifyingKey(this.__wbg_ptr);
2778
2258
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2779
2259
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2780
2260
  return v1;
@@ -2782,31 +2262,30 @@ export class SignedRevocation {
2782
2262
  }
2783
2263
  if (Symbol.dispose) SignedRevocation.prototype[Symbol.dispose] = SignedRevocation.prototype.free;
2784
2264
 
2785
- const SignerFinalization = (typeof FinalizationRegistry === 'undefined')
2786
- ? { register: () => {}, unregister: () => {} }
2787
- : new FinalizationRegistry(ptr => wasm.__wbg_signer_free(ptr >>> 0, 1));
2788
-
2789
2265
  export class Signer {
2790
-
2791
2266
  static __wrap(ptr) {
2792
- ptr = ptr >>> 0;
2793
2267
  const obj = Object.create(Signer.prototype);
2794
2268
  obj.__wbg_ptr = ptr;
2795
2269
  SignerFinalization.register(obj, obj.__wbg_ptr, obj);
2796
2270
  return obj;
2797
2271
  }
2798
-
2799
2272
  __destroy_into_raw() {
2800
2273
  const ptr = this.__wbg_ptr;
2801
2274
  this.__wbg_ptr = 0;
2802
2275
  SignerFinalization.unregister(this);
2803
2276
  return ptr;
2804
2277
  }
2805
-
2806
2278
  free() {
2807
2279
  const ptr = this.__destroy_into_raw();
2808
2280
  wasm.__wbg_signer_free(ptr, 0);
2809
2281
  }
2282
+ /**
2283
+ * @returns {Signer}
2284
+ */
2285
+ clone() {
2286
+ const ret = wasm.signer_clone(this.__wbg_ptr);
2287
+ return Signer.__wrap(ret);
2288
+ }
2810
2289
  /**
2811
2290
  * @returns {Promise<Signer>}
2812
2291
  */
@@ -2842,11 +2321,13 @@ export class Signer {
2842
2321
  return Signer.__wrap(ret[0]);
2843
2322
  }
2844
2323
  /**
2845
- * @param {any} keypair
2846
- * @returns {Promise<Signer>}
2324
+ * @param {Uint8Array} bytes
2325
+ * @returns {Promise<Signed>}
2847
2326
  */
2848
- static webCryptoSigner(keypair) {
2849
- const ret = wasm.signer_webCryptoSigner(keypair);
2327
+ trySign(bytes) {
2328
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2329
+ const len0 = WASM_VECTOR_LEN;
2330
+ const ret = wasm.signer_trySign(this.__wbg_ptr, ptr0, len0);
2850
2331
  return ret;
2851
2332
  }
2852
2333
  /**
@@ -2864,16 +2345,6 @@ export class Signer {
2864
2345
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2865
2346
  }
2866
2347
  }
2867
- /**
2868
- * @param {Uint8Array} bytes
2869
- * @returns {Promise<Signed>}
2870
- */
2871
- trySign(bytes) {
2872
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2873
- const len0 = WASM_VECTOR_LEN;
2874
- const ret = wasm.signer_trySign(this.__wbg_ptr, ptr0, len0);
2875
- return ret;
2876
- }
2877
2348
  /**
2878
2349
  * @returns {Uint8Array}
2879
2350
  */
@@ -2884,132 +2355,200 @@ export class Signer {
2884
2355
  return v1;
2885
2356
  }
2886
2357
  /**
2887
- * @returns {Signer}
2358
+ * @param {any} keypair
2359
+ * @returns {Promise<Signer>}
2888
2360
  */
2889
- clone() {
2890
- const ret = wasm.signer_clone(this.__wbg_ptr);
2891
- return Signer.__wrap(ret);
2361
+ static webCryptoSigner(keypair) {
2362
+ const ret = wasm.signer_webCryptoSigner(keypair);
2363
+ return ret;
2892
2364
  }
2893
2365
  }
2894
2366
  if (Symbol.dispose) Signer.prototype[Symbol.dispose] = Signer.prototype.free;
2895
2367
 
2896
- const SigningErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2897
- ? { register: () => {}, unregister: () => {} }
2898
- : new FinalizationRegistry(ptr => wasm.__wbg_signingerror_free(ptr >>> 0, 1));
2899
-
2900
- export class SigningError {
2901
-
2368
+ export class Stats {
2902
2369
  static __wrap(ptr) {
2903
- ptr = ptr >>> 0;
2904
- const obj = Object.create(SigningError.prototype);
2370
+ const obj = Object.create(Stats.prototype);
2905
2371
  obj.__wbg_ptr = ptr;
2906
- SigningErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2372
+ StatsFinalization.register(obj, obj.__wbg_ptr, obj);
2907
2373
  return obj;
2908
2374
  }
2909
-
2910
2375
  __destroy_into_raw() {
2911
2376
  const ptr = this.__wbg_ptr;
2912
2377
  this.__wbg_ptr = 0;
2913
- SigningErrorFinalization.unregister(this);
2378
+ StatsFinalization.unregister(this);
2914
2379
  return ptr;
2915
2380
  }
2916
-
2917
2381
  free() {
2918
2382
  const ptr = this.__destroy_into_raw();
2919
- wasm.__wbg_signingerror_free(ptr, 0);
2383
+ wasm.__wbg_stats_free(ptr, 0);
2920
2384
  }
2921
2385
  /**
2922
- * @returns {string}
2386
+ * @returns {bigint}
2923
2387
  */
2924
- message() {
2925
- let deferred1_0;
2926
- let deferred1_1;
2927
- try {
2928
- const ret = wasm.signingerror_message(this.__wbg_ptr);
2929
- deferred1_0 = ret[0];
2930
- deferred1_1 = ret[1];
2931
- return getStringFromWasm0(ret[0], ret[1]);
2932
- } finally {
2933
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2934
- }
2388
+ get activePrekeyCount() {
2389
+ const ret = wasm.stats_activePrekeyCount(this.__wbg_ptr);
2390
+ return BigInt.asUintN(64, ret);
2935
2391
  }
2936
- }
2937
- if (Symbol.dispose) SigningError.prototype[Symbol.dispose] = SigningError.prototype.free;
2938
-
2939
- const SimpleCapabilityFinalization = (typeof FinalizationRegistry === 'undefined')
2940
- ? { register: () => {}, unregister: () => {} }
2941
- : new FinalizationRegistry(ptr => wasm.__wbg_simplecapability_free(ptr >>> 0, 1));
2942
-
2943
- export class SimpleCapability {
2944
-
2945
- static __wrap(ptr) {
2946
- ptr = ptr >>> 0;
2947
- const obj = Object.create(SimpleCapability.prototype);
2948
- obj.__wbg_ptr = ptr;
2949
- SimpleCapabilityFinalization.register(obj, obj.__wbg_ptr, obj);
2950
- return obj;
2392
+ /**
2393
+ * @returns {bigint}
2394
+ */
2395
+ get cgkaOperations() {
2396
+ const ret = wasm.stats_cgkaOperations(this.__wbg_ptr);
2397
+ return BigInt.asUintN(64, ret);
2951
2398
  }
2952
-
2953
- __destroy_into_raw() {
2954
- const ptr = this.__wbg_ptr;
2955
- this.__wbg_ptr = 0;
2956
- SimpleCapabilityFinalization.unregister(this);
2957
- return ptr;
2399
+ /**
2400
+ * @returns {bigint}
2401
+ */
2402
+ get delegations() {
2403
+ const ret = wasm.stats_delegations(this.__wbg_ptr);
2404
+ return BigInt.asUintN(64, ret);
2958
2405
  }
2959
-
2960
- free() {
2961
- const ptr = this.__destroy_into_raw();
2962
- wasm.__wbg_simplecapability_free(ptr, 0);
2406
+ /**
2407
+ * @returns {bigint}
2408
+ */
2409
+ get docs() {
2410
+ const ret = wasm.stats_docs(this.__wbg_ptr);
2411
+ return BigInt.asUintN(64, ret);
2412
+ }
2413
+ /**
2414
+ * @returns {bigint}
2415
+ */
2416
+ get groups() {
2417
+ const ret = wasm.stats_groups(this.__wbg_ptr);
2418
+ return BigInt.asUintN(64, ret);
2419
+ }
2420
+ /**
2421
+ * @returns {bigint}
2422
+ */
2423
+ get individuals() {
2424
+ const ret = wasm.stats_individuals(this.__wbg_ptr);
2425
+ return BigInt.asUintN(64, ret);
2426
+ }
2427
+ /**
2428
+ * @returns {bigint}
2429
+ */
2430
+ get pendingCgkaOperation() {
2431
+ const ret = wasm.stats_pendingCgkaOperation(this.__wbg_ptr);
2432
+ return BigInt.asUintN(64, ret);
2433
+ }
2434
+ /**
2435
+ * @returns {bigint}
2436
+ */
2437
+ get pendingCgkaOperationByActive() {
2438
+ const ret = wasm.stats_pendingCgkaOperationByActive(this.__wbg_ptr);
2439
+ return BigInt.asUintN(64, ret);
2440
+ }
2441
+ /**
2442
+ * @returns {bigint}
2443
+ */
2444
+ get pendingDelegated() {
2445
+ const ret = wasm.stats_pendingDelegated(this.__wbg_ptr);
2446
+ return BigInt.asUintN(64, ret);
2447
+ }
2448
+ /**
2449
+ * @returns {bigint}
2450
+ */
2451
+ get pendingDelegatedByActive() {
2452
+ const ret = wasm.stats_pendingDelegatedByActive(this.__wbg_ptr);
2453
+ return BigInt.asUintN(64, ret);
2454
+ }
2455
+ /**
2456
+ * @returns {bigint}
2457
+ */
2458
+ get pendingPrekeyRotated() {
2459
+ const ret = wasm.stats_pendingPrekeyRotated(this.__wbg_ptr);
2460
+ return BigInt.asUintN(64, ret);
2461
+ }
2462
+ /**
2463
+ * @returns {bigint}
2464
+ */
2465
+ get pendingPrekeyRotatedByActive() {
2466
+ const ret = wasm.stats_pendingPrekeyRotatedByActive(this.__wbg_ptr);
2467
+ return BigInt.asUintN(64, ret);
2468
+ }
2469
+ /**
2470
+ * @returns {bigint}
2471
+ */
2472
+ get pendingPrekeysExpanded() {
2473
+ const ret = wasm.stats_pendingPrekeysExpanded(this.__wbg_ptr);
2474
+ return BigInt.asUintN(64, ret);
2475
+ }
2476
+ /**
2477
+ * @returns {bigint}
2478
+ */
2479
+ get pendingPrekeysExpandedByActive() {
2480
+ const ret = wasm.stats_pendingPrekeysExpandedByActive(this.__wbg_ptr);
2481
+ return BigInt.asUintN(64, ret);
2482
+ }
2483
+ /**
2484
+ * @returns {bigint}
2485
+ */
2486
+ get pendingRevoked() {
2487
+ const ret = wasm.stats_pendingRevoked(this.__wbg_ptr);
2488
+ return BigInt.asUintN(64, ret);
2489
+ }
2490
+ /**
2491
+ * @returns {bigint}
2492
+ */
2493
+ get pendingRevokedByActive() {
2494
+ const ret = wasm.stats_pendingRevokedByActive(this.__wbg_ptr);
2495
+ return BigInt.asUintN(64, ret);
2496
+ }
2497
+ /**
2498
+ * @returns {bigint}
2499
+ */
2500
+ get prekeyRotations() {
2501
+ const ret = wasm.stats_prekeyRotations(this.__wbg_ptr);
2502
+ return BigInt.asUintN(64, ret);
2503
+ }
2504
+ /**
2505
+ * @returns {bigint}
2506
+ */
2507
+ get prekeysExpanded() {
2508
+ const ret = wasm.stats_prekeysExpanded(this.__wbg_ptr);
2509
+ return BigInt.asUintN(64, ret);
2963
2510
  }
2964
2511
  /**
2965
- * @returns {Agent}
2512
+ * @returns {bigint}
2966
2513
  */
2967
- get who() {
2968
- const ret = wasm.simplecapability_who(this.__wbg_ptr);
2969
- return Agent.__wrap(ret);
2514
+ get revocations() {
2515
+ const ret = wasm.stats_revocations(this.__wbg_ptr);
2516
+ return BigInt.asUintN(64, ret);
2970
2517
  }
2971
2518
  /**
2972
- * @returns {Access}
2519
+ * @returns {bigint}
2973
2520
  */
2974
- get can() {
2975
- const ret = wasm.simplecapability_can(this.__wbg_ptr);
2976
- return Access.__wrap(ret);
2521
+ get totalOps() {
2522
+ const ret = wasm.stats_totalOps(this.__wbg_ptr);
2523
+ return BigInt.asUintN(64, ret);
2524
+ }
2525
+ /**
2526
+ * @returns {bigint}
2527
+ */
2528
+ get totalPendingOps() {
2529
+ const ret = wasm.stats_totalPendingOps(this.__wbg_ptr);
2530
+ return BigInt.asUintN(64, ret);
2977
2531
  }
2978
2532
  }
2979
- if (Symbol.dispose) SimpleCapability.prototype[Symbol.dispose] = SimpleCapability.prototype.free;
2980
-
2981
- const SummaryFinalization = (typeof FinalizationRegistry === 'undefined')
2982
- ? { register: () => {}, unregister: () => {} }
2983
- : new FinalizationRegistry(ptr => wasm.__wbg_summary_free(ptr >>> 0, 1));
2533
+ if (Symbol.dispose) Stats.prototype[Symbol.dispose] = Stats.prototype.free;
2984
2534
 
2985
2535
  export class Summary {
2986
-
2987
2536
  static __wrap(ptr) {
2988
- ptr = ptr >>> 0;
2989
2537
  const obj = Object.create(Summary.prototype);
2990
2538
  obj.__wbg_ptr = ptr;
2991
2539
  SummaryFinalization.register(obj, obj.__wbg_ptr, obj);
2992
2540
  return obj;
2993
2541
  }
2994
-
2995
2542
  __destroy_into_raw() {
2996
2543
  const ptr = this.__wbg_ptr;
2997
2544
  this.__wbg_ptr = 0;
2998
2545
  SummaryFinalization.unregister(this);
2999
2546
  return ptr;
3000
2547
  }
3001
-
3002
2548
  free() {
3003
2549
  const ptr = this.__destroy_into_raw();
3004
2550
  wasm.__wbg_summary_free(ptr, 0);
3005
2551
  }
3006
- /**
3007
- * @returns {Document}
3008
- */
3009
- get doc() {
3010
- const ret = wasm.summary_doc(this.__wbg_ptr);
3011
- return Document.__wrap(ret);
3012
- }
3013
2552
  /**
3014
2553
  * @returns {Access}
3015
2554
  */
@@ -3017,121 +2556,168 @@ export class Summary {
3017
2556
  const ret = wasm.summary_access(this.__wbg_ptr);
3018
2557
  return Access.__wrap(ret);
3019
2558
  }
3020
- }
3021
- if (Symbol.dispose) Summary.prototype[Symbol.dispose] = Summary.prototype.free;
3022
-
3023
- const TryFromArchiveErrorFinalization = (typeof FinalizationRegistry === 'undefined')
3024
- ? { register: () => {}, unregister: () => {} }
3025
- : new FinalizationRegistry(ptr => wasm.__wbg_tryfromarchiveerror_free(ptr >>> 0, 1));
3026
-
3027
- export class TryFromArchiveError {
3028
-
3029
- static __wrap(ptr) {
3030
- ptr = ptr >>> 0;
3031
- const obj = Object.create(TryFromArchiveError.prototype);
3032
- obj.__wbg_ptr = ptr;
3033
- TryFromArchiveErrorFinalization.register(obj, obj.__wbg_ptr, obj);
3034
- return obj;
3035
- }
3036
-
3037
- __destroy_into_raw() {
3038
- const ptr = this.__wbg_ptr;
3039
- this.__wbg_ptr = 0;
3040
- TryFromArchiveErrorFinalization.unregister(this);
3041
- return ptr;
3042
- }
3043
-
3044
- free() {
3045
- const ptr = this.__destroy_into_raw();
3046
- wasm.__wbg_tryfromarchiveerror_free(ptr, 0);
3047
- }
3048
2559
  /**
3049
- * @returns {any}
2560
+ * @returns {Document}
3050
2561
  */
3051
- toError() {
3052
- const ptr = this.__destroy_into_raw();
3053
- const ret = wasm.tryfromarchiveerror_toError(ptr);
3054
- return ret;
2562
+ get doc() {
2563
+ const ret = wasm.summary_doc(this.__wbg_ptr);
2564
+ return Document.__wrap(ret);
3055
2565
  }
3056
2566
  }
3057
- if (Symbol.dispose) TryFromArchiveError.prototype[Symbol.dispose] = TryFromArchiveError.prototype.free;
2567
+ if (Symbol.dispose) Summary.prototype[Symbol.dispose] = Summary.prototype.free;
3058
2568
 
3059
- export function __wbg_Error_e17e777aac105295(arg0, arg1) {
2569
+ /**
2570
+ * Panic hook lets us get better error messages if our Rust code ever panics.
2571
+ *
2572
+ * This function needs to be called at least once during initialisation.
2573
+ * https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/template-deep-dive/src-utils-rs.html#2-what-is-console_error_panic_hook
2574
+ */
2575
+ export function setPanicHook() {
2576
+ wasm.setPanicHook();
2577
+ }
2578
+ export function __wbg_Error_fdd633d4bb5dd76a(arg0, arg1) {
3060
2579
  const ret = Error(getStringFromWasm0(arg0, arg1));
3061
2580
  return ret;
3062
- };
3063
-
3064
- export function __wbg_addmembererror_new(arg0) {
3065
- const ret = AddMemberError.__wrap(arg0);
2581
+ }
2582
+ export function __wbg___wasm_refgen_toJsChangeId_1a4e8d260f698820(arg0) {
2583
+ const ret = arg0.__wasm_refgen_toJsChangeId();
2584
+ _assertClass(ret, ChangeId);
2585
+ var ptr1 = ret.__destroy_into_raw();
2586
+ return ptr1;
2587
+ }
2588
+ export function __wbg___wasm_refgen_toJsDocument_bb9bc0924846047d(arg0) {
2589
+ const ret = arg0.__wasm_refgen_toJsDocument();
2590
+ _assertClass(ret, Document);
2591
+ var ptr1 = ret.__destroy_into_raw();
2592
+ return ptr1;
2593
+ }
2594
+ export function __wbg___wasm_refgen_toJsPeer_17636bceb3369eeb(arg0) {
2595
+ const ret = arg0.__wasm_refgen_toJsPeer();
2596
+ _assertClass(ret, Peer);
2597
+ var ptr1 = ret.__destroy_into_raw();
2598
+ return ptr1;
2599
+ }
2600
+ export function __wbg___wbindgen_debug_string_8a447059637473e2(arg0, arg1) {
2601
+ const ret = debugString(arg1);
2602
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2603
+ const len1 = WASM_VECTOR_LEN;
2604
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2605
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2606
+ }
2607
+ export function __wbg___wbindgen_is_function_acc5528be2b923f2(arg0) {
2608
+ const ret = typeof(arg0) === 'function';
3066
2609
  return ret;
3067
- };
3068
-
3069
- export function __wbg_call_13410aac570ffff7() { return handleError(function (arg0, arg1) {
3070
- const ret = arg0.call(arg1);
2610
+ }
2611
+ export function __wbg___wbindgen_is_object_0beba4a1980d3eea(arg0) {
2612
+ const val = arg0;
2613
+ const ret = typeof(val) === 'object' && val !== null;
3071
2614
  return ret;
3072
- }, arguments) };
3073
-
3074
- export function __wbg_call_a5400b25a865cfd8() { return handleError(function (arg0, arg1, arg2) {
2615
+ }
2616
+ export function __wbg___wbindgen_is_string_1fca8072260dd261(arg0) {
2617
+ const ret = typeof(arg0) === 'string';
2618
+ return ret;
2619
+ }
2620
+ export function __wbg___wbindgen_is_undefined_721f8decd50c87a3(arg0) {
2621
+ const ret = arg0 === undefined;
2622
+ return ret;
2623
+ }
2624
+ export function __wbg___wbindgen_throw_ea4887a5f8f9a9db(arg0, arg1) {
2625
+ throw new Error(getStringFromWasm0(arg0, arg1));
2626
+ }
2627
+ export function __wbg__wbg_cb_unref_33c39e13d73b25f6(arg0) {
2628
+ arg0._wbg_cb_unref();
2629
+ }
2630
+ export function __wbg_access_new(arg0) {
2631
+ const ret = Access.__wrap(arg0);
2632
+ return ret;
2633
+ }
2634
+ export function __wbg_add_8db1450e4b353bba(arg0, arg1) {
2635
+ const ret = arg0.add(arg1);
2636
+ return ret;
2637
+ }
2638
+ export function __wbg_addmemberupdate_new(arg0) {
2639
+ const ret = AddMemberUpdate.__wrap(arg0);
2640
+ return ret;
2641
+ }
2642
+ export function __wbg_agent_new(arg0) {
2643
+ const ret = Agent.__wrap(arg0);
2644
+ return ret;
2645
+ }
2646
+ export function __wbg_allagentevents_new(arg0) {
2647
+ const ret = AllAgentEvents.__wrap(arg0);
2648
+ return ret;
2649
+ }
2650
+ export function __wbg_archive_new(arg0) {
2651
+ const ret = Archive.__wrap(arg0);
2652
+ return ret;
2653
+ }
2654
+ export function __wbg_call_5575218572ead796() { return handleError(function (arg0, arg1, arg2) {
3075
2655
  const ret = arg0.call(arg1, arg2);
3076
2656
  return ret;
3077
- }, arguments) };
3078
-
2657
+ }, arguments); }
3079
2658
  export function __wbg_cannotparseed25519signingkey_new(arg0) {
3080
2659
  const ret = CannotParseEd25519SigningKey.__wrap(arg0);
3081
2660
  return ret;
3082
- };
3083
-
2661
+ }
3084
2662
  export function __wbg_cannotparseidentifier_new(arg0) {
3085
2663
  const ret = CannotParseIdentifier.__wrap(arg0);
3086
2664
  return ret;
3087
- };
3088
-
2665
+ }
3089
2666
  export function __wbg_capability_new(arg0) {
3090
2667
  const ret = Capability.__wrap(arg0);
3091
2668
  return ret;
3092
- };
3093
-
3094
- export function __wbg_changeref_new(arg0) {
3095
- const ret = ChangeRef.__wrap(arg0);
2669
+ }
2670
+ export function __wbg_changeid_new(arg0) {
2671
+ const ret = ChangeId.__wrap(arg0);
3096
2672
  return ret;
3097
- };
3098
-
3099
- export function __wbg_changeref_unwrap(arg0) {
3100
- const ret = ChangeRef.__unwrap(arg0);
2673
+ }
2674
+ export function __wbg_changeid_unwrap(arg0) {
2675
+ const ret = ChangeId.__unwrap(arg0);
3101
2676
  return ret;
3102
- };
3103
-
2677
+ }
3104
2678
  export function __wbg_contactcard_new(arg0) {
3105
2679
  const ret = ContactCard.__wrap(arg0);
3106
2680
  return ret;
3107
- };
3108
-
3109
- export function __wbg_crypto_574e78ad8b13b65f(arg0) {
2681
+ }
2682
+ export function __wbg_crypto_38df2bab126b63dc(arg0) {
3110
2683
  const ret = arg0.crypto;
3111
2684
  return ret;
3112
- };
3113
-
2685
+ }
2686
+ export function __wbg_debug_1995429f18ef72ac(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
2687
+ let deferred0_0;
2688
+ let deferred0_1;
2689
+ try {
2690
+ deferred0_0 = arg0;
2691
+ deferred0_1 = arg1;
2692
+ console.debug(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
2693
+ } finally {
2694
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2695
+ }
2696
+ }
2697
+ export function __wbg_debug_3003e89da631cad7(arg0, arg1) {
2698
+ let deferred0_0;
2699
+ let deferred0_1;
2700
+ try {
2701
+ deferred0_0 = arg0;
2702
+ deferred0_1 = arg1;
2703
+ console.debug(getStringFromWasm0(arg0, arg1));
2704
+ } finally {
2705
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2706
+ }
2707
+ }
3114
2708
  export function __wbg_doccontentrefs_new(arg0) {
3115
2709
  const ret = DocContentRefs.__wrap(arg0);
3116
2710
  return ret;
3117
- };
3118
-
2711
+ }
3119
2712
  export function __wbg_document_new(arg0) {
3120
2713
  const ret = Document.__wrap(arg0);
3121
2714
  return ret;
3122
- };
3123
-
3124
- export function __wbg_document_unwrap(arg0) {
3125
- const ret = Document.__unwrap(arg0);
3126
- return ret;
3127
- };
3128
-
2715
+ }
3129
2716
  export function __wbg_encryptedcontentwithupdate_new(arg0) {
3130
2717
  const ret = EncryptedContentWithUpdate.__wrap(arg0);
3131
2718
  return ret;
3132
- };
3133
-
3134
- export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
2719
+ }
2720
+ export function __wbg_error_8b62d3db440cf4a8(arg0, arg1) {
3135
2721
  let deferred0_0;
3136
2722
  let deferred0_1;
3137
2723
  try {
@@ -3141,58 +2727,73 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
3141
2727
  } finally {
3142
2728
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3143
2729
  }
3144
- };
3145
-
2730
+ }
2731
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
2732
+ let deferred0_0;
2733
+ let deferred0_1;
2734
+ try {
2735
+ deferred0_0 = arg0;
2736
+ deferred0_1 = arg1;
2737
+ console.error(getStringFromWasm0(arg0, arg1));
2738
+ } finally {
2739
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2740
+ }
2741
+ }
2742
+ export function __wbg_error_c90492381694a8af(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
2743
+ let deferred0_0;
2744
+ let deferred0_1;
2745
+ try {
2746
+ deferred0_0 = arg0;
2747
+ deferred0_1 = arg1;
2748
+ console.error(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
2749
+ } finally {
2750
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2751
+ }
2752
+ }
3146
2753
  export function __wbg_event_new(arg0) {
3147
2754
  const ret = Event.__wrap(arg0);
3148
2755
  return ret;
3149
- };
3150
-
3151
- export function __wbg_exportKey_4a1163511775473d() { return handleError(function (arg0, arg1, arg2, arg3) {
2756
+ }
2757
+ export function __wbg_exportKey_1ce2ce04d90beed3() { return handleError(function (arg0, arg1, arg2, arg3) {
3152
2758
  const ret = arg0.exportKey(getStringFromWasm0(arg1, arg2), arg3);
3153
2759
  return ret;
3154
- }, arguments) };
3155
-
3156
- export function __wbg_generateKey_b8902ccb0e50ff4e() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2760
+ }, arguments); }
2761
+ export function __wbg_generateKey_d7565f8a873b2758() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3157
2762
  const ret = arg0.generateKey(getStringFromWasm0(arg1, arg2), arg3 !== 0, arg4);
3158
2763
  return ret;
3159
- }, arguments) };
3160
-
3161
- export function __wbg_generatedocerror_new(arg0) {
3162
- const ret = GenerateDocError.__wrap(arg0);
3163
- return ret;
3164
- };
3165
-
2764
+ }, arguments); }
3166
2765
  export function __wbg_generatewebcryptoerror_new(arg0) {
3167
2766
  const ret = GenerateWebCryptoError.__wrap(arg0);
3168
2767
  return ret;
3169
- };
3170
-
3171
- export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(function (arg0, arg1) {
2768
+ }
2769
+ export function __wbg_getRandomValues_c44a50d8cfdaebeb() { return handleError(function (arg0, arg1) {
3172
2770
  arg0.getRandomValues(arg1);
3173
- }, arguments) };
3174
-
3175
- export function __wbg_get_458e874b43b18b25() { return handleError(function (arg0, arg1) {
2771
+ }, arguments); }
2772
+ export function __wbg_get_197a3fe98f169e38(arg0, arg1) {
2773
+ const ret = arg0[arg1 >>> 0];
2774
+ return ret;
2775
+ }
2776
+ export function __wbg_get_dddb90ff5d27a080() { return handleError(function (arg0, arg1) {
3176
2777
  const ret = Reflect.get(arg0, arg1);
3177
2778
  return ret;
3178
- }, arguments) };
3179
-
3180
- export function __wbg_getprivatekey_2b060a8a8c19d828(arg0) {
2779
+ }, arguments); }
2780
+ export function __wbg_get_private_key_5512a2630ab9366a(arg0) {
3181
2781
  const ret = arg0.privateKey;
3182
2782
  return ret;
3183
- };
3184
-
3185
- export function __wbg_getpublickey_ad4c2474164b2d9a(arg0) {
2783
+ }
2784
+ export function __wbg_get_public_key_bd0de162bf5c6832(arg0) {
3186
2785
  const ret = arg0.publicKey;
3187
2786
  return ret;
3188
- };
3189
-
2787
+ }
3190
2788
  export function __wbg_group_new(arg0) {
3191
2789
  const ret = Group.__wrap(arg0);
3192
2790
  return ret;
3193
- };
3194
-
3195
- export function __wbg_instanceof_Crypto_33ac2d91cca59233(arg0) {
2791
+ }
2792
+ export function __wbg_individual_new(arg0) {
2793
+ const ret = Individual.__wrap(arg0);
2794
+ return ret;
2795
+ }
2796
+ export function __wbg_instanceof_Crypto_cecf3f85e92e02f6(arg0) {
3196
2797
  let result;
3197
2798
  try {
3198
2799
  result = arg0 instanceof Crypto;
@@ -3201,322 +2802,719 @@ export function __wbg_instanceof_Crypto_33ac2d91cca59233(arg0) {
3201
2802
  }
3202
2803
  const ret = result;
3203
2804
  return ret;
3204
- };
3205
-
3206
- export function __wbg_jsdecrypterror_new(arg0) {
3207
- const ret = JsDecryptError.__wrap(arg0);
3208
- return ret;
3209
- };
3210
-
3211
- export function __wbg_jsencrypterror_new(arg0) {
3212
- const ret = JsEncryptError.__wrap(arg0);
3213
- return ret;
3214
- };
3215
-
3216
- export function __wbg_jsreceiveprekeyoperror_new(arg0) {
3217
- const ret = JsReceivePreKeyOpError.__wrap(arg0);
3218
- return ret;
3219
- };
3220
-
3221
- export function __wbg_jsreceivestaticeventerror_new(arg0) {
3222
- const ret = JsReceiveStaticEventError.__wrap(arg0);
3223
- return ret;
3224
- };
3225
-
2805
+ }
3226
2806
  export function __wbg_keyhive_new(arg0) {
3227
2807
  const ret = Keyhive.__wrap(arg0);
3228
2808
  return ret;
3229
- };
3230
-
3231
- export function __wbg_length_6bb7e81f9d7713e4(arg0) {
2809
+ }
2810
+ export function __wbg_length_589238bdcf171f0e(arg0) {
3232
2811
  const ret = arg0.length;
3233
2812
  return ret;
3234
- };
3235
-
3236
- export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
2813
+ }
2814
+ export function __wbg_length_c6054974c0a6cdb9(arg0) {
2815
+ const ret = arg0.length;
2816
+ return ret;
2817
+ }
2818
+ export function __wbg_log_17a3e9a5cbb91ef7(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
2819
+ let deferred0_0;
2820
+ let deferred0_1;
2821
+ try {
2822
+ deferred0_0 = arg0;
2823
+ deferred0_1 = arg1;
2824
+ console.log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
2825
+ } finally {
2826
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2827
+ }
2828
+ }
2829
+ export function __wbg_log_e885b89e7e480a2f(arg0, arg1) {
2830
+ let deferred0_0;
2831
+ let deferred0_1;
2832
+ try {
2833
+ deferred0_0 = arg0;
2834
+ deferred0_1 = arg1;
2835
+ console.log(getStringFromWasm0(arg0, arg1));
2836
+ } finally {
2837
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2838
+ }
2839
+ }
2840
+ export function __wbg_mark_0279c5d75168b5b8(arg0, arg1) {
2841
+ performance.mark(getStringFromWasm0(arg0, arg1));
2842
+ }
2843
+ export function __wbg_measure_c9b58ac538b3e2f7() { return handleError(function (arg0, arg1, arg2, arg3) {
2844
+ let deferred0_0;
2845
+ let deferred0_1;
2846
+ let deferred1_0;
2847
+ let deferred1_1;
2848
+ try {
2849
+ deferred0_0 = arg0;
2850
+ deferred0_1 = arg1;
2851
+ deferred1_0 = arg2;
2852
+ deferred1_1 = arg3;
2853
+ performance.measure(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
2854
+ } finally {
2855
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2856
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2857
+ }
2858
+ }, arguments); }
2859
+ export function __wbg_membership_new(arg0) {
2860
+ const ret = Membership.__wrap(arg0);
2861
+ return ret;
2862
+ }
2863
+ export function __wbg_msCrypto_bd5a034af96bcba6(arg0) {
3237
2864
  const ret = arg0.msCrypto;
3238
2865
  return ret;
3239
- };
3240
-
3241
- export function __wbg_new_2e3c58a15f39f5f9(arg0, arg1) {
2866
+ }
2867
+ export function __wbg_new_227d7c05414eb861() {
2868
+ const ret = new Error();
2869
+ return ret;
2870
+ }
2871
+ export function __wbg_new_3444eb7412549f0b() {
2872
+ const ret = new Map();
2873
+ return ret;
2874
+ }
2875
+ export function __wbg_new_36e147a8ced3c6e0() {
2876
+ const ret = new Array();
2877
+ return ret;
2878
+ }
2879
+ export function __wbg_new_4a05b166716eeed6(arg0) {
2880
+ const ret = new Set(arg0);
2881
+ return ret;
2882
+ }
2883
+ export function __wbg_new_81880fb5002cb255(arg0) {
2884
+ const ret = new Uint8Array(arg0);
2885
+ return ret;
2886
+ }
2887
+ export function __wbg_new_e66a4b7758dd2e5c(arg0, arg1) {
2888
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2889
+ return ret;
2890
+ }
2891
+ export function __wbg_new_from_slice_543b875b27789a8f(arg0, arg1) {
2892
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2893
+ return ret;
2894
+ }
2895
+ export function __wbg_new_typed_00a409eb4ec4f2d9(arg0, arg1) {
3242
2896
  try {
3243
2897
  var state0 = {a: arg0, b: arg1};
3244
2898
  var cb0 = (arg0, arg1) => {
3245
2899
  const a = state0.a;
3246
2900
  state0.a = 0;
3247
2901
  try {
3248
- return __wbg_adapter_272(a, state0.b, arg0, arg1);
2902
+ return wasm_bindgen__convert__closures_____invoke__h1ce7fe53f08aa9a8(a, state0.b, arg0, arg1);
3249
2903
  } finally {
3250
2904
  state0.a = a;
3251
2905
  }
3252
2906
  };
3253
2907
  const ret = new Promise(cb0);
3254
2908
  return ret;
3255
- } finally {
3256
- state0.a = state0.b = 0;
3257
- }
3258
- };
3259
-
3260
- export function __wbg_new_638ebfaedbf32a5e(arg0) {
3261
- const ret = new Uint8Array(arg0);
3262
- return ret;
3263
- };
3264
-
3265
- export function __wbg_new_8a6f238a6ece86ea() {
3266
- const ret = new Error();
3267
- return ret;
3268
- };
3269
-
3270
- export function __wbg_newnoargs_254190557c45b4ec(arg0, arg1) {
3271
- const ret = new Function(getStringFromWasm0(arg0, arg1));
3272
- return ret;
3273
- };
3274
-
3275
- export function __wbg_newwithlength_a167dcc7aaa3ba77(arg0) {
2909
+ } finally {
2910
+ state0.a = 0;
2911
+ }
2912
+ }
2913
+ export function __wbg_new_with_length_9b650f44b5c44a4e(arg0) {
3276
2914
  const ret = new Uint8Array(arg0 >>> 0);
3277
2915
  return ret;
3278
- };
3279
-
3280
- export function __wbg_node_905d3e251edff8a2(arg0) {
2916
+ }
2917
+ export function __wbg_node_84ea875411254db1(arg0) {
3281
2918
  const ret = arg0.node;
3282
2919
  return ret;
3283
- };
3284
-
3285
- export function __wbg_peer_unwrap(arg0) {
3286
- const ret = Peer.__unwrap(arg0);
3287
- return ret;
3288
- };
3289
-
3290
- export function __wbg_process_dc0fbacc7c1c06f7(arg0) {
2920
+ }
2921
+ export function __wbg_process_44c7a14e11e9f69e(arg0) {
3291
2922
  const ret = arg0.process;
3292
2923
  return ret;
3293
- };
3294
-
3295
- export function __wbg_prototypesetcall_3d4a26c1ed734349(arg0, arg1, arg2) {
2924
+ }
2925
+ export function __wbg_prototypesetcall_d721637c7ca66eb8(arg0, arg1, arg2) {
3296
2926
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
3297
- };
3298
-
3299
- export function __wbg_queueMicrotask_25d0739ac89e8c88(arg0) {
3300
- queueMicrotask(arg0);
3301
- };
3302
-
3303
- export function __wbg_queueMicrotask_4488407636f5bf24(arg0) {
2927
+ }
2928
+ export function __wbg_push_f724b5db8acf89d2(arg0, arg1) {
2929
+ const ret = arg0.push(arg1);
2930
+ return ret;
2931
+ }
2932
+ export function __wbg_queueMicrotask_1c9b3800e321a967(arg0) {
3304
2933
  const ret = arg0.queueMicrotask;
3305
2934
  return ret;
3306
- };
3307
-
3308
- export function __wbg_randomFillSync_ac0988aba3254290() { return handleError(function (arg0, arg1) {
2935
+ }
2936
+ export function __wbg_queueMicrotask_311744e534a929a3(arg0) {
2937
+ queueMicrotask(arg0);
2938
+ }
2939
+ export function __wbg_randomFillSync_6c25eac9869eb53c() { return handleError(function (arg0, arg1) {
3309
2940
  arg0.randomFillSync(arg1);
3310
- }, arguments) };
3311
-
3312
- export function __wbg_require_60cc747a6bc5215a() { return handleError(function () {
2941
+ }, arguments); }
2942
+ export function __wbg_require_b4edbdcf3e2a1ef0() { return handleError(function () {
3313
2943
  const ret = module.require;
3314
2944
  return ret;
3315
- }, arguments) };
3316
-
3317
- export function __wbg_resolve_4055c623acdd6a1b(arg0) {
2945
+ }, arguments); }
2946
+ export function __wbg_resolve_d82363d90af6928a(arg0) {
3318
2947
  const ret = Promise.resolve(arg0);
3319
2948
  return ret;
3320
- };
3321
-
3322
- export function __wbg_revokemembererror_new(arg0) {
3323
- const ret = RevokeMemberError.__wrap(arg0);
3324
- return ret;
3325
- };
3326
-
3327
- export function __wbg_serializationerror_new(arg0) {
3328
- const ret = SerializationError.__wrap(arg0);
2949
+ }
2950
+ export function __wbg_set_9a1d61e17de7054c(arg0, arg1, arg2) {
2951
+ const ret = arg0.set(arg1, arg2);
3329
2952
  return ret;
3330
- };
3331
-
2953
+ }
2954
+ export function __wbg_set_name_15bb90053efbc017(arg0, arg1, arg2) {
2955
+ arg0.name = getStringFromWasm0(arg1, arg2);
2956
+ }
3332
2957
  export function __wbg_sharekey_new(arg0) {
3333
2958
  const ret = ShareKey.__wrap(arg0);
3334
2959
  return ret;
3335
- };
3336
-
3337
- export function __wbg_sign_8891059f121b31b5() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2960
+ }
2961
+ export function __wbg_sign_12a498c8600b5618() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
3338
2962
  const ret = arg0.sign(arg1, arg2, getArrayU8FromWasm0(arg3, arg4));
3339
2963
  return ret;
3340
- }, arguments) };
3341
-
2964
+ }, arguments); }
3342
2965
  export function __wbg_signed_new(arg0) {
3343
2966
  const ret = Signed.__wrap(arg0);
3344
2967
  return ret;
3345
- };
3346
-
2968
+ }
3347
2969
  export function __wbg_signeddelegation_new(arg0) {
3348
2970
  const ret = SignedDelegation.__wrap(arg0);
3349
2971
  return ret;
3350
- };
3351
-
2972
+ }
3352
2973
  export function __wbg_signedrevocation_new(arg0) {
3353
2974
  const ret = SignedRevocation.__wrap(arg0);
3354
2975
  return ret;
3355
- };
3356
-
2976
+ }
3357
2977
  export function __wbg_signer_new(arg0) {
3358
2978
  const ret = Signer.__wrap(arg0);
3359
2979
  return ret;
3360
- };
3361
-
3362
- export function __wbg_signingerror_new(arg0) {
3363
- const ret = SigningError.__wrap(arg0);
3364
- return ret;
3365
- };
3366
-
3367
- export function __wbg_simplecapability_new(arg0) {
3368
- const ret = SimpleCapability.__wrap(arg0);
3369
- return ret;
3370
- };
3371
-
3372
- export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
2980
+ }
2981
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
3373
2982
  const ret = arg1.stack;
3374
2983
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3375
2984
  const len1 = WASM_VECTOR_LEN;
3376
2985
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3377
2986
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3378
- };
2987
+ }
2988
+ export function __wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938() {
2989
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
2990
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2991
+ }
2992
+ export function __wbg_static_accessor_GLOBAL_ce44e66a4935da8c() {
2993
+ const ret = typeof global === 'undefined' ? null : global;
2994
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2995
+ }
2996
+ export function __wbg_static_accessor_SELF_44f6e0cb5e67cdad() {
2997
+ const ret = typeof self === 'undefined' ? null : self;
2998
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2999
+ }
3000
+ export function __wbg_static_accessor_WINDOW_168f178805d978fe() {
3001
+ const ret = typeof window === 'undefined' ? null : window;
3002
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3003
+ }
3004
+ export function __wbg_stats_new(arg0) {
3005
+ const ret = Stats.__wrap(arg0);
3006
+ return ret;
3007
+ }
3008
+ export function __wbg_subarray_b0e8ac4ed313fea8(arg0, arg1, arg2) {
3009
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
3010
+ return ret;
3011
+ }
3012
+ export function __wbg_subtle_1287656b3b345d44(arg0) {
3013
+ const ret = arg0.subtle;
3014
+ return ret;
3015
+ }
3016
+ export function __wbg_summary_new(arg0) {
3017
+ const ret = Summary.__wrap(arg0);
3018
+ return ret;
3019
+ }
3020
+ export function __wbg_then_05edfc8a4fea5106(arg0, arg1, arg2) {
3021
+ const ret = arg0.then(arg1, arg2);
3022
+ return ret;
3023
+ }
3024
+ export function __wbg_then_591b6b3a75ee817a(arg0, arg1) {
3025
+ const ret = arg0.then(arg1);
3026
+ return ret;
3027
+ }
3028
+ export function __wbg_versions_276b2795b1c6a219(arg0) {
3029
+ const ret = arg0.versions;
3030
+ return ret;
3031
+ }
3032
+ export function __wbg_warn_2a49b47d25e1e018(arg0, arg1) {
3033
+ let deferred0_0;
3034
+ let deferred0_1;
3035
+ try {
3036
+ deferred0_0 = arg0;
3037
+ deferred0_1 = arg1;
3038
+ console.warn(getStringFromWasm0(arg0, arg1));
3039
+ } finally {
3040
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3041
+ }
3042
+ }
3043
+ export function __wbg_warn_9d7408e9659996aa(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
3044
+ let deferred0_0;
3045
+ let deferred0_1;
3046
+ try {
3047
+ deferred0_0 = arg0;
3048
+ deferred0_1 = arg1;
3049
+ console.warn(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
3050
+ } finally {
3051
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3052
+ }
3053
+ }
3054
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
3055
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 711, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3056
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd575a1431d676418);
3057
+ return ret;
3058
+ }
3059
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
3060
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
3061
+ const ret = getArrayU8FromWasm0(arg0, arg1);
3062
+ return ret;
3063
+ }
3064
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
3065
+ // Cast intrinsic for `Ref(String) -> Externref`.
3066
+ const ret = getStringFromWasm0(arg0, arg1);
3067
+ return ret;
3068
+ }
3069
+ export function __wbindgen_cast_0000000000000004(arg0, arg1) {
3070
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3071
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3072
+ // Cast intrinsic for `Vector(NamedExternref("Capability")) -> Externref`.
3073
+ const ret = v0;
3074
+ return ret;
3075
+ }
3076
+ export function __wbindgen_cast_0000000000000005(arg0, arg1) {
3077
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3078
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3079
+ // Cast intrinsic for `Vector(NamedExternref("ChangeId")) -> Externref`.
3080
+ const ret = v0;
3081
+ return ret;
3082
+ }
3083
+ export function __wbindgen_cast_0000000000000006(arg0, arg1) {
3084
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3085
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3086
+ // Cast intrinsic for `Vector(NamedExternref("Membership")) -> Externref`.
3087
+ const ret = v0;
3088
+ return ret;
3089
+ }
3090
+ export function __wbindgen_cast_0000000000000007(arg0, arg1) {
3091
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3092
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3093
+ // Cast intrinsic for `Vector(NamedExternref("SignedRevocation")) -> Externref`.
3094
+ const ret = v0;
3095
+ return ret;
3096
+ }
3097
+ export function __wbindgen_cast_0000000000000008(arg0, arg1) {
3098
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3099
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3100
+ // Cast intrinsic for `Vector(NamedExternref("Summary")) -> Externref`.
3101
+ const ret = v0;
3102
+ return ret;
3103
+ }
3104
+ export function __wbindgen_cast_0000000000000009(arg0, arg1) {
3105
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3106
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3107
+ // Cast intrinsic for `Vector(NamedExternref("Uint8Array")) -> Externref`.
3108
+ const ret = v0;
3109
+ return ret;
3110
+ }
3111
+ export function __wbindgen_cast_000000000000000a(arg0, arg1) {
3112
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3113
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3114
+ // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
3115
+ const ret = v0;
3116
+ return ret;
3117
+ }
3118
+ export function __wbindgen_cast_000000000000000b(arg0, arg1) {
3119
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
3120
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
3121
+ // Cast intrinsic for `Vector(U8) -> Externref`.
3122
+ const ret = v0;
3123
+ return ret;
3124
+ }
3125
+ export function __wbindgen_init_externref_table() {
3126
+ const table = wasm.__wbindgen_externrefs;
3127
+ const offset = table.grow(4);
3128
+ table.set(0, undefined);
3129
+ table.set(offset + 0, undefined);
3130
+ table.set(offset + 1, null);
3131
+ table.set(offset + 2, true);
3132
+ table.set(offset + 3, false);
3133
+ }
3134
+ function wasm_bindgen__convert__closures_____invoke__hd575a1431d676418(arg0, arg1, arg2) {
3135
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__hd575a1431d676418(arg0, arg1, arg2);
3136
+ if (ret[1]) {
3137
+ throw takeFromExternrefTable0(ret[0]);
3138
+ }
3139
+ }
3140
+
3141
+ function wasm_bindgen__convert__closures_____invoke__h1ce7fe53f08aa9a8(arg0, arg1, arg2, arg3) {
3142
+ wasm.wasm_bindgen__convert__closures_____invoke__h1ce7fe53f08aa9a8(arg0, arg1, arg2, arg3);
3143
+ }
3144
+
3145
+ const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
3146
+ ? { register: () => {}, unregister: () => {} }
3147
+ : new FinalizationRegistry(ptr => wasm.__wbg_access_free(ptr, 1));
3148
+ const AddMemberUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
3149
+ ? { register: () => {}, unregister: () => {} }
3150
+ : new FinalizationRegistry(ptr => wasm.__wbg_addmemberupdate_free(ptr, 1));
3151
+ const AgentFinalization = (typeof FinalizationRegistry === 'undefined')
3152
+ ? { register: () => {}, unregister: () => {} }
3153
+ : new FinalizationRegistry(ptr => wasm.__wbg_agent_free(ptr, 1));
3154
+ const AllAgentEventsFinalization = (typeof FinalizationRegistry === 'undefined')
3155
+ ? { register: () => {}, unregister: () => {} }
3156
+ : new FinalizationRegistry(ptr => wasm.__wbg_allagentevents_free(ptr, 1));
3157
+ const ArchiveFinalization = (typeof FinalizationRegistry === 'undefined')
3158
+ ? { register: () => {}, unregister: () => {} }
3159
+ : new FinalizationRegistry(ptr => wasm.__wbg_archive_free(ptr, 1));
3160
+ const CannotParseEd25519SigningKeyFinalization = (typeof FinalizationRegistry === 'undefined')
3161
+ ? { register: () => {}, unregister: () => {} }
3162
+ : new FinalizationRegistry(ptr => wasm.__wbg_cannotparseed25519signingkey_free(ptr, 1));
3163
+ const CannotParseIdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
3164
+ ? { register: () => {}, unregister: () => {} }
3165
+ : new FinalizationRegistry(ptr => wasm.__wbg_cannotparseidentifier_free(ptr, 1));
3166
+ const CapabilityFinalization = (typeof FinalizationRegistry === 'undefined')
3167
+ ? { register: () => {}, unregister: () => {} }
3168
+ : new FinalizationRegistry(ptr => wasm.__wbg_capability_free(ptr, 1));
3169
+ const CgkaOperationFinalization = (typeof FinalizationRegistry === 'undefined')
3170
+ ? { register: () => {}, unregister: () => {} }
3171
+ : new FinalizationRegistry(ptr => wasm.__wbg_cgkaoperation_free(ptr, 1));
3172
+ const ChangeIdFinalization = (typeof FinalizationRegistry === 'undefined')
3173
+ ? { register: () => {}, unregister: () => {} }
3174
+ : new FinalizationRegistry(ptr => wasm.__wbg_changeid_free(ptr, 1));
3175
+ const CiphertextStoreFinalization = (typeof FinalizationRegistry === 'undefined')
3176
+ ? { register: () => {}, unregister: () => {} }
3177
+ : new FinalizationRegistry(ptr => wasm.__wbg_ciphertextstore_free(ptr, 1));
3178
+ const ContactCardFinalization = (typeof FinalizationRegistry === 'undefined')
3179
+ ? { register: () => {}, unregister: () => {} }
3180
+ : new FinalizationRegistry(ptr => wasm.__wbg_contactcard_free(ptr, 1));
3181
+ const DelegationFinalization = (typeof FinalizationRegistry === 'undefined')
3182
+ ? { register: () => {}, unregister: () => {} }
3183
+ : new FinalizationRegistry(ptr => wasm.__wbg_delegation_free(ptr, 1));
3184
+ const DocContentRefsFinalization = (typeof FinalizationRegistry === 'undefined')
3185
+ ? { register: () => {}, unregister: () => {} }
3186
+ : new FinalizationRegistry(ptr => wasm.__wbg_doccontentrefs_free(ptr, 1));
3187
+ const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
3188
+ ? { register: () => {}, unregister: () => {} }
3189
+ : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr, 1));
3190
+ const DocumentIdFinalization = (typeof FinalizationRegistry === 'undefined')
3191
+ ? { register: () => {}, unregister: () => {} }
3192
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentid_free(ptr, 1));
3193
+ const EncryptedFinalization = (typeof FinalizationRegistry === 'undefined')
3194
+ ? { register: () => {}, unregister: () => {} }
3195
+ : new FinalizationRegistry(ptr => wasm.__wbg_encrypted_free(ptr, 1));
3196
+ const EncryptedContentWithUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
3197
+ ? { register: () => {}, unregister: () => {} }
3198
+ : new FinalizationRegistry(ptr => wasm.__wbg_encryptedcontentwithupdate_free(ptr, 1));
3199
+ const EventFinalization = (typeof FinalizationRegistry === 'undefined')
3200
+ ? { register: () => {}, unregister: () => {} }
3201
+ : new FinalizationRegistry(ptr => wasm.__wbg_event_free(ptr, 1));
3202
+ const GenerateWebCryptoErrorFinalization = (typeof FinalizationRegistry === 'undefined')
3203
+ ? { register: () => {}, unregister: () => {} }
3204
+ : new FinalizationRegistry(ptr => wasm.__wbg_generatewebcryptoerror_free(ptr, 1));
3205
+ const GroupFinalization = (typeof FinalizationRegistry === 'undefined')
3206
+ ? { register: () => {}, unregister: () => {} }
3207
+ : new FinalizationRegistry(ptr => wasm.__wbg_group_free(ptr, 1));
3208
+ const GroupIdFinalization = (typeof FinalizationRegistry === 'undefined')
3209
+ ? { register: () => {}, unregister: () => {} }
3210
+ : new FinalizationRegistry(ptr => wasm.__wbg_groupid_free(ptr, 1));
3211
+ const HistoryFinalization = (typeof FinalizationRegistry === 'undefined')
3212
+ ? { register: () => {}, unregister: () => {} }
3213
+ : new FinalizationRegistry(ptr => wasm.__wbg_history_free(ptr, 1));
3214
+ const IdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
3215
+ ? { register: () => {}, unregister: () => {} }
3216
+ : new FinalizationRegistry(ptr => wasm.__wbg_identifier_free(ptr, 1));
3217
+ const IndividualFinalization = (typeof FinalizationRegistry === 'undefined')
3218
+ ? { register: () => {}, unregister: () => {} }
3219
+ : new FinalizationRegistry(ptr => wasm.__wbg_individual_free(ptr, 1));
3220
+ const IndividualIdFinalization = (typeof FinalizationRegistry === 'undefined')
3221
+ ? { register: () => {}, unregister: () => {} }
3222
+ : new FinalizationRegistry(ptr => wasm.__wbg_individualid_free(ptr, 1));
3223
+ const InvocationFinalization = (typeof FinalizationRegistry === 'undefined')
3224
+ ? { register: () => {}, unregister: () => {} }
3225
+ : new FinalizationRegistry(ptr => wasm.__wbg_invocation_free(ptr, 1));
3226
+ const KeyhiveFinalization = (typeof FinalizationRegistry === 'undefined')
3227
+ ? { register: () => {}, unregister: () => {} }
3228
+ : new FinalizationRegistry(ptr => wasm.__wbg_keyhive_free(ptr, 1));
3229
+ const MemberedFinalization = (typeof FinalizationRegistry === 'undefined')
3230
+ ? { register: () => {}, unregister: () => {} }
3231
+ : new FinalizationRegistry(ptr => wasm.__wbg_membered_free(ptr, 1));
3232
+ const MembershipFinalization = (typeof FinalizationRegistry === 'undefined')
3233
+ ? { register: () => {}, unregister: () => {} }
3234
+ : new FinalizationRegistry(ptr => wasm.__wbg_membership_free(ptr, 1));
3235
+ const PeerFinalization = (typeof FinalizationRegistry === 'undefined')
3236
+ ? { register: () => {}, unregister: () => {} }
3237
+ : new FinalizationRegistry(ptr => wasm.__wbg_peer_free(ptr, 1));
3238
+ const RevocationFinalization = (typeof FinalizationRegistry === 'undefined')
3239
+ ? { register: () => {}, unregister: () => {} }
3240
+ : new FinalizationRegistry(ptr => wasm.__wbg_revocation_free(ptr, 1));
3241
+ const ShareKeyFinalization = (typeof FinalizationRegistry === 'undefined')
3242
+ ? { register: () => {}, unregister: () => {} }
3243
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharekey_free(ptr, 1));
3244
+ const SignedFinalization = (typeof FinalizationRegistry === 'undefined')
3245
+ ? { register: () => {}, unregister: () => {} }
3246
+ : new FinalizationRegistry(ptr => wasm.__wbg_signed_free(ptr, 1));
3247
+ const SignedCgkaOperationFinalization = (typeof FinalizationRegistry === 'undefined')
3248
+ ? { register: () => {}, unregister: () => {} }
3249
+ : new FinalizationRegistry(ptr => wasm.__wbg_signedcgkaoperation_free(ptr, 1));
3250
+ const SignedDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
3251
+ ? { register: () => {}, unregister: () => {} }
3252
+ : new FinalizationRegistry(ptr => wasm.__wbg_signeddelegation_free(ptr, 1));
3253
+ const SignedInvocationFinalization = (typeof FinalizationRegistry === 'undefined')
3254
+ ? { register: () => {}, unregister: () => {} }
3255
+ : new FinalizationRegistry(ptr => wasm.__wbg_signedinvocation_free(ptr, 1));
3256
+ const SignedRevocationFinalization = (typeof FinalizationRegistry === 'undefined')
3257
+ ? { register: () => {}, unregister: () => {} }
3258
+ : new FinalizationRegistry(ptr => wasm.__wbg_signedrevocation_free(ptr, 1));
3259
+ const SignerFinalization = (typeof FinalizationRegistry === 'undefined')
3260
+ ? { register: () => {}, unregister: () => {} }
3261
+ : new FinalizationRegistry(ptr => wasm.__wbg_signer_free(ptr, 1));
3262
+ const StatsFinalization = (typeof FinalizationRegistry === 'undefined')
3263
+ ? { register: () => {}, unregister: () => {} }
3264
+ : new FinalizationRegistry(ptr => wasm.__wbg_stats_free(ptr, 1));
3265
+ const SummaryFinalization = (typeof FinalizationRegistry === 'undefined')
3266
+ ? { register: () => {}, unregister: () => {} }
3267
+ : new FinalizationRegistry(ptr => wasm.__wbg_summary_free(ptr, 1));
3268
+
3269
+ function addToExternrefTable0(obj) {
3270
+ const idx = wasm.__externref_table_alloc();
3271
+ wasm.__wbindgen_externrefs.set(idx, obj);
3272
+ return idx;
3273
+ }
3274
+
3275
+ function _assertClass(instance, klass) {
3276
+ if (!(instance instanceof klass)) {
3277
+ throw new Error(`expected instance of ${klass.name}`);
3278
+ }
3279
+ }
3280
+
3281
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
3282
+ ? { register: () => {}, unregister: () => {} }
3283
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
3284
+
3285
+ function debugString(val) {
3286
+ // primitive types
3287
+ const type = typeof val;
3288
+ if (type == 'number' || type == 'boolean' || val == null) {
3289
+ return `${val}`;
3290
+ }
3291
+ if (type == 'string') {
3292
+ return `"${val}"`;
3293
+ }
3294
+ if (type == 'symbol') {
3295
+ const description = val.description;
3296
+ if (description == null) {
3297
+ return 'Symbol';
3298
+ } else {
3299
+ return `Symbol(${description})`;
3300
+ }
3301
+ }
3302
+ if (type == 'function') {
3303
+ const name = val.name;
3304
+ if (typeof name == 'string' && name.length > 0) {
3305
+ return `Function(${name})`;
3306
+ } else {
3307
+ return 'Function';
3308
+ }
3309
+ }
3310
+ // objects
3311
+ if (Array.isArray(val)) {
3312
+ const length = val.length;
3313
+ let debug = '[';
3314
+ if (length > 0) {
3315
+ debug += debugString(val[0]);
3316
+ }
3317
+ for(let i = 1; i < length; i++) {
3318
+ debug += ', ' + debugString(val[i]);
3319
+ }
3320
+ debug += ']';
3321
+ return debug;
3322
+ }
3323
+ // Test for built-in
3324
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
3325
+ let className;
3326
+ if (builtInMatches && builtInMatches.length > 1) {
3327
+ className = builtInMatches[1];
3328
+ } else {
3329
+ // Failed to match the standard '[object ClassName]'
3330
+ return toString.call(val);
3331
+ }
3332
+ if (className == 'Object') {
3333
+ // we're a user defined class or Object
3334
+ // JSON.stringify avoids problems with cycles, and is generally much
3335
+ // easier than looping through ownProperties of `val`.
3336
+ try {
3337
+ return 'Object(' + JSON.stringify(val) + ')';
3338
+ } catch (_) {
3339
+ return 'Object';
3340
+ }
3341
+ }
3342
+ // errors
3343
+ if (val instanceof Error) {
3344
+ return `${val.name}: ${val.message}\n${val.stack}`;
3345
+ }
3346
+ // TODO we could test for more things here, like `Set`s and `Map`s.
3347
+ return className;
3348
+ }
3379
3349
 
3380
- export function __wbg_static_accessor_GLOBAL_8921f820c2ce3f12() {
3381
- const ret = typeof global === 'undefined' ? null : global;
3382
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3383
- };
3350
+ function getArrayJsValueFromWasm0(ptr, len) {
3351
+ ptr = ptr >>> 0;
3352
+ const mem = getDataViewMemory0();
3353
+ const result = [];
3354
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
3355
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
3356
+ }
3357
+ wasm.__externref_drop_slice(ptr, len);
3358
+ return result;
3359
+ }
3384
3360
 
3385
- export function __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184() {
3386
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
3387
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3388
- };
3361
+ function getArrayU8FromWasm0(ptr, len) {
3362
+ ptr = ptr >>> 0;
3363
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
3364
+ }
3389
3365
 
3390
- export function __wbg_static_accessor_SELF_995b214ae681ff99() {
3391
- const ret = typeof self === 'undefined' ? null : self;
3392
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3393
- };
3366
+ let cachedDataViewMemory0 = null;
3367
+ function getDataViewMemory0() {
3368
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
3369
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
3370
+ }
3371
+ return cachedDataViewMemory0;
3372
+ }
3394
3373
 
3395
- export function __wbg_static_accessor_WINDOW_cde3890479c675ea() {
3396
- const ret = typeof window === 'undefined' ? null : window;
3397
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3398
- };
3374
+ function getStringFromWasm0(ptr, len) {
3375
+ return decodeText(ptr >>> 0, len);
3376
+ }
3399
3377
 
3400
- export function __wbg_subarray_70fd07feefe14294(arg0, arg1, arg2) {
3401
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
3402
- return ret;
3403
- };
3378
+ let cachedUint8ArrayMemory0 = null;
3379
+ function getUint8ArrayMemory0() {
3380
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
3381
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
3382
+ }
3383
+ return cachedUint8ArrayMemory0;
3384
+ }
3404
3385
 
3405
- export function __wbg_subtle_dd66747d3e9a93d4(arg0) {
3406
- const ret = arg0.subtle;
3407
- return ret;
3408
- };
3386
+ function handleError(f, args) {
3387
+ try {
3388
+ return f.apply(this, args);
3389
+ } catch (e) {
3390
+ const idx = addToExternrefTable0(e);
3391
+ wasm.__wbindgen_exn_store(idx);
3392
+ }
3393
+ }
3409
3394
 
3410
- export function __wbg_summary_new(arg0) {
3411
- const ret = Summary.__wrap(arg0);
3412
- return ret;
3413
- };
3395
+ function isLikeNone(x) {
3396
+ return x === undefined || x === null;
3397
+ }
3414
3398
 
3415
- export function __wbg_then_b33a773d723afa3e(arg0, arg1, arg2) {
3416
- const ret = arg0.then(arg1, arg2);
3417
- return ret;
3418
- };
3399
+ function makeMutClosure(arg0, arg1, f) {
3400
+ const state = { a: arg0, b: arg1, cnt: 1 };
3401
+ const real = (...args) => {
3419
3402
 
3420
- export function __wbg_then_e22500defe16819f(arg0, arg1) {
3421
- const ret = arg0.then(arg1);
3422
- return ret;
3423
- };
3403
+ // First up with a closure we increment the internal reference
3404
+ // count. This ensures that the Rust closure environment won't
3405
+ // be deallocated while we're invoking it.
3406
+ state.cnt++;
3407
+ const a = state.a;
3408
+ state.a = 0;
3409
+ try {
3410
+ return f(a, state.b, ...args);
3411
+ } finally {
3412
+ state.a = a;
3413
+ real._wbg_cb_unref();
3414
+ }
3415
+ };
3416
+ real._wbg_cb_unref = () => {
3417
+ if (--state.cnt === 0) {
3418
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
3419
+ state.a = 0;
3420
+ CLOSURE_DTORS.unregister(state);
3421
+ }
3422
+ };
3423
+ CLOSURE_DTORS.register(real, state, state);
3424
+ return real;
3425
+ }
3424
3426
 
3425
- export function __wbg_tryfromarchiveerror_new(arg0) {
3426
- const ret = TryFromArchiveError.__wrap(arg0);
3427
- return ret;
3428
- };
3427
+ function passArray8ToWasm0(arg, malloc) {
3428
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
3429
+ getUint8ArrayMemory0().set(arg, ptr / 1);
3430
+ WASM_VECTOR_LEN = arg.length;
3431
+ return ptr;
3432
+ }
3429
3433
 
3430
- export function __wbg_versions_c01dfd4722a88165(arg0) {
3431
- const ret = arg0.versions;
3432
- return ret;
3433
- };
3434
+ function passArrayJsValueToWasm0(array, malloc) {
3435
+ const ptr = malloc(array.length * 4, 4) >>> 0;
3436
+ for (let i = 0; i < array.length; i++) {
3437
+ const add = addToExternrefTable0(array[i]);
3438
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
3439
+ }
3440
+ WASM_VECTOR_LEN = array.length;
3441
+ return ptr;
3442
+ }
3434
3443
 
3435
- export function __wbg_wbindgencbdrop_eb10308566512b88(arg0) {
3436
- const obj = arg0.original;
3437
- if (obj.cnt-- == 1) {
3438
- obj.a = 0;
3439
- return true;
3444
+ function passStringToWasm0(arg, malloc, realloc) {
3445
+ if (realloc === undefined) {
3446
+ const buf = cachedTextEncoder.encode(arg);
3447
+ const ptr = malloc(buf.length, 1) >>> 0;
3448
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
3449
+ WASM_VECTOR_LEN = buf.length;
3450
+ return ptr;
3440
3451
  }
3441
- const ret = false;
3442
- return ret;
3443
- };
3444
3452
 
3445
- export function __wbg_wbindgendebugstring_99ef257a3ddda34d(arg0, arg1) {
3446
- const ret = debugString(arg1);
3447
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3448
- const len1 = WASM_VECTOR_LEN;
3449
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3450
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3451
- };
3453
+ let len = arg.length;
3454
+ let ptr = malloc(len, 1) >>> 0;
3452
3455
 
3453
- export function __wbg_wbindgenisfunction_8cee7dce3725ae74(arg0) {
3454
- const ret = typeof(arg0) === 'function';
3455
- return ret;
3456
- };
3456
+ const mem = getUint8ArrayMemory0();
3457
3457
 
3458
- export function __wbg_wbindgenisobject_307a53c6bd97fbf8(arg0) {
3459
- const val = arg0;
3460
- const ret = typeof(val) === 'object' && val !== null;
3461
- return ret;
3462
- };
3458
+ let offset = 0;
3463
3459
 
3464
- export function __wbg_wbindgenisstring_d4fa939789f003b0(arg0) {
3465
- const ret = typeof(arg0) === 'string';
3466
- return ret;
3467
- };
3460
+ for (; offset < len; offset++) {
3461
+ const code = arg.charCodeAt(offset);
3462
+ if (code > 0x7F) break;
3463
+ mem[ptr + offset] = code;
3464
+ }
3465
+ if (offset !== len) {
3466
+ if (offset !== 0) {
3467
+ arg = arg.slice(offset);
3468
+ }
3469
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
3470
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
3471
+ const ret = cachedTextEncoder.encodeInto(arg, view);
3468
3472
 
3469
- export function __wbg_wbindgenisundefined_c4b71d073b92f3c5(arg0) {
3470
- const ret = arg0 === undefined;
3471
- return ret;
3472
- };
3473
+ offset += ret.written;
3474
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
3475
+ }
3473
3476
 
3474
- export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
3475
- throw new Error(getStringFromWasm0(arg0, arg1));
3476
- };
3477
+ WASM_VECTOR_LEN = offset;
3478
+ return ptr;
3479
+ }
3477
3480
 
3478
- export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
3479
- // Cast intrinsic for `Ref(String) -> Externref`.
3480
- const ret = getStringFromWasm0(arg0, arg1);
3481
- return ret;
3482
- };
3481
+ function takeFromExternrefTable0(idx) {
3482
+ const value = wasm.__wbindgen_externrefs.get(idx);
3483
+ wasm.__externref_table_dealloc(idx);
3484
+ return value;
3485
+ }
3483
3486
 
3484
- export function __wbindgen_cast_25a0a844437d0e92(arg0, arg1) {
3485
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3486
- wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3487
- // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
3488
- const ret = v0;
3489
- return ret;
3490
- };
3487
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
3488
+ cachedTextDecoder.decode();
3489
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
3490
+ let numBytesDecoded = 0;
3491
+ function decodeText(ptr, len) {
3492
+ numBytesDecoded += len;
3493
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
3494
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
3495
+ cachedTextDecoder.decode();
3496
+ numBytesDecoded = len;
3497
+ }
3498
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
3499
+ }
3491
3500
 
3492
- export function __wbindgen_cast_a788a31e51647739(arg0, arg1) {
3493
- // Cast intrinsic for `Closure(Closure { dtor_idx: 428, function: Function { arguments: [Externref], shim_idx: 429, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3494
- const ret = makeMutClosure(arg0, arg1, 428, __wbg_adapter_10);
3495
- return ret;
3496
- };
3501
+ const cachedTextEncoder = new TextEncoder();
3497
3502
 
3498
- export function __wbindgen_cast_ae91babfc5c19b28(arg0, arg1) {
3499
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3500
- wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3501
- // Cast intrinsic for `Vector(NamedExternref("SignedRevocation")) -> Externref`.
3502
- const ret = v0;
3503
- return ret;
3504
- };
3503
+ if (!('encodeInto' in cachedTextEncoder)) {
3504
+ cachedTextEncoder.encodeInto = function (arg, view) {
3505
+ const buf = cachedTextEncoder.encode(arg);
3506
+ view.set(buf);
3507
+ return {
3508
+ read: arg.length,
3509
+ written: buf.length
3510
+ };
3511
+ };
3512
+ }
3505
3513
 
3506
- export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
3507
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
3508
- const ret = getArrayU8FromWasm0(arg0, arg1);
3509
- return ret;
3510
- };
3514
+ let WASM_VECTOR_LEN = 0;
3511
3515
 
3512
- export function __wbindgen_init_externref_table() {
3513
- const table = wasm.__wbindgen_export_2;
3514
- const offset = table.grow(4);
3515
- table.set(0, undefined);
3516
- table.set(offset + 0, undefined);
3517
- table.set(offset + 1, null);
3518
- table.set(offset + 2, true);
3519
- table.set(offset + 3, false);
3520
- ;
3521
- };
3522
3516
 
3517
+ let wasm;
3518
+ export function __wbg_set_wasm(val) {
3519
+ wasm = val;
3520
+ }