@ghostlytools/cli 1.13.2 → 1.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +9 -8
  2. package/dist/assets/{api-DV52o7A8.js → api-DO0YMLiB.js} +2 -2
  3. package/dist/assets/{api-O57SNJcb.js → api-Dz2cw7WD.js} +155 -44
  4. package/dist/assets/api-Dz2cw7WD.js.map +1 -0
  5. package/dist/assets/{apiKit-CPTFJHA7.js → apiKit-DAFsWtyk.js} +17 -3
  6. package/dist/assets/apiKit-DAFsWtyk.js.map +1 -0
  7. package/dist/assets/{appFetch-Ca9DNQQ2.js → appFetch-BQO5Pk7W.js} +2 -2
  8. package/dist/assets/{appFetch-Ca9DNQQ2.js.map → appFetch-BQO5Pk7W.js.map} +1 -1
  9. package/dist/assets/{apps-gXpGFPiv.js → apps-B88rYWRm.js} +45 -19
  10. package/dist/assets/apps-B88rYWRm.js.map +1 -0
  11. package/dist/assets/{apps-uZTu5FlR.js → apps-D4KRpZB4.js} +1 -1
  12. package/dist/assets/{backup-Di2U6QVH.js → backup-BeXBtbVL.js} +1 -1
  13. package/dist/assets/{backup-CxH3auHB.js → backup-CNLY905d.js} +10 -5
  14. package/dist/assets/backup-CNLY905d.js.map +1 -0
  15. package/dist/assets/bark_ffi_wasm_bg-CjjCN3FD.js +5 -0
  16. package/dist/assets/{bitcoind-BpZn3bRN.js → bitcoind-BXZdQ1wZ.js} +2 -2
  17. package/dist/assets/{bitcoind-BpZn3bRN.js.map → bitcoind-BXZdQ1wZ.js.map} +1 -1
  18. package/dist/assets/bitcoindevkit_bg-D6IFIaJi.js +5 -0
  19. package/dist/assets/{buttons-D4udKEvT.js → buttons-BKojbx0Q.js} +4 -4
  20. package/dist/assets/{buttons-D4udKEvT.js.map → buttons-BKojbx0Q.js.map} +1 -1
  21. package/dist/assets/buttons-_5Fw8uHn.js +1 -0
  22. package/dist/assets/{client-DGx7E8b3.js → client-BtPhfWjK.js} +2 -2
  23. package/dist/assets/{client-DGx7E8b3.js.map → client-BtPhfWjK.js.map} +1 -1
  24. package/dist/assets/{fedimintSdk-D-6H9Pe7.js → fedimintSdk-eLXBrj9i.js} +2 -2
  25. package/dist/assets/{fedimintSdk-D-6H9Pe7.js.map → fedimintSdk-eLXBrj9i.js.map} +1 -1
  26. package/dist/assets/fedimint_client_wasm_bg-CRQlnJdu.js +5 -0
  27. package/dist/assets/{fixedHosts-CODN2pTL.js → fixedHosts-BJFL8Ell.js} +3 -3
  28. package/dist/assets/{fixedHosts-CODN2pTL.js.map → fixedHosts-BJFL8Ell.js.map} +1 -1
  29. package/dist/assets/{groupMeta-CeZpqVVC.js → groupMeta-Cz95F6sX.js} +98 -9
  30. package/dist/assets/groupMeta-Cz95F6sX.js.map +1 -0
  31. package/dist/assets/{host-CRA7h5A2.js → host-BsBWxTtW.js} +172 -22
  32. package/dist/assets/host-BsBWxTtW.js.map +1 -0
  33. package/dist/assets/{identityProofs-B8zCp5_0.js → identityProofs-zI_Iy9uI.js} +15 -1
  34. package/dist/assets/identityProofs-zI_Iy9uI.js.map +1 -0
  35. package/dist/assets/{irohWeb-mnOi2Jp7.js → irohWeb-BLDcHwYz.js} +50 -13
  36. package/dist/assets/irohWeb-BLDcHwYz.js.map +1 -0
  37. package/dist/assets/{main-Chc871HV.js → main-D48Ben7C.js} +68 -28
  38. package/dist/assets/main-D48Ben7C.js.map +1 -0
  39. package/dist/assets/{ownDid-BOuSlDv-.js → ownDid-CwxFBzOH.js} +5 -4
  40. package/dist/assets/ownDid-CwxFBzOH.js.map +1 -0
  41. package/dist/assets/{ownStatus-CLA1VPkL.js → ownStatus-DjD0sQKF.js} +34 -11
  42. package/dist/assets/ownStatus-DjD0sQKF.js.map +1 -0
  43. package/dist/assets/{profiles-BH1bH9aE.js → profiles-BAJf0c9E.js} +33 -8
  44. package/dist/assets/profiles-BAJf0c9E.js.map +1 -0
  45. package/dist/assets/{registry-DAq16T-V.js → registry-CHwHTWbK.js} +1 -1
  46. package/dist/assets/{registry-DP_-RA-v.js → registry-CPuexTle.js} +25 -13
  47. package/dist/assets/registry-CPuexTle.js.map +1 -0
  48. package/dist/assets/{resolve-B1eQ4dVQ.js → resolve-BqmGXKn4.js} +2 -2
  49. package/dist/assets/{resolve-B1eQ4dVQ.js.map → resolve-BqmGXKn4.js.map} +1 -1
  50. package/dist/assets/{server-Bd2ofxc1.js → server-e4oKeNez.js} +399 -88
  51. package/dist/assets/server-e4oKeNez.js.map +1 -0
  52. package/dist/assets/{sshForges-As7dbGXM.js → sshForges-Cqt3qfWe.js} +2 -2
  53. package/dist/assets/{sshForges-As7dbGXM.js.map → sshForges-Cqt3qfWe.js.map} +1 -1
  54. package/dist/assets/translate-DnuQMfj0.js.map +1 -1
  55. package/dist/assets/{waitNotice-BHuMofaH.js → waitNotice-mB0Ym145.js} +2 -2
  56. package/dist/assets/{waitNotice-BHuMofaH.js.map → waitNotice-mB0Ym145.js.map} +1 -1
  57. package/dist/ghostly.mjs +1 -1
  58. package/npm-shrinkwrap.json +2 -2
  59. package/package.json +1 -1
  60. package/dist/assets/api-O57SNJcb.js.map +0 -1
  61. package/dist/assets/apiKit-CPTFJHA7.js.map +0 -1
  62. package/dist/assets/apps-gXpGFPiv.js.map +0 -1
  63. package/dist/assets/backup-CxH3auHB.js.map +0 -1
  64. package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js +0 -5
  65. package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js.map +0 -1
  66. package/dist/assets/bark_ffi_wasm_bg-VNmaJsc9.wasm +0 -0
  67. package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js +0 -5
  68. package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js.map +0 -1
  69. package/dist/assets/bitcoindevkit_bg-DXil67yS.wasm +0 -0
  70. package/dist/assets/buttons-YTYEqvGC.js +0 -1
  71. package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js +0 -5
  72. package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js.map +0 -1
  73. package/dist/assets/fedimint_client_wasm_bg-DeFtkIv6.wasm +0 -0
  74. package/dist/assets/groupMeta-CeZpqVVC.js.map +0 -1
  75. package/dist/assets/host-CRA7h5A2.js.map +0 -1
  76. package/dist/assets/identityProofs-B8zCp5_0.js.map +0 -1
  77. package/dist/assets/irohWeb-mnOi2Jp7.js.map +0 -1
  78. package/dist/assets/main-Chc871HV.js.map +0 -1
  79. package/dist/assets/ownDid-BOuSlDv-.js.map +0 -1
  80. package/dist/assets/ownStatus-CLA1VPkL.js.map +0 -1
  81. package/dist/assets/profiles-BH1bH9aE.js.map +0 -1
  82. package/dist/assets/registry-DP_-RA-v.js.map +0 -1
  83. package/dist/assets/server-Bd2ofxc1.js.map +0 -1
