@ghostlytools/sdk 1.10.3 → 1.10.5

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.
Files changed (30) hide show
  1. package/dist/core.js +2 -2
  2. package/dist/{fakes-Dbw01Dk9.js → fakes-BNNNkQqY.js} +2 -2
  3. package/dist/{fakes-Dbw01Dk9.js.map → fakes-BNNNkQqY.js.map} +1 -1
  4. package/dist/fakes.js +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/{keet-identity-key-BT3p-YEj.js → keet-identity-key-DJbA1oSW.js} +2 -2
  8. package/dist/{keet-identity-key-BT3p-YEj.js.map → keet-identity-key-DJbA1oSW.js.map} +1 -1
  9. package/dist/{src-CCGK1Q_h.js → src-C2bAufMs.js} +738 -155
  10. package/dist/src-C2bAufMs.js.map +1 -0
  11. package/dist/testing.js +3 -3
  12. package/dist/types/browser/src/proofs/contract.d.ts +4 -1
  13. package/dist/types/core/src/capsRecord.d.ts +19 -6
  14. package/dist/types/core/src/dhtDelivery.d.ts +47 -0
  15. package/dist/types/core/src/frames.d.ts +6 -0
  16. package/dist/types/core/src/ghostlink.d.ts +5 -0
  17. package/dist/types/core/src/groupCommunity.d.ts +23 -2
  18. package/dist/types/core/src/groupSession.d.ts +20 -1
  19. package/dist/types/core/src/http.d.ts +1 -0
  20. package/dist/types/core/src/identityProofs.d.ts +15 -0
  21. package/dist/types/core/src/identityTimeline.d.ts +8 -2
  22. package/dist/types/core/src/link.d.ts +8 -0
  23. package/dist/types/core/src/relay.d.ts +46 -7
  24. package/dist/types/core/src/transport.d.ts +29 -0
  25. package/dist/types/core/src/transportSwitch.d.ts +2 -0
  26. package/dist/{verify-DXMSqZzR.js → verify-CpIce6Bt.js} +3 -2
  27. package/dist/verify-CpIce6Bt.js.map +1 -0
  28. package/package.json +1 -1
  29. package/dist/src-CCGK1Q_h.js.map +0 -1
  30. package/dist/verify-DXMSqZzR.js.map +0 -1
