const{c:e}=require("hyperschema/runtime");let n=1;const t={preencode(n,t){n.end++,t.timestamp&&e.uint.preencode(n,t.timestamp),t.length&&e.uint.preencode(n,t.length)},encode(n,t){const d=(t.timestamp?1:0)|(t.length?2:0);e.uint.encode(n,d),t.timestamp&&e.uint.encode(n,t.timestamp),t.length&&e.uint.encode(n,t.length)},decode(n){const t=e.uint.decode(n);return{timestamp:1&t?e.uint.decode(n):0,length:2&t?e.uint.decode(n):0}}},d={preencode(n,t){n.end++,t.updated&&e.uint.preencode(n,t.updated)},encode(n,t){const d=t.updated?1:0;e.uint.encode(n,d),t.updated&&e.uint.encode(n,t.updated)},decode:n=>({updated:1&e.uint.decode(n)?e.uint.decode(n):0})};function o(e){switch(e){case"@keet-unreads/unread-anchors":return t;case"@keet-unreads/info":return d;default:throw new Error("Encoder not found "+e)}}function c(e,t=1){const d=o(e);return{preencode(e,o){n=t,d.preencode(e,o)},encode(e,o){n=t,d.encode(e,o)},decode:e=>(n=t,d.decode(e))}}const u=c;module.exports={resolveStruct:u,getStruct:c,getEnum:function(e){throw new Error("Enum not found "+e)},getEncoding:o,encode:function(t,d,c=1){return n=c,e.encode(o(t),d)},decode:function(t,d,c=1){return n=c,e.decode(o(t),d)},setVersion:function(e){n=e},version:n};