protobuf.js/dist/light/protobuf.min.js

10 lines
54 KiB
JavaScript

/*!
* protobuf.js v6.6.0 (c) 2016, Daniel Wirtz
* Compiled Sat, 21 Jan 2017 22:47:16 UTC
* Licensed under the BSD-3-Clause License
* see: https://github.com/dcodeIO/protobuf.js for details
*/
!function(e,t){"use strict";!function e(t,r,n){function i(o,u){if(!r[o]){if(!t[o]){var f="function"==typeof require&&require;if(!u&&f)return f(o,!0);if(s)return s(o,!0);var a=Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var h=r[o]={exports:{}};t[o][0].call(h.exports,function(e){var r=t[o][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t){function r(e,t){for(var r=[],n=2;n<arguments.length;)r.push(arguments[n++]);var i=!0;return new Promise(function(n,s){r.push(function(e){if(i)if(i=!1,e)s(e);else{for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);n.apply(null,t)}});try{e.apply(t||this,r)}catch(e){i&&(i=!1,s(e))}})}t.exports=r},{}],2:[function(e,r,n){var i=n;i.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var s=Array(64),o=Array(123),u=0;u<64;)o[s[u]=u<26?u+65:u<52?u+71:u<62?u-4:u-59|43]=u++;i.encode=function(e,t,r){for(var n,i=[],o=0,u=0;t<r;){var f=e[t++];switch(u){case 0:i[o++]=s[f>>2],n=(3&f)<<4,u=1;break;case 1:i[o++]=s[n|f>>4],n=(15&f)<<2,u=2;break;case 2:i[o++]=s[n|f>>6],i[o++]=s[63&f],u=0}}return u&&(i[o++]=s[n],i[o]=61,1===u&&(i[o+1]=61)),String.fromCharCode.apply(String,i)};var f="invalid encoding";i.decode=function(e,r,n){for(var i,s=n,u=0,a=0;a<e.length;){var h=e.charCodeAt(a++);if(61===h&&u>1)break;if((h=o[h])===t)throw Error(f);switch(u){case 0:i=h,u=1;break;case 1:r[n++]=i<<2|(48&h)>>4,i=h,u=2;break;case 2:r[n++]=(15&i)<<4|(60&h)>>2,i=h,u=3;break;case 3:r[n++]=(3&i)<<6|h,u=0}}if(1===u)throw Error(f);return n-s},i.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)}},{}],3:[function(e,r){function n(){function e(){for(var t=[],r=0;r<arguments.length;)t.push(arguments[r++]);var n=i.apply(null,t),h=p;if(c.length){var l=c[c.length-1];s.test(l)?h=++p:f.test(l)&&++h,u.test(l)&&!u.test(n)?(h=++p,d=!0):d&&a.test(l)&&(h=--p,d=!1),o.test(n)&&(h=--p)}for(r=0;r<h;++r)n="\t"+n;return c.push(n),e}function r(e){return"function"+(e?" "+e.replace(/[^\w_$]/g,"_"):"")+"("+l.join(",")+") {\n"+c.join("\n")+"\n}"}function h(r,i){"object"==typeof r&&(i=r,r=t);var s=e.str(r);n.verbose&&console.log("--- codegen ---\n"+s.replace(/^/gm,"> ").replace(/\t/g," "));var o=Object.keys(i||(i={}));return Function.apply(null,o.concat("return "+s)).apply(null,o.map(function(e){return i[e]}))}for(var l=[],c=[],p=1,d=!1,y=0;y<arguments.length;)l.push(arguments[y++]);return e.str=r,e.eof=h,e}function i(e){for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);if(r=0,e=e.replace(/%([dfjs])/g,function(e,n){switch(n){case"d":return Math.floor(t[r++]);case"f":return+t[r++];case"j":return JSON.stringify(t[r++]);default:return t[r++]}}),r!==t.length)throw Error("argument count mismatch");return e}r.exports=n;var s=/[{[]$/,o=/^[}\]]/,u=/:$/,f=/^\s*(?:if|}?else if|while|for)\b|\b(?:else)\s*$/,a=/\b(?:break|continue)(?: \w+)?;?$|^\s*return\b/;n.sprintf=i,n.supported=!1;try{n.supported=1===n("a","b")("return a-b").eof()(2,1)}catch(e){}n.verbose=!1},{}],4:[function(e,r){function n(){this.a={}}r.exports=n;var i=n.prototype;i.on=function(e,t,r){return(this.a[e]||(this.a[e]=[])).push({fn:t,ctx:r||this}),this},i.off=function(e,r){if(e===t)this.a={};else if(r===t)this.a[e]=[];else for(var n=this.a[e],i=0;i<n.length;)n[i].fn===r?n.splice(i,1):++i;return this},i.emit=function(e){var t=this.a[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},{}],5:[function(e,t){function r(e){for(var t=Object.keys(this),r=0;r<t.length;++r)e[t[r]]=this[t[r]];var n=e.prototype=Object.create(this.prototype);return n.constructor=e,n}t.exports=r},{}],6:[function(e,r){function n(e,t){return t?u&&u.readFile?u.readFile(e,"utf8",function(r,n){return r&&"undefined"!=typeof XMLHttpRequest?i(e,t):t(r,n)}):i(e,t):s(n,this,e)}function i(e,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){return 4===n.readyState?0===n.status||200===n.status?r(null,n.responseText):r(Error("status "+n.status)):t},n.open("GET",e),n.send()}r.exports=n;var s=e(1),o=e(7),u=o("fs")},{1:1,7:7}],7:[function(e,t,r){function n(e){try{var t=eval("quire".replace(/^/,"re"))(e);if(t&&(t.length||Object.keys(t).length))return t}catch(e){}return null}t.exports=n},{}],8:[function(e,t,r){var n=r,i=n.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},s=n.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),r=i(e),n="";r&&(n=t.shift()+"/");for(var s=0;s<t.length;)".."===t[s]?s>0?t.splice(--s,2):r?t.splice(s,1):++s:"."===t[s]?t.splice(s,1):++s;return n+t.join("/")};n.resolve=function(e,t,r){return r||(t=s(t)),i(t)?t:(r||(e=s(e)),(e=e.replace(/(?:\/|^)[^\/]+$/,"")).length?s(e+"/"+t):t)}},{}],9:[function(e,t){function r(e,t,r){var n=r||8192,i=n>>>1,s=null,o=n;return function(r){if(r<1||r>i)return e(r);o+r>n&&(s=e(n),o=0);var u=t.call(s,o,o+=r);return 7&o&&(o=(7|o)+1),u}}t.exports=r},{}],10:[function(e,t,r){var n=r;n.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)r=e.charCodeAt(n),r<128?t+=1:r<2048?t+=2:55296===(64512&r)&&56320===(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},n.read=function(e,t,r){var n=r-t;if(n<1)return"";for(var i,s=null,o=[],u=0;t<r;)i=e[t++],i<128?o[u++]=i:i>191&&i<224?o[u++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[u++]=55296+(i>>10),o[u++]=56320+(1023&i)):o[u++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],u>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),u=0);return s?(u&&s.push(String.fromCharCode.apply(String,o.slice(0,u))),s.join("")):u?String.fromCharCode.apply(String,o.slice(0,u)):""},n.write=function(e,t,r){for(var n,i,s=r,o=0;o<e.length;++o)n=e.charCodeAt(o),n<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=e.charCodeAt(o+1)))?(n=65536+((1023&n)<<10)+(1023&i),++o,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-s}},{}],11:[function(e,t){function r(e){return n(e)}function n(t,n){if(i||(i=e(31)),!(t instanceof i))throw TypeError("type must be a Type");if(n){if("function"!=typeof n)throw TypeError("ctor must be a function")}else n=o.codegen("p")("return ctor.call(this,p)").eof(t.name,{ctor:s});n.constructor=r;var u=n.prototype=new s;return u.constructor=n,o.merge(n,s,!0),n.$type=t,u.$type=t,t.fieldsArray.forEach(function(e){u[e.name]=Array.isArray(e.resolve().defaultValue)?o.emptyArray:o.isObject(e.defaultValue)&&!e.long?o.emptyObject:e.defaultValue}),t.oneofsArray.forEach(function(e){Object.defineProperty(u,e.resolve().name,{get:o.oneOfGetter(e.oneof),set:o.oneOfSetter(e.oneof)})}),t.ctor=n,u}t.exports=r;var i,s=e(20),o=e(33);r.create=n,r.prototype=s},{20:20,31:31,33:33}],12:[function(e,t,r){function n(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){var i=t.resolvedType.values;e("switch(d%s){",n),Object.keys(i).forEach(function(r){t.repeated&&i[r]===t.typeDefault&&e("default:"),e("case%j:",r)("case %j:",i[r])("m%s=%j",n,i[r])("break")}),e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%d].fromObject(d%s)",n,r,n);else{var s=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,s)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low,d%s.high).toNumber(%s)",n,n,n,s?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function i(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof o?e("d%s=o.enums===String?types[%d].values[m%s]:m%s",n,r,n,n):e("d%s=types[%d].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low,m%s.high).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("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",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}var s=r,o=e(15),u=e(33);s.fromObject=function(e){var t=e.fieldsArray,r=u.codegen("d")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var i=0;i<t.length;++i){var s=t[i].resolve(),f=u.safeProp(s.name);s.map?(r("if(d%s){",f)('if(typeof d%s!=="object")',f)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",f)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",f),n(r,s,i,f+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",f)("if(!Array.isArray(d%s))",f)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",f)("for(var i=0;i<d%s.length;++i){",f),n(r,s,i,f+"[i]")("}")("}")):(s.resolvedType instanceof o||r("if(d%s!==undefined&&d%s!==null){",f,f),n(r,s,i,f),s.resolvedType instanceof o||r("}"))}return r("return m")},s.toObject=function(e){var t=e.fieldsArray;if(!t.length)return u.codegen()("return {}");var r=u.codegen("m","o")("if(!o)")("o={}")("var d={}"),n=t.filter(function(e){return e.resolve().repeated});n.length&&(r("if(o.arrays||o.defaults){"),n.forEach(function(e){r("d%s=[]",u.safeProp(e.name))}),r("}"));var s=t.filter(function(e){return e.map});s.length&&(r("if(o.objects||o.defaults){"),s.forEach(function(e){r("d%s={}",u.safeProp(e.name))}),r("}"));var f=t.filter(function(e){return!(e.repeated||e.map)});f.length&&(r("if(o.defaults){"),f.forEach(function(e){var t=u.safeProp(e.name);e.resolvedType instanceof o?r("d%s=o.enums===String?%j:%j",t,e.resolvedType.valuesById[e.typeDefault],e.typeDefault):e.long?r("if(util.Long){")("var n=new util.Long(%d,%d,%j)",e.typeDefault.low,e.typeDefault.high,e.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",t)("}else")("d%s=o.longs===String?%j:%d",t,""+e.typeDefault,e.typeDefault.toNumber()):e.bytes?r("d%s=o.bytes===String?%j:%s",t,String.fromCharCode.apply(String,e.typeDefault),"["+Array.prototype.slice.call(e.typeDefault).join(",")+"]"):r("d%s=%j",t,e.typeDefault)}),r("}"));for(var a=0;a<t.length;++a){var h=t[a],l=u.safeProp(h.name);r("if(m%s!==undefined&&m%s!==null&&m.hasOwnProperty(%j)){",l,l,h.name),h.map?(r("d%s={}",l)("for(var ks2=Object.keys(m%s),j=0;j<ks2.length;++j){",l),i(r,h,a,l+"[ks2[j]]")("}")):h.repeated?(r("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),i(r,h,a,l+"[j]")("}")):i(r,h,a,l),r("}")}return r("return d")}},{15:15,33:33}],13:[function(e,r){function n(e){var r=e.fieldsArray,u=o.codegen("r","l")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor")("while(r.pos<c){")("var t=r.uint32()");e.group&&u("if((t&7)===4)")("break"),u("switch(t>>>3){");for(var f=0;f<r.length;++f){var a=r[f].resolve(),h=a.resolvedType instanceof i?"uint32":a.type,l="m"+o.safeProp(a.name);u("case %d:",a.id),a.map?(u("r.skip().pos++")("if(%s===util.emptyObject)",l)("%s={}",l)("var k=r.%s()",a.keyType)("r.pos++"),s.basic[h]===t?u('%s[typeof k==="object"?util.longToHash(k):k]=types[%d].decode(r,r.uint32())',l,f):u('%s[typeof k==="object"?util.longToHash(k):k]=r.%s()',l,h)):a.repeated?(u("if(!(%s&&%s.length))",l,l)("%s=[]",l),(n.compat||a.packed)&&s.packed[h]!==t&&u("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",l,h)("}else"),s.basic[h]===t?u(a.resolvedType.group?"%s.push(types[%d].decode(r))":"%s.push(types[%d].decode(r,r.uint32()))",l,f):u("%s.push(r.%s())",l,h)):s.basic[h]===t?u(a.resolvedType.group?"%s=types[%d].decode(r)":"%s=types[%d].decode(r,r.uint32())",l,f):u("%s=r.%s()",l,h),u("break")}return u("default:")("r.skipType(t&7)")("break")("}")("}")("return m")}r.exports=n,n.compat=!0;var i=e(15),s=e(32),o=e(33)},{15:15,32:32,33:33}],14:[function(e,r){function n(e,t,r,n){return t.resolvedType.group?e("types[%d].encode(%s,w.uint32(%d)).uint32(%d)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%d].encode(%s,w.uint32(%d).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}function i(e){for(var r,i,f=e.fieldsArray,a=e.oneofsArray,h=u.codegen("m","w")("if(!w)")("w=Writer.create()"),r=0;r<f.length;++r){var l=f[r].resolve();if(!l.partOf){var c=l.resolvedType instanceof s?"uint32":l.type,p=o.basic[c];i="m"+u.safeProp(l.name),l.map?(h("if(%s&&m.hasOwnProperty(%j)){",i,l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",i)("w.uint32(%d).fork().uint32(%d).%s(ks[i])",(l.id<<3|2)>>>0,8|o.mapKey[l.keyType],l.keyType),p===t?h("types[%d].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",r,i):h(".uint32(%d).%s(%s[ks[i]]).ldelim()",16|p,c,i),h("}")("}")):l.repeated?l.packed&&o.packed[c]!==t?h("if(%s&&%s.length&&m.hasOwnProperty(%j)){",i,i,l.name)("w.uint32(%d).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",i)("w.%s(%s[i])",c,i)("w.ldelim()")("}"):(h("if(%s!==undefined&&m.hasOwnProperty(%j)){",i,l.name)("for(var i=0;i<%s.length;++i)",i),p===t?n(h,l,r,i+"[i]"):h("w.uint32(%d).%s(%s[i])",(l.id<<3|p)>>>0,c,i),h("}")):(l.required||(l.long?h("if(%s!==undefined&&%s!==null&&m.hasOwnProperty(%j))",i,i,l.name):l.bytes?h("if(%s&&m.hasOwnProperty(%j))",i,l.name):h("if(%s!==undefined&&m.hasOwnProperty(%j))",i,l.name)),p===t?n(h,l,r,i):h("w.uint32(%d).%s(%s)",(l.id<<3|p)>>>0,c,i))}}for(var r=0;r<a.length;++r){var d=a[r];h("switch(%s){","m"+u.safeProp(d.name));for(var y=d.fieldsArray,m=0;m<y.length;++m){var l=y[m],c=l.resolvedType instanceof s?"uint32":l.type,p=o.basic[c];i="m"+u.safeProp(l.name),h("case%j:",l.name),p===t?n(h,l,f.indexOf(l),i):h("w.uint32(%d).%s(%s)",(l.id<<3|p)>>>0,c,i),h("break")}h("}")}return h("return w")}r.exports=i;var s=e(15),o=e(32),u=e(33)},{15:15,32:32,33:33}],15:[function(e,r){function n(e,t,r){i.call(this,e,r),this.valuesById={},this.values=Object.create(this.valuesById),this.comments={};var n=this;Object.keys(t||{}).forEach(function(e){n.valuesById[n.values[e]=t[e]]=e})}r.exports=n;var i=e(23),s=i.extend(n);n.className="Enum";var o=e(33);n.testJSON=function(e){return!(!e||!e.values)},n.fromJSON=function(e,t){return new n(e,t.values,t.options)},s.toJSON=function(){return{options:this.options,values:this.values}},s.add=function(e,r,n){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(r))throw TypeError("id must be an integer");if(this.values[e]!==t)throw Error("duplicate name");if(this.valuesById[r]!==t)throw Error("duplicate id");return this.valuesById[this.values[e]=r]=e,this.comments[e]=n||null,this},s.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var r=this.values[e];if(r===t)throw Error("name does not exist");return delete this.valuesById[r],delete this.values[e],delete this.comments[e],this}},{23:23,33:33}],16:[function(e,r){function n(e,r,n,s,o,u){if(h.isObject(s)?(u=s,s=o=t):h.isObject(o)&&(u=o,o=t),i.call(this,e,u),!h.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!h.isString(n))throw TypeError("type must be a string");if(s!==t&&!/^required|optional|repeated$/.test(s=(""+s).toLowerCase()))throw TypeError("rule must be a string rule");if(o!==t&&!h.isString(o))throw TypeError("extend must be a string");this.rule=s&&"optional"!==s?s:t,this.type=n,this.id=r,this.extend=o||t,this.required="required"===s,this.optional=!this.required,this.repeated="repeated"===s,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!h.Long&&a.long[n]!==t,this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.b=null}r.exports=n;var i=e(23),s=i.extend(n);n.className="Field";var o,u,f=e(15),a=e(32),h=e(33);Object.defineProperty(s,"packed",{get:function(){return null===this.b&&(this.b=this.getOption("packed")!==!1),this.b}}),s.setOption=function(e,t,r){return"packed"===e&&(this.b=null),i.prototype.setOption.call(this,e,t,r)},n.testJSON=function(e){return!(!e||e.id===t)},n.fromJSON=function(r,i){return i.keyType!==t?(u||(u=e(19)),u.fromJSON(r,i)):new n(r,i.id,i.type,i.rule,i.extend,i.options)},s.toJSON=function(){return{rule:"optional"!==this.rule&&this.rule||t,type:this.type,id:this.id,extend:this.extend,options:this.options}},s.resolve=function(){if(this.resolved)return this;if((this.typeDefault=a.defaults[this.type])===t)if(o||(o=e(31)),this.resolvedType=this.parent.lookup(this.type,o))this.typeDefault=null;else{if(!(this.resolvedType=this.parent.lookup(this.type,f)))throw Error("unresolvable field type: "+this.type);this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]}if(this.options&&this.options.default!==t&&(this.typeDefault=this.options.default,this.resolvedType instanceof f&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.long)this.typeDefault=h.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var r;h.base64.test(this.typeDefault)?h.base64.decode(this.typeDefault,r=h.newBuffer(h.base64.length(this.typeDefault)),0):h.utf8.write(this.typeDefault,r=h.newBuffer(h.utf8.length(this.typeDefault)),0),this.typeDefault=r}return this.map?this.defaultValue=h.emptyObject:this.repeated?this.defaultValue=h.emptyArray:this.defaultValue=this.typeDefault,i.prototype.resolve.call(this)}},{15:15,19:19,23:23,31:31,32:32,33:33}],17:[function(e,t){function r(e,t,r){return"function"==typeof t?(r=t,t=new i.Root):t||(t=new i.Root),t.load(e,r)}function n(e,t){return t||(t=new i.Root),t.loadSync(e)}var i=t.exports=e(18);i.build="light",i.load=r,i.loadSync=n,i.encoder=e(14),i.decoder=e(13),i.verifier=e(36),i.converter=e(12),i.ReflectionObject=e(23),i.Namespace=e(22),i.Root=e(27),i.Enum=e(15),i.Type=e(31),i.Field=e(16),i.OneOf=e(24),i.MapField=e(19),i.Service=e(30),i.Method=e(21),i.Class=e(11),i.Message=e(20),i.types=e(32),i.util=e(33)},{11:11,12:12,13:13,14:14,15:15,16:16,18:18,19:19,20:20,21:21,22:22,23:23,24:24,27:27,30:30,31:31,32:32,33:33,36:36}],18:[function(t,r,n){function i(){s.Reader.c()}var s=e.protobuf=n;s.build="minimal",s.roots={},s.Writer=t(37),s.BufferWriter=t(38),s.Reader=t(25),s.BufferReader=t(26),s.util=t(35),s.rpc=t(28),s.configure=i,"function"==typeof define&&define.amd&&define(["long"],function(e){return e&&(s.util.Long=e,i()),s})},{25:25,26:26,28:28,35:35,37:37,38:38}],19:[function(e,r){function n(e,t,r,n,s){if(i.call(this,e,t,n,s),!f.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}r.exports=n;var i=e(16),s=i.prototype,o=i.extend(n);n.className="MapField";var u=e(32),f=e(33);n.testJSON=function(e){return i.testJSON(e)&&e.keyType!==t},n.fromJSON=function(e,t){return new n(e,t.id,t.keyType,t.type,t.options)},o.toJSON=function(){return{keyType:this.keyType,type:this.type,id:this.id,extend:this.extend,options:this.options}},o.resolve=function(){if(this.resolved)return this;if(u.mapKey[this.keyType]===t)throw Error("invalid key type: "+this.keyType);return s.resolve.call(this)}},{16:16,32:32,33:33}],20:[function(e,t){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}t.exports=r;var n=e(33);r.encode=function(e,t){return this.$type.encode(e,t)},r.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},r.decode=function(e){return this.$type.decode(e)},r.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},r.verify=function(e){return this.$type.verify(e)},r.fromObject=function(e){return this.$type.fromObject(e)},r.from=r.fromObject,r.toObject=function(e,t){return this.$type.toObject(e,t)},r.prototype.toObject=function(e){return this.$type.toObject(this,e)},r.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},{33:33}],21:[function(e,r){function n(e,r,n,s,o,f,a){if(u.isObject(o)?(a=o,o=f=t):u.isObject(f)&&(a=f,f=t),r&&!u.isString(r))throw TypeError("type must be a string");if(!u.isString(n))throw TypeError("requestType must be a string");if(!u.isString(s))throw TypeError("responseType must be a string");i.call(this,e,a),this.type=r||"rpc",this.requestType=n,this.requestStream=!!o||t,this.responseType=s,this.responseStream=!!f||t,this.resolvedRequestType=null,this.resolvedResponseType=null}r.exports=n;var i=e(23),s=i.extend(n);n.className="Method";var o=e(31),u=e(33);n.testJSON=function(e){return!(!e||e.requestType===t)},n.fromJSON=function(e,t){return new n(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options)},s.toJSON=function(){return{type:"rpc"!==this.type&&this.type||t,requestType:this.requestType,requestStream:this.requestStream,responseType:this.responseType,responseStream:this.responseStream,options:this.options}},s.resolve=function(){if(this.resolved)return this;if(!(this.resolvedRequestType=this.parent.lookup(this.requestType,o)))throw Error("unresolvable request type: "+this.requestType);if(!(this.resolvedResponseType=this.parent.lookup(this.responseType,o)))throw Error("unresolvable response type: "+this.requestType);return i.prototype.resolve.call(this)}},{23:23,31:31,33:33}],22:[function(e,r){function n(){a||(a=e(31)),h||(h=e(30)),l=[p,a,h,d,s],c="one of "+l.map(function(e){return e.name}).join(", ")}function i(e){if(!e||!e.length)return t;for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON();return r}function s(e,r){u.call(this,e,r),this.nested=t,this.d=null}function o(e){return e.d=null,e}r.exports=s;var u=e(23),f=u.extend(s);s.className="Namespace";var a,h,l,c,p=e(15),d=e(16),y=e(33);s.testJSON=function(e){return!(!e||e.fields||e.values||e.id!==t||e.oneof||e.methods||e.requestType!==t)},s.fromJSON=function(e,t){return new s(e,t.options).addJSON(t.nested)},s.arrayToJSON=i,Object.defineProperty(f,"nestedArray",{get:function(){return this.d||(this.d=y.toArray(this.nested))}}),f.toJSON=function(){return{options:this.options,nested:i(this.nestedArray)}},f.addJSON=function(e){var t=this;return e&&(l||n(),Object.keys(e).forEach(function(r){for(var n=e[r],i=0;i<l.length;++i)if(l[i].testJSON(n))return t.add(l[i].fromJSON(r,n));throw TypeError("nested."+r+" must be JSON for "+c)})),this},f.get=function(e){return this.nested===t?null:this.nested[e]||null},f.getEnum=function(e){if(this.nested&&this.nested[e]instanceof p)return this.nested[e].values;throw Error("no such enum")},f.add=function(e){if(l||n(),!e||l.indexOf(e.constructor)<0)throw TypeError("object must be "+c);if(e instanceof d&&e.extend===t)throw TypeError("object must be an extension field when not part of a type");if(this.nested){var r=this.get(e.name);if(r){if(!(r instanceof s&&e instanceof s)||r instanceof a||r instanceof h)throw Error("duplicate name '"+e.name+"' in "+this);for(var i=r.nestedArray,u=0;u<i.length;++u)e.add(i[u]);this.remove(r),this.nested||(this.nested={}),e.setOptions(r.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),o(this)},f.remove=function(e){if(!(e instanceof u))throw TypeError("object must be a ReflectionObject");if(e.parent!==this||!this.nested)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=t),e.onRemove(this),o(this)},f.define=function(e,t){if(y.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(r=r.nested[n],!(r instanceof s))throw Error("path conflicts with non-namespace objects")}else r.add(r=new s(n))}return t&&r.addJSON(t),r},f.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof s?e[t++].resolveAll():e[t++].resolve();return f.resolve.call(this)},f.lookup=function(e,r,n){if("boolean"==typeof r&&(n=r,r=t),y.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),r);var i=this.get(e[0]);if(i)if(1===e.length){if(!r||i instanceof r)return i}else if(i instanceof s&&(i=i.lookup(e.slice(1),r,!0)))return i;return null===this.parent||n?null:this.parent.lookup(e,r)},f.lookupType=function(t){a||(a=e(31));var r=this.lookup(t,a);if(!r)throw Error("no such type");return r},f.lookupService=function(t){h||(h=e(30));var r=this.lookup(t,h);if(!r)throw Error("no such service");return r},f.lookupEnum=function(e){var t=this.lookup(e,p);if(!t)throw Error("no such enum");return t.values}},{15:15,16:16,23:23,30:30,31:31,33:33}],23:[function(e,r){function n(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.name=e,this.parent=null,this.resolved=!1,this.comment=null}r.exports=n;var i=e(33);n.className="ReflectionObject",n.extend=i.extend;var s,o=n.prototype;Object.defineProperties(o,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.toJSON=function(){throw Error()},o.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;var r=t.root;s||(s=e(27)),r instanceof s&&r.e(this)},o.onRemove=function(t){s||(s=e(27));var r=t.root;r instanceof s&&r.f(this),this.parent=null,this.resolved=!1},o.resolve=function(){return this.resolved?this:(s||(s=e(27)),this.root instanceof s&&(this.resolved=!0),this)},o.getOption=function(e){return this.options?this.options[e]:t},o.setOption=function(e,r,n){return n&&this.options&&this.options[e]!==t||((this.options||(this.options={}))[e]=r),this},o.setOptions=function(e,t){return e&&Object.keys(e).forEach(function(r){this.setOption(r,e[r],t)},this),this},o.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e}},{27:27,33:33}],24:[function(e,r){function n(e,r,n){if(Array.isArray(r)||(n=r,r=t),s.call(this,e,n),r&&!Array.isArray(r))throw TypeError("fieldNames must be an Array");this.oneof=r||[],this.g=[]}function i(e){e.parent&&e.g.forEach(function(t){t.parent||e.parent.add(t)})}r.exports=n;var s=e(23),o=s.extend(n);n.className="OneOf";var u=e(16);Object.defineProperty(o,"fieldsArray",{get:function(){return this.g}}),n.testJSON=function(e){return!!e.oneof},n.fromJSON=function(e,t){return new n(e,t.oneof,t.options)},o.toJSON=function(){return{oneof:this.oneof,options:this.options}},o.add=function(e){if(!(e instanceof u))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.g.push(e),e.partOf=this,i(this),this},o.remove=function(e){if(!(e instanceof u))throw TypeError("field must be a Field");var t=this.g.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.g.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this},o.onAdd=function(e){s.prototype.onAdd.call(this,e);var t=this;this.oneof.forEach(function(r){var n=e.get(r);n&&!n.partOf&&(n.partOf=t,t.g.push(n))}),i(this)},o.onRemove=function(e){this.g.forEach(function(e){e.parent&&e.parent.remove(e)}),s.prototype.onRemove.call(this,e)}},{16:16,23:23}],25:[function(e,t){function r(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function i(){var e=new w(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw r(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw r(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function s(){return i.call(this).toLong()}function o(){return i.call(this).toNumber()}function u(){return i.call(this).toLong(!0)}function f(){return i.call(this).toNumber(!0)}function a(){return i.call(this).zzDecode().toLong()}function h(){return i.call(this).zzDecode().toNumber()}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function c(){if(this.pos+8>this.len)throw r(this,8);return new w(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}function p(){return c.call(this).toLong(!0)}function d(){return c.call(this).toNumber(!0)}function y(){return c.call(this).zzDecode().toLong()}function m(){return c.call(this).zzDecode().toNumber()}function v(){b.Long?(j.int64=s,j.uint64=u,j.sint64=a,j.fixed64=p,j.sfixed64=y):(j.int64=o,j.uint64=f,j.sint64=h,j.fixed64=d,j.sfixed64=m)}t.exports=n;var g,b=e(35),w=b.LongBits,O=b.utf8;n.create=b.Buffer?function(t){return g||(g=e(26)),(n.create=function(e){return b.Buffer.isBuffer(e)?new g(e):new n(e)})(t)}:function(e){return new n(e)};var j=n.prototype;j.h=b.Array.prototype.subarray||b.Array.prototype.slice,j.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,r(this,10);return e}}(),j.int32=function(){return 0|this.uint32()},j.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},j.bool=function(){return 0!==this.uint32()},j.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return l(this.buf,this.pos+=4)},j.sfixed32=function(){var e=this.fixed32();return e>>>1^-(1&e)};var k="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,n){return t[0]=r[n],t[1]=r[n+1],t[2]=r[n+2],t[3]=r[n+3],e[0]}:function(r,n){return t[3]=r[n],t[2]=r[n+1],t[1]=r[n+2],t[0]=r[n+3],e[0]}}():function(e,t){var r=l(e,t+4),n=2*(r>>31)+1,i=r>>>23&255,s=8388607&r;return 255===i?s?NaN:n*(1/0):0===i?1.401298464324817e-45*n*s:n*Math.pow(2,i-150)*(s+8388608)};j.float=function(){if(this.pos+4>this.len)throw r(this,4);var e=k(this.buf,this.pos);return this.pos+=4,e};var x="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,n){return t[0]=r[n],t[1]=r[n+1],t[2]=r[n+2],t[3]=r[n+3],t[4]=r[n+4],t[5]=r[n+5],t[6]=r[n+6],t[7]=r[n+7],e[0]}:function(r,n){return t[7]=r[n],t[6]=r[n+1],t[5]=r[n+2],t[4]=r[n+3],t[3]=r[n+4],t[2]=r[n+5],t[1]=r[n+6],t[0]=r[n+7],e[0]}}():function(e,t){var r=l(e,t+4),n=l(e,t+8),i=2*(n>>31)+1,s=n>>>20&2047,o=4294967296*(1048575&n)+r;return 2047===s?o?NaN:i*(1/0):0===s?5e-324*i*o:i*Math.pow(2,s-1075)*(o+4503599627370496)};j.double=function(){if(this.pos+8>this.len)throw r(this,4);var e=x(this.buf,this.pos);return this.pos+=8,e},j.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw r(this,e);return this.pos+=e,t===n?new this.buf.constructor(0):this.h.call(this.buf,t,n);
},j.string=function(){var e=this.bytes();return O.read(e,0,e.length)},j.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw r(this,e);this.pos+=e}else do if(this.pos>=this.len)throw r(this);while(128&this.buf[this.pos++]);return this},j.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4===(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},n.c=v,v()},{26:26,35:35}],26:[function(e,t){function r(e){n.call(this,e)}t.exports=r;var n=e(25),i=r.prototype=Object.create(n.prototype);i.constructor=r;var s=e(35);s.Buffer&&(i.h=s.Buffer.prototype.slice),i.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{25:25,35:35}],27:[function(e,r){function n(e){o.call(this,"",e),this.deferred=[],this.files=[]}function i(){}function s(e){var r=e.parent.lookup(e.extend);if(r){var n=new h(e.fullName,e.id,e.type,e.rule,t,e.options);return n.declaringField=e,e.extensionField=n,r.add(n),!0}return!1}r.exports=n;var o=e(22),u=o.extend(n);n.className="Root";var f,a,h=e(16),l=e(15),c=e(33);n.fromJSON=function(e,t){return t||(t=new n),t.setOptions(e.options).addJSON(e.nested)},u.resolvePath=c.path.resolve,u.load=function e(r,n,s){function o(e,t){if(s){var r=s;if(s=null,p)throw e;r(e,t)}}function u(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){f.filename=e;var r=f(t,l,n);r.imports&&r.imports.forEach(function(t){h(l.resolvePath(e,t))}),r.weakImports&&r.weakImports.forEach(function(t){h(l.resolvePath(e,t),!0)})}else l.setOptions(t.options).addJSON(t.nested)}catch(e){o(e)}p||d||o(null,l)}function h(e,r){var n=e.lastIndexOf("google/protobuf/");if(n>-1){var i=e.substring(n);i in a&&(e=i)}if(!(l.files.indexOf(e)>-1)){if(l.files.push(e),e in a)return p?u(e,a[e]):(++d,setTimeout(function(){--d,u(e,a[e])})),t;if(p){var f;try{f=c.fs.readFileSync(e).toString("utf8")}catch(e){return r||o(e),t}u(e,f)}else++d,c.fetch(e,function(n,i){if(--d,s)return n?(r?d||o(null,l):o(n),t):(u(e,i),t)})}}"function"==typeof n&&(s=n,n=t);var l=this;if(!s)return c.asPromise(e,l,r);var p=s===i,d=0;return c.isString(r)&&(r=[r]),r.forEach(function(e){h(l.resolvePath("",e))}),p?l:(d||o(null,l),t)},u.loadSync=function(e,t){if(!c.isNode)throw Error("not supported");return this.load(e,t,i)},u.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return o.prototype.resolveAll.call(this)};var p=/^[A-Z]/;u.e=function(e){var r=this.deferred.slice();this.deferred=[];for(var n=0;n<r.length;)s(r[n])?r.splice(n,1):++n;if(this.deferred=r,e instanceof h)e.extend!==t&&!e.extensionField&&!s(e)&&this.deferred.indexOf(e)<0&&this.deferred.push(e);else if(e instanceof o){var i=e.nestedArray;for(n=0;n<i.length;++n)this.e(i[n]);p.test(e.name)&&(e.parent[e.name]=e)}else e instanceof l&&p.test(e.name)&&(e.parent[e.name]=e.values)},u.f=function(e){if(e instanceof h){if(e.extend!==t&&!e.extensionField){var r=this.deferred.indexOf(e);r>-1&&this.deferred.splice(r,1)}e.extensionField&&(e.extensionField.parent.remove(e.extensionField),e.extensionField=null)}else if(e instanceof o){for(var n=e.nestedArray,i=0;i<n.length;++i)this.f(n[i]);p.test(e.name)&&delete e.parent[e.name]}else e instanceof l&&p.test(e.name)&&delete e.parent[e.name]},n.c=function(e,t){f=e,a=t}},{15:15,16:16,22:22,33:33}],28:[function(e,t,r){var n=r;n.Service=e(29)},{29:29}],29:[function(e,r){function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.exports=n;var i=e(35);(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(r,n,s,o,u){if(!o)throw TypeError("request must be specified");var f=this;if(!u)return i.asPromise(e,f,r,n,s,o);if(!f.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),t;try{return f.rpcImpl(r,n[f.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,n){if(e)return f.emit("error",e,r),u(e);if(null===n)return f.end(!0),t;if(!(n instanceof s))try{n=s[f.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return f.emit("error",e,r),u("error",e)}return f.emit("data",n,r),u(null,n)})}catch(e){return f.emit("error",e,r),setTimeout(function(){u(e)},0),t}},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{35:35}],30:[function(e,r){function n(e,t){s.call(this,e,t),this.methods={},this.i=null}function i(e){return e.i=null,e}r.exports=n;var s=e(22),o=s.prototype,u=s.extend(n);n.className="Service";var f=e(21),a=e(33),h=e(28);n.testJSON=function(e){return!(!e||!e.methods)},n.fromJSON=function(e,t){var r=new n(e,t.options);return t.methods&&Object.keys(t.methods).forEach(function(e){r.add(f.fromJSON(e,t.methods[e]))}),r},Object.defineProperty(u,"methodsArray",{get:function(){return this.i||(this.i=a.toArray(this.methods))}}),u.toJSON=function(){var e=o.toJSON.call(this);return{options:e&&e.options||t,methods:s.arrayToJSON(this.methodsArray)||{},nested:e&&e.nested||t}},u.get=function(e){return o.get.call(this,e)||this.methods[e]||null},u.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return o.resolve.call(this)},u.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof f?(this.methods[e.name]=e,e.parent=this,i(this)):o.add.call(this,e)},u.remove=function(e){if(e instanceof f){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,i(this)}return o.remove.call(this,e)},u.create=function(e,t,r){var n=new h.Service(e,t,r);return this.methodsArray.forEach(function(e){n[a.lcFirst(e.resolve().name)]=a.codegen("r","c")("return this.rpcCall(m,q,s,r,c)").eof(a.lcFirst(e.name),{m:e,q:e.resolvedRequestType.ctor,s:e.resolvedResponseType.ctor})}),n}},{21:21,22:22,28:28,33:33}],31:[function(e,r){function n(e,r){s.call(this,e,r),this.fields={},this.oneofs=t,this.extensions=t,this.reserved=t,this.group=t,this.j=null,this.g=null,this.k=null,this.l=null}function i(e){return e.j=e.g=e.k=e.l=null,delete e.encode,delete e.decode,delete e.verify,e}r.exports=n;var s=e(22),o=s.prototype,u=s.extend(n);n.className="Type";var f=e(15),a=e(24),h=e(16),l=e(30),c=e(11),p=e(20),d=e(25),y=e(37),m=e(33),v=e(14),g=e(13),b=e(36),w=e(12),O=[f,n,h,l];n.testJSON=function(e){return!(!e||!e.fields)},n.fromJSON=function(e,r){var i=new n(e,r.options);return i.extensions=r.extensions,i.reserved=r.reserved,Object.keys(r.fields).forEach(function(e){i.add(h.fromJSON(e,r.fields[e]))}),r.oneofs&&Object.keys(r.oneofs).forEach(function(e){i.add(a.fromJSON(e,r.oneofs[e]))}),r.nested&&Object.keys(r.nested).forEach(function(e){for(var n=r.nested[e],s=0;s<O.length;++s)if(O[s].testJSON(n))return i.add(O[s].fromJSON(e,n)),t;throw Error("invalid nested object in "+i+": "+e)}),r.extensions&&r.extensions.length&&(i.extensions=r.extensions),r.reserved&&r.reserved.length&&(i.reserved=r.reserved),r.group&&(i.group=!0),i},Object.defineProperties(u,{fieldsById:{get:function(){if(this.j)return this.j;this.j={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this.j[n])throw Error("duplicate id "+n+" in "+this);this.j[n]=r}return this.j}},fieldsArray:{get:function(){return this.g||(this.g=m.toArray(this.fields))}},oneofsArray:{get:function(){return this.k||(this.k=m.toArray(this.oneofs))}},ctor:{get:function(){return this.l||(this.l=c.create(this).constructor)},set:function(e){if(e&&!(e.prototype instanceof p))throw TypeError("ctor must be a Message constructor");e.from||(e.from=p.from),this.l=e}}}),u.toJSON=function(){var e=o.toJSON.call(this);return{options:e&&e.options||t,oneofs:s.arrayToJSON(this.oneofsArray),fields:s.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}))||{},extensions:this.extensions&&this.extensions.length?this.extensions:t,reserved:this.reserved&&this.reserved.length?this.reserved:t,group:this.group||t,nested:e&&e.nested||t}},u.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return o.resolve.call(this)},u.get=function(e){return o.get.call(this,e)||this.fields&&this.fields[e]||this.oneofs&&this.oneofs[e]||null},u.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof h&&e.extend===t){if(this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),i(this)}return e instanceof a?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),i(this)):o.add.call(this,e)},u.remove=function(e){if(e instanceof h&&e.extend===t){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),i(this)}if(e instanceof a){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),i(this)}return o.remove.call(this,e)},u.create=function(e){return new this.ctor(e)},u.setup=function(){var e=this.fullName,t=this.fieldsArray.map(function(e){return e.resolve().resolvedType});return this.encode=v(this).eof(e+"$encode",{Writer:y,types:t,util:m}),this.decode=g(this).eof(e+"$decode",{Reader:d,types:t,util:m}),this.verify=b(this).eof(e+"$verify",{types:t,util:m}),this.fromObject=this.from=w.fromObject(this).eof(e+"$fromObject",{types:t,util:m}),this.toObject=w.toObject(this).eof(e+"$toObject",{types:t,util:m}),this},u.encode=function(e,t){return this.setup().encode(e,t)},u.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},u.decode=function(e,t){return this.setup().decode(e,t)},u.decodeDelimited=function(e){return e instanceof d||(e=d.create(e)),this.decode(e,e.uint32())},u.verify=function(e){return this.setup().verify(e)},u.fromObject=function(e){return this.setup().fromObject(e)},u.from=u.fromObject,u.toObject=function(e,t){return this.setup().toObject(e,t)}},{11:11,12:12,13:13,14:14,15:15,16:16,20:20,22:22,24:24,25:25,30:30,33:33,36:36,37:37}],32:[function(e,t,r){function n(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}var i=r,s=e(33),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];i.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),i.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",s.emptyArray,null]),i.long=n([0,0,0,1,1],7),i.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),i.packed=n([1,5,0,0,0,5,5,0,0,0,1,1,0])},{33:33}],33:[function(e,t){var r=t.exports=e(35);r.codegen=e(3),r.extend=e(5),r.fetch=e(6),r.path=e(8),r.fs=r.inquire("fs"),r.toArray=function(e){return e?Object.keys(e).map(function(t){return e[t]}):[]},r.safeProp=function(e){return'["'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"]'},r.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)}},{3:3,35:35,5:5,6:6,8:8}],34:[function(e,t){function r(e,t){this.lo=e,this.hi=t}t.exports=r;var n=e(35),i=r.prototype,s=r.zero=new r(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new r(n,i)},r.from=function(e){if("number"==typeof e)return r.fromNumber(e);if("string"==typeof e){if(!n.Long)return r.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new r(e.low>>>0,e.high>>>0):s},i.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,(!!e)):{low:0|this.lo,high:0|this.hi,unsigned:!!e}};var u=String.prototype.charCodeAt;r.fromHash=function(e){return e===o?s:new r((u.call(e,0)|u.call(e,1)<<8|u.call(e,2)<<16|u.call(e,3)<<24)>>>0,(u.call(e,4)|u.call(e,5)<<8|u.call(e,6)<<16|u.call(e,7)<<24)>>>0)},i.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},{35:35}],35:[function(r,n,i){var s=i;s.asPromise=r(1),s.base64=r(2),s.EventEmitter=r(4),s.inquire=r(7),s.utf8=r(10),s.pool=r(9),s.LongBits=r(34),s.emptyArray=Object.freeze?Object.freeze([]):[],s.emptyObject=Object.freeze?Object.freeze({}):{},s.isNode=!!(e.process&&e.process.versions&&e.process.versions.node),s.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},s.isString=function(e){return"string"==typeof e||e instanceof String},s.isObject=function(e){return e&&"object"==typeof e},s.Buffer=function(){try{var e=s.inquire("buffer").Buffer;return e.prototype.utf8Write?(e.from||(e.from=function(t,r){return new e(t,r)}),e.allocUnsafe||(e.allocUnsafe=function(t){return new e(t)}),e):null}catch(e){return null}}(),s.newBuffer=function(e){return"number"==typeof e?s.Buffer?s.Buffer.allocUnsafe(e):new s.Array(e):s.Buffer?s.Buffer.from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},s.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,s.Long=e.dcodeIO&&e.dcodeIO.Long||s.inquire("long"),s.longToHash=function(e){return e?s.LongBits.from(e).toHash():s.LongBits.zeroHash},s.longFromHash=function(e,t){var r=s.LongBits.fromHash(e);return s.Long?s.Long.fromBits(r.lo,r.hi,t):r.toNumber(!!t)},s.merge=function(e,r,n){for(var i=Object.keys(r),s=0;s<i.length;++s)e[i[s]]!==t&&n||(e[i[s]]=r[i[s]]);return e},s.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},s.oneOfGetter=function(e){var r={};return e.forEach(function(e){r[e]=1}),function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===r[e[n]]&&this[e[n]]!==t&&null!==this[e[n]])return e[n]}},s.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},s.lazyResolve=function(e,t){t.forEach(function(t){Object.keys(t).forEach(function(r){for(var n=t[r|=0].split("."),i=e;n.length;)i=i[n.shift()];t[r]=i})})},s.toJSONOptions={longs:String,enums:String,bytes:String}},{1:1,10:10,2:2,34:34,4:4,7:7,9:9}],36:[function(e,t){function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function n(e,t,n,i){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(%s){",i)("default:")("return%j",r(t,"enum value"));for(var s=u.toArray(t.resolvedType.values),f=0;f<s.length;++f)e("case %d:",s[f]);e("break")("}")}else e("var e=types[%d].verify(%s);",n,i)("if(e)")("return%j+e",t.name+".");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",r(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",r(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",r(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",r(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",r(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",r(t,"buffer"))}return e}function i(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!/^-?(?:0|[1-9][0-9]*)$/.test(%s))",n)("return%j",r(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/.test(%s))",n)("return%j",r(t,"integer|Long key"));break;case"bool":e("if(!/^true|false|0|1$/.test(%s))",n)("return%j",r(t,"boolean key"))}return e}function s(e){var t=e.fieldsArray;if(!t.length)return u.codegen()("return null");for(var s=u.codegen("m"),f=0;f<t.length;++f){var a=t[f].resolve(),h="m"+u.safeProp(a.name);a.map?(s("if(%s!==undefined){",h)("if(!util.isObject(%s))",h)("return%j",r(a,"object"))("var k=Object.keys(%s)",h)("for(var i=0;i<k.length;++i){"),i(s,a,"k[i]"),n(s,a,f,h+"[k[i]]")("}")("}")):a.repeated?(s("if(%s!==undefined){",h)("if(!Array.isArray(%s))",h)("return%j",r(a,"array"))("for(var i=0;i<%s.length;++i){",h),n(s,a,f,h+"[i]")("}")("}")):(a.required||(!a.resolvedType||a.resolvedType instanceof o?s("if(%s!==undefined){",h):s("if(%s!==undefined&&%s!==null){",h,h)),n(s,a,f,h),a.required||s("}"))}return s("return null")}t.exports=s;var o=e(15),u=e(33)},{15:15,33:33}],37:[function(e,r){function n(e,r,n){this.fn=e,this.len=r,this.next=t,this.val=n}function i(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function o(){this.len=0,this.head=new n(i,0,0),this.tail=this.head,this.states=null}function u(e,t,r){t[r]=255&e}function f(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e}function a(e,r){this.len=e,this.next=t,this.val=r}function h(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function l(e,t,r){t[r++]=255&e,t[r++]=e>>>8&255,t[r++]=e>>>16&255,t[r]=e>>>24}r.exports=o;var c,p=e(35),d=p.LongBits,y=p.base64,m=p.utf8;o.create=p.Buffer?function(){return c||(c=e(38)),(o.create=function(){return new c})()}:function(){return new o},o.alloc=function(e){return new p.Array(e)},p.Array!==Array&&(o.alloc=p.pool(o.alloc,p.Array.prototype.subarray));var v=o.prototype;v.push=function(e,t,r){return this.tail=this.tail.next=new n(e,t,r),this.len+=t,this},a.prototype=Object.create(n.prototype),a.prototype.fn=f,v.uint32=function(e){return this.len+=(this.tail=this.tail.next=new a((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},v.int32=function(e){return e<0?this.push(h,10,d.fromNumber(e)):this.uint32(e)},v.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},v.uint64=function(e){var t=d.from(e);return this.push(h,t.length(),t)},v.int64=v.uint64,v.sint64=function(e){var t=d.from(e).zzEncode();return this.push(h,t.length(),t)},v.bool=function(e){return this.push(u,1,e?1:0)},v.fixed32=function(e){return this.push(l,4,e>>>0)},v.sfixed32=function(e){return this.push(l,4,e<<1^e>>31)},v.fixed64=function(e){var t=d.from(e);return this.push(l,4,t.lo).push(l,4,t.hi)},v.sfixed64=function(e){var t=d.from(e).zzEncode();return this.push(l,4,t.lo).push(l,4,t.hi)};var g="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,n,i){e[0]=r,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3]}:function(r,n,i){e[0]=r,n[i++]=t[3],n[i++]=t[2],n[i++]=t[1],n[i]=t[0]}}():function(e,t,r){var n=e<0?1:0;if(n&&(e=-e),0===e)l(1/e>0?0:2147483648,t,r);else if(isNaN(e))l(2147483647,t,r);else if(e>3.4028234663852886e38)l((n<<31|2139095040)>>>0,t,r);else if(e<1.1754943508222875e-38)l((n<<31|Math.round(e/1.401298464324817e-45))>>>0,t,r);else{var i=Math.floor(Math.log(e)/Math.LN2),s=8388607&Math.round(e*Math.pow(2,-i)*8388608);l((n<<31|i+127<<23|s)>>>0,t,r)}};v.float=function(e){return this.push(g,4,e)};var b="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,n,i){e[0]=r,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i]=t[7]}:function(r,n,i){e[0]=r,n[i++]=t[7],n[i++]=t[6],n[i++]=t[5],n[i++]=t[4],n[i++]=t[3],n[i++]=t[2],n[i++]=t[1],n[i]=t[0]}}():function(e,t,r){var n=e<0?1:0;if(n&&(e=-e),0===e)l(0,t,r),l(1/e>0?0:2147483648,t,r+4);else if(isNaN(e))l(4294967295,t,r),l(2147483647,t,r+4);else if(e>1.7976931348623157e308)l(0,t,r),l((n<<31|2146435072)>>>0,t,r+4);else{var i;if(e<2.2250738585072014e-308)i=e/5e-324,l(i>>>0,t,r),l((n<<31|i/4294967296)>>>0,t,r+4);else{var s=Math.floor(Math.log(e)/Math.LN2);1024===s&&(s=1023),i=e*Math.pow(2,-s),l(4503599627370496*i>>>0,t,r),l((n<<31|s+1023<<20|1048576*i&1048575)>>>0,t,r+4)}}};v.double=function(e){return this.push(b,8,e)};var w=p.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};v.bytes=function(e){var t=e.length>>>0;if(!t)return this.push(u,1,0);if("string"==typeof e){var r=o.alloc(t=y.length(e));y.decode(e,r,0),e=r}return this.uint32(t).push(w,t,e)},v.string=function(e){var t=m.length(e);return t?this.uint32(t).push(m.write,t,e):this.push(u,1,0)},v.fork=function(){return this.states=new s(this),this.head=this.tail=new n(i,0,0),this.len=0,this},v.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new n(i,0,0),this.len=0),this},v.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},v.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t}},{35:35,38:38}],38:[function(e,t){function r(){i.call(this)}function n(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write(e,r)}t.exports=r;var i=e(37),s=r.prototype=Object.create(i.prototype);s.constructor=r;var o=e(35),u=o.Buffer;r.alloc=function(e){return(r.alloc=u.allocUnsafe)(e)};var f=u&&u.prototype instanceof Uint8Array&&"set"===u.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]};s.bytes=function(e){"string"==typeof e&&(e=u.from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this.push(f,t,e),this},s.string=function(e){var t=u.byteLength(e);return this.uint32(t),t&&this.push(n,t,e),this}},{35:35,37:37}]},{},[17])}("object"==typeof window&&window||"object"==typeof self&&self||this);
//# sourceMappingURL=protobuf.min.js.map