@ghostlytools/sdk 1.7.3 → 1.7.4

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.
@@ -998,6 +998,64 @@ var firstWriter = (who) => !who.write || who.background ? null : who.group ? "gr
998
998
  /** A key's turn neither asked nor read in the last minute: it is dropped, and asking again starts a new one (`TURNS_PRUNE_MS`). */
999
999
  var staleTurn = (turn, now) => now - Math.max(turn.askedAt, turn.servedAt) >= 6e4;
1000
1000
  /**
1001
+ * Keys and when each was last set, those of the last minute: how many and the latest, without walking them all (the
1002
+ * chats that need a relay, `chatNeeds`). Each is set at the time it is set, so the sets come oldest first; a clock
1003
+ * gone back makes the later ones as of now.
1004
+ */
1005
+ var RecentKeys = class {
1006
+ at = /* @__PURE__ */ new Map();
1007
+ /** Every set, oldest first, from `head`; one a later set or a delete replaced is skipped. */
1008
+ order = [];
1009
+ head = 0;
1010
+ set(key, now) {
1011
+ this.prune(now);
1012
+ this.at.set(key, now);
1013
+ this.order.push([key, now]);
1014
+ }
1015
+ delete(key) {
1016
+ this.at.delete(key);
1017
+ }
1018
+ size(now) {
1019
+ this.prune(now);
1020
+ return this.at.size;
1021
+ }
1022
+ /** When the key set last was, -Infinity with none in the last minute. */
1023
+ latest(now) {
1024
+ this.prune(now);
1025
+ while (this.order.length > this.head) {
1026
+ const [key, at] = this.order[this.order.length - 1];
1027
+ if (this.at.get(key) === at) return at;
1028
+ this.order.pop();
1029
+ }
1030
+ return -Infinity;
1031
+ }
1032
+ /** The keys set in the last minute, oldest first. */
1033
+ *entries(now) {
1034
+ this.prune(now);
1035
+ for (let i = this.head; i < this.order.length; i++) if (this.at.get(this.order[i][0]) === this.order[i][1]) yield this.order[i];
1036
+ }
1037
+ /** Drops the keys set a minute ago or more. */
1038
+ prune(now) {
1039
+ if (this.order.length > this.head && now < this.order[this.order.length - 1][1]) {
1040
+ for (const [key, at] of this.at) this.at.set(key, Math.min(at, now));
1041
+ this.order = [...this.at].sort((a, b) => a[1] - b[1]);
1042
+ this.head = 0;
1043
+ }
1044
+ while (this.head < this.order.length) {
1045
+ const [key, at] = this.order[this.head];
1046
+ if (this.at.get(key) === at) {
1047
+ if (now - at < 6e4) break;
1048
+ this.at.delete(key);
1049
+ }
1050
+ this.head++;
1051
+ }
1052
+ if (this.head > 64 && this.head * 2 > this.order.length) {
1053
+ this.order = this.order.slice(this.head);
1054
+ this.head = 0;
1055
+ }
1056
+ }
1057
+ };
1058
+ /**
1001
1059
  * Public Pkarr relays. They are generic Pkarr infrastructure (an HTTP bridge to
1002
1060
  * the Mainline DHT), not a Ghostly backend: they only ever see signed,
1003
1061
  * encrypted packets. Every client uses this list: the browser clients read and
@@ -1381,9 +1439,11 @@ var RelayTransport = class {
1381
1439
  /**
1382
1440
  * Per key a 1:1 chat asks for: when it last read urgently (for the next minute, groups leave it `CHAT_RESERVE` on
1383
1441
  * every relay) and when the budget last refused it on each relay (the same, on that relay). A read of the key at a
1384
- * slow pace (the chat is live, or back in the background) drops it: `CHAT_RESERVE`.
1442
+ * slow pace (the chat is live, or back in the background) drops it: `CHAT_RESERVE`. Per relay, the later of the two
1443
+ * for each key (`chatNeed`); `chatUrgentAt` keeps the urgent ones for a relay not asked yet.
1385
1444
  */
1386
1445
  chatNeeds = /* @__PURE__ */ new Map();
1446
+ chatUrgentAt = new RecentKeys();
1387
1447
  /** When a link (a chat's or a group's) last asked urgently: background requests yield for `SIGNALING_WINDOW_MS`. */
1388
1448
  urgentAt = -Infinity;
1389
1449
  /** Timestamp of the last packet sent to each relay, per key: the compare-and-swap value for the next one. */
