New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

protobufjs

Package Overview
Dependencies
Maintainers
1
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protobufjs - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

bench/read.js

3

.eslintrc.json

@@ -8,2 +8,5 @@ {

"Uint8Array": true,
"Float32Array": true,
"Float64Array": true,
"define": true,
"XMLHttpRequest": true,

@@ -10,0 +13,0 @@ "Promise": true

6

bench/bench.json

@@ -16,5 +16,7 @@ {

"outer" : {
"bool" : [ true, false, false, true, false, false, true ]
"bool" : [ true, false, false, true, false, false, true ],
"double": 204.8
}
}
},
"float": 0.25
}

@@ -1,6 +0,3 @@

var benchmark = require("benchmark"),
chalk = require("chalk");
var protobuf = require("../src/index"),
suite = new benchmark.Suite(),
newSuite = require("./suite"),
data = require("./bench.json");

@@ -29,87 +26,55 @@

protobuf.util.codegen.verbose = true;
var buf = Test.encode(data).finish(),
dec = Test.decode(buf);
var str = JSON.stringify(data),
strbuf = Buffer.from(str, "utf8");
var buf = Test.encode(data).finish();
newSuite("encoding")
.add("Type.encode to buffer", function() {
// warm up
for (var i = 0; i < 500000; ++i)
Test.encode(data).finish();
})
.add("JSON.stringify to string", function() {
JSON.stringify(data);
})
.add("JSON.stringify to buffer", function() {
new Buffer(JSON.stringify(data), "utf8");
})
.run();
newSuite("decoding")
.add("Type.decode from buffer", function() {
for (var i = 0; i < 1000000; ++i)
Test.decode(buf);
})
.add("JSON.parse from string", function() {
JSON.parse(str);
})
.add("JSON.parse from buffer", function() {
JSON.parse(strbuf.toString("utf8"));
})
.run();
console.log("");
newSuite("combined")
.add("Type to/from buffer", function() {
Test.decode(Test.encode(data).finish());
})
.add("JSON to/from string", function() {
JSON.parse(JSON.stringify(data));
})
.add("JSON to/from buffer", function() {
JSON.parse(new Buffer(JSON.stringify(data), "utf8").toString("utf8"));
})
.run();
// give the optimizer some time to do its job
setTimeout(function() {
var str = JSON.stringify(data),
strbuf = Buffer.from(str, "utf8");
});
newSuite("encoding")
.add("Type.encode to buffer", function() {
Test.encode(data).finish();
})
.add("JSON.stringify to string", function() {
JSON.stringify(data);
})
.add("JSON.stringify to buffer", function() {
new Buffer(JSON.stringify(data), "utf8");
})
.run();
var padSize = 27;
newSuite("decoding")
.add("Type.decode from buffer", function() {
Test.decode(buf);
})
.add("JSON.parse from string", function() {
JSON.parse(str);
})
.add("JSON.parse from buffer", function() {
JSON.parse(strbuf.toString("utf8"));
})
.run();
function newSuite(name) {
var benches = [];
return new benchmark.Suite(name)
.on("add", function(event) {
benches.push(event.target);
})
.on("start", function() {
console.log("benchmarking " + name + " performance ...\n");
})
.on("error", function(err) {
console.log("ERROR:", err);
})
.on("cycle", function(event) {
console.log(String(event.target));
})
.on("complete", function(event) {
var fastest = this.filter('fastest'),
slowest = this.filter('slowest');
var fastestHz = getHz(fastest[0]);
console.log("\n" + chalk.white(pad(fastest[0].name, padSize)) + " was " + chalk.green("fastest"));
benches.forEach(function(bench) {
if (fastest.indexOf(bench) > -1)
return;
var hz = hz = getHz(bench);
var percent = (1 - (hz / fastestHz)) * 100;
console.log(chalk.white(pad(bench.name, padSize)) + " was " + chalk.red(percent.toFixed(1)+'% slower'));
});
console.log();
});
}
newSuite("combined")
.add("Type to/from buffer", function() {
Test.decode(Test.encode(data).finish());
})
.add("JSON to/from string", function() {
JSON.parse(JSON.stringify(data));
})
.add("JSON to/from buffer", function() {
JSON.parse(new Buffer(JSON.stringify(data), "utf8").toString("utf8"));
})
.run();
function getHz(bench) {
return 1 / (bench.stats.mean + bench.stats.moe);
}
}, 3000);
function pad(str, len, l) {
while (str.length < len)
str = l ? str + " " : " " + str;
return str;
}
});

@@ -19,5 +19,6 @@ var path = require("path"),

out : "o",
path : "p"
path : "p",
wrap : "w"
},
string: [ "target", "out", "path" ],
string: [ "target", "out", "path", "wrap" ],
default: {

@@ -27,2 +28,3 @@ target: "json"

});
var target = targets[argv.target],

@@ -32,3 +34,3 @@ files = argv._,

