OverviewFilesCommitsIssuesDocsReleasesPeers

keet-deobfuscated / @holepunchto / keet-registry / spec / hyperschema / index.js

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