OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-core / schema / spec / contract / hyperschema / index.js

1 lines · javascript ref:
const{c:e}=require("hyperschema/runtime");let d=31;const o={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.length)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.length)},decode:d=>({key:e.fixed32.decode(d),length:e.uint.decode(d)})},n={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.seq)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.seq)},decode:d=>({key:e.fixed32.decode(d),seq:e.uint.decode(d)})},c={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed32.preencode(d,o.secretKey)},encode(d,o){e.fixed32.encode(d,o.publicKey),e.fixed32.encode(d,o.secretKey)},decode:d=>({publicKey:e.fixed32.decode(d),secretKey:e.fixed32.decode(d)})},r={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed64.preencode(d,o.secretKey)},encode(d,o){e.fixed32.encode(d,o.publicKey),e.fixed64.encode(d,o.secretKey)},decode:d=>({publicKey:e.fixed32.decode(d),secretKey:e.fixed64.decode(d)})},t={preencode(n,c){e.fixed32.preencode(n,c.key),n.end++,c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),c.fastForwardTo&&e.fixed32.preencode(n,c.fastForwardTo),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(c.encryptionKey?1:0)|(c.fastForwardTo?2:0)|(d>=27&&c.bootFrom?4:0);e.fixed32.encode(n,c.key),e.uint.encode(n,r),c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),r=e.uint.decode(n);return{key:c,encryptionKey:1&r?e.buffer.decode(n):null,fastForwardTo:2&r?e.fixed32.decode(n):null,bootFrom:d>=27&&4&r?o.decode(n):null}}},i={preencode(d,o){e.uint.preencode(d,o.timestamp)},encode(d,o){e.uint.encode(d,o.timestamp)},decode:d=>({timestamp:e.uint.decode(d)})},a={preencode(d,o){e.uint.preencode(d,o.blockOffset),e.uint.preencode(d,o.blockLength),e.uint.preencode(d,o.byteOffset),e.uint.preencode(d,o.byteLength)},encode(d,o){e.uint.encode(d,o.blockOffset),e.uint.encode(d,o.blockLength),e.uint.encode(d,o.byteOffset),e.uint.encode(d,o.byteLength)},decode:d=>({blockOffset:e.uint.decode(d),blockLength:e.uint.decode(d),byteOffset:e.uint.decode(d),byteLength:e.uint.decode(d)})},s={preencode(d,o){e.uint.preencode(d,o.width),e.uint.preencode(d,o.height)},encode(d,o){e.uint.encode(d,o.width),e.uint.encode(d,o.height)},decode:d=>({width:e.uint.decode(d),height:e.uint.decode(d)})},p=e.frame(s),u={preencode(d,o){d.end++,o.name&&e.string.preencode(d,o.name),o.mimetype&&e.string.preencode(d,o.mimetype),o.dimensions&&p.preencode(d,o.dimensions),o.userdata&&e.buffer.preencode(d,o.userdata),o.duration&&e.uint.preencode(d,o.duration)},encode(d,o){const n=(o.name?1:0)|(o.mimetype?2:0)|(o.dimensions?4:0)|(o.userdata?8:0)|(o.duration?16:0)|(o.isPreview?32:0);e.uint.encode(d,n),o.name&&e.string.encode(d,o.name),o.mimetype&&e.string.encode(d,o.mimetype),o.dimensions&&p.encode(d,o.dimensions),o.userdata&&e.buffer.encode(d,o.userdata),o.duration&&e.uint.encode(d,o.duration)},decode(d){const o=e.uint.decode(d);return{name:1&o?e.string.decode(d):null,mimetype:2&o?e.string.decode(d):null,dimensions:4&o?p.decode(d):null,userdata:8&o?e.buffer.decode(d):null,duration:16&o?e.uint.decode(d):0,isPreview:!!(32&o)}}},l={preencode(d,o){e.fixed32.preencode(d,o.key),e.string.preencode(d,o.path),e.uint.preencode(d,o.version),e.uint.preencode(d,o.size)},encode(d,o){e.fixed32.encode(d,o.key),e.string.encode(d,o.path),e.uint.encode(d,o.version),e.uint.encode(d,o.size)},decode:d=>({key:e.fixed32.decode(d),path:e.string.decode(d),version:e.uint.decode(d),size:e.uint.decode(d)})},f={preencode(d,o){e.fixed32.preencode(d,o.key),a.preencode(d,o.blob)},encode(d,o){e.fixed32.encode(d,o.key),a.encode(d,o.blob)},decode:d=>({key:e.fixed32.decode(d),blob:a.decode(d)})},m=e.frame(f),y=e.frame(l),b={preencode(o,n){o.end++,n.inlined&&e.buffer.preencode(o,n.inlined),n.blob&&a.preencode(o,n.blob),n.externalBlob&&m.preencode(o,n.externalBlob),n.externalDrive&&y.preencode(o,n.externalDrive),d>=27&&n.bee&&ft.preencode(o,n.bee)},encode(o,n){const c=(n.inlined?1:0)|(n.blob?2:0)|(n.externalBlob?4:0)|(n.externalDrive?8:0)|(d>=27&&n.bee?16:0);e.uint.encode(o,c),n.inlined&&e.buffer.encode(o,n.inlined),n.blob&&a.encode(o,n.blob),n.externalBlob&&m.encode(o,n.externalBlob),n.externalDrive&&y.encode(o,n.externalDrive),d>=27&&n.bee&&ft.encode(o,n.bee)},decode(o){const n=e.uint.decode(o);return{inlined:1&n?e.buffer.decode(o):null,blob:2&n?a.decode(o):null,externalBlob:4&n?m.decode(o):null,externalDrive:8&n?y.decode(o):null,bee:d>=27&&16&n?ft.decode(o):null}}},x=e.frame(b),k=e.frame(u),v={preencode(d,o){x.preencode(d,o.pointer),d.end++,o.metadata&&k.preencode(d,o.metadata),o.preview&&zt.preencode(d,o.preview),o.hash&&e.fixed32.preencode(d,o.hash)},encode(d,o){const n=(o.metadata?1:0)|(o.preview?2:0)|(o.hash?4:0);x.encode(d,o.pointer),e.uint.encode(d,n),o.metadata&&k.encode(d,o.metadata),o.preview&&zt.encode(d,o.preview),o.hash&&e.fixed32.encode(d,o.hash)},decode(d){const o=x.decode(d),n=e.uint.decode(d);return{pointer:o,metadata:1&n?k.decode(d):null,preview:2&n?zt.decode(d):null,hash:4&n?e.fixed32.decode(d):null}}},g=e.frame(v),h=g,K=g,w={preencode(e,d){e.end++,d.small&&g.preencode(e,d.small),d.medium&&h.preencode(e,d.medium),d.large&&K.preencode(e,d.large)},encode(d,o){const n=(o.small?1:0)|(o.medium?2:0)|(o.large?4:0);e.uint.encode(d,n),o.small&&g.encode(d,o.small),o.medium&&h.encode(d,o.medium),o.large&&K.encode(d,o.large)},decode(d){const o=e.uint.decode(d);return{small:1&o?g.decode(d):null,medium:2&o?h.decode(d):null,large:4&o?K.decode(d):null}}},T={preencode(e,d){e.end++},encode(d,o){const n=o.isDeleted?1:0;e.uint.encode(d,n)},decode:d=>({isDeleted:!!(1&e.uint.decode(d))})},A=e.frame(T),P=g,S={preencode(o,c){e.uint.preencode(o,c.id),n.preencode(o,c.oplog),A.preencode(o,c.status),P.preencode(o,c.file),o.end++,d>=14&&c.version&&e.uint.preencode(o,c.version)},encode(o,c){const r=d>=14&&c.version?1:0;e.uint.encode(o,c.id),n.encode(o,c.oplog),A.encode(o,c.status),P.encode(o,c.file),e.uint.encode(o,r),d>=14&&c.version&&e.uint.encode(o,c.version)},decode(o){const c=e.uint.decode(o),r=n.decode(o),t=A.decode(o),i=P.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{id:c,oplog:r,status:t,file:i,version:d>=14&&1&a?e.uint.decode(o):0}}},I={preencode(e,d){e.end++},encode(d,o){const n=(o.isActive?1:0)|(o.isIndexing?2:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isActive:!!(1&o),isIndexing:!!(2&o)}}},R={preencode(o,n){const c=(n.isAdmin?1:0)|(n.isModerator?2:0)|(n.isPending?4:0)|(n.isActive?8:0)|(n.isMuted?16:0)|(n.isBanned?32:0)|(n.isShadowBanned?64:0)|(d>=13&&n.isRemoved?128:0);e.uint.preencode(o,c)},encode(o,n){const c=(n.isAdmin?1:0)|(n.isModerator?2:0)|(n.isPending?4:0)|(n.isActive?8:0)|(n.isMuted?16:0)|(n.isBanned?32:0)|(n.isShadowBanned?64:0)|(d>=13&&n.isRemoved?128:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isAdmin:!!(1&n),isModerator:!!(2&n),isPending:!!(4&n),isActive:!!(8&n),isMuted:!!(16&n),isBanned:!!(32&n),isShadowBanned:!!(64&n),isRemoved:d>=13&&!!(128&n)}}},F={preencode(e,d){e.end++},encode(d,o){const n=(o.isMuted?1:0)|(o.isBanned?2:0)|(o.isShadowBanned?4:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isMuted:!!(1&o),isBanned:!!(2&o),isShadowBanned:!!(4&o)}}},H={preencode(d,o){e.uint.preencode(d,o.version)},encode(d,o){e.uint.encode(d,o.version)},decode:d=>({version:e.uint.decode(d)})},M={preencode(d,o){e.uint.preencode(d,o.total),e.uint.preencode(d,o.active)},encode(d,o){e.uint.encode(d,o.total),e.uint.encode(d,o.active)},decode:d=>({total:e.uint.decode(d),active:e.uint.decode(d)})},C={preencode(d,o){e.uint.preencode(d,o.total),e.uint.preencode(d,o.active),e.uint.preencode(d,o.pending)},encode(d,o){e.uint.encode(d,o.total),e.uint.encode(d,o.active),e.uint.encode(d,o.pending)},decode:d=>({total:e.uint.decode(d),active:e.uint.decode(d),pending:e.uint.decode(d)})},D={preencode(o,n){e.uint.preencode(o,n.clock),e.uint.preencode(o,n.pinned),e.uint.preencode(o,n.threads),e.uint.preencode(o,n.timestamp),o.end++,d>=15&&n.flagsClock&&e.uint.preencode(o,n.flagsClock)},encode(o,n){const c=d>=15&&n.flagsClock?1:0;e.uint.encode(o,n.clock),e.uint.encode(o,n.pinned),e.uint.encode(o,n.threads),e.uint.encode(o,n.timestamp),e.uint.encode(o,c),d>=15&&n.flagsClock&&e.uint.encode(o,n.flagsClock)},decode(o){const n=e.uint.decode(o),c=e.uint.decode(o),r=e.uint.decode(o),t=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{clock:n,pinned:c,threads:r,timestamp:t,flagsClock:d>=15&&1&i?e.uint.decode(o):0}}},V={preencode(d,o){e.uint.preencode(d,o.clock)},encode(d,o){e.uint.encode(d,o.clock)},decode:d=>({clock:e.uint.decode(d)})},L=e.frame(M),q=e.frame(C),E=e.frame(D),B=e.frame(V),z={preencode(e,o){L.preencode(e,o.devices),q.preencode(e,o.members),E.preencode(e,o.chat),B.preencode(e,o.files),e.end++,d>=26&&o.calls&&Nt.preencode(e,o.calls)},encode(o,n){const c=d>=26&&n.calls?1:0;L.encode(o,n.devices),q.encode(o,n.members),E.encode(o,n.chat),B.encode(o,n.files),e.uint.encode(o,c),d>=26&&n.calls&&Nt.encode(o,n.calls)},decode(o){const n=L.decode(o),c=q.decode(o),r=E.decode(o),t=B.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{devices:n,members:c,chat:r,files:t,calls:d>=26&&1&i?Nt.decode(o):null}}},N={Default:1,Broadcast:2,DirectMessage:3},j={preencode(e,d){e.end++},encode(d,o){if(o>3)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},O={preencode(o,n){const c=(n.roomType?1:0)|(n.isExperimental?2:0)|(n.isJoiningDisabled?4:0)|(n.isAppendingDisabled?8:0)|(n.isCallingDisabled?16:0)|(n.isMembershipEventsDisabled?32:0)|(d>=19&&n.isAttachmentsDisabled?64:0)|(d>=19&&n.isLinksDisabled?128:0)|(d>=20&&n.buildType?256:0)|(d>=23&&n.isRoomInviteHidden?512:0);e.uint.preencode(o,c),n.roomType&&j.preencode(o,n.roomType),d>=20&&n.buildType&&Br.preencode(o,n.buildType)},encode(o,n){const c=(n.roomType?1:0)|(n.isExperimental?2:0)|(n.isJoiningDisabled?4:0)|(n.isAppendingDisabled?8:0)|(n.isCallingDisabled?16:0)|(n.isMembershipEventsDisabled?32:0)|(d>=19&&n.isAttachmentsDisabled?64:0)|(d>=19&&n.isLinksDisabled?128:0)|(d>=20&&n.buildType?256:0)|(d>=23&&n.isRoomInviteHidden?512:0);e.uint.encode(o,c),n.roomType&&j.encode(o,n.roomType),d>=20&&n.buildType&&Br.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{roomType:1&n?j.decode(o):0,isExperimental:!!(2&n),isJoiningDisabled:!!(4&n),isAppendingDisabled:!!(8&n),isCallingDisabled:!!(16&n),isMembershipEventsDisabled:!!(32&n),isAttachmentsDisabled:d>=19&&!!(64&n),isLinksDisabled:d>=19&&!!(128&n),buildType:d>=20&&256&n?Br.decode(o):null,isRoomInviteHidden:d>=23&&!!(512&n)}}},U=e.frame(H),J=e.frame(O),G={preencode(d,o){U.preencode(d,o.abi),J.preencode(d,o.settings),e.uint.preencode(d,o.creationTime)},encode(d,o){U.encode(d,o.abi),J.encode(d,o.settings),e.uint.encode(d,o.creationTime)},decode:d=>({abi:U.decode(d),settings:J.decode(d),creationTime:e.uint.decode(d)})},Q={preencode(d,o){e.fixed32.preencode(d,o.seed)},encode(d,o){e.fixed32.encode(d,o.seed)},decode:d=>({seed:e.fixed32.decode(d)})},W={preencode(d,o){c.preencode(d,o.mailboxKeyPair),r.preencode(d,o.discoveryKeyPair),e.fixed32.preencode(d,o.wakeupTopic),e.fixed32.preencode(d,o.swarmTopic)},encode(d,o){c.encode(d,o.mailboxKeyPair),r.encode(d,o.discoveryKeyPair),e.fixed32.encode(d,o.wakeupTopic),e.fixed32.encode(d,o.swarmTopic)},decode:d=>({mailboxKeyPair:c.decode(d),discoveryKeyPair:r.decode(d),wakeupTopic:e.fixed32.decode(d),swarmTopic:e.fixed32.decode(d)})},X=e.array(e.fixed32),Y={preencode(o,n){o.end++,n.title&&e.string.preencode(o,n.title),n.avatar&&jt.preencode(o,n.avatar),n.description&&e.string.preencode(o,n.description),d>=11&&n.supportedLanguages&&Ot.preencode(o,n.supportedLanguages),d>=13&&n.blindPeers&&X.preencode(o,n.blindPeers)},encode(o,n){const c=(n.title?1:0)|(n.avatar?2:0)|(n.description?4:0)|(d>=11&&n.supportedLanguages?8:0)|(d>=13&&n.blindPeers?16:0);e.uint.encode(o,c),n.title&&e.string.encode(o,n.title),n.avatar&&jt.encode(o,n.avatar),n.description&&e.string.encode(o,n.description),d>=11&&n.supportedLanguages&&Ot.encode(o,n.supportedLanguages),d>=13&&n.blindPeers&&X.encode(o,n.blindPeers)},decode(o){const n=e.uint.decode(o);return{title:1&n?e.string.decode(o):null,avatar:2&n?jt.decode(o):null,description:4&n?e.string.decode(o):null,supportedLanguages:d>=11&&8&n?Ot.decode(o):null,blindPeers:d>=13&&16&n?X.decode(o):null}}},Z={preencode(d,o){e.fixed32.preencode(d,o.key)},encode(d,o){e.fixed32.encode(d,o.key)},decode:d=>({key:e.fixed32.decode(d)})},$=e.frame(i),_=e.frame(Z),ee={preencode(e,d){$.preencode(e,d.header),_.preencode(e,d.peer)},encode(e,d){$.encode(e,d.header),_.encode(e,d.peer)},decode:e=>({header:$.decode(e),peer:_.decode(e)})},de=$,oe={preencode(d,o){de.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){de.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:de.decode(d),key:e.fixed32.decode(d)})},ne={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.buffer.preencode(d,o.proof)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.buffer.encode(d,o.proof)},decode:d=>({memberKey:e.fixed32.decode(d),proof:e.buffer.decode(d)})},ce={preencode(d,o){e.fixed32.preencode(d,o.id),e.buffer.preencode(d,o.response)},encode(d,o){e.fixed32.encode(d,o.id),e.buffer.encode(d,o.response)},decode:d=>({id:e.fixed32.decode(d),response:e.buffer.decode(d)})},re=e.frame(I),te=e.frame(ce),ie={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.memberKey),re.preencode(d,o.status),Ut.preencode(d,o.profile),d.end++,o.invitation&&te.preencode(d,o.invitation)},encode(d,o){const n=o.invitation?1:0;e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.memberKey),re.encode(d,o.status),Ut.encode(d,o.profile),e.uint.encode(d,n),o.invitation&&te.encode(d,o.invitation)},decode:d=>({key:e.fixed32.decode(d),memberKey:e.fixed32.decode(d),status:re.decode(d),profile:Ut.decode(d),invitation:1&e.uint.decode(d)?te.decode(d):null})},ae={preencode(d,o){e.uint.preencode(d,o.timestamp),d.end++,o.mailbox&&e.fixed32.preencode(d,o.mailbox),o.displayName&&e.string.preencode(d,o.displayName),o.avatar&&Jt.preencode(d,o.avatar),o.username&&e.string.preencode(d,o.username)},encode(d,o){const n=(o.mailbox?1:0)|(o.displayName?2:0)|(o.avatar?4:0)|(o.username?8:0);e.uint.encode(d,o.timestamp),e.uint.encode(d,n),o.mailbox&&e.fixed32.encode(d,o.mailbox),o.displayName&&e.string.encode(d,o.displayName),o.avatar&&Jt.encode(d,o.avatar),o.username&&e.string.encode(d,o.username)},decode(d){const o=e.uint.decode(d),n=e.uint.decode(d);return{timestamp:o,mailbox:1&n?e.fixed32.decode(d):null,displayName:2&n?e.string.decode(d):null,avatar:4&n?Jt.decode(d):null,username:8&n?e.string.decode(d):null}}},se={preencode(o,n){o.end++,n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),n.name&&e.string.preencode(o,n.name),d>=20&&n.buildType&&Br.preencode(o,n.buildType)},encode(o,n){const c=(n.swarmKey?1:0)|(n.name?2:0)|(n.isMobile?4:0)|(d>=20&&n.buildType?8:0);e.uint.encode(o,c),n.swarmKey&&e.fixed32.encode(o,n.swarmKey),n.name&&e.string.encode(o,n.name),d>=20&&n.buildType&&Br.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{swarmKey:1&n?e.fixed32.decode(o):null,name:2&n?e.string.decode(o):null,isMobile:!!(4&n),buildType:d>=20&&8&n?Br.decode(o):null}}},pe=e.frame(ae),ue={preencode(e,d){pe.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){pe.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:pe.decode(e),attestation:ne.decode(e)})},le={preencode(e,d){Gt.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){Gt.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:Gt.decode(e),attestation:ne.decode(e)})},fe={preencode(d,o){e.fixed32.preencode(d,o.id),e.buffer.preencode(d,o.data),e.buffer.preencode(d,o.signature)},encode(d,o){e.fixed32.encode(d,o.id),e.buffer.encode(d,o.data),e.buffer.encode(d,o.signature)},decode:d=>({id:e.fixed32.decode(d),data:e.buffer.decode(d),signature:e.buffer.decode(d)})},me={preencode(d,o){e.fixed32.preencode(d,o.devicePublicKey)},encode(d,o){e.fixed32.encode(d,o.devicePublicKey)},decode:d=>({devicePublicKey:e.fixed32.decode(d)})},ye={preencode(d,o){ne.preencode(d,o.privateProfileIdentity),e.buffer.preencode(d,o.deviceProof)},encode(d,o){ne.encode(d,o.privateProfileIdentity),e.buffer.encode(d,o.deviceProof)},decode:d=>({privateProfileIdentity:ne.decode(d),deviceProof:e.buffer.decode(d)})},be=e.frame(le),xe=e.frame(ue),ke=e.frame(me),ve={preencode(n,c){e.fixed32.preencode(n,c.deviceKey),r.preencode(n,c.keyPair),be.preencode(n,c.device),xe.preencode(n,c.member),n.end++,c.identity&&ke.preencode(n,c.identity),d>=27&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=27&&c.link?2:0);e.fixed32.encode(n,c.deviceKey),r.encode(n,c.keyPair),be.encode(n,c.device),xe.encode(n,c.member),e.uint.encode(n,t),c.identity&&ke.encode(n,c.identity),d>=27&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),t=r.decode(n),i=be.decode(n),a=xe.decode(n),s=e.uint.decode(n);return{deviceKey:c,keyPair:t,device:i,member:a,identity:1&s?ke.decode(n):null,link:d>=27&&2&s?o.decode(n):null}}},ge=e.frame(ve),he={preencode(d,o){e.fixed32.preencode(d,o.id),ge.preencode(d,o.request),e.buffer.preencode(d,o.signature)},encode(d,o){e.fixed32.encode(d,o.id),ge.encode(d,o.request),e.buffer.encode(d,o.signature)},decode:d=>({id:e.fixed32.decode(d),request:ge.decode(d),signature:e.buffer.decode(d)})},Ke=be,we=xe,Te={preencode(e,d){Ke.preencode(e,d.device),e.end++,d.member&&we.preencode(e,d.member)},encode(d,o){const n=o.member?1:0;Ke.encode(d,o.device),e.uint.encode(d,n),o.member&&we.encode(d,o.member)},decode:d=>({device:Ke.decode(d),member:1&e.uint.decode(d)?we.decode(d):null})},Ae=e.frame(he),Pe=e.frame(Te),Se={preencode(e,d){e.end++,d.withInvitation&&Ae.preencode(e,d.withInvitation),d.withMemberProof&&Pe.preencode(e,d.withMemberProof)},encode(d,o){const n=(o.withInvitation?1:0)|(o.withMemberProof?2:0);e.uint.encode(d,n),o.withInvitation&&Ae.encode(d,o.withInvitation),o.withMemberProof&&Pe.encode(d,o.withMemberProof)},decode(d){const o=e.uint.decode(d);return{withInvitation:1&o?Ae.decode(d):null,withMemberProof:2&o?Pe.decode(d):null}}},Ie=e.frame(fe),Re=e.frame(ye),Fe={preencode(e,d){Ie.preencode(e,d.signedKeys),e.end++,d.identity&&Re.preencode(e,d.identity)},encode(d,o){const n=o.identity?1:0;Ie.encode(d,o.signedKeys),e.uint.encode(d,n),o.identity&&Re.encode(d,o.identity)},decode:d=>({signedKeys:Ie.decode(d),identity:1&e.uint.decode(d)?Re.decode(d):null})},He={preencode(o,n){o.end++,n.expiration&&e.uint.preencode(o,n.expiration),d>=20&&n.buildType&&Br.preencode(o,n.buildType)},encode(o,n){const c=(n.expiration?1:0)|(n.requiresConfirmation?2:0)|(n.canModerate?4:0)|(n.canAdmin?8:0)|(d>=20&&n.buildType?16:0);e.uint.encode(o,c),n.expiration&&e.uint.encode(o,n.expiration),d>=20&&n.buildType&&Br.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{expiration:1&n?e.uint.decode(o):0,requiresConfirmation:!!(2&n),canModerate:!!(4&n),canAdmin:!!(8&n),buildType:d>=20&&16&n?Br.decode(o):null}}},Me=Ie,Ce=e.frame(He),De={preencode(d,n){e.fixed32.preencode(d,n.id),Me.preencode(d,n.response),Ce.preencode(d,n.metadata),d.end++,n.anchor&&o.preencode(d,n.anchor)},encode(d,n){const c=(n.anchor?1:0)|(n.isActive?2:0);e.fixed32.encode(d,n.id),Me.encode(d,n.response),Ce.encode(d,n.metadata),e.uint.encode(d,c),n.anchor&&o.encode(d,n.anchor)},decode(d){const n=e.fixed32.decode(d),c=Me.decode(d),r=Ce.decode(d),t=e.uint.decode(d);return{id:n,response:c,metadata:r,anchor:1&t?o.decode(d):null,isActive:!!(2&t)}}},Ve=$,Le=e.frame(De),qe={preencode(e,d){Ve.preencode(e,d.header),Le.preencode(e,d.invitation)},encode(e,d){Ve.encode(e,d.header),Le.encode(e,d.invitation)},decode:e=>({header:Ve.decode(e),invitation:Le.decode(e)})},Ee=$,Be={preencode(d,o){Ee.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Ee.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Ee.decode(d),id:e.fixed32.decode(d)})},ze={preencode(d,n){e.fixed32.preencode(d,n.mailbox),e.fixed32.preencode(d,n.invitationSeed),o.preencode(d,n.anchor)},encode(d,n){e.fixed32.encode(d,n.mailbox),e.fixed32.encode(d,n.invitationSeed),o.encode(d,n.anchor)},decode:d=>({mailbox:e.fixed32.decode(d),invitationSeed:e.fixed32.decode(d),anchor:o.decode(d)})},Ne={preencode(d,n){e.fixed32.preencode(d,n.mailbox),e.fixed32.preencode(d,n.invitationSeed),o.preencode(d,n.anchor),e.fixed32.preencode(d,n.identityPublicKey)},encode(d,n){e.fixed32.encode(d,n.mailbox),e.fixed32.encode(d,n.invitationSeed),o.encode(d,n.anchor),e.fixed32.encode(d,n.identityPublicKey)},decode:d=>({mailbox:e.fixed32.decode(d),invitationSeed:e.fixed32.decode(d),anchor:o.decode(d),identityPublicKey:e.fixed32.decode(d)})},je={preencode(d,o){e.fixed32.preencode(d,o.mailbox)},encode(d,o){e.fixed32.encode(d,o.mailbox)},decode:d=>({mailbox:e.fixed32.decode(d)})},Oe=e.frame(ze),Ue=e.frame(Ne),Je=e.frame(je),Ge=e.array(e.ipv4Address),Qe={preencode(e,o){e.end++,o.room&&Oe.preencode(e,o.room),o.identity&&Ue.preencode(e,o.identity),o.contact&&Je.preencode(e,o.contact),d>=6&&o.readonly&&Qt.preencode(e,o.readonly),d>=11&&o.additionalNodes&&Ge.preencode(e,o.additionalNodes),d>=20&&o.buildType&&Br.preencode(e,o.buildType),d>=27&&o["readonly-v2"]&&Wt.preencode(e,o["readonly-v2"])},encode(o,n){const c=(n.room?1:0)|(n.identity?2:0)|(n.contact?4:0)|(d>=6&&n.readonly?8:0)|(d>=11&&n.additionalNodes?16:0)|(d>=20&&n.buildType?32:0)|(d>=27&&n["readonly-v2"]?64:0);e.uint.encode(o,c),n.room&&Oe.encode(o,n.room),n.identity&&Ue.encode(o,n.identity),n.contact&&Je.encode(o,n.contact),d>=6&&n.readonly&&Qt.encode(o,n.readonly),d>=11&&n.additionalNodes&&Ge.encode(o,n.additionalNodes),d>=20&&n.buildType&&Br.encode(o,n.buildType),d>=27&&n["readonly-v2"]&&Wt.encode(o,n["readonly-v2"])},decode(o){const n=e.uint.decode(o);return{room:1&n?Oe.decode(o):null,identity:2&n?Ue.decode(o):null,contact:4&n?Je.decode(o):null,readonly:d>=6&&8&n?Qt.decode(o):null,additionalNodes:d>=11&&16&n?Ge.decode(o):null,buildType:d>=20&&32&n?Br.decode(o):null,"readonly-v2":d>=27&&64&n?Wt.decode(o):null}}},We=$,Xe={preencode(d,o){We.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){We.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:We.decode(d),blindRequest:e.buffer.decode(d)})},Ye=$,Ze={preencode(o,n){Ye.preencode(o,n.header),o.end++,n.profile&&Xt.preencode(o,n.profile),d>=24&&n.key&&e.fixed32.preencode(o,n.key)},encode(o,n){const c=(n.profile?1:0)|(d>=24&&n.key?2:0);Ye.encode(o,n.header),e.uint.encode(o,c),n.profile&&Xt.encode(o,n.profile),d>=24&&n.key&&e.fixed32.encode(o,n.key)},decode(o){const n=Ye.decode(o),c=e.uint.decode(o);return{header:n,profile:1&c?Xt.decode(o):null,key:d>=24&&2&c?e.fixed32.decode(o):null}}},$e={preencode(e,d){},encode(e,d){},decode:e=>({})},_e=$e,ed=ge,dd={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.id),ed.preencode(d,o.request)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.id),ed.encode(d,o.request)},decode:d=>({deviceKey:e.fixed32.decode(d),id:e.fixed32.decode(d),request:ed.decode(d)})},od=$,nd=Re,cd={preencode(d,o){od.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),d.end++,o.identity&&nd.preencode(d,o.identity)},encode(d,o){const n=o.identity?1:0;od.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.uint.encode(d,n),o.identity&&nd.encode(d,o.identity)},decode:d=>({header:od.decode(d),deviceKey:e.fixed32.decode(d),identity:1&e.uint.decode(d)?nd.decode(d):null})},rd=$,td={preencode(d,o){rd.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){rd.encode(d,o.header),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:rd.decode(d),deviceKey:e.fixed32.decode(d)})},id=e.frame(R),ad=pe,sd={preencode(d,o){e.fixed32.preencode(d,o.key),id.preencode(d,o.status),ad.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),id.encode(d,o.status),ad.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),status:id.decode(d),profile:ad.decode(d)})},pd=id,ud=pe,ld={preencode(d,o){e.fixed32.preencode(d,o.key),pd.preencode(d,o.status),ud.preencode(d,o.profile),d.end++,o.proofs&&Yt.preencode(d,o.proofs)},encode(d,o){const n=o.proofs?1:0;e.fixed32.encode(d,o.key),pd.encode(d,o.status),ud.encode(d,o.profile),e.uint.encode(d,n),o.proofs&&Yt.encode(d,o.proofs)},decode:d=>({key:e.fixed32.decode(d),status:pd.decode(d),profile:ud.decode(d),proofs:1&e.uint.decode(d)?Yt.decode(d):null})},fd={preencode(d,o){e.fixed32.preencode(d,o.key),d.end++,o.profileAttestation&&e.buffer.preencode(d,o.profileAttestation),o.latestReceipt&&e.buffer.preencode(d,o.latestReceipt)},encode(d,o){const n=(o.profileAttestation?1:0)|(o.latestReceipt?2:0);e.fixed32.encode(d,o.key),e.uint.encode(d,n),o.profileAttestation&&e.buffer.encode(d,o.profileAttestation),o.latestReceipt&&e.buffer.encode(d,o.latestReceipt)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d);return{key:o,profileAttestation:1&n?e.buffer.decode(d):null,latestReceipt:2&n?e.buffer.decode(d):null}}},md=$,yd=xe,bd={preencode(e,d){md.preencode(e,d.header),yd.preencode(e,d.member)},encode(e,d){md.encode(e,d.header),yd.encode(e,d.member)},decode:e=>({header:md.decode(e),member:yd.decode(e)})},xd=$,kd=e.frame(F),vd={preencode(d,o){xd.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),kd.preencode(d,o.status)},encode(d,o){xd.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),kd.encode(d,o.status)},decode:d=>({header:xd.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:kd.decode(d)})},gd=$,hd={preencode(d,o){gd.preencode(d,o.header),e.fixed32.preencode(d,o.key),d.end++},encode(d,o){const n=(o.isModerator?1:0)|(o.isAdmin?2:0);gd.encode(d,o.header),e.fixed32.encode(d,o.key),e.uint.encode(d,n)},decode(d){const o=gd.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{header:o,key:n,isModerator:!!(1&c),isAdmin:!!(2&c)}}},Kd=$,wd={preencode(d,o){Kd.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Kd.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Kd.decode(d),key:e.fixed32.decode(d)})},Td={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.mentions)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.mentions)},decode:d=>({key:e.fixed32.decode(d),mentions:e.uint.decode(d)})},Ad={preencode(d,o){d.end++,o.memberKey&&e.fixed32.preencode(d,o.memberKey)},encode(d,o){const n=o.memberKey?1:0;e.uint.encode(d,n),o.memberKey&&e.fixed32.encode(d,o.memberKey)},decode:d=>({memberKey:1&e.uint.decode(d)?e.fixed32.decode(d):null})},Pd=Ad,Sd={preencode(d,o){d.end++,o.from&&e.string.preencode(d,o.from),o.to&&e.string.preencode(d,o.to)},encode(d,o){const n=(o.from?1:0)|(o.to?2:0);e.uint.encode(d,n),o.from&&e.string.encode(d,o.from),o.to&&e.string.encode(d,o.to)},decode(d){const o=e.uint.decode(d);return{from:1&o?e.string.decode(d):null,to:2&o?e.string.decode(d):null}}},Id=e.frame(Ad),Rd=e.frame(Pd),Fd=e.frame(Sd),Hd={preencode(o,n){const c=(n.memberJoined?1:0)|(n.memberLeft?2:0)|(n.titleChanged?4:0)|(n.callStarted?8:0)|(n.callHangup?16:0)|(n.callMissed?32:0)|(d>=3&&n.roomAvatarChanged?64:0)|(d>=3&&n.invitationCreated?128:0)|(d>=3&&n.memberRemoved?256:0)|(d>=18&&n.locationShared?512:0);e.uint.preencode(o,c),n.memberJoined&&Id.preencode(o,n.memberJoined),n.memberLeft&&Rd.preencode(o,n.memberLeft),n.titleChanged&&Fd.preencode(o,n.titleChanged),d>=3&&n.memberRemoved&&Zt.preencode(o,n.memberRemoved),d>=18&&n.locationShared&&$t.preencode(o,n.locationShared)},encode(o,n){const c=(n.memberJoined?1:0)|(n.memberLeft?2:0)|(n.titleChanged?4:0)|(n.callStarted?8:0)|(n.callHangup?16:0)|(n.callMissed?32:0)|(d>=3&&n.roomAvatarChanged?64:0)|(d>=3&&n.invitationCreated?128:0)|(d>=3&&n.memberRemoved?256:0)|(d>=18&&n.locationShared?512:0);e.uint.encode(o,c),n.memberJoined&&Id.encode(o,n.memberJoined),n.memberLeft&&Rd.encode(o,n.memberLeft),n.titleChanged&&Fd.encode(o,n.titleChanged),d>=3&&n.memberRemoved&&Zt.encode(o,n.memberRemoved),d>=18&&n.locationShared&&$t.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{memberJoined:1&n?Id.decode(o):null,memberLeft:2&n?Rd.decode(o):null,titleChanged:4&n?Fd.decode(o):null,callStarted:!!(8&n),callHangup:!!(16&n),callMissed:!!(32&n),roomAvatarChanged:d>=3&&!!(64&n),invitationCreated:d>=3&&!!(128&n),memberRemoved:d>=3&&256&n?Zt.decode(o):null,locationShared:d>=18&&512&n?$t.decode(o):null}}},Md={preencode(e,o){e.end++,d>=18&&o.locationShared&&_t.preencode(e,o.locationShared)},encode(o,n){const c=(n.callStarted?1:0)|(n.callHangup?2:0)|(n.callMissed?4:0)|(d>=18&&n.locationShared?8:0);e.uint.encode(o,c),d>=18&&n.locationShared&&_t.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{callStarted:!!(1&n),callHangup:!!(2&n),callMissed:!!(4&n),locationShared:d>=18&&8&n?_t.decode(o):null}}},Cd={preencode(d,o){e.uint.preencode(d,o.start),e.uint.preencode(d,o.length)},encode(d,o){e.uint.encode(d,o.start),e.uint.encode(d,o.length)},decode:d=>({start:e.uint.decode(d),length:e.uint.decode(d)})},Dd=e.frame(Cd),Vd={preencode(d,o){Dd.preencode(d,o.range),e.string.preencode(d,o.content)},encode(d,o){Dd.encode(d,o.range),e.string.encode(d,o.content)},decode:d=>({range:Dd.decode(d),content:e.string.decode(d)})},Ld=Dd,qd={preencode(d,o){Ld.preencode(d,o.range),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Ld.encode(d,o.range),e.fixed32.encode(d,o.memberKey)},decode:d=>({range:Ld.decode(d),memberKey:e.fixed32.decode(d)})},Ed=g,Bd=e.array(e.uint),zd={preencode(o,n){o.end++,n.title&&e.string.preencode(o,n.title),n.description&&e.string.preencode(o,n.description),n.file&&Ed.preencode(o,n.file),d>=7&&n.files&&Bd.preencode(o,n.files)},encode(o,n){const c=(n.title?1:0)|(n.description?2:0)|(n.file?4:0)|(d>=7&&n.files?8:0);e.uint.encode(o,c),n.title&&e.string.encode(o,n.title),n.description&&e.string.encode(o,n.description),n.file&&Ed.encode(o,n.file),d>=7&&n.files&&Bd.encode(o,n.files)},decode(o){const n=e.uint.decode(o);return{title:1&n?e.string.decode(o):null,description:2&n?e.string.decode(o):null,file:4&n?Ed.decode(o):null,files:d>=7&&8&n?Bd.decode(o):null}}},Nd=Dd,jd=e.frame(zd),Od={preencode(d,o){Nd.preencode(d,o.range),e.string.preencode(d,o.url),d.end++,o.preview&&jd.preencode(d,o.preview)},encode(d,o){const n=o.preview?1:0;Nd.encode(d,o.range),e.string.encode(d,o.url),e.uint.encode(d,n),o.preview&&jd.encode(d,o.preview)},decode:d=>({range:Nd.decode(d),url:e.string.decode(d),preview:1&e.uint.decode(d)?jd.decode(d):null})},Ud=e.array(e.frame(qd)),Jd=e.array(e.frame(Od)),Gd=Jd,Qd=e.array(e.frame(Cd)),Wd=Qd,Xd=Qd,Yd=e.array(e.frame(Vd)),Zd=Qd,$d=Qd,_d={preencode(o,n){const c=(n.mention?1:0)|(n.httpLink?2:0)|(n.pearLink?4:0)|(n.bold?8:0)|(n.italic?16:0)|(n.code?32:0)|(n.emoji?64:0)|(n.codeBlock?128:0)|(n.strike?256:0)|(d>=11&&n.translation?512:0);e.uint.preencode(o,c),n.mention&&Ud.preencode(o,n.mention),n.httpLink&&Jd.preencode(o,n.httpLink),n.pearLink&&Gd.preencode(o,n.pearLink),n.bold&&Qd.preencode(o,n.bold),n.italic&&Wd.preencode(o,n.italic),n.code&&Xd.preencode(o,n.code),n.emoji&&Yd.preencode(o,n.emoji),n.codeBlock&&Zd.preencode(o,n.codeBlock),n.strike&&$d.preencode(o,n.strike),d>=11&&n.translation&&ei.preencode(o,n.translation)},encode(o,n){const c=(n.mention?1:0)|(n.httpLink?2:0)|(n.pearLink?4:0)|(n.bold?8:0)|(n.italic?16:0)|(n.code?32:0)|(n.emoji?64:0)|(n.codeBlock?128:0)|(n.strike?256:0)|(d>=11&&n.translation?512:0);e.uint.encode(o,c),n.mention&&Ud.encode(o,n.mention),n.httpLink&&Jd.encode(o,n.httpLink),n.pearLink&&Gd.encode(o,n.pearLink),n.bold&&Qd.encode(o,n.bold),n.italic&&Wd.encode(o,n.italic),n.code&&Xd.encode(o,n.code),n.emoji&&Yd.encode(o,n.emoji),n.codeBlock&&Zd.encode(o,n.codeBlock),n.strike&&$d.encode(o,n.strike),d>=11&&n.translation&&ei.encode(o,n.translation)},decode(o){const n=e.uint.decode(o);return{mention:1&n?Ud.decode(o):null,httpLink:2&n?Jd.decode(o):null,pearLink:4&n?Gd.decode(o):null,bold:8&n?Qd.decode(o):null,italic:16&n?Wd.decode(o):null,code:32&n?Xd.decode(o):null,emoji:64&n?Yd.decode(o):null,codeBlock:128&n?Zd.decode(o):null,strike:256&n?$d.decode(o):null,translation:d>=11&&512&n?ei.decode(o):null}}},eo=e.array(e.frame(v)),oo=e.frame(_d),no=e.frame(Md),co={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&eo.preencode(d,o.files),o.display&&oo.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent),o.event&&no.preencode(d,o.event)},encode(o,c){const r=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(c.event?32:0)|(d>=18&&c.forwarded?64:0);e.uint.encode(o,r),c.text&&e.string.encode(o,c.text),c.files&&eo.encode(o,c.files),c.display&&oo.encode(o,c.display),c.replyTo&&n.encode(o,c.replyTo),c.parent&&n.encode(o,c.parent),c.event&&no.encode(o,c.event)},decode(o){const c=e.uint.decode(o);return{text:1&c?e.string.decode(o):null,files:2&c?eo.decode(o):null,display:4&c?oo.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,event:32&c?no.decode(o):null,forwarded:d>=18&&!!(64&c)}}},ro=Bd,to=oo,io={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&ro.preencode(d,o.files),o.display&&to.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent)},encode(o,c){const r=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(d>=18&&c.forwarded?32:0);e.uint.encode(o,r),c.text&&e.string.encode(o,c.text),c.files&&ro.encode(o,c.files),c.display&&to.encode(o,c.display),c.replyTo&&n.encode(o,c.replyTo),c.parent&&n.encode(o,c.parent)},decode(o){const c=e.uint.decode(o);return{text:1&c?e.string.decode(o):null,files:2&c?ro.decode(o):null,display:4&c?to.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,forwarded:d>=18&&!!(32&c)}}},ao=eo,so=oo,po={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&ao.preencode(d,o.files),o.display&&so.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent)},encode(o,c){const r=(c.text?1:0)|(c.files?2:0)|(c.display?4:0)|(c.replyTo?8:0)|(c.parent?16:0)|(d>=18&&c.forwarded?32:0);e.uint.encode(o,r),c.text&&e.string.encode(o,c.text),c.files&&ao.encode(o,c.files),c.display&&so.encode(o,c.display),c.replyTo&&n.encode(o,c.replyTo),c.parent&&n.encode(o,c.parent)},decode(o){const c=e.uint.decode(o);return{text:1&c?e.string.decode(o):null,files:2&c?ao.decode(o):null,display:4&c?so.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,forwarded:d>=18&&!!(32&c)}}},uo={preencode(e,d){e.end++},encode(d,o){const n=(o.isEdited?1:0)|(o.isDeleted?2:0)|(o.isPinned?4:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isEdited:!!(1&o),isDeleted:!!(2&o),isPinned:!!(4&o)}}},lo={preencode(d,o){e.uint.preencode(d,o.thread),e.uint.preencode(d,o.index)},encode(d,o){e.uint.encode(d,o.thread),e.uint.encode(d,o.index)},decode:d=>({thread:e.uint.decode(d),index:e.uint.decode(d)})},fo=e.frame(z),mo={preencode(d,o){e.uint.preencode(d,o.id),e.uint.preencode(d,o.count),d.end++,o.parent&&n.preencode(d,o.parent),o.stats&&fo.preencode(d,o.stats)},encode(d,o){const c=(o.parent?1:0)|(o.stats?2:0);e.uint.encode(d,o.id),e.uint.encode(d,o.count),e.uint.encode(d,c),o.parent&&n.encode(d,o.parent),o.stats&&fo.encode(d,o.stats)},decode(d){const o=e.uint.decode(d),c=e.uint.decode(d),r=e.uint.decode(d);return{id:o,count:c,parent:1&r?n.decode(d):null,stats:2&r?fo.decode(d):null}}},yo=e.frame(uo),bo=e.frame(io),xo=e.frame(Hd),ko={preencode(d,o){lo.preencode(d,o.id),n.preencode(d,o.oplog),e.uint.preencode(d,o.clock),e.uint.preencode(d,o.timestamp),d.end++,o.editedAt&&e.uint.preencode(d,o.editedAt),yo.preencode(d,o.status),o.message&&bo.preencode(d,o.message),o.event&&xo.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);lo.encode(d,o.id),n.encode(d,o.oplog),e.uint.encode(d,o.clock),e.uint.encode(d,o.timestamp),e.uint.encode(d,c),o.editedAt&&e.uint.encode(d,o.editedAt),yo.encode(d,o.status),o.message&&bo.encode(d,o.message),o.event&&xo.encode(d,o.event)},decode(d){const o=lo.decode(d),c=n.decode(d),r=e.uint.decode(d),t=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:r,timestamp:t,editedAt:1&i?e.uint.decode(d):0,status:yo.decode(d),message:2&i?bo.decode(d):null,event:4&i?xo.decode(d):null}}},vo=yo,go=e.frame(po),ho=xo,Ko={preencode(d,o){lo.preencode(d,o.id),n.preencode(d,o.oplog),e.uint.preencode(d,o.clock),e.uint.preencode(d,o.timestamp),d.end++,o.editedAt&&e.uint.preencode(d,o.editedAt),vo.preencode(d,o.status),o.message&&go.preencode(d,o.message),o.event&&ho.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);lo.encode(d,o.id),n.encode(d,o.oplog),e.uint.encode(d,o.clock),e.uint.encode(d,o.timestamp),e.uint.encode(d,c),o.editedAt&&e.uint.encode(d,o.editedAt),vo.encode(d,o.status),o.message&&go.encode(d,o.message),o.event&&ho.encode(d,o.event)},decode(d){const o=lo.decode(d),c=n.decode(d),r=e.uint.decode(d),t=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:r,timestamp:t,editedAt:1&i?e.uint.decode(d):0,status:vo.decode(d),message:2&i?go.decode(d):null,event:4&i?ho.decode(d):null}}},wo=$,To=e.frame(co),Ao={preencode(e,d){wo.preencode(e,d.header),To.preencode(e,d.message)},encode(e,d){wo.encode(e,d.header),To.encode(e,d.message)},decode:e=>({header:wo.decode(e),message:To.decode(e)})},Po=$,So={preencode(e,d){Po.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){Po.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:Po.decode(e),oplog:n.decode(e)})},Io=$,Ro=To,Fo={preencode(e,d){Io.preencode(e,d.header),n.preencode(e,d.oplog),Ro.preencode(e,d.message)},encode(e,d){Io.encode(e,d.header),n.encode(e,d.oplog),Ro.encode(e,d.message)},decode:e=>({header:Io.decode(e),oplog:n.decode(e),message:Ro.decode(e)})},Ho=$,Mo={preencode(e,d){Ho.preencode(e,d.header),n.preencode(e,d.oplog),e.end++},encode(d,o){const c=o.isPinned?1:0;Ho.encode(d,o.header),n.encode(d,o.oplog),e.uint.encode(d,c)},decode:d=>({header:Ho.decode(d),oplog:n.decode(d),isPinned:!!(1&e.uint.decode(d))})},Co={preencode(d,o){lo.preencode(d,o.id),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),e.string.preencode(d,o.reaction)},encode(d,o){lo.encode(d,o.id),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),e.string.encode(d,o.reaction)},decode:d=>({id:lo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),reaction:e.string.decode(d)})},Do={preencode(d,o){e.string.preencode(d,o.text),e.uint.preencode(d,o.count)},encode(d,o){e.string.encode(d,o.text),e.uint.encode(d,o.count)},decode:d=>({text:e.string.decode(d),count:e.uint.decode(d)})},Vo=e.array(e.frame(Do)),Lo={preencode(o,n){lo.preencode(o,n.id),e.uint.preencode(o,n.total),Vo.preencode(o,n.reactions),o.end++,d>=11&&n.editedAt&&e.uint.preencode(o,n.editedAt)},encode(o,n){const c=d>=11&&n.editedAt?1:0;lo.encode(o,n.id),e.uint.encode(o,n.total),Vo.encode(o,n.reactions),e.uint.encode(o,c),d>=11&&n.editedAt&&e.uint.encode(o,n.editedAt)},decode(o){const n=lo.decode(o),c=e.uint.decode(o),r=Vo.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,reactions:r,editedAt:d>=11&&1&t?e.uint.decode(o):0}}},qo=$,Eo={preencode(d,o){qo.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){qo.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:qo.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},Bo=$,zo={preencode(d,o){Bo.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){Bo.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:Bo.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},No=$,jo=e.frame(Y),Oo={preencode(d,o){No.preencode(d,o.header),e.uint.preencode(d,o.key),jo.preencode(d,o.config)},encode(d,o){No.encode(d,o.header),e.uint.encode(d,o.key),jo.encode(d,o.config)},decode:d=>({header:No.decode(d),key:e.uint.decode(d),config:jo.decode(d)})},Uo={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.string.preencode(d,o.displayName),d.end++,o.avatar&&di.preencode(d,o.avatar)},encode(d,o){const n=o.avatar?1:0;e.fixed32.encode(d,o.memberKey),e.string.encode(d,o.displayName),e.uint.encode(d,n),o.avatar&&di.encode(d,o.avatar)},decode:d=>({memberKey:e.fixed32.decode(d),displayName:e.string.decode(d),avatar:1&e.uint.decode(d)?di.decode(d):null})},Jo={preencode(d,o){e.fixed32.preencode(d,o.key),d.end++,o.username&&e.string.preencode(d,o.username)},encode(d,o){const n=o.username?1:0;e.fixed32.encode(d,o.key),e.uint.encode(d,n),o.username&&e.string.encode(d,o.username)},decode:d=>({key:e.fixed32.decode(d),username:1&e.uint.decode(d)?e.string.decode(d):null})},Go=e.frame(Jo),Qo={preencode(d,o){e.fixed32.preencode(d,o.publicKey),d.end++,o.discoveryCoreKey&&e.fixed32.preencode(d,o.discoveryCoreKey),o.userRegistry&&Go.preencode(d,o.userRegistry)},encode(d,o){const n=(o.discoveryCoreKey?1:0)|(o.userRegistry?2:0);e.fixed32.encode(d,o.publicKey),e.uint.encode(d,n),o.discoveryCoreKey&&e.fixed32.encode(d,o.discoveryCoreKey),o.userRegistry&&Go.encode(d,o.userRegistry)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d);return{publicKey:o,discoveryCoreKey:1&n?e.fixed32.decode(d):null,userRegistry:2&n?Go.decode(d):null}}},Wo=$,Xo=e.frame(G),Yo=e.frame(Q),Zo=jo,$o=e.frame(Qo),_o=be,en=e.array(e.frame(ue)),dn={preencode(e,d){Wo.preencode(e,d.header),Xo.preencode(e,d.digest),Yo.preencode(e,d.capabilities),e.end++,d.config&&Zo.preencode(e,d.config),d.identity&&$o.preencode(e,d.identity),d.bootstrapDevice&&_o.preencode(e,d.bootstrapDevice),d.initialMembers&&en.preencode(e,d.initialMembers)},encode(d,o){const n=(o.config?1:0)|(o.identity?2:0)|(o.bootstrapDevice?4:0)|(o.initialMembers?8:0);Wo.encode(d,o.header),Xo.encode(d,o.digest),Yo.encode(d,o.capabilities),e.uint.encode(d,n),o.config&&Zo.encode(d,o.config),o.identity&&$o.encode(d,o.identity),o.bootstrapDevice&&_o.encode(d,o.bootstrapDevice),o.initialMembers&&en.encode(d,o.initialMembers)},decode(d){const o=Wo.decode(d),n=Xo.decode(d),c=Yo.decode(d),r=e.uint.decode(d);return{header:o,digest:n,capabilities:c,config:1&r?Zo.decode(d):null,identity:2&r?$o.decode(d):null,bootstrapDevice:4&r?_o.decode(d):null,initialMembers:8&r?en.decode(d):null}}},on=$,nn={preencode(d,o){on.preencode(d,o.header),e.uint.preencode(d,o.version)},encode(d,o){on.encode(d,o.header),e.uint.encode(d,o.version)},decode:d=>({header:on.decode(d),version:e.uint.decode(d)})},cn=$,rn=J,tn={preencode(d,o){cn.preencode(d,o.header),e.uint.preencode(d,o.key),rn.preencode(d,o.settings)},encode(d,o){cn.encode(d,o.header),e.uint.encode(d,o.key),rn.encode(d,o.settings)},decode:d=>({header:cn.decode(d),key:e.uint.decode(d),settings:rn.decode(d)})},an={preencode(o,n){e.fixed32.preencode(o,n.memberKey),oi.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=22&&n.contactInfo&&ni.preencode(o,n.contactInfo),d>=22&&n.version&&e.uint.preencode(o,n.version),d>=24&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=22&&n.contactInfo?4:0)|(d>=22&&n.version?8:0)|(d>=24&&n.alias?16:0);e.fixed32.encode(o,n.memberKey),oi.encode(o,n.status),e.uint.encode(o,c),n.mailbox&&e.fixed32.encode(o,n.mailbox),n.roomKey&&e.fixed32.encode(o,n.roomKey),d>=22&&n.contactInfo&&ni.encode(o,n.contactInfo),d>=22&&n.version&&e.uint.encode(o,n.version),d>=24&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=oi.decode(o),r=e.uint.decode(o);return{memberKey:n,status:c,mailbox:1&r?e.fixed32.decode(o):null,roomKey:2&r?e.fixed32.decode(o):null,contactInfo:d>=22&&4&r?ni.decode(o):null,version:d>=22&&8&r?e.uint.decode(o):0,alias:d>=24&&16&r?e.string.decode(o):null}}},sn={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),e.fixed32.preencode(d,n.seed),o.preencode(d,n.initiator),e.fixed32.preencode(d,n.fastForwardTo)},encode(d,n){e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.fixed32.encode(d,n.seed),o.encode(d,n.initiator),e.fixed32.encode(d,n.fastForwardTo)},decode:d=>({roomKey:e.fixed32.decode(d),encryptionKey:e.buffer.decode(d),seed:e.fixed32.decode(d),initiator:o.decode(d),fastForwardTo:e.fixed32.decode(d)})},pn=e.array(e.frame(sn)),un=X,ln={preencode(e,d){pn.preencode(e,d.sharedRooms),un.preencode(e,d.blockedContacts)},encode(e,d){pn.encode(e,d.sharedRooms),un.encode(e,d.blockedContacts)},decode:e=>({sharedRooms:pn.decode(e),blockedContacts:un.decode(e)})},fn=$o,mn={preencode(e,d){fn.preencode(e,d.identity)},encode(e,d){fn.encode(e,d.identity)},decode:e=>({identity:fn.decode(e)})},yn={preencode(d,o){e.uint.preencode(d,o.rooms),e.uint.preencode(d,o.contacts)},encode(d,o){e.uint.encode(d,o.rooms),e.uint.encode(d,o.contacts)},decode:d=>({rooms:e.uint.decode(d),contacts:e.uint.decode(d)})},bn={preencode(d,o){e.uint.preencode(d,o.rooms),e.uint.preencode(d,o.contactRequests)},encode(d,o){e.uint.encode(d,o.rooms),e.uint.encode(d,o.contactRequests)},decode:d=>({rooms:e.uint.decode(d),contactRequests:e.uint.decode(d)})},xn={preencode(d,o){e.buffer.preencode(d,o.entropy)},encode(d,o){e.buffer.encode(d,o.entropy)},decode:d=>({entropy:e.buffer.decode(d)})},kn={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed32.preencode(d,o.devicePublicKey),e.fixed32.preencode(d,o.writerKey)},encode(d,o){e.fixed32.encode(d,o.publicKey),e.fixed32.encode(d,o.devicePublicKey),e.fixed32.encode(d,o.writerKey)},decode:d=>({publicKey:e.fixed32.decode(d),devicePublicKey:e.fixed32.decode(d),writerKey:e.fixed32.decode(d)})},vn=e.frame(kn),gn={preencode(n,c){e.fixed32.preencode(n,c.id),e.fixed32.preencode(n,c.invitationSeed),e.fixed32.preencode(n,c.mailbox),r.preencode(n,c.responseKeyPair),o.preencode(n,c.initiator),o.preencode(n,c.inviter),n.end++,c.identity&&vn.preencode(n,c.identity),d>=20&&c.buildType&&Br.preencode(n,c.buildType),d>=27&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=20&&c.buildType?2:0)|(d>=27&&c.link?4:0);e.fixed32.encode(n,c.id),e.fixed32.encode(n,c.invitationSeed),e.fixed32.encode(n,c.mailbox),r.encode(n,c.responseKeyPair),o.encode(n,c.initiator),o.encode(n,c.inviter),e.uint.encode(n,t),c.identity&&vn.encode(n,c.identity),d>=20&&c.buildType&&Br.encode(n,c.buildType),d>=27&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),t=e.fixed32.decode(n),i=e.fixed32.decode(n),a=r.decode(n),s=o.decode(n),p=o.decode(n),u=e.uint.decode(n);return{id:c,invitationSeed:t,mailbox:i,responseKeyPair:a,initiator:s,inviter:p,identity:1&u?vn.decode(n):null,buildType:d>=20&&2&u?Br.decode(n):null,link:d>=27&&4&u?o.decode(n):null}}},hn=$,Kn={preencode(d,o){hn.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){hn.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:hn.decode(d),blindResponse:e.buffer.decode(d)})},wn=$,Tn=e.frame(gn),An={preencode(e,d){wn.preencode(e,d.header),Tn.preencode(e,d.invitation)},encode(e,d){wn.encode(e,d.header),Tn.encode(e,d.invitation)},decode:e=>({header:wn.decode(e),invitation:Tn.decode(e)})},Pn=$,Sn={preencode(d,o){Pn.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Pn.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Pn.decode(d),id:e.fixed32.decode(d)})},In={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed32.preencode(d,o.devicePublicKey),d.end++,o.privateProfileKey&&e.fixed32.preencode(d,o.privateProfileKey),o.deviceKeyPair&&r.preencode(d,o.deviceKeyPair),e.buffer.preencode(d,o.deviceProof)},encode(d,o){const n=(o.privateProfileKey?1:0)|(o.deviceKeyPair?2:0);e.fixed32.encode(d,o.publicKey),e.fixed32.encode(d,o.devicePublicKey),e.uint.encode(d,n),o.privateProfileKey&&e.fixed32.encode(d,o.privateProfileKey),o.deviceKeyPair&&r.encode(d,o.deviceKeyPair),e.buffer.encode(d,o.deviceProof)},decode(d){const o=e.fixed32.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{publicKey:o,devicePublicKey:n,privateProfileKey:1&c?e.fixed32.decode(d):null,deviceKeyPair:2&c?r.decode(d):null,deviceProof:e.buffer.decode(d)}}},Rn={preencode(o,n){o.end++,d>=25&&n.roomSnoozeTime&&e.uint.preencode(o,n.roomSnoozeTime)},encode(o,n){const c=(n.isActive?1:0)|(n.isFullyMuted?2:0)|(n.isMentionsOnlyMuted?4:0)|(d>=9&&n.isReadOnly?8:0)|(d>=18&&n.isFavorite?16:0)|(d>=21&&n.isUnread?32:0)|(d>=25&&n.roomSnoozeTime?64:0);e.uint.encode(o,c),d>=25&&n.roomSnoozeTime&&e.uint.encode(o,n.roomSnoozeTime)},decode(o){const n=e.uint.decode(o);return{isActive:!!(1&n),isFullyMuted:!!(2&n),isMentionsOnlyMuted:!!(4&n),isReadOnly:d>=9&&!!(8&n),isFavorite:d>=18&&!!(16&n),isUnread:d>=21&&!!(32&n),roomSnoozeTime:d>=25&&64&n?e.uint.decode(o):0}}},Fn=e.frame(Rn),Hn=e.frame(In),Mn=vn,Cn={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),Fn.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,c.initiator&&o.preencode(n,c.initiator),c.fastForwardTo&&e.fixed32.preencode(n,c.fastForwardTo),c.identitySwap&&Hn.preencode(n,c.identitySwap),d>=6&&c.identitySwapV2&&Mn.preencode(n,c.identitySwapV2),d>=10&&c.contact&&e.fixed32.preencode(n,c.contact),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=29&&c.activeClock&&e.uint.preencode(n,c.activeClock)},encode(n,c){const r=(c.initiator?1:0)|(c.fastForwardTo?2:0)|(c.identitySwap?4:0)|(d>=6&&c.identitySwapV2?8:0)|(d>=10&&c.contact?16:0)|(d>=27&&c.bootFrom?32:0)|(d>=29&&c.activeClock?64:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),Fn.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,r),c.initiator&&o.encode(n,c.initiator),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),c.identitySwap&&Hn.encode(n,c.identitySwap),d>=6&&c.identitySwapV2&&Mn.encode(n,c.identitySwapV2),d>=10&&c.contact&&e.fixed32.encode(n,c.contact),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom),d>=29&&c.activeClock&&e.uint.encode(n,c.activeClock)},decode(n){const c=e.fixed32.decode(n),r=e.buffer.decode(n),t=e.fixed32.decode(n),i=Fn.decode(n),a=e.uint.decode(n),s=e.uint.decode(n);return{roomKey:c,encryptionKey:r,mailbox:t,status:i,clock:a,initiator:1&s?o.decode(n):null,fastForwardTo:2&s?e.fixed32.decode(n):null,identitySwap:4&s?Hn.decode(n):null,identitySwapV2:d>=6&&8&s?Mn.decode(n):null,contact:d>=10&&16&s?e.fixed32.decode(n):null,bootFrom:d>=27&&32&s?o.decode(n):null,activeClock:d>=29&&64&s?e.uint.decode(n):0}}},Dn=$,Vn={preencode(d,n){Dn.preencode(d,n.header),e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),e.fixed32.preencode(d,n.mailbox),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator),n.dm&&e.fixed32.preencode(d,n.dm)},encode(n,c){const r=(c.fastForwardTo?1:0)|(c.initiator?2:0)|(c.dm?4:0)|(d>=9&&c.isReadOnly?8:0);Dn.encode(n,c.header),e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),e.uint.encode(n,r),c.fastForwardTo&&e.fixed32.encode(n,c.fastForwardTo),c.initiator&&o.encode(n,c.initiator),c.dm&&e.fixed32.encode(n,c.dm)},decode(n){const c=Dn.decode(n),r=e.fixed32.decode(n),t=e.buffer.decode(n),i=e.fixed32.decode(n),a=e.uint.decode(n);return{header:c,roomKey:r,encryptionKey:t,mailbox:i,fastForwardTo:1&a?e.fixed32.decode(n):null,initiator:2&a?o.decode(n):null,dm:4&a?e.fixed32.decode(n):null,isReadOnly:d>=9&&!!(8&a)}}},Ln=$,qn={preencode(d,o){Ln.preencode(d,o.header),e.fixed32.preencode(d,o.discoveryKey)},encode(d,o){Ln.encode(d,o.header),e.fixed32.encode(d,o.discoveryKey)},decode:d=>({header:Ln.decode(d),discoveryKey:e.fixed32.decode(d)})},En=$,Bn=Fn,zn={preencode(d,o){En.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),Bn.preencode(d,o.status)},encode(d,o){En.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),Bn.encode(d,o.status)},decode:d=>({header:En.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),status:Bn.decode(d)})},Nn={preencode(e,d){e.end++},encode(o,n){const c=(n.isBlocked?1:0)|(d>=22&&n.isActive?2:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isBlocked:!!(1&n),isActive:d>=22&&!!(2&n)}}},jn={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),ci.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=22&&n.contactInfo&&ri.preencode(o,n.contactInfo),d>=24&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=22&&n.contactInfo?4:0)|(d>=24&&n.alias?8:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),ci.encode(o,n.status),e.uint.encode(o,c),n.mailbox&&e.fixed32.encode(o,n.mailbox),n.roomKey&&e.fixed32.encode(o,n.roomKey),d>=22&&n.contactInfo&&ri.encode(o,n.contactInfo),d>=24&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=ci.decode(o),t=e.uint.decode(o);return{memberKey:n,clock:c,status:r,mailbox:1&t?e.fixed32.decode(o):null,roomKey:2&t?e.fixed32.decode(o):null,contactInfo:d>=22&&4&t?ri.decode(o):null,alias:d>=24&&8&t?e.string.decode(o):null}}},On=$,Un=e.frame(an),Jn={preencode(e,d){On.preencode(e,d.header),Un.preencode(e,d.contact)},encode(e,d){On.encode(e,d.header),Un.encode(e,d.contact)},decode:e=>({header:On.decode(e),contact:Un.decode(e)})},Gn=$,Qn={preencode(d,o){Gn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),ti.preencode(d,o.status)},encode(d,o){Gn.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),ti.encode(d,o.status)},decode:d=>({header:Gn.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:ti.decode(d)})},Wn=$,Xn={preencode(d,o){Wn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Wn.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:Wn.decode(d),memberKey:e.fixed32.decode(d)})},Yn={preencode(e,d){e.end++},encode(d,o){const n=(o.isPending?1:0)|(o.isAccepted?2:0)|(o.isRejected?4:0)|(o.isDiscarded?8:0)|(o.isSeen?16:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isPending:!!(1&o),isAccepted:!!(2&o),isRejected:!!(4&o),isDiscarded:!!(8&o),isSeen:!!(16&o)}}},Zn=xe,$n=e.frame(t),_n={preencode(d,o){Zn.preencode(d,o.sender),$n.preencode(d,o.keys),e.fixed32.preencode(d,o.mailbox),d.end++,o.message&&e.string.preencode(d,o.message)},encode(d,o){const n=o.message?1:0;Zn.encode(d,o.sender),$n.encode(d,o.keys),e.fixed32.encode(d,o.mailbox),e.uint.encode(d,n),o.message&&e.string.encode(d,o.message)},decode:d=>({sender:Zn.decode(d),keys:$n.decode(d),mailbox:e.fixed32.decode(d),message:1&e.uint.decode(d)?e.string.decode(d):null})},ec=e.frame(_n),dc={preencode(o,n){ec.preencode(o,n.body),ne.preencode(o,n.attestation),o.end++,d>=31&&n.recipientProof&&e.buffer.preencode(o,n.recipientProof)},encode(o,n){const c=d>=31&&n.recipientProof?1:0;ec.encode(o,n.body),ne.encode(o,n.attestation),e.uint.encode(o,c),d>=31&&n.recipientProof&&e.buffer.encode(o,n.recipientProof)},decode(o){const n=ec.decode(o),c=ne.decode(o),r=o.start<o.end?e.uint.decode(o):0;return{body:n,attestation:c,recipientProof:d>=31&&1&r?e.buffer.decode(o):null}}},oc=pe,nc=e.frame(Yn),cc=$n,rc={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),oc.preencode(o,n.sender),nc.preencode(o,n.status),cc.preencode(o,n.keys),e.fixed32.preencode(o,n.mailbox),o.end++,n.message&&e.string.preencode(o,n.message),d>=11&&n.sentAt&&e.uint.preencode(o,n.sentAt),d>=22&&n.contactInfo&&ii.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=11&&n.sentAt?2:0)|(d>=22&&n.contactInfo?4:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),oc.encode(o,n.sender),nc.encode(o,n.status),cc.encode(o,n.keys),e.fixed32.encode(o,n.mailbox),e.uint.encode(o,c),n.message&&e.string.encode(o,n.message),d>=11&&n.sentAt&&e.uint.encode(o,n.sentAt),d>=22&&n.contactInfo&&ii.encode(o,n.contactInfo)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=oc.decode(o),t=nc.decode(o),i=cc.decode(o),a=e.fixed32.decode(o),s=e.uint.decode(o);return{memberKey:n,clock:c,sender:r,status:t,keys:i,mailbox:a,message:1&s?e.string.decode(o):null,sentAt:d>=11&&2&s?e.uint.decode(o):0,contactInfo:d>=22&&4&s?ii.decode(o):null}}},tc=$,ic={preencode(d,o){tc.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){tc.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:tc.decode(d),blindRequest:e.buffer.decode(d)})},ac=$,sc=nc,pc={preencode(o,n){ac.preencode(o,n.header),e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.key),sc.preencode(o,n.status),o.end++,d>=10&&n.roomKey&&e.fixed32.preencode(o,n.roomKey)},encode(o,n){const c=d>=10&&n.roomKey?1:0;ac.encode(o,n.header),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.key),sc.encode(o,n.status),e.uint.encode(o,c),d>=10&&n.roomKey&&e.fixed32.encode(o,n.roomKey)},decode(o){const n=ac.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o),t=sc.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{header:n,memberKey:c,key:r,status:t,roomKey:d>=10&&1&i?e.fixed32.decode(o):null}}},uc={preencode(d,o){e.uint.preencode(d,o.timestamp),e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.mailbox)},encode(d,o){e.uint.encode(d,o.timestamp),e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.mailbox)},decode:d=>({version:0,timestamp:e.uint.decode(d),key:e.fixed32.decode(d),mailbox:e.fixed32.decode(d)})},lc={preencode(d,o){const n=o.version??1;switch(e.uint.preencode(d,n),n){case 0:case 1:uc.preencode(d,o);break;default:throw new Error("Unsupported version")}},encode(d,o){const n=o.version??1;switch(e.uint.encode(d,n),n){case 0:case 1:uc.encode(d,o);break;default:throw new Error("Unsupported version")}},decode(d){const o=e.uint.decode(d);switch(o){case 0:case 1:{const e=uc.decode(d);return e.version=o,e}default:throw new Error("Unsupported version")}}},fc=$,mc={preencode(o,c){fc.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),ai.preencode(o,c.preview),o.end++,d>=7&&c.displayType&&Pc.preencode(o,c.displayType)},encode(o,c){const r=d>=7&&c.displayType?1:0;fc.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),ai.encode(o,c.preview),e.uint.encode(o,r),d>=7&&c.displayType&&Pc.encode(o,c.displayType)},decode(o){const c=fc.decode(o),r=n.decode(o),t=e.uint.decode(o),i=ai.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{header:c,oplog:r,index:t,preview:i,displayType:d>=7&&1&a?Pc.decode(o):0}}},yc={preencode(o,n){o.end++,d>=3&&n.memberKey&&e.fixed32.preencode(o,n.memberKey)},encode(o,n){const c=d>=3&&n.memberKey?1:0;e.uint.encode(o,c),d>=3&&n.memberKey&&e.fixed32.encode(o,n.memberKey)},decode(o){const n=e.uint.decode(o);return{memberKey:d>=3&&1&n?e.fixed32.decode(o):null}}},bc=pe,xc={preencode(e,d){bc.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){bc.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:bc.decode(e),attestation:ne.decode(e)})},kc=$,vc={preencode(d,o){kc.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){kc.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:kc.decode(d),key:e.fixed32.decode(d)})},gc={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),ne.preencode(d,o.privateProfileIdentity),e.buffer.preencode(d,o.deviceProof)},encode(d,o){e.fixed32.encode(d,o.deviceKey),ne.encode(d,o.privateProfileIdentity),e.buffer.encode(d,o.deviceProof)},decode:d=>({deviceKey:e.fixed32.decode(d),privateProfileIdentity:ne.decode(d),deviceProof:e.buffer.decode(d)})},hc={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.encryptionKey),e.fixed32.preencode(o,n.seed),o.end++,d>=6&&n.fastForwardTo&&e.fixed32.preencode(o,n.fastForwardTo)},encode(o,n){const c=d>=6&&n.fastForwardTo?1:0;e.fixed32.encode(o,n.roomKey),e.fixed32.encode(o,n.encryptionKey),e.fixed32.encode(o,n.seed),e.uint.encode(o,c),d>=6&&n.fastForwardTo&&e.fixed32.encode(o,n.fastForwardTo)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o);return{roomKey:n,encryptionKey:c,seed:r,fastForwardTo:d>=6&&1&t?e.fixed32.decode(o):null}}},Kc={preencode(o,n){e.fixed32.preencode(o,n.publicKey),e.fixed32.preencode(o,n.writerKey),e.fixed32.preencode(o,n.devicePublicKey),o.end++,d>=6&&n.privateProfileKey&&e.fixed32.preencode(o,n.privateProfileKey)},encode(o,n){const c=d>=6&&n.privateProfileKey?1:0;e.fixed32.encode(o,n.publicKey),e.fixed32.encode(o,n.writerKey),e.fixed32.encode(o,n.devicePublicKey),e.uint.encode(o,c),d>=6&&n.privateProfileKey&&e.fixed32.encode(o,n.privateProfileKey)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o);return{publicKey:n,writerKey:c,devicePublicKey:r,privateProfileKey:d>=6&&1&t?e.fixed32.decode(o):null}}},wc=$,Tc={preencode(d,o){wc.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){wc.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:wc.decode(d),memberKey:e.fixed32.decode(d)})},Ac={HttpLink:1,PearLink:2},Pc={preencode(e,d){e.end++},encode(d,o){if(o>2)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Sc=$,Ic={preencode(d,o){Sc.preencode(d,o.header),e.uint.preencode(d,o.value)},encode(d,o){Sc.encode(d,o.header),e.uint.encode(d,o.value)},decode:d=>({header:Sc.decode(d),value:e.uint.decode(d)})},Rc={preencode(d,o){e.uint.preencode(d,o.key),e.uint.preencode(d,o.value)},encode(d,o){e.uint.encode(d,o.key),e.uint.encode(d,o.value)},decode:d=>({key:e.uint.decode(d),value:e.uint.decode(d)})},Fc=$,Hc={preencode(o,n){Fc.preencode(o,n.header),e.uint.preencode(o,n.from),e.uint.preencode(o,n.to),o.end++,d>=20&&n.buildType&&Br.preencode(o,n.buildType)},encode(o,n){const c=d>=20&&n.buildType?1:0;Fc.encode(o,n.header),e.uint.encode(o,n.from),e.uint.encode(o,n.to),e.uint.encode(o,c),d>=20&&n.buildType&&Br.encode(o,n.buildType)},decode(o){const n=Fc.decode(o),c=e.uint.decode(o),r=e.uint.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{header:n,from:c,to:r,buildType:d>=20&&1&t?Br.decode(o):null}}},Mc={RoomType:1,IsExperimental:2,IsJoiningDisabled:3,IsAppendingDisabled:4,IsCallingDisabled:5,IsMembershipEventsDisabled:6,IsAttachmentsDisabled:7,IsLinksDisabled:8,IsRoomInviteHidden:9},Cc={preencode(e,d){e.end++},encode(d,o){if(o>9)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Dc={en:"en",it:"it",ru:"ru",es:"es",de:"de"},Vc={preencode(e,d){e.end++},encode(d,o){switch(o){case"en":e.uint.encode(d,1);break;case"it":e.uint.encode(d,2);break;case"ru":e.uint.encode(d,3);break;case"es":e.uint.encode(d,4);break;case"de":e.uint.encode(d,5);break;default:throw new Error("Unknown enum")}},decode(d){switch(e.uint.decode(d)){case 1:return"en";case 2:return"it";case 3:return"ru";case 4:return"es";case 5:return"de";default:return null}}},Lc=Dd,qc={preencode(d,o){Lc.preencode(d,o.range),Vc.preencode(d,o.language),e.string.preencode(d,o.text)},encode(d,o){Lc.encode(d,o.range),Vc.encode(d,o.language),e.string.encode(d,o.text)},decode:d=>({range:Lc.decode(d),language:Vc.decode(d),text:e.string.decode(d)})},Ec={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.key)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.key)},decode:d=>({deviceKey:e.fixed32.decode(d),key:e.fixed32.decode(d)})},Bc=$,zc={preencode(d,o){Bc.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Bc.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Bc.decode(d),key:e.fixed32.decode(d)})},Nc=$,jc={preencode(d,o){Nc.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Nc.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Nc.decode(d),key:e.fixed32.decode(d)})},Oc={Flag:1},Uc={preencode(e,d){e.end++},encode(d,o){if(o>1)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Jc={preencode(d,o){lo.preencode(d,o.id),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),Uc.preencode(d,o.label)},encode(d,o){lo.encode(d,o.id),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),Uc.encode(d,o.label)},decode:d=>({id:lo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:Uc.decode(d)})},Gc=$,Qc={preencode(e,d){Gc.preencode(e,d.header),n.preencode(e,d.oplog),Uc.preencode(e,d.label)},encode(e,d){Gc.encode(e,d.header),n.encode(e,d.oplog),Uc.encode(e,d.label)},decode:e=>({header:Gc.decode(e),oplog:n.decode(e),label:Uc.decode(e)})},Wc=$,Xc={preencode(e,d){Wc.preencode(e,d.header),n.preencode(e,d.oplog),Uc.preencode(e,d.label)},encode(e,d){Wc.encode(e,d.header),n.encode(e,d.oplog),Uc.encode(e,d.label)},decode:e=>({header:Wc.decode(e),oplog:n.decode(e),label:Uc.decode(e)})},Yc={preencode(d,o){Uc.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){Uc.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:Uc.decode(d),count:e.uint.decode(d)})},Zc=e.array(e.frame(Yc)),$c={preencode(o,n){lo.preencode(o,n.id),e.uint.preencode(o,n.total),Zc.preencode(o,n.labels),e.uint.preencode(o,n.editedAt),o.end++,d>=15&&n.flagsClock&&e.uint.preencode(o,n.flagsClock),d>=15&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=15&&n.flagsClock?1:0)|(d>=15&&n.version?2:0)|(d>=16&&n.isDeleted?4:0);lo.encode(o,n.id),e.uint.encode(o,n.total),Zc.encode(o,n.labels),e.uint.encode(o,n.editedAt),e.uint.encode(o,c),d>=15&&n.flagsClock&&e.uint.encode(o,n.flagsClock),d>=15&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=lo.decode(o),c=e.uint.decode(o),r=Zc.decode(o),t=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,labels:r,editedAt:t,flagsClock:d>=15&&1&i?e.uint.decode(o):0,version:d>=15&&2&i?e.uint.decode(o):0,isDeleted:d>=16&&!!(4&i)}}},_c=$,er={preencode(d,o){_c.preencode(d,o.header),e.uint.preencode(d,o.length)},encode(d,o){_c.encode(d,o.header),e.uint.encode(d,o.length)},decode:d=>({header:_c.decode(d),length:e.uint.decode(d)})},dr={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.length)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.length)},decode:d=>({memberKey:e.fixed32.decode(d),length:e.uint.decode(d)})},or=Z,nr={preencode(o,n){o.end++,d>=23&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(d>=13&&n.disableReadReceipts?1:0)|(d>=21&&n.stripAttachmentMetadata?2:0)|(d>=23&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=23&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:d>=13&&!!(1&n),stripAttachmentMetadata:d>=21&&!!(2&n),profileSnoozeTime:d>=23&&4&n?e.uint.decode(o):0}}},cr={disableReadReceipts:"disableReadReceipts",stripAttachmentMetadata:"stripAttachmentMetadata",profileSnoozeTime:"profileSnoozeTime"},rr={preencode(e,d){e.end++},encode(d,o){switch(o){case"disableReadReceipts":e.uint.encode(d,1);break;case"stripAttachmentMetadata":e.uint.encode(d,2);break;case"profileSnoozeTime":e.uint.encode(d,3);break;default:throw new Error("Unknown enum")}},decode(d){switch(e.uint.decode(d)){case 1:return"disableReadReceipts";case 2:return"stripAttachmentMetadata";case 3:return"profileSnoozeTime";default:return null}}},tr=$,ir=e.frame(nr),ar={preencode(e,d){tr.preencode(e,d.header),rr.preencode(e,d.key),ir.preencode(e,d.settings)},encode(e,d){tr.encode(e,d.header),rr.encode(e,d.key),ir.encode(e,d.settings)},decode:e=>({header:tr.decode(e),key:rr.decode(e),settings:ir.decode(e)})},sr={Flag:1},pr={preencode(e,d){e.end++},encode(d,o){if(o>1)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},ur={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),pr.preencode(d,o.label)},encode(d,o){e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),pr.encode(d,o.label)},decode:d=>({key:e.fixed32.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:pr.decode(d)})},lr=$,fr={preencode(d,o){lr.preencode(d,o.header),e.fixed32.preencode(d,o.key),pr.preencode(d,o.label)},encode(d,o){lr.encode(d,o.header),e.fixed32.encode(d,o.key),pr.encode(d,o.label)},decode:d=>({header:lr.decode(d),key:e.fixed32.decode(d),label:pr.decode(d)})},mr={preencode(d,o){pr.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){pr.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:pr.decode(d),count:e.uint.decode(d)})},yr=e.array(e.frame(mr)),br={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.total),yr.preencode(d,o.labels),e.uint.preencode(d,o.editedAt),e.uint.preencode(d,o.flagsClock)},encode(d,o){e.fixed32.encode(d,o.key),e.uint.encode(d,o.total),yr.encode(d,o.labels),e.uint.encode(d,o.editedAt),e.uint.encode(d,o.flagsClock)},decode:d=>({key:e.fixed32.decode(d),total:e.uint.decode(d),labels:yr.decode(d),editedAt:e.uint.decode(d),flagsClock:e.uint.decode(d)})},xr={preencode(d,o){e.float64.preencode(d,o.latitude),e.float64.preencode(d,o.longitude)},encode(d,o){e.float64.encode(d,o.latitude),e.float64.encode(d,o.longitude)},decode:d=>({latitude:e.float64.decode(d),longitude:e.float64.decode(d)})},kr=$,vr={preencode(d,o){kr.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.fromDeviceKey)},encode(d,o){kr.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.fromDeviceKey)},decode:d=>({header:kr.decode(d),deviceKey:e.fixed32.decode(d),fromDeviceKey:e.fixed32.decode(d)})},gr=$,hr=X,Kr={preencode(o,n){gr.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),o.end++,d>=19&&n.streams&&hr.preencode(o,n.streams),d>=19&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=19&&n.version&&e.uint.preencode(o,n.version),d>=26&&n.streamInputs&&si.preencode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=19&&n.streams?1:0)|(d>=19&&n.discoveryKey?2:0)|(d>=19&&n.version?4:0)|(d>=26&&n.streamInputs?8:0)|(d>=26&&n.swarmKey?16:0);gr.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,c),d>=19&&n.streams&&hr.encode(o,n.streams),d>=19&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=19&&n.version&&e.uint.encode(o,n.version),d>=26&&n.streamInputs&&si.encode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=gr.decode(o),c=e.fixed32.decode(o),r=e.buffer.decode(o),t=e.uint.decode(o);return{header:n,callKey:c,encryptionKey:r,streams:d>=19&&1&t?hr.decode(o):null,discoveryKey:d>=19&&2&t?e.fixed32.decode(o):null,version:d>=19&&4&t?e.uint.decode(o):0,streamInputs:d>=26&&8&t?si.decode(o):null,swarmKey:d>=26&&16&t?e.fixed32.decode(o):null}}},wr=$,Tr=X,Ar={preencode(o,n){wr.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),o.end++,d>=19&&n.streams&&Tr.preencode(o,n.streams),d>=26&&n.streamInputs&&pi.preencode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=19&&n.streams?1:0)|(d>=26&&n.streamInputs?2:0)|(d>=26&&n.swarmKey?4:0);wr.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=19&&n.streams&&Tr.encode(o,n.streams),d>=26&&n.streamInputs&&pi.encode(o,n.streamInputs),d>=26&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=wr.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,callKey:c,streams:d>=19&&1&r?Tr.decode(o):null,streamInputs:d>=26&&2&r?pi.decode(o):null,swarmKey:d>=26&&4&r?e.fixed32.decode(o):null}}},Pr=$,Sr={preencode(d,o){Pr.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Pr.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Pr.decode(d),callKey:e.fixed32.decode(d)})},Ir=$,Rr={preencode(d,o){Ir.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Ir.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Ir.decode(d),callKey:e.fixed32.decode(d)})},Fr=$,Hr={preencode(o,n){Fr.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.streamKey),o.end++,d>=26&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=26&&n.type&&e.string.preencode(o,n.type)},encode(o,n){const c=(d>=26&&n.mediaStreamId?1:0)|(d>=26&&n.type?2:0)|(d>=26&&n.muted?4:0);Fr.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.streamKey),e.uint.encode(o,c),d>=26&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=26&&n.type&&e.string.encode(o,n.type)},decode(o){const n=Fr.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{header:n,callKey:c,streamKey:r,mediaStreamId:d>=26&&1&t?e.string.decode(o):null,type:d>=26&&2&t?e.string.decode(o):null,muted:d>=26&&!!(4&t)}}},Mr=$,Cr={preencode(d,o){Mr.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey)},encode(d,o){Mr.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.streamKey)},decode:d=>({header:Mr.decode(d),callKey:e.fixed32.decode(d),streamKey:e.fixed32.decode(d)})},Dr={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),e.uint.preencode(o,n.createdAt),o.end++,d>=19&&n.endedAt&&e.uint.preencode(o,n.endedAt),d>=19&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=19&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=19&&n.endedAt?1:0)|(d>=19&&n.discoveryKey?2:0)|(d>=19&&n.version?4:0);e.fixed32.encode(o,n.callKey),e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=19&&n.endedAt&&e.uint.encode(o,n.endedAt),d>=19&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=19&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=e.fixed32.decode(o),c=e.buffer.decode(o),r=e.uint.decode(o),t=e.uint.decode(o);return{callKey:n,encryptionKey:c,createdAt:r,endedAt:d>=19&&1&t?e.uint.decode(o):0,discoveryKey:d>=19&&2&t?e.fixed32.decode(o):null,version:d>=19&&4&t?e.uint.decode(o):0}}},Vr={preencode(d,o){e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.createdAt)},encode(d,o){e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.createdAt)},decode:d=>({callKey:e.fixed32.decode(d),memberKey:e.fixed32.decode(d),createdAt:e.uint.decode(d)})},Lr={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.deviceKey),e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.createdAt),o.end++,d>=19&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),d>=22&&n.lastHeartbeatAt&&e.uint.preencode(o,n.lastHeartbeatAt)},encode(o,n){const c=(d>=19&&n.swarmKey?1:0)|(d>=22&&n.lastHeartbeatAt?2:0)|(d>=23&&n.isRecording?4:0);e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.deviceKey),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=19&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey),d>=22&&n.lastHeartbeatAt&&e.uint.encode(o,n.lastHeartbeatAt)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o),i=e.uint.decode(o);return{callKey:n,deviceKey:c,memberKey:r,createdAt:t,swarmKey:d>=19&&1&i?e.fixed32.decode(o):null,lastHeartbeatAt:d>=22&&2&i?e.uint.decode(o):0,isRecording:d>=23&&!!(4&i)}}},qr={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.deviceKey),e.buffer.preencode(o,n.streamKey),e.uint.preencode(o,n.createdAt),o.end++,d>=26&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=26&&n.type&&e.string.preencode(o,n.type),d>=26&&n.statusKey&&e.uint.preencode(o,n.statusKey)},encode(o,n){const c=(d>=26&&n.mediaStreamId?1:0)|(d>=26&&n.type?2:0)|(d>=26&&n.statusKey?4:0);e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.deviceKey),e.buffer.encode(o,n.streamKey),e.uint.encode(o,n.createdAt),e.uint.encode(o,c),d>=26&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=26&&n.type&&e.string.encode(o,n.type),d>=26&&n.statusKey&&e.uint.encode(o,n.statusKey)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.buffer.decode(o),t=e.uint.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{callKey:n,deviceKey:c,streamKey:r,createdAt:t,mediaStreamId:d>=26&&1&i?e.string.decode(o):null,type:d>=26&&2&i?e.string.decode(o):null,statusKey:d>=26&&4&i?e.uint.decode(o):0}}},Er={Nightly:"Nightly",Internal:"Internal",Production:"Production"},Br={preencode(e,d){e.end++},encode(d,o){switch(o){case"Nightly":e.uint.encode(d,1);break;case"Internal":e.uint.encode(d,2);break;case"Production":e.uint.encode(d,3);break;default:throw new Error("Unknown enum")}},decode(d){switch(e.uint.decode(d)){case 1:return"Nightly";case 2:return"Internal";case 3:return"Production";default:return null}}},zr=$,Nr={preencode(e,d){zr.preencode(e,d.header)},encode(e,d){zr.encode(e,d.header)},decode:e=>({header:zr.decode(e)})},jr=$,Or={preencode(e,d){jr.preencode(e,d.header)},encode(e,d){jr.encode(e,d.header)},decode:e=>({header:jr.decode(e)})},Ur=$,Jr={preencode(d,o){Ur.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),e.buffer.preencode(d,o.deviceProof),e.buffer.preencode(d,o.writerProof)},encode(d,o){Ur.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.buffer.encode(d,o.deviceProof),e.buffer.encode(d,o.writerProof)},decode:d=>({header:Ur.decode(d),deviceKey:e.fixed32.decode(d),deviceProof:e.buffer.decode(d),writerProof:e.buffer.decode(d)})},Gr=$,Qr={preencode(d,o){Gr.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Gr.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Gr.decode(d),callKey:e.fixed32.decode(d)})},Wr=$,Xr={preencode(d,o){Wr.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){Wr.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:Wr.decode(d),callKey:e.fixed32.decode(d),deviceKey:e.fixed32.decode(d)})},Yr=$,Zr={preencode(d,o){Yr.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Yr.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Yr.decode(d),callKey:e.fixed32.decode(d)})},$r=$,_r={preencode(d,o){$r.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){$r.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:$r.decode(d),callKey:e.fixed32.decode(d)})},et=$,dt={preencode(e,d){et.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){et.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:et.decode(e),oplog:n.decode(e)})},ot=$,nt={preencode(e,d){ot.preencode(e,d.header)},encode(e,d){ot.encode(e,d.header)},decode:e=>({header:ot.decode(e)})},ct={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.timestamp)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.timestamp)},decode:d=>({memberKey:e.fixed32.decode(d),timestamp:e.uint.decode(d)})},rt=$,tt={preencode(o,n){rt.preencode(o,n.header),e.fixed32.preencode(o,n.memberKey),o.end++,d>=24&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=d>=24&&n.alias?1:0;rt.encode(o,n.header),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,c),d>=24&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=rt.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,memberKey:c,alias:d>=24&&1&r?e.string.decode(o):null}}},it={preencode(d,o){e.uint.preencode(d,o.streams)},encode(d,o){e.uint.encode(d,o.streams)},decode:d=>({streams:e.uint.decode(d)})},at={preencode(d,o){e.fixed32.preencode(d,o.streamKey),e.string.preencode(d,o.mediaStreamId),e.string.preencode(d,o.type),d.end++},encode(o,n){const c=d>=26&&n.muted?1:0;e.fixed32.encode(o,n.streamKey),e.string.encode(o,n.mediaStreamId),e.string.encode(o,n.type),e.uint.encode(o,c)},decode(o){const n=e.fixed32.decode(o),c=e.string.decode(o),r=e.string.decode(o),t=e.uint.decode(o);return{streamKey:n,mediaStreamId:c,type:r,muted:d>=26&&!!(1&t)}}},st=$,pt={preencode(d,o){st.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey),d.end++},encode(o,n){const c=d>=26&&n.muted?1:0;st.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.streamKey),e.uint.encode(o,c)},decode(o){const n=st.decode(o),c=e.fixed32.decode(o),r=e.fixed32.decode(o),t=e.uint.decode(o);return{header:n,callKey:c,streamKey:r,muted:d>=26&&!!(1&t)}}},ut={preencode(d,o){e.uint.preencode(d,o.statusKey),d.end++},encode(o,n){const c=d>=26&&n.muted?1:0;e.uint.encode(o,n.statusKey),e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o),c=e.uint.decode(o);return{statusKey:n,muted:d>=26&&!!(1&c)}}},lt={preencode(n,c){e.fixed32.preencode(n,c.key),n.end++,d>=27&&c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(d>=27&&c.encryptionKey?1:0)|(d>=27&&c.bootFrom?2:0);e.fixed32.encode(n,c.key),e.uint.encode(n,r),d>=27&&c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),r=e.uint.decode(n);return{key:c,encryptionKey:d>=27&&1&r?e.buffer.decode(n):null,bootFrom:d>=27&&2&r?o.decode(n):null}}},ft={preencode(d,o){e.fixed32.preencode(d,o.hash)},encode(d,o){e.fixed32.encode(d,o.hash)},decode:d=>({hash:e.fixed32.decode(d)})},mt={preencode(d,o){e.fixed32.preencode(d,o.hash),e.buffer.preencode(d,o.data)},encode(d,o){e.fixed32.encode(d,o.hash),e.buffer.encode(d,o.data)},decode:d=>({hash:e.fixed32.decode(d),data:e.buffer.decode(d)})},yt={preencode(n,c){o.preencode(n,c.autobeeMigrationHead),n.end++,d>=27&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=27&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=27&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),e.uint.preencode(n,c.createdAt)},encode(n,c){const r=(d>=27&&c.legacyViewHead?1:0)|(d>=27&&c.dbViewHead?2:0)|(d>=27&&c.blobsViewHead?4:0);o.encode(n,c.autobeeMigrationHead),e.uint.encode(n,r),d>=27&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=27&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=27&&c.blobsViewHead&&o.encode(n,c.blobsViewHead),e.uint.encode(n,c.createdAt)},decode(n){const c=o.decode(n),r=e.uint.decode(n);return{autobeeMigrationHead:c,legacyViewHead:d>=27&&1&r?o.decode(n):null,dbViewHead:d>=27&&2&r?o.decode(n):null,blobsViewHead:d>=27&&4&r?o.decode(n):null,createdAt:e.uint.decode(n)}}},bt=$,xt={preencode(e,n){bt.preencode(e,n.header),o.preencode(e,n.head),e.end++,d>=27&&n.legacyViewHead&&o.preencode(e,n.legacyViewHead),d>=27&&n.dbViewHead&&o.preencode(e,n.dbViewHead),d>=27&&n.blobsViewHead&&o.preencode(e,n.blobsViewHead)},encode(n,c){const r=(d>=27&&c.legacyViewHead?1:0)|(d>=27&&c.dbViewHead?2:0)|(d>=27&&c.blobsViewHead?4:0);bt.encode(n,c.header),o.encode(n,c.head),e.uint.encode(n,r),d>=27&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=27&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=27&&c.blobsViewHead&&o.encode(n,c.blobsViewHead)},decode(n){const c=bt.decode(n),r=o.decode(n),t=e.uint.decode(n);return{header:c,head:r,legacyViewHead:d>=27&&1&t?o.decode(n):null,dbViewHead:d>=27&&2&t?o.decode(n):null,blobsViewHead:d>=27&&4&t?o.decode(n):null}}},kt={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.fixed32.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.seed),n.end++,d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=d>=27&&c.bootFrom?1:0;e.fixed32.encode(n,c.roomKey),e.fixed32.encode(n,c.encryptionKey),e.fixed32.encode(n,c.seed),e.uint.encode(n,r),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom)},decode(n){const c=e.fixed32.decode(n),r=e.fixed32.decode(n),t=e.fixed32.decode(n),i=e.uint.decode(n);return{roomKey:c,encryptionKey:r,seed:t,bootFrom:d>=27&&1&i?o.decode(n):null}}},vt=id,gt={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.fixed32.preencode(d,o.deviceKey),e.uint.preencode(d,o.deviceLength),e.uint.preencode(d,o.clock),vt.preencode(d,o.status)},encode(d,o){e.fixed32.encode(d,o.memberKey),e.fixed32.encode(d,o.deviceKey),e.uint.encode(d,o.deviceLength),e.uint.encode(d,o.clock),vt.encode(d,o.status)},decode:d=>({memberKey:e.fixed32.decode(d),deviceKey:e.fixed32.decode(d),deviceLength:e.uint.decode(d),clock:e.uint.decode(d),status:vt.decode(d)})},ht={preencode(d,o){e.fixed32.preencode(d,o.hash),e.buffer.preencode(d,o.blob)},encode(d,o){e.fixed32.encode(d,o.hash),e.buffer.encode(d,o.blob)},decode:d=>({hash:e.fixed32.decode(d),blob:e.buffer.decode(d)})},Kt=Fn,wt=Hn,Tt=vn,At={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),Kt.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,d>=27&&c.initiator&&o.preencode(n,c.initiator),d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=27&&c.identitySwap&&wt.preencode(n,c.identitySwap),d>=27&&c.identitySwapV2&&Tt.preencode(n,c.identitySwapV2),d>=27&&c.contact&&e.fixed32.preencode(n,c.contact)},encode(n,c){const r=(d>=27&&c.initiator?1:0)|(d>=27&&c.bootFrom?2:0)|(d>=27&&c.identitySwap?4:0)|(d>=27&&c.identitySwapV2?8:0)|(d>=27&&c.contact?16:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),Kt.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,r),d>=27&&c.initiator&&o.encode(n,c.initiator),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom),d>=27&&c.identitySwap&&wt.encode(n,c.identitySwap),d>=27&&c.identitySwapV2&&Tt.encode(n,c.identitySwapV2),d>=27&&c.contact&&e.fixed32.encode(n,c.contact)},decode(n){const c=e.fixed32.decode(n),r=e.buffer.decode(n),t=e.fixed32.decode(n),i=Kt.decode(n),a=e.uint.decode(n),s=e.uint.decode(n);return{roomKey:c,encryptionKey:r,mailbox:t,status:i,clock:a,initiator:d>=27&&1&s?o.decode(n):null,bootFrom:d>=27&&2&s?o.decode(n):null,identitySwap:d>=27&&4&s?wt.decode(n):null,identitySwapV2:d>=27&&8&s?Tt.decode(n):null,contact:d>=27&&16&s?e.fixed32.decode(n):null}}},Pt=$,St={preencode(n,c){Pt.preencode(n,c.header),e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),n.end++,d>=27&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=27&&c.initiator&&o.preencode(n,c.initiator),d>=27&&c.dm&&e.fixed32.preencode(n,c.dm)},encode(n,c){const r=(d>=27&&c.bootFrom?1:0)|(d>=27&&c.initiator?2:0)|(d>=27&&c.dm?4:0)|(d>=27&&c.isReadOnly?8:0);Pt.encode(n,c.header),e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),e.uint.encode(n,r),d>=27&&c.bootFrom&&o.encode(n,c.bootFrom),d>=27&&c.initiator&&o.encode(n,c.initiator),d>=27&&c.dm&&e.fixed32.encode(n,c.dm)},decode(n){const c=Pt.decode(n),r=e.fixed32.decode(n),t=e.buffer.decode(n),i=e.fixed32.decode(n),a=e.uint.decode(n);return{header:c,roomKey:r,encryptionKey:t,mailbox:i,bootFrom:d>=27&&1&a?o.decode(n):null,initiator:d>=27&&2&a?o.decode(n):null,dm:d>=27&&4&a?e.fixed32.decode(n):null,isReadOnly:d>=27&&!!(8&a)}}},It={preencode(d,o){e.fixed32.preencode(d,o.id),e.fixed32.preencode(d,o.writerKey),e.buffer.preencode(d,o.blindResponse)},encode(d,o){e.fixed32.encode(d,o.id),e.fixed32.encode(d,o.writerKey),e.buffer.encode(d,o.blindResponse)},decode:d=>({id:e.fixed32.decode(d),writerKey:e.fixed32.decode(d),blindResponse:e.buffer.decode(d)})},Rt=$,Ft={preencode(d,o){Rt.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){Rt.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:Rt.decode(d),blindResponse:e.buffer.decode(d)})},Ht=$,Mt={preencode(e,d){Ht.preencode(e,d.header)},encode(e,d){Ht.encode(e,d.header)},decode:e=>({header:Ht.decode(e)})},Ct=$,Dt={preencode(o,c){Ct.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),o.end++,d>=30&&c.displayType&&Pc.preencode(o,c.displayType)},encode(o,c){const r=d>=30&&c.displayType?1:0;Ct.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),e.uint.encode(o,r),d>=30&&c.displayType&&Pc.encode(o,c.displayType)},decode(o){const c=Ct.decode(o),r=n.decode(o),t=e.uint.decode(o),i=e.uint.decode(o);return{header:c,oplog:r,index:t,displayType:d>=30&&1&i?Pc.decode(o):0}}},Vt=$,Lt=jd,qt={preencode(d,o){Vt.preencode(d,o.header),n.preencode(d,o.oplog),Pc.preencode(d,o.displayType),e.uint.preencode(d,o.index),Lt.preencode(d,o.preview)},encode(d,o){Vt.encode(d,o.header),n.encode(d,o.oplog),Pc.encode(d,o.displayType),e.uint.encode(d,o.index),Lt.encode(d,o.preview)},decode:d=>({header:Vt.decode(d),oplog:n.decode(d),displayType:Pc.decode(d),index:e.uint.decode(d),preview:Lt.decode(d)})},Et=$,Bt={preencode(d,o){Et.preencode(d,o.header),n.preencode(d,o.oplog),Pc.preencode(d,o.displayType),e.uint.preencode(d,o.index)},encode(d,o){Et.encode(d,o.header),n.encode(d,o.oplog),Pc.encode(d,o.displayType),e.uint.encode(d,o.index)},decode:d=>({header:Et.decode(d),oplog:n.decode(d),displayType:Pc.decode(d),index:e.uint.decode(d)})},zt=e.frame(w),Nt=e.frame(it),jt=zt,Ot=e.array(Vc),Ut=e.frame(se),Jt=zt,Gt=Ut,Qt=e.frame(hc),Wt=e.frame(kt),Xt=Ut,Yt=e.frame(fd),Zt=e.frame(yc),$t=e.frame(xr),_t=$t,ei=e.array(e.frame(qc)),di=zt,oi=e.frame(Nn),ni=e.frame(xc),ci=oi,ri=ni,ti=oi,ii=ni,ai=zt,si=e.array(e.frame(at)),pi=si;function ui(e){switch(e){case"@keet/head":return o;case"@keet/oplog-id":return n;case"@keet/encryption-keypair":return c;case"@keet/signing-keypair":return r;case"@keet/room-keys":return t;case"@keet/operation-header":return i;case"@keet/blob-pointer":return a;case"@keet/file-dimensions":return s;case"@keet/file-metadata":return u;case"@keet/external-drive-pointer":return l;case"@keet/external-blob-pointer":return f;case"@keet/file-pointer":return b;case"@keet/file":return v;case"@keet/image-file":return w;case"@keet/file-status":return T;case"@keet/file-record":return S;case"@keet/device-status":return I;case"@keet/member-status":return R;case"@keet/member-moderation-status":return F;case"@keet/abi":return H;case"@keet/device-stats":return M;case"@keet/member-stats":return C;case"@keet/chat-stats":return D;case"@keet/file-stats":return V;case"@keet/stats":return z;case"@keet/room-type":return j;case"@keet/system-settings":return O;case"@keet/system-digest":return G;case"@keet/room-seed":return Q;case"@keet/room-capabilities":return W;case"@keet/room-config":return Y;case"@keet/blind-peer":return Z;case"@keet/add-blind-peer-operation":return ee;case"@keet/remove-blind-peer-operation":return oe;case"@keet/identity-attestation":return ne;case"@keet/device-invitation":return ce;case"@keet/device":return ie;case"@keet/member-profile":return ae;case"@keet/device-profile":return se;case"@keet/member-update":return ue;case"@keet/device-update":return le;case"@keet/signed-pairing-data":return fe;case"@keet/device-request-identity":return me;case"@keet/device-response-identity":return ye;case"@keet/device-request-with-invitation":return ve;case"@keet/device-request-with-invitation-and-proof":return he;case"@keet/device-request-with-member-proof":return Te;case"@keet/device-request":return Se;case"@keet/device-response":return Fe;case"@keet/invitation-metadata":return He;case"@keet/invitation":return De;case"@keet/add-invitation-operation":return qe;case"@keet/remove-invitation-operation":return Be;case"@keet/sendable-room-invitation":return ze;case"@keet/sendable-identity-invitation":return Ne;case"@keet/sendable-contact-invitation":return je;case"@keet/sendable-invitation":return Qe;case"@keet/add-device-operation":return Xe;case"@keet/update-device-operation":return Ze;case"@keet/start-indexing-operation":return $e;case"@keet/stop-indexing-operation":return _e;case"@keet/join-request":return dd;case"@keet/accept-join-request-operation":return cd;case"@keet/reject-join-request-operation":return td;case"@keet/member":return sd;case"@keet/full-member":return ld;case"@keet/member-proofs":return fd;case"@keet/update-member-operation":return bd;case"@keet/change-member-status-operation":return vd;case"@keet/change-member-role-operation":return hd;case"@keet/remove-member-operation":return wd;case"@keet/member-activity":return Td;case"@keet/member-joined-event":return Ad;case"@keet/member-left-event":return Pd;case"@keet/title-changed-chat-event":return Sd;case"@keet/chat-event":return Hd;case"@keet/sendable-event":return Md;case"@keet/display-range":return Cd;case"@keet/display-content-range":return Vd;case"@keet/mention-display-item":return qd;case"@keet/link-preview":return zd;case"@keet/display-link-item":return Od;case"@keet/display":return _d;case"@keet/oplog-message":return co;case"@keet/index-message":return io;case"@keet/full-index-message":return po;case"@keet/message-status":return uo;case"@keet/message-index-id":return lo;case"@keet/thread":return mo;case"@keet/chat-message-record":return ko;case"@keet/full-chat-message-record":return Ko;case"@keet/add-chat-message-operation":return Ao;case"@keet/remove-chat-message-operation":return So;case"@keet/update-chat-message-operation":return Fo;case"@keet/pin-chat-message-operation":return Mo;case"@keet/reaction":return Co;case"@keet/reactions-summary":return Do;case"@keet/reactions-digest":return Lo;case"@keet/add-reaction-operation":return Eo;case"@keet/remove-reaction-operation":return zo;case"@keet/update-room-config-operation":return Oo;case"@keet/group-member":return Uo;case"@keet/user-registry-info":return Jo;case"@keet/room-identity":return Qo;case"@keet/genesis-operation":return dn;case"@keet/upgrade-operation":return nn;case"@keet/update-system-settings-operation":return tn;case"@keet-private-id/contact":return an;case"@keet-private-id/v3-room-migration-info":return sn;case"@keet-private-id/run-v3-migration-operation":return ln;case"@keet-private-id/update-identity-operation":return mn;case"@keet-private-id/counters":return yn;case"@keet-private-id/stats":return bn;case"@keet-private-id/add-entropy-operation":return xn;case"@keet-private-id/pending-invitation-identity":return kn;case"@keet-private-id/pending-invitation":return gn;case"@keet-private-id/resolve-pending-invitation-operation":return Kn;case"@keet-private-id/add-pending-invitation-operation":return An;case"@keet-private-id/remove-pending-invitation-operation":return Sn;case"@keet-private-id/identity-swap":return In;case"@keet-private-id/room-status":return Rn;case"@keet-private-id/room":return Cn;case"@keet-private-id/add-room-operation":return Vn;case"@keet-private-id/remove-room-operation":return qn;case"@keet-private-id/update-room-status-operation":return zn;case"@keet-private-id/contact-status":return Nn;case"@keet-private-id/contact-record":return jn;case"@keet-private-id/add-contact-operation":return Jn;case"@keet-private-id/update-contact-status-operation":return Qn;case"@keet-private-id/remove-contact-operation":return Xn;case"@keet-private-id/contact-request-status":return Yn;case"@keet-private-id/contact-request-body":return _n;case"@keet-private-id/contact-request":return dc;case"@keet-private-id/contact-request-record":return rc;case"@keet-private-id/add-contact-request-operation":return ic;case"@keet-private-id/update-contact-request-status-operation":return pc;case"@keet-private-id/profile-discovery-record-v1":return uc;case"@keet-private-id/profile-discovery-record":return lc;case"@keet/add-file-preview-operation":return mc;case"@keet/member-removed-event":return yc;case"@keet/member-contact-info":return xc;case"@keet/remove-device-operation":return vc;case"@keet/device-identity":return gc;case"@keet/readonly-room-invitation":return hc;case"@keet-private-id/identity-swap-v2":return Kc;case"@keet-private-id/activate-contact-room-operation":return Tc;case"@keet/display-type":return Pc;case"@keet/test-increment-operation":return Ic;case"@keet/test-collection-record-1":return Rc;case"@keet/migrate-abi-operation":return Hc;case"@keet/system-settings-keys":return Cc;case"@keet/room-supported-language":return Vc;case"@keet/translation-display-item":return qc;case"@keet-private-id/unreads":return Ec;case"@keet-private-id/add-unreads-key-operation":return zc;case"@keet-private-id/remove-unreads-key-operation":return jc;case"@keet/label-type":return Uc;case"@keet/chat-label":return Jc;case"@keet/add-chat-label-operation":return Qc;case"@keet/remove-chat-label-operation":return Xc;case"@keet/chat-label-summary":return Yc;case"@keet/chat-label-digest":return $c;case"@keet/update-read-length-operation":return er;case"@keet/read-length":return dr;case"@keet/tmp-removed-member":return or;case"@keet-private-id/settings":return nr;case"@keet-private-id/user-settings-key":return rr;case"@keet-private-id/update-settings-operation":return ar;case"@keet/member-label-type":return pr;case"@keet/member-label":return ur;case"@keet/add-member-label-operation":return fr;case"@keet/member-label-summary":return mr;case"@keet/member-label-digest":return br;case"@keet/location-shared-event":return xr;case"@keet/move-indexer-operation":return vr;case"@keet/start-call":return Kr;case"@keet/join-call":return Ar;case"@keet/leave-call":return Sr;case"@keet/end-call":return Rr;case"@keet/add-call-stream":return Hr;case"@keet/remove-call-stream":return Cr;case"@keet/call-record":return Dr;case"@keet/call-member-record":return Vr;case"@keet/call-device-record":return Lr;case"@keet/call-stream-record":return qr;case"@keet/build-type":return Br;case"@keet/test-crash-operation":return Nr;case"@keet/test-dispatch-error-operation":return Or;case"@keet-private-id/shorten-device-attestation-operation":return Jr;case"@keet/call-device-heartbeat":return Qr;case"@keet/remove-call-device":return Xr;case"@keet/start-call-recording":return Zr;case"@keet/stop-call-recording":return _r;case"@keet/dismiss-chat-reports-operation":return dt;case"@keet/update-typing-indicator-operation":return nt;case"@keet/typing-indicator":return ct;case"@keet-private-id/update-contact-alias-operation":return tt;case"@keet/call-stats":return it;case"@keet/call-stream-input":return at;case"@keet/update-call-stream":return pt;case"@keet/call-stream-status-record":return ut;case"@keet/room-keys-v2":return lt;case"@keet/blob-pointer-v2":return ft;case"@keet/blob":return mt;case"@keet/autobee-migration":return yt;case"@keet/autobee-migration-operation":return xt;case"@keet/readonly-room-invitation-v2":return kt;case"@keet/admin-last-seen":return gt;case"@keet/blob-record":return ht;case"@keet-private-id/room-v2":return At;case"@keet-private-id/add-room-operation-v2":return St;case"@keet-private-id/pending-invitation-response":return It;case"@keet-private-id/resolve-pending-invitation-operation-v2":return Ft;case"@keet/claim-admin-devices-operation":return Mt;case"@keet/remove-file-preview-operation":return Dt;case"@keet/add-link-preview-operation":return qt;case"@keet/remove-link-preview-operation":return Bt;default:throw new Error("Encoder not found "+e)}}function li(e,o=31){const n=ui(e);return{preencode(e,c){d=o,n.preencode(e,c)},encode(e,c){d=o,n.encode(e,c)},decode:e=>(d=o,n.decode(e))}}const fi=li;module.exports={resolveStruct:fi,getStruct:li,getEnum:function(e){switch(e){case"@keet/room-type":return N;case"@keet/display-type":return Ac;case"@keet/system-settings-keys":return Mc;case"@keet/room-supported-language":return Dc;case"@keet/label-type":return Oc;case"@keet-private-id/user-settings-key":return cr;case"@keet/member-label-type":return sr;case"@keet/build-type":return Er;default:throw new Error("Enum not found "+e)}},getEncoding:ui,encode:function(o,n,c=31){return d=c,e.encode(ui(o),n)},decode:function(o,n,c=31){return d=c,e.decode(ui(o),n)},setVersion:function(e){d=e},version:d};