if (!target || !files.length) {
if (!files.length) {
console.log([

@@ -40,5 +42,10 @@ "protobuf.js v" + pkg.version + " cli",

" -t, --target Specifies the target format. [" + Object.keys(targets).filter(function(key) { return !targets[key].private; }).join(', ') + "]",
" Also accepts a path to require a custom target.",
"",
" -p, --path Adds a directory to the include path.",
"",
" -o, --out Saves to a file instead of writing to stdout.",
"",
" -w, --wrap Specifies an alternative wrapper for the static target.",
"",
"usage: " + chalk.bold.green(path.basename(process.argv[1])) + " [options] file1.proto file2.json ..."

@@ -59,5 +66,9 @@ ].join("\n"));

// Require custom target
if (!target)
target = require(path.resolve(process.cwd(), argv.target));
var root = new protobuf.Root();
// Fall back to include paths when resolving imports
// Search include paths when resolving imports
root.resolvePath = function pbjsResolvePath(origin, target) {

@@ -75,8 +86,6 @@ var filepath = protobuf.util.resolvePath(origin, target);

var options = {};
root.load(files, function(err) {
if (err)
throw err;
target(root, options, function(err, output) {
target(root, argv, function(err, output) {
if (err)

@@ -83,0 +92,0 @@ throw err;

@@ -0,1 +1,2 @@

"use strict";
module.exports = json_target;

@@ -2,0 +3,0 @@

@@ -0,1 +1,2 @@

"use strict";
module.exports = proto_target;

@@ -95,5 +96,5 @@

} while (true);
out.push('syntax = "proto' + syntax + '";');
if (pkg.length)
out.push("package " + pkg.join(".") + ";", "");
out.push('syntax = "proto' + syntax + '";');
out.push("", "package " + pkg.join(".") + ";");

@@ -100,0 +101,0 @@ buildOptions(ptr);

@@ -0,1 +1,2 @@

"use strict";
module.exports = proto2_target;

@@ -2,0 +3,0 @@

@@ -0,1 +1,2 @@

"use strict";
module.exports = proto3_target;

@@ -2,0 +3,0 @@

/*!
* protobuf.js v6.0.1 (c) 2016 Daniel Wirtz
* Compiled Thu, 01 Dec 2016 10:27:23 UTC
* protobuf.js v6.0.2 (c) 2016 Daniel Wirtz
* Compiled Mon, 05 Dec 2016 19:04:43 UTC
* Licensed under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/protobuf.js for details
*/
!function e(t,i,n){function r(o,u){if(!i[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=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var h=i[o]={exports:{}};t[o][0].call(h.exports,function(e){var i=t[o][1][e];return r(i?i:e)},h,h.exports,e,t,i,n)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(e,t,i){i.read=function(e,t,i,n,r){var s,o,u=8*r-n-1,f=(1<<u)-1,a=f>>1,h=-7,l=i?0:r-1,c=i?1:-1,d=e[t+l];for(l+=c,s=d&(1<<-h)-1,d>>=-h,h+=u;h>0;s=256*s+e[t+l],l+=c,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=256*o+e[t+l],l+=c,h-=8);if(0===s)s=1-a;else{if(s===f)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,n),s-=a}return(d?-1:1)*o*Math.pow(2,s-n)},i.write=function(e,t,i,n,r,s){var o,u,f,a=8*s-r-1,h=(1<<a)-1,l=h>>1,c=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?s-1:0,p=n?-1:1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),t+=o+l>=1?c/f:c*Math.pow(2,1-l),t*f>=2&&(o++,f/=2),o+l>=h?(u=0,o=h):o+l>=1?(u=(t*f-1)*Math.pow(2,r),o+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,r),o=0));r>=8;e[i+d]=255&u,d+=p,u/=256,r-=8);for(o=o<<r|u,a+=r;a>0;e[i+d]=255&o,d+=p,o/=256,a-=8);e[i+d-p]|=128*v}},{}],2:[function(e,t,i){"use strict";function n(e,t){/\/|\./.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}t.exports=n,n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var r;n("duration",{Duration:r={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:r}),n("empty",{Empty:{fields:{}}}),n("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}})},{}],3:[function(e,t,i){"use strict";function n(e){this.type=e}t.exports=n;var r=e(5),s=e(15),o=e(20),u=e(21),f=n.prototype;Object.defineProperties(f,{fieldsById:{get:f.getFieldsById=function(){return this.type.getFieldsById()}},ctor:{get:f.getCtor=function(){return this.type.getCtor()}}}),f.decode=function(e,t){for(var i=this.getFieldsById(),e=e instanceof s?e:s(e),n=void 0===t?e.len:e.pos+t,f=new(this.getCtor());e.pos<n;){var a=e.tag(),h=i[a.id].resolve(),l=h.resolvedType instanceof r?"uint32":h.type;if(h)if(h.map){var c=h.resolvedKeyType?"uint32":h.keyType,t=e.uint32(),d=f[h.name]={};if(t){t+=e.pos;for(var p=[],v=[];e.pos<t;)1===e.tag().id?p[p.length]=e[c]():void 0!==o.basic[l]?v[v.length]=e[l]():v[v.length]=h.resolvedType.decode(e,e.uint32());for(var y=0;y<p.length;++y)d["object"==typeof p[y]?u.longToHash(p[y]):p[y]]=v[y]}}else if(h.repeated){var g=f[h.name]||(f[h.name]=[]);if(h.packed&&void 0!==o.packed[l]&&2===a.wireType)for(var m=e.uint32()+e.pos;e.pos<m;)g[g.length]=e[l]();else void 0!==o.basic[l]?g[g.length]=e[l]():g[g.length]=h.resolvedType.decode(e,e.uint32())}else void 0!==o.basic[l]?f[h.name]=e[l]():f[h.name]=h.resolvedType.decode(e,e.uint32());else e.skipType(a.wireType)}return f},f.generate=function(){for(var e=this.type.getFieldsArray(),t=u.codegen("r","l")("r instanceof Reader||(r=Reader(r))")("var c=l===undefined?r.len:r.pos+l,m=new (this.getCtor())()")("while(r.pos<c){")("var t=r.tag()")("switch(t.id){"),i=0;i<e.length;++i){var n=e[i].resolve(),f=n.resolvedType instanceof r?"uint32":n.type,a=u.safeProp(n.name);if(t("case %d:",n.id),n.map){var h=n.resolvedKeyType?"uint32":n.keyType;t("var n=r.uint32(),o={}")("if(n){")("n+=r.pos")("var k=[],v=[]")("while(r.pos<n){")("if(r.tag().id===1)")("k[k.length]=r.%s()",h),void 0!==o.basic[f]?t("else")("v[v.length]=r.%s()",f):t("else")("v[v.length]=types[%d].decode(r,r.uint32())",i,i),t("}")("for(var i=0;i<k.length;++i)")("o[typeof(k[i])==='object'?util.longToHash(k[i]):k[i]]=v[i]")("}")("m%s=o",a)}else n.repeated?(t("m%s||(m%s=[])",a,a),n.packed&&void 0!==o.packed[f]&&t("if(t.wireType===2){")("var e=r.uint32()+r.pos")("while(r.pos<e)")("m%s[m%s.length]=r.%s()",a,a,f)("}else"),void 0!==o.basic[f]?t("m%s[m%s.length]=r.%s()",a,a,f):t("m%s[m%s.length]=types[%d].decode(r,r.uint32())",a,a,i,i)):void 0!==o.basic[f]?t("m%s=r.%s()",a,f):t("m%s=types[%d].decode(r,r.uint32())",a,i,i);t("break")}return t("default:")("r.skipType(t.wireType)")("break")("}")("}")("return m"),t.eof(this.type.getFullName()+"$decode",{Reader:s,types:e.map(function(e){return e.resolvedType}),util:u.toHash})}},{15:15,20:20,21:21,5:5}],4:[function(e,t,i){"use strict";function n(e){this.type=e}t.exports=n;var r=e(5),s=e(25),o=e(20),u=e(21),f=n.prototype;Object.defineProperties(f,{fieldsArray:{get:f.getFieldsArray=function(){return this.type.getFieldsArray()}}}),f.encode=function(e,t){t||(t=s());for(var i=this.getFieldsArray(),n=0;n<i.length;){var f=i[n++].resolve(),a=f.resolvedType instanceof r?"uint32":f.type,h=o.basic[a];if(f.map){var l,c,d=f.resolvedKeyType?"uint32":f.keyType;if((l=e[f.name])&&(c=Object.keys(l)).length){t.fork();for(var p=0;p<c.length;++p)t.tag(1,o.mapKey[d])[d](c[p]),void 0!==h?t.tag(2,h)[a](l[c[p]]):f.resolvedType.encode(l[c[p]],t.tag(2,2).fork()).ldelim();t.ldelim(f.id)}}else if(f.repeated){var v=e[f.name];if(v&&v.length)if(f.packed&&void 0!==o.packed[a]){t.fork();for(var p=0;p<v.length;)t[a](v[p++]);t.ldelim(f.id)}else{var p=0;if(void 0!==h)for(;p<v.length;)t.tag(f.id,h)[a](v[p++]);else for(;p<v.length;)f.resolvedType.encode(v[p++],t.tag(f.id,2).fork()).ldelim()}}else{var l=e[f.name];(f.required||void 0!==l&&f.long?u.longNeq(l,f.defaultValue):l!==f.defaultValue)&&(void 0!==h?t.tag(f.id,h)[a](l):(f.resolvedType.encode(l,t.fork()),t.len||f.required?t.ldelim(f.id):t.reset()))}}return t},f.generate=function(){for(var e=this.type.getFieldsArray(),t=u.codegen("m","w")("w||(w=Writer())"),i=0;i<e.length;++i){var n=e[i].resolve(),f=n.resolvedType instanceof r?"uint32":n.type,a=o.basic[f],h=u.safeProp(n.name);if(n.map){var l=n.resolvedKeyType?"uint32":n.keyType,c=o.mapKey[l];t("if(m%s){",h)("w.fork()")("for(var i=0,ks=Object.keys(m%s);i<ks.length;++i){",h)("w.tag(1,%d).%s(ks[i])",c,l),void 0!==a?t("w.tag(2,%d).%s(m%s[ks[i]])",a,f,h):t("types[%d].encode(m%s[ks[i]],w.tag(2,2).fork()).ldelim()",i,h),t("}")("w.len&&w.ldelim(%d)||w.reset()",n.id)("}")}else n.repeated?n.packed&&void 0!==o.packed[f]?t("if(m%s&&m%s.length){",h,h)("w.fork()")("for(var i=0;i<m%s.length;++i)",h)("w.%s(m%s[i])",f,h)("w.ldelim(%d)",n.id)("}"):(t("if(m%s)",h)("for(var i=0;i<m%s.length;++i)",h),void 0!==a?t("w.tag(%d,%d).%s(m%s[i])",n.id,a,f,h):t("types[%d].encode(m%s[i],w.tag(%d,2).fork()).ldelim()",i,h,n.id)):(n.required||(n.long?t("if(m%s!==undefined&&util.longNeq(m%s,%j))",h,h,n.defaultValue):t("if(m%s!==undefined&&m%s!==%j)",h,h,n.defaultValue)),void 0!==a?t("w.tag(%d,%d).%s(m%s)",n.id,a,f,h):n.required?t("types[%d].encode(m%s,w.tag(%d,2).fork()).ldelim()",i,h,n.id):t("types[%d].encode(m%s,w.fork()).len&&w.ldelim(%d)||w.reset()",i,h,n.id))}return t("return w").eof(this.type.getFullName()+"$encode",{Writer:s,types:e.map(function(e){return e.resolvedType}),util:u})}},{20:20,21:21,25:25,5:5}],5:[function(e,t,i){"use strict";function n(e,t,i){s.call(this,e,i),this.values=t||{},this.a=null}function r(e){return e.a=null,e}t.exports=n;var s=e(11),o=s.extend(n),u=e(21),f=u.b;Object.defineProperties(o,{valuesById:{get:o.getValuesById=function(){return this.a||(this.a={},Object.keys(this.values).forEach(function(e){var t=this.values[e];if(this.a[t])throw Error("duplicate id "+t+" in "+this);this.a[t]=e},this)),this.a}}}),n.testJSON=function(e){return Boolean(e&&e.values)},n.fromJSON=function(e,t){return new n(e,t.values,t.options)},o.toJSON=function(){return{options:this.options,values:this.values}},o.add=function(e,t){if(!u.isString(e))throw f("name");if(!u.isInteger(t)||t<0)throw f("id","a non-negative integer");if(void 0!==this.values[e])throw Error('duplicate name "'+e+'" in '+this);if(void 0!==this.getValuesById()[t])throw Error("duplicate id "+t+" in "+this);return this.values[e]=t,r(this)},o.remove=function(e){if(!u.isString(e))throw f("name");if(void 0===this.values[e])throw Error('"'+e+'" is not a name of '+this);return delete this.values[e],r(this)}},{11:11,21:21}],6:[function(e,t,i){"use strict";function n(e,t,i,n,s,o){if(h.isObject(n)?(o=n,n=s=void 0):h.isObject(s)&&(o=s,s=void 0),r.call(this,e,o),!h.isInteger(t)||t<0)throw l("id","a non-negative integer");if(!h.isString(i))throw l("type");if(void 0!==s&&!h.isString(s))throw l("extend");if(void 0!==n&&!/^required|optional|repeated$/.test(n=n.toString().toLowerCase()))throw l("rule","a valid rule string");this.rule=n&&"optional"!==n?n:void 0,this.type=i,this.id=t,this.extend=s||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.defaultValue=null,this.long=!!h.Long&&void 0!==a.long[i],this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.c=null}t.exports=n;var r=e(11),s=r.extend(n),o=e(19),u=e(5),f=e(8),a=e(20),h=e(21),l=h.b;Object.defineProperties(s,{packed:{get:s.isPacked=function(){return null===this.c&&(this.c=this.getOption("packed")!==!1),this.c}}}),s.setOption=function(e,t,i){return"packed"===e&&(this.c=null),r.prototype.setOption.call(this,e,t,i)},n.testJSON=function(e){return Boolean(e&&void 0!==e.id)},n.fromJSON=function(e,t){return void 0!==t.keyType?f.fromJSON(e,t):new n(e,t.id,t.type,t.role,t.extend,t.options)},s.toJSON=function(){return{rule:"optional"!==this.rule&&this.rule||void 0,type:this.type,id:this.id,extend:this.extend,options:this.options}},s.resolve=function(){if(this.resolved)return this;var e=a.defaults[this.type];if(void 0===e){var t=this.parent.lookup(this.type);if(t instanceof o)this.resolvedType=t,e=null;else{if(!(t instanceof u))throw Error("unresolvable field type: "+this.type);this.resolvedType=t,e=0}}var i;return this.map?this.defaultValue={}:this.repeated?this.defaultValue=[]:this.options&&void 0!==(i=this.options.default)?this.defaultValue=i:this.defaultValue=e,this.long&&(this.defaultValue=h.Long.fromValue(this.defaultValue)),r.prototype.resolve.call(this)},s.jsonConvert=function(e,t){if(t){if(this.resolvedType instanceof u&&t.enum===String)return this.resolvedType.getValuesById()[e];if(this.long&&t.long)return t.long===Number?"number"==typeof e?e:h.Long.fromValue(e).toNumber():h.Long.fromValue(e,"u"===this.type.charAt(0)).toString()}return e}},{11:11,19:19,20:20,21:21,5:5,8:8}],7:[function(e,t,i){"use strict";function n(e,t,i){if("function"!=typeof e)throw u("clazz","a function");if(!(t instanceof s))throw u("type","a Type");i||(i={});var f={$type:{value:t}};i.noStatics||o.merge(f,{encode:{value:function(e,t){return this.$type.encode(e,t).finish()}},encodeDelimited:{value:function(e,t){return this.$type.encodeDelimited(e,t).finish()}},decode:{value:function(e){return this.$type.decode(e)}},decodeDelimited:{value:function(e){return this.$type.decodeDelimited(e)}},verify:{value:function(e){return this.$type.verify(e)}}},!0),Object.defineProperties(e,f);var a=n.defineProperties(new r,t);return e.prototype=a,a.constructor=e,i.noRegister||t.setCtor(e),a}t.exports=n;var r=e(14),s=e(19),o=e(21),u=o.b;n.defineProperties=function(e,t){var i={$type:{value:t}};return t.getFieldsArray().forEach(function(t){t.resolve(),o.isObject(t.defaultValue)||(e[t.name]=t.defaultValue)}),t.getOneofsArray().forEach(function(e){i[e.resolve().name]={get:function(){for(var t=e.oneof,i=0;i<t.length;++i){var n=e.parent.fields[t[i]];if(this[t[i]]!=n.defaultValue)return t[i]}},set:function(t){for(var i=e.oneof,n=0;n<i.length;++n)i[n]!==t&&delete this[i[n]]}}}),Object.defineProperties(e,i),e}},{14:14,19:19,21:21}],8:[function(e,t,i){"use strict";function n(e,t,i,n,s){if(r.call(this,e,t,n,s),!a.isString(i))throw a.b("keyType");this.keyType=i,this.resolvedKeyType=null,this.map=!0}t.exports=n;var r=e(6),s=r.prototype,o=r.extend(n),u=e(5),f=e(20),a=e(21);n.testJSON=function(e){return r.testJSON(e)&&void 0!==e.keyType},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;var e=f.mapKey[this.keyType];if(void 0===e){var t=this.parent.lookup(this.keyType);if(!(t instanceof u))throw Error("unresolvable map key type: "+this.keyType);this.resolvedKeyType=t}return s.resolve.call(this)}},{20:20,21:21,5:5,6:6}],9:[function(e,t,i){"use strict";function n(e,t,i,n,s,o,a){if(u.isObject(s)?(a=s,s=o=void 0):u.isObject(o)&&(a=o,o=void 0),!u.isString(t))throw f("type");if(!u.isString(i))throw f("requestType");if(!u.isString(n))throw f("responseType");r.call(this,e,a),this.type=t||"rpc",this.requestType=i,this.requestStream=!!s||void 0,this.responseType=n,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null}t.exports=n;var r=e(11),s=r.extend(n),o=e(19),u=e(21),f=u.b;n.testJSON=function(e){return Boolean(e&&void 0!==e.requestType)},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||void 0,requestType:this.requestType,requestStream:this.requestStream,responseType:this.responseType,responseStream:this.responseStream,options:this.options}},s.resolve=function(){if(this.resolved)return this;var e=this.parent.lookup(this.requestType);if(!(e&&e instanceof o))throw Error("unresolvable request type: "+this.requestType);if(this.resolvedRequestType=e,e=this.parent.lookup(this.responseType),!(e&&e instanceof o))throw Error("unresolvable response type: "+this.requestType);return this.resolvedResponseType=e,r.prototype.resolve.call(this)}},{11:11,19:19,21:21}],10:[function(e,t,i){"use strict";function n(e,t){o.call(this,e,t),this.nested=void 0,this.d=null}function r(e){return e.d=null,e}function s(e){if(e&&e.length){for(var t={},i=0;i<e.length;++i)t[e[i].name]=e[i].toJSON();return t}}t.exports=n;var o=e(11),u=o.extend(n),f=e(5),a=e(19),h=e(6),l=e(17),c=e(21),d=c.b,p=[f,a,l,h,n],v="one of "+p.map(function(e){return e.name}).join(", ");Object.defineProperties(u,{nestedArray:{get:u.getNestedArray=function(){return this.d||(this.d=c.toArray(this.nested))}}}),n.testJSON=function(e){return Boolean(e&&!e.fields&&!e.values&&void 0===e.id&&!e.oneof&&!e.methods&&void 0===e.requestType)},n.fromJSON=function(e,t){return new n(e,t.options).addJSON(t.nested)},u.toJSON=function(){return{options:this.options,nested:s(this.getNestedArray())}},n.arrayToJSON=s,u.addJSON=function(e){var t=this;return e&&Object.keys(e).forEach(function(i){for(var n=e[i],r=0;r<p.length;++r)if(p[r].testJSON(n))return t.add(p[r].fromJSON(i,n));throw d("nested."+i,"JSON for "+v)}),this},u.get=function(e){return void 0===this.nested?null:this.nested[e]||null},u.add=function(e){if(!e||p.indexOf(e.constructor)<0)throw d("object",v);if(e instanceof h&&void 0===e.extend)throw d("object","an extension field when not part of a type");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof n&&e instanceof n)||t instanceof a||t instanceof l)throw Error("duplicate name '"+e.name+"' in "+this);for(var i=t.getNestedArray(),s=0;s<i.length;++s)e.add(i[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),r(this)},u.remove=function(e){if(!(e instanceof o))throw d("object","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=void 0),e.onRemove(this),r(this)},u.define=function(e,t){c.isString(e)?e=e.split("."):Array.isArray(e)||(t=e,e=void 0);var i=this;if(e)for(;e.length>0;){var r=e.shift();if(i.nested&&i.nested[r]){if(i=i.nested[r],!(i instanceof n))throw Error("path conflicts with non-namespace objects")}else i.add(i=new n(r))}return t&&i.addJSON(t),i},u.resolveAll=function(){for(var e=this.getNestedArray(),t=0;t<e.length;)e[t]instanceof n?e[t++].resolveAll():e[t++].resolve();return o.prototype.resolve.call(this)},u.lookup=function(e,t){if(c.isString(e)){if(!e.length)return null;e=e.split(".")}else if(!e.length)return null;if(""===e[0])return this.getRoot().lookup(e.slice(1));var i=this.get(e[0]);return i&&(1===e.length||i instanceof n&&(i=i.lookup(e.slice(1),!0)))?i:null===this.parent||t?null:this.parent.lookup(e)}},{11:11,17:17,19:19,21:21,5:5,6:6}],11:[function(e,t,i){"use strict";function n(e,t){if(!o.isString(e))throw u("name");if(t&&!o.isObject(t))throw u("options","an object");this.options=t,this.name=e,this.parent=null,this.resolved=!1}function r(e){var t=e.prototype=Object.create(this.prototype);return t.constructor=e,e.extend=r,t}t.exports=n,n.extend=r;var s=e(16),o=e(21),u=o.b,f=n.prototype;Object.defineProperties(f,{root:{get:f.getRoot=function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:f.getFullName=function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),f.toJSON=function(){throw Error()},f.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.getRoot();t instanceof s&&t.e(this)},f.onRemove=function(e){var t=e.getRoot();t instanceof s&&t.f(this),this.parent=null,this.resolved=!1},f.resolve=function(){if(this.resolved)return this;var e=this.getRoot();return e instanceof s&&(this.resolved=!0),this},f.getOption=function(e){if(this.options)return this.options[e]},f.setOption=function(e,t,i){return i&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},f.setOptions=function(e,t){return e&&Object.keys(e).forEach(function(i){this.setOption(i,e[i],t)},this),this},f.toString=function(){return this.constructor.name+" "+this.getFullName()}},{16:16,21:21}],12:[function(e,t,i){"use strict";function n(e,t,i){if(Array.isArray(t)||(i=t,t=void 0),s.call(this,e,i),t&&!Array.isArray(t))throw a("fieldNames","an Array");this.oneof=t||[],this.g=[]}function r(e){e.parent&&e.g.forEach(function(t){t.parent||e.parent.add(t)})}t.exports=n;var s=e(11),o=s.extend(n),u=e(6),f=e(21),a=f.b;n.testJSON=function(e){return Boolean(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 a("field","a Field");return e.parent&&e.parent.remove(e),this.oneof.push(e.name),this.g.push(e),e.partOf=this,r(this),this},o.remove=function(e){if(!(e instanceof u))throw a("field","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.parent&&e.parent.remove(e),e.partOf=null,this},o.onAdd=function(e){s.prototype.onAdd.call(this,e),r(this)},o.onRemove=function(e){this.g.forEach(function(e){e.parent&&e.parent.remove(e)}),s.prototype.onRemove.call(this,e)}},{11:11,21:21,6:6}],13:[function(e,t,i){"use strict";function n(e){return null===e?null:e.toLowerCase()}function r(e){return e.substring(0,1)+e.substring(1).replace(/_([a-z])(?=[a-z]|$)/g,function(e,t){return t.toUpperCase()})}function s(e,t){function i(e,t){return Error("illegal "+(t||"token")+" '"+e+"' (line "+ne.line()+j)}function s(){var e,t=[];do{if((e=re())!==F&&e!==J)throw i(e);t.push(re()),ue(e),e=oe()}while(e===F||e===J);return t.join("")}function B(e){var t=re();switch(n(t)){case J:case F:return se(t),s();case"true":return!0;case"false":return!1}try{return V(t)}catch(n){if(e&&g.test(t))return t;throw i(t,"value")}}function q(){var e=z(re()),t=e;return ue("to",!0)&&(t=z(re())),ue(E),[e,t]}function V(e){var t=1;"-"===e.charAt(0)&&(t=-1,e=e.substring(1));var r=n(e);switch(r){case"inf":return t*(1/0);case"nan":return NaN;case"0":return 0}if(/^[1-9][0-9]*$/.test(e))return t*parseInt(e,10);if(/^0[x][0-9a-f]+$/.test(r))return t*parseInt(e,16);if(/^0[0-7]+$/.test(e))return t*parseInt(e,8);if(/^(?!e)[0-9]*(?:\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(r))return t*parseFloat(e);throw i(e,"number")}function z(e,t){var r=n(e);switch(r){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===e.charAt(0)&&!t)throw i(e,"id");if(/^-?[1-9][0-9]*$/.test(e))return parseInt(e,10);if(/^-?0[x][0-9a-f]+$/.test(r))return parseInt(e,16);if(/^-?0[0-7]+$/.test(e))return parseInt(e,8);throw i(e,"id")}function L(){if(void 0!==Y)throw i("package");if(Y=re(),!g.test(Y))throw i(Y,x);le=le.define(Y),ue(E)}function P(){var e,t=oe();switch(t){case"weak":e=te||(te=[]),re();break;case"public":re();default:e=ee||(ee=[])}t=s(),ue(E),e.push(t)}function R(){ue("="),ie=n(s());var e;if(["proto2",e="proto3"].indexOf(ie)<0)throw i(ie,"syntax");ae=ie===e,ue(E)}function I(e,t){switch(t){case O:return K(e,t),ue(E),!0;case"message":return $(e,t),!0;case"enum":return U(e,t),!0;case"service":return G(e,t),!0;case"extend":return Q(e,t),!0}return!1}function $(e,t){var r=re();if(!y.test(r))throw i(r,"type name");var s=new f(r);if(ue(T,!0)){for(;(t=re())!==S;){var o=n(t);if(!I(s,t))switch(o){case"map":M(s,o);break;case w:case k:case b:C(s,o);break;case"oneof":D(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(q(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(q(s,o));break;default:if(!ae||!g.test(t))throw i(t);se(t),C(s,k)}}ue(E,!0)}else ue(E);e.add(s)}function C(e,t,n){var s=re();if(!g.test(s))throw i(s,N);var o=re();if(!y.test(o))throw i(o,x);o=r(o),ue("=");var u=z(re()),f=Z(new a(o,u,s,t,n));f.repeated&&f.setOption("packed",ae,!0),e.add(f)}function M(e){ue("<");var t=re();if(void 0===v.mapKey[t])throw i(t,N);ue(",");var n=re();if(!g.test(n))throw i(n,N);ue(">");var s=re();if(!y.test(s))throw i(s,x);s=r(s),ue("=");var o=z(re()),u=Z(new h(s,o,t,n));e.add(u)}function D(e,t){var n=re();if(!y.test(n))throw i(n,x);n=r(n);var s=new l(n);if(ue(T,!0)){for(;(t=re())!==S;)t===O?(K(s,t),ue(E)):(se(t),C(s,k));ue(E,!0)}else ue(E);e.add(s)}function U(e,t){var r=re();if(!y.test(r))throw i(r,x);var s={},o=new c(r,s);if(ue(T,!0)){for(;(t=re())!==S;)n(t)===O?K(o):_(o,t);ue(E,!0)}else ue(E);e.add(o)}function _(e,t){if(!y.test(t))throw i(t,x);var n=t;ue("=");var r=z(re(),!0);e.values[n]=r,Z({})}function K(e,t){var n=ue(A,!0),r=re();if(!g.test(r))throw i(r,x);n&&(ue(j),r=A+r+j,t=oe(),m.test(t)&&(r+=t,re())),ue("="),H(e,r)}function H(e,t){if(ue(T,!0)){for(;(he=re())!==S;){if(!y.test(he))throw i(he,x);t=t+"."+he,ue(":",!0)?W(e,t,B(!0)):H(e,t)}ue(E,!0)}else W(e,t,B(!0))}function W(e,t,i){e.setOption?e.setOption(t,i):e[t]=i}function Z(e){if(ue("[",!0)){do K(e,O);while(ue(",",!0));ue("]")}return ue(E),e}function G(e,t){if(t=re(),!y.test(t))throw i(t,"service name");var r=t,s=new d(r);if(ue(T,!0)){for(;(t=re())!==S;){var o=n(t);switch(o){case O:K(s,o),ue(E);break;case"rpc":X(s,o);break;default:throw i(t)}}ue(E,!0)}else ue(E);e.add(s)}function X(e,t){var r=t,s=re();if(!y.test(s))throw i(s,x);var o,u,f,a;ue(A);var h;if(ue(h="stream",!0)&&(u=!0),!g.test(t=re()))throw i(t);if(o=t,ue(j),ue("returns"),ue(A),ue(h,!0)&&(a=!0),!g.test(t=re()))throw i(t);f=t,ue(j);var l=new p(s,r,o,f,u,a);if(ue(T,!0)){for(;(t=re())!==S;){var c=n(t);switch(c){case O:K(l,c),ue(E);break;default:throw i(t)}}ue(E,!0)}else ue(E);e.add(l)}function Q(e,t){var r=re();if(!g.test(r))throw i(r,"reference");if(ue(T,!0)){for(;(t=re())!==S;){var s=n(t);switch(s){case w:case b:case k:C(e,s,r);break;default:if(!ae||!g.test(t))throw i(t);se(t),C(e,k,r)}}ue(E,!0)}else ue(E)}t||(t=new u);var Y,ee,te,ie,ne=o(e),re=ne.next,se=ne.push,oe=ne.peek,ue=ne.skip,fe=!0,ae=!1;t||(t=new u);for(var he,le=t;null!==(he=re());){var ce=n(he);switch(ce){case"package":if(!fe)throw i(he);L();break;case"import":if(!fe)throw i(he);P();break;case"syntax":if(!fe)throw i(he);R();break;case O:if(!fe)throw i(he);K(le,he),ue(E);break;default:if(I(le,he)){fe=!1;continue}throw i(he)}}return{package:Y,imports:ee,weakImports:te,syntax:ie,root:t}}t.exports=s;var o=e(18),u=e(16),f=e(19),a=e(6),h=e(8),l=e(12),c=e(5),d=e(17),p=e(9),v=e(20),y=/^[a-zA-Z_][a-zA-Z_0-9]*$/,g=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,m=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,w="required",b="repeated",k="optional",O="option",x="name",N="type",T="{",S="}",A="(",j=")",E=";",F='"',J="'"},{12:12,16:16,17:17,18:18,19:19,20:20,5:5,6:6,8:8,9:9}],14:[function(e,t,i){"use strict";function n(e,t){if(e)for(var i=!(t&&t.fieldsOnly),n=this.constructor.$type.fields,r=Object.keys(e),s=0;s<r.length;++s)(n[r[s]]||i)&&(this[r[s]]=e[r[s]])}t.exports=n,n.prototype.asJSON=function(e){for(var t,i=!(e&&e.fieldsOnly),n=this.constructor.$type.fields,r={},s=Object.keys(this),o=0;o<s.length;++o){var u=n[t=s[o]],f=this[t];if(u)if(u.repeated){if(f&&f.length){for(var a=new Array(f.length),h=0,l=f.length;h<l;++h)a[h]=u.jsonConvert(f[h],e);r[t]=a}}else r[t]=u.jsonConvert(f,e);else i&&(r[t]=f)}return r}},{}],15:[function(e,t,i){"use strict";function n(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function r(e){return this instanceof r?(this.buf=e,this.pos=0,void(this.len=e.length)):w.Buffer&&(!e||w.Buffer.isBuffer(e))&&new m(e)||new r(e)}function s(e,t){this.id=e,this.wireType=t}function o(){var e=0,t=0,i=0,r=0;if(this.len-this.pos>9){for(i=0;i<4;++i)if(r=this.buf[this.pos++],e|=(127&r)<<7*i,r<128)return new k(e>>>0,t>>>0);if(r=this.buf[this.pos++],e|=(127&r)<<28,t|=(127&r)>>4,r<128)return new k(e>>>0,t>>>0);for(i=0;i<5;++i)if(r=this.buf[this.pos++],t|=(127&r)<<7*i+3,r<128)return new k(e>>>0,t>>>0)}else{for(i=0;i<4;++i){if(this.pos>=this.len)throw n(this);if(r=this.buf[this.pos++],e|=(127&r)<<7*i,r<128)return new k(e>>>0,t>>>0)}if(this.pos>=this.len)throw n(this);if(r=this.buf[this.pos++],e|=(127&r)<<28,t|=(127&r)>>4,r<128)return new k(e>>>0,t>>>0);for(i=0;i<5;++i){if(this.pos>=this.len)throw n(this);if(r=this.buf[this.pos++],t|=(127&r)<<7*i+3,r<128)return new k(e>>>0,t>>>0)}}throw Error("invalid varint encoding")}function u(){return o.call(this).toLong()}function f(){return o.call(this).toNumber()}function a(){return o.call(this).toLong(!0)}function h(){return o.call(this).toNumber(!0)}function l(){return o.call(this).zzDecode().toLong()}function c(){return o.call(this).zzDecode().toNumber()}function d(){if(this.pos+8>this.len)throw n(this,8);return new k((this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0,(this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0)}function p(){return d.call(this).toLong(!0)}function v(){return d.call(this).toNumber(!0)}function y(){return d.call(this).zzDecode().toLong()}function g(){return d.call(this).zzDecode().toNumber()}function m(e){T&&T(),r.call(this,e)}t.exports=r,r.BufferReader=m;var w=e(21),b=e(1),k=w.LongBits,O=w.Long,x=r.prototype,N="undefined"!=typeof Uint8Array?Uint8Array:Array;x.h=N.prototype.slice||N.prototype.subarray,x.tag=function(){if(this.pos>=this.len)throw n(this);return new s(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},x.int32=function(){var e=0,t=0,i=0;do{if(this.pos>=this.len)throw n(this);i=this.buf[this.pos++],t<32&&(e|=(127&i)<<t),t+=7}while(128&i);return e},x.uint32=function(){return this.int32()>>>0},x.sint32=function(){var e=this.int32();return e>>>1^-(1&e)},x.int64=O&&u||f,x.uint64=O&&a||h,x.sint64=O&&l||c,x.bool=function(){return 0!==this.int32()},x.fixed32=function(){if(this.pos+4>this.len)throw n(this,4);return this.pos+=4,this.buf[this.pos-4]|this.buf[this.pos-3]<<8|this.buf[this.pos-2]<<16|this.buf[this.pos-1]<<24},x.sfixed32=function(){var e=this.fixed32();return e>>>1^-(1&e)},x.fixed64=O&&p||v,x.sfixed64=O&&y||g,x.float=function(){if(this.pos+4>this.len)throw n(this,4);var e=b.read(this.buf,this.pos,!1,23,4);return this.pos+=4,e},x.double=function(){if(this.pos+8>this.len)throw n(this,4);var e=b.read(this.buf,this.pos,!1,52,8);return this.pos+=8,e},x.bytes=function(){var e=this.int32()>>>0,t=this.pos,i=this.pos+e;if(i>this.len)throw n(this,e);return this.pos+=e,t===i?new this.buf.constructor(0):this.h.call(this.buf,t,i)},x.string=function(){var e=this.bytes(),t=e.length;if(t){for(var i=new Array(t),n=0,r=0;n<t;){var s=e[n++];if(s<128)i[r++]=s;else if(s>191&&s<224)i[r++]=(31&s)<<6|63&e[n++];else if(s>239&&s<365){var o=((7&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;i[r++]=55296+(o>>10),i[r++]=56320+(1023&o)}else i[r++]=(15&s)<<12|(63&e[n++])<<6|63&e[n++]}return String.fromCharCode.apply(String,i.slice(0,r))}return""},x.skip=function(e){if(void 0===e){do if(this.pos>=this.len)throw n(this);while(128&this.buf[this.pos++])}else{if(this.pos+e>this.len)throw n(this,e);this.pos+=e}return this},x.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(;;){var t=this.tag();if(4===t.wireType)break;this.skipType(t.wireType)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type: "+e)}return this},x.reset=function(e){return e?(this.buf=e,this.len=e.length):(this.buf=null,this.len=0),this.pos=0,this},x.finish=function(e){var t=this.pos?this.h.call(this.buf,this.pos):this.buf;return this.reset(e),t};var T=function(){if(!w.Buffer)throw Error("Buffer is not supported");S.h=w.Buffer.prototype.slice,T=!1},S=m.prototype=Object.create(r.prototype);S.constructor=m,S.float=function(){if(this.pos+4>this.len)throw n(this,4);var e=this.buf.readFloatLE(this.pos,!0);return this.pos+=4,e},S.double=function(){if(this.pos+8>this.len)throw n(this,8);var e=this.buf.readDoubleLE(this.pos,!0);return this.pos+=8,e},S.string=function(){var e=this.int32()>>>0,t=this.pos,i=this.pos+e;if(i>this.len)throw n(this,e);return this.pos+=e,this.buf.toString("utf8",t,i)},S.finish=function(e){var t=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(e),t}},{1:1,21:21}],16:[function(e,t,i){"use strict";function n(e){s.call(this,"",e),this.deferred=[],this.files=[]}function r(e){var t=e.parent.lookup(e.extend);if(t){var i=new u(e.getFullName(),e.id,e.type,e.rule,(void 0),e.options);return i.declaringField=e,e.extensionField=i,t.add(i),!0}return!1}t.exports=n;var s=e(10),o=s.extend(n),u=e(6),f=e(21),a=e(2);n.fromJSON=function(e,t){return t||(t=new n),t.setOptions(e.options).addJSON(e.nested)},o.resolvePath=f.resolvePath,o.load=function t(i,n){function r(e,t){if(n){var i=n;n=null,i(e,t)}}function s(t,i){try{if(f.isString(i)&&"{"===i.charAt(0)&&(i=JSON.parse(i)),f.isString(i)){var n=e(13)(i,u);n.imports&&n.imports.forEach(function(e){o(u.resolvePath(t,e))}),n.weakImports&&n.weakImports.forEach(function(e){o(u.resolvePath(t,e),!0)})}else u.setOptions(i.options).addJSON(i.nested)}catch(e){return void r(e)}h||r(null,u)}function o(e,t){var i=e.indexOf("google/protobuf/");if(i>-1){var o=e.substring(i);o in a&&(e=o)}if(!(u.files.indexOf(e)>-1)){if(u.files.push(e),e in a)return++h,void setTimeout(function(){--h,s(e,a[e])});++h,f.fetch(e,function(i,o){if(--h,n)return i?void(t||r(i)):void s(e,o)})}}var u=this;if(!n)return f.asPromise(t,u,i);var h=0;f.isString(i)&&(i=[i]),i.forEach(function(e){o(u.resolvePath("",e))}),h||r(null)},o.e=function(e){var t=this.deferred.slice();this.deferred=[];for(var i=0;i<t.length;)r(t[i])?t.splice(i,1):++i;if(this.deferred=t,e instanceof u&&void 0!==e.extend&&!e.extensionField&&!r(e)&&this.deferred.indexOf(e)<0)this.deferred.push(e);else if(e instanceof s){var n=e.getNestedArray();for(i=0;i<n.length;++i)this.e(n[i])}},o.f=function(e){if(e instanceof u){if(void 0!==e.extend&&!e.extensionField){var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}e.extensionField&&(e.extensionField.parent.remove(e.extensionField),e.extensionField=null)}else if(e instanceof s)for(var i=e.getNestedArray(),n=0;n<i.length;++n)this.f(i[n])},o.toString=function(){
return this.constructor.name}},{10:10,13:13,2:2,21:21,6:6}],17:[function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this.methods={},this.i=null}function r(e){return e.i=null,e}t.exports=n;var s=e(10),o=s.prototype,u=s.extend(n),f=e(9),a=e(21);Object.defineProperties(u,{methodsArray:{get:u.getMethodsArray=function(){return this.i||(this.i=a.toArray(this.methods))}}}),n.testJSON=function(e){return Boolean(e&&e.methods)},n.fromJSON=function(e,t){var i=new n(e,t.options);return t.methods&&Object.keys(t.methods).forEach(function(e){i.add(f.fromJSON(e,t.methods[e]))}),i},u.toJSON=function(){var e=o.toJSON.call(this);return{options:e&&e.options||void 0,methods:s.arrayToJSON(this.getMethodsArray())||{},nested:e&&e.nested||void 0}},u.get=function(e){return o.get.call(this,e)||this.methods[e]||null},u.resolveAll=function(){for(var e=this.getMethodsArray(),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,r(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,r(this)}return o.remove.call(this,e)},u.create=function(e,t,i){var n={};return Object.defineProperty(n,"$rpc",{value:e}),this.getMethodsArray().forEach(function(r){n[r.name]=function(n,s){r.resolve();var o;try{o=(t&&r.resolvedRequestType.encodeDelimited(n)||r.resolvedRequestType.encode(n)).finish()}catch(e){return void("function"==typeof setImmediate&&setImmediate||setTimeout)(function(){s(e)})}e(r,o,function(e,t){if(e)return void s(e);var n;try{n=i&&r.resolvedResponseType.decodeDelimited(t)||r.resolvedResponseType.decode(t)}catch(e){return void s(e)}s(null,n)})}}),n}},{10:10,21:21,9:9}],18:[function(e,t,i){"use strict";function n(e){return e.replace(/\\(.?)/g,function(e,t){switch(t){case"\\":case"":return t;case"0":return"\0";default:return t}})}function r(e){function t(e){return Error("illegal "+e+" (line "+g+")")}function i(){var i='"'===w?o:u;i.lastIndex=v-1;var r=i.exec(e);if(!r)throw t("string");return v=i.lastIndex,c(w),w=null,n(r[1])}function r(t){return e.charAt(t)}function l(){if(m.length>0)return m.shift();if(w)return i();var n,o,u;do{if(v===y)return null;for(n=!1;/\s/.test(u=r(v));)if(u===f&&++g,++v===y)return null;if(r(v)===a){if(++v===y)throw t("comment");if(r(v)===a){for(;r(++v)!==f;)if(v===y)return null;++v,++g,n=!0}else{if((u=r(v))!==h)return a;do{if(u===f&&++g,++v===y)return null;o=u,u=r(v)}while(o!==h||u!==a);++v,n=!0}}}while(n);if(v===y)return null;var l=v;s.lastIndex=0;var c=s.test(r(l++));if(!c)for(;l<y&&!s.test(r(l));)++l;var d=e.substring(v,v=l);return'"'!==d&&"'"!==d||(w=d),d}function c(e){m.push(e)}function d(){if(!m.length){var e=l();if(null===e)return null;c(e)}return m[0]}function p(e,i){var n=d(),r=n===e;if(r)return l(),!0;if(!i)throw t("token '"+n+"', '"+e+"' expected");return!1}e=e.toString();var v=0,y=e.length,g=1,m=[],w=null;return{line:function(){return g},next:l,peek:d,push:c,skip:p}}t.exports=r;var s=/[\s{}=;:[\],'"()<>]/g,o=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,u=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,f="\n",a="/",h="*"},{}],19:[function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.j=null,this.k=null,this.l=null,this.m=null}function r(e){return e.j=e.k=e.l=e.m=null,delete e.encode,delete e.decode,e}t.exports=n;var s=e(10),o=s.prototype,u=s.extend(n),f=e(5),a=e(12),h=e(6),l=e(17),c=e(14),d=e(7),p=e(21),v=e(15),y=e(4),g=e(3),m=e(24),w=p.codegen;Object.defineProperties(u,{fieldsById:{get:u.getFieldsById=function(){if(this.j)return this.j;this.j={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var i=this.fields[e[t]],n=i.id;if(this.j[n])throw Error("duplicate id "+n+" in "+this);this.j[n]=i}return this.j}},fieldsArray:{get:u.getFieldsArray=function(){return this.k||(this.k=p.toArray(this.fields))}},oneofsArray:{get:u.getOneofsArray=function(){return this.l||(this.l=p.toArray(this.oneofs))}},ctor:{get:u.getCtor=function(){if(this.m)return this.m;var e;return e=w.supported?w("p")("P.call(this,p)").eof(this.getFullName()+"$ctor",{P:c}):function(e){c.call(this,e)},e.prototype=d(e,this),this.m=e,e},set:u.setCtor=function(e){if(e&&!(e.prototype instanceof c))throw p.b("ctor","a constructor inheriting from Prototype");this.m=e}}}),n.testJSON=function(e){return Boolean(e&&e.fields)};var b=[f,n,h,l];n.fromJSON=function(e,t){var i=new n(e,t.options);return i.extensions=t.extensions,i.reserved=t.reserved,t.fields&&Object.keys(t.fields).forEach(function(e){i.add(h.fromJSON(e,t.fields[e]))}),t.oneofs&&Object.keys(t.oneofs).forEach(function(e){i.add(a.fromJSON(e,t.oneofs[e]))}),t.nested&&Object.keys(t.nested).forEach(function(e){for(var n=t.nested[e],r=0;r<b.length;++r)if(b[r].testJSON(n))return void i.add(b[r].fromJSON(e,n));throw Error("invalid nested object in "+i+": "+e)}),t.extensions&&t.extensions.length&&(i.extensions=t.extensions),t.reserved&&t.reserved.length&&(i.reserved=t.reserved),i},u.toJSON=function(){var e=o.toJSON.call(this);return{options:e&&e.options||void 0,oneofs:s.arrayToJSON(this.getOneofsArray()),fields:s.arrayToJSON(this.getFieldsArray().filter(function(e){return!e.declaringField}))||{},extensions:this.extensions&&this.extensions.length?this.extensions:void 0,reserved:this.reserved&&this.reserved.length?this.reserved:void 0,nested:e&&e.nested||void 0}},u.resolveAll=function(){for(var e=this.getFieldsArray(),t=0;t<e.length;)e[t++].resolve();var i=this.getOneofsArray();for(t=0;t<i.length;)i[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&&void 0===e.extend){if(this.getFieldsById()[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),r(this)}return e instanceof a?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),r(this)):o.add.call(this,e)},u.remove=function(e){if(e instanceof h&&void 0===e.extend){if(this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.message=null,r(this)}return o.remove.call(this,e)},u.create=function(e,t){if("function"==typeof e)t=e,e=void 0;else if(e instanceof c)return e;if(t){if(!(t.prototype instanceof c))throw p.b("ctor","a constructor inheriting from Prototype")}else t=this.getCtor();return new t(e)},u.encode=function(e,t){var i=new y(this);return this.encode=w.supported?i.generate():i.encode,this.encode(e,t)},u.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},u.decode=function(e,t){var i=new g(this);return this.decode=w.supported?i.generate():i.decode,this.decode(e,t)},u.decodeDelimited=function(e){return e=e instanceof v?e:v(e),this.decode(e,e.uint32())},u.verify=function(e){var t=new m(this);return this.verify=w.supported?t.generate():t.verify,this.verify(e)}},{10:10,12:12,14:14,15:15,17:17,21:21,24:24,3:3,4:4,5:5,6:6,7:7}],20:[function(e,t,i){"use strict";function n(e,t){var i=0,n={};for(t|=0;i<e.length;)n[s[i+t]]=e[i++];return n}var r=t.exports={},s=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];r.basic=n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);var o=[];Object.freeze&&Object.freeze(o),r.defaults=n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o]),r.long=n([0,0,0,1,1],7),r.mapKey=n([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=n([0,0,0,5,5,0,0,0,1,1,0],2)},{}],21:[function(e,t,i){(function(i){"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e,t){for(var i=[],n=2;n<arguments.length;++n)i.push(arguments[n]);return new Promise(function(n,r){e.apply(t,i.concat(function(e){e?r(e):n.apply(null,Array.prototype.slice.call(arguments,1))}))})}function s(t,i){function o(){return 0!==a.status&&200!==a.status?i(Error("status "+a.status)):n(a.responseText)?i(null,a.responseText):i(Error("request failed"))}if(!i)return r(s,f,t);var u;try{u=e("fs")}catch(e){}if(u&&u.readFile)return u.readFile(t,"utf8",i);var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&o()},a.open("GET",t,!0),a.send()}function o(e){return/^(?:\/|[a-zA-Z0-9]+:)/.test(e)}function u(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),i=o(e),n="";i&&(n=t.shift()+"/");for(var r=0;r<t.length;)".."===t[r]?r>0?t.splice(--r,2):i?t.splice(r,1):++r:"."===t[r]?t.splice(r,1):++r;return n+t.join("/")}var f=t.exports={},a=f.LongBits=e(23);f.codegen=e(22);var h=f.isNode=Boolean(i.process&&i.process.versions&&i.process.versions.node);if(f.Buffer=null,h)try{f.Buffer=e("buffer").Buffer}catch(e){}if(f.Long=i.dcodeIO&&i.dcodeIO.Long||null,!f.Long)try{f.Long=e("long")}catch(e){}f.isString=n,f.isObject=function(e){return Boolean(e&&"object"==typeof e)},f.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},f.toArray=function(e){if(!e)return[];for(var t=Object.keys(e),i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=e[t[r]];return n},f.b=function(e,t){return TypeError(e+" must be "+(t||"a string"))},f.asPromise=r,f.fetch=s,f.isAbsolutePath=o,f.normalizePath=u,f.resolvePath=function(e,t,i){return i||(t=u(t)),o(t)?t:(i||(e=u(e)),e=e.replace(/(?:\/|^)[^\/]+$/,""),e.length?u(e+"/"+t):t)},f.longToHash=function(e){return e?a.from(e).toHash():"\0\0\0\0\0\0\0\0"},f.longFromHash=function(e,t){var i=a.fromHash(e);return f.Long?f.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},f.longNeq=function(e,t){return"number"==typeof e?"number"==typeof t?e!==t:(e=a.fromNumber(e)).lo!==t.low||e.hi!==t.high:"number"==typeof t?(t=a.fromNumber(t)).lo!==e.low||t.hi!==e.high:e.low!==t.low||e.high!==t.high},f.merge=function(e,t,i){if(t)for(var n=Object.keys(t),r=0;r<n.length;++r)void 0!==e[n[r]]&&i||(e[n[r]]=t[n[r]]);return e},f.safeProp=function(e){return"['"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"']"},f.newBuffer=function(e){return new(f.Buffer||"undefined"!=typeof Uint8Array&&Uint8Array||Array)(e||0)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{22:22,23:23,buffer:"buffer",long:"long",undefined:void 0}],22:[function(e,t,i){"use strict";function n(){function e(){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];var l=e.fmt.apply(null,t),c=a;if(i.length){var d=i[i.length-1];r.test(d)?c=++a:u.test(d)&&++c,o.test(d)&&!o.test(l)?(c=++a,h=!0):h&&f.test(d)&&(c=--a,h=!1),s.test(l)&&(c=--a)}for(var p=0;p<c;++p)l="\t"+l;return i.push(l),e}var t=Array.prototype.slice.call(arguments),i=['\t"use strict"'],a=1,h=!1;return e.fmt=function(e){var t=Array.prototype.slice.call(arguments,1),i=0;return e.replace(/%([djs])/g,function(e,n){var r=t[i++];return"j"===n?JSON.stringify(r):String(r)})},e.str=function(e){return"function "+(e?e.replace(/[^\w_$]/g,"_"):"")+"("+t.join(",")+") {\n"+i.join("\n")+"\n}"},e.eof=function(t,i){t&&"object"==typeof t&&(i=t,t=void 0);var r=e.str(t);n.verbose&&console.log("--- codegen ---\n"+r.replace(/^/gm,"> ").replace(/\t/g," ")),r="return "+r;var s,o=[];Array.isArray(i)?s=i.slice():i?(s=Object.keys(i),o=s.map(function(e){return i[e]})):s=[];var u=Function.apply(null,s.concat(r));return o?u.apply(null,o):u()},e}t.exports=n;var r=/[{[]$/,s=/^[}\]]/,o=/:$/,u=/^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/,f=/\b(?:break|continue);?$|^\s*return\b/;n.supported=!1;try{n.supported=1===n("a","b")("return a-b").eof()(2,1)}catch(e){}n.verbose=!1},{}],23:[function(e,t,i){"use strict";function n(e,t){this.lo=e,this.hi=t}t.exports=n;var r=e(21),s=n.prototype,o=n.zero=new n(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1},n.fromNumber=function(e){if(0===e)return o;var t=e<0;e=Math.abs(e);var i=e>>>0,r=(e-i)/4294967296>>>0;return t&&(r=~r>>>0,i=~i>>>0,++i>4294967295&&(i=0,++r>4294967295&&(r=0))),new n(i,r)},n.from=function(e){switch(typeof e){case"number":return n.fromNumber(e);case"string":e=r.Long.fromString(e)}return(e.low||e.high)&&new n(e.low>>>0,e.high>>>0)||o},s.toNumber=function(e){return!e&&this.hi>>>31?(this.lo=~this.lo+1>>>0,this.hi=~this.hi>>>0,this.lo||(this.hi=this.hi+1>>>0),-(this.lo+4294967296*this.hi)):this.lo+4294967296*this.hi},s.toLong=function(e){return new r.Long(this.lo,this.hi,e)};var u=String.prototype.charCodeAt;n.fromHash=function(e){return new n((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)},s.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24&255,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24&255)},s.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},s.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},s.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===t?e<16384?e<128?1:2:e<1<<21?3:4:t<16384?t<128?5:6:t<1<<21?7:8:i<128?9:10}},{21:21}],24:[function(e,t,i){"use strict";function n(e){this.type=e}t.exports=n;var r=e(5),s=e(19),o=e(21),u=n.prototype;Object.defineProperties(u,{fieldsArray:{get:u.getFieldsArray=function(){return this.type.getFieldsArray()}},fullName:{get:u.getFullName=function(){return this.type.getFullName()}}}),u.verify=function(e){for(var t=this.getFieldsArray(),i=0;i<t.length;){var n=t[i++].resolve(),o=e[n.name];if(void 0===o){if(n.required)return"missing required field "+n.name+" in "+this.getFullName()}else{if(n.resolvedType instanceof r&&void 0===n.resolvedType.getValuesById()[o])return"invalid enum value "+n.name+" = "+o+" in "+this.getFullName();if(n.resolvedType instanceof s){if(!o&&n.required)return"missing required field "+n.name+" in "+this.getFullName();var u;if(null!==(u=n.resolvedType.verify(o)))return u}}}return null},u.generate=function(){for(var e=this.type.getFieldsArray(),t=o.codegen("m"),i=!1,n=0;n<e.length;++n){var u=e[n].resolve(),f=o.safeProp(u.name);if(u.required)t("if(m%s===undefined)",f)("return 'missing required field %s in %s'",u.name,this.type.getFullName());else if(u.resolvedType instanceof r){var a=o.toArray(u.resolvedType.values);t("switch(m%s){",f)("default:")("return 'invalid enum value %s = '+m%s+' in %s'",u.name,f,this.type.getFullName());for(var h=0,l=a.length;h<l;++h)t("case %d:",a[h]);t("}")}else u.resolvedType instanceof s&&(u.required&&t("if(!m%s)",f)("return 'missing required field %s in %s'",u.name,this.type.getFullName()),i||(t("var r"),i=!0),t("if((r=types[%d].verify(m%s))!==null)",n,f)("return r"))}return t("return null").eof(this.type.getFullName()+"$verify",{types:e.map(function(e){return e.resolvedType})})}},{19:19,21:21,5:5}],25:[function(e,t,i){"use strict";function n(e,t,i){this.fn=e,this.val=t,this.len=i,this.next=null}function r(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len}function o(){return this instanceof o?(this.len=0,this.head=new n(r,0,0),this.tail=this.head,void(this.stack=[])):b.Buffer&&new v||new o}function u(e,t,i){e[t]=255&i}function f(e,t,i){for(;i>127;)e[t++]=127&i|128,i>>>=7;e[t]=i}function a(e,t,i){for(;i.hi||i.lo>127;)e[t++]=127&i.lo|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0,i.hi>>>=7;e[t++]=i.lo}function h(e,t,i){e[t++]=255&i,e[t++]=i>>>8&255,e[t++]=i>>>16&255,e[t]=i>>>24&255}function l(e,t,i){k.write(e,i,t,!1,23,4)}function c(e,t,i){k.write(e,i,t,!1,52,8)}function d(e,t,i){for(var n=0;n<i.length;++n){var r,s=i.charCodeAt(n);s<128?e[t++]=s:s<2048?(e[t++]=s>>6|192,e[t++]=63&s|128):55296===(64512&s)&&n+1<i.length&&56320===(64512&(r=i.charCodeAt(n+1)))?(s=65536+((1023&s)<<10)+(1023&r),++n,e[t++]=s>>18|240,e[t++]=s>>12&63|128,e[t++]=s>>6&63|128,e[t++]=63&s|128):(e[t++]=s>>12|224,e[t++]=s>>6&63|128,e[t++]=63&s|128)}}function p(e){var t=e.length>>>0;if(t){for(var i,n=0,r=0;r<t;++r)i=e.charCodeAt(r),i<128?n+=1:i<2048?n+=2:55296===(64512&i)&&r+1<t&&56320===(64512&e.charCodeAt(r+1))?(++r,n+=4):n+=3;return n}return 0}function v(){o.call(this)}function y(e,t,i){e.writeFloatLE(i,t,!0)}function g(e,t,i){e.writeDoubleLE(i,t,!0)}function m(e,t,i){i.length&&i.copy(e,t,0,i.length)}function w(e,t,i){e.write(i,t)}t.exports=o,o.BufferWriter=v;var b=e(21),k=e(1),O=b.LongBits;o.Op=n,o.State=s;var x="undefined"!=typeof Uint8Array?Uint8Array:Array,N=o.prototype;N.push=function(e,t,i){var r=new n(e,i,t);return this.tail.next=r,this.tail=r,this.len+=t,this},N.tag=function(e,t){return this.push(u,1,e<<3|7&t)},N.uint32=function(e){return e>>>=0,this.push(f,e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)},N.int32=function(e){return e<0?this.push(a,10,O.fromNumber(e)):this.uint32(e)},N.sint32=function(e){return this.uint32(e<<1^e>>31)},N.uint64=function(e){var t=O.from(e);return this.push(a,t.length(),t)},N.int64=N.uint64,N.sint64=function(e){var t=O.from(e).zzEncode();return this.push(a,t.length(),t)},N.bool=function(e){return this.push(u,1,e?1:0)},N.fixed32=function(e){return this.push(h,4,e>>>0)},N.sfixed32=function(e){return this.push(h,4,e<<1^e>>31)},N.fixed64=function(e){var t=O.from(e);return this.push(h,4,t.hi).push(h,4,t.lo)},N.sfixed64=function(e){var t=O.from(e).zzEncode();return this.push(h,4,t.hi).push(h,4,t.lo)},N.float=function(e){return this.push(l,4,e)},N.double=function(e){return this.push(c,8,e)};var T=x.prototype.set?function(e,t,i){e.set(i,t)}:function(e,t,i){for(var n=0;n<i.length;++n)e[t+n]=i[n]};N.bytes=function(e){var t=e.length>>>0;return t?this.uint32(t).push(T,t,e):this.push(u,1,0)},N.string=function(e){var t=p(e);return t?this.uint32(t).push(d,t,e):this.push(u,1,0)},N.fork=function(){return this.stack.push(new s(this)),this.head=this.tail=new n(r,0,0),this.len=0,this},N.reset=function(){if(this.stack.length){var e=this.stack.pop();this.head=e.head,this.tail=e.tail,this.len=e.len}else this.head=this.tail=new n(r,0,0),this.len=0;return this},N.ldelim=function(e){var t=this.head,i=this.tail,n=this.len;return this.reset(),void 0!==e&&this.tag(e,2),this.uint32(n),this.tail.next=t.next,this.tail=i,this.len+=n,this},N.finish=function(){var e=this.head.next,t=new x(this.len),i=0;for(this.reset();e;)e.fn(t,i,e.val),i+=e.len,e=e.next;return t};var S=v.prototype=Object.create(o.prototype);S.constructor=v,S.float=function(e){return this.push(y,4,e)},S.double=function(e){return this.push(g,8,e)},S.bytes=function(e){var t=e.length>>>0;return t?this.uint32(t).push(m,t,e):this.push(u,1,0)},S.string=function(e){var t=p(e);return t?this.uint32(t).push(w,t,e):this.push(u,1,0)},S.finish=function(){var e=this.head.next,t=b.Buffer.allocUnsafe&&b.Buffer.allocUnsafe(this.len)||new b.Buffer(this.len),i=0;for(this.reset();e;)e.fn(t,i,e.val),i+=e.len,e=e.next;return t}},{1:1,21:21}],26:[function(e,t,i){(function(t){"use strict";function n(e,t,i){return"function"==typeof t?(i=t,t=new r.Root):t||(t=new r.Root),t.load(e,i)||r}var r=t.protobuf=i,s=e(21);r.load=n,r.tokenize=e(18),r.parse=e(13),r.Writer=e(25),r.BufferWriter=r.Writer.BufferWriter,r.Reader=e(15),r.BufferReader=r.Reader.BufferReader,r.Encoder=e(4),r.Decoder=e(3),r.ReflectionObject=e(11),r.Namespace=e(10),r.Root=e(16),r.Enum=e(5),r.Type=e(19),r.Field=e(6),r.OneOf=e(12),r.MapField=e(8),r.Service=e(17),r.Method=e(9),r.Prototype=e(14),r.inherits=e(7),r.types=e(20),r.common=e(2),r.util=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,2:2,20:20,21:21,25:25,3:3,4:4,5:5,6:6,7:7,8:8,9:9}]},{},[26]);
!function e(t,n,i){function r(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var h=n[o]={exports:{}};t[o][0].call(h.exports,function(e){var n=t[o][1][e];return r(n?n:e)},h,h.exports,e,t,n,i)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(e,t,n){n.read=function(e,t,n,i,r){var s,o,u=8*r-i-1,a=(1<<u)-1,f=a>>1,h=-7,l=n?0:r-1,c=n?1:-1,d=e[t+l];for(l+=c,s=d&(1<<-h)-1,d>>=-h,h+=u;h>0;s=256*s+e[t+l],l+=c,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+e[t+l],l+=c,h-=8);if(0===s)s=1-f;else{if(s===a)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,i),s-=f}return(d?-1:1)*o*Math.pow(2,s-i)},n.write=function(e,t,n,i,r,s){var o,u,a,f=8*s-r-1,h=(1<<f)-1,l=h>>1,c=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?s-1:0,p=i?-1:1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-o))<1&&(o--,a*=2),t+=o+l>=1?c/a:c*Math.pow(2,1-l),t*a>=2&&(o++,a/=2),o+l>=h?(u=0,o=h):o+l>=1?(u=(t*a-1)*Math.pow(2,r),o+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,r),o=0));r>=8;e[n+d]=255&u,d+=p,u/=256,r-=8);for(o=o<<r|u,f+=r;f>0;e[n+d]=255&o,d+=p,o/=256,f-=8);e[n+d-p]|=128*v}},{}],2:[function(e,t,n){"use strict";function i(e,t){/\/|\./.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),i[e]=t}t.exports=i,i("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var r;i("duration",{Duration:r={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),i("timestamp",{Timestamp:r}),i("empty",{Empty:{fields:{}}}),i("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}})},{}],3:[function(e,t,n){"use strict";var i=n,r=e(5),s=e(15),o=e(20),u=e(21);i.fallback=function(e,t){for(var n=this.getFieldsById(),e=e instanceof s?e:s(e),i=void 0===t?e.len:e.pos+t,a=new(this.getCtor());e.pos<i;){var f=e.tag(),h=n[f.id].resolve(),l=h.resolvedType instanceof r?"uint32":h.type;if(h)if(h.map){var c=h.resolvedKeyType?"uint32":h.keyType,t=e.uint32(),d=a[h.name]={};if(t){t+=e.pos;for(var p=[],v=[];e.pos<t;)1===e.tag().id?p[p.length]=e[c]():void 0!==o.basic[l]?v[v.length]=e[l]():v[v.length]=h.resolvedType.decode(e,e.uint32());for(var y=0;y<p.length;++y)d["object"==typeof p[y]?u.longToHash(p[y]):p[y]]=v[y]}}else if(h.repeated){var g=a[h.name]||(a[h.name]=[]);if(h.packed&&void 0!==o.packed[l]&&2===f.wireType)for(var m=e.uint32()+e.pos;e.pos<m;)g[g.length]=e[l]();else void 0!==o.basic[l]?g[g.length]=e[l]():g[g.length]=h.resolvedType.decode(e,e.uint32())}else void 0!==o.basic[l]?a[h.name]=e[l]():a[h.name]=h.resolvedType.decode(e,e.uint32());else e.skipType(f.wireType)}return a},i.generate=function(e){for(var t=e.getFieldsArray(),n=u.codegen("r","l")("r instanceof Reader||(r=Reader(r))")("var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())")("while(r.pos<c){")("var t=r.tag()")("switch(t.id){"),i=0;i<t.length;++i){var s=t[i].resolve(),a=s.resolvedType instanceof r?"uint32":s.type,f=u.safeProp(s.name);if(n("case %d:",s.id),s.map){var h=s.resolvedKeyType?"uint32":s.keyType;n("var n=r.uint32(),o={}")("if(n){")("n+=r.pos")("var k=[],v=[]")("while(r.pos<n){")("if(r.tag().id===1)")("k[k.length]=r.%s()",h),void 0!==o.basic[a]?n("else")("v[v.length]=r.%s()",a):n("else")("v[v.length]=types[%d].decode(r,r.uint32())",i,i),n("}")("for(var i=0;i<k.length;++i)")("o[typeof(k[i])==='object'?util.longToHash(k[i]):k[i]]=v[i]")("}")("m%s=o",f)}else s.repeated?(n("m%s||(m%s=[])",f,f),s.packed&&void 0!==o.packed[a]&&n("if(t.wireType===2){")("var e=r.uint32()+r.pos")("while(r.pos<e)")("m%s[m%s.length]=r.%s()",f,f,a)("}else"),void 0!==o.basic[a]?n("m%s[m%s.length]=r.%s()",f,f,a):n("m%s[m%s.length]=types[%d].decode(r,r.uint32())",f,f,i,i)):void 0!==o.basic[a]?n("m%s=r.%s()",f,a):n("m%s=types[%d].decode(r,r.uint32())",f,i,i);n("break")}return n("default:")("r.skipType(t.wireType)")("break")("}")("}")("return m")}},{15:15,20:20,21:21,5:5}],4:[function(e,t,n){"use strict";var i=n,r=e(5),s=e(26),o=e(20),u=e(21);i.fallback=function(e,t){t||(t=s());for(var n=this.getFieldsArray(),i=0;i<n.length;){var a=n[i++].resolve(),f=a.resolvedType instanceof r?"uint32":a.type,h=o.basic[f];if(a.map){var l,c,d=a.resolvedKeyType?"uint32":a.keyType;if((l=e[a.name])&&(c=Object.keys(l)).length){t.fork();for(var p=0;p<c.length;++p)t.tag(1,o.mapKey[d])[d](c[p]),void 0!==h?t.tag(2,h)[f](l[c[p]]):a.resolvedType.encode(l[c[p]],t.tag(2,2).fork()).ldelim();t.ldelim(a.id)}}else if(a.repeated){var v=e[a.name];if(v&&v.length)if(a.packed&&void 0!==o.packed[f]){t.fork();for(var p=0;p<v.length;)t[f](v[p++]);t.ldelim(a.id)}else{var p=0;if(void 0!==h)for(;p<v.length;)t.tag(a.id,h)[f](v[p++]);else for(;p<v.length;)a.resolvedType.encode(v[p++],t.tag(a.id,2).fork()).ldelim()}}else{var l=e[a.name];(a.required||void 0!==l&&a.long?u.longNeq(l,a.defaultValue):l!==a.defaultValue)&&(void 0!==h?t.tag(a.id,h)[f](l):(a.resolvedType.encode(l,t.fork()),t.len||a.required?t.ldelim(a.id):t.reset()))}}return t},i.generate=function(e){for(var t=e.getFieldsArray(),n=u.codegen("m","w")("w||(w=Writer())"),i=0;i<t.length;++i){var s=t[i].resolve(),a=s.resolvedType instanceof r?"uint32":s.type,f=o.basic[a],h=u.safeProp(s.name);if(s.map){var l=s.resolvedKeyType?"uint32":s.keyType,c=o.mapKey[l];n("if(m%s){",h)("w.fork()")("for(var i=0,ks=Object.keys(m%s);i<ks.length;++i){",h)("w.tag(1,%d).%s(ks[i])",c,l),void 0!==f?n("w.tag(2,%d).%s(m%s[ks[i]])",f,a,h):n("types[%d].encode(m%s[ks[i]],w.tag(2,2).fork()).ldelim()",i,h),n("}")("w.len&&w.ldelim(%d)||w.reset()",s.id)("}")}else s.repeated?s.packed&&void 0!==o.packed[a]?n("if(m%s&&m%s.length){",h,h)("w.fork()")("for(var i=0;i<m%s.length;++i)",h)("w.%s(m%s[i])",a,h)("w.ldelim(%d)",s.id)("}"):(n("if(m%s)",h)("for(var i=0;i<m%s.length;++i)",h),void 0!==f?n("w.tag(%d,%d).%s(m%s[i])",s.id,f,a,h):n("types[%d].encode(m%s[i],w.tag(%d,2).fork()).ldelim()",i,h,s.id)):(s.required||(s.long?n("if(m%s!==undefined&&util.longNeq(m%s,%j))",h,h,s.defaultValue):n("if(m%s!==undefined&&m%s!==%j)",h,h,s.defaultValue)),void 0!==f?n("w.tag(%d,%d).%s(m%s)",s.id,f,a,h):s.required?n("types[%d].encode(m%s,w.tag(%d,2).fork()).ldelim()",i,h,s.id):n("types[%d].encode(m%s,w.fork()).len&&w.ldelim(%d)||w.reset()",i,h,s.id))}return n("return w")}},{20:20,21:21,26:26,5:5}],5:[function(e,t,n){"use strict";function i(e,t,n){s.call(this,e,n),this.values=t||{},this.a=null}function r(e){return e.a=null,e}t.exports=i;var s=e(11),o=s.extend(i),u=e(21),a=u.b;u.props(o,{valuesById:{get:function(){return this.a||(this.a={},Object.keys(this.values).forEach(function(e){var t=this.values[e];if(this.a[t])throw Error("duplicate id "+t+" in "+this);this.a[t]=e},this)),this.a}}}),i.testJSON=function(e){return Boolean(e&&e.values)},i.fromJSON=function(e,t){return new i(e,t.values,t.options)},o.toJSON=function(){return{options:this.options,values:this.values}},o.add=function(e,t){if(!u.isString(e))throw a("name");if(!u.isInteger(t)||t<0)throw a("id","a non-negative integer");if(void 0!==this.values[e])throw Error('duplicate name "'+e+'" in '+this);if(void 0!==this.getValuesById()[t])throw Error("duplicate id "+t+" in "+this);return this.values[e]=t,r(this)},o.remove=function(e){if(!u.isString(e))throw a("name");if(void 0===this.values[e])throw Error('"'+e+'" is not a name of '+this);return delete this.values[e],r(this)}},{11:11,21:21}],6:[function(e,t,n){"use strict";function i(e,t,n,i,s,o){if(h.isObject(i)?(o=i,i=s=void 0):h.isObject(s)&&(o=s,s=void 0),r.call(this,e,o),!h.isInteger(t)||t<0)throw l("id","a non-negative integer");if(!h.isString(n))throw l("type");if(void 0!==s&&!h.isString(s))throw l("extend");if(void 0!==i&&!/^required|optional|repeated$/.test(i=i.toString().toLowerCase()))throw l("rule","a valid rule string");this.rule=i&&"optional"!==i?i:void 0,this.type=n,this.id=t,this.extend=s||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.defaultValue=null,this.long=!!h.Long&&void 0!==f.long[n],this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.c=null}t.exports=i;var r=e(11),s=r.extend(i),o=e(19),u=e(5),a=e(8),f=e(20),h=e(21),l=h.b;h.props(s,{packed:{get:s.isPacked=function(){return null===this.c&&(this.c=this.getOption("packed")!==!1),this.c}}}),s.setOption=function(e,t,n){return"packed"===e&&(this.c=null),r.prototype.setOption.call(this,e,t,n)},i.testJSON=function(e){return Boolean(e&&void 0!==e.id)},i.fromJSON=function(e,t){return void 0!==t.keyType?a.fromJSON(e,t):new i(e,t.id,t.type,t.role,t.extend,t.options)},s.toJSON=function(){return{rule:"optional"!==this.rule&&this.rule||void 0,type:this.type,id:this.id,extend:this.extend,options:this.options}},s.resolve=function(){if(this.resolved)return this;var e=f.defaults[this.type];if(void 0===e){var t=this.parent.lookup(this.type);if(t instanceof o)this.resolvedType=t,e=null;else{if(!(t instanceof u))throw Error("unresolvable field type: "+this.type);this.resolvedType=t,e=0}}var n;return this.map?this.defaultValue={}:this.repeated?this.defaultValue=[]:this.options&&void 0!==(n=this.options.default)?this.defaultValue=n:this.defaultValue=e,this.long&&(this.defaultValue=h.Long.fromValue(this.defaultValue)),r.prototype.resolve.call(this)},s.jsonConvert=function(e,t){if(t){if(this.resolvedType instanceof u&&t.enum===String)return this.resolvedType.getValuesById()[e];if(this.long&&t.long)return t.long===Number?"number"==typeof e?e:h.Long.fromValue(e).toNumber():h.Long.fromValue(e,"u"===this.type.charAt(0)).toString()}return e}},{11:11,19:19,20:20,21:21,5:5,8:8}],7:[function(e,t,n){"use strict";function i(e,t,n){if("function"!=typeof e)throw u("clazz","a function");if(!(t instanceof s))throw u("type","a Type");n||(n={});var a={$type:{value:t}};n.noStatics||o.merge(a,{encode:{value:function(e,t){return this.$type.encode(e,t)}},encodeDelimited:{value:function(e,t){return this.$type.encodeDelimited(e,t)}},decode:{value:function(e){return this.$type.decode(e)}},decodeDelimited:{value:function(e){return this.$type.decodeDelimited(e)}},verify:{value:function(e){return this.$type.verify(e)}}},!0),o.props(e,a);var f=i.defineProperties(new r,t);return e.prototype=f,f.constructor=e,n.noRegister||t.setCtor(e),f}t.exports=i;var r=e(14),s=e(19),o=e(21),u=o.b;i.defineProperties=function(e,t){var n={$type:{value:t}};return t.getFieldsArray().forEach(function(t){t.resolve(),o.isObject(t.defaultValue)||(e[t.name]=t.defaultValue)}),t.getOneofsArray().forEach(function(t){o.prop(e,t.resolve().name,{get:function(){for(var e=t.oneof,n=0;n<e.length;++n){var i=t.parent.fields[e[n]];if(this[e[n]]!=i.defaultValue)return e[n]}},set:function(e){for(var n=t.oneof,i=0;i<n.length;++i)n[i]!==e&&delete this[n[i]]}})}),o.props(e,n),e}},{14:14,19:19,21:21}],8:[function(e,t,n){"use strict";function i(e,t,n,i,s){if(r.call(this,e,t,i,s),!f.isString(n))throw f.b("keyType");this.keyType=n,this.resolvedKeyType=null,this.map=!0}t.exports=i;var r=e(6),s=r.prototype,o=r.extend(i),u=e(5),a=e(20),f=e(21);i.testJSON=function(e){return r.testJSON(e)&&void 0!==e.keyType},i.fromJSON=function(e,t){return new i(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;var e=a.mapKey[this.keyType];if(void 0===e){var t=this.parent.lookup(this.keyType);if(!(t instanceof u))throw Error("unresolvable map key type: "+this.keyType);this.resolvedKeyType=t}return s.resolve.call(this)}},{20:20,21:21,5:5,6:6}],9:[function(e,t,n){"use strict";function i(e,t,n,i,s,o,f){if(u.isObject(s)?(f=s,s=o=void 0):u.isObject(o)&&(f=o,o=void 0),!u.isString(t))throw a("type");if(!u.isString(n))throw a("requestType");if(!u.isString(i))throw a("responseType");r.call(this,e,f),this.type=t||"rpc",this.requestType=n,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null}t.exports=i;var r=e(11),s=r.extend(i),o=e(19),u=e(21),a=u.b;i.testJSON=function(e){return Boolean(e&&void 0!==e.requestType)},i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options)},s.toJSON=function(){return{type:"rpc"!==this.type&&this.type||void 0,requestType:this.requestType,requestStream:this.requestStream,responseType:this.responseType,responseStream:this.responseStream,options:this.options}},s.resolve=function(){if(this.resolved)return this;var e=this.parent.lookup(this.requestType);if(!(e&&e instanceof o))throw Error("unresolvable request type: "+this.requestType);if(this.resolvedRequestType=e,e=this.parent.lookup(this.responseType),!(e&&e instanceof o))throw Error("unresolvable response type: "+this.requestType);return this.resolvedResponseType=e,r.prototype.resolve.call(this)}},{11:11,19:19,21:21}],10:[function(e,t,n){"use strict";function i(e,t){o.call(this,e,t),this.nested=void 0,this.d=null}function r(e){return e.d=null,e}function s(e){if(e&&e.length){for(var t={},n=0;n<e.length;++n)t[e[n].name]=e[n].toJSON();return t}}t.exports=i;var o=e(11),u=o.extend(i),a=e(5),f=e(19),h=e(6),l=e(17),c=e(21),d=c.b,p=[a,f,l,h,i],v="one of "+p.map(function(e){return e.name}).join(", ");c.props(u,{nestedArray:{get:function(){return this.d||(this.d=c.toArray(this.nested))}}}),i.testJSON=function(e){return Boolean(e&&!e.fields&&!e.values&&void 0===e.id&&!e.oneof&&!e.methods&&void 0===e.requestType)},i.fromJSON=function(e,t){return new i(e,t.options).addJSON(t.nested)},u.toJSON=function(){return{options:this.options,nested:s(this.getNestedArray())}},i.arrayToJSON=s,u.addJSON=function(e){var t=this;return e&&Object.keys(e).forEach(function(n){for(var i=e[n],r=0;r<p.length;++r)if(p[r].testJSON(i))return t.add(p[r].fromJSON(n,i));throw d("nested."+n,"JSON for "+v)}),this},u.get=function(e){return void 0===this.nested?null:this.nested[e]||null},u.add=function(e){if(!e||p.indexOf(e.constructor)<0)throw d("object",v);if(e instanceof h&&void 0===e.extend)throw d("object","an extension field when not part of a type");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof i&&e instanceof i)||t instanceof f||t instanceof l)throw Error("duplicate name '"+e.name+"' in "+this);for(var n=t.getNestedArray(),s=0;s<n.length;++s)e.add(n[s]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),r(this)},u.remove=function(e){if(!(e instanceof o))throw d("object","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=void 0),e.onRemove(this),r(this)},u.define=function(e,t){c.isString(e)?e=e.split("."):Array.isArray(e)||(t=e,e=void 0);var n=this;if(e)for(;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(n=n.nested[r],!(n instanceof i))throw Error("path conflicts with non-namespace objects")}else n.add(n=new i(r))}return t&&n.addJSON(t),n},u.resolveAll=function(){for(var e=this.getNestedArray(),t=0;t<e.length;)e[t]instanceof i?e[t++].resolveAll():e[t++].resolve();return o.prototype.resolve.call(this)},u.lookup=function(e,t){if(c.isString(e)){if(!e.length)return null;e=e.split(".")}else if(!e.length)return null;if(""===e[0])return this.getRoot().lookup(e.slice(1));var n=this.get(e[0]);return n&&(1===e.length||n instanceof i&&(n=n.lookup(e.slice(1),!0)))?n:null===this.parent||t?null:this.parent.lookup(e)}},{11:11,17:17,19:19,21:21,5:5,6:6}],11:[function(e,t,n){"use strict";function i(e,t){if(!o.isString(e))throw u("name");if(t&&!o.isObject(t))throw u("options","an object");this.options=t,this.name=e,this.parent=null,this.resolved=!1}function r(e){var t=e.prototype=Object.create(this.prototype);return t.constructor=e,e.extend=r,t}t.exports=i,i.extend=r;var s=e(16),o=e(21),u=o.b,a=i.prototype;o.props(a,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:a.getFullName=function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),a.toJSON=function(){throw Error()},a.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.getRoot();t instanceof s&&t.e(this)},a.onRemove=function(e){var t=e.getRoot();t instanceof s&&t.f(this),this.parent=null,this.resolved=!1},a.resolve=function(){if(this.resolved)return this;var e=this.getRoot();return e instanceof s&&(this.resolved=!0),this},a.getOption=function(e){if(this.options)return this.options[e]},a.setOption=function(e,t,n){return n&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},a.setOptions=function(e,t){return e&&Object.keys(e).forEach(function(n){this.setOption(n,e[n],t)},this),this},a.toString=function(){return this.constructor.name+" "+this.getFullName()}},{16:16,21:21}],12:[function(e,t,n){"use strict";function i(e,t,n){if(Array.isArray(t)||(n=t,t=void 0),s.call(this,e,n),t&&!Array.isArray(t))throw f("fieldNames","an Array");this.ucName=this.name.substring(0,1).toUpperCase()+this.name.substring(1),this.oneof=t||[],this.g=[]}function r(e){e.parent&&e.g.forEach(function(t){t.parent||e.parent.add(t)})}t.exports=i;var s=e(11),o=s.extend(i),u=e(6),a=e(21),f=a.b;i.testJSON=function(e){return Boolean(e.oneof)},i.fromJSON=function(e,t){return new i(e,t.oneof,t.options)},o.toJSON=function(){return{oneof:this.oneof,options:this.options}},o.add=function(e){if(!(e instanceof u))throw f("field","a Field");return e.parent&&e.parent.remove(e),this.oneof.push(e.name),this.g.push(e),e.partOf=this,r(this),this},o.remove=function(e){if(!(e instanceof u))throw f("field","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.parent&&e.parent.remove(e),e.partOf=null,this},o.onAdd=function(e){s.prototype.onAdd.call(this,e),r(this)},o.onRemove=function(e){this.g.forEach(function(e){e.parent&&e.parent.remove(e)}),s.prototype.onRemove.call(this,e)}},{11:11,21:21,6:6}],13:[function(e,t,n){"use strict";function i(e){return null===e?null:e.toLowerCase()}function r(e){return e.substring(0,1)+e.substring(1).replace(/_([a-z])(?=[a-z]|$)/g,function(e,t){return t.toUpperCase()})}function s(e,t){function n(e,t){return Error("illegal "+(t||"token")+" '"+e+"' (line "+ie.line()+j)}function s(){var e,t=[];do{if((e=re())!==E&&e!==B)throw n(e);t.push(re()),ue(e),e=oe()}while(e===E||e===B);return t.join("")}function J(e){var t=re();switch(i(t)){case B:case E:return se(t),s();case"true":return!0;case"false":return!1}try{return V(t)}catch(i){if(e&&g.test(t))return t;throw n(t,"value")}}function q(){var e=L(re()),t=e;return ue("to",!0)&&(t=L(re())),ue(F),[e,t]}function V(e){var t=1;"-"===e.charAt(0)&&(t=-1,e=e.substring(1));var r=i(e);switch(r){case"inf":return t*(1/0);case"nan":return NaN;case"0":return 0}if(/^[1-9][0-9]*$/.test(e))return t*parseInt(e,10);if(/^0[x][0-9a-f]+$/.test(r))return t*parseInt(e,16);if(/^0[0-7]+$/.test(e))return t*parseInt(e,8);if(/^(?!e)[0-9]*(?:\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(r))return t*parseFloat(e);throw n(e,"number")}function L(e,t){var r=i(e);switch(r){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===e.charAt(0)&&!t)throw n(e,"id");if(/^-?[1-9][0-9]*$/.test(e))return parseInt(e,10);if(/^-?0[x][0-9a-f]+$/.test(r))return parseInt(e,16);if(/^-?0[0-7]+$/.test(e))return parseInt(e,8);throw n(e,"id")}function z(){if(void 0!==Y)throw n("package");if(Y=re(),!g.test(Y))throw n(Y,x);le=le.define(Y),ue(F)}function R(){var e,t=oe();switch(t){case"weak":e=te||(te=[]),re();break;case"public":re();default:e=ee||(ee=[])}t=s(),ue(F),e.push(t)}function $(){ue("="),ne=i(s());var e;if(["proto2",e="proto3"].indexOf(ne)<0)throw n(ne,"syntax");fe=ne===e,ue(F)}function I(e,t){switch(t){case O:return K(e,t),ue(F),!0;case"message":return C(e,t),!0;case"enum":return D(e,t),!0;case"service":return G(e,t),!0;case"extend":return Q(e,t),!0}return!1}function C(e,t){var r=re();if(!y.test(r))throw n(r,"type name");var s=new a(r);if(ue(A,!0)){for(;(t=re())!==T;){var o=i(t);if(!I(s,t))switch(o){case"map":M(s,o);break;case w:case k:case b:P(s,o);break;case"oneof":U(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(q(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(q(s,o));break;default:if(!fe||!g.test(t))throw n(t);se(t),P(s,k)}}ue(F,!0)}else ue(F);e.add(s)}function P(e,t,i){var s=re();if(!g.test(s))throw n(s,N);var o=re();if(!y.test(o))throw n(o,x);o=r(o),ue("=");var u=L(re()),a=Z(new f(o,u,s,t,i));a.repeated&&a.setOption("packed",fe,!0),e.add(a)}function M(e){ue("<");var t=re();if(void 0===v.mapKey[t])throw n(t,N);ue(",");var i=re();if(!g.test(i))throw n(i,N);ue(">");var s=re();if(!y.test(s))throw n(s,x);s=r(s),ue("=");var o=L(re()),u=Z(new h(s,o,t,i));e.add(u)}function U(e,t){var i=re();if(!y.test(i))throw n(i,x);i=r(i);var s=new l(i);if(ue(A,!0)){for(;(t=re())!==T;)t===O?(K(s,t),ue(F)):(se(t),P(s,k));ue(F,!0)}else ue(F);e.add(s)}function D(e,t){var r=re();if(!y.test(r))throw n(r,x);var s={},o=new c(r,s);if(ue(A,!0)){for(;(t=re())!==T;)i(t)===O?K(o):_(o,t);ue(F,!0)}else ue(F);e.add(o)}function _(e,t){if(!y.test(t))throw n(t,x);var i=t;ue("=");var r=L(re(),!0);e.values[i]=r,Z({})}function K(e,t){var i=ue(S,!0),r=re();if(!g.test(r))throw n(r,x);i&&(ue(j),r=S+r+j,t=oe(),m.test(t)&&(r+=t,re())),ue("="),H(e,r)}function H(e,t){if(ue(A,!0)){for(;(he=re())!==T;){if(!y.test(he))throw n(he,x);t=t+"."+he,ue(":",!0)?W(e,t,J(!0)):H(e,t)}ue(F,!0)}else W(e,t,J(!0))}function W(e,t,n){e.setOption?e.setOption(t,n):e[t]=n}function Z(e){if(ue("[",!0)){do K(e,O);while(ue(",",!0));ue("]")}return ue(F),e}function G(e,t){if(t=re(),!y.test(t))throw n(t,"service name");var r=t,s=new d(r);if(ue(A,!0)){for(;(t=re())!==T;){var o=i(t);switch(o){case O:K(s,o),ue(F);break;case"rpc":X(s,o);break;default:throw n(t)}}ue(F,!0)}else ue(F);e.add(s)}function X(e,t){var r=t,s=re();if(!y.test(s))throw n(s,x);var o,u,a,f;ue(S);var h;if(ue(h="stream",!0)&&(u=!0),!g.test(t=re()))throw n(t);if(o=t,ue(j),ue("returns"),ue(S),ue(h,!0)&&(f=!0),!g.test(t=re()))throw n(t);a=t,ue(j);var l=new p(s,r,o,a,u,f);if(ue(A,!0)){for(;(t=re())!==T;){var c=i(t);switch(c){case O:K(l,c),ue(F);break;default:throw n(t)}}ue(F,!0)}else ue(F);e.add(l)}function Q(e,t){var r=re();if(!g.test(r))throw n(r,"reference");if(ue(A,!0)){for(;(t=re())!==T;){var s=i(t);switch(s){case w:case b:case k:P(e,s,r);break;default:if(!fe||!g.test(t))throw n(t);se(t),P(e,k,r)}}ue(F,!0)}else ue(F)}t||(t=new u);var Y,ee,te,ne,ie=o(e),re=ie.next,se=ie.push,oe=ie.peek,ue=ie.skip,ae=!0,fe=!1;t||(t=new u);for(var he,le=t;null!==(he=re());){var ce=i(he);switch(ce){case"package":if(!ae)throw n(he);z();break;case"import":if(!ae)throw n(he);R();break;case"syntax":if(!ae)throw n(he);$();break;case O:if(!ae)throw n(he);K(le,he),ue(F);break;default:if(I(le,he)){ae=!1;continue}throw n(he)}}return{package:Y,imports:ee,weakImports:te,syntax:ne,root:t}}t.exports=s;var o=e(18),u=e(16),a=e(19),f=e(6),h=e(8),l=e(12),c=e(5),d=e(17),p=e(9),v=e(20),y=/^[a-zA-Z_][a-zA-Z_0-9]*$/,g=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,m=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,w="required",b="repeated",k="optional",O="option",x="name",N="type",A="{",T="}",S="(",j=")",F=";",E='"',B="'"},{12:12,16:16,17:17,18:18,19:19,20:20,5:5,6:6,8:8,9:9}],14:[function(e,t,n){"use strict";function i(e,t){if(e)for(var n=!(t&&t.fieldsOnly),i=this.constructor.$type.fields,r=Object.keys(e),s=0;s<r.length;++s){var o=i[r[s]];o&&o.partOf&&this["set"+o.partOf.ucName](o.name),(o||n)&&(this[r[s]]=e[r[s]])}}t.exports=i,i.prototype.asJSON=function(e){for(var t,n=!(e&&e.fieldsOnly),i=this.constructor.$type.fields,r={},s=Object.keys(this),o=0;o<s.length;++o){var u=i[t=s[o]],a=this[t];if(u)if(u.repeated){if(a&&a.length){for(var f=new Array(a.length),h=0,l=a.length;h<l;++h)f[h]=u.jsonConvert(a[h],e);r[t]=f}}else r[t]=u.jsonConvert(a,e);else n&&(r[t]=a)}return r}},{}],15:[function(e,t,n){"use strict";function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function r(){O.Long?(T.int64=a,T.uint64=h,T.sint64=c,T.fixed64=v,T.sfixed64=g):(T.int64=f,T.uint64=l,T.sint64=d,T.fixed64=y,T.sfixed64=m)}function s(e){return this instanceof s?(this.buf=e,this.pos=0,void(this.len=e.length)):O.Buffer&&(!e||O.Buffer.isBuffer(e))&&new w(e)||new s(e)}function o(e,t){this.id=e,this.wireType=t}function u(){var e=0,t=0,n=0,r=0;if(this.len-this.pos>9){for(n=0;n<4;++n)if(r=this.buf[this.pos++],e|=(127&r)<<7*n,r<128)return new N(e>>>0,t>>>0);if(r=this.buf[this.pos++],e|=(127&r)<<28,t|=(127&r)>>4,r<128)return new N(e>>>0,t>>>0);for(n=0;n<5;++n)if(r=this.buf[this.pos++],t|=(127&r)<<7*n+3,r<128)return new N(e>>>0,t>>>0)}else{for(n=0;n<4;++n){if(this.pos>=this.len)throw i(this);if(r=this.buf[this.pos++],e|=(127&r)<<7*n,r<128)return new N(e>>>0,t>>>0)}if(this.pos>=this.len)throw i(this);if(r=this.buf[this.pos++],e|=(127&r)<<28,t|=(127&r)>>4,r<128)return new N(e>>>0,t>>>0);for(n=0;n<5;++n){if(this.pos>=this.len)throw i(this);if(r=this.buf[this.pos++],t|=(127&r)<<7*n+3,r<128)return new N(e>>>0,t>>>0)}}throw Error("invalid varint encoding")}function a(){return u.call(this).toLong()}function f(){return u.call(this).toNumber()}function h(){return u.call(this).toLong(!0)}function l(){return u.call(this).toNumber(!0)}function c(){return u.call(this).zzDecode().toLong()}function d(){return u.call(this).zzDecode().toNumber()}function p(){if(this.pos+8>this.len)throw i(this,8);return new N((this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0,(this.buf[this.pos++]|this.buf[this.pos++]<<8|this.buf[this.pos++]<<16|this.buf[this.pos++]<<24)>>>0)}function v(){return p.call(this).toLong(!0)}function y(){return p.call(this).toNumber(!0)}function g(){return p.call(this).zzDecode().toLong()}function m(){return p.call(this).zzDecode().toNumber()}function w(e){F&&F(),s.call(this,e)}function b(e,t,n){return e.utf8Slice(t,n)}function k(e,t,n){return e.toString("utf8",t,n)}t.exports=s,s.BufferReader=w;var O=e(24),x=e(1),N=O.LongBits,A="undefined"!=typeof Uint8Array?Uint8Array:Array;s.configure=r;var T=s.prototype;T.h=A.prototype.slice||A.prototype.subarray,T.tag=function(){if(this.pos>=this.len)throw i(this);return new o(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},T.int32=function(){var e=0,t=0,n=0;do{if(this.pos>=this.len)throw i(this);if(n=this.buf[this.pos++],t<29)e|=(127&n)<<t;else if(t>63)throw Error("invalid varint encoding");t+=7}while(128&n);return e},T.uint32=function(){return this.int32()>>>0},T.sint32=function(){var e=this.int32();return e>>>1^-(1&e)},T.bool=function(){return 0!==this.int32()},T.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return this.pos+=4,this.buf[this.pos-4]|this.buf[this.pos-3]<<8|this.buf[this.pos-2]<<16|this.buf[this.pos-1]<<24},T.sfixed32=function(){var e=this.fixed32();return e>>>1^-(1&e)};var S="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(n,i){return t[0]=n[i++],t[1]=n[i++],t[2]=n[i++],t[3]=n[i],e[0]}:function(n,i){return t[3]=n[i++],t[2]=n[i++],t[1]=n[i++],t[0]=n[i],e[0]}}():function(e,t){return x.read(e,t,!1,23,4)};T.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=S(this.buf,this.pos);return this.pos+=4,e};var j="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(n,i){return 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]=n[i],e[0]}:function(n,i){return 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]=n[i],e[0]}}():function(e,t){return x.read(e,t,!1,52,8)};T.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=j(this.buf,this.pos);return this.pos+=8,e},T.bytes=function(){var e=this.int32()>>>0,t=this.pos,n=this.pos+e;if(n>this.len)throw i(this,e);return this.pos+=e,t===n?new this.buf.constructor(0):this.h.call(this.buf,t,n)},T.string=function(){var e=this.bytes(),t=e.length;if(t){for(var n=new Array(t),i=0,r=0;i<t;){var s=e[i++];if(s<128)n[r++]=s;else if(s>191&&s<224)n[r++]=(31&s)<<6|63&e[i++];else if(s>239&&s<365){var o=((7&s)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536;n[r++]=55296+(o>>10),n[r++]=56320+(1023&o)}else n[r++]=(15&s)<<12|(63&e[i++])<<6|63&e[i++]}return String.fromCharCode.apply(String,n.slice(0,r))}return""},T.skip=function(e){if(void 0===e){do if(this.pos>=this.len)throw i(this);while(128&this.buf[this.pos++])}else{if(this.pos+e>this.len)throw i(this,e);this.pos+=e}return this},T.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(;;){var t=this.tag();if(4===t.wireType)break;this.skipType(t.wireType)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type: "+e)}return this},T.reset=function(e){return e?(this.buf=e,this.len=e.length):(this.buf=null,this.len=0),this.pos=0,this},T.finish=function(e){var t=this.pos?this.h.call(this.buf,this.pos):this.buf;return this.reset(e),t};var F=function(){if(!O.Buffer)throw Error("Buffer is not supported");E.h=O.Buffer.prototype.slice,B=O.Buffer.prototype.utf8Slice?b:k,F=!1},E=w.prototype=Object.create(s.prototype);E.constructor=w,"undefined"==typeof Float32Array&&(E.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=this.buf.readFloatLE(this.pos,!0);return this.pos+=4,e}),"undefined"==typeof Float64Array&&(E.double=function(){if(this.pos+8>this.len)throw i(this,8);var e=this.buf.readDoubleLE(this.pos,!0);return this.pos+=8,e});var B;E.string=function(){var e=this.int32()>>>0,t=this.pos,n=this.pos+e;if(n>this.len)throw i(this,e);return this.pos+=e,B(this.buf,t,n)},E.finish=function(e){var t=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(e),t},r()},{1:1,24:24}],16:[function(e,t,n){"use strict";function i(e){s.call(this,"",e),this.deferred=[],this.files=[]}function r(e){var t=e.parent.lookup(e.extend);if(t){var n=new u(e.getFullName(),e.id,e.type,e.rule,(void 0),e.options);return n.declaringField=e,e.extensionField=n,t.add(n),!0}return!1}t.exports=i;var s=e(10),o=s.extend(i),u=e(6),a=e(21),f=e(2);i.fromJSON=function(e,t){return t||(t=new i),t.setOptions(e.options).addJSON(e.nested)},o.resolvePath=a.resolvePath,o.load=function t(n,i){function r(e,t){if(i){var n=i;i=null,n(e,t)}}function s(t,n){try{if(a.isString(n)&&"{"===n.charAt(0)&&(n=JSON.parse(n)),a.isString(n)){var i=e(13)(n,u);i.imports&&i.imports.forEach(function(e){o(u.resolvePath(t,e))}),i.weakImports&&i.weakImports.forEach(function(e){o(u.resolvePath(t,e),!0)})}else u.setOptions(n.options).addJSON(n.nested)}catch(e){return void r(e)}h||r(null,u)}function o(e,t){var n=e.indexOf("google/protobuf/");if(n>-1){var o=e.substring(n);o in f&&(e=o)}if(!(u.files.indexOf(e)>-1)){if(u.files.push(e),e in f)return++h,void setTimeout(function(){--h,s(e,f[e])});++h,a.fetch(e,function(n,o){if(--h,i)return n?void(t||r(n)):void s(e,o)})}}var u=this;if(!i)return a.asPromise(t,u,n);var h=0;a.isString(n)&&(n=[n]),n.forEach(function(e){o(u.resolvePath("",e))}),h||r(null)},o.e=function(e){var t=this.deferred.slice();this.deferred=[];for(var n=0;n<t.length;)r(t[n])?t.splice(n,1):++n;if(this.deferred=t,e instanceof u&&void 0!==e.extend&&!e.extensionField&&!r(e)&&this.deferred.indexOf(e)<0)this.deferred.push(e);else if(e instanceof s){var i=e.getNestedArray();
for(n=0;n<i.length;++n)this.e(i[n])}},o.f=function(e){if(e instanceof u){if(void 0!==e.extend&&!e.extensionField){var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}e.extensionField&&(e.extensionField.parent.remove(e.extensionField),e.extensionField=null)}else if(e instanceof s)for(var n=e.getNestedArray(),i=0;i<n.length;++i)this.f(n[i])},o.toString=function(){return this.constructor.name}},{10:10,13:13,2:2,21:21,6:6}],17:[function(e,t,n){"use strict";function i(e,t){s.call(this,e,t),this.methods={},this.i=null}function r(e){return e.i=null,e}t.exports=i;var s=e(10),o=s.prototype,u=s.extend(i),a=e(9),f=e(21);f.props(u,{methodsArray:{get:function(){return this.i||(this.i=f.toArray(this.methods))}}}),i.testJSON=function(e){return Boolean(e&&e.methods)},i.fromJSON=function(e,t){var n=new i(e,t.options);return t.methods&&Object.keys(t.methods).forEach(function(e){n.add(a.fromJSON(e,t.methods[e]))}),n},u.toJSON=function(){var e=o.toJSON.call(this);return{options:e&&e.options||void 0,methods:s.arrayToJSON(this.getMethodsArray())||{},nested:e&&e.nested||void 0}},u.get=function(e){return o.get.call(this,e)||this.methods[e]||null},u.resolveAll=function(){for(var e=this.getMethodsArray(),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 a?(this.methods[e.name]=e,e.parent=this,r(this)):o.add.call(this,e)},u.remove=function(e){if(e instanceof a){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,r(this)}return o.remove.call(this,e)},u.create=function(e,t,n){var i={};return f.prop(i,"$rpc",{value:e}),this.getMethodsArray().forEach(function(r){var s=r.name.substring(0,1).toLowerCase()+r.name.substring(1);i[s]=function(i,s){r.resolve();var o;try{o=(t&&r.resolvedRequestType.encodeDelimited(i)||r.resolvedRequestType.encode(i)).finish()}catch(e){return void("function"==typeof setImmediate&&setImmediate||setTimeout)(function(){s(e)})}e(r,o,function(e,t){if(e)return void s(e);var i;try{i=n&&r.resolvedResponseType.decodeDelimited(t)||r.resolvedResponseType.decode(t)}catch(e){return void s(e)}s(null,i)})}}),i}},{10:10,21:21,9:9}],18:[function(e,t,n){"use strict";function i(e){return e.replace(/\\(.?)/g,function(e,t){switch(t){case"\\":case"":return t;case"0":return"\0";default:return t}})}function r(e){function t(e){return Error("illegal "+e+" (line "+g+")")}function n(){var n='"'===w?o:u;n.lastIndex=v-1;var r=n.exec(e);if(!r)throw t("string");return v=n.lastIndex,c(w),w=null,i(r[1])}function r(t){return e.charAt(t)}function l(){if(m.length>0)return m.shift();if(w)return n();var i,o,u;do{if(v===y)return null;for(i=!1;/\s/.test(u=r(v));)if(u===a&&++g,++v===y)return null;if(r(v)===f){if(++v===y)throw t("comment");if(r(v)===f){for(;r(++v)!==a;)if(v===y)return null;++v,++g,i=!0}else{if((u=r(v))!==h)return f;do{if(u===a&&++g,++v===y)return null;o=u,u=r(v)}while(o!==h||u!==f);++v,i=!0}}}while(i);if(v===y)return null;var l=v;s.lastIndex=0;var c=s.test(r(l++));if(!c)for(;l<y&&!s.test(r(l));)++l;var d=e.substring(v,v=l);return'"'!==d&&"'"!==d||(w=d),d}function c(e){m.push(e)}function d(){if(!m.length){var e=l();if(null===e)return null;c(e)}return m[0]}function p(e,n){var i=d(),r=i===e;if(r)return l(),!0;if(!n)throw t("token '"+i+"', '"+e+"' expected");return!1}e=e.toString();var v=0,y=e.length,g=1,m=[],w=null;return{line:function(){return g},next:l,peek:d,push:c,skip:p}}t.exports=r;var s=/[\s{}=;:[\],'"()<>]/g,o=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,u=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a="\n",f="/",h="*"},{}],19:[function(e,t,n){"use strict";function i(e,t){s.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.j=null,this.k=null,this.l=null,this.m=null}function r(e){return e.j=e.k=e.l=e.m=null,delete e.encode,delete e.decode,e}t.exports=i;var s=e(10),o=s.prototype,u=s.extend(i),a=e(5),f=e(12),h=e(6),l=e(17),c=e(14),d=e(15),p=e(26),v=e(4),y=e(3),g=e(25),m=e(7),w=e(21),b=w.codegen;w.props(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 n=this.fields[e[t]],i=n.id;if(this.j[i])throw Error("duplicate id "+i+" in "+this);this.j[i]=n}return this.j}},fieldsArray:{get:u.getFieldsArray=function(){return this.k||(this.k=w.toArray(this.fields))}},oneofsArray:{get:u.getOneofsArray=function(){return this.l||(this.l=w.toArray(this.oneofs))}},ctor:{get:u.getCtor=function(){if(this.m)return this.m;var e;return e=b.supported?b("p")("P.call(this,p)").eof(this.getFullName()+"$ctor",{P:c}):function(e){c.call(this,e)},e.prototype=m(e,this),this.m=e,e},set:u.setCtor=function(e){if(e&&!(e.prototype instanceof c))throw w.b("ctor","a constructor inheriting from Prototype");this.m=e}}}),i.testJSON=function(e){return Boolean(e&&e.fields)};var k=[a,i,h,l];i.fromJSON=function(e,t){var n=new i(e,t.options);return n.extensions=t.extensions,n.reserved=t.reserved,t.fields&&Object.keys(t.fields).forEach(function(e){n.add(h.fromJSON(e,t.fields[e]))}),t.oneofs&&Object.keys(t.oneofs).forEach(function(e){n.add(f.fromJSON(e,t.oneofs[e]))}),t.nested&&Object.keys(t.nested).forEach(function(e){for(var i=t.nested[e],r=0;r<k.length;++r)if(k[r].testJSON(i))return void n.add(k[r].fromJSON(e,i));throw Error("invalid nested object in "+n+": "+e)}),t.extensions&&t.extensions.length&&(n.extensions=t.extensions),t.reserved&&t.reserved.length&&(n.reserved=t.reserved),n},u.toJSON=function(){var e=o.toJSON.call(this);return{options:e&&e.options||void 0,oneofs:s.arrayToJSON(this.getOneofsArray()),fields:s.arrayToJSON(this.getFieldsArray().filter(function(e){return!e.declaringField}))||{},extensions:this.extensions&&this.extensions.length?this.extensions:void 0,reserved:this.reserved&&this.reserved.length?this.reserved:void 0,nested:e&&e.nested||void 0}},u.resolveAll=function(){for(var e=this.getFieldsArray(),t=0;t<e.length;)e[t++].resolve();var n=this.getOneofsArray();for(t=0;t<n.length;)n[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&&void 0===e.extend){if(this.getFieldsById()[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),r(this)}return e instanceof f?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),r(this)):o.add.call(this,e)},u.remove=function(e){if(e instanceof h&&void 0===e.extend){if(this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.message=null,r(this)}return o.remove.call(this,e)},u.create=function(e,t){if("function"==typeof e)t=e,e=void 0;else if(e instanceof c)return e;if(t){if(!(t.prototype instanceof c))throw w.b("ctor","a constructor inheriting from Prototype")}else t=this.getCtor();return new t(e)},u.encode=function(e,t){return(this.encode=b.supported?v.generate(this).eof(this.getFullName()+"$encode",{Writer:p,types:this.getFieldsArray().map(function(e){return e.resolvedType}),util:w}):v.fallback).call(this,e,t)},u.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},u.decode=function(e,t){return(this.decode=b.supported?y.generate(this).eof(this.getFullName()+"$decode",{Reader:d,types:this.getFieldsArray().map(function(e){return e.resolvedType}),util:w}):y.fallback).call(this,e,t)},u.decodeDelimited=function(e){return e=e instanceof d?e:d(e),this.decode(e,e.uint32())},u.verify=function(e){return(this.verify=b.supported?g.generate(this).eof(this.getFullName()+"$verify",{types:this.getFieldsArray().map(function(e){return e.resolvedType})}):g.fallback).call(this,e)}},{10:10,12:12,14:14,15:15,17:17,21:21,25:25,26:26,3:3,4:4,5:5,6:6,7:7}],20:[function(e,t,n){"use strict";function i(e,t){var n=0,i={};for(t|=0;n<e.length;)i[s[n+t]]=e[n++];return i}var r=n,s=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];r.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);var o=[];Object.freeze&&Object.freeze(o),r.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o]),r.long=i([0,0,0,1,1],7),r.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])},{}],21:[function(e,t,n){"use strict";function i(e){return"string"==typeof e||e instanceof String}function r(e,t){for(var n=[],i=2;i<arguments.length;++i)n.push(arguments[i]);return new Promise(function(i,r){e.apply(t,n.concat(function(e){e?r(e):i.apply(null,Array.prototype.slice.call(arguments,1))}))})}function s(t,n){function o(){return 0!==f.status&&200!==f.status?n(Error("status "+f.status)):i(f.responseText)?n(null,f.responseText):n(Error("request failed"))}if(!n)return r(s,a,t);var u;try{u=e("fs")}catch(e){}if(u&&u.readFile)return u.readFile(t,"utf8",n);var f=new XMLHttpRequest;f.onreadystatechange=function(){4===f.readyState&&o()},f.open("GET",t,!0),f.send()}function o(e){return/^(?:\/|[a-zA-Z0-9]+:)/.test(e)}function u(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),n=o(e),i="";n&&(i=t.shift()+"/");for(var r=0;r<t.length;)".."===t[r]?r>0?t.splice(--r,2):n?t.splice(r,1):++r:"."===t[r]?t.splice(r,1):++r;return i+t.join("/")}var a=n;a.codegen=e(22),a.isString=i,a.isObject=function(e){return Boolean(e&&"object"==typeof e)},a.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},a.toArray=function(e){if(!e)return[];for(var t=Object.keys(e),n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=e[t[r]];return i},a.b=function(e,t){return TypeError(e+" must be "+(t||"a string"))},a.asPromise=r,a.fetch=s,a.isAbsolutePath=o,a.normalizePath=u,a.resolvePath=function(e,t,n){return n||(t=u(t)),o(t)?t:(n||(e=u(e)),e=e.replace(/(?:\/|^)[^\/]+$/,""),e.length?u(e+"/"+t):t)},a.merge=function(e,t,n){if(t)for(var i=Object.keys(t),r=0;r<i.length;++r)void 0!==e[i[r]]&&n||(e[i[r]]=t[i[r]]);return e},a.safeProp=function(e){return"['"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"']"},a.newBuffer=function(e){return e=e||0,a.Buffer?a.Buffer.allocUnsafe&&a.Buffer.allocUnsafe(e)||new a.Buffer(e):new("undefined"!=typeof Uint8Array&&Uint8Array||Array)(e)},a.merge(a,e(24))},{22:22,24:24,undefined:void 0}],22:[function(e,t,n){"use strict";function i(){function e(){for(var t=[],i=0;i<arguments.length;++i)t[i]=arguments[i];var l=e.fmt.apply(null,t),c=f;if(n.length){var d=n[n.length-1];r.test(d)?c=++f:u.test(d)&&++c,o.test(d)&&!o.test(l)?(c=++f,h=!0):h&&a.test(d)&&(c=--f,h=!1),s.test(l)&&(c=--f)}for(var p=0;p<c;++p)l="\t"+l;return n.push(l),e}var t=Array.prototype.slice.call(arguments),n=['\t"use strict"'],f=1,h=!1;return e.fmt=function(e){var t=Array.prototype.slice.call(arguments,1),n=0;return e.replace(/%([djs])/g,function(e,i){var r=t[n++];return"j"===i?JSON.stringify(r):String(r)})},e.str=function(e){return"function "+(e?e.replace(/[^\w_$]/g,"_"):"")+"("+t.join(",")+") {\n"+n.join("\n")+"\n}"},e.eof=function(t,n){t&&"object"==typeof t&&(n=t,t=void 0);var r=e.str(t);i.verbose&&console.log("--- codegen ---\n"+r.replace(/^/gm,"> ").replace(/\t/g," ")),r="return "+r;var s,o=[];Array.isArray(n)?s=n.slice():n?(s=Object.keys(n),o=s.map(function(e){return n[e]})):s=[];var u=Function.apply(null,s.concat(r));return o?u.apply(null,o):u()},e}t.exports=i;var r=/[{[]$/,s=/^[}\]]/,o=/:$/,u=/^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/,a=/\b(?:break|continue);?$|^\s*return\b/;i.supported=!1;try{i.supported=1===i("a","b")("return a-b").eof()(2,1)}catch(e){}i.verbose=!1},{}],23:[function(e,t,n){"use strict";function i(e,t){this.lo=e,this.hi=t}t.exports=i;var r=e(21),s=i.prototype,o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1},i.fromNumber=function(e){if(0===e)return o;var t=e<0;e=Math.abs(e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){switch(typeof e){case"number":return i.fromNumber(e);case"string":e=r.Long.fromString(e)}return(e.low||e.high)&&new i(e.low>>>0,e.high>>>0)||o},s.toNumber=function(e){return!e&&this.hi>>>31?(this.lo=~this.lo+1>>>0,this.hi=~this.hi>>>0,this.lo||(this.hi=this.hi+1>>>0),-(this.lo+4294967296*this.hi)):this.lo+4294967296*this.hi},s.toLong=function(e){return new r.Long(this.lo,this.hi,e)};var u=String.prototype.charCodeAt;i.fromHash=function(e){return new i((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)},s.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24&255,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24&255)},s.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},s.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},s.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<1<<21?3:4:t<16384?t<128?5:6:t<1<<21?7:8:n<128?9:10}},{21:21}],24:[function(e,t,n){(function(t){"use strict";var i=n,r=i.LongBits=e(23),s=i.isNode=Boolean(t.process&&t.process.versions&&t.process.versions.node);if(i.Buffer=null,s)try{i.Buffer=e("buffer").Buffer}catch(e){}if(i.Long=t.dcodeIO&&t.dcodeIO.Long||null,!i.Long&&s)try{i.Long=e("long")}catch(e){}i.longToHash=function(e){return e?r.from(e).toHash():"\0\0\0\0\0\0\0\0"},i.longFromHash=function(e,t){var n=r.fromHash(e);return i.Long?i.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},i.longNeq=function(e,t){return"number"==typeof e?"number"==typeof t?e!==t:(e=r.fromNumber(e)).lo!==t.low||e.hi!==t.high:"number"==typeof t?(t=r.fromNumber(t)).lo!==e.low||t.hi!==e.high:e.low!==t.low||e.high!==t.high},i.props=function(e,t){Object.keys(t).forEach(function(n){i.prop(e,n,t[n])})},i.prop=function(e,t,n){var i=!-[1],r=t.substring(0,1).toUpperCase()+t.substring(1);n.get&&(e["get"+r]=n.get),n.set&&(e["set"+r]=i?function(e){n.set.call(this,e),this[t]=e}:n.set),i?void 0!==n.value&&(e[t]=n.value):Object.defineProperty(e,t,n)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{23:23,buffer:"buffer",long:"long"}],25:[function(e,t,n){"use strict";var i=n,r=e(5),s=e(19),o=e(21);i.fallback=function(e){for(var t=this.getFieldsArray(),n=0;n<t.length;){var i=t[n++].resolve(),o=e[i.name];if(void 0===o){if(i.required)return"missing required field "+i.name+" in "+this.getFullName()}else{if(i.resolvedType instanceof r&&void 0===i.resolvedType.getValuesById()[o])return"invalid enum value "+i.name+" = "+o+" in "+this.getFullName();if(i.resolvedType instanceof s){if(!o&&i.required)return"missing required field "+i.name+" in "+this.getFullName();var u;if(null!==(u=i.resolvedType.verify(o)))return u}}}return null},i.generate=function(e){for(var t=e.getFieldsArray(),n=o.codegen("m"),i=!1,u=0;u<t.length;++u){var a=t[u].resolve(),f=o.safeProp(a.name);if(a.required)n("if(m%s===undefined)",f)("return 'missing required field %s in %s'",a.name,e.getFullName());else if(a.resolvedType instanceof r){var h=o.toArray(a.resolvedType.values);n("switch(m%s){",f)("default:")("return 'invalid enum value %s = '+m%s+' in %s'",a.name,f,e.getFullName());for(var l=0,c=h.length;l<c;++l)n("case %d:",h[l]);n("}")}else a.resolvedType instanceof s&&(a.required&&n("if(!m%s)",f)("return 'missing required field %s in %s'",a.name,e.getFullName()),i||(n("var r"),i=!0),n("if((r=types[%d].verify(m%s))!==null)",u,f)("return r"))}return n("return null")}},{19:19,21:21,5:5}],26:[function(e,t,n){"use strict";function i(e,t,n){this.fn=e,this.val=t,this.len=n,this.next=null}function r(){}function s(e,t){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=t}function o(){return this instanceof o?(this.len=0,this.head=new i(r,0,0),this.tail=this.head,void(this.states=null)):m.Buffer&&new p||new o}function u(e,t,n){e[t]=255&n}function a(e,t,n){for(;n>127;)e[t++]=127&n|128,n>>>=7;e[t]=n}function f(e,t,n){for(;n.hi;)e[t++]=127&n.lo|128,n.lo=(n.lo>>>7|n.hi<<25)>>>0,n.hi>>>=7;for(;n.lo>127;)e[t++]=127&n.lo|128,n.lo=(n.lo>>>7|n.hi<<25)>>>0;e[t++]=n.lo}function h(e,t,n){e[t++]=255&n,e[t++]=n>>>8&255,e[t++]=n>>>16&255,e[t]=n>>>24}function l(e,t,n){for(var i=0;i<n.length;++i){var r,s=n.charCodeAt(i);s<128?e[t++]=s:s<2048?(e[t++]=s>>6|192,e[t++]=63&s|128):55296===(64512&s)&&56320===(64512&(r=n.charCodeAt(i+1)))?(s=65536+((1023&s)<<10)+(1023&r),++i,e[t++]=s>>18|240,e[t++]=s>>12&63|128,e[t++]=s>>6&63|128,e[t++]=63&s|128):(e[t++]=s>>12|224,e[t++]=s>>6&63|128,e[t++]=63&s|128)}}function c(e){for(var t=e.length>>>0,n=0,i=0;i<t;++i){var r=e.charCodeAt(i);r<128?n+=1:r<2048?n+=2:55296===(64512&r)&&56320===(64512&e.charCodeAt(i+1))?(++i,n+=4):n+=3}return n}function d(e,t){for(var n=0;e;)e.fn(t,n,e.val),n+=e.len,e=e.next;return t}function p(){o.call(this)}function v(e,t,n){e.writeFloatLE(n,t,!0)}function y(e,t,n){e.writeDoubleLE(n,t,!0)}function g(e,t,n){n.length&&n.copy(e,t,0,n.length)}t.exports=o,o.BufferWriter=p;var m=e(24),w=e(1),b=m.LongBits,k="undefined"!=typeof Uint8Array?Uint8Array:Array;o.Op=i,o.State=s;var O=o.prototype;O.push=function(e,t,n){var r=new i(e,n,t);return this.tail.next=r,this.tail=r,this.len+=t,this},O.tag=function(e,t){return this.push(u,1,e<<3|7&t)},O.uint32=function(e){return e>>>=0,e<128?this.push(u,1,e):this.push(a,e<16384?2:e<2097152?3:e<268435456?4:5,e)},O.int32=function(e){return e<0?this.push(f,10,b.fromNumber(e)):this.uint32(e)},O.sint32=function(e){return this.uint32(e<<1^e>>31)},O.uint64=function(e){var t=b.from(e);return this.push(f,t.length(),t)},O.int64=O.uint64,O.sint64=function(e){var t=b.from(e).zzEncode();return this.push(f,t.length(),t)},O.bool=function(e){return this.push(u,1,e?1:0)},O.fixed32=function(e){return this.push(h,4,e>>>0)},O.sfixed32=function(e){return this.push(h,4,e<<1^e>>31)},O.fixed64=function(e){var t=b.from(e);return this.push(h,4,t.hi).push(h,4,t.lo)},O.sfixed64=function(e){var t=b.from(e).zzEncode();return this.push(h,4,t.hi).push(h,4,t.lo)};var x="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(n,i,r){e[0]=r,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3]}:function(n,i,r){e[0]=r,n[i++]=t[3],n[i++]=t[2],n[i++]=t[1],n[i]=t[0]}}():function(e,t,n){w.write(e,n,t,!1,23,4)};O.float=function(e){return this.push(x,4,e)};var N="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(n,i,r){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(n,i,r){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,n){w.write(e,n,t,!1,52,8)};O.double=function(e){return this.push(N,8,e)};var A=k.prototype.set?function(e,t,n){e.set(n,t)}:function(e,t,n){for(var i=0;i<n.length;++i)e[t+i]=n[i]};O.bytes=function(e){var t=e.length>>>0;return t?this.uint32(t).push(A,t,e):this.push(u,1,0)},O.string=function(e){var t=c(e);return t?this.uint32(t).push(l,t,e):this.push(u,1,0)},O.fork=function(){return this.states=new s(this,this.states),this.head=this.tail=new i(r,0,0),this.len=0,this},O.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 i(r,0,0),this.len=0),this},O.ldelim=function(e){var t=this.head,n=this.tail,i=this.len;return this.reset(),void 0!==e&&this.tag(e,2),this.uint32(i),this.tail.next=t.next,this.tail=n,this.len+=i,this},O.n=d,O.finish=function(){var e=this.head.next,t=new k(this.len);return this.reset(),d(e,t)};var T=p.prototype=Object.create(o.prototype);T.constructor=p,"undefined"==typeof Float32Array&&(T.float=function(e){return this.push(v,4,e)}),"undefined"==typeof Float64Array&&(T.double=function(e){return this.push(y,8,e)}),k.prototype.set&&m.Buffer&&m.Buffer.prototype.set||(T.bytes=function(e){var t=e.length>>>0;return t?this.uint32(t).push(g,t,e):this.push(u,1,0)});var S=function(){return m.Buffer&&m.Buffer.prototype.utf8Write?function(e,t,n){n.length<40?l(e,t,n):e.utf8Write(n,t)}:function(e,t,n){n.length<40?l(e,t,n):e.write(n,t)}}();T.string=function(e){var t=e.length<40?c(e):m.Buffer.byteLength(e);return t?this.uint32(t).push(S,t,e):this.push(u,1,0)},T.finish=function(){var e=this.head.next,t=m.Buffer.allocUnsafe&&m.Buffer.allocUnsafe(this.len)||new m.Buffer(this.len);return this.reset(),d(e,t)}},{1:1,24:24}],27:[function(e,t,n){(function(t){"use strict";function i(e,t,n){return"function"==typeof t?(n=t,t=new r.Root):t||(t=new r.Root),t.load(e,n)||r}var r=t.protobuf=n;r.load=i,r.tokenize=e(18),r.parse=e(13),r.Writer=e(26),r.BufferWriter=r.Writer.BufferWriter,r.Reader=e(15),r.BufferReader=r.Reader.BufferReader,r.encoder=e(4),r.decoder=e(3),r.verifier=e(25),r.ReflectionObject=e(11),r.Namespace=e(10),r.Root=e(16),r.Enum=e(5),r.Type=e(19),r.Field=e(6),r.OneOf=e(12),r.MapField=e(8),r.Service=e(17),r.Method=e(9),r.Prototype=e(14),r.inherits=e(7),r.types=e(20),r.common=e(2),r.util=e(21),"function"==typeof define&&define.amd&&define(["long"],function(e){return e&&(r.util.Long=e,r.Reader.configure()),r})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,2:2,20:20,21:21,25:25,26:26,3:3,4:4,5:5,6:6,7:7,8:8,9:9}]},{},[27]);
//# sourceMappingURL=protobuf.min.js.map

@@ -10,3 +10,3 @@ This folder contains prebuilt browser versions of [protobuf.js](https://github.com/dcodeIO/protobuf.js). When sending pull requests, it is not required to update these.

```
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.0/dist/protobuf.js"></script>
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1/dist/protobuf.js"></script>
```

@@ -16,3 +16,3 @@

```
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.0/dist/protobuf.min.js"></script>
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1/dist/protobuf.min.js"></script>
```

@@ -19,0 +19,0 @@

{
"name": "protobufjs",
"version": "6.0.1",
"version": "6.0.2",
"description": "Protocol Buffers for JavaScript.",

@@ -30,3 +30,3 @@ "author": "Daniel Wirtz",

"pages": "node scripts/pages",
"types": "jsdoc -c jsdoc.types.json && node scripts/types.js",
"types": "jsdoc -c jsdoc.types.json && node scripts/types.js && tsc types/test.ts --lib es2015 --noEmit",
"lint": "eslint src",

@@ -37,4 +37,6 @@ "test": "tape tests/*.js | tap-spec",

"bench": "node bench",
"bench-read": "node bench/read",
"bench-write": "node bench/write",
"all": "npm run lint && npm run test && npm run build && npm run types && npm run docs && npm run bench",
"prepublish": "node scripts/prepublish.js"
"prepublish": "node scripts/prepublish"
},

@@ -67,2 +69,3 @@ "optionalDependencies": {

"tsd-jsdoc": "dcodeIO/tsd-jsdoc",
"typescript": "^2.2.0-dev.20161202",
"vinyl-buffer": "^1.0.0",

@@ -69,0 +72,0 @@ "vinyl-fs": "^2.4.4",

@@ -15,2 +15,13 @@ protobuf.js [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![donate][paypal-image]][paypal-url]

**Recommended read:** [Changes in protobuf.js 6.0](https://github.com/dcodeIO/protobuf.js/wiki/Changes-in-protobuf.js-6.0)
Features
--------
* Optimized [for performance](#performance)
* Exhaustive [browser support](#compatibility)
* Managed [TypeScript definitions](#usage-with-typescript)
* Elaborate [API documentation](#documentation)
* Convenient [CLI utilities](#command-line)
* Seamless [browserify integration](#browserify-integration)
Contents

@@ -60,3 +71,3 @@ --------

```
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.0/dist/protobuf.js"></script>
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1/dist/protobuf.js"></script>
```

@@ -66,3 +77,3 @@

```
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.0/dist/protobuf.min.js"></script>
<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1/dist/protobuf.min.js"></script>
```

@@ -99,7 +110,7 @@

// Encode a message (note that reflection encodes to a writer and we need to call finish)
// Encode a message
var buffer = AwesomeMessage.encode(message).finish();
// ... do something with buffer
// Or, encode a plain object (note that reflection encodes to a writer and we need to call finish)
// Or, encode a plain object
var buffer = AwesomeMessage.encode({ awesomeField: "AwesomeString" }).finish();

@@ -111,2 +122,4 @@ // ... do something with buffer

// ... do something with message
// If your application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited.
});

@@ -153,17 +166,16 @@ ```

// Encode a message (note that classes encode to a buffer directly)
var buffer = AwesomeMessage.encode(message);
// ... do something with buffer
// Continue at "Encode a message" above
```
// Or, encode a plain object (note that classes encode to a buffer directly)
var buffer = AwesomeMessage.encode({ awesomeField: "AwesomeString" });
// ... do something with buffer
Custom classes are automatically populated with static `encode`, `encodeDelimited`, `decode`, `decodeDelimited` and `verify` methods and reference their reflected type via the `$type` property. Note that there are no methods (just `$type`) on instances by default as method names might conflict with field names.
// Decode a buffer
var message = AwesomeMessage.decode(buffer);
// ... do something with message
### Usage with TypeScript
```ts
/// <reference path="node_modules/protobufjs/types/protobuf.js.d.ts" />
import * as protobuf from "protobufjs";
...
```
Custom classes are automatically populated with static `encode`, `encodeDelimited`, `decode`, `decodeDelimited` and `verify` methods and reference their reflected type via the `$type` property. Note that there are no methods (just `$type`) on instances by default as method names might conflict with field names.
Module Structure

@@ -285,6 +297,11 @@ ----------------

-t, --target Specifies the target format. [json, proto2, proto3]
-t, --target Specifies the target format. [json, proto2, proto3, static]
Also accepts a path to require a custom target.
-p, --path Adds a directory to the include path.
-o, --out Saves to a file instead of writing to stdout.
-w, --wrap Specifies an alternative wrapper for the static target.
usage: pbjs [options] file1.proto file2.json ...

@@ -343,2 +360,11 @@ ```

### Browserify integration
protobuf.js integrates into any browserify build-process. There are a few possible tweaks:
* If performance is a concern or IE8 support is required, you should make sure to exclude the browserified `buffer` module and let protobuf.js do its thing with Uint8Array/Array instead.
* If you do not need int64 support, you can exclude the `long` module.
* If your application does not rely on the following modules and/or package size is a concern, you can also exclude `process` , `_process` and `fs`.
* If you have any special requirements, there is [the bundler](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/bundle.js) as a reference.
Performance

@@ -351,29 +377,29 @@ -----------

Type.encode to buffer x 402,572 ops/sec ±1.09% (90 runs sampled)
JSON.stringify to string x 342,004 ops/sec ±1.46% (82 runs sampled)
JSON.stringify to buffer x 184,468 ops/sec ±1.76% (79 runs sampled)
Type.encode to buffer x 469,818 ops/sec ±0.58% (89 runs sampled)
JSON.stringify to string x 309,883 ops/sec ±0.81% (92 runs sampled)
JSON.stringify to buffer x 174,440 ops/sec ±1.46% (87 runs sampled)
Type.encode to buffer was fastest
JSON.stringify to string was 15.4% slower
JSON.stringify to buffer was 54.5% slower
JSON.stringify to string was 34.2% slower
JSON.stringify to buffer was 63.2% slower
benchmarking decoding performance ...
Type.decode from buffer x 1,170,490 ops/sec ±1.49% (88 runs sampled)
JSON.parse from string x 328,975 ops/sec ±0.90% (88 runs sampled)
JSON.parse from buffer x 298,702 ops/sec ±0.82% (89 runs sampled)
Type.decode from buffer x 1,127,271 ops/sec ±0.76% (90 runs sampled)
JSON.parse from string x 295,445 ops/sec ±0.74% (92 runs sampled)
JSON.parse from buffer x 265,703 ops/sec ±0.85% (92 runs sampled)
Type.decode from buffer was fastest
JSON.parse from string was 71.7% slower
JSON.parse from buffer was 74.3% slower
JSON.parse from string was 73.8% slower
JSON.parse from buffer was 76.4% slower
benchmarking combined performance ...
Type to/from buffer x 218,688 ops/sec ±1.49% (90 runs sampled)
JSON to/from string x 144,634 ops/sec ±1.97% (87 runs sampled)
JSON to/from buffer x 102,350 ops/sec ±1.23% (92 runs sampled)
Type to/from buffer x 232,255 ops/sec ±0.99% (87 runs sampled)
JSON to/from string x 125,555 ops/sec ±1.01% (91 runs sampled)
JSON to/from buffer x 91,243 ops/sec ±0.83% (91 runs sampled)
Type to/from buffer was fastest
JSON to/from string was 34.2% slower
JSON to/from buffer was 53.1% slower
JSON to/from string was 46.0% slower
JSON to/from buffer was 60.7% slower
```

@@ -380,0 +406,0 @@

@@ -7,4 +7,4 @@ var fs = require("fs"),

var header = [
'/// <reference path="../node_modules/@types/node/index.d.ts" />',
'/// <reference path="../node_modules/@types/long/index.d.ts" />',
'/// <reference types="node" />',
'/// <reference types="long" />',
"",

@@ -22,2 +22,5 @@ "/*",

// Fix classes
dts = dts.replace(/\(\(\) => any\)/g, "any");
// Fix multidimensional arrays

@@ -36,5 +39,5 @@ var found;

dts = dts.replace(/^/mg, " ");
dts = header.join('\n')+"\ndeclare module protobuf {\n\n" + dts + "\n}\n";
dts = header.join('\n')+"\ndeclare module \"protobufjs\" {\n\n" + dts + "\n}\n";
fs.writeFileSync(path.join(dir, "protobuf.js.d.ts"), dts);
fs.unlinkSync(path.join(dir, "types.d.ts"));
"use strict";
module.exports = Decoder;
/**
* Wire format decoder using code generation on top of reflection.
* @namespace
*/
var decoder = exports;
var Enum = require("./enum"),

@@ -10,53 +15,9 @@ Reader = require("./reader"),

/**
* Constructs a new decoder for the specified message type.
* @classdesc Wire format decoder using code generation on top of reflection.
* @constructor
* @param {Type} type Message type
*/
function Decoder(type) {
/**
* Message type.
* @type {Type}
*/
this.type = type;
}
/** @alias Decoder.prototype */
var DecoderPrototype = Decoder.prototype;
// This is here to mimic Type so that fallback functions work without having to bind()
Object.defineProperties(DecoderPrototype, {
/**
* Fields of this decoder's message type by id for lookups.
* @name Decoder#fieldsById
* @type {Object.<number,Field>}
* @readonly
*/
fieldsById: {
get: DecoderPrototype.getFieldsById = function getFieldsById() {
return this.type.getFieldsById();
}
},
/**
* With this decoder's message type registered constructor, if any registered, otherwise a generic constructor.
* @name Decoder#ctor
* @type {Prototype}
*/
ctor: {
get: DecoderPrototype.getCtor = function getCtor() {
return this.type.getCtor();
}
}
});
/**
* Decodes a message of this decoder's message type.
* Decodes a message of `this` message's type.
* @param {Reader} reader Reader to decode from
* @param {number} [length] Length of the message, if known beforehand
* @returns {Prototype} Populated runtime message
* @this Type
*/
DecoderPrototype.decode = function decode_fallback(reader, length) { // codegen reference and fallback
decoder.fallback = function fallback(reader, length) {
/* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */

@@ -126,12 +87,13 @@ var fields = this.getFieldsById(),

/**
* Generates a decoder specific to this decoder's message type.
* @returns {function} Decoder function with an identical signature to {@link Decoder#decode}
* Generates a decoder specific to the specified message type.
* @param {Type} mtype Message type
* @returns {util.CodegenAppender} Unscoped codegen instance
*/
DecoderPrototype.generate = function generate() {
decoder.generate = function generate(mtype) {
/* eslint-disable no-unexpected-multiline */
var fields = this.type.getFieldsArray();
var fields = mtype.getFieldsArray();
var gen = util.codegen("r", "l")
("r instanceof Reader||(r=Reader(r))")
("var c=l===undefined?r.len:r.pos+l,m=new (this.getCtor())()")
("var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())")
("while(r.pos<c){")

@@ -206,3 +168,3 @@ ("var t=r.tag()")

("break");
} gen
} return gen
("default:")

@@ -214,9 +176,3 @@ ("r.skipType(t.wireType)")

("return m");
return gen
.eof(this.type.getFullName() + "$decode", {
Reader : Reader,
types : fields.map(function(fld) { return fld.resolvedType; }),
util : util.toHash
});
/* eslint-enable no-unexpected-multiline */
};
"use strict";
module.exports = Encoder;
/**
* Wire format encoder using code generation on top of reflection.
* @namespace
*/
var encoder = exports;
var Enum = require("./enum"),

@@ -10,42 +15,9 @@ Writer = require("./writer"),

/**
* Constructs a new encoder for the specified message type.
* @classdesc Wire format encoder using code generation on top of reflection
* @constructor
* @param {Type} type Message type
*/
function Encoder(type) {
/**
* Message type.
* @type {Type}
*/
this.type = type;
}
/** @alias Encoder.prototype */
var EncoderPrototype = Encoder.prototype;
// This is here to mimic Type so that fallback functions work without having to bind()
Object.defineProperties(EncoderPrototype, {
/**
* Fields of this encoder's message type as an array for iteration.
* @name Encoder#fieldsArray
* @type {Field[]}
* @readonly
*/
fieldsArray: {
get: EncoderPrototype.getFieldsArray = function getFieldsArray() {
return this.type.getFieldsArray();
}
}
});
/**
* Encodes a message of this encoder's message type.
* Encodes a message of `this` message's type.
* @param {Prototype|Object} message Runtime message or plain object to encode
* @param {Writer} [writer] Writer to encode to
* @returns {Writer} writer
* @this Type
*/
EncoderPrototype.encode = function encode_fallback(message, writer) { // codegen reference and fallback
encoder.fallback = function fallback(message, writer) {
/* eslint-disable block-scoped-var, no-redeclare */

@@ -123,8 +95,9 @@ if (!writer)

/**
* Generates an encoder specific to this encoder's message type.
* @returns {function} Encoder function with an identical signature to {@link Encoder#encode}
* Generates an encoder specific to the specified message type.
* @param {Type} mtype Message type
* @returns {util.CodegenAppender} Unscoped codegen instance
*/
EncoderPrototype.generate = function generate() {
encoder.generate = function generate(mtype) {
/* eslint-disable no-unexpected-multiline */
var fields = this.type.getFieldsArray();
var fields = mtype.getFieldsArray();
var gen = util.codegen("m", "w")

@@ -214,10 +187,4 @@ ("w||(w=Writer())");

return gen
("return w")
.eof(this.type.getFullName() + "$encode", {
Writer : Writer,
types : fields.map(function(fld) { return fld.resolvedType; }),
util : util
});
("return w");
/* eslint-enable no-unexpected-multiline */
};

@@ -38,3 +38,3 @@ "use strict";

Object.defineProperties(EnumPrototype, {
util.props(EnumPrototype, {

@@ -48,3 +48,3 @@ /**

valuesById: {
get: EnumPrototype.getValuesById = function getValuesById() {
get: function getValuesById() {
if (!this._valuesById) {

@@ -62,2 +62,9 @@ this._valuesById = {};

}
/**
* Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.
* @name Enum#getValuesById
* @function
* @returns {Object.<number,string>}
*/
});

@@ -64,0 +71,0 @@

@@ -144,3 +144,3 @@ "use strict";

Object.defineProperties(FieldPrototype, {
util.props(FieldPrototype, {

@@ -161,2 +161,8 @@ /**

/**
* Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.
* @name Field#isPacked
* @function
* @returns {boolean}
*/
});

@@ -163,0 +169,0 @@

"use strict";
var protobuf = global.protobuf = exports;
var util = require("./util");
/**

@@ -34,4 +32,5 @@ * Loads one or multiple .proto or preprocessed .json files into a common root namespace.

protobuf.BufferReader = protobuf.Reader.BufferReader;
protobuf.Encoder = require("./encoder");
protobuf.Decoder = require("./decoder");
protobuf.encoder = require("./encoder");
protobuf.decoder = require("./decoder");
protobuf.verifier = require("./verifier");

@@ -57,2 +56,12 @@ // Reflection

protobuf.common = require("./common");
protobuf.util = util;
protobuf.util = require("./util");
// Be nice to AMD
if (typeof define === 'function' && define.amd)
define(["long"], function(Long) {
if (Long) {
protobuf.util.Long = Long;
protobuf.Reader.configure();
}
return protobuf;
});

@@ -43,3 +43,3 @@ "use strict";

var classProperties = {
/**

@@ -65,7 +65,7 @@ * Reference to the reflected type.

* @param {Writer} [writer] Writer to use
* @returns {Uint8Array} Encoded message
* @returns {Writer} Writer
*/
encode: {
value: function encode(message, writer) {
return this.$type.encode(message, writer).finish();
return this.$type.encode(message, writer);
}

@@ -80,7 +80,7 @@ },

* @param {Writer} [writer] Writer to use
* @returns {Uint8Array} Encoded message
* @returns {Writer} Writer
*/
encodeDelimited: {
value: function encodeDelimited(message, writer) {
return this.$type.encodeDelimited(message, writer).finish();
return this.$type.encodeDelimited(message, writer);
}

@@ -130,3 +130,3 @@ },

Object.defineProperties(clazz, classProperties);
util.props(clazz, classProperties);
var prototype = inherits.defineProperties(new Prototype(), type);

@@ -174,4 +174,4 @@ clazz.prototype = prototype;

type.getOneofsArray().forEach(function(oneof) {
prototypeProperties[oneof.resolve().name] = {
get: function() {
util.prop(prototype, oneof.resolve().name, {
get: function getVirtual() {
var keys = oneof.oneof;

@@ -185,3 +185,3 @@ for (var i = 0; i < keys.length; ++i) {

},
set: function(value) {
set: function setVirtual(value) {
var keys = oneof.oneof;

@@ -193,7 +193,7 @@ for (var i = 0; i < keys.length; ++i) {

}
};
});
});
Object.defineProperties(prototype, prototypeProperties);
util.props(prototype, prototypeProperties);
return prototype;
};

@@ -49,3 +49,3 @@ "use strict";

Object.defineProperties(NamespacePrototype, {
util.props(NamespacePrototype, {

@@ -59,3 +59,3 @@ /**

nestedArray: {
get: NamespacePrototype.getNestedArray = function getNestedArray() {
get: function getNestedArray() {
return this._nestedArray || (this._nestedArray = util.toArray(this.nested));

@@ -62,0 +62,0 @@ }

@@ -53,3 +53,3 @@ "use strict";

Object.defineProperties(ReflectionObjectPrototype, {
util.props(ReflectionObjectPrototype, {

@@ -63,3 +63,3 @@ /**

root: {
get: ReflectionObjectPrototype.getRoot = function getRoot() {
get: function getRoot() {
var ptr = this;

@@ -66,0 +66,0 @@ while (ptr.parent !== null)

@@ -32,2 +32,8 @@ "use strict";

/**
* Upper cased name for getter/setter calls.
* @type {string}
*/
this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);
/**
* Field names that belong to this oneof.

@@ -34,0 +40,0 @@ * @type {Array.<string>}

@@ -27,5 +27,9 @@ "use strict";

keys = Object.keys(properties);
for (var i = 0; i < keys.length; ++i)
if (fields[keys[i]] || any)
for (var i = 0; i < keys.length; ++i) {
var field = fields[keys[i]];
if (field && field.partOf)
this['set' + field.partOf.ucName](field.name);
if (field || any)
this[keys[i]] = properties[keys[i]];
}
}

@@ -32,0 +36,0 @@ }

@@ -6,6 +6,6 @@ "use strict";

var util = require("./util"),
ieee754 = require("../lib/ieee754");
var LongBits = util.LongBits,
Long = util.Long;
var util = require("./util/runtime"),
ieee754 = require("../lib/ieee754");
var LongBits = util.LongBits,
ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;

@@ -17,2 +17,25 @@ function indexOutOfRange(reader, writeLength) {

/**
* Configures the Reader interface according to the environment.
* @memberof Reader
* @returns {undefined}
*/
function configure() {
if (util.Long) {
ReaderPrototype.int64 = read_int64_long;
ReaderPrototype.uint64 = read_uint64_long;
ReaderPrototype.sint64 = read_sint64_long;
ReaderPrototype.fixed64 = read_fixed64_long;
ReaderPrototype.sfixed64 = read_sfixed64_long;
} else {
ReaderPrototype.int64 = read_int64_number;
ReaderPrototype.uint64 = read_uint64_number;
ReaderPrototype.sint64 = read_sint64_number;
ReaderPrototype.fixed64 = read_fixed64_number;
ReaderPrototype.sfixed64 = read_sfixed64_number;
}
}
Reader.configure = configure;
/**
* Constructs a new reader using the specified buffer.

@@ -50,3 +73,2 @@ * When called as a function, returns an appropriate reader for the specified buffer.

var ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
ReaderPrototype._slice = ArrayImpl.prototype.slice || ArrayImpl.prototype.subarray;

@@ -84,2 +106,4 @@

octet = 0;
// A fast route could potentially be a thing here, but the benefits are minimal because
// of the assertions required (up to 10 bytes if negative, more is invalid).
do {

@@ -89,4 +113,6 @@ if (this.pos >= this.len)

octet = this.buf[this.pos++];
if (shift < 32)
if (shift < 29) // 0..28
value |= (octet & 127) << shift;
else if (shift > 63) // 35..63
throw Error("invalid varint encoding");
shift += 7;

@@ -114,9 +140,4 @@ } while (octet & 128);

/**
* Reads a possibly 64 bits varint.
* @returns {LongBits} Long bits
* @this {Reader}
* @inner
* @ignore
*/
/* eslint-disable no-invalid-this */
function readLongVarint() {

@@ -172,45 +193,47 @@ var lo = 0, hi = 0,

function read_int64_long() {
return readLongVarint.call(this).toLong(); // eslint-disable-line no-invalid-this
return readLongVarint.call(this).toLong();
}
function read_int64_number() {
return readLongVarint.call(this).toNumber(); // eslint-disable-line no-invalid-this
return readLongVarint.call(this).toNumber();
}
/**
* Reads a varint as a signed 64 bit value.
* @function
* @returns {Long|number} Value read
*/
ReaderPrototype.int64 = Long && read_int64_long || read_int64_number;
function read_uint64_long() {
return readLongVarint.call(this).toLong(true); // eslint-disable-line no-invalid-this
return readLongVarint.call(this).toLong(true);
}
function read_uint64_number() {
return readLongVarint.call(this).toNumber(true); // eslint-disable-line no-invalid-this
return readLongVarint.call(this).toNumber(true);
}
/**
* Reads a varint as an unsigned 64 bit value.
* @function
* @returns {Long|number} Value read
*/
ReaderPrototype.uint64 = Long && read_uint64_long || read_uint64_number;
function read_sint64_long() {
return readLongVarint.call(this).zzDecode().toLong(); // eslint-disable-line no-invalid-this
return readLongVarint.call(this).zzDecode().toLong();
}
function read_sint64_number() {
return readLongVarint.call(this).zzDecode().toNumber(); // eslint-disable-line no-invalid-this
return readLongVarint.call(this).zzDecode().toNumber();
}
/* eslint-enable no-invalid-this */
/**
* Reads a varint as a signed 64 bit value.
* @name Reader#int64
* @function
* @returns {Long|number} Value read
*/
/**
* Reads a varint as an unsigned 64 bit value.
* @name Reader#uint64
* @function
* @returns {Long|number} Value read
*/
/**
* Reads a zig-zag encoded varint as a signed 64 bit value.
* @name Reader#sint64
* @function
* @returns {Long|number} Value read
*/
ReaderPrototype.sint64 = Long && read_sint64_long || read_sint64_number;

@@ -248,9 +271,4 @@ /**

/**
* Reads a 64 bit value.
* @returns {LongBits} Long bits
* @this {Reader}
* @inner
* @ignore
*/
/* eslint-disable no-invalid-this */
function readLongFixed() {

@@ -273,30 +291,58 @@ if (this.pos + 8 > this.len)

function read_fixed64_long() {
return readLongFixed.call(this).toLong(true); // eslint-disable-line no-invalid-this
return readLongFixed.call(this).toLong(true);
}
function read_fixed64_number() {
return readLongFixed.call(this).toNumber(true); // eslint-disable-line no-invalid-this
return readLongFixed.call(this).toNumber(true);
}
/**
* Reads fixed 64 bits.
* @function
* @returns {Long|number} Value read
*/
ReaderPrototype.fixed64 = Long && read_fixed64_long || read_fixed64_number;
function read_sfixed64_long() {
return readLongFixed.call(this).zzDecode().toLong(); // eslint-disable-line no-invalid-this
return readLongFixed.call(this).zzDecode().toLong();
}
function read_sfixed64_number() {
return readLongFixed.call(this).zzDecode().toNumber(); // eslint-disable-line no-invalid-this
return readLongFixed.call(this).zzDecode().toNumber();
}
/* eslint-enable no-invalid-this */
/**
* Reads fixed 64 bits.
* @name Reader#fixed64
* @function
* @returns {Long|number} Value read
*/
/**
* Reads zig-zag encoded fixed 64 bits.
* @name Reader#sfixed64
* @function
* @returns {Long|number} Value read
*/
ReaderPrototype.sfixed64 = Long && read_sfixed64_long || read_sfixed64_number;
var readFloat = typeof Float32Array !== 'undefined'
? (function() { // eslint-disable-line wrap-iife
var f32 = new Float32Array(1),
f8b = new Uint8Array(f32.buffer);
f32[0] = -0;
return f8b[3] // already le?
? function readFloat_f32(buf, pos) {
f8b[0] = buf[pos++];
f8b[1] = buf[pos++];
f8b[2] = buf[pos++];
f8b[3] = buf[pos ];
return f32[0];
}
: function readFloat_f32_le(buf, pos) {
f8b[3] = buf[pos++];
f8b[2] = buf[pos++];
f8b[1] = buf[pos++];
f8b[0] = buf[pos ];
return f32[0];
};
})()
: function readFloat_ieee754(buf, pos) {
return ieee754.read(buf, pos, false, 23, 4);
};
/**

@@ -310,3 +356,3 @@ * Reads a float (32 bit) as a number.

throw indexOutOfRange(this, 4);
var value = ieee754.read(this.buf, this.pos, false, 23, 4);
var value = readFloat(this.buf, this.pos);
this.pos += 4;

@@ -316,2 +362,35 @@ return value;

var readDouble = typeof Float64Array !== 'undefined'
? (function() { // eslint-disable-line wrap-iife
var f64 = new Float64Array(1),
f8b = new Uint8Array(f64.buffer);
f64[0] = -0;
return f8b[7] // already le?
? function readDouble_f64(buf, pos) {
f8b[0] = buf[pos++];
f8b[1] = buf[pos++];
f8b[2] = buf[pos++];
f8b[3] = buf[pos++];
f8b[4] = buf[pos++];
f8b[5] = buf[pos++];
f8b[6] = buf[pos++];
f8b[7] = buf[pos ];
return f64[0];
}
: function readDouble_f64_le(buf, pos) {
f8b[7] = buf[pos++];
f8b[6] = buf[pos++];
f8b[5] = buf[pos++];
f8b[4] = buf[pos++];
f8b[3] = buf[pos++];
f8b[2] = buf[pos++];
f8b[1] = buf[pos++];
f8b[0] = buf[pos ];
return f64[0];
};
})()
: function readDouble_ieee754(buf, pos) {
return ieee754.read(buf, pos, false, 52, 8);
};
/**

@@ -325,3 +404,3 @@ * Reads a double (64 bit float) as a number.

throw indexOutOfRange(this, 4);
var value = ieee754.read(this.buf, this.pos, false, 52, 8);
var value = readDouble(this.buf, this.pos);
this.pos += 8;

@@ -462,2 +541,5 @@ return value;

BufferReaderPrototype._slice = util.Buffer.prototype.slice;
readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer
? readStringBuffer_utf8Slice
: readStringBuffer_toString;
initBufferReader = false;

@@ -484,2 +566,3 @@ };

if (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)
/**

@@ -496,2 +579,3 @@ * @override

if (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)
/**

@@ -508,2 +592,12 @@ * @override

var readStringBuffer;
function readStringBuffer_utf8Slice(buf, start, end) {
return buf.utf8Slice(start, end); // fastest
}
function readStringBuffer_toString(buf, start, end) {
return buf.toString("utf8", start, end); // 2nd, again assertions
}
/**

@@ -514,8 +608,8 @@ * @override

var length = this.int32() >>> 0,
start = this.pos,
end = this.pos + length;
start = this.pos,
end = this.pos + length;
if (end > this.len)
throw indexOutOfRange(this, length);
this.pos += length;
return this.buf.toString("utf8", start, end);
return readStringBuffer(this.buf, start, end);
};

@@ -531,1 +625,3 @@

};
configure();

@@ -39,3 +39,3 @@ "use strict";

Object.defineProperties(ServicePrototype, {
util.props(ServicePrototype, {

@@ -49,3 +49,3 @@ /**

methodsArray: {
get: ServicePrototype.getMethodsArray = function getMethodsArray() {
get: function getMethodsArray() {
return this._methodsArray || (this._methodsArray = util.toArray(this.methods));

@@ -157,4 +157,4 @@ }

* @param {function(Method, Uint8Array, function)} rpc RPC implementation ({@link RPCImpl|see})
* @param {boolean} [requestDelimited=false] Whether request data is length delimited
* @param {boolean} [responseDelimited=false] Whether response data is length delimited
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
* @returns {Object} Runtime service

@@ -164,7 +164,8 @@ */

var rpcService = {};
Object.defineProperty(rpcService, "$rpc", {
util.prop(rpcService, "$rpc", {
value: rpc
});
this.getMethodsArray().forEach(function(method) {
rpcService[method.name] = function(request, callback) {
var lcName = method.name.substring(0, 1).toLowerCase() + method.name.substring(1);
rpcService[lcName] = function(request, callback) {
method.resolve();

@@ -171,0 +172,0 @@ var requestData;

@@ -15,8 +15,10 @@ "use strict";

Prototype = require("./prototype"),
Reader = require("./reader"),
Writer = require("./writer"),
encoder = require("./encoder"),
decoder = require("./decoder"),
verifier = require("./verifier"),
inherits = require("./inherits"),
util = require("./util"),
Reader = require("./reader"),
Encoder = require("./encoder"),
Decoder = require("./decoder"),
Verifier = require("./verifier");
util = require("./util");
var codegen = util.codegen;

@@ -88,3 +90,3 @@

Object.defineProperties(TypePrototype, {
util.props(TypePrototype, {

@@ -98,3 +100,3 @@ /**

fieldsById: {
get: TypePrototype.getFieldsById = function getFieldsById() {
get: function getFieldsById() {
if (this._fieldsById)

@@ -338,7 +340,10 @@ return this._fieldsById;

TypePrototype.encode = function encode(message, writer) {
var encoder = new Encoder(this);
this.encode = codegen.supported
? encoder.generate()
: encoder.encode;
return this.encode(message, writer);
return (this.encode = codegen.supported
? encoder.generate(this).eof(this.getFullName() + "$encode", {
Writer : Writer,
types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),
util : util
})
: encoder.fallback
).call(this, message, writer);
};

@@ -363,7 +368,10 @@

TypePrototype.decode = function decode(readerOrBuffer, length) {
var decoder = new Decoder(this);
this.decode = codegen.supported
? decoder.generate()
: decoder.decode;
return this.decode(readerOrBuffer, length);
return (this.decode = codegen.supported
? decoder.generate(this).eof(this.getFullName() + "$decode", {
Reader : Reader,
types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),
util : util
})
: decoder.fallback
).call(this, readerOrBuffer, length);
};

@@ -387,7 +395,8 @@

TypePrototype.verify = function verify(message) {
var verifier = new Verifier(this);
this.verify = codegen.supported
? verifier.generate()
: verifier.verify;
return this.verify(message);
return (this.verify = codegen.supported
? verifier.generate(this).eof(this.getFullName() + "$verify", {
types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; })
})
: verifier.fallback
).call(this, message);
};

@@ -7,3 +7,3 @@ "use strict";

*/
var types = module.exports = {};
var types = exports;

@@ -119,2 +119,4 @@ var s = [

types.packed = bake([
/* double */ 1,
/* float */ 5,
/* int32 */ 0,

@@ -131,2 +133,2 @@ /* uint32 */ 0,

/* bool */ 0
], 2);
]);

@@ -7,36 +7,7 @@ "use strict";

*/
var util = module.exports = {};
var util = exports;
var LongBits =
util.LongBits = require("./util/longbits");
util.codegen = require("./util/codegen");
/**
* Whether running within node or not.
* @memberof util
* @type {boolean}
*/
var isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);
/**
* Optional buffer class to use.
* If you assign any compatible buffer implementation to this property, the library will use it.
* @type {?Function}
*/
util.Buffer = null;
if (isNode)
try { util.Buffer = require("buffer").Buffer; } catch (e) {} // eslint-disable-line no-empty
/**
* Optional Long class to use.
* If you assign any compatible long implementation to this property, the library will use it.
* @type {?Function}
*/
util.Long = global.dcodeIO && global.dcodeIO.Long || null;
if (!util.Long)
try { util.Long = require("long"); } catch (e) {} // eslint-disable-line no-empty
/**
* Tests if the specified value is a string.

@@ -218,42 +189,2 @@ * @memberof util

/**
* Converts a number or long to an 8 characters long hash string.
* @param {Long|number} value Value to convert
* @returns {string} Hash
*/
util.longToHash = function longToHash(value) {
return value
? LongBits.from(value).toHash()
: '\0\0\0\0\0\0\0\0';
};
/**
* Converts an 8 characters long hash string to a long or number.
* @param {string} hash Hash
* @param {boolean} [unsigned=false] Whether unsigned or not
* @returns {Long|number} Original value
*/
util.longFromHash = function longFromHash(hash, unsigned) {
var bits = LongBits.fromHash(hash);
if (util.Long)
return util.Long.fromBits(bits.lo, bits.hi, unsigned);
return bits.toNumber(Boolean(unsigned));
};
/**
* Tests if two possibly long values are not equal.
* @param {number|Long} a First value
* @param {number|Long} b Second value
* @returns {boolean} `true` if not equal
*/
util.longNeq = function longNeq(a, b) {
return typeof a === 'number'
? typeof b === 'number'
? a !== b
: (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high
: typeof b === 'number'
? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high
: a.low !== b.low || a.high !== b.high;
};
/**
* Merges the properties of the source object into the destination object.

@@ -295,3 +226,9 @@ * @param {Object} dst Destination object

util.newBuffer = function newBuffer(size) {
return new (util.Buffer || typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size || 0);
size = size || 0;
return util.Buffer
? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)
: new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);
};
// Merge in runtime utility
util.merge(util, require("./util/runtime"));
"use strict";
module.exports = Verifier;
/**
* Runtime message verifier using code generation on top of reflection.
* @namespace
*/
var verifier = exports;
var Enum = require("./enum"),

@@ -9,53 +14,8 @@ Type = require("./type"),

/**
* Constructs a new verifier for the specified message type.
* @classdesc Runtime message verifier using code generation on top of reflection.
* @constructor
* @param {Type} type Message type
*/
function Verifier(type) {
/**
* Message type.
* @type {Type}
*/
this.type = type;
}
/** @alias Verifier.prototype */
var VerifierPrototype = Verifier.prototype;
// This is here to mimic Type so that fallback functions work without having to bind()
Object.defineProperties(VerifierPrototype, {
/**
* Fields of this verifier's message type as an array for iteration.
* @name Verifier#fieldsArray
* @type {Field[]}
* @readonly
*/
fieldsArray: {
get: VerifierPrototype.getFieldsArray = function getFieldsArray() {
return this.type.getFieldsArray();
}
},
/**
* Full name of this verifier's message type.
* @name Verifier#fullName
* @type {string}
* @readonly
*/
fullName: {
get: VerifierPrototype.getFullName = function getFullName() {
return this.type.getFullName();
}
}
});
/**
* Verifies a runtime message of this verifier's message type.
* Verifies a runtime message of `this` message type.
* @param {Prototype|Object} message Runtime message or plain object to verify
* @returns {?string} `null` if valid, otherwise the reason why it is not
* @this {Type}
*/
VerifierPrototype.verify = function verify_fallback(message) {
verifier.fallback = function fallback(message) {
var fields = this.getFieldsArray(),

@@ -86,8 +46,9 @@ i = 0;

/**
* Generates a verifier specific to this verifier's message type.
* @returns {function} Verifier function with an identical signature to {@link Verifier#verify}
* Generates a verifier specific to the specified message type.
* @param {Type} mtype Message type
* @returns {util.CodegenAppender} Unscoped codegen instance
*/
VerifierPrototype.generate = function generate() {
verifier.generate = function generate(mtype) {
/* eslint-disable no-unexpected-multiline */
var fields = this.type.getFieldsArray();
var fields = mtype.getFieldsArray();
var gen = util.codegen("m");

@@ -102,3 +63,3 @@ var hasReasonVar = false;

("if(m%s===undefined)", prop)
("return 'missing required field %s in %s'", field.name, this.type.getFullName());
("return 'missing required field %s in %s'", field.name, mtype.getFullName());

@@ -110,3 +71,3 @@ } else if (field.resolvedType instanceof Enum) {

("default:")
("return 'invalid enum value %s = '+m%s+' in %s'", field.name, prop, this.type.getFullName());
("return 'invalid enum value %s = '+m%s+' in %s'", field.name, prop, mtype.getFullName());

@@ -121,3 +82,3 @@ for (var j = 0, l = values.length; j < l; ++j) gen

("if(!m%s)", prop)
("return 'missing required field %s in %s'", field.name, this.type.getFullName());
("return 'missing required field %s in %s'", field.name, mtype.getFullName());

@@ -131,8 +92,4 @@ if (!hasReasonVar) { gen("var r"); hasReasonVar = true; } gen

return gen
("return null")
.eof(this.type.getFullName() + "$verify", {
types : fields.map(function(fld) { return fld.resolvedType; })
});
("return null");
/* eslint-enable no-unexpected-multiline */
};

@@ -6,5 +6,6 @@ "use strict";

var util = require("./util"),
ieee754 = require("../lib/ieee754");
var LongBits = util.LongBits;
var util = require("./util/runtime"),
ieee754 = require("../lib/ieee754");
var LongBits = util.LongBits,
ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;

@@ -59,6 +60,7 @@ /**

* @param {Writer} writer Writer to copy state from
* @param {State} next Next state entry
* @private
* @ignore
*/
function State(writer) {
function State(writer, next) {

@@ -82,2 +84,8 @@ /**

this.len = writer.len;
/**
* Next state.
* @type {?State}
*/
this.next = next;
}

@@ -87,4 +95,2 @@

var ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
/**

@@ -120,6 +126,6 @@ * Constructs a new writer.

/**
* State stack.
* @type {Object[]}
* Linked forked states.
* @type {?Object}
*/
this.stack = [];
this.states = null;

@@ -180,9 +186,10 @@ // When a value is written, the writer calculates its byte length and puts it into a linked

value >>>= 0;
return this.push(writeVarint32,
value < 128 ? 1
: value < 16384 ? 2
: value < 2097152 ? 3
: value < 268435456 ? 4
: 5
, value);
return value < 128
? this.push(writeByte, 1, value)
: this.push(writeVarint32,
value < 16384 ? 2
: value < 2097152 ? 3
: value < 268435456 ? 4
: 5
, value);
};

@@ -213,3 +220,3 @@

// tends to deoptimize. stays optimized when using bits directly.
while (val.hi || val.lo > 127) {
while (val.hi) {
buf[pos++] = val.lo & 127 | 128;

@@ -219,2 +226,6 @@ val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;

}
while (val.lo > 127) {
buf[pos++] = val.lo & 127 | 128;
val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
}
buf[pos++] = val.lo;

@@ -249,3 +260,3 @@ }

*/
WriterPrototype.sint64 = function sint64(value) {
WriterPrototype.sint64 = function write_sint64(value) {
var bits = LongBits.from(value).zzEncode();

@@ -268,3 +279,3 @@ return this.push(writeVarint64, bits.length(), bits);

buf[pos++] = val >>> 16 & 255;
buf[pos ] = val >>> 24 & 255;
buf[pos ] = val >>> 24;
}

@@ -312,5 +323,26 @@

function writeFloat(buf, pos, val) {
ieee754.write(buf, val, pos, false, 23, 4);
}
var writeFloat = typeof Float32Array !== 'undefined'
? (function() { // eslint-disable-line wrap-iife
var f32 = new Float32Array(1),
f8b = new Uint8Array(f32.buffer);
f32[0] = -0;
return f8b[3] // already le?
? function writeFloat_f32(buf, pos, val) {
f32[0] = val;
buf[pos++] = f8b[0];
buf[pos++] = f8b[1];
buf[pos++] = f8b[2];
buf[pos ] = f8b[3];
}
: function writeFloat_f32_le(buf, pos, val) {
f32[0] = val;
buf[pos++] = f8b[3];
buf[pos++] = f8b[2];
buf[pos++] = f8b[1];
buf[pos ] = f8b[0];
};
})()
: function writeFloat_ieee754(buf, pos, val) {
ieee754.write(buf, val, pos, false, 23, 4);
};

@@ -327,5 +359,34 @@ /**

function writeDouble(buf, pos, val) {
ieee754.write(buf, val, pos, false, 52, 8);
}
var writeDouble = typeof Float64Array !== 'undefined'
? (function() { // eslint-disable-line wrap-iife
var f64 = new Float64Array(1),
f8b = new Uint8Array(f64.buffer);
f64[0] = -0;
return f8b[7] // already le?
? function writeDouble_f64(buf, pos, val) {
f64[0] = val;
buf[pos++] = f8b[0];
buf[pos++] = f8b[1];
buf[pos++] = f8b[2];
buf[pos++] = f8b[3];
buf[pos++] = f8b[4];
buf[pos++] = f8b[5];
buf[pos++] = f8b[6];
buf[pos ] = f8b[7];
}
: function writeDouble_f64_le(buf, pos, val) {
f64[0] = val;
buf[pos++] = f8b[7];
buf[pos++] = f8b[6];
buf[pos++] = f8b[5];
buf[pos++] = f8b[4];
buf[pos++] = f8b[3];
buf[pos++] = f8b[2];
buf[pos++] = f8b[1];
buf[pos ] = f8b[0];
};
})()
: function writeDouble_ieee754(buf, pos, val) {
ieee754.write(buf, val, pos, false, 52, 8);
};

@@ -343,4 +404,9 @@ /**

var writeBytes = ArrayImpl.prototype.set
? function writeBytes_set(buf, pos, val) { buf.set(val, pos); }
: function writeBytes_for(buf, pos, val) { for (var i = 0; i < val.length; ++i) buf[pos + i] = val[i]; };
? function writeBytes_set(buf, pos, val) {
buf.set(val, pos);
}
: function writeBytes_for(buf, pos, val) {
for (var i = 0; i < val.length; ++i)
buf[pos + i] = val[i];
};

@@ -365,5 +431,5 @@ /**

} else if (c1 < 2048) {
buf[pos++] = c1 >> 6 | 192;
buf[pos++] = c1 & 63 | 128;
} else if ((c1 & 0xFC00) === 0xD800 && i + 1 < val.length && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
buf[pos++] = c1 >> 6 | 192;
buf[pos++] = c1 & 63 | 128;
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);

@@ -385,19 +451,16 @@ ++i;

var strlen = val.length >>> 0;
if (strlen) {
var len = 0;
for (var i = 0, c1; i < strlen; ++i) {
c1 = val.charCodeAt(i);
if (c1 < 128)
len += 1;
else if (c1 < 2048)
len += 2;
else if ((c1 & 0xFC00) === 0xD800 && i + 1 < strlen && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
++i;
len += 4;
} else
len += 3;
}
return len;
var len = 0;
for (var i = 0; i < strlen; ++i) {
var c1 = val.charCodeAt(i);
if (c1 < 128)
len += 1;
else if (c1 < 2048)
len += 2;
else if ((c1 & 0xFC00) === 0xD800 && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
++i;
len += 4;
} else
len += 3;
}
return 0;
return len;
}

@@ -423,3 +486,3 @@

WriterPrototype.fork = function fork() {
this.stack.push(new State(this));
this.states = new State(this, this.states);
this.head = this.tail = new Op(noop, 0, 0);

@@ -435,7 +498,7 @@ this.len = 0;

WriterPrototype.reset = function reset() {
if (this.stack.length) {
var state = this.stack.pop();
this.head = state.head;
this.tail = state.tail;
this.len = state.len;
if (this.states) {
this.head = this.states.head;
this.tail = this.states.tail;
this.len = this.states.len;
this.states = this.states.next;
} else {

@@ -467,2 +530,14 @@ this.head = this.tail = new Op(noop, 0, 0);

function finish_internal(head, buf) {
var pos = 0;
while (head) {
head.fn(buf, pos, head.val);
pos += head.len;
head = head.next;
}
return buf;
}
WriterPrototype._finish = finish_internal;
/**

@@ -474,11 +549,5 @@ * Finishes the current sequence of write operations and frees all resources.

var head = this.head.next, // skip noop
buf = new ArrayImpl(this.len),
pos = 0;
buf = new ArrayImpl(this.len);
this.reset();
while (head) {
head.fn(buf, pos, head.val);
pos += head.len;
head = head.next;
}
return buf;
return finish_internal(head, buf);
};

@@ -505,2 +574,3 @@

if (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)
/**

@@ -517,2 +587,3 @@ * @override

if (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)
/**

@@ -528,4 +599,6 @@ * @override

val.copy(buf, pos, 0, val.length);
// This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.
}
if (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)
/**

@@ -541,5 +614,20 @@ * @override

function writeStringBuffer(buf, pos, val) {
buf.write(val, pos);
}
var writeStringBuffer = (function() { // eslint-disable-line wrap-iife
return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer
? function writeString_buffer_utf8Write(buf, pos, val) {
if (val.length < 40)
writeString(buf, pos, val);
else
buf.utf8Write(val, pos);
}
: function writeString_buffer_write(buf, pos, val) {
if (val.length < 40)
writeString(buf, pos, val);
else
buf.write(val, pos);
};
// Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.
// For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.
// Unfortunately, this does not translate 1:1 to real use cases, hence the common "good enough" limit of 40.
})();

@@ -550,3 +638,5 @@ /**

BufferWriterPrototype.string = function write_string_buffer(value) {
var len = byteLength(value);
var len = value.length < 40
? byteLength(value)
: util.Buffer.byteLength(value);
return len

@@ -562,11 +652,5 @@ ? this.uint32(len).push(writeStringBuffer, len, value)

var head = this.head.next, // skip noop
buf = util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(this.len) || new util.Buffer(this.len),
pos = 0;
buf = util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(this.len) || new util.Buffer(this.len);
this.reset();
while (head) {
head.fn(buf, pos, head.val);
pos += head.len;
head = head.next;
}
return buf;
return finish_internal(head, buf);
};

@@ -52,4 +52,3 @@ var tape = require("tape");

var enc = new protobuf.Encoder(Any);
writer = enc.encode(any);
writer = protobuf.encoder.fallback.call(Any, any);
buf = writer.finish();

@@ -73,4 +72,3 @@

var dec = new protobuf.Decoder(Any);
msg = dec.decode(buf);
msg = protobuf.decoder.fallback.call(Any, buf);

@@ -77,0 +75,0 @@ test.deepEqual(msg, any, "an equal message");

@@ -36,3 +36,3 @@ var tape = require("tape");

buf = Any.encode(any);
buf = Any.encode(any).finish();

@@ -59,3 +59,3 @@ test.equal(buf[0] , 1 << 3 | 2, "a tag with id 1, wire type 2");

buf = Any.encodeDelimited(any);
buf = Any.encodeDelimited(any).finish();

@@ -62,0 +62,0 @@ test.equal(buf[0] , 13 , "a length of 13");

@@ -41,6 +41,4 @@ var tape = require("tape");

var service = MyService.create(rpc, true, false);
test.deepEqual(Object.keys(service), [ "MyMethod" ], "should create a service with exactly one method");
service.MyMethod(MyRequest.create({
service.myMethod(MyRequest.create({
path: "/"

@@ -47,0 +45,0 @@ }), function(err, response) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc