OverviewFilesCommitsIssuesDocsReleasesPeers

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

1 lines · javascript ref:
const{c:e}=require("hyperschema/runtime");let d=41;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>=37&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(c.encryptionKey?1:0)|(c.fastForwardTo?2:0)|(d>=37&&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>=37&&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>=37&&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),l={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)}}},u={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(u),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>=37&&n.bee&&_i.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>=37&&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>=37&&n.bee&&_i.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>=37&&16&n?_i.decode(o):null}}},x=e.frame(b),v=e.frame(l),k={preencode(d,o){x.preencode(d,o.pointer),d.end++,o.metadata&&v.preencode(d,o.metadata),o.preview&&Ca.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&&v.encode(d,o.metadata),o.preview&&Ca.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?v.decode(d):null,preview:2&n?Ca.decode(d):null,hash:4&n?e.fixed32.decode(d):null}}},g=e.frame(k),K=g,h=g,w={preencode(e,d){e.end++,d.small&&g.preencode(e,d.small),d.medium&&K.preencode(e,d.medium),d.large&&h.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&&K.encode(d,o.medium),o.large&&h.encode(d,o.large)},decode(d){const o=e.uint.decode(d);return{small:1&o?g.decode(d):null,medium:2&o?K.decode(d):null,large:4&o?h.decode(d):null}}},P={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))})},T=e.frame(P),R=g,A={preencode(o,c){e.uint.preencode(o,c.id),n.preencode(o,c.oplog),T.preencode(o,c.status),R.preencode(o,c.file),o.end++,d>=22&&c.version&&e.uint.preencode(o,c.version)},encode(o,c){const r=d>=22&&c.version?1:0;e.uint.encode(o,c.id),n.encode(o,c.oplog),T.encode(o,c.status),R.encode(o,c.file),e.uint.encode(o,r),d>=22&&c.version&&e.uint.encode(o,c.version)},decode(o){const c=e.uint.decode(o),r=n.decode(o),t=T.decode(o),i=R.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{id:c,oplog:r,status:t,file:i,version:d>=22&&1&a?e.uint.decode(o):0}}},S={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)}}},I={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>=19&&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>=19&&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>=19&&!!(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)}}},M={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)})},C={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)})},V={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)})},H={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>=24&&n.flagsClock&&e.uint.preencode(o,n.flagsClock)},encode(o,n){const c=d>=24&&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>=24&&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>=24&&1&i?e.uint.decode(o):0}}},D={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(C),q=e.frame(V),j=e.frame(H),E=e.frame(D),B={preencode(e,o){L.preencode(e,o.devices),q.preencode(e,o.members),j.preencode(e,o.chat),E.preencode(e,o.files),e.end++,d>=36&&o.calls&&Va.preencode(e,o.calls)},encode(o,n){const c=d>=36&&n.calls?1:0;L.encode(o,n.devices),q.encode(o,n.members),j.encode(o,n.chat),E.encode(o,n.files),e.uint.encode(o,c),d>=36&&n.calls&&Va.encode(o,n.calls)},decode(o){const n=L.decode(o),c=q.decode(o),r=j.decode(o),t=E.decode(o),i=o.start<o.end?e.uint.decode(o):0;return{devices:n,members:c,chat:r,files:t,calls:d>=36&&1&i?Va.decode(o):null}}},z={Default:1,Broadcast:2,DirectMessage:3},O={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)},N={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>=28&&n.isAttachmentsDisabled?64:0)|(d>=28&&n.isLinksDisabled?128:0)|(d>=29&&n.buildType?256:0)|(d>=33&&n.isRoomInviteHidden?512:0);e.uint.preencode(o,c),n.roomType&&O.preencode(o,n.roomType),d>=29&&n.buildType&&xi.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>=28&&n.isAttachmentsDisabled?64:0)|(d>=28&&n.isLinksDisabled?128:0)|(d>=29&&n.buildType?256:0)|(d>=33&&n.isRoomInviteHidden?512:0);e.uint.encode(o,c),n.roomType&&O.encode(o,n.roomType),d>=29&&n.buildType&&xi.encode(o,n.buildType)},decode(o){const n=e.uint.decode(o);return{roomType:1&n?O.decode(o):0,isExperimental:!!(2&n),isJoiningDisabled:!!(4&n),isAppendingDisabled:!!(8&n),isCallingDisabled:!!(16&n),isMembershipEventsDisabled:!!(32&n),isAttachmentsDisabled:d>=28&&!!(64&n),isLinksDisabled:d>=28&&!!(128&n),buildType:d>=29&&256&n?xi.decode(o):null,isRoomInviteHidden:d>=33&&!!(512&n)}}},U=e.frame(M),J=e.frame(N),W={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)})},G={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)})},Q={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&&Ha.preencode(o,n.avatar),n.description&&e.string.preencode(o,n.description),d>=17&&n.supportedLanguages&&Da.preencode(o,n.supportedLanguages),d>=19&&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>=17&&n.supportedLanguages?8:0)|(d>=19&&n.blindPeers?16:0);e.uint.encode(o,c),n.title&&e.string.encode(o,n.title),n.avatar&&Ha.encode(o,n.avatar),n.description&&e.string.encode(o,n.description),d>=17&&n.supportedLanguages&&Da.encode(o,n.supportedLanguages),d>=19&&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?Ha.decode(o):null,description:4&n?e.string.decode(o):null,supportedLanguages:d>=17&&8&n?Da.decode(o):null,blindPeers:d>=19&&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(S),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),La.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),La.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:La.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&&qa.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&&qa.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?qa.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>=29&&n.buildType&&xi.preencode(o,n.buildType)},encode(o,n){const c=(n.swarmKey?1:0)|(n.name?2:0)|(n.isMobile?4:0)|(d>=29&&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>=29&&n.buildType&&xi.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>=29&&8&n?xi.decode(o):null}}},pe=e.frame(ae),le={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)})},ue={preencode(e,d){ja.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){ja.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:ja.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(ue),xe=e.frame(le),ve=e.frame(me),ke={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&&ve.preencode(n,c.identity),d>=37&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=37&&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&&ve.encode(n,c.identity),d>=37&&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?ve.decode(n):null,link:d>=37&&2&s?o.decode(n):null}}},ge=e.frame(ke),Ke={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)})},he=be,we=xe,Pe={preencode(e,d){he.preencode(e,d.device),e.end++,d.member&&we.preencode(e,d.member)},encode(d,o){const n=o.member?1:0;he.encode(d,o.device),e.uint.encode(d,n),o.member&&we.encode(d,o.member)},decode:d=>({device:he.decode(d),member:1&e.uint.decode(d)?we.decode(d):null})},Te=e.frame(Ke),Re=e.frame(Pe),Ae={preencode(e,d){e.end++,d.withInvitation&&Te.preencode(e,d.withInvitation),d.withMemberProof&&Re.preencode(e,d.withMemberProof)},encode(d,o){const n=(o.withInvitation?1:0)|(o.withMemberProof?2:0);e.uint.encode(d,n),o.withInvitation&&Te.encode(d,o.withInvitation),o.withMemberProof&&Re.encode(d,o.withMemberProof)},decode(d){const o=e.uint.decode(d);return{withInvitation:1&o?Te.decode(d):null,withMemberProof:2&o?Re.decode(d):null}}},Se=e.frame(fe),Ie=e.frame(ye),Fe={preencode(e,d){Se.preencode(e,d.signedKeys),e.end++,d.identity&&Ie.preencode(e,d.identity)},encode(d,o){const n=o.identity?1:0;Se.encode(d,o.signedKeys),e.uint.encode(d,n),o.identity&&Ie.encode(d,o.identity)},decode:d=>({signedKeys:Se.decode(d),identity:1&e.uint.decode(d)?Ie.decode(d):null})},Me={preencode(o,n){o.end++,n.expiration&&e.uint.preencode(o,n.expiration),d>=29&&n.buildType&&xi.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>=29&&n.buildType?16:0);e.uint.encode(o,c),n.expiration&&e.uint.encode(o,n.expiration),d>=29&&n.buildType&&xi.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>=29&&16&n?xi.decode(o):null}}},Ce=Se,Ve=e.frame(Me),He={preencode(d,n){e.fixed32.preencode(d,n.id),Ce.preencode(d,n.response),Ve.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),Ce.encode(d,n.response),Ve.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=Ce.decode(d),r=Ve.decode(d),t=e.uint.decode(d);return{id:n,response:c,metadata:r,anchor:1&t?o.decode(d):null,isActive:!!(2&t)}}},De=$,Le=e.frame(He),qe={preencode(e,d){De.preencode(e,d.header),Le.preencode(e,d.invitation)},encode(e,d){De.encode(e,d.header),Le.encode(e,d.invitation)},decode:e=>({header:De.decode(e),invitation:Le.decode(e)})},je=$,Ee={preencode(d,o){je.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){je.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:je.decode(d),id:e.fixed32.decode(d)})},Be={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)})},ze={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)})},Oe={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)})},Ne=e.frame(Be),Ue=e.frame(ze),Je=e.frame(Oe),We=e.array(e.ipv4Address),Ge={preencode(e,o){e.end++,o.room&&Ne.preencode(e,o.room),o.identity&&Ue.preencode(e,o.identity),o.contact&&Je.preencode(e,o.contact),d>=9&&o.readonly&&Ea.preencode(e,o.readonly),d>=17&&o.additionalNodes&&We.preencode(e,o.additionalNodes),d>=29&&o.buildType&&xi.preencode(e,o.buildType),d>=37&&o["readonly-v2"]&&Ba.preencode(e,o["readonly-v2"])},encode(o,n){const c=(n.room?1:0)|(n.identity?2:0)|(n.contact?4:0)|(d>=9&&n.readonly?8:0)|(d>=17&&n.additionalNodes?16:0)|(d>=29&&n.buildType?32:0)|(d>=37&&n["readonly-v2"]?64:0);e.uint.encode(o,c),n.room&&Ne.encode(o,n.room),n.identity&&Ue.encode(o,n.identity),n.contact&&Je.encode(o,n.contact),d>=9&&n.readonly&&Ea.encode(o,n.readonly),d>=17&&n.additionalNodes&&We.encode(o,n.additionalNodes),d>=29&&n.buildType&&xi.encode(o,n.buildType),d>=37&&n["readonly-v2"]&&Ba.encode(o,n["readonly-v2"])},decode(o){const n=e.uint.decode(o);return{room:1&n?Ne.decode(o):null,identity:2&n?Ue.decode(o):null,contact:4&n?Je.decode(o):null,readonly:d>=9&&8&n?Ea.decode(o):null,additionalNodes:d>=17&&16&n?We.decode(o):null,buildType:d>=29&&32&n?xi.decode(o):null,"readonly-v2":d>=37&&64&n?Ba.decode(o):null}}},Qe=$,Xe={preencode(d,o){Qe.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){Qe.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:Qe.decode(d),blindRequest:e.buffer.decode(d)})},Ye=$,Ze={preencode(o,n){Ye.preencode(o,n.header),o.end++,n.profile&&za.preencode(o,n.profile),d>=34&&n.key&&e.fixed32.preencode(o,n.key)},encode(o,n){const c=(n.profile?1:0)|(d>=34&&n.key?2:0);Ye.encode(o,n.header),e.uint.encode(o,c),n.profile&&za.encode(o,n.profile),d>=34&&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?za.decode(o):null,key:d>=34&&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=Ie,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(I),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,ld=pe,ud={preencode(d,o){e.fixed32.preencode(d,o.key),pd.preencode(d,o.status),ld.preencode(d,o.profile),d.end++,o.proofs&&Oa.preencode(d,o.proofs)},encode(d,o){const n=o.proofs?1:0;e.fixed32.encode(d,o.key),pd.encode(d,o.status),ld.encode(d,o.profile),e.uint.encode(d,n),o.proofs&&Oa.encode(d,o.proofs)},decode:d=>({key:e.fixed32.decode(d),status:pd.decode(d),profile:ld.decode(d),proofs:1&e.uint.decode(d)?Oa.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=$,vd=e.frame(F),kd={preencode(d,o){xd.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),vd.preencode(d,o.status)},encode(d,o){xd.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),vd.encode(d,o.status)},decode:d=>({header:xd.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:vd.decode(d)})},gd=$,Kd={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)}}},hd=$,wd={preencode(d,o){hd.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){hd.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:hd.decode(d),key:e.fixed32.decode(d)})},Pd={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)})},Td={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})},Rd=Td,Ad={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}}},Sd=e.frame(Td),Id=e.frame(Rd),Fd=e.frame(Ad),Md={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>=4&&n.roomAvatarChanged?64:0)|(d>=4&&n.invitationCreated?128:0)|(d>=4&&n.memberRemoved?256:0)|(d>=27&&n.locationShared?512:0);e.uint.preencode(o,c),n.memberJoined&&Sd.preencode(o,n.memberJoined),n.memberLeft&&Id.preencode(o,n.memberLeft),n.titleChanged&&Fd.preencode(o,n.titleChanged),d>=4&&n.memberRemoved&&Na.preencode(o,n.memberRemoved),d>=27&&n.locationShared&&Ua.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>=4&&n.roomAvatarChanged?64:0)|(d>=4&&n.invitationCreated?128:0)|(d>=4&&n.memberRemoved?256:0)|(d>=27&&n.locationShared?512:0);e.uint.encode(o,c),n.memberJoined&&Sd.encode(o,n.memberJoined),n.memberLeft&&Id.encode(o,n.memberLeft),n.titleChanged&&Fd.encode(o,n.titleChanged),d>=4&&n.memberRemoved&&Na.encode(o,n.memberRemoved),d>=27&&n.locationShared&&Ua.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{memberJoined:1&n?Sd.decode(o):null,memberLeft:2&n?Id.decode(o):null,titleChanged:4&n?Fd.decode(o):null,callStarted:!!(8&n),callHangup:!!(16&n),callMissed:!!(32&n),roomAvatarChanged:d>=4&&!!(64&n),invitationCreated:d>=4&&!!(128&n),memberRemoved:d>=4&&256&n?Na.decode(o):null,locationShared:d>=27&&512&n?Ua.decode(o):null}}},Cd={preencode(e,o){e.end++,d>=27&&o.locationShared&&Ja.preencode(e,o.locationShared)},encode(o,n){const c=(n.callStarted?1:0)|(n.callHangup?2:0)|(n.callMissed?4:0)|(d>=27&&n.locationShared?8:0);e.uint.encode(o,c),d>=27&&n.locationShared&&Ja.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{callStarted:!!(1&n),callHangup:!!(2&n),callMissed:!!(4&n),locationShared:d>=27&&8&n?Ja.decode(o):null}}},Vd={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)})},Hd=e.frame(Vd),Dd={preencode(d,o){Hd.preencode(d,o.range),e.string.preencode(d,o.content)},encode(d,o){Hd.encode(d,o.range),e.string.encode(d,o.content)},decode:d=>({range:Hd.decode(d),content:e.string.decode(d)})},Ld=Hd,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)})},jd=g,Ed=e.array(e.uint),Bd={preencode(o,n){o.end++,n.title&&e.string.preencode(o,n.title),n.description&&e.string.preencode(o,n.description),n.file&&jd.preencode(o,n.file),d>=12&&n.files&&Ed.preencode(o,n.files)},encode(o,n){const c=(n.title?1:0)|(n.description?2:0)|(n.file?4:0)|(d>=12&&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&&jd.encode(o,n.file),d>=12&&n.files&&Ed.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?jd.decode(o):null,files:d>=12&&8&n?Ed.decode(o):null}}},zd=Hd,Od=e.frame(Bd),Nd={preencode(d,o){zd.preencode(d,o.range),e.string.preencode(d,o.url),d.end++,o.preview&&Od.preencode(d,o.preview)},encode(d,o){const n=o.preview?1:0;zd.encode(d,o.range),e.string.encode(d,o.url),e.uint.encode(d,n),o.preview&&Od.encode(d,o.preview)},decode:d=>({range:zd.decode(d),url:e.string.decode(d),preview:1&e.uint.decode(d)?Od.decode(d):null})},Ud=e.array(e.frame(qd)),Jd=e.array(e.frame(Nd)),Wd=Jd,Gd=e.array(e.frame(Vd)),Qd=Gd,Xd=Gd,Yd=e.array(e.frame(Dd)),Zd=Gd,$d=Gd,_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>=17&&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&&Wd.preencode(o,n.pearLink),n.bold&&Gd.preencode(o,n.bold),n.italic&&Qd.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>=17&&n.translation&&Wa.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>=17&&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&&Wd.encode(o,n.pearLink),n.bold&&Gd.encode(o,n.bold),n.italic&&Qd.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>=17&&n.translation&&Wa.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?Wd.decode(o):null,bold:8&n?Gd.decode(o):null,italic:16&n?Qd.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>=17&&512&n?Wa.decode(o):null}}},eo=e.array(e.frame(k)),oo=e.frame(_d),no=e.frame(Cd),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>=27&&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>=27&&!!(64&c)}}},ro=Ed,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>=27&&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>=27&&!!(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>=27&&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>=27&&!!(32&c)}}},lo={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)}}},uo={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(B),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(lo),bo=e.frame(io),xo=e.frame(Md),vo={preencode(d,o){uo.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);uo.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=uo.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}}},ko=yo,go=e.frame(po),Ko=xo,ho={preencode(d,o){uo.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),ko.preencode(d,o.status),o.message&&go.preencode(d,o.message),o.event&&Ko.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);uo.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),ko.encode(d,o.status),o.message&&go.encode(d,o.message),o.event&&Ko.encode(d,o.event)},decode(d){const o=uo.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:ko.decode(d),message:2&i?go.decode(d):null,event:4&i?Ko.decode(d):null}}},wo=$,Po=e.frame(co),To={preencode(e,d){wo.preencode(e,d.header),Po.preencode(e,d.message)},encode(e,d){wo.encode(e,d.header),Po.encode(e,d.message)},decode:e=>({header:wo.decode(e),message:Po.decode(e)})},Ro=$,Ao={preencode(e,d){Ro.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){Ro.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:Ro.decode(e),oplog:n.decode(e)})},So=$,Io=Po,Fo={preencode(e,d){So.preencode(e,d.header),n.preencode(e,d.oplog),Io.preencode(e,d.message)},encode(e,d){So.encode(e,d.header),n.encode(e,d.oplog),Io.encode(e,d.message)},decode:e=>({header:So.decode(e),oplog:n.decode(e),message:Io.decode(e)})},Mo=$,Co={preencode(e,d){Mo.preencode(e,d.header),n.preencode(e,d.oplog),e.end++},encode(d,o){const c=o.isPinned?1:0;Mo.encode(d,o.header),n.encode(d,o.oplog),e.uint.encode(d,c)},decode:d=>({header:Mo.decode(d),oplog:n.decode(d),isPinned:!!(1&e.uint.decode(d))})},Vo={preencode(d,o){uo.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){uo.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:uo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),reaction:e.string.decode(d)})},Ho={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)})},Do=e.array(e.frame(Ho)),Lo={preencode(o,n){uo.preencode(o,n.id),e.uint.preencode(o,n.total),Do.preencode(o,n.reactions),o.end++,d>=17&&n.editedAt&&e.uint.preencode(o,n.editedAt)},encode(o,n){const c=d>=17&&n.editedAt?1:0;uo.encode(o,n.id),e.uint.encode(o,n.total),Do.encode(o,n.reactions),e.uint.encode(o,c),d>=17&&n.editedAt&&e.uint.encode(o,n.editedAt)},decode(o){const n=uo.decode(o),c=e.uint.decode(o),r=Do.decode(o),t=o.start<o.end?e.uint.decode(o):0;return{id:n,total:c,reactions:r,editedAt:d>=17&&1&t?e.uint.decode(o):0}}},qo=$,jo={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)})},Eo=$,Bo={preencode(d,o){Eo.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){Eo.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:Eo.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},zo=$,Oo=e.frame(Y),No={preencode(d,o){zo.preencode(d,o.header),e.uint.preencode(d,o.key),Oo.preencode(d,o.config)},encode(d,o){zo.encode(d,o.header),e.uint.encode(d,o.key),Oo.encode(d,o.config)},decode:d=>({header:zo.decode(d),key:e.uint.decode(d),config:Oo.decode(d)})},Uo={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.string.preencode(d,o.displayName),d.end++,o.avatar&&Ga.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&&Ga.encode(d,o.avatar)},decode:d=>({memberKey:e.fixed32.decode(d),displayName:e.string.decode(d),avatar:1&e.uint.decode(d)?Ga.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})},Wo=e.frame(Jo),Go={preencode(d,o){e.fixed32.preencode(d,o.publicKey),d.end++,o.discoveryCoreKey&&e.fixed32.preencode(d,o.discoveryCoreKey),o.userRegistry&&Wo.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&&Wo.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?Wo.decode(d):null}}},Qo=$,Xo=e.frame(W),Yo=e.frame(G),Zo=Oo,$o=e.frame(Go),_o=be,en=e.array(e.frame(le)),dn={preencode(e,d){Qo.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);Qo.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=Qo.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),Qa.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=32&&n.contactInfo&&Xa.preencode(o,n.contactInfo),d>=32&&n.version&&e.uint.preencode(o,n.version),d>=34&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=32&&n.contactInfo?4:0)|(d>=32&&n.version?8:0)|(d>=34&&n.alias?16:0);e.fixed32.encode(o,n.memberKey),Qa.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>=32&&n.contactInfo&&Xa.encode(o,n.contactInfo),d>=32&&n.version&&e.uint.encode(o,n.version),d>=34&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=Qa.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>=32&&4&r?Xa.decode(o):null,version:d>=32&&8&r?e.uint.decode(o):0,alias:d>=34&&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)),ln=X,un={preencode(e,d){pn.preencode(e,d.sharedRooms),ln.preencode(e,d.blockedContacts)},encode(e,d){pn.encode(e,d.sharedRooms),ln.encode(e,d.blockedContacts)},decode:e=>({sharedRooms:pn.decode(e),blockedContacts:ln.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)})},vn={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)})},kn=e.frame(vn),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&&kn.preencode(n,c.identity),d>=29&&c.buildType&&xi.preencode(n,c.buildType),d>=37&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=29&&c.buildType?2:0)|(d>=37&&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&&kn.encode(n,c.identity),d>=29&&c.buildType&&xi.encode(n,c.buildType),d>=37&&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),l=e.uint.decode(n);return{id:c,invitationSeed:t,mailbox:i,responseKeyPair:a,initiator:s,inviter:p,identity:1&l?kn.decode(n):null,buildType:d>=29&&2&l?xi.decode(n):null,link:d>=37&&4&l?o.decode(n):null}}},Kn=$,hn={preencode(d,o){Kn.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){Kn.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:Kn.decode(d),blindResponse:e.buffer.decode(d)})},wn=$,Pn=e.frame(gn),Tn={preencode(e,d){wn.preencode(e,d.header),Pn.preencode(e,d.invitation)},encode(e,d){wn.encode(e,d.header),Pn.encode(e,d.invitation)},decode:e=>({header:wn.decode(e),invitation:Pn.decode(e)})},Rn=$,An={preencode(d,o){Rn.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Rn.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Rn.decode(d),id:e.fixed32.decode(d)})},Sn={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)}}},In={preencode(o,n){o.end++,d>=35&&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>=14&&n.isReadOnly?8:0)|(d>=27&&n.isFavorite?16:0)|(d>=31&&n.isUnread?32:0)|(d>=35&&n.roomSnoozeTime?64:0);e.uint.encode(o,c),d>=35&&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>=14&&!!(8&n),isFavorite:d>=27&&!!(16&n),isUnread:d>=31&&!!(32&n),roomSnoozeTime:d>=35&&64&n?e.uint.decode(o):0}}},Fn=e.frame(In),Mn=e.frame(Sn),Cn=kn,Vn={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&&Mn.preencode(n,c.identitySwap),d>=9&&c.identitySwapV2&&Cn.preencode(n,c.identitySwapV2),d>=15&&c.contact&&e.fixed32.preencode(n,c.contact),d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=39&&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>=9&&c.identitySwapV2?8:0)|(d>=15&&c.contact?16:0)|(d>=37&&c.bootFrom?32:0)|(d>=39&&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&&Mn.encode(n,c.identitySwap),d>=9&&c.identitySwapV2&&Cn.encode(n,c.identitySwapV2),d>=15&&c.contact&&e.fixed32.encode(n,c.contact),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=39&&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?Mn.decode(n):null,identitySwapV2:d>=9&&8&s?Cn.decode(n):null,contact:d>=15&&16&s?e.fixed32.decode(n):null,bootFrom:d>=37&&32&s?o.decode(n):null,activeClock:d>=39&&64&s?e.uint.decode(n):0}}},Hn=$,Dn={preencode(d,n){Hn.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>=14&&c.isReadOnly?8:0);Hn.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=Hn.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>=14&&!!(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)})},jn=$,En=Fn,Bn={preencode(d,o){jn.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),En.preencode(d,o.status)},encode(d,o){jn.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),En.encode(d,o.status)},decode:d=>({header:jn.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),status:En.decode(d)})},zn={preencode(e,d){e.end++},encode(o,n){const c=(n.isBlocked?1:0)|(d>=32&&n.isActive?2:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isBlocked:!!(1&n),isActive:d>=32&&!!(2&n)}}},On={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),Ya.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=32&&n.contactInfo&&Za.preencode(o,n.contactInfo),d>=34&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=32&&n.contactInfo?4:0)|(d>=34&&n.alias?8:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),Ya.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>=32&&n.contactInfo&&Za.encode(o,n.contactInfo),d>=34&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=Ya.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>=32&&4&t?Za.decode(o):null,alias:d>=34&&8&t?e.string.decode(o):null}}},Nn=$,Un=e.frame(an),Jn={preencode(e,d){Nn.preencode(e,d.header),Un.preencode(e,d.contact)},encode(e,d){Nn.encode(e,d.header),Un.encode(e,d.contact)},decode:e=>({header:Nn.decode(e),contact:Un.decode(e)})},Wn=$,Gn={preencode(d,o){Wn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),$a.preencode(d,o.status)},encode(d,o){Wn.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),$a.encode(d,o.status)},decode:d=>({header:Wn.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:$a.decode(d)})},Qn=$,Xn={preencode(d,o){Qn.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Qn.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:Qn.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>=41&&n.recipientProof&&e.buffer.preencode(o,n.recipientProof)},encode(o,n){const c=d>=41&&n.recipientProof?1:0;ec.encode(o,n.body),ne.encode(o,n.attestation),e.uint.encode(o,c),d>=41&&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>=41&&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>=17&&n.sentAt&&e.uint.preencode(o,n.sentAt),d>=32&&n.contactInfo&&_a.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=17&&n.sentAt?2:0)|(d>=32&&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>=17&&n.sentAt&&e.uint.encode(o,n.sentAt),d>=32&&n.contactInfo&&_a.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>=17&&2&s?e.uint.decode(o):0,contactInfo:d>=32&&4&s?_a.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>=15&&n.roomKey&&e.fixed32.preencode(o,n.roomKey)},encode(o,n){const c=d>=15&&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>=15&&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>=15&&1&i?e.fixed32.decode(o):null}}},lc={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)})},uc={preencode(d,o){const n=o.version??1;switch(e.uint.preencode(d,n),n){case 0:case 1:lc.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:lc.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=lc.decode(d);return e.version=o,e}default:throw new Error("Unsupported version")}}},fc={preencode(d,o){e.fixed32.preencode(d,o.discoveryPublicKey),e.uint.preencode(d,o.timestamp),d.end++,o.lastSynced&&e.uint.preencode(d,o.lastSynced)},encode(d,o){const n=(o.lastSynced?1:0)|(o.dirty?2:0);e.fixed32.encode(d,o.discoveryPublicKey),e.uint.encode(d,o.timestamp),e.uint.encode(d,n),o.lastSynced&&e.uint.encode(d,o.lastSynced)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d),c=e.uint.decode(d);return{discoveryPublicKey:o,timestamp:n,lastSynced:1&c?e.uint.decode(d):0,dirty:!!(2&c)}}},mc={preencode(d,o){e.uint.preencode(d,o.rooms),e.uint.preencode(d,o.activeRooms)},encode(d,o){e.uint.encode(d,o.rooms),e.uint.encode(d,o.activeRooms)},decode:d=>({rooms:e.uint.decode(d),activeRooms:e.uint.decode(d)})},yc=M,bc=X,xc={preencode(e,d){e.end++,d.blockedMembers&&bc.preencode(e,d.blockedMembers)},encode(d,o){const n=o.blockedMembers?1:0;e.uint.encode(d,n),o.blockedMembers&&bc.encode(d,o.blockedMembers)},decode:d=>({blockedMembers:1&e.uint.decode(d)?bc.decode(d):null})},vc=e.frame(Q),kc=e.frame(xc),gc={preencode(d,n){e.buffer.preencode(d,n.encryptionKey),e.fixed32.preencode(d,n.seed),vc.preencode(d,n.capabilities),o.preencode(d,n.initiator),e.fixed32.preencode(d,n.fastForwardTo),d.end++,n.privateProfile&&kc.preencode(d,n.privateProfile)},encode(d,n){const c=n.privateProfile?1:0;e.buffer.encode(d,n.encryptionKey),e.fixed32.encode(d,n.seed),vc.encode(d,n.capabilities),o.encode(d,n.initiator),e.fixed32.encode(d,n.fastForwardTo),e.uint.encode(d,c),n.privateProfile&&kc.encode(d,n.privateProfile)},decode:d=>({encryptionKey:e.buffer.decode(d),seed:e.fixed32.decode(d),capabilities:vc.decode(d),initiator:o.decode(d),fastForwardTo:e.fixed32.decode(d),privateProfile:1&e.uint.decode(d)?kc.decode(d):null})},Kc={preencode(d,o){d.end++,o.count&&e.uint.preencode(d,o.count)},encode(d,o){const n=o.count?1:0;e.uint.encode(d,n),o.count&&e.uint.encode(d,o.count)},decode:d=>({count:1&e.uint.decode(d)?e.uint.decode(d):0})},hc=e.frame(gc),wc={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.uint.preencode(o,n.priority),o.end++,n.v3&&hc.preencode(o,n.v3),d>=5&&n.timestamp&&e.uint.preencode(o,n.timestamp)},encode(o,n){const c=(n.v3?1:0)|(d>=3&&n.errored?2:0)|(d>=5&&n.timestamp?4:0);e.fixed32.encode(o,n.roomKey),e.uint.encode(o,n.priority),e.uint.encode(o,c),n.v3&&hc.encode(o,n.v3),d>=5&&n.timestamp&&e.uint.encode(o,n.timestamp)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=e.uint.decode(o);return{roomKey:n,priority:c,v3:1&r?hc.decode(o):null,errored:d>=3&&!!(2&r),timestamp:d>=5&&4&r?e.uint.decode(o):0}}},Pc={preencode(e,d){e.end++},encode(d,o){const n=o.isConfirmed?1:0;e.uint.encode(d,n)},decode:d=>({isConfirmed:!!(1&e.uint.decode(d))})},Tc=e.frame(Pc),Rc=Mn,Ac={preencode(o,n){e.fixed32.preencode(o,n.publicKey),e.fixed32.preencode(o,n.privateProfileKey),r.preencode(o,n.deviceKeyPair),e.buffer.preencode(o,n.deviceProof),Tc.preencode(o,n.status),o.end++,n.entropy&&e.buffer.preencode(o,n.entropy),n.swap&&Rc.preencode(o,n.swap),d>=9&&n.swapV2&&es.preencode(o,n.swapV2),d>=31&&n.proofShortenedAt&&e.uint.preencode(o,n.proofShortenedAt)},encode(o,n){const c=(n.entropy?1:0)|(n.swap?2:0)|(d>=9&&n.swapV2?4:0)|(d>=31&&n.proofShortenedAt?8:0);e.fixed32.encode(o,n.publicKey),e.fixed32.encode(o,n.privateProfileKey),r.encode(o,n.deviceKeyPair),e.buffer.encode(o,n.deviceProof),Tc.encode(o,n.status),e.uint.encode(o,c),n.entropy&&e.buffer.encode(o,n.entropy),n.swap&&Rc.encode(o,n.swap),d>=9&&n.swapV2&&es.encode(o,n.swapV2),d>=31&&n.proofShortenedAt&&e.uint.encode(o,n.proofShortenedAt)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=r.decode(o),i=e.buffer.decode(o),a=Tc.decode(o),s=e.uint.decode(o);return{publicKey:n,privateProfileKey:c,deviceKeyPair:t,deviceProof:i,status:a,entropy:1&s?e.buffer.decode(o):null,swap:2&s?Rc.decode(o):null,swapV2:d>=9&&4&s?es.decode(o):null,proofShortenedAt:d>=31&&8&s?e.uint.decode(o):0}}},Sc={RestoreIdentity:1,CreateRoom:2,LeaveRoom:3,ClearRoom:4,JoinRoomInvitation:5,JoinRoomKeys:6,JoinRoomResponse:7,SendContactRequest:8,TestFastTask:9,TestSlowTask:10,TestErrorTask:11},Ic={preencode(e,d){e.end++},encode(d,o){if(o>11)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},Fc={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator)},encode(d,n){const c=(n.fastForwardTo?1:0)|(n.initiator?2:0);e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.uint.encode(d,c),n.fastForwardTo&&e.fixed32.encode(d,n.fastForwardTo),n.initiator&&o.encode(d,n.initiator)},decode(d){const n=e.fixed32.decode(d),c=e.buffer.decode(d),r=e.uint.decode(d);return{roomKey:n,encryptionKey:c,fastForwardTo:1&r?e.fixed32.decode(d):null,initiator:2&r?o.decode(d):null}}},Mc=Pn,Cc={preencode(e,d){Mc.preencode(e,d.invitation)},encode(e,d){Mc.encode(e,d.invitation)},decode:e=>({invitation:Mc.decode(e)})},Vc={preencode(d,o){e.fixed32.preencode(d,o.mailbox),r.preencode(d,o.keyPair),e.buffer.preencode(d,o.response)},encode(d,o){e.fixed32.encode(d,o.mailbox),r.encode(d,o.keyPair),e.buffer.encode(d,o.response)},decode:d=>({mailbox:e.fixed32.decode(d),keyPair:r.decode(d),response:e.buffer.decode(d)})},Hc=Z,Dc={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator),n.mailbox&&e.fixed32.preencode(d,n.mailbox)},encode(d,n){const c=(n.fastForwardTo?1:0)|(n.initiator?2:0)|(n.mailbox?4:0);e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.uint.encode(d,c),n.fastForwardTo&&e.fixed32.encode(d,n.fastForwardTo),n.initiator&&o.encode(d,n.initiator),n.mailbox&&e.fixed32.encode(d,n.mailbox)},decode(d){const n=e.fixed32.decode(d),c=e.buffer.decode(d),r=e.uint.decode(d);return{roomKey:n,encryptionKey:c,fastForwardTo:1&r?e.fixed32.decode(d):null,initiator:2&r?o.decode(d):null,mailbox:4&r?e.fixed32.decode(d):null}}},Lc=e.frame(Dc),qc={preencode(o,n){Lc.preencode(o,n.keys),o.end++,d>=39&&n.activeClock&&e.uint.preencode(o,n.activeClock)},encode(o,n){const c=(d>=39&&n.activeClock?1:0)|(d>=39&&n.isReadOnly?2:0);Lc.encode(o,n.keys),e.uint.encode(o,c),d>=39&&n.activeClock&&e.uint.encode(o,n.activeClock)},decode(o){const n=Lc.decode(o),c=o.start<o.end?e.uint.decode(o):0;return{keys:n,activeClock:d>=39&&1&c?e.uint.decode(o):0,isReadOnly:d>=39&&!!(2&c)}}},jc=e.frame(dn),Ec={preencode(d,n){e.fixed32.preencode(d,n.roomKey),e.buffer.preencode(d,n.encryptionKey),d.end++,n.fastForwardTo&&e.fixed32.preencode(d,n.fastForwardTo),n.initiator&&o.preencode(d,n.initiator),n.mailbox&&e.fixed32.preencode(d,n.mailbox),n.keyPair&&r.preencode(d,n.keyPair),n.genesis&&jc.preencode(d,n.genesis)},encode(d,n){const c=(n.fastForwardTo?1:0)|(n.initiator?2:0)|(n.mailbox?4:0)|(n.keyPair?8:0)|(n.genesis?16:0)|(n.isPrivateProfile?32:0);e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.uint.encode(d,c),n.fastForwardTo&&e.fixed32.encode(d,n.fastForwardTo),n.initiator&&o.encode(d,n.initiator),n.mailbox&&e.fixed32.encode(d,n.mailbox),n.keyPair&&r.encode(d,n.keyPair),n.genesis&&jc.encode(d,n.genesis)},decode(d){const n=e.fixed32.decode(d),c=e.buffer.decode(d),t=e.uint.decode(d);return{roomKey:n,encryptionKey:c,fastForwardTo:1&t?e.fixed32.decode(d):null,initiator:2&t?o.decode(d):null,mailbox:4&t?e.fixed32.decode(d):null,keyPair:8&t?r.decode(d):null,genesis:16&t?jc.decode(d):null,isPrivateProfile:!!(32&t)}}},Bc={preencode(d,o){e.fixed32.preencode(d,o.roomKey),d.end++},encode(d,o){const n=o.isGossiped?1:0;e.fixed32.encode(d,o.roomKey),e.uint.encode(d,n)},decode:d=>({roomKey:e.fixed32.decode(d),isGossiped:!!(1&e.uint.decode(d))})},zc={preencode(d,o){e.fixed32.preencode(d,o.roomKey)},encode(d,o){e.fixed32.encode(d,o.roomKey)},decode:d=>({roomKey:e.fixed32.decode(d)})},Oc={preencode(d,o){e.string.preencode(d,o.mnemonic),d.end++,o.profileDiscoveryTimeout&&e.uint.preencode(d,o.profileDiscoveryTimeout)},encode(d,o){const n=(o.profileDiscoveryTimeout?1:0)|(o.recover?2:0);e.string.encode(d,o.mnemonic),e.uint.encode(d,n),o.profileDiscoveryTimeout&&e.uint.encode(d,o.profileDiscoveryTimeout)},decode(d){const o=e.string.decode(d),n=e.uint.decode(d);return{mnemonic:o,profileDiscoveryTimeout:1&n?e.uint.decode(d):0,recover:!!(2&n)}}},Nc={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.memberKey),o.end++,n.message&&e.string.preencode(o,n.message),d>=6&&n.contactInfo&&ds.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(d>=6&&n.contactInfo?2:0);e.fixed32.encode(o,n.roomKey),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,c),n.message&&e.string.encode(o,n.message),d>=6&&n.contactInfo&&ds.encode(o,n.contactInfo)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{roomKey:n,memberKey:c,message:1&r?e.string.decode(o):null,contactInfo:d>=6&&2&r?ds.decode(o):null}}},Uc={preencode(d,o){e.fixed32.preencode(d,o.key),d.end++},encode(d,o){const n=o.isPrivateProfile?1:0;e.fixed32.encode(d,o.key),e.uint.encode(d,n)},decode:d=>({key:e.fixed32.decode(d),isPrivateProfile:!!(1&e.uint.decode(d))})},Jc=e.frame(Oc),Wc=e.frame(Ec),Gc=e.frame(Bc),Qc=e.frame(zc),Xc=e.frame(Cc),Yc=e.frame(qc),Zc=e.frame(Vc),$c=e.frame(Nc),_c=e.frame(Uc),er={preencode(d,o){const n=(o.restoreIdentity?1:0)|(o.createRoom?2:0)|(o.leaveRoom?4:0)|(o.clearRoom?8:0)|(o.joinRoomInvitation?16:0)|(o.joinRoomKeys?32:0)|(o.joinRoomResponse?64:0)|(o.sendContactRequest?128:0)|(o.migrateV2Room?256:0);e.fixed32.preencode(d,o.discoveryKey),e.uint.preencode(d,o.priority),e.uint.preencode(d,o.timestamp),e.uint.preencode(d,o.type),e.uint.preencode(d,n),o.restoreIdentity&&Jc.preencode(d,o.restoreIdentity),o.createRoom&&Wc.preencode(d,o.createRoom),o.leaveRoom&&Gc.preencode(d,o.leaveRoom),o.clearRoom&&Qc.preencode(d,o.clearRoom),o.joinRoomInvitation&&Xc.preencode(d,o.joinRoomInvitation),o.joinRoomKeys&&Yc.preencode(d,o.joinRoomKeys),o.joinRoomResponse&&Zc.preencode(d,o.joinRoomResponse),o.sendContactRequest&&$c.preencode(d,o.sendContactRequest),o.migrateV2Room&&_c.preencode(d,o.migrateV2Room)},encode(d,o){const n=(o.restoreIdentity?1:0)|(o.createRoom?2:0)|(o.leaveRoom?4:0)|(o.clearRoom?8:0)|(o.joinRoomInvitation?16:0)|(o.joinRoomKeys?32:0)|(o.joinRoomResponse?64:0)|(o.sendContactRequest?128:0)|(o.migrateV2Room?256:0);e.fixed32.encode(d,o.discoveryKey),e.uint.encode(d,o.priority),e.uint.encode(d,o.timestamp),e.uint.encode(d,o.type),e.uint.encode(d,n),o.restoreIdentity&&Jc.encode(d,o.restoreIdentity),o.createRoom&&Wc.encode(d,o.createRoom),o.leaveRoom&&Gc.encode(d,o.leaveRoom),o.clearRoom&&Qc.encode(d,o.clearRoom),o.joinRoomInvitation&&Xc.encode(d,o.joinRoomInvitation),o.joinRoomKeys&&Yc.encode(d,o.joinRoomKeys),o.joinRoomResponse&&Zc.encode(d,o.joinRoomResponse),o.sendContactRequest&&$c.encode(d,o.sendContactRequest),o.migrateV2Room&&_c.encode(d,o.migrateV2Room)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d),c=e.uint.decode(d),r=e.uint.decode(d),t=e.uint.decode(d);return{discoveryKey:o,priority:n,timestamp:c,type:r,restoreIdentity:1&t?Jc.decode(d):null,createRoom:2&t?Wc.decode(d):null,leaveRoom:4&t?Gc.decode(d):null,clearRoom:8&t?Qc.decode(d):null,joinRoomInvitation:16&t?Xc.decode(d):null,joinRoomKeys:32&t?Yc.decode(d):null,joinRoomResponse:64&t?Zc.decode(d):null,sendContactRequest:128&t?$c.decode(d):null,migrateV2Room:256&t?_c.decode(d):null}}},dr=Le,or={preencode(d,o){e.buffer.preencode(d,o.seed),dr.preencode(d,o.invitation)},encode(d,o){e.buffer.encode(d,o.seed),dr.encode(d,o.invitation)},decode:d=>({seed:e.buffer.decode(d),invitation:dr.decode(d)})},nr={preencode(e,d){e.end++},encode(o,n){const c=(n.isWritable?1:0)|(n.isReadable?2:0)|(n.isPrivateProfile?4:0)|(d>=8&&n.isRemoved?8:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isWritable:!!(1&n),isReadable:!!(2&n),isPrivateProfile:!!(4&n),isRemoved:d>=8&&!!(8&n)}}},cr={preencode(d,o){e.uint.preencode(d,o.creation),e.uint.preencode(d,o.latestSync),e.uint.preencode(d,o.latestChatMessage)},encode(d,o){e.uint.encode(d,o.creation),e.uint.encode(d,o.latestSync),e.uint.encode(d,o.latestChatMessage)},decode:d=>({creation:e.uint.decode(d),latestSync:e.uint.decode(d),latestChatMessage:e.uint.decode(d)})},rr=Xo,tr=fo,ir=e.frame(cr),ar=vc,sr=e.frame(nr),pr=e.frame(ie),lr=e.frame(ud),ur=Oo,fr=$o,mr=e.frame(ho),yr=X,br=e.frame(sd),xr=Fn,vr={preencode(o,n){const c=(n.selfDevice?1:0)|(n.selfMember?2:0)|(n.config?4:0)|(n.identity?8:0)|(n.lastMessage?16:0)|(n.dm?32:0)|(d>=19&&n.readLengths?64:0)|(d>=19&&n.lastMember?128:0)|(d>=21&&n.version?256:0)|(d>=27&&n.preferences?512:0)|(d>=28&&n.activeCall?1024:0)|(d>=32&&n.lastMessageLabels?2048:0)|(d>=33&&n.settings?4096:0)|(d>=37&&n.system?8192:0)|(d>=37&&n.processed?16384:0);e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.discoveryKey),e.buffer.preencode(o,n.encryptionKey),rr.preencode(o,n.digest),tr.preencode(o,n.stats),ir.preencode(o,n.timestamps),e.uint.preencode(o,n.fork),e.uint.preencode(o,n.length),e.fixed32.preencode(o,n.seed),ar.preencode(o,n.capabilities),sr.preencode(o,n.status),e.uint.preencode(o,c),n.selfDevice&&pr.preencode(o,n.selfDevice),n.selfMember&&lr.preencode(o,n.selfMember),n.config&&ur.preencode(o,n.config),n.identity&&fr.preencode(o,n.identity),n.lastMessage&&mr.preencode(o,n.lastMessage),n.dm&&yr.preencode(o,n.dm),d>=19&&n.readLengths&&os.preencode(o,n.readLengths),d>=19&&n.lastMember&&br.preencode(o,n.lastMember),d>=21&&n.version&&e.uint.preencode(o,n.version),d>=27&&n.preferences&&xr.preencode(o,n.preferences),d>=28&&n.activeCall&&ns.preencode(o,n.activeCall),d>=32&&n.lastMessageLabels&&cs.preencode(o,n.lastMessageLabels),d>=33&&n.settings&&rs.preencode(o,n.settings),d>=37&&n.system&&ts.preencode(o,n.system),d>=37&&n.processed&&is.preencode(o,n.processed)},encode(o,n){const c=(n.selfDevice?1:0)|(n.selfMember?2:0)|(n.config?4:0)|(n.identity?8:0)|(n.lastMessage?16:0)|(n.dm?32:0)|(d>=19&&n.readLengths?64:0)|(d>=19&&n.lastMember?128:0)|(d>=21&&n.version?256:0)|(d>=27&&n.preferences?512:0)|(d>=28&&n.activeCall?1024:0)|(d>=32&&n.lastMessageLabels?2048:0)|(d>=33&&n.settings?4096:0)|(d>=37&&n.system?8192:0)|(d>=37&&n.processed?16384:0);e.fixed32.encode(o,n.roomKey),e.fixed32.encode(o,n.discoveryKey),e.buffer.encode(o,n.encryptionKey),rr.encode(o,n.digest),tr.encode(o,n.stats),ir.encode(o,n.timestamps),e.uint.encode(o,n.fork),e.uint.encode(o,n.length),e.fixed32.encode(o,n.seed),ar.encode(o,n.capabilities),sr.encode(o,n.status),e.uint.encode(o,c),n.selfDevice&&pr.encode(o,n.selfDevice),n.selfMember&&lr.encode(o,n.selfMember),n.config&&ur.encode(o,n.config),n.identity&&fr.encode(o,n.identity),n.lastMessage&&mr.encode(o,n.lastMessage),n.dm&&yr.encode(o,n.dm),d>=19&&n.readLengths&&os.encode(o,n.readLengths),d>=19&&n.lastMember&&br.encode(o,n.lastMember),d>=21&&n.version&&e.uint.encode(o,n.version),d>=27&&n.preferences&&xr.encode(o,n.preferences),d>=28&&n.activeCall&&ns.encode(o,n.activeCall),d>=32&&n.lastMessageLabels&&cs.encode(o,n.lastMessageLabels),d>=33&&n.settings&&rs.encode(o,n.settings),d>=37&&n.system&&ts.encode(o,n.system),d>=37&&n.processed&&is.encode(o,n.processed)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.buffer.decode(o),t=rr.decode(o),i=tr.decode(o),a=ir.decode(o),s=e.uint.decode(o),p=e.uint.decode(o),l=e.fixed32.decode(o),u=ar.decode(o),f=sr.decode(o),m=e.uint.decode(o);return{roomKey:n,discoveryKey:c,encryptionKey:r,digest:t,stats:i,timestamps:a,fork:s,length:p,seed:l,capabilities:u,status:f,selfDevice:1&m?pr.decode(o):null,selfMember:2&m?lr.decode(o):null,config:4&m?ur.decode(o):null,identity:8&m?fr.decode(o):null,lastMessage:16&m?mr.decode(o):null,dm:32&m?yr.decode(o):null,readLengths:d>=19&&64&m?os.decode(o):null,lastMember:d>=19&&128&m?br.decode(o):null,version:d>=21&&256&m?e.uint.decode(o):0,preferences:d>=27&&512&m?xr.decode(o):null,activeCall:d>=28&&1024&m?ns.decode(o):null,lastMessageLabels:d>=32&&2048&m?cs.decode(o):null,settings:d>=33&&4096&m?rs.decode(o):null,system:d>=37&&8192&m?ts.decode(o):null,processed:d>=37&&16384&m?is.decode(o):null}}},kr=Fn,gr={preencode(d,o){e.fixed32.preencode(d,o.roomKey),kr.preencode(d,o.status)},encode(d,o){e.fixed32.encode(d,o.roomKey),kr.encode(d,o.status)},decode:d=>({roomKey:e.fixed32.decode(d),status:kr.decode(d)})},Kr={preencode(o,n){e.fixed32.preencode(o,n.mailbox),e.fixed32.preencode(o,n.key),o.end++,n.roomKey&&e.fixed32.preencode(o,n.roomKey),n.keyPair&&r.preencode(o,n.keyPair),n.responseKeyPair&&r.preencode(o,n.responseKeyPair),d>=39&&n.activeClock&&e.uint.preencode(o,n.activeClock)},encode(o,n){const c=(n.roomKey?1:0)|(n.keyPair?2:0)|(n.responseKeyPair?4:0)|(d>=38&&n.pending?8:0)|(d>=39&&n.activeClock?16:0);e.fixed32.encode(o,n.mailbox),e.fixed32.encode(o,n.key),e.uint.encode(o,c),n.roomKey&&e.fixed32.encode(o,n.roomKey),n.keyPair&&r.encode(o,n.keyPair),n.responseKeyPair&&r.encode(o,n.responseKeyPair),d>=39&&n.activeClock&&e.uint.encode(o,n.activeClock)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),t=e.uint.decode(o);return{mailbox:n,key:c,roomKey:1&t?e.fixed32.decode(o):null,keyPair:2&t?r.decode(o):null,responseKeyPair:4&t?r.decode(o):null,pending:d>=38&&!!(8&t),activeClock:d>=39&&16&t?e.uint.decode(o):0}}},hr=pe,wr={preencode(d,o){e.fixed32.preencode(d,o.key),hr.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),hr.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),profile:hr.decode(d)})},Pr=pr,Tr={preencode(d,o){e.fixed32.preencode(d,o.roomKey),Pr.preencode(d,o.device)},encode(d,o){e.fixed32.encode(d,o.roomKey),Pr.encode(d,o.device)},decode:d=>({roomKey:e.fixed32.decode(d),device:Pr.decode(d)})},Rr=g,Ar={preencode(o,n){Rr.preencode(o,n.file),e.fixed32.preencode(o,n.roomKey),o.end++,n.encryptionKey&&e.buffer.preencode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.preencode(o,n.lastAccessed),d>=28&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(n.encryptionKey?1:0)|(n.cleared?2:0)|(n.own?4:0)|(d>=28&&n.lastAccessed?8:0)|(d>=28&&n.version?16:0);Rr.encode(o,n.file),e.fixed32.encode(o,n.roomKey),e.uint.encode(o,c),n.encryptionKey&&e.buffer.encode(o,n.encryptionKey),d>=28&&n.lastAccessed&&e.uint.encode(o,n.lastAccessed),d>=28&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=Rr.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{file:n,roomKey:c,encryptionKey:1&r?e.buffer.decode(o):null,cleared:!!(2&r),own:!!(4&r),lastAccessed:d>=28&&8&r?e.uint.decode(o):0,version:d>=28&&16&r?e.uint.decode(o):0}}},Sr=$,Ir={preencode(o,c){Sr.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),as.preencode(o,c.preview),o.end++,d>=12&&c.displayType&&Gr.preencode(o,c.displayType)},encode(o,c){const r=d>=12&&c.displayType?1:0;Sr.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),as.encode(o,c.preview),e.uint.encode(o,r),d>=12&&c.displayType&&Gr.encode(o,c.displayType)},decode(o){const c=Sr.decode(o),r=n.decode(o),t=e.uint.decode(o),i=as.decode(o),a=o.start<o.end?e.uint.decode(o):0;return{header:c,oplog:r,index:t,preview:i,displayType:d>=12&&1&a?Gr.decode(o):0}}},Fr={preencode(o,n){o.end++,d>=4&&n.memberKey&&e.fixed32.preencode(o,n.memberKey)},encode(o,n){const c=d>=4&&n.memberKey?1:0;e.uint.encode(o,c),d>=4&&n.memberKey&&e.fixed32.encode(o,n.memberKey)},decode(o){const n=e.uint.decode(o);return{memberKey:d>=4&&1&n?e.fixed32.decode(o):null}}},Mr=pe,Cr={preencode(e,d){Mr.preencode(e,d.profile),ne.preencode(e,d.attestation)},encode(e,d){Mr.encode(e,d.profile),ne.encode(e,d.attestation)},decode:e=>({profile:Mr.decode(e),attestation:ne.decode(e)})},Vr=$,Hr={preencode(d,o){Vr.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){Vr.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:Vr.decode(d),key:e.fixed32.decode(d)})},Dr={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)})},Lr={preencode(o,n){e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.encryptionKey),e.fixed32.preencode(o,n.seed),o.end++,d>=9&&n.fastForwardTo&&e.fixed32.preencode(o,n.fastForwardTo)},encode(o,n){const c=d>=9&&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>=9&&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>=9&&1&t?e.fixed32.decode(o):null}}},qr={preencode(o,n){e.fixed32.preencode(o,n.publicKey),e.fixed32.preencode(o,n.writerKey),e.fixed32.preencode(o,n.devicePublicKey),o.end++,d>=9&&n.privateProfileKey&&e.fixed32.preencode(o,n.privateProfileKey)},encode(o,n){const c=d>=9&&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>=9&&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>=9&&1&t?e.fixed32.decode(o):null}}},jr=$,Er={preencode(d,o){jr.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){jr.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:jr.decode(d),memberKey:e.fixed32.decode(d)})},Br={preencode(d,o){e.fixed32.preencode(d,o.privateProfileKey)},encode(d,o){e.fixed32.encode(d,o.privateProfileKey)},decode:d=>({privateProfileKey:e.fixed32.decode(d)})},zr={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.responsePublicKey)},encode(d,o){e.fixed32.encode(d,o.key),e.fixed32.encode(d,o.responsePublicKey)},decode:d=>({key:e.fixed32.decode(d),responsePublicKey:e.fixed32.decode(d)})},Or={preencode(o,n){e.fixed32.preencode(o,n.roomKey),o.end++,d>=10&&n.repairs&&e.uint.preencode(o,n.repairs)},encode(o,n){const c=d>=10&&n.repairs?1:0;e.fixed32.encode(o,n.roomKey),e.uint.encode(o,c),d>=10&&n.repairs&&e.uint.encode(o,n.repairs)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o);return{roomKey:n,repairs:d>=10&&1&c?e.uint.decode(o):0}}},Nr={preencode(o,n){o.end++,d>=11&&n.key&&e.string.preencode(o,n.key),d>=11&&n.description&&e.string.preencode(o,n.description)},encode(o,n){const c=(d>=11&&n.key?1:0)|(d>=11&&n.value?2:0)|(d>=11&&n.description?4:0);e.uint.encode(o,c),d>=11&&n.key&&e.string.encode(o,n.key),d>=11&&n.description&&e.string.encode(o,n.description)},decode(o){const n=e.uint.decode(o);return{key:d>=11&&1&n?e.string.decode(o):null,value:d>=11&&!!(2&n),description:d>=11&&4&n?e.string.decode(o):null}}},Ur=e.array(e.frame(Nr)),Jr={preencode(e,o){e.end++,d>=11&&o.flags&&Ur.preencode(e,o.flags)},encode(o,n){const c=d>=11&&n.flags?1:0;e.uint.encode(o,c),d>=11&&n.flags&&Ur.encode(o,n.flags)},decode(o){const n=e.uint.decode(o);return{flags:d>=11&&1&n?Ur.decode(o):null}}},Wr={HttpLink:1,PearLink:2},Gr={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)},Qr=$,Xr={preencode(d,o){Qr.preencode(d,o.header),e.uint.preencode(d,o.value)},encode(d,o){Qr.encode(d,o.header),e.uint.encode(d,o.value)},decode:d=>({header:Qr.decode(d),value:e.uint.decode(d)})},Yr={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)})},Zr=$,$r={preencode(o,n){Zr.preencode(o,n.header),e.uint.preencode(o,n.from),e.uint.preencode(o,n.to),o.end++,d>=29&&n.buildType&&xi.preencode(o,n.buildType)},encode(o,n){const c=d>=29&&n.buildType?1:0;Zr.encode(o,n.header),e.uint.encode(o,n.from),e.uint.encode(o,n.to),e.uint.encode(o,c),d>=29&&n.buildType&&xi.encode(o,n.buildType)},decode(o){const n=Zr.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>=29&&1&t?xi.decode(o):null}}},_r={RoomType:1,IsExperimental:2,IsJoiningDisabled:3,IsAppendingDisabled:4,IsCallingDisabled:5,IsMembershipEventsDisabled:6,IsAttachmentsDisabled:7,IsLinksDisabled:8,IsRoomInviteHidden:9},et={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)},dt=We,ot={preencode(o,n){o.end++,d>=16&&n.nodes&&dt.preencode(o,n.nodes),d>=24&&n.concurrency&&e.uint.preencode(o,n.concurrency),d>=24&&n.maxWindow&&e.uint.preencode(o,n.maxWindow),d>=24&&n.randomPunchInterval&&e.uint.preencode(o,n.randomPunchInterval),d>=24&&n.connectionKeepAlive&&e.uint.preencode(o,n.connectionKeepAlive)},encode(o,n){const c=(d>=16&&n.nodes?1:0)|(d>=24&&n.concurrency?2:0)|(d>=24&&n.maxWindow?4:0)|(d>=24&&n.randomPunchInterval?8:0)|(d>=24&&n.connectionKeepAlive?16:0);e.uint.encode(o,c),d>=16&&n.nodes&&dt.encode(o,n.nodes),d>=24&&n.concurrency&&e.uint.encode(o,n.concurrency),d>=24&&n.maxWindow&&e.uint.encode(o,n.maxWindow),d>=24&&n.randomPunchInterval&&e.uint.encode(o,n.randomPunchInterval),d>=24&&n.connectionKeepAlive&&e.uint.encode(o,n.connectionKeepAlive)},decode(o){const n=e.uint.decode(o);return{nodes:d>=16&&1&n?dt.decode(o):null,concurrency:d>=24&&2&n?e.uint.decode(o):0,maxWindow:d>=24&&4&n?e.uint.decode(o):0,randomPunchInterval:d>=24&&8&n?e.uint.decode(o):0,connectionKeepAlive:d>=24&&16&n?e.uint.decode(o):0}}},nt={en:"en",it:"it",ru:"ru",es:"es",de:"de"},ct={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}}},rt=Hd,tt={preencode(d,o){rt.preencode(d,o.range),ct.preencode(d,o.language),e.string.preencode(d,o.text)},encode(d,o){rt.encode(d,o.range),ct.encode(d,o.language),e.string.encode(d,o.text)},decode:d=>({range:rt.decode(d),language:ct.decode(d),text:e.string.decode(d)})},it={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.count)},encode(d,o){e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.count)},decode:d=>({roomKey:e.fixed32.decode(d),count:e.uint.decode(d)})},at={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)})},st=$,pt={preencode(d,o){st.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){st.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:st.decode(d),key:e.fixed32.decode(d)})},lt=$,ut={preencode(d,o){lt.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){lt.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:lt.decode(d),key:e.fixed32.decode(d)})},ft={Flag:1},mt={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)},yt={preencode(d,o){uo.preencode(d,o.id),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),mt.preencode(d,o.label)},encode(d,o){uo.encode(d,o.id),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),mt.encode(d,o.label)},decode:d=>({id:uo.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:mt.decode(d)})},bt=$,xt={preencode(e,d){bt.preencode(e,d.header),n.preencode(e,d.oplog),mt.preencode(e,d.label)},encode(e,d){bt.encode(e,d.header),n.encode(e,d.oplog),mt.encode(e,d.label)},decode:e=>({header:bt.decode(e),oplog:n.decode(e),label:mt.decode(e)})},vt=$,kt={preencode(e,d){vt.preencode(e,d.header),n.preencode(e,d.oplog),mt.preencode(e,d.label)},encode(e,d){vt.encode(e,d.header),n.encode(e,d.oplog),mt.encode(e,d.label)},decode:e=>({header:vt.decode(e),oplog:n.decode(e),label:mt.decode(e)})},gt={preencode(d,o){mt.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){mt.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:mt.decode(d),count:e.uint.decode(d)})},Kt=e.array(e.frame(gt)),ht={preencode(o,n){uo.preencode(o,n.id),e.uint.preencode(o,n.total),Kt.preencode(o,n.labels),e.uint.preencode(o,n.editedAt),o.end++,d>=24&&n.flagsClock&&e.uint.preencode(o,n.flagsClock),d>=24&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=24&&n.flagsClock?1:0)|(d>=24&&n.version?2:0)|(d>=25&&n.isDeleted?4:0);uo.encode(o,n.id),e.uint.encode(o,n.total),Kt.encode(o,n.labels),e.uint.encode(o,n.editedAt),e.uint.encode(o,c),d>=24&&n.flagsClock&&e.uint.encode(o,n.flagsClock),d>=24&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=uo.decode(o),c=e.uint.decode(o),r=Kt.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>=24&&1&i?e.uint.decode(o):0,version:d>=24&&2&i?e.uint.decode(o):0,isDeleted:d>=25&&!!(4&i)}}},wt=$,Pt={preencode(d,o){wt.preencode(d,o.header),e.uint.preencode(d,o.length)},encode(d,o){wt.encode(d,o.header),e.uint.encode(d,o.length)},decode:d=>({header:wt.decode(d),length:e.uint.decode(d)})},Tt={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)})},Rt=Z,At={preencode(o,n){o.end++,d>=33&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(d>=19&&n.disableReadReceipts?1:0)|(d>=31&&n.stripAttachmentMetadata?2:0)|(d>=33&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=33&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:d>=19&&!!(1&n),stripAttachmentMetadata:d>=31&&!!(2&n),profileSnoozeTime:d>=33&&4&n?e.uint.decode(o):0}}},St={disableReadReceipts:"disableReadReceipts",stripAttachmentMetadata:"stripAttachmentMetadata",profileSnoozeTime:"profileSnoozeTime"},It={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}}},Ft=$,Mt=e.frame(At),Ct={preencode(e,d){Ft.preencode(e,d.header),It.preencode(e,d.key),Mt.preencode(e,d.settings)},encode(e,d){Ft.encode(e,d.header),It.encode(e,d.key),Mt.encode(e,d.settings)},decode:e=>({header:Ft.decode(e),key:It.decode(e),settings:Mt.decode(e)})},Vt={preencode(o,n){o.end++,d>=20&&n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=23&&n.coreKey&&e.fixed32.preencode(o,n.coreKey)},encode(o,n){const c=(d>=20&&n.roomKey?1:0)|(d>=23&&n.coreKey?2:0);e.uint.encode(o,c),d>=20&&n.roomKey&&e.fixed32.encode(o,n.roomKey),d>=23&&n.coreKey&&e.fixed32.encode(o,n.coreKey)},decode(o){const n=e.uint.decode(o);return{roomKey:d>=20&&1&n?e.fixed32.decode(o):null,coreKey:d>=23&&2&n?e.fixed32.decode(o):null}}},Ht=e.frame(Vt),Dt={preencode(o,n){e.string.preencode(o,n.code),e.string.preencode(o,n.message),e.string.preencode(o,n.stack),e.uint.preencode(o,n.timestamp),o.end++,d>=20&&n.details&&Ht.preencode(o,n.details)},encode(o,n){const c=d>=20&&n.details?1:0;e.string.encode(o,n.code),e.string.encode(o,n.message),e.string.encode(o,n.stack),e.uint.encode(o,n.timestamp),e.uint.encode(o,c),d>=20&&n.details&&Ht.encode(o,n.details)},decode(o){const n=e.string.decode(o),c=e.string.decode(o),r=e.string.decode(o),t=e.uint.decode(o),i=e.uint.decode(o);return{code:n,message:c,stack:r,timestamp:t,details:d>=20&&1&i?Ht.decode(o):null}}},Lt={RESUME:1,WAKEUP:2,PRESUSPEND:3,SUSPEND:4},qt={preencode(e,d){e.end++},encode(d,o){if(o>4)throw new Error("Unknown enum");e.uint.encode(d,o)},decode:d=>e.uint.decode(d)},jt={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.total)},encode(d,o){e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.total)},decode:d=>({roomKey:e.fixed32.decode(d),total:e.uint.decode(d)})},Et={Flag:1},Bt={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)},zt={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),Bt.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),Bt.encode(d,o.label)},decode:d=>({key:e.fixed32.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:Bt.decode(d)})},Ot=$,Nt={preencode(d,o){Ot.preencode(d,o.header),e.fixed32.preencode(d,o.key),Bt.preencode(d,o.label)},encode(d,o){Ot.encode(d,o.header),e.fixed32.encode(d,o.key),Bt.encode(d,o.label)},decode:d=>({header:Ot.decode(d),key:e.fixed32.decode(d),label:Bt.decode(d)})},Ut={preencode(d,o){Bt.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){Bt.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:Bt.decode(d),count:e.uint.decode(d)})},Jt=e.array(e.frame(Ut)),Wt={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.total),Jt.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),Jt.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:Jt.decode(d),editedAt:e.uint.decode(d),flagsClock:e.uint.decode(d)})},Gt={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)})},Qt=$,Xt={preencode(d,o){Qt.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.fromDeviceKey)},encode(d,o){Qt.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.fromDeviceKey)},decode:d=>({header:Qt.decode(d),deviceKey:e.fixed32.decode(d),fromDeviceKey:e.fixed32.decode(d)})},Yt=$,Zt=X,$t={preencode(o,n){Yt.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),o.end++,d>=28&&n.streams&&Zt.preencode(o,n.streams),d>=28&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=28&&n.version&&e.uint.preencode(o,n.version),d>=36&&n.streamInputs&&ss.preencode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=28&&n.streams?1:0)|(d>=28&&n.discoveryKey?2:0)|(d>=28&&n.version?4:0)|(d>=36&&n.streamInputs?8:0)|(d>=36&&n.swarmKey?16:0);Yt.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,c),d>=28&&n.streams&&Zt.encode(o,n.streams),d>=28&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=28&&n.version&&e.uint.encode(o,n.version),d>=36&&n.streamInputs&&ss.encode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=Yt.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>=28&&1&t?Zt.decode(o):null,discoveryKey:d>=28&&2&t?e.fixed32.decode(o):null,version:d>=28&&4&t?e.uint.decode(o):0,streamInputs:d>=36&&8&t?ss.decode(o):null,swarmKey:d>=36&&16&t?e.fixed32.decode(o):null}}},_t=$,ei=X,di={preencode(o,n){_t.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),o.end++,d>=28&&n.streams&&ei.preencode(o,n.streams),d>=36&&n.streamInputs&&ps.preencode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=28&&n.streams?1:0)|(d>=36&&n.streamInputs?2:0)|(d>=36&&n.swarmKey?4:0);_t.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=28&&n.streams&&ei.encode(o,n.streams),d>=36&&n.streamInputs&&ps.encode(o,n.streamInputs),d>=36&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=_t.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,callKey:c,streams:d>=28&&1&r?ei.decode(o):null,streamInputs:d>=36&&2&r?ps.decode(o):null,swarmKey:d>=36&&4&r?e.fixed32.decode(o):null}}},oi=$,ni={preencode(d,o){oi.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){oi.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:oi.decode(d),callKey:e.fixed32.decode(d)})},ci=$,ri={preencode(d,o){ci.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){ci.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:ci.decode(d),callKey:e.fixed32.decode(d)})},ti=$,ii={preencode(o,n){ti.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.streamKey),o.end++,d>=36&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=36&&n.type&&e.string.preencode(o,n.type)},encode(o,n){const c=(d>=36&&n.mediaStreamId?1:0)|(d>=36&&n.type?2:0)|(d>=36&&n.muted?4:0);ti.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.streamKey),e.uint.encode(o,c),d>=36&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=36&&n.type&&e.string.encode(o,n.type)},decode(o){const n=ti.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>=36&&1&t?e.string.decode(o):null,type:d>=36&&2&t?e.string.decode(o):null,muted:d>=36&&!!(4&t)}}},ai=$,si={preencode(d,o){ai.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey)},encode(d,o){ai.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.streamKey)},decode:d=>({header:ai.decode(d),callKey:e.fixed32.decode(d),streamKey:e.fixed32.decode(d)})},pi={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),e.uint.preencode(o,n.createdAt),o.end++,d>=28&&n.endedAt&&e.uint.preencode(o,n.endedAt),d>=28&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=28&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=28&&n.endedAt?1:0)|(d>=28&&n.discoveryKey?2:0)|(d>=28&&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>=28&&n.endedAt&&e.uint.encode(o,n.endedAt),d>=28&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=28&&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>=28&&1&t?e.uint.decode(o):0,discoveryKey:d>=28&&2&t?e.fixed32.decode(o):null,version:d>=28&&4&t?e.uint.decode(o):0}}},li={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)})},ui={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>=28&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),d>=32&&n.lastHeartbeatAt&&e.uint.preencode(o,n.lastHeartbeatAt)},encode(o,n){const c=(d>=28&&n.swarmKey?1:0)|(d>=32&&n.lastHeartbeatAt?2:0)|(d>=33&&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>=28&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey),d>=32&&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>=28&&1&i?e.fixed32.decode(o):null,lastHeartbeatAt:d>=32&&2&i?e.uint.decode(o):0,isRecording:d>=33&&!!(4&i)}}},fi={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>=36&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=36&&n.type&&e.string.preencode(o,n.type),d>=36&&n.statusKey&&e.uint.preencode(o,n.statusKey)},encode(o,n){const c=(d>=36&&n.mediaStreamId?1:0)|(d>=36&&n.type?2:0)|(d>=36&&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>=36&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=36&&n.type&&e.string.encode(o,n.type),d>=36&&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>=36&&1&i?e.string.decode(o):null,type:d>=36&&2&i?e.string.decode(o):null,statusKey:d>=36&&4&i?e.uint.decode(o):0}}},mi={preencode(o,n){e.fixed32.preencode(o,n.callKey),o.end++,d>=28&&n.selfDeviceKey&&e.fixed32.preencode(o,n.selfDeviceKey),d>=36&&n.createdAt&&e.uint.preencode(o,n.createdAt)},encode(o,n){const c=(d>=28&&n.selfDeviceKey?1:0)|(d>=36&&n.createdAt?2:0);e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=28&&n.selfDeviceKey&&e.fixed32.encode(o,n.selfDeviceKey),d>=36&&n.createdAt&&e.uint.encode(o,n.createdAt)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o);return{callKey:n,selfDeviceKey:d>=28&&1&c?e.fixed32.decode(o):null,createdAt:d>=36&&2&c?e.uint.decode(o):0}}},yi={preencode(d,o){e.uint.preencode(d,o.lastCleared)},encode(d,o){e.uint.encode(d,o.lastCleared)},decode:d=>({lastCleared:e.uint.decode(d)})},bi={Nightly:"Nightly",Internal:"Internal",Production:"Production"},xi={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}}},vi=$,ki={preencode(e,d){vi.preencode(e,d.header)},encode(e,d){vi.encode(e,d.header)},decode:e=>({header:vi.decode(e)})},gi=$,Ki={preencode(e,d){gi.preencode(e,d.header)},encode(e,d){gi.encode(e,d.header)},decode:e=>({header:gi.decode(e)})},hi={preencode(o,n){xi.preencode(o,n.buildType),o.end++,d>=30&&n.latestOfflineAbi&&e.uint.preencode(o,n.latestOfflineAbi)},encode(o,n){const c=d>=30&&n.latestOfflineAbi?1:0;xi.encode(o,n.buildType),e.uint.encode(o,c),d>=30&&n.latestOfflineAbi&&e.uint.encode(o,n.latestOfflineAbi)},decode(o){const n=xi.decode(o),c=o.start<o.end?e.uint.decode(o):0;return{buildType:n,latestOfflineAbi:d>=30&&1&c?e.uint.decode(o):0}}},wi=$,Pi={preencode(d,o){wi.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){wi.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:wi.decode(d),deviceKey:e.fixed32.decode(d),deviceProof:e.buffer.decode(d),writerProof:e.buffer.decode(d)})},Ti={preencode(o,n){o.end++,d>=31&&n.otaResyncPrivateProfileBump&&e.uint.preencode(o,n.otaResyncPrivateProfileBump)},encode(o,n){const c=d>=31&&n.otaResyncPrivateProfileBump?1:0;e.uint.encode(o,c),d>=31&&n.otaResyncPrivateProfileBump&&e.uint.encode(o,n.otaResyncPrivateProfileBump)},decode(o){const n=e.uint.decode(o);return{otaResyncPrivateProfileBump:d>=31&&1&n?e.uint.decode(o):0}}},Ri={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.buffer.preencode(d,o.proof),e.uint.preencode(d,o.createdAt)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.buffer.encode(d,o.proof),e.uint.encode(d,o.createdAt)},decode:d=>({deviceKey:e.fixed32.decode(d),proof:e.buffer.decode(d),createdAt:e.uint.decode(d)})},Ai=$,Si={preencode(d,o){Ai.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Ai.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Ai.decode(d),callKey:e.fixed32.decode(d)})},Ii=$,Fi={preencode(d,o){Ii.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){Ii.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:Ii.decode(d),callKey:e.fixed32.decode(d),deviceKey:e.fixed32.decode(d)})},Mi=e.frame(ht),Ci=e.array(e.frame(yt)),Vi={preencode(e,d){Mi.preencode(e,d.digest),Ci.preencode(e,d.mine)},encode(e,d){Mi.encode(e,d.digest),Ci.encode(e,d.mine)},decode:e=>({digest:Mi.decode(e),mine:Ci.decode(e)})},Hi=$,Di={preencode(d,o){Hi.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Hi.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Hi.decode(d),callKey:e.fixed32.decode(d)})},Li=$,qi={preencode(d,o){Li.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Li.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Li.decode(d),callKey:e.fixed32.decode(d)})},ji={preencode(o,n){o.end++,d>=33&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(d>=33&&n.disableReadReceipts?1:0)|(d>=33&&n.stripAttachmentMetadata?2:0)|(d>=33&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=33&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:d>=33&&!!(1&n),stripAttachmentMetadata:d>=33&&!!(2&n),profileSnoozeTime:d>=33&&4&n?e.uint.decode(o):0}}},Ei={preencode(o,n){o.end++,d>=33&&n.maxPeers&&e.uint.preencode(o,n.maxPeers)},encode(o,n){const c=d>=33&&n.maxPeers?1:0;e.uint.encode(o,c),d>=33&&n.maxPeers&&e.uint.encode(o,n.maxPeers)},decode(o){const n=e.uint.decode(o);return{maxPeers:d>=33&&1&n?e.uint.decode(o):0}}},Bi=$,zi={preencode(e,d){Bi.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){Bi.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:Bi.decode(e),oplog:n.decode(e)})},Oi=$,Ni={preencode(e,d){Oi.preencode(e,d.header)},encode(e,d){Oi.encode(e,d.header)},decode:e=>({header:Oi.decode(e)})},Ui={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)})},Ji=$,Wi={preencode(o,n){Ji.preencode(o,n.header),e.fixed32.preencode(o,n.memberKey),o.end++,d>=34&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=d>=34&&n.alias?1:0;Ji.encode(o,n.header),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,c),d>=34&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=Ji.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,memberKey:c,alias:d>=34&&1&r?e.string.decode(o):null}}},Gi={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)})},Qi={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>=36&&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>=36&&!!(1&t)}}},Xi=$,Yi={preencode(d,o){Xi.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey),d.end++},encode(o,n){const c=d>=36&&n.muted?1:0;Xi.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=Xi.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>=36&&!!(1&t)}}},Zi={preencode(d,o){e.uint.preencode(d,o.statusKey),d.end++},encode(o,n){const c=d>=36&&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>=36&&!!(1&c)}}},$i={preencode(n,c){e.fixed32.preencode(n,c.key),n.end++,d>=37&&c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(d>=37&&c.encryptionKey?1:0)|(d>=37&&c.bootFrom?2:0);e.fixed32.encode(n,c.key),e.uint.encode(n,r),d>=37&&c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),d>=37&&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>=37&&1&r?e.buffer.decode(n):null,bootFrom:d>=37&&2&r?o.decode(n):null}}},_i={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)})},ea={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)})},da={preencode(n,c){o.preencode(n,c.autobeeMigrationHead),n.end++,d>=37&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),e.uint.preencode(n,c.createdAt)},encode(n,c){const r=(d>=37&&c.legacyViewHead?1:0)|(d>=37&&c.dbViewHead?2:0)|(d>=37&&c.blobsViewHead?4:0);o.encode(n,c.autobeeMigrationHead),e.uint.encode(n,r),d>=37&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=37&&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>=37&&1&r?o.decode(n):null,dbViewHead:d>=37&&2&r?o.decode(n):null,blobsViewHead:d>=37&&4&r?o.decode(n):null,createdAt:e.uint.decode(n)}}},oa=$,na={preencode(e,n){oa.preencode(e,n.header),o.preencode(e,n.head),e.end++,d>=37&&n.legacyViewHead&&o.preencode(e,n.legacyViewHead),d>=37&&n.dbViewHead&&o.preencode(e,n.dbViewHead),d>=37&&n.blobsViewHead&&o.preencode(e,n.blobsViewHead)},encode(n,c){const r=(d>=37&&c.legacyViewHead?1:0)|(d>=37&&c.dbViewHead?2:0)|(d>=37&&c.blobsViewHead?4:0);oa.encode(n,c.header),o.encode(n,c.head),e.uint.encode(n,r),d>=37&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.encode(n,c.blobsViewHead)},decode(n){const c=oa.decode(n),r=o.decode(n),t=e.uint.decode(n);return{header:c,head:r,legacyViewHead:d>=37&&1&t?o.decode(n):null,dbViewHead:d>=37&&2&t?o.decode(n):null,blobsViewHead:d>=37&&4&t?o.decode(n):null}}},ca={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.fixed32.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.seed),n.end++,d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=d>=37&&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>=37&&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>=37&&1&i?o.decode(n):null}}},ra=id,ta={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),ra.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),ra.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:ra.decode(d)})},ia={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)})},aa=Fn,sa=Mn,pa=kn,la={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),aa.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,d>=37&&c.initiator&&o.preencode(n,c.initiator),d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=37&&c.identitySwap&&sa.preencode(n,c.identitySwap),d>=37&&c.identitySwapV2&&pa.preencode(n,c.identitySwapV2),d>=37&&c.contact&&e.fixed32.preencode(n,c.contact)},encode(n,c){const r=(d>=37&&c.initiator?1:0)|(d>=37&&c.bootFrom?2:0)|(d>=37&&c.identitySwap?4:0)|(d>=37&&c.identitySwapV2?8:0)|(d>=37&&c.contact?16:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),aa.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,r),d>=37&&c.initiator&&o.encode(n,c.initiator),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=37&&c.identitySwap&&sa.encode(n,c.identitySwap),d>=37&&c.identitySwapV2&&pa.encode(n,c.identitySwapV2),d>=37&&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=aa.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>=37&&1&s?o.decode(n):null,bootFrom:d>=37&&2&s?o.decode(n):null,identitySwap:d>=37&&4&s?sa.decode(n):null,identitySwapV2:d>=37&&8&s?pa.decode(n):null,contact:d>=37&&16&s?e.fixed32.decode(n):null}}},ua=$,fa={preencode(n,c){ua.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>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=37&&c.initiator&&o.preencode(n,c.initiator),d>=37&&c.dm&&e.fixed32.preencode(n,c.dm)},encode(n,c){const r=(d>=37&&c.bootFrom?1:0)|(d>=37&&c.initiator?2:0)|(d>=37&&c.dm?4:0)|(d>=37&&c.isReadOnly?8:0);ua.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>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=37&&c.initiator&&o.encode(n,c.initiator),d>=37&&c.dm&&e.fixed32.encode(n,c.dm)},decode(n){const c=ua.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>=37&&1&a?o.decode(n):null,initiator:d>=37&&2&a?o.decode(n):null,dm:d>=37&&4&a?e.fixed32.decode(n):null,isReadOnly:d>=37&&!!(8&a)}}},ma={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),n.end++,d>=37&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=37&&c.initiator&&o.preencode(n,c.initiator)},encode(n,c){const r=(d>=37&&c.bootFrom?1:0)|(d>=37&&c.initiator?2:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.uint.encode(n,r),d>=37&&c.bootFrom&&o.encode(n,c.bootFrom),d>=37&&c.initiator&&o.encode(n,c.initiator)},decode(n){const c=e.fixed32.decode(n),r=e.buffer.decode(n),t=e.uint.decode(n);return{roomKey:c,encryptionKey:r,bootFrom:d>=37&&1&t?o.decode(n):null,initiator:d>=37&&2&t?o.decode(n):null}}},ya={preencode(d,o){e.fixed32.preencode(d,o.roomKey),ls.preencode(d,o.head),e.uint.preencode(d,o.timestamp),d.end++},encode(o,n){const c=d>=37&&n.incremental?1:0;e.fixed32.encode(o,n.roomKey),ls.encode(o,n.head),e.uint.encode(o,n.timestamp),e.uint.encode(o,c)},decode(o){const n=e.fixed32.decode(o),c=ls.decode(o),r=e.uint.decode(o),t=e.uint.decode(o);return{roomKey:n,head:c,timestamp:r,incremental:d>=37&&!!(1&t)}}},ba={preencode(o,n){o.end++,d>=37&&n.key&&e.fixed32.preencode(o,n.key),e.uint.preencode(o,n.length)},encode(o,n){const c=d>=37&&n.key?1:0;e.uint.encode(o,c),d>=37&&n.key&&e.fixed32.encode(o,n.key),e.uint.encode(o,n.length)},decode(o){const n=e.uint.decode(o);return{key:d>=37&&1&n?e.fixed32.decode(o):null,length:e.uint.decode(o)}}},xa={preencode(n,c){e.fixed32.preencode(n,c.roomKey),n.end++,d>=37&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),d>=37&&c.autobeeMigrationHead&&o.preencode(n,c.autobeeMigrationHead)},encode(n,c){const r=(d>=37&&c.legacyViewHead?1:0)|(d>=37&&c.dbViewHead?2:0)|(d>=37&&c.blobsViewHead?4:0)|(d>=37&&c.autobeeMigrationHead?8:0);e.fixed32.encode(n,c.roomKey),e.uint.encode(n,r),d>=37&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=37&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=37&&c.blobsViewHead&&o.encode(n,c.blobsViewHead),d>=37&&c.autobeeMigrationHead&&o.encode(n,c.autobeeMigrationHead)},decode(n){const c=e.fixed32.decode(n),r=e.uint.decode(n);return{roomKey:c,legacyViewHead:d>=37&&1&r?o.decode(n):null,dbViewHead:d>=37&&2&r?o.decode(n):null,blobsViewHead:d>=37&&4&r?o.decode(n):null,autobeeMigrationHead:d>=37&&8&r?o.decode(n):null}}},va={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)})},ka=$,ga={preencode(d,o){ka.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){ka.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:ka.decode(d),blindResponse:e.buffer.decode(d)})},Ka=e.frame(Ac),ha={preencode(o,n){e.string.preencode(o,n.mnemonic),o.end++,d>=39&&n.profileDiscoveryTimeout&&e.uint.preencode(o,n.profileDiscoveryTimeout),d>=39&&n.privateProfileKey&&e.fixed32.preencode(o,n.privateProfileKey),d>=39&&n.identity&&Ka.preencode(o,n.identity)},encode(o,n){const c=(d>=39&&n.profileDiscoveryTimeout?1:0)|(d>=39&&n.privateProfileKey?2:0)|(d>=39&&n.identity?4:0);e.string.encode(o,n.mnemonic),e.uint.encode(o,c),d>=39&&n.profileDiscoveryTimeout&&e.uint.encode(o,n.profileDiscoveryTimeout),d>=39&&n.privateProfileKey&&e.fixed32.encode(o,n.privateProfileKey),d>=39&&n.identity&&Ka.encode(o,n.identity)},decode(o){const n=e.string.decode(o),c=e.uint.decode(o);return{mnemonic:n,profileDiscoveryTimeout:d>=39&&1&c?e.uint.decode(o):0,privateProfileKey:d>=39&&2&c?e.fixed32.decode(o):null,identity:d>=39&&4&c?Ka.decode(o):null}}},wa=$,Pa={preencode(e,d){wa.preencode(e,d.header)},encode(e,d){wa.encode(e,d.header)},decode:e=>({header:wa.decode(e)})},Ta=$,Ra={preencode(o,c){Ta.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),o.end++,d>=40&&c.displayType&&Gr.preencode(o,c.displayType)},encode(o,c){const r=d>=40&&c.displayType?1:0;Ta.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),e.uint.encode(o,r),d>=40&&c.displayType&&Gr.encode(o,c.displayType)},decode(o){const c=Ta.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>=40&&1&i?Gr.decode(o):0}}},Aa=$,Sa=Od,Ia={preencode(d,o){Aa.preencode(d,o.header),n.preencode(d,o.oplog),Gr.preencode(d,o.displayType),e.uint.preencode(d,o.index),Sa.preencode(d,o.preview)},encode(d,o){Aa.encode(d,o.header),n.encode(d,o.oplog),Gr.encode(d,o.displayType),e.uint.encode(d,o.index),Sa.encode(d,o.preview)},decode:d=>({header:Aa.decode(d),oplog:n.decode(d),displayType:Gr.decode(d),index:e.uint.decode(d),preview:Sa.decode(d)})},Fa=$,Ma={preencode(d,o){Fa.preencode(d,o.header),n.preencode(d,o.oplog),Gr.preencode(d,o.displayType),e.uint.preencode(d,o.index)},encode(d,o){Fa.encode(d,o.header),n.encode(d,o.oplog),Gr.encode(d,o.displayType),e.uint.encode(d,o.index)},decode:d=>({header:Fa.decode(d),oplog:n.decode(d),displayType:Gr.decode(d),index:e.uint.decode(d)})},Ca=e.frame(w),Va=e.frame(Gi),Ha=Ca,Da=e.array(ct),La=e.frame(se),qa=Ca,ja=La,Ea=e.frame(Lr),Ba=e.frame(ca),za=La,Oa=e.frame(fd),Na=e.frame(Fr),Ua=e.frame(Gt),Ja=Ua,Wa=e.array(e.frame(tt)),Ga=Ca,Qa=e.frame(zn),Xa=e.frame(Cr),Ya=Qa,Za=Xa,$a=Qa,_a=Xa,es=e.frame(qr),ds=Xa,os=e.array(e.frame(Tt)),ns=e.frame(mi),cs=e.frame(Vi),rs=e.frame(ji),ts=e.frame(ba),is=ts,as=Ca,ss=e.array(e.frame(Qi)),ps=ss,ls=ts;function us(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 l;case"@keet/external-drive-pointer":return u;case"@keet/external-blob-pointer":return f;case"@keet/file-pointer":return b;case"@keet/file":return k;case"@keet/image-file":return w;case"@keet/file-status":return P;case"@keet/file-record":return A;case"@keet/device-status":return S;case"@keet/member-status":return I;case"@keet/member-moderation-status":return F;case"@keet/abi":return M;case"@keet/device-stats":return C;case"@keet/member-stats":return V;case"@keet/chat-stats":return H;case"@keet/file-stats":return D;case"@keet/stats":return B;case"@keet/room-type":return O;case"@keet/system-settings":return N;case"@keet/system-digest":return W;case"@keet/room-seed":return G;case"@keet/room-capabilities":return Q;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 le;case"@keet/device-update":return ue;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 ke;case"@keet/device-request-with-invitation-and-proof":return Ke;case"@keet/device-request-with-member-proof":return Pe;case"@keet/device-request":return Ae;case"@keet/device-response":return Fe;case"@keet/invitation-metadata":return Me;case"@keet/invitation":return He;case"@keet/add-invitation-operation":return qe;case"@keet/remove-invitation-operation":return Ee;case"@keet/sendable-room-invitation":return Be;case"@keet/sendable-identity-invitation":return ze;case"@keet/sendable-contact-invitation":return Oe;case"@keet/sendable-invitation":return Ge;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 ud;case"@keet/member-proofs":return fd;case"@keet/update-member-operation":return bd;case"@keet/change-member-status-operation":return kd;case"@keet/change-member-role-operation":return Kd;case"@keet/remove-member-operation":return wd;case"@keet/member-activity":return Pd;case"@keet/member-joined-event":return Td;case"@keet/member-left-event":return Rd;case"@keet/title-changed-chat-event":return Ad;case"@keet/chat-event":return Md;case"@keet/sendable-event":return Cd;case"@keet/display-range":return Vd;case"@keet/display-content-range":return Dd;case"@keet/mention-display-item":return qd;case"@keet/link-preview":return Bd;case"@keet/display-link-item":return Nd;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 lo;case"@keet/message-index-id":return uo;case"@keet/thread":return mo;case"@keet/chat-message-record":return vo;case"@keet/full-chat-message-record":return ho;case"@keet/add-chat-message-operation":return To;case"@keet/remove-chat-message-operation":return Ao;case"@keet/update-chat-message-operation":return Fo;case"@keet/pin-chat-message-operation":return Co;case"@keet/reaction":return Vo;case"@keet/reactions-summary":return Ho;case"@keet/reactions-digest":return Lo;case"@keet/add-reaction-operation":return jo;case"@keet/remove-reaction-operation":return Bo;case"@keet/update-room-config-operation":return No;case"@keet/group-member":return Uo;case"@keet/user-registry-info":return Jo;case"@keet/room-identity":return Go;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 un;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 vn;case"@keet-private-id/pending-invitation":return gn;case"@keet-private-id/resolve-pending-invitation-operation":return hn;case"@keet-private-id/add-pending-invitation-operation":return Tn;case"@keet-private-id/remove-pending-invitation-operation":return An;case"@keet-private-id/identity-swap":return Sn;case"@keet-private-id/room-status":return In;case"@keet-private-id/room":return Vn;case"@keet-private-id/add-room-operation":return Dn;case"@keet-private-id/remove-room-operation":return qn;case"@keet-private-id/update-room-status-operation":return Bn;case"@keet-private-id/contact-status":return zn;case"@keet-private-id/contact-record":return On;case"@keet-private-id/add-contact-operation":return Jn;case"@keet-private-id/update-contact-status-operation":return Gn;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 lc;case"@keet-private-id/profile-discovery-record":return uc;case"@local/background-sync-room":return fc;case"@local/stats":return mc;case"@local/migration-status":return yc;case"@local/v3-private-profile-migration":return xc;case"@local/v3-room-migration":return gc;case"@local/room-migration-stats":return Kc;case"@local/room-migration":return wc;case"@local/identity-status":return Pc;case"@local/identity-record":return Ac;case"@local/tasks":return Ic;case"@local/room-keys":return Fc;case"@local/join-room-invitation-task":return Cc;case"@local/join-room-response-task":return Vc;case"@local/fast-forward-to":return Hc;case"@local/add-room-fields":return Dc;case"@local/join-room-keys-task":return qc;case"@local/create-room-task":return Ec;case"@local/leave-room-task":return Bc;case"@local/clear-room-task":return zc;case"@local/restore-identity-task":return Oc;case"@local/send-contact-request-task":return Nc;case"@local/migrate-v2-room-task":return Uc;case"@local/task":return er;case"@local/shared-invitation":return or;case"@local/room-status":return nr;case"@local/room-timestamps":return cr;case"@local/room":return vr;case"@local/room-preferences":return gr;case"@local/writer":return Kr;case"@local/member":return wr;case"@local/device":return Tr;case"@local/file":return Ar;case"@keet/add-file-preview-operation":return Ir;case"@keet/member-removed-event":return Fr;case"@keet/member-contact-info":return Cr;case"@keet/remove-device-operation":return Hr;case"@keet/device-identity":return Dr;case"@keet/readonly-room-invitation":return Lr;case"@keet-private-id/identity-swap-v2":return qr;case"@keet-private-id/activate-contact-room-operation":return Er;case"@local/identity-swap":return Br;case"@local/writer-append":return zr;case"@local/room-metadata":return Or;case"@local/debug-flag":return Nr;case"@local/debug":return Jr;case"@keet/display-type":return Gr;case"@keet/test-increment-operation":return Xr;case"@keet/test-collection-record-1":return Yr;case"@keet/migrate-abi-operation":return $r;case"@keet/system-settings-keys":return et;case"@local/hyperdht-record":return ot;case"@keet/room-supported-language":return ct;case"@keet/translation-display-item":return tt;case"@local/unread":return it;case"@keet-private-id/unreads":return at;case"@keet-private-id/add-unreads-key-operation":return pt;case"@keet-private-id/remove-unreads-key-operation":return ut;case"@keet/label-type":return mt;case"@keet/chat-label":return yt;case"@keet/add-chat-label-operation":return xt;case"@keet/remove-chat-label-operation":return kt;case"@keet/chat-label-summary":return gt;case"@keet/chat-label-digest":return ht;case"@keet/update-read-length-operation":return Pt;case"@keet/read-length":return Tt;case"@keet/tmp-removed-member":return Rt;case"@keet-private-id/settings":return At;case"@keet-private-id/user-settings-key":return It;case"@keet-private-id/update-settings-operation":return Ct;case"@local/error-record-details":return Vt;case"@local/error-record":return Dt;case"@local/keet-state":return qt;case"@local/file-stats":return jt;case"@keet/member-label-type":return Bt;case"@keet/member-label":return zt;case"@keet/add-member-label-operation":return Nt;case"@keet/member-label-summary":return Ut;case"@keet/member-label-digest":return Wt;case"@keet/location-shared-event":return Gt;case"@keet/move-indexer-operation":return Xt;case"@keet/start-call":return $t;case"@keet/join-call":return di;case"@keet/leave-call":return ni;case"@keet/end-call":return ri;case"@keet/add-call-stream":return ii;case"@keet/remove-call-stream":return si;case"@keet/call-record":return pi;case"@keet/call-member-record":return li;case"@keet/call-device-record":return ui;case"@keet/call-stream-record":return fi;case"@local/active-call":return mi;case"@local/file-gc-info":return yi;case"@keet/build-type":return xi;case"@keet/test-crash-operation":return ki;case"@keet/test-dispatch-error-operation":return Ki;case"@local/environment-record":return hi;case"@keet-private-id/shorten-device-attestation-operation":return Pi;case"@local/ota-actions":return Ti;case"@local/device-attestation":return Ri;case"@keet/call-device-heartbeat":return Si;case"@keet/remove-call-device":return Fi;case"@local/chat-labels":return Vi;case"@keet/start-call-recording":return Di;case"@keet/stop-call-recording":return qi;case"@local/settings":return ji;case"@local/hyperswarm-record":return Ei;case"@keet/dismiss-chat-reports-operation":return zi;case"@keet/update-typing-indicator-operation":return Ni;case"@keet/typing-indicator":return Ui;case"@keet-private-id/update-contact-alias-operation":return Wi;case"@keet/call-stats":return Gi;case"@keet/call-stream-input":return Qi;case"@keet/update-call-stream":return Yi;case"@keet/call-stream-status-record":return Zi;case"@keet/room-keys-v2":return $i;case"@keet/blob-pointer-v2":return _i;case"@keet/blob":return ea;case"@keet/autobee-migration":return da;case"@keet/autobee-migration-operation":return na;case"@keet/readonly-room-invitation-v2":return ca;case"@keet/admin-last-seen":return ta;case"@keet/blob-record":return ia;case"@keet-private-id/room-v2":return la;case"@keet-private-id/add-room-operation-v2":return fa;case"@local/room-keys/v2":return ma;case"@local/room-update":return ya;case"@local/view-head":return ba;case"@local/autobee-migration":return xa;case"@keet-private-id/pending-invitation-response":return va;case"@keet-private-id/resolve-pending-invitation-operation-v2":return ga;case"@local/pending-recovery":return ha;case"@keet/claim-admin-devices-operation":return Pa;case"@keet/remove-file-preview-operation":return Ra;case"@keet/add-link-preview-operation":return Ia;case"@keet/remove-link-preview-operation":return Ma;default:throw new Error("Encoder not found "+e)}}function fs(e,o=41){const n=us(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 ms=fs;module.exports={resolveStruct:ms,getStruct:fs,getEnum:function(e){switch(e){case"@keet/room-type":return z;case"@local/tasks":return Sc;case"@keet/display-type":return Wr;case"@keet/system-settings-keys":return _r;case"@keet/room-supported-language":return nt;case"@keet/label-type":return ft;case"@keet-private-id/user-settings-key":return St;case"@local/keet-state":return Lt;case"@keet/member-label-type":return Et;case"@keet/build-type":return bi;default:throw new Error("Enum not found "+e)}},getEncoding:us,encode:function(o,n,c=41){return d=c,e.encode(us(o),n)},decode:function(o,n,c=41){return d=c,e.decode(us(o),n)},setVersion:function(e){d=e},version:d};