@@ -1790,7 +1850,7 @@ var RelayTransport = class {
1790
1850
  */
1791
1851
  async resolve(pubKeyZ32, options = {}, keptOnFailure = true) {
1792
1852
  if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
1793
- if (options.background && !options.urgent && !options.group) this.chatNeeds.delete(pubKeyZ32);
1853
+ if (options.background && !options.urgent && !options.group) this.chatNeedLapsed(pubKeyZ32);
1794
1854
  const readAt = this.readAt.get(pubKeyZ32);
1795
1855
  if (readAt !== void 0 && Date.now() - readAt < this.freshReadMs) return this.newest.get(pubKeyZ32) ?? null;
1796
1856
  const order = this.readOrder(pubKeyZ32);
@@ -2146,13 +2206,13 @@ var RelayTransport = class {
2146
2206
  const writer = firstWriter(who);
2147
2207
  if (who.urgent && !who.background) {
2148
2208
  this.urgentAt = now;
2149
- if (isChat(who)) this.chatNeed(key).urgentAt = now;
2209
+ if (isChat(who)) this.chatNeed(key, now);
2150
2210
  }
2151
2211
  if (isGroupRead(who) || isChatWatch(who)) this.readAsked(key, who, now);
2152
2212
  if (isTurnRead(who)) this.turnAsked(key, who, now);
2153
2213
  if (this.heldFor(relay, who, now, key) > 0) {
2154
2214
  if (isGroupRead(who) && (this.spent.get(relay)?.length ?? 0) >= this.limitOf(relay)) this.groupsFullAt.set(relay, now);
2155
- if (isChat(who)) this.chatNeed(key).refused.set(relay, now);
2215
+ if (isChat(who)) this.chatNeed(key, now, relay);
2156
2216
  if (writer) this.writeWaiting.set(`${writer} ${relay}`, now);
2157
2217
  return false;
2158
2218
  }
@@ -2357,25 +2417,36 @@ var RelayTransport = class {
2357
2417
  for (const [other, reads] of this.departedOver) if (now - reads[reads.length - 1] >= 6e4) this.departedOver.delete(other);
2358
2418
  this.departedOver.set(key, [...this.departedOver.get(key) ?? [], now]);
2359
2419
  }
2360
- chatNeed(key) {
2361
- let need = this.chatNeeds.get(key);
2362
- if (!need) this.chatNeeds.set(key, need = {
2363
- urgentAt: -Infinity,
2364
- refused: /* @__PURE__ */ new Map()
2365
- });
2366
- return need;
2420
+ /** A chat's request of `key` asked urgently (it needs every relay), or the budget refused it on `relay` (it needs that one). */
2421
+ chatNeed(key, now, relay) {
2422
+ if (relay !== void 0) {
2423
+ this.chatNeedsOn(relay, now).set(key, now);
2424
+ return;
2425
+ }
2426
+ this.chatUrgentAt.set(key, now);
2427
+ for (const needs of this.chatNeeds.values()) needs.set(key, now);
2367
2428
  }
2368
- /** How long groups still leave a chat its reserve on this relay (`CHAT_RESERVE`); a chat's need a minute old goes. */
2369
- chatReservedFor(relay, now) {
2370
- let until = -Infinity;
2371
- for (const [key, need] of this.chatNeeds) {
2372
- if (now - Math.max(need.urgentAt, ...need.refused.values()) >= 6e4) {
2373
- this.chatNeeds.delete(key);
2374
- continue;
2375
- }
2376
- until = Math.max(until, need.urgentAt, need.refused.get(relay) ?? -Infinity);
2429
+ /** The chats that need this relay: those a request of was refused there, and the urgent ones. */
2430
+ chatNeedsOn(relay, now) {
2431
+ let needs = this.chatNeeds.get(relay);
2432
+ if (!needs) {
2433
+ this.chatNeeds.set(relay, needs = new RecentKeys());
2434
+ for (const [key, at] of this.chatUrgentAt.entries(now)) needs.set(key, at);
2377
2435
  }
2378
- return until + 6e4 - now;
2436
+ return needs;
2437
+ }
2438
+ /** The chat reading `key` has nothing due: it needs no relay any more. */
2439
+ chatNeedLapsed(key) {
2440
+ this.chatUrgentAt.delete(key);
2441
+ for (const needs of this.chatNeeds.values()) needs.delete(key);
2442
+ }
2443
+ /**
2444
+ * How long groups still leave a chat its reserve on this relay (`CHAT_RESERVE`); a chat's need a minute old goes.
2445
+ * Kept up to date as needs come and go (`RecentKeys`): walking them all for each request cost a daemon with 500
2446
+ * contacts away 2.7 s of CPU per 10 idle minutes (bug hunt, 2026-11-01).
2447
+ */
2448
+ chatReservedFor(relay, now) {
2449
+ return this.chatNeedsOn(relay, now).latest(now) + 6e4 - now;
2379
2450
  }
2380
2451
  /**
2381
2452
  * How long a chat's packet another relay already took waits for this one: while chats need the relays, a copy takes
@@ -2396,8 +2467,7 @@ var RelayTransport = class {
2396
2467
  }
2397
2468
  /** What the chats that need the relays keep on this relay (`CHAT_RESERVE_PER_CHAT`), never less than `reserveOf`. */
2398
2469
  chatReserveOf(relay, now) {
2399
- let needing = 0;
2400
- for (const need of this.chatNeeds.values()) if (now - Math.max(need.urgentAt, need.refused.get(relay) ?? -Infinity) < 6e4) needing++;
2470
+ const needing = this.chatNeedsOn(relay, now).size(now);
2401
2471
  return Math.max(this.reserveOf(relay), Math.min(needing * 3, Math.floor(this.limitOf(relay) * CHAT_RESERVE_MOST_SHARE)));
2402
2472
  }
2403
2473
  /** What groups leave a chat on this relay: `CHAT_RESERVE`, or a third of a smaller budget. */
@@ -4138,14 +4208,38 @@ function webpSize(b) {
4138
4208
  if (ascii(b, 12, "VP8X")) return sized(u24le(b, 24) + 1, u24le(b, 27) + 1);
4139
4209
  }
4140
4210
  /**
4211
+ * A GIF's size as it is decoded: its logical screen, or as far as its first frame reaches past it (a browser decodes
4212
+ * the first frame whole, at its own size, however small the screen says it is). Undefined when its first frame is not
4213
+ * in these bytes: what it would be drawn at is not known.
4214
+ */
4215
+ function gifSize(b) {
4216
+ if (b.length < 13) return void 0;
4217
+ const screenWidth = u16le(b, 6), screenHeight = u16le(b, 8);
4218
+ let at = 13 + (b[10] & 128 ? 3 * (2 << (b[10] & 7)) : 0);
4219
+ while (at < b.length) {
4220
+ const block = b[at];
4221
+ if (block === 44) {
4222
+ if (at + 9 > b.length) return void 0;
4223
+ const left = u16le(b, at + 1), top = u16le(b, at + 3), width = u16le(b, at + 5), height = u16le(b, at + 7);
4224
+ return sized(Math.max(screenWidth, left + width), Math.max(screenHeight, top + height));
4225
+ }
4226
+ if (block === 59) return sized(screenWidth, screenHeight);
4227
+ if (block !== 33 || at + 2 > b.length) return void 0;
4228
+ at += 2;
4229
+ while (at < b.length && b[at] !== 0) at += 1 + b[at];
4230
+ at++;
4231
+ }
4232
+ }
4233
+ /**
4141
4234
  * A picture's size as it is shown, read from its first bytes (PNG, JPEG, GIF, WebP), or undefined when they do not
4142
- * say. Only the header is read: a JPEG whose frame header sits past `IMAGE_LIMITS.headBytes` goes without.
4235
+ * say. Only the header is read: a JPEG whose frame header, or a GIF whose first frame, sits past
4236
+ * `IMAGE_LIMITS.headBytes` goes without.
4143
4237
  */
4144
4238
  function imageSize(head) {
4145
4239
  const b = head;
4146
4240
  try {
4147
4241
  if (b.length >= 24 && b[0] === 137 && ascii(b, 1, "PNG\r\n\n") && ascii(b, 12, "IHDR")) return sized(u32be(b, 16), u32be(b, 20));
4148
- if (b.length >= 10 && (ascii(b, 0, "GIF87a") || ascii(b, 0, "GIF89a"))) return sized(u16le(b, 6), u16le(b, 8));
4242
+ if (b.length >= 10 && (ascii(b, 0, "GIF87a") || ascii(b, 0, "GIF89a"))) return gifSize(b);
4149
4243
  if (b.length >= 4 && b[0] === 255 && b[1] === 216 && b[2] === 255) return jpegSize(b);
4150
4244
  if (b.length >= 16 && ascii(b, 0, "RIFF") && ascii(b, 8, "WEBP")) return webpSize(b);
4151
4245
  } catch {}
@@ -4618,7 +4712,7 @@ function isAppUrl(value) {
4618
4712
  return false;
4619
4713
  }
4620
4714
  if (url.protocol !== "https:" || url.username || url.password || !url.hostname) return false;
4621
- const host = url.hostname.toLowerCase();
4715
+ const host = url.hostname.toLowerCase().replace(/\.+$/, "");
4622
4716
  if (host === "jsdelivr.net" || host.endsWith(".jsdelivr.net")) return host === "cdn.jsdelivr.net" && /^\/gh\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@[0-9a-f]{40}\/./.test(url.pathname);
4623
4717
  return true;
4624
4718
  }
@@ -10993,11 +11087,25 @@ var LINK_CLOSERS = {
10993
11087
  "}": "{"
10994
11088
  };
10995
11089
  /**
10996
- * A link ends where the sentence around it takes over: trailing punctuation ("see https://x.example/a.") and a
10997
- * closing bracket or quote the link did not open ("(https://x.example/a)") are left as text. The same rule as the
10998
- * message bubble's links.
11090
+ * Punctuation a sentence in Chinese, Japanese or Arabic puts right after a link, with no space: the ideographic comma
11091
+ * and full stop, the full-width ! , : ; ? and brackets, the corner quotes, the Arabic comma, semicolon and question
11092
+ * mark, the Urdu full stop. No address holds one as typed, so a link stops at the first.
11093
+ */
11094
+ var LINK_STOP = /[、。〈-】!(),:;?،؛؟۔]/;
11095
+ /** What a link leaves out at its end: a sentence's punctuation ("…", "»", "”" too), never a path's "/". */
11096
+ var LINK_TRAILING = /[.,;:!?'"*_>…»’”]/;
11097
+ /** A link up to the first `LINK_STOP`: "https://x.example/a。" opens /a, not /a%E3%80%82. */
11098
+ function linkStop(url) {
11099
+ const at = url.search(LINK_STOP);
11100
+ return at < 0 ? url : url.slice(0, at);
11101
+ }
11102
+ /**
11103
+ * A link ends where the sentence around it takes over: trailing punctuation ("see https://x.example/a.", in any of
11104
+ * the app's languages) and a closing bracket or quote the link did not open ("(https://x.example/a)") are left as
11105
+ * text. The same rule as the message bubble's links.
10999
11106
  */
11000
- function linkEnd(url) {
11107
+ function linkEnd(whole) {
11108
+ const url = linkStop(whole);
11001
11109
  const count = {
11002
11110
  "(": 0,
11003
11111
  ")": 0,
@@ -11011,7 +11119,7 @@ function linkEnd(url) {
11011
11119
  while (end > 0) {
11012
11120
  const last = url[end - 1];
11013
11121
  const opener = LINK_CLOSERS[last];
11014
- if (!/[.,;:!?'"*_>]/.test(last) && !(opener && count[last] > count[opener])) break;
11122
+ if (!LINK_TRAILING.test(last) && !(opener && count[last] > count[opener])) break;
11015
11123
  if (opener) count[last]--;
11016
11124
  end--;
11017
11125
  }
@@ -11021,7 +11129,7 @@ function linkEnd(url) {
11021
11129
  var LINK_MAX_CHARS = 4096;
11022
11130
  /** The http(s) links of a text, in order, each ending as the bubble ends it. */
11023
11131
  function linksIn(text) {
11024
- return [...text.matchAll(/https?:\/\/\S+/g)].filter((match) => match[0].length <= LINK_MAX_CHARS).map((match) => linkEnd(match[0])).filter((url) => url.length > 8);
11132
+ return [...text.matchAll(/https?:\/\/\S+/gi)].filter((match) => match[0].length <= LINK_MAX_CHARS).map((match) => linkEnd(match[0])).filter((url) => url.length > 8);
11025
11133
  }
11026
11134
  /**
11027
11135
  * The link as a preview names it: parsed, http(s) only, without tracking parameters (`utm_*`, `fbclid`, …). The
@@ -11522,6 +11630,17 @@ var BLANK = /[\u034F\u115F\u1160\u2800\u3164\uFFA0]/gu;
11522
11630
  */
11523
11631
  var SPACE_RUN = /(?:\s\p{M}*)+/gu;
11524
11632
  /**
11633
+ * A run of characters meant to draw nothing (variation selectors, the Khmer inherent vowels, the Mongolian free
11634
+ * variation selectors). WebKit draws some of them as wide blanks after a letter, so "Invoice.pdf" + 150 of one +
11635
+ * ".exe" reads as a PDF there. A letter keeps one variation selector (its variant form); the rest go.
11636
+ */
11637
+ var IGNORABLE_RUN = /\p{Default_Ignorable_Code_Point}+/gu;
11638
+ var VARIATION_SELECTOR = /^\p{Variation_Selector}/u;
11639
+ function dropIgnorable(run, offset, text) {
11640
+ const kept = VARIATION_SELECTOR.exec(run)?.[0];
11641
+ return kept && offset > 0 && !/\s/u.test(text[offset - 1]) ? kept : "";
11642
+ }
11643
+ /**
11525
11644
  * Names Windows keeps for devices, whatever the case, with any extension, and with spaces before the dot:
11526
11645
  * "CON", "nul.txt", "COM1 .log" open a device there, not a file.
11527
11646
  */
@@ -11538,7 +11657,7 @@ function shorten(name) {
11538
11657
  }
11539
11658
  /** A file name is display text and a download suggestion, never a path. */
11540
11659
  function sanitizeFileName(name) {
11541
- const clean = shorten(name.replace(INVISIBLE, "").replace(BLANK, "").replace(/[/\\:]/g, "").replace(SPACE_RUN, " ").replace(/^[\s.]+/, "").trim());
11660
+ const clean = shorten(name.replace(INVISIBLE, "").replace(BLANK, "").replace(/[/\\:]/g, "").replace(IGNORABLE_RUN, dropIgnorable).replace(SPACE_RUN, " ").replace(/^[\s.]+/, "").trim());
11542
11661
  if (WINDOWS_DEVICE.test(clean)) return shorten("_" + clean);
11543
11662
  return clean || "file";
11544
11663
  }
@@ -13757,6 +13876,14 @@ var TransportSwitch = class {
13757
13876
  var RING_LIFETIME = 600;
13758
13877
  var enc = base64urlnopad.encode;
13759
13878
  var dec = base64urlnopad.decode;
13879
+ /** No bytes for text that is not base64url: the checks then refuse it with their own message. */
13880
+ var decOrEmpty = (s) => {
13881
+ try {
13882
+ return dec(s);
13883
+ } catch {
13884
+ return /* @__PURE__ */ new Uint8Array(0);
13885
+ }
13886
+ };
13760
13887
  var hash = (s) => enc(sha256(utf8Encode(s)));
13761
13888
  var header = enc(utf8Encode(JSON.stringify({
13762
13889
  alg: "EdDSA",
@@ -13781,8 +13908,14 @@ function verifyRingAuthorization(authorization, statement, issuer, issuedAt, exp
13781
13908
  if (typeof authorization !== "string" || authorization.length > 2400) throw new Error("Invalid Ring authorization");
13782
13909
  const [h, p, s, ...extra] = authorization.split(".");
13783
13910
  if (extra.length || h !== header || !p || !s) throw new Error("Unsupported Ring authorization");
13784
- const claims = JSON.parse(utf8Decode(dec(p)));
13785
- if (typeof claims?.cnf !== "string" || !validRingKey(claims.cnf) || expiresAt !== issuedAt + 600 || p !== enc(utf8Encode(JSON.stringify(ringClaims(statement, issuer, claims.cnf, issuedAt, expiresAt)))) || !validRingKey(issuer) || dec(s).length !== 64 || enc(dec(s)) !== s || !ed25519.verify(dec(s), utf8Encode(h + "." + p), fromZ32(issuer), { zip215: false })) throw new Error("Ring did not authorize this exact conversation");
13911
+ let claims;
13912
+ try {
13913
+ claims = JSON.parse(utf8Decode(dec(p)));
13914
+ } catch {
13915
+ throw new Error("Unsupported Ring authorization");
13916
+ }
13917
+ const sig = decOrEmpty(s);
13918
+ if (typeof claims?.cnf !== "string" || !validRingKey(claims.cnf) || expiresAt !== issuedAt + 600 || p !== enc(utf8Encode(JSON.stringify(ringClaims(statement, issuer, claims.cnf, issuedAt, expiresAt)))) || !validRingKey(issuer) || sig.length !== 64 || enc(sig) !== s || !ed25519.verify(sig, utf8Encode(h + "." + p), fromZ32(issuer), { zip215: false })) throw new Error("Ring did not authorize this exact conversation");
13786
13919
  return claims;
13787
13920
  }
13788
13921
  function validRingKey(key) {
@@ -13817,7 +13950,7 @@ function ringEvidence(authorization, statement, delegatedSeed) {
13817
13950
  function verifyRingEvidence(e, statement, issuer, issuedAt, expiresAt) {
13818
13951
  if (!e || e.scheme !== "pubky-ring/1" || typeof e.signature !== "string" || e.signature.length !== 86) throw new Error("Invalid Ring proof");
13819
13952
  const claims = verifyRingAuthorization(e.authorization, statement, issuer, issuedAt, expiresAt);
13820
- const sig = dec(e.signature);
13953
+ const sig = decOrEmpty(e.signature);
13821
13954
  if (enc(sig) !== e.signature || e.id !== evidenceId(e.authorization, e.signature) || !ed25519.verify(sig, possession(e.authorization, statement), fromZ32(claims.cnf), { zip215: false })) throw new Error("Invalid delegated proof of possession");
13822
13955
  }
13823
13956
  //#endregion
@@ -13952,7 +14085,7 @@ async function verifyPeerProof(event, c, readStorage) {
13952
14085
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
13953
14086
  } else if (c.adapter === "keet-import") {
13954
14087
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
13955
- const { default: IdentityKey } = await import("./keet-identity-key-740ESaV_.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
14088
+ const { default: IdentityKey } = await import("./keet-identity-key-BRKv78jp.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
13956
14089
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
13957
14090
  } else throw new Error("Unsupported proof adapter");
13958
14091
  }
@@ -14176,10 +14309,12 @@ function applyIdentityEvent(timeline, event, at) {
14176
14309
  const i = lastOf(out, event.side, event.type === "result" ? [event.proof, event.requested] : [event.proof]);
14177
14310
  const last = i >= 0 ? out[i] : void 0;
14178
14311
  const add = (entry) => {
14179
- const n = out.filter((e) => e.side === entry.side && e.proof === entry.proof).length;
14312
+ const prefix = `${entry.side}:${entry.proof}:`;
14313
+ let n = 0;
14314
+ for (const e of out) if (e.id.startsWith(prefix)) n = Math.max(n, Number(e.id.slice(prefix.length)) + 1 || 0);
14180
14315
  out.push({
14181
14316
  ...entry,
14182
- id: `${entry.side}:${entry.proof}:${n}`,
14317
+ id: `${prefix}${n}`,
14183
14318
  at
14184
14319
  });
14185
14320
  };
@@ -14384,13 +14519,19 @@ function verifyIdentityPresentation(key, sig, proofId, scope, nonce, issuedAt) {
14384
14519
  }
14385
14520
  var clean$1 = (value, max) => {
14386
14521
  if (typeof value !== "string") return void 0;
14387
- const text = value.replace(/[\u0000-\u001f\u007f-\u009f‎‏‪-‮⁦-⁩]/g, "").trim();
14388
- return text ? text.slice(0, max) : void 0;
14522
+ const text = stripHidden(value).trim();
14523
+ return text && hasVisible(text) ? text.slice(0, max) : void 0;
14389
14524
  };
14525
+ /**
14526
+ * Room for a line that names a domain (up to 253 characters) once or twice: a How line or a reason cut inside the name
14527
+ * names a record that does not exist, and the app no longer knows the reason to say it in the person's language.
14528
+ */
14529
+ var SOURCE_MAX = 640;
14530
+ var ERROR_MAX = 512;
14390
14531
  /** Bounds a provider's result so a buggy provider cannot store or show arbitrary data. */
14391
14532
  function boundVerifiedIdentity(v) {
14392
14533
  if (!v || typeof v.subject !== "string" || !IDENTITY_SUBJECT.test(v.subject)) throw new Error("Provider returned an invalid subject");
14393
- const source = clean$1(v.source, 120);
14534
+ const source = clean$1(v.source, SOURCE_MAX);
14394
14535
  if (!source) throw new Error("Provider did not say how it verified");
14395
14536
  const out = {
14396
14537
  subject: v.subject,
@@ -14444,7 +14585,10 @@ function receivedWithRoom(received, id, replaced, now) {
14444
14585
  const out = kept.filter((r) => !drop.has(r));
14445
14586
  return out.length < 16 ? out : void 0;
14446
14587
  }
14447
- var shortError = (e) => clean$1(e instanceof Error ? e.message : String(e), 160) ?? "Invalid proof";
14588
+ var REVOKED = "Its owner revoked this proof";
14589
+ /** Revoked is final: a later lookup that fails or finds nothing (the relays forgot it) does not undo it. */
14590
+ var revokedHere = (received, id) => received.some((r) => r.id === id && r.status === "revoked");
14591
+ var shortError = (e) => clean$1(e instanceof Error ? e.message : String(e), ERROR_MAX) ?? "Invalid proof";
14448
14592
  /**
14449
14593
  * A check this side could not finish because of what its own network did: a host it refused to contact, a server
14450
14594
  * that did not answer or answered an error. The message is for this side only. The contact is told the proof could
@@ -14605,54 +14749,60 @@ var IdentityExchange = class {
14605
14749
  const r = this.options.storage.read().received.find((x) => x.id === id);
14606
14750
  if (!r) throw new Error("Unknown identity");
14607
14751
  if (r.status === "revoked") return r;
14608
- let next;
14609
- const settled = r.status === "withdrawn";
14610
- if (await this.options.revoked?.(identityStatement(r.binding)).catch(() => false)) {
14611
- next = {
14612
- ...r,
14613
- status: "revoked",
14614
- checkedAt: this.now(),
14615
- error: void 0
14616
- };
14617
- await this.options.storage.update((l) => this.log({
14618
- ...l,
14619
- received: l.received.map((x) => x.id === id ? next : x)
14620
- }, {
14621
- type: "stopped",
14622
- side: "theirs",
14623
- proof: id,
14624
- provider: r.binding.provider,
14625
- subject: r.verified.subject,
14626
- reason: "revoked"
14627
- }));
14628
- return next;
14629
- }
14752
+ if (await this.options.revoked?.(identityStatement(r.binding)).catch(() => false)) return await this.settleRecheck(id, (x) => x.status === "revoked" ? x : {
14753
+ ...x,
14754
+ status: "revoked",
14755
+ checkedAt: this.now(),
14756
+ error: void 0
14757
+ }, {
14758
+ type: "stopped",
14759
+ side: "theirs",
14760
+ proof: id,
14761
+ provider: r.binding.provider,
14762
+ subject: r.verified.subject,
14763
+ reason: "revoked"
14764
+ }) ?? r;
14630
14765
  if (revocationOnly) return r;
14766
+ let outcome;
14631
14767
  try {
14632
14768
  const verified = boundVerifiedIdentity(await this.options.verify(identityStatement(r.binding), r.evidence));
14633
14769
  if (verified.subject !== r.verified.subject) throw new Error("The identity changed");
14634
- next = {
14635
- ...r,
14770
+ outcome = (x) => ({
14771
+ ...x,
14636
14772
  verified: {
14637
14773
  ...verified,
14638
- display: verified.display ?? r.verified.display
14774
+ display: verified.display ?? x.verified.display
14639
14775
  },
14640
14776
  checkedAt: this.now(),
14641
- status: settled ? "withdrawn" : "verified",
14777
+ status: "verified",
14642
14778
  error: void 0
14643
- };
14779
+ });
14644
14780
  } catch (e) {
14645
- next = {
14646
- ...r,
14781
+ const error = shortError(e);
14782
+ outcome = (x) => ({
14783
+ ...x,
14647
14784
  checkedAt: this.now(),
14648
- status: settled ? "withdrawn" : "unconfirmed",
14649
- error: shortError(e)
14650
- };
14785
+ status: "unconfirmed",
14786
+ error
14787
+ });
14651
14788
  }
14652
- await this.options.storage.update((l) => ({
14653
- ...l,
14654
- received: l.received.map((x) => x.id === id ? next : x)
14655
- }));
14789
+ return await this.settleRecheck(id, (x) => x.status === "revoked" ? x : x.status === "withdrawn" ? {
14790
+ ...outcome(x),
14791
+ status: "withdrawn"
14792
+ } : outcome(x)) ?? r;
14793
+ }
14794
+ async settleRecheck(id, outcome, event) {
14795
+ let next;
14796
+ await this.options.storage.update((l) => {
14797
+ const x = l.received.find((y) => y.id === id);
14798
+ if (!x) return l;
14799
+ next = outcome(x);
14800
+ const out = {
14801
+ ...l,
14802
+ received: l.received.map((y) => y.id === id ? next : y)
14803
+ };
14804
+ return event && x.status !== "revoked" ? this.log(out, event) : out;
14805
+ });
14656
14806
  return next;
14657
14807
  }
14658
14808
  async receive(frame) {
@@ -14669,7 +14819,7 @@ var IdentityExchange = class {
14669
14819
  case "idp-result": {
14670
14820
  const s = id ? this.shared(id) : void 0;
14671
14821
  if (!s || s.status !== "pending") return;
14672
- const error = frame.ok === true ? void 0 : clean$1(frame.error, 160) ?? "Your contact could not verify it";
14822
+ const error = frame.ok === true ? void 0 : clean$1(frame.error, ERROR_MAX) ?? "Your contact could not verify it";
14673
14823
  await this.setShared({
14674
14824
  ...s,
14675
14825
  status: frame.ok === true ? "accepted" : "rejected",
@@ -14687,7 +14837,7 @@ var IdentityExchange = class {
14687
14837
  case "idp-withdraw": {
14688
14838
  if (!id) return;
14689
14839
  const r = this.options.storage.read().received.find((x) => x.id === id);
14690
- if (r && r.status !== "withdrawn") await this.options.storage.update((l) => this.log({
14840
+ if (r && r.status !== "withdrawn" && r.status !== "revoked") await this.options.storage.update((l) => this.log({
14691
14841
  ...l,
14692
14842
  received: l.received.map((x) => x.id === id ? {
14693
14843
  ...x,
@@ -14815,13 +14965,14 @@ var IdentityExchange = class {
14815
14965
  let reason;
14816
14966
  try {
14817
14967
  const mayReplace = (r) => r.binding.provider === binding.provider && (r.binding.subject === binding.subject || r.verified.subject === binding.subject);
14968
+ if (revokedHere(this.options.storage.read().received, id)) throw new Error(REVOKED);
14818
14969
  if (!receivedWithRoom(this.options.storage.read().received, id, mayReplace, now)) throw new Error(TOO_MANY_RECEIVED);
14819
14970
  if (JSON.stringify(evidence ?? null).length > 16384) throw new Error("Evidence too large");
14820
14971
  if (!verifyIdentityPresentation(binding.key, sig, id, scope, nonce, issuedAt)) throw new Error("The proof key did not sign this conversation's challenge");
14821
14972
  if (binding.issuedAt > now + 300) throw new Error("The proof is dated in the future");
14822
14973
  const result = boundVerifiedIdentity(await this.options.verify(statement, evidence));
14823
14974
  if (Math.min(binding.expiresAt, result.expiresAt ?? Infinity) <= now) throw new Error("The proof has expired");
14824
- if (await this.options.revoked?.(statement).catch(() => false)) throw new Error("Its owner revoked this proof");
14975
+ if (await this.options.revoked?.(statement).catch(() => false)) throw new Error(REVOKED);
14825
14976
  verified = result;
14826
14977
  } catch (e) {
14827
14978
  error = peerError(e);
@@ -14832,6 +14983,10 @@ var IdentityExchange = class {
14832
14983
  if (!challenge) throw new Error("Unknown or reused identity challenge");
14833
14984
  const challenges = l.challenges.filter((c) => c.nonce !== nonce);
14834
14985
  const subject = verified?.subject;
14986
+ if (verified && revokedHere(l.received, id)) {
14987
+ verified = void 0;
14988
+ error = reason = REVOKED;
14989
+ }
14835
14990
  const received = verified && receivedWithRoom(l.received, id, (r) => r.binding.provider === binding.provider && r.verified.subject === subject, now);
14836
14991
  if (verified && !received) {
14837
14992
  verified = void 0;
@@ -16693,7 +16848,7 @@ var APP_RATE_LIMIT = 50;
16693
16848
  var APP_RATE_WINDOW_MS = 1e3;
16694
16849
  /** Data frames a sender sends per app per window: under the receiver's limit, so an `open` or `close` always fits. */
16695
16850
  var APP_SEND_LIMIT = 48;
16696
- /** Distinct apps the peer may have open on one session; an `open` for one more is dropped. */
16851
+ /** Distinct apps the peer may have open on one session, held ones counted; an `open` for one more is dropped. */
16697
16852
  var APP_PEER_OPEN_MAX = 16;
16698
16853
  /** The longest version an `open` carries. */
16699
16854
  var APP_VERSION_MAX = 64;
@@ -16852,7 +17007,10 @@ var AppSessions = class {
16852
17007
  open;
16853
17008
  now;
16854
17009
  peer = /* @__PURE__ */ new Map();
16855
- /** What the peer had open on a session that ended, held for `APP_RESUME_GRACE_MS` until it says so again. */
17010
+ /**
17011
+ * What the peer had open on a session that ended, until it says so again: each with its version and the time its
17012
+ * grace ends, counted from the suspension that took it from the peer.
17013
+ */
16856
17014
  held = /* @__PURE__ */ new Map();
16857
17015
  received = new RateWindows(50, 64);
16858
17016
  sent = new RateWindows(48, 64);
@@ -16886,7 +17044,7 @@ var AppSessions = class {
16886
17044
  app,
16887
17045
  o: "close"
16888
17046
  } : null;
16889
- if (!this.peer.has(app) && this.peer.size >= 16) return null;
17047
+ if (!this.peer.has(app) && !this.held.has(app) && this.peer.size + this.held.size >= 16) return null;
16890
17048
  this.held.delete(app);
16891
17049
  this.peer.set(app, parsed.v);
16892
17050
  return {
@@ -16921,10 +17079,14 @@ var AppSessions = class {
16921
17079
  /**
16922
17080
  * The session ended or was replaced, and another may follow at once: what the peer had open is held, not closed (no
16923
17081
  * event now). Nothing is sent to a held app; an `open` on the next session takes it back, a `close` closes it, and
16924
- * `heldExpired` closes the rest once `APP_RESUME_GRACE_MS` has passed.
17082
+ * `heldExpired` closes the rest once `graceMs` has passed since the suspension that held each.
16925
17083
  */
16926
- sessionSuspended() {
16927
- for (const [app, version] of this.peer) this.held.set(app, version);
17084
+ sessionSuspended(graceMs = APP_RESUME_GRACE_MS) {
17085
+ const until = this.now() + graceMs;
17086
+ for (const [app, version] of this.peer) this.held.set(app, {
17087
+ version,
17088
+ until
17089
+ });
16928
17090
  this.peer.clear();
16929
17091
  this.received.clear();
16930
17092
  this.sent.clear();
@@ -16933,14 +17095,23 @@ var AppSessions = class {
16933
17095
  get holding() {
16934
17096
  return this.held.size > 0;
16935
17097
  }
16936
- /** The grace is over: each app still held is closed, with `offline`. */
17098
+ /** When the next held app's grace ends; undefined when none is held. */
17099
+ get heldUntil() {
17100
+ let first;
17101
+ for (const { until } of this.held.values()) if (first === void 0 || until < first) first = until;
17102
+ return first;
17103
+ }
17104
+ /** Each app held whose grace is over is closed, with `offline`; the ones held later keep theirs. */
16937
17105
  heldExpired() {
16938
- const closed = [...this.held.keys()].map((app) => ({
16939
- app,
16940
- o: "close",
16941
- offline: true
16942
- }));
16943
- this.held.clear();
17106
+ const now = this.now(), closed = [];
17107
+ for (const [app, { until }] of this.held) if (until <= now) {
17108
+ this.held.delete(app);
17109
+ closed.push({
17110
+ app,
17111
+ o: "close",
17112
+ offline: true
17113
+ });
17114
+ }
16944
17115
  return closed;
16945
17116
  }
16946
17117
  };
@@ -18146,6 +18317,12 @@ var FILE_LIMITS = {
18146
18317
  autoAcceptBytesPerPeer: 524288e3,
18147
18318
  /** Offers from one contact waiting for an answer here. */
18148
18319
  maxWaitingOffers: 16,
18320
+ /**
18321
+ * Files from one contact not finished here, whatever their state (asked about, taken and waiting their turn, paused,
18322
+ * arriving). Only bytes were counted before: offers of 0 bytes were each taken, and 2,500 of them were 2,500
18323
+ * messages and records waiting for good.
18324
+ */
18325
+ maxUnfinishedIncoming: 256,
18149
18326
  /** Files one contact sends at once; accepted ones beyond wait their turn. */
18150
18327
  maxActiveIncoming: 3,
18151
18328
  /** An offer nobody answered ends after this long. */
@@ -18583,6 +18760,11 @@ var ChatFiles = class {
18583
18760
  if (entry.record.direction === "out") this.announce(entry);
18584
18761
  else if (entry.record.state === "queued") this.startIncoming(entry);
18585
18762
  else if (entry.record.state === "active") this.armNudge(entry);
18763
+ else if (entry.record.state === "paused" && entry.record.pausedBy === "peer") this.send({
18764
+ t: "pf-accept",
18765
+ id: entry.record.id,
18766
+ offset: entry.in.written
18767
+ });
18586
18768
  }
18587
18769
  }
18588
18770
  /** The session went: nothing moves until the next one. What was received is made durable. */
@@ -18604,7 +18786,11 @@ var ChatFiles = class {
18604
18786
  if (entry.in && !transferEnded(entry.record)) this.checkpoint(entry);
18605
18787
  }
18606
18788
  }
18607
- /** Offers ended by their time to live. The host calls it now and then; `attach` does too. */
18789
+ /**
18790
+ * Offers ended by their time to live. The host calls it now and then; `attach` does too. A file taken here and waiting
18791
+ * its turn ends too once nothing of it arrived in that time: its sender never sent it. Offered again, it is taken
18792
+ * again (`retakeAgreed`).
18793
+ */
18608
18794
  sweep() {
18609
18795
  const now = this.now();
18610
18796
  for (const entry of this.entries.values()) {
@@ -18614,7 +18800,7 @@ var ChatFiles = class {
18614
18800
  "offered",
18615
18801
  "asking"
18616
18802
  ].includes(record.state) || record.since + FILE_LIMITS.offerTtlMs > now) continue;
18617
- if (record.direction === "in" && record.state === "queued") continue;
18803
+ if (record.direction === "in" && record.state === "queued" && (entry.in?.starting || this.moved(entry) > 0)) continue;
18618
18804
  this.end(entry, "failed", record.direction === "in" ? "The offer expired" : record.state === "queued" ? "Not delivered in time" : "Not accepted in time");
18619
18805
  if (record.direction === "in") this.send({
18620
18806
  t: "pf-refuse",
@@ -18835,6 +19021,9 @@ var ChatFiles = class {
18835
19021
  waitingOffers() {
18836
19022
  return [...this.entries.values()].filter((e) => e.record.direction === "in" && e.record.state === "asking").length;
18837
19023
  }
19024
+ unfinishedIncoming() {
19025
+ return [...this.entries.values()].filter((e) => e.record.direction === "in" && !transferEnded(e.record)).length;
19026
+ }
18838
19027
  activeIncoming(except) {
18839
19028
  return [...this.entries.values()].filter((e) => e !== except && e.record.direction === "in" && (e.record.state === "active" || e.record.state === "verifying" || e.in?.starting)).length;
18840
19029
  }
@@ -19023,7 +19212,7 @@ var ChatFiles = class {
19023
19212
  this.startIncoming(existing);
19024
19213
  return;
19025
19214
  }
19026
- if (this.waitingOffers() >= FILE_LIMITS.maxWaitingOffers) {
19215
+ if (this.waitingOffers() >= FILE_LIMITS.maxWaitingOffers || this.unfinishedIncoming() >= FILE_LIMITS.maxUnfinishedIncoming) {
19027
19216
  this.send({
19028
19217
  t: "pf-refuse",
19029
19218
  id,
@@ -19082,6 +19271,14 @@ var ChatFiles = class {
19082
19271
  */
19083
19272
  async retakeAgreed(entry) {
19084
19273
  const { record } = entry;
19274
+ if (this.unfinishedIncoming() >= FILE_LIMITS.maxUnfinishedIncoming) {
19275
+ this.send({
19276
+ t: "pf-refuse",
19277
+ id: record.id,
19278
+ why: "too-many"
19279
+ });
19280
+ return false;
19281
+ }
19085
19282
  if (!record.consented) {
19086
19283
  let decision;
19087
19284
  try {
@@ -19452,6 +19649,7 @@ var ChatFiles = class {
19452
19649
  if (entry.record.state !== "asking") return;
19453
19650
  entry.record.state = "queued";
19454
19651
  entry.record.consented = entry.record.agreed = true;
19652
+ entry.record.since = this.now();
19455
19653
  this.changed(entry);
19456
19654
  this.startIncoming(entry);
19457
19655
  }
@@ -19495,6 +19693,7 @@ var ChatFiles = class {
19495
19693
  if (record.state !== "paused" || record.pausedBy !== "me") return;
19496
19694
  record.pausedBy = void 0;
19497
19695
  record.state = "queued";
19696
+ if (direction === "in") record.since = this.now();
19498
19697
  this.changed(entry);
19499
19698
  if (direction === "out") {
19500
19699
  if (this.attached) this.announce(entry);
@@ -21084,6 +21283,13 @@ var WAKE_LOST_MS = 1e4;
21084
21283
  * then did the resume dial: a chat opened on return went live 21 s after the tap (Android emulator, 2026-10-29).
21085
21284
  */
21086
21285
  var WAKE_ANSWER_GRACE_MS = 3e3;
21286
+ function peerSaidWindow() {
21287
+ return {
21288
+ window: new RateWindow(6, 6e4),
21289
+ read: null,
21290
+ timer: null
21291
+ };
21292
+ }
21087
21293
  /**
21088
21294
  * What files/3 may hold on a session's channel (WISP 501, Backpressure): a quarter of its send budget (native and iroh
21089
21295
  * channels throw past 120 KiB), or the high water mark of a WebRTC channel, which has none.
@@ -21291,6 +21497,11 @@ var GhostLink = class {
21291
21497
  peerNickOverride = null;
21292
21498
  /** Group protocol versions the peer announced on this session; null until it does. */
21293
21499
  peerGroupVersions = null;
21500
+ /**
21501
+ * Groups were on on this session. Off again, they stay off until the next session: each "on" runs a group edge's
21502
+ * whole opening, and the peer says its versions once a session.
21503
+ */
21504
+ peerGroupsWereOn = false;
21294
21505
  /** What each side announced after the handshake (`paired-capabilities`): calls, services. */
21295
21506
  sessionCapabilities = new SessionCapabilities(() => this.offeredCapabilities());
21296
21507
  pairedCalls = new PairedCalls();
@@ -21315,20 +21526,16 @@ var GhostLink = class {
21315
21526
  editsReceived = new RateWindow(30, EDIT_RATE_WINDOW_MS);
21316
21527
  wakeReceived = new RateWindow(6, 6e4);
21317
21528
  /**
21318
- * The contact's name and picture, each saved when it changes: said once a session and when changed, so a handful a
21319
- * minute each. Past that only the newest waits, read once the window has room again.
21529
+ * The contact's name and picture, its word on held items, its ways of paying and its transport descriptors, each saved
21530
+ * on this side when it changes: said once a session and when changed, so a handful a minute each. Past that only the
21531
+ * newest waits, read once the window has room again.
21320
21532
  */
21321
21533
  peerSaid = {
21322
- "paired-nick": {
21323
- window: new RateWindow(6, 6e4),
21324
- read: null,
21325
- timer: null
21326
- },
21327
- "paired-avatar": {
21328
- window: new RateWindow(6, 6e4),
21329
- read: null,
21330
- timer: null
21331
- }
21534
+ "paired-nick": peerSaidWindow(),
21535
+ "paired-avatar": peerSaidWindow(),
21536
+ "paired-hold": peerSaidWindow(),
21537
+ "paired-payments": peerSaidWindow(),
21538
+ "paired-adapters": peerSaidWindow()
21332
21539
  };
21333
21540
  /** Identity-proof frames the contact may send per window; the rest are dropped before they are read. */
21334
21541
  identityReceived = new RateWindow(40, IDENTITY_FRAME_WINDOW_MS);
@@ -24436,16 +24643,27 @@ var GhostLink = class {
24436
24643
  /**
24437
24644
  * The session ended or a new one took its place (a transport switch, a resume, a re-dial): what the contact had open
24438
24645
  * is held for `APP_RESUME_GRACE_MS` (WISP 1200 § In a chat). The next session's `open` takes each back, and the app
24439
- * hears only that open, not a close first; one not said again by then is closed with `offline`.
24646
+ * hears only that open, not a close first; one not said again by then is closed with `offline`. Each suspension
24647
+ * gives what it held its own grace: a later one's apps do not close at an earlier one's time.
24440
24648
  */
24441
24649
  appsSuspended() {
24442
24650
  this.appRanges.reset();
24443
- this.apps.sessionSuspended();
24444
- if (!this.apps.holding || this.appsGrace) return;
24651
+ this.apps.sessionSuspended(this.options.appResumeGraceMs ?? 1e4);
24652
+ this.armAppsGrace();
24653
+ }
24654
+ /** A timer for the next held app's grace, as long as any is held. */
24655
+ armAppsGrace() {
24656
+ if (this.appsGrace) {
24657
+ clearTimeout(this.appsGrace);
24658
+ this.appsGrace = null;
24659
+ }
24660
+ const until = this.apps.heldUntil;
24661
+ if (until === void 0) return;
24445
24662
  this.appsGrace = setTimeout(() => {
24446
24663
  this.appsGrace = null;
24447
24664
  for (const event of this.apps.heldExpired()) this.options.events?.onAppFrame?.(event);
24448
- }, this.options.appResumeGraceMs ?? 1e4);
24665
+ this.armAppsGrace();
24666
+ }, Math.max(0, until - Date.now()));
24449
24667
  }
24450
24668
  /** Whether files/3 was agreed on the session open now; kept to say when that changes. */
24451
24669
  filesOpen = false;
@@ -25118,6 +25336,7 @@ var GhostLink = class {
25118
25336
  this.peerNetworks = null;
25119
25337
  this.peerHoldOverride = null;
25120
25338
  this.sessionCapabilities.reset();
25339
+ this.peerGroupsWereOn = false;
25121
25340
  this.leaveHangUp();
25122
25341
  this.typingSender.reset();
25123
25342
  this.typingReceiver.clear();
@@ -25296,7 +25515,7 @@ var GhostLink = class {
25296
25515
  return;
25297
25516
  }
25298
25517
  if (frame?.t === "paired-avatar" || frame?.t === "paired-nick") {
25299
- this.peerSays(channel, frame.t, frame);
25518
+ this.peerSaysOfItself(channel, frame.t, frame);
25300
25519
  return;
25301
25520
  }
25302
25521
  if (frame?.t === "paired-capabilities") {
@@ -25388,15 +25607,21 @@ var GhostLink = class {
25388
25607
  }
25389
25608
  if (frame?.t === "paired-payments") {
25390
25609
  if (!Array.isArray(frame.m) || frame.m.length > 16 || !frame.m.every((m) => typeof m === "string")) return;
25391
- this.peerPaymentMethods = new Set(frame.m.filter((m) => PAYMENT_METHODS.includes(m)));
25392
- this.peerNetworks = frame.n === void 0 ? null : parsePaymentNetworks(frame.n) ?? this.peerNetworks;
25393
- this.emitPairingState();
25610
+ const methods = new Set(frame.m.filter((m) => PAYMENT_METHODS.includes(m)));
25611
+ const networks = frame.n === void 0 ? null : parsePaymentNetworks(frame.n);
25612
+ this.peerSays(channel, "paired-payments", () => {
25613
+ this.peerPaymentMethods = methods;
25614
+ this.peerNetworks = frame.n === void 0 ? null : networks ?? this.peerNetworks;
25615
+ this.emitPairingState();
25616
+ });
25394
25617
  return;
25395
25618
  }
25396
25619
  if (frame?.t === "paired-groups") {
25397
25620
  if (!Array.isArray(frame.v) || frame.v.length > 8 || !frame.v.every((v) => Number.isSafeInteger(v) && v > 0)) return;
25398
25621
  const before = this.groupsSupport;
25622
+ if (!before && this.peerGroupsWereOn && frame.v.includes(1)) return;
25399
25623
  this.peerGroupVersions = frame.v;
25624
+ if (this.groupsSupport) this.peerGroupsWereOn = true;
25400
25625
  if (this.groupsSupport !== before) this.options.events?.onGroupsSupport?.(this.groupsSupport);
25401
25626
  return;
25402
25627
  }
@@ -25413,12 +25638,15 @@ var GhostLink = class {
25413
25638
  }
25414
25639
  if (frame?.t === "paired-hold") {
25415
25640
  if (typeof frame.on !== "boolean" || frame.top !== void 0 && !(Number.isSafeInteger(frame.top) && frame.top >= 0)) return;
25416
- this.peerHoldOverride = frame.on;
25417
- Promise.resolve(this.options.events?.onHold?.({
25418
- peerAllows: frame.on,
25419
- peerTop: frame.top
25420
- })).catch(() => {});
25421
- this.emitPairingState();
25641
+ const on = frame.on, top = frame.top;
25642
+ this.peerSays(channel, "paired-hold", () => {
25643
+ this.peerHoldOverride = on;
25644
+ Promise.resolve(this.options.events?.onHold?.({
25645
+ peerAllows: on,
25646
+ peerTop: top
25647
+ })).catch(() => {});
25648
+ this.emitPairingState();
25649
+ });
25422
25650
  return;
25423
25651
  }
25424
25652
  if (frame?.t === "paired-reconnect") {
@@ -25433,12 +25661,14 @@ var GhostLink = class {
25433
25661
  if (frame?.t === "paired-adapters") {
25434
25662
  if (!frame.descriptors || typeof frame.descriptors !== "object" || JSON.stringify(frame.descriptors).length > 4096) return;
25435
25663
  const descriptors = checkedDescriptors(frame.descriptors);
25436
- const transports = [...this.paired?.peerTransports ?? []];
25437
- const fallback = this.paired?.peerAllowsFallback ?? false;
25438
- await this.options.events?.onTransportDiscovery?.(descriptors, transports, fallback);
25439
- this.peerDescriptors = descriptors;
25440
- this.peerTransports = transports;
25441
- this.peerFallback = fallback;
25664
+ await this.peerSays(channel, "paired-adapters", async () => {
25665
+ const transports = [...this.paired?.peerTransports ?? []];
25666
+ const fallback = this.paired?.peerAllowsFallback ?? false;
25667
+ await this.options.events?.onTransportDiscovery?.(descriptors, transports, fallback);
25668
+ this.peerDescriptors = descriptors;
25669
+ this.peerTransports = transports;
25670
+ this.peerFallback = fallback;
25671
+ });
25442
25672
  return;
25443
25673
  }
25444
25674
  if (!frame || typeof frame.id !== "string" || !/^[A-Za-z0-9_-]{22}$/.test(frame.id)) return;
@@ -25797,11 +26027,8 @@ var GhostLink = class {
25797
26027
  traceLink(this.myPubKeyZ32, "wake-answer-dropped", {});
25798
26028
  this.dataLink.abandon();
25799
26029
  }
25800
- /**
25801
- * A name or picture the contact said, once it is one (reading it costs little; saving it is what counts): past the
25802
- * window the newest waits for room on this session, so the last word still counts.
25803
- */
25804
- peerSays(channel, kind, frame) {
26030
+ /** A name or picture the contact said, once it is one (reading it costs little; saving it is what counts). */
26031
+ peerSaysOfItself(channel, kind, frame) {
25805
26032
  let read;
25806
26033
  if (kind === "paired-avatar") {
25807
26034
  const avatar = sanitizeAvatar(frame.a);
@@ -25817,11 +26044,15 @@ var GhostLink = class {
25817
26044
  }
25818
26045
  };
25819
26046
  }
26047
+ this.peerSays(channel, kind, read);
26048
+ }
26049
+ /**
26050
+ * Something the contact said that this side saves, read within its window: past it the newest waits for room on this
26051
+ * session (handed on unawaited then), so the last word still counts. What `read` returns when read at once is returned.
26052
+ */
26053
+ peerSays(channel, kind, read) {
25820
26054
  const held = this.peerSaid[kind];
25821
- if (!held.timer && held.window.take()) {
25822
- read();
25823
- return;
25824
- }
26055
+ if (!held.timer && held.window.take()) return read();
25825
26056
  held.read = read;
25826
26057
  if (held.timer) return;
25827
26058
  const due = () => {
@@ -25836,7 +26067,7 @@ var GhostLink = class {
25836
26067
  }
25837
26068
  const next = held.read;
25838
26069
  held.read = null;
25839
- next();
26070
+ Promise.resolve(next()).catch(() => {});
25840
26071
  };
25841
26072
  held.timer = setTimeout(due, held.window.wait());
25842
26073
  }
@@ -25897,6 +26128,7 @@ var GhostLink = class {
25897
26128
  this.typingReceiver.clear();
25898
26129
  this.appsSuspended();
25899
26130
  this.emitFilesSession();
26131
+ this.peerGroupsWereOn = false;
25900
26132
  if (this.peerGroupVersions) {
25901
26133
  this.peerGroupVersions = null;
25902
26134
  this.options.events?.onGroupsSupport?.(false);
@@ -27344,7 +27576,7 @@ function decodeDidDhtPacket(did, dnsPacket) {
27344
27576
  const alg = props.get("a") ?? KEY_TYPES[type].alg;
27345
27577
  if (!ALG.test(alg)) throw malformed(`the key ${alias} has an unusable algorithm`);
27346
27578
  const k = props.get("k") ?? "";
27347
- const bytes = /^[A-Za-z0-9_-]+$/.test(k) ? fromBase64Url(k) : /* @__PURE__ */ new Uint8Array();
27579
+ const bytes = /^[A-Za-z0-9_-]+$/.test(k) && k.length % 4 !== 1 ? fromBase64Url(k) : /* @__PURE__ */ new Uint8Array();
27348
27580
  if (bytes.length === 0 || toBase64Url(bytes) !== k) throw malformed(`the key ${alias} is not unpadded base64url`);
27349
27581
  const controller = props.get("c") ?? did;
27350
27582
  if (!DID.test(controller)) throw malformed(`the key ${alias} has a controller that is not a DID`);
@@ -27619,6 +27851,11 @@ function parseWeb(id) {
27619
27851
  path
27620
27852
  };
27621
27853
  }
27854
+ /**
27855
+ * A did:web (or one of its URLs) with the port's `%3a` written `%3A`, as `parseDid` writes it: percent-encoding is
27856
+ * case-insensitive (RFC 3986), so a document may write either. The fragment is left as it is.
27857
+ */
27858
+ var webPortForm = (value) => value.startsWith("did:web:") ? value.replace(/^[^#]*/, (part) => part.replace(/%3a/g, "%3A")) : value;
27622
27859
  var web = (did) => {
27623
27860
  const parsed = parseDid(did);
27624
27861
  if (parsed.method !== "web") throw new DidError("Not a did:web");
@@ -27655,7 +27892,7 @@ function didWebFileNames(text, did, statement) {
27655
27892
  } catch {
27656
27893
  return false;
27657
27894
  }
27658
- return isObject$6(body) && body.ghostly === 1 && body.did === did && body.statement === statement;
27895
+ return isObject$6(body) && body.ghostly === 1 && typeof body.did === "string" && webPortForm(body.did) === did && body.statement === statement;
27659
27896
  }
27660
27897
  /** The service entry a did.json can carry instead of the file. */
27661
27898
  function didGhostlyServiceEntry(did, key, proofId) {
@@ -27807,7 +28044,7 @@ function staticDidDocument(did) {
27807
28044
  /** An id as absolute `<did>#<fragment>`, from `#frag` or the absolute form; undefined for another DID's. */
27808
28045
  function methodId(did, id) {
27809
28046
  if (typeof id !== "string" || id.length > 640) return void 0;
27810
- const absolute = id.startsWith("#") ? `${did}${id}` : id;
28047
+ const absolute = id.startsWith("#") ? `${did}${id}` : webPortForm(id);
27811
28048
  return absolute.startsWith(`${did}#`) && absolute.length > did.length + 1 && /^[\x21-\x7e]+$/.test(absolute) ? absolute : void 0;
27812
28049
  }
27813
28050
  /** Key material of one verification method: `publicKeyJwk`, `publicKeyMultibase` or (Ed25519 2018) `publicKeyBase58`. */
@@ -27846,7 +28083,7 @@ var list = (value, name) => {
27846
28083
  */
27847
28084
  function parseDidDocument(did, raw) {
27848
28085
  if (!isObject$6(raw)) throw new DidError("The DID document is not a JSON object");
27849
- if (raw.id !== did) throw new DidError(typeof raw.id === "string" ? `The DID document is for another DID (${raw.id.slice(0, 80)})` : "The DID document has no id");
28086
+ if (typeof raw.id !== "string" || webPortForm(raw.id) !== did) throw new DidError(typeof raw.id === "string" ? `The DID document is for another DID (${raw.id.slice(0, 80)})` : "The DID document has no id");
27850
28087
  const keys = /* @__PURE__ */ new Map();
27851
28088
  const unusable = /* @__PURE__ */ new Set();
27852
28089
  let skipped = 0;
@@ -28000,14 +28237,19 @@ function checkDidJws(input, messages, doc) {
28000
28237
  inputs = [];
28001
28238
  }
28002
28239
  if (!inputs.length) throw new DidError("The JWS carries another text: sign exactly the statement shown");
28240
+ let refused;
28003
28241
  for (const key of candidates) {
28004
28242
  if (!inputs.some((m) => verifyWith(key, jws.signature, m))) continue;
28005
- if (!key.relationships.length) throw refusedKey(key);
28243
+ if (!key.relationships.length) {
28244
+ refused ??= key;
28245
+ continue;
28246
+ }
28006
28247
  return {
28007
28248
  key,
28008
28249
  alg: jws.alg
28009
28250
  };
28010
28251
  }
28252
+ if (refused) throw refusedKey(refused);
28011
28253
  throw new DidError("The JWS signature does not match: sign exactly the statement shown, with a key of this DID");
28012
28254
  }
28013
28255
  /**
@@ -28025,10 +28267,14 @@ function checkDidSignature(signature, messages, doc, vm) {
28025
28267
  }
28026
28268
  const der = signature.length !== 64 && signature[0] === 48;
28027
28269
  if (signature.length !== 64 && !der) throw new DidError("A signature is 64 bytes (or DER, for ECDSA)");
28270
+ let refused;
28028
28271
  for (const key of candidates) {
28029
28272
  if (der && key.curve === "Ed25519") continue;
28030
28273
  if (!messages.some((m) => verifyWith(key, signature, m, der ? "der" : "compact"))) continue;
28031
- if (!key.relationships.length) throw refusedKey(key);
28274
+ if (!key.relationships.length) {
28275
+ refused ??= key;
28276
+ continue;
28277
+ }
28032
28278
  const canonical = der ? (key.curve === "secp256k1" ? secp256k1 : p256).Signature.fromBytes(signature, "der").toBytes("compact") : signature;
28033
28279
  return {
28034
28280
  key,
@@ -28036,6 +28282,7 @@ function checkDidSignature(signature, messages, doc, vm) {
28036
28282
  signature: canonical
28037
28283
  };
28038
28284
  }
28285
+ if (refused) throw refusedKey(refused);
28039
28286
  throw new DidError("The signature does not match: sign exactly the statement shown, with a key of this DID");
28040
28287
  }
28041
28288
  function parseDidSignaturePaste(pasted) {
@@ -30321,6 +30568,8 @@ function readFirstPlace(o, epoch) {
30321
30568
  var ownKey = (f) => `${f.e}:${f.n}`;
30322
30569
  /** What a frame weighs in a log, roughly: its boxes plus the fixed fields around them. */
30323
30570
  var frameKey$1 = (f) => `${f.s}:${f.e}:${f.n}`;
30571
+ /** One edit of a message, by its number: an edit handed already, apart from the message's own `frameKey`. */
30572
+ var editKey = (f) => `${f.s}:${f.e}:${f.n}:v${f.v}`;
30324
30573
  /** What a kept frame counts for against `GROUP_LIMITS.relayBytes`. */
30325
30574
  var frameBytes = (f) => f.c.length + (f.m?.c.length ?? 0) + (f.r?.c.length ?? 0) + (f.sc?.c.length ?? 0) + (f.fl?.c.length ?? 0) + (f.nk?.c.length ?? 0) + 400;
30326
30575
  /** Only the fields an edit frame has, as `clean` does for a message. */
@@ -30505,9 +30754,9 @@ var GroupSession = class {
30505
30754
  }
30506
30755
  this.answers = new CatchUpAnswers({
30507
30756
  send: (to, frame) => {
30508
- if (frame.t === "group-msg" && !rosterHas(this.roster, frame.s)) {
30757
+ if ((frame.t === "group-msg" || frame.t === "group-edit") && !rosterHas(this.roster, frame.s)) {
30509
30758
  const handed = this.leaversHanded.get(to) ?? /* @__PURE__ */ new Set();
30510
- this.leaversHanded.set(to, handed.add(frameKey$1(frame)));
30759
+ this.leaversHanded.set(to, handed.add(frame.t === "group-edit" ? editKey(frame) : frameKey$1(frame)));
30511
30760
  }
30512
30761
  return hooks.send(to, frame);
30513
30762
  },
@@ -30984,7 +31233,18 @@ var GroupSession = class {
30984
31233
  if (this.state.relay?.length) this.state.relay = prune(this.state.relay, false);
30985
31234
  if (this.onRows?.length) this.onRows = prune(this.onRows, true);
30986
31235
  this.pruned.splice(0, this.pruned.length - GROUP_LIMITS.relay);
30987
- if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s));
31236
+ if (this.state.relayEdits?.length) this.state.relayEdits = this.state.relayEdits.filter((f) => rosterHas(this.roster, f.s) || this.isRemovalEdit(f));
31237
+ }
31238
+ /** Whether a kept edit is a removal (WISP 400 § Delete for everyone): its box, under its epoch's key, says `rm`. */
31239
+ isRemovalEdit(frame) {
31240
+ const secret = this.secret(frame.e);
31241
+ const plain = secret && decryptText(epochKeys(secret, this.id, frame.e).message, editAad(frame), frame.nn, frame.c);
31242
+ if (!plain) return false;
31243
+ try {
31244
+ return JSON.parse(plain)?.rm === true;
31245
+ } catch {
31246
+ return false;
31247
+ }
30988
31248
  }
30989
31249
  /** The frames `pruneRelay` dropped that are handed on again now (a removal's `left` mark came after it), back in their logs. */
30990
31250
  unprune() {
@@ -31671,11 +31931,14 @@ var GroupSession = class {
31671
31931
  /**
31672
31932
  * An edit of a member's own message, from its author's edge or handed on by another member: believed only while its
31673
31933
  * author is still in the roster (someone removed edits nothing), and the member handing it on too; for an epoch the
31674
- * author and I were both members of, with the author's signature over the whole frame and a box that opens. One for
31675
- * an epoch or a secret not here yet waits, as a message does. Taken, it is kept to hand on in turn.
31934
+ * author and I were both members of, with the author's signature over the whole frame and a box that opens. A removal
31935
+ * of an author out of the roster still stands, handed on by a member: it only takes away what the author wrote while
31936
+ * in, and a member away when it was said would keep the message for good. One for an epoch or a secret not here yet
31937
+ * waits, as a message does. Taken, it is kept to hand on in turn.
31676
31938
  */
31677
31939
  async receiveEdit(from, raw) {
31678
- if (!isEditFrame(raw) || raw.s === this.myKey || !rosterHas(this.roster, raw.s) || !rosterHas(this.roster, from)) return;
31940
+ if (!isEditFrame(raw) || raw.s === this.myKey || !rosterHas(this.roster, from)) return;
31941
+ const member = rosterHas(this.roster, raw.s);
31679
31942
  if (!verify(fromBase64Url(raw.sig), editSigned(raw), publicKeyFromZ32(raw.s))) return;
31680
31943
  if (raw.e > this.epoch) {
31681
31944
  this.parkEdit(from, raw);
@@ -31699,6 +31962,7 @@ var GroupSession = class {
31699
31962
  if (!body || typeof body !== "object" || !validEditText(body.text)) return;
31700
31963
  if (body.rm !== void 0 && body.rm !== true) return;
31701
31964
  const rm = body.rm === true;
31965
+ if (!member && !rm) return;
31702
31966
  if (!rm && !cardEditNumber(raw.v)) return;
31703
31967
  const k = rm ? [] : validMentions(body.m, body.text, rosterAdmin(commit.m) === raw.s && this.admin === raw.s);
31704
31968
  const sc = rm || body.sc === void 0 ? void 0 : readStatusCard(body.sc);
@@ -31859,7 +32123,7 @@ var GroupSession = class {
31859
32123
  if (e <= this.epoch) {
31860
32124
  const known = this.state.chain[e];
31861
32125
  const result = verifyCommit(raw, this.state.chain[e - 1] ?? null, this.id);
31862
- if ("error" in result || result.commit.by !== known.by) return;
32126
+ if ("error" in result || result.commit.by !== known.by || result.commit.by !== this.admin) return;
31863
32127
  if (commitHash(result.commit) !== commitHash(known)) await this.fork(`Member ${from.slice(0, 8)} holds a different membership history for epoch ${e}`);
31864
32128
  else if (this.takeLeftMark(known, frame.left)) {
31865
32129
  this.unprune();
@@ -32017,10 +32281,13 @@ var GroupSession = class {
32017
32281
  while (metas.length && metas[0].ts < f.ts) answer.push(metas.shift().frame);
32018
32282
  answer.push(f);
32019
32283
  }
32284
+ const readable = (f) => !!this.state.chain[f.e] && rosterHas(this.state.chain[f.e].m, from);
32020
32285
  for (const author of asked) {
32021
- const edits = (this.state.relayEdits ?? []).filter((f) => f.s === author && this.state.chain[f.e] && rosterHas(this.state.chain[f.e].m, from));
32286
+ const edits = (this.state.relayEdits ?? []).filter((f) => f.s === author && readable(f));
32022
32287
  answer.push(...edits.slice(-GROUP_LIMITS.handOnEdits));
32023
32288
  }
32289
+ const gone = (this.state.relayEdits ?? []).filter((f) => !rosterHas(this.roster, f.s) && readable(f) && !handed?.has(editKey(f)));
32290
+ answer.push(...gone.slice(-GROUP_LIMITS.handOnEdits));
32024
32291
  answer.push(...metas.map((m) => m.frame));
32025
32292
  this.handOut(from, answer);
32026
32293
  }
@@ -32419,8 +32686,9 @@ function entryParams(link, mySeed, myZ32, peerZ32) {
32419
32686
  * only a newcomer is sent it; `leave`, `remove` and `rotate` get a fresh secret sealed to everyone;
32420
32687
  * - concurrent commits are a race with a deterministic winner, not a fork: the branch that keeps the
32421
32688
  * admin's changes (remove, role, rotate, link) since the common parent, then the longest, then the
32422
- * lowest hash of the first commit after the common parent. The admin signing changes on two
32423
- * branches (after the same commit or not) is still a fork and halts the group;
32689
+ * lowest hash of the first commit after the common parent. The admin of the tip signing changes on
32690
+ * two branches (after the same commit or not) is still a fork and halts the group; a former admin
32691
+ * doing so on a branch from before its hand-over is refused, as a stale branch;
32424
32692
  * - messages name the commit of their epoch, so messages under a commit that lost stay readable;
32425
32693
  * every member keeps recent frames from everyone and re-sends them to whoever was away.
32426
32694
  *
@@ -32475,6 +32743,15 @@ var COMMUNITY_LIMITS = {
32475
32743
  syncAnswers: 16,
32476
32744
  syncWindowMs: 6e4,
32477
32745
  /**
32746
+ * Messages of one member taken per `messageWindowMs`, and the bytes of their sealed bodies, past what one catch-up
32747
+ * answer holds (a whole store, and the lasting frames): anyone with the link is a member, and each message taken is a
32748
+ * row in every member's app and a frame each hub passes on. The rest are not taken now and come again in a catch-up
32749
+ * (`MessagePace`).
32750
+ */
32751
+ messagesPerAuthor: 30,
32752
+ messageBytesPerAuthor: 131072,
32753
+ messageWindowMs: 1e4,
32754
+ /**
32478
32755
  * Frames of one catch-up answer in a slice (`CommunitySessionHooks.handled`), two slices at most not handled yet by
32479
32756
  * the member's app: a member back after the store filled was handed 258 at once, and an app holds 64 waiting at most
32480
32757
  * before 2026-10-07 (more ends the session). As a private group's (`GROUP_LIMITS.catchUpSlice`).
@@ -32680,7 +32957,7 @@ function communityRoster(previous, c, trusted = false) {
32680
32957
  /**
32681
32958
  * One commit against its parent (null for a genesis) and the parent's roster: shape, id, link,
32682
32959
  * authority, roster arithmetic, roster hash and signature. The confirmation tag is checked once
32683
- * the secret is known. `before`: the commits before it on its branch, newest first; given, a `leave` is held to the
32960
+ * the secret is known (a derived kind's on arrival, by a member holding the parent's: `receiveCommit`). `before`: the commits before it on its branch, newest first; given, a `leave` is held to the
32684
32961
  * admission it ends (`leaveStands`). A member gives it for every commit it takes in after its own admission; the chain
32685
32962
  * of a welcome is not held to it (`verifyCommunityChain`).
32686
32963
  */
@@ -32782,6 +33059,56 @@ var messageSigned = (f) => utf8Encode(JSON.stringify([
32782
33059
  ]));
32783
33060
  var communityMessageId = (sender, epoch, h, seq) => `${sender}:${epoch}:${h}:${seq}`;
32784
33061
  var seenKey = (e, h) => `${e}:${h}`;
33062
+ /**
33063
+ * One member's messages taken: a whole catch-up answer at once (`MESSAGE_BURST`), then
33064
+ * `COMMUNITY_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`. One not taken is not marked
33065
+ * seen, so a catch-up hands it again; until it is taken, those after it under the same commit (`seenKey`) are not taken
33066
+ * either: a later one taken would say I have everything up to it (`syncFrame`'s `have`) and the one before would never
33067
+ * be handed again. A place that moves no more for `COMMUNITY_LIMITS.pendingMs` (no catch-up holds it any longer) is let go.
33068
+ */
33069
+ var MESSAGE_BURST = {
33070
+ frames: COMMUNITY_LIMITS.store + COMMUNITY_LIMITS.lasting,
33071
+ bytes: COMMUNITY_LIMITS.storeBytes + COMMUNITY_LIMITS.lasting * COMMUNITY_LIMITS.textBytes * 2
33072
+ };
33073
+ var MessagePace = class {
33074
+ frames = MESSAGE_BURST.frames;
33075
+ bytes = MESSAGE_BURST.bytes;
33076
+ at;
33077
+ held = /* @__PURE__ */ new Map();
33078
+ take(key, n, bytes, now) {
33079
+ let held = this.held.get(key);
33080
+ if (held && now - held.at >= COMMUNITY_LIMITS.pendingMs) {
33081
+ this.held.delete(key);
33082
+ held = void 0;
33083
+ }
33084
+ if (held && n > held.low) {
33085
+ held.top = Math.max(held.top, n);
33086
+ return false;
33087
+ }
33088
+ const elapsed = Math.max(0, now - (this.at ?? now)) / COMMUNITY_LIMITS.messageWindowMs;
33089
+ this.at = now;
33090
+ this.frames = Math.min(MESSAGE_BURST.frames, this.frames + elapsed * COMMUNITY_LIMITS.messagesPerAuthor);
33091
+ this.bytes = Math.min(MESSAGE_BURST.bytes, this.bytes + elapsed * COMMUNITY_LIMITS.messageBytesPerAuthor);
33092
+ if (this.frames < 1 || this.bytes < bytes) {
33093
+ if (held) held.low = n;
33094
+ else this.held.set(key, {
33095
+ low: n,
33096
+ top: n,
33097
+ at: now
33098
+ });
33099
+ return false;
33100
+ }
33101
+ this.frames -= 1;
33102
+ this.bytes -= bytes;
33103
+ if (held && n === held.low) {
33104
+ if (held.top > n) {
33105
+ held.low = n + 1;
33106
+ held.at = now;
33107
+ } else this.held.delete(key);
33108
+ }
33109
+ return true;
33110
+ }
33111
+ };
32785
33112
  /** One of a member's frames, among its own. */
32786
33113
  var frameKey = (f) => `${f.e}:${f.h}:${f.n}`;
32787
33114
  /** A frame among everyone's: each member counts its own `n`, so `frameKey` alone tells only one member's frames apart. */
@@ -32865,6 +33192,8 @@ var CommunitySession = class {
32865
33192
  asked = /* @__PURE__ */ new Map();
32866
33193
  /** Syncs answered per member, a few a minute (`COMMUNITY_LIMITS.syncAnswers`). In memory only. */
32867
33194
  syncsAnswered = /* @__PURE__ */ new Map();
33195
+ /** Messages taken per author, a few a second (`MessagePace`). In memory only. */
33196
+ messagePace = /* @__PURE__ */ new Map();
32868
33197
  /** The entry seed sealed to each member, for the seed it seals (`entryFrame`): every sync answer carries it. In memory only. */
32869
33198
  sealedEntries = /* @__PURE__ */ new Map();
32870
33199
  /** Catch-up answers still going out, a slice at a time (`receiveSync`). */
@@ -33378,11 +33707,17 @@ var CommunitySession = class {
33378
33707
  if (!parsed || this.known.has(communityCommitHash(parsed))) return false;
33379
33708
  const result = verifyCommunityCommit(raw, parent, parentRoster, this.id, this.ancestry(p));
33380
33709
  if ("error" in result) return false;
33710
+ const previous = this.state.secrets[p];
33711
+ if (previous && !FRESH.has(result.commit.k)) {
33712
+ const untagged = communityUntaggedHash(result.commit);
33713
+ if (!confirmationMatches(epochKeys(derivedSecret(fromBase64Url(previous), untagged), this.id, result.commit.e).confirm, untagged, result.commit.c)) return false;
33714
+ }
33381
33715
  if (GROWS.has(result.commit.k) && !keepsRoom(result.commit.e, result.roster)) return false;
33382
33716
  const commit = result.commit, h = communityCommitHash(commit);
33383
33717
  const admin = rosterAdmin(parentRoster);
33384
33718
  if (commit.by === admin) {
33385
33719
  for (const [other, c] of this.known) if (other !== h && c.p === commit.p && c.by === admin) {
33720
+ if (admin !== this.admin) return false;
33386
33721
  this.known.set(h, commit);
33387
33722
  this.rosters.set(h, result.roster);
33388
33723
  await this.fork(`The admin signed two different changes after epoch ${parent.e}`);
@@ -33395,6 +33730,11 @@ var CommunitySession = class {
33395
33730
  if (branch && branch.path.length) {
33396
33731
  const { admin } = this.parting(branch, this.branch(this.topHash), this.adminCounts());
33397
33732
  if (ADMIN_ONLY.has(commit.k) && admin[1]) {
33733
+ if (commit.by !== this.admin) {
33734
+ this.known.delete(h);
33735
+ this.rosters.delete(h);
33736
+ return false;
33737
+ }
33398
33738
  await this.fork(`The admin signed changes on two branches after epoch ${this.state.chain[branch.fork].e}`);
33399
33739
  return true;
33400
33740
  }
@@ -33486,6 +33826,7 @@ var CommunitySession = class {
33486
33826
  this.state.chain.push(c);
33487
33827
  this.takeDerived(h);
33488
33828
  }
33829
+ this.holdDroppedLeaves(dropped);
33489
33830
  if (!rosterHas(this.roster, this.myKey) && this.state.status === "active") {
33490
33831
  const out = [...path].reverse().map((h) => this.known.get(h)).find((c) => (c.k === "remove" || c.k === "leave") && c.s === this.myKey);
33491
33832
  if (out) this.out(out.k === "remove" ? "removed" : "left", out.k === "remove" ? "You were removed from this group" : "You left this group");
@@ -33495,6 +33836,33 @@ var CommunitySession = class {
33495
33836
  }
33496
33837
  }
33497
33838
  }
33839
+ /**
33840
+ * A leave the branch I left behind had committed, whose member the main branch still lists (an admin-only commit
33841
+ * signed on a stale view won the fork): its request is held again, so the next hub commits it on top. The hub that
33842
+ * committed it kept no copy and the leaver's app forgot the group, so nobody would say it again (agents#2285).
33843
+ */
33844
+ holdDroppedLeaves(dropped) {
33845
+ let held = this.state.pendingLeaves;
33846
+ for (const c of dropped) {
33847
+ if (c.k !== "leave" || !c.s || !c.ls || c.s === this.myKey || !rosterHas(this.roster, c.s)) continue;
33848
+ const request = {
33849
+ s: c.s,
33850
+ ls: c.ls,
33851
+ ...c.ls3 ? { ls3: c.ls3 } : {}
33852
+ };
33853
+ if (!leaveStands({
33854
+ g: this.id,
33855
+ ...request
33856
+ }, this.ancestry(this.topHash))) continue;
33857
+ const other = held.find((r) => r.s === c.s && leaveStands({
33858
+ g: this.id,
33859
+ ...r
33860
+ }, this.ancestry(this.topHash)));
33861
+ if (other && (other.ls3 || !request.ls3)) continue;
33862
+ held = [...held.filter((r) => r.s !== c.s), request].slice(-COMMUNITY_LIMITS.pendingLeaves);
33863
+ }
33864
+ this.state.pendingLeaves = held;
33865
+ }
33498
33866
  /** The entry key is the one the main branch names; its seed comes with a `group-entry` from whoever holds it. */
33499
33867
  followEntry() {
33500
33868
  const key = this.currentEntryKey();
@@ -33749,6 +34117,10 @@ var CommunitySession = class {
33749
34117
  return this.serialize(async () => {
33750
34118
  this.requireAdmin();
33751
34119
  if (!rosterHas(this.roster, memberKey) || memberKey === this.myKey) throw new Error("Not a member");
34120
+ if (this.state.pendingLeaves.some((r) => r.s === memberKey && leaveStands({
34121
+ g: this.id,
34122
+ ...r
34123
+ }, this.ancestry(this.topHash)))) throw new Error("This member has left the group. Make someone else the admin.");
33752
34124
  await this.commit("role", { s: memberKey }, now);
33753
34125
  });
33754
34126
  }
@@ -34380,6 +34752,9 @@ var CommunitySession = class {
34380
34752
  }
34381
34753
  const roster = this.rosterOf(found.hash);
34382
34754
  if (!rosterHas(roster, raw.s)) return false;
34755
+ let pace = this.messagePace.get(raw.s);
34756
+ if (!pace) this.messagePace.set(raw.s, pace = new MessagePace());
34757
+ if (!pace.take(seenKey(raw.e, raw.h), raw.n, raw.c.length, this.hooks.clock?.() ?? Date.now())) return false;
34383
34758
  if (!rosterHas(roster, this.myKey)) {
34384
34759
  this.markSeen(raw);
34385
34760
  this.keep(raw);
@@ -34631,8 +35006,8 @@ var CommunitySession = class {
34631
35006
  const unheard = new Set(this.state.unheard ?? []);
34632
35007
  const marked = /* @__PURE__ */ new Set();
34633
35008
  const metas = this.metaFor(from, frame.mt);
34634
- const inStore = new Set(this.state.store.map(frameKey));
34635
- const lasting = Object.values(this.state.lasting ?? {}).filter((f) => !inStore.has(frameKey(f))).sort((a, b) => a.ts - b.ts);
35009
+ const inStore = new Set(this.state.store.map(storeKey));
35010
+ const lasting = Object.values(this.state.lasting ?? {}).filter((f) => !inStore.has(storeKey(f))).sort((a, b) => a.ts - b.ts);
34636
35011
  for (const stored of [...lasting, ...this.state.store]) {
34637
35012
  if (stored.s === from) continue;
34638
35013
  const high = have[stored.s]?.[seenKey(stored.e, stored.h)];
@@ -36169,6 +36544,6 @@ function x401ApprovalDigest(subject) {
36169
36544
  return toBase64Url(sha256(utf8Encode(canonical)));
36170
36545
  }
36171
36546
  //#endregion
36172
- export { COMMUNITY_LIMITS as $, fromBase64 as $C, normalizeRelayUrl as $S, readHandoffAck as $_, LIVENESS_PING_MS as $a, INVITE_VERSION as $b, isServeId as $c, emptyDhtDeliveryState as $d, LINK_PREVIEW_LIMITS as $f, HANDOFF_BUSY_REASONS as $g, encodeChunk as $h, sparkAddressKind as $i, DOMAIN_FILE_MAX_BYTES as $l, DATA_SETTLE_MS as $m, bip322MessageHash as $n, meshHubs as $o, cardLinkHost as $p, checkDidJws as $r, GROUP_PIN_FRAME as $s, carryMentions as $t, identityRevocationValue as $u, planKnocks as $v, TURN_SLOTS as $x, pacer as $y, readX401ProofResponseHeader as A, identityFromSeed as AC, DEPARTED_READS as AS, handoffContext as A_, ENDPOINT as Aa, parseImageMeta as Ab, wakeRequest as Ac, ringAuthorization as Ad, isPlayableVideoType as Af, waitForIceGathering as Ag, UNUSED_INVITE_WAIT_MAX_MS as Ah, openDidDhtPayload as Ai, SERVICES_CAPABILITY as Al, rememberAlone as Am, parseGroupMetaFrame as An, fetchesByItself as Ao, REPLY_ID as Ap, shortAtprotoDid as Ar, FileUplink as As, mergeKnocks as At, dialDescriptors as Au, ENROLL_PROOF as Av, signDeviceTransports as Ax, readLinkRecord as Ay, APP_STORE_KINDS as B, MAX_AVATAR_LENGTH as BC, RELAY_REQUESTS_PER_MINUTE as BS, handoffManifestFrames as B_, CROSSED_FRESH_MS as Ba, readContactLink as Bb, APP_RANGE_DATA_KIND as Bc, irohDescriptor as Bd, MAX_EDITS_PER_MESSAGE as Bf, MAX_SERVICES as Bg, relativizeLocation as Bh, USDT_PUBLIC_RPC as Bi, PairedSession as Bl, confirmationTag as Bm, SshSigError as Bn, GROUP_VERSION_SIGNALS as Bo, CRON_LINE as Bp, parseAtprotoVerificationKey as Br, TYPING_REFRESH_MS as Bs, mentionedMembers as Bt, IDENTITY_MAX_FRAME as Bu, readEnrollGrant as Bv, keptAtEqualSequence as Bx, APP_ICON_PATH as By, buildX401TokenObject as C, signRelayPayload as CC, BACKGROUND_REQUESTS_PER_MINUTE as CS, filePartName as C_, parseLightningDestination as Ca, signAppRevocation as Cb, newWakeToken as Cc, storageProof as Cd, voiceFileName as Cf, heardCallSignal as Cg, PRESENCE_HEARTBEAT as Ch, didDhtDocument as Ci, CALLS_CAPABILITY as Cl, MEMBER_KEY as Cm, groupMetaTag as Cn, parseEngineError as Co, reactionFrame as Cp, atprotoDidMethod as Cr, PAIRED_CALL_FRAME as Cs, MAX_KNOCKS as Ct, CAPS_PUBLISH_SPACING_MS as Cu, verifySetUpdate as Cv, deviceLinkPairing as Cx, knockSlotRecords as Cy, readX401ProofRequest as D, readDnsName as DC, CHAT_RESERVE_PER_CHAT as DS, handoffAttemptSucceeded as D_, BOLT11_PATTERN as Da, IMAGE_LIMITS as Db, relayRequest as Dc, verifyNostrProof as Dd, PLAYABLE_VIDEO as Df, pickCallCandidates as Dg, STALLED_LOOK_MS as Dh, encodeDidDhtDeactivated as Di, KNOWN_SESSION_CAPABILITIES as Dl, commitUntaggedHash as Dm, nextGroupMetaRevision as Dn, GROUP_VERSION_FILES as Do, validReactionNumber as Dp, isAtprotoDid as Dr, FILE_DATA_KIND as Ds, groupEntryUrl as Dt, CapsRefusedError as Du, ENROLL_DONE as Dv, deviceLinkSecret as Dx, mergeContactKnocks as Dy, isX401Protocol as E, encodeTxtPacket as EC, CHAT_RESERVE_MOST_SHARE as ES, handoffAttemptFailed as E_, resolveLightningDestination as Ea, verifyAppStatementBytes as Eb, readWakePayload as Ec, validExternalKey as Ed, voicePeaksOf as Ef, parseCallSignal as Eg, SIGNAL_OUT_READS as Eh, didDhtRecords as Ei, FILES_CAPABILITY as El, commitHash as Em, keepPastGroupMeta as En, GROUP_HAVE_FRAME as Eo, readReaction as Ep, checkAtprotoProofRecord as Er, ChatFiles as Es, entryParams as Et, CapsKeys as Eu, ENROLL_CANCEL_REASONS as Ev, deviceLinkSealKey as Ex, makeStampPaced as Ey, appRevocationFor as F, decrypt as FC, GROUP_RATION_WINDOW_MS as FS, handoffEphemeral as F_, parseCashuRequestPayload as Fa, readCanonicalJson as Fb, encryptPushPayload as Fc, verifyRingEvidence as Fd, EDIT_BUFFER_MS as Ff, emptyLinkRecords as Fg, GhostlyHttpError as Fh, ONCHAIN_PROVIDER as Fi, UPGRADE_CAPABILITY as Fl, verifyChain as Fm, wrapGroupMeta as Fn, readGroupWant as Fo, replySnippet as Fp, decodeDagCbor as Fr, transferStalled as Fs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ft, IDENTITY_CHECK_UNAVAILABLE as Fu, enrollGrantFrame as Fv, TURN_PUT_WINDOW_MS as Fx, APP_BUNDLE_LIMITS as Fy, readAppStore as G, hasVisible as GC, SIGNALING_WINDOW_MS as GS, handoffRetryAfter as G_, DHT_PIN_GRACE_MS as Ga, deviceInviteJoinerKeyZ32 as Gb, appRangeCancelFrame as Gc, ACTIVE_DHT_POLL_MS as Gd, editFrame as Gf, isViewerTag as Gg, webLocalFetch as Gh, formatPaymentAmount as Gi, HOLD_LIMITS as Gl, newEpochSecret as Gm, sshKeyDigestHex as Gn, SIGNAL_PROVEN_MS as Go, ROUTINE_STATES as Gp, DID_DOCUMENT_MAX_BYTES as Gr, TypingSender as Gs, GroupSession as Gt, IDENTITY_REVOCATION_LABEL as Gu, MAX_MISSED as Gv, TURN_LABEL as Gx, appViewOf as Gy, checkAppListing as H, jpegSize$1 as HC, RelayTransport as HS, handoffPakeFrame as H_, CROSSED_WAIT_MS as Ha, DEVICE_INVITE_LIFETIME_S as Hb, APP_RANGE_FRAMES as Hc, rankTransports as Hd, REMOVED_TEXT as Hf, decodeServices as Hg, sanitizeRequestHeaders as Hh, arkAddressPrefix as Hi, SESSION_RECEIVE_PENDING as Hl, edgeParams as Hm, parseSshSignature as Hn, SIGNAL_CARRIERS as Ho, PR_CHECKS as Hp, unsignedCommitBytes as Hr, TYPING_STATUS_MAX as Hs, GROUP_LIMITS as Ht, IDENTITY_MAX_VALIDITY as Hu, verifyEnrollProof as Hv, TOMBSTONE_SEQUENCE as Hx, APP_SCREENSHOTS_DIR as Hy, appStoreDecision as I, encrypt as IC, GROUP_SIGNALING_ALLOWANCE_SHARE as IS, handoffFileMissingFrame as I_, parseFedimintRequestPayload as Ia, CONTACT_LINK_BYTES as Ib, generateVapidKeys as Ic, RELAY_URL as Id, EDIT_FRAME as If, isEmptyLinkPacket as Ig, HttpClient as Ih, PaymentPreflightError as Ii, WAKE_SESSION_CAPABILITY as Il, verifyCommit as Im, SSHSIG_MAX_ARMOR as In, readGroupWantNo as Io, wireReply as Ip, encodeDagCbor as Ir, TYPING_FRAME as Is, GROUP_WAKE_RECEIVE_LIMIT as It, IDENTITY_CLOCK_SKEW as Iu, enrollHelloFrame as Iv, TURN_RAISE_READ_TIMEOUT_MS as Ix, APP_BUNDLE_MAGIC as Iy, GROUP_TYPING_FRAME as J, stripHidden as JC, TURN_SOURCE_TIMEOUT_MS as JS, handoffVerifiedMessage as J_, GhostLink as Ja, readDeviceInvite as Jb, appRangeEndFrame as Jc, DHT_MESSAGE_TTL as Jd, parseEditedFrame as Jf, servicesToWire as Jg, LIMITS as Jh, validatePaymentTarget as Ji, isHoldUrl as Jl, sealPair as Jm, isLegacySignature as Jn, readGroupSignal as Jo, TASK_STATUSES as Jp, DID_JWS_ALGS as Jr, sanitizeTypingStatus as Js, frameBytes as Jt, IdentityCheckUnavailable as Ju, REOPEN_BELOW as Jv, TURN_NAME_BYTES as Jx, checkAppManifest as Jy, readAppStoreSteps as K, sanitizeDisplayText as KC, SLOW_DEMOTE_MS as KS, handoffStreamKey as K_, EARLY_DIAL_JOIN_MS as Ka, deviceInviteJoinerParams as Kb, appRangeChunk as Kc, DHT_FILE_REFUSED as Kd, editedFrame as Kf, serviceIdFromName as Kg, CHUNK_FLAG_END as Kh, isWalletNetwork as Ki, HoldKeys as Kl, openPair as Km, sshSignCommand as Kn, SIGNAL_REPLY_MS as Ko, RUN_RESULTS as Kp, DID_FILE_MAX_BYTES as Kr, parseTypingActivity as Ks, asWritten as Kt, IDENTITY_STATEMENT_PREFIX as Ku, MAX_WAITING as Kv, TURN_LAST_SEQUENCE as Kx, assembleAppBundle as Ky, appUpdateDecision as L, generateEncryptionKey as LC, HEDGE_MISSING_MS as LS, handoffFileRequestFrame as L_, ANSWERS_REFUSED_PAUSES as La, CONTACT_LINK_VERSION as Lb, pushRequest as Lc, TRANSPORTS as Ld, EDIT_RATE_WINDOW_MS as Lf, parseLinkRecords as Lg, HttpHost as Lh, SEPOLIA_TEST_USDT as Li, parseSessionCapabilities as Ll, verifyCommitSignature as Lm, SSHSIG_NAMESPACE as Ln, CARRIED_DEFER_MS as Lo, ACTIVE_TASK_STATUSES as Lp, findInMst as Lr, TYPING_KINDS as Ls, GroupWakeLimiter as Lt, IDENTITY_FRAME_LIMIT as Lu, enrollMessage as Lv, TURN_SETTLE_MS as Lx, APP_CLIENTS as Ly, readX401ProofResultHeader as M, publicKeyFromZ32 as MC, GROUP_BURST_MS as MS, handoffDataFrame as M_, fedimintRequestPayload as Ma, readImageMeta as Mb, WebPushError as Mc, ringEvidence as Md, parseVideoMeta as Mf, MAX_MSGS_PAYLOAD_B64 as Mg, countUnusedInvite as Mh, signDidDhtPacket as Mi, STATUS_CARD_CAPABILITY as Ml, rosterHas as Mm, parseGroupMetaTag as Mn, isGroupMessageId as Mo, groupReplyAuthor as Mp, AtprotoProofError as Mr, encodeFileData as Ms, GROUP_WAKE_FRAME as Mt, encodePacketTransports as Mu, enrollCancelReason as Mv, verifyDeviceTransports as Mx, requestRecords as My, x401AnswerableRequests as N, sign as NC, GROUP_BURST_ONE_LINK as NS, handoffDigest as N_, findEndpoint as Na, canonicalJson as Nb, checkPushEndpoint as Nc, validRingKey as Nd, EDITED_FRAME as Nf, RECORD_TTL as Ng, presenceSeenAt as Nh, ETHEREUM_USDT as Ni, SessionCapabilities as Nl, signCommit as Nm, signGroupMeta as Nn, readGroupFileMeta as No, pairedReplyAuthor as Np, atprotoCidFor as Nr, refusalText as Ns, GROUP_WAKE_GROUP_LIMIT as Nt, parsePacketTransports as Nu, enrollDigits as Nv, seedSigner as Nx, seenEntry as Ny, readX401ProofRequestHeader as O, IDENTITY_MEMO_SIZE as OC, CHAT_WATCH_SHARE as OS, handoffBusyFrame as O_, decodeBolt11 as Oa, imageSize as Ob, wakeFrame as Oc, verifyPeerProof as Od, VIDEO_LIMITS as Of, sdpHasCandidates as Og, TRANSPORTS_GONE_MS as Oh, encodeDidDhtPacket as Oi, PIN_CAPABILITY as Ol, expectedRoster as Om, openGroupMeta as On, GROUP_WANT_FRAME as Oo, wireReaction as Op, normalizeAtprotoHandle as Or, FILE_FRAMES as Os, knockIdentity as Ot, DHT_TEXT_CAPABILITY as Ou, ENROLL_GRANT as Ov, devicePingFrame as Ox, openRequest as Oy, addedAppPermissions as P, verify as PC, GROUP_OVER_PACE_MS as PS, handoffDoneFrame as P_, isFederationId as Pa, canonicalJsonBytes as Pb, decryptPushPayload as Pc, verifyRingAuthorization as Pd, EDIT_BUFFER_MAX as Pf, buildLinkRecords as Pg, unusedInviteWait as Ph, EVM_TEST_CHAINS as Pi, TYPING_CAPABILITY as Pl, sortRoster as Pm, verifyGroupMetaSignature as Pn, readGroupHave as Po, readReply as Pp, decodeAtprotoCommit as Pr, transferEnded as Ps, GROUP_WAKE_GROUP_WINDOW_MS as Pt, IDENTITY_CHALLENGE_WINDOW as Pu, enrollDoneFrame as Pv, webCryptoSigner as Px, stampHolds as Py, sealGroupTyping as Q, concatBytes as QC, currentRelays as QS, openHandoffPiece as Q_, LIVENESS_MISSED_PINGS as Qa, INVITE_MAX_LENGTH as Qb, encodeAppRangeData as Qc, LIVE_POLL_MS as Qd, LINK_MAX_CHARS as Qf, HANDOFF_BUSY as Qg, decodeControl as Qh, isSparkAddress as Qi, DNS_TYPE as Ql, CONNECT_TIMEOUT_MS as Qm, MessageRefusal as Qn, mayBeHub as Qo, cardLine as Qp, DidError as Qr, COMMUNITY_PIN_FRAME as Qs, GROUP_EDIT_TEXT_BYTES as Qt, identityPresentationBytes as Qu, newInbox as Qv, TURN_SIGNED_BYTES as Qx, isAppUrl as Qy, checkAppBeforeRun as R, sealedLength as RC, HEDGE_MS as RS, handoffHaveFrames as R_, ANSWERS_REFUSED_PAUSE_MS as Ra, createContactLink as Rb, vapidAuthorization as Rc, automaticTransport as Rd, EDIT_RECEIVE_LIMIT as Rf, HTTP_SERVICE_PROTO as Rg, formatLocalTarget as Rh, SEPOLIA_TEST_USDT_FAUCET as Ri, sessionCapabilitiesFrame as Rl, GROUP_PROFILE as Rm, SSH_KEY_TYPES as Rn, CarriedTransport as Ro, BUTTON_ID as Rp, parseAtprotoCar as Rr, TYPING_RATE_LIMIT as Rs, groupWakeFrame as Rt, IDENTITY_FRAME_WINDOW_MS as Ru, enrollProofFrame as Rv, TURN_VISIBLE_MS as Rx, APP_CLIENT_NAME as Ry, buildX401ResultArtifact as S, readOwnRelayPayload as SC, turnVerifierMark as SS, filePartDigest as S_, parseInvoiceCallback as Sa, signAppObject as Sb, deviceWakeRequest as Sc, proofStatement as Sd, voiceDownloadName as Sf, extractParamsFromSdp as Sg, OFFER_STEP_MAX as Sh, decodeDidDhtPacket as Si, BUTTONS_CAPABILITY as Sl, MAX_GROUP_MEMBERS as Sm, groupMetaPicture as Sn, engineText as So, reactionEmoji as Sp, ATPROTO_PROOF_SCOPE as Sr, MAX_PAIRED_CALL_SIGNAL as Ss, KNOCK_TTL_MS as St, CAPS_LIMITS as Su, signTombstone as Sv, deviceKeyZ32 as Sx, knockSlotOf as Sy, encodeX401Header as T, decodeTxtPacket as TC, CHAT_RESERVE as TS, handoffAttemptAllowed as T_, requestLnurlInvoice as Ta, verifyAppSignature as Tb, readWake as Tc, storageProofPath as Td, voiceLevelsOf as Tf, keepsToRelays as Tg, RELAY_POLL_INTERVALS as Th, didDhtKey as Ti, FILES_BINARY_CAPABILITY as Tl, SAID_AGAIN as Tm, groupName as Tn, GROUP_FILE_LIMITS as To, readDhtReactions as Tp, atprotoProofRkey as Tr, parsePairedCallFrame as Ts, encodeGroupEntryLink as Tt, CapsExchange as Tu, ENROLL_CANCEL as Tv, deviceLinkRendezvousSeed as Tx, makeStamp as Ty, checkAppStoreIndex as U, sanitizeAvatar as UC, RelaysFailedError as US, handoffReleaseFrame as U_, DEMOTE_AFTER_FAILURES as Ua, DEVICE_INVITE_OWN_DEVICE as Ub, APP_RANGE_LIMITS as Uc, relayedTransports as Ud, RateWindow as Uf, encodeServices as Ug, sanitizeResponseHeaders as Uh, assertTokenUnits as Ui, HOLD_CAPABILITY as Ul, encryptText as Um, sameSshKey as Un, SIGNAL_FRESH_MS as Uo, PR_STATES as Up, verifyAtprotoRecordProof as Ur, TYPING_TIMEOUT_MS as Us, GROUP_REACTED_FRAME as Ut, IDENTITY_PROOF_CAPABILITY as Uu, FLOOD_PER_DAY as Uv, TOMBSTONE_TURN as Ux, APP_VIEWS as Uy, APP_STORE_LIMITS as V, MAX_AVATAR_SIDE as VC, REQUESTS_PER_MINUTE as VS, handoffOfferFrame as V_, CROSSED_PROBE_MS as Va, DEVICE_INVITE_BYTES as Vb, APP_RANGE_ERRORS as Vc, irohRelayUrl as Vd, MAX_REMOVAL_NUMBER as Vf, SERVICES_VERSION as Vg, resolveTargetUrl as Vh, WALLET_NETWORKS as Vi, SESSION_FRAME_MAX as Vl, decryptText as Vm, parseSshPublicKey as Vn, SIGNALS_PER_MINUTE as Vo, ITEM_STATES as Vp, readAtprotoCid as Vr, TYPING_SEND_LIMIT as Vs, parseGroupWakeFrame as Vt, IDENTITY_MAX_RECEIVED as Vu, readEnrollHello as Vv, turnPutSummary as Vx, APP_PERMISSIONS as Vy, readAppListing as W, MAX_NICK_LENGTH as WC, SIGNALING_ALLOWANCE_SHARE as WS, handoffRequestFrame as W_, DEMOTE_MS as Wa, createDeviceInvite as Wb, AppRanges as Wc, transportOrder as Wd, dhtEditId as Wf, isValidServiceId as Wg, viewerResponseHeaders as Wh, assertWholeSats as Wi, HOLD_DATED_BACK_MS as Wl, epochKeys as Wm, sshFingerprint as Wn, SIGNAL_HOLD_MS as Wo, REMOVABLE_KINDS as Wp, verifyAtprotoSignature as Wr, TypingReceiver as Ws, GROUP_READ_NOTE as Wt, IDENTITY_PROVIDER_ID as Wu, MAX_DONE as Wv, TURN_BODY_BYTES as Wx, appDigest as Wy, groupTypingEpoch as X, unwrapPasted as XC, WAY_BACK_SHARE as XS, isHandoffPartName as X_, INVITER_DIAL_GRACE_MS as Xa, INVITE_HRP as Xb, appRangeGetFrame as Xc, DHT_TEXT_REFUSED as Xd, validEditNumber as Xf, HANDOFF_ACK as Xg, PROTOCOL_VERSION as Xh, SPARK_NETWORKS as Xi, readManifest as Xl, sha256Hex as Xm, verifyBitcoinMessage as Xn, MESH_HUBS as Xo, buttonLabelClash as Xp, DID_MAX_LENGTH as Xr, typingFrame as Xs, COMMUNITY_EDIT_FRAME as Xt, boundVerifiedIdentity as Xu, endedRequests as Xv, TURN_REV_LIMIT as Xx, isAppLicense as Xy, GroupTypingBoard as Y, trimEndOf as YC, WATCH_SHARE as YS, handoffVersions as Y_, HANDLED_WAIT_MS as Ya, DEVICE_INVITE_VERSION as Yb, appRangeErrorFrame as Yc, DHT_TEXT_BYTES as Yd, validEditMessage as Yf, viewerTag as Yg, MAX_CHUNK_PAYLOAD_BYTES as Yh, walletNetworkOf as Yi, newMailbox as Yl, sealSecret as Ym, legacyMessageHash as Yn, GROUP_VERSION_HUBS as Yo, appCardId as Yp, DID_JWS_MAX_LENGTH as Yr, typingActivity as Ys, groupMessageId as Yt, IdentityExchange as Yu, clearMissed as Yv, TURN_NO_ACTIVE as Yx, findAppForbiddenKey as Yy, openGroupTyping as Z, bytesEqual as ZC, WRITE_FIRST_MS as ZS, newHandoffId as Z_, INVITE_TAKEN as Za, INVITE_LINK_ORIGIN as Zb, decodeAppRangeData as Zc, DhtDelivery as Zd, validRemovalNumber as Zf, HANDOFF_ATTEMPTS as Zg, decodeChunk as Zh, SPARK_PROVIDER as Zi, DNS_LABEL as Zl, ANSWER_REFUSED_REDIALS as Zm, BIP322_REVISION as Zn, NO_HUB_POLICY as Zo, cardEditNumber as Zp, DID_METHODS as Zr, typingKindOf as Zs, GROUP_EDIT_FRAME as Zt, emptyIdentityLedger as Zu, inboxRecord as Zv, TURN_SEALED_BYTES as Zx, isAppPath as Zy, X401_PROTOCOLS as _, createRelayPayload as _C, turnPayloadSequence as _S, HANDOFF_TIMINGS as __, LIGHTNING_DESTINATION_PATTERN as _a, readAppRevocation as _b, WAKE_FRAME as _c, importedProof as _d, fileMessageText as _f, callRtcConfig as _g, IDLE_THRESHOLD as _h, DID_DHT_MAX_PAYLOAD as _i, isChatAppId as _l, GROUP_ID as _m, encodeGroupMetaBody as _n, parsePaymentNetworks as _o, nextReactionNumber as _p, u64 as _r, readBeacon as _s, shortHash as _t, txtValue as _u, encodeSetSlots as _v, ENROLL_CAPABILITY as _x, STAMP_BITS_MAX as _y, X401_DCQL_LIMITS as a, BREAKER_MAX_MS as aC, nextTurnPosition as aS, HANDOFF_FILE_REQUEST as a_, PUBKY_PROOF_ROOT as aa, APP_PREFIXES as ab, nextPinNumber as ac, revokesIdentity as ad, FileTransfers as af, RTC_SIGNAL_FUTURE_MS as ag, STALLED_EVIDENCE_MS as ah, didWebFile as ai, APP_RATE_LIMIT as al, sameButtonText as am, MENTION_EVERYONE as an, RACE_ANSWERED_MS as ao, sanitizePreviewImage as ap, ByteReader as ar, beaconKeys as as, communityHasFrame as at, decodeDnsResponse as au, readHandoffHave as av, toBase64Url as aw, encodeInviteCode as ax, KNOCK_SLOTS as ay, buildX401ProofRequest as b, openRelayPayload as bC, turnSignedMessage as bS, HANDOFF_WINDOW as b_, findLightningDestination as ba, readAppSignature as bb, WAKE_TTL_SECONDS as bc, proofCapability as bd, parseVoiceMeta as bf, contactRtcConfig as bg, OFFER_FAST_MS as bh, DID_DHT_VERSION as bi, APPS_CAPABILITY as bl, LEGACY_GROUP_MEMBERS as bm, groupMetaChange as bn, EngineError as bo, queueReaction as bp, ATPROTO_FULL_SCOPE as br, shouldBeHub as bs, verifyCommunityCommit as bt, CAPS_ISSUED_BACK_MS as bu, setUpdateFrame as bv, deviceEchoNonce as bx, knockHolds as by, readX401DcqlQuery as c, DiscoveryBudgetError as cC, readTurnPacket as cS, HANDOFF_LATER_BYTES as c_, newPubkyProofFolder as ca, appRef as cb, pinFrame as cc, IDENTITY_TIMELINE_MAX as cd, safeBlobType as cf, extractRtcParams as cg, DIRECT_PEERS as ch, didWebHost as ci, APP_SEND_LIMIT as cl, taskProgress as cm, mentionsMember as cn, REDESCRIBED_GRACE_MS as co, forwardedMany as cp, decodeBitcoinAddress as cr, freshHubs as cs, communityUntaggedHash as ct, domainWellKnownFile as cu, readHandoffPake as cv, utf8Encode as cw, inviteQrSegments as cx, MAX_SEEN as cy, newX401HolderKey as d, isDiscoveryBudgetError as dC, signTurnPacket as dS, HANDOFF_OFFER as d_, pubkyProofFile as da, appSignedBytes as db, pinnedFrame as dc, PROOF_ADAPTERS as dd, PLAYABLE_AUDIO as df, CALL_SIGNAL_FUTURE_MS as dg, symmetricNat as dh, parseDidDocument as di, appCloseFrame as dl, arrivalKey as dm, GROUP_META_PAST as dn, SWITCH_RETIRE_MS as do, GROUP_REACTION_FRAME as dp, encodeTx as dr, lobbyRecords as ds, encodeCommunityLink as dt, nip05RootKey as du, readHandoffVerified as dv, __exportAll as dw, pastedAgain as dx, REQUEST_LABEL as dy, readRelayBody as eC, TURN_TTL as eS, HANDOFF_CANCEL as e_, sparkInvoiceDetails as ea, readAppBundle as eb, PINNED_FRAME as ec, identityStatement as ed, peekDhtMailbox as ef, encodeControl as eg, DataLink as eh, checkDidSignature as ei, parseAppRangeFrame as el, cardTimeUtc as em, communityEditFrame as en, MAX_PAIRED_MESSAGE_FRAME as eo, canonicalUrl as ep, bip322ToSign as er, meshRendezvous as es, COMMUNITY_PROFILE as et, DOMAIN_MAX_RECORDS as eu, readHandoffBusy as ev, fromBase64Url as ew, OwnInviteError as ex, settleRequest as ey, readX401SdJwtVc as f, withRequestOptions as fC, signTurnRelease as fS, HANDOFF_PAKE as f_, pubkyProofPath as fa, checkAppRevokeStatement as fb, readPin as fc, PROOF_CAPABILITY as fd, RECORDING_TYPES as ff, CALL_SIGNAL_MAX_AGE_MS as fg, AWAITING_PEER_MS as fh, parseDidJws as fi, appDataBytes as fl, claimedTime as fm, GROUP_META_PAST_CHARS as fn, UNPROVEN_AUTH_MS as fo, QUICK_REACTIONS as fp, encodeWitness as fr, mergeBeacon as fs, leaveStands as ft, normalizeDomain as fu, sameDigest as fv, __require as fw, readInviteCode as fx, REQUEST_LIFETIME_MS as fy, X401_LIMITS as g, RELAY_PAYLOAD_MAX_BYTES as gC, turnPacket as gS, HANDOFF_REQUEST as g_, pubkyHomeserverOf as ga, isAppSignature as gb, WAKE_CALL_WAIT_MS as gc, emptyProofLedger as gd, downsamplePeaks as gf, buildSdpFromSignal as gg, FIRST_PUBLISH_MAX_MS as gh, strictBase64Url as gi, isAppVersion as gl, GROUP_ADMIN_OFF_ERROR as gm, MAX_GROUP_PICTURE_LENGTH as gn, pairedMessageFrame as go, ReactionWindow as gp, u32$1 as gr, rankHubs as gs, rosterHash as gt, recordsName as gu, SET_UPDATE as gv, DEVICE_PING_FRAME as gx, STAMP_BITS_DEFAULT as gy, X401_HEADERS as h, PacketTooLargeError as hC, turnName as hS, HANDOFF_RELEASE as h_, homeserverWebEndpoint as ha, isAppRef as hb, WAKE_CALL_TTL_SECONDS as hc, STORAGE_ROOT as hd, baseMime as hf, answersOffer as hg, EXPECT_PEER_MS as hh, staticDidDocument as hi, chatAppId as hl, shownTime as hm, MAX_GROUP_NAME_LENGTH as hn, pairedMessageFits as ho, REACTION_LIMITS as hp, txHash as hr, pickHubs as hs, leftStatement as ht, recordsFromWellKnown as hu, SET_ACK as hv, DEVICE_ECHO_FRAME as hx, REQUEST_TEXT_BYTES as hy, x401ApprovalDigest as i, BREAKER_BASE_MS as iC, firstDeviceSetSecret as iS, HANDOFF_FILE_MISSING as i_, PUBKY_PROOF_MAX_BYTES as ia, APP_NAME as ib, mayPin as ic, receivedIdentityStatus as id, readDhtFile as if, DATA_CHANNEL_LABEL as ig, REANSWERS as ih, didWebDocumentUrl as ii, APP_PEER_OPEN_MAX as il, removedCardText as im, validEditText as in, PONG_WAIT_MS as io, previewImageSize as ip, BitcoinAddressError as ir, COMMUNITY_TOPOLOGY as is, communityGroupId as it, WELL_KNOWN_PATH as iu, readHandoffFileFrame as iv, toBase64 as iw, encodeGhostlyInvite as ix, ContactRequestError as iy, readX401ProofResult as j, identityFromSeedB64 as jC, FRESH_READ_MS as jS, handoffContextProof as j_, cashuRequestPayload as ja, previewable as jb, PUSH_SERVICE_HOSTS as jc, ringClaims as jd, isVideoMime as jf, LABEL$1 as jg, WATCH_PEER_MS as jh, resolveDidDht as ji, SESSION_CAPABILITIES_FRAME as jl, rosterAdmin as jm, parseGroupMetaStatement as jn, groupFileFallback as jo, REPLY_LIMITS as jp, AtprotoCid as jr, decodeFileData as js, readKnocks as jt, emptyCapsState as ju, enrollCancelFrame as jv, unsignedDeviceTransports as jx, requestPlaintextBytes as jy, readX401ProofResponse as k, createIdentity as kC, DEFAULT_RELAYS as kS, handoffCancelFrame as k_, findBolt11 as ka, isImageMime as kb, wakePayload as kc, RING_LIFETIME as kd, formatVideoDuration as kf, signalHasVideo as kg, UNUSED_INVITE_READS_PER_MINUTE as kh, jwkThumbprint as ki, REACTIONS_CAPABILITY as kl, parseGroupCommit as km, parseGroupMetaBody as kn, GROUP_WANT_NO_FRAME as ko, PAIRED_REPLY_AUTHORS as kp, parseAtprotoDidDocument as kr, FILE_LIMITS as ks, knockRecords as kt, capsDescriptors as ku, ENROLL_HELLO as kv, newDeviceSetSecret as kx, readKnockSlot as ky, x401VpToken as l, budgetRetryMs as lC, sealTurnBody as lS, HANDOFF_LIST_PER_FRAME as l_, normalizePubkyKey as la, appRefPublisher as lb, pinIsNewer as lc, applyIdentityEvent as ld, sanitizeFileName as lf, offerIsFresh as lg, DirectPathWatch as lh, normalizeDid as li, APP_VERSION_MAX as ll, usageLeft as lm, validMentions as ln, RESUME_WAIT_MS as lo, readForwarded as lp, decodeTx as lr, hubRank as ls, decodeCommunityLink as lt, encodeDnsQuery as lu, readHandoffRelease as lv, __commonJSMin as lw, inviteQrText as lx, MAX_SLOT_KNOCKS as ly, x401HolderJwk as m, PKARR_FUTURE_SKEW_MS as mC, turnKeys as mS, HANDOFF_PIECE_OVERHEAD as m_, encodeSvcbPacket as ma, isAppKey as mb, WAKE_CALL_INTERVAL_MS as mc, STORAGE_LIFETIME as md, VOICE_METER as mf, RTC_CONFIG as mg, DHT_POLL_INTERVALS as mh, signingKeys as mi, appOpenFrame as ml, receivedTimestamp as mm, MAX_GROUP_NAME_BYTES as mn, WAKE_LOST_MS as mo, REACTION_FRAME as mp, sha256d as mr, newerHead as ms, leaveStatement3 as mt, recordsFromTxt as mu, sortParts as mv, DEVICE_CAPABILITIES as mx, REQUEST_PACKET_BYTES as my, X401_RESPONSE_MODES as n, traceLink as nC, TurnRecordError as nS, HANDOFF_DATA as n_, BITCOIN_NETWORKS as na, sha256Paced as nb, PIN_FRAME as nc, isIdentityBinding as nd, dhtFileElements as nf, wrapDataChannel as ng, GATHER_STALL_MS as nh, didJwsAlg as ni, APP_DATA_MAX_BYTES as nl, checkStatusCard as nm, meshMessageRef as nn, PAIRING_ATTEMPT_MS as no, linksIn as np, decodeBase64 as nr, pickMeshHubs as ns, GROUP_READ_NOTE_COMMUNITY as nt, DOMAIN_TXT_MAX_BYTES as nu, readHandoffData as nv, isZ32Key as nw, createLink as nx, turnOff as ny, matchX401Dcql as o, BREAKER_THRESHOLD as oC, openTurnValue as oS, HANDOFF_HAVE as o_, isPubkyKey as oa, APP_STATEMENT_LIMITS as ob, parsePinFrame as oc, signIdentityPresentation as od, PREVIEWABLE_IMAGE as of, RTC_SIGNAL_MAX_AGE_MS as og, DIRECT_EVIDENCE_MS as oh, didWebFileNames as oi, APP_RATE_WINDOW_MS as ol, statusCardBytes as om, MENTION_LIMITS as on, RACE_DIRECT_MS as oo, FORWARD_LIMITS as op, compactSize as or, beaconRecords as os, communityMessageId as ot, dnsProofName as ou, readHandoffHello as ov, toZ32 as ow, inviteLink as ox, KNOCK_SLOT_LABEL as oy, sameX401HolderJwk as p, MAX_DNS_PACKET_BYTES as pC, turnInstance as pS, HANDOFF_PIECE_BYTES as p_, decodeSvcbRecords as pa, isAppHash as pb, DEVICE_WAKE_TTL_SECONDS as pc, PeerProofs as pd, VOICE_LIMITS as pf, PAIRED_CALL_CANDIDATES as pg, DEPARTED_READ_MS as ph, parseDidSignaturePaste as pi, appDataFrame as pl, heardTime as pm, MAX_GROUP_META_BODY as pn, WAKE_ANSWER_GRACE_MS as po, REACTED_FRAME as pp, hash160 as pr, mergeLobby as ps, leaveStatement as pt, parseDomainTxt as pu, sealHandoffPiece as pv, __toCommonJS as pw, DEVICES_CAPABILITY as px, REQUEST_NAME_UNITS as py, signAppStore as q, sanitizeNick as qC, SLOW_MS as qS, handoffVerifiedFrame as q_, FIRST_PAIRING_PACE_MS as qa, encodeDeviceInvite as qb, appRangeDataFrame as qc, DHT_FILE_TOO_LARGE as qd, parseEditFrame as qf, servicesFromWire as qg, CHUNK_KIND as qh, parsePaymentAmount as qi, HoldRefusedError as ql, openSecret as qm, verifySshSignature as qn, groupSignalFrame as qo, STATUS_CARD_LIMITS as qp, DID_GHOSTLY_SERVICE as qr, parseTypingFrame as qs, chainPieces as qt, IDENTITY_SUBJECT as qu, NEW_PER_HOUR as qv, TURN_MAX as qx, buildAppBundle as qy, readX401OpenId4VpRequest as r, BREAKER_ALL_DOWN_PROBE_MS as rC, encodeTurnFields as rS, HANDOFF_DONE as r_, isBitcoinAddress as ra, yieldThread as rb, PIN_LIMITS as rc, newIdentityBinding as rd, dhtFileId as rf, DATA_CHANNEL_ID as rg, OFFER_HOST_GATHER_MS as rh, didSignedMessages as ri, APP_FRAME as rl, readStatusCard as rm, parseCommunityEdit as rn, PAIRING_RETRY_MS as ro, parseLinkPreview as rp, verifyBip322 as rr, wireHubPolicy as rs, communityCommitHash as rt, NIP05_PATH as ru, readHandoffDone as rv, randomBytes as rw, decodeInviteCode as rx, CONTACT_RECORD_TTL as ry, presentX401SdJwtVc as s, RelayBreaker as sC, readTurnBody as sS, HANDOFF_HELLO as s_, isPubkyProofFolder as sa, appFingerprint as sb, parsePinnedFrame as sc, verifyIdentityPresentation as sd, formatFileSize as sf, buildDataSdp as sg, DIRECT_OWN_ATTEMPTS as sh, didWebFileUrl as si, APP_RESUME_GRACE_MS as sl, statusCardText as sm, mentionsBytes as sn, RACE_RELAYED_MS as so, forwardedAgain as sp, decodeAnyBitcoinAddress as sr, doorHubs as ss, communityRoster as st, domainTxtRecord as su, readHandoffManifest as sv, utf8Decode as sw, inviteOwnership as sx, LINK_RECORD_LABEL as sy, X401_REQUEST_LIMITS as t, setLinkTraceSink as tC, TURN_VERSION as tS, HANDOFF_CANCEL_REASONS as t_, sparkNetworkOf as ta, readAppBundleAsync as tb, PIN_CLOCK_SKEW_MS as tc, identityStatementText as td, DHT_FILE_CAPABILITY as tf, sendBody as tg, GATHER_ATTEMPTS as th, didGhostlyServiceEntry as ti, readAppRangeFrame as tl, cardUrl as tm, communityMessageAuthor as tn, PAIRED_FRAME_TOO_LARGE as to, linkEnd as tp, bip322ToSpend as tr, parseHubPolicy as ts, CommunitySession as tt, DOMAIN_METHODS as tu, readHandoffCancel as tv, fromZ32 as tw, createChatInvite as tx, takeRequest as ty, X401_CREDENTIAL_LIMITS as u, heldBackError as uC, signTurnBody as uS, HANDOFF_MANIFEST as u_, pubkyProofCapability as ua, appRevocationId as ub, pinNumberHolds as uc, lastSharedWithMe as ud, sanitizeMime as uf, parseRtcSignal as ug, directBlocked as uh, parseDid as ui, AppSessions as ul, MESSAGE_CLOCK_SKEW_MS as um, wireMentions as un, RTC_UNSTARTED_MS as uo, COMMUNITY_REACTION_FRAME as up, decodeWitness as ur, lobbyKeys as us, derivedSecret as ut, isPublicAddress as uu, readHandoffTurnFrame as uv, __esmMin as uw, ownInviteRefusal as ux, REQUEST_CLOCK_SKEW_MS as uy, X401_SCHEME as v, measureRecords as vC, turnReleaseMessage as vS, HANDOFF_VERIFIED as v_, LNURL_LIMITS as va, readAppRevocationShape as vb, WAKE_INTERVAL_MS as vc, isProofAdapter as vd, formatVoiceDuration as vf, callSignalHeardAt as vg, LinkSession as vh, DID_DHT_PREFIX as vi, parseAppFrame as vl, GROUP_MEMBER_CAP as vm, groupDisplayName as vn, publishFailure as vo, parseReactedFrame as vp, varBytes as vr, readBeaconHead as vs, signCommunity as vt, validDomainRecord as vu, readSetUpdate as vv, HANDOFF_CAPABILITY as vx, STAMP_BITS_MIN as vy, decodeX401Header as w, decodeDnsAnswers as wC, BACKGROUND_WHILE_SIGNALING as wS, handoffAckFrame as w_, parsePayParams as wa, verifyAppRevocation as wb, parseWakeFrame as wc, storageProofBody as wd, voiceLevel as wf, isGlobalIpv4Host as wg, PRESENCE_WINDOW as wh, didDhtFromPublicKey as wi, EDIT_CAPABILITY as wl, OWN_FRAME_LIMIT as wm, groupMetaToHand as wn, PairingTracker as wo, reactionIsNewer as wp, atprotoProofRecord as wr, PairedCalls as ws, decodeGroupEntryLink as wt, CAPS_REFRESH_MS as wu, DEVICE_KINDS as wv, deviceLinkParams as wx, linkRecords as wy, buildX401ProofResult as x, parseRelayPayload as xC, turnStatedVerifier as xS, NO_ATTEMPTS as x_, invoiceCallbackUrl as xa, setAppSignatureFastPath as xb, WakeLimiter as xc, proofHash as xd, recordingMime as xf, decompressSdp as xg, OFFER_LOOK_MS as xh, DidDhtError as xi, APP_RANGES_CAPABILITY as xl, MAX_GROUP_CHAIN as xm, groupMetaNewer as xn, engineError as xo, reactedFrame as xp, ATPROTO_PROOF_COLLECTION as xr, validHead as xs, GROUP_ENTRY_PROFILE as xt, CAPS_LABEL as xu, setUpdateMessage as xv, deviceFrameCapability as xx, knockSlotIdentity as xy, X401_VERSION as y, newerPacket as yC, turnSequence as yS, HANDOFF_VERSION as y_, fetchLnurlJson as ya, readAppRevocations as yb, WAKE_SUBJECT as yc, nostrProofTemplate as yd, isPlayableAudioType as yf, compressSdp as yg, MAX_DHT_TEXT_BYTES as yh, DID_DHT_TTL as yi, readAppFrame as yl, GROUP_VERSION_LARGE as ym, groupMetaBody as yn, ENGINE_ERRORS as yo, parseReactionFrame as yp, ATPROTO_DECLARED_SCOPE as yr, readLobby as ys, verifyCommunityChain as yt, wellKnownUrl as yu, setAckFrame as yv, deviceEchoFrame as yx, contactDay as yy, planAppUpdate as z, tryDecrypt as zC, PREVIOUS_DEFAULT_RELAYS as zS, handoffHelloFrame as z_, BLOCKED_DIAL_WAIT_MS as za, encodeContactLink as zb, vapidKeysMatch as zc, checkedDescriptors as zd, EDIT_SEND_LIMIT as zf, LEGACY_SERVICES as zg, parseLocalTarget as zh, TEST_USDT_FAUCET_AMOUNT as zi, PAIRED_PROFILE as zl, confirmationMatches as zm, SSH_PUBLIC_KEY_MAX as zn, GROUP_SIGNAL_FRAME as zo, BUTTON_STYLES as zp, parseAtprotoDidKey as zr, TYPING_RATE_WINDOW_MS as zs, groupWakes as zt, IDENTITY_MAX_EVIDENCE as zu, formatEnrollDigits as zv, classifyTurnRead as zx, APP_FORBIDDEN_KEYS as zy };
36547
+ export { COMMUNITY_LIMITS as $, bytesEqual as $C, WRITE_FIRST_MS as $S, newHandoffId as $_, LIVENESS_PING_MS as $a, INVITE_LINK_ORIGIN as $b, isServeId as $c, emptyDhtDeliveryState as $d, LINK_PREVIEW_LIMITS as $f, HANDOFF_ATTEMPTS as $g, decodeChunk as $h, sparkAddressKind as $i, DOMAIN_FILE_MAX_BYTES as $l, ANSWER_REFUSED_REDIALS as $m, bip322MessageHash as $n, meshHubs as $o, cardEditNumber as $p, checkDidJws as $r, GROUP_PIN_FRAME as $s, carryMentions as $t, identityRevocationValue as $u, inboxRecord as $v, TURN_SEALED_BYTES as $x, isAppPath as $y, readX401ProofResponseHeader as A, IDENTITY_MEMO_SIZE as AC, CHAT_WATCH_SHARE as AS, handoffBusyFrame as A_, ENDPOINT as Aa, imageSize as Ab, wakeRequest as Ac, ringAuthorization as Ad, isPlayableVideoType as Af, sdpHasCandidates as Ag, TRANSPORTS_GONE_MS as Ah, openDidDhtPayload as Ai, SERVICES_CAPABILITY as Al, expectedRoster as Am, parseGroupMetaFrame as An, fetchesByItself as Ao, wireReaction as Ap, shortAtprotoDid as Ar, FileUplink as As, mergeKnocks as At, dialDescriptors as Au, ENROLL_GRANT as Av, devicePingFrame as Ax, openRequest as Ay, APP_STORE_KINDS as B, sealedLength as BC, HEDGE_MS as BS, handoffHaveFrames as B_, CROSSED_FRESH_MS as Ba, createContactLink as Bb, APP_RANGE_DATA_KIND as Bc, irohDescriptor as Bd, MAX_EDITS_PER_MESSAGE as Bf, HTTP_SERVICE_PROTO as Bg, formatLocalTarget as Bh, USDT_PUBLIC_RPC as Bi, PairedSession as Bl, GROUP_PROFILE as Bm, SshSigError as Bn, GROUP_VERSION_SIGNALS as Bo, BUTTON_ID as Bp, parseAtprotoVerificationKey as Br, TYPING_REFRESH_MS as Bs, mentionedMembers as Bt, IDENTITY_MAX_FRAME as Bu, enrollProofFrame as Bv, TURN_VISIBLE_MS as Bx, APP_CLIENT_NAME as By, buildX401TokenObject as C, parseRelayPayload as CC, turnStatedVerifier as CS, NO_ATTEMPTS as C_, parseLightningDestination as Ca, setAppSignatureFastPath as Cb, newWakeToken as Cc, storageProof as Cd, voiceFileName as Cf, decompressSdp as Cg, OFFER_LOOK_MS as Ch, didDhtDocument as Ci, CALLS_CAPABILITY as Cl, MAX_GROUP_CHAIN as Cm, groupMetaTag as Cn, parseEngineError as Co, reactedFrame as Cp, atprotoDidMethod as Cr, PAIRED_CALL_FRAME as Cs, MAX_KNOCKS as Ct, CAPS_PUBLISH_SPACING_MS as Cu, setUpdateMessage as Cv, deviceFrameCapability as Cx, knockSlotIdentity as Cy, readX401ProofRequest as D, decodeTxtPacket as DC, CHAT_RESERVE as DS, handoffAttemptAllowed as D_, BOLT11_PATTERN as Da, verifyAppSignature as Db, relayRequest as Dc, verifyNostrProof as Dd, PLAYABLE_VIDEO as Df, keepsToRelays as Dg, RELAY_POLL_INTERVALS as Dh, encodeDidDhtDeactivated as Di, KNOWN_SESSION_CAPABILITIES as Dl, SAID_AGAIN as Dm, nextGroupMetaRevision as Dn, GROUP_VERSION_FILES as Do, readDhtReactions as Dp, isAtprotoDid as Dr, FILE_DATA_KIND as Ds, groupEntryUrl as Dt, CapsRefusedError as Du, ENROLL_CANCEL as Dv, deviceLinkRendezvousSeed as Dx, makeStamp as Dy, isX401Protocol as E, decodeDnsAnswers as EC, BACKGROUND_WHILE_SIGNALING as ES, handoffAckFrame as E_, resolveLightningDestination as Ea, verifyAppRevocation as Eb, readWakePayload as Ec, validExternalKey as Ed, voicePeaksOf as Ef, isGlobalIpv4Host as Eg, PRESENCE_WINDOW as Eh, didDhtRecords as Ei, FILES_CAPABILITY as El, OWN_FRAME_LIMIT as Em, keepPastGroupMeta as En, GROUP_HAVE_FRAME as Eo, reactionIsNewer as Ep, checkAtprotoProofRecord as Er, ChatFiles as Es, entryParams as Et, CapsKeys as Eu, DEVICE_KINDS as Ev, deviceLinkParams as Ex, linkRecords as Ey, appRevocationFor as F, sign as FC, GROUP_BURST_ONE_LINK as FS, handoffDigest as F_, parseCashuRequestPayload as Fa, canonicalJson as Fb, encryptPushPayload as Fc, verifyRingEvidence as Fd, EDIT_BUFFER_MS as Ff, RECORD_TTL as Fg, presenceSeenAt as Fh, ONCHAIN_PROVIDER as Fi, UPGRADE_CAPABILITY as Fl, signCommit as Fm, wrapGroupMeta as Fn, readGroupWant as Fo, pairedReplyAuthor as Fp, decodeDagCbor as Fr, transferStalled as Fs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ft, IDENTITY_CHECK_UNAVAILABLE as Fu, enrollDigits as Fv, seedSigner as Fx, seenEntry as Fy, readAppStore as G, sanitizeAvatar as GC, RelaysFailedError as GS, handoffReleaseFrame as G_, DHT_PIN_GRACE_MS as Ga, DEVICE_INVITE_OWN_DEVICE as Gb, appRangeCancelFrame as Gc, ACTIVE_DHT_POLL_MS as Gd, editFrame as Gf, encodeServices as Gg, sanitizeResponseHeaders as Gh, formatPaymentAmount as Gi, HOLD_LIMITS as Gl, encryptText as Gm, sshKeyDigestHex as Gn, SIGNAL_PROVEN_MS as Go, PR_STATES as Gp, DID_DOCUMENT_MAX_BYTES as Gr, TypingSender as Gs, GroupSession as Gt, IDENTITY_REVOCATION_LABEL as Gu, FLOOD_PER_DAY as Gv, TOMBSTONE_TURN as Gx, APP_VIEWS as Gy, checkAppListing as H, MAX_AVATAR_LENGTH as HC, RELAY_REQUESTS_PER_MINUTE as HS, handoffManifestFrames as H_, CROSSED_WAIT_MS as Ha, readContactLink as Hb, APP_RANGE_FRAMES as Hc, rankTransports as Hd, REMOVED_TEXT as Hf, MAX_SERVICES as Hg, relativizeLocation as Hh, arkAddressPrefix as Hi, SESSION_RECEIVE_PENDING as Hl, confirmationTag as Hm, parseSshSignature as Hn, SIGNAL_CARRIERS as Ho, CRON_LINE as Hp, unsignedCommitBytes as Hr, TYPING_STATUS_MAX as Hs, GROUP_LIMITS as Ht, IDENTITY_MAX_VALIDITY as Hu, readEnrollGrant as Hv, keptAtEqualSequence as Hx, APP_ICON_PATH as Hy, appStoreDecision as I, verify as IC, GROUP_OVER_PACE_MS as IS, handoffDoneFrame as I_, parseFedimintRequestPayload as Ia, canonicalJsonBytes as Ib, generateVapidKeys as Ic, RELAY_URL as Id, EDIT_FRAME as If, buildLinkRecords as Ig, unusedInviteWait as Ih, PaymentPreflightError as Ii, WAKE_SESSION_CAPABILITY as Il, sortRoster as Im, SSHSIG_MAX_ARMOR as In, readGroupWantNo as Io, readReply as Ip, encodeDagCbor as Ir, TYPING_FRAME as Is, GROUP_WAKE_RECEIVE_LIMIT as It, IDENTITY_CLOCK_SKEW as Iu, enrollDoneFrame as Iv, webCryptoSigner as Ix, stampHolds as Iy, GROUP_TYPING_FRAME as J, sanitizeDisplayText as JC, SLOW_DEMOTE_MS as JS, handoffStreamKey as J_, GhostLink as Ja, deviceInviteJoinerParams as Jb, appRangeEndFrame as Jc, DHT_MESSAGE_TTL as Jd, parseEditedFrame as Jf, serviceIdFromName as Jg, CHUNK_FLAG_END as Jh, validatePaymentTarget as Ji, isHoldUrl as Jl, openPair as Jm, isLegacySignature as Jn, readGroupSignal as Jo, RUN_RESULTS as Jp, DID_JWS_ALGS as Jr, sanitizeTypingStatus as Js, frameBytes as Jt, IdentityCheckUnavailable as Ju, MAX_WAITING as Jv, TURN_LAST_SEQUENCE as Jx, assembleAppBundle as Jy, readAppStoreSteps as K, MAX_NICK_LENGTH as KC, SIGNALING_ALLOWANCE_SHARE as KS, handoffRequestFrame as K_, EARLY_DIAL_JOIN_MS as Ka, createDeviceInvite as Kb, appRangeChunk as Kc, DHT_FILE_REFUSED as Kd, editedFrame as Kf, isValidServiceId as Kg, viewerResponseHeaders as Kh, isWalletNetwork as Ki, HoldKeys as Kl, epochKeys as Km, sshSignCommand as Kn, SIGNAL_REPLY_MS as Ko, REMOVABLE_KINDS as Kp, DID_FILE_MAX_BYTES as Kr, parseTypingActivity as Ks, asWritten as Kt, IDENTITY_STATEMENT_PREFIX as Ku, MAX_DONE as Kv, TURN_BODY_BYTES as Kx, appDigest as Ky, appUpdateDecision as L, decrypt as LC, GROUP_RATION_WINDOW_MS as LS, handoffEphemeral as L_, ANSWERS_REFUSED_PAUSES as La, readCanonicalJson as Lb, pushRequest as Lc, TRANSPORTS as Ld, EDIT_RATE_WINDOW_MS as Lf, emptyLinkRecords as Lg, GhostlyHttpError as Lh, SEPOLIA_TEST_USDT as Li, parseSessionCapabilities as Ll, verifyChain as Lm, SSHSIG_NAMESPACE as Ln, CARRIED_DEFER_MS as Lo, replySnippet as Lp, findInMst as Lr, TYPING_KINDS as Ls, GroupWakeLimiter as Lt, IDENTITY_FRAME_LIMIT as Lu, enrollGrantFrame as Lv, TURN_PUT_WINDOW_MS as Lx, APP_BUNDLE_LIMITS as Ly, readX401ProofResultHeader as M, identityFromSeed as MC, DEPARTED_READS as MS, handoffContext as M_, fedimintRequestPayload as Ma, parseImageMeta as Mb, WebPushError as Mc, ringEvidence as Md, parseVideoMeta as Mf, waitForIceGathering as Mg, UNUSED_INVITE_WAIT_MAX_MS as Mh, signDidDhtPacket as Mi, STATUS_CARD_CAPABILITY as Ml, rememberAlone as Mm, parseGroupMetaTag as Mn, isGroupMessageId as Mo, REPLY_ID as Mp, AtprotoProofError as Mr, encodeFileData as Ms, GROUP_WAKE_FRAME as Mt, encodePacketTransports as Mu, ENROLL_PROOF as Mv, signDeviceTransports as Mx, readLinkRecord as My, x401AnswerableRequests as N, identityFromSeedB64 as NC, FRESH_READ_MS as NS, handoffContextProof as N_, findEndpoint as Na, previewable as Nb, checkPushEndpoint as Nc, validRingKey as Nd, EDITED_FRAME as Nf, LABEL$1 as Ng, WATCH_PEER_MS as Nh, ETHEREUM_USDT as Ni, SessionCapabilities as Nl, rosterAdmin as Nm, signGroupMeta as Nn, readGroupFileMeta as No, REPLY_LIMITS as Np, atprotoCidFor as Nr, refusalText as Ns, GROUP_WAKE_GROUP_LIMIT as Nt, parsePacketTransports as Nu, enrollCancelFrame as Nv, unsignedDeviceTransports as Nx, requestPlaintextBytes as Ny, readX401ProofRequestHeader as O, encodeTxtPacket as OC, CHAT_RESERVE_MOST_SHARE as OS, handoffAttemptFailed as O_, decodeBolt11 as Oa, verifyAppStatementBytes as Ob, wakeFrame as Oc, verifyPeerProof as Od, VIDEO_LIMITS as Of, parseCallSignal as Og, SIGNAL_OUT_READS as Oh, encodeDidDhtPacket as Oi, PIN_CAPABILITY as Ol, commitHash as Om, openGroupMeta as On, GROUP_WANT_FRAME as Oo, readReaction as Op, normalizeAtprotoHandle as Or, FILE_FRAMES as Os, knockIdentity as Ot, DHT_TEXT_CAPABILITY as Ou, ENROLL_CANCEL_REASONS as Ov, deviceLinkSealKey as Ox, makeStampPaced as Oy, addedAppPermissions as P, publicKeyFromZ32 as PC, GROUP_BURST_MS as PS, handoffDataFrame as P_, isFederationId as Pa, readImageMeta as Pb, decryptPushPayload as Pc, verifyRingAuthorization as Pd, EDIT_BUFFER_MAX as Pf, MAX_MSGS_PAYLOAD_B64 as Pg, countUnusedInvite as Ph, EVM_TEST_CHAINS as Pi, TYPING_CAPABILITY as Pl, rosterHas as Pm, verifyGroupMetaSignature as Pn, readGroupHave as Po, groupReplyAuthor as Pp, decodeAtprotoCommit as Pr, transferEnded as Ps, GROUP_WAKE_GROUP_WINDOW_MS as Pt, IDENTITY_CHALLENGE_WINDOW as Pu, enrollCancelReason as Pv, verifyDeviceTransports as Px, requestRecords as Py, sealGroupTyping as Q, unwrapPasted as QC, WAY_BACK_SHARE as QS, isHandoffPartName as Q_, LIVENESS_MISSED_PINGS as Qa, INVITE_HRP as Qb, encodeAppRangeData as Qc, LIVE_POLL_MS as Qd, LINK_MAX_CHARS as Qf, HANDOFF_ACK as Qg, PROTOCOL_VERSION as Qh, isSparkAddress as Qi, DNS_TYPE as Ql, sha256Hex as Qm, MessageRefusal as Qn, mayBeHub as Qo, buttonLabelClash as Qp, DidError as Qr, COMMUNITY_PIN_FRAME as Qs, GROUP_EDIT_TEXT_BYTES as Qt, identityPresentationBytes as Qu, endedRequests as Qv, TURN_REV_LIMIT as Qx, isAppLicense as Qy, checkAppBeforeRun as R, encrypt as RC, GROUP_SIGNALING_ALLOWANCE_SHARE as RS, handoffFileMissingFrame as R_, ANSWERS_REFUSED_PAUSE_MS as Ra, CONTACT_LINK_BYTES as Rb, vapidAuthorization as Rc, automaticTransport as Rd, EDIT_RECEIVE_LIMIT as Rf, isEmptyLinkPacket as Rg, HttpClient as Rh, SEPOLIA_TEST_USDT_FAUCET as Ri, sessionCapabilitiesFrame as Rl, verifyCommit as Rm, SSH_KEY_TYPES as Rn, CarriedTransport as Ro, wireReply as Rp, parseAtprotoCar as Rr, TYPING_RATE_LIMIT as Rs, groupWakeFrame as Rt, IDENTITY_FRAME_WINDOW_MS as Ru, enrollHelloFrame as Rv, TURN_RAISE_READ_TIMEOUT_MS as Rx, APP_BUNDLE_MAGIC as Ry, buildX401ResultArtifact as S, openRelayPayload as SC, turnSignedMessage as SS, HANDOFF_WINDOW as S_, parseInvoiceCallback as Sa, readAppSignature as Sb, deviceWakeRequest as Sc, proofStatement as Sd, voiceDownloadName as Sf, contactRtcConfig as Sg, OFFER_FAST_MS as Sh, decodeDidDhtPacket as Si, BUTTONS_CAPABILITY as Sl, LEGACY_GROUP_MEMBERS as Sm, groupMetaPicture as Sn, engineText as So, queueReaction as Sp, ATPROTO_PROOF_SCOPE as Sr, MAX_PAIRED_CALL_SIGNAL as Ss, KNOCK_TTL_MS as St, CAPS_LIMITS as Su, setUpdateFrame as Sv, deviceEchoNonce as Sx, knockHolds as Sy, encodeX401Header as T, signRelayPayload as TC, BACKGROUND_REQUESTS_PER_MINUTE as TS, filePartName as T_, requestLnurlInvoice as Ta, signAppRevocation as Tb, readWake as Tc, storageProofPath as Td, voiceLevelsOf as Tf, heardCallSignal as Tg, PRESENCE_HEARTBEAT as Th, didDhtKey as Ti, FILES_BINARY_CAPABILITY as Tl, MEMBER_KEY as Tm, groupName as Tn, GROUP_FILE_LIMITS as To, reactionFrame as Tp, atprotoProofRkey as Tr, parsePairedCallFrame as Ts, encodeGroupEntryLink as Tt, CapsExchange as Tu, verifySetUpdate as Tv, deviceLinkPairing as Tx, knockSlotRecords as Ty, checkAppStoreIndex as U, MAX_AVATAR_SIDE as UC, REQUESTS_PER_MINUTE as US, handoffOfferFrame as U_, DEMOTE_AFTER_FAILURES as Ua, DEVICE_INVITE_BYTES as Ub, APP_RANGE_LIMITS as Uc, relayedTransports as Ud, RateWindow as Uf, SERVICES_VERSION as Ug, resolveTargetUrl as Uh, assertTokenUnits as Ui, HOLD_CAPABILITY as Ul, decryptText as Um, sameSshKey as Un, SIGNAL_FRESH_MS as Uo, ITEM_STATES as Up, verifyAtprotoRecordProof as Ur, TYPING_TIMEOUT_MS as Us, GROUP_REACTED_FRAME as Ut, IDENTITY_PROOF_CAPABILITY as Uu, readEnrollHello as Uv, turnPutSummary as Ux, APP_PERMISSIONS as Uy, APP_STORE_LIMITS as V, tryDecrypt as VC, PREVIOUS_DEFAULT_RELAYS as VS, handoffHelloFrame as V_, CROSSED_PROBE_MS as Va, encodeContactLink as Vb, APP_RANGE_ERRORS as Vc, irohRelayUrl as Vd, MAX_REMOVAL_NUMBER as Vf, LEGACY_SERVICES as Vg, parseLocalTarget as Vh, WALLET_NETWORKS as Vi, SESSION_FRAME_MAX as Vl, confirmationMatches as Vm, parseSshPublicKey as Vn, SIGNALS_PER_MINUTE as Vo, BUTTON_STYLES as Vp, readAtprotoCid as Vr, TYPING_SEND_LIMIT as Vs, parseGroupWakeFrame as Vt, IDENTITY_MAX_RECEIVED as Vu, formatEnrollDigits as Vv, classifyTurnRead as Vx, APP_FORBIDDEN_KEYS as Vy, readAppListing as W, jpegSize$1 as WC, RelayTransport as WS, handoffPakeFrame as W_, DEMOTE_MS as Wa, DEVICE_INVITE_LIFETIME_S as Wb, AppRanges as Wc, transportOrder as Wd, dhtEditId as Wf, decodeServices as Wg, sanitizeRequestHeaders as Wh, assertWholeSats as Wi, HOLD_DATED_BACK_MS as Wl, edgeParams as Wm, sshFingerprint as Wn, SIGNAL_HOLD_MS as Wo, PR_CHECKS as Wp, verifyAtprotoSignature as Wr, TypingReceiver as Ws, GROUP_READ_NOTE as Wt, IDENTITY_PROVIDER_ID as Wu, verifyEnrollProof as Wv, TOMBSTONE_SEQUENCE as Wx, APP_SCREENSHOTS_DIR as Wy, groupTypingEpoch as X, stripHidden as XC, TURN_SOURCE_TIMEOUT_MS as XS, handoffVerifiedMessage as X_, INVITER_DIAL_GRACE_MS as Xa, readDeviceInvite as Xb, appRangeGetFrame as Xc, DHT_TEXT_REFUSED as Xd, validEditNumber as Xf, servicesToWire as Xg, LIMITS as Xh, SPARK_NETWORKS as Xi, readManifest as Xl, sealPair as Xm, verifyBitcoinMessage as Xn, MESH_HUBS as Xo, TASK_STATUSES as Xp, DID_MAX_LENGTH as Xr, typingFrame as Xs, COMMUNITY_EDIT_FRAME as Xt, boundVerifiedIdentity as Xu, REOPEN_BELOW as Xv, TURN_NAME_BYTES as Xx, checkAppManifest as Xy, GroupTypingBoard as Y, sanitizeNick as YC, SLOW_MS as YS, handoffVerifiedFrame as Y_, HANDLED_WAIT_MS as Ya, encodeDeviceInvite as Yb, appRangeErrorFrame as Yc, DHT_TEXT_BYTES as Yd, validEditMessage as Yf, servicesFromWire as Yg, CHUNK_KIND as Yh, walletNetworkOf as Yi, newMailbox as Yl, openSecret as Ym, legacyMessageHash as Yn, GROUP_VERSION_HUBS as Yo, STATUS_CARD_LIMITS as Yp, DID_JWS_MAX_LENGTH as Yr, typingActivity as Ys, groupMessageId as Yt, IdentityExchange as Yu, NEW_PER_HOUR as Yv, TURN_MAX as Yx, buildAppBundle as Yy, openGroupTyping as Z, trimEndOf as ZC, WATCH_SHARE as ZS, handoffVersions as Z_, INVITE_TAKEN as Za, DEVICE_INVITE_VERSION as Zb, decodeAppRangeData as Zc, DhtDelivery as Zd, validRemovalNumber as Zf, viewerTag as Zg, MAX_CHUNK_PAYLOAD_BYTES as Zh, SPARK_PROVIDER as Zi, DNS_LABEL as Zl, sealSecret as Zm, BIP322_REVISION as Zn, NO_HUB_POLICY as Zo, appCardId as Zp, DID_METHODS as Zr, typingKindOf as Zs, GROUP_EDIT_FRAME as Zt, emptyIdentityLedger as Zu, clearMissed as Zv, TURN_NO_ACTIVE as Zx, findAppForbiddenKey as Zy, X401_PROTOCOLS as _, PacketTooLargeError as _C, turnName as _S, HANDOFF_RELEASE as __, LIGHTNING_DESTINATION_PATTERN as _a, isAppRef as _b, WAKE_FRAME as _c, importedProof as _d, fileMessageText as _f, answersOffer as _g, EXPECT_PEER_MS as _h, DID_DHT_MAX_PAYLOAD as _i, isChatAppId as _l, shownTime as _m, encodeGroupMetaBody as _n, parsePaymentNetworks as _o, REACTION_LIMITS as _p, u64 as _r, readBeacon as _s, shortHash as _t, txtValue as _u, SET_ACK as _v, DEVICE_ECHO_FRAME as _x, REQUEST_TEXT_BYTES as _y, X401_DCQL_LIMITS as a, BREAKER_ALL_DOWN_PROBE_MS as aC, encodeTurnFields as aS, HANDOFF_DONE as a_, PUBKY_PROOF_ROOT as aa, yieldThread as ab, nextPinNumber as ac, revokesIdentity as ad, FileTransfers as af, DATA_CHANNEL_ID as ag, OFFER_HOST_GATHER_MS as ah, didWebFile as ai, APP_RATE_LIMIT as al, readStatusCard as am, MENTION_EVERYONE as an, RACE_ANSWERED_MS as ao, parseLinkPreview as ap, ByteReader as ar, beaconKeys as as, communityHasFrame as at, decodeDnsResponse as au, readHandoffDone as av, randomBytes as aw, decodeInviteCode as ax, CONTACT_RECORD_TTL as ay, buildX401ProofRequest as b, measureRecords as bC, turnReleaseMessage as bS, HANDOFF_VERIFIED as b_, findLightningDestination as ba, readAppRevocationShape as bb, WAKE_TTL_SECONDS as bc, proofCapability as bd, parseVoiceMeta as bf, callSignalHeardAt as bg, LinkSession as bh, DID_DHT_VERSION as bi, APPS_CAPABILITY as bl, GROUP_MEMBER_CAP as bm, groupMetaChange as bn, EngineError as bo, parseReactedFrame as bp, ATPROTO_FULL_SCOPE as br, shouldBeHub as bs, verifyCommunityCommit as bt, CAPS_ISSUED_BACK_MS as bu, readSetUpdate as bv, HANDOFF_CAPABILITY as bx, STAMP_BITS_MIN as by, readX401DcqlQuery as c, BREAKER_THRESHOLD as cC, openTurnValue as cS, HANDOFF_HAVE as c_, newPubkyProofFolder as ca, APP_STATEMENT_LIMITS as cb, pinFrame as cc, IDENTITY_TIMELINE_MAX as cd, safeBlobType as cf, RTC_SIGNAL_MAX_AGE_MS as cg, DIRECT_EVIDENCE_MS as ch, didWebHost as ci, APP_SEND_LIMIT as cl, statusCardBytes as cm, mentionsMember as cn, REDESCRIBED_GRACE_MS as co, FORWARD_LIMITS as cp, decodeBitcoinAddress as cr, freshHubs as cs, communityUntaggedHash as ct, domainWellKnownFile as cu, readHandoffHello as cv, toZ32 as cw, inviteLink as cx, KNOCK_SLOT_LABEL as cy, newX401HolderKey as d, budgetRetryMs as dC, sealTurnBody as dS, HANDOFF_LIST_PER_FRAME as d_, pubkyProofFile as da, appRefPublisher as db, pinnedFrame as dc, PROOF_ADAPTERS as dd, PLAYABLE_AUDIO as df, offerIsFresh as dg, DirectPathWatch as dh, parseDidDocument as di, appCloseFrame as dl, usageLeft as dm, GROUP_META_PAST as dn, SWITCH_RETIRE_MS as do, readForwarded as dp, encodeTx as dr, lobbyRecords as ds, encodeCommunityLink as dt, nip05RootKey as du, readHandoffRelease as dv, __commonJSMin as dw, inviteQrText as dx, MAX_SLOT_KNOCKS as dy, currentRelays as eC, TURN_SIGNED_BYTES as eS, HANDOFF_BUSY as e_, sparkInvoiceDetails as ea, isAppUrl as eb, PINNED_FRAME as ec, identityStatement as ed, peekDhtMailbox as ef, decodeControl as eg, CONNECT_TIMEOUT_MS as eh, checkDidSignature as ei, parseAppRangeFrame as el, cardLine as em, communityEditFrame as en, MAX_PAIRED_MESSAGE_FRAME as eo, LINK_TRAILING as ep, bip322ToSign as er, meshRendezvous as es, COMMUNITY_PROFILE as et, DOMAIN_MAX_RECORDS as eu, openHandoffPiece as ev, concatBytes as ew, INVITE_MAX_LENGTH as ex, newInbox as ey, readX401SdJwtVc as f, heldBackError as fC, signTurnBody as fS, HANDOFF_MANIFEST as f_, pubkyProofPath as fa, appRevocationId as fb, readPin as fc, PROOF_CAPABILITY as fd, RECORDING_TYPES as ff, parseRtcSignal as fg, directBlocked as fh, parseDidJws as fi, appDataBytes as fl, MESSAGE_CLOCK_SKEW_MS as fm, GROUP_META_PAST_CHARS as fn, UNPROVEN_AUTH_MS as fo, COMMUNITY_REACTION_FRAME as fp, encodeWitness as fr, mergeBeacon as fs, leaveStands as ft, normalizeDomain as fu, readHandoffTurnFrame as fv, __esmMin as fw, ownInviteRefusal as fx, REQUEST_CLOCK_SKEW_MS as fy, X401_LIMITS as g, PKARR_FUTURE_SKEW_MS as gC, turnKeys as gS, HANDOFF_PIECE_OVERHEAD as g_, pubkyHomeserverOf as ga, isAppKey as gb, WAKE_CALL_WAIT_MS as gc, emptyProofLedger as gd, downsamplePeaks as gf, RTC_CONFIG as gg, DHT_POLL_INTERVALS as gh, strictBase64Url as gi, isAppVersion as gl, receivedTimestamp as gm, MAX_GROUP_PICTURE_LENGTH as gn, pairedMessageFrame as go, REACTION_FRAME as gp, u32$1 as gr, rankHubs as gs, rosterHash as gt, recordsName as gu, sortParts as gv, DEVICE_CAPABILITIES as gx, REQUEST_PACKET_BYTES as gy, X401_HEADERS as h, MAX_DNS_PACKET_BYTES as hC, turnInstance as hS, HANDOFF_PIECE_BYTES as h_, homeserverWebEndpoint as ha, isAppHash as hb, WAKE_CALL_TTL_SECONDS as hc, STORAGE_ROOT as hd, baseMime as hf, PAIRED_CALL_CANDIDATES as hg, DEPARTED_READ_MS as hh, staticDidDocument as hi, chatAppId as hl, heardTime as hm, MAX_GROUP_NAME_LENGTH as hn, pairedMessageFits as ho, REACTED_FRAME as hp, txHash as hr, pickHubs as hs, leftStatement as ht, recordsFromWellKnown as hu, sealHandoffPiece as hv, __toCommonJS as hw, DEVICES_CAPABILITY as hx, REQUEST_NAME_UNITS as hy, x401ApprovalDigest as i, traceLink as iC, TurnRecordError as iS, HANDOFF_DATA as i_, PUBKY_PROOF_MAX_BYTES as ia, sha256Paced as ib, mayPin as ic, receivedIdentityStatus as id, readDhtFile as if, wrapDataChannel as ig, GATHER_STALL_MS as ih, didWebDocumentUrl as ii, APP_PEER_OPEN_MAX as il, checkStatusCard as im, validEditText as in, PONG_WAIT_MS as io, linksIn as ip, BitcoinAddressError as ir, COMMUNITY_TOPOLOGY as is, communityGroupId as it, WELL_KNOWN_PATH as iu, readHandoffData as iv, isZ32Key as iw, createLink as ix, turnOff as iy, readX401ProofResult as j, createIdentity as jC, DEFAULT_RELAYS as jS, handoffCancelFrame as j_, cashuRequestPayload as ja, isImageMime as jb, PUSH_SERVICE_HOSTS as jc, ringClaims as jd, isVideoMime as jf, signalHasVideo as jg, UNUSED_INVITE_READS_PER_MINUTE as jh, resolveDidDht as ji, SESSION_CAPABILITIES_FRAME as jl, parseGroupCommit as jm, parseGroupMetaStatement as jn, groupFileFallback as jo, PAIRED_REPLY_AUTHORS as jp, AtprotoCid as jr, decodeFileData as js, readKnocks as jt, emptyCapsState as ju, ENROLL_HELLO as jv, newDeviceSetSecret as jx, readKnockSlot as jy, readX401ProofResponse as k, readDnsName as kC, CHAT_RESERVE_PER_CHAT as kS, handoffAttemptSucceeded as k_, findBolt11 as ka, IMAGE_LIMITS as kb, wakePayload as kc, RING_LIFETIME as kd, formatVideoDuration as kf, pickCallCandidates as kg, STALLED_LOOK_MS as kh, jwkThumbprint as ki, REACTIONS_CAPABILITY as kl, commitUntaggedHash as km, parseGroupMetaBody as kn, GROUP_WANT_NO_FRAME as ko, validReactionNumber as kp, parseAtprotoDidDocument as kr, FILE_LIMITS as ks, knockRecords as kt, capsDescriptors as ku, ENROLL_DONE as kv, deviceLinkSecret as kx, mergeContactKnocks as ky, x401VpToken as l, RelayBreaker as lC, readTurnBody as lS, HANDOFF_HELLO as l_, normalizePubkyKey as la, appFingerprint as lb, pinIsNewer as lc, applyIdentityEvent as ld, sanitizeFileName as lf, buildDataSdp as lg, DIRECT_OWN_ATTEMPTS as lh, normalizeDid as li, APP_VERSION_MAX as ll, statusCardText as lm, validMentions as ln, RESUME_WAIT_MS as lo, forwardedAgain as lp, decodeTx as lr, hubRank as ls, decodeCommunityLink as lt, encodeDnsQuery as lu, readHandoffManifest as lv, utf8Decode as lw, inviteOwnership as lx, LINK_RECORD_LABEL as ly, x401HolderJwk as m, withRequestOptions as mC, signTurnRelease as mS, HANDOFF_PAKE as m_, encodeSvcbPacket as ma, checkAppRevokeStatement as mb, WAKE_CALL_INTERVAL_MS as mc, STORAGE_LIFETIME as md, VOICE_METER as mf, CALL_SIGNAL_MAX_AGE_MS as mg, AWAITING_PEER_MS as mh, signingKeys as mi, appOpenFrame as ml, claimedTime as mm, MAX_GROUP_NAME_BYTES as mn, WAKE_LOST_MS as mo, QUICK_REACTIONS as mp, sha256d as mr, newerHead as ms, leaveStatement3 as mt, recordsFromTxt as mu, sameDigest as mv, __require as mw, readInviteCode as mx, REQUEST_LIFETIME_MS as my, X401_RESPONSE_MODES as n, readRelayBody as nC, TURN_TTL as nS, HANDOFF_CANCEL as n_, BITCOIN_NETWORKS as na, readAppBundle as nb, PIN_FRAME as nc, isIdentityBinding as nd, dhtFileElements as nf, encodeControl as ng, DataLink as nh, didJwsAlg as ni, APP_DATA_MAX_BYTES as nl, cardTimeUtc as nm, meshMessageRef as nn, PAIRING_ATTEMPT_MS as no, linkEnd as np, decodeBase64 as nr, pickMeshHubs as ns, GROUP_READ_NOTE_COMMUNITY as nt, DOMAIN_TXT_MAX_BYTES as nu, readHandoffBusy as nv, fromBase64Url as nw, OwnInviteError as nx, settleRequest as ny, matchX401Dcql as o, BREAKER_BASE_MS as oC, firstDeviceSetSecret as oS, HANDOFF_FILE_MISSING as o_, isPubkyKey as oa, APP_NAME as ob, parsePinFrame as oc, signIdentityPresentation as od, PREVIEWABLE_IMAGE as of, DATA_CHANNEL_LABEL as og, REANSWERS as oh, didWebFileNames as oi, APP_RATE_WINDOW_MS as ol, removedCardText as om, MENTION_LIMITS as on, RACE_DIRECT_MS as oo, previewImageSize as op, compactSize as or, beaconRecords as os, communityMessageId as ot, dnsProofName as ou, readHandoffFileFrame as ov, toBase64 as ow, encodeGhostlyInvite as ox, ContactRequestError as oy, sameX401HolderJwk as p, isDiscoveryBudgetError as pC, signTurnPacket as pS, HANDOFF_OFFER as p_, decodeSvcbRecords as pa, appSignedBytes as pb, DEVICE_WAKE_TTL_SECONDS as pc, PeerProofs as pd, VOICE_LIMITS as pf, CALL_SIGNAL_FUTURE_MS as pg, symmetricNat as ph, parseDidSignaturePaste as pi, appDataFrame as pl, arrivalKey as pm, MAX_GROUP_META_BODY as pn, WAKE_ANSWER_GRACE_MS as po, GROUP_REACTION_FRAME as pp, hash160 as pr, mergeLobby as ps, leaveStatement as pt, parseDomainTxt as pu, readHandoffVerified as pv, __exportAll as pw, pastedAgain as px, REQUEST_LABEL as py, signAppStore as q, hasVisible as qC, SIGNALING_WINDOW_MS as qS, handoffRetryAfter as q_, FIRST_PAIRING_PACE_MS as qa, deviceInviteJoinerKeyZ32 as qb, appRangeDataFrame as qc, DHT_FILE_TOO_LARGE as qd, parseEditFrame as qf, isViewerTag as qg, webLocalFetch as qh, parsePaymentAmount as qi, HoldRefusedError as ql, newEpochSecret as qm, verifySshSignature as qn, groupSignalFrame as qo, ROUTINE_STATES as qp, DID_GHOSTLY_SERVICE as qr, parseTypingFrame as qs, chainPieces as qt, IDENTITY_SUBJECT as qu, MAX_MISSED as qv, TURN_LABEL as qx, appViewOf as qy, readX401OpenId4VpRequest as r, setLinkTraceSink as rC, TURN_VERSION as rS, HANDOFF_CANCEL_REASONS as r_, isBitcoinAddress as ra, readAppBundleAsync as rb, PIN_LIMITS as rc, newIdentityBinding as rd, dhtFileId as rf, sendBody as rg, GATHER_ATTEMPTS as rh, didSignedMessages as ri, APP_FRAME as rl, cardUrl as rm, parseCommunityEdit as rn, PAIRING_RETRY_MS as ro, linkStop as rp, verifyBip322 as rr, wireHubPolicy as rs, communityCommitHash as rt, NIP05_PATH as ru, readHandoffCancel as rv, fromZ32 as rw, createChatInvite as rx, takeRequest as ry, presentX401SdJwtVc as s, BREAKER_MAX_MS as sC, nextTurnPosition as sS, HANDOFF_FILE_REQUEST as s_, isPubkyProofFolder as sa, APP_PREFIXES as sb, parsePinnedFrame as sc, verifyIdentityPresentation as sd, formatFileSize as sf, RTC_SIGNAL_FUTURE_MS as sg, STALLED_EVIDENCE_MS as sh, didWebFileUrl as si, APP_RESUME_GRACE_MS as sl, sameButtonText as sm, mentionsBytes as sn, RACE_RELAYED_MS as so, sanitizePreviewImage as sp, decodeAnyBitcoinAddress as sr, doorHubs as ss, communityRoster as st, domainTxtRecord as su, readHandoffHave as sv, toBase64Url as sw, encodeInviteCode as sx, KNOCK_SLOTS as sy, X401_REQUEST_LIMITS as t, normalizeRelayUrl as tC, TURN_SLOTS as tS, HANDOFF_BUSY_REASONS as t_, sparkNetworkOf as ta, pacer as tb, PIN_CLOCK_SKEW_MS as tc, identityStatementText as td, DHT_FILE_CAPABILITY as tf, encodeChunk as tg, DATA_SETTLE_MS as th, didGhostlyServiceEntry as ti, readAppRangeFrame as tl, cardLinkHost as tm, communityMessageAuthor as tn, PAIRED_FRAME_TOO_LARGE as to, canonicalUrl as tp, bip322ToSpend as tr, parseHubPolicy as ts, CommunitySession as tt, DOMAIN_METHODS as tu, readHandoffAck as tv, fromBase64 as tw, INVITE_VERSION as tx, planKnocks as ty, X401_CREDENTIAL_LIMITS as u, DiscoveryBudgetError as uC, readTurnPacket as uS, HANDOFF_LATER_BYTES as u_, pubkyProofCapability as ua, appRef as ub, pinNumberHolds as uc, lastSharedWithMe as ud, sanitizeMime as uf, extractRtcParams as ug, DIRECT_PEERS as uh, parseDid as ui, AppSessions as ul, taskProgress as um, wireMentions as un, RTC_UNSTARTED_MS as uo, forwardedMany as up, decodeWitness as ur, lobbyKeys as us, derivedSecret as ut, isPublicAddress as uu, readHandoffPake as uv, utf8Encode as uw, inviteQrSegments as ux, MAX_SEEN as uy, X401_SCHEME as v, RELAY_PAYLOAD_MAX_BYTES as vC, turnPacket as vS, HANDOFF_REQUEST as v_, LNURL_LIMITS as va, isAppSignature as vb, WAKE_INTERVAL_MS as vc, isProofAdapter as vd, formatVoiceDuration as vf, buildSdpFromSignal as vg, FIRST_PUBLISH_MAX_MS as vh, DID_DHT_PREFIX as vi, parseAppFrame as vl, GROUP_ADMIN_OFF_ERROR as vm, groupDisplayName as vn, publishFailure as vo, ReactionWindow as vp, varBytes as vr, readBeaconHead as vs, signCommunity as vt, validDomainRecord as vu, SET_UPDATE as vv, DEVICE_PING_FRAME as vx, STAMP_BITS_DEFAULT as vy, decodeX401Header as w, readOwnRelayPayload as wC, turnVerifierMark as wS, filePartDigest as w_, parsePayParams as wa, signAppObject as wb, parseWakeFrame as wc, storageProofBody as wd, voiceLevel as wf, extractParamsFromSdp as wg, OFFER_STEP_MAX as wh, didDhtFromPublicKey as wi, EDIT_CAPABILITY as wl, MAX_GROUP_MEMBERS as wm, groupMetaToHand as wn, PairingTracker as wo, reactionEmoji as wp, atprotoProofRecord as wr, PairedCalls as ws, decodeGroupEntryLink as wt, CAPS_REFRESH_MS as wu, signTombstone as wv, deviceKeyZ32 as wx, knockSlotOf as wy, buildX401ProofResult as x, newerPacket as xC, turnSequence as xS, HANDOFF_VERSION as x_, invoiceCallbackUrl as xa, readAppRevocations as xb, WakeLimiter as xc, proofHash as xd, recordingMime as xf, compressSdp as xg, MAX_DHT_TEXT_BYTES as xh, DidDhtError as xi, APP_RANGES_CAPABILITY as xl, GROUP_VERSION_LARGE as xm, groupMetaNewer as xn, engineError as xo, parseReactionFrame as xp, ATPROTO_PROOF_COLLECTION as xr, validHead as xs, GROUP_ENTRY_PROFILE as xt, CAPS_LABEL as xu, setAckFrame as xv, deviceEchoFrame as xx, contactDay as xy, X401_VERSION as y, createRelayPayload as yC, turnPayloadSequence as yS, HANDOFF_TIMINGS as y_, fetchLnurlJson as ya, readAppRevocation as yb, WAKE_SUBJECT as yc, nostrProofTemplate as yd, isPlayableAudioType as yf, callRtcConfig as yg, IDLE_THRESHOLD as yh, DID_DHT_TTL as yi, readAppFrame as yl, GROUP_ID as ym, groupMetaBody as yn, ENGINE_ERRORS as yo, nextReactionNumber as yp, ATPROTO_DECLARED_SCOPE as yr, readLobby as ys, verifyCommunityChain as yt, wellKnownUrl as yu, encodeSetSlots as yv, ENROLL_CAPABILITY as yx, STAMP_BITS_MAX as yy, planAppUpdate as z, generateEncryptionKey as zC, HEDGE_MISSING_MS as zS, handoffFileRequestFrame as z_, BLOCKED_DIAL_WAIT_MS as za, CONTACT_LINK_VERSION as zb, vapidKeysMatch as zc, checkedDescriptors as zd, EDIT_SEND_LIMIT as zf, parseLinkRecords as zg, HttpHost as zh, TEST_USDT_FAUCET_AMOUNT as zi, PAIRED_PROFILE as zl, verifyCommitSignature as zm, SSH_PUBLIC_KEY_MAX as zn, GROUP_SIGNAL_FRAME as zo, ACTIVE_TASK_STATUSES as zp, parseAtprotoDidKey as zr, TYPING_RATE_WINDOW_MS as zs, groupWakes as zt, IDENTITY_MAX_EVIDENCE as zu, enrollMessage as zv, TURN_SETTLE_MS as zx, APP_CLIENTS as zy };
36173
36548
 
36174
- //# sourceMappingURL=src-Dw-9Vq6U.js.map
36549
+ //# sourceMappingURL=src-B5uLojgn.js.map