diff --git a/bench/index.js b/bench/index.js index 348cfd3fa..df35884c4 100644 --- a/bench/index.js +++ b/bench/index.js @@ -22,7 +22,7 @@ var protobuf = require("../src/index"), var root = protobuf.loadSync(require.resolve("./bench.proto")); var Test = root.lookup("Test"); -protobuf.codegen.verbose = true; +protobuf.util.codegen.verbose = true; var buf = Test.encode(data).finish(); diff --git a/cli/targets/static.js b/cli/targets/static.js index a12029706..8b1dd14ef 100644 --- a/cli/targets/static.js +++ b/cli/targets/static.js @@ -9,8 +9,7 @@ var Type = protobuf.Type, Service = protobuf.Service, Enum = protobuf.Enum, Namespace = protobuf.Namespace, - util = protobuf.util, - codegen = protobuf.codegen; + util = protobuf.util; var out = []; var indent = 0; @@ -232,7 +231,7 @@ function buildType(ref, type) { "@param {Writer} [writer] Writer to encode to", "@returns {Writer} Writer" ]); - buildFunction(type, "encode", codegen.encode.generate(type), { + buildFunction(type, "encode", protobuf.encode.generate(type), { Writer : "$protobuf.Writer", util : "$protobuf.util" }); @@ -260,7 +259,7 @@ function buildType(ref, type) { "@param {number} [length] Message length if known beforehand", "@returns {" + fullName + "} " + type.name ]); - buildFunction(type, "decode", codegen.decode.generate(type), { + buildFunction(type, "decode", protobuf.decode.generate(type), { Reader : "$protobuf.Reader", util : "$protobuf.util" }); @@ -286,7 +285,7 @@ function buildType(ref, type) { "@param {" + fullName + "|Object} message " + type.name + " or plain object to verify", "@returns {?string} `null` if valid, otherwise the reason why it is not" ]); - buildFunction(type, "verify", codegen.verify.generate(type), { + buildFunction(type, "verify", protobuf.verify.generate(type), { util : "$protobuf.util" }); } diff --git a/dist/protobuf.js b/dist/protobuf.js index 478f4be4a..dab7ae47a 100644 --- a/dist/protobuf.js +++ b/dist/protobuf.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.1.0 (c) 2016 Daniel Wirtz - * Compiled Sat, 10 Dec 2016 13:31:00 UTC + * Compiled Sat, 10 Dec 2016 23:00:12 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ @@ -128,9 +128,9 @@ exports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) "use strict"; module.exports = Class; -var Message = require(11), - Type = require(23), - util = require(25); +var Message = require(9), + Type = require(21), + util = require(23); var _TypeError = util._TypeError; @@ -263,159 +263,157 @@ Class.prototype = Message; * @returns {?string} `null` if valid, otherwise the reason why it is not */ -},{"11":11,"23":23,"25":25}],3:[function(require,module,exports){ +},{"21":21,"23":23,"9":9}],3:[function(require,module,exports){ "use strict"; -module.exports = codegen; - -var util = require(25); -var blockOpenRe = /[{[]$/, - blockCloseRe = /^[}\]]/, - casingRe = /:$/, - branchRe = /^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/, - breakRe = /\b(?:break|continue);?$|^\s*return\b/; +module.exports = common; /** - * A closure for generating functions programmatically. - * @namespace - * @function - * @param {...string} params Function parameter names - * @returns {Codegen} Codegen instance - * @property {boolean} supported Whether code generation is supported by the environment. - * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging. + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name + * @param {Object} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + * @returns {undefined} + * @property {Object} google/protobuf/any.proto Any + * @property {Object} google/protobuf/duration.proto Duration + * @property {Object} google/protobuf/empty.proto Empty + * @property {Object} google/protobuf/struct.proto Struct, Value, NullValue and ListValue + * @property {Object} google/protobuf/timestamp.proto Timestamp */ -function codegen() { - var args = Array.prototype.slice.call(arguments), - src = ['\t"use strict"'], - indent = 1, - inCase = false; +function common(name, json) { + if (!/\/|\./.test(name)) { + name = "google/protobuf/" + name + ".proto"; + json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; + } + common[name] = json; +} - /** - * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function. - * @typedef Codegen - * @type {function} - * @param {string} format Format string - * @param {...*} args Replacements - * @returns {Codegen} Itself - * @property {function(string=):string} str Stringifies the so far generated function source. - * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope. - */ - /**/ - function gen() { - var line = util.sprintf.apply(null, arguments); - var level = indent; - if (src.length) { - var prev = src[src.length - 1]; +// Not provided because of limited use (feel free to discuss or to provide yourself): +// - google/protobuf/descriptor.proto +// - google/protobuf/field_mask.proto +// - google/protobuf/source_context.proto +// - google/protobuf/type.proto +// - google/protobuf/wrappers.proto - // block open or one time branch - if (blockOpenRe.test(prev)) - level = ++indent; // keep - else if (branchRe.test(prev)) - ++level; // once - - // casing - if (casingRe.test(prev) && !casingRe.test(line)) { - level = ++indent; - inCase = true; - } else if (inCase && breakRe.test(prev)) { - level = --indent; - inCase = false; +common("any", { + Any: { + fields: { + type_url: { + type: "string", + id: 1 + }, + value: { + type: "bytes", + id: 2 } - - // block close - if (blockCloseRe.test(line)) - level = --indent; } - for (var index = 0; index < level; ++index) - line = "\t" + line; - src.push(line); - return gen; - } - - /** - * Stringifies the so far generated function source. - * @param {string} [name] Function name, defaults to generate an anonymous function - * @returns {string} Function source using tabs for indentation - * @inner - */ - function str(name) { - return "function " + (name ? name.replace(/[^\w_$]/g, "_") : "") + "(" + args.join(", ") + ") {\n" + src.join("\n") + "\n}"; } +}); - gen.str = str; +var timeType; - /** - * Ends generation and builds the function whilst applying a scope. - * @param {string} [name] Function name, defaults to generate an anonymous function - * @param {Object} [scope] Function scope - * @returns {function} The generated function, with scope applied if specified - * @inner - */ - function eof(name, scope) { - if (typeof name === 'object') { - scope = name; - name = undefined; +common("duration", { + Duration: timeType = { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } } - var source = gen.str(name); - if (codegen.verbose) - console.log("--- codegen ---\n" + source.replace(/^/mg, "> ").replace(/\t/g, " ")); // eslint-disable-line no-console - var keys = Object.keys(scope || (scope = {})); - return Function.apply(null, keys.concat("return " + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func - // ^ Creates a wrapper function with the scoped variable names as its parameters, - // calls it with the respective scoped variable values ^ - // and returns our brand-new properly scoped function. - // - // This works because "Invoking the Function constructor as a function (without using the - // new operator) has the same effect as invoking it as a constructor." - // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function } +}); - gen.eof = eof; - - return gen; -} +common("timestamp", { + Timestamp: timeType +}); -codegen.supported = false; try { codegen.supported = codegen("a","b")("return a-b").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty -codegen.verbose = false; +common("empty", { + Empty: { + fields: {} + } +}); -codegen.encode = require(5); -codegen.decode = require(4); -codegen.verify = require(6); +common("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 + } + } + } +}); -},{"25":25,"4":4,"5":5,"6":6}],4:[function(require,module,exports){ +},{}],4:[function(require,module,exports){ "use strict"; +module.exports = decode; -/** - * Wire format decoder using code generation on top of reflection that also provides a fallback. - * @exports codegen.decode - * @namespace - */ -var decode = exports; - -var Enum = require(8), - Reader = require(17), - types = require(24), - util = require(25), - codegen = require(3); - -/** - * A message decoder as generated by {@link codegen.decode.generate}. - * @typedef Decoder - * @type {function} - * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from - * @param {number} [length] Length of the message, if known beforehand - * @returns {Message} Populated runtime message - * @this Type - */ +var Enum = require(6), + Reader = require(15), + types = require(22), + util = require(23); /** - * Fallback {@link Decoder|decoder}. + * General purpose message decoder. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand * @returns {Message} Populated runtime message * @this Type + * @property {GenerateDecoder} generate Generates a type specific decoder */ -decode.fallback = function decode_fallback(readerOrBuffer, length) { +function decode(readerOrBuffer, length) { /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */ var fields = this.getFieldsById(), reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer), @@ -477,17 +475,20 @@ decode.fallback = function decode_fallback(readerOrBuffer, length) { } return message; /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */ -}; +} /** - * Generates a {@link Decoder|decoder} specific to the specified message type. + * Generates a decoder specific to the specified message type. + * @typedef GenerateDecoder + * @type {function} * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ -decode.generate = function decode_generate(mtype) { +/**/ +decode.generate = function generate(mtype) { /* eslint-disable no-unexpected-multiline */ var fields = mtype.getFieldsArray(); - var gen = codegen("r", "l") + var gen = util.codegen("r", "l") ("r instanceof Reader||(r=Reader.create(r))") ("var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())") @@ -570,40 +571,24 @@ decode.generate = function decode_generate(mtype) { /* eslint-enable no-unexpected-multiline */ }; -},{"17":17,"24":24,"25":25,"3":3,"8":8}],5:[function(require,module,exports){ +},{"15":15,"22":22,"23":23,"6":6}],5:[function(require,module,exports){ "use strict"; +module.exports = encode; -/** - * Wire format encoder using code generation on top of reflection that also provides a fallback. - * @exports codegen.encode - * @namespace - */ -var encode = exports; - -var Enum = require(8), - Writer = require(30), - types = require(24), - util = require(25), - codegen = require(3); - -/** - * A message encoder as generated by {@link codegen.encode.generate}. - * @typedef Encoder - * @type {function} - * @param {Message|Object} message Runtime message or plain object to encode - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - * @this Type - */ +var Enum = require(6), + Writer = require(32), + types = require(22), + util = require(23); /** - * Fallback {@link Encoder|encoder}. + * General purpose message encoder. * @param {Message|Object} message Runtime message or plain object to encode * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer * @this Type + * @property {GenerateEncoder} generate Generates a type specific encoder */ -encode.fallback = function encode_fallback(message, writer) { +function encode(message, writer) { /* eslint-disable block-scoped-var, no-redeclare */ if (!writer) writer = Writer.create(); @@ -673,17 +658,20 @@ encode.fallback = function encode_fallback(message, writer) { } return writer; /* eslint-enable block-scoped-var, no-redeclare */ -}; +} /** * Generates an {@link Encoder|encoder} specific to the specified message type. + * @typedef GenerateEncoder + * @type {function} * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ -encode.generate = function encode_generate(mtype) { +/**/ +encode.generate = function generate(mtype) { /* eslint-disable no-unexpected-multiline */ var fields = mtype.getFieldsArray(); - var gen = codegen("m", "w") + var gen = util.codegen("m", "w") ("w||(w=Writer.create())"); for (var i = 0; i < fields.length; ++i) { @@ -751,460 +739,35 @@ encode.generate = function encode_generate(mtype) { ("if(m%s!==undefined&&m%s!==%j)", prop, prop, field.defaultValue); } - - if (wireType !== undefined) gen - - ("w.tag(%d,%d).%s(m%s)", field.id, wireType, type, prop); - - else if (field.required) gen - - ("types[%d].encode(m%s,w.tag(%d,2).fork()).ldelim()", i, prop, field.id); - - else gen - - ("types[%d].encode(m%s,w.fork()).len&&w.ldelim(%d)||w.reset()", i, prop, field.id); - - } - } - return gen - ("return w"); - /* eslint-enable no-unexpected-multiline */ -}; - -},{"24":24,"25":25,"3":3,"30":30,"8":8}],6:[function(require,module,exports){ -"use strict"; - -/** - * Runtime message verifier using code generation on top of reflection that also provides a fallback. - * @exports codegen.verify - * @namespace - */ -var verify = exports; - -var Enum = require(8), - Type = require(23), - util = require(25), - codegen = require(3); -var isInteger = util.isInteger; - -/** - * A message verifier as generated by {@link codegen.verify.generate}. - * @typedef Verifier - * @type {function} - * @param {Message|Object} message Runtime message or plain object to verify - * @returns {?string} `null` if valid, otherwise the reason why it is not - * @this {Type} - */ - -function invalid(field, expected) { - return "invalid value for field " + field.getFullName() + " (" + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected)"; -} - -function verifyValue(field, value) { - switch (field.type) { - case "double": - case "float": - if (typeof value !== 'number') - return invalid(field, "number"); - break; - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": - if (!isInteger(value)) - return invalid(field, "integer"); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": - if (!(isInteger(value) || value && isInteger(value.low) && isInteger(value.high))) - return invalid(field, "integer|Long"); - break; - case "bool": - if (typeof value !== 'boolean') - return invalid(field, "boolean"); - break; - case "string": - if (!util.isString(value)) - return invalid(field, "string"); - break; - case "bytes": - if (!(value && typeof value.length === 'number' || util.isString(value))) - return invalid(field, "buffer"); - break; - default: - if (field.resolvedType instanceof Enum) { - if (typeof field.resolvedType.getValuesById()[value] !== 'number') - return invalid(field, "enum value"); - } else if (field.resolvedType instanceof Type) { - var reason = field.resolvedType.verify(value); - if (reason) - return reason; - } - break; - } - return null; -} - -function verifyKey(field, value) { - switch (field.keyType) { - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": - if (/^[\x00-\xff]{8}$/.test(value)) // eslint-disable-line no-control-regex - return null; - // fallthrough - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": - if (/^-?(?:0|[1-9]\d*)$/.test(value)) - return invalid(field, "integer key"); - break; - case "bool": - if (/^true|false|0|1$/.test(value)) - return invalid(field, "boolean key"); - break; - } - return null; -} - -/** - * Fallback {@link Verifier|verifier}. - * @param {Message|Object} message Runtime message or plain object to verify - * @returns {?string} `null` if valid, otherwise the reason why it is not - * @this {Type} - */ -verify.fallback = function verify_fallback(message) { - /* eslint-disable block-scoped-var, no-redeclare */ - var fields = this.getFieldsArray(), - i = 0, - reason; - while (i < fields.length) { - var field = fields[i++].resolve(), - value = message[field.name]; - - // map fields - if (field.map) { - - if (value !== undefined) { - if (!util.isObject(value)) - return invalid(field, "object"); - var keys = Object.keys(value); - for (var j = 0; j < keys.length; ++j) { - if (reason = verifyKey(field, keys[j])) // eslint-disable-line no-cond-assign - return reason; - if (reason = verifyValue(field, value[keys[j]])) // eslint-disable-line no-cond-assign - return reason; - } - } - - // repeated fields - } else if (field.repeated) { - - if (value !== undefined) { - if (!Array.isArray(value)) - return invalid(field, "array"); - for (var j = 0; j < value.length; ++j) - if (reason = verifyValue(field, value[j])) // eslint-disable-line no-cond-assign - return reason; - } - - // required or present fields - } else if (field.required || value !== undefined) { - - if (reason = verifyValue(field, value)) // eslint-disable-line no-cond-assign - return reason; - } - - } - return null; - /* eslint-enable block-scoped-var, no-redeclare */ -}; - -function genVerifyValue(gen, field, fieldIndex, ref) { - /* eslint-disable no-unexpected-multiline */ - switch (field.type) { - case "double": - case "float": gen - ("if(typeof %s!=='number')", ref) - ("return%j", invalid(field, "number")); - break; - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.isInteger(%s))", ref) - ("return%j", invalid(field, "integer")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!(util.isInteger(%s)||%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) - ("return%j", invalid(field, "integer|Long")); - break; - case "bool": gen - ("if(typeof %s!=='boolean')", ref) - ("return%j", invalid(field, "boolean")); - break; - case "string": gen - ("if(!util.isString(%s))", ref) - ("return%j", invalid(field, "string")); - break; - case "bytes": gen - ("if(!(%s&&typeof %s.length==='number'||util.isString(%s))", ref, ref, ref) - ("return%j", invalid(field, "buffer")); - break; - default: - if (field.resolvedType instanceof Enum) { gen - ("switch(%s){", ref) - ("default:") - ("return%j", invalid(field, "enum value")); - var values = util.toArray(field.resolvedType.values); - for (var j = 0; j < values.length; ++j) gen - ("case %d:", values[j]); - gen - ("break") - ("}"); - } else if (field.resolvedType instanceof Type) { gen - ("var r;") - ("if(r=types[%d].verify(%s))", fieldIndex, ref) - ("return r"); - } - break; - } - /* eslint-enable no-unexpected-multiline */ -} - -function genVerifyKey(gen, field, ref) { - /* eslint-disable no-unexpected-multiline */ - switch (field.keyType) { - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9]\\d*))$/.test(%s))", ref) - ("return%j", invalid(field, "integer|Long key")); - break; - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": - ("if(!/^-?(?:0|[1-9]\\d*)$/.test(%s))", ref) - ("return%j", invalid(field, "integer key")); - break; - case "bool": - ("if(!/^true|false|0|1$/.test(%s))", ref) - ("return%j", invalid(field, "boolean key")); - break; - } - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a {@link Verifier|verifier} specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -verify.generate = function verify_generate(mtype) { - /* eslint-disable no-unexpected-multiline */ - var fields = mtype.getFieldsArray(); - var gen = codegen("m"); - - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - prop = util.safeProp(field.name); - - // map fields - if (field.map) { gen - ("if(m%s!==undefined){", prop) - ("if(!util.isObject(m%s))", prop) - ("return%j", invalid(field, "object")) - ("var k=Object.keys(m%s)", prop) - ("for(var i=0;i " + reader.len); @@ -3580,27 +3144,8 @@ ReaderPrototype.bytes = function read_bytes() { * @returns {string} Value read */ ReaderPrototype.string = function read_string() { - // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js - var bytes = this.bytes(), - len = bytes.length; - if (len) { - var out = new Array(len), p = 0, c = 0; - while (p < len) { - var c1 = bytes[p++]; - if (c1 < 128) - out[c++] = c1; - else if (c1 > 191 && c1 < 224) - out[c++] = (c1 & 31) << 6 | bytes[p++] & 63; - else if (c1 > 239 && c1 < 365) { - var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000; - out[c++] = 0xD800 + (u >> 10); - out[c++] = 0xDC00 + (u & 1023); - } else - out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63; - } - return String.fromCharCode.apply(String, out.slice(0, c)); - } - return ""; + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); }; /** @@ -3790,17 +3335,17 @@ Reader._configure = configure; configure(); -},{"1":1,"29":29}],18:[function(require,module,exports){ +},{"1":1,"29":29}],16:[function(require,module,exports){ "use strict"; module.exports = Root; -var Namespace = require(13); +var Namespace = require(11); /** @alias Root.prototype */ var RootPrototype = Namespace.extend(Root); -var Field = require(9), - util = require(25), - common = require(7); +var Field = require(7), + util = require(23), + common = require(3); /** * Constructs a new root namespace instance. @@ -3880,7 +3425,7 @@ RootPrototype.load = function load(filename, callback) { if (!util.isString(source)) self.setOptions(source.options).addJSON(source.nested); else { - var parsed = require(16)(source, self); + var parsed = require(14)(source, self); if (parsed.imports) parsed.imports.forEach(function(name) { fetch(self.resolvePath(filename, name)); @@ -4071,7 +3616,7 @@ RootPrototype.toString = function toString() { return this.constructor.name; }; -},{"13":13,"16":16,"25":25,"7":7,"9":9}],19:[function(require,module,exports){ +},{"11":11,"14":14,"23":23,"3":3,"7":7}],17:[function(require,module,exports){ "use strict"; /** @@ -4080,9 +3625,9 @@ RootPrototype.toString = function toString() { */ var rpc = exports; -rpc.Service = require(20); +rpc.Service = require(18); -},{"20":20}],20:[function(require,module,exports){ +},{"18":18}],18:[function(require,module,exports){ "use strict"; module.exports = Service; @@ -4100,7 +3645,7 @@ function Service(rpcImpl) { EventEmitter.call(this); /** - * RPC implementation. Becomes `null` when the service is ended. + * RPC implementation. Becomes `null` once the service is ended. * @type {?RPCImpl} */ this.$rpc = rpcImpl; @@ -4125,19 +3670,19 @@ ServicePrototype.end = function end(endedByRPC) { return this; }; -},{"26":26}],21:[function(require,module,exports){ +},{"26":26}],19:[function(require,module,exports){ "use strict"; module.exports = Service; -var Namespace = require(13); +var Namespace = require(11); /** @alias Namespace.prototype */ var NamespacePrototype = Namespace.prototype; /** @alias Service.prototype */ var ServicePrototype = Namespace.extend(Service); -var Method = require(12), - util = require(25), - rpc = require(19); +var Method = require(10), + util = require(23), + rpc = require(17); /** * Constructs a new service instance. @@ -4336,7 +3881,7 @@ ServicePrototype.create = function create(rpcImpl, requestDelimited, responseDel return rpcService; }; -},{"12":12,"13":13,"19":19,"25":25}],22:[function(require,module,exports){ +},{"10":10,"11":11,"17":17,"23":23}],20:[function(require,module,exports){ "use strict"; module.exports = tokenize; @@ -4543,26 +4088,28 @@ function tokenize(source) { }; /* eslint-enable callback-return */ } -},{}],23:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ "use strict"; module.exports = Type; -var Namespace = require(13); +var Namespace = require(11); /** @alias Namespace.prototype */ var NamespacePrototype = Namespace.prototype; /** @alias Type.prototype */ var TypePrototype = Namespace.extend(Type); -var Enum = require(8), - OneOf = require(15), - Field = require(9), - Service = require(21), +var Enum = require(6), + OneOf = require(13), + Field = require(7), + Service = require(19), Class = require(2), - Message = require(11), - Reader = require(17), - Writer = require(30), - util = require(25), - codegen = require(3); + Message = require(9), + Reader = require(15), + Writer = require(32), + util = require(23); +var encode = require(5), + decode = require(4), + verify = require(31); /** * Constructs a new reflected message type instance. @@ -4869,14 +4416,14 @@ TypePrototype.create = function create(properties) { * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ -TypePrototype.encode = function encode(message, writer) { - return (this.encode = codegen.supported - ? codegen.encode.generate(this).eof(this.getFullName() + "$encode", { +TypePrototype.encode = function encode_setup(message, writer) { + return (this.encode = util.codegen.supported + ? encode.generate(this).eof(this.getFullName() + "$encode", { Writer : Writer, types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }), util : util }) - : codegen.encode.fallback + : encode ).call(this, message, writer); }; @@ -4896,14 +4443,14 @@ TypePrototype.encodeDelimited = function encodeDelimited(message, writer) { * @param {number} [length] Length of the message, if known beforehand * @returns {Message} Decoded message */ -TypePrototype.decode = function decode(readerOrBuffer, length) { - return (this.decode = codegen.supported - ? codegen.decode.generate(this).eof(this.getFullName() + "$decode", { +TypePrototype.decode = function decode_setup(readerOrBuffer, length) { + return (this.decode = util.codegen.supported + ? decode.generate(this).eof(this.getFullName() + "$decode", { Reader : Reader, types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }), util : util }) - : codegen.decode.fallback + : decode ).call(this, readerOrBuffer, length); }; @@ -4922,17 +4469,17 @@ TypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) { * @param {Message|Object} message Message to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ -TypePrototype.verify = function verify(message) { - return (this.verify = codegen.supported - ? codegen.verify.generate(this).eof(this.getFullName() + "$verify", { +TypePrototype.verify = function verify_setup(message) { + return (this.verify = util.codegen.supported + ? verify.generate(this).eof(this.getFullName() + "$verify", { types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }), util : util }) - : codegen.verify.fallback + : verify ).call(this, message); }; -},{"11":11,"13":13,"15":15,"17":17,"2":2,"21":21,"25":25,"3":3,"30":30,"8":8,"9":9}],24:[function(require,module,exports){ +},{"11":11,"13":13,"15":15,"19":19,"2":2,"23":23,"31":31,"32":32,"4":4,"5":5,"6":6,"7":7,"9":9}],22:[function(require,module,exports){ "use strict"; /** @@ -4941,7 +4488,7 @@ TypePrototype.verify = function verify(message) { */ var types = exports; -var util = require(25); +var util = require(23); var s = [ "double", // 0 @@ -5063,7 +4610,7 @@ types.packed = bake([ /* bool */ 0 ]); -},{"25":25}],25:[function(require,module,exports){ +},{"23":23}],23:[function(require,module,exports){ "use strict"; /** @@ -5072,6 +4619,8 @@ types.packed = bake([ */ var util = exports; +util.codegen = require(25); + /** * Converts an object's values to an array. * @param {Object.} object Object to convert @@ -5249,25 +4798,297 @@ util.merge = function merge(dst, src, ifNotSet) { if (dst[keys[i]] === undefined || !ifNotSet) dst[keys[i]] = src[keys[i]]; } - return dst; -}; + return dst; +}; + +/** + * Returns a safe property accessor for the specified properly name. + * @param {string} prop Property name + * @returns {string} Safe accessor + */ +util.safeProp = function safeProp(prop) { + return "['" + prop.replace(/\\/g, "\\\\").replace(/'/g, "\\'") + "']"; +}; + +/** + * Converts a string to camel case notation. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.camelCase = function camelCase(str) { + return str.substring(0,1) + + str.substring(1) + .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); }); +}; + +/** + * Converts a string to underscore notation. + * @param {string} str String to convert + * @returns {string} Converted string + */ +util.underScore = function underScore(str) { + return str.substring(0,1) + + str.substring(1) + .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); +}; + +/** + * Creates a new buffer of whatever type supported by the environment. + * @param {number} [size=0] Buffer size + * @returns {Uint8Array} Buffer + */ +util.newBuffer = function newBuffer(size) { + size = size || 0; + return util.Buffer + ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size) + : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size); +}; + +var runtime = require(29); + +util.EventEmitter = require(26); + +// Merge in runtime utility +util.merge(util, runtime); + +util._configure = function configure() { + runtime.Long = util.Long; +}; + +},{"25":25,"26":26,"29":29}],24:[function(require,module,exports){ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the base64 byte length of a string. + * @param {string} str Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(str) { + var p = str.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && str.charAt(p) === '=') + ++n; + return Math.ceil(str.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = [ + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 +]; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var str = new Array(Math.ceil((end - start) / 3) * 4); + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + str[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + str[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + str[i++] = b64[t | b >> 6]; + str[i++] = b64[b & 63]; + j = 0; + break; + } + } + if (j) { + str[i++] = b64[t]; + str[i ] = 61; + if (j === 1) + str[i + 1] = 61; + } + return String.fromCharCode.apply(String, str); +}; + +// Base64 decoding table +var s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i; +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} src Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(src, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < src.length;) { + var c = src.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; + +},{}],25:[function(require,module,exports){ +"use strict"; +module.exports = codegen; + +var blockOpenRe = /[{[]$/, + blockCloseRe = /^[}\]]/, + casingRe = /:$/, + branchRe = /^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/, + breakRe = /\b(?:break|continue);?$|^\s*return\b/; + +/** + * A closure for generating functions programmatically. + * @memberof util + * @namespace + * @function + * @param {...string} params Function parameter names + * @returns {Codegen} Codegen instance + * @property {boolean} supported Whether code generation is supported by the environment. + * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging. + */ +function codegen() { + var args = Array.prototype.slice.call(arguments), + src = ['\t"use strict"'], + indent = 1, + inCase = false; + + /** + * A codegen instance as returned by {@link codegen}, that also is a sprintf-like appender function. + * @typedef Codegen + * @type {function} + * @param {string} format Format string + * @param {...*} args Replacements + * @returns {Codegen} Itself + * @property {function(string=):string} str Stringifies the so far generated function source. + * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope. + */ + /**/ + function gen() { + var line = sprintf.apply(null, arguments); + var level = indent; + if (src.length) { + var prev = src[src.length - 1]; + + // block open or one time branch + if (blockOpenRe.test(prev)) + level = ++indent; // keep + else if (branchRe.test(prev)) + ++level; // once + + // casing + if (casingRe.test(prev) && !casingRe.test(line)) { + level = ++indent; + inCase = true; + } else if (inCase && breakRe.test(prev)) { + level = --indent; + inCase = false; + } + + // block close + if (blockCloseRe.test(line)) + level = --indent; + } + for (var index = 0; index < level; ++index) + line = "\t" + line; + src.push(line); + return gen; + } + + /** + * Stringifies the so far generated function source. + * @param {string} [name] Function name, defaults to generate an anonymous function + * @returns {string} Function source using tabs for indentation + * @inner + */ + function str(name) { + return "function " + (name ? name.replace(/[^\w_$]/g, "_") : "") + "(" + args.join(", ") + ") {\n" + src.join("\n") + "\n}"; + } + + gen.str = str; + + /** + * Ends generation and builds the function whilst applying a scope. + * @param {string} [name] Function name, defaults to generate an anonymous function + * @param {Object} [scope] Function scope + * @returns {function} The generated function, with scope applied if specified + * @inner + */ + function eof(name, scope) { + if (typeof name === 'object') { + scope = name; + name = undefined; + } + var source = gen.str(name); + if (codegen.verbose) + console.log("--- codegen ---\n" + source.replace(/^/mg, "> ").replace(/\t/g, " ")); // eslint-disable-line no-console + var keys = Object.keys(scope || (scope = {})); + return Function.apply(null, keys.concat("return " + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func + // ^ Creates a wrapper function with the scoped variable names as its parameters, + // calls it with the respective scoped variable values ^ + // and returns our brand-new properly scoped function. + // + // This works because "Invoking the Function constructor as a function (without using the + // new operator) has the same effect as invoking it as a constructor." + // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function + } -/** - * Returns a safe property accessor for the specified properly name. - * @param {string} prop Property name - * @returns {string} Safe accessor - */ -util.safeProp = function safeProp(prop) { - return "['" + prop.replace(/\\/g, "\\\\").replace(/'/g, "\\'") + "']"; -}; + gen.eof = eof; -/** - * Minimalistic sprintf. - * @param {string} format Format string - * @param {...*} args Replacements - * @returns {string} Formatted string - */ -util.sprintf = function sprintf(format) { + return gen; +} + +function sprintf(format) { var params = Array.prototype.slice.call(arguments, 1), index = 0; return format.replace(/%([djs])/g, function($0, $1) { @@ -5275,60 +5096,16 @@ util.sprintf = function sprintf(format) { switch ($1) { case "j": return JSON.stringify(param); - case "p": - return util.safeProp(param); default: return String(param); } }); -}; - -/** - * Converts a string to camel case notation. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.camelCase = function camelCase(str) { - return str.substring(0,1) - + str.substring(1) - .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); }); -}; - -/** - * Converts a string to underscore notation. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.underScore = function underScore(str) { - return str.substring(0,1) - + str.substring(1) - .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); -}; - -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number} [size=0] Buffer size - * @returns {Uint8Array} Buffer - */ -util.newBuffer = function newBuffer(size) { - size = size || 0; - return util.Buffer - ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size) - : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size); -}; - -var runtime = require(29); - -util.EventEmitter = require(26); - -// Merge in runtime utility -util.merge(util, runtime); +} -util._configure = function configure() { - runtime.Long = util.Long; -}; +codegen.supported = false; try { codegen.supported = codegen("a","b")("return a-b").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty +codegen.verbose = false; -},{"26":26,"29":29}],26:[function(require,module,exports){ +},{}],26:[function(require,module,exports){ "use strict"; module.exports = EventEmitter; @@ -5411,7 +5188,7 @@ EventEmitterPrototype.emit = function emit(evt) { module.exports = LongBits; -var util = require(25); +var util = require(23); /** * Any compatible Long instance. @@ -5609,18 +5386,36 @@ LongBitsPrototype.length = function length() { return part2 < 1 << 7 ? 9 : 10; }; -},{"25":25}],28:[function(require,module,exports){ +},{"23":23}],28:[function(require,module,exports){ "use strict"; module.exports = pool; /** - * A drop-in buffer pool, similar in functionality to what node uses for buffers. + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. * @memberof util * @function - * @param {function(number):Uint8Array} alloc Allocator - * @param {function(number, number):Uint8Array} slice Slicer + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer * @param {number} [size=8192] Slab size - * @returns {function(number):Uint8Array} Pooled allocator + * @returns {PoolAllocator} Pooled allocator */ function pool(alloc, slice, size) { var SIZE = size || 8192; @@ -5649,7 +5444,9 @@ var util = exports; var LongBits = util.LongBits = require(27); -util.pool = require(28); +util.base64 = require(24); +util.utf8 = require(30); +util.pool = require(28); /** * Whether running within node or not. @@ -5797,125 +5594,385 @@ util.emptyArray = Object.freeze([]); */ util.emptyObject = Object.freeze({}); +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{"24":24,"27":27,"28":28,"30":30,"buffer":"buffer","long":"long"}],30:[function(require,module,exports){ +"use strict"; + /** - * Calculates the byte length of a base64 encoded string. - * @param {string} str Base64 encoded string + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} str String * @returns {number} Byte length */ -util.length64 = function length64(str) { - var p = str.length; - var n = 0; - if (p) - while (--p % 4 > 1 && str.charAt(p) === '=') - ++n; - return Math.ceil(str.length * 3) / 4 - n; +utf8.length = function length(str) { + var strlen = str.length >>> 0; + var len = 0, + c = 0; + for (var i = 0; i < strlen; ++i) { + c = str.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (str.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Writes a string as UTF8 bytes. + * @param {Uint8Array} buf Destination buffer + * @param {number} pos Destination offset + * @param {string} str Source string + * @returns {number} Bytes written + */ +utf8.write = function(buf, pos, str) { + var start = pos; + for (var i = 0; i < str.length; ++i) { + var c1 = str.charCodeAt(i), c2; + if (c1 < 128) { + buf[pos++] = c1; + } else if (c1 < 2048) { + buf[pos++] = c1 >> 6 | 192; + buf[pos++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = str.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buf[pos++] = c1 >> 18 | 240; + buf[pos++] = c1 >> 12 & 63 | 128; + buf[pos++] = c1 >> 6 & 63 | 128; + buf[pos++] = c1 & 63 | 128; + } else { + buf[pos++] = c1 >> 12 | 224; + buf[pos++] = c1 >> 6 & 63 | 128; + buf[pos++] = c1 & 63 | 128; + } + } + return pos - start; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source offset + * @param {number} len Source length + * @returns {string} String read + */ +utf8.read = function(buf, pos, len) { + if (len) { + var out = [], + i = 0, // char offset + t; // temporary + while (pos < len) { + t = buf[pos++]; + if (t < 128) + out[i++] = t; + else if (t > 191 && t < 224) + out[i++] = (t & 31) << 6 | buf[pos++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buf[pos++] & 63) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63) - 0x10000; + out[i++] = 0xD800 + (t >> 10); + out[i++] = 0xDC00 + (t & 1023); + } else + out[i++] = (t & 15) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63; + } + return String.fromCharCode.apply(String, out.slice(0, i)); + } + return ""; }; -// Base64 encoding table -var b64 = [ - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 -]; +},{}],31:[function(require,module,exports){ +"use strict"; +module.exports = verify; + +var Enum = require(6), + Type = require(21), + util = require(23); +var isInteger = util.isInteger; + +function invalid(field, expected) { + return "invalid value for field " + field.getFullName() + " (" + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected)"; +} + +function verifyValue(field, value) { + switch (field.type) { + case "double": + case "float": + if (typeof value !== 'number') + return invalid(field, "number"); + break; + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": + if (!isInteger(value)) + return invalid(field, "integer"); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": + if (!(isInteger(value) || value && isInteger(value.low) && isInteger(value.high))) + return invalid(field, "integer|Long"); + break; + case "bool": + if (typeof value !== 'boolean') + return invalid(field, "boolean"); + break; + case "string": + if (!util.isString(value)) + return invalid(field, "string"); + break; + case "bytes": + if (!(value && typeof value.length === 'number' || util.isString(value))) + return invalid(field, "buffer"); + break; + default: + if (field.resolvedType instanceof Enum) { + if (typeof field.resolvedType.getValuesById()[value] !== 'number') + return invalid(field, "enum value"); + } else if (field.resolvedType instanceof Type) { + var reason = field.resolvedType.verify(value); + if (reason) + return reason; + } + break; + } + return null; +} + +function verifyKey(field, value) { + switch (field.keyType) { + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": + if (/^[\x00-\xff]{8}$/.test(value)) // eslint-disable-line no-control-regex + return null; + // fallthrough + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": + if (/^-?(?:0|[1-9]\d*)$/.test(value)) + return invalid(field, "integer key"); + break; + case "bool": + if (/^true|false|0|1$/.test(value)) + return invalid(field, "boolean key"); + break; + } + return null; +} + +/** + * General purpose message verifier. + * @param {Message|Object} message Runtime message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + * @this {Type} + * @property {GenerateVerifier} generate Generates a type specific verifier + */ +function verify(message) { + /* eslint-disable block-scoped-var, no-redeclare */ + var fields = this.getFieldsArray(), + i = 0, + reason; + while (i < fields.length) { + var field = fields[i++].resolve(), + value = message[field.name]; + + // map fields + if (field.map) { + + if (value !== undefined) { + if (!util.isObject(value)) + return invalid(field, "object"); + var keys = Object.keys(value); + for (var j = 0; j < keys.length; ++j) { + if (reason = verifyKey(field, keys[j])) // eslint-disable-line no-cond-assign + return reason; + if (reason = verifyValue(field, value[keys[j]])) // eslint-disable-line no-cond-assign + return reason; + } + } + + // repeated fields + } else if (field.repeated) { -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -util.encode64 = function encode64(buffer, start, end) { - var dst = new Array(Math.ceil((end - start) / 3) * 4); - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - dst[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - dst[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - dst[i++] = b64[t | b >> 6]; - dst[i++] = b64[b & 63]; - j = 0; - break; + if (value !== undefined) { + if (!Array.isArray(value)) + return invalid(field, "array"); + for (var j = 0; j < value.length; ++j) + if (reason = verifyValue(field, value[j])) // eslint-disable-line no-cond-assign + return reason; + } + + // required or present fields + } else if (field.required || value !== undefined) { + + if (reason = verifyValue(field, value)) // eslint-disable-line no-cond-assign + return reason; } + } - switch (j) { - case 1: - dst[i++] = b64[t]; - dst[i++] = 61; - dst[i ] = 61; + return null; + /* eslint-enable block-scoped-var, no-redeclare */ +} + +function genVerifyValue(gen, field, fieldIndex, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.type) { + case "double": + case "float": gen + ("if(typeof %s!=='number')", ref) + ("return%j", invalid(field, "number")); break; - case 2: - dst[i++] = b64[t]; - dst[i ] = 61; + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": gen + ("if(!util.isInteger(%s))", ref) + ("return%j", invalid(field, "integer")); + break; + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!(util.isInteger(%s)||%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) + ("return%j", invalid(field, "integer|Long")); + break; + case "bool": gen + ("if(typeof %s!=='boolean')", ref) + ("return%j", invalid(field, "boolean")); + break; + case "string": gen + ("if(!util.isString(%s))", ref) + ("return%j", invalid(field, "string")); + break; + case "bytes": gen + ("if(!(%s&&typeof %s.length==='number'||util.isString(%s))", ref, ref, ref) + ("return%j", invalid(field, "buffer")); + break; + default: + if (field.resolvedType instanceof Enum) { gen + ("switch(%s){", ref) + ("default:") + ("return%j", invalid(field, "enum value")); + var values = util.toArray(field.resolvedType.values); + for (var j = 0; j < values.length; ++j) gen + ("case %d:", values[j]); + gen + ("break") + ("}"); + } else if (field.resolvedType instanceof Type) { gen + ("var r;") + ("if(r=types[%d].verify(%s))", fieldIndex, ref) + ("return r"); + } break; } - return String.fromCharCode.apply(String, dst); -}; + /* eslint-enable no-unexpected-multiline */ +} -// Base64 decoding table -var s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i; -var invalidEncoding = "invalid encoding"; +function genVerifyKey(gen, field, ref) { + /* eslint-disable no-unexpected-multiline */ + switch (field.keyType) { + case "int64": + case "uint64": + case "sint64": + case "fixed64": + case "sfixed64": gen + ("if(!/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9]\\d*))$/.test(%s))", ref) + ("return%j", invalid(field, "integer|Long key")); + break; + case "int32": + case "uint32": + case "sint32": + case "fixed32": + case "sfixed32": + ("if(!/^-?(?:0|[1-9]\\d*)$/.test(%s))", ref) + ("return%j", invalid(field, "integer key")); + break; + case "bool": + ("if(!/^true|false|0|1$/.test(%s))", ref) + ("return%j", invalid(field, "boolean key")); + break; + } + /* eslint-enable no-unexpected-multiline */ +} /** - * Decodes a base64 encoded string to a buffer. - * @param {string} src Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid + * Generates a verifier specific to the specified message type. + * @typedef GenerateVerifier + * @type {function} + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance */ -util.decode64 = function decode64(src, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < src.length;) { - var c = src.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; +/**/ +verify.generate = function generate(mtype) { + /* eslint-disable no-unexpected-multiline */ + var fields = mtype.getFieldsArray(); + var gen = util.codegen("m"); + + for (var i = 0; i < fields.length; ++i) { + var field = fields[i].resolve(), + prop = util.safeProp(field.name); + + // map fields + if (field.map) { gen + ("if(m%s!==undefined){", prop) + ("if(!util.isObject(m%s))", prop) + ("return%j", invalid(field, "object")) + ("var k=Object.keys(m%s)", prop) + ("for(var i=0;i>> 0; if (typeof value === 'string' && len) { - var buf = Writer.alloc(len = util.length64(value)); - util.decode64(value, buf, 0); + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); value = buf; } return len @@ -6351,56 +6410,15 @@ WriterPrototype.bytes = function write_bytes(value) { : this.push(writeByte, 1, 0); }; -function writeString(buf, pos, val) { - for (var i = 0; i < val.length; ++i) { - var c1 = val.charCodeAt(i), c2; - if (c1 < 128) { - buf[pos++] = c1; - } else if (c1 < 2048) { - 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); - ++i; - buf[pos++] = c1 >> 18 | 240; - buf[pos++] = c1 >> 12 & 63 | 128; - buf[pos++] = c1 >> 6 & 63 | 128; - buf[pos++] = c1 & 63 | 128; - } else { - buf[pos++] = c1 >> 12 | 224; - buf[pos++] = c1 >> 6 & 63 | 128; - buf[pos++] = c1 & 63 | 128; - } - } -} - -function byteLength(val) { - var strlen = val.length >>> 0; - 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 len; -} - /** * Writes a string. * @param {string} value Value to write * @returns {Writer} `this` */ WriterPrototype.string = function write_string(value) { - var len = byteLength(value); + var len = utf8.length(value); return len - ? this.uint32(len).push(writeString, len, value) + ? this.uint32(len).push(utf8.write, len, value) : this.push(writeByte, 1, 0); }; @@ -6523,7 +6541,7 @@ BufferWriterPrototype.double = function write_double_buffer(value) { function writeBytesBuffer(buf, pos, val) { if (val.length) val.copy(buf, pos, 0, val.length); -}; +} /** * @override @@ -6541,13 +6559,13 @@ 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); + utf8.write(buf, pos, val); else buf.utf8Write(val, pos); } : function writeString_buffer_write(buf, pos, val) { if (val.length < 40) - writeString(buf, pos, val); + utf8.write(buf, pos, val); else buf.write(val, pos); }; @@ -6561,14 +6579,14 @@ var writeStringBuffer = (function() { // eslint-disable-line wrap-iife */ BufferWriterPrototype.string = function write_string_buffer(value) { var len = value.length < 40 - ? byteLength(value) + ? utf8.length(value) : util.Buffer.byteLength(value); return len ? this.uint32(len).push(writeStringBuffer, len, value) : this.push(writeByte, 1, 0); }; -},{"1":1,"29":29}],31:[function(require,module,exports){ +},{"1":1,"29":29}],33:[function(require,module,exports){ (function (global){ "use strict"; var protobuf = global.protobuf = exports; @@ -6639,39 +6657,41 @@ function loadSync(filename, root) { protobuf.loadSync = loadSync; // Parser -protobuf.tokenize = require(22); -protobuf.parse = require(16); +protobuf.tokenize = require(20); +protobuf.parse = require(14); // Serialization -protobuf.Writer = require(30); +protobuf.Writer = require(32); protobuf.BufferWriter = protobuf.Writer.BufferWriter; var Reader = -protobuf.Reader = require(17); +protobuf.Reader = require(15); protobuf.BufferReader = protobuf.Reader.BufferReader; -protobuf.codegen = require(3); +protobuf.encode = require(5); +protobuf.decode = require(4); +protobuf.verify = require(31); // Reflection -protobuf.ReflectionObject = require(14); -protobuf.Namespace = require(13); -protobuf.Root = require(18); -protobuf.Enum = require(8); -protobuf.Type = require(23); -protobuf.Field = require(9); -protobuf.OneOf = require(15); -protobuf.MapField = require(10); -protobuf.Service = require(21); -protobuf.Method = require(12); +protobuf.ReflectionObject = require(12); +protobuf.Namespace = require(11); +protobuf.Root = require(16); +protobuf.Enum = require(6); +protobuf.Type = require(21); +protobuf.Field = require(7); +protobuf.OneOf = require(13); +protobuf.MapField = require(8); +protobuf.Service = require(19); +protobuf.Method = require(10); // Runtime protobuf.Class = require(2); -protobuf.Message = require(11); +protobuf.Message = require(9); // Utility -protobuf.types = require(24); -protobuf.common = require(7); -protobuf.rpc = require(19); +protobuf.types = require(22); +protobuf.common = require(3); +protobuf.rpc = require(17); var util = -protobuf.util = require(25); +protobuf.util = require(23); protobuf.configure = configure; /** @@ -6695,7 +6715,7 @@ if (typeof define === 'function' && define.amd) }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"10":10,"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"2":2,"21":21,"22":22,"23":23,"24":24,"25":25,"3":3,"30":30,"7":7,"8":8,"9":9}]},{},[31]) +},{"10":10,"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"19":19,"2":2,"20":20,"21":21,"22":22,"23":23,"3":3,"31":31,"32":32,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9}]},{},[33]) //# sourceMappingURL=protobuf.js.map diff --git a/dist/protobuf.js.map b/dist/protobuf.js.map index fbe28064d..d61b97b27 100644 --- a/dist/protobuf.js.map +++ b/dist/protobuf.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/class.js","src/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/mapfield.js","src/message.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/eventemitter.js","src/util/longbits.js","src/util/pool.js","src/util/runtime.js","src/writer.js","src/index.js"],"names":[],"mappings":";;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC3oBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Class;\r\n\r\nvar Message = require(11),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a class instance, which is also a message prototype.\r\n * @classdesc Runtime class providing the tools to create your own custom classes.\r\n * @constructor\r\n * @param {Type} type Reflected type\r\n * @abstract\r\n */\r\nfunction Class(type) {\r\n return Class.create(type);\r\n}\r\n\r\n/**\r\n * Constructs a new message prototype for the specified reflected type and sets up its constructor.\r\n * @param {Type} type Reflected message type\r\n * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted\r\n * @returns {Message} Message prototype\r\n */\r\nClass.create = function create(type, ctor) {\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n var clazz = ctor;\r\n if (clazz) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"ctor\", \"a function\");\r\n } else\r\n clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife\r\n return function Message(properties) {\r\n MessageCtor.call(this, properties);\r\n };\r\n })(Message);\r\n\r\n // Let's pretend...\r\n clazz.constructor = Class;\r\n \r\n // new Class() -> Message.prototype\r\n var prototype = clazz.prototype = new Message();\r\n prototype.constructor = clazz;\r\n\r\n // Static methods on Message are instance methods on Class and vice versa.\r\n util.merge(clazz, Message, true);\r\n\r\n // Classes and messages reference their reflected type\r\n clazz.$type = type;\r\n prototype.$type = type;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n // Register\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n};\r\n\r\n// Static methods on Message are instance methods on Class and vice versa.\r\nClass.prototype = Message;\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @name Class#encode\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @name Class#encodeDelimited\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Class#decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Class#decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Class#verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar util = require(25);\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {Codegen} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {Codegen} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = util.sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n\r\ncodegen.encode = require(5);\r\ncodegen.decode = require(4);\r\ncodegen.verify = require(6);\r\n","\"use strict\";\r\n\r\n/**\r\n * Wire format decoder using code generation on top of reflection that also provides a fallback.\r\n * @exports codegen.decode\r\n * @namespace\r\n */\r\nvar decode = exports;\r\n\r\nvar Enum = require(8),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * A message decoder as generated by {@link codegen.decode.generate}.\r\n * @typedef Decoder\r\n * @type {function}\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n */\r\n\r\n/**\r\n * Fallback {@link Decoder|decoder}.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n */\r\ndecode.fallback = function decode_fallback(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n};\r\n\r\n/**\r\n * Generates a {@link Decoder|decoder} specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\ndecode.generate = function decode_generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(8),\r\n MapField = require(10),\r\n types = require(24),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Message#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(9);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(8),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * \r\n * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`.\r\n * @classdesc Abstract runtime message.\r\n * @extends {Object}\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link Class.create}\r\n */\r\nfunction Message(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/** @alias Message.prototype */\r\nvar MessagePrototype = Message.prototype;\r\n\r\n/**\r\n * Converts this message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nMessagePrototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decode = function decode(readerOrBuffer) {\r\n return this.$type.decode(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n return this.$type.decodeDelimited(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(8),\r\n Type = require(23),\r\n Field = require(9),\r\n Service = require(21),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(18),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Constructor prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var prototype = constructor.prototype = Object.create(this.prototype);\r\n prototype.constructor = constructor;\r\n constructor.extend = extend;\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(9),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(22),\r\n Root = require(18),\r\n Type = require(23),\r\n Field = require(9),\r\n MapField = require(10),\r\n OneOf = require(15),\r\n Enum = require(8),\r\n Service = require(21),\r\n Method = require(12),\r\n types = require(24),\r\n util = require(25);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js\r\n var bytes = this.bytes(),\r\n len = bytes.length;\r\n if (len) {\r\n var out = new Array(len), p = 0, c = 0;\r\n while (p < len) {\r\n var c1 = bytes[p++];\r\n if (c1 < 128)\r\n out[c++] = c1;\r\n else if (c1 > 191 && c1 < 224)\r\n out[c++] = (c1 & 31) << 6 | bytes[p++] & 63;\r\n else if (c1 > 239 && c1 < 365) {\r\n var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000;\r\n out[c++] = 0xD800 + (u >> 10);\r\n out[c++] = 0xDC00 + (u & 1023);\r\n } else\r\n out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, c));\r\n }\r\n return \"\";\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader._configure = configure;\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(9),\r\n util = require(25),\r\n common = require(7);\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(16)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(20);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` when the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(12),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Uint8Array} [responseData] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(8),\r\n OneOf = require(15),\r\n Field = require(9),\r\n Service = require(21),\r\n Class = require(2),\r\n Message = require(11),\r\n Reader = require(17),\r\n Writer = require(30),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Class}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n return this._ctor || (this._ctor = Class.create(this).constructor);\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Message))\r\n throw util._TypeError(\"ctor\", \"a Message constructor\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @returns {Message} Runtime message\r\n */\r\nTypePrototype.create = function create(properties) {\r\n return new (this.getCtor())(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode(message, writer) {\r\n return (this.encode = codegen.supported\r\n ? codegen.encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.encode.fallback\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decode = function decode(readerOrBuffer, length) {\r\n return (this.decode = codegen.supported\r\n ? codegen.decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.decode.fallback\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Message|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify(message) {\r\n return (this.verify = codegen.supported\r\n ? codegen.verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.verify.fallback\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(25);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} [callback] Callback function\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (util.isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Minimalistic sprintf.\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {string} Formatted string\r\n */\r\nutil.sprintf = function sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n case \"p\":\r\n return util.safeProp(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0; \r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nvar runtime = require(29);\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, runtime);\r\n\r\nutil._configure = function configure() {\r\n runtime.Long = util.Long;\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(25);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n // fallthrough\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo, this.hi, unsigned)\r\n : { low: this.lo, high: this.hi, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * A drop-in buffer pool, similar in functionality to what node uses for buffers.\r\n * @memberof util\r\n * @function\r\n * @param {function(number):Uint8Array} alloc Allocator\r\n * @param {function(number, number):Uint8Array} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {function(number):Uint8Array} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} str Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nutil.length64 = function length64(str) {\r\n var p = str.length;\r\n var n = 0;\r\n if (p)\r\n while (--p % 4 > 1 && str.charAt(p) === '=')\r\n ++n;\r\n return Math.ceil(str.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = [\r\n 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\r\n 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,\r\n 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\r\n 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\r\n];\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nutil.encode64 = function encode64(buffer, start, end) {\r\n var dst = new Array(Math.ceil((end - start) / 3) * 4);\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n dst[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n dst[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n dst[i++] = b64[t | b >> 6];\r\n dst[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n }\r\n switch (j) {\r\n case 1:\r\n dst[i++] = b64[t];\r\n dst[i++] = 61;\r\n dst[i ] = 61;\r\n break;\r\n case 2:\r\n dst[i++] = b64[t];\r\n dst[i ] = 61;\r\n break;\r\n }\r\n return String.fromCharCode.apply(String, dst);\r\n};\r\n\r\n// Base64 decoding table\r\nvar s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i;\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} src Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nutil.decode64 = function decode64(src, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < src.length;) {\r\n var c = src.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {*} val Value to write\r\n * @param {number} len Value byte length\r\n * @private\r\n * @ignore\r\n */\r\nfunction Op(fn, val, len) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {?Writer.Op}\r\n */\r\n this.next = null;\r\n}\r\n\r\nWriter.Op = Op;\r\n\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @param {State} next Next state entry\r\n * @private\r\n * @ignore\r\n */\r\nfunction State(writer, next) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {?State}\r\n */\r\n this.next = next;\r\n}\r\n\r\nWriter.State = State;\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {?Object}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling linked operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = function create() {\r\n return new (util.Buffer && BufferWriter || Writer);\r\n};\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new ArrayImpl(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\nif (ArrayImpl !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice);\r\n\r\n/** @alias Writer.prototype */\r\nvar WriterPrototype = Writer.prototype;\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.push = function push(fn, len, val) {\r\n var op = new Op(fn, val, len);\r\n this.tail.next = op;\r\n this.tail = op;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(buf, pos, val) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\n/**\r\n * Writes a tag.\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.tag = function write_tag(id, wireType) {\r\n return this.push(writeByte, 1, id << 3 | wireType & 7);\r\n};\r\n\r\nfunction writeVarint32(buf, pos, val) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nfunction writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n}\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? writeBytes_set\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (typeof value === 'string' && len) {\r\n var buf = Writer.alloc(len = util.length64(value));\r\n util.decode64(value, buf, 0);\r\n value = buf;\r\n }\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nfunction writeString(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i) {\r\n var c1 = val.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n}\r\n\r\nfunction byteLength(val) {\r\n var strlen = val.length >>> 0;\r\n var len = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n var c1 = val.charCodeAt(i);\r\n if (c1 < 128)\r\n len += 1;\r\n else if (c1 < 2048)\r\n len += 2;\r\n else if ((c1 & 0xFC00) === 0xD800 && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n}\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeString, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n if (typeof value === 'string')\r\n value = util.Buffer.from && util.Buffer.from(value, \"base64\") || new util.Buffer(value, \"base64\");\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? byteLength(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\n var Reader =\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.codegen = require(\"./codegen\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Class = require(\"./class\");\r\nprotobuf.Message = require(\"./message\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\n var util =\r\nprotobuf.util = require(\"./util\");\r\nprotobuf.configure = configure;\r\n\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n util._configure();\r\n Reader._configure();\r\n}\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/class.js","src/common.js","src/decode.js","src/encode.js","src/enum.js","src/field.js","src/mapfield.js","src/message.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/base64/index.js","src/util/codegen/index.js","src/util/eventemitter/index.js","src/util/longbits.js","src/util/pool/index.js","src/util/runtime.js","src/util/utf8/index.js","src/verify.js","src/writer.js","src/index.js"],"names":[],"mappings":";;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"protobuf.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Class;\r\n\r\nvar Message = require(9),\r\n Type = require(21),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a class instance, which is also a message prototype.\r\n * @classdesc Runtime class providing the tools to create your own custom classes.\r\n * @constructor\r\n * @param {Type} type Reflected type\r\n * @abstract\r\n */\r\nfunction Class(type) {\r\n return Class.create(type);\r\n}\r\n\r\n/**\r\n * Constructs a new message prototype for the specified reflected type and sets up its constructor.\r\n * @param {Type} type Reflected message type\r\n * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted\r\n * @returns {Message} Message prototype\r\n */\r\nClass.create = function create(type, ctor) {\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n var clazz = ctor;\r\n if (clazz) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"ctor\", \"a function\");\r\n } else\r\n clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife\r\n return function Message(properties) {\r\n MessageCtor.call(this, properties);\r\n };\r\n })(Message);\r\n\r\n // Let's pretend...\r\n clazz.constructor = Class;\r\n \r\n // new Class() -> Message.prototype\r\n var prototype = clazz.prototype = new Message();\r\n prototype.constructor = clazz;\r\n\r\n // Static methods on Message are instance methods on Class and vice versa.\r\n util.merge(clazz, Message, true);\r\n\r\n // Classes and messages reference their reflected type\r\n clazz.$type = type;\r\n prototype.$type = type;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n // Register\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n};\r\n\r\n// Static methods on Message are instance methods on Class and vice versa.\r\nClass.prototype = Message;\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @name Class#encode\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @name Class#encodeDelimited\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Class#decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Class#decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Class#verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n","\"use strict\";\r\n\r\nmodule.exports = common;\r\n\r\n/**\r\n * Provides common type definitions.\r\n * Can also be used to provide additional google types or your own custom types.\r\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\r\n * @param {Object} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\r\n * @returns {undefined}\r\n * @property {Object} google/protobuf/any.proto Any\r\n * @property {Object} google/protobuf/duration.proto Duration\r\n * @property {Object} google/protobuf/empty.proto Empty\r\n * @property {Object} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\r\n * @property {Object} google/protobuf/timestamp.proto Timestamp\r\n */\r\nfunction common(name, json) {\r\n if (!/\\/|\\./.test(name)) {\r\n name = \"google/protobuf/\" + name + \".proto\";\r\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\r\n }\r\n common[name] = json;\r\n}\r\n\r\n// Not provided because of limited use (feel free to discuss or to provide yourself):\r\n// - google/protobuf/descriptor.proto\r\n// - google/protobuf/field_mask.proto\r\n// - google/protobuf/source_context.proto\r\n// - google/protobuf/type.proto\r\n// - google/protobuf/wrappers.proto\r\n\r\ncommon(\"any\", {\r\n Any: {\r\n fields: {\r\n type_url: {\r\n type: \"string\",\r\n id: 1\r\n },\r\n value: {\r\n type: \"bytes\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\nvar timeType;\r\n\r\ncommon(\"duration\", {\r\n Duration: timeType = {\r\n fields: {\r\n seconds: {\r\n type: \"int64\",\r\n id: 1\r\n },\r\n nanos: {\r\n type: \"int32\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"timestamp\", {\r\n Timestamp: timeType\r\n});\r\n\r\ncommon(\"empty\", {\r\n Empty: {\r\n fields: {}\r\n }\r\n});\r\n\r\ncommon(\"struct\", {\r\n Struct: {\r\n fields: {\r\n fields: {\r\n keyType: \"string\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n },\r\n Value: {\r\n oneofs: {\r\n kind: {\r\n oneof: [ \"nullValue\", \"numberValue\", \"stringValue\", \"boolValue\", \"structValue\", \"listValue\" ]\r\n }\r\n },\r\n fields: {\r\n nullValue: {\r\n type: \"NullValue\",\r\n id: 1\r\n },\r\n numberValue: {\r\n type: \"double\",\r\n id: 2\r\n },\r\n stringValue: {\r\n type: \"string\",\r\n id: 3\r\n },\r\n boolValue: {\r\n type: \"bool\",\r\n id: 4\r\n },\r\n structValue: {\r\n type: \"Struct\",\r\n id: 5\r\n },\r\n listValue: {\r\n type: \"ListValue\",\r\n id: 6\r\n }\r\n }\r\n },\r\n NullValue: {\r\n values: {\r\n NULL_VALUE: 0\r\n }\r\n },\r\n ListValue: {\r\n fields: {\r\n values: {\r\n rule: \"repeated\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n","\"use strict\";\r\nmodule.exports = decode;\r\n\r\nvar Enum = require(6),\r\n Reader = require(15),\r\n types = require(22),\r\n util = require(23);\r\n\r\n/**\r\n * General purpose message decoder.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n * @property {GenerateDecoder} generate Generates a type specific decoder\r\n */\r\nfunction decode(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a decoder specific to the specified message type.\r\n * @typedef GenerateDecoder\r\n * @type {function}\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\n/**/\r\ndecode.generate = function generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = util.codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(21),\r\n Enum = require(6),\r\n MapField = require(8),\r\n types = require(22),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Message#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(7);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(6),\r\n types = require(22),\r\n util = require(23);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * \r\n * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`.\r\n * @classdesc Abstract runtime message.\r\n * @extends {Object}\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link Class.create}\r\n */\r\nfunction Message(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/** @alias Message.prototype */\r\nvar MessagePrototype = Message.prototype;\r\n\r\n/**\r\n * Converts this message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nMessagePrototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decode = function decode(readerOrBuffer) {\r\n return this.$type.decode(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n return this.$type.decodeDelimited(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(21),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(6),\r\n Type = require(21),\r\n Field = require(7),\r\n Service = require(19),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(16),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Constructor prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var prototype = constructor.prototype = Object.create(this.prototype);\r\n prototype.constructor = constructor;\r\n constructor.extend = extend;\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(7),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(20),\r\n Root = require(16),\r\n Type = require(21),\r\n Field = require(7),\r\n MapField = require(8),\r\n OneOf = require(13),\r\n Enum = require(6),\r\n Service = require(19),\r\n Method = require(10),\r\n types = require(22),\r\n util = require(23);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\nvar ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader._configure = configure;\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(11);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(7),\r\n util = require(23),\r\n common = require(3);\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(14)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(18);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(11);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(10),\r\n util = require(23),\r\n rpc = require(17);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Uint8Array} [responseData] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(11);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(6),\r\n OneOf = require(13),\r\n Field = require(7),\r\n Service = require(19),\r\n Class = require(2),\r\n Message = require(9),\r\n Reader = require(15),\r\n Writer = require(32),\r\n util = require(23);\r\nvar encode = require(5),\r\n decode = require(4),\r\n verify = require(31);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Class}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n return this._ctor || (this._ctor = Class.create(this).constructor);\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Message))\r\n throw util._TypeError(\"ctor\", \"a Message constructor\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @returns {Message} Runtime message\r\n */\r\nTypePrototype.create = function create(properties) {\r\n return new (this.getCtor())(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode_setup(message, writer) {\r\n return (this.encode = util.codegen.supported\r\n ? encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : encode\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decode = function decode_setup(readerOrBuffer, length) {\r\n return (this.decode = util.codegen.supported\r\n ? decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : decode\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Message|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify_setup(message) {\r\n return (this.verify = util.codegen.supported\r\n ? verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : verify\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(23);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\nutil.codegen = require(25);\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} [callback] Callback function\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (util.isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0;\r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nvar runtime = require(29);\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, runtime);\r\n\r\nutil._configure = function configure() {\r\n runtime.Long = util.Long;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the base64 byte length of a string.\r\n * @param {string} str Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(str) {\r\n var p = str.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && str.charAt(p) === '=')\r\n ++n;\r\n return Math.ceil(str.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = [\r\n 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\r\n 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,\r\n 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\r\n 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\r\n];\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var str = new Array(Math.ceil((end - start) / 3) * 4);\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n str[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n str[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n str[i++] = b64[t | b >> 6];\r\n str[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j) {\r\n str[i++] = b64[t];\r\n str[i ] = 61;\r\n if (j === 1)\r\n str[i + 1] = 61;\r\n }\r\n return String.fromCharCode.apply(String, str);\r\n};\r\n\r\n// Base64 decoding table\r\nvar s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i;\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} src Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(src, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < src.length;) {\r\n var c = src.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @memberof util\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {Codegen} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a sprintf-like appender function.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {Codegen} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\nfunction sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(23);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n // fallthrough\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo, this.hi, unsigned)\r\n : { low: this.lo, high: this.hi, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.base64 = require(\"./base64\");\r\nutil.utf8 = require(\"./utf8\");\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} str String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function length(str) {\r\n var strlen = str.length >>> 0;\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n c = str.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (str.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {Uint8Array} buf Destination buffer\r\n * @param {number} pos Destination offset\r\n * @param {string} str Source string\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function(buf, pos, str) {\r\n var start = pos;\r\n for (var i = 0; i < str.length; ++i) {\r\n var c1 = str.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = str.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n return pos - start;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source offset\r\n * @param {number} len Source length\r\n * @returns {string} String read\r\n */\r\nutf8.read = function(buf, pos, len) {\r\n if (len) {\r\n var out = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (pos < len) {\r\n t = buf[pos++];\r\n if (t < 128)\r\n out[i++] = t;\r\n else if (t > 191 && t < 224)\r\n out[i++] = (t & 31) << 6 | buf[pos++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buf[pos++] & 63) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63) - 0x10000;\r\n out[i++] = 0xD800 + (t >> 10);\r\n out[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n out[i++] = (t & 15) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, i));\r\n }\r\n return \"\";\r\n};\r\n","\"use strict\";\r\nmodule.exports = verify;\r\n\r\nvar Enum = require(6),\r\n Type = require(21),\r\n util = require(23);\r\nvar isInteger = util.isInteger;\r\n\r\nfunction invalid(field, expected) {\r\n return \"invalid value for field \" + field.getFullName() + \" (\" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected)\";\r\n}\r\n\r\nfunction verifyValue(field, value) {\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\":\r\n if (typeof value !== 'number')\r\n return invalid(field, \"number\");\r\n break;\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\":\r\n if (!isInteger(value))\r\n return invalid(field, \"integer\");\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\":\r\n if (!(isInteger(value) || value && isInteger(value.low) && isInteger(value.high)))\r\n return invalid(field, \"integer|Long\");\r\n break;\r\n case \"bool\":\r\n if (typeof value !== 'boolean')\r\n return invalid(field, \"boolean\");\r\n break;\r\n case \"string\":\r\n if (!util.isString(value))\r\n return invalid(field, \"string\");\r\n break;\r\n case \"bytes\":\r\n if (!(value && typeof value.length === 'number' || util.isString(value)))\r\n return invalid(field, \"buffer\");\r\n break;\r\n default:\r\n if (field.resolvedType instanceof Enum) {\r\n if (typeof field.resolvedType.getValuesById()[value] !== 'number')\r\n return invalid(field, \"enum value\");\r\n } else if (field.resolvedType instanceof Type) {\r\n var reason = field.resolvedType.verify(value);\r\n if (reason)\r\n return reason;\r\n }\r\n break;\r\n }\r\n return null;\r\n}\r\n\r\nfunction verifyKey(field, value) {\r\n switch (field.keyType) {\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\":\r\n if (/^[\\x00-\\xff]{8}$/.test(value)) // eslint-disable-line no-control-regex\r\n return null;\r\n // fallthrough\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\":\r\n if (/^-?(?:0|[1-9]\\d*)$/.test(value))\r\n return invalid(field, \"integer key\");\r\n break;\r\n case \"bool\":\r\n if (/^true|false|0|1$/.test(value))\r\n return invalid(field, \"boolean key\");\r\n break;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * General purpose message verifier.\r\n * @param {Message|Object} message Runtime message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n * @this {Type}\r\n * @property {GenerateVerifier} generate Generates a type specific verifier\r\n */\r\nfunction verify(message) {\r\n /* eslint-disable block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsArray(),\r\n i = 0,\r\n reason;\r\n while (i < fields.length) {\r\n var field = fields[i++].resolve(),\r\n value = message[field.name];\r\n\r\n // map fields\r\n if (field.map) {\r\n\r\n if (value !== undefined) {\r\n if (!util.isObject(value))\r\n return invalid(field, \"object\");\r\n var keys = Object.keys(value);\r\n for (var j = 0; j < keys.length; ++j) {\r\n if (reason = verifyKey(field, keys[j])) // eslint-disable-line no-cond-assign\r\n return reason;\r\n if (reason = verifyValue(field, value[keys[j]])) // eslint-disable-line no-cond-assign\r\n return reason;\r\n }\r\n }\r\n\r\n // repeated fields\r\n } else if (field.repeated) {\r\n\r\n if (value !== undefined) {\r\n if (!Array.isArray(value))\r\n return invalid(field, \"array\");\r\n for (var j = 0; j < value.length; ++j)\r\n if (reason = verifyValue(field, value[j])) // eslint-disable-line no-cond-assign\r\n return reason;\r\n }\r\n\r\n // required or present fields\r\n } else if (field.required || value !== undefined) {\r\n \r\n if (reason = verifyValue(field, value)) // eslint-disable-line no-cond-assign\r\n return reason;\r\n }\r\n\r\n }\r\n return null;\r\n /* eslint-enable block-scoped-var, no-redeclare */\r\n}\r\n\r\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\": gen\r\n (\"if(typeof %s!=='number')\", ref)\r\n (\"return%j\", invalid(field, \"number\"));\r\n break;\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.isInteger(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!(util.isInteger(%s)||%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\r\n (\"return%j\", invalid(field, \"integer|Long\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(typeof %s!=='boolean')\", ref)\r\n (\"return%j\", invalid(field, \"boolean\"));\r\n break;\r\n case \"string\": gen\r\n (\"if(!util.isString(%s))\", ref)\r\n (\"return%j\", invalid(field, \"string\"));\r\n break;\r\n case \"bytes\": gen\r\n (\"if(!(%s&&typeof %s.length==='number'||util.isString(%s))\", ref, ref, ref)\r\n (\"return%j\", invalid(field, \"buffer\"));\r\n break;\r\n default:\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(%s){\", ref)\r\n (\"default:\")\r\n (\"return%j\", invalid(field, \"enum value\"));\r\n var values = util.toArray(field.resolvedType.values);\r\n for (var j = 0; j < values.length; ++j) gen\r\n (\"case %d:\", values[j]);\r\n gen\r\n (\"break\")\r\n (\"}\");\r\n } else if (field.resolvedType instanceof Type) { gen\r\n (\"var r;\")\r\n (\"if(r=types[%d].verify(%s))\", fieldIndex, ref)\r\n (\"return r\");\r\n }\r\n break;\r\n }\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\nfunction genVerifyKey(gen, field, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.keyType) {\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9]\\\\d*))$/.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer|Long key\"));\r\n break;\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\":\r\n (\"if(!/^-?(?:0|[1-9]\\\\d*)$/.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer key\"));\r\n break;\r\n case \"bool\":\r\n (\"if(!/^true|false|0|1$/.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"boolean key\"));\r\n break;\r\n }\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a verifier specific to the specified message type.\r\n * @typedef GenerateVerifier\r\n * @type {function}\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\n/**/\r\nverify.generate = function generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray();\r\n var gen = util.codegen(\"m\");\r\n\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n prop = util.safeProp(field.name);\r\n\r\n // map fields\r\n if (field.map) { gen\r\n (\"if(m%s!==undefined){\", prop)\r\n (\"if(!util.isObject(m%s))\", prop)\r\n (\"return%j\", invalid(field, \"object\"))\r\n (\"var k=Object.keys(m%s)\", prop)\r\n (\"for(var i=0;i 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nfunction writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n}\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? writeBytes_set\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (typeof value === 'string' && len) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len).push(utf8.write, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n if (typeof value === 'string')\r\n value = util.Buffer.from && util.Buffer.from(value, \"base64\") || new util.Buffer(value, \"base64\");\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n utf8.write(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n utf8.write(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? utf8.length(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\n var Reader =\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.encode = require(\"./encode\");\r\nprotobuf.decode = require(\"./decode\");\r\nprotobuf.verify = require(\"./verify\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Class = require(\"./class\");\r\nprotobuf.Message = require(\"./message\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\n var util =\r\nprotobuf.util = require(\"./util\");\r\nprotobuf.configure = configure;\r\n\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n util._configure();\r\n Reader._configure();\r\n}\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/dist/protobuf.min.js b/dist/protobuf.min.js index 5926d9003..62b50441e 100644 --- a/dist/protobuf.min.js +++ b/dist/protobuf.min.js @@ -1,9 +1,9 @@ /*! * protobuf.js v6.1.0 (c) 2016 Daniel Wirtz - * Compiled Sat, 10 Dec 2016 13:31:00 UTC + * Compiled Sat, 10 Dec 2016 23:00:12 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ -!function e(t,r,i){function n(o,u){if(!r[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 l=r[o]={exports:{}};t[o][0].call(l.exports,function(e){var r=t[o][1][e];return n(r?r:e)},l,l.exports,e,t,r,i)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o>1,l=-7,h=r?0:n-1,c=r?1:-1,d=e[t+h];for(h+=c,s=d&(1<<-l)-1,d>>=-l,l+=u;l>0;s=256*s+e[t+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+h],h+=c,l-=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)},r.write=function(e,t,r,i,n,s){var o,u,a,f=8*s-n-1,l=(1<>1,c=23===n?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=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-o))<1&&(o--,a*=2),t+=o+h>=1?c/a:c*Math.pow(2,1-h),t*a>=2&&(o++,a/=2),o+h>=l?(u=0,o=l):o+h>=1?(u=(t*a-1)*Math.pow(2,n),o+=h):(u=t*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;e[r+d]=255&u,d+=p,u/=256,n-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,f-=8);e[r+d-p]|=128*v}},{}],2:[function(e,t,r){"use strict";function i(e){return i.create(e)}t.exports=i;var n=e(11),s=e(23),o=e(25),u=o.a;i.create=function(e,t){if(!(e instanceof s))throw u("type","a Type");var r=t;if(r){if("function"!=typeof r)throw u("ctor","a function")}else r=function(e){return function(t){e.call(this,t)}}(n);r.constructor=i;var a=r.prototype=new n;return a.constructor=r,o.merge(r,n,!0),r.$type=e,a.$type=e,e.getFieldsArray().forEach(function(e){e.resolve(),a[e.name]=Array.isArray(e.defaultValue)?o.emptyArray:o.isObject(e.defaultValue)?o.emptyObject:e.defaultValue}),e.getOneofsArray().forEach(function(e){o.prop(a,e.resolve().name,{get:function(){for(var t=Object.keys(this),r=t.length-1;r>-1;--r)if(e.oneof.indexOf(t[r])>-1)return t[r]},set:function(t){for(var r=e.oneof,i=0;i ").replace(/\t/g," "));var s=Object.keys(r||(r={}));return Function.apply(null,s.concat("return "+n)).apply(null,s.map(function(e){return r[e]}))}var l=Array.prototype.slice.call(arguments),h=['\t"use strict"'],c=1,d=!1;return e.str=t,e.eof=r,e}t.exports=i;var n=e(25),s=/[{[]$/,o=/^[}\]]/,u=/:$/,a=/^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/,f=/\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,i.encode=e(5),i.decode=e(4),i.verify=e(6)},{25:25,4:4,5:5,6:6}],4:[function(e,t,r){"use strict";var i=r,n=e(8),s=e(17),o=e(24),u=e(25),a=e(3);i.fallback=function(e,t){for(var r=this.getFieldsById(),i=e instanceof s?e:s.create(e),a=void 0===t?i.len:i.pos+t,f=new(this.getCtor());i.pos0;){var n=e.shift();if(r.nested&&r.nested[n]){if(r=r.nested[n],!(r instanceof i))throw Error("path conflicts with non-namespace objects")}else r.add(r=new i(n))}return t&&r.addJSON(t),r},u.resolveAll=function(){for(var e=this.getNestedArray(),t=0;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),n(this)},o.onRemove=function(e){this.g.forEach(function(e){e.parent&&e.parent.remove(e)}),s.prototype.onRemove.call(this,e)}},{14:14,25:25,9:9}],16:[function(e,t,r){"use strict";function i(e){return null===e?null:e.toLowerCase()}function n(e,t){function r(e,t){return Error("illegal "+(t||"token")+" '"+e+"' (line "+ie.line()+E)}function n(){var e,t=[];do{if((e=ne())!==B&&e!==J)throw r(e);t.push(ne()),ue(e),e=oe()}while(e===B||e===J);return t.join("")}function v(e){var t=ne();switch(i(t)){case J:case B:return se(t),n();case"true":return!0;case"false":return!1}try{return q(t)}catch(i){if(e&&m.test(t))return t;throw r(t,"value")}}function L(){var e=z(ne()),t=e;return ue("to",!0)&&(t=z(ne())),ue(F),[e,t]}function q(e){var t=1;"-"===e.charAt(0)&&(t=-1,e=e.substring(1));var n=i(e);switch(n){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(n))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(n))return t*parseFloat(e);throw r(e,"number")}function z(e,t){var n=i(e);switch(n){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===e.charAt(0)&&!t)throw r(e,"id");if(/^-?[1-9][0-9]*$/.test(e))return parseInt(e,10);if(/^-?0[x][0-9a-f]+$/.test(n))return parseInt(e,16);if(/^-?0[0-7]+$/.test(e))return parseInt(e,8);throw r(e,"id")}function V(){if(void 0!==Y)throw r("package");if(Y=ne(),!m.test(Y))throw r(Y,A);he=he.define(Y),ue(F)}function $(){var e,t=oe();switch(t){case"weak":e=te||(te=[]),ne();break;case"public":ne();default:e=ee||(ee=[])}t=n(),ue(F),e.push(t)}function I(){ue("="),re=i(n());var e;if(["proto2",e="proto3"].indexOf(re)<0)throw r(re,"syntax");fe=re===e,ue(F)}function R(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 n=ne();if(!g.test(n))throw r(n,"type name");var s=new u(n);if(ue(N,!0)){for(;(t=ne())!==T;){var o=i(t);if(!R(s,t))switch(o){case"map":M(s,o);break;case w:case x:case k:P(s,o);break;case"oneof":U(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(L(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(L(s,o));break;default:if(!fe||!m.test(t))throw r(t);se(t),P(s,x)}}ue(F,!0)}else ue(F);e.add(s)}function P(e,t,i){var n=ne();if(!m.test(n))throw r(n,S);var s=ne();if(!g.test(s))throw r(s,A);s=y(s),ue("=");var o=z(ne()),u=Z(new a(s,o,n,t,i));u.repeated&&u.setOption("packed",fe,!0),e.add(u)}function M(e){ue("<");var t=ne();if(void 0===p.mapKey[t])throw r(t,S);ue(",");var i=ne();if(!m.test(i))throw r(i,S);ue(">");var n=ne();if(!g.test(n))throw r(n,A);n=y(n),ue("=");var s=z(ne()),o=Z(new f(n,s,t,i));e.add(o)}function U(e,t){var i=ne();if(!g.test(i))throw r(i,A);i=y(i);var n=new l(i);if(ue(N,!0)){for(;(t=ne())!==T;)t===O?(K(n,t),ue(F)):(se(t),P(n,x));ue(F,!0)}else ue(F);e.add(n)}function D(e,t){var n=ne();if(!g.test(n))throw r(n,A);var s={},o=new h(n,s);if(ue(N,!0)){for(;(t=ne())!==T;)i(t)===O?K(o):_(o,t);ue(F,!0)}else ue(F);e.add(o)}function _(e,t){if(!g.test(t))throw r(t,A);var i=t;ue("=");var n=z(ne(),!0);e.values[i]=n,Z({})}function K(e,t){var i=ue(j,!0),n=ne();if(!m.test(n))throw r(n,A);i&&(ue(E),n=j+n+E,t=oe(),b.test(t)&&(n+=t,ne())),ue("="),H(e,n)}function H(e,t){if(ue(N,!0))for(;(le=ne())!==T;){if(!g.test(le))throw r(le,A);t=t+"."+le,ue(":",!0)?W(e,t,v(!0)):H(e,t)}else W(e,t,v(!0))}function W(e,t,r){e.setOption?e.setOption(t,r):e[t]=r}function Z(e){if(ue("[",!0)){do K(e,O);while(ue(",",!0));ue("]")}return ue(F),e}function G(e,t){if(t=ne(),!g.test(t))throw r(t,"service name");var n=t,s=new c(n);if(ue(N,!0)){for(;(t=ne())!==T;){var o=i(t);switch(o){case O:K(s,o),ue(F);break;case"rpc":X(s,o);break;default:throw r(t)}}ue(F,!0)}else ue(F);e.add(s)}function X(e,t){var n=t,s=ne();if(!g.test(s))throw r(s,A);var o,u,a,f;ue(j);var l;if(ue(l="stream",!0)&&(u=!0),!m.test(t=ne()))throw r(t);if(o=t,ue(E),ue("returns"),ue(j),ue(l,!0)&&(f=!0),!m.test(t=ne()))throw r(t);a=t,ue(E);var h=new d(s,n,o,a,u,f);if(ue(N,!0)){for(;(t=ne())!==T;){var c=i(t);switch(c){case O:K(h,c),ue(F);break;default:throw r(t)}}ue(F,!0)}else ue(F);e.add(h)}function Q(e,t){var n=ne();if(!m.test(n))throw r(n,"reference");if(ue(N,!0)){for(;(t=ne())!==T;){var s=i(t);switch(s){case w:case k:case x:P(e,s,n);break;default:if(!fe||!m.test(t))throw r(t);se(t),P(e,x,n)}}ue(F,!0)}else ue(F)}t||(t=new o);var Y,ee,te,re,ie=s(e),ne=ie.next,se=ie.push,oe=ie.peek,ue=ie.skip,ae=!0,fe=!1;t||(t=new o);for(var le,he=t;null!==(le=ne());){var ce=i(le);switch(ce){case"package":if(!ae)throw r(le);V();break;case"import":if(!ae)throw r(le);$();break;case"syntax":if(!ae)throw r(le);I();break;case O:if(!ae)throw r(le);K(he,le),ue(F);break;default:if(R(he,le)){ae=!1;continue}throw r(le)}}return{package:Y,imports:ee,weakImports:te,syntax:re,root:t}}t.exports=n;var s=e(22),o=e(18),u=e(23),a=e(9),f=e(10),l=e(15),h=e(8),c=e(21),d=e(12),p=e(24),v=e(25),y=v.camelCase,g=/^[a-zA-Z_][a-zA-Z_0-9]*$/,m=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,b=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,w="required",k="repeated",x="optional",O="option",A="name",S="type",N="{",T="}",j="(",E=")",F=";",B='"',J="'"},{10:10,12:12,15:15,18:18,21:21,22:22,23:23,24:24,25:25,8:8,9:9}],17:[function(e,t,r){"use strict";function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function s(e,t){this.id=e,this.wireType=t}function o(){var e=0,t=0,r=0,n=0;if(this.len-this.pos>9){for(r=0;r<4;++r)if(n=this.buf[this.pos++],e|=(127&n)<<7*r,n<128)return new A(e>>>0,t>>>0);if(n=this.buf[this.pos++],e|=(127&n)<<28,t|=(127&n)>>4,n<128)return new A(e>>>0,t>>>0);for(r=0;r<5;++r)if(n=this.buf[this.pos++],t|=(127&n)<<7*r+3,n<128)return new A(e>>>0,t>>>0)}else{for(r=0;r<4;++r){if(this.pos>=this.len)throw i(this);if(n=this.buf[this.pos++],e|=(127&n)<<7*r,n<128)return new A(e>>>0,t>>>0)}if(this.pos>=this.len)throw i(this);if(n=this.buf[this.pos++],e|=(127&n)<<28,t|=(127&n)>>4,n<128)return new A(e>>>0,t>>>0);for(r=0;r<5;++r){if(this.pos>=this.len)throw i(this);if(n=this.buf[this.pos++],t|=(127&n)<<7*r+3,n<128)return new A(e>>>0,t>>>0)}}throw Error("invalid varint encoding")}function u(){return o.call(this).toLong()}function a(){return o.call(this).toNumber()}function f(){return o.call(this).toLong(!0)}function l(){return o.call(this).toNumber(!0)}function h(){return o.call(this).zzDecode().toLong()}function c(){return o.call(this).zzDecode().toNumber()}function d(){if(this.pos+8>this.len)throw i(this,8);return new A((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){E&&E(),n.call(this,e)}function b(e,t,r){return e.utf8Slice(t,r)}function w(e,t,r){return e.toString("utf8",t,r)}function k(){x.Long?(N.int64=u,N.uint64=f,N.sint64=h,N.fixed64=p,N.sfixed64=y):(N.int64=a,N.uint64=l,N.sint64=c,N.fixed64=v,N.sfixed64=g)}t.exports=n,n.BufferReader=m;var x=e(29),O=e(1),A=x.LongBits,S="undefined"!=typeof Uint8Array?Uint8Array:Array;n.create=function(e){return new(x.Buffer&&x.Buffer.isBuffer(e)&&m||n)(e)};var N=n.prototype;N.h=S.prototype.subarray||S.prototype.slice,N.tag=function(){if(this.pos>=this.len)throw i(this);return new s(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},N.int32=function(){var e=this.buf[this.pos++],t=127&e;if(e>127&&(e=this.buf[this.pos++],t|=(127&e)<<7,e>127&&(e=this.buf[this.pos++],t|=(127&e)<<14,e>127&&(e=this.buf[this.pos++],t|=(127&e)<<21,e>127&&(e=this.buf[this.pos++],t|=e<<28,e>127&&(this.pos+=5))))),this.pos>this.len)throw this.pos=this.len,i(this);return t},N.uint32=function(){ -return this.int32()>>>0},N.sint32=function(){var e=this.int32();return e>>>1^-(1&e)},N.bool=function(){return 0!==this.int32()},N.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},N.sfixed32=function(){var e=this.fixed32();return e>>>1^-(1&e)};var T="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i){return t[0]=r[i++],t[1]=r[i++],t[2]=r[i++],t[3]=r[i],e[0]}:function(r,i){return t[3]=r[i++],t[2]=r[i++],t[1]=r[i++],t[0]=r[i],e[0]}}():function(e,t){return O.read(e,t,!1,23,4)};N.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=T(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(r,i){return t[0]=r[i++],t[1]=r[i++],t[2]=r[i++],t[3]=r[i++],t[4]=r[i++],t[5]=r[i++],t[6]=r[i++],t[7]=r[i],e[0]}:function(r,i){return t[7]=r[i++],t[6]=r[i++],t[5]=r[i++],t[4]=r[i++],t[3]=r[i++],t[2]=r[i++],t[1]=r[i++],t[0]=r[i],e[0]}}():function(e,t){return O.read(e,t,!1,52,8)};N.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=j(this.buf,this.pos);return this.pos+=8,e},N.bytes=function(){var e=this.int32()>>>0,t=this.pos,r=this.pos+e;if(r>this.len)throw i(this,e);return this.pos+=e,t===r?new this.buf.constructor(0):this.h.call(this.buf,t,r)},N.string=function(){var e=this.bytes(),t=e.length;if(t){for(var r=new Array(t),i=0,n=0;i191&&s<224)r[n++]=(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;r[n++]=55296+(o>>10),r[n++]=56320+(1023&o)}else r[n++]=(15&s)<<12|(63&e[i++])<<6|63&e[i++]}return String.fromCharCode.apply(String,r.slice(0,n))}return""},N.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},N.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},N.reset=function(e){return e?(this.buf=e,this.len=e.length):(this.buf=null,this.len=0),this.pos=0,this},N.finish=function(e){var t=this.pos?this.h.call(this.buf,this.pos):this.buf;return this.reset(e),t};var E=function(){if(!x.Buffer)throw Error("Buffer is not supported");F.h=x.Buffer.prototype.slice,B=x.Buffer.prototype.utf8Slice?b:w,E=!1},F=m.prototype=Object.create(n.prototype);F.constructor=m,"undefined"==typeof Float32Array&&(F.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&&(F.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;F.string=function(){var e=this.int32()>>>0,t=this.pos,r=this.pos+e;if(r>this.len)throw i(this,e);return this.pos+=e,B(this.buf,t,r)},F.finish=function(e){var t=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(e),t},n.i=k,k()},{1:1,29:29}],18:[function(e,t,r){"use strict";function i(e){o.call(this,"",e),this.deferred=[],this.files=[]}function n(){}function s(e){var t=e.parent.lookup(e.extend);if(t){var r=new a(e.getFullName(),e.id,e.type,e.rule,(void 0),e.options);return r.declaringField=e,e.extensionField=r,t.add(r),!0}return!1}t.exports=i;var o=e(13),u=o.extend(i),a=e(9),f=e(25),l=e(7);i.fromJSON=function(e,t){return t||(t=new i),t.setOptions(e.options).addJSON(e.nested)},u.resolvePath=f.resolvePath,u.load=function t(r,i){function s(e,t){if(i){var r=i;i=null,r(e,t)}}function o(t,r){try{if(f.isString(r)&&"{"===r.charAt(0)&&(r=JSON.parse(r)),f.isString(r)){var i=e(16)(r,a);i.imports&&i.imports.forEach(function(e){u(a.resolvePath(t,e))}),i.weakImports&&i.weakImports.forEach(function(e){u(a.resolvePath(t,e),!0)})}else a.setOptions(r.options).addJSON(r.nested)}catch(e){return void s(e)}h||c||s(null,a)}function u(e,t){var r=e.indexOf("google/protobuf/");if(r>-1){var n=e.substring(r);n in l&&(e=n)}if(!(a.files.indexOf(e)>-1)){if(a.files.push(e),e in l)return void(h?o(e,l[e]):(++c,setTimeout(function(){--c,o(e,l[e])})));if(h){var u;try{u=f.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||s(e))}o(e,u)}else++c,f.fetch(e,function(r,n){if(--c,i)return r?void(t||s(r)):void o(e,n)})}}var a=this;if(!i)return f.asPromise(t,a,r);var h=i===n,c=0;return f.isString(r)&&(r=[r]),r.forEach(function(e){u(a.resolvePath("",e))}),h?a:void(c||s(null,a))},u.loadSync=function(e){return this.load(e,n)},u.e=function(e){var t=this.deferred.slice();this.deferred=[];for(var r=0;r-1&&this.deferred.splice(t,1)}e.extensionField&&(e.extensionField.parent.remove(e.extensionField),e.extensionField=null)}else if(e instanceof o)for(var r=e.getNestedArray(),i=0;i0)return m.shift();if(b)return r();var i,o,u;do{if(v===y)return null;for(i=!1;/\s/.test(u=n(v));)if(u===a&&++g,++v===y)return null;if(n(v)===f){if(++v===y)throw t("comment");if(n(v)===f){for(;n(++v)!==a;)if(v===y)return null;++v,++g,i=!0}else{if((u=n(v))!==l)return f;do{if(u===a&&++g,++v===y)return null;o=u,u=n(v)}while(o!==l||u!==f);++v,i=!0}}}while(i);if(v===y)return null;var h=v;s.lastIndex=0;var c=s.test(n(h++));if(!c)for(;h]/g,o=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,u=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a="\n",f="/",l="*"},{}],23:[function(e,t,r){"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.k=null,this.l=null,this.m=null,this.n=null,this.o=null}function n(e){return e.k=e.l=e.n=e.o=null,delete e.encode,delete e.decode,e}t.exports=i;var s=e(13),o=s.prototype,u=s.extend(i),a=e(8),f=e(15),l=e(9),h=e(21),c=e(2),d=e(11),p=e(17),v=e(30),y=e(25),g=e(3);y.props(u,{fieldsById:{get:function(){if(this.k)return this.k;this.k={};for(var e=Object.keys(this.fields),t=0;t0?t.splice(--n,2):r?t.splice(n,1):++n:"."===t[n]?t.splice(n,1):++n;return i+t.join("/")}var util=exports;util.toArray=function(e){if(!e)return[];for(var t=Object.keys(e),r=t.length,i=new Array(r),n=0;n>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){switch(typeof e){case"number":return i.fromNumber(e);case"string":if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.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 n.Long?new n.Long(this.lo,this.hi,e):{low:this.lo,high:this.hi,unsigned:Boolean(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,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<1<<21?3:4:t<16384?t<128?5:6:t<1<<21?7:8:r<128?9:10}},{25:25}],28:[function(e,t,r){"use strict";function i(e,t,r){var i=r||8192,n=i>>>1,s=null,o=i;return function(r){if(r>n)return e(r);o+r>i&&(s=e(i),o=0);var u=t.call(s,o,o+=r);return 7&o&&(o=(7|o)+1),u}}t.exports=i},{}],29:[function(e,t,r){(function(t){"use strict";var i=r,n=i.LongBits=e(27);i.pool=e(28);var 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.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},i.isString=function(e){return"string"==typeof e||e instanceof String},i.isObject=function(e){return Boolean(e&&"object"==typeof e)},i.longToHash=function(e){return e?n.from(e).toHash():"\0\0\0\0\0\0\0\0"},i.longFromHash=function(e,t){var r=n.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.longNeq=function(e,t){return"number"==typeof e?"number"==typeof t?e!==t:(e=n.fromNumber(e)).lo!==t.low||e.hi!==t.high:"number"==typeof t?(t=n.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(r){i.prop(e,r,t[r])})},i.prop=function(e,t,r){var i=!-[1],n=t.substring(0,1).toUpperCase()+t.substring(1);r.get&&(e["get"+n]=r.get),r.set&&(e["set"+n]=i?function(e){r.set.call(this,e),this[t]=e}:r.set),i?void 0!==r.value&&(e[t]=r.value):Object.defineProperty(e,t,r)},i.emptyArray=Object.freeze([]),i.emptyObject=Object.freeze({}),i.length64=function(e){var t=e.length,r=0;if(t)for(;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};var o=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47];i.encode64=function(e,t,r){for(var i,n=new Array(4*Math.ceil((r-t)/3)),s=0,u=0;t>2],i=(3&a)<<4,u=1;break;case 1:n[s++]=o[i|a>>4],i=(15&a)<<2,u=2;break;case 2:n[s++]=o[i|a>>6],n[s++]=o[63&a],u=0}}switch(u){case 1:n[s++]=o[i],n[s++]=61,n[s]=61;break;case 2:n[s++]=o[i],n[s]=61}return String.fromCharCode.apply(String,n)};for(var u=[],a=0;a1)break;if(void 0===(a=u[a]))throw Error(f);switch(s){case 0:i=a,s=1;break;case 1:t[r++]=i<<2|(48&a)>>4,i=a,s=2;break;case 2:t[r++]=(15&i)<<4|(60&a)>>2,i=a,s=3;break;case 3:t[r++]=(3&i)<<6|a,s=0}}if(1===s)throw Error(f);return r-n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{27:27,28:28,buffer:"buffer",long:"long"}],30:[function(e,t,r){"use strict";function i(e,t,r){this.fn=e,this.val=t,this.len=r,this.next=null}function n(){}function s(e,t){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=t}function o(){this.len=0,this.head=new i(n,0,0),this.tail=this.head,this.states=null}function u(e,t,r){e[t]=255&r}function a(e,t,r){for(;r>127;)e[t++]=127&r|128,r>>>=7;e[t]=r}function f(e,t,r){for(;r.hi;)e[t++]=127&r.lo|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=127&r.lo|128,r.lo=r.lo>>>7;e[t++]=r.lo}function l(e,t,r){e[t++]=255&r,e[t++]=r>>>8&255,e[t++]=r>>>16&255,e[t]=r>>>24}function h(e,t,r){e.set(r,t)}function c(e,t,r){for(var i=0;i>6|192,e[t++]=63&s|128):55296===(64512&s)&&56320===(64512&(n=r.charCodeAt(i+1)))?(s=65536+((1023&s)<<10)+(1023&n),++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 d(e){for(var t=e.length>>>0,r=0,i=0;i>>=0,e<128?this.push(u,1,e):this.push(a,e<16384?2:e<2097152?3:e<268435456?4:5,e)},x.int32=function(e){return e<0?this.push(f,10,w.fromNumber(e)):this.uint32(e)},x.sint32=function(e){return this.uint32(e<<1^e>>31)},x.uint64=function(e){var t=w.from(e);return this.push(f,t.length(),t)},x.int64=x.uint64,x.sint64=function(e){var t=w.from(e).zzEncode();return this.push(f,t.length(),t)},x.bool=function(e){return this.push(u,1,e?1:0)},x.fixed32=function(e){return this.push(l,4,e>>>0)},x.sfixed32=function(e){return this.push(l,4,e<<1^e>>31)},x.fixed64=function(e){var t=w.from(e);return this.push(l,4,t.lo).push(l,4,t.hi)},x.sfixed64=function(e){var t=w.from(e).zzEncode();return this.push(l,4,t.lo).push(l,4,t.hi)};var O="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i,n){e[0]=n,r[i++]=t[0],r[i++]=t[1],r[i++]=t[2],r[i]=t[3]}:function(r,i,n){e[0]=n,r[i++]=t[3],r[i++]=t[2],r[i++]=t[1],r[i]=t[0]}}():function(e,t,r){b.write(e,r,t,!1,23,4)};x.float=function(e){return this.push(O,4,e)};var A="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i,n){e[0]=n,r[i++]=t[0],r[i++]=t[1],r[i++]=t[2],r[i++]=t[3],r[i++]=t[4],r[i++]=t[5],r[i++]=t[6],r[i]=t[7]}:function(r,i,n){e[0]=n,r[i++]=t[7],r[i++]=t[6],r[i++]=t[5],r[i++]=t[4],r[i++]=t[3],r[i++]=t[2],r[i++]=t[1],r[i]=t[0]}}():function(e,t,r){b.write(e,r,t,!1,52,8)};x.double=function(e){return this.push(A,8,e)};var S=k.prototype.set?h:function(e,t,r){for(var i=0;i>>0;if("string"==typeof e&&t){var r=o.alloc(t=m.length64(e));m.decode64(e,r,0),e=r}return t?this.uint32(t).push(S,t,e):this.push(u,1,0)},x.string=function(e){var t=d(e);return t?this.uint32(t).push(c,t,e):this.push(u,1,0)},x.fork=function(){return this.states=new s(this,this.states),this.head=this.tail=new i(n,0,0),this.len=0,this},x.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(n,0,0),this.len=0),this},x.ldelim=function(e){var t=this.head,r=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=r,this.len+=i,this},x.finish=function(){var e=this.head.next,t=this.constructor.alloc(this.len);this.reset();for(var r=0;e;)e.fn(t,r,e.val),r+=e.len,e=e.next;return t},p.alloc=function(e){return p.alloc=m.Buffer.allocUnsafe?m.Buffer.allocUnsafe:function(e){return new m.Buffer(e)},p.alloc(e)};var N=p.prototype=Object.create(o.prototype);N.constructor=p,"undefined"==typeof Float32Array&&(N.float=function(e){return this.push(v,4,e)}),"undefined"==typeof Float64Array&&(N.double=function(e){return this.push(y,8,e)}),N.bytes=function(e){"string"==typeof e&&(e=m.Buffer.from&&m.Buffer.from(e,"base64")||new m.Buffer(e,"base64"));var t=e.length>>>0;return t?this.uint32(t).push(g,t,e):this.push(u,1,0)};var T=function(){return m.Buffer&&m.Buffer.prototype.utf8Write?function(e,t,r){r.length<40?c(e,t,r):e.utf8Write(r,t)}:function(e,t,r){r.length<40?c(e,t,r):e.write(r,t)}}();N.string=function(e){var t=e.length<40?d(e):m.Buffer.byteLength(e);return t?this.uint32(t).push(T,t,e):this.push(u,1,0)}},{1:1,29:29}],31:[function(e,t,r){(function(t){"use strict";function i(e,t,r){return"function"==typeof t?(r=t,t=new o.Root):t||(t=new o.Root),t.load(e,r)}function n(e,t){return t||(t=new o.Root),t.loadSync(e)}function s(){a.i(),u.i()}var o=t.protobuf=r;o.load=i,o.loadSync=n,o.tokenize=e(22),o.parse=e(16),o.Writer=e(30),o.BufferWriter=o.Writer.BufferWriter;var u=o.Reader=e(17);o.BufferReader=o.Reader.BufferReader,o.codegen=e(3),o.ReflectionObject=e(14),o.Namespace=e(13),o.Root=e(18),o.Enum=e(8),o.Type=e(23),o.Field=e(9),o.OneOf=e(15),o.MapField=e(10),o.Service=e(21),o.Method=e(12),o.Class=e(2),o.Message=e(11),o.types=e(24),o.common=e(7),o.rpc=e(19);var a=o.util=e(25);o.configure=s,"function"==typeof define&&define.amd&&define(["long"],function(e){return e&&(o.util.Long=e,s()),o})}).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,21:21,22:22,23:23,24:24,25:25,3:3,30:30,7:7,8:8,9:9}]},{},[31]); +!function e(t,r,n){function i(o,u){if(!r[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 l=r[o]={exports:{}};t[o][0].call(l.exports,function(e){var r=t[o][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o>1,l=-7,h=r?0:i-1,c=r?1:-1,d=e[t+h];for(h+=c,s=d&(1<<-l)-1,d>>=-l,l+=u;l>0;s=256*s+e[t+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+h],h+=c,l-=8);if(0===s)s=1-f;else{if(s===a)return o?NaN:(d?-1:1)*(1/0);o+=Math.pow(2,n),s-=f}return(d?-1:1)*o*Math.pow(2,s-n)},r.write=function(e,t,r,n,i,s){var o,u,a,f=8*s-i-1,l=(1<>1,c=23===i?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=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-o))<1&&(o--,a*=2),t+=o+h>=1?c/a:c*Math.pow(2,1-h),t*a>=2&&(o++,a/=2),o+h>=l?(u=0,o=l):o+h>=1?(u=(t*a-1)*Math.pow(2,i),o+=h):(u=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&u,d+=p,u/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,f-=8);e[r+d-p]|=128*v}},{}],2:[function(e,t,r){"use strict";function n(e){return n.create(e)}t.exports=n;var i=e(9),s=e(21),o=e(23),u=o.a;n.create=function(e,t){if(!(e instanceof s))throw u("type","a Type");var r=t;if(r){if("function"!=typeof r)throw u("ctor","a function")}else r=function(e){return function(t){e.call(this,t)}}(i);r.constructor=n;var a=r.prototype=new i;return a.constructor=r,o.merge(r,i,!0),r.$type=e,a.$type=e,e.getFieldsArray().forEach(function(e){e.resolve(),a[e.name]=Array.isArray(e.defaultValue)?o.emptyArray:o.isObject(e.defaultValue)?o.emptyObject:e.defaultValue}),e.getOneofsArray().forEach(function(e){o.prop(a,e.resolve().name,{get:function(){for(var t=Object.keys(this),r=t.length-1;r>-1;--r)if(e.oneof.indexOf(t[r])>-1)return t[r]},set:function(t){for(var r=e.oneof,n=0;n0;){var i=e.shift();if(r.nested&&r.nested[i]){if(r=r.nested[i],!(r instanceof n))throw Error("path conflicts with non-namespace objects")}else r.add(r=new n(i))}return t&&r.addJSON(t),r},u.resolveAll=function(){for(var e=this.getNestedArray(),t=0;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),i(this)},o.onRemove=function(e){this.g.forEach(function(e){e.parent&&e.parent.remove(e)}),s.prototype.onRemove.call(this,e)}},{12:12,23:23,7:7}],14:[function(e,t,r){"use strict";function n(e){return null===e?null:e.toLowerCase()}function i(e,t){function r(e,t){return Error("illegal "+(t||"token")+" '"+e+"' (line "+ne.line()+E)}function i(){var e,t=[];do{if((e=ie())!==B&&e!==J)throw r(e);t.push(ie()),ue(e),e=oe()}while(e===B||e===J);return t.join("")}function v(e){var t=ie();switch(n(t)){case J:case B:return se(t),i();case"true":return!0;case"false":return!1}try{return q(t)}catch(n){if(e&&m.test(t))return t;throw r(t,"value")}}function L(){var e=z(ie()),t=e;return ue("to",!0)&&(t=z(ie())),ue(F),[e,t]}function q(e){var t=1;"-"===e.charAt(0)&&(t=-1,e=e.substring(1));var i=n(e);switch(i){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(i))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(i))return t*parseFloat(e);throw r(e,"number")}function z(e,t){var i=n(e);switch(i){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===e.charAt(0)&&!t)throw r(e,"id");if(/^-?[1-9][0-9]*$/.test(e))return parseInt(e,10);if(/^-?0[x][0-9a-f]+$/.test(i))return parseInt(e,16);if(/^-?0[0-7]+$/.test(e))return parseInt(e,8);throw r(e,"id")}function V(){if(void 0!==Y)throw r("package");if(Y=ie(),!m.test(Y))throw r(Y,A);he=he.define(Y),ue(F)}function $(){var e,t=oe();switch(t){case"weak":e=te||(te=[]),ie();break;case"public":ie();default:e=ee||(ee=[])}t=i(),ue(F),e.push(t)}function I(){ue("="),re=n(i());var e;if(["proto2",e="proto3"].indexOf(re)<0)throw r(re,"syntax");fe=re===e,ue(F)}function R(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 i=ie();if(!g.test(i))throw r(i,"type name");var s=new u(i);if(ue(N,!0)){for(;(t=ie())!==T;){var o=n(t);if(!R(s,t))switch(o){case"map":M(s,o);break;case w:case x:case k:P(s,o);break;case"oneof":U(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(L(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(L(s,o));break;default:if(!fe||!m.test(t))throw r(t);se(t),P(s,x)}}ue(F,!0)}else ue(F);e.add(s)}function P(e,t,n){var i=ie();if(!m.test(i))throw r(i,S);var s=ie();if(!g.test(s))throw r(s,A);s=y(s),ue("=");var o=z(ie()),u=Z(new a(s,o,i,t,n));u.repeated&&u.setOption("packed",fe,!0),e.add(u)}function M(e){ue("<");var t=ie();if(void 0===p.mapKey[t])throw r(t,S);ue(",");var n=ie();if(!m.test(n))throw r(n,S);ue(">");var i=ie();if(!g.test(i))throw r(i,A);i=y(i),ue("=");var s=z(ie()),o=Z(new f(i,s,t,n));e.add(o)}function U(e,t){var n=ie();if(!g.test(n))throw r(n,A);n=y(n);var i=new l(n);if(ue(N,!0)){for(;(t=ie())!==T;)t===O?(K(i,t),ue(F)):(se(t),P(i,x));ue(F,!0)}else ue(F);e.add(i)}function D(e,t){var i=ie();if(!g.test(i))throw r(i,A);var s={},o=new h(i,s);if(ue(N,!0)){for(;(t=ie())!==T;)n(t)===O?K(o):_(o,t);ue(F,!0)}else ue(F);e.add(o)}function _(e,t){if(!g.test(t))throw r(t,A);var n=t;ue("=");var i=z(ie(),!0);e.values[n]=i,Z({})}function K(e,t){var n=ue(j,!0),i=ie();if(!m.test(i))throw r(i,A);n&&(ue(E),i=j+i+E,t=oe(),b.test(t)&&(i+=t,ie())),ue("="),H(e,i)}function H(e,t){if(ue(N,!0))for(;(le=ie())!==T;){if(!g.test(le))throw r(le,A);t=t+"."+le,ue(":",!0)?W(e,t,v(!0)):H(e,t)}else W(e,t,v(!0))}function W(e,t,r){e.setOption?e.setOption(t,r):e[t]=r}function Z(e){if(ue("[",!0)){do K(e,O);while(ue(",",!0));ue("]")}return ue(F),e}function G(e,t){if(t=ie(),!g.test(t))throw r(t,"service name");var i=t,s=new c(i);if(ue(N,!0)){for(;(t=ie())!==T;){var o=n(t);switch(o){case O:K(s,o),ue(F);break;case"rpc":X(s,o);break;default:throw r(t)}}ue(F,!0)}else ue(F);e.add(s)}function X(e,t){var i=t,s=ie();if(!g.test(s))throw r(s,A);var o,u,a,f;ue(j);var l;if(ue(l="stream",!0)&&(u=!0),!m.test(t=ie()))throw r(t);if(o=t,ue(E),ue("returns"),ue(j),ue(l,!0)&&(f=!0),!m.test(t=ie()))throw r(t);a=t,ue(E);var h=new d(s,i,o,a,u,f);if(ue(N,!0)){for(;(t=ie())!==T;){var c=n(t);switch(c){case O:K(h,c),ue(F);break;default:throw r(t)}}ue(F,!0)}else ue(F);e.add(h)}function Q(e,t){var i=ie();if(!m.test(i))throw r(i,"reference");if(ue(N,!0)){for(;(t=ie())!==T;){var s=n(t);switch(s){case w:case k:case x:P(e,s,i);break;default:if(!fe||!m.test(t))throw r(t);se(t),P(e,x,i)}}ue(F,!0)}else ue(F)}t||(t=new o);var Y,ee,te,re,ne=s(e),ie=ne.next,se=ne.push,oe=ne.peek,ue=ne.skip,ae=!0,fe=!1;t||(t=new o);for(var le,he=t;null!==(le=ie());){var ce=n(le);switch(ce){case"package":if(!ae)throw r(le);V();break;case"import":if(!ae)throw r(le);$();break;case"syntax":if(!ae)throw r(le);I();break;case O:if(!ae)throw r(le);K(he,le),ue(F);break;default:if(R(he,le)){ae=!1;continue}throw r(le)}}return{package:Y,imports:ee,weakImports:te,syntax:re,root:t}}t.exports=i;var s=e(20),o=e(16),u=e(21),a=e(7),f=e(8),l=e(13),h=e(6),c=e(19),d=e(10),p=e(22),v=e(23),y=v.camelCase,g=/^[a-zA-Z_][a-zA-Z_0-9]*$/,m=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,b=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,w="required",k="repeated",x="optional",O="option",A="name",S="type",N="{",T="}",j="(",E=")",F=";",B='"',J="'"},{10:10,13:13,16:16,19:19,20:20,21:21,22:22,23:23,6:6,7:7,8:8}],15:[function(e,t,r){"use strict";function n(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}function s(e,t){this.id=e,this.wireType=t}function o(){var e=0,t=0,r=0,i=0;if(this.len-this.pos>9){for(r=0;r<4;++r)if(i=this.buf[this.pos++],e|=(127&i)<<7*r,i<128)return new A(e>>>0,t>>>0);if(i=this.buf[this.pos++],e|=(127&i)<<28,t|=(127&i)>>4,i<128)return new A(e>>>0,t>>>0);for(r=0;r<5;++r)if(i=this.buf[this.pos++],t|=(127&i)<<7*r+3,i<128)return new A(e>>>0,t>>>0)}else{for(r=0;r<4;++r){if(this.pos>=this.len)throw n(this);if(i=this.buf[this.pos++],e|=(127&i)<<7*r,i<128)return new A(e>>>0,t>>>0)}if(this.pos>=this.len)throw n(this);if(i=this.buf[this.pos++],e|=(127&i)<<28,t|=(127&i)>>4,i<128)return new A(e>>>0,t>>>0);for(r=0;r<5;++r){if(this.pos>=this.len)throw n(this);if(i=this.buf[this.pos++],t|=(127&i)<<7*r+3,i<128)return new A(e>>>0,t>>>0)}}throw Error("invalid varint encoding")}function u(){return o.call(this).toLong()}function a(){return o.call(this).toNumber()}function f(){return o.call(this).toLong(!0)}function l(){return o.call(this).toNumber(!0)}function h(){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 A((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){F&&F(),i.call(this,e)}function b(e,t,r){return e.utf8Slice(t,r)}function w(e,t,r){return e.toString("utf8",t,r)}function k(){x.Long?(T.int64=u,T.uint64=f,T.sint64=h,T.fixed64=p,T.sfixed64=y):(T.int64=a,T.uint64=l,T.sint64=c,T.fixed64=v,T.sfixed64=g)}t.exports=i,i.BufferReader=m;var x=e(29),O=e(1),A=x.LongBits,S=x.utf8,N="undefined"!=typeof Uint8Array?Uint8Array:Array;i.create=function(e){return new(x.Buffer&&x.Buffer.isBuffer(e)&&m||i)(e)};var T=i.prototype;T.h=N.prototype.subarray||N.prototype.slice,T.tag=function(){if(this.pos>=this.len)throw n(this);return new s(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},T.int32=function(){var e=this.buf[this.pos++],t=127&e;if(e>127&&(e=this.buf[this.pos++],t|=(127&e)<<7,e>127&&(e=this.buf[this.pos++],t|=(127&e)<<14,e>127&&(e=this.buf[this.pos++],t|=(127&e)<<21,e>127&&(e=this.buf[this.pos++],t|=e<<28,e>127&&(this.pos+=5))))),this.pos>this.len)throw this.pos=this.len,n(this);return t},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 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},T.sfixed32=function(){var e=this.fixed32();return e>>>1^-(1&e)};var j="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,n){return t[0]=r[n++],t[1]=r[n++],t[2]=r[n++],t[3]=r[n],e[0]}:function(r,n){return t[3]=r[n++],t[2]=r[n++],t[1]=r[n++],t[0]=r[n],e[0]}}():function(e,t){return O.read(e,t,!1,23,4)};T.float=function(){if(this.pos+4>this.len)throw n(this,4);var e=j(this.buf,this.pos);return this.pos+=4,e};var E="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,n){return t[0]=r[n++],t[1]=r[n++],t[2]=r[n++],t[3]=r[n++],t[4]=r[n++],t[5]=r[n++],t[6]=r[n++],t[7]=r[n],e[0]}:function(r,n){return t[7]=r[n++],t[6]=r[n++],t[5]=r[n++],t[4]=r[n++],t[3]=r[n++],t[2]=r[n++],t[1]=r[n++],t[0]=r[n],e[0]}}():function(e,t){return O.read(e,t,!1,52,8)};T.double=function(){if(this.pos+8>this.len)throw n(this,4);var e=E(this.buf,this.pos);return this.pos+=8,e},T.bytes=function(){var e=this.int32()>>>0,t=this.pos,r=this.pos+e;if(r>this.len)throw n(this,e);return this.pos+=e,t===r?new this.buf.constructor(0):this.h.call(this.buf,t,r)},T.string=function(){var e=this.bytes();return S.read(e,0,e.length)},T.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},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(!x.Buffer)throw Error("Buffer is not supported");B.h=x.Buffer.prototype.slice,J=x.Buffer.prototype.utf8Slice?b:w,F=!1},B=m.prototype=Object.create(i.prototype);B.constructor=m,"undefined"==typeof Float32Array&&(B.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}),"undefined"==typeof Float64Array&&(B.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});var J;B.string=function(){var e=this.int32()>>>0,t=this.pos,r=this.pos+e;if(r>this.len)throw n(this,e);return this.pos+=e,J(this.buf,t,r)},B.finish=function(e){var t=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(e),t},i.i=k,k()},{1:1,29:29}],16:[function(e,t,r){"use strict";function n(e){o.call(this,"",e),this.deferred=[],this.files=[]}function i(){}function s(e){var t=e.parent.lookup(e.extend);if(t){var r=new a(e.getFullName(),e.id,e.type,e.rule,(void 0),e.options);return r.declaringField=e,e.extensionField=r,t.add(r),!0}return!1}t.exports=n;var o=e(11),u=o.extend(n),a=e(7),f=e(23),l=e(3);n.fromJSON=function(e,t){return t||(t=new n),t.setOptions(e.options).addJSON(e.nested)},u.resolvePath=f.resolvePath,u.load=function t(r,n){function s(e,t){if(n){var r=n;n=null,r(e,t)}}function o(t,r){try{if(f.isString(r)&&"{"===r.charAt(0)&&(r=JSON.parse(r)),f.isString(r)){var n=e(14)(r,a);n.imports&&n.imports.forEach(function(e){u(a.resolvePath(t,e))}),n.weakImports&&n.weakImports.forEach(function(e){u(a.resolvePath(t,e),!0)})}else a.setOptions(r.options).addJSON(r.nested)}catch(e){return void s(e)}h||c||s(null,a)}function u(e,t){var r=e.indexOf("google/protobuf/");if(r>-1){var i=e.substring(r);i in l&&(e=i)}if(!(a.files.indexOf(e)>-1)){if(a.files.push(e),e in l)return void(h?o(e,l[e]):(++c,setTimeout(function(){--c,o(e,l[e])})));if(h){var u;try{u=f.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||s(e))}o(e,u)}else++c,f.fetch(e,function(r,i){if(--c,n)return r?void(t||s(r)):void o(e,i)})}}var a=this;if(!n)return f.asPromise(t,a,r);var h=n===i,c=0;return f.isString(r)&&(r=[r]),r.forEach(function(e){u(a.resolvePath("",e))}),h?a:void(c||s(null,a))},u.loadSync=function(e){return this.load(e,i)},u.e=function(e){var t=this.deferred.slice();this.deferred=[];for(var r=0;r-1&&this.deferred.splice(t,1)}e.extensionField&&(e.extensionField.parent.remove(e.extensionField),e.extensionField=null)}else if(e instanceof o)for(var r=e.getNestedArray(),n=0;n0)return m.shift();if(b)return r();var n,o,u;do{if(v===y)return null;for(n=!1;/\s/.test(u=i(v));)if(u===a&&++g,++v===y)return null;if(i(v)===f){if(++v===y)throw t("comment");if(i(v)===f){for(;i(++v)!==a;)if(v===y)return null;++v,++g,n=!0}else{if((u=i(v))!==l)return f;do{if(u===a&&++g,++v===y)return null;o=u,u=i(v)}while(o!==l||u!==f);++v,n=!0}}}while(n);if(v===y)return null;var h=v;s.lastIndex=0;var c=s.test(i(h++));if(!c)for(;h]/g,o=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,u=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a="\n",f="/",l="*"},{}],21:[function(e,t,r){"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.k=null,this.l=null,this.m=null,this.n=null,this.o=null}function i(e){return e.k=e.l=e.n=e.o=null,delete e.encode,delete e.decode,e}t.exports=n;var s=e(11),o=s.prototype,u=s.extend(n),a=e(6),f=e(13),l=e(7),h=e(19),c=e(2),d=e(9),p=e(15),v=e(32),y=e(23),g=e(5),m=e(4),b=e(31);y.props(u,{fieldsById:{get:function(){if(this.k)return this.k;this.k={};for(var e=Object.keys(this.fields),t=0;t0?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")}var util=exports;util.codegen=require(25),util.toArray=function(e){if(!e)return[];for(var t=Object.keys(e),r=t.length,n=new Array(r),i=0;i1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};var i=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47];n.encode=function(e,t,r){for(var n,s=new Array(4*Math.ceil((r-t)/3)),o=0,u=0;t>2],n=(3&a)<<4,u=1;break;case 1:s[o++]=i[n|a>>4],n=(15&a)<<2,u=2;break;case 2:s[o++]=i[n|a>>6],s[o++]=i[63&a],u=0}}return u&&(s[o++]=i[n],s[o]=61,1===u&&(s[o+1]=61)),String.fromCharCode.apply(String,s)};for(var s=[],o=0;o1)break;if(void 0===(f=s[f]))throw Error(u);switch(o){case 0:n=f,o=1;break;case 1:t[r++]=n<<2|(48&f)>>4,n=f,o=2;break;case 2:t[r++]=(15&n)<<4|(60&f)>>2,n=f,o=3;break;case 3:t[r++]=(3&n)<<6|f,o=0}}if(1===o)throw Error(u);return r-i}},{}],25:[function(e,t,r){"use strict";function n(){function e(){var t=i.apply(null,arguments),r=c;if(h.length){var n=h[h.length-1];s.test(n)?r=++c:a.test(n)&&++r,u.test(n)&&!u.test(t)?(r=++c,d=!0):d&&f.test(n)&&(r=--c,d=!1),o.test(t)&&(r=--c)}for(var l=0;l ").replace(/\t/g," "));var s=Object.keys(r||(r={}));return Function.apply(null,s.concat("return "+i)).apply(null,s.map(function(e){return r[e]}))}var l=Array.prototype.slice.call(arguments),h=['\t"use strict"'],c=1,d=!1;return e.str=t,e.eof=r,e}function i(e){var t=Array.prototype.slice.call(arguments,1),r=0;return e.replace(/%([djs])/g,function(e,n){var i=t[r++];switch(n){case"j":return JSON.stringify(i);default:return String(i)}})}t.exports=n;var s=/[{[]$/,o=/^[}\]]/,u=/:$/,a=/^\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},{}],26:[function(e,t,r){"use strict";function n(){this.p={}}t.exports=n;var i=n.prototype;i.on=function(e,t,r){return(this.p[e]||(this.p[e]=[])).push({fn:t,ctx:r||this}),this},i.off=function(e,t){if(void 0===e)this.p={};else if(void 0===t)this.p[e]=[];else for(var r=this.p[e],n=0;n>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(e){switch(typeof e){case"number":return n.fromNumber(e);case"string":if(!i.Long)return n.fromNumber(parseInt(e,10));e=i.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 i.Long?new i.Long(this.lo,this.hi,e):{low:this.lo,high:this.hi,unsigned:Boolean(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,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<1<<21?3:4:t<16384?t<128?5:6:t<1<<21?7:8:r<128?9:10}},{23:23}],28:[function(e,t,r){"use strict";function n(e,t,r){var n=r||8192,i=n>>>1,s=null,o=n;return function(r){if(r>i)return e(r);o+r>n&&(s=e(n),o=0);var u=t.call(s,o,o+=r);return 7&o&&(o=(7|o)+1),u}}t.exports=n},{}],29:[function(e,t,r){(function(t){"use strict";var n=r,i=n.LongBits=e(27);n.base64=e(24),n.utf8=e(30),n.pool=e(28);var s=n.isNode=Boolean(t.process&&t.process.versions&&t.process.versions.node);if(n.Buffer=null,s)try{n.Buffer=e("buffer").Buffer}catch(e){}if(n.Long=t.dcodeIO&&t.dcodeIO.Long||null,!n.Long&&s)try{n.Long=e("long")}catch(e){}n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return Boolean(e&&"object"==typeof e)},n.longToHash=function(e){return e?i.from(e).toHash():"\0\0\0\0\0\0\0\0"},n.longFromHash=function(e,t){var r=i.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.longNeq=function(e,t){return"number"==typeof e?"number"==typeof t?e!==t:(e=i.fromNumber(e)).lo!==t.low||e.hi!==t.high:"number"==typeof t?(t=i.fromNumber(t)).lo!==e.low||t.hi!==e.high:e.low!==t.low||e.high!==t.high},n.props=function(e,t){Object.keys(t).forEach(function(r){n.prop(e,r,t[r])})},n.prop=function(e,t,r){var n=!-[1],i=t.substring(0,1).toUpperCase()+t.substring(1);r.get&&(e["get"+i]=r.get),r.set&&(e["set"+i]=n?function(e){r.set.call(this,e),this[t]=e}:r.set),n?void 0!==r.value&&(e[t]=r.value):Object.defineProperty(e,t,r)},n.emptyArray=Object.freeze([]),n.emptyObject=Object.freeze({})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{24:24,27:27,28:28,30:30,buffer:"buffer",long:"long"}],30:[function(e,t,r){"use strict";var n=r;n.length=function(e){for(var t=e.length>>>0,r=0,n=0,i=0;i>6|192,e[t++]=63&o|128):55296===(64512&o)&&56320===(64512&(s=r.charCodeAt(i+1)))?(o=65536+((1023&o)<<10)+(1023&s),++i,e[t++]=o>>18|240,e[t++]=o>>12&63|128,e[t++]=o>>6&63|128,e[t++]=63&o|128):(e[t++]=o>>12|224,e[t++]=o>>6&63|128,e[t++]=63&o|128)}return t-n},n.read=function(e,t,r){if(r){for(var n,i=[],s=0;t191&&n<224?i[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(n>>10),i[s++]=56320+(1023&n)):i[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++];return String.fromCharCode.apply(String,i.slice(0,s))}return""}},{}],31:[function(e,t,r){"use strict";function n(e,t){return"invalid value for field "+e.getFullName()+" ("+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected)"}function i(e,t){switch(e.type){case"double":case"float":if("number"!=typeof t)return n(e,"number");break;case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!c(t))return n(e,"integer");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!(c(t)||t&&c(t.low)&&c(t.high)))return n(e,"integer|Long");break;case"bool":if("boolean"!=typeof t)return n(e,"boolean");break;case"string":if(!h.isString(t))return n(e,"string");break;case"bytes":if(!(t&&"number"==typeof t.length||h.isString(t)))return n(e,"buffer");break;default:if(e.resolvedType instanceof f){if("number"!=typeof e.resolvedType.getValuesById()[t])return n(e,"enum value")}else if(e.resolvedType instanceof l){var r=e.resolvedType.verify(t);if(r)return r}}return null}function s(e,t){switch(e.keyType){case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(/^[\x00-\xff]{8}$/.test(t))return null;case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(/^-?(?:0|[1-9]\d*)$/.test(t))return n(e,"integer key");break;case"bool":if(/^true|false|0|1$/.test(t))return n(e,"boolean key")}return null}function o(e){for(var t,r=this.getFieldsArray(),o=0;o127;)e[t++]=127&r|128,r>>>=7;e[t]=r}function f(e,t,r){for(;r.hi;)e[t++]=127&r.lo|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=127&r.lo|128,r.lo=r.lo>>>7;e[t++]=r.lo}function l(e,t,r){e[t++]=255&r,e[t++]=r>>>8&255,e[t++]=r>>>16&255,e[t]=r>>>24}function h(e,t,r){e.set(r,t)}function c(){o.call(this)}function d(e,t,r){e.writeFloatLE(r,t,!0)}function p(e,t,r){e.writeDoubleLE(r,t,!0)}function v(e,t,r){r.length&&r.copy(e,t,0,r.length)}t.exports=o,o.BufferWriter=c;var y=e(29),g=e(1),m=y.LongBits,b=y.base64,w=y.utf8,k="undefined"!=typeof Uint8Array?Uint8Array:Array;o.Op=n,o.State=s,o.create=function(){return new(y.Buffer&&c||o)},o.alloc=function(e){return new k(e)},k!==Array&&(o.alloc=y.pool(o.alloc,k.prototype.subarray||k.prototype.slice));var x=o.prototype;x.push=function(e,t,r){var i=new n(e,r,t);return this.tail.next=i,this.tail=i,this.len+=t,this},x.tag=function(e,t){return this.push(u,1,e<<3|7&t)},x.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)},x.int32=function(e){return e<0?this.push(f,10,m.fromNumber(e)):this.uint32(e)},x.sint32=function(e){return this.uint32(e<<1^e>>31)},x.uint64=function(e){var t=m.from(e);return this.push(f,t.length(),t)},x.int64=x.uint64,x.sint64=function(e){var t=m.from(e).zzEncode();return this.push(f,t.length(),t)},x.bool=function(e){return this.push(u,1,e?1:0)},x.fixed32=function(e){return this.push(l,4,e>>>0)},x.sfixed32=function(e){return this.push(l,4,e<<1^e>>31)},x.fixed64=function(e){var t=m.from(e);return this.push(l,4,t.lo).push(l,4,t.hi)},x.sfixed64=function(e){var t=m.from(e).zzEncode();return this.push(l,4,t.lo).push(l,4,t.hi)};var O="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,n,i){e[0]=i,r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n]=t[3]}:function(r,n,i){e[0]=i,r[n++]=t[3],r[n++]=t[2],r[n++]=t[1],r[n]=t[0]}}():function(e,t,r){g.write(e,r,t,!1,23,4)};x.float=function(e){return this.push(O,4,e)};var A="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,n,i){e[0]=i,r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n++]=t[3],r[n++]=t[4],r[n++]=t[5],r[n++]=t[6],r[n]=t[7]}:function(r,n,i){e[0]=i,r[n++]=t[7],r[n++]=t[6],r[n++]=t[5],r[n++]=t[4],r[n++]=t[3],r[n++]=t[2],r[n++]=t[1],r[n]=t[0]}}():function(e,t,r){g.write(e,r,t,!1,52,8)};x.double=function(e){return this.push(A,8,e)};var S=k.prototype.set?h:function(e,t,r){for(var n=0;n>>0;if("string"==typeof e&&t){var r=o.alloc(t=b.length(e));b.decode(e,r,0),e=r}return t?this.uint32(t).push(S,t,e):this.push(u,1,0)},x.string=function(e){var t=w.length(e);return t?this.uint32(t).push(w.write,t,e):this.push(u,1,0)},x.fork=function(){return this.states=new s(this,this.states),this.head=this.tail=new n(i,0,0),this.len=0,this},x.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new n(i,0,0),this.len=0),this},x.ldelim=function(e){var t=this.head,r=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=r,this.len+=n,this},x.finish=function(){var e=this.head.next,t=this.constructor.alloc(this.len);this.reset();for(var r=0;e;)e.fn(t,r,e.val),r+=e.len,e=e.next;return t},c.alloc=function(e){return c.alloc=y.Buffer.allocUnsafe?y.Buffer.allocUnsafe:function(e){return new y.Buffer(e)},c.alloc(e)};var N=c.prototype=Object.create(o.prototype);N.constructor=c,"undefined"==typeof Float32Array&&(N.float=function(e){return this.push(d,4,e)}),"undefined"==typeof Float64Array&&(N.double=function(e){return this.push(p,8,e)}),N.bytes=function(e){"string"==typeof e&&(e=y.Buffer.from&&y.Buffer.from(e,"base64")||new y.Buffer(e,"base64"));var t=e.length>>>0;return t?this.uint32(t).push(v,t,e):this.push(u,1,0)};var T=function(){return y.Buffer&&y.Buffer.prototype.utf8Write?function(e,t,r){r.length<40?w.write(e,t,r):e.utf8Write(r,t)}:function(e,t,r){r.length<40?w.write(e,t,r):e.write(r,t)}}();N.string=function(e){var t=e.length<40?w.length(e):y.Buffer.byteLength(e);return t?this.uint32(t).push(T,t,e):this.push(u,1,0)}},{1:1,29:29}],33:[function(e,t,r){(function(t){"use strict";function n(e,t,r){return"function"==typeof t?(r=t,t=new o.Root):t||(t=new o.Root),t.load(e,r)}function i(e,t){return t||(t=new o.Root),t.loadSync(e)}function s(){a.i(),u.i()}var o=t.protobuf=r;o.load=n,o.loadSync=i,o.tokenize=e(20),o.parse=e(14),o.Writer=e(32),o.BufferWriter=o.Writer.BufferWriter;var u=o.Reader=e(15);o.BufferReader=o.Reader.BufferReader,o.encode=e(5),o.decode=e(4),o.verify=e(31),o.ReflectionObject=e(12),o.Namespace=e(11),o.Root=e(16),o.Enum=e(6),o.Type=e(21),o.Field=e(7),o.OneOf=e(13),o.MapField=e(8),o.Service=e(19),o.Method=e(10),o.Class=e(2),o.Message=e(9),o.types=e(22),o.common=e(3),o.rpc=e(17);var a=o.util=e(23);o.configure=s,"function"==typeof define&&define.amd&&define(["long"],function(e){return e&&(o.util.Long=e,s()),o})}).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,19:19,2:2,20:20,21:21,22:22,23:23,3:3,31:31,32:32,4:4,5:5,6:6,7:7,8:8,9:9}]},{},[33]); //# sourceMappingURL=protobuf.min.js.map diff --git a/dist/protobuf.min.js.gz b/dist/protobuf.min.js.gz index d2f97c12a..726ce1044 100644 Binary files a/dist/protobuf.min.js.gz and b/dist/protobuf.min.js.gz differ diff --git a/dist/protobuf.min.js.map b/dist/protobuf.min.js.map index 3dbf03d23..fb5bdbaaf 100644 --- a/dist/protobuf.min.js.map +++ b/dist/protobuf.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/class.js","src/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/mapfield.js","src/message.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/eventemitter.js","src/util/longbits.js","src/util/pool.js","src/util/runtime.js","src/writer.js","src/index.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","read","buffer","offset","isBE","mLen","nBytes","m","eLen","eMax","eBias","nBits","d","NaN","Infinity","Math","pow","write","value","c","rt","abs","isNaN","floor","log","LN2","Class","type","create","Message","Type","util","_TypeError","ctor","clazz","MessageCtor","properties","this","constructor","prototype","merge","$type","getFieldsArray","forEach","field","resolve","name","Array","isArray","defaultValue","emptyArray","isObject","emptyObject","getOneofsArray","oneof","prop","get","keys","Object","indexOf","set","setCtor","codegen","gen","line","sprintf","apply","arguments","level","indent","src","prev","blockOpenRe","test","branchRe","casingRe","inCase","breakRe","blockCloseRe","index","push","str","replace","args","join","eof","scope","undefined","source","verbose","console","Function","concat","map","key","slice","supported","encode","decode","verify","Enum","Reader","types","fallback","readerOrBuffer","fields","getFieldsById","reader","limit","len","pos","message","getCtor","tag","id","resolvedType","keyType","resolvedKeyType","uint32","ks","vs","basic","longToHash","repeated","values","packed","wireType","plimit","skipType","generate","mtype","safeProp","Writer","writer","fi","fork","mapKey","ldelim","required","long","longNeq","reset","keyWireType","invalid","expected","getFullName","verifyValue","isInteger","low","high","isString","getValuesById","reason","verifyKey","genVerifyValue","fieldIndex","ref","toArray","j","genVerifyKey","common","json","nested","google","protobuf","Any","type_url","timeType","Duration","seconds","nanos","Timestamp","Empty","Struct","Value","oneofs","kind","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","NULL_VALUE","ListValue","rule","options","ReflectionObject","_valuesById","clearCache","enm","EnumPrototype","extend","props","valuesById","testJSON","Boolean","fromJSON","toJSON","add","remove","Field","toString","toLowerCase","optional","partOf","Long","extensionField","declaringField","_packed","FieldPrototype","MapField","isPacked","getOption","setOption","ifNotSet","resolved","typeDefault","defaults","parent","lookup","optionDefault","fromValue","jsonConvert","String","Number","toNumber","charAt","MapFieldPrototype","MessagePrototype","asJSON","k","array","fieldsOnly","encodeDelimited","decodeDelimited","Method","requestType","responseType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","MethodPrototype","Namespace","_nestedArray","namespace","arrayToJSON","obj","NamespacePrototype","Service","nestedTypes","nestedError","nestedArray","methods","addJSON","getNestedArray","nestedJson","ns","nestedName","object","setOptions","onAdd","onRemove","define","path","split","ptr","part","shift","resolveAll","parentAlreadyChecked","getRoot","found","Root","ReflectionObjectPrototype","root","fullName","unshift","_handleAdd","_handleRemove","OneOf","fieldNames","ucName","substring","toUpperCase","_fields","addFieldsToParent","OneOfPrototype","splice","lower","token","parse","illegal","tn","s_bclose","readString","next","s_dq","s_sq","skip","peek","readValue","acceptTypeRef","parseNumber","typeRefRe","readRange","start","parseId","end","s_semi","sign","tokenLower","parseInt","parseFloat","acceptNegative","parsePackage","pkg","s_name","parseImport","whichImports","weakImports","imports","parseSyntax","syntax","p3","isProto3","parseCommon","s_option","parseOption","parseType","parseEnum","parseService","parseExtension","nameRe","s_open","s_close","parseMapField","s_required","s_optional","s_repeated","parseField","parseOneOf","extensions","reserved","s_type","camelCase","parseInlineOptions","valueType","parseEnumField","custom","s_bopen","fqTypeRefRe","parseOptionValue","service","parseMethod","st","method","reference","tokenize","head","package","indexOutOfRange","writeLength","RangeError","buf","Tag","readLongVarint","lo","hi","b","LongBits","read_int64_long","toLong","read_int64_number","read_uint64_long","read_uint64_number","read_sint64_long","zzDecode","read_sint64_number","readLongFixed","read_fixed64_long","read_fixed64_number","read_sfixed64_long","read_sfixed64_number","BufferReader","initBufferReader","readStringBuffer_utf8Slice","utf8Slice","readStringBuffer_toString","configure","ReaderPrototype","int64","uint64","sint64","fixed64","sfixed64","ieee754","ArrayImpl","Uint8Array","Buffer","isBuffer","_slice","subarray","int32","octet","sint32","bool","fixed32","sfixed32","readFloat","Float32Array","f32","f8b","float","readDouble","Float64Array","f64","double","bytes","string","out","p","c1","fromCharCode","finish","remain","BufferReaderPrototype","readStringBuffer","readFloatLE","readDoubleLE","_configure","deferred","files","SYNC","handleExtension","extendedType","sisterField","RootPrototype","resolvePath","load","filename","callback","err","cb","process","JSON","parsed","self","fetch","sync","queued","weak","idx","altname","setTimeout","fs","readFileSync","asPromise","loadSync","newDeferred","rpc","rpcImpl","EventEmitter","$rpc","ServicePrototype","endedByRPC","emit","off","_methodsArray","methodsArray","methodName","inherited","getMethodsArray","requestDelimited","responseDelimited","rpcService","request","requestData","setImmediate","responseData","response","err2","unescape","$0","$1","subject","re","stringDelim","stringDoubleRe","stringSingleRe","lastIndex","match","exec","stack","repeat","curr","s_nl","s_sl","s_as","delimRe","delim","actual","equals","_fieldsById","_fieldsArray","_repeatedFieldsArray","_oneofsArray","_ctor","TypePrototype","fieldsById","names","fieldsArray","repeatedFieldsArray","filter","oneofsArray","fieldName","oneOfName","fld","bake","fn","ctx","Promise","reject","onload","xhr","status","responseText","readFile","XMLHttpRequest","onreadystatechange","readyState","open","send","isAbsolutePath","normalizePath","parts","prefix","description","TypeError","eval","originPath","importPath","alreadyNormalized","dst","format","params","param","stringify","underScore","newBuffer","size","allocUnsafe","runtime","_listeners","EventEmitterPrototype","on","evt","listeners","LongBitsPrototype","zero","zzEncode","fromNumber","from","fromString","unsigned","charCodeAt","fromHash","hash","toHash","mask","part0","part1","part2","pool","alloc","SIZE","MAX","slab","isNode","global","versions","node","dcodeIO","isFinite","longFromHash","bits","fromBits","target","descriptors","descriptor","ie8","ucKey","defineProperty","freeze","length64","ceil","b64","encode64","s64","invalidEncoding","decode64","Op","val","noop","State","tail","states","writeByte","writeVarint32","writeVarint64","writeFixed32","writeBytes_set","writeString","c2","byteLength","strlen","BufferWriter","writeFloatBuffer","writeFloatLE","writeDoubleBuffer","writeDoubleLE","writeBytesBuffer","copy","WriterPrototype","op","writeFloat","writeDouble","writeBytes","BufferWriterPrototype","writeStringBuffer","utf8Write","amd"],"mappings":";;;;;;CAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAAA,GAAAL,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAAAX,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,KAAAa,GAAA,SAAAT,EAAAU,EAAAJ,GCkCAA,EAAAK,KAAA,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA,GAAAxB,GAAAyB,EACAC,EAAA,EAAAF,EAAAD,EAAA,EACAI,GAAA,GAAAD,GAAA,EACAE,EAAAD,GAAA,EACAE,GAAA,EACApB,EAAAa,EAAA,EAAAE,EAAA,EACAM,EAAAR,EAAA,GAAA,EACAlB,EAAAgB,EAAAC,EAAAZ,EAOA,KALAA,GAAAqB,EAEA9B,EAAAI,GAAA,IAAAyB,GAAA,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MAFAA,KACAA,EAAA,GAAAjH,GAAA+G,MACAE,EAAAuL,SAAAlB,GA6CA,QAAAnD,KACAxW,EAAAiZ,IACA3U,EAAA2U,IA7GA,GAAA5Q,GAAAia,EAAAja,SAAAxK,CAkDAwK,GAAAqR,KAAAA,EAeArR,EAAAwS,SAAAA,EAGAxS,EAAAoM,SAAAlX,EAAA,IACA8K,EAAAiI,MAAA/S,EAAA,IAGA8K,EAAAhC,OAAA9I,EAAA,IACA8K,EAAAsc,aAAAtc,EAAAhC,OAAAse,YACA,IAAArgB,GACA+D,EAAA/D,OAAA/G,EAAA,GACA8K,GAAA8N,aAAA9N,EAAA/D,OAAA6R,aACA9N,EAAAtG,QAAAxE,EAAA,GAGA8K,EAAAwB,iBAAAtM,EAAA,IACA8K,EAAAiF,UAAA/P,EAAA,IACA8K,EAAA+G,KAAA7R,EAAA,IACA8K,EAAAhE,KAAA9G,EAAA,GACA8K,EAAAtI,KAAAxC,EAAA,IACA8K,EAAAsC,MAAApN,EAAA,GACA8K,EAAAsH,MAAApS,EAAA,IACA8K,EAAAgD,SAAA9N,EAAA,IACA8K,EAAAuF,QAAArQ,EAAA,IACA8K,EAAAyE,OAAAvP,EAAA,IAGA8K,EAAA1I,MAAApC,EAAA,GACA8K,EAAAvI,QAAAvC,EAAA,IAGA8K,EAAA9D,MAAAhH,EAAA,IACA8K,EAAAJ,OAAA1K,EAAA,GACA8K,EAAA0S,IAAAxd,EAAA,GACA,IAAAyC,GACAqI,EAAArI,KAAAzC,EAAA,GACA8K,GAAAmO,UAAAA,EAYA,kBAAA9H,SAAAA,OAAAgX,KACAhX,QAAA,QAAA,SAAA1D,GAKA,MAJAA,KACA3C,EAAArI,KAAAgL,KAAAA,EACAwL,KAEAnO","file":"protobuf.min.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Class;\r\n\r\nvar Message = require(11),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a class instance, which is also a message prototype.\r\n * @classdesc Runtime class providing the tools to create your own custom classes.\r\n * @constructor\r\n * @param {Type} type Reflected type\r\n * @abstract\r\n */\r\nfunction Class(type) {\r\n return Class.create(type);\r\n}\r\n\r\n/**\r\n * Constructs a new message prototype for the specified reflected type and sets up its constructor.\r\n * @param {Type} type Reflected message type\r\n * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted\r\n * @returns {Message} Message prototype\r\n */\r\nClass.create = function create(type, ctor) {\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n var clazz = ctor;\r\n if (clazz) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"ctor\", \"a function\");\r\n } else\r\n clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife\r\n return function Message(properties) {\r\n MessageCtor.call(this, properties);\r\n };\r\n })(Message);\r\n\r\n // Let's pretend...\r\n clazz.constructor = Class;\r\n \r\n // new Class() -> Message.prototype\r\n var prototype = clazz.prototype = new Message();\r\n prototype.constructor = clazz;\r\n\r\n // Static methods on Message are instance methods on Class and vice versa.\r\n util.merge(clazz, Message, true);\r\n\r\n // Classes and messages reference their reflected type\r\n clazz.$type = type;\r\n prototype.$type = type;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n // Register\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n};\r\n\r\n// Static methods on Message are instance methods on Class and vice versa.\r\nClass.prototype = Message;\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @name Class#encode\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @name Class#encodeDelimited\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Class#decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Class#decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Class#verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar util = require(25);\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {Codegen} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {Codegen} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = util.sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n\r\ncodegen.encode = require(5);\r\ncodegen.decode = require(4);\r\ncodegen.verify = require(6);\r\n","\"use strict\";\r\n\r\n/**\r\n * Wire format decoder using code generation on top of reflection that also provides a fallback.\r\n * @exports codegen.decode\r\n * @namespace\r\n */\r\nvar decode = exports;\r\n\r\nvar Enum = require(8),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * A message decoder as generated by {@link codegen.decode.generate}.\r\n * @typedef Decoder\r\n * @type {function}\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n */\r\n\r\n/**\r\n * Fallback {@link Decoder|decoder}.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n */\r\ndecode.fallback = function decode_fallback(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n};\r\n\r\n/**\r\n * Generates a {@link Decoder|decoder} specific to the specified message type.\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\ndecode.generate = function decode_generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(8),\r\n MapField = require(10),\r\n types = require(24),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Message#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(9);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(8),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * \r\n * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`.\r\n * @classdesc Abstract runtime message.\r\n * @extends {Object}\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link Class.create}\r\n */\r\nfunction Message(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/** @alias Message.prototype */\r\nvar MessagePrototype = Message.prototype;\r\n\r\n/**\r\n * Converts this message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nMessagePrototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decode = function decode(readerOrBuffer) {\r\n return this.$type.decode(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n return this.$type.decodeDelimited(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(8),\r\n Type = require(23),\r\n Field = require(9),\r\n Service = require(21),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(18),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Constructor prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var prototype = constructor.prototype = Object.create(this.prototype);\r\n prototype.constructor = constructor;\r\n constructor.extend = extend;\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(14);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(9),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(22),\r\n Root = require(18),\r\n Type = require(23),\r\n Field = require(9),\r\n MapField = require(10),\r\n OneOf = require(15),\r\n Enum = require(8),\r\n Service = require(21),\r\n Method = require(12),\r\n types = require(24),\r\n util = require(25);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js\r\n var bytes = this.bytes(),\r\n len = bytes.length;\r\n if (len) {\r\n var out = new Array(len), p = 0, c = 0;\r\n while (p < len) {\r\n var c1 = bytes[p++];\r\n if (c1 < 128)\r\n out[c++] = c1;\r\n else if (c1 > 191 && c1 < 224)\r\n out[c++] = (c1 & 31) << 6 | bytes[p++] & 63;\r\n else if (c1 > 239 && c1 < 365) {\r\n var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000;\r\n out[c++] = 0xD800 + (u >> 10);\r\n out[c++] = 0xDC00 + (u & 1023);\r\n } else\r\n out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, c));\r\n }\r\n return \"\";\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader._configure = configure;\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(9),\r\n util = require(25),\r\n common = require(7);\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(16)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(20);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` when the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(12),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Uint8Array} [responseData] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(8),\r\n OneOf = require(15),\r\n Field = require(9),\r\n Service = require(21),\r\n Class = require(2),\r\n Message = require(11),\r\n Reader = require(17),\r\n Writer = require(30),\r\n util = require(25),\r\n codegen = require(3);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Class}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n return this._ctor || (this._ctor = Class.create(this).constructor);\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Message))\r\n throw util._TypeError(\"ctor\", \"a Message constructor\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @returns {Message} Runtime message\r\n */\r\nTypePrototype.create = function create(properties) {\r\n return new (this.getCtor())(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode(message, writer) {\r\n return (this.encode = codegen.supported\r\n ? codegen.encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.encode.fallback\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decode = function decode(readerOrBuffer, length) {\r\n return (this.decode = codegen.supported\r\n ? codegen.decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.decode.fallback\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Message|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify(message) {\r\n return (this.verify = codegen.supported\r\n ? codegen.verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : codegen.verify.fallback\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(25);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} [callback] Callback function\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (util.isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Minimalistic sprintf.\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {string} Formatted string\r\n */\r\nutil.sprintf = function sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n case \"p\":\r\n return util.safeProp(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0; \r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nvar runtime = require(29);\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, runtime);\r\n\r\nutil._configure = function configure() {\r\n runtime.Long = util.Long;\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(25);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n // fallthrough\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo, this.hi, unsigned)\r\n : { low: this.lo, high: this.hi, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * A drop-in buffer pool, similar in functionality to what node uses for buffers.\r\n * @memberof util\r\n * @function\r\n * @param {function(number):Uint8Array} alloc Allocator\r\n * @param {function(number, number):Uint8Array} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {function(number):Uint8Array} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} str Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nutil.length64 = function length64(str) {\r\n var p = str.length;\r\n var n = 0;\r\n if (p)\r\n while (--p % 4 > 1 && str.charAt(p) === '=')\r\n ++n;\r\n return Math.ceil(str.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = [\r\n 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\r\n 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,\r\n 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\r\n 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\r\n];\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nutil.encode64 = function encode64(buffer, start, end) {\r\n var dst = new Array(Math.ceil((end - start) / 3) * 4);\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n dst[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n dst[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n dst[i++] = b64[t | b >> 6];\r\n dst[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n }\r\n switch (j) {\r\n case 1:\r\n dst[i++] = b64[t];\r\n dst[i++] = 61;\r\n dst[i ] = 61;\r\n break;\r\n case 2:\r\n dst[i++] = b64[t];\r\n dst[i ] = 61;\r\n break;\r\n }\r\n return String.fromCharCode.apply(String, dst);\r\n};\r\n\r\n// Base64 decoding table\r\nvar s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i;\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} src Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nutil.decode64 = function decode64(src, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < src.length;) {\r\n var c = src.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\n/**\r\n * Constructs a new writer operation instance.\r\n * @classdesc Scheduled writer operation.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {*} val Value to write\r\n * @param {number} len Value byte length\r\n * @private\r\n * @ignore\r\n */\r\nfunction Op(fn, val, len) {\r\n\r\n /**\r\n * Function to call.\r\n * @type {function(Uint8Array, number, *)}\r\n */\r\n this.fn = fn;\r\n\r\n /**\r\n * Value to write.\r\n * @type {*}\r\n */\r\n this.val = val;\r\n\r\n /**\r\n * Value byte length.\r\n * @type {number}\r\n */\r\n this.len = len;\r\n\r\n /**\r\n * Next operation.\r\n * @type {?Writer.Op}\r\n */\r\n this.next = null;\r\n}\r\n\r\nWriter.Op = Op;\r\n\r\nfunction noop() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Constructs a new writer state instance.\r\n * @classdesc Copied writer state.\r\n * @memberof Writer\r\n * @constructor\r\n * @param {Writer} writer Writer to copy state from\r\n * @param {State} next Next state entry\r\n * @private\r\n * @ignore\r\n */\r\nfunction State(writer, next) {\r\n\r\n /**\r\n * Current head.\r\n * @type {Writer.Op}\r\n */\r\n this.head = writer.head;\r\n\r\n /**\r\n * Current tail.\r\n * @type {Writer.Op}\r\n */\r\n this.tail = writer.tail;\r\n\r\n /**\r\n * Current buffer length.\r\n * @type {number}\r\n */\r\n this.len = writer.len;\r\n\r\n /**\r\n * Next state.\r\n * @type {?State}\r\n */\r\n this.next = next;\r\n}\r\n\r\nWriter.State = State;\r\n\r\n/**\r\n * Constructs a new writer instance.\r\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n */\r\nfunction Writer() {\r\n\r\n /**\r\n * Current length.\r\n * @type {number}\r\n */\r\n this.len = 0;\r\n\r\n /**\r\n * Operations head.\r\n * @type {Object}\r\n */\r\n this.head = new Op(noop, 0, 0);\r\n\r\n /**\r\n * Operations tail\r\n * @type {Object}\r\n */\r\n this.tail = this.head;\r\n\r\n /**\r\n * Linked forked states.\r\n * @type {?Object}\r\n */\r\n this.states = null;\r\n\r\n // When a value is written, the writer calculates its byte length and puts it into a linked\r\n // list of operations to perform when finish() is called. This both allows us to allocate\r\n // buffers of the exact required size and reduces the amount of work we have to do compared\r\n // to first calculating over objects and then encoding over objects. In our case, the encoding\r\n // part is just a linked list walk calling linked operations with already prepared values.\r\n}\r\n\r\n/**\r\n * Creates a new writer.\r\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\r\n */\r\nWriter.create = function create() {\r\n return new (util.Buffer && BufferWriter || Writer);\r\n};\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nWriter.alloc = function alloc(size) {\r\n return new ArrayImpl(size);\r\n};\r\n\r\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\r\nif (ArrayImpl !== Array)\r\n Writer.alloc = util.pool(Writer.alloc, ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice);\r\n\r\n/** @alias Writer.prototype */\r\nvar WriterPrototype = Writer.prototype;\r\n\r\n/**\r\n * Pushes a new operation to the queue.\r\n * @param {function(Uint8Array, number, *)} fn Function to call\r\n * @param {number} len Value byte length\r\n * @param {number} val Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.push = function push(fn, len, val) {\r\n var op = new Op(fn, val, len);\r\n this.tail.next = op;\r\n this.tail = op;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\nfunction writeByte(buf, pos, val) {\r\n buf[pos] = val & 255;\r\n}\r\n\r\n/**\r\n * Writes a tag.\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.tag = function write_tag(id, wireType) {\r\n return this.push(writeByte, 1, id << 3 | wireType & 7);\r\n};\r\n\r\nfunction writeVarint32(buf, pos, val) {\r\n while (val > 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nfunction writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n}\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? writeBytes_set\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (typeof value === 'string' && len) {\r\n var buf = Writer.alloc(len = util.length64(value));\r\n util.decode64(value, buf, 0);\r\n value = buf;\r\n }\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nfunction writeString(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i) {\r\n var c1 = val.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = val.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n}\r\n\r\nfunction byteLength(val) {\r\n var strlen = val.length >>> 0;\r\n var len = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n var c1 = val.charCodeAt(i);\r\n if (c1 < 128)\r\n len += 1;\r\n else if (c1 < 2048)\r\n len += 2;\r\n else if ((c1 & 0xFC00) === 0xD800 && (val.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n}\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeString, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n if (typeof value === 'string')\r\n value = util.Buffer.from && util.Buffer.from(value, \"base64\") || new util.Buffer(value, \"base64\");\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n writeString(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? byteLength(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\n var Reader =\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.codegen = require(\"./codegen\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Class = require(\"./class\");\r\nprotobuf.Message = require(\"./message\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\n var util =\r\nprotobuf.util = require(\"./util\");\r\nprotobuf.configure = configure;\r\n\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n util._configure();\r\n Reader._configure();\r\n}\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","lib/ieee754.js","src/class.js","src/common.js","src/decode.js","src/encode.js","src/enum.js","src/field.js","src/mapfield.js","src/message.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/reader.js","src/root.js","src/rpc.js","src/rpc/service.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.js","src/util/base64/index.js","src/util/codegen/index.js","src/util/eventemitter/index.js","src/util/longbits.js","src/util/pool/index.js","src/util/runtime.js","src/util/utf8/index.js","src/verify.js","src/writer.js","src/index.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length","1","module","read","buffer","offset","isBE","mLen","nBytes","m","eLen","eMax","eBias","nBits","d","NaN","Infinity","Math","pow","write","value","c","rt","abs","isNaN","floor","log","LN2","Class","type","create","Message","Type","util","_TypeError","ctor","clazz","MessageCtor","properties","this","constructor","prototype","merge","$type","getFieldsArray","forEach","field","resolve","name","Array","isArray","defaultValue","emptyArray","isObject","emptyObject","getOneofsArray","oneof","prop","get","keys","Object","indexOf","set","setCtor","common","json","test","nested","google","protobuf","Any","fields","type_url","id","timeType","Duration","seconds","nanos","Timestamp","Empty","Struct","keyType","Value","oneofs","kind","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","values","NULL_VALUE","ListValue","rule","decode","readerOrBuffer","getFieldsById","reader","Reader","limit","undefined","len","pos","message","getCtor","tag","resolvedType","Enum","map","resolvedKeyType","uint32","ks","vs","types","basic","longToHash","repeated","packed","wireType","plimit","skipType","generate","mtype","gen","codegen","safeProp","encode","writer","Writer","fi","fork","mapKey","ldelim","required","long","longNeq","reset","keyWireType","options","ReflectionObject","_valuesById","clearCache","enm","EnumPrototype","extend","props","valuesById","testJSON","Boolean","fromJSON","toJSON","add","isString","isInteger","getValuesById","remove","Field","toString","toLowerCase","optional","partOf","Long","extensionField","declaringField","_packed","FieldPrototype","MapField","isPacked","getOption","setOption","ifNotSet","resolved","typeDefault","defaults","parent","lookup","optionDefault","fromValue","jsonConvert","String","Number","toNumber","charAt","MapFieldPrototype","MessagePrototype","asJSON","k","push","key","array","j","fieldsOnly","encodeDelimited","decodeDelimited","verify","Method","requestType","responseType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","MethodPrototype","Namespace","_nestedArray","namespace","arrayToJSON","obj","NamespacePrototype","Service","nestedTypes","nestedError","join","nestedArray","toArray","methods","addJSON","getNestedArray","nestedJson","ns","nestedName","object","prev","setOptions","onAdd","onRemove","define","path","split","ptr","part","shift","resolveAll","parentAlreadyChecked","getRoot","slice","found","Root","ReflectionObjectPrototype","root","fullName","getFullName","unshift","_handleAdd","_handleRemove","OneOf","fieldNames","ucName","substring","toUpperCase","_fields","addFieldsToParent","OneOfPrototype","index","splice","lower","token","parse","source","illegal","tn","line","s_bclose","readString","next","s_dq","s_sq","skip","peek","readValue","acceptTypeRef","parseNumber","typeRefRe","readRange","start","parseId","end","s_semi","sign","tokenLower","parseInt","parseFloat","acceptNegative","parsePackage","pkg","s_name","parseImport","whichImports","weakImports","imports","parseSyntax","syntax","p3","isProto3","parseCommon","s_option","parseOption","parseType","parseEnum","parseService","parseExtension","nameRe","s_open","s_close","parseMapField","s_required","s_optional","s_repeated","parseField","parseOneOf","extensions","reserved","s_type","camelCase","parseInlineOptions","valueType","parseEnumField","custom","s_bopen","fqTypeRefRe","parseOptionValue","service","parseMethod","st","method","reference","tokenize","head","package","indexOutOfRange","writeLength","RangeError","buf","Tag","readLongVarint","lo","hi","b","LongBits","read_int64_long","toLong","read_int64_number","read_uint64_long","read_uint64_number","read_sint64_long","zzDecode","read_sint64_number","readLongFixed","read_fixed64_long","read_fixed64_number","read_sfixed64_long","read_sfixed64_number","BufferReader","initBufferReader","readStringBuffer_utf8Slice","utf8Slice","readStringBuffer_toString","configure","ReaderPrototype","int64","uint64","sint64","fixed64","sfixed64","ieee754","utf8","ArrayImpl","Uint8Array","Buffer","isBuffer","_slice","subarray","int32","octet","sint32","bool","fixed32","sfixed32","readFloat","Float32Array","f32","f8b","float","readDouble","Float64Array","f64","double","bytes","string","finish","remain","BufferReaderPrototype","readStringBuffer","readFloatLE","readDoubleLE","_configure","deferred","files","SYNC","handleExtension","extendedType","sisterField","RootPrototype","resolvePath","load","filename","callback","err","cb","process","JSON","parsed","self","fetch","sync","queued","weak","idx","altname","setTimeout","fs","readFileSync","asPromise","loadSync","newDeferred","rpc","rpcImpl","EventEmitter","$rpc","ServicePrototype","endedByRPC","emit","off","_methodsArray","methodsArray","methodName","inherited","getMethodsArray","requestDelimited","responseDelimited","rpcService","request","requestData","setImmediate","responseData","response","err2","unescape","str","replace","$0","$1","subject","re","stringDelim","stringDoubleRe","stringSingleRe","lastIndex","match","exec","stack","repeat","curr","s_nl","s_sl","s_as","delimRe","delim","expected","actual","equals","_fieldsById","_fieldsArray","_repeatedFieldsArray","_oneofsArray","_ctor","TypePrototype","fieldsById","names","fieldsArray","repeatedFieldsArray","filter","oneofsArray","fieldName","oneOfName","supported","eof","fld","bake","fn","ctx","args","arguments","Promise","reject","apply","concat","onload","xhr","status","responseText","readFile","XMLHttpRequest","onreadystatechange","readyState","open","send","isAbsolutePath","normalizePath","parts","prefix","description","TypeError","eval","originPath","importPath","alreadyNormalized","dst","src","underScore","newBuffer","size","allocUnsafe","runtime","base64","p","ceil","b64","fromCharCode","s64","invalidEncoding","charCodeAt","sprintf","level","indent","blockOpenRe","branchRe","casingRe","inCase","breakRe","blockCloseRe","scope","verbose","console","Function","format","params","param","stringify","_listeners","EventEmitterPrototype","on","evt","listeners","LongBitsPrototype","zero","zzEncode","fromNumber","from","fromString","low","high","unsigned","fromHash","hash","toHash","mask","part0","part1","part2","pool","alloc","SIZE","MAX","slab","isNode","global","versions","node","dcodeIO","isFinite","longFromHash","bits","fromBits","target","descriptors","descriptor","ie8","ucKey","defineProperty","freeze","strlen","c2","c1","out","invalid","verifyValue","reason","verifyKey","genVerifyValue","fieldIndex","ref","genVerifyKey","Op","val","noop","State","tail","states","writeByte","writeVarint32","writeVarint64","writeFixed32","writeBytes_set","BufferWriter","writeFloatBuffer","writeFloatLE","writeDoubleBuffer","writeDoubleLE","writeBytesBuffer","copy","WriterPrototype","op","writeFloat","writeDouble","writeBytes","BufferWriterPrototype","writeStringBuffer","utf8Write","byteLength","amd"],"mappings":";;;;;;CAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAAA,GAAAL,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAA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Z,QAAA,QAAA,SAAAjE,GAKA,MAJAA,KACA9F,EAAApC,KAAAkI,KAAAA,EACAoM,KAEAlS","file":"protobuf.min.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o> 1,\r\n nBits = -7,\r\n i = isBE ? 0 : (nBytes - 1),\r\n d = isBE ? 1 : -1,\r\n s = buffer[offset + i];\r\n\r\n i += d;\r\n\r\n e = s & ((1 << (-nBits)) - 1);\r\n s >>= (-nBits);\r\n nBits += eLen;\r\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n m = e & ((1 << (-nBits)) - 1);\r\n e >>= (-nBits);\r\n nBits += mLen;\r\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);\r\n\r\n if (e === 0) {\r\n e = 1 - eBias;\r\n } else if (e === eMax) {\r\n return m ? NaN : ((s ? -1 : 1) * Infinity);\r\n } else {\r\n m = m + Math.pow(2, mLen);\r\n e = e - eBias;\r\n }\r\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\r\n};\r\n\r\nexports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) {\r\n var e, m, c,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),\r\n i = isBE ? (nBytes - 1) : 0,\r\n d = isBE ? -1 : 1,\r\n s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\r\n\r\n value = Math.abs(value);\r\n\r\n if (isNaN(value) || value === Infinity) {\r\n m = isNaN(value) ? 1 : 0;\r\n e = eMax;\r\n } else {\r\n e = Math.floor(Math.log(value) / Math.LN2);\r\n if (value * (c = Math.pow(2, -e)) < 1) {\r\n e--;\r\n c *= 2;\r\n }\r\n if (e + eBias >= 1) {\r\n value += rt / c;\r\n } else {\r\n value += rt * Math.pow(2, 1 - eBias);\r\n }\r\n if (value * c >= 2) {\r\n e++;\r\n c /= 2;\r\n }\r\n\r\n if (e + eBias >= eMax) {\r\n m = 0;\r\n e = eMax;\r\n } else if (e + eBias >= 1) {\r\n m = (value * c - 1) * Math.pow(2, mLen);\r\n e = e + eBias;\r\n } else {\r\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\r\n e = 0;\r\n }\r\n }\r\n\r\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);\r\n\r\n e = (e << mLen) | m;\r\n eLen += mLen;\r\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);\r\n\r\n buffer[offset + i - d] |= s * 128;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Class;\r\n\r\nvar Message = require(9),\r\n Type = require(21),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a class instance, which is also a message prototype.\r\n * @classdesc Runtime class providing the tools to create your own custom classes.\r\n * @constructor\r\n * @param {Type} type Reflected type\r\n * @abstract\r\n */\r\nfunction Class(type) {\r\n return Class.create(type);\r\n}\r\n\r\n/**\r\n * Constructs a new message prototype for the specified reflected type and sets up its constructor.\r\n * @param {Type} type Reflected message type\r\n * @param {*} [ctor] Custom constructor to set up, defaults to create a generic one if omitted\r\n * @returns {Message} Message prototype\r\n */\r\nClass.create = function create(type, ctor) {\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n var clazz = ctor;\r\n if (clazz) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"ctor\", \"a function\");\r\n } else\r\n clazz = (function(MessageCtor) { // eslint-disable-line wrap-iife\r\n return function Message(properties) {\r\n MessageCtor.call(this, properties);\r\n };\r\n })(Message);\r\n\r\n // Let's pretend...\r\n clazz.constructor = Class;\r\n \r\n // new Class() -> Message.prototype\r\n var prototype = clazz.prototype = new Message();\r\n prototype.constructor = clazz;\r\n\r\n // Static methods on Message are instance methods on Class and vice versa.\r\n util.merge(clazz, Message, true);\r\n\r\n // Classes and messages reference their reflected type\r\n clazz.$type = type;\r\n prototype.$type = type;\r\n\r\n // Messages have non-enumerable default values on their prototype\r\n type.getFieldsArray().forEach(function(field) {\r\n field.resolve();\r\n // objects on the prototype must be immmutable. users must assign a new object instance and\r\n // cannot use Array#push on empty arrays on the prototype for example, as this would modify\r\n // the value on the prototype for ALL messages of this type. Hence, these objects are frozen.\r\n prototype[field.name] = Array.isArray(field.defaultValue)\r\n ? util.emptyArray\r\n : util.isObject(field.defaultValue)\r\n ? util.emptyObject\r\n : field.defaultValue;\r\n });\r\n\r\n // Messages have non-enumerable getters and setters for each virtual oneof field\r\n type.getOneofsArray().forEach(function(oneof) {\r\n util.prop(prototype, oneof.resolve().name, {\r\n get: function getVirtual() {\r\n // > If the parser encounters multiple members of the same oneof on the wire, only the last member seen is used in the parsed message.\r\n var keys = Object.keys(this);\r\n for (var i = keys.length - 1; i > -1; --i)\r\n if (oneof.oneof.indexOf(keys[i]) > -1)\r\n return keys[i];\r\n return undefined;\r\n },\r\n set: function setVirtual(value) {\r\n var keys = oneof.oneof;\r\n for (var i = 0; i < keys.length; ++i)\r\n if (keys[i] !== value)\r\n delete this[keys[i]];\r\n }\r\n });\r\n });\r\n\r\n // Register\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n};\r\n\r\n// Static methods on Message are instance methods on Class and vice versa.\r\nClass.prototype = Message;\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @name Class#encode\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @name Class#encodeDelimited\r\n * @function\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Class#decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Class#decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Class#verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\n","\"use strict\";\r\n\r\nmodule.exports = common;\r\n\r\n/**\r\n * Provides common type definitions.\r\n * Can also be used to provide additional google types or your own custom types.\r\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\r\n * @param {Object} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\r\n * @returns {undefined}\r\n * @property {Object} google/protobuf/any.proto Any\r\n * @property {Object} google/protobuf/duration.proto Duration\r\n * @property {Object} google/protobuf/empty.proto Empty\r\n * @property {Object} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\r\n * @property {Object} google/protobuf/timestamp.proto Timestamp\r\n */\r\nfunction common(name, json) {\r\n if (!/\\/|\\./.test(name)) {\r\n name = \"google/protobuf/\" + name + \".proto\";\r\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\r\n }\r\n common[name] = json;\r\n}\r\n\r\n// Not provided because of limited use (feel free to discuss or to provide yourself):\r\n// - google/protobuf/descriptor.proto\r\n// - google/protobuf/field_mask.proto\r\n// - google/protobuf/source_context.proto\r\n// - google/protobuf/type.proto\r\n// - google/protobuf/wrappers.proto\r\n\r\ncommon(\"any\", {\r\n Any: {\r\n fields: {\r\n type_url: {\r\n type: \"string\",\r\n id: 1\r\n },\r\n value: {\r\n type: \"bytes\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\nvar timeType;\r\n\r\ncommon(\"duration\", {\r\n Duration: timeType = {\r\n fields: {\r\n seconds: {\r\n type: \"int64\",\r\n id: 1\r\n },\r\n nanos: {\r\n type: \"int32\",\r\n id: 2\r\n }\r\n }\r\n }\r\n});\r\n\r\ncommon(\"timestamp\", {\r\n Timestamp: timeType\r\n});\r\n\r\ncommon(\"empty\", {\r\n Empty: {\r\n fields: {}\r\n }\r\n});\r\n\r\ncommon(\"struct\", {\r\n Struct: {\r\n fields: {\r\n fields: {\r\n keyType: \"string\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n },\r\n Value: {\r\n oneofs: {\r\n kind: {\r\n oneof: [ \"nullValue\", \"numberValue\", \"stringValue\", \"boolValue\", \"structValue\", \"listValue\" ]\r\n }\r\n },\r\n fields: {\r\n nullValue: {\r\n type: \"NullValue\",\r\n id: 1\r\n },\r\n numberValue: {\r\n type: \"double\",\r\n id: 2\r\n },\r\n stringValue: {\r\n type: \"string\",\r\n id: 3\r\n },\r\n boolValue: {\r\n type: \"bool\",\r\n id: 4\r\n },\r\n structValue: {\r\n type: \"Struct\",\r\n id: 5\r\n },\r\n listValue: {\r\n type: \"ListValue\",\r\n id: 6\r\n }\r\n }\r\n },\r\n NullValue: {\r\n values: {\r\n NULL_VALUE: 0\r\n }\r\n },\r\n ListValue: {\r\n fields: {\r\n values: {\r\n rule: \"repeated\",\r\n type: \"Value\",\r\n id: 1\r\n }\r\n }\r\n }\r\n});\r\n","\"use strict\";\r\nmodule.exports = decode;\r\n\r\nvar Enum = require(6),\r\n Reader = require(15),\r\n types = require(22),\r\n util = require(23);\r\n\r\n/**\r\n * General purpose message decoder.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Populated runtime message\r\n * @this Type\r\n * @property {GenerateDecoder} generate Generates a type specific decoder\r\n */\r\nfunction decode(readerOrBuffer, length) {\r\n /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsById(),\r\n reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer),\r\n limit = length === undefined ? reader.len : reader.pos + length,\r\n message = new (this.getCtor())();\r\n while (reader.pos < limit) {\r\n var tag = reader.tag(),\r\n field = fields[tag.id].resolve(),\r\n type = field.resolvedType instanceof Enum ? \"uint32\" : field.type;\r\n \r\n // Known fields\r\n if (field) {\r\n\r\n // Map fields\r\n if (field.map) {\r\n var keyType = field.resolvedKeyType /* only valid is enum */ ? \"uint32\" : field.keyType,\r\n length = reader.uint32();\r\n var map = message[field.name] = {};\r\n if (length) {\r\n length += reader.pos;\r\n var ks = [], vs = [];\r\n while (reader.pos < length) {\r\n if (reader.tag().id === 1)\r\n ks[ks.length] = reader[keyType]();\r\n else if (types.basic[type] !== undefined)\r\n vs[vs.length] = reader[type]();\r\n else\r\n vs[vs.length] = field.resolvedType.decode(reader, reader.uint32());\r\n }\r\n for (var i = 0; i < ks.length; ++i)\r\n map[typeof ks[i] === 'object' ? util.longToHash(ks[i]) : ks[i]] = vs[i];\r\n }\r\n\r\n // Repeated fields\r\n } else if (field.repeated) {\r\n var values = message[field.name] && message[field.name].length ? message[field.name] : message[field.name] = [];\r\n\r\n // Packed\r\n if (field.packed && types.packed[type] !== undefined && tag.wireType === 2) {\r\n var plimit = reader.uint32() + reader.pos;\r\n while (reader.pos < plimit)\r\n values[values.length] = reader[type]();\r\n\r\n // Non-packed\r\n } else if (types.basic[type] !== undefined)\r\n values[values.length] = reader[type]();\r\n else\r\n values[values.length] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Non-repeated\r\n } else if (types.basic[type] !== undefined)\r\n message[field.name] = reader[type]();\r\n else\r\n message[field.name] = field.resolvedType.decode(reader, reader.uint32());\r\n\r\n // Unknown fields\r\n } else\r\n reader.skipType(tag.wireType);\r\n }\r\n return message;\r\n /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */\r\n}\r\n\r\n/**\r\n * Generates a decoder specific to the specified message type.\r\n * @typedef GenerateDecoder\r\n * @type {function}\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\n/**/\r\ndecode.generate = function generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray(); \r\n var gen = util.codegen(\"r\", \"l\")\r\n\r\n (\"r instanceof Reader||(r=Reader.create(r))\")\r\n (\"var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())\")\r\n (\"while(r.pos} [values] Enum values as an object, by name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Enum(name, values, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Enum values by name.\r\n * @type {Object.}\r\n */\r\n this.values = values || {}; // toJSON, marker\r\n\r\n /**\r\n * Cached values by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._valuesById = null;\r\n}\r\n\r\nutil.props(EnumPrototype, {\r\n\r\n /**\r\n * Enum values by id.\r\n * @name Enum#valuesById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n valuesById: {\r\n get: function getValuesById() {\r\n if (!this._valuesById) {\r\n this._valuesById = {};\r\n Object.keys(this.values).forEach(function(name) {\r\n var id = this.values[name];\r\n if (this._valuesById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._valuesById[id] = name;\r\n }, this);\r\n }\r\n return this._valuesById;\r\n }\r\n }\r\n\r\n /**\r\n * Gets this enum's values by id. This is an alias of {@link Enum#valuesById}'s getter for use within non-ES5 environments.\r\n * @name Enum#getValuesById\r\n * @function\r\n * @returns {Object.}\r\n */\r\n});\r\n\r\nfunction clearCache(enm) {\r\n enm._valuesById = null;\r\n return enm;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes an enum.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes an enum\r\n */\r\nEnum.testJSON = function testJSON(json) {\r\n return Boolean(json && json.values);\r\n};\r\n\r\n/**\r\n * Creates an enum from JSON.\r\n * @param {string} name Enum name\r\n * @param {Object.} json JSON object\r\n * @returns {Enum} Created enum\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nEnum.fromJSON = function fromJSON(name, json) {\r\n return new Enum(name, json.values, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nEnumPrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n values : this.values\r\n };\r\n};\r\n\r\n/**\r\n * Adds a value to this enum.\r\n * @param {string} name Value name\r\n * @param {number} id Value id\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a value with this name or id\r\n */\r\nEnumPrototype.add = function(name, id) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (this.values[name] !== undefined)\r\n throw Error('duplicate name \"' + name + '\" in ' + this);\r\n if (this.getValuesById()[id] !== undefined)\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this.values[name] = id;\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a value from this enum\r\n * @param {string} name Value name\r\n * @returns {Enum} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `name` is not a name of this enum\r\n */\r\nEnumPrototype.remove = function(name) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (this.values[name] === undefined)\r\n throw Error('\"' + name + '\" is not a name of ' + this);\r\n delete this.values[name];\r\n return clearCache(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Field;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(21),\r\n Enum = require(6),\r\n MapField = require(8),\r\n types = require(22),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\r\n * @classdesc Reflected message field.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} type Value type\r\n * @param {string|Object} [rule=\"optional\"] Field rule\r\n * @param {string|Object} [extend] Extended type if different from parent\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Field(name, id, type, rule, extend, options) {\r\n if (util.isObject(rule)) {\r\n options = rule;\r\n rule = extend = undefined;\r\n } else if (util.isObject(extend)) {\r\n options = extend;\r\n extend = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (!util.isInteger(id) || id < 0)\r\n throw _TypeError(\"id\", \"a non-negative integer\");\r\n if (!util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (extend !== undefined && !util.isString(extend))\r\n throw _TypeError(\"extend\");\r\n if (rule !== undefined && !/^required|optional|repeated$/.test(rule = rule.toString().toLowerCase()))\r\n throw _TypeError(\"rule\", \"a valid rule string\");\r\n\r\n /**\r\n * Field rule, if any.\r\n * @type {string|undefined}\r\n */\r\n this.rule = rule && rule !== 'optional' ? rule : undefined; // toJSON\r\n\r\n /**\r\n * Field type.\r\n * @type {string}\r\n */\r\n this.type = type; // toJSON\r\n\r\n /**\r\n * Unique field id.\r\n * @type {number}\r\n */\r\n this.id = id; // toJSON, marker\r\n\r\n /**\r\n * Extended type if different from parent.\r\n * @type {string|undefined}\r\n */\r\n this.extend = extend || undefined; // toJSON\r\n\r\n /**\r\n * Whether this field is required.\r\n * @type {boolean}\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Whether this field is optional.\r\n * @type {boolean}\r\n */\r\n this.optional = !this.required;\r\n\r\n /**\r\n * Whether this field is repeated.\r\n * @type {boolean}\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Whether this field is a map or not.\r\n * @type {boolean}\r\n */\r\n this.map = false;\r\n\r\n /**\r\n * Message this field belongs to.\r\n * @type {?Type}\r\n */\r\n this.message = null;\r\n\r\n /**\r\n * OneOf this field belongs to, if any,\r\n * @type {?OneOf}\r\n */\r\n this.partOf = null;\r\n\r\n /**\r\n * The field's default value. Only relevant when working with proto2.\r\n * @type {*}\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Whether this field's value should be treated as a long.\r\n * @type {boolean}\r\n */\r\n this.long = util.Long ? types.long[type] !== undefined : false;\r\n\r\n /**\r\n * Resolved type if not a basic type.\r\n * @type {?(Type|Enum)}\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Sister-field within the extended type if a declaring extension field.\r\n * @type {?Field}\r\n */\r\n this.extensionField = null;\r\n\r\n /**\r\n * Sister-field within the declaring namespace if an extended field.\r\n * @type {?Field}\r\n */\r\n this.declaringField = null;\r\n\r\n /**\r\n * Internally remembers whether this field is packed.\r\n * @type {?boolean}\r\n * @private\r\n */\r\n this._packed = null;\r\n}\r\n\r\nutil.props(FieldPrototype, {\r\n\r\n /**\r\n * Determines whether this field is packed. Only relevant when repeated and working with proto2.\r\n * @name Field#packed\r\n * @type {boolean}\r\n * @readonly\r\n */\r\n packed: {\r\n get: FieldPrototype.isPacked = function() {\r\n if (this._packed === null)\r\n this._packed = this.getOption(\"packed\") !== false;\r\n return this._packed;\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether this field is packed. This is an alias of {@link Field#packed}'s getter for use within non-ES5 environments.\r\n * @name Field#isPacked\r\n * @function\r\n * @returns {boolean}\r\n */\r\n});\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (name === \"packed\")\r\n this._packed = null;\r\n return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\r\n};\r\n\r\n/**\r\n * Tests if the specified JSON object describes a field.\r\n * @param {*} json Any JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nField.testJSON = function testJSON(json) {\r\n return Boolean(json && json.id !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {Field} Created field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nField.fromJSON = function fromJSON(name, json) {\r\n if (json.keyType !== undefined)\r\n return MapField.fromJSON(name, json);\r\n return new Field(name, json.id, json.type, json.rule, json.extend, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n rule : this.rule !== \"optional\" && this.rule || undefined,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Resolves this field's type references.\r\n * @returns {Field} `this`\r\n * @throws {Error} If any reference cannot be resolved\r\n */\r\nFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n\r\n var typeDefault = types.defaults[this.type];\r\n\r\n // if not a basic type, resolve it\r\n if (typeDefault === undefined) {\r\n var resolved = this.parent.lookup(this.type);\r\n if (resolved instanceof Type) {\r\n this.resolvedType = resolved;\r\n typeDefault = null;\r\n } else if (resolved instanceof Enum) {\r\n this.resolvedType = resolved;\r\n typeDefault = 0;\r\n } else\r\n throw Error(\"unresolvable field type: \" + this.type);\r\n }\r\n\r\n // when everything is resolved determine the default value\r\n var optionDefault;\r\n if (this.map)\r\n this.defaultValue = {};\r\n else if (this.repeated)\r\n this.defaultValue = [];\r\n else if (this.options && (optionDefault = this.options['default']) !== undefined) // eslint-disable-line dot-notation\r\n this.defaultValue = optionDefault;\r\n else\r\n this.defaultValue = typeDefault;\r\n\r\n if (this.long)\r\n this.defaultValue = util.Long.fromValue(this.defaultValue);\r\n \r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Converts a field value to JSON using the specified options. Note that this method does not account for repeated fields and must be called once for each repeated element instead.\r\n * @param {*} value Field value\r\n * @param {Object.} [options] Conversion options\r\n * @returns {*} Converted value\r\n * @see {@link Message#asJSON}\r\n */\r\nFieldPrototype.jsonConvert = function(value, options) {\r\n if (options) {\r\n if (this.resolvedType instanceof Enum && options['enum'] === String) // eslint-disable-line dot-notation\r\n return this.resolvedType.getValuesById()[value];\r\n else if (this.long && options.long)\r\n return options.long === Number\r\n ? typeof value === 'number'\r\n ? value\r\n : util.Long.fromValue(value).toNumber()\r\n : util.Long.fromValue(value, this.type.charAt(0) === 'u').toString();\r\n }\r\n return value;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(7);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = Field.prototype;\r\n/** @alias MapField.prototype */\r\nvar MapFieldPrototype = Field.extend(MapField);\r\n\r\nvar Enum = require(6),\r\n types = require(22),\r\n util = require(23);\r\n\r\n/**\r\n * Constructs a new map field instance.\r\n * @classdesc Reflected map field.\r\n * @extends Field\r\n * @constructor\r\n * @param {string} name Unique name within its namespace\r\n * @param {number} id Unique id within its namespace\r\n * @param {string} keyType Key type\r\n * @param {string} type Value type\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction MapField(name, id, keyType, type, options) {\r\n Field.call(this, name, id, type, options);\r\n if (!util.isString(keyType))\r\n throw util._TypeError(\"keyType\");\r\n \r\n /**\r\n * Key type.\r\n * @type {string}\r\n */\r\n this.keyType = keyType; // toJSON, marker\r\n\r\n /**\r\n * Resolved key type if not a basic type.\r\n * @type {?ReflectionObject}\r\n */\r\n this.resolvedKeyType = null;\r\n\r\n // Overrides Field#map\r\n this.map = true;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a map field.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a field\r\n */\r\nMapField.testJSON = function testJSON(json) {\r\n return Field.testJSON(json) && json.keyType !== undefined;\r\n};\r\n\r\n/**\r\n * Constructs a map field from JSON.\r\n * @param {string} name Field name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created map field\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMapField.fromJSON = function fromJSON(name, json) {\r\n return new MapField(name, json.id, json.keyType, json.type, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.toJSON = function toJSON() {\r\n return {\r\n keyType : this.keyType,\r\n type : this.type,\r\n id : this.id,\r\n extend : this.extend,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMapFieldPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n \r\n // Besides a value type, map fields have a key type to resolve\r\n var keyWireType = types.mapKey[this.keyType];\r\n if (keyWireType === undefined) {\r\n var resolved = this.parent.lookup(this.keyType);\r\n if (!(resolved instanceof Enum))\r\n throw Error(\"unresolvable map key type: \" + this.keyType);\r\n this.resolvedKeyType = resolved;\r\n }\r\n\r\n return FieldPrototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Message;\r\n\r\n/**\r\n * Constructs a new message instance.\r\n * \r\n * This method should be called from your custom constructors, i.e. `Message.call(this, properties)`.\r\n * @classdesc Abstract runtime message.\r\n * @extends {Object}\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link Class.create}\r\n */\r\nfunction Message(properties) {\r\n if (properties) {\r\n var keys = Object.keys(properties);\r\n for (var i = 0; i < keys.length; ++i)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n}\r\n\r\n/** @alias Message.prototype */\r\nvar MessagePrototype = Message.prototype;\r\n\r\n/**\r\n * Converts this message to a JSON object.\r\n * @param {Object.} [options] Conversion options\r\n * @param {boolean} [options.fieldsOnly=false] Converts only properties that reference a field\r\n * @param {*} [options.long] Long conversion type. Only relevant with a long library.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to a possibly unsafe number without, and a `Long` with a long library.\r\n * @param {*} [options.enum=Number] Enum value conversion type.\r\n * Valid values are `String` and `Number` (the global types).\r\n * Defaults to the numeric ids.\r\n * @param {boolean} [options.defaults=false] Also sets default values on the resulting object\r\n * @returns {Object.} JSON object\r\n */\r\nMessagePrototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options.defaults) {\r\n keys = [];\r\n for (var k in this) // eslint-disable-line guard-for-in\r\n keys.push(k);\r\n } else\r\n keys = Object.keys(this);\r\n for (var i = 0, key; i < keys.length; ++i) {\r\n var field = fields[key = keys[i]],\r\n value = this[key];\r\n if (field) {\r\n if (field.repeated) {\r\n if (value && value.length) {\r\n var array = new Array(value.length);\r\n for (var j = 0, l = value.length; j < l; ++j)\r\n array[j] = field.jsonConvert(value[j], options);\r\n json[key] = array;\r\n }\r\n } else\r\n json[key] = field.jsonConvert(value, options);\r\n } else if (!options.fieldsOnly)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Reference to the reflected type.\r\n * @name Message#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encode = function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its length as a varint.\r\n * @param {Message|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @name Message.decode\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decode = function decode(readerOrBuffer) {\r\n return this.$type.decode(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its length as a varint.\r\n * @name Message.decodeDelimited\r\n * @function\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode\r\n * @returns {Message} Decoded message\r\n */\r\nMessage.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n return this.$type.decodeDelimited(readerOrBuffer);\r\n};\r\n\r\n/**\r\n * Verifies a message of this type.\r\n * @name Message.verify\r\n * @function\r\n * @param {Message|Object} message Message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nMessage.verify = function verify(message) {\r\n return this.$type.verify(message);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Method;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias Method.prototype */\r\nvar MethodPrototype = ReflectionObject.extend(Method);\r\n\r\nvar Type = require(21),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new service method instance.\r\n * @classdesc Reflected service method.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Method name\r\n * @param {string|undefined} type Method type, usually `\"rpc\"`\r\n * @param {string} requestType Request message type\r\n * @param {string} responseType Response message type\r\n * @param {boolean|Object} [requestStream] Whether the request is streamed\r\n * @param {boolean|Object} [responseStream] Whether the response is streamed\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options) {\r\n if (util.isObject(requestStream)) {\r\n options = requestStream;\r\n requestStream = responseStream = undefined;\r\n } else if (util.isObject(responseStream)) {\r\n options = responseStream;\r\n responseStream = undefined;\r\n }\r\n if (type && !util.isString(type))\r\n throw _TypeError(\"type\");\r\n if (!util.isString(requestType))\r\n throw _TypeError(\"requestType\");\r\n if (!util.isString(responseType))\r\n throw _TypeError(\"responseType\");\r\n\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Method type.\r\n * @type {string}\r\n */\r\n this.type = type || \"rpc\"; // toJSON\r\n\r\n /**\r\n * Request type.\r\n * @type {string}\r\n */\r\n this.requestType = requestType; // toJSON, marker\r\n\r\n /**\r\n * Whether requests are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.requestStream = requestStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Response type.\r\n * @type {string}\r\n */\r\n this.responseType = responseType; // toJSON\r\n\r\n /**\r\n * Whether responses are streamed or not.\r\n * @type {boolean|undefined}\r\n */\r\n this.responseStream = responseStream ? true : undefined; // toJSON\r\n\r\n /**\r\n * Resolved request type.\r\n * @type {?Type}\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response type.\r\n * @type {?Type}\r\n */\r\n this.resolvedResponseType = null;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service method.\r\n * @param {Object} json JSON object\r\n * @returns {boolean} `true` if the object describes a map field\r\n */\r\nMethod.testJSON = function testJSON(json) {\r\n return Boolean(json && json.requestType !== undefined);\r\n};\r\n\r\n/**\r\n * Constructs a service method from JSON.\r\n * @param {string} name Method name\r\n * @param {Object} json JSON object\r\n * @returns {Method} Created method\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nMethod.fromJSON = function fromJSON(name, json) {\r\n return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.toJSON = function toJSON() {\r\n return {\r\n type : this.type !== \"rpc\" && this.type || undefined,\r\n requestType : this.requestType,\r\n requestStream : this.requestStream,\r\n responseType : this.responseType,\r\n responseStream : this.responseStream,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nMethodPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var resolved = this.parent.lookup(this.requestType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable request type: \" + this.requestType);\r\n this.resolvedRequestType = resolved;\r\n resolved = this.parent.lookup(this.responseType);\r\n if (!(resolved && resolved instanceof Type))\r\n throw Error(\"unresolvable response type: \" + this.requestType);\r\n this.resolvedResponseType = resolved;\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n","\"use strict\";\r\nmodule.exports = Namespace;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(6),\r\n Type = require(21),\r\n Field = require(7),\r\n Service = require(19),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\nvar nestedTypes = [ Enum, Type, Service, Field, Namespace ],\r\n nestedError = \"one of \" + nestedTypes.map(function(ctor) { return ctor.name; }).join(', ');\r\n\r\n/**\r\n * Constructs a new namespace instance.\r\n * @classdesc Reflected namespace and base class of all reflection objects containing nested objects.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Namespace name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Namespace(name, options) {\r\n ReflectionObject.call(this, name, options);\r\n\r\n /**\r\n * Nested objects by name.\r\n * @type {Object.|undefined}\r\n */\r\n this.nested = undefined; // toJSON\r\n\r\n /**\r\n * Cached nested objects as an array.\r\n * @type {?ReflectionObject[]}\r\n * @private\r\n */\r\n this._nestedArray = null;\r\n}\r\n\r\nfunction clearCache(namespace) {\r\n namespace._nestedArray = null;\r\n return namespace;\r\n}\r\n\r\nutil.props(NamespacePrototype, {\r\n\r\n /**\r\n * Nested objects of this namespace as an array for iteration.\r\n * @name Namespace#nestedArray\r\n * @type {ReflectionObject[]}\r\n * @readonly\r\n */\r\n nestedArray: {\r\n get: function getNestedArray() {\r\n return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Tests if the specified JSON object describes not another reflection object.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes not another reflection object\r\n */\r\nNamespace.testJSON = function testJSON(json) {\r\n return Boolean(json\r\n && !json.fields // Type\r\n && !json.values // Enum\r\n && json.id === undefined // Field, MapField\r\n && !json.oneof // OneOf\r\n && !json.methods // Service\r\n && json.requestType === undefined // Method\r\n );\r\n};\r\n\r\n/**\r\n * Constructs a namespace from JSON.\r\n * @param {string} name Namespace name\r\n * @param {Object} json JSON object\r\n * @returns {Namespace} Created namespace\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nNamespace.fromJSON = function fromJSON(name, json) {\r\n return new Namespace(name, json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nNamespacePrototype.toJSON = function toJSON() {\r\n return {\r\n options : this.options,\r\n nested : arrayToJSON(this.getNestedArray())\r\n };\r\n};\r\n\r\n/**\r\n * Converts an array of reflection objects to JSON.\r\n * @memberof Namespace\r\n * @param {ReflectionObject[]} array Object array\r\n * @returns {Object.|undefined} JSON object or `undefined` when array is empty\r\n */\r\nfunction arrayToJSON(array) {\r\n if (!(array && array.length))\r\n return undefined;\r\n var obj = {};\r\n for (var i = 0; i < array.length; ++i)\r\n obj[array[i].name] = array[i].toJSON();\r\n return obj;\r\n}\r\n\r\nNamespace.arrayToJSON = arrayToJSON;\r\n\r\n/**\r\n * Adds nested elements to this namespace from JSON.\r\n * @param {Object.} nestedJson Nested JSON\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.addJSON = function addJSON(nestedJson) {\r\n var ns = this;\r\n if (nestedJson)\r\n Object.keys(nestedJson).forEach(function(nestedName) {\r\n var nested = nestedJson[nestedName];\r\n for (var j = 0; j < nestedTypes.length; ++j)\r\n if (nestedTypes[j].testJSON(nested))\r\n return ns.add(nestedTypes[j].fromJSON(nestedName, nested));\r\n throw _TypeError(\"nested.\" + nestedName, \"JSON for \" + nestedError);\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets the nested object of the specified name.\r\n * @param {string} name Nested object name\r\n * @returns {?ReflectionObject} The reflection object or `null` if it doesn't exist\r\n */\r\nNamespacePrototype.get = function get(name) {\r\n if (this.nested === undefined) // prevents deopt\r\n return null;\r\n return this.nested[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this namespace.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name\r\n */\r\nNamespacePrototype.add = function add(object) {\r\n if (!object || nestedTypes.indexOf(object.constructor) < 0)\r\n throw _TypeError(\"object\", nestedError);\r\n if (object instanceof Field && object.extend === undefined)\r\n throw _TypeError(\"object\", \"an extension field when not part of a type\");\r\n if (!this.nested)\r\n this.nested = {};\r\n else {\r\n var prev = this.get(object.name);\r\n if (prev) {\r\n if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\r\n // replace plain namespace but keep existing nested elements and options\r\n var nested = prev.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i)\r\n object.add(nested[i]);\r\n this.remove(prev);\r\n if (!this.nested)\r\n this.nested = {};\r\n object.setOptions(prev.options, true);\r\n } else\r\n throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\r\n }\r\n }\r\n this.nested[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this namespace.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Namespace} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this namespace\r\n */\r\nNamespacePrototype.remove = function remove(object) {\r\n if (!(object instanceof ReflectionObject))\r\n throw _TypeError(\"object\", \"a ReflectionObject\");\r\n if (object.parent !== this || !this.nested)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.nested[object.name];\r\n if (!Object.keys(this.nested).length)\r\n this.nested = undefined;\r\n object.onRemove(this);\r\n return clearCache(this);\r\n};\r\n\r\n/**\r\n * Defines additial namespaces within this one if not yet existing.\r\n * @param {string|string[]} path Path to create\r\n * @param {*} [json] Nested types to create from JSON\r\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\r\n */\r\nNamespacePrototype.define = function define(path, json) {\r\n if (util.isString(path))\r\n path = path.split('.');\r\n else if (!Array.isArray(path)) {\r\n json = path;\r\n path = undefined;\r\n }\r\n var ptr = this;\r\n if (path)\r\n while (path.length > 0) {\r\n var part = path.shift();\r\n if (ptr.nested && ptr.nested[part]) {\r\n ptr = ptr.nested[part];\r\n if (!(ptr instanceof Namespace))\r\n throw Error(\"path conflicts with non-namespace objects\");\r\n } else\r\n ptr.add(ptr = new Namespace(part));\r\n }\r\n if (json)\r\n ptr.addJSON(json);\r\n return ptr;\r\n};\r\n\r\n/**\r\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree.\r\n * @returns {Namespace} `this`\r\n */\r\nNamespacePrototype.resolveAll = function resolve() {\r\n var nested = this.getNestedArray(), i = 0;\r\n while (i < nested.length)\r\n if (nested[i] instanceof Namespace)\r\n nested[i++].resolveAll();\r\n else\r\n nested[i++].resolve();\r\n return ReflectionObject.prototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * Looks up the reflection object at the specified path, relative to this namespace.\r\n * @param {string|string[]} path Path to look up\r\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\r\n * @returns {?ReflectionObject} Looked up object or `null` if none could be found\r\n */\r\nNamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) {\r\n if (util.isString(path)) {\r\n if (!path.length)\r\n return null;\r\n path = path.split('.');\r\n } else if (!path.length)\r\n return null;\r\n // Start at root if path is absolute\r\n if (path[0] === \"\")\r\n return this.getRoot().lookup(path.slice(1));\r\n // Test if the first part matches any nested object, and if so, traverse if path contains more\r\n var found = this.get(path[0]);\r\n if (found && (path.length === 1 || found instanceof Namespace && (found = found.lookup(path.slice(1), true))))\r\n return found;\r\n // If there hasn't been a match, try again at the parent\r\n if (this.parent === null || parentAlreadyChecked)\r\n return null;\r\n return this.parent.lookup(path);\r\n};\r\n","\"use strict\";\r\nmodule.exports = ReflectionObject;\r\n\r\nReflectionObject.extend = extend;\r\n\r\nvar Root = require(16),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object instance.\r\n * @classdesc Base class of all reflection objects.\r\n * @constructor\r\n * @param {string} name Object name\r\n * @param {Object} [options] Declared options\r\n * @abstract\r\n */\r\nfunction ReflectionObject(name, options) {\r\n if (!util.isString(name))\r\n throw _TypeError(\"name\");\r\n if (options && !util.isObject(options))\r\n throw _TypeError(\"options\", \"an object\");\r\n\r\n /**\r\n * Options.\r\n * @type {Object.|undefined}\r\n */\r\n this.options = options; // toJSON\r\n\r\n /**\r\n * Unique name within its namespace.\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Parent namespace.\r\n * @type {?Namespace}\r\n */\r\n this.parent = null;\r\n\r\n /**\r\n * Whether already resolved or not.\r\n * @type {boolean}\r\n */\r\n this.resolved = false;\r\n}\r\n\r\n/** @alias ReflectionObject.prototype */\r\nvar ReflectionObjectPrototype = ReflectionObject.prototype;\r\n\r\nutil.props(ReflectionObjectPrototype, {\r\n\r\n /**\r\n * Reference to the root namespace.\r\n * @name ReflectionObject#root\r\n * @type {Root}\r\n * @readonly\r\n */\r\n root: {\r\n get: function getRoot() {\r\n var ptr = this;\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n return ptr;\r\n }\r\n },\r\n\r\n /**\r\n * Full name including leading dot.\r\n * @name ReflectionObject#fullName\r\n * @type {string}\r\n * @readonly\r\n */\r\n fullName: {\r\n get: ReflectionObjectPrototype.getFullName = function getFullName() {\r\n var path = [ this.name ],\r\n ptr = this.parent;\r\n while (ptr) {\r\n path.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n }\r\n return path.join('.');\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * Lets the specified constructor extend this class.\r\n * @memberof ReflectionObject\r\n * @param {*} constructor Extending constructor\r\n * @returns {Object} Constructor prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var prototype = constructor.prototype = Object.create(this.prototype);\r\n prototype.constructor = constructor;\r\n constructor.extend = extend;\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Converts this reflection object to its JSON representation.\r\n * @returns {Object} JSON object\r\n * @abstract\r\n */\r\nReflectionObjectPrototype.toJSON = function toJSON() {\r\n throw Error(); // not implemented, shouldn't happen\r\n};\r\n\r\n/**\r\n * Called when this object is added to a parent.\r\n * @param {ReflectionObject} parent Parent added to\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onAdd = function onAdd(parent) {\r\n if (this.parent && this.parent !== parent)\r\n this.parent.remove(this);\r\n this.parent = parent;\r\n this.resolved = false;\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleAdd(this);\r\n};\r\n\r\n/**\r\n * Called when this object is removed from a parent.\r\n * @param {ReflectionObject} parent Parent removed from\r\n * @returns {undefined}\r\n */\r\nReflectionObjectPrototype.onRemove = function onRemove(parent) {\r\n var root = parent.getRoot();\r\n if (root instanceof Root)\r\n root._handleRemove(this);\r\n this.parent = null;\r\n this.resolved = false;\r\n};\r\n\r\n/**\r\n * Resolves this objects type references.\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.resolve = function resolve() {\r\n if (this.resolved)\r\n return this;\r\n var root = this.getRoot();\r\n if (root instanceof Root)\r\n this.resolved = true; // only if part of a root\r\n return this;\r\n};\r\n\r\n/**\r\n * Gets an option value.\r\n * @param {string} name Option name\r\n * @returns {*} Option value or `undefined` if not set\r\n */\r\nReflectionObjectPrototype.getOption = function getOption(name) {\r\n if (this.options)\r\n return this.options[name];\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Sets an option.\r\n * @param {string} name Option name\r\n * @param {*} value Option value\r\n * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOption = function setOption(name, value, ifNotSet) {\r\n if (!ifNotSet || !this.options || this.options[name] === undefined)\r\n (this.options || (this.options = {}))[name] = value;\r\n return this;\r\n};\r\n\r\n/**\r\n * Sets multiple options.\r\n * @param {Object.} options Options to set\r\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\r\n * @returns {ReflectionObject} `this`\r\n */\r\nReflectionObjectPrototype.setOptions = function setOptions(options, ifNotSet) {\r\n if (options)\r\n Object.keys(options).forEach(function(name) {\r\n this.setOption(name, options[name], ifNotSet);\r\n }, this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Converts this instance to its string representation.\r\n * @returns {string} Constructor name, space, full name\r\n */\r\nReflectionObjectPrototype.toString = function toString() {\r\n return this.constructor.name + \" \" + this.getFullName();\r\n};\r\n","\"use strict\";\r\nmodule.exports = OneOf;\r\n\r\nvar ReflectionObject = require(12);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(7),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof instance.\r\n * @classdesc Reflected oneof.\r\n * @extends ReflectionObject\r\n * @constructor\r\n * @param {string} name Oneof name\r\n * @param {string[]|Object} [fieldNames] Field names\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction OneOf(name, fieldNames, options) {\r\n if (!Array.isArray(fieldNames)) {\r\n options = fieldNames;\r\n fieldNames = undefined;\r\n }\r\n ReflectionObject.call(this, name, options);\r\n if (fieldNames && !Array.isArray(fieldNames))\r\n throw _TypeError(\"fieldNames\", \"an Array\");\r\n\r\n /**\r\n * Upper cased name for getter/setter calls.\r\n * @type {string}\r\n */\r\n this.ucName = this.name.substring(0, 1).toUpperCase() + this.name.substring(1);\r\n\r\n /**\r\n * Field names that belong to this oneof.\r\n * @type {string[]}\r\n */\r\n this.oneof = fieldNames || []; // toJSON, marker\r\n\r\n /**\r\n * Fields that belong to this oneof and are possibly not yet added to its parent.\r\n * @type {Field[]}\r\n * @private\r\n */\r\n this._fields = [];\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a oneof.\r\n * @param {*} json JSON object\r\n * @returns {boolean} `true` if the object describes a oneof\r\n */\r\nOneOf.testJSON = function testJSON(json) {\r\n return Boolean(json.oneof);\r\n};\r\n\r\n/**\r\n * Constructs a oneof from JSON.\r\n * @param {string} name Oneof name\r\n * @param {Object} json JSON object\r\n * @returns {MapField} Created oneof\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nOneOf.fromJSON = function fromJSON(name, json) {\r\n return new OneOf(name, json.oneof, json.options);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.toJSON = function toJSON() {\r\n return {\r\n oneof : this.oneof,\r\n options : this.options\r\n };\r\n};\r\n\r\n/**\r\n * Adds the fields of the specified oneof to the parent if not already done so.\r\n * @param {OneOf} oneof The oneof\r\n * @returns {undefined}\r\n * @inner\r\n * @ignore\r\n */\r\nfunction addFieldsToParent(oneof) {\r\n if (oneof.parent)\r\n oneof._fields.forEach(function(field) {\r\n if (!field.parent)\r\n oneof.parent.add(field);\r\n });\r\n}\r\n\r\n/**\r\n * Adds a field to this oneof.\r\n * @param {Field} field Field to add\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.add = function add(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n if (field.parent)\r\n field.parent.remove(field);\r\n this.oneof.push(field.name);\r\n this._fields.push(field);\r\n field.partOf = this; // field.parent remains null\r\n addFieldsToParent(this);\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes a field from this oneof.\r\n * @param {Field} field Field to remove\r\n * @returns {OneOf} `this`\r\n */\r\nOneOfPrototype.remove = function remove(field) {\r\n if (!(field instanceof Field))\r\n throw _TypeError(\"field\", \"a Field\");\r\n var index = this._fields.indexOf(field);\r\n if (index < 0)\r\n throw Error(field + \" is not a member of \" + this);\r\n this._fields.splice(index, 1);\r\n index = this.oneof.indexOf(field.name);\r\n if (index > -1)\r\n this.oneof.splice(index, 1);\r\n if (field.parent)\r\n field.parent.remove(field);\r\n field.partOf = null;\r\n return this;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onAdd = function onAdd(parent) {\r\n ReflectionObject.prototype.onAdd.call(this, parent);\r\n addFieldsToParent(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nOneOfPrototype.onRemove = function onRemove(parent) {\r\n this._fields.forEach(function(field) {\r\n if (field.parent)\r\n field.parent.remove(field);\r\n });\r\n ReflectionObject.prototype.onRemove.call(this, parent);\r\n};\r\n","\"use strict\";\r\nmodule.exports = parse;\r\n\r\nvar tokenize = require(20),\r\n Root = require(16),\r\n Type = require(21),\r\n Field = require(7),\r\n MapField = require(8),\r\n OneOf = require(13),\r\n Enum = require(6),\r\n Service = require(19),\r\n Method = require(10),\r\n types = require(22),\r\n util = require(23);\r\nvar camelCase = util.camelCase;\r\n\r\nvar nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n fqTypeRefRe = /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/;\r\n\r\nfunction lower(token) {\r\n return token === null ? null : token.toLowerCase();\r\n}\r\n\r\nvar s_required = \"required\",\r\n s_repeated = \"repeated\",\r\n s_optional = \"optional\",\r\n s_option = \"option\",\r\n s_name = \"name\",\r\n s_type = \"type\";\r\nvar s_open = \"{\",\r\n s_close = \"}\",\r\n s_bopen = '(',\r\n s_bclose = ')',\r\n s_semi = \";\",\r\n s_dq = '\"',\r\n s_sq = \"'\";\r\n\r\n/**\r\n * Result object returned from {@link parse}.\r\n * @typedef ParserResult\r\n * @type {Object}\r\n * @property {string|undefined} package Package name, if declared\r\n * @property {string[]|undefined} imports Imports, if any\r\n * @property {string[]|undefined} weakImports Weak imports, if any\r\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\r\n * @property {Root} root Populated root instance\r\n */\r\n\r\n/**\r\n * Parses the given .proto source and returns an object with the parsed contents.\r\n * @param {string} source Source contents\r\n * @param {Root} [root] Root to populate\r\n * @returns {ParserResult} Parser result\r\n */\r\nfunction parse(source, root) {\r\n /* eslint-disable callback-return */\r\n if (!root)\r\n root = new Root();\r\n\r\n var tn = tokenize(source),\r\n next = tn.next,\r\n push = tn.push,\r\n peek = tn.peek,\r\n skip = tn.skip;\r\n\r\n var head = true,\r\n pkg,\r\n imports,\r\n weakImports,\r\n syntax,\r\n isProto3 = false;\r\n\r\n if (!root)\r\n root = new Root();\r\n\r\n var ptr = root;\r\n\r\n function illegal(token, name) {\r\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (line \" + tn.line() + s_bclose);\r\n }\r\n\r\n function readString() {\r\n var values = [],\r\n token;\r\n do {\r\n if ((token = next()) !== s_dq && token !== s_sq)\r\n throw illegal(token);\r\n values.push(next());\r\n skip(token);\r\n token = peek();\r\n } while (token === s_dq || token === s_sq);\r\n return values.join('');\r\n }\r\n\r\n function readValue(acceptTypeRef) {\r\n var token = next();\r\n switch (lower(token)) {\r\n case s_sq:\r\n case s_dq:\r\n push(token);\r\n return readString();\r\n case \"true\":\r\n return true;\r\n case \"false\":\r\n return false;\r\n }\r\n try {\r\n return parseNumber(token);\r\n } catch (e) {\r\n if (acceptTypeRef && typeRefRe.test(token))\r\n return token;\r\n throw illegal(token, \"value\");\r\n }\r\n }\r\n\r\n function readRange() {\r\n var start = parseId(next());\r\n var end = start;\r\n if (skip(\"to\", true))\r\n end = parseId(next());\r\n skip(s_semi);\r\n return [ start, end ];\r\n }\r\n\r\n function parseNumber(token) {\r\n var sign = 1;\r\n if (token.charAt(0) === '-') {\r\n sign = -1;\r\n token = token.substring(1);\r\n }\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"inf\": return sign * Infinity;\r\n case \"nan\": return NaN;\r\n case \"0\": return 0;\r\n }\r\n if (/^[1-9][0-9]*$/.test(token))\r\n return sign * parseInt(token, 10);\r\n if (/^0[x][0-9a-f]+$/.test(tokenLower))\r\n return sign * parseInt(token, 16);\r\n if (/^0[0-7]+$/.test(token))\r\n return sign * parseInt(token, 8);\r\n if (/^(?!e)[0-9]*(?:\\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(tokenLower))\r\n return sign * parseFloat(token);\r\n throw illegal(token, 'number');\r\n }\r\n\r\n function parseId(token, acceptNegative) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case \"min\": return 1;\r\n case \"max\": return 0x1FFFFFFF;\r\n case \"0\": return 0;\r\n }\r\n if (token.charAt(0) === '-' && !acceptNegative)\r\n throw illegal(token, \"id\");\r\n if (/^-?[1-9][0-9]*$/.test(token))\r\n return parseInt(token, 10);\r\n if (/^-?0[x][0-9a-f]+$/.test(tokenLower))\r\n return parseInt(token, 16);\r\n if (/^-?0[0-7]+$/.test(token))\r\n return parseInt(token, 8);\r\n throw illegal(token, \"id\");\r\n }\r\n\r\n function parsePackage() {\r\n if (pkg !== undefined)\r\n throw illegal(\"package\");\r\n pkg = next();\r\n if (!typeRefRe.test(pkg))\r\n throw illegal(pkg, s_name);\r\n ptr = ptr.define(pkg);\r\n skip(s_semi);\r\n }\r\n\r\n function parseImport() {\r\n var token = peek();\r\n var whichImports;\r\n switch (token) {\r\n case \"weak\":\r\n whichImports = weakImports || (weakImports = []);\r\n next();\r\n break;\r\n case \"public\":\r\n next();\r\n // eslint-disable-line no-fallthrough\r\n default:\r\n whichImports = imports || (imports = []);\r\n break;\r\n }\r\n token = readString();\r\n skip(s_semi);\r\n whichImports.push(token);\r\n }\r\n\r\n function parseSyntax() {\r\n skip(\"=\");\r\n syntax = lower(readString());\r\n var p3;\r\n if ([ \"proto2\", p3 = \"proto3\" ].indexOf(syntax) < 0)\r\n throw illegal(syntax, \"syntax\");\r\n isProto3 = syntax === p3;\r\n skip(s_semi);\r\n }\r\n\r\n function parseCommon(parent, token) {\r\n switch (token) {\r\n\r\n case s_option:\r\n parseOption(parent, token);\r\n skip(s_semi);\r\n return true;\r\n\r\n case \"message\":\r\n parseType(parent, token);\r\n return true;\r\n\r\n case \"enum\":\r\n parseEnum(parent, token);\r\n return true;\r\n\r\n case \"service\":\r\n parseService(parent, token);\r\n return true;\r\n\r\n case \"extend\":\r\n parseExtension(parent, token);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function parseType(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, \"type name\");\r\n var type = new Type(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n if (parseCommon(type, token))\r\n continue;\r\n switch (tokenLower) {\r\n case \"map\":\r\n parseMapField(type, tokenLower);\r\n break;\r\n case s_required:\r\n case s_optional:\r\n case s_repeated:\r\n parseField(type, tokenLower);\r\n break;\r\n case \"oneof\":\r\n parseOneOf(type, tokenLower);\r\n break;\r\n case \"extensions\":\r\n (type.extensions || (type.extensions = [])).push(readRange(type, tokenLower));\r\n break;\r\n case \"reserved\":\r\n (type.reserved || (type.reserved = [])).push(readRange(type, tokenLower));\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(type, s_optional);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(type);\r\n }\r\n\r\n function parseField(parent, rule, extend) {\r\n var type = next();\r\n if (!typeRefRe.test(type))\r\n throw illegal(type, s_type);\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new Field(name, id, type, rule, extend));\r\n if (field.repeated)\r\n field.setOption(\"packed\", isProto3, /* ifNotSet */ true);\r\n parent.add(field);\r\n }\r\n\r\n function parseMapField(parent) {\r\n skip(\"<\");\r\n var keyType = next();\r\n if (types.mapKey[keyType] === undefined)\r\n throw illegal(keyType, s_type);\r\n skip(\",\");\r\n var valueType = next();\r\n if (!typeRefRe.test(valueType))\r\n throw illegal(valueType, s_type);\r\n skip(\">\");\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n skip(\"=\");\r\n var id = parseId(next());\r\n var field = parseInlineOptions(new MapField(name, id, keyType, valueType));\r\n parent.add(field);\r\n }\r\n\r\n function parseOneOf(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n name = camelCase(name);\r\n var oneof = new OneOf(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (token === s_option) {\r\n parseOption(oneof, token);\r\n skip(s_semi);\r\n } else {\r\n push(token);\r\n parseField(oneof, s_optional);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(oneof);\r\n }\r\n\r\n function parseEnum(parent, token) {\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var values = {};\r\n var enm = new Enum(name, values);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (lower(token) === s_option)\r\n parseOption(enm);\r\n else\r\n parseEnumField(enm, token);\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(enm);\r\n }\r\n\r\n function parseEnumField(parent, token) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n var name = token;\r\n skip(\"=\");\r\n var value = parseId(next(), true);\r\n parent.values[name] = value;\r\n parseInlineOptions({}); // skips enum value options\r\n }\r\n\r\n function parseOption(parent, token) {\r\n var custom = skip(s_bopen, true);\r\n var name = next();\r\n if (!typeRefRe.test(name))\r\n throw illegal(name, s_name);\r\n if (custom) {\r\n skip(s_bclose);\r\n name = s_bopen + name + s_bclose;\r\n token = peek();\r\n if (fqTypeRefRe.test(token)) {\r\n name += token;\r\n next();\r\n }\r\n }\r\n skip(\"=\");\r\n parseOptionValue(parent, name);\r\n }\r\n\r\n function parseOptionValue(parent, name) {\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n if (!nameRe.test(token))\r\n throw illegal(token, s_name);\r\n name = name + \".\" + token;\r\n if (skip(\":\", true))\r\n setOption(parent, name, readValue(true));\r\n else\r\n parseOptionValue(parent, name);\r\n }\r\n } else\r\n setOption(parent, name, readValue(true));\r\n // Does not enforce a delimiter to be universal\r\n }\r\n\r\n function setOption(parent, name, value) {\r\n if (parent.setOption)\r\n parent.setOption(name, value);\r\n else\r\n parent[name] = value;\r\n }\r\n\r\n function parseInlineOptions(parent) {\r\n if (skip(\"[\", true)) {\r\n do {\r\n parseOption(parent, s_option);\r\n } while (skip(\",\", true));\r\n skip(\"]\");\r\n }\r\n skip(s_semi);\r\n return parent;\r\n }\r\n\r\n function parseService(parent, token) {\r\n token = next();\r\n if (!nameRe.test(token))\r\n throw illegal(token, \"service name\");\r\n var name = token;\r\n var service = new Service(name);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(service, tokenLower);\r\n skip(s_semi);\r\n break;\r\n case \"rpc\":\r\n parseMethod(service, tokenLower);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(service);\r\n }\r\n\r\n function parseMethod(parent, token) {\r\n var type = token;\r\n var name = next();\r\n if (!nameRe.test(name))\r\n throw illegal(name, s_name);\r\n var requestType, requestStream,\r\n responseType, responseStream;\r\n skip(s_bopen);\r\n var st;\r\n if (skip(st = \"stream\", true))\r\n requestStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n requestType = token;\r\n skip(s_bclose); skip(\"returns\"); skip(s_bopen);\r\n if (skip(st, true))\r\n responseStream = true;\r\n if (!typeRefRe.test(token = next()))\r\n throw illegal(token);\r\n responseType = token;\r\n skip(s_bclose);\r\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_option:\r\n parseOption(method, tokenLower);\r\n skip(s_semi);\r\n break;\r\n default:\r\n throw illegal(token);\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n parent.add(method);\r\n }\r\n\r\n function parseExtension(parent, token) {\r\n var reference = next();\r\n if (!typeRefRe.test(reference))\r\n throw illegal(reference, \"reference\");\r\n if (skip(s_open, true)) {\r\n while ((token = next()) !== s_close) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n case s_required:\r\n case s_repeated:\r\n case s_optional:\r\n parseField(parent, tokenLower, reference);\r\n break;\r\n default:\r\n if (!isProto3 || !typeRefRe.test(token))\r\n throw illegal(token);\r\n push(token);\r\n parseField(parent, s_optional, reference);\r\n break;\r\n }\r\n }\r\n skip(s_semi, true);\r\n } else\r\n skip(s_semi);\r\n }\r\n\r\n var token;\r\n while ((token = next()) !== null) {\r\n var tokenLower = lower(token);\r\n switch (tokenLower) {\r\n\r\n case \"package\":\r\n if (!head)\r\n throw illegal(token);\r\n parsePackage();\r\n break;\r\n\r\n case \"import\":\r\n if (!head)\r\n throw illegal(token);\r\n parseImport();\r\n break;\r\n\r\n case \"syntax\":\r\n if (!head)\r\n throw illegal(token);\r\n parseSyntax();\r\n break;\r\n\r\n case s_option:\r\n if (!head)\r\n throw illegal(token);\r\n parseOption(ptr, token);\r\n skip(s_semi);\r\n break;\r\n\r\n default:\r\n if (parseCommon(ptr, token)) {\r\n head = false;\r\n continue;\r\n }\r\n throw illegal(token);\r\n }\r\n }\r\n\r\n return {\r\n 'package' : pkg,\r\n 'imports' : imports,\r\n 'weakImports' : weakImports,\r\n 'syntax' : syntax,\r\n 'root' : root\r\n };\r\n}\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(29),\r\n ieee754 = require(1);\r\nvar LongBits = util.LongBits,\r\n utf8 = util.utf8;\r\nvar ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\r\n\r\nfunction indexOutOfRange(reader, writeLength) {\r\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\r\n}\r\n\r\n/**\r\n * Constructs a new reader instance using the specified buffer.\r\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\r\n * @constructor\r\n * @param {Uint8Array} buffer Buffer to read from\r\n */\r\nfunction Reader(buffer) {\r\n \r\n /**\r\n * Read buffer.\r\n * @type {Uint8Array}\r\n */\r\n this.buf = buffer;\r\n\r\n /**\r\n * Read buffer position.\r\n * @type {number}\r\n */\r\n this.pos = 0;\r\n\r\n /**\r\n * Read buffer length.\r\n * @type {number}\r\n */\r\n this.len = buffer.length;\r\n}\r\n\r\n/**\r\n * Creates a new reader using the specified buffer.\r\n * @param {Uint8Array} buffer Buffer to read from\r\n * @returns {BufferReader|Reader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\r\n */\r\nReader.create = function create(buffer) {\r\n return new (util.Buffer && util.Buffer.isBuffer(buffer) && BufferReader || Reader)(buffer);\r\n};\r\n\r\n/** @alias Reader.prototype */\r\nvar ReaderPrototype = Reader.prototype;\r\n\r\nReaderPrototype._slice = ArrayImpl.prototype.subarray || ArrayImpl.prototype.slice;\r\n\r\n/**\r\n * Tag read.\r\n * @constructor\r\n * @param {number} id Field id\r\n * @param {number} wireType Wire type\r\n * @ignore\r\n */\r\nfunction Tag(id, wireType) {\r\n this.id = id;\r\n this.wireType = wireType;\r\n}\r\n\r\n/**\r\n * Reads a tag.\r\n * @returns {{id: number, wireType: number}} Field id and wire type\r\n */\r\nReaderPrototype.tag = function read_tag() {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n return new Tag(this.buf[this.pos] >>> 3, this.buf[this.pos++] & 7);\r\n};\r\n\r\n/**\r\n * Reads a varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.int32 = function read_int32() {\r\n // 1 byte\r\n var octet = this.buf[this.pos++],\r\n value = octet & 127;\r\n if (octet > 127) { // false if octet is undefined (pos >= len)\r\n // 2 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 7;\r\n if (octet > 127) {\r\n // 3 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 14;\r\n if (octet > 127) {\r\n // 4 bytes\r\n octet = this.buf[this.pos++];\r\n value |= (octet & 127) << 21;\r\n if (octet > 127) {\r\n // 5 bytes\r\n octet = this.buf[this.pos++];\r\n value |= octet << 28;\r\n if (octet > 127) {\r\n // 6..10 bytes (sign extended)\r\n this.pos += 5;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (this.pos > this.len) {\r\n this.pos = this.len;\r\n throw indexOutOfRange(this);\r\n }\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a varint as an unsigned 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.uint32 = function read_uint32() {\r\n return this.int32() >>> 0;\r\n};\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 32 bit value.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sint32 = function read_sint32() {\r\n var value = this.int32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongVarint() {\r\n var lo = 0, hi = 0,\r\n i = 0, b = 0;\r\n if (this.len - this.pos > 9) { // fast route\r\n for (i = 0; i < 4; ++i) {\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n } else {\r\n for (i = 0; i < 4; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << i * 7;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n lo |= (b & 127) << 28;\r\n hi |= (b & 127) >> 4;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n for (i = 0; i < 5; ++i) {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n b = this.buf[this.pos++];\r\n hi |= (b & 127) << i * 7 + 3;\r\n if (b < 128)\r\n return new LongBits(lo >>> 0, hi >>> 0);\r\n }\r\n }\r\n throw Error(\"invalid varint encoding\");\r\n}\r\n\r\nfunction read_int64_long() {\r\n return readLongVarint.call(this).toLong();\r\n}\r\n\r\nfunction read_int64_number() {\r\n return readLongVarint.call(this).toNumber();\r\n}\r\n\r\nfunction read_uint64_long() {\r\n return readLongVarint.call(this).toLong(true);\r\n}\r\n\r\nfunction read_uint64_number() {\r\n return readLongVarint.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sint64_long() {\r\n return readLongVarint.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sint64_number() {\r\n return readLongVarint.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads a varint as a signed 64 bit value.\r\n * @name Reader#int64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as an unsigned 64 bit value.\r\n * @name Reader#uint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a zig-zag encoded varint as a signed 64 bit value.\r\n * @name Reader#sint64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads a varint as a boolean.\r\n * @returns {boolean} Value read\r\n */\r\nReaderPrototype.bool = function read_bool() {\r\n return this.int32() !== 0;\r\n};\r\n\r\n/**\r\n * Reads fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.fixed32 = function read_fixed32() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n this.pos += 4;\r\n return this.buf[this.pos - 4]\r\n | this.buf[this.pos - 3] << 8\r\n | this.buf[this.pos - 2] << 16\r\n | this.buf[this.pos - 1] << 24;\r\n};\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 32 bits as a number.\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.sfixed32 = function read_sfixed32() {\r\n var value = this.fixed32();\r\n return value >>> 1 ^ -(value & 1);\r\n};\r\n\r\n/* eslint-disable no-invalid-this */\r\n\r\nfunction readLongFixed() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n return new LongBits(\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n ,\r\n ( this.buf[this.pos++]\r\n | this.buf[this.pos++] << 8\r\n | this.buf[this.pos++] << 16\r\n | this.buf[this.pos++] << 24 ) >>> 0\r\n );\r\n}\r\n\r\nfunction read_fixed64_long() {\r\n return readLongFixed.call(this).toLong(true);\r\n}\r\n\r\nfunction read_fixed64_number() {\r\n return readLongFixed.call(this).toNumber(true);\r\n}\r\n\r\nfunction read_sfixed64_long() {\r\n return readLongFixed.call(this).zzDecode().toLong();\r\n}\r\n\r\nfunction read_sfixed64_number() {\r\n return readLongFixed.call(this).zzDecode().toNumber();\r\n}\r\n\r\n/* eslint-enable no-invalid-this */\r\n\r\n/**\r\n * Reads fixed 64 bits.\r\n * @name Reader#fixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\n/**\r\n * Reads zig-zag encoded fixed 64 bits.\r\n * @name Reader#sfixed64\r\n * @function\r\n * @returns {Long|number} Value read\r\n */\r\n\r\nvar readFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function readFloat_f32(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos ];\r\n return f32[0];\r\n }\r\n : function readFloat_f32_le(buf, pos) {\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f32[0];\r\n };\r\n })()\r\n : function readFloat_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Reads a float (32 bit) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.float = function read_float() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readFloat(this.buf, this.pos);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nvar readDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function readDouble_f64(buf, pos) {\r\n f8b[0] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[7] = buf[pos ];\r\n return f64[0];\r\n }\r\n : function readDouble_f64_le(buf, pos) {\r\n f8b[7] = buf[pos++];\r\n f8b[6] = buf[pos++];\r\n f8b[5] = buf[pos++];\r\n f8b[4] = buf[pos++];\r\n f8b[3] = buf[pos++];\r\n f8b[2] = buf[pos++];\r\n f8b[1] = buf[pos++];\r\n f8b[0] = buf[pos ];\r\n return f64[0];\r\n };\r\n })()\r\n : function readDouble_ieee754(buf, pos) {\r\n return ieee754.read(buf, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Reads a double (64 bit float) as a number.\r\n * @function\r\n * @returns {number} Value read\r\n */\r\nReaderPrototype.double = function read_double() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = readDouble(this.buf, this.pos);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\n/**\r\n * Reads a sequence of bytes preceeded by its length as a varint.\r\n * @returns {Uint8Array} Value read\r\n */\r\nReaderPrototype.bytes = function read_bytes() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\r\n ? new this.buf.constructor(0)\r\n : this._slice.call(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * Reads a string preceeded by its byte length as a varint.\r\n * @returns {string} Value read\r\n */\r\nReaderPrototype.string = function read_string() {\r\n var bytes = this.bytes();\r\n return utf8.read(bytes, 0, bytes.length);\r\n};\r\n\r\n/**\r\n * Skips the specified number of bytes if specified, otherwise skips a varint.\r\n * @param {number} [length] Length if known, otherwise a varint is assumed\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skip = function skip(length) {\r\n if (length === undefined) {\r\n do {\r\n if (this.pos >= this.len)\r\n throw indexOutOfRange(this);\r\n } while (this.buf[this.pos++] & 128);\r\n } else {\r\n if (this.pos + length > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Skips the next element of the specified wire type.\r\n * @param {number} wireType Wire type received\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.skipType = function(wireType) {\r\n switch (wireType) {\r\n case 0:\r\n this.skip();\r\n break;\r\n case 1:\r\n this.skip(8);\r\n break;\r\n case 2:\r\n this.skip(this.uint32());\r\n break;\r\n case 3:\r\n do { // eslint-disable-line no-constant-condition\r\n var tag = this.tag();\r\n if (tag.wireType === 4)\r\n break;\r\n this.skipType(tag.wireType);\r\n } while (true);\r\n break;\r\n case 5:\r\n this.skip(4);\r\n break;\r\n default:\r\n throw Error(\"invalid wire type: \" + wireType);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance and frees all resources.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Reader} `this`\r\n */\r\nReaderPrototype.reset = function reset(buffer) {\r\n if (buffer) {\r\n this.buf = buffer;\r\n this.len = buffer.length;\r\n } else {\r\n this.buf = null; // makes it throw\r\n this.len = 0;\r\n }\r\n this.pos = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of read operations, frees all resources and returns the remaining buffer.\r\n * @param {Uint8Array} [buffer] New buffer for a new sequence of read operations\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nReaderPrototype.finish = function finish(buffer) {\r\n var remain = this.pos\r\n ? this._slice.call(this.buf, this.pos)\r\n : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\n// One time function to initialize BufferReader with the now-known buffer implementation's slice method\r\nvar initBufferReader = function() {\r\n if (!util.Buffer)\r\n throw Error(\"Buffer is not supported\");\r\n BufferReaderPrototype._slice = util.Buffer.prototype.slice;\r\n readStringBuffer = util.Buffer.prototype.utf8Slice // around forever, but not present in browser buffer\r\n ? readStringBuffer_utf8Slice\r\n : readStringBuffer_toString;\r\n initBufferReader = false;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer reader instance.\r\n * @classdesc Wire format reader using node buffers.\r\n * @extends Reader\r\n * @constructor\r\n * @param {Buffer} buffer Buffer to read from\r\n */\r\nfunction BufferReader(buffer) {\r\n if (initBufferReader)\r\n initBufferReader();\r\n Reader.call(this, buffer);\r\n}\r\n\r\n/** @alias BufferReader.prototype */\r\nvar BufferReaderPrototype = BufferReader.prototype = Object.create(Reader.prototype);\r\n\r\nBufferReaderPrototype.constructor = BufferReader;\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.float = function read_float_buffer() {\r\n if (this.pos + 4 > this.len)\r\n throw indexOutOfRange(this, 4);\r\n var value = this.buf.readFloatLE(this.pos, true);\r\n this.pos += 4;\r\n return value;\r\n};\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.double = function read_double_buffer() {\r\n if (this.pos + 8 > this.len)\r\n throw indexOutOfRange(this, 8);\r\n var value = this.buf.readDoubleLE(this.pos, true);\r\n this.pos += 8;\r\n return value;\r\n};\r\n\r\nvar readStringBuffer;\r\n\r\nfunction readStringBuffer_utf8Slice(buf, start, end) {\r\n return buf.utf8Slice(start, end); // fastest\r\n}\r\n\r\nfunction readStringBuffer_toString(buf, start, end) {\r\n return buf.toString(\"utf8\", start, end); // 2nd, again assertions\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.string = function read_string_buffer() {\r\n var length = this.int32() >>> 0,\r\n start = this.pos,\r\n end = this.pos + length;\r\n if (end > this.len)\r\n throw indexOutOfRange(this, length);\r\n this.pos += length;\r\n return readStringBuffer(this.buf, start, end);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nBufferReaderPrototype.finish = function finish_buffer(buffer) {\r\n var remain = this.pos ? this.buf.slice(this.pos) : this.buf;\r\n this.reset(buffer);\r\n return remain;\r\n};\r\n\r\nfunction configure() {\r\n if (util.Long) {\r\n ReaderPrototype.int64 = read_int64_long;\r\n ReaderPrototype.uint64 = read_uint64_long;\r\n ReaderPrototype.sint64 = read_sint64_long;\r\n ReaderPrototype.fixed64 = read_fixed64_long;\r\n ReaderPrototype.sfixed64 = read_sfixed64_long;\r\n } else {\r\n ReaderPrototype.int64 = read_int64_number;\r\n ReaderPrototype.uint64 = read_uint64_number;\r\n ReaderPrototype.sint64 = read_sint64_number;\r\n ReaderPrototype.fixed64 = read_fixed64_number;\r\n ReaderPrototype.sfixed64 = read_sfixed64_number;\r\n }\r\n}\r\n\r\nReader._configure = configure;\r\n\r\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(11);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(7),\r\n util = require(23),\r\n common = require(3);\r\n\r\n/**\r\n * Constructs a new root namespace instance.\r\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {Object} [options] Top level options\r\n */\r\nfunction Root(options) {\r\n Namespace.call(this, \"\", options);\r\n\r\n /**\r\n * Deferred extension fields.\r\n * @type {Field[]}\r\n */\r\n this.deferred = [];\r\n\r\n /**\r\n * Resolved file names of loaded files. \r\n * @type {string[]}\r\n */\r\n this.files = [];\r\n}\r\n\r\n/**\r\n * Loads a JSON definition into a root namespace.\r\n * @param {*} json JSON definition\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\r\n * @returns {Root} Root namespace\r\n */\r\nRoot.fromJSON = function fromJSON(json, root) {\r\n if (!root)\r\n root = new Root();\r\n return root.setOptions(json.options).addJSON(json.nested);\r\n};\r\n\r\n/**\r\n * Resolves the path of an imported file, relative to the importing origin.\r\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\r\n * @function\r\n * @param {string} origin The file name of the importing file\r\n * @param {string} target The file name being imported\r\n * @returns {string} Resolved path to `target`\r\n */\r\nRootPrototype.resolvePath = util.resolvePath;\r\n\r\n// A symbol-like function to safely signal synchronous loading\r\nfunction SYNC() {} // eslint-disable-line no-empty-function\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nRootPrototype.load = function load(filename, callback) {\r\n var self = this;\r\n if (!callback)\r\n return util.asPromise(load, self, filename);\r\n\r\n // Finishes loading by calling the callback (exactly once)\r\n function finish(err, root) {\r\n if (!callback)\r\n return;\r\n var cb = callback;\r\n callback = null;\r\n cb(err, root);\r\n }\r\n\r\n var sync = callback === SYNC; // undocumented\r\n\r\n // Processes a single file\r\n function process(filename, source) {\r\n try {\r\n if (util.isString(source) && source.charAt(0) === \"{\")\r\n source = JSON.parse(source);\r\n if (!util.isString(source))\r\n self.setOptions(source.options).addJSON(source.nested);\r\n else {\r\n var parsed = require(14)(source, self);\r\n if (parsed.imports)\r\n parsed.imports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name));\r\n });\r\n if (parsed.weakImports)\r\n parsed.weakImports.forEach(function(name) {\r\n fetch(self.resolvePath(filename, name), true);\r\n });\r\n }\r\n } catch (err) {\r\n finish(err);\r\n return;\r\n }\r\n if (!sync && !queued)\r\n finish(null, self);\r\n }\r\n\r\n // Fetches a single file\r\n function fetch(filename, weak) {\r\n\r\n // Strip path if this file references a bundled definition\r\n var idx = filename.indexOf(\"google/protobuf/\");\r\n if (idx > -1) {\r\n var altname = filename.substring(idx);\r\n if (altname in common)\r\n filename = altname;\r\n }\r\n\r\n // Skip if already loaded\r\n if (self.files.indexOf(filename) > -1)\r\n return;\r\n self.files.push(filename);\r\n\r\n // Shortcut bundled definitions\r\n if (filename in common) {\r\n if (sync)\r\n process(filename, common[filename]);\r\n else {\r\n ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\r\n if (sync) {\r\n var source;\r\n try {\r\n source = util.fs.readFileSync(filename).toString(\"utf8\");\r\n } catch (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n } else {\r\n ++queued;\r\n util.fetch(filename, function(err, source) {\r\n --queued;\r\n if (!callback)\r\n return; // terminated meanwhile\r\n if (err) {\r\n if (!weak)\r\n finish(err);\r\n return;\r\n }\r\n process(filename, source);\r\n });\r\n }\r\n }\r\n var queued = 0;\r\n\r\n // Assembling the root namespace doesn't require working type\r\n // references anymore, so we can load everything in parallel\r\n if (util.isString(filename))\r\n filename = [ filename ];\r\n filename.forEach(function(filename) {\r\n fetch(self.resolvePath(\"\", filename));\r\n });\r\n\r\n if (sync)\r\n return self;\r\n if (!queued)\r\n finish(null, self);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\r\n * @name Root#load\r\n * @function\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Promise} Promise\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace.\r\n * @param {string|string[]} filename Names of one or multiple files to load\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nRootPrototype.loadSync = function loadSync(filename) {\r\n return this.load(filename, SYNC);\r\n};\r\n\r\n/**\r\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\r\n * @param {Field} field Declaring extension field witin the declaring type\r\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\r\n * @inner\r\n * @ignore\r\n */\r\nfunction handleExtension(field) {\r\n var extendedType = field.parent.lookup(field.extend);\r\n if (extendedType) {\r\n var sisterField = new Field(field.getFullName(), field.id, field.type, field.rule, undefined, field.options);\r\n sisterField.declaringField = field;\r\n field.extensionField = sisterField;\r\n extendedType.add(sisterField);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Called when any object is added to this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object added\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleAdd = function handleAdd(object) {\r\n // Try to handle any deferred extensions\r\n var newDeferred = this.deferred.slice();\r\n this.deferred = []; // because the loop calls handleAdd\r\n var i = 0;\r\n while (i < newDeferred.length)\r\n if (handleExtension(newDeferred[i]))\r\n newDeferred.splice(i, 1);\r\n else\r\n ++i;\r\n this.deferred = newDeferred;\r\n // Handle new declaring extension fields without a sister field yet\r\n if (object instanceof Field && object.extend !== undefined && !object.extensionField && !handleExtension(object) && this.deferred.indexOf(object) < 0)\r\n this.deferred.push(object);\r\n else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleAdd(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * Called when any object is removed from this root or its sub-namespaces.\r\n * @param {ReflectionObject} object Object removed\r\n * @returns {undefined}\r\n * @private\r\n */\r\nRootPrototype._handleRemove = function handleRemove(object) {\r\n if (object instanceof Field) {\r\n // If a deferred declaring extension field, cancel the extension\r\n if (object.extend !== undefined && !object.extensionField) {\r\n var index = this.deferred.indexOf(object);\r\n if (index > -1)\r\n this.deferred.splice(index, 1);\r\n }\r\n // If a declaring extension field with a sister field, remove its sister field\r\n if (object.extensionField) {\r\n object.extensionField.parent.remove(object.extensionField);\r\n object.extensionField = null;\r\n }\r\n } else if (object instanceof Namespace) {\r\n var nested = object.getNestedArray();\r\n for (var i = 0; i < nested.length; ++i) // recurse into the namespace\r\n this._handleRemove(nested[i]);\r\n }\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nRootPrototype.toString = function toString() {\r\n return this.constructor.name;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Streaming RPC helpers.\r\n * @namespace\r\n */\r\nvar rpc = exports;\r\n\r\nrpc.Service = require(18);\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar EventEmitter = require(26);\r\n\r\n/**\r\n * Constructs a new RPC service instance.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @extends util.EventEmitter\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n EventEmitter.call(this);\r\n\r\n /**\r\n * RPC implementation. Becomes `null` once the service is ended.\r\n * @type {?RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype = Object.create(EventEmitter.prototype);\r\nServicePrototype.constructor = Service;\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end(endedByRPC) {\r\n if (this.$rpc) {\r\n if (!endedByRPC) // signal end to rpcImpl\r\n this.$rpc(null, null, null);\r\n this.$rpc = null;\r\n this.emit('end').off();\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(11);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Service.prototype */\r\nvar ServicePrototype = Namespace.extend(Service);\r\n\r\nvar Method = require(10),\r\n util = require(23),\r\n rpc = require(17);\r\n\r\n/**\r\n * Constructs a new service instance.\r\n * @classdesc Reflected service.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Service name\r\n * @param {Object.} [options] Service options\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nfunction Service(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Service methods.\r\n * @type {Object.}\r\n */\r\n this.methods = {}; // toJSON, marker\r\n\r\n /**\r\n * Cached methods as an array.\r\n * @type {?Method[]}\r\n * @private\r\n */\r\n this._methodsArray = null;\r\n}\r\n\r\nutil.props(ServicePrototype, {\r\n\r\n /**\r\n * Methods of this service as an array for iteration.\r\n * @name Service#methodsArray\r\n * @type {Method[]}\r\n * @readonly\r\n */\r\n methodsArray: {\r\n get: function getMethodsArray() {\r\n return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\r\n }\r\n }\r\n\r\n});\r\n\r\nfunction clearCache(service) {\r\n service._methodsArray = null;\r\n return service;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a service.\r\n * @param {Object} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a service\r\n */\r\nService.testJSON = function testJSON(json) {\r\n return Boolean(json && json.methods);\r\n};\r\n\r\n/**\r\n * Constructs a service from JSON.\r\n * @param {string} name Service name\r\n * @param {Object} json JSON object\r\n * @returns {Service} Created service\r\n * @throws {TypeError} If arguments are invalid\r\n */\r\nService.fromJSON = function fromJSON(name, json) {\r\n var service = new Service(name, json.options);\r\n if (json.methods)\r\n Object.keys(json.methods).forEach(function(methodName) {\r\n service.add(Method.fromJSON(methodName, json.methods[methodName]));\r\n });\r\n return service;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n methods : Namespace.arrayToJSON(this.getMethodsArray()) || {},\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.methods[name] || null;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.resolveAll = function resolve() {\r\n var methods = this.getMethodsArray();\r\n for (var i = 0; i < methods.length; ++i)\r\n methods[i].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Method) {\r\n this.methods[object.name] = object;\r\n object.parent = this;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nServicePrototype.remove = function remove(object) {\r\n if (object instanceof Method) {\r\n if (this.methods[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.methods[object.name];\r\n object.parent = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\r\n * @typedef RPCImpl\r\n * @type {function}\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {RPCCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Node-style callback as used by {@link RPCImpl}.\r\n * @typedef RPCCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Uint8Array} [responseData] Response data or `null` to signal end of stream, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Creates a runtime service using the specified rpc implementation.\r\n * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see})\r\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\r\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\r\n * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed.\r\n */\r\nServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\r\n var rpcService = new rpc.Service(rpcImpl);\r\n this.getMethodsArray().forEach(function(method) {\r\n rpcService[method.name.substring(0, 1).toLowerCase() + method.name.substring(1)] = function callVirtual(request, /* optional */ callback) {\r\n if (!rpcService.$rpc) // already ended?\r\n return;\r\n if (!request)\r\n throw util._TypeError(\"request\", \"not null\");\r\n method.resolve();\r\n var requestData;\r\n try {\r\n requestData = (requestDelimited && method.resolvedRequestType.encodeDelimited(request) || method.resolvedRequestType.encode(request)).finish();\r\n } catch (err) {\r\n (typeof setImmediate === 'function' && setImmediate || setTimeout)(function() { callback(err); });\r\n return;\r\n }\r\n // Calls the custom RPC implementation with the reflected method and binary request data\r\n // and expects the rpc implementation to call its callback with the binary response data.\r\n rpcImpl(method, requestData, function(err, responseData) {\r\n if (err) {\r\n rpcService.emit('error', err, method);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.end(/* endedByRPC */ true);\r\n return undefined;\r\n }\r\n var response;\r\n try {\r\n response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData);\r\n } catch (err2) {\r\n rpcService.emit('error', err2, method);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response, method);\r\n return callback ? callback(null, response) : undefined;\r\n });\r\n };\r\n });\r\n return rpcService;\r\n};\r\n","\"use strict\";\r\nmodule.exports = tokenize;\r\n\r\nvar delimRe = /[\\s{}=;:[\\],'\"()<>]/g,\r\n stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\r\n\r\n/**\r\n * Handle object returned from {@link tokenize}.\r\n * @typedef {Object} TokenizerHandle\r\n * @property {function():number} line Gets the current line number\r\n * @property {function():?string} next Gets the next token and advances (`null` on eof)\r\n * @property {function():?string} peek Peeks for the next token (`null` on eof)\r\n * @property {function(string)} push Pushes a token back to the stack\r\n * @property {function(string, boolean=):boolean} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\r\n */\r\n\r\nvar s_nl = \"\\n\",\r\n s_sl = '/',\r\n s_as = '*';\r\n\r\nfunction unescape(str) {\r\n return str.replace(/\\\\(.?)/g, function($0, $1) {\r\n switch ($1) {\r\n case \"\\\\\":\r\n case \"\":\r\n return $1;\r\n case \"0\":\r\n return \"\\u0000\";\r\n default:\r\n return $1;\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Tokenizes the given .proto source and returns an object with useful utility functions.\r\n * @param {string} source Source contents\r\n * @returns {TokenizerHandle} Tokenizer handle\r\n */\r\nfunction tokenize(source) {\r\n /* eslint-disable callback-return */\r\n source = source.toString();\r\n \r\n var offset = 0,\r\n length = source.length,\r\n line = 1;\r\n \r\n var stack = [];\r\n\r\n var stringDelim = null;\r\n\r\n /**\r\n * Creates an error for illegal syntax.\r\n * @param {string} subject Subject\r\n * @returns {Error} Error created\r\n * @inner\r\n */\r\n function illegal(subject) {\r\n return Error(\"illegal \" + subject + \" (line \" + line + \")\");\r\n }\r\n\r\n /**\r\n * Reads a string till its end.\r\n * @returns {string} String read\r\n * @inner\r\n */\r\n function readString() {\r\n var re = stringDelim === '\"' ? stringDoubleRe : stringSingleRe;\r\n re.lastIndex = offset - 1;\r\n var match = re.exec(source);\r\n if (!match)\r\n throw illegal(\"string\");\r\n offset = re.lastIndex;\r\n push(stringDelim);\r\n stringDelim = null;\r\n return unescape(match[1]);\r\n }\r\n\r\n /**\r\n * Gets the character at `pos` within the source.\r\n * @param {number} pos Position\r\n * @returns {string} Character\r\n * @inner\r\n */\r\n function charAt(pos) {\r\n return source.charAt(pos);\r\n }\r\n\r\n /**\r\n * Obtains the next token.\r\n * @returns {?string} Next token or `null` on eof\r\n * @inner\r\n */\r\n function next() {\r\n if (stack.length > 0)\r\n return stack.shift();\r\n if (stringDelim)\r\n return readString();\r\n var repeat,\r\n prev,\r\n curr;\r\n do {\r\n if (offset === length)\r\n return null;\r\n repeat = false;\r\n while (/\\s/.test(curr = charAt(offset))) {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n }\r\n if (charAt(offset) === s_sl) {\r\n if (++offset === length)\r\n throw illegal(\"comment\");\r\n if (charAt(offset) === s_sl) { // Line\r\n while (charAt(++offset) !== s_nl)\r\n if (offset === length)\r\n return null;\r\n ++offset;\r\n ++line;\r\n repeat = true;\r\n } else if ((curr = charAt(offset)) === s_as) { /* Block */\r\n do {\r\n if (curr === s_nl)\r\n ++line;\r\n if (++offset === length)\r\n return null;\r\n prev = curr;\r\n curr = charAt(offset);\r\n } while (prev !== s_as || curr !== s_sl);\r\n ++offset;\r\n repeat = true;\r\n } else\r\n return s_sl;\r\n }\r\n } while (repeat);\r\n\r\n if (offset === length)\r\n return null;\r\n var end = offset;\r\n delimRe.lastIndex = 0;\r\n var delim = delimRe.test(charAt(end++));\r\n if (!delim)\r\n while (end < length && !delimRe.test(charAt(end)))\r\n ++end;\r\n var token = source.substring(offset, offset = end);\r\n if (token === '\"' || token === \"'\")\r\n stringDelim = token;\r\n return token;\r\n }\r\n\r\n /**\r\n * Pushes a token back to the stack.\r\n * @param {string} token Token\r\n * @returns {undefined}\r\n * @inner\r\n */\r\n function push(token) {\r\n stack.push(token);\r\n }\r\n\r\n /**\r\n * Peeks for the next token.\r\n * @returns {?string} Token or `null` on eof\r\n * @inner\r\n */\r\n function peek() {\r\n if (!stack.length) {\r\n var token = next();\r\n if (token === null)\r\n return null;\r\n push(token);\r\n }\r\n return stack[0];\r\n }\r\n\r\n /**\r\n * Skips a token.\r\n * @param {string} expected Expected token\r\n * @param {boolean} [optional=false] Whether the token is optional\r\n * @returns {boolean} `true` when skipped, `false` if not\r\n * @throws {Error} When a required token is not present\r\n * @inner\r\n */\r\n function skip(expected, optional) {\r\n var actual = peek(),\r\n equals = actual === expected;\r\n if (equals) {\r\n next();\r\n return true;\r\n }\r\n if (!optional)\r\n throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\r\n return false;\r\n }\r\n\r\n return {\r\n line: function() { return line; },\r\n next: next,\r\n peek: peek,\r\n push: push,\r\n skip: skip\r\n };\r\n /* eslint-enable callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(11);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = Namespace.prototype;\r\n/** @alias Type.prototype */\r\nvar TypePrototype = Namespace.extend(Type);\r\n\r\nvar Enum = require(6),\r\n OneOf = require(13),\r\n Field = require(7),\r\n Service = require(19),\r\n Class = require(2),\r\n Message = require(9),\r\n Reader = require(15),\r\n Writer = require(32),\r\n util = require(23);\r\nvar encode = require(5),\r\n decode = require(4),\r\n verify = require(31);\r\n\r\n/**\r\n * Constructs a new reflected message type instance.\r\n * @classdesc Reflected message type.\r\n * @extends Namespace\r\n * @constructor\r\n * @param {string} name Message name\r\n * @param {Object} [options] Declared options\r\n */\r\nfunction Type(name, options) {\r\n Namespace.call(this, name, options);\r\n\r\n /**\r\n * Message fields.\r\n * @type {Object.}\r\n */\r\n this.fields = {}; // toJSON, marker\r\n\r\n /**\r\n * Oneofs declared within this namespace, if any.\r\n * @type {Object.}\r\n */\r\n this.oneofs = undefined; // toJSON\r\n\r\n /**\r\n * Extension ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.extensions = undefined; // toJSON\r\n\r\n /**\r\n * Reserved ranges, if any.\r\n * @type {number[][]}\r\n */\r\n this.reserved = undefined; // toJSON\r\n\r\n /**\r\n * Cached fields by id.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsById = null;\r\n\r\n /**\r\n * Cached fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._fieldsArray = null;\r\n\r\n /**\r\n * Cached repeated fields as an array.\r\n * @type {?Field[]}\r\n * @private\r\n */\r\n this._repeatedFieldsArray = null;\r\n\r\n /**\r\n * Cached oneofs as an array.\r\n * @type {?OneOf[]}\r\n * @private\r\n */\r\n this._oneofsArray = null;\r\n\r\n /**\r\n * Cached constructor.\r\n * @type {*}\r\n * @private\r\n */\r\n this._ctor = null;\r\n}\r\n\r\nutil.props(TypePrototype, {\r\n\r\n /**\r\n * Message fields by id.\r\n * @name Type#fieldsById\r\n * @type {Object.}\r\n * @readonly\r\n */\r\n fieldsById: {\r\n get: function getFieldsById() {\r\n if (this._fieldsById)\r\n return this._fieldsById;\r\n this._fieldsById = {};\r\n var names = Object.keys(this.fields);\r\n for (var i = 0; i < names.length; ++i) {\r\n var field = this.fields[names[i]],\r\n id = field.id;\r\n if (this._fieldsById[id])\r\n throw Error(\"duplicate id \" + id + \" in \" + this);\r\n this._fieldsById[id] = field;\r\n }\r\n return this._fieldsById;\r\n }\r\n },\r\n\r\n /**\r\n * Fields of this message as an array for iteration.\r\n * @name Type#fieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n fieldsArray: {\r\n get: function getFieldsArray() {\r\n return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\r\n }\r\n },\r\n\r\n /**\r\n * Repeated fields of this message as an array for iteration.\r\n * @name Type#repeatedFieldsArray\r\n * @type {Field[]}\r\n * @readonly\r\n */\r\n repeatedFieldsArray: {\r\n get: function getRepeatedFieldsArray() {\r\n return this._repeatedFieldsArray || (this._repeatedFieldsArray = this.getFieldsArray().filter(function(field) { return field.repeated; }));\r\n }\r\n },\r\n\r\n /**\r\n * Oneofs of this message as an array for iteration.\r\n * @name Type#oneofsArray\r\n * @type {OneOf[]}\r\n * @readonly\r\n */\r\n oneofsArray: {\r\n get: function getOneofsArray() {\r\n return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\r\n }\r\n },\r\n\r\n /**\r\n * The registered constructor, if any registered, otherwise a generic constructor.\r\n * @name Type#ctor\r\n * @type {Class}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n return this._ctor || (this._ctor = Class.create(this).constructor);\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Message))\r\n throw util._TypeError(\"ctor\", \"a Message constructor\");\r\n this._ctor = ctor;\r\n }\r\n }\r\n});\r\n\r\nfunction clearCache(type) {\r\n type._fieldsById = type._fieldsArray = type._oneofsArray = type._ctor = null;\r\n delete type.encode;\r\n delete type.decode;\r\n return type;\r\n}\r\n\r\n/**\r\n * Tests if the specified JSON object describes a message type.\r\n * @param {*} json JSON object to test\r\n * @returns {boolean} `true` if the object describes a message type\r\n */\r\nType.testJSON = function testJSON(json) {\r\n return Boolean(json && json.fields);\r\n};\r\n\r\nvar nestedTypes = [ Enum, Type, Field, Service ];\r\n\r\n/**\r\n * Creates a type from JSON.\r\n * @param {string} name Message name\r\n * @param {Object} json JSON object\r\n * @returns {Type} Created message type\r\n */\r\nType.fromJSON = function fromJSON(name, json) {\r\n var type = new Type(name, json.options);\r\n type.extensions = json.extensions;\r\n type.reserved = json.reserved;\r\n if (json.fields)\r\n Object.keys(json.fields).forEach(function(fieldName) {\r\n type.add(Field.fromJSON(fieldName, json.fields[fieldName]));\r\n });\r\n if (json.oneofs)\r\n Object.keys(json.oneofs).forEach(function(oneOfName) {\r\n type.add(OneOf.fromJSON(oneOfName, json.oneofs[oneOfName]));\r\n });\r\n if (json.nested)\r\n Object.keys(json.nested).forEach(function(nestedName) {\r\n var nested = json.nested[nestedName];\r\n for (var i = 0; i < nestedTypes.length; ++i) {\r\n if (nestedTypes[i].testJSON(nested)) {\r\n type.add(nestedTypes[i].fromJSON(nestedName, nested));\r\n return;\r\n }\r\n }\r\n throw Error(\"invalid nested object in \" + type + \": \" + nestedName);\r\n });\r\n if (json.extensions && json.extensions.length)\r\n type.extensions = json.extensions;\r\n if (json.reserved && json.reserved.length)\r\n type.reserved = json.reserved;\r\n return type;\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.toJSON = function toJSON() {\r\n var inherited = NamespacePrototype.toJSON.call(this);\r\n return {\r\n options : inherited && inherited.options || undefined,\r\n oneofs : Namespace.arrayToJSON(this.getOneofsArray()),\r\n fields : Namespace.arrayToJSON(this.getFieldsArray().filter(function(obj) { return !obj.declaringField; })) || {},\r\n extensions : this.extensions && this.extensions.length ? this.extensions : undefined,\r\n reserved : this.reserved && this.reserved.length ? this.reserved : undefined,\r\n nested : inherited && inherited.nested || undefined\r\n };\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.resolveAll = function resolve() {\r\n var fields = this.getFieldsArray(), i = 0;\r\n while (i < fields.length)\r\n fields[i++].resolve();\r\n var oneofs = this.getOneofsArray(); i = 0;\r\n while (i < oneofs.length)\r\n oneofs[i++].resolve();\r\n return NamespacePrototype.resolve.call(this);\r\n};\r\n\r\n/**\r\n * @override\r\n */\r\nTypePrototype.get = function get(name) {\r\n return NamespacePrototype.get.call(this, name) || this.fields && this.fields[name] || this.oneofs && this.oneofs[name] || null;\r\n};\r\n\r\n/**\r\n * Adds a nested object to this type.\r\n * @param {ReflectionObject} object Nested object to add\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\r\n */\r\nTypePrototype.add = function add(object) {\r\n if (this.get(object.name))\r\n throw Error(\"duplicate name '\" + object.name + '\" in ' + this);\r\n if (object instanceof Field && object.extend === undefined) {\r\n // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\r\n // The root object takes care of adding distinct sister-fields to the respective extended\r\n // type instead.\r\n if (this.getFieldsById()[object.id])\r\n throw Error(\"duplicate id \" + object.id + \" in \" + this);\r\n if (object.parent)\r\n object.parent.remove(object);\r\n this.fields[object.name] = object;\r\n object.message = this;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n if (object instanceof OneOf) {\r\n if (!this.oneofs)\r\n this.oneofs = {};\r\n this.oneofs[object.name] = object;\r\n object.onAdd(this);\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.add.call(this, object);\r\n};\r\n\r\n/**\r\n * Removes a nested object from this type.\r\n * @param {ReflectionObject} object Nested object to remove\r\n * @returns {Type} `this`\r\n * @throws {TypeError} If arguments are invalid\r\n * @throws {Error} If `object` is not a member of this type\r\n */\r\nTypePrototype.remove = function remove(object) {\r\n if (object instanceof Field && object.extend === undefined) {\r\n // See Type#add for the reason why extension fields are excluded here.\r\n if (this.fields[object.name] !== object)\r\n throw Error(object + \" is not a member of \" + this);\r\n delete this.fields[object.name];\r\n object.message = null;\r\n return clearCache(this);\r\n }\r\n return NamespacePrototype.remove.call(this, object);\r\n};\r\n\r\n/**\r\n * Creates a new message of this type using the specified properties.\r\n * @param {Object|*} [properties] Properties to set\r\n * @returns {Message} Runtime message\r\n */\r\nTypePrototype.create = function create(properties) {\r\n return new (this.getCtor())(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encode = function encode_setup(message, writer) {\r\n return (this.encode = util.codegen.supported\r\n ? encode.generate(this).eof(this.getFullName() + \"$encode\", {\r\n Writer : Writer,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : encode\r\n ).call(this, message, writer);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Message|Object} message Message instance or plain object\r\n * @param {Writer} [writer] Writer to encode to\r\n * @returns {Writer} writer\r\n */\r\nTypePrototype.encodeDelimited = function encodeDelimited(message, writer) {\r\n return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\r\n};\r\n\r\n/**\r\n * Decodes a message of this type.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @param {number} [length] Length of the message, if known beforehand\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decode = function decode_setup(readerOrBuffer, length) {\r\n return (this.decode = util.codegen.supported\r\n ? decode.generate(this).eof(this.getFullName() + \"$decode\", {\r\n Reader : Reader,\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : decode\r\n ).call(this, readerOrBuffer, length);\r\n};\r\n\r\n/**\r\n * Decodes a message of this type preceeded by its byte length as a varint.\r\n * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from\r\n * @returns {Message} Decoded message\r\n */\r\nTypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) {\r\n readerOrBuffer = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer);\r\n return this.decode(readerOrBuffer, readerOrBuffer.uint32());\r\n};\r\n\r\n/**\r\n * Verifies that field values are valid and that required fields are present.\r\n * @param {Message|Object} message Message to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n */\r\nTypePrototype.verify = function verify_setup(message) {\r\n return (this.verify = util.codegen.supported\r\n ? verify.generate(this).eof(this.getFullName() + \"$verify\", {\r\n types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }),\r\n util : util\r\n })\r\n : verify\r\n ).call(this, message);\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * Common type constants.\r\n * @namespace\r\n */\r\nvar types = exports;\r\n\r\nvar util = require(23);\r\n\r\nvar s = [\r\n \"double\", // 0\r\n \"float\", // 1\r\n \"int32\", // 2\r\n \"uint32\", // 3\r\n \"sint32\", // 4\r\n \"fixed32\", // 5\r\n \"sfixed32\", // 6\r\n \"int64\", // 7\r\n \"uint64\", // 8\r\n \"sint64\", // 9\r\n \"fixed64\", // 10\r\n \"sfixed64\", // 11\r\n \"bool\", // 12\r\n \"string\", // 13\r\n \"bytes\" // 14\r\n];\r\n\r\nfunction bake(values, offset) {\r\n var i = 0, o = {};\r\n offset |= 0;\r\n while (i < values.length) o[s[i + offset]] = values[i++];\r\n return o;\r\n}\r\n\r\n/**\r\n * Basic type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.basic = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2,\r\n /* bytes */ 2\r\n]);\r\n\r\n/**\r\n * Basic type defaults.\r\n * @type {Object.}\r\n */\r\ntypes.defaults = bake([\r\n /* double */ 0,\r\n /* float */ 0,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 0,\r\n /* sfixed32 */ 0,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 0,\r\n /* sfixed64 */ 0,\r\n /* bool */ false,\r\n /* string */ \"\",\r\n /* bytes */ util.emptyArray\r\n]);\r\n\r\n/**\r\n * Basic long type wire types.\r\n * @type {Object.}\r\n */\r\ntypes.long = bake([\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1\r\n], 7);\r\n\r\n/**\r\n * Allowed types for map keys with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.mapKey = bake([\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0,\r\n /* string */ 2\r\n], 2);\r\n\r\n/**\r\n * Allowed types for packed repeated fields with their associated wire type.\r\n * @type {Object.}\r\n */\r\ntypes.packed = bake([\r\n /* double */ 1,\r\n /* float */ 5,\r\n /* int32 */ 0,\r\n /* uint32 */ 0,\r\n /* sint32 */ 0,\r\n /* fixed32 */ 5,\r\n /* sfixed32 */ 5,\r\n /* int64 */ 0,\r\n /* uint64 */ 0,\r\n /* sint64 */ 0,\r\n /* fixed64 */ 1,\r\n /* sfixed64 */ 1,\r\n /* bool */ 0\r\n]);\r\n","\"use strict\";\r\n\r\n/**\r\n * Various utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\nutil.codegen = require(25);\r\n\r\n/**\r\n * Converts an object's values to an array.\r\n * @param {Object.} object Object to convert\r\n * @returns {Array.<*>} Converted array\r\n */\r\nutil.toArray = function toArray(object) {\r\n if (!object)\r\n return [];\r\n var names = Object.keys(object),\r\n length = names.length;\r\n var array = new Array(length);\r\n for (var i = 0; i < length; ++i)\r\n array[i] = object[names[i]];\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a type error.\r\n * @param {string} name Argument name\r\n * @param {string} [description=\"a string\"] Expected argument descripotion\r\n * @returns {TypeError} Created type error\r\n * @private\r\n */\r\nutil._TypeError = function(name, description) {\r\n return TypeError(name + \" must be \" + (description || \"a string\"));\r\n};\r\n\r\n/**\r\n * Returns a promise from a node-style function.\r\n * @memberof util\r\n * @param {function(Error, ...*)} fn Function to call\r\n * @param {Object} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var args = [];\r\n for (var i = 2; i < arguments.length; ++i)\r\n args.push(arguments[i]);\r\n return new Promise(function(resolve, reject) {\r\n fn.apply(ctx, args.concat(\r\n function(err/*, varargs */) {\r\n if (err) reject(err);\r\n else resolve.apply(null, Array.prototype.slice.call(arguments, 1));\r\n }\r\n ));\r\n });\r\n}\r\n\r\nutil.asPromise = asPromise;\r\n\r\n/**\r\n * Filesystem, if available.\r\n * @memberof util\r\n * @type {?Object}\r\n */\r\nvar fs = null; // Hide this from webpack. There is probably another, better way.\r\ntry { fs = eval(['req','uire'].join(''))(\"fs\"); } catch (e) {} // eslint-disable-line no-eval, no-empty\r\n\r\nutil.fs = fs;\r\n\r\n/**\r\n * Node-style callback as used by {@link util.fetch}.\r\n * @typedef FetchCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {string} [contents] File contents, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {FetchCallback} [callback] Callback function\r\n * @returns {Promise|undefined} A Promise if `callback` has been omitted \r\n */\r\nfunction fetch(path, callback) {\r\n if (!callback)\r\n return asPromise(fetch, util, path);\r\n if (fs && fs.readFile)\r\n return fs.readFile(path, \"utf8\", callback);\r\n var xhr = new XMLHttpRequest();\r\n function onload() {\r\n if (xhr.status !== 0 && xhr.status !== 200)\r\n return callback(Error(\"status \" + xhr.status));\r\n if (util.isString(xhr.responseText))\r\n return callback(null, xhr.responseText);\r\n return callback(Error(\"request failed\"));\r\n }\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState === 4)\r\n onload();\r\n };\r\n xhr.open(\"GET\", path, true);\r\n xhr.send();\r\n return undefined;\r\n}\r\n\r\nutil.fetch = fetch;\r\n\r\n/**\r\n * Tests if the specified path is absolute.\r\n * @memberof util\r\n * @param {string} path Path to test\r\n * @returns {boolean} `true` if path is absolute\r\n */\r\nfunction isAbsolutePath(path) {\r\n return /^(?:\\/|[a-zA-Z0-9]+:)/.test(path);\r\n}\r\n\r\nutil.isAbsolutePath = isAbsolutePath;\r\n\r\n/**\r\n * Normalizes the specified path.\r\n * @memberof util\r\n * @param {string} path Path to normalize\r\n * @returns {string} Normalized path\r\n */\r\nfunction normalizePath(path) {\r\n path = path.replace(/\\\\/g, '/')\r\n .replace(/\\/{2,}/g, '/');\r\n var parts = path.split('/');\r\n var abs = isAbsolutePath(path);\r\n var prefix = \"\";\r\n if (abs)\r\n prefix = parts.shift() + '/';\r\n for (var i = 0; i < parts.length;) {\r\n if (parts[i] === '..') {\r\n if (i > 0)\r\n parts.splice(--i, 2);\r\n else if (abs)\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n } else if (parts[i] === '.')\r\n parts.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n return prefix + parts.join('/');\r\n}\r\n\r\nutil.normalizePath = normalizePath;\r\n\r\n/**\r\n * Resolves the specified include path against the specified origin path.\r\n * @param {string} originPath Path that was used to fetch the origin file\r\n * @param {string} importPath Import path specified in the origin file\r\n * @param {boolean} [alreadyNormalized] `true` if both paths are already known to be normalized\r\n * @returns {string} Path to the imported file\r\n */\r\nutil.resolvePath = function resolvePath(originPath, importPath, alreadyNormalized) {\r\n if (!alreadyNormalized)\r\n importPath = normalizePath(importPath);\r\n if (isAbsolutePath(importPath))\r\n return importPath;\r\n if (!alreadyNormalized)\r\n originPath = normalizePath(originPath);\r\n originPath = originPath.replace(/(?:\\/|^)[^/]+$/, '');\r\n return originPath.length ? normalizePath(originPath + '/' + importPath) : importPath;\r\n};\r\n\r\n/**\r\n * Merges the properties of the source object into the destination object.\r\n * @param {Object} dst Destination object\r\n * @param {Object} src Source object\r\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\r\n * @returns {Object} Destination object\r\n */\r\nutil.merge = function merge(dst, src, ifNotSet) {\r\n if (src) {\r\n var keys = Object.keys(src);\r\n for (var i = 0; i < keys.length; ++i)\r\n if (dst[keys[i]] === undefined || !ifNotSet)\r\n dst[keys[i]] = src[keys[i]];\r\n }\r\n return dst;\r\n};\r\n\r\n/**\r\n * Returns a safe property accessor for the specified properly name.\r\n * @param {string} prop Property name\r\n * @returns {string} Safe accessor\r\n */\r\nutil.safeProp = function safeProp(prop) {\r\n return \"['\" + prop.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\") + \"']\";\r\n};\r\n\r\n/**\r\n * Converts a string to camel case notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.camelCase = function camelCase(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\r\n};\r\n\r\n/**\r\n * Converts a string to underscore notation.\r\n * @param {string} str String to convert\r\n * @returns {string} Converted string\r\n */\r\nutil.underScore = function underScore(str) {\r\n return str.substring(0,1)\r\n + str.substring(1)\r\n .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\r\n};\r\n\r\n/**\r\n * Creates a new buffer of whatever type supported by the environment.\r\n * @param {number} [size=0] Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nutil.newBuffer = function newBuffer(size) {\r\n size = size || 0;\r\n return util.Buffer\r\n ? util.Buffer.allocUnsafe && util.Buffer.allocUnsafe(size) || new util.Buffer(size)\r\n : new (typeof Uint8Array !== 'undefined' && Uint8Array || Array)(size);\r\n};\r\n\r\nvar runtime = require(29);\r\n\r\nutil.EventEmitter = require(26);\r\n\r\n// Merge in runtime utility\r\nutil.merge(util, runtime);\r\n\r\nutil._configure = function configure() {\r\n runtime.Long = util.Long;\r\n};\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the base64 byte length of a string.\r\n * @param {string} str Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(str) {\r\n var p = str.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && str.charAt(p) === '=')\r\n ++n;\r\n return Math.ceil(str.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = [\r\n 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\r\n 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,\r\n 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\r\n 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\r\n];\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var str = new Array(Math.ceil((end - start) / 3) * 4);\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n str[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n str[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n str[i++] = b64[t | b >> 6];\r\n str[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j) {\r\n str[i++] = b64[t];\r\n str[i ] = 61;\r\n if (j === 1)\r\n str[i + 1] = 61;\r\n }\r\n return String.fromCharCode.apply(String, str);\r\n};\r\n\r\n// Base64 decoding table\r\nvar s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i;\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} src Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(src, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < src.length;) {\r\n var c = src.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = codegen;\r\n\r\nvar blockOpenRe = /[{[]$/,\r\n blockCloseRe = /^[}\\]]/,\r\n casingRe = /:$/,\r\n branchRe = /^\\s*(?:if|else if|while|for)\\b|\\b(?:else)\\s*$/,\r\n breakRe = /\\b(?:break|continue);?$|^\\s*return\\b/;\r\n\r\n/**\r\n * A closure for generating functions programmatically.\r\n * @memberof util\r\n * @namespace\r\n * @function\r\n * @param {...string} params Function parameter names\r\n * @returns {Codegen} Codegen instance\r\n * @property {boolean} supported Whether code generation is supported by the environment.\r\n * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging.\r\n */\r\nfunction codegen() {\r\n var args = Array.prototype.slice.call(arguments),\r\n src = ['\\t\"use strict\"'],\r\n indent = 1,\r\n inCase = false;\r\n\r\n /**\r\n * A codegen instance as returned by {@link codegen}, that also is a sprintf-like appender function.\r\n * @typedef Codegen\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {Codegen} Itself\r\n * @property {function(string=):string} str Stringifies the so far generated function source.\r\n * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope.\r\n */\r\n /**/\r\n function gen() {\r\n var line = sprintf.apply(null, arguments);\r\n var level = indent;\r\n if (src.length) {\r\n var prev = src[src.length - 1];\r\n\r\n // block open or one time branch\r\n if (blockOpenRe.test(prev))\r\n level = ++indent; // keep\r\n else if (branchRe.test(prev))\r\n ++level; // once\r\n \r\n // casing\r\n if (casingRe.test(prev) && !casingRe.test(line)) {\r\n level = ++indent;\r\n inCase = true;\r\n } else if (inCase && breakRe.test(prev)) {\r\n level = --indent;\r\n inCase = false;\r\n }\r\n\r\n // block close\r\n if (blockCloseRe.test(line))\r\n level = --indent;\r\n }\r\n for (var index = 0; index < level; ++index)\r\n line = \"\\t\" + line;\r\n src.push(line);\r\n return gen;\r\n }\r\n\r\n /**\r\n * Stringifies the so far generated function source.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @returns {string} Function source using tabs for indentation\r\n * @inner\r\n */\r\n function str(name) {\r\n return \"function \" + (name ? name.replace(/[^\\w_$]/g, \"_\") : \"\") + \"(\" + args.join(\", \") + \") {\\n\" + src.join(\"\\n\") + \"\\n}\";\r\n }\r\n\r\n gen.str = str;\r\n\r\n /**\r\n * Ends generation and builds the function whilst applying a scope.\r\n * @param {string} [name] Function name, defaults to generate an anonymous function\r\n * @param {Object} [scope] Function scope\r\n * @returns {function} The generated function, with scope applied if specified\r\n * @inner\r\n */\r\n function eof(name, scope) {\r\n if (typeof name === 'object') {\r\n scope = name;\r\n name = undefined;\r\n }\r\n var source = gen.str(name);\r\n if (codegen.verbose)\r\n console.log(\"--- codegen ---\\n\" + source.replace(/^/mg, \"> \").replace(/\\t/g, \" \")); // eslint-disable-line no-console\r\n var keys = Object.keys(scope || (scope = {}));\r\n return Function.apply(null, keys.concat(\"return \" + source)).apply(null, keys.map(function(key) { return scope[key]; })); // eslint-disable-line no-new-func\r\n // ^ Creates a wrapper function with the scoped variable names as its parameters,\r\n // calls it with the respective scoped variable values ^\r\n // and returns our brand-new properly scoped function.\r\n //\r\n // This works because \"Invoking the Function constructor as a function (without using the\r\n // new operator) has the same effect as invoking it as a constructor.\"\r\n // https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function\r\n }\r\n\r\n gen.eof = eof;\r\n\r\n return gen;\r\n}\r\n\r\nfunction sprintf(format) {\r\n var params = Array.prototype.slice.call(arguments, 1),\r\n index = 0;\r\n return format.replace(/%([djs])/g, function($0, $1) {\r\n var param = params[index++];\r\n switch ($1) {\r\n case \"j\":\r\n return JSON.stringify(param);\r\n default:\r\n return String(param);\r\n }\r\n });\r\n}\r\n\r\ncodegen.supported = false; try { codegen.supported = codegen(\"a\",\"b\")(\"return a-b\").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty\r\ncodegen.verbose = false;\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias util.EventEmitter.prototype */\r\nvar EventEmitterPrototype = EventEmitter.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {Object} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitterPrototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < listeners.length; ++i)\r\n listeners[i].fn.apply(listeners[i].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = LongBits;\r\n\r\nvar util = require(23);\r\n\r\n/**\r\n * Any compatible Long instance.\r\n * @typedef Long\r\n * @type {Object}\r\n * @property {number} low Low bits\r\n * @property {number} high High bits\r\n * @property {boolean} unsigned Whether unsigned or not\r\n */\r\n\r\n/**\r\n * Constructs new long bits.\r\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\r\n * @memberof util\r\n * @constructor\r\n * @param {number} lo Low bits\r\n * @param {number} hi High bits\r\n */\r\nfunction LongBits(lo, hi) { // make sure to always call this with unsigned 32bits for proper optimization\r\n\r\n /**\r\n * Low bits.\r\n * @type {number}\r\n */\r\n this.lo = lo;\r\n\r\n /**\r\n * High bits.\r\n * @type {number}\r\n */\r\n this.hi = hi;\r\n}\r\n\r\n/** @alias util.LongBits.prototype */\r\nvar LongBitsPrototype = LongBits.prototype;\r\n\r\n/**\r\n * Zero bits.\r\n * @memberof util.LongBits\r\n * @type {util.LongBits}\r\n */\r\nvar zero = LongBits.zero = new LongBits(0, 0);\r\n\r\nzero.toNumber = function() { return 0; };\r\nzero.zzEncode = zero.zzDecode = function() { return this; };\r\nzero.length = function() { return 1; };\r\n\r\n/**\r\n * Constructs new long bits from the specified number.\r\n * @param {number} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.fromNumber = function fromNumber(value) {\r\n if (value === 0)\r\n return zero;\r\n var sign = value < 0;\r\n value = Math.abs(value);\r\n var lo = value >>> 0,\r\n hi = (value - lo) / 4294967296 >>> 0;\r\n if (sign) {\r\n hi = ~hi >>> 0;\r\n lo = ~lo >>> 0;\r\n if (++lo > 4294967295) {\r\n lo = 0;\r\n if (++hi > 4294967295)\r\n hi = 0;\r\n }\r\n }\r\n return new LongBits(lo, hi);\r\n};\r\n\r\n/**\r\n * Constructs new long bits from a number, long or string.\r\n * @param {Long|number|string} value Value\r\n * @returns {util.LongBits} Instance\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n if (util.Long)\r\n value = util.Long.fromString(value);\r\n // fallthrough\r\n else\r\n return LongBits.fromNumber(parseInt(value, 10));\r\n }\r\n return (value.low || value.high) && new LongBits(value.low >>> 0, value.high >>> 0) || zero;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a possibly unsafe JavaScript number.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {number} Possibly unsafe number\r\n */\r\nLongBitsPrototype.toNumber = function toNumber(unsigned) {\r\n if (!unsigned && this.hi >>> 31) {\r\n this.lo = ~this.lo + 1 >>> 0;\r\n this.hi = ~this.hi >>> 0;\r\n if (!this.lo)\r\n this.hi = this.hi + 1 >>> 0;\r\n return -(this.lo + this.hi * 4294967296);\r\n }\r\n return this.lo + this.hi * 4294967296;\r\n};\r\n\r\n/**\r\n * Converts this long bits to a long.\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long} Long\r\n */\r\nLongBitsPrototype.toLong = function toLong(unsigned) {\r\n return util.Long\r\n ? new util.Long(this.lo, this.hi, unsigned)\r\n : { low: this.lo, high: this.hi, unsigned: Boolean(unsigned) };\r\n};\r\n\r\nvar charCodeAt = String.prototype.charCodeAt;\r\n\r\n/**\r\n * Constructs new long bits from the specified 8 characters long hash.\r\n * @param {string} hash Hash\r\n * @returns {util.LongBits} Bits\r\n */\r\nLongBits.fromHash = function fromHash(hash) {\r\n return new LongBits(\r\n ( charCodeAt.call(hash, 0)\r\n | charCodeAt.call(hash, 1) << 8\r\n | charCodeAt.call(hash, 2) << 16\r\n | charCodeAt.call(hash, 3) << 24) >>> 0\r\n ,\r\n ( charCodeAt.call(hash, 4)\r\n | charCodeAt.call(hash, 5) << 8\r\n | charCodeAt.call(hash, 6) << 16\r\n | charCodeAt.call(hash, 7) << 24) >>> 0\r\n );\r\n};\r\n\r\n/**\r\n * Converts this long bits to a 8 characters long hash.\r\n * @returns {string} Hash\r\n */\r\nLongBitsPrototype.toHash = function toHash() {\r\n return String.fromCharCode(\r\n this.lo & 255,\r\n this.lo >>> 8 & 255,\r\n this.lo >>> 16 & 255,\r\n this.lo >>> 24 & 255,\r\n this.hi & 255,\r\n this.hi >>> 8 & 255,\r\n this.hi >>> 16 & 255,\r\n this.hi >>> 24 & 255\r\n );\r\n};\r\n\r\n/**\r\n * Zig-zag encodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzEncode = function zzEncode() {\r\n var mask = this.hi >> 31;\r\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\r\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Zig-zag decodes this long bits.\r\n * @returns {util.LongBits} `this`\r\n */\r\nLongBitsPrototype.zzDecode = function zzDecode() {\r\n var mask = -(this.lo & 1);\r\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\r\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Calculates the length of this longbits when encoded as a varint.\r\n * @returns {number} Length\r\n */\r\nLongBitsPrototype.length = function length() {\r\n var part0 = this.lo,\r\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\r\n part2 = this.hi >>> 24;\r\n if (part2 === 0) {\r\n if (part1 === 0)\r\n return part0 < 1 << 14\r\n ? part0 < 1 << 7 ? 1 : 2\r\n : part0 < 1 << 21 ? 3 : 4;\r\n return part1 < 1 << 14\r\n ? part1 < 1 << 7 ? 5 : 6\r\n : part1 < 1 << 21 ? 7 : 8;\r\n }\r\n return part2 < 1 << 7 ? 9 : 10;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\nvar util = exports;\r\n\r\nvar LongBits = util.LongBits = require(\"./longbits\");\r\n\r\nutil.base64 = require(\"./base64\");\r\nutil.utf8 = require(\"./utf8\");\r\nutil.pool = require(\"./pool\");\r\n\r\n/**\r\n * Whether running within node or not.\r\n * @memberof util\r\n * @type {boolean}\r\n */\r\nvar isNode = util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);\r\n\r\n/**\r\n * Optional buffer class to use.\r\n * If you assign any compatible buffer implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Buffer = null;\r\n\r\nif (isNode)\r\n try { util.Buffer = require(\"buffer\").Buffer; } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Optional Long class to use.\r\n * If you assign any compatible long implementation to this property, the library will use it.\r\n * @type {*}\r\n */\r\nutil.Long = global.dcodeIO && global.dcodeIO.Long || null;\r\n\r\nif (!util.Long && isNode)\r\n try { util.Long = require(\"long\"); } catch (e) {} // eslint-disable-line no-empty\r\n\r\n/**\r\n * Tests if the specified value is an integer.\r\n * @function\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is an integer\r\n */\r\nutil.isInteger = Number.isInteger || function isInteger(value) {\r\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nutil.isString = function isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n};\r\n\r\n/**\r\n * Tests if the specified value is a non-null object.\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a non-null object\r\n */\r\nutil.isObject = function isObject(value) {\r\n return Boolean(value && typeof value === 'object');\r\n};\r\n\r\n/**\r\n * Converts a number or long to an 8 characters long hash string.\r\n * @param {Long|number} value Value to convert\r\n * @returns {string} Hash\r\n */\r\nutil.longToHash = function longToHash(value) {\r\n return value\r\n ? LongBits.from(value).toHash()\r\n : '\\0\\0\\0\\0\\0\\0\\0\\0';\r\n};\r\n\r\n/**\r\n * Converts an 8 characters long hash string to a long or number.\r\n * @param {string} hash Hash\r\n * @param {boolean} [unsigned=false] Whether unsigned or not\r\n * @returns {Long|number} Original value\r\n */\r\nutil.longFromHash = function longFromHash(hash, unsigned) {\r\n var bits = LongBits.fromHash(hash);\r\n if (util.Long)\r\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\r\n return bits.toNumber(Boolean(unsigned));\r\n};\r\n\r\n/**\r\n * Tests if two possibly long values are not equal.\r\n * @param {number|Long} a First value\r\n * @param {number|Long} b Second value\r\n * @returns {boolean} `true` if not equal\r\n */\r\nutil.longNeq = function longNeq(a, b) {\r\n return typeof a === 'number'\r\n ? typeof b === 'number'\r\n ? a !== b\r\n : (a = LongBits.fromNumber(a)).lo !== b.low || a.hi !== b.high\r\n : typeof b === 'number'\r\n ? (b = LongBits.fromNumber(b)).lo !== a.low || b.hi !== a.high\r\n : a.low !== b.low || a.high !== b.high;\r\n};\r\n\r\n/**\r\n * Defines the specified properties on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {Object} descriptors Property descriptors\r\n * @returns {undefined}\r\n */\r\nutil.props = function props(target, descriptors) {\r\n Object.keys(descriptors).forEach(function(key) {\r\n util.prop(target, key, descriptors[key]);\r\n });\r\n};\r\n\r\n/**\r\n * Defines the specified property on the specified target. Also adds getters and setters for non-ES5 environments.\r\n * @param {Object} target Target object\r\n * @param {string} key Property name\r\n * @param {Object} descriptor Property descriptor\r\n * @returns {undefined}\r\n */\r\nutil.prop = function prop(target, key, descriptor) {\r\n var ie8 = !-[1,];\r\n var ucKey = key.substring(0, 1).toUpperCase() + key.substring(1);\r\n if (descriptor.get)\r\n target['get' + ucKey] = descriptor.get;\r\n if (descriptor.set)\r\n target['set' + ucKey] = ie8\r\n ? function(value) {\r\n descriptor.set.call(this, value);\r\n this[key] = value;\r\n }\r\n : descriptor.set;\r\n if (ie8) {\r\n if (descriptor.value !== undefined)\r\n target[key] = descriptor.value;\r\n } else\r\n Object.defineProperty(target, key, descriptor);\r\n};\r\n\r\n/**\r\n * An immuable empty array.\r\n * @memberof util\r\n * @type {Array.<*>}\r\n */\r\nutil.emptyArray = Object.freeze([]);\r\n\r\n/**\r\n * An immutable empty object.\r\n * @type {Object}\r\n */\r\nutil.emptyObject = Object.freeze({});\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} str String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function length(str) {\r\n var strlen = str.length >>> 0;\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < strlen; ++i) {\r\n c = str.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (str.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {Uint8Array} buf Destination buffer\r\n * @param {number} pos Destination offset\r\n * @param {string} str Source string\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function(buf, pos, str) {\r\n var start = pos;\r\n for (var i = 0; i < str.length; ++i) {\r\n var c1 = str.charCodeAt(i), c2;\r\n if (c1 < 128) {\r\n buf[pos++] = c1;\r\n } else if (c1 < 2048) {\r\n buf[pos++] = c1 >> 6 | 192;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = str.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buf[pos++] = c1 >> 18 | 240;\r\n buf[pos++] = c1 >> 12 & 63 | 128;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n } else {\r\n buf[pos++] = c1 >> 12 | 224;\r\n buf[pos++] = c1 >> 6 & 63 | 128;\r\n buf[pos++] = c1 & 63 | 128;\r\n }\r\n }\r\n return pos - start;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source offset\r\n * @param {number} len Source length\r\n * @returns {string} String read\r\n */\r\nutf8.read = function(buf, pos, len) {\r\n if (len) {\r\n var out = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (pos < len) {\r\n t = buf[pos++];\r\n if (t < 128)\r\n out[i++] = t;\r\n else if (t > 191 && t < 224)\r\n out[i++] = (t & 31) << 6 | buf[pos++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buf[pos++] & 63) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63) - 0x10000;\r\n out[i++] = 0xD800 + (t >> 10);\r\n out[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n out[i++] = (t & 15) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63;\r\n }\r\n return String.fromCharCode.apply(String, out.slice(0, i));\r\n }\r\n return \"\";\r\n};\r\n","\"use strict\";\r\nmodule.exports = verify;\r\n\r\nvar Enum = require(6),\r\n Type = require(21),\r\n util = require(23);\r\nvar isInteger = util.isInteger;\r\n\r\nfunction invalid(field, expected) {\r\n return \"invalid value for field \" + field.getFullName() + \" (\" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected)\";\r\n}\r\n\r\nfunction verifyValue(field, value) {\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\":\r\n if (typeof value !== 'number')\r\n return invalid(field, \"number\");\r\n break;\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\":\r\n if (!isInteger(value))\r\n return invalid(field, \"integer\");\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\":\r\n if (!(isInteger(value) || value && isInteger(value.low) && isInteger(value.high)))\r\n return invalid(field, \"integer|Long\");\r\n break;\r\n case \"bool\":\r\n if (typeof value !== 'boolean')\r\n return invalid(field, \"boolean\");\r\n break;\r\n case \"string\":\r\n if (!util.isString(value))\r\n return invalid(field, \"string\");\r\n break;\r\n case \"bytes\":\r\n if (!(value && typeof value.length === 'number' || util.isString(value)))\r\n return invalid(field, \"buffer\");\r\n break;\r\n default:\r\n if (field.resolvedType instanceof Enum) {\r\n if (typeof field.resolvedType.getValuesById()[value] !== 'number')\r\n return invalid(field, \"enum value\");\r\n } else if (field.resolvedType instanceof Type) {\r\n var reason = field.resolvedType.verify(value);\r\n if (reason)\r\n return reason;\r\n }\r\n break;\r\n }\r\n return null;\r\n}\r\n\r\nfunction verifyKey(field, value) {\r\n switch (field.keyType) {\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\":\r\n if (/^[\\x00-\\xff]{8}$/.test(value)) // eslint-disable-line no-control-regex\r\n return null;\r\n // fallthrough\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\":\r\n if (/^-?(?:0|[1-9]\\d*)$/.test(value))\r\n return invalid(field, \"integer key\");\r\n break;\r\n case \"bool\":\r\n if (/^true|false|0|1$/.test(value))\r\n return invalid(field, \"boolean key\");\r\n break;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * General purpose message verifier.\r\n * @param {Message|Object} message Runtime message or plain object to verify\r\n * @returns {?string} `null` if valid, otherwise the reason why it is not\r\n * @this {Type}\r\n * @property {GenerateVerifier} generate Generates a type specific verifier\r\n */\r\nfunction verify(message) {\r\n /* eslint-disable block-scoped-var, no-redeclare */\r\n var fields = this.getFieldsArray(),\r\n i = 0,\r\n reason;\r\n while (i < fields.length) {\r\n var field = fields[i++].resolve(),\r\n value = message[field.name];\r\n\r\n // map fields\r\n if (field.map) {\r\n\r\n if (value !== undefined) {\r\n if (!util.isObject(value))\r\n return invalid(field, \"object\");\r\n var keys = Object.keys(value);\r\n for (var j = 0; j < keys.length; ++j) {\r\n if (reason = verifyKey(field, keys[j])) // eslint-disable-line no-cond-assign\r\n return reason;\r\n if (reason = verifyValue(field, value[keys[j]])) // eslint-disable-line no-cond-assign\r\n return reason;\r\n }\r\n }\r\n\r\n // repeated fields\r\n } else if (field.repeated) {\r\n\r\n if (value !== undefined) {\r\n if (!Array.isArray(value))\r\n return invalid(field, \"array\");\r\n for (var j = 0; j < value.length; ++j)\r\n if (reason = verifyValue(field, value[j])) // eslint-disable-line no-cond-assign\r\n return reason;\r\n }\r\n\r\n // required or present fields\r\n } else if (field.required || value !== undefined) {\r\n \r\n if (reason = verifyValue(field, value)) // eslint-disable-line no-cond-assign\r\n return reason;\r\n }\r\n\r\n }\r\n return null;\r\n /* eslint-enable block-scoped-var, no-redeclare */\r\n}\r\n\r\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.type) {\r\n case \"double\":\r\n case \"float\": gen\r\n (\"if(typeof %s!=='number')\", ref)\r\n (\"return%j\", invalid(field, \"number\"));\r\n break;\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\": gen\r\n (\"if(!util.isInteger(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer\"));\r\n break;\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!(util.isInteger(%s)||%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\r\n (\"return%j\", invalid(field, \"integer|Long\"));\r\n break;\r\n case \"bool\": gen\r\n (\"if(typeof %s!=='boolean')\", ref)\r\n (\"return%j\", invalid(field, \"boolean\"));\r\n break;\r\n case \"string\": gen\r\n (\"if(!util.isString(%s))\", ref)\r\n (\"return%j\", invalid(field, \"string\"));\r\n break;\r\n case \"bytes\": gen\r\n (\"if(!(%s&&typeof %s.length==='number'||util.isString(%s))\", ref, ref, ref)\r\n (\"return%j\", invalid(field, \"buffer\"));\r\n break;\r\n default:\r\n if (field.resolvedType instanceof Enum) { gen\r\n (\"switch(%s){\", ref)\r\n (\"default:\")\r\n (\"return%j\", invalid(field, \"enum value\"));\r\n var values = util.toArray(field.resolvedType.values);\r\n for (var j = 0; j < values.length; ++j) gen\r\n (\"case %d:\", values[j]);\r\n gen\r\n (\"break\")\r\n (\"}\");\r\n } else if (field.resolvedType instanceof Type) { gen\r\n (\"var r;\")\r\n (\"if(r=types[%d].verify(%s))\", fieldIndex, ref)\r\n (\"return r\");\r\n }\r\n break;\r\n }\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\nfunction genVerifyKey(gen, field, ref) {\r\n /* eslint-disable no-unexpected-multiline */\r\n switch (field.keyType) {\r\n case \"int64\":\r\n case \"uint64\":\r\n case \"sint64\":\r\n case \"fixed64\":\r\n case \"sfixed64\": gen\r\n (\"if(!/^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9]\\\\d*))$/.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer|Long key\"));\r\n break;\r\n case \"int32\":\r\n case \"uint32\":\r\n case \"sint32\":\r\n case \"fixed32\":\r\n case \"sfixed32\":\r\n (\"if(!/^-?(?:0|[1-9]\\\\d*)$/.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"integer key\"));\r\n break;\r\n case \"bool\":\r\n (\"if(!/^true|false|0|1$/.test(%s))\", ref)\r\n (\"return%j\", invalid(field, \"boolean key\"));\r\n break;\r\n }\r\n /* eslint-enable no-unexpected-multiline */\r\n}\r\n\r\n/**\r\n * Generates a verifier specific to the specified message type.\r\n * @typedef GenerateVerifier\r\n * @type {function}\r\n * @param {Type} mtype Message type\r\n * @returns {Codegen} Codegen instance\r\n */\r\n/**/\r\nverify.generate = function generate(mtype) {\r\n /* eslint-disable no-unexpected-multiline */\r\n var fields = mtype.getFieldsArray();\r\n var gen = util.codegen(\"m\");\r\n\r\n for (var i = 0; i < fields.length; ++i) {\r\n var field = fields[i].resolve(),\r\n prop = util.safeProp(field.name);\r\n\r\n // map fields\r\n if (field.map) { gen\r\n (\"if(m%s!==undefined){\", prop)\r\n (\"if(!util.isObject(m%s))\", prop)\r\n (\"return%j\", invalid(field, \"object\"))\r\n (\"var k=Object.keys(m%s)\", prop)\r\n (\"for(var i=0;i 127) {\r\n buf[pos++] = val & 127 | 128;\r\n val >>>= 7;\r\n }\r\n buf[pos] = val;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 32 bit value as a varint.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.uint32 = function write_uint32(value) {\r\n value >>>= 0;\r\n return value < 128\r\n ? this.push(writeByte, 1, value)\r\n : this.push(writeVarint32,\r\n value < 16384 ? 2\r\n : value < 2097152 ? 3\r\n : value < 268435456 ? 4\r\n : 5\r\n , value);\r\n};\r\n\r\n/**\r\n * Writes a signed 32 bit value as a varint.\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.int32 = function write_int32(value) {\r\n return value < 0\r\n ? this.push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\r\n : this.uint32(value);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as a varint, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sint32 = function write_sint32(value) {\r\n return this.uint32(value << 1 ^ value >> 31);\r\n};\r\n\r\nfunction writeVarint64(buf, pos, val) {\r\n // tends to deoptimize. stays optimized when using bits directly.\r\n while (val.hi) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\r\n val.hi >>>= 7;\r\n }\r\n while (val.lo > 127) {\r\n buf[pos++] = val.lo & 127 | 128;\r\n val.lo = val.lo >>> 7;\r\n }\r\n buf[pos++] = val.lo;\r\n}\r\n\r\n/**\r\n * Writes an unsigned 64 bit value as a varint.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.uint64 = function write_uint64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint.\r\n * @function\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.int64 = WriterPrototype.uint64;\r\n\r\n/**\r\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sint64 = function write_sint64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeVarint64, bits.length(), bits);\r\n};\r\n\r\n/**\r\n * Writes a boolish value as a varint.\r\n * @param {boolean} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bool = function write_bool(value) {\r\n return this.push(writeByte, 1, value ? 1 : 0);\r\n};\r\n\r\nfunction writeFixed32(buf, pos, val) {\r\n buf[pos++] = val & 255;\r\n buf[pos++] = val >>> 8 & 255;\r\n buf[pos++] = val >>> 16 & 255;\r\n buf[pos ] = val >>> 24;\r\n}\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fixed32 = function write_fixed32(value) {\r\n return this.push(writeFixed32, 4, value >>> 0);\r\n};\r\n\r\n/**\r\n * Writes a 32 bit value as fixed 32 bits, zig-zag encoded.\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.sfixed32 = function write_sfixed32(value) {\r\n return this.push(writeFixed32, 4, value << 1 ^ value >> 31);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.fixed64 = function write_fixed64(value) {\r\n var bits = LongBits.from(value);\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\n/**\r\n * Writes a 64 bit value as fixed 64 bits, zig-zag encoded.\r\n * @param {Long|number|string} value Value to write\r\n * @returns {Writer} `this`\r\n * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nWriterPrototype.sfixed64 = function write_sfixed64(value) {\r\n var bits = LongBits.from(value).zzEncode();\r\n return this.push(writeFixed32, 4, bits.lo).push(writeFixed32, 4, bits.hi);\r\n};\r\n\r\nvar writeFloat = typeof Float32Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f32 = new Float32Array(1),\r\n f8b = new Uint8Array(f32.buffer);\r\n f32[0] = -0;\r\n return f8b[3] // already le?\r\n ? function writeFloat_f32(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos ] = f8b[3];\r\n }\r\n : function writeFloat_f32_le(buf, pos, val) {\r\n f32[0] = val;\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeFloat_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 23, 4);\r\n };\r\n\r\n/**\r\n * Writes a float (32 bit).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.float = function write_float(value) {\r\n return this.push(writeFloat, 4, value);\r\n};\r\n\r\nvar writeDouble = typeof Float64Array !== 'undefined'\r\n ? (function() { // eslint-disable-line wrap-iife\r\n var f64 = new Float64Array(1),\r\n f8b = new Uint8Array(f64.buffer);\r\n f64[0] = -0;\r\n return f8b[7] // already le?\r\n ? function writeDouble_f64(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[0];\r\n buf[pos++] = f8b[1];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[6];\r\n buf[pos ] = f8b[7];\r\n }\r\n : function writeDouble_f64_le(buf, pos, val) {\r\n f64[0] = val;\r\n buf[pos++] = f8b[7];\r\n buf[pos++] = f8b[6];\r\n buf[pos++] = f8b[5];\r\n buf[pos++] = f8b[4];\r\n buf[pos++] = f8b[3];\r\n buf[pos++] = f8b[2];\r\n buf[pos++] = f8b[1];\r\n buf[pos ] = f8b[0];\r\n };\r\n })()\r\n : function writeDouble_ieee754(buf, pos, val) {\r\n ieee754.write(buf, val, pos, false, 52, 8);\r\n };\r\n\r\n/**\r\n * Writes a double (64 bit float).\r\n * @function\r\n * @param {number} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.double = function write_double(value) {\r\n return this.push(writeDouble, 8, value);\r\n};\r\n\r\nfunction writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n}\r\n\r\nvar writeBytes = ArrayImpl.prototype.set\r\n ? writeBytes_set\r\n : function writeBytes_for(buf, pos, val) {\r\n for (var i = 0; i < val.length; ++i)\r\n buf[pos + i] = val[i];\r\n };\r\n\r\n/**\r\n * Writes a sequence of bytes.\r\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.bytes = function write_bytes(value) {\r\n var len = value.length >>> 0;\r\n if (typeof value === 'string' && len) {\r\n var buf = Writer.alloc(len = base64.length(value));\r\n base64.decode(value, buf, 0);\r\n value = buf;\r\n }\r\n return len\r\n ? this.uint32(len).push(writeBytes, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Writes a string.\r\n * @param {string} value Value to write\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.string = function write_string(value) {\r\n var len = utf8.length(value);\r\n return len\r\n ? this.uint32(len).push(utf8.write, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\n/**\r\n * Forks this writer's state by pushing it to a stack.\r\n * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.fork = function fork() {\r\n this.states = new State(this, this.states);\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets this instance to the last state.\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.reset = function reset() {\r\n if (this.states) {\r\n this.head = this.states.head;\r\n this.tail = this.states.tail;\r\n this.len = this.states.len;\r\n this.states = this.states.next;\r\n } else {\r\n this.head = this.tail = new Op(noop, 0, 0);\r\n this.len = 0;\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\r\n * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable\r\n * @returns {Writer} `this`\r\n */\r\nWriterPrototype.ldelim = function ldelim(id) {\r\n var head = this.head,\r\n tail = this.tail,\r\n len = this.len;\r\n this.reset();\r\n if (id !== undefined)\r\n this.tag(id, 2);\r\n this.uint32(len);\r\n this.tail.next = head.next; // skip noop\r\n this.tail = tail;\r\n this.len += len;\r\n return this;\r\n};\r\n\r\n/**\r\n * Finishes the current sequence of write operations and frees all resources.\r\n * @returns {Uint8Array} Finished buffer\r\n */\r\nWriterPrototype.finish = function finish() {\r\n var head = this.head.next, // skip noop\r\n buf = this.constructor.alloc(this.len);\r\n this.reset();\r\n var pos = 0;\r\n while (head) {\r\n head.fn(buf, pos, head.val);\r\n pos += head.len;\r\n head = head.next;\r\n }\r\n return buf;\r\n};\r\n\r\n/**\r\n * Constructs a new buffer writer instance.\r\n * @classdesc Wire format writer using node buffers.\r\n * @exports BufferWriter\r\n * @extends Writer\r\n * @constructor\r\n */\r\nfunction BufferWriter() {\r\n Writer.call(this);\r\n}\r\n\r\n/**\r\n * Allocates a buffer of the specified size.\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\nBufferWriter.alloc = function alloc_buffer(size) {\r\n BufferWriter.alloc = util.Buffer.allocUnsafe\r\n ? util.Buffer.allocUnsafe\r\n : function allocUnsafeNew(size) { return new util.Buffer(size); };\r\n return BufferWriter.alloc(size);\r\n};\r\n\r\n/** @alias BufferWriter.prototype */\r\nvar BufferWriterPrototype = BufferWriter.prototype = Object.create(Writer.prototype);\r\nBufferWriterPrototype.constructor = BufferWriter;\r\n\r\nfunction writeFloatBuffer(buf, pos, val) {\r\n buf.writeFloatLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float32Array === 'undefined') // f32 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.float = function write_float_buffer(value) {\r\n return this.push(writeFloatBuffer, 4, value);\r\n};\r\n\r\nfunction writeDoubleBuffer(buf, pos, val) {\r\n buf.writeDoubleLE(val, pos, true);\r\n}\r\n\r\nif (typeof Float64Array === 'undefined') // f64 is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.double = function write_double_buffer(value) {\r\n return this.push(writeDoubleBuffer, 8, value);\r\n};\r\n\r\nfunction writeBytesBuffer(buf, pos, val) {\r\n if (val.length)\r\n val.copy(buf, pos, 0, val.length);\r\n}\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\r\n if (typeof value === 'string')\r\n value = util.Buffer.from && util.Buffer.from(value, \"base64\") || new util.Buffer(value, \"base64\");\r\n var len = value.length >>> 0;\r\n return len\r\n ? this.uint32(len).push(writeBytesBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n\r\nvar writeStringBuffer = (function() { // eslint-disable-line wrap-iife\r\n return util.Buffer && util.Buffer.prototype.utf8Write // around forever, but not present in browser buffer\r\n ? function writeString_buffer_utf8Write(buf, pos, val) {\r\n if (val.length < 40)\r\n utf8.write(buf, pos, val);\r\n else\r\n buf.utf8Write(val, pos);\r\n }\r\n : function writeString_buffer_write(buf, pos, val) {\r\n if (val.length < 40)\r\n utf8.write(buf, pos, val);\r\n else\r\n buf.write(val, pos);\r\n };\r\n // Note that the plain JS encoder is faster for short strings, probably because of redundant assertions.\r\n // For a raw utf8Write, the breaking point is about 20 characters, for write it is around 40 characters.\r\n // Unfortunately, this does not translate 1:1 to real use cases, hence the common \"good enough\" limit of 40.\r\n})();\r\n\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.string = function write_string_buffer(value) {\r\n var len = value.length < 40\r\n ? utf8.length(value)\r\n : util.Buffer.byteLength(value);\r\n return len\r\n ? this.uint32(len).push(writeStringBuffer, len, value)\r\n : this.push(writeByte, 1, 0);\r\n};\r\n","\"use strict\";\r\nvar protobuf = global.protobuf = exports;\r\n\r\n/**\r\n * A node-style callback as used by {@link load} and {@link Root#load}.\r\n * @typedef LoadCallback\r\n * @type {function}\r\n * @param {?Error} error Error, if any, otherwise `null`\r\n * @param {Root} [root] Root, if there hasn't been an error\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n */\r\nfunction load(filename, root, callback) {\r\n if (typeof root === 'function') {\r\n callback = root;\r\n root = new protobuf.Root();\r\n } else if (!root)\r\n root = new protobuf.Root();\r\n return root.load(filename, callback);\r\n}\r\n// function load(filename:string, root:Root, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {LoadCallback} callback Callback function\r\n * @returns {undefined}\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:LoadCallback):undefined\r\n\r\n/**\r\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\r\n * @name load\r\n * @function\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Promise} Promise\r\n * @variation 3\r\n */\r\n// function load(filename:string, [root:Root]):Promise\r\n\r\nprotobuf.load = load;\r\n\r\n/**\r\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\r\n * @param {string|string[]} filename One or multiple files to load\r\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\r\n * @returns {Root} Root namespace\r\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\r\n */\r\nfunction loadSync(filename, root) {\r\n if (!root)\r\n root = new protobuf.Root();\r\n return root.loadSync(filename);\r\n}\r\n\r\nprotobuf.loadSync = loadSync;\r\n\r\n// Parser\r\nprotobuf.tokenize = require(\"./tokenize\");\r\nprotobuf.parse = require(\"./parse\");\r\n\r\n// Serialization\r\nprotobuf.Writer = require(\"./writer\");\r\nprotobuf.BufferWriter = protobuf.Writer.BufferWriter;\r\n var Reader =\r\nprotobuf.Reader = require(\"./reader\");\r\nprotobuf.BufferReader = protobuf.Reader.BufferReader;\r\nprotobuf.encode = require(\"./encode\");\r\nprotobuf.decode = require(\"./decode\");\r\nprotobuf.verify = require(\"./verify\");\r\n\r\n// Reflection\r\nprotobuf.ReflectionObject = require(\"./object\");\r\nprotobuf.Namespace = require(\"./namespace\");\r\nprotobuf.Root = require(\"./root\");\r\nprotobuf.Enum = require(\"./enum\");\r\nprotobuf.Type = require(\"./type\");\r\nprotobuf.Field = require(\"./field\");\r\nprotobuf.OneOf = require(\"./oneof\");\r\nprotobuf.MapField = require(\"./mapfield\");\r\nprotobuf.Service = require(\"./service\");\r\nprotobuf.Method = require(\"./method\");\r\n\r\n// Runtime\r\nprotobuf.Class = require(\"./class\");\r\nprotobuf.Message = require(\"./message\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\n var util =\r\nprotobuf.util = require(\"./util\");\r\nprotobuf.configure = configure;\r\n\r\n/**\r\n * Reconfigures the library according to the environment.\r\n * @returns {undefined}\r\n */\r\nfunction configure() {\r\n util._configure();\r\n Reader._configure();\r\n}\r\n\r\n// Be nice to AMD\r\nif (typeof define === 'function' && define.amd)\r\n define([\"long\"], function(Long) {\r\n if (Long) {\r\n protobuf.util.Long = Long;\r\n configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/runtime.js b/runtime/index.js similarity index 59% rename from runtime.js rename to runtime/index.js index a515d62f7..e27d45edc 100644 --- a/runtime.js +++ b/runtime/index.js @@ -1,6 +1,6 @@ // This file exports just the bare minimum required to work with statically generated code. // Can be used as a drop-in replacement for the full library as it has the same general structure. var protobuf_rt = exports; -protobuf_rt.Reader = require("./src/reader"); -protobuf_rt.Writer = require("./src/writer"); -protobuf_rt.util = require("./src/util/runtime"); +protobuf_rt.Reader = require("../src/reader"); +protobuf_rt.Writer = require("../src/writer"); +protobuf_rt.util = require("../src/util/runtime"); diff --git a/src/codegen/decode.js b/src/decode.js similarity index 86% rename from src/codegen/decode.js rename to src/decode.js index e1b271927..cd95b25e4 100644 --- a/src/codegen/decode.js +++ b/src/decode.js @@ -1,36 +1,20 @@ "use strict"; +module.exports = decode; -/** - * Wire format decoder using code generation on top of reflection that also provides a fallback. - * @exports codegen.decode - * @namespace - */ -var decode = exports; - -var Enum = require("../enum"), - Reader = require("../reader"), - types = require("../types"), - util = require("../util"), - codegen = require("../codegen"); +var Enum = require("./enum"), + Reader = require("./reader"), + types = require("./types"), + util = require("./util"); /** - * A message decoder as generated by {@link codegen.decode.generate}. - * @typedef Decoder - * @type {function} + * General purpose message decoder. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand * @returns {Message} Populated runtime message * @this Type + * @property {GenerateDecoder} generate Generates a type specific decoder */ - -/** - * Fallback {@link Decoder|decoder}. - * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from - * @param {number} [length] Length of the message, if known beforehand - * @returns {Message} Populated runtime message - * @this Type - */ -decode.fallback = function decode_fallback(readerOrBuffer, length) { +function decode(readerOrBuffer, length) { /* eslint-disable no-invalid-this, block-scoped-var, no-redeclare */ var fields = this.getFieldsById(), reader = readerOrBuffer instanceof Reader ? readerOrBuffer : Reader.create(readerOrBuffer), @@ -92,17 +76,20 @@ decode.fallback = function decode_fallback(readerOrBuffer, length) { } return message; /* eslint-enable no-invalid-this, block-scoped-var, no-redeclare */ -}; +} /** - * Generates a {@link Decoder|decoder} specific to the specified message type. + * Generates a decoder specific to the specified message type. + * @typedef GenerateDecoder + * @type {function} * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ -decode.generate = function decode_generate(mtype) { +/**/ +decode.generate = function generate(mtype) { /* eslint-disable no-unexpected-multiline */ var fields = mtype.getFieldsArray(); - var gen = codegen("r", "l") + var gen = util.codegen("r", "l") ("r instanceof Reader||(r=Reader.create(r))") ("var c=l===undefined?r.len:r.pos+l,m=new(this.getCtor())") diff --git a/src/codegen/encode.js b/src/encode.js similarity index 87% rename from src/codegen/encode.js rename to src/encode.js index fb99960d2..ded0eefe4 100644 --- a/src/codegen/encode.js +++ b/src/encode.js @@ -1,36 +1,20 @@ "use strict"; +module.exports = encode; -/** - * Wire format encoder using code generation on top of reflection that also provides a fallback. - * @exports codegen.encode - * @namespace - */ -var encode = exports; - -var Enum = require("../enum"), - Writer = require("../writer"), - types = require("../types"), - util = require("../util"), - codegen = require("../codegen"); +var Enum = require("./enum"), + Writer = require("./writer"), + types = require("./types"), + util = require("./util"); /** - * A message encoder as generated by {@link codegen.encode.generate}. - * @typedef Encoder - * @type {function} + * General purpose message encoder. * @param {Message|Object} message Runtime message or plain object to encode * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer * @this Type + * @property {GenerateEncoder} generate Generates a type specific encoder */ - -/** - * Fallback {@link Encoder|encoder}. - * @param {Message|Object} message Runtime message or plain object to encode - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - * @this Type - */ -encode.fallback = function encode_fallback(message, writer) { +function encode(message, writer) { /* eslint-disable block-scoped-var, no-redeclare */ if (!writer) writer = Writer.create(); @@ -100,17 +84,20 @@ encode.fallback = function encode_fallback(message, writer) { } return writer; /* eslint-enable block-scoped-var, no-redeclare */ -}; +} /** * Generates an {@link Encoder|encoder} specific to the specified message type. + * @typedef GenerateEncoder + * @type {function} * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ -encode.generate = function encode_generate(mtype) { +/**/ +encode.generate = function generate(mtype) { /* eslint-disable no-unexpected-multiline */ var fields = mtype.getFieldsArray(); - var gen = codegen("m", "w") + var gen = util.codegen("m", "w") ("w||(w=Writer.create())"); for (var i = 0; i < fields.length; ++i) { diff --git a/src/index.js b/src/index.js index 9decb6250..66e6270bf 100644 --- a/src/index.js +++ b/src/index.js @@ -76,7 +76,9 @@ protobuf.BufferWriter = protobuf.Writer.BufferWriter; var Reader = protobuf.Reader = require("./reader"); protobuf.BufferReader = protobuf.Reader.BufferReader; -protobuf.codegen = require("./codegen"); +protobuf.encode = require("./encode"); +protobuf.decode = require("./decode"); +protobuf.verify = require("./verify"); // Reflection protobuf.ReflectionObject = require("./object"); diff --git a/src/reader.js b/src/reader.js index eb0ed45fd..21f77baec 100644 --- a/src/reader.js +++ b/src/reader.js @@ -6,7 +6,8 @@ Reader.BufferReader = BufferReader; var util = require("./util/runtime"), ieee754 = require("../lib/ieee754"); var LongBits = util.LongBits, - ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + utf8 = util.utf8; +var ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; function indexOutOfRange(reader, writeLength) { return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); @@ -415,27 +416,8 @@ ReaderPrototype.bytes = function read_bytes() { * @returns {string} Value read */ ReaderPrototype.string = function read_string() { - // ref: https://github.com/google/closure-library/blob/master/closure/goog/crypt/crypt.js - var bytes = this.bytes(), - len = bytes.length; - if (len) { - var out = new Array(len), p = 0, c = 0; - while (p < len) { - var c1 = bytes[p++]; - if (c1 < 128) - out[c++] = c1; - else if (c1 > 191 && c1 < 224) - out[c++] = (c1 & 31) << 6 | bytes[p++] & 63; - else if (c1 > 239 && c1 < 365) { - var u = ((c1 & 7) << 18 | (bytes[p++] & 63) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63) - 0x10000; - out[c++] = 0xD800 + (u >> 10); - out[c++] = 0xDC00 + (u & 1023); - } else - out[c++] = (c1 & 15) << 12 | (bytes[p++] & 63) << 6 | bytes[p++] & 63; - } - return String.fromCharCode.apply(String, out.slice(0, c)); - } - return ""; + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); }; /** diff --git a/src/rpc/service.js b/src/rpc/service.js index de5b8221e..8d313e92e 100644 --- a/src/rpc/service.js +++ b/src/rpc/service.js @@ -15,7 +15,7 @@ function Service(rpcImpl) { EventEmitter.call(this); /** - * RPC implementation. Becomes `null` when the service is ended. + * RPC implementation. Becomes `null` once the service is ended. * @type {?RPCImpl} */ this.$rpc = rpcImpl; diff --git a/src/type.js b/src/type.js index 23a5488df..2a8c1f09c 100644 --- a/src/type.js +++ b/src/type.js @@ -15,8 +15,10 @@ var Enum = require("./enum"), Message = require("./message"), Reader = require("./reader"), Writer = require("./writer"), - util = require("./util"), - codegen = require("./codegen"); + util = require("./util"); +var encode = require("./encode"), + decode = require("./decode"), + verify = require("./verify"); /** * Constructs a new reflected message type instance. @@ -323,14 +325,14 @@ TypePrototype.create = function create(properties) { * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ -TypePrototype.encode = function encode(message, writer) { - return (this.encode = codegen.supported - ? codegen.encode.generate(this).eof(this.getFullName() + "$encode", { +TypePrototype.encode = function encode_setup(message, writer) { + return (this.encode = util.codegen.supported + ? encode.generate(this).eof(this.getFullName() + "$encode", { Writer : Writer, types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }), util : util }) - : codegen.encode.fallback + : encode ).call(this, message, writer); }; @@ -350,14 +352,14 @@ TypePrototype.encodeDelimited = function encodeDelimited(message, writer) { * @param {number} [length] Length of the message, if known beforehand * @returns {Message} Decoded message */ -TypePrototype.decode = function decode(readerOrBuffer, length) { - return (this.decode = codegen.supported - ? codegen.decode.generate(this).eof(this.getFullName() + "$decode", { +TypePrototype.decode = function decode_setup(readerOrBuffer, length) { + return (this.decode = util.codegen.supported + ? decode.generate(this).eof(this.getFullName() + "$decode", { Reader : Reader, types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }), util : util }) - : codegen.decode.fallback + : decode ).call(this, readerOrBuffer, length); }; @@ -376,12 +378,12 @@ TypePrototype.decodeDelimited = function decodeDelimited(readerOrBuffer) { * @param {Message|Object} message Message to verify * @returns {?string} `null` if valid, otherwise the reason why it is not */ -TypePrototype.verify = function verify(message) { - return (this.verify = codegen.supported - ? codegen.verify.generate(this).eof(this.getFullName() + "$verify", { +TypePrototype.verify = function verify_setup(message) { + return (this.verify = util.codegen.supported + ? verify.generate(this).eof(this.getFullName() + "$verify", { types : this.getFieldsArray().map(function(fld) { return fld.resolvedType; }), util : util }) - : codegen.verify.fallback + : verify ).call(this, message); }; diff --git a/src/util.js b/src/util.js index 5c74444cf..1013d671c 100644 --- a/src/util.js +++ b/src/util.js @@ -6,6 +6,8 @@ */ var util = exports; +util.codegen = require("./util/codegen"); + /** * Converts an object's values to an array. * @param {Object.} object Object to convert @@ -195,28 +197,6 @@ util.safeProp = function safeProp(prop) { return "['" + prop.replace(/\\/g, "\\\\").replace(/'/g, "\\'") + "']"; }; -/** - * Minimalistic sprintf. - * @param {string} format Format string - * @param {...*} args Replacements - * @returns {string} Formatted string - */ -util.sprintf = function sprintf(format) { - var params = Array.prototype.slice.call(arguments, 1), - index = 0; - return format.replace(/%([djs])/g, function($0, $1) { - var param = params[index++]; - switch ($1) { - case "j": - return JSON.stringify(param); - case "p": - return util.safeProp(param); - default: - return String(param); - } - }); -}; - /** * Converts a string to camel case notation. * @param {string} str String to convert @@ -245,7 +225,7 @@ util.underScore = function underScore(str) { * @returns {Uint8Array} Buffer */ util.newBuffer = function newBuffer(size) { - size = 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); diff --git a/src/util/base64/LICENSE b/src/util/base64/LICENSE new file mode 100644 index 000000000..7a4a3ea24 --- /dev/null +++ b/src/util/base64/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/src/util/base64/README.md b/src/util/base64/README.md new file mode 100644 index 000000000..a64e11591 --- /dev/null +++ b/src/util/base64/README.md @@ -0,0 +1,5 @@ +@protobufjs/base64 +================== +A minimal base64 implementation for number arrays. + +**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/src/util/base64/index.js b/src/util/base64/index.js new file mode 100644 index 000000000..7ba9c7c20 --- /dev/null +++ b/src/util/base64/index.js @@ -0,0 +1,120 @@ +"use strict"; + +/** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ +var base64 = exports; + +/** + * Calculates the base64 byte length of a string. + * @param {string} str Base64 encoded string + * @returns {number} Byte length + */ +base64.length = function length(str) { + var p = str.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && str.charAt(p) === '=') + ++n; + return Math.ceil(str.length * 3) / 4 - n; +}; + +// Base64 encoding table +var b64 = [ + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 +]; + +/** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ +base64.encode = function encode(buffer, start, end) { + var str = new Array(Math.ceil((end - start) / 3) * 4); + var i = 0, // output index + j = 0, // goto index + t; // temporary + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + str[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + str[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + str[i++] = b64[t | b >> 6]; + str[i++] = b64[b & 63]; + j = 0; + break; + } + } + if (j) { + str[i++] = b64[t]; + str[i ] = 61; + if (j === 1) + str[i + 1] = 61; + } + return String.fromCharCode.apply(String, str); +}; + +// Base64 decoding table +var s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i; +var invalidEncoding = "invalid encoding"; + +/** + * Decodes a base64 encoded string to a buffer. + * @param {string} src Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ +base64.decode = function decode(src, buffer, offset) { + var start = offset; + var j = 0, // goto index + t; // temporary + for (var i = 0; i < src.length;) { + var c = src.charCodeAt(i++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; +}; diff --git a/src/util/base64/package.json b/src/util/base64/package.json new file mode 100644 index 000000000..b7ad5458b --- /dev/null +++ b/src/util/base64/package.json @@ -0,0 +1,11 @@ +{ + "name": "@protobufjs/base64", + "description": "A minimal base64 implementation for number arrays.", + "version": "1.0.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/src/util/codegen/LICENSE b/src/util/codegen/LICENSE new file mode 100644 index 000000000..7a4a3ea24 --- /dev/null +++ b/src/util/codegen/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/src/util/codegen/README.md b/src/util/codegen/README.md new file mode 100644 index 000000000..8364b9b3d --- /dev/null +++ b/src/util/codegen/README.md @@ -0,0 +1,5 @@ +@protobufjs/codegen +=================== +A closure for generating functions programmatically. + +**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) \ No newline at end of file diff --git a/src/codegen.js b/src/util/codegen/index.js similarity index 89% rename from src/codegen.js rename to src/util/codegen/index.js index 4cfa6e723..0ead1afc8 100644 --- a/src/codegen.js +++ b/src/util/codegen/index.js @@ -1,8 +1,6 @@ "use strict"; module.exports = codegen; -var util = require("./util"); - var blockOpenRe = /[{[]$/, blockCloseRe = /^[}\]]/, casingRe = /:$/, @@ -11,6 +9,7 @@ var blockOpenRe = /[{[]$/, /** * A closure for generating functions programmatically. + * @memberof util * @namespace * @function * @param {...string} params Function parameter names @@ -25,7 +24,7 @@ function codegen() { inCase = false; /** - * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function. + * A codegen instance as returned by {@link codegen}, that also is a sprintf-like appender function. * @typedef Codegen * @type {function} * @param {string} format Format string @@ -36,7 +35,7 @@ function codegen() { */ /**/ function gen() { - var line = util.sprintf.apply(null, arguments); + var line = sprintf.apply(null, arguments); var level = indent; if (src.length) { var prev = src[src.length - 1]; @@ -109,9 +108,19 @@ function codegen() { return gen; } +function sprintf(format) { + var params = Array.prototype.slice.call(arguments, 1), + index = 0; + return format.replace(/%([djs])/g, function($0, $1) { + var param = params[index++]; + switch ($1) { + case "j": + return JSON.stringify(param); + default: + return String(param); + } + }); +} + codegen.supported = false; try { codegen.supported = codegen("a","b")("return a-b").eof()(2,1) === 1; } catch (e) {} // eslint-disable-line no-empty codegen.verbose = false; - -codegen.encode = require("./codegen/encode"); -codegen.decode = require("./codegen/decode"); -codegen.verify = require("./codegen/verify"); diff --git a/src/util/codegen/package.json b/src/util/codegen/package.json new file mode 100644 index 000000000..8d76db2a4 --- /dev/null +++ b/src/util/codegen/package.json @@ -0,0 +1,11 @@ +{ + "name": "@protobufjs/codegen", + "description": "A closure for generating functions programmatically.", + "version": "1.0.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/src/util/eventemitter/LICENSE b/src/util/eventemitter/LICENSE new file mode 100644 index 000000000..7a4a3ea24 --- /dev/null +++ b/src/util/eventemitter/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/src/util/eventemitter/README.md b/src/util/eventemitter/README.md new file mode 100644 index 000000000..2ae67a080 --- /dev/null +++ b/src/util/eventemitter/README.md @@ -0,0 +1,5 @@ +@protobufjs/eventemitter +======================== +A minimal event emitter. + +**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/src/util/eventemitter.js b/src/util/eventemitter/index.js similarity index 100% rename from src/util/eventemitter.js rename to src/util/eventemitter/index.js diff --git a/src/util/eventemitter/package.json b/src/util/eventemitter/package.json new file mode 100644 index 000000000..78c2cd5be --- /dev/null +++ b/src/util/eventemitter/package.json @@ -0,0 +1,11 @@ +{ + "name": "@protobufjs/eventemitter", + "description": "A minimal event emitter.", + "version": "1.0.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/src/util/pool/LICENSE b/src/util/pool/LICENSE new file mode 100644 index 000000000..7a4a3ea24 --- /dev/null +++ b/src/util/pool/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/src/util/pool/README.md b/src/util/pool/README.md new file mode 100644 index 000000000..b1180ffb9 --- /dev/null +++ b/src/util/pool/README.md @@ -0,0 +1,5 @@ +@protobufjs/pool +================ +A general purpose buffer pool. + +**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) \ No newline at end of file diff --git a/src/util/pool.js b/src/util/pool/index.js similarity index 53% rename from src/util/pool.js rename to src/util/pool/index.js index 55c228f95..ea4feaddc 100644 --- a/src/util/pool.js +++ b/src/util/pool/index.js @@ -2,13 +2,31 @@ module.exports = pool; /** - * A drop-in buffer pool, similar in functionality to what node uses for buffers. + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + +/** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + +/** + * A general purpose buffer pool. * @memberof util * @function - * @param {function(number):Uint8Array} alloc Allocator - * @param {function(number, number):Uint8Array} slice Slicer + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer * @param {number} [size=8192] Slab size - * @returns {function(number):Uint8Array} Pooled allocator + * @returns {PoolAllocator} Pooled allocator */ function pool(alloc, slice, size) { var SIZE = size || 8192; diff --git a/src/util/pool/package.json b/src/util/pool/package.json new file mode 100644 index 000000000..1870454f6 --- /dev/null +++ b/src/util/pool/package.json @@ -0,0 +1,11 @@ +{ + "name": "@protobufjs/pool", + "description": "A general purpose buffer pool.", + "version": "1.0.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/src/util/runtime.js b/src/util/runtime.js index a13a17e5a..1621155d7 100644 --- a/src/util/runtime.js +++ b/src/util/runtime.js @@ -4,7 +4,9 @@ var util = exports; var LongBits = util.LongBits = require("./longbits"); -util.pool = require("./pool"); +util.base64 = require("./base64"); +util.utf8 = require("./utf8"); +util.pool = require("./pool"); /** * Whether running within node or not. @@ -151,119 +153,3 @@ util.emptyArray = Object.freeze([]); * @type {Object} */ util.emptyObject = Object.freeze({}); - -/** - * Calculates the byte length of a base64 encoded string. - * @param {string} str Base64 encoded string - * @returns {number} Byte length - */ -util.length64 = function length64(str) { - var p = str.length; - var n = 0; - if (p) - while (--p % 4 > 1 && str.charAt(p) === '=') - ++n; - return Math.ceil(str.length * 3) / 4 - n; -}; - -// Base64 encoding table -var b64 = [ - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 -]; - -/** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ -util.encode64 = function encode64(buffer, start, end) { - var dst = new Array(Math.ceil((end - start) / 3) * 4); - var i = 0, // output index - j = 0, // goto index - t; // temporary - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - dst[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - dst[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - dst[i++] = b64[t | b >> 6]; - dst[i++] = b64[b & 63]; - j = 0; - break; - } - } - switch (j) { - case 1: - dst[i++] = b64[t]; - dst[i++] = 61; - dst[i ] = 61; - break; - case 2: - dst[i++] = b64[t]; - dst[i ] = 61; - break; - } - return String.fromCharCode.apply(String, dst); -}; - -// Base64 decoding table -var s64 = []; for (var i = 0; i < b64.length; ++i) s64[b64[i]] = i; -var invalidEncoding = "invalid encoding"; - -/** - * Decodes a base64 encoded string to a buffer. - * @param {string} src Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ -util.decode64 = function decode64(src, buffer, offset) { - var start = offset; - var j = 0, // goto index - t; // temporary - for (var i = 0; i < src.length;) { - var c = src.charCodeAt(i++); - if (c === 61 && j > 1) - break; - if ((c = s64[c]) === undefined) - throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) - throw Error(invalidEncoding); - return offset - start; -}; diff --git a/src/util/utf8/LICENSE b/src/util/utf8/LICENSE new file mode 100644 index 000000000..7a4a3ea24 --- /dev/null +++ b/src/util/utf8/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/src/util/utf8/README.md b/src/util/utf8/README.md new file mode 100644 index 000000000..f28541c95 --- /dev/null +++ b/src/util/utf8/README.md @@ -0,0 +1,5 @@ +@protobufjs/utf8 +================ +A minimal UTF8 implementation for number arrays. + +**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/src/util/utf8/index.js b/src/util/utf8/index.js new file mode 100644 index 000000000..59a3a8982 --- /dev/null +++ b/src/util/utf8/index.js @@ -0,0 +1,94 @@ +"use strict"; + +/** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ +var utf8 = exports; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} str String + * @returns {number} Byte length + */ +utf8.length = function length(str) { + var strlen = str.length >>> 0; + var len = 0, + c = 0; + for (var i = 0; i < strlen; ++i) { + c = str.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 0xFC00) === 0xD800 && (str.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { + ++i; + len += 4; + } else + len += 3; + } + return len; +}; + +/** + * Writes a string as UTF8 bytes. + * @param {Uint8Array} buf Destination buffer + * @param {number} pos Destination offset + * @param {string} str Source string + * @returns {number} Bytes written + */ +utf8.write = function(buf, pos, str) { + var start = pos; + for (var i = 0; i < str.length; ++i) { + var c1 = str.charCodeAt(i), c2; + if (c1 < 128) { + buf[pos++] = c1; + } else if (c1 < 2048) { + buf[pos++] = c1 >> 6 | 192; + buf[pos++] = c1 & 63 | 128; + } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = str.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { + c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); + ++i; + buf[pos++] = c1 >> 18 | 240; + buf[pos++] = c1 >> 12 & 63 | 128; + buf[pos++] = c1 >> 6 & 63 | 128; + buf[pos++] = c1 & 63 | 128; + } else { + buf[pos++] = c1 >> 12 | 224; + buf[pos++] = c1 >> 6 & 63 | 128; + buf[pos++] = c1 & 63 | 128; + } + } + return pos - start; +}; + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source offset + * @param {number} len Source length + * @returns {string} String read + */ +utf8.read = function(buf, pos, len) { + if (len) { + var out = [], + i = 0, // char offset + t; // temporary + while (pos < len) { + t = buf[pos++]; + if (t < 128) + out[i++] = t; + else if (t > 191 && t < 224) + out[i++] = (t & 31) << 6 | buf[pos++] & 63; + else if (t > 239 && t < 365) { + t = ((t & 7) << 18 | (buf[pos++] & 63) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63) - 0x10000; + out[i++] = 0xD800 + (t >> 10); + out[i++] = 0xDC00 + (t & 1023); + } else + out[i++] = (t & 15) << 12 | (buf[pos++] & 63) << 6 | buf[pos++] & 63; + } + return String.fromCharCode.apply(String, out.slice(0, i)); + } + return ""; +}; diff --git a/src/util/utf8/package.json b/src/util/utf8/package.json new file mode 100644 index 000000000..2711f8778 --- /dev/null +++ b/src/util/utf8/package.json @@ -0,0 +1,11 @@ +{ + "name": "@protobufjs/utf8", + "description": "A minimal UTF8 implementation for number arrays.", + "version": "1.0.0", + "author": "Daniel Wirtz ", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/protobuf.js.git" + }, + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/src/codegen/verify.js b/src/verify.js similarity index 91% rename from src/codegen/verify.js rename to src/verify.js index 756b72531..8b9465537 100644 --- a/src/codegen/verify.js +++ b/src/verify.js @@ -1,27 +1,11 @@ "use strict"; +module.exports = verify; -/** - * Runtime message verifier using code generation on top of reflection that also provides a fallback. - * @exports codegen.verify - * @namespace - */ -var verify = exports; - -var Enum = require("../enum"), - Type = require("../type"), - util = require("../util"), - codegen = require("../codegen"); +var Enum = require("./enum"), + Type = require("./type"), + util = require("./util"); var isInteger = util.isInteger; -/** - * A message verifier as generated by {@link codegen.verify.generate}. - * @typedef Verifier - * @type {function} - * @param {Message|Object} message Runtime message or plain object to verify - * @returns {?string} `null` if valid, otherwise the reason why it is not - * @this {Type} - */ - function invalid(field, expected) { return "invalid value for field " + field.getFullName() + " (" + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected)"; } @@ -102,12 +86,13 @@ function verifyKey(field, value) { } /** - * Fallback {@link Verifier|verifier}. + * General purpose message verifier. * @param {Message|Object} message Runtime message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not * @this {Type} + * @property {GenerateVerifier} generate Generates a type specific verifier */ -verify.fallback = function verify_fallback(message) { +function verify(message) { /* eslint-disable block-scoped-var, no-redeclare */ var fields = this.getFieldsArray(), i = 0, @@ -152,7 +137,7 @@ verify.fallback = function verify_fallback(message) { } return null; /* eslint-enable block-scoped-var, no-redeclare */ -}; +} function genVerifyValue(gen, field, fieldIndex, ref) { /* eslint-disable no-unexpected-multiline */ @@ -239,14 +224,17 @@ function genVerifyKey(gen, field, ref) { } /** - * Generates a {@link Verifier|verifier} specific to the specified message type. + * Generates a verifier specific to the specified message type. + * @typedef GenerateVerifier + * @type {function} * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ -verify.generate = function verify_generate(mtype) { +/**/ +verify.generate = function generate(mtype) { /* eslint-disable no-unexpected-multiline */ var fields = mtype.getFieldsArray(); - var gen = codegen("m"); + var gen = util.codegen("m"); for (var i = 0; i < fields.length; ++i) { var field = fields[i].resolve(), diff --git a/src/writer.js b/src/writer.js index 4c6079041..1ff561d36 100644 --- a/src/writer.js +++ b/src/writer.js @@ -6,7 +6,9 @@ Writer.BufferWriter = BufferWriter; var util = require("./util/runtime"), ieee754 = require("../lib/ieee754"); var LongBits = util.LongBits, - ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + base64 = util.base64, + utf8 = util.utf8; +var ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; /** * Constructs a new writer operation instance. @@ -424,8 +426,8 @@ var writeBytes = ArrayImpl.prototype.set WriterPrototype.bytes = function write_bytes(value) { var len = value.length >>> 0; if (typeof value === 'string' && len) { - var buf = Writer.alloc(len = util.length64(value)); - util.decode64(value, buf, 0); + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); value = buf; } return len @@ -433,56 +435,15 @@ WriterPrototype.bytes = function write_bytes(value) { : this.push(writeByte, 1, 0); }; -function writeString(buf, pos, val) { - for (var i = 0; i < val.length; ++i) { - var c1 = val.charCodeAt(i), c2; - if (c1 < 128) { - buf[pos++] = c1; - } else if (c1 < 2048) { - 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); - ++i; - buf[pos++] = c1 >> 18 | 240; - buf[pos++] = c1 >> 12 & 63 | 128; - buf[pos++] = c1 >> 6 & 63 | 128; - buf[pos++] = c1 & 63 | 128; - } else { - buf[pos++] = c1 >> 12 | 224; - buf[pos++] = c1 >> 6 & 63 | 128; - buf[pos++] = c1 & 63 | 128; - } - } -} - -function byteLength(val) { - var strlen = val.length >>> 0; - 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 len; -} - /** * Writes a string. * @param {string} value Value to write * @returns {Writer} `this` */ WriterPrototype.string = function write_string(value) { - var len = byteLength(value); + var len = utf8.length(value); return len - ? this.uint32(len).push(writeString, len, value) + ? this.uint32(len).push(utf8.write, len, value) : this.push(writeByte, 1, 0); }; @@ -605,7 +566,7 @@ BufferWriterPrototype.double = function write_double_buffer(value) { function writeBytesBuffer(buf, pos, val) { if (val.length) val.copy(buf, pos, 0, val.length); -}; +} /** * @override @@ -623,13 +584,13 @@ 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); + utf8.write(buf, pos, val); else buf.utf8Write(val, pos); } : function writeString_buffer_write(buf, pos, val) { if (val.length < 40) - writeString(buf, pos, val); + utf8.write(buf, pos, val); else buf.write(val, pos); }; @@ -643,7 +604,7 @@ var writeStringBuffer = (function() { // eslint-disable-line wrap-iife */ BufferWriterPrototype.string = function write_string_buffer(value) { var len = value.length < 40 - ? byteLength(value) + ? utf8.length(value) : util.Buffer.byteLength(value); return len ? this.uint32(len).push(writeStringBuffer, len, value) diff --git a/tests/base64.js b/tests/base64.js index 8cddd1962..994caef0f 100644 --- a/tests/base64.js +++ b/tests/base64.js @@ -16,17 +16,17 @@ tape.test("base64", function(test) { Object.keys(strings).forEach(function(str) { var enc = strings[str]; - var len = protobuf.util.length64(enc); + var len = protobuf.util.base64.length(enc); test.equal(len, str.length, "should calculate '" + enc + "' as " + str.length + " bytes"); var buf = protobuf.util.newBuffer(len); - var len2 = protobuf.util.decode64(enc, buf, 0); + var len2 = protobuf.util.base64.decode(enc, buf, 0); test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes"); if (protobuf.util.isNode && protobuf.util.Buffer) test.equal(buf.toString("utf8"), str, "should decode '" + enc + "' to '" + str + "'"); - var enc2 = protobuf.util.encode64(buf, 0, buf.length); + var enc2 = protobuf.util.base64.encode(buf, 0, buf.length); test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'"); var writer = protobuf.Writer.create(); diff --git a/tests/basics.js b/tests/basics.js index 346a9d5e0..312ac3eff 100644 --- a/tests/basics.js +++ b/tests/basics.js @@ -49,7 +49,7 @@ tape.test("google.protobuf.Any type", function(test) { test.test("should encode (fallback)", function(test) { - writer = protobuf.codegen.encode.fallback.call(Any, any); + writer = protobuf.encode.call(Any, any); buf = writer.finish(); verifyEncode(test, buf); @@ -68,7 +68,7 @@ tape.test("google.protobuf.Any type", function(test) { test.test("should decode (fallback)", function(test) { - msg = protobuf.codegen.decode.fallback.call(Any, buf); + msg = protobuf.decode.call(Any, buf); test.deepEqual(msg, any, "an equal message"); diff --git a/types/protobuf.js.d.ts b/types/protobuf.js.d.ts index e1abcdd13..8e5aa170d 100644 --- a/types/protobuf.js.d.ts +++ b/types/protobuf.js.d.ts @@ -1,6 +1,6 @@ /* * protobuf.js v6.1.0 TypeScript definitions - * Generated Fri, 09 Dec 2016 22:46:53 UTC + * Generated Sat, 10 Dec 2016 23:00:30 UTC */ declare module "protobufjs" { @@ -70,73 +70,56 @@ declare module "protobufjs" { } /** - * A message decoder as generated by {@link codegen.decode.generate}. - * @typedef Decoder - * @type {function} + * Provides common type definitions. + * Can also be used to provide additional google types or your own custom types. + * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name + * @param {Object} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition + * @returns {undefined} + * @property {Object} google/protobuf/any.proto Any + * @property {Object} google/protobuf/duration.proto Duration + * @property {Object} google/protobuf/empty.proto Empty + * @property {Object} google/protobuf/struct.proto Struct, Value, NullValue and ListValue + * @property {Object} google/protobuf/timestamp.proto Timestamp + */ + function common(name: string, json: Object): void; + + /** + * General purpose message decoder. * @param {Reader|Uint8Array} readerOrBuffer Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand * @returns {Message} Populated runtime message * @this Type + * @property {GenerateDecoder} generate Generates a type specific decoder */ - type Decoder = (readerOrBuffer: (Reader|Uint8Array), length?: number) => Message; + function decode(readerOrBuffer: (Reader|Uint8Array), length?: number): Message; /** - * A message encoder as generated by {@link codegen.encode.generate}. - * @typedef Encoder + * Generates a decoder specific to the specified message type. + * @typedef GenerateDecoder * @type {function} + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ + type GenerateDecoder = (mtype: Type) => Codegen; + + /** + * General purpose message encoder. * @param {Message|Object} message Runtime message or plain object to encode * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer * @this Type + * @property {GenerateEncoder} generate Generates a type specific encoder */ - type Encoder = (message: (Message|Object), writer?: Writer) => Writer; + function encode(message: (Message|Object), writer?: Writer): Writer; /** - * A message verifier as generated by {@link codegen.verify.generate}. - * @typedef Verifier + * Generates an {@link Encoder|encoder} specific to the specified message type. + * @typedef GenerateEncoder * @type {function} - * @param {Message|Object} message Runtime message or plain object to verify - * @returns {?string} `null` if valid, otherwise the reason why it is not - * @this {Type} - */ - type Verifier = (message: (Message|Object)) => string; - - /** - * A closure for generating functions programmatically. - * @namespace - * @function - * @param {...string} params Function parameter names + * @param {Type} mtype Message type * @returns {Codegen} Codegen instance - * @property {boolean} supported Whether code generation is supported by the environment. - * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging. */ - function codegen(params: string): Codegen; - - /** - * A codegen instance as returned by {@link codegen}, that also is a {@link util.sprintf|sprintf}-like appender function. - * @typedef Codegen - * @type {function} - * @param {string} format Format string - * @param {...*} args Replacements - * @returns {Codegen} Itself - * @property {function(string=):string} str Stringifies the so far generated function source. - * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope. - */ - type Codegen = (format: string, args: any) => Codegen; - - /** - * Provides common type definitions. - * Can also be used to provide additional google types or your own custom types. - * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name - * @param {Object} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition - * @returns {undefined} - * @property {Object} google/protobuf/any.proto Any - * @property {Object} google/protobuf/duration.proto Duration - * @property {Object} google/protobuf/empty.proto Empty - * @property {Object} google/protobuf/struct.proto Struct, Value, NullValue and ListValue - * @property {Object} google/protobuf/timestamp.proto Timestamp - */ - function common(name: string, json: Object): void; + type GenerateEncoder = (mtype: Type) => Codegen; /** * Constructs a new enum instance. @@ -1292,7 +1275,7 @@ declare module "protobufjs" { constructor(rpcImpl: RPCImpl); /** - * RPC implementation. Becomes `null` when the service is ended. + * RPC implementation. Becomes `null` once the service is ended. * @type {?RPCImpl} */ $rpc: RPCImpl; @@ -1615,6 +1598,18 @@ declare module "protobufjs" { } + /** + * A codegen instance as returned by {@link codegen}, that also is a sprintf-like appender function. + * @typedef Codegen + * @type {function} + * @param {string} format Format string + * @param {...*} args Replacements + * @returns {Codegen} Itself + * @property {function(string=):string} str Stringifies the so far generated function source. + * @property {function(string=, Object=):function} eof Ends generation and builds the function whilst applying a scope. + */ + type Codegen = (format: string, args: any) => Codegen; + /** * Any compatible Long instance. * @typedef Long @@ -1630,11 +1625,77 @@ declare module "protobufjs" { } + /** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + type PoolAllocator = (size: number) => Uint8Array; + + /** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + type PoolSlicer = (start: number, end: number) => Uint8Array; + /** * Various utility functions. * @namespace */ module util { + /** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ + module base64 { + /** + * Calculates the base64 byte length of a string. + * @param {string} str Base64 encoded string + * @returns {number} Byte length + */ + function length(str: string): number; + + /** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ + function encode(buffer: Uint8Array, start: number, end: number): string; + + /** + * Decodes a base64 encoded string to a buffer. + * @param {string} src Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ + function decode(src: string, buffer: Uint8Array, offset: number): number; + + } + + /** + * A closure for generating functions programmatically. + * @memberof util + * @namespace + * @function + * @param {...string} params Function parameter names + * @returns {Codegen} Codegen instance + * @property {boolean} supported Whether code generation is supported by the environment. + * @property {boolean} verbose=false When set to true, codegen will log generated code to console. Useful for debugging. + */ + function codegen(params: string): Codegen; + /** * Constructs a new event emitter instance. * @classdesc A minimal event emitter. @@ -1777,15 +1838,15 @@ declare module "protobufjs" { } /** - * A drop-in buffer pool, similar in functionality to what node uses for buffers. + * A general purpose buffer pool. * @memberof util * @function - * @param {function(number):Uint8Array} alloc Allocator - * @param {function(number, number):Uint8Array} slice Slicer + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer * @param {number} [size=8192] Slab size - * @returns {function(number):Uint8Array} Pooled allocator + * @returns {PoolAllocator} Pooled allocator */ - function pool(alloc: (() => any), slice: (() => any), size?: number): (() => any); + function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; /** * Whether running within node or not. @@ -1883,6 +1944,39 @@ declare module "protobufjs" { */ var emptyObject: Object; + /** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ + module utf8 { + /** + * Calculates the UTF8 byte length of a string. + * @param {string} str String + * @returns {number} Byte length + */ + function length(str: string): number; + + /** + * Writes a string as UTF8 bytes. + * @param {Uint8Array} buf Destination buffer + * @param {number} pos Destination offset + * @param {string} str Source string + * @returns {number} Bytes written + */ + function write(buf: Uint8Array, pos: number, str: string): number; + + /** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source offset + * @param {number} len Source length + * @returns {string} String read + */ + function read(buf: Uint8Array, pos: number, len: number): string; + + } + /** * Converts an object's values to an array. * @param {Object.} object Object to convert @@ -1957,14 +2051,6 @@ declare module "protobufjs" { */ function safeProp(prop: string): string; - /** - * Minimalistic sprintf. - * @param {string} format Format string - * @param {...*} args Replacements - * @returns {string} Formatted string - */ - function sprintf(format: string, args: any): string; - /** * Converts a string to camel case notation. * @param {string} str String to convert @@ -1998,6 +2084,24 @@ declare module "protobufjs" { */ type FetchCallback = (error?: Error, contents?: string) => void; + /** + * General purpose message verifier. + * @param {Message|Object} message Runtime message or plain object to verify + * @returns {?string} `null` if valid, otherwise the reason why it is not + * @this {Type} + * @property {GenerateVerifier} generate Generates a type specific verifier + */ + function verify(message: (Message|Object)): string; + + /** + * Generates a verifier specific to the specified message type. + * @typedef GenerateVerifier + * @type {function} + * @param {Type} mtype Message type + * @returns {Codegen} Codegen instance + */ + type GenerateVerifier = (mtype: Type) => Codegen; + /** * Constructs a new writer instance. * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. @@ -2167,10 +2271,10 @@ declare module "protobufjs" { /** * Writes a sequence of bytes. - * @param {Uint8Array} value Value to write + * @param {Uint8Array|string} value Buffer or base64 encoded string to write * @returns {Writer} `this` */ - bytes(value: Uint8Array): Writer; + bytes(value: (Uint8Array|string)): Writer; /** * Writes a string.