@@ -1,23 +1,23 @@
1
- import { $ as beaconKeys, $i as MAX_SHARED_APPS, $n as reactionEmoji, $t as vapidKeysMatch, Aa as sha256Paced, Ai as GhostlyHttpError, Ar as statusCardText, At as TypingSender, Bn as REMOVED_TEXT, Br as GROUP_MEMBER_CAP, Bt as WAKE_CALL_INTERVAL_MS, C as MESSAGE_PACED, Cn as dhtFileId, Cr as cardEditNumber, Ct as liveStatus, D as pairedMessageFrame, Da as pacer, Di as RELAY_POLL_INTERVALS, Dr as readStatusCard, E as pairedMessageFits, Ei as PRESENCE_WINDOW, En as sanitizeMime, Er as checkStatusCard, Et as TYPING_FRAME, F as readGroupFileMeta, Fa as appRefPublisher, Fi as LIMITS, Fr as heardTime, Ft as mayPin, G as readGroupSignal, Gn as forwardedAgain, Gr as commitHash, Gt as WakeLimiter, Ha as readAppRevocation, Hn as dhtEditId, Hr as MEMBER_KEY, Ht as WAKE_ONLINE_BATCH_MS, Ia as appRevocationsFileEntries, Ii as decodeControl, In as parseVideoMeta, Ir as receivedTimestamp, It as nextPinNumber, J as mayBeHub, Ji as parseCallSignal, Jn as GROUP_REACTION_FRAME, Jr as parseGroupCommit, Jt as parseWakeFrame, K as MESH_HUBS, Ki as contactRtcConfig, Kn as readForwarded, Kr as commitUntaggedHash, Kt as deviceWakeRequest, Li as encodeControl, Ln as EDIT_BUFFER_MS, Lr as shownTime, Lt as pinIsNewer, Mi as formatLocalTarget, Mn as fileMessageText, Mt as typingActivity, N as groupFileFallback, Na as appFingerprint, Ni as parseLocalTarget, Nn as parseVoiceMeta, Nr as arrivalKey, Nt as GROUP_PIN_FRAME, O as GROUP_FILE_LIMITS, Oi as WATCH_PEER_MS, Or as sameButtonText, Pa as appRef, Pi as webLocalFetch, Pr as claimedTime, Pt as PIN_LIMITS, Q as COMMUNITY_TOPOLOGY, Qa as parseImageMeta, Qi as LEGACY_SERVICES, Qn as queueReaction, Qr as signCommit, Qt as checkPushEndpoint, Ra as isAppHash, Rn as EDIT_RATE_WINDOW_MS, Rr as GROUP_ADMIN_OFF_ERROR, Rt as pinNumberHolds, S as LIVENESS_PING_MS, Sa as appViewOf, Sn as DHT_FILE_CAPABILITY, St as STATUS_IDLE_AFTER_MS, T as pairedEditFits, Tn as sanitizeFileName, Ua as readAppRevocationShape, Un as validEditNumber, Ur as OWN_FRAME_LIMIT, Ut as WAKE_ONLINE_DELAY_MS, Va as isAppRef, Vi as RTC_CONFIG, Vn as RateWindow, Vt as WAKE_INTERVAL_MS, W as groupSignalFrame, Wn as validRemovalNumber, Wr as SAID_AGAIN, X as meshRendezvous, Xi as emptyLinkRecords, Xn as ReactionWindow, Xr as rosterAdmin, Xt as wakeFrame, Y as meshHubs, Yn as REACTION_LIMITS, Yr as rememberAlone, Yt as relayRequest, Z as pickMeshHubs, Zi as HTTP_SERVICE_PROTO, Zn as nextReactionNumber, Zr as rosterHas, Zt as wakeRequest, _ as signGroupMeta, _a as seenEntry, _i as RATCHET_CAPABILITY, _o as deviceEchoNonce, a as groupMetaChange, aa as contactDay, ai as confirmationTag, an as APPS_CAPABILITY, ao as OwnInviteError, ar as groupReplyAuthor, at as lobbyRecords, b as GhostLink, bi as ratchetSessionOf, bo as devicePingFrame, bt as transferStalled, c as groupMetaTag, ca as knockSlotOf, ci as encryptText, cn as STATUS_CARD_CAPABILITY, co as encodeInviteCode, cr as replySnippet, ct as newerHead, d as keepPastGroupMeta, da as makeStampPaced, di as newEpochSecret, dn as DHT_TEXT_CAPABILITY, dt as readBeacon, ea as serviceIdFromName, ei as verifyChain, en as APP_RANGE_LIMITS, eo as canonicalJson, er as reactionIsNewer, et as beaconRecords, f as nextGroupMetaRevision, fa as mergeContactKnocks, fn as capsDescriptors, fo as pastedAgain, ft as readBeaconHead, g as parseGroupMetaTag, ga as requestRecords, gi as sha256Hex, gn as validExternalKey, go as deviceEchoFrame, gt as FILE_LIMITS, h as parseGroupMetaFrame, ha as readLinkRecord, hi as sealSecret, hn as emptyProofLedger, ho as HANDOFF_CAPABILITY, ht as ChatFiles, i as groupMetaBody, ia as contactAskerHolds, ii as confirmationMatches, in as isAppVersion, io as INVITE_MAX_LENGTH, ir as REPLY_LIMITS, it as lobbyKeys, jr as withoutAppLink, k as GROUP_HAVE_FRAME, ka as readAppBundleAsync, ki as presenceSeenAt, kt as TypingReceiver, l as groupMetaToHand, la as knockSlotRecords, li as epochKeys, ln as UPGRADE_CAPABILITY, lo as inviteLink, lr as wireReply, lt as pickHubs, m as parseGroupMetaBody, ma as readKnockSlot, mn as PeerProofs, mo as ENROLL_CAPABILITY, mt as shouldBeHub, na as REQUEST_LIFETIME_MS, ni as verifyCommitSignature, no as readCanonicalJson, nr as validReactionNumber, nt as freshHubs, o as groupMetaNewer, oa as knockHolds, oi as decryptText, on as BUTTONS_CAPABILITY, oo as createChatInvite, or as pairedReplyAuthor, ot as mergeBeacon, p as openGroupMeta, pa as openRequest, pi as openSecret, pn as dialDescriptors, po as DEVICES_CAPABILITY, pt as readLobby, q as NO_HUB_POLICY, qn as COMMUNITY_REACTION_FRAME, qr as expectedRoster, qt as newWakeToken, r as groupDisplayName, ra as contactAskerFrame, ri as GROUP_PROFILE, rn as chatAppId, ro as INVITE_HRP, rr as wireReaction, rt as hubRank, s as groupMetaPicture, sa as knockSlotIdentity, si as edgeParams, sn as EDIT_CAPABILITY, so as decodeInviteCode, sr as readReply, st as mergeLobby, t as encodeGroupMetaBody, ta as ContactRequestError, ti as verifyCommit, tn as isServeId, to as canonicalJsonBytes, tr as readReaction, tt as doorHubs, u as groupName, ua as linkRecords, un as CapsExchange, uo as inviteOwnership, ur as BUTTON_ID, ut as rankHubs, v as verifyGroupMetaSignature, va as APP_BUNDLE_LIMITS, vi as RatchetBox, vo as deviceKeyZ32, vr as STATUS_CARD_LIMITS, vt as sentWhole, w as PAIRED_FRAME_TOO_LARGE, wi as DHT_POLL_INTERVALS, wn as formatFileSize, wt as personStatus, x as INVITE_TAKEN, xa as appDigest, xi as DirectPathWatch, xn as peekDhtMailbox, xo as newDeviceSetSecret, y as wrapGroupMeta, ya as APP_BUNDLE_MAGIC, yi as emptyRatchetState, yn as DHT_MESSAGE_TTL, yo as deviceLinkPairing, yt as transferEnded, z as CarriedTransport, za as isAppKey, zn as MAX_REMOVAL_NUMBER, zr as GROUP_ID, zt as readPin } from "./groupMeta-CeZpqVVC.js";
2
- import { _ as receivedIdentityStatus, d as emptyIdentityLedger, y as lastSharedWithMe } from "./identityProofs-B8zCp5_0.js";
1
+ import { $ as beaconKeys, $i as MAX_SHARED_APPS, $n as reactionEmoji, $t as vapidKeysMatch, Aa as sha256Paced, Ai as GhostlyHttpError, Ar as statusCardText, At as TypingSender, Bn as REMOVED_TEXT, Br as GROUP_MEMBER_CAP, Bt as WAKE_CALL_INTERVAL_MS, C as MESSAGE_PACED, Cn as dhtFileId, Cr as cardEditNumber, Ct as liveStatus, D as pairedMessageFrame, Da as pacer, Di as RELAY_POLL_INTERVALS, Dr as readStatusCard, E as pairedMessageFits, Ei as PRESENCE_WINDOW, En as sanitizeMime, Er as checkStatusCard, Et as TYPING_FRAME, F as readGroupFileMeta, Fa as appRefPublisher, Fi as LIMITS, Fr as heardTime, Ft as mayPin, G as readGroupSignal, Gn as forwardedAgain, Gr as commitHash, Gt as WakeLimiter, Ha as readAppRevocation, Hn as dhtEditId, Hr as MEMBER_KEY, Ht as WAKE_ONLINE_BATCH_MS, Ia as appRevocationsFileEntries, Ii as decodeControl, In as parseVideoMeta, Ir as receivedTimestamp, It as nextPinNumber, J as mayBeHub, Ji as parseCallSignal, Jn as GROUP_REACTION_FRAME, Jr as parseGroupCommit, Jt as parseWakeFrame, K as MESH_HUBS, Ki as contactRtcConfig, Kn as readForwarded, Kr as commitUntaggedHash, Kt as deviceWakeRequest, Li as encodeControl, Ln as EDIT_BUFFER_MS, Lr as shownTime, Lt as pinIsNewer, Mi as formatLocalTarget, Mn as fileMessageText, Mt as typingActivity, N as groupFileFallback, Na as appFingerprint, Ni as parseLocalTarget, Nn as parseVoiceMeta, Nr as arrivalKey, Nt as GROUP_PIN_FRAME, O as GROUP_FILE_LIMITS, Oi as WATCH_PEER_MS, Or as sameButtonText, Pa as appRef, Pi as webLocalFetch, Pr as claimedTime, Pt as PIN_LIMITS, Q as COMMUNITY_TOPOLOGY, Qa as parseImageMeta, Qi as LEGACY_SERVICES, Qn as queueReaction, Qr as signCommit, Qt as checkPushEndpoint, Ra as isAppHash, Rn as EDIT_RATE_WINDOW_MS, Rr as GROUP_ADMIN_OFF_ERROR, Rt as pinNumberHolds, S as LIVENESS_PING_MS, Sa as appViewOf, Sn as DHT_FILE_CAPABILITY, St as STATUS_IDLE_AFTER_MS, T as pairedEditFits, Tn as sanitizeFileName, Ua as readAppRevocationShape, Un as validEditNumber, Ur as OWN_FRAME_LIMIT, Ut as WAKE_ONLINE_DELAY_MS, Va as isAppRef, Vi as RTC_CONFIG, Vn as RateWindow, Vt as WAKE_INTERVAL_MS, W as groupSignalFrame, Wn as validRemovalNumber, Wr as SAID_AGAIN, X as meshRendezvous, Xi as emptyLinkRecords, Xn as ReactionWindow, Xr as rosterAdmin, Xt as wakeFrame, Y as meshHubs, Yn as REACTION_LIMITS, Yr as rememberAlone, Yt as relayRequest, Z as pickMeshHubs, Zi as HTTP_SERVICE_PROTO, Zn as nextReactionNumber, Zr as rosterHas, Zt as wakeRequest, _ as signGroupMeta, _a as seenEntry, _i as RATCHET_CAPABILITY, _o as deviceEchoNonce, a as groupMetaChange, aa as contactDay, ai as confirmationTag, an as APPS_CAPABILITY, ao as OwnInviteError, ar as groupReplyAuthor, at as lobbyRecords, b as GhostLink, bi as ratchetSessionOf, bo as devicePingFrame, bt as transferStalled, c as groupMetaTag, ca as knockSlotOf, ci as encryptText, cn as STATUS_CARD_CAPABILITY, co as encodeInviteCode, cr as replySnippet, ct as newerHead, d as keepPastGroupMeta, da as makeStampPaced, di as newEpochSecret, dn as DHT_TEXT_CAPABILITY, dt as readBeacon, ea as serviceIdFromName, ei as verifyChain, en as APP_RANGE_LIMITS, eo as canonicalJson, er as reactionIsNewer, et as beaconRecords, f as nextGroupMetaRevision, fa as mergeContactKnocks, fn as capsDescriptors, fo as pastedAgain, ft as readBeaconHead, g as parseGroupMetaTag, ga as requestRecords, gi as sha256Hex, gn as validExternalKey, go as deviceEchoFrame, gt as FILE_LIMITS, h as parseGroupMetaFrame, ha as readLinkRecord, hi as sealSecret, hn as emptyProofLedger, ho as HANDOFF_CAPABILITY, ht as ChatFiles, i as groupMetaBody, ia as contactAskerHolds, ii as confirmationMatches, in as isAppVersion, io as INVITE_MAX_LENGTH, ir as REPLY_LIMITS, it as lobbyKeys, jr as withoutAppLink, k as GROUP_HAVE_FRAME, ka as readAppBundleAsync, ki as presenceSeenAt, kt as TypingReceiver, l as groupMetaToHand, la as knockSlotRecords, li as epochKeys, ln as UPGRADE_CAPABILITY, lo as inviteLink, lr as wireReply, lt as pickHubs, m as parseGroupMetaBody, ma as readKnockSlot, mn as PeerProofs, mo as ENROLL_CAPABILITY, mt as shouldBeHub, na as REQUEST_LIFETIME_MS, ni as verifyCommitSignature, no as readCanonicalJson, nr as validReactionNumber, nt as freshHubs, o as groupMetaNewer, oa as knockHolds, oi as decryptText, on as BUTTONS_CAPABILITY, oo as createChatInvite, or as pairedReplyAuthor, ot as mergeBeacon, p as openGroupMeta, pa as openRequest, pi as openSecret, pn as dialDescriptors, po as DEVICES_CAPABILITY, pt as readLobby, q as NO_HUB_POLICY, qn as COMMUNITY_REACTION_FRAME, qr as expectedRoster, qt as newWakeToken, r as groupDisplayName, ra as contactAskerFrame, ri as GROUP_PROFILE, rn as chatAppId, ro as INVITE_HRP, rr as wireReaction, rt as hubRank, s as groupMetaPicture, sa as knockSlotIdentity, si as edgeParams, sn as EDIT_CAPABILITY, so as decodeInviteCode, sr as readReply, st as mergeLobby, t as encodeGroupMetaBody, ta as ContactRequestError, ti as verifyCommit, tn as isServeId, to as canonicalJsonBytes, tr as readReaction, tt as doorHubs, u as groupName, ua as linkRecords, un as CapsExchange, uo as inviteOwnership, ur as BUTTON_ID, ut as rankHubs, v as verifyGroupMetaSignature, va as APP_BUNDLE_LIMITS, vi as RatchetBox, vo as deviceKeyZ32, vr as STATUS_CARD_LIMITS, vt as sentWhole, w as PAIRED_FRAME_TOO_LARGE, wi as DHT_POLL_INTERVALS, wn as formatFileSize, wt as personStatus, x as INVITE_TAKEN, xa as appDigest, xi as DirectPathWatch, xn as peekDhtMailbox, xo as newDeviceSetSecret, y as wrapGroupMeta, ya as APP_BUNDLE_MAGIC, yi as emptyRatchetState, yn as DHT_MESSAGE_TTL, yo as deviceLinkPairing, yt as transferEnded, z as CarriedTransport, za as isAppKey, zn as MAX_REMOVAL_NUMBER, zr as GROUP_ID, zt as readPin } from "./groupMeta-Cz95F6sX.js";
2
+ import { _ as receivedIdentityStatus, d as emptyIdentityLedger, y as lastSharedWithMe } from "./identityProofs-zI_Iy9uI.js";
3
3
  import { _ as openDb, a as GROUP_LIGHT_RANGE, b as transact, c as clearProfileStores, d as deleteDatabase, f as errorLine, h as groupLiveKey, i as FILE_INDEX, l as committed, m as groupLightKey, n as APP_STORAGE_SCOPE_INDEX, o as GROUP_LIVE_RANGE, p as fileStore, r as CARD_INDEX, s as STORES$1, t as APP_STORAGE_CHAT_INDEX, u as databaseName, v as profileOpenFailure, x as wrap, y as store } from "./idb-ewvbqyDI.js";
4
4
  import { c as fileSpace, f as FILE_BYTES_STEP, o as fileBytes, r as blobDigest, s as fileBytesOf, u as removeFileBytes } from "./fileBytes-CfvUXdSy.js";
5
5
  import { a as sealSeed, c as openRow, d as sealRow, g as whenDataKeyDropped, h as sealSecret$1, i as newDeviceKey, l as openRows, m as openSecret$1, o as unsealSeed, r as intentRepository, s as RowSeals } from "./networkReason-DYlPZS5M.js";