@@ -659,6 +659,7 @@ function createRelayPayload(identity, records, timestampMicros = BigInt(Date.now
659
659
  */
660
660
  function signRelayPayload(identity, dnsPacket, seq) {
661
661
  if (dnsPacket.length > 1e3) throw new PacketTooLargeError(dnsPacket.length);
662
+ if (seq < 0n || seq >= 1n << 64n) throw new RangeError(`Sequence number ${seq} does not fit in 64 bits`);
662
663
  const signature = sign(signable(seq, dnsPacket), identity.seed);
663
664
  const timestamp = new Uint8Array(TIMESTAMP_LENGTH);
664
665
  new DataView(timestamp.buffer).setBigUint64(0, seq);
@@ -761,6 +762,7 @@ function withRequestOptions(transport, extra) {
761
762
  if (transport.turnRead) wrapped.turnRead = (pubKeyZ32, options) => transport.turnRead(pubKeyZ32, options);
762
763
  if (transport.turnPut) wrapped.turnPut = (pubKeyZ32, payload, conditions) => transport.turnPut(pubKeyZ32, payload, conditions);
763
764
  if (transport.turnWarm) wrapped.turnWarm = () => transport.turnWarm();
765
+ if (transport.forget) wrapped.forget = (keys) => transport.forget(keys);
764
766
  return wrapped;
765
767
  }
766
768
  /**
@@ -782,6 +784,30 @@ function isDiscoveryBudgetError(error) {
782
784
  return error instanceof DiscoveryBudgetError || typeof error === "object" && error !== null && error.code === "discovery-budget" && typeof error.retryInMs === "number";
783
785
  }
784
786
  /**
787
+ * A publish no relay took (`RelayTransport`), saying whether one of them may hold the packet all the same. Not
788
+ * `mayBeStored` only when every relay was not asked now (its budget, its rate limit, its breaker, its network
789
+ * cooldown), answered that it did not take it (a 4xx), or could not be reached before the request went (a refused
790
+ * connection or a name that does not resolve, where the runtime says so: Node does, a browser does not), or when there
791
+ * is no relay at all. A relay that did not answer in time, dropped the connection, or answered with a server error
792
+ * may have stored it. The message is the publish's usual one.
793
+ */
794
+ var PublishFailedError = class extends Error {
795
+ mayBeStored;
796
+ code = "publish-failed";
797
+ constructor(message, mayBeStored) {
798
+ super(message);
799
+ this.mayBeStored = mayBeStored;
800
+ }
801
+ };
802
+ /**
803
+ * Whether `error` is a publish that went nowhere (`PublishFailedError` with `mayBeStored` false), also from another
804
+ * copy of this module. Anything else (a timeout, the DHT's own failure beside the relays', a Desktop's error in
805
+ * words) may have left this device.
806
+ */
807
+ function publishedNowhere(error) {
808
+ return typeof error === "object" && error !== null && error.code === "publish-failed" && error.mayBeStored === false;
809
+ }
810
+ /**
785
811
  * A publish Ghostly Desktop's Rust relay client held back, as it says it in words (`pkarr_network.rs`
786
812
  * `publish_failure`: "Publish held back on every relay…; retry in N ms: …"), as the `DiscoveryBudgetError` it is: every
787
813
  * relay held the packet back for its rate limit, or held it back beside relays left alone for failing, and nothing failed
@@ -997,6 +1023,7 @@ var asker = (options, write) => ({
997
1023
  watch: !!options.watch && !write,
998
1024
  watchWrite: !!options.watch && write,
999
1025
  departed: !!options.departed && !write,
1026
+ awaited: !!options.awaited && !write,
1000
1027
  resume: !!options.resume && !write,
1001
1028
  back: !!options.back
1002
1029
  });
@@ -1006,6 +1033,8 @@ var isChat = (who) => !who.background && !who.group;
1006
1033
  var isChatSignal = (who) => who.signal && isChat(who);
1007
1034
  /** A 1:1 chat's read of a contact that just went away: a few may use the chat's allowance (`DEPARTED_READS`). */
1008
1035
  var isDepartedRead = (who) => who.departed && isChat(who);
1036
+ /** A 1:1 chat's read of an invite this side made, its joiner due: a few may use the chat's allowance (`AWAITED_READS`). */
1037
+ var isAwaitedRead = (who) => who.awaited && isChat(who);
1009
1038
  /** A group's edge looking fast for a signal (`GROUP_BURST_MS`). */
1010
1039
  var isGroupUrgentRead = (who) => who.group && who.urgent && !who.write && !who.background;
1011
1040
  /**
@@ -1034,6 +1063,7 @@ var ANSWER_READER = {
1034
1063
  watch: false,
1035
1064
  watchWrite: false,
1036
1065
  departed: false,
1066
+ awaited: false,
1037
1067
  resume: false,
1038
1068
  back: false
1039
1069
  };
@@ -1213,6 +1243,19 @@ var SIGNALING_ALLOWANCE_SHARE = 1 / 5;
1213
1243
  */
1214
1244
  var DEPARTED_READS = 6;
1215
1245
  /**
1246
+ * A 1:1 chat's reads of an invite this side made, while its joiner is due and has not shown (`awaited`, `AWAITING_PEER_MS`
1247
+ * in link.ts), may go over a relay's minute within the chat's allowance (`SIGNALING_ALLOWANCE_SHARE`) the same way: at
1248
+ * most this many of each invite's in a minute, every relay together. And while one asked in the last minute, the departed
1249
+ * reads leave them half of that on each relay: the last `AWAITED_READS / 2` of the allowance's reads (`DEPARTED_READS`
1250
+ * then take at most 3 on a relay of 30, against 5). Read every 2 to 4 s, they cover the seconds in which a joiner that
1251
+ * opened the link at once knocks. Within the chats' allowance, they add nothing to what a relay may see in a minute
1252
+ * (`WAY_BACK_SHARE`): 36 at most from the chats on a relay of 30, none past 5 on a relay of 5. An inviter pairing one joiner after
1253
+ * another on relays of 30 spent the minute on both 12 s in (two pairings, about 15 requests a relay each), the departed
1254
+ * reads of the contact that had just left took the allowance, and the third invite's key was read once, then not until
1255
+ * the minute freed: the joiner's knock 48 s late, and join to live in 60 s, against 2.6 and 4.6 s (CLI lab, 2026-11-07).
1256
+ */
1257
+ var AWAITED_READS = 4;
1258
+ /**
1216
1259
  * A group edge's requests for a member that may be back may go over a relay's minute by this fraction of it (4 on a
1217
1260
  * relay of 30, 8 on one of 60, none on a relay of 5): its reads of a member that went away and its packet
1218
1261
  * written meanwhile, which that member reads first when it is back (`watch`), its offer or answer, and its reads for
@@ -1393,6 +1436,7 @@ var CATCH_UP_ASKER = {
1393
1436
  watch: false,
1394
1437
  watchWrite: false,
1395
1438
  departed: false,
1439
+ awaited: false,
1396
1440
  resume: false,
1397
1441
  back: false
1398
1442
  };
@@ -1483,6 +1527,47 @@ function looksLikeHost(text) {
1483
1527
  /** A relay the breaker leaves alone for failing (`RelayBreaker`): nothing was asked of it now. */
1484
1528
  var RelayLeftAloneError = class extends Error {};
1485
1529
  /**
1530
+ * A relay a put did not get an answer from. `sent` false: the request never left (its network cooling down after a
1531
+ * failure, or a connection that could not be made, `connectFailed`); true: it may have reached the relay.
1532
+ */
1533
+ var RelayNoAnswerError = class extends Error {
1534
+ sent;
1535
+ constructor(message, sent) {
1536
+ super(message);
1537
+ this.sent = sent;
1538
+ }
1539
+ };
1540
+ /** What Node says of a connection it could not make: the request never left. A browser's TypeError says nothing either way. */
1541
+ var CONNECT_FAILURES = /* @__PURE__ */ new Set([
1542
+ "ECONNREFUSED",
1543
+ "ENOTFOUND",
1544
+ "EAI_AGAIN",
1545
+ "EHOSTUNREACH",
1546
+ "ENETUNREACH",
1547
+ "ENETDOWN",
1548
+ "EHOSTDOWN",
1549
+ "EADDRNOTAVAIL",
1550
+ "UND_ERR_CONNECT_TIMEOUT"
1551
+ ]);
1552
+ /** A fetch that failed before its request left this device: Node's `cause.code` (each of an AggregateError's, for several addresses). */
1553
+ function connectFailed(error) {
1554
+ const cause = error?.cause;
1555
+ if (!cause || typeof cause !== "object") return false;
1556
+ if (Array.isArray(cause.errors) && cause.errors.length) return cause.errors.every((e) => CONNECT_FAILURES.has(e?.code));
1557
+ return CONNECT_FAILURES.has(cause.code);
1558
+ }
1559
+ /**
1560
+ * The error a publish ends with after a second round dated past a relay's later copy failed too: one that may have
1561
+ * stored the first round's packet still may, whatever the second round's relays said.
1562
+ */
1563
+ function laterRound(first, later) {
1564
+ return publishedNowhere(later) && !publishedNowhere(first) ? new PublishFailedError(later.message, true) : later;
1565
+ }
1566
+ /** A packet date no further ahead of this clock than readers take (`newerPacket`): one this client may date past. */
1567
+ function withinSkew(timestamp) {
1568
+ return timestamp <= BigInt(Date.now() + PKARR_FUTURE_SKEW_MS) * 1000n;
1569
+ }
1570
+ /**
1486
1571
  * A read the relays failed (or left alone for failing before), when its caller has another path to ask
1487
1572
  * (`RelayTransport.resolve` with `keptOnFailure` false): `kept` is the newest packet the relays gave for the key before.
1488
1573
  */
@@ -1506,7 +1591,9 @@ var RelayTransport = class {
1506
1591
  * records are written by every member, an inviter warms its contact's key with an empty packet, and this device's
1507
1592
  * own clock may have been set back since it last wrote. A relay and the DHT keep only the packet dated latest, so
1508
1593
  * one dated by this clock alone, when it is behind, was refused (409) or silently never read, until this clock
1509
- * caught up with the other one: minutes, or an hour.
1594
+ * caught up with the other one: minutes, or an hour. Only up to `PKARR_FUTURE_SKEW_MS` ahead of this clock
1595
+ * (`withinSkew`): a packet one holder of a shared key dated further ahead must not date every later one of this
1596
+ * device past it (past 64 bits, unsignable; else ahead of every reader's clock, never taken over one dated now).
1510
1597
  */
1511
1598
  seenTimestamp = /* @__PURE__ */ new Map();
1512
1599
  /**
@@ -1541,6 +1628,10 @@ var RelayTransport = class {
1541
1628
  spentAnswerAllowance = /* @__PURE__ */ new Map();
1542
1629
  /** Per contact, its departed reads past the limit in the last minute, every relay together (`DEPARTED_READS`). */
1543
1630
  departedOver = /* @__PURE__ */ new Map();
1631
+ /** Per invite, its awaited reads past the limit in the last minute, every relay together (`AWAITED_READS`). */
1632
+ awaitedOver = /* @__PURE__ */ new Map();
1633
+ /** When an awaited invite's read last asked: the departed reads leave it room for a minute (`AWAITED_READS`). */
1634
+ awaitedAt = -Infinity;
1544
1635
  /**
1545
1636
  * Per key a group reads (not in the background), when a read of it last went out and when it last asked: whose turn
1546
1637
  * it is under the watch share (`WATCH_SHARE`) and while the groups' reads are rationed (`GROUP_RATION_WINDOW_MS`). And
@@ -1593,6 +1684,10 @@ var RelayTransport = class {
1593
1684
  hedgeMs;
1594
1685
  /** Until when each relay found slow (`SLOW_MS`) goes after the others in a read (`readOrder`). */
1595
1686
  slowUntil = /* @__PURE__ */ new Map();
1687
+ /** Per relay, when each of this client's requests still waiting for its answer went out (`unanswering`). */
1688
+ waiting = /* @__PURE__ */ new Map();
1689
+ /** When each relay last answered a request of this client, whatever it said (`unanswering`). */
1690
+ answeredAt = /* @__PURE__ */ new Map();
1596
1691
  /** Keys whose last read was answered 404: their next read hedges later (`HEDGE_MISSING_MS`). */
1597
1692
  missing = /* @__PURE__ */ new Set();
1598
1693
  listeners = /* @__PURE__ */ new Set();
@@ -1649,6 +1744,24 @@ var RelayTransport = class {
1649
1744
  this.slowUntil.clear();
1650
1745
  this.changed("recovered");
1651
1746
  }
1747
+ /**
1748
+ * `PkarrTransport.forget`: the packets and dates this client kept under these keys go, on every relay (`written`,
1749
+ * `newest`, `lastTimestamp`, `seenTimestamp`, `lastPut`). A spare invite replaced unused left them here for its two keys
1750
+ * for good: an idle CLI daemon gained 8 keys an hour (343 in `written` and 690 `lastPut` entries after a day). The maps
1751
+ * that bound themselves (`readAt`, `lastReadFrom`, `heldBack`, `missing`, the turns) and the catch-ups, which go once
1752
+ * put, are left as they are. A later put under one of these keys goes as a key's first.
1753
+ */
1754
+ forget(keys) {
1755
+ const gone = new Set(keys);
1756
+ if (gone.size === 0) return;
1757
+ for (const key of gone) for (const perKey of [
1758
+ this.lastTimestamp,
1759
+ this.seenTimestamp,
1760
+ this.newest,
1761
+ this.written
1762
+ ]) perKey.delete(key);
1763
+ for (const slot of this.lastPut.keys()) if (gone.has(slot.slice(slot.lastIndexOf(" ") + 1))) this.lastPut.delete(slot);
1764
+ }
1652
1765
  /** Called when a relay trips or recovers. */
1653
1766
  subscribe(listener) {
1654
1767
  this.listeners.add(listener);
@@ -1684,7 +1797,7 @@ var RelayTransport = class {
1684
1797
  * Returns once one relay took the packet: the others finish in the background.
1685
1798
  */
1686
1799
  async publish(identity, records, options = {}) {
1687
- if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
1800
+ if (this.relays.length === 0) throw new PublishFailedError("No Pkarr relays configured", false);
1688
1801
  await this.publishDated(identity, records, (key, payload, timestamp, conflict) => this.putEverywhere(key, payload, timestamp, options, conflict), options);
1689
1802
  }
1690
1803
  /**
@@ -1723,7 +1836,7 @@ var RelayTransport = class {
1723
1836
  if (again || redated) return;
1724
1837
  redated = (async () => {
1725
1838
  const held = read ? await read().catch(() => null) : await this.heldAt(relay, key, asker(options, true));
1726
- if (held === null || held < timestamp) return false;
1839
+ if (held === null || held < timestamp || !withinSkew(held)) return false;
1727
1840
  traceLink(key, "publish-redated", {
1728
1841
  aheadMs: Number((held - timestamp) / 1000n),
1729
1842
  relay
@@ -1738,7 +1851,9 @@ var RelayTransport = class {
1738
1851
  await put(key, createRelayPayload(identity, records, timestamp), timestamp, conflict);
1739
1852
  } catch (error) {
1740
1853
  const pending = redated;
1741
- if (!pending || !await pending) throw error;
1854
+ if (!pending || !await pending.catch((later) => {
1855
+ throw laterRound(error, later);
1856
+ })) throw error;
1742
1857
  }
1743
1858
  }
1744
1859
  /** `PkarrTransport.publishHeld`: `publishDated`'s check before signing, for a payload signed elsewhere in this process. */
@@ -1804,7 +1919,7 @@ var RelayTransport = class {
1804
1919
  }
1805
1920
  /** A packet under this key was read (on a relay, or by the CLI on the DHT): its time, for `nextTimestamp`. */
1806
1921
  sawTimestamp(pubKeyZ32, timestamp) {
1807
- if (timestamp > (this.seenTimestamp.get(pubKeyZ32) ?? 0n)) this.seenTimestamp.set(pubKeyZ32, timestamp);
1922
+ if (withinSkew(timestamp) && timestamp > (this.seenTimestamp.get(pubKeyZ32) ?? 0n)) this.seenTimestamp.set(pubKeyZ32, timestamp);
1808
1923
  }
1809
1924
  /**
1810
1925
  * Puts a payload `publishDated` just signed, dated `timestamp`, on every relay. Its signature is not checked: it was
@@ -1812,7 +1927,7 @@ var RelayTransport = class {
1812
1927
  * gives it.
1813
1928
  */
1814
1929
  async putSigned(pubKeyZ32, payload, timestamp, options = {}, conflict) {
1815
- if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
1930
+ if (this.relays.length === 0) throw new PublishFailedError("No Pkarr relays configured", false);
1816
1931
  await this.putEverywhere(pubKeyZ32, payload, timestamp, options, conflict);
1817
1932
  }
1818
1933
  /**
@@ -1820,7 +1935,7 @@ var RelayTransport = class {
1820
1935
  * (`signedAt`) and is not checked again. `conflict`: as `publishDated` gives it.
1821
1936
  */
1822
1937
  async publishPayload(pubKeyZ32, payload, options = {}, conflict) {
1823
- if (this.relays.length === 0) throw new Error("No Pkarr relays configured");
1938
+ if (this.relays.length === 0) throw new PublishFailedError("No Pkarr relays configured", false);
1824
1939
  const seq = options.signedAt ?? openRelayPayload(pubKeyZ32, payload).seq;
1825
1940
  if (options.signedAt === void 0 || !options.redate) return this.putEverywhere(pubKeyZ32, payload, seq, options, conflict);
1826
1941
  await this.putRedated(pubKeyZ32, payload, seq, options, PAYLOAD_REDATES);
@@ -1853,7 +1968,7 @@ var RelayTransport = class {
1853
1968
  if (left <= 0 || redated) return;
1854
1969
  redated = (async () => {
1855
1970
  const held = await this.heldAt(relay, key, asker(options, true));
1856
- if (held === null || held < timestamp) return false;
1971
+ if (held === null || held < timestamp || !withinSkew(held)) return false;
1857
1972
  if (this.lastTimestamp.get(key) !== timestamp) return true;
1858
1973
  const again = options.redate(held);
1859
1974
  if (!again) return true;
@@ -1873,7 +1988,9 @@ var RelayTransport = class {
1873
1988
  await this.putEverywhere(key, payload, timestamp, options, conflict);
1874
1989
  } catch (error) {
1875
1990
  const pending = redated;
1876
- if (!pending || !await pending) throw error;
1991
+ if (!pending || !await pending.catch((later) => {
1992
+ throw laterRound(error, later);
1993
+ })) throw error;
1877
1994
  }
1878
1995
  }
1879
1996
  /**
@@ -1899,11 +2016,15 @@ var RelayTransport = class {
1899
2016
  let first;
1900
2017
  const edgeSignal = isGroupSignal(asker(options, true));
1901
2018
  const failed = /* @__PURE__ */ new Set();
1902
- const puts = this.relays.map(async (relay) => {
2019
+ const nowhere = this.relays.map(() => false);
2020
+ const puts = this.relays.map(async (relay, i) => {
1903
2021
  const slot = `${relay} ${pubKeyZ32}`;
1904
2022
  const previous = this.lastPut.get(slot);
1905
2023
  this.lastPut.set(slot, timestamp);
1906
- if (first && isChat(asker(options, true)) && this.spareHeldFor(relay, Date.now()) > 0 && await answeredWithin(first, 3e3)) throw new DiscoveryBudgetError(Math.max(CATCH_UP_MIN_MS, this.spareHeldFor(relay, Date.now())));
2024
+ if (first && isChat(asker(options, true)) && this.spareHeldFor(relay, Date.now()) > 0 && await answeredWithin(first, 3e3)) {
2025
+ nowhere[i] = true;
2026
+ throw new DiscoveryBudgetError(Math.max(CATCH_UP_MIN_MS, this.spareHeldFor(relay, Date.now())));
2027
+ }
1907
2028
  let response;
1908
2029
  try {
1909
2030
  response = await this.put(relay, pubKeyZ32, payload, previous, asker(options, true), relay === probe, (ok) => {
@@ -1912,8 +2033,10 @@ var RelayTransport = class {
1912
2033
  if (response.status === 412) response = await this.put(relay, pubKeyZ32, payload, void 0, asker(options, true));
1913
2034
  } catch (error) {
1914
2035
  if (!isDiscoveryBudgetError(error) && !(error instanceof RelayLeftAloneError)) failed.add(relay);
2036
+ nowhere[i] = isDiscoveryBudgetError(error) || error instanceof RelayLeftAloneError || error instanceof RelayNoAnswerError && !error.sent;
1915
2037
  throw error;
1916
2038
  }
2039
+ nowhere[i] = response.status >= 400 && response.status < 500;
1917
2040
  if (response.status >= 500 || response.status === 428) failed.add(relay);
1918
2041
  if (response.status === 409) conflict?.(relay);
1919
2042
  if (response.status === 429) throw new DiscoveryBudgetError(this.coolDown(relay, response), `${relay} responded 429; retry shortly`);
@@ -1946,7 +2069,7 @@ var RelayTransport = class {
1946
2069
  const reasons = results.map((r) => r.status === "rejected" ? String(r.reason) : "").join("; ");
1947
2070
  if (waits.length === results.length) reject(new DiscoveryBudgetError(Math.min(...waits.map((e) => e.retryInMs)), `Publish held back on every relay: ${reasons}`));
1948
2071
  else if (waits.length && results.every((r, i) => held[i] !== null || leftAlone(r))) reject(new DiscoveryBudgetError(Math.min(...waits.map((e) => e.retryInMs)), `Publish held back on every relay not left alone: ${reasons}`));
1949
- else reject(/* @__PURE__ */ new Error(`Publish failed on every relay: ${reasons}`));
2072
+ else reject(new PublishFailedError(`Publish failed on every relay: ${reasons}`, !nowhere.every(Boolean)));
1950
2073
  });
1951
2074
  });
1952
2075
  }
@@ -2094,7 +2217,7 @@ var RelayTransport = class {
2094
2217
  }
2095
2218
  for (const loser of asked.values()) {
2096
2219
  loser.controller.abort();
2097
- if (outcome.kind === "packet" && loser.started <= attempt.started) this.slow(loser.relay);
2220
+ if (loser.started <= attempt.started && (outcome.kind === "packet" || Date.now() - loser.started >= 6e3)) this.slow(loser.relay);
2098
2221
  else this.breaker.cancel(loser.relay);
2099
2222
  }
2100
2223
  this.lastRelay = relay;
@@ -2116,7 +2239,8 @@ var RelayTransport = class {
2116
2239
  throw new Error("No Pkarr relay reachable");
2117
2240
  }
2118
2241
  /**
2119
- * The order a key's read asks the relays in: in turn per key (see `resolve`), relays found slow lately last. A relay
2242
+ * The order a key's read asks the relays in: in turn per key (see `resolve`), relays found slow lately or leaving a
2243
+ * request unanswered (`unanswering`) last. A relay
2120
2244
  * with a small share of its own (`RELAY_REQUESTS_PER_MINUTE` under `REQUESTS_PER_MINUTE`: pkarr.miguelmedeiros.dev's 5)
2121
2245
  * takes no turns: it comes after the others, for when they refuse, fail or are slow, unless every relay is one. In the
2122
2246
  * turn, it was spent in seconds and the relay after it took its turns too: pkarr.pubky.org got two reads in three and
@@ -2129,8 +2253,19 @@ var RelayTransport = class {
2129
2253
  const after = lastAt < 0 ? -1 : ring.findIndex((relay) => this.relays.indexOf(relay) > lastAt);
2130
2254
  const start = lastAt < 0 ? this.cursor++ : after < 0 ? 0 : after;
2131
2255
  const turn = [...ring.map((_, i) => ring[(start + i) % ring.length]), ...this.relays.filter((relay) => !ring.includes(relay))];
2132
- const now = Date.now(), slow = (relay) => (this.slowUntil.get(relay) ?? 0) > now;
2133
- return [...turn.filter((relay) => !slow(relay)), ...turn.filter(slow)];
2256
+ const now = Date.now(), behind = (relay) => (this.slowUntil.get(relay) ?? 0) > now || this.unanswering(relay, now);
2257
+ return [...turn.filter((relay) => !behind(relay)), ...turn.filter(behind)];
2258
+ }
2259
+ /**
2260
+ * A request of this client has waited on the relay for `HEDGE_MS` and it has answered none since: it goes after the
2261
+ * others in a read (`readOrder`), at no cost of a request. A relay that took connections and never answered held a
2262
+ * fresh device's first pairing at its turn: the key's last read had found nothing (`HEDGE_MISSING_MS`), so the read
2263
+ * waited 6 s on it before asking the relay that had held the packet all along (8 s join to live, not 2.5 s).
2264
+ */
2265
+ unanswering(relay, now) {
2266
+ const since = this.answeredAt.get(relay) ?? -Infinity;
2267
+ for (const request of this.waiting.get(relay) ?? []) if (request.at > since && now - request.at >= this.hedgeMs) return true;
2268
+ return false;
2134
2269
  }
2135
2270
  /** One GET of a key at one relay, which `controller` drops. Never rejects: what happened is the outcome. */
2136
2271
  readFromRelay(relay, pubKeyZ32) {
@@ -2280,7 +2415,7 @@ var RelayTransport = class {
2280
2415
  }
2281
2416
  /** `sent`: told, once the budget took the request, whether the relay takes the packet (a 2xx). */
2282
2417
  async put(relay, pubKeyZ32, payload, replaces, who, probe = false, sent) {
2283
- if (!probe && this.networkCoolingDown(relay, "PUT")) throw new Error(`${relay} did not answer a moment ago; retry shortly`);
2418
+ if (!probe && this.networkCoolingDown(relay, "PUT")) throw new RelayNoAnswerError(`${relay} did not answer a moment ago; retry shortly`, false);
2284
2419
  const limited = this.rateLimitedFor(relay);
2285
2420
  if (limited > 0) throw new DiscoveryBudgetError(limited, "Discovery relay is cooling down after a 429; retry shortly");
2286
2421
  const blocked = probe ? 0 : this.breaker.blockedFor(relay);
@@ -2300,13 +2435,13 @@ var RelayTransport = class {
2300
2435
  let response;
2301
2436
  try {
2302
2437
  response = await request;
2303
- } catch {
2438
+ } catch (error) {
2304
2439
  this.networkCooldown.set(`PUT ${relay}`, Date.now() + NETWORK_ERROR_COOLDOWN_MS);
2305
2440
  this.answered(relay, {
2306
2441
  kind: "error",
2307
2442
  reason: "no answer"
2308
2443
  });
2309
- throw new Error(`${relay} did not answer`);
2444
+ throw new RelayNoAnswerError(`${relay} did not answer`, !connectFailed(error));
2310
2445
  }
2311
2446
  if (response.status === 429) this.answered(relay, {
2312
2447
  kind: "throttled",
@@ -2333,6 +2468,7 @@ var RelayTransport = class {
2333
2468
  }
2334
2469
  if (isGroupRead(who) || isChatWatch(who)) this.readAsked(key, who, now);
2335
2470
  if (isTurnRead(who)) this.turnAsked(key, who, now);
2471
+ if (isAwaitedRead(who)) this.awaitedAt = now;
2336
2472
  if (this.heldFor(relay, who, now, key) > 0) {
2337
2473
  if (isGroupRead(who) && (this.spent.get(relay)?.length ?? 0) >= this.limitOf(relay)) this.groupsFullAt.set(relay, now);
2338
2474
  if (isChat(who)) this.chatNeed(key, now, relay);
@@ -2374,7 +2510,8 @@ var RelayTransport = class {
2374
2510
  if (isGroupSignal(who) && !who.write && this.spent.get(relay).length >= this.limitOf(relay)) this.spentGroupOver.get(relay).push(now);
2375
2511
  if (isGroupSignal(who)) this.spentGroupSignal.get(relay).push(now);
2376
2512
  const departedOver = isDepartedRead(who) && this.spent.get(relay).length >= this.limitOf(relay);
2377
- if (departedOver) this.departedOverAdd(key, now);
2513
+ if (departedOver) this.overAdd(this.departedOver, key, now);
2514
+ if (isAwaitedRead(who) && this.spent.get(relay).length >= this.limitOf(relay)) this.overAdd(this.awaitedOver, key, now);
2378
2515
  this.spent.get(relay).push(now);
2379
2516
  if (who.background) this.spentBackground.get(relay).push(now);
2380
2517
  if (who.background && who.write) this.spentBackgroundWrites.get(relay).push(now);
@@ -2405,7 +2542,7 @@ var RelayTransport = class {
2405
2542
  * Who goes first: a chat's refused write holds back everything but chat writes; a group's refused write holds back
2406
2543
  * group reads and background requests, never a chat's. Background requests yield to a link that signals. A chat's
2407
2544
  * signaling goes over the limit by its allowance (`SIGNALING_ALLOWANCE_SHARE`), and so do a few of its reads of a
2408
- * contact that just went away (`DEPARTED_READS`). `ownAllowance` false: what holds an edge's read for its answer
2545
+ * contact that just went away (`DEPARTED_READS`) or of an invite awaited (`AWAITED_READS`). `ownAllowance` false: what holds an edge's read for its answer
2409
2546
  * without its own allowance (`ANSWER_READ_ALLOWANCE`).
2410
2547
  */
2411
2548
  heldFor(relay, who, now = Date.now(), key, turns = true, ownAllowance = true) {
@@ -2417,9 +2554,11 @@ var RelayTransport = class {
2417
2554
  this.spentBackgroundWrites.set(relay, recentBackgroundWrites);
2418
2555
  const over = (list, limit) => list.length >= limit ? list[list.length - limit] + 6e4 - now : 0;
2419
2556
  const limit = this.limitOf(relay);
2420
- const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.departedReads(key, now) < 6;
2421
- const share = isChatSignal(who) || departed ? SIGNALING_ALLOWANCE_SHARE : isGroupSignal(who) ? GROUP_SIGNALING_ALLOWANCE_SHARE : 0;
2422
- const allowance = share ? Math.max(0, Math.floor(limit * share) - (who.write ? 0 : 1)) : 0;
2557
+ const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.overReads(this.departedOver, key, now) < 6;
2558
+ const awaited = isAwaitedRead(who) && key !== void 0 && recent.length >= limit && this.overReads(this.awaitedOver, key, now) < 4;
2559
+ const share = isChatSignal(who) || departed || awaited ? SIGNALING_ALLOWANCE_SHARE : isGroupSignal(who) ? GROUP_SIGNALING_ALLOWANCE_SHARE : 0;
2560
+ let allowance = share ? Math.max(0, Math.floor(limit * share) - (who.write ? 0 : 1)) : 0;
2561
+ if (departed && now - this.awaitedAt < 6e4) allowance = Math.max(0, allowance - 2);
2423
2562
  const groupSignaled = within(this.spentGroupSignal.get(relay) ?? [], now, 6e4);
2424
2563
  this.spentGroupSignal.set(relay, groupSignaled);
2425
2564
  const groupFloor = isGroupSignal(who) && groupSignaled.length < allowance;
@@ -2476,7 +2615,8 @@ var RelayTransport = class {
2476
2615
  const at = this.writeWaiting.get(`${lane} ${relay}`);
2477
2616
  return at !== void 0 && now - at < 5e3 ? at + WRITE_FIRST_MS - now : 0;
2478
2617
  };
2479
- if (writer !== "chat" && !departed && !starved) wait = Math.max(wait, waiting("chat"));
2618
+ const signalOver = isChatSignal(who) && !who.write && recent.length >= limit;
2619
+ if (writer !== "chat" && !departed && !awaited && !signalOver && !starved) wait = Math.max(wait, waiting("chat"));
2480
2620
  if ((writer === null && who.group && !pastLimit && !isGroupAnswerRead(who) || who.background) && !starved) wait = Math.max(wait, waiting("group"));
2481
2621
  if (isGroupSignal(who) && !isGroupAnswerRead(who)) {
2482
2622
  const ahead = this.answerReadAhead(relay, now);
@@ -2599,17 +2739,17 @@ var RelayTransport = class {
2599
2739
  const since = this.heldBack.get(key)?.since;
2600
2740
  return !who.group && !who.write && !who.door && since !== void 0 && now - since >= READ_STARVED_MS;
2601
2741
  }
2602
- /** This contact's departed reads past the limit in the last minute (`DEPARTED_READS`). */
2603
- departedReads(key, now) {
2604
- const reads = within(this.departedOver.get(key) ?? [], now, 6e4);
2605
- if (reads.length) this.departedOver.set(key, reads);
2606
- else this.departedOver.delete(key);
2742
+ /** This key's departed or awaited reads past the limit in the last minute (`DEPARTED_READS`, `AWAITED_READS`). */
2743
+ overReads(over, key, now) {
2744
+ const reads = within(over.get(key) ?? [], now, 6e4);
2745
+ if (reads.length) over.set(key, reads);
2746
+ else over.delete(key);
2607
2747
  return reads.length;
2608
2748
  }
2609
- /** One more, the contacts with none in the last minute dropped. */
2610
- departedOverAdd(key, now) {
2611
- for (const [other, reads] of this.departedOver) if (now - reads[reads.length - 1] >= 6e4) this.departedOver.delete(other);
2612
- this.departedOver.set(key, [...this.departedOver.get(key) ?? [], now]);
2749
+ /** One more, the keys with none in the last minute dropped. */
2750
+ overAdd(over, key, now) {
2751
+ for (const [other, reads] of over) if (now - reads[reads.length - 1] >= 6e4) over.delete(other);
2752
+ over.set(key, [...over.get(key) ?? [], now]);
2613
2753
  }
2614
2754
  /** A chat's request of `key` asked urgently (it needs every relay), or the budget refused it on `relay` (it needs that one). */
2615
2755
  chatNeed(key, now, relay) {
@@ -2823,6 +2963,9 @@ var RelayTransport = class {
2823
2963
  const timer = setTimeout(() => controller.abort(), this.timeoutMs);
2824
2964
  const drop = () => controller.abort();
2825
2965
  cancel?.addEventListener("abort", drop, { once: true });
2966
+ const relay = url.slice(0, url.lastIndexOf("/")), request = { at: Date.now() };
2967
+ const waiting = this.waiting.get(relay) ?? /* @__PURE__ */ new Set();
2968
+ this.waiting.set(relay, waiting.add(request));
2826
2969
  try {
2827
2970
  const sent = Date.now();
2828
2971
  const response = await this.fetchFn(url, {
@@ -2830,10 +2973,12 @@ var RelayTransport = class {
2830
2973
  cache: "no-store",
2831
2974
  signal: controller.signal
2832
2975
  });
2976
+ this.answeredAt.set(relay, Date.now());
2833
2977
  this.serverTime(url, response, sent);
2834
2978
  await read?.(response, controller.signal);
2835
2979
  return response;
2836
2980
  } finally {
2981
+ waiting.delete(request);
2837
2982
  clearTimeout(timer);
2838
2983
  cancel?.removeEventListener("abort", drop);
2839
2984
  }
@@ -6649,11 +6794,16 @@ var NO_ATTEMPTS = {
6649
6794
  recent: [],
6650
6795
  total: 0
6651
6796
  };
6797
+ /**
6798
+ * When the lock-out ends by this clock, if it has not: one more than an hour away was stamped by a clock that ran ahead,
6799
+ * and is over (WISP 06 § Failure table, clocks wrong by days).
6800
+ */
6801
+ var lockedUntil = (attempts, now) => attempts?.until !== void 0 && now < attempts.until && attempts.until - now <= HANDOFF_ATTEMPTS.hourMs ? attempts.until : void 0;
6652
6802
  /** Whether a device may try now: `refused` after 15 failures with no success, until the person lets it try again. */
6653
6803
  function handoffAttemptAllowed(attempts, now) {
6654
6804
  if (!attempts) return "ok";
6655
6805
  if (attempts.total >= HANDOFF_ATTEMPTS.total) return "refused";
6656
- if (attempts.until !== void 0 && now < attempts.until) return "locked-out";
6806
+ if (lockedUntil(attempts, now) !== void 0) return "locked-out";
6657
6807
  return "ok";
6658
6808
  }
6659
6809
  /**
@@ -6661,17 +6811,18 @@ function handoffAttemptAllowed(attempts, now) {
6661
6811
  * outcome, and takes it back on success: a taker that stops after the second message has used a try.
6662
6812
  */
6663
6813
  function handoffAttemptFailed(attempts, now) {
6664
- const recent = [...(attempts?.recent ?? []).filter((at) => now - at < HANDOFF_ATTEMPTS.hourMs), now];
6814
+ const recent = [...(attempts?.recent ?? []).map((at) => Math.min(at, now)).filter((at) => now - at < HANDOFF_ATTEMPTS.hourMs), now];
6665
6815
  const total = (attempts?.total ?? 0) + 1;
6666
6816
  if (recent.length >= HANDOFF_ATTEMPTS.perHour) return {
6667
6817
  recent: [],
6668
6818
  total,
6669
6819
  until: now + HANDOFF_ATTEMPTS.hourMs
6670
6820
  };
6821
+ const until = lockedUntil(attempts, now);
6671
6822
  return {
6672
6823
  recent,
6673
6824
  total,
6674
- ...attempts?.until !== void 0 && now < attempts.until ? { until: attempts.until } : {}
6825
+ ...until !== void 0 ? { until } : {}
6675
6826
  };
6676
6827
  }
6677
6828
  /** A proof that held: the count starts again. */
@@ -6680,7 +6831,10 @@ var handoffAttemptSucceeded = () => ({
6680
6831
  total: 0
6681
6832
  });
6682
6833
  /** Seconds until a locked-out device may try again (for `handoff-busy`). */
6683
- var handoffRetryAfter = (attempts, now) => attempts?.until !== void 0 && attempts.until > now ? Math.ceil((attempts.until - now) / 1e3) : 0;
6834
+ var handoffRetryAfter = (attempts, now) => {
6835
+ const until = lockedUntil(attempts, now);
6836
+ return until !== void 0 ? Math.ceil((until - now) / 1e3) : 0;
6837
+ };
6684
6838
  /** Two digests compared. */
6685
6839
  var sameDigest = (a, b) => a.length === b.length && bytesEqual(a, b);
6686
6840
  //#endregion
@@ -7750,6 +7904,12 @@ var LIMITS = {
7750
7904
  maxConcurrentRequestsPerPeer: 32,
7751
7905
  /** Requests a client keeps in flight; the rest wait in a queue. */
7752
7906
  maxClientInFlight: 16,
7907
+ /**
7908
+ * Requests, and their bodies' bytes, a client keeps waiting for a slot: past either, a request is refused at once
7909
+ * (`busy`), so whatever asks (a contact's app in a viewer) cannot make it hold unbounded memory.
7910
+ */
7911
+ maxClientWaiting: 64,
7912
+ maxClientWaitingBodyBytes: 67108864,
7753
7913
  maxChatMessageBytes: 16384,
7754
7914
  maxFileBytes: 104857600,
7755
7915
  /** Files a peer may be sending us at once. */
@@ -8521,6 +8681,7 @@ var HttpClient = class {
8521
8681
  nextId = 1;
8522
8682
  streams = /* @__PURE__ */ new Map();
8523
8683
  waiting = [];
8684
+ waitingBytes = 0;
8524
8685
  inFlight = 0;
8525
8686
  closed = false;
8526
8687
  constructor(channel) {
@@ -8529,7 +8690,28 @@ var HttpClient = class {
8529
8690
  async request(serviceId, request) {
8530
8691
  if (this.closed) throw new GhostlyHttpError("closed", "Data link is closed");
8531
8692
  if (this.inFlight >= LIMITS.maxClientInFlight) {
8532
- await new Promise((resolve) => this.waiting.push(resolve));
8693
+ const bytes = request.body?.length ?? 0;
8694
+ if (this.waiting.length >= LIMITS.maxClientWaiting || this.waitingBytes + bytes > LIMITS.maxClientWaitingBodyBytes) throw new GhostlyHttpError("busy", "Too many requests waiting");
8695
+ this.waitingBytes += bytes;
8696
+ let leave = () => {};
8697
+ try {
8698
+ await new Promise((resolve, reject) => {
8699
+ const wake = () => {
8700
+ request.signal?.removeEventListener("abort", leave);
8701
+ resolve();
8702
+ };
8703
+ leave = () => {
8704
+ const at = this.waiting.indexOf(wake);
8705
+ if (at >= 0) this.waiting.splice(at, 1);
8706
+ reject(new GhostlyHttpError("aborted", "Request aborted"));
8707
+ };
8708
+ if (request.signal?.aborted) return leave();
8709
+ this.waiting.push(wake);
8710
+ request.signal?.addEventListener("abort", leave, { once: true });
8711
+ });
8712
+ } finally {
8713
+ this.waitingBytes -= bytes;
8714
+ }
8533
8715
  if (this.closed) throw new GhostlyHttpError("closed", "Data link is closed");
8534
8716
  }
8535
8717
  this.inFlight++;
@@ -8865,6 +9047,8 @@ var LinkSession = class {
8865
9047
  signalReadsLeft = 0;
8866
9048
  /** Fast reads still signaling while the contact's offer is due (`SIGNAL_DUE_READS`). */
8867
9049
  dueSignalReadsLeft = 0;
9050
+ /** This side just left DHT only and its presence is not out yet: the contact dials on it (`presenceDue`). */
9051
+ presenceDueOut = false;
8868
9052
  /** When the last `expectPeer` window ends (or ended): the pace slows down from there step by step. */
8869
9053
  expectUntil = 0;
8870
9054
  /**
@@ -9007,6 +9191,7 @@ var LinkSession = class {
9007
9191
  countUnusedInvite(this.transport, this, false);
9008
9192
  this.rtcSignal = null;
9009
9193
  this.callSignal = null;
9194
+ this.presenceDueOut = false;
9010
9195
  this.events.onStatus?.("offline");
9011
9196
  if (announce) try {
9012
9197
  await this.publishOnce(false);
@@ -9067,6 +9252,14 @@ var LinkSession = class {
9067
9252
  * the windows that look fast for the contact (`expectPeer`, `watchPeer`) end, and the link reads at its pace from the
9068
9253
  * next read on. An offer of this side's out keeps its window.
9069
9254
  */
9255
+ /**
9256
+ * This side just left DHT only: the contact that dials waits on its next packet that advertises, so that one is
9257
+ * signaling (`PkarrRequestOptions.signal`). As a plain write, an app that had spent its relay minute held it 55 s,
9258
+ * and the contact dialled only then.
9259
+ */
9260
+ presenceDue() {
9261
+ this.presenceDueOut = true;
9262
+ }
9070
9263
  calm() {
9071
9264
  if (this.rtcSignal !== null) return;
9072
9265
  this.fastPollUntil = this.fastStepsAfter = this.expectUntil = this.watchUntil = this.lingerUntil = this.dueSignalReadsLeft = 0;
@@ -9286,7 +9479,7 @@ var LinkSession = class {
9286
9479
  try {
9287
9480
  const awaited = this.connected || this.presence.online || this.sentBuffer.length > 0 || this.callSignal !== null || this.awaitingPeer();
9288
9481
  const takesBack = !rtcSignal && this.rtcSignalOut !== null;
9289
- const options = rtcSignal && rtcSignal !== this.rtcSignalOut ? { signal: true } : this.watching() ? { watch: true } : upkeep && (this.connected || takesBack) || !rtcSignal && !awaited ? { background: true } : void 0;
9482
+ const options = rtcSignal && rtcSignal !== this.rtcSignalOut || advertise && this.presenceDueOut ? { signal: true } : this.watching() ? { watch: true } : upkeep && (this.connected || takesBack) || !rtcSignal && !awaited ? { background: true } : void 0;
9290
9483
  this.wroteInBackground = options?.background === true;
9291
9484
  const held = this.transport.publishHeld?.(this.identity.pubKeyZ32, options);
9292
9485
  if (held) throw held;
@@ -9325,6 +9518,7 @@ var LinkSession = class {
9325
9518
  }
9326
9519
  const ms = Date.now() - started;
9327
9520
  this.lastPublishedAt = Date.now();
9521
+ if (advertise) this.presenceDueOut = false;
9328
9522
  const signalOut = !!rtcSignal && rtcSignal !== this.rtcSignalOut;
9329
9523
  this.signalReadsLeft = signalOut ? 3 : rtcSignal ? this.signalReadsLeft : 0;
9330
9524
  if (signalOut && this.fastPollUntil > 0) {
@@ -9384,6 +9578,7 @@ var LinkSession = class {
9384
9578
  }
9385
9579
  const watch = !signal && this.watching();
9386
9580
  const departed = !signal && Date.now() < this.departedUntil;
9581
+ const awaited = !signal && this.ownInvite() && this.awaitingPeer();
9387
9582
  const background = pace === "background" || pace === "connected" || pace === "idle" && !this.active;
9388
9583
  const resume = !signal && !watch && (this.resumeReads || Date.now() < this.awaitedUntil);
9389
9584
  let unread;
@@ -9393,6 +9588,7 @@ var LinkSession = class {
9393
9588
  ...signal && { signal },
9394
9589
  ...watch && { watch },
9395
9590
  ...departed && { departed },
9591
+ ...awaited && { awaited },
9396
9592
  ...resume && { resume }
9397
9593
  }, false).catch((error) => {
9398
9594
  if (!(error instanceof RelaysFailedError)) throw error;
@@ -12821,6 +13017,7 @@ function readDhtFile(raw, message) {
12821
13017
  var DHT_TEXT_BYTES = 256;
12822
13018
  var DHT_MESSAGE_TTL = 3e5;
12823
13019
  var DHT_TEXT_TOO_LONG = `DHT text is limited to 256 UTF-8 bytes. Shorten it or choose a live connection.`;
13020
+ var DHT_PACKET_BUDGET = "Text and authentication exceed the DHT packet budget. Shorten the message.";
12824
13021
  var CONTROL_TTL = 6e5;
12825
13022
  /**
12826
13023
  * How far apart two devices' clocks may be for an envelope's expiry: a reader takes one until this long after `expires`
@@ -12859,6 +13056,7 @@ var STREAM_POLL_MS = 3e4;
12859
13056
  * each has seen the other leave).
12860
13057
  */
12861
13058
  var LEAVING_DHT_FAST_MS = 12e4;
13059
+ var LEAVING_PROBE_MAX_GAP_MS = 96e4;
12862
13060
  /** Only this often while layer 1 carries the chat (WISP 403, Q7): the relays' per-IP budget is shared by every chat. */
12863
13061
  var LIVE_POLL_MS = 3e5;
12864
13062
  /**
@@ -12925,6 +13123,11 @@ var DhtDelivery = class DhtDelivery {
12925
13123
  urgent = false;
12926
13124
  /** Reads left that are signaling: the contact is leaving DHT only, and the live link waits on them (`expect`). */
12927
13125
  signalReads = 0;
13126
+ /** The read as this side leaves DHT only, before the signaling ones (`setMode`): a plain one. */
13127
+ leavingRead = false;
13128
+ /** Until when a fresh link packet of the contact starts no signaling reads, and the wait it was held to (`peerLinkPacket`). */
13129
+ probeAt = 0;
13130
+ probeGap = 0;
12928
13131
  timer = null;
12929
13132
  /** The first control envelope of a start that waits (`firstControlAfterMs`). */
12930
13133
  controlTimer = null;
@@ -12944,12 +13147,19 @@ var DhtDelivery = class DhtDelivery {
12944
13147
  /** Until when the relays' request budget holds publications back: what is due then goes at once. */
12945
13148
  budgetUntil = 0;
12946
13149
  /**
13150
+ * This side left DHT only and no envelope saying so went out yet: the contact's live link waits on it (it holds this
13151
+ * side's offer until it reads that), so it goes as signaling (`PkarrRequestOptions.signal`).
13152
+ */
13153
+ leavingOut = false;
13154
+ /**
12947
13155
  * Until when it held this side's last read of the contact's mailbox back: the read goes again then, not at the next
12948
13156
  * poll. A chat in the background reads every 30 s, and one held back while its link was redialling read the contact
12949
13157
  * 60 s after its live link dropped, the chat "On DHT · retrying live" all along while the contact had chosen DHT only.
12950
13158
  */
12951
13159
  readHeldUntil = 0;
12952
13160
  errors = {};
13161
+ /** Texts whose last `send` went nowhere (`wentNowhereFor`), newest last. */
13162
+ wentNowhere = /* @__PURE__ */ new Set();
12953
13163
  /** When the device's network last came back (`networkBack`): a read or publication started before failed for want of it. */
12954
13164
  networkBackAt = -Infinity;
12955
13165
  foreignKeySeenAt;
@@ -13104,9 +13314,17 @@ var DhtDelivery = class DhtDelivery {
13104
13314
  }
13105
13315
  this.state = next;
13106
13316
  }
13317
+ /** The key an envelope between this side and `peer` is sealed with: the same for the same contact, so derived once. */
13318
+ sealedKeys;
13107
13319
  sealedKey(peer) {
13108
- const shared = x25519.getSharedSecret(ed25519.utils.toMontgomerySecret(this.participation.seed), ed25519.utils.toMontgomery(publicKeyFromZ32(peer)));
13109
- return hkdf(sha256, shared, this.key, utf8Encode("ghostly-dht-participation-envelope/1"), 32);
13320
+ if (this.sealedKeys?.peer !== peer) {
13321
+ const shared = x25519.getSharedSecret(ed25519.utils.toMontgomerySecret(this.participation.seed), ed25519.utils.toMontgomery(publicKeyFromZ32(peer)));
13322
+ this.sealedKeys = {
13323
+ peer,
13324
+ key: hkdf(sha256, shared, this.key, utf8Encode("ghostly-dht-participation-envelope/1"), 32)
13325
+ };
13326
+ }
13327
+ return this.sealedKeys.key;
13110
13328
  }
13111
13329
  signed(body, recipient = "invite") {
13112
13330
  return utf8Encode(JSON.stringify([
@@ -13121,6 +13339,32 @@ var DhtDelivery = class DhtDelivery {
13121
13339
  return this.envelope(body, recipient).records;
13122
13340
  }
13123
13341
  /**
13342
+ * Whether an envelope to `recipient` whose plaintext is this many bytes fits the packet: its size depends on the
13343
+ * length alone, so it is measured on a placeholder, with no signature, key or encryption.
13344
+ */
13345
+ fits(bytes, recipient) {
13346
+ if (bytes > MAX_ENVELOPE_PLAINTEXT) return false;
13347
+ const ratchet = this.ratcheted(recipient);
13348
+ const sealed = ratchet ? 4 * Math.ceil((66 + bytes) / 3) : sealedLength(bytes);
13349
+ const hint = recipient ? [{
13350
+ label: "_dmk",
13351
+ value: "A".repeat(sealedLength(utf8Encode(this.participation.pubKeyZ32).length)),
13352
+ ttl: ENVELOPE_TTL
13353
+ }] : [];
13354
+ return measureRecords(this.identity.pubKeyZ32, [{
13355
+ label: ratchet ? "_dr" : "_dm",
13356
+ value: "A".repeat(sealed),
13357
+ ttl: ENVELOPE_TTL
13358
+ }, ...hint]) <= ENVELOPE_PACKET_BYTES;
13359
+ }
13360
+ /**
13361
+ * Whether `body` fits an envelope to `recipient`, as `envelope` would find it, without building one: the signature is
13362
+ * always 86 characters of base64url.
13363
+ */
13364
+ bodyFits(body, recipient) {
13365
+ return this.fits(utf8Encode(JSON.stringify([body, "x".repeat(86)])).length, recipient);
13366
+ }
13367
+ /**
13124
13368
  * The envelope's records. Ratcheted (`ratcheted`), its `_dr` record is the right length but not sealed yet: `seal`
13125
13369
  * gives its bytes, under the chat's lock, once the publication is sure to go. Measuring a packet takes no key.
13126
13370
  */
@@ -13135,13 +13379,9 @@ var DhtDelivery = class DhtDelivery {
13135
13379
  const ratchet = this.ratcheted(recipient);
13136
13380
  const sealedBytes = (bytes) => ratchet ? 4 * Math.ceil((66 + bytes) / 3) : sealedLength(bytes);
13137
13381
  const label = ratchet ? "_dr" : "_dm";
13138
- const fits = (bytes) => bytes <= MAX_ENVELOPE_PLAINTEXT && measureRecords(this.identity.pubKeyZ32, [{
13139
- label,
13140
- value: "A".repeat(sealedBytes(bytes)),
13141
- ttl: ENVELOPE_TTL
13142
- }, ...hint]) <= ENVELOPE_PACKET_BYTES;
13382
+ const fits = (bytes) => this.fits(bytes, recipient);
13143
13383
  const bytes = utf8Encode(plaintext).length;
13144
- if (!fits(bytes)) throw new Error("Text and authentication exceed the DHT packet budget. Shorten the message.");
13384
+ if (!fits(bytes)) throw new Error(DHT_PACKET_BUDGET);
13145
13385
  let padded = bytes;
13146
13386
  for (let step = 512; step >= 1; step >>= 1) if (fits(padded + step)) padded += step;
13147
13387
  const full = plaintext + " ".repeat(padded - bytes);
@@ -13209,7 +13449,12 @@ var DhtDelivery = class DhtDelivery {
13209
13449
  this.lastPublish = 0;
13210
13450
  this.leavingUntil = mode === "stream" ? Date.now() + LEAVING_DHT_FAST_MS : 0;
13211
13451
  if (mode === "dht") this.signalReads = 0;
13212
- else if (this.state.peerMode === "dht") this.signalReads = 3;
13452
+ else if (this.state.peerMode === "dht") {
13453
+ this.signalReads = 3;
13454
+ this.leavingRead = true;
13455
+ }
13456
+ this.leavingOut = mode === "stream";
13457
+ if (this.leavingOut) this.budgetUntil = 0;
13213
13458
  this.changed();
13214
13459
  });
13215
13460
  this.tick();
@@ -13246,6 +13491,20 @@ var DhtDelivery = class DhtDelivery {
13246
13491
  this.tick();
13247
13492
  }
13248
13493
  /**
13494
+ * A fresh link packet of a contact still saying DHT only (`expect`, signaling). Nothing signed says it is the contact's,
13495
+ * and one that stays on DHT only (or anyone holding the invite) can put one before every read: the reads it starts are
13496
+ * then held to a wait that doubles from `LEAVING_PROBE_GAP_MS` to `LEAVING_PROBE_MAX_GAP_MS`, and start over once the
13497
+ * contact says it left. False when held. Its offer, signed by its pinned key, is not held (`expect` directly).
13498
+ */
13499
+ peerLinkPacket(ms) {
13500
+ const now = Date.now();
13501
+ if (now < this.probeAt && this.probeAt - now <= this.probeGap) return false;
13502
+ this.probeGap = Math.min(this.probeGap * 2 || 12e4, LEAVING_PROBE_MAX_GAP_MS);
13503
+ this.probeAt = now + this.probeGap;
13504
+ this.expect(ms, true);
13505
+ return true;
13506
+ }
13507
+ /**
13249
13508
  * Layer 1 carries the chat, or no longer does. While it does, the mailbox is read every 5 minutes, after one
13250
13509
  * last look as it goes live: a text the contact put on the DHT in the seconds before (after this side's last
13251
13510
  * read) would otherwise wait for the next look. That look is a background request, which yields to links that
@@ -13314,23 +13573,18 @@ var DhtDelivery = class DhtDelivery {
13314
13573
  const error = this.packetError(next.message, next.expires, next.reply, next.edit);
13315
13574
  return error && next.reply ? this.packetError(next.message, next.expires) : error;
13316
13575
  }
13576
+ /**
13577
+ * Measured, not built (`bodyFits`): the outbox asks it of every waiting text at each look, and a text that waits as no
13578
+ * relay takes it would cost a signature and a seal each time, for an answer that does not change.
13579
+ */
13317
13580
  packetError(message, expires, reply, edit) {
13318
- try {
13319
- this.records(this.body(this.sequence + 1, Date.now(), expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", reply, [], edit), this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
13320
- return null;
13321
- } catch (error) {
13322
- return error instanceof Error ? error.message : String(error);
13323
- }
13581
+ const body = this.body(this.sequence + 1, Date.now(), expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", reply, [], edit);
13582
+ return this.bodyFits(body, this.options.credentials.peerKey ?? this.participation.pubKeyZ32) ? null : DHT_PACKET_BUDGET;
13324
13583
  }
13325
13584
  /** Whether a text with its hop count fits the packet and what a reader reads (`MAX_ENVELOPE_PLAINTEXT`). */
13326
13585
  roomForHops(message, expires, reply, forwarded) {
13327
13586
  const body = this.body(this.sequence + 1, Date.now(), expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", reply, [], void 0, forwarded);
13328
- try {
13329
- this.records(body, this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
13330
- } catch {
13331
- return false;
13332
- }
13333
- return utf8Encode(JSON.stringify([body, "x".repeat(86)])).length <= MAX_ENVELOPE_PLAINTEXT;
13587
+ return this.bodyFits(body, this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
13334
13588
  }
13335
13589
  /**
13336
13590
  * `forwarded`: a forwarded text's hop count (WISP 403 § Forwards). Like a reply's id it goes only when the packet has
@@ -13338,11 +13592,13 @@ var DhtDelivery = class DhtDelivery {
13338
13592
  */
13339
13593
  async send(text, timestamp, id, reply, edit, forwarded) {
13340
13594
  return this.serialize(async () => {
13595
+ this.wentNowhere.delete(id);
13341
13596
  const error = this.validate(text, timestamp, id, reply, edit);
13342
13597
  if (error) return error;
13343
13598
  const now = Date.now(), pending = this.state.pending;
13344
13599
  const hops = edit ? void 0 : readForwarded(forwarded);
13345
- let next = pending?.message[0] === id && pending.expires > now ? pending : {
13600
+ const again = pending?.message[0] === id && pending.expires > now;
13601
+ let next = again ? pending : {
13346
13602
  message: [
13347
13603
  id,
13348
13604
  timestamp,
@@ -13378,12 +13634,27 @@ var DhtDelivery = class DhtDelivery {
13378
13634
  return null;
13379
13635
  }
13380
13636
  this.errors.publish = `DHT publication failed: ${String(error instanceof Error ? error.message : error)}. Bounded retry continues until expiry.`;
13637
+ if (!again && !edit && publishedNowhere(error) && this.state.pending?.message[0] === id) {
13638
+ await this.persist({
13639
+ ...this.state,
13640
+ pending: void 0
13641
+ });
13642
+ this.wentNowhere.add(id);
13643
+ if (this.wentNowhere.size > 64) this.wentNowhere.delete(this.wentNowhere.values().next().value);
13644
+ }
13381
13645
  this.changed();
13382
13646
  return this.errors.publish;
13383
13647
  }
13384
13648
  });
13385
13649
  }
13386
13650
  /**
13651
+ * The last `send` of this id failed with no relay holding it, and it was not out before (`PublishFailedError`): it
13652
+ * never left this device, and is no longer the floor's to publish.
13653
+ */
13654
+ wentNowhereFor(id) {
13655
+ return this.wentNowhere.has(id);
13656
+ }
13657
+ /**
13387
13658
  * The envelope a file's offer would go in, as `send` builds a text's: the most it can say that fits the packet and
13388
13659
  * what a reader reads (`MAX_ENVELOPE_PLAINTEXT`). Its meta goes first (a voice note's waveform thinned if it must),
13389
13660
  * then the reply's id, then the hop count; the name, size, type and id always. A string: why it cannot go.
@@ -13404,12 +13675,7 @@ var DhtDelivery = class DhtDelivery {
13404
13675
  const hops = readForwarded(forwarded);
13405
13676
  const fits = (element, withReply, withHops) => {
13406
13677
  const body = this.body(this.sequence + 1, now, expires, message, this.state.receipt?.id ?? "abcdefghijklmnopqrstuv", withReply ? reply : void 0, [], void 0, withHops ? hops : void 0, element);
13407
- try {
13408
- this.records(body, this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
13409
- } catch {
13410
- return false;
13411
- }
13412
- return utf8Encode(JSON.stringify([body, "x".repeat(86)])).length <= MAX_ENVELOPE_PLAINTEXT;
13678
+ return this.bodyFits(body, this.options.credentials.peerKey ?? this.participation.pubKeyZ32);
13413
13679
  };
13414
13680
  const elements = dhtFileElements(file), bare = elements[elements.length - 1];
13415
13681
  const found = [
@@ -13594,7 +13860,7 @@ var DhtDelivery = class DhtDelivery {
13594
13860
  const issued = Math.min(now, Math.max(now - DHT_ISSUED_BACK_MS, expires - (pending ? DHT_MESSAGE_TTL : CONTROL_TTL), (pending?.message[1] ?? 0) - 3e4));
13595
13861
  const identity = !reseal && this.state.peerPinned && this.state.peerPinned !== "can" && this.pinned()?.identity || this.identity;
13596
13862
  const away = !!this.options.credentials.peerKey && now - this.peerNewAt >= 6e5;
13597
- const options = keepAlive && (this.live || away) ? { background: true } : void 0;
13863
+ const options = this.leavingOut ? { signal: true } : keepAlive && (this.live || away) ? { background: true } : void 0;
13598
13864
  const held = this.options.transport.publishHeld?.(identity.pubKeyZ32, options);
13599
13865
  if (held) {
13600
13866
  await this.heldBack(held, now, {
@@ -13646,6 +13912,7 @@ var DhtDelivery = class DhtDelivery {
13646
13912
  throw error;
13647
13913
  }
13648
13914
  this.namedRev = body[8] ?? void 0;
13915
+ if (options?.signal) this.leavingOut = false;
13649
13916
  if (identity === this.identity) this.unsealedOut = !this.options.credentials.peerKey;
13650
13917
  delete this.errors.publish;
13651
13918
  this.changed();
@@ -13995,8 +14262,9 @@ var DhtDelivery = class DhtDelivery {
13995
14262
  await this.serialize(async () => {
13996
14263
  if (!this.running) return;
13997
14264
  const background = !this.urgent && this.pollMs >= STREAM_POLL_MS;
13998
- const signal = this.signalReads > 0;
14265
+ const signal = this.signalReads > 0 && !this.leavingRead;
13999
14266
  this.urgent = false;
14267
+ this.leavingRead = false;
14000
14268
  if (signal) this.signalReads--;
14001
14269
  if (!this.options.credentials.peerKey && !this.options.credentials.expectedPeerKey && !this.state.sequence) await this.publishOnTick();
14002
14270
  const readAt = Date.now();
@@ -14010,7 +14278,10 @@ var DhtDelivery = class DhtDelivery {
14010
14278
  else if (readAt >= this.networkBackAt) this.errors.read = `Could not read DHT delivery: ${error instanceof Error ? error.message : String(error)}`;
14011
14279
  }
14012
14280
  if (signal && this.readHeldUntil > 0) this.signalReads++;
14013
- if (this.state.peerMode !== "dht") this.signalReads = 0;
14281
+ if (this.state.peerMode !== "dht") {
14282
+ this.signalReads = 0;
14283
+ this.probeAt = this.probeGap = 0;
14284
+ }
14014
14285
  await this.publishOnTick();
14015
14286
  this.changed();
14016
14287
  });
@@ -15237,6 +15508,8 @@ var TransportSwitch = class {
15237
15508
  /** This side chose while no session was open: the next one begins with it as a choice. */
15238
15509
  apart = false;
15239
15510
  policiesRead = new RateWindow(10, POLICY_RECEIVE_WINDOW_MS);
15511
+ /** The session on which the contact's policy, the one read already, was said again and read for free (`handle`). */
15512
+ repeatRead = "";
15240
15513
  policyHeld = null;
15241
15514
  constructor(options) {
15242
15515
  this.options = options;
@@ -15551,7 +15824,8 @@ var TransportSwitch = class {
15551
15824
  if (frame.t === "paired-policy") {
15552
15825
  const policy = parsePolicy(frame.policy);
15553
15826
  if (!policy || this.remote && (policy.revision < this.remote.revision || policy.revision === this.remote.revision && JSON.stringify(policy) !== JSON.stringify(this.remote))) return true;
15554
- if (!this.policiesRead.take()) {
15827
+ if (!!this.remote && policy.revision === this.remote.revision && this.repeatRead !== this.context) this.repeatRead = this.context;
15828
+ else if (!this.policiesRead.take()) {
15555
15829
  if (this.policyHeld) this.policyHeld.frame = frame;
15556
15830
  else this.policyHeld = {
15557
15831
  frame,
@@ -15856,7 +16130,7 @@ async function verifyPeerProof(event, c, readStorage) {
15856
16130
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
15857
16131
  } else if (c.adapter === "keet-import") {
15858
16132
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
15859
- const { default: IdentityKey } = await import("./keet-identity-key-BT3p-YEj.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
16133
+ const { default: IdentityKey } = await import("./keet-identity-key-DJbA1oSW.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
15860
16134
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
15861
16135
  } else throw new Error("Unsupported proof adapter");
15862
16136
  }
@@ -16070,15 +16344,43 @@ var lastOf = (timeline, side, proofs) => {
16070
16344
  for (let i = timeline.length - 1; i >= 0; i--) if (timeline[i].side === side && proofs.includes(timeline[i].proof)) return i;
16071
16345
  return -1;
16072
16346
  };
16347
+ /** The contact's share of this kind still not verified (checking, or failed): the one its next attempt takes over. */
16348
+ var unverifiedOf = (timeline, provider) => {
16349
+ for (let i = timeline.length - 1; i >= 0; i--) {
16350
+ const e = timeline[i];
16351
+ if (e.side === "theirs" && e.kind === "shared" && e.state !== "verified" && e.provider === provider) return i;
16352
+ }
16353
+ return -1;
16354
+ };
16073
16355
  /**
16074
16356
  * The timeline after one step. A share already on it is updated in place, never repeated: a request sent again at
16075
16357
  * a reconnect, a second share of a proof the contact already verified. A new attempt after a failure or a stop is
16076
- * a new entry. A stop is written once; a withdrawal later found revoked becomes a revocation in place.
16358
+ * a new entry, except the contact's own not verified: those keep one entry per kind, which its next attempt takes
16359
+ * over in place (its id and time stay, so no new sound and the chat does not move). The ids and the kind are the
16360
+ * contact's to choose, so otherwise its requests alone could push every other entry, this side's too, out of the
16361
+ * bound. A stop is written once; a withdrawal later found revoked becomes a revocation in place.
16077
16362
  */
16078
16363
  function applyIdentityEvent(timeline, event, at) {
16079
16364
  const out = [...timeline];
16080
16365
  const i = lastOf(out, event.side, event.type === "result" ? [event.proof, event.requested] : [event.proof]);
16081
16366
  const last = i >= 0 ? out[i] : void 0;
16367
+ /** Puts the contact's attempt on the entry of its kind still not verified, if there is one. */
16368
+ const takeOver = (entry) => {
16369
+ const j = event.side === "theirs" ? unverifiedOf(out, entry.provider) : -1;
16370
+ if (j < 0) return false;
16371
+ out[j] = {
16372
+ id: out[j].id,
16373
+ proof: entry.proof,
16374
+ side: "theirs",
16375
+ kind: "shared",
16376
+ provider: entry.provider,
16377
+ ...entry.subject ? { subject: entry.subject } : {},
16378
+ state: entry.state,
16379
+ ...entry.error ? { error: entry.error } : {},
16380
+ at: out[j].at
16381
+ };
16382
+ return true;
16383
+ };
16082
16384
  const add = (entry) => {
16083
16385
  const prefix = `${entry.side}:${entry.proof}:`;
16084
16386
  let n = 0;
@@ -16099,6 +16401,12 @@ function applyIdentityEvent(timeline, event, at) {
16099
16401
  };
16100
16402
  break;
16101
16403
  }
16404
+ if (takeOver({
16405
+ proof: event.proof,
16406
+ provider: event.provider,
16407
+ subject: event.subject,
16408
+ state: "verifying"
16409
+ })) break;
16102
16410
  add({
16103
16411
  proof: event.proof,
16104
16412
  side: event.side,
@@ -16124,6 +16432,12 @@ function applyIdentityEvent(timeline, event, at) {
16124
16432
  };
16125
16433
  break;
16126
16434
  }
16435
+ if (!event.ok && event.provider && takeOver({
16436
+ proof: event.proof,
16437
+ provider: event.provider,
16438
+ subject: event.subject,
16439
+ ...settled
16440
+ })) break;
16127
16441
  if (event.provider) add({
16128
16442
  proof: event.proof,
16129
16443
  side: event.side,
@@ -16201,6 +16515,19 @@ var IDENTITY_MAX_RECEIVED = 16;
16201
16515
  /** `idp-*` frames a paired session reads from the contact per `IDENTITY_FRAME_WINDOW_MS`; the rest are dropped unread. */
16202
16516
  var IDENTITY_FRAME_LIMIT = 40;
16203
16517
  var IDENTITY_FRAME_WINDOW_MS = 6e4;
16518
+ /**
16519
+ * A proof this side holds verified, presented again with the same evidence between the same keys, is answered from that
16520
+ * check while it is younger than this (seconds): the contact chooses how often it presents, and each check costs this
16521
+ * device a provider lookup (a forge's per-IP quota, a DNS query, a contact's server) and a Pkarr read. An hour keeps an
16522
+ * answer as fresh as a re-share can expect; past it, and between, the daily re-check (or Check again) asks the provider.
16523
+ */
16524
+ var IDENTITY_REUSE_CHECK_S = 3600;
16525
+ /**
16526
+ * Presentations a verifier checks with their provider per contact in an hour; past it the contact is told the check
16527
+ * could not run. Room for every proof it may keep (`IDENTITY_MAX_RECEIVED`) and a few retries: a contact making fresh
16528
+ * proofs cannot spend a forge's per-IP quota (GitHub: 60 an hour) for every chat and app on this network.
16529
+ */
16530
+ var IDENTITY_MAX_CHECKS_PER_HOUR = 20;
16204
16531
  var IDENTITY_PROVIDER_ID = /^[a-z][a-z0-9-]{0,31}$/;
16205
16532
  /** Printable ASCII without spaces, so the statement can be built but never needs parsing. */
16206
16533
  var IDENTITY_SUBJECT = /^[\x21-\x7e]{1,512}$/;
@@ -16376,6 +16703,7 @@ var IdentityCheckUnavailable = class extends Error {
16376
16703
  /** What the contact is told when the check failed with an IdentityCheckUnavailable. */
16377
16704
  var IDENTITY_CHECK_UNAVAILABLE = "Your contact's app could not check it. Try again later.";
16378
16705
  var TOO_MANY_RECEIVED = "Your contact keeps too many identities from you already";
16706
+ var NEWER_HELD = "Your contact keeps a newer proof of this identity from you";
16379
16707
  var peerError = (e) => e instanceof IdentityCheckUnavailable ? IDENTITY_CHECK_UNAVAILABLE : shortError(e);
16380
16708
  var UNSUPPORTED_KIND = "Your contact's app cannot verify this kind of identity yet";
16381
16709
  var NOT_IN_PROFILE = "That identity is no longer in your profile";
@@ -16387,7 +16715,8 @@ var CONTACT_REFUSALS = /* @__PURE__ */ new Set([
16387
16715
  IDENTITY_CHECK_UNAVAILABLE,
16388
16716
  TOO_MANY_RECEIVED,
16389
16717
  REVOKED,
16390
- EXPIRED
16718
+ EXPIRED,
16719
+ NEWER_HELD
16391
16720
  ]);
16392
16721
  /**
16393
16722
  * Why a share of mine was not accepted, as this app may say it under my identity: one of the refusals above or my own
@@ -16412,6 +16741,8 @@ var IdentityExchange = class {
16412
16741
  requested = /* @__PURE__ */ new Set();
16413
16742
  /** The nonces of the presentations in their provider's check now. */
16414
16743
  checking = /* @__PURE__ */ new Set();
16744
+ /** When the contact's presentations were checked with their provider (seconds), for `IDENTITY_MAX_CHECKS_PER_HOUR`. */
16745
+ checks = [];
16415
16746
  constructor(options) {
16416
16747
  this.options = options;
16417
16748
  }
@@ -16812,6 +17143,10 @@ var IdentityExchange = class {
16812
17143
  let reason;
16813
17144
  /** Its owner withdrew the proof while this check ran: no result goes out (see below). */
16814
17145
  let withdrawn = false;
17146
+ /** The check could not run on this side (IdentityCheckUnavailable). */
17147
+ let unavailable = false;
17148
+ /** The same proof this side holds verified, checked recently: its answer is reused (`IDENTITY_REUSE_CHECK_S`). */
17149
+ let reused;
16815
17150
  try {
16816
17151
  const mayReplace = (r) => r.binding.provider === binding.provider && (r.binding.subject === binding.subject || r.verified.subject === binding.subject);
16817
17152
  if (revokedHere(this.options.storage.read().received, id)) throw new Error(REVOKED);
@@ -16819,13 +17154,21 @@ var IdentityExchange = class {
16819
17154
  if (JSON.stringify(evidence ?? null).length > 16384) throw new Error("Evidence too large");
16820
17155
  if (!verifyIdentityPresentation(binding.key, sig, id, scope, nonce, issuedAt)) throw new Error("The proof key did not sign this conversation's challenge");
16821
17156
  if (binding.issuedAt > now + 300) throw new Error("The proof is dated in the future");
16822
- const result = boundVerifiedIdentity(await this.options.verify(statement, evidence));
17157
+ const evidenceJson = JSON.stringify(evidence ?? null);
17158
+ reused = this.options.storage.read().received.find((r) => r.id === id && r.status === "verified" && r.presenter === scope.subject && r.audience === scope.audience && r.context === scope.context && r.checkedAt <= now && now - r.checkedAt < 3600 && JSON.stringify(r.evidence ?? null) === evidenceJson);
17159
+ if (!reused) {
17160
+ this.checks = this.checks.filter((t) => t > now - 3600 && t <= now);
17161
+ if (this.checks.length >= 20) throw new IdentityCheckUnavailable("Too many of this contact's proofs to check this hour");
17162
+ this.checks.push(now);
17163
+ }
17164
+ const result = reused ? reused.verified : boundVerifiedIdentity(await this.options.verify(statement, evidence));
16823
17165
  if (Math.min(binding.expiresAt, result.expiresAt ?? Infinity) <= now) throw new Error(EXPIRED);
16824
- if (await this.options.revoked?.(statement).catch(() => false)) throw new Error(REVOKED);
17166
+ if (!reused && await this.options.revoked?.(statement).catch(() => false)) throw new Error(REVOKED);
16825
17167
  verified = result;
16826
17168
  } catch (e) {
16827
17169
  error = peerError(e);
16828
17170
  reason = shortError(e);
17171
+ unavailable = e instanceof IdentityCheckUnavailable;
16829
17172
  }
16830
17173
  await this.options.storage.update((l) => {
16831
17174
  const challenge = challengeOf(l);
@@ -16841,11 +17184,27 @@ var IdentityExchange = class {
16841
17184
  verified = void 0;
16842
17185
  error = reason = REVOKED;
16843
17186
  }
17187
+ if (verified && l.received.some((r) => r.id !== id && r.binding.provider === binding.provider && r.verified.subject === subject && r.binding.issuedAt > binding.issuedAt && standing(r, now))) {
17188
+ verified = void 0;
17189
+ error = reason = NEWER_HELD;
17190
+ }
17191
+ const prior = reused && l.received.find((r) => r.id === id);
17192
+ if (verified && reused && prior?.status !== (withdrawn ? "withdrawn" : "verified")) {
17193
+ verified = void 0;
17194
+ error = IDENTITY_CHECK_UNAVAILABLE;
17195
+ reason = "It was checked again while it was presented";
17196
+ }
16844
17197
  const received = verified && receivedWithRoom(l.received, id, (r) => r.binding.provider === binding.provider && r.verified.subject === subject, now);
16845
17198
  if (verified && !received) {
16846
17199
  verified = void 0;
16847
17200
  error = reason = TOO_MANY_RECEIVED;
16848
17201
  }
17202
+ const held = verified ? void 0 : l.received.find((r) => r.id === id && r.presenter === scope.subject && r.audience === scope.audience && (r.status === "verified" || r.status === "unconfirmed"));
17203
+ const stands = held?.status === "verified" && unavailable;
17204
+ if (stands) {
17205
+ verified = held.verified;
17206
+ error = reason = void 0;
17207
+ }
16849
17208
  const logged = this.log(l, {
16850
17209
  type: "result",
16851
17210
  side: "theirs",
@@ -16856,10 +17215,20 @@ var IdentityExchange = class {
16856
17215
  ok: !!verified,
16857
17216
  ...reason ? { error: reason } : {}
16858
17217
  });
16859
- if (!verified || !received) return {
17218
+ if (stands) return {
16860
17219
  ...logged,
16861
17220
  challenges
16862
17221
  };
17222
+ if (!verified || !received) return {
17223
+ ...logged,
17224
+ challenges,
17225
+ received: held && !unavailable ? l.received.map((r) => r === held ? {
17226
+ ...r,
17227
+ checkedAt: now,
17228
+ status: "unconfirmed",
17229
+ error: reason
17230
+ } : r) : l.received
17231
+ };
16863
17232
  const record = {
16864
17233
  id,
16865
17234
  binding,
@@ -16868,8 +17237,8 @@ var IdentityExchange = class {
16868
17237
  presenter: scope.subject,
16869
17238
  audience: scope.audience,
16870
17239
  context: scope.context,
16871
- verifiedAt: now,
16872
- checkedAt: now,
17240
+ verifiedAt: prior?.verifiedAt ?? now,
17241
+ checkedAt: prior?.checkedAt ?? now,
16873
17242
  status: withdrawn ? "withdrawn" : "verified"
16874
17243
  };
16875
17244
  const kept = l.received.filter((r) => r.id !== id && !received.includes(r) && r.binding.provider === binding.provider && r.verified.subject === subject && r.status !== "withdrawn" && r.status !== "revoked").reduce((out, r) => this.log(out, {
@@ -17233,9 +17602,12 @@ var CapsExchange = class {
17233
17602
  running = false;
17234
17603
  lastRead = 0;
17235
17604
  readTimer = null;
17605
+ readBackground = false;
17236
17606
  /** The newest revision of the contact's record an envelope named, and the reads made again since for it. */
17237
17607
  named = -1;
17238
17608
  retries = 0;
17609
+ /** A revision named since the last new record read started the read-again chain: the next ones named are only background reads. */
17610
+ chased = false;
17239
17611
  retryTimer = null;
17240
17612
  /** What the last publication of this run carried. */
17241
17613
  lastOut;
@@ -17349,22 +17721,38 @@ var CapsExchange = class {
17349
17721
  const age = Date.now() - (this.state.publishedAt ?? 0);
17350
17722
  this.timer = setTimeout(() => void this.update().catch(() => {}), inMs ?? Math.max(6e4, 36e5 - age));
17351
17723
  }
17352
- /** An envelope named this revision of the contact's record: read it when it is newer than the one known. */
17724
+ /**
17725
+ * An envelope named this revision of the contact's record: read it when it is newer than the one known. The number is
17726
+ * the contact's word, not a record: read at the spacing. The first one named since the last new record read is read as
17727
+ * the chat's own (not background) and starts the read-again chain over: a chat waits on it (a transport chosen, a
17728
+ * descriptor), and while a link signals the relays hand a held background read the old copy. Any other is background
17729
+ * upkeep until a new record is read. An envelope every 4 s naming a higher one each time made 45 reads a minute.
17730
+ */
17353
17731
  peerRev(rev) {
17354
17732
  if (!Number.isSafeInteger(rev) || rev <= (this.state.peer?.rev ?? -1)) return;
17355
- if (rev > this.named) {
17356
- this.named = rev;
17733
+ const chase = rev > this.named && !this.chased;
17734
+ if (rev > this.named) this.named = rev;
17735
+ if (chase) {
17736
+ this.chased = true;
17357
17737
  this.retries = 0;
17358
17738
  }
17359
- this.refresh(true);
17739
+ this.refresh(false, !chase);
17360
17740
  }
17361
- /** Reads the contact's record now (or right after the last read, when that was a moment ago). */
17362
- refresh(force = false) {
17363
- if (!this.running || this.readTimer) return;
17741
+ /**
17742
+ * Reads the contact's record now (or right after the last read, when that was a moment ago). `background`: upkeep,
17743
+ * on the background share of the relays' budget; a read asked for meanwhile that is not makes it one that is not.
17744
+ */
17745
+ refresh(force = false, background = false) {
17746
+ if (!this.running) return;
17747
+ if (this.readTimer) {
17748
+ this.readBackground &&= background;
17749
+ return;
17750
+ }
17751
+ this.readBackground = background;
17364
17752
  const wait = force ? 0 : Math.max(0, this.lastRead + CAPS_READ_SPACING_MS - Date.now());
17365
17753
  const run = () => {
17366
17754
  this.readTimer = null;
17367
- this.read().catch(() => {});
17755
+ this.read(this.readBackground ? { background: true } : void 0).catch(() => {});
17368
17756
  };
17369
17757
  if (!wait) {
17370
17758
  this.readTimer = setTimeout(run, 0);
@@ -17373,11 +17761,11 @@ var CapsExchange = class {
17373
17761
  this.readTimer = setTimeout(run, wait);
17374
17762
  }
17375
17763
  /** Reads and checks the contact's record; the last good one stays when this one is refused. */
17376
- read() {
17764
+ read(options) {
17377
17765
  return this.serialize(async () => {
17378
17766
  if (!this.running) return this.state.peer;
17379
17767
  this.lastRead = Date.now();
17380
- const packet = await this.options.transport.resolve(this.keys.peerAddress);
17768
+ const packet = await this.options.transport.resolve(this.keys.peerAddress, options);
17381
17769
  if (!packet || !this.running) return this.state.peer;
17382
17770
  let record;
17383
17771
  try {
@@ -17392,6 +17780,7 @@ var CapsExchange = class {
17392
17780
  if (this.state.peer && record.rev === this.state.peer.rev && record.author === this.state.peer.author) return this.state.peer;
17393
17781
  await this.persist({ peer: record });
17394
17782
  this.retries = 0;
17783
+ this.chased = false;
17395
17784
  this.options.changed?.(record);
17396
17785
  return record;
17397
17786
  }, "readChain").finally(() => this.readAgainIfBehind());
@@ -17400,7 +17789,8 @@ var CapsExchange = class {
17400
17789
  * Read again in a moment, a few times at most, while the record known is short of what the contact has: of the
17401
17790
  * revision an envelope named, or of a descriptor for a native transport it lists (its endpoint was still starting)
17402
17791
  * that this side runs too. Its next revision, with the descriptor, is named only once, by an envelope that may
17403
- * come before the record is out; without it neither side could dial the other.
17792
+ * come before the record is out; without it neither side could dial the other. Started over only by a new record read,
17793
+ * the first revision named after one, or this side's own endpoint coming up: the chat's reads, not background ones.
17404
17794
  */
17405
17795
  readAgainIfBehind() {
17406
17796
  if (this.retryTimer) clearTimeout(this.retryTimer);
@@ -23658,8 +24048,11 @@ var GhostLink = class {
23658
24048
  if (!this.dht || this.dht.peerMode !== "dht" || this.deliveryMode === "dht" || !presence.online) return;
23659
24049
  if (Date.now() - presenceSeenAt(presence) >= 3e4 || presence.lastPacketAt === this.leftDhtSeenFor) return;
23660
24050
  this.leftDhtSeenFor = presence.lastPacketAt;
23661
- traceLink(this.myPubKeyZ32, "peer-link-packet", { age: Date.now() - presenceSeenAt(presence) });
23662
- this.dht.expect(EXPECT_PEER_MS, true);
24051
+ const read = this.dht.peerLinkPacket(EXPECT_PEER_MS);
24052
+ traceLink(this.myPubKeyZ32, "peer-link-packet", {
24053
+ age: Date.now() - presenceSeenAt(presence),
24054
+ ...!read && { held: true }
24055
+ });
23663
24056
  }
23664
24057
  /**
23665
24058
  * The contact dials (a WebRTC offer signed by its pinned key, or a connection on a native endpoint) while its
@@ -23667,14 +24060,22 @@ var GhostLink = class {
23667
24060
  * room for the presence `peerMayHaveLeftDht` looks at, so the mailbox is read now and at the DHT pace for a while
23668
24061
  * here too. The offer is kept and answered, and the dial taken, once that read unblocks the stream. False when
23669
24062
  * something else blocks it (this side is DHT-only, the contact is not pinned, or the offer is not the contact's).
24063
+ * A connection on a native endpoint (no `signal`) proves nothing yet: anyone who can dial the endpoint can open one,
24064
+ * with any identities, and only the session it carries, which waits for this read, authenticates it. The reads it
24065
+ * starts are held as a fresh link packet's are (`peerLinkPacket`); the connection is kept for them all the same.
23670
24066
  */
23671
24067
  peerDialsFromDht(signal) {
23672
24068
  if (!this.dht || this.dht.peerMode !== "dht" || this.deliveryMode === "dht") return false;
23673
24069
  const credentials = this.options.pairing?.credentials;
23674
24070
  if (!credentials?.peerKey) return false;
23675
24071
  if (signal !== void 0 && !verifyPairedSignal(signal, this.options.params.peerPubKeyZ32, this.myPubKeyZ32, credentials.peerKey, true)) return false;
23676
- traceLink(this.myPubKeyZ32, "peer-dials", { signal: signal !== void 0 });
23677
- this.dht.expect(EXPECT_PEER_MS, true);
24072
+ let read = true;
24073
+ if (signal !== void 0) this.dht.expect(EXPECT_PEER_MS, true);
24074
+ else read = this.dht.peerLinkPacket(EXPECT_PEER_MS);
24075
+ traceLink(this.myPubKeyZ32, "peer-dials", {
24076
+ signal: signal !== void 0,
24077
+ ...!read && { held: true }
24078
+ });
23678
24079
  return true;
23679
24080
  }
23680
24081
  get isDataLinkOpen() {
@@ -23824,7 +24225,10 @@ var GhostLink = class {
23824
24225
  if (mode === "dht") {
23825
24226
  this.disconnect();
23826
24227
  this.heldSignal = null;
23827
- } else if (!this.quietForTaken) this.session.start();
24228
+ } else if (!this.quietForTaken) {
24229
+ if (this.myPubKeyZ32 > this.options.params.peerPubKeyZ32) this.session.presenceDue();
24230
+ this.session.start();
24231
+ }
23828
24232
  await this.dht.setMode(mode);
23829
24233
  if (mode === "dht") {
23830
24234
  await this.session.stop(false);
@@ -25252,6 +25656,10 @@ var GhostLink = class {
25252
25656
  get dhtPendingId() {
25253
25657
  return this.dht?.pendingId;
25254
25658
  }
25659
+ /** The last DHT send of this text went nowhere: no relay holds it, and it is off the floor (`DhtDelivery.wentNowhereFor`). */
25660
+ dhtWentNowhere(id) {
25661
+ return !!this.dht?.wentNowhereFor(id);
25662
+ }
25255
25663
  /** What went on the DHT floor under this id needs no more retries there (it went live, or was withdrawn). */
25256
25664
  async settleDht(id) {
25257
25665
  await this.dht?.acknowledge(id);
@@ -28476,13 +28884,14 @@ async function withoutPictureMetadata(source, mime) {
28476
28884
  /**
28477
28885
  * What a video leaves with. An MP4 or QuickTime file says more than its frames: its `udta` and `meta` boxes hold where
28478
28886
  * it was recorded (`©xyz`, `com.apple.quicktime.location.ISO6709`), the device, often its software; a timed metadata
28479
- * track (an iPhone's location and motion, a GoPro's GPS) holds them sample by sample; the movie's, each track's and
28887
+ * track (an iPhone's location and motion, a GoPro's GPS) holds them sample by sample, a caption track (a drone's, a
28888
+ * dashcam's) a line of them each second; the movie's, each track's and
28480
28889
  * each track's media header (`mvhd`, `tkhd`, `mdhd`) say when it was recorded, to the second, and a camera's timecode
28481
28890
  * track the time of day. The sender removes them before the file is stored and its digest computed, without decoding
28482
28891
  * or re-encoding a frame: each such box becomes a `free` box of the same size, zeroed, the headers' creation and
28483
28892
  * modification times are zeroed (0 is "unknown"), the space already left in it (`free`, `skip`, `wide`: what an edit in
28484
28893
  * place left behind, a recorder's GPS log) is zeroed after its header, so are the names of its handlers and of the
28485
- * compressor that made its frames, and each metadata and timecode track's samples are zeroed where they are, so no
28894
+ * compressor that made its frames, and each metadata, timecode and caption track's samples are zeroed where they are, so no
28486
28895
  * offset in the file moves and it plays as it did. Only the boxes' headers, `moov` and `moof` are read; the
28487
28896
  * media goes untouched.
28488
28897
  *
@@ -28595,14 +29004,10 @@ var CONTAINERS = /* @__PURE__ */ new Set([
28595
29004
  "mvex",
28596
29005
  "traf"
28597
29006
  ]);
28598
- /** Track handlers kept as they are: picture, sound, text and subtitles, timecode, hints. `meta` tracks have their samples zeroed, `tmcd` ones too. */
29007
+ /** Track handlers kept as they are: picture, sound, timecode, hints. `meta` tracks have their samples zeroed, `tmcd` ones and `CAPTIONS` too. */
28599
29008
  var HANDLERS = /* @__PURE__ */ new Set([
28600
29009
  "vide",
28601
29010
  "soun",
28602
- "text",
28603
- "sbtl",
28604
- "subt",
28605
- "clcp",
28606
29011
  "tmcd",
28607
29012
  "hint",
28608
29013
  "auxv",
@@ -28611,6 +29016,16 @@ var HANDLERS = /* @__PURE__ */ new Set([
28611
29016
  "odsm",
28612
29017
  "subp"
28613
29018
  ]);
29019
+ /**
29020
+ * Text, subtitle and caption tracks: what a recorder writes there is a log (a drone's or a dashcam's GPS, home point,
29021
+ * date and time each second), so their samples are zeroed, in `moov`'s tables and in fragments alike; they show nothing.
29022
+ */
29023
+ var CAPTIONS = /* @__PURE__ */ new Set([
29024
+ "text",
29025
+ "sbtl",
29026
+ "subt",
29027
+ "clcp"
29028
+ ]);
28614
29029
  /** The handlers whose sample descriptions are a visual one's, a compressor's name in each. */
28615
29030
  var VISUAL = /* @__PURE__ */ new Set([
28616
29031
  "vide",
@@ -28773,7 +29188,8 @@ function defaultSampleSizes(moov) {
28773
29188
  * The byte ranges of a fragment's samples in the file, one per track run (`trun`), from its `moof` read whole (`at` its
28774
29189
  * offset in the file): each run starts at its data offset from its track fragment's base (`tfhd`'s base data offset,
28775
29190
  * else the `moof`'s start for the first track fragment or one that says so, else where the previous one's data ended),
28776
- * or where the previous run ended; its length is its samples' sizes, its own or `tfhd`'s or `trex`'s default.
29191
+ * or where the previous run ended; its length is its samples' sizes, its own or `tfhd`'s or `trex`'s default. Each
29192
+ * with its track's ID.
28777
29193
  */
28778
29194
  function fragmentRanges(b, at, sizes) {
28779
29195
  const ranges = [];
@@ -28791,7 +29207,8 @@ function fragmentRanges(b, at, sizes) {
28791
29207
  }
28792
29208
  if (flags & 2) field += 4;
28793
29209
  if (flags & 8) field += 4;
28794
- let size = sizes.get(u32be(b, tfhd.body + 4));
29210
+ const track = u32be(b, tfhd.body + 4);
29211
+ let size = sizes.get(track);
28795
29212
  if (flags & 16) {
28796
29213
  check(field + 4 <= tfhd.end);
28797
29214
  size = u32be(b, field);
@@ -28824,7 +29241,11 @@ function fragmentRanges(b, at, sizes) {
28824
29241
  length = count * size;
28825
29242
  }
28826
29243
  check(Number.isSafeInteger(next) && Number.isSafeInteger(next + length));
28827
- if (length) ranges.push([next, next + length]);
29244
+ if (length) ranges.push([
29245
+ next,
29246
+ next + length,
29247
+ track
29248
+ ]);
28828
29249
  next += length;
28829
29250
  }
28830
29251
  previous = next;
@@ -28839,12 +29260,13 @@ function selfContained(b, minf) {
28839
29260
  }
28840
29261
  /**
28841
29262
  * `moov` with its metadata boxes emptied and its headers' times zeroed, read whole: whether it has a video track, the
28842
- * byte ranges of its metadata and timecode tracks' samples (zeroed by the caller where they are), whether it has a
28843
- * metadata or timecode track, and every track's sample table.
29263
+ * byte ranges of its metadata, timecode and caption tracks' samples (zeroed by the caller where they are), whether it
29264
+ * has a metadata or timecode track, every track's sample table, and the IDs of its caption tracks (their samples in
29265
+ * fragments zeroed too).
28844
29266
  */
28845
29267
  function stripMoov(b) {
28846
29268
  let video = false, fragmented = false, metadata = false;
28847
- const zeroed = [], tables = [];
29269
+ const zeroed = [], tables = [], captions = /* @__PURE__ */ new Set();
28848
29270
  for (const box of boxes(b, header(b, 0, b.length).body, b.length)) {
28849
29271
  if (METADATA.has(box.type)) {
28850
29272
  empty(b, box);
@@ -28858,14 +29280,18 @@ function stripMoov(b) {
28858
29280
  emptyWithin(b, box.body, box.end);
28859
29281
  }
28860
29282
  if (box.type !== "trak") continue;
28861
- let mdia;
29283
+ let mdia, tkhd;
28862
29284
  for (const part of boxes(b, box.body, box.end)) {
28863
29285
  if (METADATA.has(part.type)) {
28864
29286
  empty(b, part);
28865
29287
  continue;
28866
29288
  }
28867
29289
  check(TRAK_KEEPS.has(part.type));
28868
- if (part.type === "tkhd") zeroTimes(b, part);
29290
+ if (part.type === "tkhd") {
29291
+ check(!tkhd);
29292
+ tkhd = part;
29293
+ zeroTimes(b, part);
29294
+ }
28869
29295
  if (part.type === "mdia") {
28870
29296
  check(!mdia);
28871
29297
  mdia = part;
@@ -28886,6 +29312,12 @@ function stripMoov(b) {
28886
29312
  } else if (handler === "tmcd" && selfContained(b, minf)) {
28887
29313
  metadata = true;
28888
29314
  for (const range of sampleRanges(b, stbl)) zeroed.push(range);
29315
+ } else if (CAPTIONS.has(handler)) {
29316
+ check(selfContained(b, minf) && !!tkhd);
29317
+ const id = tkhd.body + 4 + (b[tkhd.body] === 1 ? 16 : 8);
29318
+ check(id + 4 <= tkhd.end);
29319
+ captions.add(u32be(b, id));
29320
+ for (const range of sampleRanges(b, stbl)) zeroed.push(range);
28889
29321
  } else check(HANDLERS.has(handler));
28890
29322
  if (handler === "vide") video = true;
28891
29323
  if (VISUAL.has(handler)) zeroCompressorNames(b, stbl);
@@ -28896,7 +29328,8 @@ function stripMoov(b) {
28896
29328
  fragmented,
28897
29329
  metadata,
28898
29330
  zeroed,
28899
- tables
29331
+ tables,
29332
+ captions
28900
29333
  };
28901
29334
  }
28902
29335
  /**
@@ -29025,7 +29458,7 @@ async function videoMetadataPatches(file, mime) {
29025
29458
  }
29026
29459
  check(moovs.length === 1);
29027
29460
  const moov = await whole(source, moovs[0]);
29028
- const { video, fragmented, metadata, zeroed, tables } = stripMoov(moov);
29461
+ const { video, fragmented, metadata, zeroed, tables, captions } = stripMoov(moov);
29029
29462
  if (!video && !typed) return void 0;
29030
29463
  patches.push({
29031
29464
  start: moovs[0].start,
@@ -29040,10 +29473,13 @@ async function videoMetadataPatches(file, mime) {
29040
29473
  }
29041
29474
  }
29042
29475
  check(!fragmented || !metadata);
29043
- const sizes = dropped.length && fragmented ? defaultSampleSizes(moov) : void 0;
29476
+ const sizes = (dropped.length || captions.size) && fragmented ? defaultSampleSizes(moov) : void 0;
29044
29477
  for (const box of top) if (box.type === "moof") {
29045
29478
  const moof = await whole(source, box);
29046
- if (dropped.length) for (const [start, end] of fragmentRanges(moof, box.start, sizes ?? /* @__PURE__ */ new Map())) check(!meets(dropped, start, end));
29479
+ if (dropped.length || captions.size) for (const [start, end, track] of fragmentRanges(moof, box.start, sizes ?? /* @__PURE__ */ new Map())) {
29480
+ check(!meets(dropped, start, end));
29481
+ if (captions.has(track)) zeroed.push([start, end]);
29482
+ }
29047
29483
  emptyWithin(moof, box.body - box.start, moof.length);
29048
29484
  patches.push({
29049
29485
  start: box.start,
@@ -29417,7 +29853,8 @@ function findLightningDestination(text) {
29417
29853
  };
29418
29854
  }
29419
29855
  var hex = (bytes) => Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
29420
- var reason = (value) => typeof value === "string" ? value.replace(/\s+/g, " ").slice(0, 200) : "";
29856
+ /** A server's own words on one line, bounded, with no character that hides text or reorders what follows it. */
29857
+ var reason = (value) => typeof value === "string" ? stripHidden(value.replace(/\s+/g, " ")).slice(0, 200) : "";
29421
29858
  var isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value);
29422
29859
  async function readBounded(response, maxBytes) {
29423
29860
  const reader = response.body?.getReader?.();
@@ -29568,6 +30005,16 @@ function invoiceCallbackUrl(params, amountSat, comment) {
29568
30005
  }
29569
30006
  return url.href;
29570
30007
  }
30008
+ /** A success action's link: HTTPS, bounded, and no user part ("https://www.paypal.com@evil.example" opens evil.example). */
30009
+ function successUrl(text) {
30010
+ if (!/^https:\/\//i.test(text) || text.length > LNURL_LIMITS.maxUrlLength) return false;
30011
+ try {
30012
+ const url = new URL(text);
30013
+ return !url.username && !url.password;
30014
+ } catch {
30015
+ return false;
30016
+ }
30017
+ }
29571
30018
  /**
29572
30019
  * Checks the invoice a service answered with (LUD-06): the amount asked, a payment hash, not expired, and
29573
30020
  * a commitment to the metadata the person was shown: the `h` tag is its sha256, or the invoice carries the
@@ -29577,7 +30024,7 @@ function parseInvoiceCallback(body, params, amountSat) {
29577
30024
  if (!isRecord(body) || typeof body.pr !== "string") throw new Error(`${params.callbackDomain} did not answer with an invoice`);
29578
30025
  const invoice = decodeBolt11(body.pr);
29579
30026
  if (!invoice) throw new Error(`${params.callbackDomain} answered with an invoice that does not decode`);
29580
- if (invoice.amountMsat !== BigInt(amountSat) * 1000n) throw new Error(`The invoice asks for ${invoice.amountSat === null ? "any amount" : `${invoice.amountSat.toLocaleString()} sats`}, not the ${amountSat.toLocaleString()} sats you chose`);
30027
+ if (invoice.amountMsat !== BigInt(amountSat) * 1000n) throw new Error(`The invoice asks for ${invoice.amountSat === null ? "any amount" : `${invoice.amountSat.toLocaleString("en-US")} sats`}, not the ${amountSat.toLocaleString("en-US")} sats you chose`);
29581
30028
  if (!invoice.paymentHash) throw new Error("The invoice has no payment hash");
29582
30029
  if (invoice.descriptionHash !== params.descriptionHash && invoice.description !== params.metadata) throw new Error("The invoice does not commit to what the service said the payment is for");
29583
30030
  if (invoice.expiresAt * 1e3 < Date.now()) throw new Error("The invoice the service answered with has already expired");
@@ -29588,7 +30035,7 @@ function parseInvoiceCallback(body, params, amountSat) {
29588
30035
  tag: "message",
29589
30036
  message: reason(action.message)
29590
30037
  };
29591
- else if (action.tag === "url" && typeof action.url === "string" && /^https:\/\//i.test(action.url) && action.url.length <= LNURL_LIMITS.maxUrlLength) successAction = {
30038
+ else if (action.tag === "url" && typeof action.url === "string" && successUrl(action.url)) successAction = {
29592
30039
  tag: "url",
29593
30040
  description: reason(action.description),
29594
30041
  url: action.url
@@ -31030,7 +31477,7 @@ function parseDidJws(input) {
31030
31477
  }
31031
31478
  if (!isObject$6(header)) throw new DidError("The JWS header is not a JSON object");
31032
31479
  const alg = header.alg;
31033
- if (typeof alg !== "string" || !DID_JWS_ALGS[alg]) throw new DidError(`The JWS uses ${typeof alg === "string" ? alg.slice(0, 16) : "no algorithm"}: Ghostly checks EdDSA, ES256K and ES256`);
31480
+ if (typeof alg !== "string" || !DID_JWS_ALGS[alg]) throw new DidError(`The JWS uses ${typeof alg === "string" ? "another algorithm" : "no algorithm"}: Ghostly checks EdDSA, ES256K and ES256`);
31034
31481
  if (header.kid !== void 0 && (typeof header.kid !== "string" || header.kid.length > 640)) throw new DidError("The JWS kid is not a key id");
31035
31482
  if (header.b64 !== void 0 && typeof header.b64 !== "boolean") throw new DidError("The JWS b64 header is not true or false");
31036
31483
  const crit = header.crit;
@@ -31077,7 +31524,7 @@ function verifyWith(key, signature, message, format = "compact") {
31077
31524
  return false;
31078
31525
  }
31079
31526
  }
31080
- var refusedKey = (key) => new DidError(`Signed by ${key.id}, which the DID document does not list under authentication or assertionMethod`);
31527
+ var refusedKey = () => new DidError("Signed by a key the DID document does not list under authentication or assertionMethod");
31081
31528
  /**
31082
31529
  * Which key of `doc` made this JWS over one of `messages` (the statement, and the statement with a
31083
31530
  * trailing newline some tools add). With a `kid`, only that key is tried. Refused unless the key is
@@ -31088,9 +31535,9 @@ function checkDidJws(input, messages, doc) {
31088
31535
  let candidates = doc.keys.filter((k) => k.curve === jws.curve);
31089
31536
  if (jws.kid !== void 0) {
31090
31537
  const kid = methodId(doc.did, jws.kid);
31091
- if (!kid) throw new DidError(`The JWS names key ${jws.kid.slice(0, 100)}, which is not a key of ${doc.did}`);
31538
+ if (!kid) throw new DidError(`The JWS names a key that is not a key of ${doc.did}`);
31092
31539
  candidates = candidates.filter((k) => k.id === kid);
31093
- if (!candidates.length) throw new DidError(doc.keys.some((k) => k.id === kid) ? `Key ${kid} is not a ${jws.curve} key: the JWS says ${jws.alg}` : `The DID document lists no key ${kid}`);
31540
+ if (!candidates.length) throw new DidError(doc.keys.some((k) => k.id === kid) ? `The key the JWS names is not a ${jws.curve} key: the JWS says ${jws.alg}` : "The DID document does not list the key the JWS names");
31094
31541
  }
31095
31542
  if (!candidates.length) throw new DidError(`The DID document lists no ${jws.curve} key for ${jws.alg}`);
31096
31543
  let inputs;
@@ -31112,7 +31559,7 @@ function checkDidJws(input, messages, doc) {
31112
31559
  alg: jws.alg
31113
31560
  };
31114
31561
  }
31115
- if (refused) throw refusedKey(refused);
31562
+ if (refused) throw refusedKey();
31116
31563
  throw new DidError("The JWS signature does not match: sign exactly the statement shown, with a key of this DID");
31117
31564
  }
31118
31565
  /**
@@ -31124,9 +31571,9 @@ function checkDidSignature(signature, messages, doc, vm) {
31124
31571
  let candidates = doc.keys;
31125
31572
  if (vm !== void 0) {
31126
31573
  const id = methodId(doc.did, vm);
31127
- if (!id) throw new DidError(`${vm.slice(0, 100)} is not a key of ${doc.did}`);
31574
+ if (!id) throw new DidError(`The proof names a key that is not a key of ${doc.did}`);
31128
31575
  candidates = candidates.filter((k) => k.id === id);
31129
- if (!candidates.length) throw new DidError(`The DID document lists no key ${id}`);
31576
+ if (!candidates.length) throw new DidError("The DID document does not list the key the proof names");
31130
31577
  }
31131
31578
  const der = signature.length !== 64 && signature[0] === 48;
31132
31579
  if (signature.length !== 64 && !der) throw new DidError("A signature is 64 bytes (or DER, for ECDSA)");
@@ -31145,7 +31592,7 @@ function checkDidSignature(signature, messages, doc, vm) {
31145
31592
  signature: canonical
31146
31593
  };
31147
31594
  }
31148
- if (refused) throw refusedKey(refused);
31595
+ if (refused) throw refusedKey();
31149
31596
  throw new DidError("The signature does not match: sign exactly the statement shown, with a key of this DID");
31150
31597
  }
31151
31598
  function parseDidSignaturePaste(pasted) {
@@ -32436,7 +32883,7 @@ function parseKeyBlob(blob) {
32436
32883
  if (blob.length > 1100) fail("SSH public key too large");
32437
32884
  const r = new Reader(blob);
32438
32885
  const type = r.text(64);
32439
- if (!SSH_KEY_TYPES.includes(type)) fail(`Unsupported SSH key type ${JSON.stringify(type)}`);
32886
+ if (!SSH_KEY_TYPES.includes(type)) fail(`Unsupported SSH key type${type === "ssh-dss" ? " \"ssh-dss\"" : ""}`);
32440
32887
  const key = {
32441
32888
  type,
32442
32889
  blob,
@@ -32549,7 +32996,7 @@ function ecdsaSignature(blob, size) {
32549
32996
  async function verifySshSignature(armored, message, options = {}) {
32550
32997
  const parsed = parseSshSignature(armored);
32551
32998
  const namespace = options.namespace ?? "ghostly";
32552
- if (parsed.namespace !== namespace) fail(`Signed for namespace ${JSON.stringify(parsed.namespace)}, not ${JSON.stringify(namespace)}. Use -n ${namespace}.`);
32999
+ if (parsed.namespace !== namespace) fail(`Signed for another namespace, not ${JSON.stringify(namespace)}. Use -n ${namespace}.`);
32553
33000
  const bytes = typeof message === "string" ? utf8Encode(message) : message;
32554
33001
  const digest = parsed.hashAlgorithm === "sha512" ? sha512(bytes) : sha256(bytes);
32555
33002
  const signed = concatBytes(utf8Encode("SSHSIG"), sshString(utf8Encode(parsed.namespace)), sshString(/* @__PURE__ */ new Uint8Array()), sshString(utf8Encode(parsed.hashAlgorithm)), sshString(digest));
@@ -33176,6 +33623,13 @@ var GROUP_LIMITS = {
33176
33623
  /** Frames waiting for an epoch (or its secret) that has not arrived yet. */
33177
33624
  waiting: 64,
33178
33625
  waitingBytes: 1048576,
33626
+ /**
33627
+ * Of those, and of the edits waiting, the ones signed by a key no recent commit names (a newcomer whose admission has
33628
+ * not come yet, or a key anyone can make up): the newest only, they go first, and they never say I am behind.
33629
+ */
33630
+ waitingStrangers: 8,
33631
+ /** How long a frame or edit waits: then it is dropped, and a later catch-up brings it again if it was real. */
33632
+ waitingMs: 12e4,
33179
33633
  /** Epoch secrets kept: past this, older epochs cannot be read or handed on. */
33180
33634
  secrets: 32,
33181
33635
  /** Secrets in one `group-secrets` frame: apps from before revision 0.9 drop a frame with more. */
@@ -33243,23 +33697,45 @@ var ANSWER_WINDOW_MS$1 = 5e3;
33243
33697
  * hears it, with what the member says live beside it, and the edits its app says again), then
33244
33698
  * `GROUP_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`, as a community's `MessagePace`.
33245
33699
  * One not taken is neither seen nor kept nor passed on, so a sync still names it (`miss`) and a catch-up hands it again.
33246
- * What another member hands on in its answer to my sync is not counted: it took each at its author's pace already, and
33247
- * a catch-up holds many.
33700
+ * What another member hands on in its answer to my sync (or what waited for a secret) is counted too, and may run the
33701
+ * author's allowance below nothing by one answer's worth (`AUTHOR_OWED`): a catch-up holds more than a burst, and lands
33702
+ * at once; the author's next frames wait until the pace pays it back. Not counted, a member at the other end of my sync
33703
+ * handed on all a second member signed, at any rate.
33248
33704
  */
33249
33705
  var AUTHOR_BURST = {
33250
33706
  frames: 2 * GROUP_LIMITS.outlog,
33251
33707
  bytes: 2 * GROUP_LIMITS.outlogBytes
33252
33708
  };
33709
+ /** How far below nothing an answer may run an author's allowance: all its messages one answer hands on, or edits. */
33710
+ var AUTHOR_OWED = {
33711
+ messages: {
33712
+ frames: GROUP_LIMITS.relay,
33713
+ bytes: GROUP_LIMITS.relayBytes
33714
+ },
33715
+ edits: {
33716
+ frames: GROUP_LIMITS.handOnEdits,
33717
+ bytes: GROUP_LIMITS.relayEditBytes
33718
+ }
33719
+ };
33253
33720
  var AuthorPace = class {
33721
+ owed;
33254
33722
  frames = AUTHOR_BURST.frames;
33255
33723
  bytes = AUTHOR_BURST.bytes;
33256
33724
  at;
33257
- take(bytes, now) {
33725
+ constructor(owed) {
33726
+ this.owed = owed;
33727
+ }
33728
+ /** `answer`: handed on in an answer to my sync, or waited, so it may run the allowance below nothing (`owed`). */
33729
+ take(bytes, now, answer = false) {
33258
33730
  const elapsed = Math.max(0, now - (this.at ?? now)) / GROUP_LIMITS.messageWindowMs;
33259
33731
  this.at = now;
33260
33732
  this.frames = Math.min(AUTHOR_BURST.frames, this.frames + elapsed * GROUP_LIMITS.messagesPerAuthor);
33261
33733
  this.bytes = Math.min(AUTHOR_BURST.bytes, this.bytes + elapsed * GROUP_LIMITS.messageBytesPerAuthor);
33262
- if (this.frames < 1 || this.bytes < bytes) return false;
33734
+ const floor = answer ? this.owed : {
33735
+ frames: 0,
33736
+ bytes: 0
33737
+ };
33738
+ if (this.frames + floor.frames < 1 || this.bytes + floor.bytes < bytes) return false;
33263
33739
  this.frames -= 1;
33264
33740
  this.bytes -= bytes;
33265
33741
  return true;
@@ -33595,6 +34071,20 @@ function isMessageFrame$1(v) {
33595
34071
  const f = v;
33596
34072
  return f.t === "group-msg" && typeof f.g === "string" && GROUP_ID.test(f.g) && Number.isSafeInteger(f.e) && f.e >= 0 && typeof f.s === "string" && MEMBER_KEY.test(f.s) && Number.isSafeInteger(f.n) && f.n >= 0 && Number.isSafeInteger(f.ts) && f.ts > 0 && typeof f.nn === "string" && f.nn.length === 32 && B64$1.test(f.nn) && typeof f.c === "string" && f.c.length <= MAX_TEXT_BOX$1 && B64$1.test(f.c) && typeof f.sig === "string" && f.sig.length === 86 && B64$1.test(f.sig);
33597
34073
  }
34074
+ /**
34075
+ * A waiting list past `max` places, past `waitingStrangers` of keys no recent commit names, or past its bytes (`heavy`):
34076
+ * which one goes, or -1. Such a key's oldest first, else the oldest of the author holding the most places, so one
34077
+ * author's frames for an epoch that never comes push out its own, not another member's.
34078
+ */
34079
+ function overflow(list, max, heavy = false) {
34080
+ const strangers = list.filter((w) => w.stranger).length;
34081
+ if (!list.length || !heavy && list.length <= max && strangers <= GROUP_LIMITS.waitingStrangers) return -1;
34082
+ if (strangers) return list.findIndex((w) => w.stranger);
34083
+ const places = /* @__PURE__ */ new Map();
34084
+ for (const w of list) places.set(w.frame.s, (places.get(w.frame.s) ?? 0) + 1);
34085
+ const most = Math.max(...places.values());
34086
+ return list.findIndex((w) => places.get(w.frame.s) === most);
34087
+ }
33598
34088
  /** The chain cut in consecutive pieces of at most `chainPiece` commits and `chainPieceBytes`: a roster of 32 makes a commit ~2.4 KB. */
33599
34089
  function chainPieces(chain) {
33600
34090
  const pieces = [];
@@ -33621,6 +34111,11 @@ var GroupSession = class {
33621
34111
  waitingBytes = 0;
33622
34112
  /** Edits for an epoch, or a secret, not here yet: tried again with the frames above. In memory only. */
33623
34113
  waitingEdits = [];
34114
+ /**
34115
+ * Members one of whose frames waited `waitingMs` for an epoch that never came → when it was dropped: until my chain
34116
+ * moves, theirs waiting say I am behind no more (`behind`). In memory only.
34117
+ */
34118
+ waitedInVain = /* @__PURE__ */ new Map();
33624
34119
  pendingCommits = /* @__PURE__ */ new Map();
33625
34120
  /** When each member was last asked to catch me up, so a stream of unreadable frames is one question, not a loop. */
33626
34121
  asked = /* @__PURE__ */ new Map();
@@ -34550,9 +35045,14 @@ var GroupSession = class {
34550
35045
  await this.resealBehind();
34551
35046
  });
34552
35047
  }
34553
- /** Something is missing here: the current epoch's secret, a commit ahead of my chain, or the epoch of frames waiting. */
35048
+ /**
35049
+ * Something is missing here: the current epoch's secret, a commit ahead of my chain, or the epoch of a member's frames
35050
+ * waiting, unless one of that member's waited in vain since my chain last moved (`waitedInVain`).
35051
+ */
34554
35052
  get behind() {
34555
- return !this.state.secrets[this.epoch] || this.waiting.length > 0 || this.pendingCommits.size > 0;
35053
+ this.expireWaiting();
35054
+ const member = (w) => !w.stranger && !((this.waitedInVain.get(w.frame.s) ?? -Infinity) >= this.chainMovedAt);
35055
+ return !this.state.secrets[this.epoch] || this.waiting.some(member) || this.pendingCommits.size > 0;
34556
35056
  }
34557
35057
  async resealBehind() {
34558
35058
  const alone = new Set(this.state.alone ?? []);
@@ -35069,11 +35569,11 @@ var GroupSession = class {
35069
35569
  }
35070
35570
  const relayed = raw.s !== from;
35071
35571
  const now = this.now(), answer = (this.answering.get(from) ?? 0) > now;
35072
- if (answer) this.answering.set(from, now + ANSWER_WINDOW_MS$1);
35073
35572
  if (relayed && (!rosterHas(this.roster, from) || !this.handsOn(raw.s))) return;
35074
35573
  if (this.isDuplicate(raw)) return;
35075
35574
  const signedWhole = relayed && this.wholeSigned(raw);
35076
35575
  if (!signedWhole && !verify(fromBase64Url(raw.sig), messageSigned$1(raw), publicKeyFromZ32(raw.s))) return;
35576
+ if (answer) this.answering.set(from, now + ANSWER_WINDOW_MS$1);
35077
35577
  if (raw.e > this.epoch) {
35078
35578
  this.park(from, raw);
35079
35579
  return;
@@ -35093,7 +35593,7 @@ var GroupSession = class {
35093
35593
  delete raw.o;
35094
35594
  delete raw.xs;
35095
35595
  }
35096
- if (!(relayed && (answer || waited)) && !this.paced(this.messagePace, raw.s, frameBytes(raw))) return;
35596
+ if (!this.paced(this.messagePace, raw.s, frameBytes(raw), relayed && (answer || waited))) return;
35097
35597
  const first = raw.o === void 0 ? null : readFirstPlace(raw.o, raw.e);
35098
35598
  if (raw.o !== void 0 && !first) return;
35099
35599
  const secret = this.secret(raw.e);
@@ -35180,7 +35680,7 @@ var GroupSession = class {
35180
35680
  }
35181
35681
  const commit = this.state.chain[raw.e];
35182
35682
  if (!commit || !rosterHas(commit.m, raw.s)) return;
35183
- if (!(this.state.relayEdits ?? []).some((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n && f.v >= raw.v) && !(raw.s !== from && (this.awaitsAnswer(from) || waited)) && !this.paced(this.editPace, raw.s, raw.c.length + 400)) return;
35683
+ if (!(this.state.relayEdits ?? []).some((f) => f.s === raw.s && f.e === raw.e && f.n === raw.n && f.v >= raw.v) && !this.paced(this.editPace, raw.s, raw.c.length + 400, raw.s !== from && (this.awaitsAnswer(from) || waited))) return;
35184
35684
  if (!rosterHas(commit.m, this.myKey)) {
35185
35685
  if (member && this.keepEdit(raw)) {
35186
35686
  this.persistSoon();
@@ -35228,16 +35728,20 @@ var GroupSession = class {
35228
35728
  }
35229
35729
  parkEdit(from, frame) {
35230
35730
  if (frame.e > this.epoch + GROUP_LIMITS.secrets) return;
35731
+ this.expireWaiting();
35231
35732
  this.waitingEdits = [...this.waitingEdits.filter((w) => !(w.frame.s === frame.s && w.frame.e === frame.e && w.frame.n === frame.n && w.frame.v <= frame.v)), {
35232
35733
  from,
35233
- frame
35234
- }].slice(-GROUP_LIMITS.outlog);
35734
+ frame,
35735
+ at: this.now(),
35736
+ stranger: this.stranger(frame.s)
35737
+ }];
35738
+ for (let i; (i = overflow(this.waitingEdits, GROUP_LIMITS.outlog)) >= 0;) this.waitingEdits.splice(i, 1);
35235
35739
  this.ask(from);
35236
35740
  }
35237
- paced(paces, author, bytes) {
35741
+ paced(paces, author, bytes, answer) {
35238
35742
  let pace = paces.get(author);
35239
- if (!pace) paces.set(author, pace = new AuthorPace());
35240
- return pace.take(bytes, this.now());
35743
+ if (!pace) paces.set(author, pace = new AuthorPace(paces === this.editPace ? AUTHOR_OWED.edits : AUTHOR_OWED.messages));
35744
+ return pace.take(bytes, this.now(), answer);
35241
35745
  }
35242
35746
  wholeSigned(raw) {
35243
35747
  if (typeof raw.xs !== "string" || raw.xs.length !== 86 || !B64$1.test(raw.xs)) return false;
@@ -35347,15 +35851,31 @@ var GroupSession = class {
35347
35851
  }
35348
35852
  park(from, frame) {
35349
35853
  if (frame.e > this.epoch + GROUP_LIMITS.secrets) return;
35854
+ this.expireWaiting();
35350
35855
  if (this.waiting.some((w) => w.frame.s === frame.s && w.frame.e === frame.e && w.frame.n === frame.n)) return;
35351
35856
  this.waiting.push({
35352
35857
  from,
35353
- frame
35858
+ frame,
35859
+ at: this.now(),
35860
+ stranger: this.stranger(frame.s)
35354
35861
  });
35355
35862
  this.waitingBytes += frame.c.length;
35356
- while (this.waiting.length > GROUP_LIMITS.waiting || this.waitingBytes > GROUP_LIMITS.waitingBytes) this.waitingBytes -= this.waiting.shift().frame.c.length;
35863
+ for (let i; (i = overflow(this.waiting, GROUP_LIMITS.waiting, this.waitingBytes > GROUP_LIMITS.waitingBytes)) >= 0;) this.waitingBytes -= this.waiting.splice(i, 1)[0].frame.c.length;
35357
35864
  this.ask(from);
35358
35865
  }
35866
+ /** Not in the roster, nor in any of the last `secrets` commits: a key whose frames may be no member's. */
35867
+ stranger(key) {
35868
+ return !this.state.chain.slice(-GROUP_LIMITS.secrets).some((c) => rosterHas(c.m, key));
35869
+ }
35870
+ /** Frames and edits that waited `waitingMs`: dropped, and a member's noted (`waitedInVain`). */
35871
+ expireWaiting() {
35872
+ const now = this.now(), stale = (w) => now - w.at >= GROUP_LIMITS.waitingMs;
35873
+ if (!this.waiting.some(stale) && !this.waitingEdits.some(stale)) return;
35874
+ for (const w of this.waiting) if (stale(w) && !w.stranger) this.waitedInVain.set(w.frame.s, now);
35875
+ this.waiting = this.waiting.filter((w) => !stale(w));
35876
+ this.waitingBytes = this.waiting.reduce((sum, w) => sum + w.frame.c.length, 0);
35877
+ this.waitingEdits = this.waitingEdits.filter((w) => !stale(w));
35878
+ }
35359
35879
  /** Whoever sent something I cannot read yet is ahead of me, or holds a secret I lack: ask, but not in a loop. */
35360
35880
  ask(from) {
35361
35881
  const now = Date.now();
@@ -35996,6 +36516,12 @@ var COMMUNITY_LIMITS = {
35996
36516
  window: 64,
35997
36517
  /** Commits known off the main branch. */
35998
36518
  side: 512,
36519
+ /**
36520
+ * Of those, the branches one member's commit ends (its newest), and the commits it signed: a handful of races, and
36521
+ * one full run of its admissions (`memberAdmissions`, with the leaves among them). The admin's are not counted.
36522
+ */
36523
+ sideTips: 8,
36524
+ sideCommits: 64,
35999
36525
  /** Commits waiting for their parent. */
36000
36526
  pendingCommits: 64,
36001
36527
  /** Epoch secrets waiting for their commit. */
@@ -36004,6 +36530,11 @@ var COMMUNITY_LIMITS = {
36004
36530
  pendingMs: 12e4,
36005
36531
  waiting: 64,
36006
36532
  waitingBytes: 1048576,
36533
+ /**
36534
+ * Of those, the ones signed by a key no commit I know names (a newcomer whose admission has not come yet, or a key
36535
+ * anyone can make up): the newest only, they push out nobody else's, and they make no catch-up hurry.
36536
+ */
36537
+ waitingStrangers: 8,
36007
36538
  replay: 256,
36008
36539
  /** Commits in one welcome or chain piece. */
36009
36540
  chainPiece: 100,
@@ -37337,10 +37868,45 @@ var CommunitySession = class CommunitySession {
37337
37868
  seedB64: ""
37338
37869
  };
37339
37870
  }
37340
- /** Side commits stay up to a bound, the most recent ones (a longer branch being assembled included). */
37871
+ /**
37872
+ * Side commits stay up to a bound, the most recent ones (a longer branch being assembled included), and a member's
37873
+ * newest only: past `sideTips` of the branches it ends or `sideCommits` of its commits, its oldest branch goes, from
37874
+ * the tip down, so nothing kept loses its parent. Each is weighed at every commit taken and saved with the group, so
37875
+ * what one member signs off the main branch costs every member a bounded amount. What it signs last is kept, so a
37876
+ * branch it grows still comes in commit by commit (one let go comes again from where it parts in a catch-up).
37877
+ */
37341
37878
  pruneSide() {
37342
- this.state.side = this.state.side.slice(-COMMUNITY_LIMITS.side);
37343
- const keep = new Set(this.state.side.map((c) => communityCommitHash(c)));
37879
+ const admin = this.admin, hashes = /* @__PURE__ */ new Map();
37880
+ const hash = (c) => {
37881
+ let h = hashes.get(c);
37882
+ if (!h) hashes.set(c, h = communityCommitHash(c));
37883
+ return h;
37884
+ };
37885
+ let side = this.state.side.slice(-COMMUNITY_LIMITS.side);
37886
+ for (;;) {
37887
+ const held = new Set(side.map(hash)), parents = new Set(side.map((c) => c.p)), drop = /* @__PURE__ */ new Set();
37888
+ const signed = /* @__PURE__ */ new Map(), tips = /* @__PURE__ */ new Map(), oldest = /* @__PURE__ */ new Map(), cut = /* @__PURE__ */ new Set();
37889
+ for (const c of side) signed.set(c.by, (signed.get(c.by) ?? 0) + 1);
37890
+ for (let i = side.length - 1; i >= 0; i--) {
37891
+ const c = side[i];
37892
+ if (!held.has(c.p) && !this.mainIndex.has(c.p)) {
37893
+ drop.add(c);
37894
+ continue;
37895
+ }
37896
+ if (parents.has(hash(c))) continue;
37897
+ const n = (tips.get(c.by) ?? 0) + 1;
37898
+ tips.set(c.by, n);
37899
+ if (c.by !== admin && n > COMMUNITY_LIMITS.sideTips) {
37900
+ drop.add(c);
37901
+ cut.add(c.by);
37902
+ } else oldest.set(c.by, c);
37903
+ }
37904
+ for (const [by, n] of signed) if (by !== admin && n > COMMUNITY_LIMITS.sideCommits && !cut.has(by) && oldest.has(by)) drop.add(oldest.get(by));
37905
+ if (!drop.size) break;
37906
+ side = side.filter((c) => !drop.has(c));
37907
+ }
37908
+ this.state.side = side;
37909
+ const keep = new Set(side.map(hash));
37344
37910
  for (const [h, c] of [...this.known]) {
37345
37911
  if (this.mainIndex.has(h)) {
37346
37912
  if (this.mainIndex.get(h) < this.state.chain.length - 1 - COMMUNITY_LIMITS.window) this.rosters.delete(h);
@@ -37369,9 +37935,20 @@ var CommunitySession = class CommunitySession {
37369
37935
  if (!Object.keys(bySender).length) delete this.state.seen[sender];
37370
37936
  }
37371
37937
  }
37938
+ /**
37939
+ * Those of the main branch's window always stay, the current epoch's included; side commits, however many are
37940
+ * kept, only get what is left of the bound, the most recent first.
37941
+ */
37372
37942
  pruneSecrets() {
37373
- const order = [...this.state.chain.slice(-COMMUNITY_LIMITS.window - 1), ...this.state.side].map((c) => communityCommitHash(c));
37374
- const keep = new Set(order.slice(-COMMUNITY_LIMITS.secrets));
37943
+ const keep = new Set(this.state.chain.slice(-COMMUNITY_LIMITS.window - 1).map((c) => communityCommitHash(c)));
37944
+ let room = COMMUNITY_LIMITS.secrets - [...keep].filter((h) => this.state.secrets[h]).length;
37945
+ for (let i = this.state.side.length - 1; i >= 0 && room > 0; i--) {
37946
+ const h = communityCommitHash(this.state.side[i]);
37947
+ if (this.state.secrets[h] && !keep.has(h)) {
37948
+ keep.add(h);
37949
+ room--;
37950
+ }
37951
+ }
37375
37952
  for (const h of Object.keys(this.state.secrets)) if (!keep.has(h)) delete this.state.secrets[h];
37376
37953
  }
37377
37954
  /** A derived epoch's secret, from its parent's, when that is held. */
@@ -38617,19 +39194,25 @@ var CommunitySession = class CommunitySession {
38617
39194
  park(from, frame) {
38618
39195
  if (frame.e > this.epoch + COMMUNITY_LIMITS.window) return;
38619
39196
  if (this.waiting.some((w) => w.frame.s === frame.s && w.frame.e === frame.e && w.frame.h === frame.h && w.frame.n === frame.n)) return;
39197
+ const stranger = !rosterHas(this.roster, frame.s) && !this.isRecentMember(frame.s);
38620
39198
  this.waiting.push({
38621
39199
  from,
38622
- frame
39200
+ frame,
39201
+ stranger
38623
39202
  });
38624
39203
  this.waitingBytes += frame.c.length;
38625
- while (this.waiting.length > COMMUNITY_LIMITS.waiting || this.waitingBytes > COMMUNITY_LIMITS.waitingBytes) this.waitingBytes -= this.waiting.shift().frame.c.length;
39204
+ for (;;) {
39205
+ const strangers = this.waiting.filter((w) => w.stranger).length;
39206
+ if (strangers <= COMMUNITY_LIMITS.waitingStrangers && this.waiting.length <= COMMUNITY_LIMITS.waiting && this.waitingBytes <= COMMUNITY_LIMITS.waitingBytes) break;
39207
+ this.waitingBytes -= this.waiting.splice(strangers ? this.waiting.findIndex((w) => w.stranger) : 0, 1)[0].frame.c.length;
39208
+ }
38626
39209
  this.ask(from);
38627
39210
  }
38628
- /** Something is missing here: the current epoch's secret, or the epoch of frames waiting. */
39211
+ /** Something is missing here: the current epoch's secret, or the epoch of a member's frames waiting. */
38629
39212
  get needsCatchUp() {
38630
39213
  if (!this.isMember) return false;
38631
39214
  this.dropStale(this.pendingCommits, this.hooks.clock?.() ?? Date.now());
38632
- return !this.state.secrets[this.topHash] || this.waiting.length > 0 || this.pendingCommits.size > 0;
39215
+ return !this.state.secrets[this.topHash] || this.waiting.some((w) => !w.stranger) || this.pendingCommits.size > 0;
38633
39216
  }
38634
39217
  /** Asks a member I have an edge to for what I lack (the engine calls it now and then while `needsCatchUp`). */
38635
39218
  catchUp(to) {
@@ -40274,6 +40857,6 @@ function x401ApprovalDigest(subject) {
40274
40857
  return toBase64Url(sha256(utf8Encode(canonical)));
40275
40858
  }
40276
40859
  //#endregion
40277
- export { COMMUNITY_LIMITS as $, WRITE_FIRST_MS as $C, TURN_VERSION as $S, HANDOFF_HAVE as $_, DEMOTE_AFTER_FAILURES as $a, yieldThread as $b, APP_RANGE_DATA_KIND as $c, isPublicAddress as $d, EDIT_BUFFER_MS as $f, offerIsFresh as $g, DEPARTED_READ_MS as $h, isSparkAddress as $i, PairedSession as $l, rosterHas as $m, MessageRefusal as $n, SIGNAL_CARRIERS as $o, pairedReplyAuthor as $p, DidError as $r, TYPING_SEND_LIMIT as $s, GROUP_EDIT_TEXT_BYTES as $t, STORAGE_ROOT as $u, readHandoffHello as $v, trimEndOf as $w, createChatInvite as $x, KNOCK_SLOTS as $y, readX401ProofResponseHeader as A, CHAT_WATCH_SHARE as AC, verifyDeviceTransports as AS, parseLinkRecords as A_, findBolt11 as Aa, stampHolds as Ab, WAKE_INTERVAL_MS as Ac, relayedTransports as Ad, RECORDING_TYPES as Af, resolveTargetUrl as Ag, ratchetOpen as Ah, jwkThumbprint as Ai, isChatAppId as Al, usageLeft as Am, parseGroupMetaBody as An, ENGINE_ERRORS as Ao, COMMUNITY_REACTION_FRAME as Ap, parseAtprotoDidDocument as Ar, readLobby as As, knockRecords as At, IdentityCheckUnavailable as Au, handoffFileRequestFrame as Av, readDnsName as Aw, readImageMeta as Ax, enrollMessage as Ay, APP_STORE_KINDS as B, HEDGE_MS as BC, TOMBSTONE_SEQUENCE as BS, servicesFromWire as B_, videoMetadataPatches as Ba, appDigest as Bb, wakeFrame as Bc, DNS_LABEL as Bd, voiceDownloadName as Bf, PROTOCOL_VERSION as Bg, GATHER_STALL_MS as Bh, TEST_USDT_FAUCET_AMOUNT as Bi, KNOWN_SESSION_CAPABILITIES as Bl, GROUP_VERSION_LARGE as Bm, SSH_PUBLIC_KEY_MAX as Bn, GROUP_WANT_NO_FRAME as Bo, queueReaction as Bp, parseAtprotoDidKey as Br, FILE_LIMITS as Bs, groupWakes as Bt, isIdentityBinding as Bu, handoffVerifiedFrame as Bv, generateEncryptionKey as Bw, DEVICE_INVITE_LIFETIME_S as Bx, NEW_PER_HOUR as By, buildX401TokenObject as C, ANSWER_READ_SPACING_MS as CC, deviceLinkRendezvousSeed as CS, waitForIceGathering as C_, parseInvoiceCallback as Ca, mergeContactKnocks as Cb, pinnedFrame as Cc, automaticTransport as Cd, FileTransfers as Cf, GhostlyHttpError as Cg, RATCHET_KEEP_MS as Ch, decodeDidDhtPacket as Ci, AppSessions as Cl, checkStatusCard as Cm, groupMetaPicture as Cn, WAKE_ANSWER_GRACE_MS as Co, parseLinkPreview as Cp, ATPROTO_PROOF_SCOPE as Cr, mergeBeacon as Cs, KNOCK_TTL_MS as Ct, IDENTITY_MAX_RECEIVED as Cu, handoffContext as Cv, openRelayPayload as Cw, verifyAppStatementBytes as Cx, ENROLL_PROOF as Cy, readX401ProofRequest as D, CHAT_RESERVE as DC, newDeviceSetSecret as DS, buildLinkRecords as D_, resolveLightningDestination as Da, requestPlaintextBytes as Db, WAKE_CALL_TTL_SECONDS as Dc, irohRelayUrl as Dd, sanitizeFileName as Df, formatLocalTarget as Dg, isRatcheted as Dh, didDhtRecords as Di, appOpenFrame as Dl, statusCardBytes as Dm, keepPastGroupMeta as Dn, pairedMessageFrame as Do, forwardedAgain as Dp, checkAtprotoProofRecord as Dr, rankHubs as Ds, entryParams as Dt, IDENTITY_REVOCATION_LABEL as Du, handoffDoneFrame as Dv, decodeDnsAnswers as Dw, isImageMime as Dx, enrollDoneFrame as Dy, isX401Protocol as E, BACKGROUND_WRITES_SHARE as EC, devicePingFrame as ES, RECORD_TTL as E_, requestLnurlInvoice as Ea, readLinkRecord as Eb, WAKE_CALL_INTERVAL_MS as Ec, irohDescriptor as Ed, safeBlobType as Ef, VIEWER_SERVICE_CSP as Eg, emptyRatchetState as Eh, didDhtKey as Ei, appDataFrame as El, sameButtonText as Em, groupName as En, pairedMessageFits as Eo, FORWARD_LIMITS as Ep, atprotoProofRkey as Er, pickHubs as Es, encodeGroupEntryLink as Et, IDENTITY_PROVIDER_ID as Eu, handoffDigest as Ev, signRelayPayload as Ew, imageSize as Ex, enrollDigits as Ey, appRevocationFor as F, GROUP_BURST_ONE_LINK as FC, TURN_SETTLE_MS as FS, decodeServices as F_, isFederationId as Fa, APP_FORBIDDEN_KEYS as Fb, newWakeToken as Fc, HoldKeys as Fd, fileMessageText as Ff, withViewerPolicy as Fg, ANSWER_REFUSED_REDIALS as Fh, EVM_TEST_CHAINS as Fi, BUTTONS_CAPABILITY as Fl, receivedTimestamp as Fm, verifyGroupMetaSignature as Fn, PairingTracker as Fo, REACTION_LIMITS as Fp, decodeAtprotoCommit as Fr, PairedCalls as Fs, GROUP_WAKE_GROUP_WINDOW_MS as Ft, identityPresentationBytes as Fu, handoffPakeFrame as Fv, publicKeyFromZ32 as Fw, CONTACT_LINK_VERSION as Fx, verifyEnrollProof as Fy, readAppStore as G, RelaysFailedError as GC, TURN_MAX as GS, HANDOFF_BUSY as G_, stripPictureMetadata as Ga, findAppForbiddenKey as Gb, WebPushError as Gc, DOMAIN_TXT_MAX_BYTES as Gd, PLAYABLE_VIDEO as Gf, sendBody as Gg, DIRECT_EVIDENCE_MS as Gh, assertWholeSats as Gi, STATUS_CARD_CAPABILITY as Gl, OWN_FRAME_LIMIT as Gm, sshFingerprint as Gn, readGroupHave as Go, readDhtReactions as Gp, verifyAtprotoSignature as Gr, sentWhole as Gs, GROUP_READ_NOTE as Gt, verifyIdentityPresentation as Gu, openHandoffPiece as Gv, jpegSize$1 as Gw, encodeDeviceInvite as Gx, newInbox as Gy, checkAppListing as H, RELAY_REQUESTS_PER_MINUTE as HC, TURN_BODY_BYTES as HS, viewerTag as H_, NO_PICTURE_METADATA as Ha, assembleAppBundle as Hb, wakeRequest as Hc, DOMAIN_FILE_MAX_BYTES as Hd, voiceLevel as Hf, decodeControl as Hg, OFFER_HOST_GATHER_MS as Hh, WALLET_NETWORKS as Hi, REACTIONS_CAPABILITY as Hl, MAX_GROUP_CHAIN as Hm, parseSshPublicKey as Hn, groupFileFallback as Ho, reactionEmoji as Hp, readAtprotoCid as Hr, decodeFileData as Hs, parseGroupWakeFrame as Ht, receivedIdentityStatus as Hu, handoffVersions as Hv, tryDecrypt as Hw, createDeviceInvite as Hx, clearMissed as Hy, appStoreDecision as I, GROUP_OVER_PACE_MS as IC, TURN_VISIBLE_MS as IS, encodeServices as I_, parseCashuRequestPayload as Ia, APP_ICON_PATH as Ib, parseWakeFrame as Ic, HoldRefusedError as Id, formatVoiceDuration as If, CHUNK_FLAG_END as Ig, CONNECT_TIMEOUT_MS as Ih, ONCHAIN_PROVIDER as Ii, CALLS_CAPABILITY as Il, shownTime as Im, wrapGroupMeta as In, GROUP_FILE_LIMITS as Io, ReactionWindow as Ip, decodeDagCbor as Ir, parsePairedCallFrame as Is, GROUP_WAKE_MEMBER_INTERVAL_MS as It, identityRefusal as Iu, handoffReleaseFrame as Iv, sign as Iw, createContactLink as Ix, FLOOD_PER_DAY as Iy, GROUP_TYPING_FRAME as J, SLOW_DEMOTE_MS as JC, TURN_REV_LIMIT as JS, HANDOFF_CANCEL_REASONS as J_, ANSWERS_REFUSED_PAUSE_MS as Ja, isAppUrl as Jb, encryptPushPayload as Jc, decodeDnsResponse as Jd, isPlayableVideoType as Jf, DATA_CHANNEL_LABEL as Jg, DirectPathWatch as Jh, parsePaymentAmount as Ji, UPGRADE_CAPABILITY as Jl, commitUntaggedHash as Jm, verifySshSignature as Jn, CARRIED_DEFER_MS as Jo, wireReaction as Jp, DID_GHOSTLY_SERVICE as Jr, TYPING_FRAME as Js, chainPieces as Jt, lastSharedWithMe as Ju, readHandoffCancel as Jv, dropLoneJoiners as Jw, INVITE_HRP as Jx, takeRequest as Jy, readAppStoreSteps as K, SIGNALING_ALLOWANCE_SHARE as KC, TURN_NAME_BYTES as KS, HANDOFF_BUSY_REASONS as K_, withoutPictureMetadata as Ka, isAppLicense as Kb, checkPushEndpoint as Kc, NIP05_PATH as Kd, VIDEO_LIMITS as Kf, wrapDataChannel as Kg, DIRECT_OWN_ATTEMPTS as Kh, formatPaymentAmount as Ki, SessionCapabilities as Kl, SAID_AGAIN as Km, sshKeyDigestHex as Kn, readGroupWant as Ko, readReaction as Kp, DID_DOCUMENT_MAX_BYTES as Kr, transferEnded as Ks, GroupSession as Kt, IDENTITY_TIMELINE_MAX as Ku, readHandoffAck as Kv, sanitizeAvatar as Kw, readDeviceInvite as Kx, planKnocks as Ky, appUpdateDecision as L, GROUP_RATION_WINDOW_MS as LC, classifyTurnRead as LS, isValidServiceId as L_, parseFedimintRequestPayload as La, APP_PERMISSIONS as Lb, readWake as Lc, isHoldUrl as Ld, isPlayableAudioType as Lf, CHUNK_KIND as Lg, DATA_SETTLE_MS as Lh, PaymentPreflightError as Li, EDIT_CAPABILITY as Ll, GROUP_ADMIN_OFF_ERROR as Lm, SSHSIG_MAX_ARMOR as Ln, GROUP_HAVE_FRAME as Lo, nextReactionNumber as Lp, encodeDagCbor as Lr, ChatFiles as Ls, GROUP_WAKE_RECEIVE_LIMIT as Lt, identityRevocationValue as Lu, handoffRequestFrame as Lv, verify as Lw, encodeContactLink as Lx, MAX_DONE as Ly, readX401ProofResultHeader as M, DEPARTED_READS as MC, webCryptoSigner as MS, LEGACY_SERVICES as M_, cashuRequestPayload as Ma, APP_BUNDLE_MAGIC as Mb, WAKE_TTL_SECONDS as Mc, HOLD_CAPABILITY as Md, VOICE_METER as Mf, sanitizeResponseHeaders as Mg, ratchetSeal as Mh, resolveDidDht as Mi, readAppFrame as Ml, arrivalKey as Mm, parseGroupMetaStatement as Mn, engineError as Mo, QUICK_REACTIONS as Mp, AtprotoCid as Mr, validHead as Ms, readKnocks as Mt, boundIdentityDisplay as Mu, handoffHelloFrame as Mv, createIdentity as Mw, canonicalJsonBytes as Mx, formatEnrollDigits as My, x401AnswerableRequests as N, FRESH_READ_MS as NC, TURN_PUT_WINDOW_MS as NS, MAX_SERVICES as N_, fedimintRequestPayload as Na, APP_CLIENTS as Nb, WakeLimiter as Nc, HOLD_DATED_BACK_MS as Nd, baseMime as Nf, viewerResponseHeaders as Ng, ratchetSessionOf as Nh, signDidDhtPacket as Ni, APPS_CAPABILITY as Nl, claimedTime as Nm, parseGroupMetaTag as Nn, engineText as No, REACTED_FRAME as Np, AtprotoProofError as Nr, MAX_PAIRED_CALL_SIGNAL as Ns, GROUP_WAKE_FRAME as Nt, boundVerifiedIdentity as Nu, handoffManifestFrames as Nv, identityFromSeed as Nw, readCanonicalJson as Nx, readEnrollGrant as Ny, readX401ProofRequestHeader as O, CHAT_RESERVE_MOST_SHARE as OC, signDeviceTransports as OS, emptyLinkRecords as O_, BOLT11_PATTERN as Oa, requestRecords as Ob, WAKE_CALL_WAIT_MS as Oc, rankTransports as Od, sanitizeMime as Of, parseLocalTarget as Og, ratchetHeard as Oh, encodeDidDhtDeactivated as Oi, chatAppId as Ol, statusCardText as Om, nextGroupMetaRevision as On, parsePaymentNetworks as Oo, forwardedMany as Op, isAtprotoDid as Or, readBeacon as Os, groupEntryUrl as Ot, IDENTITY_STATEMENT_PREFIX as Ou, handoffEphemeral as Ov, decodeTxtPacket as Ow, parseImageMeta as Ox, enrollGrantFrame as Oy, addedAppPermissions as P, GROUP_BURST_MS as PC, TURN_RAISE_READ_TIMEOUT_MS as PS, SERVICES_VERSION as P_, findEndpoint as Pa, APP_CLIENT_NAME as Pb, deviceWakeRequest as Pc, HOLD_LIMITS as Pd, downsamplePeaks as Pf, webLocalFetch as Pg, ratchetUnknownSession as Ph, ETHEREUM_USDT as Pi, APP_RANGES_CAPABILITY as Pl, heardTime as Pm, signGroupMeta as Pn, parseEngineError as Po, REACTION_FRAME as Pp, atprotoCidFor as Pr, PAIRED_CALL_FRAME as Ps, GROUP_WAKE_GROUP_LIMIT as Pt, emptyIdentityLedger as Pu, handoffOfferFrame as Pv, identityFromSeedB64 as Pw, CONTACT_LINK_BYTES as Px, readEnrollHello as Py, sealGroupTyping as Q, WAY_BACK_SHARE as QC, TURN_TTL as QS, HANDOFF_FILE_REQUEST as Q_, CROSSED_WAIT_MS as Qa, sha256Paced as Qb, vapidKeysMatch as Qc, encodeDnsQuery as Qd, EDIT_BUFFER_MAX as Qf, extractRtcParams as Qg, DAEMON_WATCH_PEER_IDLE_MS as Qh, SPARK_PROVIDER as Qi, PAIRED_PROFILE as Ql, rosterAdmin as Qm, BIP322_REVISION as Qn, SIGNALS_PER_MINUTE as Qo, groupReplyAuthor as Qp, DID_METHODS as Qr, TYPING_REFRESH_MS as Qs, GROUP_EDIT_FRAME as Qt, STORAGE_LIFETIME as Qu, readHandoffHave as Qv, stripHidden as Qw, OwnInviteError as Qx, ContactRequestError as Qy, checkAppBeforeRun as R, GROUP_SIGNALING_ALLOWANCE_SHARE as RC, keptAtEqualSequence as RS, isViewerTag as R_, NO_VIDEO_METADATA as Ra, APP_SCREENSHOTS_DIR as Rb, readWakePayload as Rc, newMailbox as Rd, parseVoiceMeta as Rf, LIMITS as Rg, DataLink as Rh, SEPOLIA_TEST_USDT as Ri, FILES_BINARY_CAPABILITY as Rl, GROUP_ID as Rm, SSHSIG_NAMESPACE as Rn, GROUP_VERSION_FILES as Ro, parseReactedFrame as Rp, findInMst as Rr, FILE_DATA_KIND as Rs, GroupWakeLimiter as Rt, identityStatement as Ru, handoffRetryAfter as Rv, decrypt as Rw, readContactLink as Rx, MAX_MISSED as Ry, buildX401ResultArtifact as S, ANSWER_READ_FIRST_MS as SC, deviceLinkParams as SS, signalHasVideo as S_, invoiceCallbackUrl as Sa, makeStampPaced as Sb, pinNumberHolds as Sc, TRANSPORTS as Sd, readDhtFile as Sf, unusedInviteWait as Sg, RATCHET_HEADER_BYTES as Sh, DidDhtError as Si, APP_VERSION_MAX as Sl, cardUrl as Sm, groupMetaNewer as Sn, UNPROVEN_AUTH_MS as So, linksIn as Sp, ATPROTO_PROOF_COLLECTION as Sr, lobbyRecords as Ss, GROUP_ENTRY_PROFILE as St, IDENTITY_MAX_FRAME as Su, handoffCancelFrame as Sv, newerPacket as Sw, verifyAppSignature as Sx, ENROLL_HELLO as Sy, encodeX401Header as T, BACKGROUND_WHILE_SIGNALING as TC, deviceLinkSecret as TS, MAX_MSGS_PAYLOAD_B64 as T_, parsePayParams as Ta, readKnockSlot as Tb, DEVICE_WAKE_TTL_SECONDS as Tc, dialableIrohRelay as Td, formatFileSize as Tf, HttpHost as Tg, RatchetBox as Th, didDhtFromPublicKey as Ti, appDataBytes as Tl, removedCardText as Tm, groupMetaToHand as Tn, pairedEditFits as To, sanitizePreviewImage as Tp, atprotoProofRecord as Tr, newerHead as Ts, decodeGroupEntryLink as Tt, IDENTITY_PROOF_CAPABILITY as Tu, handoffDataFrame as Tv, readOwnRelayPayload as Tw, exifOrientation as Tx, enrollCancelReason as Ty, checkAppStoreIndex as U, REQUESTS_PER_MINUTE as UC, TURN_LABEL as US, HANDOFF_ACK as U_, PICTURE_METADATA_LIMITS as Ua, buildAppBundle as Ub, PUSH_PAD_BYTES as Uc, DOMAIN_MAX_RECORDS as Ud, voiceLevelsOf as Uf, encodeChunk as Ug, REANSWERS as Uh, arkAddressPrefix as Ui, SERVICES_CAPABILITY as Ul, MAX_GROUP_MEMBERS as Um, parseSshSignature as Un, isGroupMessageId as Uo, reactionFrame as Up, unsignedCommitBytes as Ur, encodeFileData as Us, GROUP_LIMITS as Ut, revokesIdentity as Uu, isHandoffPartName as Uv, MAX_AVATAR_LENGTH as Uw, deviceInviteJoinerKeyZ32 as Ux, endedRequests as Uy, APP_STORE_LIMITS as V, PREVIOUS_DEFAULT_RELAYS as VC, TOMBSTONE_TURN as VS, servicesToWire as V_, withoutVideoMetadata as Va, appViewOf as Vb, wakePayload as Vc, DNS_TYPE as Vd, voiceFileName as Vf, decodeChunk as Vg, LATE_ANSWER_MS as Vh, USDT_PUBLIC_RPC as Vi, PIN_CAPABILITY as Vl, LEGACY_GROUP_MEMBERS as Vm, SshSigError as Vn, fetchesByItself as Vo, reactedFrame as Vp, parseAtprotoVerificationKey as Vr, FileUplink as Vs, mentionedMembers as Vt, newIdentityBinding as Vu, handoffVerifiedMessage as Vv, sealedLength as Vw, DEVICE_INVITE_OWN_DEVICE as Vx, REOPEN_BELOW as Vy, readAppListing as W, RelayTransport as WC, TURN_LAST_SEQUENCE as WS, HANDOFF_ATTEMPTS as W_, isStrippedPicture as Wa, checkAppManifest as Wb, PUSH_SERVICE_HOSTS as Wc, DOMAIN_METHODS as Wd, voicePeaksOf as Wf, encodeControl as Wg, STALLED_EVIDENCE_MS as Wh, assertTokenUnits as Wi, SESSION_CAPABILITIES_FRAME as Wl, MEMBER_KEY as Wm, sameSshKey as Wn, readGroupFileMeta as Wo, reactionIsNewer as Wp, verifyAtprotoRecordProof as Wr, refusalText as Ws, GROUP_REACTED_FRAME as Wt, signIdentityPresentation as Wu, newHandoffId as Wv, MAX_AVATAR_SIDE as Ww, deviceInviteJoinerParams as Wx, inboxRecord as Wy, groupTypingEpoch as X, TURN_SOURCE_TIMEOUT_MS as XC, TURN_SIGNED_BYTES as XS, HANDOFF_DONE as X_, CROSSED_FRESH_MS as Xa, readAppBundle as Xb, pushRequest as Xc, domainTxtRecord as Xd, parseVideoMeta as Xf, RTC_SIGNAL_MAX_AGE_MS as Xg, symmetricNat as Xh, walletNetworkOf as Xi, parseSessionCapabilities as Xl, parseGroupCommit as Xm, legacyMessageHash as Xn, GROUP_SIGNAL_FRAME as Xo, REPLY_ID as Xp, DID_JWS_MAX_LENGTH as Xr, TYPING_RATE_LIMIT as Xs, groupMessageId as Xt, PROOF_CAPABILITY as Xu, readHandoffDone as Xv, sanitizeDisplayText as Xw, INVITE_MAX_LENGTH as Xx, CONTACT_ASKER_FRAME as Xy, GroupTypingBoard as Y, SLOW_MS as YC, TURN_SEALED_BYTES as YS, HANDOFF_DATA as Y_, BLOCKED_DIAL_WAIT_MS as Ya, pacer as Yb, generateVapidKeys as Yc, dnsProofName as Yd, isVideoMime as Yf, RTC_SIGNAL_FUTURE_MS as Yg, directBlocked as Yh, validatePaymentTarget as Yi, WAKE_SESSION_CAPABILITY as Yl, expectedRoster as Ym, isLegacySignature as Yn, CarriedTransport as Yo, PAIRED_REPLY_AUTHORS as Yp, DID_JWS_ALGS as Yr, TYPING_KINDS as Ys, frameBytes as Yt, PROOF_ADAPTERS as Yu, readHandoffData as Yv, hasVisible as Yw, INVITE_LINK_ORIGIN as Yx, turnOff as Yy, openGroupTyping as Z, WATCH_SHARE as ZC, TURN_SLOTS as ZS, HANDOFF_FILE_MISSING as Z_, CROSSED_PROBE_MS as Za, readAppBundleAsync as Zb, vapidAuthorization as Zc, domainWellKnownFile as Zd, EDITED_FRAME as Zf, buildDataSdp as Zg, AWAITING_PEER_MS as Zh, SPARK_NETWORKS as Zi, sessionCapabilitiesFrame as Zl, rememberAlone as Zm, verifyBitcoinMessage as Zn, GROUP_VERSION_SIGNALS as Zo, REPLY_LIMITS as Zp, DID_MAX_LENGTH as Zr, TYPING_RATE_WINDOW_MS as Zs, COMMUNITY_EDIT_FRAME as Zt, PeerProofs as Zu, readHandoffFileFrame as Zv, sanitizeNick as Zw, INVITE_VERSION as Zx, CONTACT_RECORD_TTL as Zy, X401_PROTOCOLS as _, turnSequence as _C, deviceEchoFrame as _S, __toCommonJS as _T, isGlobalIpv4Host as __, pubkyHomeserverOf as _a, knockSlotIdentity as _b, nextPinNumber as _c, validRingKey as _d, emptyDhtDeliveryState as _f, UNUSED_INVITE_UPKEEP_MS as _g, sha256Hex as _h, strictBase64Url as _i, APP_PEER_OPEN_MAX as _l, buttonLabelClash as _m, MAX_GROUP_PICTURE_LENGTH as _n, RACE_RELAYED_MS as _o, LINK_PREVIEW_LIMITS as _p, u32$1 as _r, beaconRecords as _s, shortHash as _t, IDENTITY_CHECK_UNAVAILABLE as _u, handoffAckFrame as _v, PKARR_FUTURE_SKEW_MS as _w, readAppSignature as _x, DEVICE_KINDS as _y, X401_DCQL_LIMITS as a, readTurnBody as aC, inviteOwnership as aS, fromZ32 as aT, QUICK_REDIAL_MS as a_, PUBKY_PROOF_MAX_BYTES as aa, REQUEST_LABEL as ab, parseTypingFrame as ac, proofHash as ad, recordsName as af, MAX_DHT_TEXT_BYTES as ag, GROUP_PROFILE as ah, didWebDocumentUrl as ai, appRangeChunk as al, BUTTON_STYLES as am, validEditText as an, HANDLED_WAIT_MS as ao, MAX_REMOVAL_NUMBER as ap, BitcoinAddressError as ar, readGroupSignal as as, communityHasFrame as at, CAPS_PUBLISH_SPACING_MS as au, HANDOFF_PAKE as av, traceLink as aw, appRefPublisher as ax, sameDigest as ay, buildX401ProofRequest as b, turnVerifierMark as bC, deviceKeyZ32 as bS, pickCallCandidates as b_, fetchLnurlJson as ba, linkRecords as bb, pinFrame as bc, RELAY_URL as bd, dhtFileElements as bf, countUnusedInvite as bg, MAX_SKIPPED_KEYS as bh, DID_DHT_TTL as bi, APP_RESUME_GRACE_MS as bl, cardLinkHost as bm, groupMetaBody as bn, RTC_UNSTARTED_MS as bo, linkEnd as bp, ATPROTO_DECLARED_SCOPE as br, hubRank as bs, verifyCommunityChainPaced as bt, IDENTITY_FRAME_WINDOW_MS as bu, handoffAttemptSucceeded as bv, createRelayPayload as bw, signAppRevocation as bx, ENROLL_DONE as by, readX401DcqlQuery as c, signTurnBody as cC, ownInviteRefusal as cS, toBase64 as cT, buildSdpFromSignal as c_, isPubkyProofFolder as ca, REQUEST_PACKET_BYTES as cb, typingFrame as cc, storageProofBody as cd, wellKnownUrl as cf, OFFER_STEP_MAX as cg, decryptText as ch, didWebFileUrl as ci, appRangeErrorFrame as cl, PR_CHECKS as cm, mentionsBytes as cn, LIVENESS_MISSED_PINGS as co, dhtEditId as cp, decodeAnyBitcoinAddress as cr, NO_HUB_POLICY as cs, communityUntaggedHash as ct, CapsKeys as cu, HANDOFF_RELEASE as cv, BREAKER_MAX_MS as cw, checkAppRevokeStatement as cx, SET_ACK as cy, newX401HolderKey as d, turnInstance as dC, DEVICES_CAPABILITY as dS, utf8Decode as dT, compressSdp as d_, pubkyProofCapability as da, STAMP_BITS_MAX as db, GROUP_PIN_FRAME as dc, verifyNostrProof as dd, DHT_FILE_TOO_LARGE as df, RELAY_POLL_INTERVALS as dg, epochKeys as dh, parseDid as di, encodeAppRangeData as dl, ROUTINE_STATES as dm, wireMentions as dn, PAIRED_FRAME_TOO_LARGE as do, parseEditFrame as dp, decodeWitness as dr, meshRendezvous as ds, encodeCommunityLink as dt, capsDescriptors as du, HANDOFF_VERIFIED as dv, DiscoveryBudgetError as dw, isAppLine as dx, readSetUpdate as dy, TurnRecordError as eC, createLink as eS, unwrapPasted as eT, parseRtcSignal as e_, sparkAddressKind as ea, KNOCK_SLOT_LABEL as eb, TYPING_STATUS_MAX as ec, emptyProofLedger as ed, nip05RootKey as ef, DHT_POLL_INTERVALS as eg, signCommit as eh, checkDidJws as ei, APP_RANGE_ERRORS as el, readReply as em, carryMentions as en, DEMOTE_MS as eo, EDIT_FRAME as ep, bip322MessageHash as er, SIGNAL_FRESH_MS as es, COMMUNITY_PROFILE as et, SESSION_FRAME_MAX as eu, HANDOFF_HELLO as ev, currentRelays as ew, APP_NAME as ex, readHandoffManifest as ey, readX401SdJwtVc as f, turnKeys as fC, DEVICE_CAPABILITIES as fS, utf8Encode as fT, contactRtcConfig as f_, pubkyProofFile as fa, STAMP_BITS_MIN as fb, PINNED_FRAME as fc, verifyPeerProof as fd, DHT_MESSAGE_TTL as ff, SIGNAL_DUE_READS as fg, newEpochSecret as fh, parseDidDocument as fi, isServeId as fl, RUN_RESULTS as fm, GROUP_META_PAST as fn, PAIRING_ATTEMPT_MS as fo, parseEditedFrame as fp, encodeTx as fr, parseHubPolicy as fs, leaveStands as ft, dialDescriptors as fu, HANDOFF_VERSION as fv, budgetRetryMs as fw, isAppRef as fx, setAckFrame as fy, X401_LIMITS as g, turnReleaseMessage as gC, HANDOFF_CAPABILITY as gS, __require as gT, isCandidateAddress as g_, homeserverWebEndpoint as ga, knockHolds as gb, mayPin as gc, ringEvidence as gd, LIVE_POLL_MS as gf, UNUSED_INVITE_READS_PER_MINUTE as gg, sealSecret as gh, staticDidDocument as gi, APP_FRAME as gl, appCardUrl as gm, MAX_GROUP_NAME_LENGTH as gn, RACE_DIRECT_MS as go, LINK_MAX_CHARS as gp, txHash as gr, beaconKeys as gs, rosterHash as gt, IDENTITY_CHALLENGE_WINDOW as gu, filePartName as gv, MAX_DNS_PACKET_BYTES as gw, readAppRevocations as gx, verifySetUpdate as gy, X401_HEADERS as h, turnPayloadSequence as hC, ENROLL_CAPABILITY as hS, __exportAll as hT, heardCallSignal as h_, encodeSvcbPacket as ha, contactDay as hb, PIN_LIMITS as hc, ringClaims as hd, DhtDelivery as hf, TRANSPORTS_GONE_MS as hg, sealPair as hh, signingKeys as hi, APP_DATA_MAX_BYTES as hl, appCardId as hm, MAX_GROUP_NAME_BYTES as hn, RACE_ANSWERED_MS as ho, validRemovalNumber as hp, sha256d as hr, COMMUNITY_TOPOLOGY as hs, leftStatement as ht, parsePacketTransports as hu, filePartDigest as hv, withRequestOptions as hw, readAppRevocationShape as hx, signTombstone as hy, x401ApprovalDigest as i, openTurnValue as iC, inviteLink as iS, fromBase64Url as iT, PAIRED_CALL_CANDIDATES as i_, isBitcoinAddress as ia, REQUEST_CLOCK_SKEW_MS as ib, parseTypingActivity as ic, proofCapability as id, recordsFromWellKnown as if, LinkSession as ig, verifyCommitSignature as ih, didSignedMessages as ii, appRangeCancelFrame as il, BUTTON_ID as im, parseCommunityEdit as in, GhostLink as io, MAX_EDITS_PER_MESSAGE as ip, verifyBip322 as ir, groupSignalFrame as is, communityGroupId as it, CAPS_LIMITS as iu, HANDOFF_OFFER as iv, setLinkTraceSink as iw, appRef as ix, readHandoffVerified as iy, readX401ProofResult as j, DEFAULT_RELAYS as jC, seedSigner as jS, HTTP_SERVICE_PROTO as j_, ENDPOINT as ja, APP_BUNDLE_LIMITS as jb, WAKE_SUBJECT as jc, transportOrder as jd, VOICE_LIMITS as jf, sanitizeRequestHeaders as jg, ratchetRoot as jh, openDidDhtPayload as ji, parseAppFrame as jl, MESSAGE_CLOCK_SKEW_MS as jm, parseGroupMetaFrame as jn, EngineError as jo, GROUP_REACTION_FRAME as jp, shortAtprotoDid as jr, shouldBeHub as js, mergeKnocks as jt, IdentityExchange as ju, handoffHaveFrames as jv, IDENTITY_MEMO_SIZE as jw, canonicalJson as jx, enrollProofFrame as jy, readX401ProofResponse as k, CHAT_RESERVE_PER_CHAT as kC, unsignedDeviceTransports as kS, isEmptyLinkPacket as k_, decodeBolt11 as ka, seenEntry as kb, WAKE_FRAME as kc, relayUrl as kd, PLAYABLE_AUDIO as kf, relativizeLocation as kg, ratchetOn as kh, encodeDidDhtPacket as ki, isAppVersion as kl, taskProgress as km, openGroupMeta as kn, publishFailure as ko, readForwarded as kp, normalizeAtprotoHandle as kr, readBeaconHead as ks, knockIdentity as kt, IDENTITY_SUBJECT as ku, handoffFileMissingFrame as kv, encodeTxtPacket as kw, previewable as kx, enrollHelloFrame as ky, x401VpToken as l, signTurnPacket as lC, pastedAgain as lS, toBase64Url as lT, callRtcConfig as l_, newPubkyProofFolder as la, REQUEST_TEXT_BYTES as lb, typingKindOf as lc, storageProofPath as ld, ACTIVE_DHT_POLL_MS as lf, PRESENCE_HEARTBEAT as lg, edgeParams as lh, didWebHost as li, appRangeGetFrame as ll, PR_STATES as lm, mentionsMember as ln, LIVENESS_PING_MS as lo, editFrame as lp, decodeBitcoinAddress as lr, mayBeHub as ls, decodeCommunityLink as lt, CapsRefusedError as lu, HANDOFF_REQUEST as lv, BREAKER_THRESHOLD as lw, isAppHash as lx, SET_UPDATE as ly, x401HolderJwk as m, turnPacket as mC, DEVICE_PING_FRAME as mS, __esmMin as mT, extractParamsFromSdp as m_, decodeSvcbRecords as ma, contactAskerHolds as mb, PIN_FRAME as mc, ringAuthorization as md, DHT_TEXT_REFUSED as mf, STALLED_LOOK_MS as mg, openSecret as mh, parseDidSignaturePaste as mi, readAppRangeFrame as ml, TASK_STATUSES as mm, MAX_GROUP_META_BODY as mn, PONG_WAIT_MS as mo, validEditNumber as mp, hash160 as mr, wireHubPolicy as ms, leaveStatement3 as mt, encodePacketTransports as mu, NO_ATTEMPTS as mv, isDiscoveryBudgetError as mw, readAppRevocation as mx, setUpdateMessage as my, X401_RESPONSE_MODES as n, firstDeviceSetSecret as nC, encodeGhostlyInvite as nS, concatBytes as nT, CALL_SIGNAL_FUTURE_MS as n_, sparkNetworkOf as na, MAX_SEEN as nb, TypingReceiver as nc, isProofAdapter as nd, parseDomainTxt as nf, FIRST_PUBLISH_MAX_MS as ng, verifyChain as nh, didGhostlyServiceEntry as ni, APP_RANGE_LIMITS as nl, wireReply as nm, communityMessageAuthor as nn, EARLY_DIAL_JOIN_MS as no, EDIT_RECEIVE_LIMIT as np, bip322ToSpend as nr, SIGNAL_PROVEN_MS as ns, GROUP_READ_NOTE_COMMUNITY as nt, CAPS_ISSUED_BACK_MS as nu, HANDOFF_LIST_PER_FRAME as nv, readRelayBody as nw, APP_STATEMENT_LIMITS as nx, readHandoffRelease as ny, matchX401Dcql as o, readTurnPacket as oC, inviteQrSegments as oS, isZ32Key as oT, RTC_CONFIG as o_, PUBKY_PROOF_ROOT as oa, REQUEST_LIFETIME_MS as ob, sanitizeTypingStatus as oc, proofStatement as od, txtValue as of, OFFER_FAST_MS as og, confirmationMatches as oh, didWebFile as oi, appRangeDataFrame as ol, CRON_LINE as om, MENTION_EVERYONE as on, INVITER_DIAL_GRACE_MS as oo, REMOVED_TEXT as op, ByteReader as or, GROUP_VERSION_HUBS as os, communityMessageId as ot, CAPS_REFRESH_MS as ou, HANDOFF_PIECE_BYTES as ov, BREAKER_ALL_DOWN_PROBE_MS as ow, appRevocationId as ox, sealHandoffPiece as oy, sameX401HolderJwk as p, turnName as pC, DEVICE_ECHO_FRAME as pS, __commonJSMin as pT, decompressSdp as p_, pubkyProofPath as pa, contactAskerFrame as pb, PIN_CLOCK_SKEW_MS as pc, RING_LIFETIME as pd, DHT_TEXT_BYTES as pf, SIGNAL_OUT_READS as pg, openPair as ph, parseDidJws as pi, parseAppRangeFrame as pl, STATUS_CARD_LIMITS as pm, GROUP_META_PAST_CHARS as pn, PAIRING_RETRY_MS as po, validEditMessage as pp, encodeWitness as pr, pickMeshHubs as ps, leaveStatement as pt, emptyCapsState as pu, HANDOFF_WINDOW as pv, heldBackError as pw, isAppSignature as px, setUpdateFrame as py, signAppStore as q, SIGNALING_WINDOW_MS as qC, TURN_NO_ACTIVE as qS, HANDOFF_CANCEL as q_, ANSWERS_REFUSED_PAUSES as qa, isAppPath as qb, decryptPushPayload as qc, WELL_KNOWN_PATH as qd, formatVideoDuration as qf, DATA_CHANNEL_ID as qg, DIRECT_PEERS as qh, isWalletNetwork as qi, TYPING_CAPABILITY as ql, commitHash as qm, sshSignCommand as qn, readGroupWantNo as qo, validReactionNumber as qp, DID_FILE_MAX_BYTES as qr, transferStalled as qs, asWritten as qt, applyIdentityEvent as qu, readHandoffBusy as qv, MAX_NICK_LENGTH as qw, DEVICE_INVITE_VERSION as qx, settleRequest as qy, readX401OpenId4VpRequest as r, nextTurnPosition as rC, encodeInviteCode as rS, fromBase64 as rT, CALL_SIGNAL_MAX_AGE_MS as r_, BITCOIN_NETWORKS as ra, MAX_SLOT_KNOCKS as rb, TypingSender as rc, nostrProofTemplate as rd, recordsFromTxt as rf, IDLE_THRESHOLD as rg, verifyCommit as rh, didJwsAlg as ri, AppRanges as rl, ACTIVE_TASK_STATUSES as rm, meshMessageRef as rn, FIRST_PAIRING_PACE_MS as ro, EDIT_SEND_LIMIT as rp, decodeBase64 as rr, SIGNAL_REPLY_MS as rs, communityCommitHash as rt, CAPS_LABEL as ru, HANDOFF_MANIFEST as rv, relayUrlProblem as rw, appFingerprint as rx, readHandoffTurnFrame as ry, presentX401SdJwtVc as s, sealTurnBody as sC, inviteQrText as sS, randomBytes as sT, answersOffer as s_, isPubkyKey as sa, REQUEST_NAME_UNITS as sb, typingActivity as sc, storageProof as sd, validDomainRecord as sf, OFFER_LOOK_MS as sg, confirmationTag as sh, didWebFileNames as si, appRangeEndFrame as sl, ITEM_STATES as sm, MENTION_LIMITS as sn, INVITE_TAKEN as so, RateWindow as sp, compactSize as sr, MESH_HUBS as ss, communityRoster as st, CapsExchange as su, HANDOFF_PIECE_OVERHEAD as sv, BREAKER_BASE_MS as sw, appSignedBytes as sx, sortParts as sy, X401_REQUEST_LIMITS as t, encodeTurnFields as tC, decodeInviteCode as tS, bytesEqual as tT, BURST_RING_MS as t_, sparkInvoiceDetails as ta, LINK_RECORD_LABEL as tb, TYPING_TIMEOUT_MS as tc, importedProof as td, normalizeDomain as tf, EXPECT_PEER_MS as tg, sortRoster as th, checkDidSignature as ti, APP_RANGE_FRAMES as tl, replySnippet as tm, communityEditFrame as tn, DHT_PIN_GRACE_MS as to, EDIT_RATE_WINDOW_MS as tp, bip322ToSign as tr, SIGNAL_HOLD_MS as ts, CommunitySession as tt, SESSION_RECEIVE_PENDING as tu, HANDOFF_LATER_BYTES as tv, normalizeRelayUrl as tw, APP_PREFIXES as tx, readHandoffPake as ty, X401_CREDENTIAL_LIMITS as u, signTurnRelease as uC, readInviteCode as uS, toZ32 as uT, callSignalHeardAt as u_, normalizePubkyKey as ua, STAMP_BITS_DEFAULT as ub, COMMUNITY_PIN_FRAME as uc, validExternalKey as ud, DHT_FILE_REFUSED as uf, PRESENCE_WINDOW as ug, encryptText as uh, normalizeDid as ui, decodeAppRangeData as ul, REMOVABLE_KINDS as um, validMentions as un, MAX_PAIRED_MESSAGE_FRAME as uo, editedFrame as up, decodeTx as ur, meshHubs as us, derivedSecret as ut, DHT_TEXT_CAPABILITY as uu, HANDOFF_TIMINGS as uv, RelayBreaker as uw, isAppKey as ux, encodeSetSlots as uy, X401_SCHEME as v, turnSignedMessage as vC, deviceEchoNonce as vS, keepsToRelays as v_, LIGHTNING_DESTINATION_PATTERN as va, knockSlotOf as vb, parsePinFrame as vc, verifyRingAuthorization as vd, peekDhtMailbox as vf, UNUSED_INVITE_WAIT_MAX_MS as vg, FOLLOW_MS as vh, DID_DHT_MAX_PAYLOAD as vi, APP_RATE_LIMIT as vl, cardEditNumber as vm, encodeGroupMetaBody as vn, REDESCRIBED_GRACE_MS as vo, LINK_TRAILING as vp, u64 as vr, doorHubs as vs, signCommunity as vt, IDENTITY_CLOCK_SKEW as vu, handoffAttemptAllowed as vv, PacketTooLargeError as vw, setAppSignatureFastPath as vx, ENROLL_CANCEL as vy, decodeX401Header as w, BACKGROUND_REQUESTS_PER_MINUTE as wC, deviceLinkSealKey as wS, LABEL$1 as w_, parseLightningDestination as wa, openRequest as wb, readPin as wc, checkedDescriptors as wd, PREVIEWABLE_IMAGE as wf, HttpClient as wg, RATCHET_OVERHEAD as wh, didDhtDocument as wi, appCloseFrame as wl, readStatusCard as wm, groupMetaTag as wn, WAKE_LOST_MS as wo, previewImageSize as wp, atprotoDidMethod as wr, mergeLobby as ws, MAX_KNOCKS as wt, IDENTITY_MAX_VALIDITY as wu, handoffContextProof as wv, parseRelayPayload as ww, IMAGE_LIMITS as wx, enrollCancelFrame as wy, buildX401ProofResult as x, ANSWER_READ_ALLOWANCE as xC, deviceLinkPairing as xS, sdpHasCandidates as x_, findLightningDestination as xa, makeStamp as xb, pinIsNewer as xc, RELAY_WITH_SECRETS as xd, dhtFileId as xf, presenceSeenAt as xg, RATCHET_CAPABILITY as xh, DID_DHT_VERSION as xi, APP_SEND_LIMIT as xl, cardTimeUtc as xm, groupMetaChange as xn, SWITCH_RETIRE_MS as xo, linkStop as xp, ATPROTO_FULL_SCOPE as xr, lobbyKeys as xs, verifyCommunityCommit as xt, IDENTITY_MAX_EVIDENCE as xu, handoffBusyFrame as xv, measureRecords as xw, verifyAppRevocation as xx, ENROLL_GRANT as xy, X401_VERSION as y, turnStatedVerifier as yC, deviceFrameCapability as yS, parseCallSignal as y_, LNURL_LIMITS as ya, knockSlotRecords as yb, parsePinnedFrame as yc, verifyRingEvidence as yd, DHT_FILE_CAPABILITY as yf, WATCH_PEER_MS as yg, MAX_SKIP as yh, DID_DHT_PREFIX as yi, APP_RATE_WINDOW_MS as yl, cardLine as ym, groupDisplayName as yn, RESUME_WAIT_MS as yo, canonicalUrl as yp, varBytes as yr, freshHubs as ys, verifyCommunityChain as yt, IDENTITY_FRAME_LIMIT as yu, handoffAttemptFailed as yv, RELAY_PAYLOAD_MAX_BYTES as yw, signAppObject as yx, ENROLL_CANCEL_REASONS as yy, planAppUpdate as z, HEDGE_MISSING_MS as zC, turnPutSummary as zS, serviceIdFromName as z_, VIDEO_METADATA_LIMITS as za, APP_VIEWS as zb, relayRequest as zc, readManifest as zd, recordingMime as zf, MAX_CHUNK_PAYLOAD_BYTES as zg, GATHER_ATTEMPTS as zh, SEPOLIA_TEST_USDT_FAUCET as zi, FILES_CAPABILITY as zl, GROUP_MEMBER_CAP as zm, SSH_KEY_TYPES as zn, GROUP_WANT_FRAME as zo, parseReactionFrame as zp, parseAtprotoCar as zr, FILE_FRAMES as zs, groupWakeFrame as zt, identityStatementText as zu, handoffStreamKey as zv, encrypt as zw, DEVICE_INVITE_BYTES as zx, MAX_WAITING as zy };
40860
+ export { COMMUNITY_LIMITS as $, TURN_SOURCE_TIMEOUT_MS as $C, TURN_SLOTS as $S, HANDOFF_FILE_MISSING as $_, DEMOTE_AFTER_FAILURES as $a, readAppBundleAsync as $b, APP_RANGE_DATA_KIND as $c, domainWellKnownFile as $d, EDITED_FRAME as $f, buildDataSdp as $g, AWAITING_PEER_MS as $h, isSparkAddress as $i, PairedSession as $l, rememberAlone as $m, MessageRefusal as $n, SIGNAL_CARRIERS as $o, REPLY_LIMITS as $p, DidError as $r, TYPING_SEND_LIMIT as $s, GROUP_EDIT_TEXT_BYTES as $t, PeerProofs as $u, readHandoffFileFrame as $v, dropLoneJoiners as $w, INVITE_VERSION as $x, CONTACT_RECORD_TTL as $y, readX401ProofResponseHeader as A, CHAT_RESERVE as AC, signDeviceTransports as AS, emptyLinkRecords as A_, findBolt11 as Aa, requestRecords as Ab, WAKE_INTERVAL_MS as Ac, rankTransports as Ad, sanitizeMime as Af, parseLocalTarget as Ag, ratchetHeard as Ah, jwkThumbprint as Ai, isChatAppId as Al, statusCardText as Am, parseGroupMetaBody as An, ENGINE_ERRORS as Ao, forwardedMany as Ap, parseAtprotoDidDocument as Ar, readLobby as As, knockRecords as At, IDENTITY_STATEMENT_PREFIX as Au, handoffEphemeral as Av, readOwnRelayPayload as Aw, parseImageMeta as Ax, enrollGrantFrame as Ay, APP_STORE_KINDS as B, GROUP_RATION_WINDOW_MS as BC, keptAtEqualSequence as BS, isViewerTag as B_, videoMetadataPatches as Ba, APP_SCREENSHOTS_DIR as Bb, wakeFrame as Bc, newMailbox as Bd, parseVoiceMeta as Bf, LIMITS as Bg, DataLink as Bh, TEST_USDT_FAUCET_AMOUNT as Bi, KNOWN_SESSION_CAPABILITIES as Bl, GROUP_ID as Bm, SSH_PUBLIC_KEY_MAX as Bn, GROUP_WANT_NO_FRAME as Bo, parseReactedFrame as Bp, parseAtprotoDidKey as Br, FILE_LIMITS as Bs, groupWakes as Bt, identityStatement as Bu, handoffRetryAfter as Bv, publicKeyFromZ32 as Bw, readContactLink as Bx, MAX_MISSED as By, buildX401TokenObject as C, ANSWER_READ_ALLOWANCE as CC, deviceLinkPairing as CS, sdpHasCandidates as C_, parseInvoiceCallback as Ca, makeStamp as Cb, pinnedFrame as Cc, RELAY_WITH_SECRETS as Cd, dhtFileId as Cf, presenceSeenAt as Cg, RATCHET_CAPABILITY as Ch, decodeDidDhtPacket as Ci, AppSessions as Cl, cardTimeUtc as Cm, groupMetaPicture as Cn, WAKE_ANSWER_GRACE_MS as Co, linkStop as Cp, ATPROTO_PROOF_SCOPE as Cr, mergeBeacon as Cs, KNOCK_TTL_MS as Ct, IDENTITY_MAX_FRAME as Cu, handoffBusyFrame as Cv, PacketTooLargeError as Cw, verifyAppRevocation as Cx, ENROLL_GRANT as Cy, readX401ProofRequest as D, BACKGROUND_REQUESTS_PER_MINUTE as DC, deviceLinkSecret as DS, MAX_MSGS_PAYLOAD_B64 as D_, resolveLightningDestination as Da, readKnockSlot as Db, WAKE_CALL_TTL_SECONDS as Dc, dialableIrohRelay as Dd, formatFileSize as Df, HttpHost as Dg, RatchetBox as Dh, didDhtRecords as Di, appOpenFrame as Dl, removedCardText as Dm, keepPastGroupMeta as Dn, pairedMessageFrame as Do, sanitizePreviewImage as Dp, checkAtprotoProofRecord as Dr, rankHubs as Ds, entryParams as Dt, IDENTITY_PROVIDER_ID as Du, handoffDataFrame as Dv, newerPacket as Dw, exifOrientation as Dx, enrollCancelReason as Dy, isX401Protocol as E, AWAITED_READS as EC, deviceLinkSealKey as ES, LABEL$1 as E_, requestLnurlInvoice as Ea, openRequest as Eb, WAKE_CALL_INTERVAL_MS as Ec, checkedDescriptors as Ed, PREVIEWABLE_IMAGE as Ef, HttpClient as Eg, RATCHET_OVERHEAD as Eh, didDhtKey as Ei, appDataFrame as El, readStatusCard as Em, groupName as En, pairedMessageFits as Eo, previewImageSize as Ep, atprotoProofRkey as Er, pickHubs as Es, encodeGroupEntryLink as Et, IDENTITY_PROOF_CAPABILITY as Eu, handoffContextProof as Ev, measureRecords as Ew, IMAGE_LIMITS as Ex, enrollCancelFrame as Ey, appRevocationFor as F, DEPARTED_READS as FC, TURN_PUT_WINDOW_MS as FS, MAX_SERVICES as F_, isFederationId as Fa, APP_CLIENTS as Fb, newWakeToken as Fc, HOLD_DATED_BACK_MS as Fd, baseMime as Ff, viewerResponseHeaders as Fg, ratchetSessionOf as Fh, EVM_TEST_CHAINS as Fi, BUTTONS_CAPABILITY as Fl, claimedTime as Fm, verifyGroupMetaSignature as Fn, PairingTracker as Fo, REACTED_FRAME as Fp, decodeAtprotoCommit as Fr, PairedCalls as Fs, GROUP_WAKE_GROUP_WINDOW_MS as Ft, boundVerifiedIdentity as Fu, handoffManifestFrames as Fv, readDnsName as Fw, readCanonicalJson as Fx, readEnrollGrant as Fy, readAppStore as G, RELAY_REQUESTS_PER_MINUTE as GC, TURN_LABEL as GS, HANDOFF_ACK as G_, stripPictureMetadata as Ga, buildAppBundle as Gb, WebPushError as Gc, DOMAIN_MAX_RECORDS as Gd, voiceLevelsOf as Gf, encodeChunk as Gg, REANSWERS as Gh, assertWholeSats as Gi, STATUS_CARD_CAPABILITY as Gl, MAX_GROUP_MEMBERS as Gm, sshFingerprint as Gn, readGroupHave as Go, reactionFrame as Gp, verifyAtprotoSignature as Gr, sentWhole as Gs, GROUP_READ_NOTE as Gt, revokesIdentity as Gu, isHandoffPartName as Gv, generateEncryptionKey as Gw, deviceInviteJoinerKeyZ32 as Gx, endedRequests as Gy, checkAppListing as H, HEDGE_MISSING_MS as HC, TOMBSTONE_SEQUENCE as HS, servicesFromWire as H_, NO_PICTURE_METADATA as Ha, appDigest as Hb, wakeRequest as Hc, DNS_LABEL as Hd, voiceDownloadName as Hf, PROTOCOL_VERSION as Hg, GATHER_STALL_MS as Hh, WALLET_NETWORKS as Hi, REACTIONS_CAPABILITY as Hl, GROUP_VERSION_LARGE as Hm, parseSshPublicKey as Hn, groupFileFallback as Ho, queueReaction as Hp, readAtprotoCid as Hr, decodeFileData as Hs, parseGroupWakeFrame as Ht, isIdentityBinding as Hu, handoffVerifiedFrame as Hv, verify as Hw, DEVICE_INVITE_LIFETIME_S as Hx, NEW_PER_HOUR as Hy, appStoreDecision as I, FRESH_READ_MS as IC, TURN_RAISE_READ_TIMEOUT_MS as IS, SERVICES_VERSION as I_, parseCashuRequestPayload as Ia, APP_CLIENT_NAME as Ib, parseWakeFrame as Ic, HOLD_LIMITS as Id, downsamplePeaks as If, webLocalFetch as Ig, ratchetUnknownSession as Ih, ONCHAIN_PROVIDER as Ii, CALLS_CAPABILITY as Il, heardTime as Im, wrapGroupMeta as In, GROUP_FILE_LIMITS as Io, REACTION_FRAME as Ip, decodeDagCbor as Ir, parsePairedCallFrame as Is, GROUP_WAKE_MEMBER_INTERVAL_MS as It, emptyIdentityLedger as Iu, handoffOfferFrame as Iv, IDENTITY_MEMO_SIZE as Iw, CONTACT_LINK_BYTES as Ix, readEnrollHello as Iy, GROUP_TYPING_FRAME as J, RelaysFailedError as JC, TURN_NAME_BYTES as JS, HANDOFF_BUSY_REASONS as J_, ANSWERS_REFUSED_PAUSE_MS as Ja, isAppLicense as Jb, encryptPushPayload as Jc, NIP05_PATH as Jd, VIDEO_LIMITS as Jf, wrapDataChannel as Jg, DIRECT_OWN_ATTEMPTS as Jh, parsePaymentAmount as Ji, UPGRADE_CAPABILITY as Jl, SAID_AGAIN as Jm, verifySshSignature as Jn, CARRIED_DEFER_MS as Jo, readReaction as Jp, DID_GHOSTLY_SERVICE as Jr, TYPING_FRAME as Js, chainPieces as Jt, IDENTITY_TIMELINE_MAX as Ju, readHandoffAck as Jv, MAX_AVATAR_LENGTH as Jw, readDeviceInvite as Jx, planKnocks as Jy, readAppStoreSteps as K, REQUESTS_PER_MINUTE as KC, TURN_LAST_SEQUENCE as KS, HANDOFF_ATTEMPTS as K_, withoutPictureMetadata as Ka, checkAppManifest as Kb, checkPushEndpoint as Kc, DOMAIN_METHODS as Kd, voicePeaksOf as Kf, encodeControl as Kg, STALLED_EVIDENCE_MS as Kh, formatPaymentAmount as Ki, SessionCapabilities as Kl, MEMBER_KEY as Km, sshKeyDigestHex as Kn, readGroupWant as Ko, reactionIsNewer as Kp, DID_DOCUMENT_MAX_BYTES as Kr, transferEnded as Ks, GroupSession as Kt, signIdentityPresentation as Ku, newHandoffId as Kv, sealedLength as Kw, deviceInviteJoinerParams as Kx, inboxRecord as Ky, appUpdateDecision as L, GROUP_BURST_MS as LC, TURN_SETTLE_MS as LS, decodeServices as L_, parseFedimintRequestPayload as La, APP_FORBIDDEN_KEYS as Lb, readWake as Lc, HoldKeys as Ld, fileMessageText as Lf, withViewerPolicy as Lg, ANSWER_REFUSED_REDIALS as Lh, PaymentPreflightError as Li, EDIT_CAPABILITY as Ll, receivedTimestamp as Lm, SSHSIG_MAX_ARMOR as Ln, GROUP_HAVE_FRAME as Lo, REACTION_LIMITS as Lp, encodeDagCbor as Lr, ChatFiles as Ls, GROUP_WAKE_RECEIVE_LIMIT as Lt, identityPresentationBytes as Lu, handoffPakeFrame as Lv, createIdentity as Lw, CONTACT_LINK_VERSION as Lx, verifyEnrollProof as Ly, readX401ProofResultHeader as M, CHAT_RESERVE_PER_CHAT as MC, verifyDeviceTransports as MS, parseLinkRecords as M_, cashuRequestPayload as Ma, stampHolds as Mb, WAKE_TTL_SECONDS as Mc, relayedTransports as Md, RECORDING_TYPES as Mf, resolveTargetUrl as Mg, ratchetOpen as Mh, resolveDidDht as Mi, readAppFrame as Ml, usageLeft as Mm, parseGroupMetaStatement as Mn, engineError as Mo, COMMUNITY_REACTION_FRAME as Mp, AtprotoCid as Mr, validHead as Ms, readKnocks as Mt, IdentityCheckUnavailable as Mu, handoffFileRequestFrame as Mv, decodeDnsAnswers as Mw, readImageMeta as Mx, enrollMessage as My, x401AnswerableRequests as N, CHAT_WATCH_SHARE as NC, seedSigner as NS, HTTP_SERVICE_PROTO as N_, fedimintRequestPayload as Na, APP_BUNDLE_LIMITS as Nb, WakeLimiter as Nc, transportOrder as Nd, VOICE_LIMITS as Nf, sanitizeRequestHeaders as Ng, ratchetRoot as Nh, signDidDhtPacket as Ni, APPS_CAPABILITY as Nl, MESSAGE_CLOCK_SKEW_MS as Nm, parseGroupMetaTag as Nn, engineText as No, GROUP_REACTION_FRAME as Np, AtprotoProofError as Nr, MAX_PAIRED_CALL_SIGNAL as Ns, GROUP_WAKE_FRAME as Nt, IdentityExchange as Nu, handoffHaveFrames as Nv, decodeTxtPacket as Nw, canonicalJson as Nx, enrollProofFrame as Ny, readX401ProofRequestHeader as O, BACKGROUND_WHILE_SIGNALING as OC, devicePingFrame as OS, RECORD_TTL as O_, BOLT11_PATTERN as Oa, readLinkRecord as Ob, WAKE_CALL_WAIT_MS as Oc, irohDescriptor as Od, safeBlobType as Of, VIEWER_SERVICE_CSP as Og, emptyRatchetState as Oh, encodeDidDhtDeactivated as Oi, chatAppId as Ol, sameButtonText as Om, nextGroupMetaRevision as On, parsePaymentNetworks as Oo, FORWARD_LIMITS as Op, isAtprotoDid as Or, readBeacon as Os, groupEntryUrl as Ot, IDENTITY_REUSE_CHECK_S as Ou, handoffDigest as Ov, openRelayPayload as Ow, imageSize as Ox, enrollDigits as Oy, addedAppPermissions as P, DEFAULT_RELAYS as PC, webCryptoSigner as PS, LEGACY_SERVICES as P_, findEndpoint as Pa, APP_BUNDLE_MAGIC as Pb, deviceWakeRequest as Pc, HOLD_CAPABILITY as Pd, VOICE_METER as Pf, sanitizeResponseHeaders as Pg, ratchetSeal as Ph, ETHEREUM_USDT as Pi, APP_RANGES_CAPABILITY as Pl, arrivalKey as Pm, signGroupMeta as Pn, parseEngineError as Po, QUICK_REACTIONS as Pp, atprotoCidFor as Pr, PAIRED_CALL_FRAME as Ps, GROUP_WAKE_GROUP_LIMIT as Pt, boundIdentityDisplay as Pu, handoffHelloFrame as Pv, encodeTxtPacket as Pw, canonicalJsonBytes as Px, formatEnrollDigits as Py, sealGroupTyping as Q, SLOW_MS as QC, TURN_SIGNED_BYTES as QS, HANDOFF_DONE as Q_, CROSSED_WAIT_MS as Qa, readAppBundle as Qb, vapidKeysMatch as Qc, domainTxtRecord as Qd, parseVideoMeta as Qf, RTC_SIGNAL_MAX_AGE_MS as Qg, symmetricNat as Qh, SPARK_PROVIDER as Qi, PAIRED_PROFILE as Ql, parseGroupCommit as Qm, BIP322_REVISION as Qn, SIGNALS_PER_MINUTE as Qo, REPLY_ID as Qp, DID_METHODS as Qr, TYPING_REFRESH_MS as Qs, GROUP_EDIT_FRAME as Qt, PROOF_CAPABILITY as Qu, readHandoffDone as Qv, MAX_NICK_LENGTH as Qw, INVITE_MAX_LENGTH as Qx, CONTACT_ASKER_FRAME as Qy, checkAppBeforeRun as R, GROUP_BURST_ONE_LINK as RC, TURN_VISIBLE_MS as RS, encodeServices as R_, NO_VIDEO_METADATA as Ra, APP_ICON_PATH as Rb, readWakePayload as Rc, HoldRefusedError as Rd, formatVoiceDuration as Rf, CHUNK_FLAG_END as Rg, CONNECT_TIMEOUT_MS as Rh, SEPOLIA_TEST_USDT as Ri, FILES_BINARY_CAPABILITY as Rl, shownTime as Rm, SSHSIG_NAMESPACE as Rn, GROUP_VERSION_FILES as Ro, ReactionWindow as Rp, findInMst as Rr, FILE_DATA_KIND as Rs, GroupWakeLimiter as Rt, identityRefusal as Ru, handoffReleaseFrame as Rv, identityFromSeed as Rw, createContactLink as Rx, FLOOD_PER_DAY as Ry, buildX401ResultArtifact as S, turnVerifierMark as SC, deviceKeyZ32 as SS, __toCommonJS as ST, pickCallCandidates as S_, invoiceCallbackUrl as Sa, linkRecords as Sb, pinNumberHolds as Sc, RELAY_URL as Sd, dhtFileElements as Sf, countUnusedInvite as Sg, MAX_SKIPPED_KEYS as Sh, DidDhtError as Si, APP_VERSION_MAX as Sl, cardLinkHost as Sm, groupMetaNewer as Sn, UNPROVEN_AUTH_MS as So, linkEnd as Sp, ATPROTO_PROOF_COLLECTION as Sr, lobbyRecords as Ss, GROUP_ENTRY_PROFILE as St, IDENTITY_MAX_EVIDENCE as Su, handoffAttemptSucceeded as Sv, PKARR_FUTURE_SKEW_MS as Sw, signAppRevocation as Sx, ENROLL_DONE as Sy, encodeX401Header as T, ANSWER_READ_SPACING_MS as TC, deviceLinkRendezvousSeed as TS, waitForIceGathering as T_, parsePayParams as Ta, mergeContactKnocks as Tb, DEVICE_WAKE_TTL_SECONDS as Tc, automaticTransport as Td, FileTransfers as Tf, GhostlyHttpError as Tg, RATCHET_KEEP_MS as Th, didDhtFromPublicKey as Ti, appDataBytes as Tl, checkStatusCard as Tm, groupMetaToHand as Tn, pairedEditFits as To, parseLinkPreview as Tp, atprotoProofRecord as Tr, newerHead as Ts, decodeGroupEntryLink as Tt, IDENTITY_MAX_VALIDITY as Tu, handoffContext as Tv, createRelayPayload as Tw, verifyAppStatementBytes as Tx, ENROLL_PROOF as Ty, checkAppStoreIndex as U, HEDGE_MS as UC, TOMBSTONE_TURN as US, servicesToWire as U_, PICTURE_METADATA_LIMITS as Ua, appViewOf as Ub, PUSH_PAD_BYTES as Uc, DNS_TYPE as Ud, voiceFileName as Uf, decodeChunk as Ug, LATE_ANSWER_MS as Uh, arkAddressPrefix as Ui, SERVICES_CAPABILITY as Ul, LEGACY_GROUP_MEMBERS as Um, parseSshSignature as Un, isGroupMessageId as Uo, reactedFrame as Up, unsignedCommitBytes as Ur, encodeFileData as Us, GROUP_LIMITS as Ut, newIdentityBinding as Uu, handoffVerifiedMessage as Uv, decrypt as Uw, DEVICE_INVITE_OWN_DEVICE as Ux, REOPEN_BELOW as Uy, APP_STORE_LIMITS as V, GROUP_SIGNALING_ALLOWANCE_SHARE as VC, turnPutSummary as VS, serviceIdFromName as V_, withoutVideoMetadata as Va, APP_VIEWS as Vb, wakePayload as Vc, readManifest as Vd, recordingMime as Vf, MAX_CHUNK_PAYLOAD_BYTES as Vg, GATHER_ATTEMPTS as Vh, USDT_PUBLIC_RPC as Vi, PIN_CAPABILITY as Vl, GROUP_MEMBER_CAP as Vm, SshSigError as Vn, fetchesByItself as Vo, parseReactionFrame as Vp, parseAtprotoVerificationKey as Vr, FileUplink as Vs, mentionedMembers as Vt, identityStatementText as Vu, handoffStreamKey as Vv, sign as Vw, DEVICE_INVITE_BYTES as Vx, MAX_WAITING as Vy, readAppListing as W, PREVIOUS_DEFAULT_RELAYS as WC, TURN_BODY_BYTES as WS, viewerTag as W_, isStrippedPicture as Wa, assembleAppBundle as Wb, PUSH_SERVICE_HOSTS as Wc, DOMAIN_FILE_MAX_BYTES as Wd, voiceLevel as Wf, decodeControl as Wg, OFFER_HOST_GATHER_MS as Wh, assertTokenUnits as Wi, SESSION_CAPABILITIES_FRAME as Wl, MAX_GROUP_CHAIN as Wm, sameSshKey as Wn, readGroupFileMeta as Wo, reactionEmoji as Wp, verifyAtprotoRecordProof as Wr, refusalText as Ws, GROUP_REACTED_FRAME as Wt, receivedIdentityStatus as Wu, handoffVersions as Wv, encrypt as Ww, createDeviceInvite as Wx, clearMissed as Wy, groupTypingEpoch as X, SIGNALING_WINDOW_MS as XC, TURN_REV_LIMIT as XS, HANDOFF_CANCEL_REASONS as X_, CROSSED_FRESH_MS as Xa, isAppUrl as Xb, pushRequest as Xc, decodeDnsResponse as Xd, isPlayableVideoType as Xf, DATA_CHANNEL_LABEL as Xg, DirectPathWatch as Xh, walletNetworkOf as Xi, parseSessionCapabilities as Xl, commitUntaggedHash as Xm, legacyMessageHash as Xn, GROUP_SIGNAL_FRAME as Xo, wireReaction as Xp, DID_JWS_MAX_LENGTH as Xr, TYPING_RATE_LIMIT as Xs, groupMessageId as Xt, lastSharedWithMe as Xu, readHandoffCancel as Xv, jpegSize$1 as Xw, INVITE_HRP as Xx, takeRequest as Xy, GroupTypingBoard as Y, SIGNALING_ALLOWANCE_SHARE as YC, TURN_NO_ACTIVE as YS, HANDOFF_CANCEL as Y_, BLOCKED_DIAL_WAIT_MS as Ya, isAppPath as Yb, generateVapidKeys as Yc, WELL_KNOWN_PATH as Yd, formatVideoDuration as Yf, DATA_CHANNEL_ID as Yg, DIRECT_PEERS as Yh, validatePaymentTarget as Yi, WAKE_SESSION_CAPABILITY as Yl, commitHash as Ym, isLegacySignature as Yn, CarriedTransport as Yo, validReactionNumber as Yp, DID_JWS_ALGS as Yr, TYPING_KINDS as Ys, frameBytes as Yt, applyIdentityEvent as Yu, readHandoffBusy as Yv, MAX_AVATAR_SIDE as Yw, DEVICE_INVITE_VERSION as Yx, settleRequest as Yy, openGroupTyping as Z, SLOW_DEMOTE_MS as ZC, TURN_SEALED_BYTES as ZS, HANDOFF_DATA as Z_, CROSSED_PROBE_MS as Za, pacer as Zb, vapidAuthorization as Zc, dnsProofName as Zd, isVideoMime as Zf, RTC_SIGNAL_FUTURE_MS as Zg, directBlocked as Zh, SPARK_NETWORKS as Zi, sessionCapabilitiesFrame as Zl, expectedRoster as Zm, verifyBitcoinMessage as Zn, GROUP_VERSION_SIGNALS as Zo, PAIRED_REPLY_AUTHORS as Zp, DID_MAX_LENGTH as Zr, TYPING_RATE_WINDOW_MS as Zs, COMMUNITY_EDIT_FRAME as Zt, PROOF_ADAPTERS as Zu, readHandoffData as Zv, sanitizeAvatar as Zw, INVITE_LINK_ORIGIN as Zx, turnOff as Zy, X401_PROTOCOLS as _, turnPayloadSequence as _C, ENROLL_CAPABILITY as _S, utf8Encode as _T, heardCallSignal as __, pubkyHomeserverOf as _a, contactDay as _b, nextPinNumber as _c, ringClaims as _d, DhtDelivery as _f, TRANSPORTS_GONE_MS as _g, sealPair as _h, strictBase64Url as _i, APP_PEER_OPEN_MAX as _l, appCardId as _m, MAX_GROUP_PICTURE_LENGTH as _n, RACE_RELAYED_MS as _o, validRemovalNumber as _p, u32$1 as _r, beaconRecords as _s, shortHash as _t, IDENTITY_CHECK_UNAVAILABLE as _u, filePartDigest as _v, heldBackError as _w, readAppRevocationShape as _x, signTombstone as _y, X401_DCQL_LIMITS as a, nextTurnPosition as aC, encodeInviteCode as aS, unwrapPasted as aT, CALL_SIGNAL_MAX_AGE_MS as a_, PUBKY_PROOF_MAX_BYTES as aa, MAX_SLOT_KNOCKS as ab, parseTypingFrame as ac, nostrProofTemplate as ad, recordsFromTxt as af, IDLE_THRESHOLD as ag, verifyCommit as ah, didWebDocumentUrl as ai, appRangeChunk as al, ACTIVE_TASK_STATUSES as am, validEditText as an, HANDLED_WAIT_MS as ao, EDIT_SEND_LIMIT as ap, BitcoinAddressError as ar, readGroupSignal as as, communityHasFrame as at, CAPS_PUBLISH_SPACING_MS as au, HANDOFF_MANIFEST as av, readRelayBody as aw, appFingerprint as ax, readHandoffTurnFrame as ay, buildX401ProofRequest as b, turnSignedMessage as bC, deviceEchoNonce as bS, __exportAll as bT, keepsToRelays as b_, fetchLnurlJson as ba, knockSlotOf as bb, pinFrame as bc, verifyRingAuthorization as bd, peekDhtMailbox as bf, UNUSED_INVITE_WAIT_MAX_MS as bg, FOLLOW_MS as bh, DID_DHT_TTL as bi, APP_RESUME_GRACE_MS as bl, cardEditNumber as bm, groupMetaBody as bn, RTC_UNSTARTED_MS as bo, LINK_TRAILING as bp, ATPROTO_DECLARED_SCOPE as br, hubRank as bs, verifyCommunityChainPaced as bt, IDENTITY_FRAME_WINDOW_MS as bu, handoffAttemptAllowed as bv, withRequestOptions as bw, setAppSignatureFastPath as bx, ENROLL_CANCEL as by, readX401DcqlQuery as c, readTurnPacket as cC, inviteQrSegments as cS, fromBase64 as cT, RTC_CONFIG as c_, isPubkyProofFolder as ca, REQUEST_LIFETIME_MS as cb, typingFrame as cc, proofStatement as cd, txtValue as cf, OFFER_FAST_MS as cg, confirmationMatches as ch, didWebFileUrl as ci, appRangeErrorFrame as cl, CRON_LINE as cm, mentionsBytes as cn, LIVENESS_MISSED_PINGS as co, REMOVED_TEXT as cp, decodeAnyBitcoinAddress as cr, NO_HUB_POLICY as cs, communityUntaggedHash as ct, CapsKeys as cu, HANDOFF_PIECE_BYTES as cv, traceLink as cw, appRevocationId as cx, sealHandoffPiece as cy, newX401HolderKey as d, signTurnPacket as dC, pastedAgain as dS, isZ32Key as dT, callRtcConfig as d_, pubkyProofCapability as da, REQUEST_TEXT_BYTES as db, GROUP_PIN_FRAME as dc, storageProofPath as dd, ACTIVE_DHT_POLL_MS as df, PRESENCE_HEARTBEAT as dg, edgeParams as dh, parseDid as di, encodeAppRangeData as dl, PR_STATES as dm, wireMentions as dn, PAIRED_FRAME_TOO_LARGE as do, editFrame as dp, decodeWitness as dr, meshRendezvous as ds, encodeCommunityLink as dt, capsDescriptors as du, HANDOFF_REQUEST as dv, BREAKER_MAX_MS as dw, isAppHash as dx, SET_UPDATE as dy, TURN_TTL as eC, OwnInviteError as eS, hasVisible as eT, extractRtcParams as e_, sparkAddressKind as ea, ContactRequestError as eb, TYPING_STATUS_MAX as ec, STORAGE_LIFETIME as ed, encodeDnsQuery as ef, DAEMON_WATCH_PEER_IDLE_MS as eg, rosterAdmin as eh, checkDidJws as ei, APP_RANGE_ERRORS as el, groupReplyAuthor as em, carryMentions as en, DEMOTE_MS as eo, EDIT_BUFFER_MAX as ep, bip322MessageHash as er, SIGNAL_FRESH_MS as es, COMMUNITY_PROFILE as et, SESSION_FRAME_MAX as eu, HANDOFF_FILE_REQUEST as ev, WATCH_SHARE as ew, sha256Paced as ex, readHandoffHave as ey, readX401SdJwtVc as f, signTurnRelease as fC, readInviteCode as fS, randomBytes as fT, callSignalHeardAt as f_, pubkyProofFile as fa, STAMP_BITS_DEFAULT as fb, PINNED_FRAME as fc, validExternalKey as fd, DHT_FILE_REFUSED as ff, PRESENCE_WINDOW as fg, encryptText as fh, parseDidDocument as fi, isServeId as fl, REMOVABLE_KINDS as fm, GROUP_META_PAST as fn, PAIRING_ATTEMPT_MS as fo, editedFrame as fp, encodeTx as fr, parseHubPolicy as fs, leaveStands as ft, dialDescriptors as fu, HANDOFF_TIMINGS as fv, BREAKER_THRESHOLD as fw, isAppKey as fx, encodeSetSlots as fy, X401_LIMITS as g, turnPacket as gC, DEVICE_PING_FRAME as gS, utf8Decode as gT, extractParamsFromSdp as g_, homeserverWebEndpoint as ga, contactAskerHolds as gb, mayPin as gc, ringAuthorization as gd, DHT_TEXT_REFUSED as gf, STALLED_LOOK_MS as gg, openSecret as gh, staticDidDocument as gi, APP_FRAME as gl, TASK_STATUSES as gm, MAX_GROUP_NAME_LENGTH as gn, RACE_DIRECT_MS as go, validEditNumber as gp, txHash as gr, beaconKeys as gs, rosterHash as gt, IDENTITY_CHALLENGE_WINDOW as gu, NO_ATTEMPTS as gv, budgetRetryMs as gw, readAppRevocation as gx, setUpdateMessage as gy, X401_HEADERS as h, turnName as hC, DEVICE_ECHO_FRAME as hS, toZ32 as hT, decompressSdp as h_, encodeSvcbPacket as ha, contactAskerFrame as hb, PIN_LIMITS as hc, RING_LIFETIME as hd, DHT_TEXT_BYTES as hf, SIGNAL_OUT_READS as hg, openPair as hh, signingKeys as hi, APP_DATA_MAX_BYTES as hl, STATUS_CARD_LIMITS as hm, MAX_GROUP_NAME_BYTES as hn, RACE_ANSWERED_MS as ho, validEditMessage as hp, sha256d as hr, COMMUNITY_TOPOLOGY as hs, leftStatement as ht, parsePacketTransports as hu, HANDOFF_WINDOW as hv, PublishFailedError as hw, isAppSignature as hx, setUpdateFrame as hy, x401ApprovalDigest as i, firstDeviceSetSecret as iC, encodeGhostlyInvite as iS, trimEndOf as iT, CALL_SIGNAL_FUTURE_MS as i_, isBitcoinAddress as ia, MAX_SEEN as ib, parseTypingActivity as ic, isProofAdapter as id, parseDomainTxt as if, FIRST_PUBLISH_MAX_MS as ig, verifyChain as ih, didSignedMessages as ii, appRangeCancelFrame as il, wireReply as im, parseCommunityEdit as in, GhostLink as io, EDIT_RECEIVE_LIMIT as ip, verifyBip322 as ir, groupSignalFrame as is, communityGroupId as it, CAPS_LIMITS as iu, HANDOFF_LIST_PER_FRAME as iv, normalizeRelayUrl as iw, APP_STATEMENT_LIMITS as ix, readHandoffRelease as iy, readX401ProofResult as j, CHAT_RESERVE_MOST_SHARE as jC, unsignedDeviceTransports as jS, isEmptyLinkPacket as j_, ENDPOINT as ja, seenEntry as jb, WAKE_SUBJECT as jc, relayUrl as jd, PLAYABLE_AUDIO as jf, relativizeLocation as jg, ratchetOn as jh, openDidDhtPayload as ji, parseAppFrame as jl, taskProgress as jm, parseGroupMetaFrame as jn, EngineError as jo, readForwarded as jp, shortAtprotoDid as jr, shouldBeHub as js, mergeKnocks as jt, IDENTITY_SUBJECT as ju, handoffFileMissingFrame as jv, signRelayPayload as jw, previewable as jx, enrollHelloFrame as jy, readX401ProofResponse as k, BACKGROUND_WRITES_SHARE as kC, newDeviceSetSecret as kS, buildLinkRecords as k_, decodeBolt11 as ka, requestPlaintextBytes as kb, WAKE_FRAME as kc, irohRelayUrl as kd, sanitizeFileName as kf, formatLocalTarget as kg, isRatcheted as kh, encodeDidDhtPacket as ki, isAppVersion as kl, statusCardBytes as km, openGroupMeta as kn, publishFailure as ko, forwardedAgain as kp, normalizeAtprotoHandle as kr, readBeaconHead as ks, knockIdentity as kt, IDENTITY_REVOCATION_LABEL as ku, handoffDoneFrame as kv, parseRelayPayload as kw, isImageMime as kx, enrollDoneFrame as ky, x401VpToken as l, sealTurnBody as lC, inviteQrText as lS, fromBase64Url as lT, answersOffer as l_, newPubkyProofFolder as la, REQUEST_NAME_UNITS as lb, typingKindOf as lc, storageProof as ld, validDomainRecord as lf, OFFER_LOOK_MS as lg, confirmationTag as lh, didWebHost as li, appRangeGetFrame as ll, ITEM_STATES as lm, mentionsMember as ln, LIVENESS_PING_MS as lo, RateWindow as lp, decodeBitcoinAddress as lr, mayBeHub as ls, decodeCommunityLink as lt, CapsRefusedError as lu, HANDOFF_PIECE_OVERHEAD as lv, BREAKER_ALL_DOWN_PROBE_MS as lw, appSignedBytes as lx, sortParts as ly, x401HolderJwk as m, turnKeys as mC, DEVICE_CAPABILITIES as mS, toBase64Url as mT, contactRtcConfig as m_, decodeSvcbRecords as ma, STAMP_BITS_MIN as mb, PIN_FRAME as mc, verifyPeerProof as md, DHT_MESSAGE_TTL as mf, SIGNAL_DUE_READS as mg, newEpochSecret as mh, parseDidSignaturePaste as mi, readAppRangeFrame as ml, RUN_RESULTS as mm, MAX_GROUP_META_BODY as mn, PONG_WAIT_MS as mo, parseEditedFrame as mp, hash160 as mr, wireHubPolicy as ms, leaveStatement3 as mt, encodePacketTransports as mu, HANDOFF_VERSION as mv, DiscoveryBudgetError as mw, isAppRef as mx, setAckFrame as my, X401_RESPONSE_MODES as n, TurnRecordError as nC, createLink as nS, sanitizeNick as nT, parseRtcSignal as n_, sparkNetworkOf as na, KNOCK_SLOT_LABEL as nb, TypingReceiver as nc, emptyProofLedger as nd, nip05RootKey as nf, DHT_POLL_INTERVALS as ng, signCommit as nh, didGhostlyServiceEntry as ni, APP_RANGE_LIMITS as nl, readReply as nm, communityMessageAuthor as nn, EARLY_DIAL_JOIN_MS as no, EDIT_FRAME as np, bip322ToSpend as nr, SIGNAL_PROVEN_MS as ns, GROUP_READ_NOTE_COMMUNITY as nt, CAPS_ISSUED_BACK_MS as nu, HANDOFF_HELLO as nv, WRITE_FIRST_MS as nw, APP_NAME as nx, readHandoffManifest as ny, matchX401Dcql as o, openTurnValue as oC, inviteLink as oS, bytesEqual as oT, PAIRED_CALL_CANDIDATES as o_, PUBKY_PROOF_ROOT as oa, REQUEST_CLOCK_SKEW_MS as ob, sanitizeTypingStatus as oc, proofCapability as od, recordsFromWellKnown as of, LinkSession as og, verifyCommitSignature as oh, didWebFile as oi, appRangeDataFrame as ol, BUTTON_ID as om, MENTION_EVERYONE as on, INVITER_DIAL_GRACE_MS as oo, MAX_EDITS_PER_MESSAGE as op, ByteReader as or, GROUP_VERSION_HUBS as os, communityMessageId as ot, CAPS_REFRESH_MS as ou, HANDOFF_OFFER as ov, relayUrlProblem as ow, appRef as ox, readHandoffVerified as oy, sameX401HolderJwk as p, turnInstance as pC, DEVICES_CAPABILITY as pS, toBase64 as pT, compressSdp as p_, pubkyProofPath as pa, STAMP_BITS_MAX as pb, PIN_CLOCK_SKEW_MS as pc, verifyNostrProof as pd, DHT_FILE_TOO_LARGE as pf, RELAY_POLL_INTERVALS as pg, epochKeys as ph, parseDidJws as pi, parseAppRangeFrame as pl, ROUTINE_STATES as pm, GROUP_META_PAST_CHARS as pn, PAIRING_RETRY_MS as po, parseEditFrame as pp, encodeWitness as pr, pickMeshHubs as ps, leaveStatement as pt, emptyCapsState as pu, HANDOFF_VERIFIED as pv, RelayBreaker as pw, isAppLine as px, readSetUpdate as py, signAppStore as q, RelayTransport as qC, TURN_MAX as qS, HANDOFF_BUSY as q_, ANSWERS_REFUSED_PAUSES as qa, findAppForbiddenKey as qb, decryptPushPayload as qc, DOMAIN_TXT_MAX_BYTES as qd, PLAYABLE_VIDEO as qf, sendBody as qg, DIRECT_EVIDENCE_MS as qh, isWalletNetwork as qi, TYPING_CAPABILITY as ql, OWN_FRAME_LIMIT as qm, sshSignCommand as qn, readGroupWantNo as qo, readDhtReactions as qp, DID_FILE_MAX_BYTES as qr, transferStalled as qs, asWritten as qt, verifyIdentityPresentation as qu, openHandoffPiece as qv, tryDecrypt as qw, encodeDeviceInvite as qx, newInbox as qy, readX401OpenId4VpRequest as r, encodeTurnFields as rC, decodeInviteCode as rS, stripHidden as rT, BURST_RING_MS as r_, BITCOIN_NETWORKS as ra, LINK_RECORD_LABEL as rb, TypingSender as rc, importedProof as rd, normalizeDomain as rf, EXPECT_PEER_MS as rg, sortRoster as rh, didJwsAlg as ri, AppRanges as rl, replySnippet as rm, meshMessageRef as rn, FIRST_PAIRING_PACE_MS as ro, EDIT_RATE_WINDOW_MS as rp, decodeBase64 as rr, SIGNAL_REPLY_MS as rs, communityCommitHash as rt, CAPS_LABEL as ru, HANDOFF_LATER_BYTES as rv, currentRelays as rw, APP_PREFIXES as rx, readHandoffPake as ry, presentX401SdJwtVc as s, readTurnBody as sC, inviteOwnership as sS, concatBytes as sT, QUICK_REDIAL_MS as s_, isPubkyKey as sa, REQUEST_LABEL as sb, typingActivity as sc, proofHash as sd, recordsName as sf, MAX_DHT_TEXT_BYTES as sg, GROUP_PROFILE as sh, didWebFileNames as si, appRangeEndFrame as sl, BUTTON_STYLES as sm, MENTION_LIMITS as sn, INVITE_TAKEN as so, MAX_REMOVAL_NUMBER as sp, compactSize as sr, MESH_HUBS as ss, communityRoster as st, CapsExchange as su, HANDOFF_PAKE as sv, setLinkTraceSink as sw, appRefPublisher as sx, sameDigest as sy, X401_REQUEST_LIMITS as t, TURN_VERSION as tC, createChatInvite as tS, sanitizeDisplayText as tT, offerIsFresh as t_, sparkInvoiceDetails as ta, KNOCK_SLOTS as tb, TYPING_TIMEOUT_MS as tc, STORAGE_ROOT as td, isPublicAddress as tf, DEPARTED_READ_MS as tg, rosterHas as th, checkDidSignature as ti, APP_RANGE_FRAMES as tl, pairedReplyAuthor as tm, communityEditFrame as tn, DHT_PIN_GRACE_MS as to, EDIT_BUFFER_MS as tp, bip322ToSign as tr, SIGNAL_HOLD_MS as ts, CommunitySession as tt, SESSION_RECEIVE_PENDING as tu, HANDOFF_HAVE as tv, WAY_BACK_SHARE as tw, yieldThread as tx, readHandoffHello as ty, X401_CREDENTIAL_LIMITS as u, signTurnBody as uC, ownInviteRefusal as uS, fromZ32 as uT, buildSdpFromSignal as u_, normalizePubkyKey as ua, REQUEST_PACKET_BYTES as ub, COMMUNITY_PIN_FRAME as uc, storageProofBody as ud, wellKnownUrl as uf, OFFER_STEP_MAX as ug, decryptText as uh, normalizeDid as ui, decodeAppRangeData as ul, PR_CHECKS as um, validMentions as un, MAX_PAIRED_MESSAGE_FRAME as uo, dhtEditId as up, decodeTx as ur, meshHubs as us, derivedSecret as ut, DHT_TEXT_CAPABILITY as uu, HANDOFF_RELEASE as uv, BREAKER_BASE_MS as uw, checkAppRevokeStatement as ux, SET_ACK as uy, X401_SCHEME as v, turnReleaseMessage as vC, HANDOFF_CAPABILITY as vS, __commonJSMin as vT, isCandidateAddress as v_, LIGHTNING_DESTINATION_PATTERN as va, knockHolds as vb, parsePinFrame as vc, ringEvidence as vd, LIVE_POLL_MS as vf, UNUSED_INVITE_READS_PER_MINUTE as vg, sealSecret as vh, DID_DHT_MAX_PAYLOAD as vi, APP_RATE_LIMIT as vl, appCardUrl as vm, encodeGroupMetaBody as vn, REDESCRIBED_GRACE_MS as vo, LINK_MAX_CHARS as vp, u64 as vr, doorHubs as vs, signCommunity as vt, IDENTITY_CLOCK_SKEW as vu, filePartName as vv, isDiscoveryBudgetError as vw, readAppRevocations as vx, verifySetUpdate as vy, decodeX401Header as w, ANSWER_READ_FIRST_MS as wC, deviceLinkParams as wS, signalHasVideo as w_, parseLightningDestination as wa, makeStampPaced as wb, readPin as wc, TRANSPORTS as wd, readDhtFile as wf, unusedInviteWait as wg, RATCHET_HEADER_BYTES as wh, didDhtDocument as wi, appCloseFrame as wl, cardUrl as wm, groupMetaTag as wn, WAKE_LOST_MS as wo, linksIn as wp, atprotoDidMethod as wr, mergeLobby as ws, MAX_KNOCKS as wt, IDENTITY_MAX_RECEIVED as wu, handoffCancelFrame as wv, RELAY_PAYLOAD_MAX_BYTES as ww, verifyAppSignature as wx, ENROLL_HELLO as wy, buildX401ProofResult as x, turnStatedVerifier as xC, deviceFrameCapability as xS, __require as xT, parseCallSignal as x_, findLightningDestination as xa, knockSlotRecords as xb, pinIsNewer as xc, verifyRingEvidence as xd, DHT_FILE_CAPABILITY as xf, WATCH_PEER_MS as xg, MAX_SKIP as xh, DID_DHT_VERSION as xi, APP_SEND_LIMIT as xl, cardLine as xm, groupMetaChange as xn, SWITCH_RETIRE_MS as xo, canonicalUrl as xp, ATPROTO_FULL_SCOPE as xr, lobbyKeys as xs, verifyCommunityCommit as xt, IDENTITY_MAX_CHECKS_PER_HOUR as xu, handoffAttemptFailed as xv, MAX_DNS_PACKET_BYTES as xw, signAppObject as xx, ENROLL_CANCEL_REASONS as xy, X401_VERSION as y, turnSequence as yC, deviceEchoFrame as yS, __esmMin as yT, isGlobalIpv4Host as y_, LNURL_LIMITS as ya, knockSlotIdentity as yb, parsePinnedFrame as yc, validRingKey as yd, emptyDhtDeliveryState as yf, UNUSED_INVITE_UPKEEP_MS as yg, sha256Hex as yh, DID_DHT_PREFIX as yi, APP_RATE_WINDOW_MS as yl, buttonLabelClash as ym, groupDisplayName as yn, RESUME_WAIT_MS as yo, LINK_PREVIEW_LIMITS as yp, varBytes as yr, freshHubs as ys, verifyCommunityChain as yt, IDENTITY_FRAME_LIMIT as yu, handoffAckFrame as yv, publishedNowhere as yw, readAppSignature as yx, DEVICE_KINDS as yy, planAppUpdate as z, GROUP_OVER_PACE_MS as zC, classifyTurnRead as zS, isValidServiceId as z_, VIDEO_METADATA_LIMITS as za, APP_PERMISSIONS as zb, relayRequest as zc, isHoldUrl as zd, isPlayableAudioType as zf, CHUNK_KIND as zg, DATA_SETTLE_MS as zh, SEPOLIA_TEST_USDT_FAUCET as zi, FILES_CAPABILITY as zl, GROUP_ADMIN_OFF_ERROR as zm, SSH_KEY_TYPES as zn, GROUP_WANT_FRAME as zo, nextReactionNumber as zp, parseAtprotoCar as zr, FILE_FRAMES as zs, groupWakeFrame as zt, identityRevocationValue as zu, handoffRequestFrame as zv, identityFromSeedB64 as zw, encodeContactLink as zx, MAX_DONE as zy };
40278
40861
 
40279
- //# sourceMappingURL=src-CCGK1Q_h.js.map
40862
+ //# sourceMappingURL=src-C2bAufMs.js.map