protobufjs
Version:
Protocol Buffers for JavaScript & TypeScript.
7 lines • 75.8 kB
JavaScript
/*!
* protobuf.js v8.3.0 (c) 2016, daniel wirtz
* compiled wed, 13 may 2026 21:15:34 utc
* licensed under the bsd-3-clause license
* see: https://github.com/dcodeio/protobuf.js for details
*/
!function(g){"use strict";var r,e,i;r={1:[function(t,i,n){},{}],2:[function(t,i,n){var v=t(5),b=t(23),p=t(24);function u(t,i,n,r){var e=!1;if(i.resolvedType)if(i.resolvedType instanceof v){t("switch(d%s){",r);for(var s=i.resolvedType.values,o=Object.keys(s),u=0;u<o.length;++u)s[o[u]]!==i.typeDefault||e||(t("default:")('if(typeof d%s==="number"){m%s=d%s;break}',r,r,r),i.repeated||t("break"),e=!0),t("case%j:",o[u])("case %i:",s[o[u]])("m%s=%j",r,s[o[u]])("break");t("}")}else t('if(typeof d%s!=="object")',r)("throw TypeError(%j)",i.fullName+": object expected")("m%s=types[%i].fromObject(d%s,q+1)",r,n,r);else{var h=!1;switch(i.type){case"double":case"float":t("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":h=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,h)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,h?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length>=0)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r)}}return t}function m(t,i,n,r,e){if(e=e||r,i.resolvedType)i.resolvedType instanceof v?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,e,e,n,e,e):t("d%s=types[%i].toObject(m%s,o)",r,n,e);else{var s=!1;switch(i.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,e,e,e);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',e)("d%s=o.longs===String?String(m%s):m%s",r,e,e)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,e,e,e,s?"true":"",e);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,e,e,e,e);break;default:t("d%s=m%s",r,e)}}return t}n.fromObject=function(t){var i=t.fieldsArray,n=p.codegen(["d","q"],t.name+"$fromObject")("if(d instanceof C)")("return d")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")');if(!i.length)return n("return new C");n("var m=new C");for(var r=0;r<i.length;++r){var e=i[r].resolve(),s=p.safeProp(e.name),o=!e.hasPresence&&!e.repeated&&!e.map&&(e.resolvedType instanceof v||b.basic[e.type]!==g);e.map?(n("if(d%s){",s)('if(typeof d%s!=="object")',s)("throw TypeError(%j)",e.fullName+": object expected")("m%s={}",s)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",s),n('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[i])",s),u(n,e,r,s+"[ks[i]]")("}")("}")):e.repeated?(n("if(d%s){",s)("if(!Array.isArray(d%s))",s)("throw TypeError(%j)",e.fullName+": array expected")("m%s=Array(d%s.length)",s,s)("for(var i=0;i<d%s.length;++i){",s),u(n,e,r,s+"[i]")("}")("}")):(e.resolvedType instanceof v||n("if(d%s!=null){",s),o&&(e.resolvedType instanceof v?n('if(d%s!==%j&&(typeof d%s!=="string"||types[%i].values[d%s]!==%j)){',s,e.typeDefault,s,r,s,e.typeDefault):"string"===e.type?n('if(typeof d%s!=="string"||d%s.length){',s,s):"bytes"===e.type?n("if(d%s.length){",s):"bool"===e.type?n("if(d%s){",s):b.long[e.type]!==g?n('if(typeof d%s==="object"?d%s.low||d%s.high:Number(d%s)!==0){',s,s,s,s):n("if(Number(d%s)!==0){",s)),u(n,e,r,s),o&&n("}"),e.resolvedType instanceof v||n("}"))}return n("return m")},n.toObject=function(t){var i=t.fieldsArray.slice().sort(p.compareFieldsById);if(!i.length)return p.codegen()("return {}");for(var n=p.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),r=[],e=[],s=[],o=0;o<i.length;++o)i[o].partOf||(i[o].resolve().repeated?r:i[o].map?e:s).push(i[o]);if(r.length){for(n("if(o.arrays||o.defaults){"),o=0;o<r.length;++o)n("d%s=[]",p.safeProp(r[o].name));n("}")}if(e.length){for(n("if(o.objects||o.defaults){"),o=0;o<e.length;++o)n("d%s={}",p.safeProp(e[o].name));n("}")}if(s.length){for(n("if(o.defaults){"),o=0;o<s.length;++o){var u,h=s[o],f=p.safeProp(h.name);h.resolvedType instanceof v?n("d%s=o.enums===String?%j:%j",f,h.resolvedType.valuesById[h.typeDefault],h.typeDefault):h.long?n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",h.typeDefault.low,h.typeDefault.high,h.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",f)("}else")("d%s=o.longs===String?%j:%i",f,h.typeDefault.toString(),h.typeDefault.toNumber()):h.bytes?(u=Array.prototype.slice.call(h.typeDefault),n("if(o.bytes===String)d%s=%j",f,String.fromCharCode.apply(String,h.typeDefault))("else{")("d%s=%j",f,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",f,f)("}")):n("d%s=%j",f,h.typeDefault)}n("}")}for(var c=!1,o=0;o<i.length;++o){var a,l,h=i[o],d=t.t.indexOf(h),f=p.safeProp(h.name);h.map?(c||(c=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",f,f)("d%s={}",f),a=b.long[h.keyType]!==g,l=f+"[ks2[j]]",n("for(var j=0;j<ks2.length;++j){"),a&&n("var k2=util.longFromKey(ks2[j],%j).toString()","uint64"===h.keyType||"fixed64"===h.keyType),n('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",f),m(n,h,d,a?f+"[k2]":l,l)("}")):h.repeated?(n("if(m%s&&m%s.length){",f,f)("d%s=Array(m%s.length)",f,f)("for(var j=0;j<m%s.length;++j){",f),m(n,h,d,f+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",f,h.name),m(n,h,d,f),h.partOf&&n("if(o.oneofs)")("d%s=%j",p.safeProp(h.partOf.name),h.name)),n("}")}return n("return d")}},{23:23,24:24,5:5}],3:[function(t,i,n){i.exports=function(t){for(var i=!1,n=!1,r=0;r<t.fieldsArray.length;++r){var e=t.t[r];e.map&&(i=!0),e.repeated||e.map||e.hasPresence||(n=!0)}var s=d.codegen(["r","l","z","q","g"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(q===undefined)q=0")("if(q>Reader.recursionLimit)")('throw Error("max depth exceeded")')("var c=l===undefined?r.len:r.pos+l,m=g||new C"+(i?",k,v":n?",v":""))("while(r.pos<c){")("var s=r.pos")("var t=r.tag()")("if(t===z){")("z=undefined")("break")("}");t.fieldsArray.length&&s("var u=t&7")("switch(t>>>=3){");for(r=0;r<t.fieldsArray.length;++r){var o,u=t.t[r].resolve(),h=u.resolvedType instanceof a?"int32":u.type,f="m"+d.safeProp(u.name);u.map?(s("case %i:{",u.id)("if(u!==2)")("break")("if(%s===util.emptyObject)",f)("%s={}",f)("var c2=r.uint32()+r.pos"),l.defaults[u.keyType]!==g?s("k=%j",l.defaults[u.keyType]):s("k=null"),l.defaults[h]!==g?s("v=%j",l.defaults[h]):s("v=null"),s("while(r.pos<c2){")("var t2=r.tag()")("u=t2&7")("switch(t2>>>=3){")("case 1:")("if(u!==%i)",l.mapKey[u.keyType])("break")("k=r.%s()",u.keyType)("continue")("case 2:")("if(u!==%i)",l.basic[h]===g?2:l.basic[h])("break"),l.basic[h]===g?s("v=types[%i].decode(r,r.uint32(),undefined,q+1)",r):s("v=r.%s()",h),s("continue")("}")("r.skipType(u,q,t2)")("}"),o=l.basic[h]===g?"v||new types["+r+"].ctor":"v",l.long[u.keyType]!==g?s('%s[typeof k==="object"?util.longToHash(k):k]=%s',f,o):("string"===u.keyType&&s('if(k==="__proto__")')("util.makeProp(%s,k)",f),s("%s[k]=%s",f,o))):u.repeated?(s("case %i:",u.id)("{"),l.packed[h]!==g&&s("if(u===2){")("if(!(%s&&%s.length))",f,f)("%s=[]",f)("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",f,h)("continue")("}"),s("if(u!==%i)",l.basic[h]===g?u.delimited?3:2:l.basic[h])("break")("if(!(%s&&%s.length))",f,f)("%s=[]",f),l.basic[h]===g?u.delimited?s("%s.push(types[%i].decode(r,undefined,%i,q+1))",f,r,8*u.id+4):s("%s.push(types[%i].decode(r,r.uint32(),undefined,q+1))",f,r):s("%s.push(r.%s())",f,h)):l.basic[h]===g?(s("case %i:{",u.id)("if(u!==%i)",u.delimited?3:2)("break"),u.delimited?s("%s=types[%i].decode(r,undefined,%i,q+1,%s)",f,r,8*u.id+4,f):s("%s=types[%i].decode(r,r.uint32(),undefined,q+1,%s)",f,r,f)):u.hasPresence?s("case %i:{",u.id)("if(u!==%i)",l.basic[h])("break")("%s=r.%s()",f,h):(s("case %i:{",u.id)("if(u!==%i)",l.basic[h])("break"),u.resolvedType instanceof a&&0!==u.typeDefault?s("if((v=r.%s())!==%j)",h,u.typeDefault):"string"===h||"bytes"===h?s("if((v=r.%s()).length)",h):l.long[h]!==g?s('if(typeof(v=r.%s())==="object"?v.low||v.high:v!==0)',h):s("double"===h||"float"===h?"if((v=r.%s())!==0)":"if(v=r.%s())",h),s("%s=v",f)("else")("delete %s",f)),u.partOf&&s("m%s=%j",d.safeProp(u.partOf.name),u.name),s("continue")("}")}r&&s("}");for(s("r.skipType(%s,q,t)",r?"u":"t&7")('util.makeProp(m,"$unknowns",false);')("(m.$unknowns||(m.$unknowns=[])).push(r.raw(s,r.pos))")("}")("if(z!==undefined)")('throw Error("missing end group")'),r=0;r<t.t.length;++r){var c=t.t[r];c.required&&s("if(!m.hasOwnProperty(%j))",c.name)("throw util.ProtocolError(%j,{instance:m})","missing required '"+c.name+"'")}return s("return m")};var a=t(5),l=t(23),d=t(24)},{23:23,24:24,5:5}],4:[function(t,i,n){i.exports=function(t){for(var i,n=a.codegen(["m","w"],t.name+"$encode")("if(!w)")("w=Writer.create()"),r=t.fieldsArray.slice().sort(a.compareFieldsById),e=0;e<r.length;++e){var s=r[e].resolve(),o=t.t.indexOf(s),u=s.resolvedType instanceof f?"int32":s.type,h=c.basic[u];i="m"+a.safeProp(s.name),s.map?(n("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",i,s.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",i),"bool"===s.keyType?n("w.uint32(%i).fork().uint32(%i).bool(util.boolFromKey(ks[i]))",(s.id<<3|2)>>>0,8|c.mapKey[s.keyType]):c.long[s.keyType]!==g?n("w.uint32(%i).fork().uint32(%i).%s(util.longFromKey(ks[i],%j))",(s.id<<3|2)>>>0,8|c.mapKey[s.keyType],s.keyType,"uint64"===s.keyType||"fixed64"===s.keyType):n("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(s.id<<3|2)>>>0,8|c.mapKey[s.keyType],s.keyType),h===g?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",o,i):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,u,i),n("}")("}")):s.repeated?(n("if(%s!=null&&%s.length){",i,i),s.packed&&c.packed[u]!==g?n("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",u,i)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",i),h===g?l(n,s,o,i+"[i]"):n("w.uint32(%i).%s(%s[i])",(s.id<<3|h)>>>0,u,i)),n("}")):(s.required||n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",i,s.name),h===g?l(n,s,o,i):n("w.uint32(%i).%s(%s)",(s.id<<3|h)>>>0,u,i))}return n('if(m.$unknowns!=null&&Object.hasOwnProperty.call(m,"$unknowns"))')("for(var i=0;i<m.$unknowns.length;++i)")("w.raw(m.$unknowns[i])")("return w")};var f=t(5),c=t(23),a=t(24);function l(t,i,n,r){i.delimited?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(i.id<<3|3)>>>0,(i.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(i.id<<3|2)>>>0)}},{23:23,24:24,5:5}],5:[function(t,i,n){i.exports=s;var h=t(13),r=(((s.prototype=Object.create(h.prototype)).constructor=s).className="Enum",t(12)),e=t(24);function s(t,i,n,r,e,s){if(h.call(this,t,n),i&&"object"!=typeof i)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=e||{},this.valuesOptions=s,this.i={},this.reserved=g,i)for(var o=Object.keys(i),u=0;u<o.length;++u)"__proto__"!==o[u]&&"number"==typeof i[o[u]]&&(this.valuesById[this.values[o[u]]=i[o[u]]]=o[u])}s.prototype.n=function(t){return t=this.r||t,h.prototype.n.call(this,t),Object.keys(this.values).forEach(t=>{var i=Object.assign({},this.e);this.i[t]=Object.assign(i,this.valuesOptions&&this.valuesOptions[t]&&this.valuesOptions[t].features)}),this},s.fromJSON=function(t,i){t=new s(t,i.values,i.options,i.comment,i.comments,i.valuesOptions);return t.reserved=i.reserved,i.edition&&(t.r=i.edition),t.o="proto3",t},s.prototype.toJSON=function(t){t=!!t&&!!t.keepComments;return e.toObject(["edition",this.u(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:g,"comment",t?this.comment:g,"comments",t?this.comments:g])},s.prototype.add=function(t,i,n,r){if(!e.isString(t))throw TypeError("name must be a string");if(!e.isInteger(i))throw TypeError("id must be an integer");if("__proto__"!==t){if(this.values[t]!==g)throw Error("duplicate name '"+t+"' in "+this);if(this.isReservedId(i))throw Error("id "+i+" is reserved in "+this);if(this.isReservedName(t))throw Error("name '"+t+"' is reserved in "+this);if(this.valuesById[i]!==g){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+i+" in "+this);this.values[t]=i}else this.valuesById[this.values[t]=i]=t;r&&(this.valuesOptions===g&&(this.valuesOptions={}),this.valuesOptions[t]=r||null),this.comments[t]=n||null}return this},s.prototype.remove=function(t){if(!e.isString(t))throw TypeError("name must be a string");var i=this.values[t];if(null==i)throw Error("name '"+t+"' does not exist in "+this);return delete this.valuesById[i],delete this.values[t],delete this.comments[t],this.valuesOptions&&delete this.valuesOptions[t],this},s.prototype.isReservedId=function(t){return r.isReservedId(this.reserved,t)},s.prototype.isReservedName=function(t){return r.isReservedName(this.reserved,t)}},{12:12,13:13,24:24}],6:[function(t,i,n){i.exports=o;var r,u=t(13),e=(((o.prototype=Object.create(u.prototype)).constructor=o).className="Field",t(5)),h=t(23),f=t(24),c=/^required|optional|repeated$/;function o(t,i,n,r,e,s,o){if(f.isObject(r)?(o=e,s=r,r=e=g):f.isObject(e)&&(o=s,s=e,e=g),u.call(this,t,s),!f.isInteger(i)||i<0)throw TypeError("id must be a non-negative integer");if(!f.isString(n))throw TypeError("type must be a string");if(r!==g&&!c.test(r=r.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(e!==g&&!f.isString(e))throw TypeError("extend must be a string");this.rule=(r="proto3_optional"===r?"optional":r)&&"optional"!==r?r:g,this.type=n,this.id=i,this.extend=e||g,this.repeated="repeated"===r,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!f.Long&&h.long[n]!==g,this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=o}o.fromJSON=function(t,i){t=new o(t,i.id,i.type,i.rule,i.extend,i.options,i.comment);return i.edition&&(t.r=i.edition),t.o="proto3",t},Object.defineProperty(o.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this.e.field_presence}}),Object.defineProperty(o.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(o.prototype,"delimited",{get:function(){return this.resolvedType instanceof r&&"DELIMITED"===this.e.message_encoding}}),Object.defineProperty(o.prototype,"packed",{get:function(){return"PACKED"===this.e.repeated_field_encoding}}),Object.defineProperty(o.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this.e.field_presence)}}),o.prototype.setOption=function(t,i,n){return u.prototype.setOption.call(this,t,i,n)},o.prototype.toJSON=function(t){t=!!t&&!!t.keepComments;return f.toObject(["edition",this.u(),"rule","optional"!==this.rule&&this.rule||g,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:g])},o.prototype.resolve=function(){var t;return this.resolved?this:((this.typeDefault=h.defaults[this.type])===g?(this.resolvedType=(this.declaringField||this).parent.lookupTypeOrEnum(this.type),this.resolvedType instanceof r?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof e&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed===g||!this.resolvedType||this.resolvedType instanceof e||delete this.options.packed,Object.keys(this.options).length||(this.options=g)),this.long?(this.typeDefault=f.Long.fromNumber(this.typeDefault,"u"==(this.type[0]||"")),Object.freeze&&Object.freeze(this.typeDefault)):this.bytes&&"string"==typeof this.typeDefault&&(f.base64.test(this.typeDefault)?f.base64.decode(this.typeDefault,t=f.newBuffer(f.base64.length(this.typeDefault)),0):f.utf8.write(this.typeDefault,t=f.newBuffer(f.utf8.length(this.typeDefault)),0),this.typeDefault=t),this.map?this.defaultValue=f.emptyObject:this.repeated?this.defaultValue=f.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof r&&this.parent.h&&(this.parent.h.prototype[this.name]=this.defaultValue),u.prototype.resolve.call(this))},o.prototype.f=function(t){var i;return"proto2"!==t&&"proto3"!==t?{}:(t={},"required"===this.rule&&(t.field_presence="LEGACY_REQUIRED"),this.parent&&h.defaults[this.type]===g&&(i=this.parent.get(this.type.split(".").pop()))&&i instanceof r&&i.group&&(t.message_encoding="DELIMITED"),!0===this.getOption("packed")?t.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(t.repeated_field_encoding="EXPANDED"),t)},o.prototype.n=function(t){return u.prototype.n.call(this,this.r||t)},o.d=function(n,r,e,s){return"function"==typeof r?r=f.decorateType(r).name:r&&"object"==typeof r&&(r=f.decorateEnum(r).name),function(t,i){f.decorateType(t.constructor).add(new o(i,n,r,e,{default:s}))}},o.c=function(t){r=t}},{13:13,23:23,24:24,5:5}],7:[function(t,i,n){var r=i.exports=t(8);r.build="light",r.load=function(t,i,n){return(i="function"==typeof i?(n=i,new r.Root):i||new r.Root).load(t,n)},r.loadSync=function(t,i){return(i=i||new r.Root).loadSync(t)},r.encoder=t(4),r.decoder=t(3),r.verifier=t(39),r.converter=t(2),r.ReflectionObject=t(13),r.Namespace=t(12),r.Root=t(17),r.Enum=t(5),r.Type=t(22),r.Field=t(6),r.OneOf=t(14),r.MapField=t(9),r.Service=t(21),r.Method=t(11),r.Message=t(10),r.wrappers=t(40),r.types=t(23),r.util=t(24),r.ReflectionObject.c(r.Root),r.Namespace.c(r.Type,r.Service,r.Enum),r.Root.c(r.Type),r.Field.c(r.Type)},{10:10,11:11,12:12,13:13,14:14,17:17,2:2,21:21,22:22,23:23,24:24,3:3,39:39,4:4,40:40,5:5,6:6,8:8,9:9}],8:[function(t,i,n){var r=n;function e(){r.util.c(),r.Writer.c(r.BufferWriter),r.Reader.c(r.BufferReader)}r.build="minimal",r.Writer=t(41),r.BufferWriter=t(42),r.Reader=t(15),r.BufferReader=t(16),r.util=t(34),r.rpc=t(19),r.roots=t(18),r.configure=e,e()},{15:15,16:16,18:18,19:19,34:34,41:41,42:42}],9:[function(t,i,n){i.exports=s;var o=t(6),r=(((s.prototype=Object.create(o.prototype)).constructor=s).className="MapField",t(23)),u=t(24);function s(t,i,n,r,e,s){if(o.call(this,t,i,r,g,g,e,s),!u.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(t,i){return new s(t,i.id,i.keyType,i.type,i.options,i.comment)},s.prototype.toJSON=function(t){t=!!t&&!!t.keepComments;return u.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:g])},s.prototype.resolve=function(){if(this.resolved)return this;if(r.mapKey[this.keyType]===g)throw Error("invalid key type: "+this.keyType);return o.prototype.resolve.call(this)},s.d=function(n,r,e){return"function"==typeof e?e=u.decorateType(e).name:e&&"object"==typeof e&&(e=u.decorateEnum(e).name),function(t,i){u.decorateType(t.constructor).add(new s(i,n,r,e))}}},{23:23,24:24,6:6}],10:[function(t,i,n){i.exports=e;var r=t(34);function e(t){if(t)for(var i=Object.keys(t),n=0;n<i.length;++n)null!=t[i[n]]&&"__proto__"!==i[n]&&(this[i[n]]=t[i[n]])}e.create=function(t){return this.$type.create(t)},e.encode=function(t,i){return this.$type.encode(t,i)},e.encodeDelimited=function(t,i){return this.$type.encodeDelimited(t,i)},e.decode=function(t){return this.$type.decode(t)},e.decodeDelimited=function(t){return this.$type.decodeDelimited(t)},e.verify=function(t){return this.$type.verify(t)},e.fromObject=function(t){return this.$type.fromObject(t)},e.toObject=function(t,i){return this.$type.toObject(t,i)},e.prototype.toJSON=function(){return this.$type.toObject(this,r.toJSONOptions)}},{34:34}],11:[function(t,i,n){i.exports=r;var f=t(13),c=(((r.prototype=Object.create(f.prototype)).constructor=r).className="Method",t(24));function r(t,i,n,r,e,s,o,u,h){if(c.isObject(e)?(o=e,e=s=g):c.isObject(s)&&(o=s,s=g),i!==g&&!c.isString(i))throw TypeError("type must be a string");if(!c.isString(n))throw TypeError("requestType must be a string");if(!c.isString(r))throw TypeError("responseType must be a string");f.call(this,t,o),this.type=i||"rpc",this.requestType=n,this.requestStream=!!e||g,this.responseType=r,this.responseStream=!!s||g,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=h}r.fromJSON=function(t,i){return new r(t,i.type,i.requestType,i.responseType,i.requestStream,i.responseStream,i.options,i.comment,i.parsedOptions)},r.prototype.toJSON=function(t){t=!!t&&!!t.keepComments;return c.toObject(["type","rpc"!==this.type&&this.type||g,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:g,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),f.prototype.resolve.call(this))}},{13:13,24:24}],12:[function(t,i,n){i.exports=a;var s,o,u,r=t(13),h=(((a.prototype=Object.create(r.prototype)).constructor=a).className="Namespace",t(6)),f=t(24),c=t(14);function e(t,i){if(!t||!t.length)return g;for(var n={},r=0;r<t.length;++r)n[t[r].name]=t[r].toJSON(i);return n}function a(t,i){r.call(this,t,i),this.nested=g,this.a=null,this.l=Object.create(null),this.v=!0,this.b=!0}function l(t){t.a=null,t.l=Object.create(null);for(var i=t;i=i.parent;)i.l=Object.create(null);return t}a.fromJSON=function(t,i,n){if((n=n===g?0:n)>f.recursionLimit)throw Error("max depth exceeded");return new a(t,i.options).addJSON(i.nested,n)},a.arrayToJSON=e,a.isReservedId=function(t,i){if(t)for(var n=0;n<t.length;++n)if("string"!=typeof t[n]&&t[n][0]<=i&&t[n][1]>i)return!0;return!1},a.isReservedName=function(t,i){if(t)for(var n=0;n<t.length;++n)if(t[n]===i)return!0;return!1},Object.defineProperty(a.prototype,"nestedArray",{get:function(){return this.a||(this.a=f.toArray(this.nested))}}),a.prototype.toJSON=function(t){return f.toObject(["options",this.options,"nested",e(this.nestedArray,t)])},a.prototype.addJSON=function(t,i){if((i=i===g?0:i)>f.recursionLimit)throw Error("max depth exceeded");if(t)for(var n,r=Object.keys(t),e=0;e<r.length;++e)n=t[r[e]],this.add((n.fields!==g?s:n.values!==g?u:n.methods!==g?o:n.id!==g?h:a).fromJSON(r[e],n,i+1));return this},a.prototype.get=function(t){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,t)?this.nested[t]:null},a.prototype.getEnum=function(t){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,t)&&this.nested[t]instanceof u)return this.nested[t].values;throw Error("no such enum: "+t)},a.prototype.add=function(t){if(!(t instanceof h&&t.extend!==g||t instanceof s||t instanceof c||t instanceof u||t instanceof o||t instanceof a))throw TypeError("object must be a valid nested object");if("__proto__"===t.name)return this;if(this.nested){var i=this.get(t.name);if(i){if(!(i instanceof a&&t instanceof a)||i instanceof s||i instanceof o)throw Error("duplicate name '"+t.name+"' in "+this);for(var n=i.nestedArray,r=0;r<n.length;++r)t.add(n[r]);this.remove(i),this.nested||(this.nested={}),t.setOptions(i.options,!0)}}else this.nested={};this.nested[t.name]=t,this instanceof s||this instanceof o||this instanceof u||this instanceof h||t.r||(t.r=t.o),this.v=!0,this.b=!0;for(var e=this;e=e.parent;)e.v=!0,e.b=!0;return t.onAdd(this),l(this)},a.prototype.remove=function(t){if(!(t instanceof r))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=g),t.onRemove(this),l(this)},a.prototype.define=function(t,i){if(f.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&""===t[0])throw Error("path must be relative");if(t.length>f.recursionLimit)throw Error("max depth exceeded");for(var n=this;0<t.length;){var r=t.shift();if(n.nested&&n.nested[r]){if(!((n=n.nested[r])instanceof a))throw Error("path conflicts with non-namespace objects")}else n.add(n=new a(r))}return i&&n.addJSON(i),n},a.prototype.resolveAll=function(){if(this.b){this.v&&this.p(this.r);var t=this.nestedArray,i=0;for(this.resolve();i<t.length;)t[i]instanceof a?t[i++].resolveAll():t[i++].resolve();this.b=!1}return this},a.prototype.p=function(i){return this.v&&(this.v=!1,i=this.r||i,r.prototype.p.call(this,i),this.nestedArray.forEach(t=>{t.p(i)})),this},a.prototype.lookup=function(t,i,n){if("boolean"==typeof i?(n=i,i=g):i&&!Array.isArray(i)&&(i=[i]),f.isString(t)&&t.length){if("."===t)return this.root;t=t.split(".")}else if(!t.length)return this;var r=t.join(".");if(""===t[0])return this.root.lookup(t.slice(1),i);var e=this.root.y&&this.root.y["."+r];if(e&&(!i||~i.indexOf(e.constructor)))return e;if((e=this.w(t,r))&&(!i||~i.indexOf(e.constructor)))return e;if(!n)for(var s=this;s.parent;){if((e=s.parent.w(t,r))&&(!i||~i.indexOf(e.constructor)))return e;s=s.parent}return null},a.prototype.w=function(t,i){if(Object.prototype.hasOwnProperty.call(this.l,i))return this.l[i];var n=this.get(t[0]),r=null;if(n)1===t.length?r=n:n instanceof a&&(t=t.slice(1),r=n.w(t,t.join(".")));else for(var e=0;e<this.nestedArray.length;++e)if(this.a[e]instanceof a&&(n=this.a[e].w(t,i))){r=n;break}return this.l[i]=r},a.prototype.lookupType=function(t){var i=this.lookup(t,[s]);if(i)return i;throw Error("no such type: "+t)},a.prototype.lookupEnum=function(t){var i=this.lookup(t,[u]);if(i)return i;throw Error("no such Enum '"+t+"' in "+this)},a.prototype.lookupTypeOrEnum=function(t){var i=this.lookup(t,[s,u]);if(i)return i;throw Error("no such Type or Enum '"+t+"' in "+this)},a.prototype.lookupService=function(t){var i=this.lookup(t,[o]);if(i)return i;throw Error("no such Service '"+t+"' in "+this)},a.c=function(t,i,n){s=t,o=i,u=n}},{13:13,14:14,24:24,6:6}],13:[function(t,i,n){(i.exports=c).className="ReflectionObject";const r=t(14);var e,o=t(24),s={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE2024",default_symbol_visibility:"EXPORT_TOP_LEVEL"},u={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"},h={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"},f={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"};function c(t,i){if(!o.isString(t))throw TypeError("name must be a string");if(i&&!o.isObject(i))throw TypeError("options must be an object");this.options=i,this.parsedOptions=null,this.name=t,this.r=null,this.o="proto2",this.e={},this.g=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(c.prototype,{root:{get:function(){for(var t=this;null!==t.parent;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],i=this.parent;i;)t.unshift(i.name),i=i.parent;return t.join(".")}}}),c.prototype.toJSON=function(){throw Error()},c.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;t=t.root;t instanceof e&&t.j(this)},c.prototype.onRemove=function(t){t=t.root;t instanceof e&&t.O(this),this.parent=null,this.resolved=!1},c.prototype.resolve=function(){return this.resolved||this.root instanceof e&&(this.resolved=!0),this},c.prototype.p=function(t){return this.n(this.r||t)},c.prototype.n=function(t){if(!this.g){var i={};if(!t)throw Error("Unknown edition for "+this.fullName);var n=Object.assign(this.options?Object.assign({},this.options.features):{},this.f(t));if(this.r){if("proto2"===t)i=Object.assign({},h);else if("proto3"===t)i=Object.assign({},f);else if("2023"===t)i=Object.assign({},u);else{if("2024"!==t)throw Error("Unknown edition: "+t);i=Object.assign({},s)}this.e=Object.assign(i,n||{})}else if(this.partOf instanceof r){t=Object.assign({},this.partOf.e);this.e=Object.assign(t,n||{})}else if(!this.declaringField){if(!this.parent)throw Error("Unable to find a parent for "+this.fullName);i=Object.assign({},this.parent.e);this.e=Object.assign(i,n||{})}this.extensionField&&(this.extensionField.e=this.e),this.g=!0}},c.prototype.f=function(){return{}},c.prototype.getOption=function(t){return this.options?this.options[t]:g},c.prototype.setOption=function(t,i,n){return"__proto__"!==t&&(this.options||(this.options={}),/^features\./.test(t)?o.setProperty(this.options,t,i,n):n&&this.options[t]!==g||(this.getOption(t)!==i&&(this.resolved=!1),this.options[t]=i)),this},c.prototype.setParsedOption=function(i,t,n){var r,e,s;return"__proto__"!==i&&(this.parsedOptions||(this.parsedOptions=[]),r=this.parsedOptions,n?(e=r.find(function(t){return Object.prototype.hasOwnProperty.call(t,i)}))?(s=e[i],o.setProperty(s,n,t)):((e={})[i]=o.setProperty({},n,t),r.push(e)):((s={})[i]=t,r.push(s))),this},c.prototype.setOptions=function(t,i){if(t)for(var n=Object.keys(t),r=0;r<n.length;++r)this.setOption(n[r],t[n[r]],i);return this},c.prototype.toString=function(){var t=this.constructor.className,i=this.fullName;return i.length?t+" "+i:t},c.prototype.u=function(){return this.r&&"proto3"!==this.r?this.r:g},c.c=function(t){e=t}},{14:14,24:24}],14:[function(t,i,n){i.exports=o;var e=t(13),r=(((o.prototype=Object.create(e.prototype)).constructor=o).className="OneOf",t(6)),s=t(24);function o(t,i,n,r){if(Array.isArray(i)||(n=i,i=g),e.call(this,t,n),i!==g&&!Array.isArray(i))throw TypeError("fieldNames must be an Array");this.oneof=i||[],this.fieldsArray=[],this.comment=r}function u(t){if(t.parent)for(var i=0;i<t.fieldsArray.length;++i)t.fieldsArray[i].parent||t.parent.add(t.fieldsArray[i])}o.fromJSON=function(t,i){return new o(t,i.oneof,i.options,i.comment)},o.prototype.toJSON=function(t){t=!!t&&!!t.keepComments;return s.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:g])},o.prototype.add=function(t){if(t instanceof r)return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),u(t.partOf=this),this;throw TypeError("field must be a Field")},o.prototype.remove=function(t){if(!(t instanceof r))throw TypeError("field must be a Field");var i=this.fieldsArray.indexOf(t);if(i<0)throw Error(t+" is not a member of "+this);return this.fieldsArray.splice(i,1),-1<(i=this.oneof.indexOf(t.name))&&this.oneof.splice(i,1),t.partOf=null,this},o.prototype.onAdd=function(t){e.prototype.onAdd.call(this,t);for(var i=0;i<this.oneof.length;++i){var n=t.get(this.oneof[i]);n&&!n.partOf&&(n.partOf=this).fieldsArray.push(n)}u(this)},o.prototype.onRemove=function(t){for(var i,n=0;n<this.fieldsArray.length;++n)(i=this.fieldsArray[n]).parent&&i.parent.remove(i);e.prototype.onRemove.call(this,t)},Object.defineProperty(o.prototype,"isProto3Optional",{get:function(){var t;return null!=this.fieldsArray&&1===this.fieldsArray.length&&(null!=(t=this.fieldsArray[0]).options&&!0===t.options.proto3_optional)}}),o.d=function(){for(var n=Array(arguments.length),t=0;t<arguments.length;)n[t]=arguments[t++];return function(t,i){s.decorateType(t.constructor).add(new o(i,n)),Object.defineProperty(t,i,{get:s.oneOfGetter(n),set:s.oneOfSetter(n)})}}},{13:13,24:24,6:6}],15:[function(t,i,n){i.exports=h;var r,e=t(34),s=e.LongBits,o=e.utf8;function u(t,i){return RangeError("index out of range: "+t.pos+" + "+(i||1)+" > "+t.len)}function h(t){this.buf=t,this.pos=0,this.len=t.length}function f(){return e.Buffer?function(t){return(h.create=function(t){return e.Buffer.isBuffer(t)?new r(t):c(t)})(t)}:c}var c="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new h(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new h(t);throw Error("illegal buffer")};function a(){var t=new s(0,0),i=0;if(!(4<this.len-this.pos)){for(;i<3;++i){if(this.pos>=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*i)>>>0,t}for(;i<4;++i)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*i)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(i=0,4<this.len-this.pos){for(;i<5;++i)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}else for(;i<5;++i){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*i+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function l(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw u(this,8);return new s(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}h.create=f(),h.prototype._=e.Array.prototype.subarray||e.Array.prototype.slice,h.prototype.raw=function(t,i){return Array.isArray(this.buf)?this.buf.slice(t,i):t===i?new this.buf.constructor(0):this._.call(this.buf,t,i)},h.prototype.uint32=function(){var t=this.buf,i=this.pos,n=(127&t[i])>>>0;if(t[i++]<128)return this.pos=i,n;if(n=(n|(127&t[i])<<7)>>>0,t[i++]<128)return this.pos=i,n;if(n=(n|(127&t[i])<<14)>>>0,t[i++]<128)return this.pos=i,n;if(n=(n|(127&t[i])<<21)>>>0,t[i++]<128)return this.pos=i,n;if(n=(n|(15&t[i])<<28)>>>0,t[i++]<128)return this.pos=i,n;for(var r=0;r<5;++r){if(i>=this.len)throw this.pos=i,u(this);if(t[i++]<128)return this.pos=i,n}throw this.pos=i,Error("invalid varint encoding")},h.prototype.tag=function(){var t=this.buf,i=this.pos,n=(127&t[i])>>>0;if(t[i++]<128)return this.pos=i,n;if(n=(n|(127&t[i])<<7)>>>0,t[i++]<128)return this.pos=i,n;if(n=(n|(127&t[i])<<14)>>>0,t[i++]<128)return this.pos=i,n;if(n=(n|(127&t[i])<<21)>>>0,t[i++]<128)return this.pos=i,n;if(n=(n|(15&t[i])<<28)>>>0,t[i]<128&&0==(112&t[i]))return this.pos=i+1,n;throw this.pos=i+1,Error("invalid tag encoding")},h.prototype.int32=function(){return 0|this.uint32()},h.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},h.prototype.bool=function(){for(var t,i=!1,n=0;n<10;++n){if(this.pos>=this.len)throw u(this);if(127&(t=this.buf[this.pos++])&&(i=!0),t<128)return i}throw Error("invalid varint encoding")},h.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return l(this.buf,this.pos+=4)},h.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|l(this.buf,this.pos+=4)},h.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=e.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},h.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=e.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},h.prototype.bytes=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos=n,this.raw(i,n)},h.prototype.string=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);return this.pos=n,o.read(this.buf,i,n)},h.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw u(this)}while(128&this.buf[this.pos++]);return this},h.recursionLimit=e.recursionLimit,h.prototype.skipType=function(t,i,n){if(h.recursionLimit<(i=i===g?0:i))throw Error("max depth exceeded");if(0===n)throw Error("illegal tag: field number 0");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),e=r>>>3;if(!e)throw Error("illegal tag: field number 0");if(4===(t=7&r)){if(n!==g&&e!==n)throw Error("invalid end group tag");break}this.skipType(t,i+1,e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},h.c=function(t){r=t,h.create=f(),r.c();var i=e.Long?"toLong":"toNumber";e.merge(h.prototype,{int64:function(){return a.call(this)[i](!1)},uint64:function(){return a.call(this)[i](!0)},sint64:function(){return a.call(this).zzDecode()[i](!1)},fixed64:function(){return d.call(this)[i](!0)},sfixed64:function(){return d.call(this)[i](!1)}})}},{34:34}],16:[function(t,i,n){i.exports=s;var r=t(15),e=((s.prototype=Object.create(r.prototype)).constructor=s,t(34));function s(t){r.call(this,t)}s.c=function(){e.Buffer&&(s.prototype._=e.Buffer.prototype.slice)},s.prototype.raw=function(t,i){return t===i?e.Buffer.alloc(0):this._.call(this.buf,t,i)},s.prototype.string=function(){var t=this.uint32(),i=this.pos,n=this.pos+t;if(n>this.len)throw RangeError("index out of range: "+this.pos+" + "+t+" > "+this.len);return this.pos=n,this.buf.utf8Slice?this.buf.utf8Slice(i,n):this.buf.toString("utf-8",i,n)},s.c()},{15:15,34:34}],17:[function(t,i,n){i.exports=h;var r,d,v,e=t(12),s=(((h.prototype=Object.create(e.prototype)).constructor=h).className="Root",t(6)),o=t(5),u=t(14),b=t(24);function h(t){e.call(this,"",t),this.deferred=[],this.files=[],this.r="proto2",this.y={}}function p(){}h.fromJSON=function(t,i,n){if((n=n===g?0:n)>b.recursionLimit)throw Error("max depth exceeded");return i=i||new h,t.options&&i.setOptions(t.options),i.addJSON(t.nested,n).resolveAll()},h.prototype.resolvePath=b.path.resolve,h.prototype.fetch=b.fetch,h.prototype.load=function t(i,s,e){"function"==typeof s&&(e=s,s=g);var o=this;if(!e)return b.asPromise(t,o,i,s);var u=e===p;function h(t,i){if(e){if(u)throw t;i&&i.resolveAll();var n=e;e=null,n(t,i)}}function f(t){var i=t.lastIndexOf("google/protobuf/");if(-1<i){i=t.substring(i);if(Object.prototype.hasOwnProperty.call(v,i))return i}return Object.prototype.hasOwnProperty.call(v,t)?t:null}function c(t,i){try{if(b.isString(i)&&"{"==(i[0]||"")&&(i=JSON.parse(i)),b.isString(i)){d.filename=t;var n,r=d(i,o,s),e=0;if(r.imports)for(;e<r.imports.length;++e)(n=f(r.imports[e])||o.resolvePath(t,r.imports[e]))&&a(n);if(r.weakImports)for(e=0;e<r.weakImports.length;++e)(n=f(r.weakImports[e])||o.resolvePath(t,r.weakImports[e]))&&a(n,!0)}else o.setOptions(i.options).addJSON(i.nested)}catch(t){h(t)}u||l||h(null,o)}function a(n,r){if(n=f(n)||n,!~o.files.indexOf(n))if(o.files.push(n),Object.prototype.hasOwnProperty.call(v,n))u?c(n,v[n]):(++l,setTimeout(function(){--l,c(n,v[n])}));else if(u){var t;try{t=b.fs.readFileSync(n).toString("utf8")}catch(t){return void(r||h(t))}c(n,t)}else++l,o.fetch(n,function(t,i){--l,e&&(t?r?l||h(null,o):h(t):c(n,i))})}var l=0;b.isString(i)&&(i=[i]);for(var n,r=0;r<i.length;++r)(n=o.resolvePath("",i[r]))&&a(n);return u?o.resolveAll():l||h(null,o),o},h.prototype.loadSync=function(t,i){if(b.isNode)return this.load(t,i,p);throw Error("not supported")},h.prototype.resolveAll=function(){if(!this.b)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(t){return"'extend "+t.extend+"' in "+t.parent.fullName}).join(", "));return e.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function c(t,i){var n,r=i.parent.lookup(i.extend);if(r)return n=new s(i.fullName,i.id,i.type,i.rule,g,i.options),r.get(n.name)||((n.declaringField=i).extensionField=n,r.add(n)),1}h.prototype.j=function(t){if(t instanceof s)t.extend===g||t.extensionField||c(0,t)||this.deferred.push(t);else if(t instanceof o)f.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof u)){if(t instanceof r)for(var i=0;i<this.deferred.length;)c(0,this.deferred[i])?this.deferred.splice(i,1):++i;for(var n=0;n<t.nestedArray.length;++n)this.j(t.a[n]);f.test(t.name)&&(t.parent[t.name]=t)}(t instanceof r||t instanceof o||t instanceof s)&&(this.y[t.fullName]=t)},h.prototype.O=function(t){var i;if(t instanceof s)t.extend!==g&&(t.extensionField?(t.extensionField.parent.remove(t.extensionField),t.extensionField=null):-1<(i=this.deferred.indexOf(t))&&this.deferred.splice(i,1));else if(t instanceof o)f.test(t.name)&&delete t.parent[t.name];else if(t instanceof e){for(var n=0;n<t.nestedArray.length;++n)this.O(t.a[n]);f.test(t.name)&&delete t.parent[t.name]}delete this.y[t.fullName]},h.c=function(t,i,n){r=t,d=i,v=n}},{12:12,14:14,24:24,5:5,6:6}],18:[function(t,i,n){i.exports={}},{}],19:[function(t,i,n){n.Service=t(20)},{20:20}],20:[function(t,i,n){i.exports=r;var u=t(34);function r(t,i,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");u.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!i,this.responseDelimited=!!n}((r.prototype=Object.create(u.EventEmitter.prototype)).constructor=r).prototype.rpcCall=function t(n,i,r,e,s){if(!e)throw TypeError("request must be specified");var o=this;if(!s)return u.asPromise(t,o,n,i,r,e);if(!o.rpcImpl)return setTimeout(function(){s(Error("already ended"))},0),g;try{return o.rpcImpl(n,i[o.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(t,i){if(t)return o.emit("error",t,n),s(t);if(null===i)return o.end(!0),g;if(!(i instanceof r))try{i=r[o.responseDelimited?"decodeDelimited":"decode"](i)}catch(t){return o.emit("error",t,n),s(t)}return o.emit("data",i,n),s(null,i)})}catch(t){return o.emit("error",t,n),setTimeout(function(){s(t)},0),g}},r.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{34:34}],21:[function(t,i,n){i.exports=c;var r=t(12),o=(((c.prototype=Object.create(r.prototype)).constructor=c).className="Service",t(11)),u=t(24),h=t(19),f=u.patterns.reservedRe;function c(t,i){r.call(this,t,i),this.methods={},this.k=null}function e(t){return t.k=null,t}c.fromJSON=function(t,i,n){if((n=n===g?0:n)>u.recursionLimit)throw Error("max depth exceeded");var r=new c(t,i.options);if(i.methods)for(var e=Object.keys(i.methods),s=0;s<e.length;++s)r.add(o.fromJSON(e[s],i.methods[e[s]]));return i.nested&&r.addJSON(i.nested,n),i.edition&&(r.r=i.edition),r.comment=i.comment,r.o="proto3",r},c.prototype.toJSON=function(t){var i=r.prototype.toJSON.call(this,t),n=!!t&&!!t.keepComments;return u.toObject(["edition",this.u(),"options",i&&i.options||g,"methods",r.arrayToJSON(this.methodsArray,t)||{},"nested",i&&i.nested||g,"comment",n?this.comment:g])},Object.defineProperty(c.prototype,"methodsArray",{get:function(){return this.k||(this.k=u.toArray(this.methods))}}),c.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.methods,t)?this.methods[t]:r.prototype.get.call(this,t)},c.prototype.resolveAll=function(){if(this.b){r.prototype.resolve.call(this);for(var t=this.methodsArray,i=0;i<t.length;++i)t[i].resolve()}return this},c.prototype.p=function(i){return this.v&&(i=this.r||i,r.prototype.p.call(this,i),this.methodsArray.forEach(t=>{t.p(i)})),this},c.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof o?"__proto__"===t.name?this:e((this.methods[t.name]=t).parent=this):r.prototype.add.call(this,t)},c.prototype.remove=function(t){if(t instanceof o){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,e(this)}return r.prototype.remove.call(this,t)},c.prototype.create=function(t,i,n){for(var r,e=new h.Service(t,i,n),s=0;s<this.methodsArray.length;++s){var o=u.lcFirst((r=this.k[s]).resolve().name).replace(/[^$\w_]/g,"");e[o]=u.codegen(["r","c"],f.test(o)?o+"_":o)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return e}},{11:11,12:12,19:19,24:24}],22:[function(t,i,n){i.exports=w;var u=t(12),h=(((w.prototype=Object.create(u.prototype)).constructor=w).className="Type",t(5)),f=t(14),c=t(6),a=t(9),l=t(21),s=t(10),e=t(15),o=t(41),d=t(24),v=t(4),b=t(3),p=t(39),m=t(2),y=t(40);function w(t,i){t=t.replace(/\W/g,""),u.call(this,t,i),this.fields={},this.oneofs=g,this.extensions=g,this.reserved=g,this.group=g,this.A=null,this.t=null,this.x=null,this.h=null}function r(t){return t.A=t.t=t.x=null,delete t.encode,delete t.decode,delete t.verify,t}Object.defineProperties(w.prototype,{fieldsById:{get:function(){if(!this.A){this.A={};for(var t=Object.keys(this.fields),i=0;i<t.length;++i){var n=this.fields[t[i]],r=n.id;if(this.A[r])throw Error("duplicate id "+r+" in "+this);this.A[r]=n}}return this.A}},fieldsArray:{get:function(){return this.t||(this.t=d.toArray(this.fields))}},oneofsArray:{get:function(){return this.x||(this.x=d.toArray(this.oneofs))}},ctor:{get:function(){return this.h||(this.ctor=w.generateConstructor(this)())},set:function(t){for(var i,n=t.prototype,r=(n instanceof s||((t.prototype=new s).constructor=t,d.merge(t.prototype,n)),t.$type=t.prototype.$type=this,d.merge(t,s,!0),this.h=t,delete this.decode,delete this.fromObject,0);r<this.fieldsArray.length;++r)i=this.t[r].resolve(),t.prototype[i.name]=i.defaultValue;for(var e={},r=0;r<this.oneofsArray.length;++r)e[this.x[r].resolve().name]={get:d.oneOfGetter(this.x[r].oneof),set:d.oneOfSetter(this.x[r].oneof)};r&&Object.defineProperties(t.prototype,e)}}}),w.generateConstructor=function(t){for(var i,n=d.codegen(["p"],t.name),r=0;r<t.fieldsArray.length;++r)(i=t.t[r]).map?n("this%s={}",d.safeProp(i.name)):i.repeated&&n("this%s=[]",d.safeProp(i.name));return n('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")},w.fromJSON=function(t,i,n){if((n=n===g?0:n)>d.nestingLimit)throw Error("max depth exceeded");for(var r=new w(t,i.options),e=(r.extensions=i.extensions,r.reserved=i.reserved,Object.keys(i.fields)),s=0;s<e.length;++s)r.add((void 0!==i.fields[e[s]].keyType?a:c).fromJSON(e[s],i.fields[e[s]]));if(i.oneofs)for(e=Object.keys(i.oneofs),s=0;s<e.length;++s)r.add(f.fromJSON(e[s],i.oneofs[e[s]]));if(i.nested)for(e=Object.keys(i.nested),s=0;s<e.length;++s){var o=i.nested[e[s]];r.add((o.id!==g?c:o.fields!==g?w:o.values!==g?h:o.methods!==g?l:u).fromJSON(e[s],o,n+1))}return i.extensions&&i.extensions.length&&(r.extensions=i.extensions),i.reserved&&i.reserved.length&&(r.reserved=i.reserved),i.group&&(r.group=!0),i.comment&&(r.comment=i.comment),i.edition&&(r.r=i.edition),r.o="proto3",r},w.prototype.toJSON=function(t){var i=u.prototype.toJSON.call(this,t),n=!!t&&!!t.keepComments;return d.toObject(["edition",this.u(),"options",i&&i.options||g,"oneofs",u.arrayToJSON(this.oneofsArray,t),"fields",u.arrayToJSON(this.fieldsArray.filter(function(t){return!t.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:g,"reserved",this.reserved&&this.reserved.length?this.reserved:g,"group",this.group||g,"nested",i&&i.nested||g,"comment",n?this.comment:g])},w.prototype.resolveAll=function(){if(this.b){u.prototype.resolveAll.call(this);for(var t=this.oneofsArray,i=0;i<t.length;)t[i++].resolve();for(var n=this.fieldsArray,i=0;i<n.length;)n[i++].resolve()}return this},w.prototype.p=function(i){return this.v&&(i=this.r||i,u.prototype.p.call(this,i),this.oneofsArray.forEach(t=>{t.n(i)}),this.fieldsArray.forEach(t=>{t.n(i)})),this},w.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.fields,t)?this.fields[t]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,t)?this.oneofs[t]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,t)?this.nested[t]:null},w.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof c&&t.extend===g){if((this.A||this.fieldsById)[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return"__proto__"===t.name?this:(t.parent&&t.parent.remove(t),(this.fields[t.name]=t).message=this,t.onAdd(this),r(this))}return t instanceof f?"__proto__"===t.name?this:(this.oneofs||(this.oneofs={}),(this.oneofs[t.name]=t).onAdd(this),r(this)):u.prototype.add.call(this,t)},w.prototype.remove=function(t){if(t instanceof c&&t.extend===g){if(this.fields&&this.fields[t.name]===t)return delete this.fields[t.name],t.parent=null,t.onRemove(this),r(this);throw Error(t+" is not a member of "+this)}if(t instanceof f){if(this.oneofs&&this.oneofs[t.name]===t)return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),r(this);throw Error(t+" is not a member of "+this)}return u.prototype.remove.call(this,t)},w.prototype.isReservedId=function(t){return u.isReservedId(this.reserved,t)},w.prototype.isReservedName=function(t){return u.isReservedName(this.reserved,t)},w.prototype.create=function(t){return new this.ctor(t)},w.prototype.setup=function(){for(var t=this.fullName,i=[],n=0;n<this.fieldsArray.length;++n)i.push(this.t[n].resolve().resolvedType);this.encode=v(this)({Writer:o,types:i,util:d}),this.decode=b(this)({Reader:e,types:i,util:d,C:this.ctor}),this.verify=p(this)({types:i,util:d}),this.fromObject=m.fromObject(this)({types:i,util:d,C:this.ctor}),this.toObject=m.toObject(this)({types:i,util:d});var r,t=y[t];return t&&((r=Object.create(this)).h=this.ctor,r.fromObject=this.fromObject,this.fromObject=t.fromObject.bind(r),r.toObject=this.toObject,this.toObject=t.toObject.bind(r)),this},w.prototype.encode=function(t,i){return this.setup().encode(t,i)},w.prototype.encodeDelimited=functi