const{c:e}=require("hyperschema/runtime");let d=17;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>=13&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(c.encryptionKey?1:0)|(c.fastForwardTo?2:0)|(d>=13&&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>=13&&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>=13&&4&r?o.decode(n):null}}},i={preencode(d,o){e.uint.preencode(d,o.timestamp)},encode(d,o){e.uint.encode(d,o.timestamp)},decode:d=>({timestamp:e.uint.decode(d)})},a={preencode(d,o){e.uint.preencode(d,o.blockOffset),e.uint.preencode(d,o.blockLength),e.uint.preencode(d,o.byteOffset),e.uint.preencode(d,o.byteLength)},encode(d,o){e.uint.encode(d,o.blockOffset),e.uint.encode(d,o.blockLength),e.uint.encode(d,o.byteOffset),e.uint.encode(d,o.byteLength)},decode:d=>({blockOffset:e.uint.decode(d),blockLength:e.uint.decode(d),byteOffset:e.uint.decode(d),byteLength:e.uint.decode(d)})},s={preencode(d,o){e.uint.preencode(d,o.width),e.uint.preencode(d,o.height)},encode(d,o){e.uint.encode(d,o.width),e.uint.encode(d,o.height)},decode:d=>({width:e.uint.decode(d),height:e.uint.decode(d)})},p=e.frame(s),u={preencode(d,o){d.end++,o.name&&e.string.preencode(d,o.name),o.mimetype&&e.string.preencode(d,o.mimetype),o.dimensions&&p.preencode(d,o.dimensions),o.userdata&&e.buffer.preencode(d,o.userdata),o.duration&&e.uint.preencode(d,o.duration)},encode(d,o){const n=(o.name?1:0)|(o.mimetype?2:0)|(o.dimensions?4:0)|(o.userdata?8:0)|(o.duration?16:0)|(o.isPreview?32:0);e.uint.encode(d,n),o.name&&e.string.encode(d,o.name),o.mimetype&&e.string.encode(d,o.mimetype),o.dimensions&&p.encode(d,o.dimensions),o.userdata&&e.buffer.encode(d,o.userdata),o.duration&&e.uint.encode(d,o.duration)},decode(d){const o=e.uint.decode(d);return{name:1&o?e.string.decode(d):null,mimetype:2&o?e.string.decode(d):null,dimensions:4&o?p.decode(d):null,userdata:8&o?e.buffer.decode(d):null,duration:16&o?e.uint.decode(d):0,isPreview:!!(32&o)}}},l={preencode(d,o){e.fixed32.preencode(d,o.key),e.string.preencode(d,o.path),e.uint.preencode(d,o.version),e.uint.preencode(d,o.size)},encode(d,o){e.fixed32.encode(d,o.key),e.string.encode(d,o.path),e.uint.encode(d,o.version),e.uint.encode(d,o.size)},decode:d=>({key:e.fixed32.decode(d),path:e.string.decode(d),version:e.uint.decode(d),size:e.uint.decode(d)})},f={preencode(d,o){e.fixed32.preencode(d,o.key),a.preencode(d,o.blob)},encode(d,o){e.fixed32.encode(d,o.key),a.encode(d,o.blob)},decode:d=>({key:e.fixed32.decode(d),blob:a.decode(d)})},m=e.frame(f),y=e.frame(l),x={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>=13&&n.bee&&vu.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>=13&&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>=13&&n.bee&&vu.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>=13&&16&n?vu.decode(o):null}}},b=e.frame(x),v=e.frame(u),g={preencode(d,o){b.preencode(d,o.pointer),d.end++,o.metadata&&v.preencode(d,o.metadata),o.preview&&Zu.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);b.encode(d,o.pointer),e.uint.encode(d,n),o.metadata&&v.encode(d,o.metadata),o.preview&&Zu.encode(d,o.preview),o.hash&&e.fixed32.encode(d,o.hash)},decode(d){const o=b.decode(d),n=e.uint.decode(d);return{pointer:o,metadata:1&n?v.decode(d):null,preview:2&n?Zu.decode(d):null,hash:4&n?e.fixed32.decode(d):null}}},k=e.frame(g),K=k,h=k,w={preencode(e,d){e.end++,d.small&&k.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&&k.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?k.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=k,A={preencode(d,o){e.uint.preencode(d,o.id),n.preencode(d,o.oplog),T.preencode(d,o.status),R.preencode(d,o.file),d.end++,o.version&&e.uint.preencode(d,o.version)},encode(d,o){const c=o.version?1:0;e.uint.encode(d,o.id),n.encode(d,o.oplog),T.encode(d,o.status),R.encode(d,o.file),e.uint.encode(d,c),o.version&&e.uint.encode(d,o.version)},decode:d=>({id:e.uint.decode(d),oplog:n.decode(d),status:T.decode(d),file:R.decode(d),version:1&e.uint.decode(d)?e.uint.decode(d):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(d,o){const n=(o.isAdmin?1:0)|(o.isModerator?2:0)|(o.isPending?4:0)|(o.isActive?8:0)|(o.isMuted?16:0)|(o.isBanned?32:0)|(o.isShadowBanned?64:0)|(o.isRemoved?128:0);e.uint.preencode(d,n)},encode(d,o){const n=(o.isAdmin?1:0)|(o.isModerator?2:0)|(o.isPending?4:0)|(o.isActive?8:0)|(o.isMuted?16:0)|(o.isBanned?32:0)|(o.isShadowBanned?64:0)|(o.isRemoved?128:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isAdmin:!!(1&o),isModerator:!!(2&o),isPending:!!(4&o),isActive:!!(8&o),isMuted:!!(16&o),isBanned:!!(32&o),isShadowBanned:!!(64&o),isRemoved:!!(128&o)}}},M={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)}}},F={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)})},q={preencode(d,o){e.uint.preencode(d,o.total),e.uint.preencode(d,o.active)},encode(d,o){e.uint.encode(d,o.total),e.uint.encode(d,o.active)},decode:d=>({total:e.uint.decode(d),active:e.uint.decode(d)})},C={preencode(d,o){e.uint.preencode(d,o.total),e.uint.preencode(d,o.active),e.uint.preencode(d,o.pending)},encode(d,o){e.uint.encode(d,o.total),e.uint.encode(d,o.active),e.uint.encode(d,o.pending)},decode:d=>({total:e.uint.decode(d),active:e.uint.decode(d),pending:e.uint.decode(d)})},V={preencode(d,o){e.uint.preencode(d,o.clock),e.uint.preencode(d,o.pinned),e.uint.preencode(d,o.threads),e.uint.preencode(d,o.timestamp),d.end++,o.flagsClock&&e.uint.preencode(d,o.flagsClock)},encode(d,o){const n=o.flagsClock?1:0;e.uint.encode(d,o.clock),e.uint.encode(d,o.pinned),e.uint.encode(d,o.threads),e.uint.encode(d,o.timestamp),e.uint.encode(d,n),o.flagsClock&&e.uint.encode(d,o.flagsClock)},decode:d=>({clock:e.uint.decode(d),pinned:e.uint.decode(d),threads:e.uint.decode(d),timestamp:e.uint.decode(d),flagsClock:1&e.uint.decode(d)?e.uint.decode(d):0})},H={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)})},D=e.frame(q),L=e.frame(C),j=e.frame(V),E=e.frame(H),B={preencode(e,o){D.preencode(e,o.devices),L.preencode(e,o.members),j.preencode(e,o.chat),E.preencode(e,o.files),e.end++,d>=12&&o.calls&&$u.preencode(e,o.calls)},encode(o,n){const c=d>=12&&n.calls?1:0;D.encode(o,n.devices),L.encode(o,n.members),j.encode(o,n.chat),E.encode(o,n.files),e.uint.encode(o,c),d>=12&&n.calls&&$u.encode(o,n.calls)},decode(o){const n=D.decode(o),c=L.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>=12&&1&i?$u.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>=4&&n.isAttachmentsDisabled?64:0)|(d>=4&&n.isLinksDisabled?128:0)|(d>=5&&n.buildType?256:0)|(d>=9&&n.isRoomInviteHidden?512:0);e.uint.preencode(o,c),n.roomType&&O.preencode(o,n.roomType),d>=5&&n.buildType&&Dp.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>=4&&n.isAttachmentsDisabled?64:0)|(d>=4&&n.isLinksDisabled?128:0)|(d>=5&&n.buildType?256:0)|(d>=9&&n.isRoomInviteHidden?512:0);e.uint.encode(o,c),n.roomType&&O.encode(o,n.roomType),d>=5&&n.buildType&&Dp.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>=4&&!!(64&n),isLinksDisabled:d>=4&&!!(128&n),buildType:d>=5&&256&n?Dp.decode(o):null,isRoomInviteHidden:d>=9&&!!(512&n)}}},U=e.frame(F),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={en:"en",it:"it",ru:"ru",es:"es",de:"de"},Y={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}}},Z=e.array(Y),$=e.array(e.fixed32),_={preencode(d,o){d.end++,o.title&&e.string.preencode(d,o.title),o.avatar&&_u.preencode(d,o.avatar),o.description&&e.string.preencode(d,o.description),o.supportedLanguages&&Z.preencode(d,o.supportedLanguages),o.blindPeers&&$.preencode(d,o.blindPeers)},encode(d,o){const n=(o.title?1:0)|(o.avatar?2:0)|(o.description?4:0)|(o.supportedLanguages?8:0)|(o.blindPeers?16:0);e.uint.encode(d,n),o.title&&e.string.encode(d,o.title),o.avatar&&_u.encode(d,o.avatar),o.description&&e.string.encode(d,o.description),o.supportedLanguages&&Z.encode(d,o.supportedLanguages),o.blindPeers&&$.encode(d,o.blindPeers)},decode(d){const o=e.uint.decode(d);return{title:1&o?e.string.decode(d):null,avatar:2&o?_u.decode(d):null,description:4&o?e.string.decode(d):null,supportedLanguages:8&o?Z.decode(d):null,blindPeers:16&o?$.decode(d):null}}},ee={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)})},de=e.frame(i),oe=e.frame(ee),ne={preencode(e,d){de.preencode(e,d.header),oe.preencode(e,d.peer)},encode(e,d){de.encode(e,d.header),oe.encode(e,d.peer)},decode:e=>({header:de.decode(e),peer:oe.decode(e)})},ce=de,re={preencode(d,o){ce.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){ce.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:ce.decode(d),key:e.fixed32.decode(d)})},te={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)})},ie={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)})},ae=e.frame(S),se=e.frame(ie),pe={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.memberKey),ae.preencode(d,o.status),el.preencode(d,o.profile),d.end++,o.invitation&&se.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),ae.encode(d,o.status),el.encode(d,o.profile),e.uint.encode(d,n),o.invitation&&se.encode(d,o.invitation)},decode:d=>({key:e.fixed32.decode(d),memberKey:e.fixed32.decode(d),status:ae.decode(d),profile:el.decode(d),invitation:1&e.uint.decode(d)?se.decode(d):null})},ue={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&&dl.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&&dl.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?dl.decode(d):null,username:8&n?e.string.decode(d):null}}},le={preencode(o,n){o.end++,n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),n.name&&e.string.preencode(o,n.name),d>=5&&n.buildType&&Dp.preencode(o,n.buildType)},encode(o,n){const c=(n.swarmKey?1:0)|(n.name?2:0)|(n.isMobile?4:0)|(d>=5&&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>=5&&n.buildType&&Dp.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>=5&&8&n?Dp.decode(o):null}}},fe=e.frame(ue),me={preencode(e,d){fe.preencode(e,d.profile),te.preencode(e,d.attestation)},encode(e,d){fe.encode(e,d.profile),te.encode(e,d.attestation)},decode:e=>({profile:fe.decode(e),attestation:te.decode(e)})},ye={preencode(e,d){ol.preencode(e,d.profile),te.preencode(e,d.attestation)},encode(e,d){ol.encode(e,d.profile),te.encode(e,d.attestation)},decode:e=>({profile:ol.decode(e),attestation:te.decode(e)})},xe=fe,be={preencode(e,d){xe.preencode(e,d.profile),te.preencode(e,d.attestation)},encode(e,d){xe.encode(e,d.profile),te.encode(e,d.attestation)},decode:e=>({profile:xe.decode(e),attestation:te.decode(e)})},ve={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)})},ge={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)})},ke={preencode(d,o){te.preencode(d,o.privateProfileIdentity),e.buffer.preencode(d,o.deviceProof)},encode(d,o){te.encode(d,o.privateProfileIdentity),e.buffer.encode(d,o.deviceProof)},decode:d=>({privateProfileIdentity:te.decode(d),deviceProof:e.buffer.decode(d)})},Ke={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),te.preencode(d,o.privateProfileIdentity),e.buffer.preencode(d,o.deviceProof)},encode(d,o){e.fixed32.encode(d,o.deviceKey),te.encode(d,o.privateProfileIdentity),e.buffer.encode(d,o.deviceProof)},decode:d=>({deviceKey:e.fixed32.decode(d),privateProfileIdentity:te.decode(d),deviceProof:e.buffer.decode(d)})},he=e.frame(ye),we=e.frame(me),Pe=e.frame(ge),Te={preencode(n,c){e.fixed32.preencode(n,c.deviceKey),r.preencode(n,c.keyPair),he.preencode(n,c.device),we.preencode(n,c.member),n.end++,c.identity&&Pe.preencode(n,c.identity),d>=13&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=13&&c.link?2:0);e.fixed32.encode(n,c.deviceKey),r.encode(n,c.keyPair),he.encode(n,c.device),we.encode(n,c.member),e.uint.encode(n,t),c.identity&&Pe.encode(n,c.identity),d>=13&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),t=r.decode(n),i=he.decode(n),a=we.decode(n),s=e.uint.decode(n);return{deviceKey:c,keyPair:t,device:i,member:a,identity:1&s?Pe.decode(n):null,link:d>=13&&2&s?o.decode(n):null}}},Re=e.frame(Te),Ae={preencode(d,o){e.fixed32.preencode(d,o.id),Re.preencode(d,o.request),e.buffer.preencode(d,o.signature)},encode(d,o){e.fixed32.encode(d,o.id),Re.encode(d,o.request),e.buffer.encode(d,o.signature)},decode:d=>({id:e.fixed32.decode(d),request:Re.decode(d),signature:e.buffer.decode(d)})},Se=he,Ie=we,Me={preencode(e,d){Se.preencode(e,d.device),e.end++,d.member&&Ie.preencode(e,d.member)},encode(d,o){const n=o.member?1:0;Se.encode(d,o.device),e.uint.encode(d,n),o.member&&Ie.encode(d,o.member)},decode:d=>({device:Se.decode(d),member:1&e.uint.decode(d)?Ie.decode(d):null})},Fe=e.frame(Ae),qe=e.frame(Me),Ce={preencode(e,d){e.end++,d.withInvitation&&Fe.preencode(e,d.withInvitation),d.withMemberProof&&qe.preencode(e,d.withMemberProof)},encode(d,o){const n=(o.withInvitation?1:0)|(o.withMemberProof?2:0);e.uint.encode(d,n),o.withInvitation&&Fe.encode(d,o.withInvitation),o.withMemberProof&&qe.encode(d,o.withMemberProof)},decode(d){const o=e.uint.decode(d);return{withInvitation:1&o?Fe.decode(d):null,withMemberProof:2&o?qe.decode(d):null}}},Ve=e.frame(ve),He=e.frame(ke),De={preencode(e,d){Ve.preencode(e,d.signedKeys),e.end++,d.identity&&He.preencode(e,d.identity)},encode(d,o){const n=o.identity?1:0;Ve.encode(d,o.signedKeys),e.uint.encode(d,n),o.identity&&He.encode(d,o.identity)},decode:d=>({signedKeys:Ve.decode(d),identity:1&e.uint.decode(d)?He.decode(d):null})},Le={preencode(o,n){o.end++,n.expiration&&e.uint.preencode(o,n.expiration),d>=5&&n.buildType&&Dp.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>=5&&n.buildType?16:0);e.uint.encode(o,c),n.expiration&&e.uint.encode(o,n.expiration),d>=5&&n.buildType&&Dp.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>=5&&16&n?Dp.decode(o):null}}},je=Ve,Ee=e.frame(Le),Be={preencode(d,n){e.fixed32.preencode(d,n.id),je.preencode(d,n.response),Ee.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),je.encode(d,n.response),Ee.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=je.decode(d),r=Ee.decode(d),t=e.uint.decode(d);return{id:n,response:c,metadata:r,anchor:1&t?o.decode(d):null,isActive:!!(2&t)}}},ze=de,Oe=e.frame(Be),Ne={preencode(e,d){ze.preencode(e,d.header),Oe.preencode(e,d.invitation)},encode(e,d){ze.encode(e,d.header),Oe.encode(e,d.invitation)},decode:e=>({header:ze.decode(e),invitation:Oe.decode(e)})},Ue=de,Je={preencode(d,o){Ue.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Ue.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Ue.decode(d),id:e.fixed32.decode(d)})},We={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)})},Ge={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.fixed32.preencode(d,o.encryptionKey),e.fixed32.preencode(d,o.seed),d.end++,o.fastForwardTo&&e.fixed32.preencode(d,o.fastForwardTo)},encode(d,o){const n=o.fastForwardTo?1:0;e.fixed32.encode(d,o.roomKey),e.fixed32.encode(d,o.encryptionKey),e.fixed32.encode(d,o.seed),e.uint.encode(d,n),o.fastForwardTo&&e.fixed32.encode(d,o.fastForwardTo)},decode:d=>({roomKey:e.fixed32.decode(d),encryptionKey:e.fixed32.decode(d),seed:e.fixed32.decode(d),fastForwardTo:1&e.uint.decode(d)?e.fixed32.decode(d):null})},Qe={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)})},Xe={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)})},Ye=e.frame(We),Ze=e.frame(Qe),$e=e.frame(Xe),_e=e.frame(Ge),ed=e.array(e.ipv4Address),dd={preencode(e,o){e.end++,o.room&&Ye.preencode(e,o.room),o.identity&&Ze.preencode(e,o.identity),o.contact&&$e.preencode(e,o.contact),o.readonly&&_e.preencode(e,o.readonly),o.additionalNodes&&ed.preencode(e,o.additionalNodes),d>=5&&o.buildType&&Dp.preencode(e,o.buildType),d>=13&&o["readonly-v2"]&&nl.preencode(e,o["readonly-v2"])},encode(o,n){const c=(n.room?1:0)|(n.identity?2:0)|(n.contact?4:0)|(n.readonly?8:0)|(n.additionalNodes?16:0)|(d>=5&&n.buildType?32:0)|(d>=13&&n["readonly-v2"]?64:0);e.uint.encode(o,c),n.room&&Ye.encode(o,n.room),n.identity&&Ze.encode(o,n.identity),n.contact&&$e.encode(o,n.contact),n.readonly&&_e.encode(o,n.readonly),n.additionalNodes&&ed.encode(o,n.additionalNodes),d>=5&&n.buildType&&Dp.encode(o,n.buildType),d>=13&&n["readonly-v2"]&&nl.encode(o,n["readonly-v2"])},decode(o){const n=e.uint.decode(o);return{room:1&n?Ye.decode(o):null,identity:2&n?Ze.decode(o):null,contact:4&n?$e.decode(o):null,readonly:8&n?_e.decode(o):null,additionalNodes:16&n?ed.decode(o):null,buildType:d>=5&&32&n?Dp.decode(o):null,"readonly-v2":d>=13&&64&n?nl.decode(o):null}}},od=de,nd={preencode(d,o){od.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){od.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:od.decode(d),blindRequest:e.buffer.decode(d)})},cd=de,rd={preencode(o,n){cd.preencode(o,n.header),o.end++,n.profile&&cl.preencode(o,n.profile),d>=10&&n.key&&e.fixed32.preencode(o,n.key)},encode(o,n){const c=(n.profile?1:0)|(d>=10&&n.key?2:0);cd.encode(o,n.header),e.uint.encode(o,c),n.profile&&cl.encode(o,n.profile),d>=10&&n.key&&e.fixed32.encode(o,n.key)},decode(o){const n=cd.decode(o),c=e.uint.decode(o);return{header:n,profile:1&c?cl.decode(o):null,key:d>=10&&2&c?e.fixed32.decode(o):null}}},td=de,id={preencode(d,o){td.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){td.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:td.decode(d),key:e.fixed32.decode(d)})},ad={preencode(e,d){},encode(e,d){},decode:e=>({})},sd=ad,pd=Re,ud={preencode(d,o){e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.id),pd.preencode(d,o.request)},encode(d,o){e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.id),pd.encode(d,o.request)},decode:d=>({deviceKey:e.fixed32.decode(d),id:e.fixed32.decode(d),request:pd.decode(d)})},ld=de,fd=He,md={preencode(d,o){ld.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),d.end++,o.identity&&fd.preencode(d,o.identity)},encode(d,o){const n=o.identity?1:0;ld.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.uint.encode(d,n),o.identity&&fd.encode(d,o.identity)},decode:d=>({header:ld.decode(d),deviceKey:e.fixed32.decode(d),identity:1&e.uint.decode(d)?fd.decode(d):null})},yd=de,xd={preencode(d,o){yd.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){yd.encode(d,o.header),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:yd.decode(d),deviceKey:e.fixed32.decode(d)})},bd=e.frame(I),vd=fe,gd={preencode(d,o){e.fixed32.preencode(d,o.key),bd.preencode(d,o.status),vd.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),bd.encode(d,o.status),vd.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),status:bd.decode(d),profile:vd.decode(d)})},kd=bd,Kd=fe,hd={preencode(d,o){e.fixed32.preencode(d,o.key),kd.preencode(d,o.status),Kd.preencode(d,o.profile),d.end++,o.proofs&&rl.preencode(d,o.proofs)},encode(d,o){const n=o.proofs?1:0;e.fixed32.encode(d,o.key),kd.encode(d,o.status),Kd.encode(d,o.profile),e.uint.encode(d,n),o.proofs&&rl.encode(d,o.proofs)},decode:d=>({key:e.fixed32.decode(d),status:kd.decode(d),profile:Kd.decode(d),proofs:1&e.uint.decode(d)?rl.decode(d):null})},wd={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}}},Pd=de,Td=we,Rd={preencode(e,d){Pd.preencode(e,d.header),Td.preencode(e,d.member)},encode(e,d){Pd.encode(e,d.header),Td.encode(e,d.member)},decode:e=>({header:Pd.decode(e),member:Td.decode(e)})},Ad=de,Sd=e.frame(M),Id={preencode(d,o){Ad.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),Sd.preencode(d,o.status)},encode(d,o){Ad.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),Sd.encode(d,o.status)},decode:d=>({header:Ad.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:Sd.decode(d)})},Md=de,Fd={preencode(d,o){Md.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);Md.encode(d,o.header),e.fixed32.encode(d,o.key),e.uint.encode(d,n)},decode(d){const o=Md.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{header:o,key:n,isModerator:!!(1&c),isAdmin:!!(2&c)}}},qd=de,Cd={preencode(d,o){qd.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){qd.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:qd.decode(d),key:e.fixed32.decode(d)})},Vd={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)})},Hd={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})},Dd=Hd,Ld=Hd,jd={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}}},Ed=e.frame(Hd),Bd=e.frame(Dd),zd=e.frame(jd),Od=e.frame(Ld),Nd={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)|(n.roomAvatarChanged?64:0)|(n.invitationCreated?128:0)|(n.memberRemoved?256:0)|(d>=3&&n.locationShared?512:0);e.uint.preencode(o,c),n.memberJoined&&Ed.preencode(o,n.memberJoined),n.memberLeft&&Bd.preencode(o,n.memberLeft),n.titleChanged&&zd.preencode(o,n.titleChanged),n.memberRemoved&&Od.preencode(o,n.memberRemoved),d>=3&&n.locationShared&&tl.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)|(n.roomAvatarChanged?64:0)|(n.invitationCreated?128:0)|(n.memberRemoved?256:0)|(d>=3&&n.locationShared?512:0);e.uint.encode(o,c),n.memberJoined&&Ed.encode(o,n.memberJoined),n.memberLeft&&Bd.encode(o,n.memberLeft),n.titleChanged&&zd.encode(o,n.titleChanged),n.memberRemoved&&Od.encode(o,n.memberRemoved),d>=3&&n.locationShared&&tl.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{memberJoined:1&n?Ed.decode(o):null,memberLeft:2&n?Bd.decode(o):null,titleChanged:4&n?zd.decode(o):null,callStarted:!!(8&n),callHangup:!!(16&n),callMissed:!!(32&n),roomAvatarChanged:!!(64&n),invitationCreated:!!(128&n),memberRemoved:256&n?Od.decode(o):null,locationShared:d>=3&&512&n?tl.decode(o):null}}},Ud={preencode(e,o){e.end++,d>=3&&o.locationShared&&il.preencode(e,o.locationShared)},encode(o,n){const c=(n.callStarted?1:0)|(n.callHangup?2:0)|(n.callMissed?4:0)|(d>=3&&n.locationShared?8:0);e.uint.encode(o,c),d>=3&&n.locationShared&&il.encode(o,n.locationShared)},decode(o){const n=e.uint.decode(o);return{callStarted:!!(1&n),callHangup:!!(2&n),callMissed:!!(4&n),locationShared:d>=3&&8&n?il.decode(o):null}}},Jd={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)})},Wd=e.frame(Jd),Gd={preencode(d,o){Wd.preencode(d,o.range),e.string.preencode(d,o.content)},encode(d,o){Wd.encode(d,o.range),e.string.encode(d,o.content)},decode:d=>({range:Wd.decode(d),content:e.string.decode(d)})},Qd=Wd,Xd={preencode(d,o){Qd.preencode(d,o.range),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Qd.encode(d,o.range),e.fixed32.encode(d,o.memberKey)},decode:d=>({range:Qd.decode(d),memberKey:e.fixed32.decode(d)})},Yd=Wd,Zd={preencode(d,o){Yd.preencode(d,o.range),Y.preencode(d,o.language),e.string.preencode(d,o.text)},encode(d,o){Yd.encode(d,o.range),Y.encode(d,o.language),e.string.encode(d,o.text)},decode:d=>({range:Yd.decode(d),language:Y.decode(d),text:e.string.decode(d)})},$d=k,_d=e.array(e.uint),eo={preencode(d,o){d.end++,o.title&&e.string.preencode(d,o.title),o.description&&e.string.preencode(d,o.description),o.file&&$d.preencode(d,o.file),o.files&&_d.preencode(d,o.files)},encode(d,o){const n=(o.title?1:0)|(o.description?2:0)|(o.file?4:0)|(o.files?8:0);e.uint.encode(d,n),o.title&&e.string.encode(d,o.title),o.description&&e.string.encode(d,o.description),o.file&&$d.encode(d,o.file),o.files&&_d.encode(d,o.files)},decode(d){const o=e.uint.decode(d);return{title:1&o?e.string.decode(d):null,description:2&o?e.string.decode(d):null,file:4&o?$d.decode(d):null,files:8&o?_d.decode(d):null}}},oo=Wd,no=e.frame(eo),co={preencode(d,o){oo.preencode(d,o.range),e.string.preencode(d,o.url),d.end++,o.preview&&no.preencode(d,o.preview)},encode(d,o){const n=o.preview?1:0;oo.encode(d,o.range),e.string.encode(d,o.url),e.uint.encode(d,n),o.preview&&no.encode(d,o.preview)},decode:d=>({range:oo.decode(d),url:e.string.decode(d),preview:1&e.uint.decode(d)?no.decode(d):null})},ro=e.array(e.frame(Xd)),to=e.array(e.frame(co)),io=to,ao=e.array(e.frame(Jd)),so=ao,po=ao,uo=e.array(e.frame(Gd)),lo=ao,fo=ao,mo=e.array(e.frame(Zd)),yo={preencode(d,o){const n=(o.mention?1:0)|(o.httpLink?2:0)|(o.pearLink?4:0)|(o.bold?8:0)|(o.italic?16:0)|(o.code?32:0)|(o.emoji?64:0)|(o.codeBlock?128:0)|(o.strike?256:0)|(o.translation?512:0);e.uint.preencode(d,n),o.mention&&ro.preencode(d,o.mention),o.httpLink&&to.preencode(d,o.httpLink),o.pearLink&&io.preencode(d,o.pearLink),o.bold&&ao.preencode(d,o.bold),o.italic&&so.preencode(d,o.italic),o.code&&po.preencode(d,o.code),o.emoji&&uo.preencode(d,o.emoji),o.codeBlock&&lo.preencode(d,o.codeBlock),o.strike&&fo.preencode(d,o.strike),o.translation&&mo.preencode(d,o.translation)},encode(d,o){const n=(o.mention?1:0)|(o.httpLink?2:0)|(o.pearLink?4:0)|(o.bold?8:0)|(o.italic?16:0)|(o.code?32:0)|(o.emoji?64:0)|(o.codeBlock?128:0)|(o.strike?256:0)|(o.translation?512:0);e.uint.encode(d,n),o.mention&&ro.encode(d,o.mention),o.httpLink&&to.encode(d,o.httpLink),o.pearLink&&io.encode(d,o.pearLink),o.bold&&ao.encode(d,o.bold),o.italic&&so.encode(d,o.italic),o.code&&po.encode(d,o.code),o.emoji&&uo.encode(d,o.emoji),o.codeBlock&&lo.encode(d,o.codeBlock),o.strike&&fo.encode(d,o.strike),o.translation&&mo.encode(d,o.translation)},decode(d){const o=e.uint.decode(d);return{mention:1&o?ro.decode(d):null,httpLink:2&o?to.decode(d):null,pearLink:4&o?io.decode(d):null,bold:8&o?ao.decode(d):null,italic:16&o?so.decode(d):null,code:32&o?po.decode(d):null,emoji:64&o?uo.decode(d):null,codeBlock:128&o?lo.decode(d):null,strike:256&o?fo.decode(d):null,translation:512&o?mo.decode(d):null}}},xo=e.array(e.frame(g)),bo=e.frame(yo),vo=e.frame(Ud),go={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&xo.preencode(d,o.files),o.display&&bo.preencode(d,o.display),o.replyTo&&n.preencode(d,o.replyTo),o.parent&&n.preencode(d,o.parent),o.event&&vo.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>=3&&c.forwarded?64:0);e.uint.encode(o,r),c.text&&e.string.encode(o,c.text),c.files&&xo.encode(o,c.files),c.display&&bo.encode(o,c.display),c.replyTo&&n.encode(o,c.replyTo),c.parent&&n.encode(o,c.parent),c.event&&vo.encode(o,c.event)},decode(o){const c=e.uint.decode(o);return{text:1&c?e.string.decode(o):null,files:2&c?xo.decode(o):null,display:4&c?bo.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,event:32&c?vo.decode(o):null,forwarded:d>=3&&!!(64&c)}}},ko=_d,Ko=bo,ho={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&ko.preencode(d,o.files),o.display&&Ko.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>=3&&c.forwarded?32:0);e.uint.encode(o,r),c.text&&e.string.encode(o,c.text),c.files&&ko.encode(o,c.files),c.display&&Ko.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?ko.decode(o):null,display:4&c?Ko.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,forwarded:d>=3&&!!(32&c)}}},wo=xo,Po=bo,To={preencode(d,o){d.end++,o.text&&e.string.preencode(d,o.text),o.files&&wo.preencode(d,o.files),o.display&&Po.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>=3&&c.forwarded?32:0);e.uint.encode(o,r),c.text&&e.string.encode(o,c.text),c.files&&wo.encode(o,c.files),c.display&&Po.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?wo.decode(o):null,display:4&c?Po.decode(o):null,replyTo:8&c?n.decode(o):null,parent:16&c?n.decode(o):null,forwarded:d>=3&&!!(32&c)}}},Ro={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)}}},Ao={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)})},So=e.frame(B),Io={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&&So.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&&So.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?So.decode(d):null}}},Mo=e.frame(Ro),Fo=e.frame(ho),qo=e.frame(Nd),Co={preencode(d,o){Ao.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),Mo.preencode(d,o.status),o.message&&Fo.preencode(d,o.message),o.event&&qo.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);Ao.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),Mo.encode(d,o.status),o.message&&Fo.encode(d,o.message),o.event&&qo.encode(d,o.event)},decode(d){const o=Ao.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:Mo.decode(d),message:2&i?Fo.decode(d):null,event:4&i?qo.decode(d):null}}},Vo=Mo,Ho=e.frame(To),Do=qo,Lo={preencode(d,o){Ao.preencode(d,o.id),n.preencode(d,o.oplog),e.uint.preencode(d,o.clock),e.uint.preencode(d,o.timestamp),d.end++,o.editedAt&&e.uint.preencode(d,o.editedAt),Vo.preencode(d,o.status),o.message&&Ho.preencode(d,o.message),o.event&&Do.preencode(d,o.event)},encode(d,o){const c=(o.editedAt?1:0)|(o.message?2:0)|(o.event?4:0);Ao.encode(d,o.id),n.encode(d,o.oplog),e.uint.encode(d,o.clock),e.uint.encode(d,o.timestamp),e.uint.encode(d,c),o.editedAt&&e.uint.encode(d,o.editedAt),Vo.encode(d,o.status),o.message&&Ho.encode(d,o.message),o.event&&Do.encode(d,o.event)},decode(d){const o=Ao.decode(d),c=n.decode(d),r=e.uint.decode(d),t=e.uint.decode(d),i=e.uint.decode(d);return{id:o,oplog:c,clock:r,timestamp:t,editedAt:1&i?e.uint.decode(d):0,status:Vo.decode(d),message:2&i?Ho.decode(d):null,event:4&i?Do.decode(d):null}}},jo=de,Eo=e.frame(go),Bo={preencode(e,d){jo.preencode(e,d.header),Eo.preencode(e,d.message)},encode(e,d){jo.encode(e,d.header),Eo.encode(e,d.message)},decode:e=>({header:jo.decode(e),message:Eo.decode(e)})},zo=de,Oo={preencode(e,d){zo.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){zo.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:zo.decode(e),oplog:n.decode(e)})},No=de,Uo=Eo,Jo={preencode(e,d){No.preencode(e,d.header),n.preencode(e,d.oplog),Uo.preencode(e,d.message)},encode(e,d){No.encode(e,d.header),n.encode(e,d.oplog),Uo.encode(e,d.message)},decode:e=>({header:No.decode(e),oplog:n.decode(e),message:Uo.decode(e)})},Wo=de,Go={preencode(e,d){Wo.preencode(e,d.header),n.preencode(e,d.oplog),e.end++},encode(d,o){const c=o.isPinned?1:0;Wo.encode(d,o.header),n.encode(d,o.oplog),e.uint.encode(d,c)},decode:d=>({header:Wo.decode(d),oplog:n.decode(d),isPinned:!!(1&e.uint.decode(d))})},Qo={HttpLink:1,PearLink:2},Xo={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)},Yo=de,Zo={preencode(d,o){Yo.preencode(d,o.header),n.preencode(d,o.oplog),e.uint.preencode(d,o.index),al.preencode(d,o.preview),d.end++,o.displayType&&Xo.preencode(d,o.displayType)},encode(d,o){const c=o.displayType?1:0;Yo.encode(d,o.header),n.encode(d,o.oplog),e.uint.encode(d,o.index),al.encode(d,o.preview),e.uint.encode(d,c),o.displayType&&Xo.encode(d,o.displayType)},decode:d=>({header:Yo.decode(d),oplog:n.decode(d),index:e.uint.decode(d),preview:al.decode(d),displayType:1&e.uint.decode(d)?Xo.decode(d):0})},$o={preencode(d,o){Ao.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){Ao.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:Ao.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),reaction:e.string.decode(d)})},_o={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)})},en=e.array(e.frame(_o)),dn={preencode(d,o){Ao.preencode(d,o.id),e.uint.preencode(d,o.total),en.preencode(d,o.reactions),d.end++,o.editedAt&&e.uint.preencode(d,o.editedAt)},encode(d,o){const n=o.editedAt?1:0;Ao.encode(d,o.id),e.uint.encode(d,o.total),en.encode(d,o.reactions),e.uint.encode(d,n),o.editedAt&&e.uint.encode(d,o.editedAt)},decode:d=>({id:Ao.decode(d),total:e.uint.decode(d),reactions:en.decode(d),editedAt:1&e.uint.decode(d)?e.uint.decode(d):0})},on=de,nn={preencode(d,o){on.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){on.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:on.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},cn=de,rn={preencode(d,o){cn.preencode(d,o.header),n.preencode(d,o.oplog),e.string.preencode(d,o.reaction)},encode(d,o){cn.encode(d,o.header),n.encode(d,o.oplog),e.string.encode(d,o.reaction)},decode:d=>({header:cn.decode(d),oplog:n.decode(d),reaction:e.string.decode(d)})},tn=de,an=e.frame(_),sn={preencode(d,o){tn.preencode(d,o.header),e.uint.preencode(d,o.key),an.preencode(d,o.config)},encode(d,o){tn.encode(d,o.header),e.uint.encode(d,o.key),an.encode(d,o.config)},decode:d=>({header:tn.decode(d),key:e.uint.decode(d),config:an.decode(d)})},pn={preencode(d,o){e.fixed32.preencode(d,o.memberKey),e.string.preencode(d,o.displayName),d.end++,o.avatar&&sl.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&&sl.encode(d,o.avatar)},decode:d=>({memberKey:e.fixed32.decode(d),displayName:e.string.decode(d),avatar:1&e.uint.decode(d)?sl.decode(d):null})},un={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})},ln=e.frame(un),fn={preencode(d,o){e.fixed32.preencode(d,o.publicKey),d.end++,o.discoveryCoreKey&&e.fixed32.preencode(d,o.discoveryCoreKey),o.userRegistry&&ln.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&&ln.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?ln.decode(d):null}}},mn=de,yn=e.frame(W),xn=e.frame(G),bn=an,vn=e.frame(fn),gn=he,kn=e.array(e.frame(me)),Kn={preencode(e,d){mn.preencode(e,d.header),yn.preencode(e,d.digest),xn.preencode(e,d.capabilities),e.end++,d.config&&bn.preencode(e,d.config),d.identity&&vn.preencode(e,d.identity),d.bootstrapDevice&&gn.preencode(e,d.bootstrapDevice),d.initialMembers&&kn.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);mn.encode(d,o.header),yn.encode(d,o.digest),xn.encode(d,o.capabilities),e.uint.encode(d,n),o.config&&bn.encode(d,o.config),o.identity&&vn.encode(d,o.identity),o.bootstrapDevice&&gn.encode(d,o.bootstrapDevice),o.initialMembers&&kn.encode(d,o.initialMembers)},decode(d){const o=mn.decode(d),n=yn.decode(d),c=xn.decode(d),r=e.uint.decode(d);return{header:o,digest:n,capabilities:c,config:1&r?bn.decode(d):null,identity:2&r?vn.decode(d):null,bootstrapDevice:4&r?gn.decode(d):null,initialMembers:8&r?kn.decode(d):null}}},hn=de,wn={preencode(d,o){hn.preencode(d,o.header),e.uint.preencode(d,o.version)},encode(d,o){hn.encode(d,o.header),e.uint.encode(d,o.version)},decode:d=>({header:hn.decode(d),version:e.uint.decode(d)})},Pn=de,Tn={preencode(o,n){Pn.preencode(o,n.header),e.uint.preencode(o,n.from),e.uint.preencode(o,n.to),o.end++,d>=5&&n.buildType&&Dp.preencode(o,n.buildType)},encode(o,n){const c=d>=5&&n.buildType?1:0;Pn.encode(o,n.header),e.uint.encode(o,n.from),e.uint.encode(o,n.to),e.uint.encode(o,c),d>=5&&n.buildType&&Dp.encode(o,n.buildType)},decode(o){const n=Pn.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>=5&&1&t?Dp.decode(o):null}}},Rn={RoomType:1,IsExperimental:2,IsJoiningDisabled:3,IsAppendingDisabled:4,IsCallingDisabled:5,IsMembershipEventsDisabled:6,IsAttachmentsDisabled:7,IsLinksDisabled:8,IsRoomInviteHidden:9},An={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)},Sn=de,In=J,Mn={preencode(d,o){Sn.preencode(d,o.header),e.uint.preencode(d,o.key),In.preencode(d,o.settings)},encode(d,o){Sn.encode(d,o.header),e.uint.encode(d,o.key),In.encode(d,o.settings)},decode:d=>({header:Sn.decode(d),key:e.uint.decode(d),settings:In.decode(d)})},Fn=de,qn={preencode(d,o){Fn.preencode(d,o.header),e.uint.preencode(d,o.value)},encode(d,o){Fn.encode(d,o.header),e.uint.encode(d,o.value)},decode:d=>({header:Fn.decode(d),value:e.uint.decode(d)})},Cn={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)})},Vn={Flag:1},Hn={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)},Dn={preencode(d,o){Ao.preencode(d,o.id),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),Hn.preencode(d,o.label)},encode(d,o){Ao.encode(d,o.id),e.fixed32.encode(d,o.sender),e.uint.encode(d,o.clock),Hn.encode(d,o.label)},decode:d=>({id:Ao.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:Hn.decode(d)})},Ln=de,jn={preencode(e,d){Ln.preencode(e,d.header),n.preencode(e,d.oplog),Hn.preencode(e,d.label)},encode(e,d){Ln.encode(e,d.header),n.encode(e,d.oplog),Hn.encode(e,d.label)},decode:e=>({header:Ln.decode(e),oplog:n.decode(e),label:Hn.decode(e)})},En=de,Bn={preencode(e,d){En.preencode(e,d.header),n.preencode(e,d.oplog),Hn.preencode(e,d.label)},encode(e,d){En.encode(e,d.header),n.encode(e,d.oplog),Hn.encode(e,d.label)},decode:e=>({header:En.decode(e),oplog:n.decode(e),label:Hn.decode(e)})},zn={preencode(d,o){Hn.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){Hn.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:Hn.decode(d),count:e.uint.decode(d)})},On=e.array(e.frame(zn)),Nn={preencode(d,o){Ao.preencode(d,o.id),e.uint.preencode(d,o.total),On.preencode(d,o.labels),e.uint.preencode(d,o.editedAt),d.end++,o.flagsClock&&e.uint.preencode(d,o.flagsClock),o.version&&e.uint.preencode(d,o.version)},encode(d,o){const n=(o.flagsClock?1:0)|(o.version?2:0)|(o.isDeleted?4:0);Ao.encode(d,o.id),e.uint.encode(d,o.total),On.encode(d,o.labels),e.uint.encode(d,o.editedAt),e.uint.encode(d,n),o.flagsClock&&e.uint.encode(d,o.flagsClock),o.version&&e.uint.encode(d,o.version)},decode(d){const o=Ao.decode(d),n=e.uint.decode(d),c=On.decode(d),r=e.uint.decode(d),t=e.uint.decode(d);return{id:o,total:n,labels:c,editedAt:r,flagsClock:1&t?e.uint.decode(d):0,version:2&t?e.uint.decode(d):0,isDeleted:!!(4&t)}}},Un=de,Jn={preencode(d,o){Un.preencode(d,o.header),e.uint.preencode(d,o.length)},encode(d,o){Un.encode(d,o.header),e.uint.encode(d,o.length)},decode:d=>({header:Un.decode(d),length:e.uint.decode(d)})},Wn={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)})},Gn=ee,Qn=e.frame(be),Xn={preencode(o,n){e.fixed32.preencode(o,n.memberKey),pl.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=8&&n.contactInfo&&Qn.preencode(o,n.contactInfo),d>=8&&n.version&&e.uint.preencode(o,n.version),d>=10&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=8&&n.contactInfo?4:0)|(d>=8&&n.version?8:0)|(d>=10&&n.alias?16:0);e.fixed32.encode(o,n.memberKey),pl.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>=8&&n.contactInfo&&Qn.encode(o,n.contactInfo),d>=8&&n.version&&e.uint.encode(o,n.version),d>=10&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=pl.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>=8&&4&r?Qn.decode(o):null,version:d>=8&&8&r?e.uint.decode(o):0,alias:d>=10&&16&r?e.string.decode(o):null}}},Yn={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)})},Zn=e.array(e.frame(Yn)),$n=$,_n={preencode(e,d){Zn.preencode(e,d.sharedRooms),$n.preencode(e,d.blockedContacts)},encode(e,d){Zn.encode(e,d.sharedRooms),$n.encode(e,d.blockedContacts)},decode:e=>({sharedRooms:Zn.decode(e),blockedContacts:$n.decode(e)})},ec=vn,dc={preencode(e,d){ec.preencode(e,d.identity)},encode(e,d){ec.encode(e,d.identity)},decode:e=>({identity:ec.decode(e)})},oc={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)})},nc={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)})},cc={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)})},rc={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)})},tc=e.frame(rc),ic={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&&tc.preencode(n,c.identity),d>=5&&c.buildType&&Dp.preencode(n,c.buildType),d>=13&&c.link&&o.preencode(n,c.link)},encode(n,c){const t=(c.identity?1:0)|(d>=5&&c.buildType?2:0)|(d>=13&&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&&tc.encode(n,c.identity),d>=5&&c.buildType&&Dp.encode(n,c.buildType),d>=13&&c.link&&o.encode(n,c.link)},decode(n){const c=e.fixed32.decode(n),t=e.fixed32.decode(n),i=e.fixed32.decode(n),a=r.decode(n),s=o.decode(n),p=o.decode(n),u=e.uint.decode(n);return{id:c,invitationSeed:t,mailbox:i,responseKeyPair:a,initiator:s,inviter:p,identity:1&u?tc.decode(n):null,buildType:d>=5&&2&u?Dp.decode(n):null,link:d>=13&&4&u?o.decode(n):null}}},ac=de,sc={preencode(d,o){ac.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){ac.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:ac.decode(d),blindResponse:e.buffer.decode(d)})},pc=de,uc=e.frame(ic),lc={preencode(e,d){pc.preencode(e,d.header),uc.preencode(e,d.invitation)},encode(e,d){pc.encode(e,d.header),uc.encode(e,d.invitation)},decode:e=>({header:pc.decode(e),invitation:uc.decode(e)})},fc=de,mc={preencode(d,o){fc.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){fc.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:fc.decode(d),id:e.fixed32.decode(d)})},yc={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)}}},xc={preencode(d,o){e.fixed32.preencode(d,o.publicKey),e.fixed32.preencode(d,o.writerKey),e.fixed32.preencode(d,o.devicePublicKey),d.end++,o.privateProfileKey&&e.fixed32.preencode(d,o.privateProfileKey)},encode(d,o){const n=o.privateProfileKey?1:0;e.fixed32.encode(d,o.publicKey),e.fixed32.encode(d,o.writerKey),e.fixed32.encode(d,o.devicePublicKey),e.uint.encode(d,n),o.privateProfileKey&&e.fixed32.encode(d,o.privateProfileKey)},decode:d=>({publicKey:e.fixed32.decode(d),writerKey:e.fixed32.decode(d),devicePublicKey:e.fixed32.decode(d),privateProfileKey:1&e.uint.decode(d)?e.fixed32.decode(d):null})},bc={preencode(o,n){o.end++,d>=11&&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)|(n.isReadOnly?8:0)|(d>=3&&n.isFavorite?16:0)|(d>=7&&n.isUnread?32:0)|(d>=11&&n.roomSnoozeTime?64:0);e.uint.encode(o,c),d>=11&&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:!!(8&n),isFavorite:d>=3&&!!(16&n),isUnread:d>=7&&!!(32&n),roomSnoozeTime:d>=11&&64&n?e.uint.decode(o):0}}},vc=e.frame(bc),gc=e.frame(yc),kc=tc,Kc={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),vc.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&&gc.preencode(n,c.identitySwap),c.identitySwapV2&&kc.preencode(n,c.identitySwapV2),c.contact&&e.fixed32.preencode(n,c.contact),d>=13&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=15&&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)|(c.identitySwapV2?8:0)|(c.contact?16:0)|(d>=13&&c.bootFrom?32:0)|(d>=15&&c.activeClock?64:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),vc.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&&gc.encode(n,c.identitySwap),c.identitySwapV2&&kc.encode(n,c.identitySwapV2),c.contact&&e.fixed32.encode(n,c.contact),d>=13&&c.bootFrom&&o.encode(n,c.bootFrom),d>=15&&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=vc.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?gc.decode(n):null,identitySwapV2:8&s?kc.decode(n):null,contact:16&s?e.fixed32.decode(n):null,bootFrom:d>=13&&32&s?o.decode(n):null,activeClock:d>=15&&64&s?e.uint.decode(n):0}}},hc=de,wc={preencode(d,n){hc.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(d,n){const c=(n.fastForwardTo?1:0)|(n.initiator?2:0)|(n.dm?4:0)|(n.isReadOnly?8:0);hc.encode(d,n.header),e.fixed32.encode(d,n.roomKey),e.buffer.encode(d,n.encryptionKey),e.fixed32.encode(d,n.mailbox),e.uint.encode(d,c),n.fastForwardTo&&e.fixed32.encode(d,n.fastForwardTo),n.initiator&&o.encode(d,n.initiator),n.dm&&e.fixed32.encode(d,n.dm)},decode(d){const n=hc.decode(d),c=e.fixed32.decode(d),r=e.buffer.decode(d),t=e.fixed32.decode(d),i=e.uint.decode(d);return{header:n,roomKey:c,encryptionKey:r,mailbox:t,fastForwardTo:1&i?e.fixed32.decode(d):null,initiator:2&i?o.decode(d):null,dm:4&i?e.fixed32.decode(d):null,isReadOnly:!!(8&i)}}},Pc=de,Tc={preencode(d,o){Pc.preencode(d,o.header),e.fixed32.preencode(d,o.discoveryKey)},encode(d,o){Pc.encode(d,o.header),e.fixed32.encode(d,o.discoveryKey)},decode:d=>({header:Pc.decode(d),discoveryKey:e.fixed32.decode(d)})},Rc=de,Ac=vc,Sc={preencode(d,o){Rc.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),Ac.preencode(d,o.status)},encode(d,o){Rc.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),Ac.encode(d,o.status)},decode:d=>({header:Rc.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),status:Ac.decode(d)})},Ic={preencode(e,d){e.end++},encode(o,n){const c=(n.isBlocked?1:0)|(d>=8&&n.isActive?2:0);e.uint.encode(o,c)},decode(o){const n=e.uint.decode(o);return{isBlocked:!!(1&n),isActive:d>=8&&!!(2&n)}}},Mc=Qn,Fc={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),ul.preencode(o,n.status),o.end++,n.mailbox&&e.fixed32.preencode(o,n.mailbox),n.roomKey&&e.fixed32.preencode(o,n.roomKey),d>=8&&n.contactInfo&&Mc.preencode(o,n.contactInfo),d>=10&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=(n.mailbox?1:0)|(n.roomKey?2:0)|(d>=8&&n.contactInfo?4:0)|(d>=10&&n.alias?8:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),ul.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>=8&&n.contactInfo&&Mc.encode(o,n.contactInfo),d>=10&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=ul.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>=8&&4&t?Mc.decode(o):null,alias:d>=10&&8&t?e.string.decode(o):null}}},qc=de,Cc=e.frame(Xn),Vc={preencode(e,d){qc.preencode(e,d.header),Cc.preencode(e,d.contact)},encode(e,d){qc.encode(e,d.header),Cc.encode(e,d.contact)},decode:e=>({header:qc.decode(e),contact:Cc.decode(e)})},Hc=de,Dc={preencode(d,o){Hc.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),ll.preencode(d,o.status)},encode(d,o){Hc.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),ll.encode(d,o.status)},decode:d=>({header:Hc.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:ll.decode(d)})},Lc=de,jc={preencode(d,o){Lc.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Lc.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:Lc.decode(d),memberKey:e.fixed32.decode(d)})},Ec=de,Bc={preencode(d,o){Ec.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Ec.encode(d,o.header),e.fixed32.encode(d,o.memberKey)},decode:d=>({header:Ec.decode(d),memberKey:e.fixed32.decode(d)})},zc={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)}}},Oc=we,Nc=e.frame(t),Uc={preencode(d,o){Oc.preencode(d,o.sender),Nc.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;Oc.encode(d,o.sender),Nc.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:Oc.decode(d),keys:Nc.decode(d),mailbox:e.fixed32.decode(d),message:1&e.uint.decode(d)?e.string.decode(d):null})},Jc=e.frame(Uc),Wc={preencode(o,n){Jc.preencode(o,n.body),te.preencode(o,n.attestation),o.end++,d>=17&&n.recipientProof&&e.buffer.preencode(o,n.recipientProof)},encode(o,n){const c=d>=17&&n.recipientProof?1:0;Jc.encode(o,n.body),te.encode(o,n.attestation),e.uint.encode(o,c),d>=17&&n.recipientProof&&e.buffer.encode(o,n.recipientProof)},decode(o){const n=Jc.decode(o),c=te.decode(o),r=o.start<o.end?e.uint.decode(o):0;return{body:n,attestation:c,recipientProof:d>=17&&1&r?e.buffer.decode(o):null}}},Gc=fe,Qc=e.frame(zc),Xc=Nc,Yc=Qn,Zc={preencode(o,n){e.fixed32.preencode(o,n.memberKey),e.uint.preencode(o,n.clock),Gc.preencode(o,n.sender),Qc.preencode(o,n.status),Xc.preencode(o,n.keys),e.fixed32.preencode(o,n.mailbox),o.end++,n.message&&e.string.preencode(o,n.message),n.sentAt&&e.uint.preencode(o,n.sentAt),d>=8&&n.contactInfo&&Yc.preencode(o,n.contactInfo)},encode(o,n){const c=(n.message?1:0)|(n.sentAt?2:0)|(d>=8&&n.contactInfo?4:0);e.fixed32.encode(o,n.memberKey),e.uint.encode(o,n.clock),Gc.encode(o,n.sender),Qc.encode(o,n.status),Xc.encode(o,n.keys),e.fixed32.encode(o,n.mailbox),e.uint.encode(o,c),n.message&&e.string.encode(o,n.message),n.sentAt&&e.uint.encode(o,n.sentAt),d>=8&&n.contactInfo&&Yc.encode(o,n.contactInfo)},decode(o){const n=e.fixed32.decode(o),c=e.uint.decode(o),r=Gc.decode(o),t=Qc.decode(o),i=Xc.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:2&s?e.uint.decode(o):0,contactInfo:d>=8&&4&s?Yc.decode(o):null}}},$c=de,_c={preencode(d,o){$c.preencode(d,o.header),e.buffer.preencode(d,o.blindRequest)},encode(d,o){$c.encode(d,o.header),e.buffer.encode(d,o.blindRequest)},decode:d=>({header:$c.decode(d),blindRequest:e.buffer.decode(d)})},er=de,dr=Qc,or={preencode(d,o){er.preencode(d,o.header),e.fixed32.preencode(d,o.memberKey),e.uint.preencode(d,o.key),dr.preencode(d,o.status),d.end++,o.roomKey&&e.fixed32.preencode(d,o.roomKey)},encode(d,o){const n=o.roomKey?1:0;er.encode(d,o.header),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,o.key),dr.encode(d,o.status),e.uint.encode(d,n),o.roomKey&&e.fixed32.encode(d,o.roomKey)},decode:d=>({header:er.decode(d),memberKey:e.fixed32.decode(d),key:e.uint.decode(d),status:dr.decode(d),roomKey:1&e.uint.decode(d)?e.fixed32.decode(d):null})},nr={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)})},cr={preencode(d,o){const n=o.version??1;switch(e.uint.preencode(d,n),n){case 0:case 1:nr.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:nr.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=nr.decode(d);return e.version=o,e}default:throw new Error("Unsupported version")}}},rr={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)})},tr=de,ir={preencode(d,o){tr.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){tr.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:tr.decode(d),key:e.fixed32.decode(d)})},ar=de,sr={preencode(d,o){ar.preencode(d,o.header),e.fixed32.preencode(d,o.key)},encode(d,o){ar.encode(d,o.header),e.fixed32.encode(d,o.key)},decode:d=>({header:ar.decode(d),key:e.fixed32.decode(d)})},pr={preencode(o,n){o.end++,d>=9&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(n.disableReadReceipts?1:0)|(d>=7&&n.stripAttachmentMetadata?2:0)|(d>=9&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=9&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:!!(1&n),stripAttachmentMetadata:d>=7&&!!(2&n),profileSnoozeTime:d>=9&&4&n?e.uint.decode(o):0}}},ur={disableReadReceipts:"disableReadReceipts",stripAttachmentMetadata:"stripAttachmentMetadata",profileSnoozeTime:"profileSnoozeTime"},lr={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}}},fr=de,mr=e.frame(pr),yr={preencode(e,d){fr.preencode(e,d.header),lr.preencode(e,d.key),mr.preencode(e,d.settings)},encode(e,d){fr.encode(e,d.header),lr.encode(e,d.key),mr.encode(e,d.settings)},decode:e=>({header:fr.decode(e),key:lr.decode(e),settings:mr.decode(e)})},xr={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)}}},br={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)})},vr=F,gr=$,kr={preencode(e,d){e.end++,d.blockedMembers&&gr.preencode(e,d.blockedMembers)},encode(d,o){const n=o.blockedMembers?1:0;e.uint.encode(d,n),o.blockedMembers&&gr.encode(d,o.blockedMembers)},decode:d=>({blockedMembers:1&e.uint.decode(d)?gr.decode(d):null})},Kr=e.frame(Q),hr=e.frame(kr),wr={preencode(d,n){e.buffer.preencode(d,n.encryptionKey),e.fixed32.preencode(d,n.seed),Kr.preencode(d,n.capabilities),o.preencode(d,n.initiator),e.fixed32.preencode(d,n.fastForwardTo),d.end++,n.privateProfile&&hr.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),Kr.encode(d,n.capabilities),o.encode(d,n.initiator),e.fixed32.encode(d,n.fastForwardTo),e.uint.encode(d,c),n.privateProfile&&hr.encode(d,n.privateProfile)},decode:d=>({encryptionKey:e.buffer.decode(d),seed:e.fixed32.decode(d),capabilities:Kr.decode(d),initiator:o.decode(d),fastForwardTo:e.fixed32.decode(d),privateProfile:1&e.uint.decode(d)?hr.decode(d):null})},Pr={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})},Tr=e.frame(wr),Rr={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.priority),d.end++,o.v3&&Tr.preencode(d,o.v3),o.timestamp&&e.uint.preencode(d,o.timestamp)},encode(d,o){const n=(o.v3?1:0)|(o.errored?2:0)|(o.timestamp?4:0);e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.priority),e.uint.encode(d,n),o.v3&&Tr.encode(d,o.v3),o.timestamp&&e.uint.encode(d,o.timestamp)},decode(d){const o=e.fixed32.decode(d),n=e.uint.decode(d),c=e.uint.decode(d);return{roomKey:o,priority:n,v3:1&c?Tr.decode(d):null,errored:!!(2&c),timestamp:4&c?e.uint.decode(d):0}}},Ar={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))})},Sr={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)})},Ir=e.frame(Ar),Mr=gc,Fr=e.frame(xc),qr={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),Ir.preencode(o,n.status),o.end++,n.entropy&&e.buffer.preencode(o,n.entropy),n.swap&&Mr.preencode(o,n.swap),n.swapV2&&Fr.preencode(o,n.swapV2),d>=7&&n.proofShortenedAt&&e.uint.preencode(o,n.proofShortenedAt)},encode(o,n){const c=(n.entropy?1:0)|(n.swap?2:0)|(n.swapV2?4:0)|(d>=7&&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),Ir.encode(o,n.status),e.uint.encode(o,c),n.entropy&&e.buffer.encode(o,n.entropy),n.swap&&Mr.encode(o,n.swap),n.swapV2&&Fr.encode(o,n.swapV2),d>=7&&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=Ir.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?Mr.decode(o):null,swapV2:4&s?Fr.decode(o):null,proofShortenedAt:d>=7&&8&s?e.uint.decode(o):0}}},Cr={RestoreIdentity:1,CreateRoom:2,LeaveRoom:3,ClearRoom:4,JoinRoomInvitation:5,JoinRoomKeys:6,JoinRoomResponse:7,SendContactRequest:8,TestFastTask:9,TestSlowTask:10,TestErrorTask:11},Vr={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)},Hr={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}}},Dr=uc,Lr={preencode(e,d){Dr.preencode(e,d.invitation)},encode(e,d){Dr.encode(e,d.invitation)},decode:e=>({invitation:Dr.decode(e)})},jr={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)})},Er=ee,Br={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}}},zr=e.frame(Br),Or={preencode(o,n){zr.preencode(o,n.keys),o.end++,d>=15&&n.activeClock&&e.uint.preencode(o,n.activeClock)},encode(o,n){const c=(d>=15&&n.activeClock?1:0)|(d>=15&&n.isReadOnly?2:0);zr.encode(o,n.keys),e.uint.encode(o,c),d>=15&&n.activeClock&&e.uint.encode(o,n.activeClock)},decode(o){const n=zr.decode(o),c=o.start<o.end?e.uint.decode(o):0;return{keys:n,activeClock:d>=15&&1&c?e.uint.decode(o):0,isReadOnly:d>=15&&!!(2&c)}}},Nr=e.frame(Kn),Ur={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&&Nr.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&&Nr.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?Nr.decode(d):null,isPrivateProfile:!!(32&t)}}},Jr={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))})},Wr={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)})},Gr={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)}}},Qr=Qn,Xr={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.fixed32.preencode(d,o.memberKey),d.end++,o.message&&e.string.preencode(d,o.message),o.contactInfo&&Qr.preencode(d,o.contactInfo)},encode(d,o){const n=(o.message?1:0)|(o.contactInfo?2:0);e.fixed32.encode(d,o.roomKey),e.fixed32.encode(d,o.memberKey),e.uint.encode(d,n),o.message&&e.string.encode(d,o.message),o.contactInfo&&Qr.encode(d,o.contactInfo)},decode(d){const o=e.fixed32.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{roomKey:o,memberKey:n,message:1&c?e.string.decode(d):null,contactInfo:2&c?Qr.decode(d):null}}},Yr={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))})},Zr=e.frame(Gr),$r=e.frame(Ur),_r=e.frame(Jr),et=e.frame(Wr),dt=e.frame(Lr),ot=e.frame(Or),nt=e.frame(jr),ct=e.frame(Xr),rt=e.frame(Yr),tt={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&&Zr.preencode(d,o.restoreIdentity),o.createRoom&&$r.preencode(d,o.createRoom),o.leaveRoom&&_r.preencode(d,o.leaveRoom),o.clearRoom&&et.preencode(d,o.clearRoom),o.joinRoomInvitation&&dt.preencode(d,o.joinRoomInvitation),o.joinRoomKeys&&ot.preencode(d,o.joinRoomKeys),o.joinRoomResponse&&nt.preencode(d,o.joinRoomResponse),o.sendContactRequest&&ct.preencode(d,o.sendContactRequest),o.migrateV2Room&&rt.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&&Zr.encode(d,o.restoreIdentity),o.createRoom&&$r.encode(d,o.createRoom),o.leaveRoom&&_r.encode(d,o.leaveRoom),o.clearRoom&&et.encode(d,o.clearRoom),o.joinRoomInvitation&&dt.encode(d,o.joinRoomInvitation),o.joinRoomKeys&&ot.encode(d,o.joinRoomKeys),o.joinRoomResponse&&nt.encode(d,o.joinRoomResponse),o.sendContactRequest&&ct.encode(d,o.sendContactRequest),o.migrateV2Room&&rt.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?Zr.decode(d):null,createRoom:2&t?$r.decode(d):null,leaveRoom:4&t?_r.decode(d):null,clearRoom:8&t?et.decode(d):null,joinRoomInvitation:16&t?dt.decode(d):null,joinRoomKeys:32&t?ot.decode(d):null,joinRoomResponse:64&t?nt.decode(d):null,sendContactRequest:128&t?ct.decode(d):null,migrateV2Room:256&t?rt.decode(d):null}}},it=Oe,at={preencode(d,o){e.buffer.preencode(d,o.seed),it.preencode(d,o.invitation)},encode(d,o){e.buffer.encode(d,o.seed),it.encode(d,o.invitation)},decode:d=>({seed:e.buffer.decode(d),invitation:it.decode(d)})},st={preencode(e,d){e.end++},encode(d,o){const n=(o.isWritable?1:0)|(o.isReadable?2:0)|(o.isPrivateProfile?4:0)|(o.isRemoved?8:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isWritable:!!(1&o),isReadable:!!(2&o),isPrivateProfile:!!(4&o),isRemoved:!!(8&o)}}},pt={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)})},ut=yn,lt=So,ft=e.frame(pt),mt=Kr,yt=e.frame(st),xt=e.frame(pe),bt=e.frame(hd),vt=an,gt=vn,kt=e.frame(Lo),Kt=$,ht=e.array(e.frame(Wn)),wt=e.frame(gd),Pt=vc,Tt={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)|(n.readLengths?64:0)|(n.lastMember?128:0)|(n.version?256:0)|(d>=3&&n.preferences?512:0)|(d>=4&&n.activeCall?1024:0)|(d>=8&&n.lastMessageLabels?2048:0)|(d>=9&&n.settings?4096:0)|(d>=13&&n.system?8192:0)|(d>=13&&n.processed?16384:0);e.fixed32.preencode(o,n.roomKey),e.fixed32.preencode(o,n.discoveryKey),e.buffer.preencode(o,n.encryptionKey),ut.preencode(o,n.digest),lt.preencode(o,n.stats),ft.preencode(o,n.timestamps),e.uint.preencode(o,n.fork),e.uint.preencode(o,n.length),e.fixed32.preencode(o,n.seed),mt.preencode(o,n.capabilities),yt.preencode(o,n.status),e.uint.preencode(o,c),n.selfDevice&&xt.preencode(o,n.selfDevice),n.selfMember&&bt.preencode(o,n.selfMember),n.config&&vt.preencode(o,n.config),n.identity&>.preencode(o,n.identity),n.lastMessage&&kt.preencode(o,n.lastMessage),n.dm&&Kt.preencode(o,n.dm),n.readLengths&&ht.preencode(o,n.readLengths),n.lastMember&&wt.preencode(o,n.lastMember),n.version&&e.uint.preencode(o,n.version),d>=3&&n.preferences&&Pt.preencode(o,n.preferences),d>=4&&n.activeCall&&fl.preencode(o,n.activeCall),d>=8&&n.lastMessageLabels&&ml.preencode(o,n.lastMessageLabels),d>=9&&n.settings&&yl.preencode(o,n.settings),d>=13&&n.system&&xl.preencode(o,n.system),d>=13&&n.processed&&bl.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)|(n.readLengths?64:0)|(n.lastMember?128:0)|(n.version?256:0)|(d>=3&&n.preferences?512:0)|(d>=4&&n.activeCall?1024:0)|(d>=8&&n.lastMessageLabels?2048:0)|(d>=9&&n.settings?4096:0)|(d>=13&&n.system?8192:0)|(d>=13&&n.processed?16384:0);e.fixed32.encode(o,n.roomKey),e.fixed32.encode(o,n.discoveryKey),e.buffer.encode(o,n.encryptionKey),ut.encode(o,n.digest),lt.encode(o,n.stats),ft.encode(o,n.timestamps),e.uint.encode(o,n.fork),e.uint.encode(o,n.length),e.fixed32.encode(o,n.seed),mt.encode(o,n.capabilities),yt.encode(o,n.status),e.uint.encode(o,c),n.selfDevice&&xt.encode(o,n.selfDevice),n.selfMember&&bt.encode(o,n.selfMember),n.config&&vt.encode(o,n.config),n.identity&>.encode(o,n.identity),n.lastMessage&&kt.encode(o,n.lastMessage),n.dm&&Kt.encode(o,n.dm),n.readLengths&&ht.encode(o,n.readLengths),n.lastMember&&wt.encode(o,n.lastMember),n.version&&e.uint.encode(o,n.version),d>=3&&n.preferences&&Pt.encode(o,n.preferences),d>=4&&n.activeCall&&fl.encode(o,n.activeCall),d>=8&&n.lastMessageLabels&&ml.encode(o,n.lastMessageLabels),d>=9&&n.settings&&yl.encode(o,n.settings),d>=13&&n.system&&xl.encode(o,n.system),d>=13&&n.processed&&bl.encode(o,n.processed)},decode(o){const n=e.fixed32.decode(o),c=e.fixed32.decode(o),r=e.buffer.decode(o),t=ut.decode(o),i=lt.decode(o),a=ft.decode(o),s=e.uint.decode(o),p=e.uint.decode(o),u=e.fixed32.decode(o),l=mt.decode(o),f=yt.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:u,capabilities:l,status:f,selfDevice:1&m?xt.decode(o):null,selfMember:2&m?bt.decode(o):null,config:4&m?vt.decode(o):null,identity:8&m?gt.decode(o):null,lastMessage:16&m?kt.decode(o):null,dm:32&m?Kt.decode(o):null,readLengths:64&m?ht.decode(o):null,lastMember:128&m?wt.decode(o):null,version:256&m?e.uint.decode(o):0,preferences:d>=3&&512&m?Pt.decode(o):null,activeCall:d>=4&&1024&m?fl.decode(o):null,lastMessageLabels:d>=8&&2048&m?ml.decode(o):null,settings:d>=9&&4096&m?yl.decode(o):null,system:d>=13&&8192&m?xl.decode(o):null,processed:d>=13&&16384&m?bl.decode(o):null}}},Rt=vc,At={preencode(d,o){e.fixed32.preencode(d,o.roomKey),Rt.preencode(d,o.status)},encode(d,o){e.fixed32.encode(d,o.roomKey),Rt.encode(d,o.status)},decode:d=>({roomKey:e.fixed32.decode(d),status:Rt.decode(d)})},St={preencode(d,o){e.fixed32.preencode(d,o.roomKey),d.end++,o.repairs&&e.uint.preencode(d,o.repairs)},encode(d,o){const n=o.repairs?1:0;e.fixed32.encode(d,o.roomKey),e.uint.encode(d,n),o.repairs&&e.uint.encode(d,o.repairs)},decode:d=>({roomKey:e.fixed32.decode(d),repairs:1&e.uint.decode(d)?e.uint.decode(d):0})},It={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>=15&&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>=14&&n.pending?8:0)|(d>=15&&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>=15&&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>=14&&!!(8&t),activeClock:d>=15&&16&t?e.uint.decode(o):0}}},Mt={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)})},Ft=fe,qt={preencode(d,o){e.fixed32.preencode(d,o.key),Ft.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),Ft.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),profile:Ft.decode(d)})},Ct=xt,Vt={preencode(d,o){e.fixed32.preencode(d,o.roomKey),Ct.preencode(d,o.device)},encode(d,o){e.fixed32.encode(d,o.roomKey),Ct.encode(d,o.device)},decode:d=>({roomKey:e.fixed32.decode(d),device:Ct.decode(d)})},Ht=k,Dt={preencode(o,n){Ht.preencode(o,n.file),e.fixed32.preencode(o,n.roomKey),o.end++,n.encryptionKey&&e.buffer.preencode(o,n.encryptionKey),d>=4&&n.lastAccessed&&e.uint.preencode(o,n.lastAccessed),d>=4&&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>=4&&n.lastAccessed?8:0)|(d>=4&&n.version?16:0);Ht.encode(o,n.file),e.fixed32.encode(o,n.roomKey),e.uint.encode(o,c),n.encryptionKey&&e.buffer.encode(o,n.encryptionKey),d>=4&&n.lastAccessed&&e.uint.encode(o,n.lastAccessed),d>=4&&n.version&&e.uint.encode(o,n.version)},decode(o){const n=Ht.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>=4&&8&r?e.uint.decode(o):0,version:d>=4&&16&r?e.uint.decode(o):0}}},Lt={preencode(d,o){d.end++,o.key&&e.string.preencode(d,o.key),o.description&&e.string.preencode(d,o.description)},encode(d,o){const n=(o.key?1:0)|(o.value?2:0)|(o.description?4:0);e.uint.encode(d,n),o.key&&e.string.encode(d,o.key),o.description&&e.string.encode(d,o.description)},decode(d){const o=e.uint.decode(d);return{key:1&o?e.string.decode(d):null,value:!!(2&o),description:4&o?e.string.decode(d):null}}},jt=e.array(e.frame(Lt)),Et={preencode(e,d){e.end++,d.flags&&jt.preencode(e,d.flags)},encode(d,o){const n=o.flags?1:0;e.uint.encode(d,n),o.flags&&jt.encode(d,o.flags)},decode:d=>({flags:1&e.uint.decode(d)?jt.decode(d):null})},Bt=ed,zt={preencode(d,o){d.end++,o.nodes&&Bt.preencode(d,o.nodes),o.concurrency&&e.uint.preencode(d,o.concurrency),o.maxWindow&&e.uint.preencode(d,o.maxWindow),o.randomPunchInterval&&e.uint.preencode(d,o.randomPunchInterval),o.connectionKeepAlive&&e.uint.preencode(d,o.connectionKeepAlive)},encode(d,o){const n=(o.nodes?1:0)|(o.concurrency?2:0)|(o.maxWindow?4:0)|(o.randomPunchInterval?8:0)|(o.connectionKeepAlive?16:0);e.uint.encode(d,n),o.nodes&&Bt.encode(d,o.nodes),o.concurrency&&e.uint.encode(d,o.concurrency),o.maxWindow&&e.uint.encode(d,o.maxWindow),o.randomPunchInterval&&e.uint.encode(d,o.randomPunchInterval),o.connectionKeepAlive&&e.uint.encode(d,o.connectionKeepAlive)},decode(d){const o=e.uint.decode(d);return{nodes:1&o?Bt.decode(d):null,concurrency:2&o?e.uint.decode(d):0,maxWindow:4&o?e.uint.decode(d):0,randomPunchInterval:8&o?e.uint.decode(d):0,connectionKeepAlive:16&o?e.uint.decode(d):0}}},Ot={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)})},Nt={preencode(d,o){d.end++,o.roomKey&&e.fixed32.preencode(d,o.roomKey),o.coreKey&&e.fixed32.preencode(d,o.coreKey)},encode(d,o){const n=(o.roomKey?1:0)|(o.coreKey?2:0);e.uint.encode(d,n),o.roomKey&&e.fixed32.encode(d,o.roomKey),o.coreKey&&e.fixed32.encode(d,o.coreKey)},decode(d){const o=e.uint.decode(d);return{roomKey:1&o?e.fixed32.decode(d):null,coreKey:2&o?e.fixed32.decode(d):null}}},Ut=e.frame(Nt),Jt={preencode(d,o){e.string.preencode(d,o.code),e.string.preencode(d,o.message),e.string.preencode(d,o.stack),e.uint.preencode(d,o.timestamp),d.end++,o.details&&Ut.preencode(d,o.details)},encode(d,o){const n=o.details?1:0;e.string.encode(d,o.code),e.string.encode(d,o.message),e.string.encode(d,o.stack),e.uint.encode(d,o.timestamp),e.uint.encode(d,n),o.details&&Ut.encode(d,o.details)},decode:d=>({code:e.string.decode(d),message:e.string.decode(d),stack:e.string.decode(d),timestamp:e.uint.decode(d),details:1&e.uint.decode(d)?Ut.decode(d):null})},Wt={RESUME:1,WAKEUP:2,PRESUSPEND:3,SUSPEND:4},Gt={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)},Qt={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)})},Xt=i,Yt={preencode(d,o){e.uint.preencode(d,o.duration)},encode(d,o){e.uint.encode(d,o.duration)},decode:d=>({duration:e.uint.decode(d)})},Zt=H,$t=H,_t=e.frame(Xt),ei={preencode(e,d){_t.preencode(e,d.header)},encode(e,d){_t.encode(e,d.header)},decode:e=>({header:_t.decode(e)})},di=e.frame(Yt),oi={preencode(e,d){di.preencode(e,d.header)},encode(e,d){di.encode(e,d.header)},decode:e=>({header:di.decode(e)})},ni=_t,ci={preencode(e,d){ni.preencode(e,d.header)},encode(e,d){ni.encode(e,d.header)},decode:e=>({header:ni.decode(e)})},ri=H,ti=_t,ii=an,ai=J,si={preencode(e,d){ti.preencode(e,d.header),e.end++,d.config&&ii.preencode(e,d.config),d.settings&&ai.preencode(e,d.settings)},encode(d,o){const n=(o.config?1:0)|(o.settings?2:0);ti.encode(d,o.header),e.uint.encode(d,n),o.config&&ii.encode(d,o.config),o.settings&&ai.encode(d,o.settings)},decode(d){const o=ti.decode(d),n=e.uint.decode(d);return{header:o,config:1&n?ii.decode(d):null,settings:2&n?ai.decode(d):null}}},pi=di,ui={preencode(d,o){pi.preencode(d,o.header),d.end++,o.roomKey&&e.fixed32.preencode(d,o.roomKey)},encode(d,o){const n=o.roomKey?1:0;pi.encode(d,o.header),e.uint.encode(d,n),o.roomKey&&e.fixed32.encode(d,o.roomKey)},decode:d=>({header:pi.decode(d),roomKey:1&e.uint.decode(d)?e.fixed32.decode(d):null})},li=_t,fi={preencode(d,o){li.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey)},encode(d,o){li.encode(d,o.header),e.fixed32.encode(d,o.roomKey)},decode:d=>({header:li.decode(d),roomKey:e.fixed32.decode(d)})},mi=_t,yi={preencode(d,o){mi.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey)},encode(d,o){mi.encode(d,o.header),e.fixed32.encode(d,o.roomKey)},decode:d=>({header:mi.decode(d),roomKey:e.fixed32.decode(d)})},xi=_t,bi={preencode(d,o){xi.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey)},encode(d,o){xi.encode(d,o.header),e.fixed32.encode(d,o.roomKey)},decode:d=>({header:xi.decode(d),roomKey:e.fixed32.decode(d)})},vi=di,gi={preencode(e,d){vi.preencode(e,d.header)},encode(e,d){vi.encode(e,d.header)},decode:e=>({header:vi.decode(e)})},ki=_t,Ki=an,hi={preencode(d,o){ki.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),Ki.preencode(d,o.config)},encode(d,o){ki.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),Ki.encode(d,o.config)},decode:d=>({header:ki.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),config:Ki.decode(d)})},wi=_t,Pi=J,Ti={preencode(d,o){wi.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),Pi.preencode(d,o.settings)},encode(d,o){wi.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),Pi.encode(d,o.settings)},decode:d=>({header:wi.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),settings:Pi.decode(d)})},Ri=_t,Ai=vc,Si={preencode(d,o){Ri.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.key),Ai.preencode(d,o.status)},encode(d,o){Ri.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.key),Ai.encode(d,o.status)},decode:d=>({header:Ri.decode(d),roomKey:e.fixed32.decode(d),key:e.uint.decode(d),status:Ai.decode(d)})},Ii=_t,Mi=Eo,Fi={preencode(d,o){Ii.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),Mi.preencode(d,o.message)},encode(d,o){Ii.encode(d,o.header),e.fixed32.encode(d,o.roomKey),Mi.encode(d,o.message)},decode:d=>({header:Ii.decode(d),roomKey:e.fixed32.decode(d),message:Mi.decode(d)})},qi=di,Ci={preencode(e,d){qi.preencode(e,d.header)},encode(e,d){qi.encode(e,d.header)},decode:e=>({header:qi.decode(e)})},Vi=_t,Hi=Eo,Di={preencode(d,o){Vi.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),n.preencode(d,o.id),Hi.preencode(d,o.message)},encode(d,o){Vi.encode(d,o.header),e.fixed32.encode(d,o.roomKey),n.encode(d,o.id),Hi.encode(d,o.message)},decode:d=>({header:Vi.decode(d),roomKey:e.fixed32.decode(d),id:n.decode(d),message:Hi.decode(d)})},Li=di,ji={preencode(e,d){Li.preencode(e,d.header)},encode(e,d){Li.encode(e,d.header)},decode:e=>({header:Li.decode(e)})},Ei=_t,Bi={preencode(d,o){Ei.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),n.preencode(d,o.id)},encode(d,o){Ei.encode(d,o.header),e.fixed32.encode(d,o.roomKey),n.encode(d,o.id)},decode:d=>({header:Ei.decode(d),roomKey:e.fixed32.decode(d),id:n.decode(d)})},zi=di,Oi={preencode(e,d){zi.preencode(e,d.header)},encode(e,d){zi.encode(e,d.header)},decode:e=>({header:zi.decode(e)})},Ni=_t,Ui={preencode(d,o){Ni.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),n.preencode(d,o.id),e.string.preencode(d,o.reaction)},encode(d,o){Ni.encode(d,o.header),e.fixed32.encode(d,o.roomKey),n.encode(d,o.id),e.string.encode(d,o.reaction)},decode:d=>({header:Ni.decode(d),roomKey:e.fixed32.decode(d),id:n.decode(d),reaction:e.string.decode(d)})},Ji=di,Wi={preencode(e,d){Ji.preencode(e,d.header)},encode(e,d){Ji.encode(e,d.header)},decode:e=>({header:Ji.decode(e)})},Gi=_t,Qi={preencode(d,o){Gi.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),n.preencode(d,o.id),e.string.preencode(d,o.reaction)},encode(d,o){Gi.encode(d,o.header),e.fixed32.encode(d,o.roomKey),n.encode(d,o.id),e.string.encode(d,o.reaction)},decode:d=>({header:Gi.decode(d),roomKey:e.fixed32.decode(d),id:n.decode(d),reaction:e.string.decode(d)})},Xi=di,Yi={preencode(e,d){Xi.preencode(e,d.header)},encode(e,d){Xi.encode(e,d.header)},decode:e=>({header:Xi.decode(e)})},Zi={preencode(d,o){e.uint.preencode(d,o.clock),e.uint.preencode(d,o.start),e.uint.preencode(d,o.end)},encode(d,o){e.uint.encode(d,o.clock),e.uint.encode(d,o.start),e.uint.encode(d,o.end)},decode:d=>({clock:e.uint.decode(d),start:e.uint.decode(d),end:e.uint.decode(d)})},$i=H,_i=$,ea={preencode(d,o){e.uint.preencode(d,o.clock),_i.preencode(d,o.keys)},encode(d,o){e.uint.encode(d,o.clock),_i.encode(d,o.keys)},decode:d=>({clock:e.uint.decode(d),keys:_i.decode(d)})},da={preencode(d,o){e.uint.preencode(d,o.clock),e.fixed32.preencode(d,o.roomKey),d.end++,o.start&&e.uint.preencode(d,o.start),o.size&&e.uint.preencode(d,o.size)},encode(d,o){const n=(o.start?1:0)|(o.size?2:0)|(o.isBottom?4:0);e.uint.encode(d,o.clock),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,n),o.start&&e.uint.encode(d,o.start),o.size&&e.uint.encode(d,o.size)},decode(d){const o=e.uint.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{clock:o,roomKey:n,start:1&c?e.uint.decode(d):0,size:2&c?e.uint.decode(d):0,isBottom:!!(4&c)}}},oa=H,na={preencode(d,o){e.uint.preencode(d,o.clock),e.fixed32.preencode(d,o.roomKey),d.end++,o.offset&&e.fixed32.preencode(d,o.offset),o.count&&e.uint.preencode(d,o.count)},encode(d,o){const n=(o.offset?1:0)|(o.count?2:0);e.uint.encode(d,o.clock),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,n),o.offset&&e.fixed32.encode(d,o.offset),o.count&&e.uint.encode(d,o.count)},decode(d){const o=e.uint.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{clock:o,roomKey:n,offset:1&c?e.fixed32.decode(d):null,count:2&c?e.uint.decode(d):0}}},ca=H,ra={preencode(d,o){e.uint.preencode(d,o.timestamp),e.fixed32.preencode(d,o.id)},encode(d,o){e.uint.encode(d,o.timestamp),e.fixed32.encode(d,o.id)},decode:d=>({timestamp:e.uint.decode(d),id:e.fixed32.decode(d)})},ta={Changed:1,Removed:2},ia={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)},aa=$,sa={preencode(d,o){aa.preencode(d,o.keys),e.uint.preencode(d,o.start),e.uint.preencode(d,o.end),e.uint.preencode(d,o.total)},encode(d,o){aa.encode(d,o.keys),e.uint.encode(d,o.start),e.uint.encode(d,o.end),e.uint.encode(d,o.total)},decode:d=>({keys:aa.decode(d),start:e.uint.decode(d),end:e.uint.decode(d),total:e.uint.decode(d)})},pa={preencode(e,d){ia.preencode(e,d.type),ra.preencode(e,d.room)},encode(e,d){ia.encode(e,d.type),ra.encode(e,d.room)},decode:e=>({type:ia.decode(e),room:ra.decode(e)})},ua=yt,la=bd,fa={preencode(e,d){ua.preencode(e,d.device),e.end++,d.member&&la.preencode(e,d.member)},encode(d,o){const n=o.member?1:0;ua.encode(d,o.device),e.uint.encode(d,n),o.member&&la.encode(d,o.member)},decode:d=>({device:ua.decode(d),member:1&e.uint.decode(d)?la.decode(d):null})},ma=e.frame(fa),ya=yn,xa=an,ba={preencode(d,o){e.fixed32.preencode(d,o.id),ma.preencode(d,o.role),ya.preencode(d,o.digest),xa.preencode(d,o.config),d.end++,o.messageId&&n.preencode(d,o.messageId)},encode(d,o){const c=o.messageId?1:0;e.fixed32.encode(d,o.id),ma.encode(d,o.role),ya.encode(d,o.digest),xa.encode(d,o.config),e.uint.encode(d,c),o.messageId&&n.encode(d,o.messageId)},decode:d=>({id:e.fixed32.decode(d),role:ma.decode(d),digest:ya.decode(d),config:xa.decode(d),messageId:1&e.uint.decode(d)?n.decode(d):null})},va=yt,ga={preencode(d,o){e.fixed32.preencode(d,o.id),va.preencode(d,o.status)},encode(d,o){e.fixed32.encode(d,o.id),va.encode(d,o.status)},decode:d=>({id:e.fixed32.decode(d),status:va.decode(d)})},ka=yn,Ka={preencode(d,o){e.fixed32.preencode(d,o.id),ka.preencode(d,o.digest)},encode(d,o){e.fixed32.encode(d,o.id),ka.encode(d,o.digest)},decode:d=>({id:e.fixed32.decode(d),digest:ka.decode(d)})},ha=an,wa={preencode(d,o){e.fixed32.preencode(d,o.id),ha.preencode(d,o.config)},encode(d,o){e.fixed32.encode(d,o.id),ha.encode(d,o.config)},decode:d=>({id:e.fixed32.decode(d),config:ha.decode(d)})},Pa=ma,Ta={preencode(d,o){e.fixed32.preencode(d,o.id),d.end++,o.role&&Pa.preencode(d,o.role)},encode(d,o){const n=o.role?1:0;e.fixed32.encode(d,o.id),e.uint.encode(d,n),o.role&&Pa.encode(d,o.role)},decode:d=>({id:e.fixed32.decode(d),role:1&e.uint.decode(d)?Pa.decode(d):null})},Ra={preencode(d,o){e.fixed32.preencode(d,o.id),n.preencode(d,o.lastMessage)},encode(d,o){e.fixed32.encode(d,o.id),n.encode(d,o.lastMessage)},decode:d=>({id:e.fixed32.decode(d),lastMessage:n.decode(d)})},Aa=fe,Sa={preencode(d,o){e.fixed32.preencode(d,o.key),Aa.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),Aa.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),profile:Aa.decode(d)})},Ia=ae,Ma={preencode(d,o){e.fixed32.preencode(d,o.key),Ia.preencode(d,o.status),vl.preencode(d,o.profile)},encode(d,o){e.fixed32.encode(d,o.key),Ia.encode(d,o.status),vl.encode(d,o.profile)},decode:d=>({key:e.fixed32.decode(d),status:Ia.decode(d),profile:vl.decode(d)})},Fa={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.fixed32.preencode(d,o.key)},encode(d,o){e.fixed32.encode(d,o.roomKey),e.fixed32.encode(d,o.key)},decode:d=>({roomKey:e.fixed32.decode(d),key:e.fixed32.decode(d)})},qa=Fa,Ca=e.array(n),Va={preencode(d,o){e.fixed32.preencode(d,o.roomKey),e.uint.preencode(d,o.start),e.uint.preencode(d,o.size),e.uint.preencode(d,o.total),Ca.preencode(d,o.ids),d.end++},encode(d,o){const n=o.isBottom?1:0;e.fixed32.encode(d,o.roomKey),e.uint.encode(d,o.start),e.uint.encode(d,o.size),e.uint.encode(d,o.total),Ca.encode(d,o.ids),e.uint.encode(d,n)},decode:d=>({roomKey:e.fixed32.decode(d),start:e.uint.decode(d),size:e.uint.decode(d),total:e.uint.decode(d),ids:Ca.decode(d),isBottom:!!(1&e.uint.decode(d))})},Ha={preencode(d,o){e.uint.preencode(d,o.sent),d.end++,o.edited&&e.uint.preencode(d,o.edited)},encode(d,o){const n=o.edited?1:0;e.uint.encode(d,o.sent),e.uint.encode(d,n),o.edited&&e.uint.encode(d,o.edited)},decode:d=>({sent:e.uint.decode(d),edited:1&e.uint.decode(d)?e.uint.decode(d):0})},Da=e.frame(Ha),La=Mo,ja=Fo,Ea=qo,Ba={preencode(d,o){n.preencode(d,o.id),e.uint.preencode(d,o.clock),Da.preencode(d,o.timestamps),La.preencode(d,o.status),d.end++,o.message&&ja.preencode(d,o.message),o.event&&Ea.preencode(d,o.event)},encode(d,o){const c=(o.message?1:0)|(o.event?2:0);n.encode(d,o.id),e.uint.encode(d,o.clock),Da.encode(d,o.timestamps),La.encode(d,o.status),e.uint.encode(d,c),o.message&&ja.encode(d,o.message),o.event&&Ea.encode(d,o.event)},decode(d){const o=n.decode(d),c=e.uint.decode(d),r=Da.decode(d),t=La.decode(d),i=e.uint.decode(d);return{id:o,clock:c,timestamps:r,status:t,message:1&i?ja.decode(d):null,event:2&i?Ea.decode(d):null}}},za=e.frame(Ba),Oa=bd,Na={preencode(d,o){za.preencode(d,o.chat),e.fixed32.preencode(d,o.memberKey),Oa.preencode(d,o.role)},encode(d,o){za.encode(d,o.chat),e.fixed32.encode(d,o.memberKey),Oa.encode(d,o.role)},decode:d=>({chat:za.decode(d),memberKey:e.fixed32.decode(d),role:Oa.decode(d)})},Ua=za,Ja={preencode(e,d){Ua.preencode(e,d.chat)},encode(e,d){Ua.encode(e,d.chat)},decode:e=>({chat:Ua.decode(e)})},Wa=Ca,Ga={preencode(d,o){Wa.preencode(d,o.ids),e.fixed32.preencode(d,o.memberKey)},encode(d,o){Wa.encode(d,o.ids),e.fixed32.encode(d,o.memberKey)},decode:d=>({ids:Wa.decode(d),memberKey:e.fixed32.decode(d)})},Qa=Ca,Xa=bd,Ya={preencode(e,d){Qa.preencode(e,d.ids),Xa.preencode(e,d.role)},encode(e,d){Qa.encode(e,d.ids),Xa.encode(e,d.role)},decode:e=>({ids:Qa.decode(e),role:Xa.decode(e)})},Za=e.frame(dn),$a={preencode(e,d){n.preencode(e,d.id),Za.preencode(e,d.reactions)},encode(e,d){n.encode(e,d.id),Za.encode(e,d.reactions)},decode:e=>({id:n.decode(e),reactions:Za.decode(e)})},_a=Za,es={preencode(e,d){n.preencode(e,d.id),_a.preencode(e,d.digest)},encode(e,d){n.encode(e,d.id),_a.encode(e,d.digest)},decode:e=>({id:n.decode(e),digest:_a.decode(e)})},ds=H,os=H,ns=e.array(e.frame(ic)),cs={preencode(e,d){ns.preencode(e,d.invitations)},encode(e,d){ns.encode(e,d.invitations)},decode:e=>({invitations:ns.decode(e)})},rs=e.frame(ud),ts={preencode(d,o){e.fixed32.preencode(d,o.roomKey),rs.preencode(d,o.request)},encode(d,o){e.fixed32.encode(d,o.roomKey),rs.encode(d,o.request)},decode:d=>({roomKey:e.fixed32.decode(d),request:rs.decode(d)})},is=e.array(e.frame(ts)),as={preencode(e,d){is.preencode(e,d.requests)},encode(e,d){is.encode(e,d.requests)},decode:e=>({requests:is.decode(e)})},ss=ns,ps=e.array(e.frame(ud)),us={preencode(e,d){ss.preencode(e,d.pendingInvitations),ps.preencode(e,d.identityJoinRequests)},encode(e,d){ss.encode(e,d.pendingInvitations),ps.encode(e,d.identityJoinRequests)},decode:e=>({pendingInvitations:ss.decode(e),identityJoinRequests:ps.decode(e)})},ls=_t,fs={preencode(d,o){ls.preencode(d,o.header),e.string.preencode(d,o.invitation),d.end++},encode(d,o){const n=o.isIdentity?1:0;ls.encode(d,o.header),e.string.encode(d,o.invitation),e.uint.encode(d,n)},decode:d=>({header:ls.decode(d),invitation:e.string.decode(d),isIdentity:!!(1&e.uint.decode(d))})},ms=di,ys={preencode(e,d){ms.preencode(e,d.header)},encode(e,d){ms.encode(e,d.header)},decode:e=>({header:ms.decode(e)})},xs={preencode(e,d){e.end++},encode(d,o){const n=(o.canModerate?1:0)|(o.canAdmin?2:0)|(o.requiresConfirmation?4:0)|(o.isReadOnly?8:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{canModerate:!!(1&o),canAdmin:!!(2&o),requiresConfirmation:!!(4&o),isReadOnly:!!(8&o)}}},bs=_t,vs=e.frame(xs),gs={preencode(d,o){bs.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),d.end++,o.permissions&&vs.preencode(d,o.permissions),o.expiration&&e.uint.preencode(d,o.expiration)},encode(d,o){const n=(o.permissions?1:0)|(o.expiration?2:0);bs.encode(d,o.header),e.fixed32.encode(d,o.roomKey),e.uint.encode(d,n),o.permissions&&vs.encode(d,o.permissions),o.expiration&&e.uint.encode(d,o.expiration)},decode(d){const o=bs.decode(d),n=e.fixed32.decode(d),c=e.uint.decode(d);return{header:o,roomKey:n,permissions:1&c?vs.decode(d):null,expiration:2&c?e.uint.decode(d):0}}},ks=di,Ks={preencode(d,o){ks.preencode(d,o.header),e.string.preencode(d,o.invitation)},encode(d,o){ks.encode(d,o.header),e.string.encode(d,o.invitation)},decode:d=>({header:ks.decode(d),invitation:e.string.decode(d)})},hs=_t,ws={preencode(e,d){hs.preencode(e,d.header)},encode(e,d){hs.encode(e,d.header)},decode:e=>({header:hs.decode(e)})},Ps=di,Ts={preencode(d,o){Ps.preencode(d,o.header),e.string.preencode(d,o.invitation)},encode(d,o){Ps.encode(d,o.header),e.string.encode(d,o.invitation)},decode:d=>({header:Ps.decode(d),invitation:e.string.decode(d)})},Rs=_t,As=rs,Ss={preencode(d,o){Rs.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),As.preencode(d,o.request)},encode(d,o){Rs.encode(d,o.header),e.fixed32.encode(d,o.roomKey),As.encode(d,o.request)},decode:d=>({header:Rs.decode(d),roomKey:e.fixed32.decode(d),request:As.decode(d)})},Is=di,Ms={preencode(e,d){Is.preencode(e,d.header)},encode(e,d){Is.encode(e,d.header)},decode:e=>({header:Is.decode(e)})},Fs=_t,qs=rs,Cs={preencode(d,o){Fs.preencode(d,o.header),e.fixed32.preencode(d,o.roomKey),qs.preencode(d,o.request)},encode(d,o){Fs.encode(d,o.header),e.fixed32.encode(d,o.roomKey),qs.encode(d,o.request)},decode:d=>({header:Fs.decode(d),roomKey:e.fixed32.decode(d),request:qs.decode(d)})},Vs=di,Hs={preencode(e,d){Vs.preencode(e,d.header)},encode(e,d){Vs.encode(e,d.header)},decode:e=>({header:Vs.decode(e)})},Ds=_t,Ls={preencode(d,o){Ds.preencode(d,o.header),e.fixed32.preencode(d,o.id)},encode(d,o){Ds.encode(d,o.header),e.fixed32.encode(d,o.id)},decode:d=>({header:Ds.decode(d),id:e.fixed32.decode(d)})},js=di,Es={preencode(e,d){js.preencode(e,d.header)},encode(e,d){js.encode(e,d.header)},decode:e=>({header:js.decode(e)})},Bs=_t,zs={preencode(d,o){Bs.preencode(d,o.header),e.string.preencode(d,o.displayName),d.end++,o.avatar&&e.buffer.preencode(d,o.avatar)},encode(d,o){const n=o.avatar?1:0;Bs.encode(d,o.header),e.string.encode(d,o.displayName),e.uint.encode(d,n),o.avatar&&e.buffer.encode(d,o.avatar)},decode:d=>({header:Bs.decode(d),displayName:e.string.decode(d),avatar:1&e.uint.decode(d)?e.buffer.decode(d):null})},Os=H,Ns=H,Us={preencode(e,d){e.end++},encode(d,o){const n=(o.isConfirmed?1:0)|(o.isLoggedOut?2:0);e.uint.encode(d,n)},decode(d){const o=e.uint.decode(d);return{isConfirmed:!!(1&o),isLoggedOut:!!(2&o)}}},Js=e.frame(Us),Ws=$,Gs={preencode(d,o){e.fixed32.preencode(d,o.memberKey),Js.preencode(d,o.status),Ws.preencode(d,o.deviceKeys)},encode(d,o){e.fixed32.encode(d,o.memberKey),Js.encode(d,o.status),Ws.encode(d,o.deviceKeys)},decode:d=>({memberKey:e.fixed32.decode(d),status:Js.decode(d),deviceKeys:Ws.decode(d)})},Qs={preencode(d,o){e.fixed32.preencode(d,o.memberKey)},encode(d,o){e.fixed32.encode(d,o.memberKey)},decode:d=>({memberKey:e.fixed32.decode(d)})},Xs={preencode(d,o){e.fixed32.preencode(d,o.deviceKey)},encode(d,o){e.fixed32.encode(d,o.deviceKey)},decode:d=>({deviceKey:e.fixed32.decode(d)})},Ys=_t,Zs={preencode(d,o){Ys.preencode(d,o.header),e.string.preencode(d,o.password)},encode(d,o){Ys.encode(d,o.header),e.string.encode(d,o.password)},decode:d=>({header:Ys.decode(d),password:e.string.decode(d)})},$s=di,_s={preencode(d,o){$s.preencode(d,o.header),e.string.preencode(d,o.inspector)},encode(d,o){$s.encode(d,o.header),e.string.encode(d,o.inspector)},decode:d=>({header:$s.decode(d),inspector:e.string.decode(d)})},ep=di,dp={preencode(e,d){ep.preencode(e,d.header)},encode(e,d){ep.encode(e,d.header)},decode:e=>({header:ep.decode(e)})},op=di,np={preencode(e,d){op.preencode(e,d.header)},encode(e,d){op.encode(e,d.header)},decode:e=>({header:op.decode(e)})},cp={Flag:1},rp={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)},tp={preencode(d,o){e.fixed32.preencode(d,o.key),e.fixed32.preencode(d,o.sender),e.uint.preencode(d,o.clock),rp.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),rp.encode(d,o.label)},decode:d=>({key:e.fixed32.decode(d),sender:e.fixed32.decode(d),clock:e.uint.decode(d),label:rp.decode(d)})},ip=de,ap={preencode(d,o){ip.preencode(d,o.header),e.fixed32.preencode(d,o.key),rp.preencode(d,o.label)},encode(d,o){ip.encode(d,o.header),e.fixed32.encode(d,o.key),rp.encode(d,o.label)},decode:d=>({header:ip.decode(d),key:e.fixed32.decode(d),label:rp.decode(d)})},sp={preencode(d,o){rp.preencode(d,o.label),e.uint.preencode(d,o.count)},encode(d,o){rp.encode(d,o.label),e.uint.encode(d,o.count)},decode:d=>({label:rp.decode(d),count:e.uint.decode(d)})},pp=e.array(e.frame(sp)),up={preencode(d,o){e.fixed32.preencode(d,o.key),e.uint.preencode(d,o.total),pp.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),pp.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:pp.decode(d),editedAt:e.uint.decode(d),flagsClock:e.uint.decode(d)})},lp=de,fp={preencode(d,o){lp.preencode(d,o.header),e.fixed32.preencode(d,o.deviceKey),e.fixed32.preencode(d,o.fromDeviceKey)},encode(d,o){lp.encode(d,o.header),e.fixed32.encode(d,o.deviceKey),e.fixed32.encode(d,o.fromDeviceKey)},decode:d=>({header:lp.decode(d),deviceKey:e.fixed32.decode(d),fromDeviceKey:e.fixed32.decode(d)})},mp={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)})},yp=de,xp=$,bp={preencode(o,n){yp.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),o.end++,d>=4&&n.streams&&xp.preencode(o,n.streams),d>=4&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=4&&n.version&&e.uint.preencode(o,n.version),d>=12&&n.streamInputs&&gl.preencode(o,n.streamInputs),d>=12&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=4&&n.streams?1:0)|(d>=4&&n.discoveryKey?2:0)|(d>=4&&n.version?4:0)|(d>=12&&n.streamInputs?8:0)|(d>=12&&n.swarmKey?16:0);yp.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.buffer.encode(o,n.encryptionKey),e.uint.encode(o,c),d>=4&&n.streams&&xp.encode(o,n.streams),d>=4&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=4&&n.version&&e.uint.encode(o,n.version),d>=12&&n.streamInputs&&gl.encode(o,n.streamInputs),d>=12&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=yp.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>=4&&1&t?xp.decode(o):null,discoveryKey:d>=4&&2&t?e.fixed32.decode(o):null,version:d>=4&&4&t?e.uint.decode(o):0,streamInputs:d>=12&&8&t?gl.decode(o):null,swarmKey:d>=12&&16&t?e.fixed32.decode(o):null}}},vp=de,gp=$,kp={preencode(o,n){vp.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),o.end++,d>=4&&n.streams&&gp.preencode(o,n.streams),d>=12&&n.streamInputs&&kl.preencode(o,n.streamInputs),d>=12&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey)},encode(o,n){const c=(d>=4&&n.streams?1:0)|(d>=12&&n.streamInputs?2:0)|(d>=12&&n.swarmKey?4:0);vp.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=4&&n.streams&&gp.encode(o,n.streams),d>=12&&n.streamInputs&&kl.encode(o,n.streamInputs),d>=12&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey)},decode(o){const n=vp.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,callKey:c,streams:d>=4&&1&r?gp.decode(o):null,streamInputs:d>=12&&2&r?kl.decode(o):null,swarmKey:d>=12&&4&r?e.fixed32.decode(o):null}}},Kp=de,hp={preencode(d,o){Kp.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Kp.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Kp.decode(d),callKey:e.fixed32.decode(d)})},wp=de,Pp={preencode(d,o){wp.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){wp.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:wp.decode(d),callKey:e.fixed32.decode(d)})},Tp=de,Rp={preencode(o,n){Tp.preencode(o,n.header),e.fixed32.preencode(o,n.callKey),e.fixed32.preencode(o,n.streamKey),o.end++,d>=12&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=12&&n.type&&e.string.preencode(o,n.type)},encode(o,n){const c=(d>=12&&n.mediaStreamId?1:0)|(d>=12&&n.type?2:0)|(d>=12&&n.muted?4:0);Tp.encode(o,n.header),e.fixed32.encode(o,n.callKey),e.fixed32.encode(o,n.streamKey),e.uint.encode(o,c),d>=12&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=12&&n.type&&e.string.encode(o,n.type)},decode(o){const n=Tp.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>=12&&1&t?e.string.decode(o):null,type:d>=12&&2&t?e.string.decode(o):null,muted:d>=12&&!!(4&t)}}},Ap=de,Sp={preencode(d,o){Ap.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey)},encode(d,o){Ap.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.streamKey)},decode:d=>({header:Ap.decode(d),callKey:e.fixed32.decode(d),streamKey:e.fixed32.decode(d)})},Ip={preencode(o,n){e.fixed32.preencode(o,n.callKey),e.buffer.preencode(o,n.encryptionKey),e.uint.preencode(o,n.createdAt),o.end++,d>=4&&n.endedAt&&e.uint.preencode(o,n.endedAt),d>=4&&n.discoveryKey&&e.fixed32.preencode(o,n.discoveryKey),d>=4&&n.version&&e.uint.preencode(o,n.version)},encode(o,n){const c=(d>=4&&n.endedAt?1:0)|(d>=4&&n.discoveryKey?2:0)|(d>=4&&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>=4&&n.endedAt&&e.uint.encode(o,n.endedAt),d>=4&&n.discoveryKey&&e.fixed32.encode(o,n.discoveryKey),d>=4&&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>=4&&1&t?e.uint.decode(o):0,discoveryKey:d>=4&&2&t?e.fixed32.decode(o):null,version:d>=4&&4&t?e.uint.decode(o):0}}},Mp={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)})},Fp={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>=4&&n.swarmKey&&e.fixed32.preencode(o,n.swarmKey),d>=8&&n.lastHeartbeatAt&&e.uint.preencode(o,n.lastHeartbeatAt)},encode(o,n){const c=(d>=4&&n.swarmKey?1:0)|(d>=8&&n.lastHeartbeatAt?2:0)|(d>=9&&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>=4&&n.swarmKey&&e.fixed32.encode(o,n.swarmKey),d>=8&&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>=4&&1&i?e.fixed32.decode(o):null,lastHeartbeatAt:d>=8&&2&i?e.uint.decode(o):0,isRecording:d>=9&&!!(4&i)}}},qp={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>=12&&n.mediaStreamId&&e.string.preencode(o,n.mediaStreamId),d>=12&&n.type&&e.string.preencode(o,n.type),d>=12&&n.statusKey&&e.uint.preencode(o,n.statusKey)},encode(o,n){const c=(d>=12&&n.mediaStreamId?1:0)|(d>=12&&n.type?2:0)|(d>=12&&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>=12&&n.mediaStreamId&&e.string.encode(o,n.mediaStreamId),d>=12&&n.type&&e.string.encode(o,n.type),d>=12&&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>=12&&1&i?e.string.decode(o):null,type:d>=12&&2&i?e.string.decode(o):null,statusKey:d>=12&&4&i?e.uint.decode(o):0}}},Cp={preencode(o,n){e.fixed32.preencode(o,n.callKey),o.end++,d>=4&&n.selfDeviceKey&&e.fixed32.preencode(o,n.selfDeviceKey),d>=12&&n.createdAt&&e.uint.preencode(o,n.createdAt)},encode(o,n){const c=(d>=4&&n.selfDeviceKey?1:0)|(d>=12&&n.createdAt?2:0);e.fixed32.encode(o,n.callKey),e.uint.encode(o,c),d>=4&&n.selfDeviceKey&&e.fixed32.encode(o,n.selfDeviceKey),d>=12&&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>=4&&1&c?e.fixed32.decode(o):null,createdAt:d>=12&&2&c?e.uint.decode(o):0}}},Vp={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)})},Hp={Nightly:"Nightly",Internal:"Internal",Production:"Production"},Dp={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}}},Lp=de,jp={preencode(e,d){Lp.preencode(e,d.header)},encode(e,d){Lp.encode(e,d.header)},decode:e=>({header:Lp.decode(e)})},Ep=de,Bp={preencode(e,d){Ep.preencode(e,d.header)},encode(e,d){Ep.encode(e,d.header)},decode:e=>({header:Ep.decode(e)})},zp={preencode(o,n){Dp.preencode(o,n.buildType),o.end++,d>=6&&n.latestOfflineAbi&&e.uint.preencode(o,n.latestOfflineAbi)},encode(o,n){const c=d>=6&&n.latestOfflineAbi?1:0;Dp.encode(o,n.buildType),e.uint.encode(o,c),d>=6&&n.latestOfflineAbi&&e.uint.encode(o,n.latestOfflineAbi)},decode(o){const n=Dp.decode(o),c=o.start<o.end?e.uint.decode(o):0;return{buildType:n,latestOfflineAbi:d>=6&&1&c?e.uint.decode(o):0}}},Op=de,Np={preencode(d,o){Op.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){Op.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:Op.decode(d),deviceKey:e.fixed32.decode(d),deviceProof:e.buffer.decode(d),writerProof:e.buffer.decode(d)})},Up={preencode(o,n){o.end++,d>=7&&n.otaResyncPrivateProfileBump&&e.uint.preencode(o,n.otaResyncPrivateProfileBump)},encode(o,n){const c=d>=7&&n.otaResyncPrivateProfileBump?1:0;e.uint.encode(o,c),d>=7&&n.otaResyncPrivateProfileBump&&e.uint.encode(o,n.otaResyncPrivateProfileBump)},decode(o){const n=e.uint.decode(o);return{otaResyncPrivateProfileBump:d>=7&&1&n?e.uint.decode(o):0}}},Jp={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)})},Wp=de,Gp={preencode(d,o){Wp.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){Wp.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:Wp.decode(d),callKey:e.fixed32.decode(d)})},Qp=de,Xp={preencode(d,o){Qp.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.deviceKey)},encode(d,o){Qp.encode(d,o.header),e.fixed32.encode(d,o.callKey),e.fixed32.encode(d,o.deviceKey)},decode:d=>({header:Qp.decode(d),callKey:e.fixed32.decode(d),deviceKey:e.fixed32.decode(d)})},Yp=e.frame(Nn),Zp=e.array(e.frame(Dn)),$p={preencode(e,d){Yp.preencode(e,d.digest),Zp.preencode(e,d.mine)},encode(e,d){Yp.encode(e,d.digest),Zp.encode(e,d.mine)},decode:e=>({digest:Yp.decode(e),mine:Zp.decode(e)})},_p=de,eu={preencode(d,o){_p.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){_p.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:_p.decode(d),callKey:e.fixed32.decode(d)})},du=de,ou={preencode(d,o){du.preencode(d,o.header),e.fixed32.preencode(d,o.callKey)},encode(d,o){du.encode(d,o.header),e.fixed32.encode(d,o.callKey)},decode:d=>({header:du.decode(d),callKey:e.fixed32.decode(d)})},nu={preencode(o,n){o.end++,d>=9&&n.profileSnoozeTime&&e.uint.preencode(o,n.profileSnoozeTime)},encode(o,n){const c=(d>=9&&n.disableReadReceipts?1:0)|(d>=9&&n.stripAttachmentMetadata?2:0)|(d>=9&&n.profileSnoozeTime?4:0);e.uint.encode(o,c),d>=9&&n.profileSnoozeTime&&e.uint.encode(o,n.profileSnoozeTime)},decode(o){const n=e.uint.decode(o);return{disableReadReceipts:d>=9&&!!(1&n),stripAttachmentMetadata:d>=9&&!!(2&n),profileSnoozeTime:d>=9&&4&n?e.uint.decode(o):0}}},cu={preencode(o,n){o.end++,d>=9&&n.maxPeers&&e.uint.preencode(o,n.maxPeers)},encode(o,n){const c=d>=9&&n.maxPeers?1:0;e.uint.encode(o,c),d>=9&&n.maxPeers&&e.uint.encode(o,n.maxPeers)},decode(o){const n=e.uint.decode(o);return{maxPeers:d>=9&&1&n?e.uint.decode(o):0}}},ru=de,tu={preencode(e,d){ru.preencode(e,d.header),n.preencode(e,d.oplog)},encode(e,d){ru.encode(e,d.header),n.encode(e,d.oplog)},decode:e=>({header:ru.decode(e),oplog:n.decode(e)})},iu=de,au={preencode(e,d){iu.preencode(e,d.header)},encode(e,d){iu.encode(e,d.header)},decode:e=>({header:iu.decode(e)})},su={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)})},pu=de,uu={preencode(o,n){pu.preencode(o,n.header),e.fixed32.preencode(o,n.memberKey),o.end++,d>=10&&n.alias&&e.string.preencode(o,n.alias)},encode(o,n){const c=d>=10&&n.alias?1:0;pu.encode(o,n.header),e.fixed32.encode(o,n.memberKey),e.uint.encode(o,c),d>=10&&n.alias&&e.string.encode(o,n.alias)},decode(o){const n=pu.decode(o),c=e.fixed32.decode(o),r=e.uint.decode(o);return{header:n,memberKey:c,alias:d>=10&&1&r?e.string.decode(o):null}}},lu={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)})},fu={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>=12&&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>=12&&!!(1&t)}}},mu=de,yu={preencode(d,o){mu.preencode(d,o.header),e.fixed32.preencode(d,o.callKey),e.fixed32.preencode(d,o.streamKey),d.end++},encode(o,n){const c=d>=12&&n.muted?1:0;mu.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=mu.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>=12&&!!(1&t)}}},xu={preencode(d,o){e.uint.preencode(d,o.statusKey),d.end++},encode(o,n){const c=d>=12&&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>=12&&!!(1&c)}}},bu={preencode(n,c){e.fixed32.preencode(n,c.key),n.end++,d>=13&&c.encryptionKey&&e.buffer.preencode(n,c.encryptionKey),d>=13&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=(d>=13&&c.encryptionKey?1:0)|(d>=13&&c.bootFrom?2:0);e.fixed32.encode(n,c.key),e.uint.encode(n,r),d>=13&&c.encryptionKey&&e.buffer.encode(n,c.encryptionKey),d>=13&&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>=13&&1&r?e.buffer.decode(n):null,bootFrom:d>=13&&2&r?o.decode(n):null}}},vu={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)})},gu={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)})},ku={preencode(n,c){o.preencode(n,c.autobeeMigrationHead),n.end++,d>=13&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=13&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=13&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),e.uint.preencode(n,c.createdAt)},encode(n,c){const r=(d>=13&&c.legacyViewHead?1:0)|(d>=13&&c.dbViewHead?2:0)|(d>=13&&c.blobsViewHead?4:0);o.encode(n,c.autobeeMigrationHead),e.uint.encode(n,r),d>=13&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=13&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=13&&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>=13&&1&r?o.decode(n):null,dbViewHead:d>=13&&2&r?o.decode(n):null,blobsViewHead:d>=13&&4&r?o.decode(n):null,createdAt:e.uint.decode(n)}}},Ku=de,hu={preencode(e,n){Ku.preencode(e,n.header),o.preencode(e,n.head),e.end++,d>=13&&n.legacyViewHead&&o.preencode(e,n.legacyViewHead),d>=13&&n.dbViewHead&&o.preencode(e,n.dbViewHead),d>=13&&n.blobsViewHead&&o.preencode(e,n.blobsViewHead)},encode(n,c){const r=(d>=13&&c.legacyViewHead?1:0)|(d>=13&&c.dbViewHead?2:0)|(d>=13&&c.blobsViewHead?4:0);Ku.encode(n,c.header),o.encode(n,c.head),e.uint.encode(n,r),d>=13&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=13&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=13&&c.blobsViewHead&&o.encode(n,c.blobsViewHead)},decode(n){const c=Ku.decode(n),r=o.decode(n),t=e.uint.decode(n);return{header:c,head:r,legacyViewHead:d>=13&&1&t?o.decode(n):null,dbViewHead:d>=13&&2&t?o.decode(n):null,blobsViewHead:d>=13&&4&t?o.decode(n):null}}},wu={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.fixed32.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.seed),n.end++,d>=13&&c.bootFrom&&o.preencode(n,c.bootFrom)},encode(n,c){const r=d>=13&&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>=13&&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>=13&&1&i?o.decode(n):null}}},Pu=bd,Tu={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),Pu.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),Pu.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:Pu.decode(d)})},Ru={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)})},Au=vc,Su=gc,Iu=tc,Mu={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),e.fixed32.preencode(n,c.mailbox),Au.preencode(n,c.status),e.uint.preencode(n,c.clock),n.end++,d>=13&&c.initiator&&o.preencode(n,c.initiator),d>=13&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=13&&c.identitySwap&&Su.preencode(n,c.identitySwap),d>=13&&c.identitySwapV2&&Iu.preencode(n,c.identitySwapV2),d>=13&&c.contact&&e.fixed32.preencode(n,c.contact)},encode(n,c){const r=(d>=13&&c.initiator?1:0)|(d>=13&&c.bootFrom?2:0)|(d>=13&&c.identitySwap?4:0)|(d>=13&&c.identitySwapV2?8:0)|(d>=13&&c.contact?16:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.fixed32.encode(n,c.mailbox),Au.encode(n,c.status),e.uint.encode(n,c.clock),e.uint.encode(n,r),d>=13&&c.initiator&&o.encode(n,c.initiator),d>=13&&c.bootFrom&&o.encode(n,c.bootFrom),d>=13&&c.identitySwap&&Su.encode(n,c.identitySwap),d>=13&&c.identitySwapV2&&Iu.encode(n,c.identitySwapV2),d>=13&&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=Au.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>=13&&1&s?o.decode(n):null,bootFrom:d>=13&&2&s?o.decode(n):null,identitySwap:d>=13&&4&s?Su.decode(n):null,identitySwapV2:d>=13&&8&s?Iu.decode(n):null,contact:d>=13&&16&s?e.fixed32.decode(n):null}}},Fu=de,qu={preencode(n,c){Fu.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>=13&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=13&&c.initiator&&o.preencode(n,c.initiator),d>=13&&c.dm&&e.fixed32.preencode(n,c.dm)},encode(n,c){const r=(d>=13&&c.bootFrom?1:0)|(d>=13&&c.initiator?2:0)|(d>=13&&c.dm?4:0)|(d>=13&&c.isReadOnly?8:0);Fu.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>=13&&c.bootFrom&&o.encode(n,c.bootFrom),d>=13&&c.initiator&&o.encode(n,c.initiator),d>=13&&c.dm&&e.fixed32.encode(n,c.dm)},decode(n){const c=Fu.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>=13&&1&a?o.decode(n):null,initiator:d>=13&&2&a?o.decode(n):null,dm:d>=13&&4&a?e.fixed32.decode(n):null,isReadOnly:d>=13&&!!(8&a)}}},Cu={preencode(n,c){e.fixed32.preencode(n,c.roomKey),e.buffer.preencode(n,c.encryptionKey),n.end++,d>=13&&c.bootFrom&&o.preencode(n,c.bootFrom),d>=13&&c.initiator&&o.preencode(n,c.initiator)},encode(n,c){const r=(d>=13&&c.bootFrom?1:0)|(d>=13&&c.initiator?2:0);e.fixed32.encode(n,c.roomKey),e.buffer.encode(n,c.encryptionKey),e.uint.encode(n,r),d>=13&&c.bootFrom&&o.encode(n,c.bootFrom),d>=13&&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>=13&&1&t?o.decode(n):null,initiator:d>=13&&2&t?o.decode(n):null}}},Vu={preencode(d,o){e.fixed32.preencode(d,o.roomKey),Kl.preencode(d,o.head),e.uint.preencode(d,o.timestamp),d.end++},encode(o,n){const c=d>=13&&n.incremental?1:0;e.fixed32.encode(o,n.roomKey),Kl.encode(o,n.head),e.uint.encode(o,n.timestamp),e.uint.encode(o,c)},decode(o){const n=e.fixed32.decode(o),c=Kl.decode(o),r=e.uint.decode(o),t=e.uint.decode(o);return{roomKey:n,head:c,timestamp:r,incremental:d>=13&&!!(1&t)}}},Hu={preencode(o,n){o.end++,d>=13&&n.key&&e.fixed32.preencode(o,n.key),e.uint.preencode(o,n.length)},encode(o,n){const c=d>=13&&n.key?1:0;e.uint.encode(o,c),d>=13&&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>=13&&1&n?e.fixed32.decode(o):null,length:e.uint.decode(o)}}},Du={preencode(n,c){e.fixed32.preencode(n,c.roomKey),n.end++,d>=13&&c.legacyViewHead&&o.preencode(n,c.legacyViewHead),d>=13&&c.dbViewHead&&o.preencode(n,c.dbViewHead),d>=13&&c.blobsViewHead&&o.preencode(n,c.blobsViewHead),d>=13&&c.autobeeMigrationHead&&o.preencode(n,c.autobeeMigrationHead)},encode(n,c){const r=(d>=13&&c.legacyViewHead?1:0)|(d>=13&&c.dbViewHead?2:0)|(d>=13&&c.blobsViewHead?4:0)|(d>=13&&c.autobeeMigrationHead?8:0);e.fixed32.encode(n,c.roomKey),e.uint.encode(n,r),d>=13&&c.legacyViewHead&&o.encode(n,c.legacyViewHead),d>=13&&c.dbViewHead&&o.encode(n,c.dbViewHead),d>=13&&c.blobsViewHead&&o.encode(n,c.blobsViewHead),d>=13&&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>=13&&1&r?o.decode(n):null,dbViewHead:d>=13&&2&r?o.decode(n):null,blobsViewHead:d>=13&&4&r?o.decode(n):null,autobeeMigrationHead:d>=13&&8&r?o.decode(n):null}}},Lu={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)})},ju=de,Eu={preencode(d,o){ju.preencode(d,o.header),e.buffer.preencode(d,o.blindResponse)},encode(d,o){ju.encode(d,o.header),e.buffer.encode(d,o.blindResponse)},decode:d=>({header:ju.decode(d),blindResponse:e.buffer.decode(d)})},Bu=e.frame(qr),zu={preencode(o,n){e.string.preencode(o,n.mnemonic),o.end++,d>=15&&n.profileDiscoveryTimeout&&e.uint.preencode(o,n.profileDiscoveryTimeout),d>=15&&n.privateProfileKey&&e.fixed32.preencode(o,n.privateProfileKey),d>=15&&n.identity&&Bu.preencode(o,n.identity)},encode(o,n){const c=(d>=15&&n.profileDiscoveryTimeout?1:0)|(d>=15&&n.privateProfileKey?2:0)|(d>=15&&n.identity?4:0);e.string.encode(o,n.mnemonic),e.uint.encode(o,c),d>=15&&n.profileDiscoveryTimeout&&e.uint.encode(o,n.profileDiscoveryTimeout),d>=15&&n.privateProfileKey&&e.fixed32.encode(o,n.privateProfileKey),d>=15&&n.identity&&Bu.encode(o,n.identity)},decode(o){const n=e.string.decode(o),c=e.uint.decode(o);return{mnemonic:n,profileDiscoveryTimeout:d>=15&&1&c?e.uint.decode(o):0,privateProfileKey:d>=15&&2&c?e.fixed32.decode(o):null,identity:d>=15&&4&c?Bu.decode(o):null}}},Ou=de,Nu={preencode(e,d){Ou.preencode(e,d.header)},encode(e,d){Ou.encode(e,d.header)},decode:e=>({header:Ou.decode(e)})},Uu=de,Ju={preencode(o,c){Uu.preencode(o,c.header),n.preencode(o,c.oplog),e.uint.preencode(o,c.index),o.end++,d>=16&&c.displayType&&Xo.preencode(o,c.displayType)},encode(o,c){const r=d>=16&&c.displayType?1:0;Uu.encode(o,c.header),n.encode(o,c.oplog),e.uint.encode(o,c.index),e.uint.encode(o,r),d>=16&&c.displayType&&Xo.encode(o,c.displayType)},decode(o){const c=Uu.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>=16&&1&i?Xo.decode(o):0}}},Wu=de,Gu=no,Qu={preencode(d,o){Wu.preencode(d,o.header),n.preencode(d,o.oplog),Xo.preencode(d,o.displayType),e.uint.preencode(d,o.index),Gu.preencode(d,o.preview)},encode(d,o){Wu.encode(d,o.header),n.encode(d,o.oplog),Xo.encode(d,o.displayType),e.uint.encode(d,o.index),Gu.encode(d,o.preview)},decode:d=>({header:Wu.decode(d),oplog:n.decode(d),displayType:Xo.decode(d),index:e.uint.decode(d),preview:Gu.decode(d)})},Xu=de,Yu={preencode(d,o){Xu.preencode(d,o.header),n.preencode(d,o.oplog),Xo.preencode(d,o.displayType),e.uint.preencode(d,o.index)},encode(d,o){Xu.encode(d,o.header),n.encode(d,o.oplog),Xo.encode(d,o.displayType),e.uint.encode(d,o.index)},decode:d=>({header:Xu.decode(d),oplog:n.decode(d),displayType:Xo.decode(d),index:e.uint.decode(d)})},Zu=e.frame(w),$u=e.frame(lu),_u=Zu,el=e.frame(le),dl=Zu,ol=el,nl=e.frame(wu),cl=el,rl=e.frame(wd),tl=e.frame(mp),il=tl,al=Zu,sl=Zu,pl=e.frame(Ic),ul=pl,ll=pl,fl=e.frame(Cp),ml=e.frame($p),yl=e.frame(nu),xl=e.frame(Hu),bl=xl,vl=el,gl=e.array(e.frame(fu)),kl=gl,Kl=xl;function hl(e){switch(e){case"@keet/head":return o;case"@keet/oplog-id":return n;case"@keet/encryption-keypair":return c;case"@keet/signing-keypair":return r;case"@keet/room-keys":return t;case"@keet/operation-header":return i;case"@keet/blob-pointer":return a;case"@keet/file-dimensions":return s;case"@keet/file-metadata":return u;case"@keet/external-drive-pointer":return l;case"@keet/external-blob-pointer":return f;case"@keet/file-pointer":return x;case"@keet/file":return g;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 M;case"@keet/abi":return F;case"@keet/device-stats":return q;case"@keet/member-stats":return C;case"@keet/chat-stats":return V;case"@keet/file-stats":return H;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-supported-language":return Y;case"@keet/room-config":return _;case"@keet/blind-peer":return ee;case"@keet/add-blind-peer-operation":return ne;case"@keet/remove-blind-peer-operation":return re;case"@keet/identity-attestation":return te;case"@keet/device-invitation":return ie;case"@keet/device":return pe;case"@keet/member-profile":return ue;case"@keet/device-profile":return le;case"@keet/member-update":return me;case"@keet/device-update":return ye;case"@keet/member-contact-info":return be;case"@keet/signed-pairing-data":return ve;case"@keet/device-request-identity":return ge;case"@keet/device-response-identity":return ke;case"@keet/device-identity":return Ke;case"@keet/device-request-with-invitation":return Te;case"@keet/device-request-with-invitation-and-proof":return Ae;case"@keet/device-request-with-member-proof":return Me;case"@keet/device-request":return Ce;case"@keet/device-response":return De;case"@keet/invitation-metadata":return Le;case"@keet/invitation":return Be;case"@keet/add-invitation-operation":return Ne;case"@keet/remove-invitation-operation":return Je;case"@keet/sendable-room-invitation":return We;case"@keet/readonly-room-invitation":return Ge;case"@keet/sendable-identity-invitation":return Qe;case"@keet/sendable-contact-invitation":return Xe;case"@keet/sendable-invitation":return dd;case"@keet/add-device-operation":return nd;case"@keet/update-device-operation":return rd;case"@keet/remove-device-operation":return id;case"@keet/start-indexing-operation":return ad;case"@keet/stop-indexing-operation":return sd;case"@keet/join-request":return ud;case"@keet/accept-join-request-operation":return md;case"@keet/reject-join-request-operation":return xd;case"@keet/member":return gd;case"@keet/full-member":return hd;case"@keet/member-proofs":return wd;case"@keet/update-member-operation":return Rd;case"@keet/change-member-status-operation":return Id;case"@keet/change-member-role-operation":return Fd;case"@keet/remove-member-operation":return Cd;case"@keet/member-activity":return Vd;case"@keet/member-joined-event":return Hd;case"@keet/member-left-event":return Dd;case"@keet/member-removed-event":return Ld;case"@keet/title-changed-chat-event":return jd;case"@keet/chat-event":return Nd;case"@keet/sendable-event":return Ud;case"@keet/display-range":return Jd;case"@keet/display-content-range":return Gd;case"@keet/mention-display-item":return Xd;case"@keet/translation-display-item":return Zd;case"@keet/link-preview":return eo;case"@keet/display-link-item":return co;case"@keet/display":return yo;case"@keet/oplog-message":return go;case"@keet/index-message":return ho;case"@keet/full-index-message":return To;case"@keet/message-status":return Ro;case"@keet/message-index-id":return Ao;case"@keet/thread":return Io;case"@keet/chat-message-record":return Co;case"@keet/full-chat-message-record":return Lo;case"@keet/add-chat-message-operation":return Bo;case"@keet/remove-chat-message-operation":return Oo;case"@keet/update-chat-message-operation":return Jo;case"@keet/pin-chat-message-operation":return Go;case"@keet/display-type":return Xo;case"@keet/add-file-preview-operation":return Zo;case"@keet/reaction":return $o;case"@keet/reactions-summary":return _o;case"@keet/reactions-digest":return dn;case"@keet/add-reaction-operation":return nn;case"@keet/remove-reaction-operation":return rn;case"@keet/update-room-config-operation":return sn;case"@keet/group-member":return pn;case"@keet/user-registry-info":return un;case"@keet/room-identity":return fn;case"@keet/genesis-operation":return Kn;case"@keet/upgrade-operation":return wn;case"@keet/migrate-abi-operation":return Tn;case"@keet/system-settings-keys":return An;case"@keet/update-system-settings-operation":return Mn;case"@keet/test-increment-operation":return qn;case"@keet/test-collection-record-1":return Cn;case"@keet/label-type":return Hn;case"@keet/chat-label":return Dn;case"@keet/add-chat-label-operation":return jn;case"@keet/remove-chat-label-operation":return Bn;case"@keet/chat-label-summary":return zn;case"@keet/chat-label-digest":return Nn;case"@keet/update-read-length-operation":return Jn;case"@keet/read-length":return Wn;case"@keet/tmp-removed-member":return Gn;case"@keet-private-id/contact":return Xn;case"@keet-private-id/v3-room-migration-info":return Yn;case"@keet-private-id/run-v3-migration-operation":return _n;case"@keet-private-id/update-identity-operation":return dc;case"@keet-private-id/counters":return oc;case"@keet-private-id/stats":return nc;case"@keet-private-id/add-entropy-operation":return cc;case"@keet-private-id/pending-invitation-identity":return rc;case"@keet-private-id/pending-invitation":return ic;case"@keet-private-id/resolve-pending-invitation-operation":return sc;case"@keet-private-id/add-pending-invitation-operation":return lc;case"@keet-private-id/remove-pending-invitation-operation":return mc;case"@keet-private-id/identity-swap":return yc;case"@keet-private-id/identity-swap-v2":return xc;case"@keet-private-id/room-status":return bc;case"@keet-private-id/room":return Kc;case"@keet-private-id/add-room-operation":return wc;case"@keet-private-id/remove-room-operation":return Tc;case"@keet-private-id/update-room-status-operation":return Sc;case"@keet-private-id/contact-status":return Ic;case"@keet-private-id/contact-record":return Fc;case"@keet-private-id/add-contact-operation":return Vc;case"@keet-private-id/update-contact-status-operation":return Dc;case"@keet-private-id/remove-contact-operation":return jc;case"@keet-private-id/activate-contact-room-operation":return Bc;case"@keet-private-id/contact-request-status":return zc;case"@keet-private-id/contact-request-body":return Uc;case"@keet-private-id/contact-request":return Wc;case"@keet-private-id/contact-request-record":return Zc;case"@keet-private-id/add-contact-request-operation":return _c;case"@keet-private-id/update-contact-request-status-operation":return or;case"@keet-private-id/profile-discovery-record-v1":return nr;case"@keet-private-id/profile-discovery-record":return cr;case"@keet-private-id/unreads":return rr;case"@keet-private-id/add-unreads-key-operation":return ir;case"@keet-private-id/remove-unreads-key-operation":return sr;case"@keet-private-id/settings":return pr;case"@keet-private-id/user-settings-key":return lr;case"@keet-private-id/update-settings-operation":return yr;case"@local/background-sync-room":return xr;case"@local/stats":return br;case"@local/migration-status":return vr;case"@local/v3-private-profile-migration":return kr;case"@local/v3-room-migration":return wr;case"@local/room-migration-stats":return Pr;case"@local/room-migration":return Rr;case"@local/identity-status":return Ar;case"@local/identity-swap":return Sr;case"@local/identity-record":return qr;case"@local/tasks":return Vr;case"@local/room-keys":return Hr;case"@local/join-room-invitation-task":return Lr;case"@local/join-room-response-task":return jr;case"@local/fast-forward-to":return Er;case"@local/add-room-fields":return Br;case"@local/join-room-keys-task":return Or;case"@local/create-room-task":return Ur;case"@local/leave-room-task":return Jr;case"@local/clear-room-task":return Wr;case"@local/restore-identity-task":return Gr;case"@local/send-contact-request-task":return Xr;case"@local/migrate-v2-room-task":return Yr;case"@local/task":return tt;case"@local/shared-invitation":return at;case"@local/room-status":return st;case"@local/room-timestamps":return pt;case"@local/room":return Tt;case"@local/room-preferences":return At;case"@local/room-metadata":return St;case"@local/writer":return It;case"@local/writer-append":return Mt;case"@local/member":return qt;case"@local/device":return Vt;case"@local/file":return Dt;case"@local/debug-flag":return Lt;case"@local/debug":return Et;case"@local/hyperdht-record":return zt;case"@local/unread":return Ot;case"@local/error-record-details":return Nt;case"@local/error-record":return Jt;case"@local/keet-state":return Gt;case"@local/file-stats":return Qt;case"@api/request-header":return Xt;case"@api/response-header":return Yt;case"@api/subscription-request-header":return Zt;case"@api/subscription-response-header":return $t;case"@api/boot-request":return ei;case"@api/boot-response":return oi;case"@api/self-destruct-request":return ci;case"@api/core/have":return ri;case"@api/core/create-room-request":return si;case"@api/core/create-room-response":return ui;case"@api/core/activate-room-request":return fi;case"@api/core/deactivate-room-request":return yi;case"@api/core/leave-room-request":return bi;case"@api/core/leave-room-response":return gi;case"@api/core/update-room-config-request":return hi;case"@api/core/update-room-settings-request":return Ti;case"@api/core/update-room-status-request":return Si;case"@api/core/add-chat-message-request":return Fi;case"@api/core/add-chat-message-response":return Ci;case"@api/core/edit-chat-message-request":return Di;case"@api/core/edit-chat-message-response":return ji;case"@api/core/remove-chat-message-request":return Bi;case"@api/core/remove-chat-message-response":return Oi;case"@api/core/add-chat-reaction-request":return Ui;case"@api/core/add-chat-reaction-response":return Wi;case"@api/core/remove-chat-reaction-request":return Qi;case"@api/core/remove-chat-reaction-response":return Yi;case"@api/core/want-lobby":return Zi;case"@api/core/unwant-lobby":return $i;case"@api/core/want-room-info":return ea;case"@api/core/want-chat":return da;case"@api/core/unwant-chat":return oa;case"@api/core/want-members":return na;case"@api/core/unwant-members":return ca;case"@api/core/lobby-record":return ra;case"@api/core/lobby-record-change-type":return ia;case"@api/core/lobby":return sa;case"@api/core/lobby-room":return pa;case"@api/core/room-role":return fa;case"@api/core/room-info":return ba;case"@api/core/room-info-status":return ga;case"@api/core/room-info-digest":return Ka;case"@api/core/room-info-config":return wa;case"@api/core/room-info-role":return Ta;case"@api/core/room-info-last-message":return Ra;case"@api/core/member":return Sa;case"@api/core/device":return Ma;case"@api/core/member-list-add":return Fa;case"@api/core/member-list-remove":return qa;case"@api/core/chat-reset":return Va;case"@api/core/message-timestamps":return Ha;case"@api/core/message":return Ba;case"@api/core/message-info":return Na;case"@api/core/message-info-chat":return Ja;case"@api/core/message-info-member":return Ga;case"@api/core/message-info-role":return Ya;case"@api/core/message-info-reactions":return $a;case"@api/core/reactions":return es;case"@api/core/want-pairing":return ds;case"@api/core/unwant-pairing":return os;case"@api/core/pending-invitations":return cs;case"@api/core/join-request":return ts;case"@api/core/join-requests":return as;case"@api/core/pairing":return us;case"@api/core/start-pairing-request":return fs;case"@api/core/start-pairing-response":return ys;case"@api/core/invitation-permissions":return xs;case"@api/core/create-room-invitation-request":return gs;case"@api/core/create-room-invitation-response":return Ks;case"@api/core/create-identity-invitation-request":return ws;case"@api/core/create-identity-invitation-response":return Ts;case"@api/core/accept-join-request-request":return Ss;case"@api/core/accept-join-request-response":return Ms;case"@api/core/reject-join-request-request":return Cs;case"@api/core/reject-join-request-response":return Hs;case"@api/core/stop-pairing-request":return Ls;case"@api/core/stop-pairing-response":return Es;case"@api/core/update-profile-request":return zs;case"@api/core/want-identity":return Os;case"@api/core/unwant-identity":return Ns;case"@api/core/identity-status":return Us;case"@api/core/identity":return Gs;case"@api/core/identity-member":return Qs;case"@api/core/identity-device":return Xs;case"@api/debug/enable-request":return Zs;case"@api/debug/enable-response":return _s;case"@api/debug/disable-request":return dp;case"@api/debug/disable-response":return np;case"@keet/member-label-type":return rp;case"@keet/member-label":return tp;case"@keet/add-member-label-operation":return ap;case"@keet/member-label-summary":return sp;case"@keet/member-label-digest":return up;case"@keet/move-indexer-operation":return fp;case"@keet/location-shared-event":return mp;case"@keet/start-call":return bp;case"@keet/join-call":return kp;case"@keet/leave-call":return hp;case"@keet/end-call":return Pp;case"@keet/add-call-stream":return Rp;case"@keet/remove-call-stream":return Sp;case"@keet/call-record":return Ip;case"@keet/call-member-record":return Mp;case"@keet/call-device-record":return Fp;case"@keet/call-stream-record":return qp;case"@local/active-call":return Cp;case"@local/file-gc-info":return Vp;case"@keet/build-type":return Dp;case"@keet/test-crash-operation":return jp;case"@keet/test-dispatch-error-operation":return Bp;case"@local/environment-record":return zp;case"@keet-private-id/shorten-device-attestation-operation":return Np;case"@local/ota-actions":return Up;case"@local/device-attestation":return Jp;case"@keet/call-device-heartbeat":return Gp;case"@keet/remove-call-device":return Xp;case"@local/chat-labels":return $p;case"@keet/start-call-recording":return eu;case"@keet/stop-call-recording":return ou;case"@local/settings":return nu;case"@local/hyperswarm-record":return cu;case"@keet/dismiss-chat-reports-operation":return tu;case"@keet/update-typing-indicator-operation":return au;case"@keet/typing-indicator":return su;case"@keet-private-id/update-contact-alias-operation":return uu;case"@keet/call-stats":return lu;case"@keet/call-stream-input":return fu;case"@keet/update-call-stream":return yu;case"@keet/call-stream-status-record":return xu;case"@keet/room-keys-v2":return bu;case"@keet/blob-pointer-v2":return vu;case"@keet/blob":return gu;case"@keet/autobee-migration":return ku;case"@keet/autobee-migration-operation":return hu;case"@keet/readonly-room-invitation-v2":return wu;case"@keet/admin-last-seen":return Tu;case"@keet/blob-record":return Ru;case"@keet-private-id/room-v2":return Mu;case"@keet-private-id/add-room-operation-v2":return qu;case"@local/room-keys/v2":return Cu;case"@local/room-update":return Vu;case"@local/view-head":return Hu;case"@local/autobee-migration":return Du;case"@keet-private-id/pending-invitation-response":return Lu;case"@keet-private-id/resolve-pending-invitation-operation-v2":return Eu;case"@local/pending-recovery":return zu;case"@keet/claim-admin-devices-operation":return Nu;case"@keet/remove-file-preview-operation":return Ju;case"@keet/add-link-preview-operation":return Qu;case"@keet/remove-link-preview-operation":return Yu;default:throw new Error("Encoder not found "+e)}}function wl(e,o=17){const n=hl(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 Pl=wl;module.exports={resolveStruct:Pl,getStruct:wl,getEnum:function(e){switch(e){case"@keet/room-type":return z;case"@keet/room-supported-language":return X;case"@keet/display-type":return Qo;case"@keet/system-settings-keys":return Rn;case"@keet/label-type":return Vn;case"@keet-private-id/user-settings-key":return ur;case"@local/tasks":return Cr;case"@local/keet-state":return Wt;case"@api/core/lobby-record-change-type":return ta;case"@keet/member-label-type":return cp;case"@keet/build-type":return Hp;default:throw new Error("Enum not found "+e)}},getEncoding:hl,encode:function(o,n,c=17){return d=c,e.encode(hl(o),n)},decode:function(o,n,c=17){return d=c,e.decode(hl(o),n)},setVersion:function(e){d=e},version:d};