6
- import { $ as cardsKey, $t as validEditText, A as assertConfirmedReal, At as COMMUNITY_LIMITS, B as copyForForward, Bt as encodeGroupEntryLink, C as pairedWireReply, Ct as WrongNetworkError, D as paymentAlias, Dt as requireTurn, E as replyTo, Et as refuseAway, F as paymentNetworksOf, Ft as encodeCommunityLink, G as removeStored, Gt as readKnocks, H as forwardKind, Ht as knockIdentity, I as walletInstances, It as memberAdmissions, Jt as GROUP_EDIT_FRAME, K as storedSize, Kt as CatchUpAnswers, Lt as routedCommunityFrame, M as createTiming, Mt as GROUP_READ_NOTE_COMMUNITY, N as crossNetwork, Nt as communityHasFrame, O as paymentWireId, Ot as setAwayWallets, P as paymentNetwork, Pt as decodeCommunityLink, Q as LightningCards, Qt as parseCommunityEdit, R as WALLET_TYPES, S as groupReply, St as ModeGate, T as replyRef, Tt as awayFrom, U as FileAppender, Ut as knockRecords, V as forwardError, Vt as entryParams, W as readStored$2, Wt as mergeKnocks, X as IdentityProofs, Xt as carryMentions, Yt as GROUP_EDIT_TEXT_BYTES, Z as CASHU_CARD, Zt as meshMessageRef, _ as GroupFileDesk, _t as breezDatabasesFor, a as CashuWallet, at as INVOICE_PACE, b as groupOfFile, bt as relayOnlyProblem, c as assertAmount, ct as CASHU_MINT_SOURCE, d as groupPayLineId, dt as CashuAdapter, en as MENTION_LIMITS, et as BREEZ_SOURCE, ft as swapSettledAt, g as parsePayLink, gt as breezDatabaseInUse, h as pairLinkId, ht as openBreez, i as onPublicIrohRelay, it as lightningPaying, j as createFailure, jt as CommunitySession, k as WALLET_NAMES, kt as setSingleWriterGate, l as normalizeMintUrl, lt as cashuMint, m as groupLinkId, mt as loadBreezSdk, n as createIrohWebEndpoint, nn as validMentions, nt as normalizePhrase, o as SwapUnsettledError, ot as ProviderSources, pt as forgetBreez, q as streamStored, r as irohRelayProblem, rn as wireMentions, rt as journaledPayment, st as sourceKey, t as DEFAULT_IROH_RELAYS, tn as mentionsMember, tt as breez, ut as AskBackoff, v as groupFileId, vt as iceServerProblem, w as receivedPairedReply, wt as networkLabel, x as storedGroupFiles, xt as ModeChanged, y as groupFileText, yt as iceServerSetting, z as FORWARD_MESSAGE_GONE, zt as decodeGroupEntryLink } from "./irohWeb-mnOi2Jp7.js";
6
+ import { $ as cardsKey, $t as validEditText, A as assertConfirmedReal, At as COMMUNITY_LIMITS, B as copyForForward, Bt as encodeGroupEntryLink, C as pairedWireReply, Ct as WrongNetworkError, D as paymentAlias, Dt as requireTurn, E as replyTo, Et as refuseAway, F as paymentNetworksOf, Ft as encodeCommunityLink, G as removeStored, Gt as readKnocks, H as forwardKind, Ht as knockIdentity, I as walletInstances, It as memberAdmissions, Jt as GROUP_EDIT_FRAME, K as storedSize, Kt as CatchUpAnswers, Lt as routedCommunityFrame, M as createTiming, Mt as GROUP_READ_NOTE_COMMUNITY, N as crossNetwork, Nt as communityHasFrame, O as paymentWireId, Ot as setAwayWallets, P as paymentNetwork, Pt as decodeCommunityLink, Q as LightningCards, Qt as parseCommunityEdit, R as WALLET_TYPES, S as groupReply, St as ModeGate, T as replyRef, Tt as awayFrom, U as FileAppender, Ut as knockRecords, V as forwardError, Vt as entryParams, W as readStored$2, Wt as mergeKnocks, X as IdentityProofs, Xt as carryMentions, Yt as GROUP_EDIT_TEXT_BYTES, Z as CASHU_CARD, Zt as meshMessageRef, _ as GroupFileDesk, _t as breezDatabasesFor, a as CashuWallet, at as INVOICE_PACE, b as groupOfFile, bt as relayOnlyProblem, c as assertAmount, ct as CASHU_MINT_SOURCE, d as groupPayLineId, dt as CashuAdapter, en as MENTION_LIMITS, et as BREEZ_SOURCE, ft as swapSettledAt, g as parsePayLink, gt as breezDatabaseInUse, h as pairLinkId, ht as openBreez, i as onPublicIrohRelay, it as lightningPaying, j as createFailure, jt as CommunitySession, k as WALLET_NAMES, kt as setSingleWriterGate, l as normalizeMintUrl, lt as cashuMint, m as groupLinkId, mt as loadBreezSdk, n as createIrohWebEndpoint, nn as validMentions, nt as normalizePhrase, o as SwapUnsettledError, ot as ProviderSources, pt as forgetBreez, q as streamStored, r as irohRelayProblem, rn as wireMentions, rt as journaledPayment, st as sourceKey, t as DEFAULT_IROH_RELAYS, tn as mentionsMember, tt as breez, ut as AskBackoff, v as groupFileId, vt as iceServerProblem, w as receivedPairedReply, wt as networkLabel, x as storedGroupFiles, xt as ModeChanged, y as groupFileText, yt as iceServerSetting, z as FORWARD_MESSAGE_GONE, zt as decodeGroupEntryLink } from "./irohWeb-BLDcHwYz.js";
7
7
  import { C as cashuRequestPayload, D as parseCashuRequestPayload, E as isFederationId, O as parseFedimintRequestPayload, S as ENDPOINT, T as findEndpoint, _ as SPARK_NETWORKS, a as SEPOLIA_TEST_USDT, b as sparkInvoiceDetails, c as USDT_PUBLIC_RPC, d as assertTokenUnits, f as assertWholeSats, g as walletNetworkOf, h as validatePaymentTarget, i as PaymentPreflightError, l as WALLET_NETWORKS, n as EVM_TEST_CHAINS, p as formatPaymentAmount, r as ONCHAIN_PROVIDER, s as TEST_USDT_FAUCET_AMOUNT, t as ETHEREUM_USDT, u as arkAddressPrefix, v as SPARK_PROVIDER, w as fedimintRequestPayload, x as isBitcoinAddress, y as sparkAddressKind } from "./paymentIntent-Cr3uZa_0.js";
8
8
  import { a as decodeBolt11, t as nwc } from "./nwcProvider-pL2XqSbW.js";
9
9
  import { a as parseEngineError, i as engineText, r as engineError, t as EngineError } from "./engineErrors-wWlLy54D.js";
10
- import { r as loadFedimintSdk, t as fedimintDatabase } from "./fedimintSdk-D-6H9Pe7.js";
10
+ import { r as loadFedimintSdk, t as fedimintDatabase } from "./fedimintSdk-eLXBrj9i.js";
11
11
  import { i as SourceUnreachableError, n as PROVIDER_PLATFORMS, o as isNothingSpentError, r as SourceConfigError, t as NothingSpentError, u as redact } from "./types-CdWwgvyt.js";
12
- import { a as registeredLightningProviders, b as isPubkyKey, c as boundedIdentityFetch, d as testSwitch, g as encodeDidDhtPacket, h as encodeDidDhtDeactivated, m as didDhtFromPublicKey, n as setOwnDidSource, o as registeredOnchainProviders, p as didDhtDocument, r as onAdaptersChanged, s as reserveAdapterIds, u as testBuild, v as signDidDhtPacket } from "./ownDid-BOuSlDv-.js";
12
+ import { a as registeredLightningProviders, b as isPubkyKey, c as boundedIdentityFetch, d as testSwitch, g as encodeDidDhtPacket, h as encodeDidDhtDeactivated, m as didDhtFromPublicKey, n as setOwnDidSource, o as registeredOnchainProviders, p as didDhtDocument, r as onAdaptersChanged, s as reserveAdapterIds, u as testBuild, v as signDidDhtPacket } from "./ownDid-CwxFBzOH.js";
13
13
  import { S as verify, _ as identityFromSeed, a as createRelayPayload, c as openRelayPayload, d as signRelayPayload, f as decodeDnsAnswers, g as createIdentity, m as encodeTxtPacket, p as decodeTxtPacket, r as PacketTooLargeError, v as identityFromSeedB64, x as sign, y as publicKeyFromZ32 } from "./pkarr-BQo4PcCg.js";
14
14
  import { c as normalizeRelayUrl, d as traceLink, g as withRequestOptions, i as RelayTransport, m as isDiscoveryBudgetError, p as budgetRetryMs, s as currentRelays, t as DEFAULT_RELAYS } from "./relay-gJTOYQJZ.js";
15
15
  import { a as stripHidden, i as sanitizeNick, n as hasVisible, r as sanitizeDisplayText, s as unwrapPasted, t as dropLoneJoiners } from "./text-li76pThX.js";
16
16
  import { a as fromZ32, d as utf8Decode, f as utf8Encode, i as fromBase64Url, l as toBase64Url, n as concatBytes$1, o as isZ32Key, s as randomBytes, t as bytesEqual, u as toZ32 } from "./bytes-C1DNGY18.js";
17
17
  import { _ as HoldKeys, b as newMailbox, g as HOLD_LIMITS, h as HOLD_DATED_BACK_MS, i as automaticTransport, m as HOLD_CAPABILITY, r as TRANSPORTS, v as HoldRefusedError, w as generateEncryptionKey, x as readManifest, y as isHoldUrl } from "./pairedTransports-DAzupLYo.js";
18
18
  import { a as parseLinkPreview, s as sanitizeAvatar } from "./linkPreview-5kHmKUTN.js";
19
- import { C as isAtprotoDid, d as chosenResolver, h as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer, w as normalizeAtprotoHandle } from "./resolve-B1eQ4dVQ.js";
20
- import { S as webCryptoSigner, a as besideUrl, c as isGitHubPage, d as appStoreDecision, f as appUpdateDecision, h as APP_STORE_LIMITS, i as appPasteUrl, l as addedAppPermissions, m as planAppUpdate, n as APP_FETCH_LIMITS, o as boundedAppFetch, p as checkAppBeforeRun, r as AppFetchError, s as isAppFetchUrl, u as appRevocationFor, v as readAppStoreSteps, x as seedSigner } from "./appFetch-Ca9DNQQ2.js";
19
+ import { C as isAtprotoDid, d as chosenResolver, h as setPkarrRelaySource, r as resolveAtprotoDid, t as assertPublicServer, w as normalizeAtprotoHandle } from "./resolve-BqmGXKn4.js";
20
+ import { S as webCryptoSigner, a as besideUrl, c as isGitHubPage, d as appStoreDecision, f as appUpdateDecision, h as APP_STORE_LIMITS, i as appPasteUrl, l as addedAppPermissions, m as planAppUpdate, n as APP_FETCH_LIMITS, o as boundedAppFetch, p as checkAppBeforeRun, r as AppFetchError, s as isAppFetchUrl, u as appRevocationFor, v as readAppStoreSteps, x as seedSigner } from "./appFetch-BQO5Pk7W.js";
21
21
  import { l as isWorthlessMint, n as DEFAULT_MINTS, r as TEST_MINT, u as mintNetwork } from "./mints-CMDLbMeH.js";
22
22
  import { n as traceJoin } from "./joinTrace-xKBe73j9.js";
23
23
  import { n as MAX_BACKUP_BYTES, t as BACKUP_MEDIA_TYPE } from "./envelope-Bi2kMqbp.js";
@@ -1748,6 +1748,12 @@ var GROUP_LIMITS = {
1748
1748
  /** Own messages kept for catch-up: count and total ciphertext bytes. */
1749
1749
  outlog: 32,
1750
1750
  outlogBytes: 131072,
1751
+ /**
1752
+ * Own messages past that log that members may not have taken (`GroupState.owed`): count and total ciphertext bytes.
1753
+ * With the log, the 256 a member takes in one answer.
1754
+ */
1755
+ owed: 224,
1756
+ owedBytes: 524288,
1751
1757
  /** Frames waiting for an epoch (or its secret) that has not arrived yet. */
1752
1758
  waiting: 64,
1753
1759
  waitingBytes: 1048576,
@@ -1835,6 +1841,7 @@ var GROUP_TAKEOVER_META_MS = 6e5;
1835
1841
  * hears it, with what the member says live beside it, and the edits its app says again), then
1836
1842
  * `GROUP_LIMITS.messagesPerAuthor` and `messageBytesPerAuthor` per `messageWindowMs`, as a community's `MessagePace`.
1837
1843
  * 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.
1844
+ * Every member refuses the same live frames, so only the author holds them: past its log, it keeps them (`owed`).
1838
1845
  * What another member hands on in its answer to my sync (or what waited for a secret) is counted too, and may run the
1839
1846
  * author's allowance below nothing by one answer's worth (`AUTHOR_OWED`): a catch-up holds more than a burst, and lands
1840
1847
  * 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
@@ -1855,25 +1862,47 @@ var AUTHOR_OWED = {
1855
1862
  bytes: GROUP_LIMITS.relayEditBytes
1856
1863
  }
1857
1864
  };
1865
+ /**
1866
+ * The pace my own frames go at, as members count it, with half their burst and the room left spent on a frame it does
1867
+ * not take (one a member may take still): an edge opening hands my log again, and frames arrive closer together than I
1868
+ * said them, so a frame members refuse is never one this takes.
1869
+ */
1870
+ var OWN_BURST = {
1871
+ frames: GROUP_LIMITS.outlog,
1872
+ bytes: GROUP_LIMITS.outlogBytes
1873
+ };
1858
1874
  var AuthorPace = class {
1859
1875
  owed;
1860
- frames = AUTHOR_BURST.frames;
1861
- bytes = AUTHOR_BURST.bytes;
1876
+ burst;
1877
+ frames;
1878
+ bytes;
1862
1879
  at;
1863
- constructor(owed) {
1880
+ constructor(owed, burst = AUTHOR_BURST) {
1864
1881
  this.owed = owed;
1882
+ this.burst = burst;
1883
+ this.frames = burst.frames;
1884
+ this.bytes = burst.bytes;
1865
1885
  }
1866
- /** `answer`: handed on in an answer to my sync, or waited, so it may run the allowance below nothing (`owed`). */
1867
- take(bytes, now, answer = false) {
1886
+ /**
1887
+ * `answer`: handed on in an answer to my sync, or waited, so it may run the allowance below nothing (`owed`).
1888
+ * `spend`: one not taken still spends what is left of the allowance.
1889
+ */
1890
+ take(bytes, now, answer = false, spend = false) {
1868
1891
  const elapsed = Math.max(0, now - (this.at ?? now)) / GROUP_LIMITS.messageWindowMs;
1869
1892
  this.at = now;
1870
- this.frames = Math.min(AUTHOR_BURST.frames, this.frames + elapsed * GROUP_LIMITS.messagesPerAuthor);
1871
- this.bytes = Math.min(AUTHOR_BURST.bytes, this.bytes + elapsed * GROUP_LIMITS.messageBytesPerAuthor);
1893
+ this.frames = Math.min(this.burst.frames, this.frames + elapsed * GROUP_LIMITS.messagesPerAuthor);
1894
+ this.bytes = Math.min(this.burst.bytes, this.bytes + elapsed * GROUP_LIMITS.messageBytesPerAuthor);
1872
1895
  const floor = answer ? this.owed : {
1873
1896
  frames: 0,
1874
1897
  bytes: 0
1875
1898
  };
1876
- if (this.frames + floor.frames < 1 || this.bytes + floor.bytes < bytes) return false;
1899
+ if (this.frames + floor.frames < 1 || this.bytes + floor.bytes < bytes) {
1900
+ if (spend) {
1901
+ this.frames = Math.max(0, this.frames - 1);
1902
+ this.bytes = Math.max(0, this.bytes - bytes);
1903
+ }
1904
+ return false;
1905
+ }
1877
1906
  this.frames -= 1;
1878
1907
  this.bytes -= bytes;
1879
1908
  return true;
@@ -2186,6 +2215,21 @@ function missingIn(frame, from) {
2186
2215
  };
2187
2216
  }
2188
2217
  /**
2218
+ * Whether a member's sync shows it holds my frame `f`: it has seen up to it, and does not name it missing among all its
2219
+ * gaps, or among the newest it names when they are more than a sync holds (`GROUP_LIMITS.miss`).
2220
+ */
2221
+ function heldIn(frame) {
2222
+ const have = frame.have && typeof frame.have === "object" ? frame.have : {};
2223
+ const miss = frame.miss && typeof frame.miss === "object" ? frame.miss : {};
2224
+ return (f) => {
2225
+ const high = have[f.s]?.[f.e];
2226
+ if (!Number.isSafeInteger(high) || high < f.n) return false;
2227
+ const gaps = miss[f.s]?.[f.e];
2228
+ if (!Array.isArray(gaps)) return true;
2229
+ return !gaps.includes(f.n) && (gaps.length < GROUP_LIMITS.miss || gaps.some((n) => typeof n === "number" && n < f.n));
2230
+ };
2231
+ }
2232
+ /**
2189
2233
  * My own messages and the ones I kept of other members, as one list for a member catching up: each log keeps its own
2190
2234
  * order (mine as I sent them, the others' as they reached me, which no member's clock can change), and the two are
2191
2235
  * merged by the time each frame says, mine first when they say the same. A member whose clock is off moves only
@@ -2276,6 +2320,17 @@ var GroupSession = class {
2276
2320
  namesTaken = /* @__PURE__ */ new Map();
2277
2321
  /** Messages, and apart from them edits, taken per author (`AuthorPace`). In memory only. */
2278
2322
  messagePace = /* @__PURE__ */ new Map();
2323
+ /**
2324
+ * My own frames as members pace them (`OWN_BURST`), and those of mine in `sent` it did not take: one of them that falls
2325
+ * out of `sent` goes to `owed`. Then, per frame of `owed`, the members whose sync showed they hold it. In memory only:
2326
+ * after a start, each owed frame waits for a sync of every member.
2327
+ */
2328
+ ownPace = new AuthorPace({
2329
+ frames: 0,
2330
+ bytes: 0
2331
+ }, OWN_BURST);
2332
+ overPace = /* @__PURE__ */ new Set();
2333
+ owedHeld = /* @__PURE__ */ new Map();
2279
2334
  editPace = /* @__PURE__ */ new Map();
2280
2335
  queue = Promise.resolve();
2281
2336
  /** Metadata frames that name a commit or an epoch I do not have yet, one signed by the admin and one by anyone else (`waitMeta`): tried again when the chain moves. */
@@ -2314,6 +2369,12 @@ var GroupSession = class {
2314
2369
  */
2315
2370
  heard = /* @__PURE__ */ new Map();
2316
2371
  /**
2372
+ * Per author and epoch, the highest number of its own signed frames I did not take at its pace (`AuthorPace`): what
2373
+ * `lacking` names, so the author is asked for it again (it keeps it, `GroupState.owed`). Every member refuses the
2374
+ * same frames of a burst, all past the last one it took, so nothing else shows they are missing. In memory only.
2375
+ */
2376
+ refused = /* @__PURE__ */ new Map();
2377
+ /**
2317
2378
  * Per member: until when what comes over its edge may be its answer to my sync (`syncFrame`), a catch-up and not a
2318
2379
  * message written just now. Each frame of the answer keeps it open: it goes a slice at a time. In memory only.
2319
2380
  */
@@ -2591,7 +2652,11 @@ var GroupSession = class {
2591
2652
  */
2592
2653
  lacking() {
2593
2654
  const out = /* @__PURE__ */ new Map();
2594
- for (const sender of /* @__PURE__ */ new Set([...Object.keys(this.state.seen), ...this.heard.keys()])) {
2655
+ for (const sender of /* @__PURE__ */ new Set([
2656
+ ...Object.keys(this.state.seen),
2657
+ ...this.heard.keys(),
2658
+ ...this.refused.keys()
2659
+ ])) {
2595
2660
  if (sender === this.myKey || !rosterHas(this.roster, sender)) continue;
2596
2661
  const marks = Object.entries(this.missOf(sender)).map(([e, gaps]) => `${e}:${gaps.join(".")}`);
2597
2662
  if (marks.length) out.set(sender, marks.join(","));
@@ -2602,16 +2667,24 @@ var GroupSession = class {
2602
2667
  * What a sync names in `miss` for one sender now: per epoch, the newest `GROUP_LIMITS.miss` numbers that never arrived.
2603
2668
  * And, for an epoch of which none arrived, the newest numbers another member said it has (`heard`): a member back
2604
2669
  * after someone joined, whose author wrote 32 since (all its own answer holds), had nothing below them to ask for.
2670
+ * And, first, the oldest of those past the highest seen up to the highest of its frames I refused at its pace
2671
+ * (`refused`): its answer brings them oldest first, so what is named changes as they come.
2605
2672
  */
2606
2673
  missOf(sender) {
2607
2674
  const out = {};
2608
- const seen = this.state.seen[sender] ?? {};
2609
- for (const [e, entry] of Object.entries(seen)) {
2610
- const gaps = this.gaps(entry);
2675
+ const seen = this.state.seen[sender] ?? {}, refused = this.refused.get(sender);
2676
+ for (const e of /* @__PURE__ */ new Set([...Object.keys(seen), ...[...refused?.keys() ?? []].map(String)])) {
2677
+ const entry = seen[e] ?? {
2678
+ high: -1,
2679
+ window: []
2680
+ }, top = refused?.get(Number(e)) ?? -1;
2681
+ const gaps = [];
2682
+ for (let n = entry.high + 1; n <= top && gaps.length < GROUP_LIMITS.miss; n++) gaps.push(n);
2683
+ if (entry.high >= 0) gaps.push(...this.gaps(entry).slice(0, GROUP_LIMITS.miss - gaps.length));
2611
2684
  if (gaps.length) out[e] = gaps;
2612
2685
  }
2613
2686
  for (const [e, high] of this.heard.get(sender) ?? []) {
2614
- if (seen[e]) continue;
2687
+ if (seen[e] || out[e]) continue;
2615
2688
  const numbers = [];
2616
2689
  for (let n = high; n >= 0 && numbers.length < GROUP_LIMITS.miss; n--) numbers.push(n);
2617
2690
  out[e] = numbers;
@@ -2999,6 +3072,7 @@ var GroupSession = class {
2999
3072
  this.state.statusReason = reason;
3000
3073
  this.state.secrets = {};
3001
3074
  this.state.sent = [];
3075
+ delete this.state.owed;
3002
3076
  delete this.state.unsaid;
3003
3077
  this.state.relay = [];
3004
3078
  if (this.onRows) this.onRows = [];
@@ -3054,6 +3128,7 @@ var GroupSession = class {
3054
3128
  this.state.unsaid = [...this.state.unsaid ?? [], ownKey(frame)];
3055
3129
  const unsend = async (free) => {
3056
3130
  this.state.sent = this.state.sent.filter((f) => f !== frame);
3131
+ this.overPace.delete(ownKey(frame));
3057
3132
  this.state.unsaid = (this.state.unsaid ?? []).filter((key) => key !== ownKey(frame));
3058
3133
  if (free && this.state.seqEpoch === epoch && this.state.seq === n + 1) this.state.seq = n;
3059
3134
  await this.persist().catch(() => {});
@@ -3201,11 +3276,46 @@ var GroupSession = class {
3201
3276
  } : {}
3202
3277
  };
3203
3278
  }
3204
- /** Into my bounded log, for members who missed it. */
3279
+ /** Into my bounded log, for members who missed it; one said past the pace members apply goes on to `owed` when it falls out. */
3205
3280
  logOwn(frame) {
3281
+ if (!this.ownPace.take(frameBytes(frame), this.now(), false, true)) this.overPace.add(ownKey(frame));
3206
3282
  this.state.sent.push(frame);
3207
3283
  let bytes = this.state.sent.reduce((sum, f) => sum + f.c.length, 0);
3208
- while (this.state.sent.length > GROUP_LIMITS.outlog || bytes > GROUP_LIMITS.outlogBytes) bytes -= this.state.sent.shift().c.length;
3284
+ while (this.state.sent.length > GROUP_LIMITS.outlog || bytes > GROUP_LIMITS.outlogBytes) {
3285
+ const out = this.state.sent.shift();
3286
+ bytes -= out.c.length;
3287
+ if (this.overPace.delete(ownKey(out))) this.owe(out);
3288
+ }
3289
+ }
3290
+ owe(frame) {
3291
+ const owed = [...this.state.owed ?? [], frame];
3292
+ let bytes = owed.reduce((sum, f) => sum + f.c.length, 0);
3293
+ while (owed.length > GROUP_LIMITS.owed || bytes > GROUP_LIMITS.owedBytes) {
3294
+ const gone = owed.shift();
3295
+ bytes -= gone.c.length;
3296
+ this.owedHeld.delete(ownKey(gone));
3297
+ }
3298
+ this.state.owed = owed;
3299
+ }
3300
+ /** Drops from `owed` each frame every other member of its epoch has shown, in a sync, that it holds. */
3301
+ owedTaken(from, frame) {
3302
+ if (!this.state.owed?.length) return;
3303
+ const holds = heldIn(frame);
3304
+ const owed = this.state.owed.filter((f) => {
3305
+ const key = ownKey(f);
3306
+ let held = this.owedHeld.get(key);
3307
+ if (holds(f)) {
3308
+ if (!held) this.owedHeld.set(key, held = /* @__PURE__ */ new Set());
3309
+ held.add(from);
3310
+ }
3311
+ const readers = this.state.chain[f.e]?.m;
3312
+ const waits = !!readers && this.others.some((k) => rosterHas(readers, k) && !held?.has(k));
3313
+ if (!waits) this.owedHeld.delete(key);
3314
+ return waits;
3315
+ });
3316
+ if (owed.length === this.state.owed.length) return;
3317
+ this.state.owed = owed;
3318
+ this.persistSoon();
3209
3319
  }
3210
3320
  /**
3211
3321
  * My message `id` was deleted for everyone: its frame, and each copy said again, keep their place in my log (`nextSeq`,
@@ -3216,7 +3326,7 @@ var GroupSession = class {
3216
3326
  * I cannot sign theirs, and its author hands it on. Saved soon, as a community's `forget`; `flush` writes it now.
3217
3327
  */
3218
3328
  forget(id) {
3219
- const sent = this.state.sent.map((f) => !f.c ? f : this.messageIdOf(f) === id ? {
3329
+ const emptied = (f) => !f.c ? f : this.messageIdOf(f) === id ? {
3220
3330
  t: f.t,
3221
3331
  g: f.g,
3222
3332
  e: f.e,
@@ -3227,11 +3337,13 @@ var GroupSession = class {
3227
3337
  c: "",
3228
3338
  sig: "",
3229
3339
  ...f.o ? { o: f.o } : {}
3230
- } : this.unquoted(f, id));
3340
+ } : this.unquoted(f, id);
3341
+ const sent = this.state.sent.map(emptied), owed = this.state.owed?.map(emptied);
3231
3342
  const gone = (f) => this.messageIdOf(f) === id || !!this.quoting(f, id);
3232
3343
  const relay = this.state.relay?.filter((f) => !gone(f)), rows = this.onRows?.filter((f) => !gone(f));
3233
- if (sent.every((f, i) => f === this.state.sent[i]) && relay?.length === this.state.relay?.length && rows?.length === this.onRows?.length) return;
3344
+ if (sent.every((f, i) => f === this.state.sent[i]) && (owed ?? []).every((f, i) => f === this.state.owed[i]) && relay?.length === this.state.relay?.length && rows?.length === this.onRows?.length) return;
3234
3345
  this.state.sent = sent;
3346
+ if (owed) this.state.owed = owed;
3235
3347
  if (relay) this.state.relay = relay;
3236
3348
  if (rows) this.onRows = rows;
3237
3349
  this.persistSoon();
@@ -3844,7 +3956,12 @@ var GroupSession = class {
3844
3956
  delete raw.o;
3845
3957
  delete raw.xs;
3846
3958
  }
3847
- if (!this.paced(this.messagePace, raw.s, frameBytes(raw), relayed && (answer || waited))) return;
3959
+ if (!this.paced(this.messagePace, raw.s, frameBytes(raw), relayed && (answer || waited))) {
3960
+ let byEpoch = this.refused.get(raw.s);
3961
+ if (!byEpoch) this.refused.set(raw.s, byEpoch = /* @__PURE__ */ new Map());
3962
+ byEpoch.set(raw.e, Math.max(byEpoch.get(raw.e) ?? -1, raw.n));
3963
+ return;
3964
+ }
3848
3965
  const first = raw.o === void 0 ? null : readFirstPlace(raw.o, raw.e);
3849
3966
  if (raw.o !== void 0 && !first) return;
3850
3967
  const secret = this.secret(raw.e);
@@ -4099,6 +4216,10 @@ var GroupSession = class {
4099
4216
  for (const e of Object.keys(bySender)) if (Number(e) < this.epoch - GROUP_LIMITS.secrets) delete bySender[e];
4100
4217
  if (!Object.keys(bySender).length) delete this.state.seen[sender];
4101
4218
  }
4219
+ for (const [sender, byEpoch] of this.refused) {
4220
+ for (const e of byEpoch.keys()) if (e < this.epoch - GROUP_LIMITS.secrets) byEpoch.delete(e);
4221
+ if (!byEpoch.size) this.refused.delete(sender);
4222
+ }
4102
4223
  }
4103
4224
  park(from, frame) {
4104
4225
  if (frame.e > this.epoch + GROUP_LIMITS.secrets) return;
@@ -4271,6 +4392,7 @@ var GroupSession = class {
4271
4392
  if (!answered) this.syncsAnswered.set(from, answered = new RateWindow(GROUP_LIMITS.syncAnswers, GROUP_LIMITS.syncWindowMs, () => this.hooks.clock?.() ?? Date.now()));
4272
4393
  if (!answered.take()) return;
4273
4394
  this.hear(frame);
4395
+ this.owedTaken(from, frame);
4274
4396
  await this.vouch(from, frame.mt);
4275
4397
  if (frame.e > this.epoch) {
4276
4398
  this.syncedEpoch.set(from, frame.e);
@@ -4347,13 +4469,13 @@ var GroupSession = class {
4347
4469
  handOut(to, frames) {
4348
4470
  this.answers.handOut(to, frames);
4349
4471
  }
4350
- /** My own messages a member's sync says it lacks, from my bounded log, for the epochs it was a member of. */
4472
+ /** My own messages a member's sync says it lacks, from my bounded log (and `owed`), for the epochs it was a member of. */
4351
4473
  handOwn(to, frame) {
4352
4474
  for (const sent of this.ownLacked(to, frame)) this.hooks.send(to, sent);
4353
4475
  }
4354
4476
  ownLacked(to, frame) {
4355
4477
  const lacks = missingIn(frame, to);
4356
- return this.state.sent.filter((sent) => this.state.chain[sent.e] && rosterHas(this.state.chain[sent.e].m, to) && lacks(sent) && !this.isRemoved(sent));
4478
+ return [...this.state.owed ?? [], ...this.state.sent].filter((sent) => this.state.chain[sent.e] && rosterHas(this.state.chain[sent.e].m, to) && lacks(sent) && !this.isRemoved(sent));
4357
4479
  }
4358
4480
  /** A frame of a message deleted for everyone (`hooks.removed`, or one of mine `forget` emptied): handed to nobody, its removal is what they get. */
4359
4481
  isRemoved(f) {
@@ -5258,7 +5380,7 @@ var bitcoindRpc = {
5258
5380
  if (!user || !password) throw new Error("Enter the RPC user and password, or paste the .cookie file");
5259
5381
  },
5260
5382
  async create(settings, host) {
5261
- const { BitcoindOnchain, tauriTransport } = await import("./bitcoind-BpZn3bRN.js");
5383
+ const { BitcoindOnchain, tauriTransport } = await import("./bitcoind-BXZdQ1wZ.js");
5262
5384
  return BitcoindOnchain.connect({
5263
5385
  url: settings.config.url.trim(),
5264
5386
  wallet: settings.config.wallet?.trim() ?? "",
@@ -6825,7 +6947,7 @@ var loading$2;
6825
6947
  /** Loads the WebAssembly once, on first use: profiles that never open a Bark wallet never fetch its 7.7 MB. */
6826
6948
  function loadBarkSdk() {
6827
6949
  return loading$2 ??= (async () => {
6828
- const [bark, wasm] = await Promise.all([import("@secondts/bark/web"), import("./bark_ffi_wasm_bg-CcafsJla.js")]);
6950
+ const [bark, wasm] = await Promise.all([import("@secondts/bark/web"), import("./bark_ffi_wasm_bg-CjjCN3FD.js")]);
6829
6951
  await bark.default({ module_or_path: wasm.default });
6830
6952
  return {
6831
6953
  async open({ network, mnemonic, server, esplora, database }) {
@@ -9404,7 +9526,7 @@ var BitcoinService = class {
9404
9526
  // ../browser/src/engine/paymentAdapters/providers/bdkSdk.ts
9405
9527
  var WASM_IMPORTS = "./bitcoindevkit_bg.js";
9406
9528
  var appLoader = async () => {
9407
- const [glue, url] = await Promise.all([import("@bitcoindevkit/bdk-wallet-web/bitcoindevkit_bg.js"), import("./bitcoindevkit_bg-BWQHx7vd.js")]);
9529
+ const [glue, url] = await Promise.all([import("@bitcoindevkit/bdk-wallet-web/bitcoindevkit_bg.js"), import("./bitcoindevkit_bg-D6IFIaJi.js")]);
9408
9530
  return {
9409
9531
  glue,
9410
9532
  wasm: await fetch(url.default)
@@ -14459,7 +14581,7 @@ var HostNotContacted = class extends Error {};
14459
14581
  */
14460
14582
  function fixedHostsFetch(fetch) {
14461
14583
  return async (url, options) => {
14462
- const { fixedIdentityHosts } = await import("./fixedHosts-CODN2pTL.js");
14584
+ const { fixedIdentityHosts } = await import("./fixedHosts-BJFL8Ell.js");
14463
14585
  const host = hostOf$1(url);
14464
14586
  if (!fixedIdentityHosts().has(host) && host !== hostOf$1("https://public.api.bsky.app") && host !== hostOf$1("https://nexus.pubky.app")) throw new HostNotContacted(`Hide my IP from contacts is on: ${host}, a server your contact chose, was not contacted`);
14465
14587
  return fetch(url, options);
@@ -15998,6 +16120,13 @@ var ChatTextSearch = class {
15998
16120
  const kept = this.texts.get(linkId);
15999
16121
  if (kept) for (const id of ids) kept.changed.add(id);
16000
16122
  }
16123
+ /**
16124
+ * A chat deleted: its texts go. The same invite joined again is a chat of the same id, and only the rows it changes
16125
+ * are read again: it was found by the deleted chat's words for as long as a search went on.
16126
+ */
16127
+ forget(linkId) {
16128
+ this.texts.delete(linkId);
16129
+ }
16001
16130
  textsOf(linkId) {
16002
16131
  let kept = this.texts.get(linkId);
16003
16132
  if (!kept) {
@@ -16074,6 +16203,8 @@ var APP_CHECK_TIMINGS = {
16074
16203
  /** After the engine starts, so the chats come up first. */
16075
16204
  afterStartMs: 6e4,
16076
16205
  everyMs: 864e5,
16206
+ /** A check the network was off for, or whose read of the installed apps failed, is tried again this soon, not a day later. */
16207
+ offlineRetryMs: 6e5,
16077
16208
  /** A check at start is skipped when every app was checked this recently (a page reloaded several times). */
16078
16209
  freshMs: 36e5
16079
16210
  };
@@ -16206,6 +16337,8 @@ function pooled(items, limit, run) {
16206
16337
  for (let w = 0; w < Math.min(limit, items.length); w++) worker();
16207
16338
  return out;
16208
16339
  }
16340
+ /** A jsDelivr URL, which this client reads only at a full commit (`isAppFetchUrl`): its bytes never move on. */
16341
+ var isPinnedAppUrl = (u) => new URL(u).hostname.toLowerCase() === "cdn.jsdelivr.net";
16209
16342
  /**
16210
16343
  * A listing's URLs this client reads, in order, a jsDelivr copy first: one this client reads names a full commit, so it
16211
16344
  * holds exactly the version the store reviewed, where a raw `HEAD` may have moved on to one it has not (WISP 1200 §
@@ -16213,8 +16346,7 @@ function pooled(items, limit, run) {
16213
16346
  */
16214
16347
  function listingUrls(urls) {
16215
16348
  const readable = urls.filter(isAppFetchUrl);
16216
- const pinned = (u) => new URL(u).hostname.toLowerCase() === "cdn.jsdelivr.net";
16217
- return [...readable.filter(pinned), ...readable.filter((u) => !pinned(u))];
16349
+ return [...readable.filter(isPinnedAppUrl), ...readable.filter((u) => !isPinnedAppUrl(u))];
16218
16350
  }
16219
16351
  /** A read that failed for a reason that may pass: offline, the host not reached or too slow, its own trouble (5xx, 429). */
16220
16352
  var passing = (error) => error instanceof AppFetchError && (error.code === "offline" || error.code === "network" || error.code === "slow" || (error.status ?? 0) >= 500 || error.status === 429);
@@ -16722,11 +16854,14 @@ var Apps = class {
16722
16854
  this.timer = null;
16723
16855
  (async () => {
16724
16856
  if (this.stopped) return;
16725
- if (this.host.online()) {
16726
- const apps = await this.installed();
16727
- const fresh = atStart && apps.length > 0 && apps.every((a) => this.checkedWithin(a.checkedAt, APP_CHECK_TIMINGS.freshMs));
16728
- if (apps.length && !fresh) await this.checkUpdates().catch(() => {});
16857
+ if (!this.host.online()) return this.schedule(APP_CHECK_TIMINGS.offlineRetryMs, atStart);
16858
+ const apps = await this.installed().catch(() => null);
16859
+ if (!apps) {
16860
+ if (!this.stopped) this.schedule(APP_CHECK_TIMINGS.offlineRetryMs, atStart);
16861
+ return;
16729
16862
  }
16863
+ const fresh = atStart && apps.length > 0 && apps.every((a) => this.checkedWithin(a.checkedAt, APP_CHECK_TIMINGS.freshMs));
16864
+ if (apps.length && !fresh) await this.checkUpdates().catch(() => {});
16730
16865
  if (!this.stopped) this.schedule(APP_CHECK_TIMINGS.everyMs);
16731
16866
  })();
16732
16867
  }, ms);
@@ -16813,14 +16948,17 @@ var Apps = class {
16813
16948
  }
16814
16949
  /**
16815
16950
  * The bundle the build carries for a built-in app, checked as a fetched one is, and against its entry: the digest the
16816
- * list pins and the entry's reference. Anything else in that file is not this app, and nothing of it is kept.
16951
+ * list pins and the entry's reference. Anything else in that file is not this app, and nothing of it is kept. A read
16952
+ * that says why it failed (`AppFetchError`: offline, the host not reached, its status) says so as is, so the screen
16953
+ * offers Try again: only an unexplained failure is a build that does not carry the app.
16817
16954
  */
16818
16955
  async bundled(app) {
16819
16956
  if (!this.host.readBuiltIn) fail("not-carried", "This build does not carry this app");
16820
16957
  let bytes;
16821
16958
  try {
16822
16959
  bytes = await this.host.readBuiltIn(app);
16823
- } catch {
16960
+ } catch (error) {
16961
+ if (error instanceof AppFetchError) throw error;
16824
16962
  fail("not-carried", "This build does not carry this app");
16825
16963
  }
16826
16964
  if (!(bytes instanceof Uint8Array) || bytes.length > APP_BUNDLE_LIMITS.bundleBytes) fail("not-carried", "This build does not carry this app");
@@ -17810,17 +17948,23 @@ var Apps = class {
17810
17948
  };
17811
17949
  } else fail("bad-source", "No app to fetch");
17812
17950
  if (!urls.length) fail("host", "This listing has no URL Ghostly reads from");
17951
+ const judge = (version) => {
17952
+ if (!expect) return;
17953
+ if (version.ref !== expect.ref) fail("other-app", "The URL holds another app");
17954
+ if (expect.sequence !== void 0 && version.sequence < expect.sequence) fail("rollback", "The URL holds an older version than the one named");
17955
+ if (expect.sequence === version.sequence && expect.digest !== void 0 && expect.digest !== version.digest) fail("equivocation", "The URL holds another version under the same number");
17956
+ if (expect.exact && version.digest !== expect.digest) fail("unlisted", "The URL holds a version the store does not list");
17957
+ };
17813
17958
  let last = null;
17814
17959
  for (const url of urls) try {
17815
17960
  const kept = expect?.digest !== void 0 ? this.staged.get(stagedKey(expect.digest, url, fromStore)) : void 0;
17816
- const { bundle, bytes } = kept && this.checkedWithin(kept.at, STAGED.ms) ? kept : await this.fetchBundle(url);
17817
- const version = versionOf(bundle.manifest, bundle.digest);
17818
- if (expect) {
17819
- if (version.ref !== expect.ref) fail("other-app", "The URL holds another app");
17820
- if (expect.sequence !== void 0 && version.sequence < expect.sequence) fail("rollback", "The URL holds an older version than the one named");
17821
- if (expect.sequence === version.sequence && expect.digest !== void 0 && expect.digest !== version.digest) fail("equivocation", "The URL holds another version under the same number");
17822
- if (expect.exact && version.digest !== expect.digest) fail("unlisted", "The URL holds a version the store does not list");
17961
+ const fresh = kept && this.checkedWithin(kept.at, STAGED.ms);
17962
+ if (!fresh && expect?.exact && !isPinnedAppUrl(url)) {
17963
+ const peek = await this.peekAt(url);
17964
+ if (peek) judge(peek);
17823
17965
  }
17966
+ const { bundle, bytes } = fresh ? kept : await this.fetchBundle(url);
17967
+ judge(versionOf(bundle.manifest, bundle.digest));
17824
17968
  return this.stage(bundle, bytes, url, fromStore);
17825
17969
  } catch (error) {
17826
17970
  if (!passing(last) || passing(error)) last = error;
@@ -22276,19 +22420,42 @@ var RELAY_TEXT_CHARS = 120;
22276
22420
  * The push relay answered, but not with a push service's status: its own refusal (403 `Origin not allowed`, 400 naming
22277
22421
  * a header, 429), a web page or JSON without `status` (a wrong address or path, a proxy with no route). `text` is the
22278
22422
  * relay's own `{ error }` text when it gave one, on one line and cut to `RELAY_TEXT_CHARS`; a web page gives none.
22423
+ * `http` 0 is fetch's status for an answer the page may not read: the address answered, but without CORS (another
22424
+ * kind of server, a proxy's error page in front of a relay that is down), so it is no push relay this page can use.
22279
22425
  */
22280
22426
  var PushRelayRefusal = class extends Error {
22281
22427
  http;
22282
22428
  text;
22283
22429
  cause;
22284
22430
  constructor(http, text, cause) {
22285
- super(`The push relay did not forward it (HTTP ${http})`);
22431
+ super(http === 0 ? "The push relay's address answered without CORS" : `The push relay did not forward it (HTTP ${http})`);
22286
22432
  this.http = http;
22287
22433
  this.text = text;
22288
22434
  this.cause = cause;
22289
22435
  this.name = "PushRelayRefusal";
22290
22436
  }
22291
22437
  };
22438
+ /**
22439
+ * Whether something answers at `url` at all, read with a `no-cors` GET: its answer is opaque, but it arrives, where
22440
+ * offline, a name that does not resolve or a host that refuses the connection fail as the post did. Only asked after
22441
+ * the post failed with a `TypeError`, which is all a page gets both for an answer without CORS and for no answer.
22442
+ */
22443
+ async function answersWithoutCors(url) {
22444
+ if (typeof navigator !== "undefined" && navigator.onLine === false) return false;
22445
+ try {
22446
+ await fetch(url, {
22447
+ method: "GET",
22448
+ mode: "no-cors",
22449
+ credentials: "omit",
22450
+ referrerPolicy: "no-referrer",
22451
+ cache: "no-store",
22452
+ signal: AbortSignal.timeout(1e4)
22453
+ });
22454
+ return true;
22455
+ } catch {
22456
+ return false;
22457
+ }
22458
+ }
22292
22459
  /** The relay's own `{ error: "..." }` text in `body`, one line, cut; undefined when it gave none. */
22293
22460
  function relayErrorText(body) {
22294
22461
  const error = body && typeof body === "object" ? body.error : void 0;
@@ -22301,8 +22468,8 @@ function relayErrorText(body) {
22301
22468
  /**
22302
22469
  * Posts a push: the host's way (Desktop and the CLI post it themselves), or `fetch`, then the person's push relay when
22303
22470
  * a page may not post it (the push services answer without CORS). Answers the push service's HTTP status; throws a
22304
- * `PushRelayRefusal` when the relay answers without it (`relayed` is told when it answers with it), and the fetch's
22305
- * own error when the relay cannot be reached at all.
22471
+ * `PushRelayRefusal` when the relay answers without it (`relayed` is told when it answers with it), or when its address
22472
+ * answers but without CORS (`http` 0), and the fetch's own error when the relay cannot be reached at all.
22306
22473
  */
22307
22474
  async function postPush(request, options) {
22308
22475
  if (options.pushSend) return options.pushSend(request);
@@ -22321,13 +22488,19 @@ async function postPush(request, options) {
22321
22488
  })).status;
22322
22489
  } catch (error) {
22323
22490
  if (!options.relay) throw error;
22324
- const response = await fetch(options.relay, {
22325
- method: "POST",
22326
- headers: { "Content-Type": "application/json" },
22327
- body: JSON.stringify(relayRequest(request)),
22328
- signal: AbortSignal.timeout(15e3),
22329
- ...quiet
22330
- });
22491
+ let response;
22492
+ try {
22493
+ response = await fetch(options.relay, {
22494
+ method: "POST",
22495
+ headers: { "Content-Type": "application/json" },
22496
+ body: JSON.stringify(relayRequest(request)),
22497
+ signal: AbortSignal.timeout(15e3),
22498
+ ...quiet
22499
+ });
22500
+ } catch (relayError) {
22501
+ if (relayError instanceof TypeError && await answersWithoutCors(options.relay)) throw new PushRelayRefusal(0, void 0, relayError);
22502
+ throw relayError;
22503
+ }
22331
22504
  const answer = await response.json().catch(() => null);
22332
22505
  if (!response.ok || typeof answer?.status !== "number") throw new PushRelayRefusal(response.status, relayErrorText(answer), error);
22333
22506
  options.relayed?.();
@@ -24890,13 +25063,15 @@ var HandoffGiver = class {
24890
25063
  return this.exclusive(() => this.handle(from, frame)).catch(() => {});
24891
25064
  }
24892
25065
  /**
24893
- * A turn read on this standby found the record of `key` at `turn`: the device it released to took the turn, which is
25066
+ * A turn read on this standby found a record at `turn`: the device it released to took the turn, which is
24894
25067
  * what the `handoff-done` would have said. That frame goes once, as the taker reloads, and can be lost; without this
24895
- * the screen said "Moving to …" for good, with no Use here, until that device offered the profile back.
25068
+ * the screen said "Moving to …" for good, with no Use here, until that device offered the profile back. Another
25069
+ * device's record at the release's turn or above (a forced takeover that won) ends the release too: the taker steps
25070
+ * back from it, and the screen and a Take over follow the record's active device, not the one released to.
24896
25071
  */
24897
- turnTaken(key, turn) {
25072
+ turnTaken(turn) {
24898
25073
  return this.exclusive(async () => {
24899
- if (this.stopped || this.phase !== "released" || key !== this.peer || turn <= this.turn) return;
25074
+ if (this.stopped || this.phase !== "released" || turn <= this.turn) return;
24900
25075
  await this.taken();
24901
25076
  }).catch(() => {});
24902
25077
  }
@@ -26391,6 +26566,8 @@ var FileDesk = class {
26391
26566
  deciding = /* @__PURE__ */ new Set();
26392
26567
  /** Received files whose offer waits for the person, by local id: the room they show is read again (`rooms`). */
26393
26568
  asking = /* @__PURE__ */ new Set();
26569
+ /** Ends what was said on the floor and never offered (`sweepAnnounced`), from the first one said. */
26570
+ announcedSweeper;
26394
26571
  constructor(deps) {
26395
26572
  this.deps = deps;
26396
26573
  }
@@ -26452,7 +26629,10 @@ var FileDesk = class {
26452
26629
  records.push(file.wire3);
26453
26630
  if (file.wire3.direction === "in") chat.local.set(file.wire3.id, file.id);
26454
26631
  if (!transferEnded(file.wire3)) this.restored.add(file.id);
26455
- else if (file.wire3.state !== "done" || !unsettled.has(file.id)) this.ended.add(file.id);
26632
+ else if (file.wire3.state !== "done" || !unsettled.has(file.id)) {
26633
+ this.ended.add(file.id);
26634
+ if (file.wire3.direction === "out" && (file.wire3.state === "cancelled" || file.wire3.state === "declined") && file.bytes) this.dropStaged(chat, file.id);
26635
+ }
26456
26636
  if (file.wire3.state === "done") continue;
26457
26637
  this.deps.transfers.set(file.id, this.view(chat, file.wire3, file.wire3.confirmed, transferStalled(file.wire3, elapsed(), this.restored.has(file.id), elapsed())));
26458
26638
  }
@@ -26521,6 +26701,9 @@ var FileDesk = class {
26521
26701
  transferred: 0,
26522
26702
  size
26523
26703
  });
26704
+ if (this.announcedSweeper) return;
26705
+ this.announcedSweeper = setInterval(() => this.sweepAnnounced(), FILE_LIMITS.sweepEveryMs);
26706
+ this.announcedSweeper.unref?.();
26524
26707
  }
26525
26708
  /** This device refuses the offer of a file said on the floor: its bubble ends, saying why (`floorRefusal`). */
26526
26709
  refusedHere(chat, frame) {
@@ -26696,13 +26879,18 @@ var FileDesk = class {
26696
26879
  this.speeds.delete(fileId);
26697
26880
  this.unwatch(fileId);
26698
26881
  }
26699
- /** Offers nobody answered in a week end; the peer calls this now and then. */
26882
+ /** Offers nobody answered in a week end (each chat's own sweep does it while its session is open), and so do files said on the floor. */
26700
26883
  sweep() {
26884
+ for (const chat of this.chats.values()) chat.files.sweep();
26885
+ this.sweepAnnounced();
26886
+ }
26887
+ /**
26888
+ * Said on the floor and never offered live within the week an offer waits: it is not coming. Run every
26889
+ * `FILE_LIMITS.sweepEveryMs` from the first one said (`announcedHere`): nothing called `sweep`, so its bubble waited for good.
26890
+ */
26891
+ sweepAnnounced() {
26701
26892
  const now = Date.now();
26702
- for (const chat of this.chats.values()) {
26703
- chat.files.sweep();
26704
- for (const [wireId, said] of [...chat.announced]) if (now - said.at > ANNOUNCED_FOR_MS) this.withdrawn(chat, wireId, "It did not come within a week");
26705
- }
26893
+ for (const chat of this.chats.values()) for (const [wireId, said] of [...chat.announced]) if (now - said.at > ANNOUNCED_FOR_MS) this.withdrawn(chat, wireId, "It did not come within a week");
26706
26894
  }
26707
26895
  /**
26708
26896
  * The chat went away: its transfers stop here. An unfinished one ends on the contact's side too, as deleting its
@@ -26726,6 +26914,12 @@ var FileDesk = class {
26726
26914
  ]) if (id.startsWith(`${linkId}-`)) this.unwatch(id);
26727
26915
  return said;
26728
26916
  }
26917
+ /** The app stops: no chat's files are swept any more (`ChatFiles.stop`), nor what was said on the floor. */
26918
+ stop() {
26919
+ for (const chat of this.chats.values()) chat.files.stop();
26920
+ clearInterval(this.announcedSweeper);
26921
+ this.announcedSweeper = void 0;
26922
+ }
26729
26923
  /** Stops tracking whether a transfer is stuck, and the room an offer of it shows. */
26730
26924
  unwatch(id) {
26731
26925
  clearTimeout(this.stallChecks.get(id));
@@ -26947,6 +27141,7 @@ var FileDesk = class {
26947
27141
  ...file.forwarded && { forwarded: file.forwarded },
26948
27142
  details: { wire: fileWire("files/3", file.size) }
26949
27143
  });
27144
+ if (this.deps.deleted(linkId, `peer_${record.id}`)) this.deletedMeanwhile(linkId, id);
26950
27145
  }).catch((error) => this.unkept(linkId, chat, record.id, id, error));
26951
27146
  }
26952
27147
  const offered = record.direction === "in" && !this.deps.transfers.has(chat.local.get(record.id));
@@ -26997,6 +27192,14 @@ var FileDesk = class {
26997
27192
  chat.files.refuse(wireId, error?.name === "QuotaExceededError" ? "no-room" : "invalid");
26998
27193
  this.deps.changed();
26999
27194
  }
27195
+ /** A new offer whose message was deleted before its row was kept: forgotten as a deleted message's file is. */
27196
+ deletedMeanwhile(linkId, id) {
27197
+ this.forget(linkId, id);
27198
+ this.deps.transfers.delete(id);
27199
+ const chat = this.chats.get(linkId);
27200
+ if (chat) chat.saving = chat.saving.then(() => removeStored(id)).catch(() => {});
27201
+ this.deps.changed();
27202
+ }
27000
27203
  /**
27001
27204
  * Writes a transfer's record and the view of it, after the chat's writes before it; what was held back goes with it.
27002
27205
  * One the database refuses (a full disk) is kept and written again, with the chat's next write and every few seconds,
@@ -27080,8 +27283,16 @@ var FileDesk = class {
27080
27283
  this.ended.add(id);
27081
27284
  this.deps.settled?.(linkId, id, record, this.underway.delete(id));
27082
27285
  if (record.direction === "in") this.rooms();
27286
+ else if (record.state === "cancelled" || record.state === "declined") this.dropStaged(chat, id);
27083
27287
  }
27084
27288
  }
27289
+ /** The bytes a sent file was staged in, after the chat's writes before; a small one kept whole in its record stays. */
27290
+ dropStaged(chat, id) {
27291
+ chat.saving = chat.saving.then(async () => {
27292
+ const stored = await fileStore.get(id);
27293
+ if (stored?.bytes) await (await fileBytesOf(stored.bytes))?.remove(id);
27294
+ }).catch(() => {});
27295
+ }
27085
27296
  /**
27086
27297
  * Whether a transfer is stuck (`transferStalled`): not moved for `FILE_LIMITS.stallMs`, or not since the app started.
27087
27298
  * Only bytes moving count (`progress`: confirmed by the receiver, stored here), not a session saying again where it
@@ -29651,7 +29862,7 @@ var Reactions = class {
29651
29862
  if (!e && !current?.e) return { error: "No reaction of yours to take back" };
29652
29863
  let history;
29653
29864
  const read = async () => history ??= await this.host.messages(chat);
29654
- if (group && current?.e && current.at < await this.joinedAt(chat, read)) return { error: "Your reaction to this message went out before you were invited back, and stays as it is" };
29865
+ if (group && current?.e && current.at < await this.joinedAt(chat, read)) return { error: "Your reaction to this message is from before you were removed and invited back, and stays as it is" };
29655
29866
  let last = this.last.get(chat) ?? lastMine(await read());
29656
29867
  for (const p of pending) last = Math.max(last, p.n);
29657
29868
  const reaction = {
@@ -30050,6 +30261,7 @@ var LIVE = [
30050
30261
  "seqEpoch",
30051
30262
  "seen",
30052
30263
  "sent",
30264
+ "owed",
30053
30265
  "alone",
30054
30266
  "provisional",
30055
30267
  "nicks",
@@ -30141,6 +30353,7 @@ function liveOf(group) {
30141
30353
  seen: s.seen,
30142
30354
  sent: s.sent,
30143
30355
  nicks: s.nicks,
30356
+ ...s.owed?.length ? { owed: s.owed } : {},
30144
30357
  ...s.alone && { alone: s.alone },
30145
30358
  ...s.provisional && { provisional: s.provisional },
30146
30359
  ...s.unsaid?.length ? { unsaid: s.unsaid } : {}
@@ -33033,7 +33246,10 @@ var Communities = class {
33033
33246
  ...m.frame && { frame: m.frame }
33034
33247
  }, m.live);
33035
33248
  placing(stored !== false);
33036
- if (stored === false && this.stored.get(id)?.removedIds?.includes(m.id)) return false;
33249
+ if (stored === false && this.stored.get(id)?.removedIds?.includes(m.id)) {
33250
+ if (file) await this.files?.forget(id, m.id);
33251
+ return false;
33252
+ }
33037
33253
  const came = m.sender === session.myKey ? timestamp : cameAt(timestamp, stored, arrivalNow(this.now()));
33038
33254
  markCame(this.marks, id, m.id, came, m.sender !== session.myKey, mentioned);
33039
33255
  noteCame(this.stored.get(id), came, m.sender !== session.myKey, mentioned);
@@ -37481,7 +37697,7 @@ var Groups = class {
37481
37697
  }
37482
37698
  const lacking = session.lacking();
37483
37699
  out.push(...this.gapsOf(groupId, session, via, lacking));
37484
- this.ownGap(groupId, via, lacking);
37700
+ this.ownGap(groupId, session, via, lacking);
37485
37701
  if (out.length) this.lastGossip.set(groupId, now);
37486
37702
  return out;
37487
37703
  }
@@ -37603,9 +37819,10 @@ var Groups = class {
37603
37819
  }
37604
37820
  /**
37605
37821
  * Whether a sync to `via` asks it for its own messages that never reached me, for the first time since what is
37606
- * missing changed: any sync names them (`miss`), and an author answers from its own log (`GROUP_LIMITS.outlog`).
37822
+ * missing changed: any sync names them (`miss`), and an author answers from its own log (`GROUP_LIMITS.outlog`) and
37823
+ * the frames past it members did not take at its pace (`GroupState.owed`).
37607
37824
  */
37608
- ownGap(groupId, via, lacking) {
37825
+ ownGap(groupId, session, via, lacking) {
37609
37826
  const mark = lacking.get(via);
37610
37827
  if (mark === void 0) return false;
37611
37828
  let tried = this.gapsAsked.get(groupId);
@@ -37616,11 +37833,16 @@ var Groups = class {
37616
37833
  mark,
37617
37834
  of: /* @__PURE__ */ new Set(),
37618
37835
  noticed: entry?.noticed ?? now,
37619
- last: entry?.last
37836
+ last: entry?.last,
37837
+ own: entry?.own
37620
37838
  });
37621
37839
  if (entry.of.has(via)) return false;
37622
37840
  entry.of.add(via);
37623
37841
  entry.at = now;
37842
+ entry.own = {
37843
+ at: now,
37844
+ asked: session.missOf(via)
37845
+ };
37624
37846
  return true;
37625
37847
  }
37626
37848
  /** Whether some of a member's messages are still on their way (not known gone): in any epoch, or in those below `below`. */
@@ -37684,8 +37906,20 @@ var Groups = class {
37684
37906
  of: /* @__PURE__ */ new Set(),
37685
37907
  noticed: now
37686
37908
  });
37687
- const { last } = entry;
37909
+ const { last, own } = entry;
37688
37910
  if (!up(key)) continue;
37911
+ if (own && now - own.at >= 1e4 && session.filledSince(key, own.asked)) {
37912
+ entry.of.add(key);
37913
+ entry.at = now;
37914
+ entry.own = {
37915
+ at: now,
37916
+ asked: session.missOf(key)
37917
+ };
37918
+ try {
37919
+ this.host.sendOnLink(edges.get(key), session.syncFrame([], key));
37920
+ } catch {}
37921
+ continue;
37922
+ }
37689
37923
  if (!last) {
37690
37924
  if (now - (entry.noticed ?? now) >= 1e4) fresh.set(key, mark);
37691
37925
  continue;
@@ -37706,7 +37940,8 @@ var Groups = class {
37706
37940
  via,
37707
37941
  at: now,
37708
37942
  asked: session.missOf(key)
37709
- }
37943
+ },
37944
+ own: tried.get(key)?.own
37710
37945
  });
37711
37946
  asked?.set(key, {
37712
37947
  via,
@@ -37771,7 +38006,7 @@ var Groups = class {
37771
38006
  at: now
37772
38007
  });
37773
38008
  const ask = [...away, ...this.gapsOf(groupId, session, via, lacking)];
37774
- if (!this.ownGap(groupId, via, lacking) && !ask.length) continue;
38009
+ if (!this.ownGap(groupId, session, via, lacking) && !ask.length) continue;
37775
38010
  try {
37776
38011
  this.host.sendOnLink(edges.get(via), session.syncFrame(ask, via));
37777
38012
  } catch {}
@@ -37914,6 +38149,7 @@ var Groups = class {
37914
38149
  ...row,
37915
38150
  at: this.now()
37916
38151
  }, placedAbove);
38152
+ if (stored === false && file && this.isRemoved(state.id, m.id)) await this.files?.forget(state.id, m.id);
37917
38153
  if (stored === false && !completed && this.isRemoved(state.id, m.id)) {
37918
38154
  this.typings.messageFrom(state.id, m.sender);
37919
38155
  return;
@@ -38682,7 +38918,8 @@ var GroupEdits = class {
38682
38918
  const chat = chatOf(groupId);
38683
38919
  const message = await this.find(chat, messageId);
38684
38920
  looked.missing = !message;
38685
- if (!message || !canEditInGroup(message) || underOldKey(message, membership)) return refuse("Only your own text messages can be edited");
38921
+ if (!message || !canEditInGroup(message)) return refuse("Only your own text messages can be edited");
38922
+ if (underOldKey(message, membership)) return refuse("This message is from before you were removed and invited back, and can't be edited now");
38686
38923
  const text = raw.trim();
38687
38924
  if (!text) return refuse("An edit cannot be empty. Delete the message instead.");
38688
38925
  if (isJoinNotice(text)) return refuse("An edit cannot read as a join notice.");
@@ -38732,7 +38969,8 @@ var GroupEdits = class {
38732
38969
  if (!membership) return refuse(this.notMember(groupId));
38733
38970
  const chat = chatOf(groupId);
38734
38971
  const message = typeof messageId === "string" ? await this.find(chat, messageId) : void 0;
38735
- if (!message || message.removed || message.sender !== "me" || !GROUP_MESSAGE_ID.test(message.id) || underOldKey(message, membership)) return refuse("Only your own messages can be deleted for everyone");
38972
+ if (!message || message.removed || message.sender !== "me" || !GROUP_MESSAGE_ID.test(message.id)) return refuse("Only your own messages can be deleted for everyone");
38973
+ if (underOldKey(message, membership)) return refuse("This message is from before you were removed and invited back, and can't be deleted for everyone now");
38736
38974
  if (!canRemove(message)) return refuse("A payment, a request or a notice cannot be deleted for everyone");
38737
38975
  const e = removalNumber(message.edit?.seq);
38738
38976
  await this.host.removeMine(chat, message, {
@@ -45456,6 +45694,8 @@ var GhostlyNode = class GhostlyNode {
45456
45694
  get nativeQueue() {
45457
45695
  return Promise.all(this.nativeQueues.values()).then(() => {});
45458
45696
  }
45697
+ /** Per chat, how many transport choices it was given (`setChatTransport`): one still settling knows a later one came. */
45698
+ transportChoices = /* @__PURE__ */ new Map();
45459
45699
  shuttingDown = false;
45460
45700
  /** Settles as `shutdown` begins: what is still starting is not waited for past it. */
45461
45701
  stopBegan;
@@ -47778,6 +48018,8 @@ var GhostlyNode = class GhostlyNode {
47778
48018
  this.groupEdits.stop();
47779
48019
  this.reactions.stop();
47780
48020
  this.cardEdits.stop();
48021
+ this.fileDesk.stop();
48022
+ this.groups.files?.stopSweeps();
47781
48023
  await Promise.allSettled([
47782
48024
  linksStopped,
47783
48025
  links?.stop(),
@@ -49083,6 +49325,7 @@ var GhostlyNode = class GhostlyNode {
49083
49325
  this.reactionNotes.delete(linkId);
49084
49326
  this.reactionNotesBefore.delete(linkId);
49085
49327
  this.reactionNotesWhole.delete(linkId);
49328
+ this.chatSearch.forget(linkId);
49086
49329
  if (filesEnded) setTimeout(() => void live.link?.stop(true), FILES_END_MS);
49087
49330
  else live.link?.stop(true);
49088
49331
  live.caps?.stop();
@@ -49094,7 +49337,10 @@ var GhostlyNode = class GhostlyNode {
49094
49337
  this.wakeLimiter.reset(linkId);
49095
49338
  this.callWakeLimiter.reset(linkId);
49096
49339
  if (live.stored.wakeToken) this.rotateWake().then(() => this.emitState());
49097
- db.deleteLink(linkId).finally(() => this.appShelf?.forgetScope(linkId));
49340
+ db.deleteLink(linkId).finally(() => {
49341
+ this.chatSearch.forget(linkId);
49342
+ this.appShelf?.forgetScope(linkId);
49343
+ });
49098
49344
  this.desk.forgetLink(linkId);
49099
49345
  this.awaitingSoon();
49100
49346
  this.emitState();
@@ -51196,9 +51442,13 @@ var GhostlyNode = class GhostlyNode {
51196
51442
  * Iroh's relay or the HyperDHT out of reach, so `chat disconnect --hold 0` blocked that long.
51197
51443
  */
51198
51444
  async setDeliveryMode({ linkId, mode }) {
51199
- await this.switchDeliveryMode(linkId, mode, false);
51445
+ await this.switchDeliveryMode(linkId, mode);
51200
51446
  }
51201
- /** `setDeliveryMode`; `native`: back on a live link, wait for its native listeners too (a choice that names one). */
51447
+ /**
51448
+ * `setDeliveryMode`; `native`: back on a live link, wait for a native listener too: the one a choice names, or every
51449
+ * one (Automatic on an app with no WebRTC). Not every one for a named choice: HyperDHT chosen waited 10 s for Iroh's
51450
+ * listener with its relay out of reach, the chat live on the HyperDHT at 2 s.
51451
+ */
51202
51452
  async switchDeliveryMode(linkId, mode, native) {
51203
51453
  const live = this.links.get(linkId);
51204
51454
  if (!live?.stored.profile || !live.link || mode !== "stream" && mode !== "dht") throw new Error("Delivery method unavailable.");
@@ -51209,7 +51459,7 @@ var GhostlyNode = class GhostlyNode {
51209
51459
  };
51210
51460
  await live.link.setDeliveryMode(mode);
51211
51461
  if (mode === "stream") {
51212
- const listening = this.ensureNativeEndpoints(linkId);
51462
+ const listening = this.ensureNativeEndpoints(linkId, false, native === "all" ? void 0 : native);
51213
51463
  if (native) await listening;
51214
51464
  }
51215
51465
  this.observeTransport(linkId);
@@ -51258,9 +51508,15 @@ var GhostlyNode = class GhostlyNode {
51258
51508
  * (WISP 400: it travels as the DHT envelope's mode; either side choosing it keeps both off the live link). Choosing
51259
51509
  * anything else while on DHT only leaves it first. Fallback stays as it was. A live session moves over without
51260
51510
  * reconnecting; if the new transport fails, it stays where it was.
51511
+ *
51512
+ * The last choice wins: one still waiting for its listener when a later one comes stops there, the chat as the later
51513
+ * one left it (as that one is recorded, so it stays after a restart). It ended on the earlier one, with nothing
51514
+ * said, the later one already answered (Automatic 3 s after HyperDHT, Iroh's relay out of reach: bug hunt, 2026-11-17).
51261
51515
  */
51262
51516
  async setChatTransport({ linkId, transport }) {
51263
51517
  const live = this.links.get(linkId);
51518
+ const choice = (this.transportChoices.get(linkId) ?? 0) + 1;
51519
+ this.transportChoices.set(linkId, choice);
51264
51520
  if (transport === "dht") {
51265
51521
  await this.setDeliveryMode({
51266
51522
  linkId,
@@ -51270,13 +51526,17 @@ var GhostlyNode = class GhostlyNode {
51270
51526
  }
51271
51527
  if (live?.stored.deliveryMode === "dht") {
51272
51528
  const preferredTransport = transport === "auto" ? void 0 : transport;
51273
- const native = transport === "auto" ? !live.link?.availableTransports.includes("webrtc/1") : transport !== "webrtc/1";
51529
+ const native = transport === "auto" ? live.link?.availableTransports.includes("webrtc/1") ? void 0 : "all" : transport === "webrtc/1" ? void 0 : transport;
51274
51530
  live.stored = {
51275
51531
  ...live.stored,
51276
51532
  preferredTransport
51277
51533
  };
51278
51534
  await db.patchLink(linkId, { preferredTransport });
51279
51535
  await this.switchDeliveryMode(linkId, "stream", native);
51536
+ if (this.transportChoices.get(linkId) !== choice) {
51537
+ if (this.links.get(linkId)?.stored.deliveryMode === "dht") throw new Error("Transport unavailable");
51538
+ return;
51539
+ }
51280
51540
  }
51281
51541
  if (transport !== "auto") {
51282
51542
  await this.setTransportPreference({
@@ -56101,8 +56361,11 @@ var GhostlyNode = class GhostlyNode {
56101
56361
  this.ensureNativeEndpoints(live.stored.id);
56102
56362
  }
56103
56363
  }
56104
- /** `inUse`: a text is going or coming in the chat now, which counts as the chat on screen does for taking a listener. */
56105
- ensureNativeEndpoints(linkId, inUse = false) {
56364
+ /**
56365
+ * `inUse`: a text is going or coming in the chat now, which counts as the chat on screen does for taking a listener.
56366
+ * `only`: what it answers on is that transport's start alone (each still starts); otherwise every one's.
56367
+ */
56368
+ ensureNativeEndpoints(linkId, inUse = false, only) {
56106
56369
  const expected = this.links.get(linkId)?.link;
56107
56370
  const starts = Object.entries(this.nativeFactories).map(([transport, factory]) => {
56108
56371
  const key = transport;
@@ -56110,7 +56373,8 @@ var GhostlyNode = class GhostlyNode {
56110
56373
  this.nativeQueues.set(key, Promise.all([this.nativeQueues.get(key), operation.then(() => {}, () => {})]).then(() => {}));
56111
56374
  return operation;
56112
56375
  });
56113
- return Promise.all(starts).then((full) => {
56376
+ const named = only ? Object.keys(this.nativeFactories).indexOf(only) : -1;
56377
+ const all = Promise.all(starts).then((full) => {
56114
56378
  const live = this.links.get(linkId), link = live?.link;
56115
56379
  if (this.shuttingDown || !live || !link || link !== expected) return;
56116
56380
  const group = !!live.stored.group;
@@ -56127,6 +56391,9 @@ var GhostlyNode = class GhostlyNode {
56127
56391
  } else this.nativeFailed.delete(linkId);
56128
56392
  this.emitState();
56129
56393
  });
56394
+ if (named < 0) return all;
56395
+ all.catch(() => {});
56396
+ return starts[named].then(() => {});
56130
56397
  }
56131
56398
  /**
56132
56399
  * A start's turn in its transport's queue: one at a time, in the order asked, but the chat in use (on screen, a text
@@ -57001,6 +57268,19 @@ var EngineServer = class {
57001
57268
  */
57002
57269
  unheardAttention;
57003
57270
  /**
57271
+ * A contact's call that rings while no client is attached (`signal`, its offer), and the end of one told so (`null`:
57272
+ * the contact hung up, or a page that opened since answered or declined it): the host tells the person itself, as it
57273
+ * does a message (`unheardAttention`). A ring nobody answers sends nothing more: the host ends it after the app's ring.
57274
+ */
57275
+ unheardCall;
57276
+ /** The chats whose ringing call the host was told of (`unheardCall`) and not yet of its end, and when it began to ring. */
57277
+ unheardRings = /* @__PURE__ */ new Map();
57278
+ /**
57279
+ * Per chat, when the contact's last call told to the host was missed after it barely rang, or held back since
57280
+ * (`QUICK_REDIAL_MS`, on the monotonic clock): the next one that comes this soon is not told, as a page does not ring it.
57281
+ */
57282
+ unheardMissedAt = /* @__PURE__ */ new Map();
57283
+ /**
57004
57284
  * `keepNewest`: the start keeps each chat's and group's newest rows that many, from the whole histories it reads anyway,
57005
57285
  * for `takeStartNewest` (the CLI's event check at start, which read them again).
57006
57286
  */
@@ -57024,13 +57304,16 @@ var EngineServer = class {
57024
57304
  this.inOrder(linkId, () => this.sendChanges(linkId, changes)).catch(() => {});
57025
57305
  },
57026
57306
  onCallSignal: (linkId, signal) => {
57027
- if (signalKind(signal) === "o") this.offers.set(linkId, signal);
57307
+ const kind = signalKind(signal);
57308
+ if (kind === "o") this.offers.set(linkId, signal);
57028
57309
  else this.offers.delete(linkId);
57029
57310
  this.broadcast({
57030
57311
  kind: "call-signal",
57031
57312
  linkId,
57032
57313
  signal
57033
57314
  });
57315
+ if (kind === "o" && !this.clients.size && parseCallSignal(signal)?.t === "o") this.ringUnheard(linkId, signal);
57316
+ else if (kind === "h") this.unheardRingEnded(linkId, true);
57034
57317
  },
57035
57318
  onAppFrame: (linkId, event) => this.broadcast({
57036
57319
  kind: "app-frame",
@@ -57336,11 +57619,39 @@ var EngineServer = class {
57336
57619
  if (typeof linkId !== "string" || !this.offers.delete(linkId)) return;
57337
57620
  const kind = typeof signal === "string" ? signalKind(signal) : void 0;
57338
57621
  if (kind !== "a" && kind !== "h") return;
57622
+ this.unheardRingEnded(linkId);
57339
57623
  for (const client of [...this.clients]) if (client !== from) this.post(client, {
57340
57624
  kind: "call-handled",
57341
57625
  linkId
57342
57626
  });
57343
57627
  }
57628
+ /**
57629
+ * The contact's offer with no page to ring it: the host is told, unless it came right after a call that barely rang
57630
+ * (`QUICK_REDIAL_MS`), which a bot looping call and hang-up places and a page keeps as missed with no ring or
57631
+ * notification (useWebRTC). Held back, it starts the wait over, so a burst rings once.
57632
+ */
57633
+ ringUnheard(linkId, signal) {
57634
+ const now = performance.now(), missedAt = this.unheardMissedAt.get(linkId);
57635
+ if (!this.unheardRings.has(linkId) && missedAt !== void 0 && now - missedAt >= 0 && now - missedAt < 2e3) {
57636
+ this.unheardMissedAt.set(linkId, now);
57637
+ return;
57638
+ }
57639
+ this.unheardRings.set(linkId, now);
57640
+ this.unheardCall?.(linkId, signal);
57641
+ }
57642
+ /**
57643
+ * A ring the host was told of (`unheardCall`) is over: it is told so, once. `byContact`: the contact hung up, which
57644
+ * holds their next call back when it barely rang (`BURST_RING_MS`), and nothing when it rang a while.
57645
+ */
57646
+ unheardRingEnded(linkId, byContact = false) {
57647
+ const since = this.unheardRings.get(linkId);
57648
+ if (since === void 0) return;
57649
+ this.unheardRings.delete(linkId);
57650
+ const now = performance.now();
57651
+ if (byContact && now - since < 1e3) this.unheardMissedAt.set(linkId, now);
57652
+ else this.unheardMissedAt.delete(linkId);
57653
+ this.unheardCall?.(linkId, null);
57654
+ }
57344
57655
  };
57345
57656
  /** Whether a call only reads a group's stored history (`GhostlyNode.groupsRead`). */
57346
57657
  function readsGroupHistory(request) {
@@ -57358,4 +57669,4 @@ function signalKind(signal) {
57358
57669
  }
57359
57670
  export { EngineServer, credentials as n, bitcoindRpc as t };
57360
57671
 
57361
- //# sourceMappingURL=server-Bd2ofxc1.js.map
57672
+ //# sourceMappingURL=server-e4oKeNez.js.map