From f1370ff5b0db2ebb73b975a3d7c7bd5b901cbfac Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Thu, 8 Dec 2016 17:21:58 +0100 Subject: [PATCH] More refactoring; Initial RPC service implementaion, see #529 --- bench/prof.js | 10 +- dist/protobuf.js | 287 ++++++++++++++++++++++++++------------- dist/protobuf.js.map | 2 +- dist/protobuf.min.js | 6 +- dist/protobuf.min.js.gz | Bin 16517 -> 16710 bytes dist/protobuf.min.js.map | 2 +- package.json | 14 +- scripts/rpc-test.js | 74 ++++++++++ src/index.js | 1 + src/prototype.js | 9 +- src/rpc.js | 9 ++ src/rpc/service.js | 81 +++++++++++ src/service.js | 35 ++--- src/writer.js | 6 +- types/protobuf.js.d.ts | 80 +++++++++-- 15 files changed, 472 insertions(+), 144 deletions(-) create mode 100644 scripts/rpc-test.js create mode 100644 src/rpc.js create mode 100644 src/rpc/service.js diff --git a/bench/prof.js b/bench/prof.js index 12313db05..72f0d4c28 100644 --- a/bench/prof.js +++ b/bench/prof.js @@ -1,5 +1,5 @@ -var fs = require("fs"), - path = require("path"); +var fs = require("fs"), + path = require("path"); // A profiling stub to measure encoding / decoding performance using benchmark data. @@ -14,7 +14,7 @@ if (process.execArgv.indexOf("--prof") < 0) { console.log("cleaning up old logs ..."); var child_process = require("child_process"); var logRe = /^isolate\-[0-9A-F]+\-v8\.log$/; - fs.readdirSync(process.cwd()).forEach(function(file) { + fs.readdirSync(process.cwd()).forEach(function readdirSync_it(file) { if (logRe.test(file)) fs.unlink(file); }); @@ -24,13 +24,13 @@ if (process.execArgv.indexOf("--prof") < 0) { stdio: 'inherit' }); console.log("processing profile ..."); - fs.readdirSync(process.cwd()).forEach(function(file) { + fs.readdirSync(process.cwd()).forEach(function readdirSync_it(file) { if (logRe.test(file)) { child_process.execSync("node --prof-process " + file, { cwd: process.cwd(), stdio: 'inherit' }); - fs.unlink(file); + // fs.unlink(file); } }); console.log("done."); diff --git a/dist/protobuf.js b/dist/protobuf.js index e4ee05f42..1ccfa17c2 100644 --- a/dist/protobuf.js +++ b/dist/protobuf.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.1.0 (c) 2016 Daniel Wirtz - * Compiled Thu, 08 Dec 2016 13:23:47 UTC + * Compiled Thu, 08 Dec 2016 16:19:10 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ @@ -128,7 +128,7 @@ exports.write = function writeIEEE754(buffer, value, offset, isBE, mLen, nBytes) "use strict"; module.exports = codegen; -var util = require(23); +var util = require(25); var blockOpenRe = /[{[]$/, blockCloseRe = /^[}\]]/, @@ -243,7 +243,7 @@ codegen.encode = require(4); codegen.decode = require(3); codegen.verify = require(5); -},{"23":23,"3":3,"4":4,"5":5}],3:[function(require,module,exports){ +},{"25":25,"3":3,"4":4,"5":5}],3:[function(require,module,exports){ "use strict"; /** @@ -255,8 +255,8 @@ var decode = exports; var Enum = require(7), Reader = require(17), - types = require(22), - util = require(23), + types = require(24), + util = require(25), codegen = require(2); /** @@ -421,7 +421,7 @@ decode.generate = function decode_generate(mtype) { /* eslint-enable no-unexpected-multiline */ }; -},{"17":17,"2":2,"22":22,"23":23,"7":7}],4:[function(require,module,exports){ +},{"17":17,"2":2,"24":24,"25":25,"7":7}],4:[function(require,module,exports){ "use strict"; /** @@ -432,9 +432,9 @@ decode.generate = function decode_generate(mtype) { var encode = exports; var Enum = require(7), - Writer = require(27), - types = require(22), - util = require(23), + Writer = require(29), + types = require(24), + util = require(25), codegen = require(2); /** @@ -612,7 +612,7 @@ encode.generate = function encode_generate(mtype) { /* eslint-enable no-unexpected-multiline */ }; -},{"2":2,"22":22,"23":23,"27":27,"7":7}],5:[function(require,module,exports){ +},{"2":2,"24":24,"25":25,"29":29,"7":7}],5:[function(require,module,exports){ "use strict"; /** @@ -623,8 +623,8 @@ encode.generate = function encode_generate(mtype) { var verify = exports; var Enum = require(7), - Type = require(21), - util = require(23), + Type = require(23), + util = require(25), codegen = require(2); /** @@ -705,7 +705,7 @@ verify.generate = function verify_generate(mtype) { /* eslint-enable no-unexpected-multiline */ }; -},{"2":2,"21":21,"23":23,"7":7}],6:[function(require,module,exports){ +},{"2":2,"23":23,"25":25,"7":7}],6:[function(require,module,exports){ "use strict"; module.exports = common; @@ -846,7 +846,7 @@ var ReflectionObject = require(13); /** @alias Enum.prototype */ var EnumPrototype = ReflectionObject.extend(Enum); -var util = require(23); +var util = require(25); var _TypeError = util._TypeError; @@ -979,7 +979,7 @@ EnumPrototype.remove = function(name) { return clearCache(this); }; -},{"13":13,"23":23}],8:[function(require,module,exports){ +},{"13":13,"25":25}],8:[function(require,module,exports){ "use strict"; module.exports = Field; @@ -987,11 +987,11 @@ var ReflectionObject = require(13); /** @alias Field.prototype */ var FieldPrototype = ReflectionObject.extend(Field); -var Type = require(21), +var Type = require(23), Enum = require(7), MapField = require(10), - types = require(22), - util = require(23); + types = require(24), + util = require(25); var _TypeError = util._TypeError; @@ -1253,13 +1253,13 @@ FieldPrototype.jsonConvert = function(value, options) { return value; }; -},{"10":10,"13":13,"21":21,"22":22,"23":23,"7":7}],9:[function(require,module,exports){ +},{"10":10,"13":13,"23":23,"24":24,"25":25,"7":7}],9:[function(require,module,exports){ "use strict"; module.exports = inherits; var Prototype = require(16), - Type = require(21), - util = require(23); + Type = require(23), + util = require(25); var _TypeError = util._TypeError; @@ -1450,7 +1450,7 @@ inherits.defineProperties = function defineProperties(prototype, type) { return prototype; }; -},{"16":16,"21":21,"23":23}],10:[function(require,module,exports){ +},{"16":16,"23":23,"25":25}],10:[function(require,module,exports){ "use strict"; module.exports = MapField; @@ -1461,8 +1461,8 @@ var FieldPrototype = Field.prototype; var MapFieldPrototype = Field.extend(MapField); var Enum = require(7), - types = require(22), - util = require(23); + types = require(24), + util = require(25); /** * Constructs a new map field. @@ -1548,7 +1548,7 @@ MapFieldPrototype.resolve = function resolve() { return FieldPrototype.resolve.call(this); }; -},{"22":22,"23":23,"7":7,"8":8}],11:[function(require,module,exports){ +},{"24":24,"25":25,"7":7,"8":8}],11:[function(require,module,exports){ "use strict"; module.exports = Method; @@ -1556,8 +1556,8 @@ var ReflectionObject = require(13); /** @alias Method.prototype */ var MethodPrototype = ReflectionObject.extend(Method); -var Type = require(21), - util = require(23); +var Type = require(23), + util = require(25); var _TypeError = util._TypeError; @@ -1685,7 +1685,7 @@ MethodPrototype.resolve = function resolve() { return ReflectionObject.prototype.resolve.call(this); }; -},{"13":13,"21":21,"23":23}],12:[function(require,module,exports){ +},{"13":13,"23":23,"25":25}],12:[function(require,module,exports){ "use strict"; module.exports = Namespace; @@ -1694,10 +1694,10 @@ var ReflectionObject = require(13); var NamespacePrototype = ReflectionObject.extend(Namespace); var Enum = require(7), - Type = require(21), + Type = require(23), Field = require(8), - Service = require(19), - util = require(23); + Service = require(21), + util = require(25); var _TypeError = util._TypeError; @@ -1956,14 +1956,14 @@ NamespacePrototype.lookup = function lookup(path, parentAlreadyChecked) { return this.parent.lookup(path); }; -},{"13":13,"19":19,"21":21,"23":23,"7":7,"8":8}],13:[function(require,module,exports){ +},{"13":13,"21":21,"23":23,"25":25,"7":7,"8":8}],13:[function(require,module,exports){ "use strict"; module.exports = ReflectionObject; ReflectionObject.extend = extend; var Root = require(18), - util = require(23); + util = require(25); var _TypeError = util._TypeError; @@ -2155,7 +2155,7 @@ ReflectionObjectPrototype.toString = function toString() { return this.constructor.name + " " + this.getFullName(); }; -},{"18":18,"23":23}],14:[function(require,module,exports){ +},{"18":18,"25":25}],14:[function(require,module,exports){ "use strict"; module.exports = OneOf; @@ -2164,7 +2164,7 @@ var ReflectionObject = require(13); var OneOfPrototype = ReflectionObject.extend(OneOf); var Field = require(8), - util = require(23); + util = require(25); var _TypeError = util._TypeError; @@ -2308,21 +2308,21 @@ OneOfPrototype.onRemove = function onRemove(parent) { ReflectionObject.prototype.onRemove.call(this, parent); }; -},{"13":13,"23":23,"8":8}],15:[function(require,module,exports){ +},{"13":13,"25":25,"8":8}],15:[function(require,module,exports){ "use strict"; module.exports = parse; -var tokenize = require(20), +var tokenize = require(22), Root = require(18), - Type = require(21), + Type = require(23), Field = require(8), MapField = require(10), OneOf = require(14), Enum = require(7), - Service = require(19), + Service = require(21), Method = require(11), - types = require(22), - util = require(23); + types = require(24), + util = require(25); var camelCase = util.camelCase; var nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, @@ -2864,7 +2864,7 @@ function parse(source, root) { }; } -},{"10":10,"11":11,"14":14,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"7":7,"8":8}],16:[function(require,module,exports){ +},{"10":10,"11":11,"14":14,"18":18,"21":21,"22":22,"23":23,"24":24,"25":25,"7":7,"8":8}],16:[function(require,module,exports){ "use strict"; module.exports = Prototype; @@ -2900,11 +2900,12 @@ function Prototype(properties) { * @returns {Object.} JSON object */ Prototype.prototype.asJSON = function asJSON(options) { - var any = !(options && options.fieldsOnly), - fields = this.constructor.$type.fields, + if (!options) + options = {}; + var fields = this.constructor.$type.fields, json = {}; var keys; - if (options && options.defaults) { + if (options.defaults) { keys = []; for (var k in this) // eslint-disable-line guard-for-in keys.push(k); @@ -2923,7 +2924,7 @@ Prototype.prototype.asJSON = function asJSON(options) { } } else json[key] = field.jsonConvert(value, options); - } else if (any) + } else if (!options.fieldsOnly) json[key] = value; } return json; @@ -2935,7 +2936,7 @@ module.exports = Reader; Reader.BufferReader = BufferReader; -var util = require(26), +var util = require(28), ieee754 = require(1); var LongBits = util.LongBits, ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; @@ -3562,7 +3563,7 @@ BufferReaderPrototype.finish = function finish_buffer(buffer) { configure(); -},{"1":1,"26":26}],18:[function(require,module,exports){ +},{"1":1,"28":28}],18:[function(require,module,exports){ "use strict"; module.exports = Root; @@ -3571,7 +3572,7 @@ var Namespace = require(12); var RootPrototype = Namespace.extend(Root); var Field = require(8), - util = require(23), + util = require(25), common = require(6); /** @@ -3812,7 +3813,101 @@ RootPrototype.toString = function toString() { return this.constructor.name; }; -},{"12":12,"15":15,"23":23,"6":6,"8":8}],19:[function(require,module,exports){ +},{"12":12,"15":15,"25":25,"6":6,"8":8}],19:[function(require,module,exports){ +"use strict"; + +/** + * RPC helpers. + * @namespace + */ +var rpc = exports; + +rpc.Service = require(20); + +},{"20":20}],20:[function(require,module,exports){ +"use strict"; +module.exports = Service; + +/** + * Constructs a new RPC service. + * @classdesc An RPC service as returned by {@link Service#create}. + * @memberof rpc + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + */ +function Service(rpcImpl) { + + /** + * RPC implementation. + * @type {RPCImpl} + */ + this.$rpc = rpcImpl; + + /** + * Service listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** @alias rpc.Service.prototype */ +var ServicePrototype = Service.prototype; + +/** + * Registers an event listener. + * @param {string} evt Event name, one of `"data"`, `"error"`, `"end"` + * @param {function} cb Listener + * @returns {rpc.Service} `this` + */ +ServicePrototype.on = function on(evt, cb) { + (this._listeners[evt] || (this._listeners[evt] = [])).push(cb); + return this; +}; + +/** + * Removes an event listener. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [cb] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {rpc.Service} `this` + */ +ServicePrototype.off = function off(evt, cb) { + if (evt) { + if (cb) { + var p = (this._listeners[evt] || []).indexOf(cb); + if (p > -1) + this._listeners[evt].splice(p, 1); + } else + this._listeners[evt] = []; + } else + this._listeners = {}; + return this; +}; + +/** + * Emits an event. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {rpc.Service} `this` + */ +ServicePrototype.emit = function emit(evt) { + if (this._listeners[evt]) { + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < this._listeners[evt].length; ++i) + this._listeners[evt][i].apply(this, args); + } + return this; +}; + +/** + * Ends this service and emits the `end` event. + * @returns {rpc.Service} `this` + */ +ServicePrototype.end = function end() { + return this.emit('end').off(); +}; + +},{}],21:[function(require,module,exports){ "use strict"; module.exports = Service; @@ -3823,7 +3918,8 @@ var NamespacePrototype = Namespace.prototype; var ServicePrototype = Namespace.extend(Service); var Method = require(11), - util = require(23); + util = require(25), + rpc = require(19); /** * Constructs a new service. @@ -3957,25 +4053,22 @@ ServicePrototype.remove = function remove(object) { /** * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. * @typedef RPCImpl - * @function + * @type {function} * @param {Method} method Reflected method being called * @param {Uint8Array} requestData Request data - * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data + * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream. * @returns {undefined} */ /** * Creates a runtime service using the specified rpc implementation. - * @param {function(Method, Uint8Array, function)} rpc RPC implementation ({@link RPCImpl|see}) + * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see}) * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Object} Runtime service + * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed. */ -ServicePrototype.create = function create(rpc, requestDelimited, responseDelimited) { - var rpcService = {}; - util.prop(rpcService, "$rpc", { - value: rpc - }); +ServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl); this.getMethodsArray().forEach(function(method) { var lcName = method.name.substring(0, 1).toLowerCase() + method.name.substring(1); rpcService[lcName] = function(request, callback) { @@ -3989,26 +4082,31 @@ ServicePrototype.create = function create(rpc, requestDelimited, responseDelimit } // Calls the custom RPC implementation with the reflected method and binary request data // and expects the rpc implementation to call its callback with the binary response data. - rpc(method, requestData, function(err, responseData) { + rpcImpl(method, requestData, function(err, responseData) { if (err) { - callback(err); - return; + rpcService.emit('error', err); + return callback ? callback(err) : undefined; + } + if (responseData === null) { + rpcService.emit('end'); + return undefined; } var response; try { response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData); } catch (err2) { - callback(err2); - return; + rpcService.emit('error', err2); + return callback ? callback('error', err2) : undefined; } - callback(null, response); + rpcService.emit('data', response); + return callback ? callback(null, response) : undefined; }); }; }); return rpcService; }; -},{"11":11,"12":12,"23":23}],20:[function(require,module,exports){ +},{"11":11,"12":12,"19":19,"25":25}],22:[function(require,module,exports){ "use strict"; module.exports = tokenize; @@ -4215,7 +4313,7 @@ function tokenize(source) { }; /* eslint-enable default-case, callback-return */ } -},{}],21:[function(require,module,exports){ +},{}],23:[function(require,module,exports){ "use strict"; module.exports = Type; @@ -4228,12 +4326,12 @@ var TypePrototype = Namespace.extend(Type); var Enum = require(7), OneOf = require(14), Field = require(8), - Service = require(19), + Service = require(21), Prototype = require(16), Reader = require(17), - Writer = require(27), + Writer = require(29), inherits = require(9), - util = require(23), + util = require(25), codegen = require(2); /** @@ -4628,7 +4726,7 @@ TypePrototype.verify = function verify(message) { ).call(this, message); }; -},{"12":12,"14":14,"16":16,"17":17,"19":19,"2":2,"23":23,"27":27,"7":7,"8":8,"9":9}],22:[function(require,module,exports){ +},{"12":12,"14":14,"16":16,"17":17,"2":2,"21":21,"25":25,"29":29,"7":7,"8":8,"9":9}],24:[function(require,module,exports){ "use strict"; /** @@ -4637,7 +4735,7 @@ TypePrototype.verify = function verify(message) { */ var types = exports; -var util = require(23); +var util = require(25); var s = [ "double", // 0 @@ -4759,7 +4857,7 @@ types.packed = bake([ /* bool */ 0 ]); -},{"23":23}],23:[function(require,module,exports){ +},{"25":25}],25:[function(require,module,exports){ "use strict"; /** @@ -5029,14 +5127,14 @@ util.newBuffer = function newBuffer(size) { }; // Merge in runtime utility -util.merge(util, require(26)); +util.merge(util, require(28)); -},{"26":26}],24:[function(require,module,exports){ +},{"28":28}],26:[function(require,module,exports){ "use strict"; module.exports = LongBits; -var util = require(23); +var util = require(25); /** * Any compatible Long instance. @@ -5229,7 +5327,7 @@ LongBitsPrototype.length = function length() { return part2 < 1 << 7 ? 9 : 10; }; -},{"23":23}],25:[function(require,module,exports){ +},{"25":25}],27:[function(require,module,exports){ "use strict"; module.exports = pool; @@ -5261,15 +5359,15 @@ function pool(alloc, slice, size) { }; } -},{}],26:[function(require,module,exports){ +},{}],28:[function(require,module,exports){ (function (global){ "use strict"; var util = exports; -var LongBits = util.LongBits = require(24); +var LongBits = util.LongBits = require(26); -util.pool = require(25); +util.pool = require(27); /** * Whether running within node or not. @@ -5391,13 +5489,13 @@ util.emptyObject = Object.freeze({}); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"24":24,"25":25,"buffer":"buffer","long":"long"}],27:[function(require,module,exports){ +},{"26":26,"27":27,"buffer":"buffer","long":"long"}],29:[function(require,module,exports){ "use strict"; module.exports = Writer; Writer.BufferWriter = BufferWriter; -var util = require(26), +var util = require(28), ieee754 = require(1); var LongBits = util.LongBits, ArrayImpl = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; @@ -5629,7 +5727,7 @@ function writeVarint64(buf, pos, val) { } while (val.lo > 127) { buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.lo = val.lo >>> 7; } buf[pos++] = val.lo; } @@ -5875,7 +5973,7 @@ WriterPrototype.string = function write_string(value) { /** * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#ldelim}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state. + * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state. * @returns {Writer} `this` */ WriterPrototype.fork = function fork() { @@ -5904,7 +6002,7 @@ WriterPrototype.reset = function reset() { /** * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @param {number} [id] Id with wire type 2 to prepend where applicable + * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable * @returns {Writer} `this` */ WriterPrototype.ldelim = function ldelim(id) { @@ -6037,7 +6135,7 @@ BufferWriterPrototype.string = function write_string_buffer(value) { : this.push(writeByte, 1, 0); }; -},{"1":1,"26":26}],28:[function(require,module,exports){ +},{"1":1,"28":28}],30:[function(require,module,exports){ (function (global){ "use strict"; var protobuf = global.protobuf = exports; @@ -6087,11 +6185,11 @@ function load(filename, root, callback) { protobuf.load = load; // Parser -protobuf.tokenize = require(20); +protobuf.tokenize = require(22); protobuf.parse = require(15); // Serialization -protobuf.Writer = require(27); +protobuf.Writer = require(29); protobuf.BufferWriter = protobuf.Writer.BufferWriter; protobuf.Reader = require(17); protobuf.BufferReader = protobuf.Reader.BufferReader; @@ -6102,11 +6200,11 @@ protobuf.ReflectionObject = require(13); protobuf.Namespace = require(12); protobuf.Root = require(18); protobuf.Enum = require(7); -protobuf.Type = require(21); +protobuf.Type = require(23); protobuf.Field = require(8); protobuf.OneOf = require(14); protobuf.MapField = require(10); -protobuf.Service = require(19); +protobuf.Service = require(21); protobuf.Method = require(11); // Runtime @@ -6114,9 +6212,10 @@ protobuf.Prototype = require(16); protobuf.inherits = require(9); // Utility -protobuf.types = require(22); +protobuf.types = require(24); protobuf.common = require(6); -protobuf.util = require(23); +protobuf.rpc = require(19); +protobuf.util = require(25); // Be nice to AMD if (typeof define === 'function' && define.amd) @@ -6130,7 +6229,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,"20":20,"21":21,"22":22,"23":23,"27":27,"6":6,"7":7,"8":8,"9":9}]},{},[28]) +},{"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,"29":29,"6":6,"7":7,"8":8,"9":9}]},{},[30]) //# sourceMappingURL=protobuf.js.map diff --git a/dist/protobuf.js.map b/dist/protobuf.js.map index 9393b77b9..347369418 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/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/inherits.js","src/mapfield.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/prototype.js","src/reader.js","src/root.js","src/service.js","src/tokenize.js","src/type.js","src/types.js","src/util.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;;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;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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 = codegen;\r\n\r\nvar util = require(23);\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 {CodegenInstance} 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 CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} 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(4);\r\ncodegen.decode = require(3);\r\ncodegen.verify = require(5);\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(7),\r\n Reader = require(17),\r\n types = require(22),\r\n util = require(23),\r\n codegen = require(2);\r\n\r\n/**\r\n * Decodes a message of `this` message's 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 {Prototype} 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 decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link 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(13);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(21),\r\n Enum = require(7),\r\n MapField = require(10),\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. 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.role, 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 Prototype#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 = inherits;\r\n\r\nvar Prototype = require(16),\r\n Type = require(21),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Options passed to {@link inherits}, modifying its behavior.\r\n * @typedef InheritanceOptions\r\n * @type {Object}\r\n * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor\r\n * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type\r\n */\r\n\r\n/**\r\n * Inherits a custom class from the message prototype of the specified message type.\r\n * @param {*} clazz Inheriting class constructor\r\n * @param {Type} type Inherited message type\r\n * @param {InheritanceOptions} [options] Inheritance options\r\n * @returns {Prototype} Created prototype\r\n */\r\nfunction inherits(clazz, type, options) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"clazz\", \"a function\");\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n if (!options)\r\n options = {};\r\n\r\n /**\r\n * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library.\r\n * @name Class\r\n * @extends Prototype\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set on the message\r\n * @see {@link inherits}\r\n */\r\n\r\n var classProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Class.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n if (!options.noStatics)\r\n util.merge(classProperties, {\r\n\r\n /**\r\n * Encodes a message of this type to a buffer.\r\n * @name Class.encode\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encode: {\r\n value: function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Encodes a message of this type preceeded by its length as a varint to a buffer.\r\n * @name Class.encodeDelimited\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encodeDelimited: {\r\n value: function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type from a buffer.\r\n * @name Class.decode\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decode: {\r\n value: function decode(buffer) {\r\n return this.$type.decode(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type preceeded by its length as a varint from a buffer.\r\n * @name Class.decodeDelimited\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decodeDelimited: {\r\n value: function decodeDelimited(buffer) {\r\n return this.$type.decodeDelimited(buffer);\r\n }\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 {Prototype|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 verify: {\r\n value: function verify(message) {\r\n return this.$type.verify(message);\r\n }\r\n }\r\n\r\n }, true);\r\n\r\n util.props(clazz, classProperties);\r\n var prototype = inherits.defineProperties(new Prototype(), type);\r\n clazz.prototype = prototype;\r\n prototype.constructor = clazz;\r\n\r\n if (!options.noRegister)\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Defines the reflected type's default values and virtual oneof properties on the specified prototype.\r\n * @memberof inherits\r\n * @param {Prototype} prototype Prototype to define properties upon\r\n * @param {Type} type Reflected message type\r\n * @returns {Prototype} The specified prototype\r\n */\r\ninherits.defineProperties = function defineProperties(prototype, type) {\r\n\r\n var prototypeProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Prototype#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n // Initialize default values\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 // Define each oneof with a non-enumerable getter and setter for the present 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 util.props(prototype, prototypeProperties);\r\n return prototype;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(8);\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(7),\r\n types = require(22),\r\n util = require(23);\r\n\r\n/**\r\n * Constructs a new map field.\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 = Method;\r\n\r\nvar ReflectionObject = require(13);\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.\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(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(7),\r\n Type = require(21),\r\n Field = require(8),\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.\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(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object.\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} Prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var proto = constructor.prototype = Object.create(this.prototype);\r\n proto.constructor = constructor;\r\n constructor.extend = extend;\r\n return proto;\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(13);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(8),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof.\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(18),\r\n Type = require(21),\r\n Field = require(8),\r\n MapField = require(10),\r\n OneOf = require(14),\r\n Enum = require(7),\r\n Service = require(19),\r\n Method = require(11),\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 default-case, 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 = Prototype;\r\n\r\n/**\r\n * Constructs a new prototype.\r\n * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`.\r\n * @classdesc Runtime message prototype ready to be extended by custom classes or generated code.\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link inherits}\r\n * @see {@link Class}\r\n */\r\nfunction Prototype(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/**\r\n * Converts a runtime 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\nPrototype.prototype.asJSON = function asJSON(options) {\r\n var any = !(options && options.fieldsOnly),\r\n fields = this.constructor.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options && 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 (any)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(26),\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 * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\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\n/**\r\n * Constructs a new reader 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.\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\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(8),\r\n util = require(23),\r\n common = require(6);\r\n\r\n/**\r\n * Constructs a new root namespace.\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/**\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 {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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 // 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(15)(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 (!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 ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\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 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 (!queued)\r\n finish(null);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\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\nmodule.exports = Service;\r\n\r\nvar Namespace = require(12);\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(11),\r\n util = require(23);\r\n\r\n/**\r\n * Constructs a new service.\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 * @function\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data\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)} rpc 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 {Object} Runtime service\r\n */\r\nServicePrototype.create = function create(rpc, requestDelimited, responseDelimited) {\r\n var rpcService = {};\r\n util.prop(rpcService, \"$rpc\", {\r\n value: rpc\r\n });\r\n this.getMethodsArray().forEach(function(method) {\r\n var lcName = method.name.substring(0, 1).toLowerCase() + method.name.substring(1);\r\n rpcService[lcName] = function(request, callback) {\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 rpc(method, requestData, function(err, responseData) {\r\n if (err) {\r\n callback(err);\r\n return;\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 callback(err2);\r\n return;\r\n }\r\n callback(null, response);\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 default-case, 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 default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(12);\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(7),\r\n OneOf = require(14),\r\n Field = require(8),\r\n Service = require(19),\r\n Prototype = require(16),\r\n Reader = require(17),\r\n Writer = require(27),\r\n inherits = require(9),\r\n util = require(23),\r\n codegen = require(2);\r\n\r\n/**\r\n * Constructs a new message type.\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 {Prototype}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n if (this._ctor)\r\n return this._ctor;\r\n var ctor;\r\n if (codegen.supported)\r\n ctor = codegen(\"p\")(\"P.call(this,p)\").eof(this.getFullName() + \"$ctor\", {\r\n P: Prototype\r\n });\r\n else\r\n ctor = function GenericMessage(properties) {\r\n Prototype.call(this, properties);\r\n };\r\n ctor.prototype = inherits(ctor, this);\r\n this._ctor = ctor;\r\n return ctor;\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\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 * @param {*} [ctor] Constructor to use.\r\n * Defaults to use the internal constuctor.\r\n * @returns {Prototype} Message instance\r\n */\r\nTypePrototype.create = function create(properties, ctor) {\r\n if (!properties || typeof properties === 'function') {\r\n ctor = properties;\r\n properties = undefined;\r\n } else if (properties /* already */ instanceof Prototype)\r\n return properties;\r\n if (ctor) {\r\n if (!(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n } else\r\n ctor = this.getCtor();\r\n return new ctor(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Prototype|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 {Prototype|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).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 {Prototype} 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 {Prototype} 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 enum values are valid and that any required fields are present.\r\n * @param {Prototype|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 })\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(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 * Utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\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 * 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 * 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 * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\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 try {\r\n // Hide this from webpack. There is probably another, better way.\r\n return eval(['req','uire'].join(''))(\"fs\") // eslint-disable-line no-eval\r\n .readFile(path, \"utf8\", callback);\r\n } catch (e) { } // eslint-disable-line no-empty\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 (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\n// Merge in runtime utility\r\nutil.merge(util, require(26));\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 * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\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 new util.Long(this.lo, this.hi, 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 * 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\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(26),\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.\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.\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.\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 | val.hi << 25) >>> 0;\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.hi).push(writeFixed32, 4, bits.lo);\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.hi).push(writeFixed32, 4, bits.lo);\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\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\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} value Value 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 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#ldelim}, {@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 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.\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 // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\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 * 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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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:function):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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\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// 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\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.Prototype = require(\"./prototype\");\r\nprotobuf.inherits = require(\"./inherits\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.util = require(\"./util\");\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 protobuf.Reader.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/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/inherits.js","src/mapfield.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/prototype.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/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;;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;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxPA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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 = 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 {CodegenInstance} 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 CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} 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(4);\r\ncodegen.decode = require(3);\r\ncodegen.verify = require(5);\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(7),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Decodes a message of `this` message's 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 {Prototype} 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 decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link 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(13);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(7),\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. 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.role, 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 Prototype#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 = inherits;\r\n\r\nvar Prototype = require(16),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Options passed to {@link inherits}, modifying its behavior.\r\n * @typedef InheritanceOptions\r\n * @type {Object}\r\n * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor\r\n * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type\r\n */\r\n\r\n/**\r\n * Inherits a custom class from the message prototype of the specified message type.\r\n * @param {*} clazz Inheriting class constructor\r\n * @param {Type} type Inherited message type\r\n * @param {InheritanceOptions} [options] Inheritance options\r\n * @returns {Prototype} Created prototype\r\n */\r\nfunction inherits(clazz, type, options) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"clazz\", \"a function\");\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n if (!options)\r\n options = {};\r\n\r\n /**\r\n * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library.\r\n * @name Class\r\n * @extends Prototype\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set on the message\r\n * @see {@link inherits}\r\n */\r\n\r\n var classProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Class.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n if (!options.noStatics)\r\n util.merge(classProperties, {\r\n\r\n /**\r\n * Encodes a message of this type to a buffer.\r\n * @name Class.encode\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encode: {\r\n value: function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Encodes a message of this type preceeded by its length as a varint to a buffer.\r\n * @name Class.encodeDelimited\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encodeDelimited: {\r\n value: function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type from a buffer.\r\n * @name Class.decode\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decode: {\r\n value: function decode(buffer) {\r\n return this.$type.decode(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type preceeded by its length as a varint from a buffer.\r\n * @name Class.decodeDelimited\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decodeDelimited: {\r\n value: function decodeDelimited(buffer) {\r\n return this.$type.decodeDelimited(buffer);\r\n }\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 {Prototype|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 verify: {\r\n value: function verify(message) {\r\n return this.$type.verify(message);\r\n }\r\n }\r\n\r\n }, true);\r\n\r\n util.props(clazz, classProperties);\r\n var prototype = inherits.defineProperties(new Prototype(), type);\r\n clazz.prototype = prototype;\r\n prototype.constructor = clazz;\r\n\r\n if (!options.noRegister)\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Defines the reflected type's default values and virtual oneof properties on the specified prototype.\r\n * @memberof inherits\r\n * @param {Prototype} prototype Prototype to define properties upon\r\n * @param {Type} type Reflected message type\r\n * @returns {Prototype} The specified prototype\r\n */\r\ninherits.defineProperties = function defineProperties(prototype, type) {\r\n\r\n var prototypeProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Prototype#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n // Initialize default values\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 // Define each oneof with a non-enumerable getter and setter for the present 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 util.props(prototype, prototypeProperties);\r\n return prototype;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(8);\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(7),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field.\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 = Method;\r\n\r\nvar ReflectionObject = require(13);\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.\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(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(7),\r\n Type = require(23),\r\n Field = require(8),\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.\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.\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} Prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var proto = constructor.prototype = Object.create(this.prototype);\r\n proto.constructor = constructor;\r\n constructor.extend = extend;\r\n return proto;\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(13);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(8),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof.\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(8),\r\n MapField = require(10),\r\n OneOf = require(14),\r\n Enum = require(7),\r\n Service = require(21),\r\n Method = require(11),\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 default-case, 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 = Prototype;\r\n\r\n/**\r\n * Constructs a new prototype.\r\n * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`.\r\n * @classdesc Runtime message prototype ready to be extended by custom classes or generated code.\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link inherits}\r\n * @see {@link Class}\r\n */\r\nfunction Prototype(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/**\r\n * Converts a runtime 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\nPrototype.prototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.constructor.$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","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(28),\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 * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\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\n/**\r\n * Constructs a new reader 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.\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\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(8),\r\n util = require(25),\r\n common = require(6);\r\n\r\n/**\r\n * Constructs a new root namespace.\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/**\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 {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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 // 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(15)(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 (!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 ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\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 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 (!queued)\r\n finish(null);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\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 * 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\n/**\r\n * Constructs a new RPC service.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n\r\n /**\r\n * RPC implementation.\r\n * @type {RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n\r\n /**\r\n * Service listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name, one of `\"data\"`, `\"error\"`, `\"end\"`\r\n * @param {function} cb Listener\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.on = function on(evt, cb) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push(cb);\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} [cb] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.off = function off(evt, cb) {\r\n if (evt) {\r\n if (cb) {\r\n var p = (this._listeners[evt] || []).indexOf(cb);\r\n if (p > -1)\r\n this._listeners[evt].splice(p, 1);\r\n } else\r\n this._listeners[evt] = [];\r\n } else\r\n this._listeners = {};\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.emit = function emit(evt) {\r\n if (this._listeners[evt]) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < this._listeners[evt].length; ++i)\r\n this._listeners[evt][i].apply(this, args);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end() {\r\n return this.emit('end').off();\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(12);\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(11),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service.\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 {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream.\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 var lcName = method.name.substring(0, 1).toLowerCase() + method.name.substring(1);\r\n rpcService[lcName] = function(request, callback) {\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);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.emit('end');\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);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response);\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 default-case, 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 default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(12);\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(7),\r\n OneOf = require(14),\r\n Field = require(8),\r\n Service = require(21),\r\n Prototype = require(16),\r\n Reader = require(17),\r\n Writer = require(29),\r\n inherits = require(9),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Constructs a new message type.\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 {Prototype}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n if (this._ctor)\r\n return this._ctor;\r\n var ctor;\r\n if (codegen.supported)\r\n ctor = codegen(\"p\")(\"P.call(this,p)\").eof(this.getFullName() + \"$ctor\", {\r\n P: Prototype\r\n });\r\n else\r\n ctor = function GenericMessage(properties) {\r\n Prototype.call(this, properties);\r\n };\r\n ctor.prototype = inherits(ctor, this);\r\n this._ctor = ctor;\r\n return ctor;\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\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 * @param {*} [ctor] Constructor to use.\r\n * Defaults to use the internal constuctor.\r\n * @returns {Prototype} Message instance\r\n */\r\nTypePrototype.create = function create(properties, ctor) {\r\n if (!properties || typeof properties === 'function') {\r\n ctor = properties;\r\n properties = undefined;\r\n } else if (properties /* already */ instanceof Prototype)\r\n return properties;\r\n if (ctor) {\r\n if (!(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n } else\r\n ctor = this.getCtor();\r\n return new ctor(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Prototype|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 {Prototype|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).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 {Prototype} 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 {Prototype} 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 enum values are valid and that any required fields are present.\r\n * @param {Prototype|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 })\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 * Utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\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 * 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 * 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 * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\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 try {\r\n // Hide this from webpack. There is probably another, better way.\r\n return eval(['req','uire'].join(''))(\"fs\") // eslint-disable-line no-eval\r\n .readFile(path, \"utf8\", callback);\r\n } catch (e) { } // eslint-disable-line no-empty\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 (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\n// Merge in runtime utility\r\nutil.merge(util, require(28));\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 * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\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 new util.Long(this.lo, this.hi, 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 * 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\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(28),\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.\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.\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.\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.hi).push(writeFixed32, 4, bits.lo);\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.hi).push(writeFixed32, 4, bits.lo);\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\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\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} value Value 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 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.\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 // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\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 * 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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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:function):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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\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// 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\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.Prototype = require(\"./prototype\");\r\nprotobuf.inherits = require(\"./inherits\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\nprotobuf.util = require(\"./util\");\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 protobuf.Reader.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 c4803ede4..92be2da9b 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 Thu, 08 Dec 2016 13:23:47 UTC + * Compiled Thu, 08 Dec 2016 16:19:10 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ -!function t(e,i,r){function n(o,u){if(!i[o]){if(!e[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=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i?i:t)},l,l.exports,t,e,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o>1,l=-7,h=i?0:n-1,c=i?1:-1,d=t[e+h];for(h+=c,s=d&(1<<-l)-1,d>>=-l,l+=u;l>0;s=256*s+t[e+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+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,r),s-=f}return(d?-1:1)*o*Math.pow(2,s-r)},i.write=function(t,e,i,r,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=r?s-1:0,p=r?-1:1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),e+=o+h>=1?c/a:c*Math.pow(2,1-h),e*a>=2&&(o++,a/=2),o+h>=l?(u=0,o=l):o+h>=1?(u=(e*a-1)*Math.pow(2,n),o+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[i+d]=255&u,d+=p,u/=256,n-=8);for(o=o<0;t[i+d]=255&o,d+=p,o/=256,f-=8);t[i+d-p]|=128*v}},{}],2:[function(t,e,i){"use strict";function r(){function t(){var e=n.sprintf.apply(null,arguments),i=c;if(h.length){var r=h[h.length-1];s.test(r)?i=++c:a.test(r)&&++i,u.test(r)&&!u.test(e)?(i=++c,d=!0):d&&f.test(r)&&(i=--c,d=!1),o.test(e)&&(i=--c)}for(var l=0;l ").replace(/\t/g," "));var s=Object.keys(i||(i={}));return Function.apply(null,s.concat("return "+n)).apply(null,s.map(function(t){return i[t]}))}var l=Array.prototype.slice.call(arguments),h=['\t"use strict"'],c=1,d=!1;return t.str=e,t.eof=i,t}e.exports=r;var n=t(23),s=/[{[]$/,o=/^[}\]]/,u=/:$/,a=/^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/,f=/\b(?:break|continue);?$|^\s*return\b/;r.supported=!1;try{r.supported=1===r("a","b")("return a-b").eof()(2,1)}catch(t){}r.verbose=!1,r.encode=t(4),r.decode=t(3),r.verify=t(5)},{23:23,3:3,4:4,5:5}],3:[function(t,e,i){"use strict";var r=i,n=t(7),s=t(17),o=t(22),u=t(23),a=t(2);r.fallback=function(t,e){for(var i=this.getFieldsById(),r=t instanceof s?t:s.create(t),a=void 0===e?r.len:r.pos+e,f=new(this.getCtor());r.pos-1;--i)if(e.oneof.indexOf(t[i])>-1)return t[i]},set:function(t){for(var i=e.oneof,r=0;r0;){var n=t.shift();if(i.nested&&i.nested[n]){if(i=i.nested[n],!(i instanceof r))throw Error("path conflicts with non-namespace objects")}else i.add(i=new r(n))}return e&&i.addJSON(e),i},u.resolveAll=function(){for(var t=this.getNestedArray(),e=0;e-1&&this.oneof.splice(e,1),t.parent&&t.parent.remove(t),t.partOf=null,this},o.onAdd=function(t){s.prototype.onAdd.call(this,t),n(this)},o.onRemove=function(t){this.g.forEach(function(t){t.parent&&t.parent.remove(t)}),s.prototype.onRemove.call(this,t)}},{13:13,23:23,8:8}],15:[function(t,e,i){"use strict";function r(t){return null===t?null:t.toLowerCase()}function n(t,e){function i(t,e){return Error("illegal "+(e||"token")+" '"+t+"' (line "+rt.line()+F)}function n(){var t,e=[];do{if((t=nt())!==B&&t!==J)throw i(t);e.push(nt()),ut(t),t=ot()}while(t===B||t===J);return e.join("")}function v(t){var e=nt();switch(r(e)){case J:case B:return st(e),n();case"true":return!0;case"false":return!1}try{return z(e)}catch(r){if(t&&m.test(e))return e;throw i(e,"value")}}function q(){var t=L(nt()),e=t;return ut("to",!0)&&(e=L(nt())),ut(E),[t,e]}function z(t){var e=1;"-"===t.charAt(0)&&(e=-1,t=t.substring(1));var n=r(t);switch(n){case"inf":return e*(1/0);case"nan":return NaN;case"0":return 0}if(/^[1-9][0-9]*$/.test(t))return e*parseInt(t,10);if(/^0[x][0-9a-f]+$/.test(n))return e*parseInt(t,16);if(/^0[0-7]+$/.test(t))return e*parseInt(t,8);if(/^(?!e)[0-9]*(?:\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(n))return e*parseFloat(t);throw i(t,"number")}function L(t,e){var n=r(t);switch(n){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===t.charAt(0)&&!e)throw i(t,"id");if(/^-?[1-9][0-9]*$/.test(t))return parseInt(t,10);if(/^-?0[x][0-9a-f]+$/.test(n))return parseInt(t,16);if(/^-?0[0-7]+$/.test(t))return parseInt(t,8);throw i(t,"id")}function V(){if(void 0!==Y)throw i("package");if(Y=nt(),!m.test(Y))throw i(Y,A);ht=ht.define(Y),ut(E)}function P(){var t,e=ot();switch(e){case"weak":t=et||(et=[]),nt();break;case"public":nt();default:t=tt||(tt=[])}e=n(),ut(E),t.push(e)}function R(){ut("="),it=r(n());var t;if(["proto2",t="proto3"].indexOf(it)<0)throw i(it,"syntax");ft=it===t,ut(E)}function $(t,e){switch(e){case O:return K(t,e),ut(E),!0;case"message":return I(t,e),!0;case"enum":return D(t,e),!0;case"service":return G(t,e),!0;case"extend":return Q(t,e),!0}return!1}function I(t,e){var n=nt();if(!g.test(n))throw i(n,"type name");var s=new u(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);if(!$(s,e))switch(o){case"map":M(s,o);break;case b:case x:case k:C(s,o);break;case"oneof":U(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(q(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(q(s,o));break;default:if(!ft||!m.test(e))throw i(e);st(e),C(s,x)}}ut(E,!0)}else ut(E);t.add(s)}function C(t,e,r){var n=nt();if(!m.test(n))throw i(n,N);var s=nt();if(!g.test(s))throw i(s,A);s=y(s),ut("=");var o=L(nt()),u=Z(new a(s,o,n,e,r));u.repeated&&u.setOption("packed",ft,!0),t.add(u)}function M(t){ut("<");var e=nt();if(void 0===p.mapKey[e])throw i(e,N);ut(",");var r=nt();if(!m.test(r))throw i(r,N);ut(">");var n=nt();if(!g.test(n))throw i(n,A);n=y(n),ut("=");var s=L(nt()),o=Z(new f(n,s,e,r));t.add(o)}function U(t,e){var r=nt();if(!g.test(r))throw i(r,A);r=y(r);var n=new l(r);if(ut(S,!0)){for(;(e=nt())!==T;)e===O?(K(n,e),ut(E)):(st(e),C(n,x));ut(E,!0)}else ut(E);t.add(n)}function D(t,e){var n=nt();if(!g.test(n))throw i(n,A);var s={},o=new h(n,s);if(ut(S,!0)){for(;(e=nt())!==T;)r(e)===O?K(o):_(o,e);ut(E,!0)}else ut(E);t.add(o)}function _(t,e){if(!g.test(e))throw i(e,A);var r=e;ut("=");var n=L(nt(),!0);t.values[r]=n,Z({})}function K(t,e){var r=ut(j,!0),n=nt();if(!m.test(n))throw i(n,A);r&&(ut(F),n=j+n+F,e=ot(),w.test(e)&&(n+=e,nt())),ut("="),H(t,n)}function H(t,e){if(ut(S,!0))for(;(lt=nt())!==T;){if(!g.test(lt))throw i(lt,A);e=e+"."+lt,ut(":",!0)?W(t,e,v(!0)):H(t,e)}else W(t,e,v(!0))}function W(t,e,i){t.setOption?t.setOption(e,i):t[e]=i}function Z(t){if(ut("[",!0)){do K(t,O);while(ut(",",!0));ut("]")}return ut(E),t}function G(t,e){if(e=nt(),!g.test(e))throw i(e,"service name");var n=e,s=new c(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);switch(o){case O:K(s,o),ut(E);break;case"rpc":X(s,o);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(s)}function X(t,e){var n=e,s=nt();if(!g.test(s))throw i(s,A);var o,u,a,f;ut(j);var l;if(ut(l="stream",!0)&&(u=!0),!m.test(e=nt()))throw i(e);if(o=e,ut(F),ut("returns"),ut(j),ut(l,!0)&&(f=!0),!m.test(e=nt()))throw i(e);a=e,ut(F);var h=new d(s,n,o,a,u,f);if(ut(S,!0)){for(;(e=nt())!==T;){var c=r(e);switch(c){case O:K(h,c),ut(E);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(h)}function Q(t,e){var n=nt();if(!m.test(n))throw i(n,"reference");if(ut(S,!0)){for(;(e=nt())!==T;){var s=r(e);switch(s){case b:case k:case x:C(t,s,n);break;default:if(!ft||!m.test(e))throw i(e);st(e),C(t,x,n)}}ut(E,!0)}else ut(E)}e||(e=new o);var Y,tt,et,it,rt=s(t),nt=rt.next,st=rt.push,ot=rt.peek,ut=rt.skip,at=!0,ft=!1;e||(e=new o);for(var lt,ht=e;null!==(lt=nt());){var ct=r(lt);switch(ct){case"package":if(!at)throw i(lt);V();break;case"import":if(!at)throw i(lt);P();break;case"syntax":if(!at)throw i(lt);R();break;case O:if(!at)throw i(lt);K(ht,lt),ut(E);break;default:if($(ht,lt)){at=!1;continue}throw i(lt)}}return{package:Y,imports:tt,weakImports:et,syntax:it,root:e}}e.exports=n;var s=t(20),o=t(18),u=t(21),a=t(8),f=t(10),l=t(14),h=t(7),c=t(19),d=t(11),p=t(22),v=t(23),y=v.camelCase,g=/^[a-zA-Z_][a-zA-Z_0-9]*$/,m=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,w=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,b="required",k="repeated",x="optional",O="option",A="name",N="type",S="{",T="}",j="(",F=")",E=";",B='"',J="'"},{10:10,11:11,14:14,18:18,19:19,20:20,21:21,22:22,23:23,7:7,8:8}],16:[function(t,e,i){"use strict";function r(t){if(t)for(var e=Object.keys(t),i=0;i "+t.len)}function n(){x.Long?(S.int64=a,S.uint64=l,S.sint64=c,S.fixed64=v,S.sfixed64=g):(S.int64=f,S.uint64=h,S.sint64=d,S.fixed64=y,S.sfixed64=m)}function s(t){this.buf=t,this.pos=0,this.len=t.length}function o(t,e){this.id=t,this.wireType=e}function u(){var t=0,e=0,i=0,n=0;if(this.len-this.pos>9){for(i=0;i<4;++i)if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i)if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}else{for(i=0;i<4;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0)}if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}}throw Error("invalid varint encoding")}function a(){return u.call(this).toLong()}function f(){return u.call(this).toNumber()}function l(){return u.call(this).toLong(!0)}function h(){return u.call(this).toNumber(!0)}function c(){return u.call(this).zzDecode().toLong()}function d(){return u.call(this).zzDecode().toNumber()}function p(){if(this.pos+8>this.len)throw r(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 v(){return p.call(this).toLong(!0)}function y(){return p.call(this).toNumber(!0)}function g(){return p.call(this).zzDecode().toLong()}function m(){return p.call(this).zzDecode().toNumber()}function w(t){F&&F(),s.call(this,t)}function b(t,e,i){return t.utf8Slice(e,i)}function k(t,e,i){return t.toString("utf8",e,i)}e.exports=s,s.BufferReader=w;var x=t(26),O=t(1),A=x.LongBits,N="undefined"!=typeof Uint8Array?Uint8Array:Array;s.configure=n,s.create=function(t){return new(x.Buffer&&x.Buffer.isBuffer(t)&&w||s)(t)};var S=s.prototype;S.h=N.prototype.subarray||N.prototype.slice,S.tag=function(){if(this.pos>=this.len)throw r(this);return new o(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},S.int32=function(){var t=this.buf[this.pos++],e=127&t;if(t>127&&(t=this.buf[this.pos++],e|=(127&t)<<7,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<14,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<21,t>127&&(t=this.buf[this.pos++],e|=t<<28,t>127&&(this.pos+=5))))),this.pos>this.len)throw this.pos=this.len,r(this);return e},S.uint32=function(){return this.int32()>>>0},S.sint32=function(){var t=this.int32();return t>>>1^-(1&t)},S.bool=function(){return 0!==this.int32()},S.fixed32=function(){if(this.pos+4>this.len)throw r(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},S.sfixed32=function(){var t=this.fixed32();return t>>>1^-(1&t)};var T="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r],t[0]}:function(i,r){return e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,23,4)};S.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=T(this.buf,this.pos);return this.pos+=4,t};var j="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r++],e[4]=i[r++],e[5]=i[r++],e[6]=i[r++],e[7]=i[r],t[0]}:function(i,r){return e[7]=i[r++],e[6]=i[r++],e[5]=i[r++],e[4]=i[r++],e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,52,8)};S.double=function(){if(this.pos+8>this.len)throw r(this,4);var t=j(this.buf,this.pos);return this.pos+=8,t},S.bytes=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,e===i?new this.buf.constructor(0):this.h.call(this.buf,e,i)},S.string=function(){var t=this.bytes(),e=t.length;if(e){for(var i=new Array(e),r=0,n=0;r191&&s<224)i[n++]=(31&s)<<6|63&t[r++];else if(s>239&&s<365){var o=((7&s)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536;i[n++]=55296+(o>>10),i[n++]=56320+(1023&o)}else i[n++]=(15&s)<<12|(63&t[r++])<<6|63&t[r++]}return String.fromCharCode.apply(String,i.slice(0,n))}return""},S.skip=function(t){if(void 0===t){do if(this.pos>=this.len)throw r(this);while(128&this.buf[this.pos++])}else{if(this.pos+t>this.len)throw r(this,t);this.pos+=t}return this},S.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var e=this.tag();if(4===e.wireType)break;this.skipType(e.wireType)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type: "+t)}return this},S.reset=function(t){return t?(this.buf=t, -this.len=t.length):(this.buf=null,this.len=0),this.pos=0,this},S.finish=function(t){var e=this.pos?this.h.call(this.buf,this.pos):this.buf;return this.reset(t),e};var F=function(){if(!x.Buffer)throw Error("Buffer is not supported");E.h=x.Buffer.prototype.slice,B=x.Buffer.prototype.utf8Slice?b:k,F=!1},E=w.prototype=Object.create(s.prototype);E.constructor=w,"undefined"==typeof Float32Array&&(E.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=this.buf.readFloatLE(this.pos,!0);return this.pos+=4,t}),"undefined"==typeof Float64Array&&(E.double=function(){if(this.pos+8>this.len)throw r(this,8);var t=this.buf.readDoubleLE(this.pos,!0);return this.pos+=8,t});var B;E.string=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,B(this.buf,e,i)},E.finish=function(t){var e=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(t),e},n()},{1:1,26:26}],18:[function(t,e,i){"use strict";function r(t){s.call(this,"",t),this.deferred=[],this.files=[]}function n(t){var e=t.parent.lookup(t.extend);if(e){var i=new u(t.getFullName(),t.id,t.type,t.rule,(void 0),t.options);return i.declaringField=t,t.extensionField=i,e.add(i),!0}return!1}e.exports=r;var s=t(12),o=s.extend(r),u=t(8),a=t(23),f=t(6);r.fromJSON=function(t,e){return e||(e=new r),e.setOptions(t.options).addJSON(t.nested)},o.resolvePath=a.resolvePath,o.load=function e(i,r){function n(t,e){if(r){var i=r;r=null,i(t,e)}}function s(e,i){try{if(a.isString(i)&&"{"===i.charAt(0)&&(i=JSON.parse(i)),a.isString(i)){var r=t(15)(i,u);r.imports&&r.imports.forEach(function(t){o(u.resolvePath(e,t))}),r.weakImports&&r.weakImports.forEach(function(t){o(u.resolvePath(e,t),!0)})}else u.setOptions(i.options).addJSON(i.nested)}catch(t){return void n(t)}l||n(null,u)}function o(t,e){var i=t.indexOf("google/protobuf/");if(i>-1){var o=t.substring(i);o in f&&(t=o)}if(!(u.files.indexOf(t)>-1)){if(u.files.push(t),t in f)return++l,void setTimeout(function(){--l,s(t,f[t])});++l,a.fetch(t,function(i,o){if(--l,r)return i?void(e||n(i)):void s(t,o)})}}var u=this;if(!r)return a.asPromise(e,u,i);var l=0;a.isString(i)&&(i=[i]),i.forEach(function(t){o(u.resolvePath("",t))}),l||n(null)},o.e=function(t){var e=this.deferred.slice();this.deferred=[];for(var i=0;i-1&&this.deferred.splice(e,1)}t.extensionField&&(t.extensionField.parent.remove(t.extensionField),t.extensionField=null)}else if(t instanceof s)for(var i=t.getNestedArray(),r=0;r0)return m.shift();if(w)return i();var r,o,u;do{if(v===y)return null;for(r=!1;/\s/.test(u=n(v));)if(u===a&&++g,++v===y)return null;if(n(v)===f){if(++v===y)throw e("comment");if(n(v)===f){for(;n(++v)!==a;)if(v===y)return null;++v,++g,r=!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,r=!0}}}while(r);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="*"},{}],21:[function(t,e,i){"use strict";function r(t,e){s.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.j=null,this.k=null,this.l=null,this.m=null,this.n=null}function n(t){return t.j=t.k=t.m=t.n=null,delete t.encode,delete t.decode,t}e.exports=r;var s=t(12),o=s.prototype,u=s.extend(r),a=t(7),f=t(14),l=t(8),h=t(19),c=t(16),d=t(17),p=t(27),v=t(9),y=t(23),g=t(2);y.props(u,{fieldsById:{get:function(){if(this.j)return this.j;this.j={};for(var t=Object.keys(this.fields),e=0;e0?e.splice(--n,2):i?e.splice(n,1):++n:"."===e[n]?e.splice(n,1):++n;return r+e.join("/")}var util=exports;util.isString=isString,util.isObject=function(t){return Boolean(t&&"object"==typeof t)},util.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},util.toArray=function(t){if(!t)return[];for(var e=Object.keys(t),i=e.length,r=new Array(i),n=0;n>>0,n=(t-i)/4294967296>>>0;return e&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(t){switch(typeof t){case"number":return r.fromNumber(t);case"string":t=n.Long.fromString(t)}return(t.low||t.high)&&new r(t.low>>>0,t.high>>>0)||o},s.toNumber=function(t){return!t&&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(t){return new n.Long(this.lo,this.hi,t)};var u=String.prototype.charCodeAt;r.fromHash=function(t){return new r((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,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 t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},s.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},s.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<1<<21?3:4:e<16384?e<128?5:6:e<1<<21?7:8:i<128?9:10}},{23:23}],25:[function(t,e,i){"use strict";function r(t,e,i){var r=i||8192,n=r>>>1,s=null,o=r;return function(i){if(i>n)return t(i);o+i>r&&(s=t(r),o=0);var u=e.call(s,o,o+=i);return 7&o&&(o=(7|o)+1),u}}e.exports=r},{}],26:[function(t,e,i){(function(e){"use strict";var r=i,n=r.LongBits=t(24);r.pool=t(25);var s=r.isNode=Boolean(e.process&&e.process.versions&&e.process.versions.node);if(r.Buffer=null,s)try{r.Buffer=t("buffer").Buffer}catch(t){}if(r.Long=e.dcodeIO&&e.dcodeIO.Long||null,!r.Long&&s)try{r.Long=t("long")}catch(t){}r.longToHash=function(t){return t?n.from(t).toHash():"\0\0\0\0\0\0\0\0"},r.longFromHash=function(t,e){var i=n.fromHash(t);return r.Long?r.Long.fromBits(i.lo,i.hi,e):i.toNumber(Boolean(e))},r.longNeq=function(t,e){return"number"==typeof t?"number"==typeof e?t!==e:(t=n.fromNumber(t)).lo!==e.low||t.hi!==e.high:"number"==typeof e?(e=n.fromNumber(e)).lo!==t.low||e.hi!==t.high:t.low!==e.low||t.high!==e.high},r.props=function(t,e){Object.keys(e).forEach(function(i){r.prop(t,i,e[i])})},r.prop=function(t,e,i){var r=!-[1],n=e.substring(0,1).toUpperCase()+e.substring(1);i.get&&(t["get"+n]=i.get),i.set&&(t["set"+n]=r?function(t){i.set.call(this,t),this[e]=t}:i.set),r?void 0!==i.value&&(t[e]=i.value):Object.defineProperty(t,e,i)},r.emptyArray=Object.freeze([]),r.emptyObject=Object.freeze({})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{24:24,25:25,buffer:"buffer",long:"long"}],27:[function(t,e,i){"use strict";function r(t,e,i){this.fn=t,this.val=e,this.len=i,this.next=null}function n(){}function s(t,e){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=e}function o(){this.len=0,this.head=new r(n,0,0),this.tail=this.head,this.states=null}function u(t,e,i){t[e]=255&i}function a(t,e,i){for(;i>127;)t[e++]=127&i|128,i>>>=7;t[e]=i}function f(t,e,i){for(;i.hi;)t[e++]=127&i.lo|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0,i.hi>>>=7;for(;i.lo>127;)t[e++]=127&i.lo|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0;t[e++]=i.lo}function l(t,e,i){t[e++]=255&i,t[e++]=i>>>8&255,t[e++]=i>>>16&255,t[e]=i>>>24}function h(t,e,i){for(var r=0;r>6|192,t[e++]=63&s|128):55296===(64512&s)&&56320===(64512&(n=i.charCodeAt(r+1)))?(s=65536+((1023&s)<<10)+(1023&n),++r,t[e++]=s>>18|240,t[e++]=s>>12&63|128,t[e++]=s>>6&63|128,t[e++]=63&s|128):(t[e++]=s>>12|224,t[e++]=s>>6&63|128,t[e++]=63&s|128)}}function c(t){for(var e=t.length>>>0,i=0,r=0;r>>=0,t<128?this.push(u,1,t):this.push(a,t<16384?2:t<2097152?3:t<268435456?4:5,t)},k.int32=function(t){return t<0?this.push(f,10,w.fromNumber(t)):this.uint32(t)},k.sint32=function(t){return this.uint32(t<<1^t>>31)},k.uint64=function(t){var e=w.from(t);return this.push(f,e.length(),e)},k.int64=k.uint64,k.sint64=function(t){var e=w.from(t).zzEncode();return this.push(f,e.length(),e)},k.bool=function(t){return this.push(u,1,t?1:0)},k.fixed32=function(t){return this.push(l,4,t>>>0)},k.sfixed32=function(t){return this.push(l,4,t<<1^t>>31)},k.fixed64=function(t){var e=w.from(t);return this.push(l,4,e.hi).push(l,4,e.lo)},k.sfixed64=function(t){var e=w.from(t).zzEncode();return this.push(l,4,e.hi).push(l,4,e.lo)};var x="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r]=e[3]}:function(i,r,n){t[0]=n,i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,23,4)};k.float=function(t){return this.push(x,4,t)};var O="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r]=e[7]}:function(i,r,n){t[0]=n,i[r++]=e[7],i[r++]=e[6],i[r++]=e[5],i[r++]=e[4],i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,52,8)};k.double=function(t){return this.push(O,8,t)};var A=b.prototype.set?function(t,e,i){t.set(i,e)}:function(t,e,i){for(var r=0;r>>0;return e?this.uint32(e).push(A,e,t):this.push(u,1,0)},k.string=function(t){var e=c(t);return e?this.uint32(e).push(h,e,t):this.push(u,1,0)},k.fork=function(){return this.states=new s(this,this.states),this.head=this.tail=new r(n,0,0),this.len=0,this},k.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 r(n,0,0),this.len=0),this},k.ldelim=function(t){var e=this.head,i=this.tail,r=this.len;return this.reset(),void 0!==t&&this.tag(t,2),this.uint32(r),this.tail.next=e.next,this.tail=i,this.len+=r,this},k.finish=function(){var t=this.head.next,e=this.constructor.alloc(this.len);this.reset();for(var i=0;t;)t.fn(e,i,t.val),i+=t.len,t=t.next;return e},d.alloc=function(t){return d.alloc=g.Buffer.allocUnsafe?g.Buffer.allocUnsafe:function(t){return new g.Buffer(t)},d.alloc(t)};var N=d.prototype=Object.create(o.prototype);N.constructor=d,"undefined"==typeof Float32Array&&(N.float=function(t){return this.push(p,4,t)}),"undefined"==typeof Float64Array&&(N.double=function(t){return this.push(v,8,t)}),b.prototype.set&&g.Buffer&&g.Buffer.prototype.set||(N.bytes=function(t){var e=t.length>>>0;return e?this.uint32(e).push(y,e,t):this.push(u,1,0)});var S=function(){return g.Buffer&&g.Buffer.prototype.utf8Write?function(t,e,i){i.length<40?h(t,e,i):t.utf8Write(i,e)}:function(t,e,i){i.length<40?h(t,e,i):t.write(i,e)}}();N.string=function(t){var e=t.length<40?c(t):g.Buffer.byteLength(t);return e?this.uint32(e).push(S,e,t):this.push(u,1,0)}},{1:1,26:26}],28:[function(t,e,i){(function(e){"use strict";function r(t,e,i){return"function"==typeof e?(i=e,e=new n.Root):e||(e=new n.Root),e.load(t,i)}var n=e.protobuf=i;n.load=r,n.tokenize=t(20),n.parse=t(15),n.Writer=t(27),n.BufferWriter=n.Writer.BufferWriter,n.Reader=t(17),n.BufferReader=n.Reader.BufferReader,n.codegen=t(2),n.ReflectionObject=t(13),n.Namespace=t(12),n.Root=t(18),n.Enum=t(7),n.Type=t(21),n.Field=t(8),n.OneOf=t(14),n.MapField=t(10),n.Service=t(19),n.Method=t(11),n.Prototype=t(16),n.inherits=t(9),n.types=t(22),n.common=t(6),n.util=t(23),"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&(n.util.Long=t,n.Reader.configure()),n})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,2:2,20:20,21:21,22:22,23:23,27:27,6:6,7:7,8:8,9:9}]},{},[28]); +!function t(e,i,r){function n(o,u){if(!i[o]){if(!e[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=i[o]={exports:{}};e[o][0].call(l.exports,function(t){var i=e[o][1][t];return n(i?i:t)},l,l.exports,t,e,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o>1,l=-7,h=i?0:n-1,c=i?1:-1,d=t[e+h];for(h+=c,s=d&(1<<-l)-1,d>>=-l,l+=u;l>0;s=256*s+t[e+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+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,r),s-=f}return(d?-1:1)*o*Math.pow(2,s-r)},i.write=function(t,e,i,r,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=r?s-1:0,p=r?-1:1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),e+=o+h>=1?c/a:c*Math.pow(2,1-h),e*a>=2&&(o++,a/=2),o+h>=l?(u=0,o=l):o+h>=1?(u=(e*a-1)*Math.pow(2,n),o+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[i+d]=255&u,d+=p,u/=256,n-=8);for(o=o<0;t[i+d]=255&o,d+=p,o/=256,f-=8);t[i+d-p]|=128*v}},{}],2:[function(t,e,i){"use strict";function r(){function t(){var e=n.sprintf.apply(null,arguments),i=c;if(h.length){var r=h[h.length-1];s.test(r)?i=++c:a.test(r)&&++i,u.test(r)&&!u.test(e)?(i=++c,d=!0):d&&f.test(r)&&(i=--c,d=!1),o.test(e)&&(i=--c)}for(var l=0;l ").replace(/\t/g," "));var s=Object.keys(i||(i={}));return Function.apply(null,s.concat("return "+n)).apply(null,s.map(function(t){return i[t]}))}var l=Array.prototype.slice.call(arguments),h=['\t"use strict"'],c=1,d=!1;return t.str=e,t.eof=i,t}e.exports=r;var n=t(25),s=/[{[]$/,o=/^[}\]]/,u=/:$/,a=/^\s*(?:if|else if|while|for)\b|\b(?:else)\s*$/,f=/\b(?:break|continue);?$|^\s*return\b/;r.supported=!1;try{r.supported=1===r("a","b")("return a-b").eof()(2,1)}catch(t){}r.verbose=!1,r.encode=t(4),r.decode=t(3),r.verify=t(5)},{25:25,3:3,4:4,5:5}],3:[function(t,e,i){"use strict";var r=i,n=t(7),s=t(17),o=t(24),u=t(25),a=t(2);r.fallback=function(t,e){for(var i=this.getFieldsById(),r=t instanceof s?t:s.create(t),a=void 0===e?r.len:r.pos+e,f=new(this.getCtor());r.pos-1;--i)if(e.oneof.indexOf(t[i])>-1)return t[i]},set:function(t){for(var i=e.oneof,r=0;r0;){var n=t.shift();if(i.nested&&i.nested[n]){if(i=i.nested[n],!(i instanceof r))throw Error("path conflicts with non-namespace objects")}else i.add(i=new r(n))}return e&&i.addJSON(e),i},u.resolveAll=function(){for(var t=this.getNestedArray(),e=0;e-1&&this.oneof.splice(e,1),t.parent&&t.parent.remove(t),t.partOf=null,this},o.onAdd=function(t){s.prototype.onAdd.call(this,t),n(this)},o.onRemove=function(t){this.g.forEach(function(t){t.parent&&t.parent.remove(t)}),s.prototype.onRemove.call(this,t)}},{13:13,25:25,8:8}],15:[function(t,e,i){"use strict";function r(t){return null===t?null:t.toLowerCase()}function n(t,e){function i(t,e){return Error("illegal "+(e||"token")+" '"+t+"' (line "+rt.line()+F)}function n(){var t,e=[];do{if((t=nt())!==B&&t!==J)throw i(t);e.push(nt()),ut(t),t=ot()}while(t===B||t===J);return e.join("")}function v(t){var e=nt();switch(r(e)){case J:case B:return st(e),n();case"true":return!0;case"false":return!1}try{return z(e)}catch(r){if(t&&m.test(e))return e;throw i(e,"value")}}function q(){var t=L(nt()),e=t;return ut("to",!0)&&(e=L(nt())),ut(E),[t,e]}function z(t){var e=1;"-"===t.charAt(0)&&(e=-1,t=t.substring(1));var n=r(t);switch(n){case"inf":return e*(1/0);case"nan":return NaN;case"0":return 0}if(/^[1-9][0-9]*$/.test(t))return e*parseInt(t,10);if(/^0[x][0-9a-f]+$/.test(n))return e*parseInt(t,16);if(/^0[0-7]+$/.test(t))return e*parseInt(t,8);if(/^(?!e)[0-9]*(?:\.[0-9]*)?(?:[e][+-]?[0-9]+)?$/.test(n))return e*parseFloat(t);throw i(t,"number")}function L(t,e){var n=r(t);switch(n){case"min":return 1;case"max":return 536870911;case"0":return 0}if("-"===t.charAt(0)&&!e)throw i(t,"id");if(/^-?[1-9][0-9]*$/.test(t))return parseInt(t,10);if(/^-?0[x][0-9a-f]+$/.test(n))return parseInt(t,16);if(/^-?0[0-7]+$/.test(t))return parseInt(t,8);throw i(t,"id")}function V(){if(void 0!==Y)throw i("package");if(Y=nt(),!m.test(Y))throw i(Y,A);ht=ht.define(Y),ut(E)}function P(){var t,e=ot();switch(e){case"weak":t=et||(et=[]),nt();break;case"public":nt();default:t=tt||(tt=[])}e=n(),ut(E),t.push(e)}function R(){ut("="),it=r(n());var t;if(["proto2",t="proto3"].indexOf(it)<0)throw i(it,"syntax");ft=it===t,ut(E)}function $(t,e){switch(e){case O:return K(t,e),ut(E),!0;case"message":return I(t,e),!0;case"enum":return D(t,e),!0;case"service":return G(t,e),!0;case"extend":return Q(t,e),!0}return!1}function I(t,e){var n=nt();if(!g.test(n))throw i(n,"type name");var s=new u(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);if(!$(s,e))switch(o){case"map":M(s,o);break;case b:case x:case k:C(s,o);break;case"oneof":U(s,o);break;case"extensions":(s.extensions||(s.extensions=[])).push(q(s,o));break;case"reserved":(s.reserved||(s.reserved=[])).push(q(s,o));break;default:if(!ft||!m.test(e))throw i(e);st(e),C(s,x)}}ut(E,!0)}else ut(E);t.add(s)}function C(t,e,r){var n=nt();if(!m.test(n))throw i(n,N);var s=nt();if(!g.test(s))throw i(s,A);s=y(s),ut("=");var o=L(nt()),u=Z(new a(s,o,n,e,r));u.repeated&&u.setOption("packed",ft,!0),t.add(u)}function M(t){ut("<");var e=nt();if(void 0===p.mapKey[e])throw i(e,N);ut(",");var r=nt();if(!m.test(r))throw i(r,N);ut(">");var n=nt();if(!g.test(n))throw i(n,A);n=y(n),ut("=");var s=L(nt()),o=Z(new f(n,s,e,r));t.add(o)}function U(t,e){var r=nt();if(!g.test(r))throw i(r,A);r=y(r);var n=new l(r);if(ut(S,!0)){for(;(e=nt())!==T;)e===O?(K(n,e),ut(E)):(st(e),C(n,x));ut(E,!0)}else ut(E);t.add(n)}function D(t,e){var n=nt();if(!g.test(n))throw i(n,A);var s={},o=new h(n,s);if(ut(S,!0)){for(;(e=nt())!==T;)r(e)===O?K(o):_(o,e);ut(E,!0)}else ut(E);t.add(o)}function _(t,e){if(!g.test(e))throw i(e,A);var r=e;ut("=");var n=L(nt(),!0);t.values[r]=n,Z({})}function K(t,e){var r=ut(j,!0),n=nt();if(!m.test(n))throw i(n,A);r&&(ut(F),n=j+n+F,e=ot(),w.test(e)&&(n+=e,nt())),ut("="),H(t,n)}function H(t,e){if(ut(S,!0))for(;(lt=nt())!==T;){if(!g.test(lt))throw i(lt,A);e=e+"."+lt,ut(":",!0)?W(t,e,v(!0)):H(t,e)}else W(t,e,v(!0))}function W(t,e,i){t.setOption?t.setOption(e,i):t[e]=i}function Z(t){if(ut("[",!0)){do K(t,O);while(ut(",",!0));ut("]")}return ut(E),t}function G(t,e){if(e=nt(),!g.test(e))throw i(e,"service name");var n=e,s=new c(n);if(ut(S,!0)){for(;(e=nt())!==T;){var o=r(e);switch(o){case O:K(s,o),ut(E);break;case"rpc":X(s,o);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(s)}function X(t,e){var n=e,s=nt();if(!g.test(s))throw i(s,A);var o,u,a,f;ut(j);var l;if(ut(l="stream",!0)&&(u=!0),!m.test(e=nt()))throw i(e);if(o=e,ut(F),ut("returns"),ut(j),ut(l,!0)&&(f=!0),!m.test(e=nt()))throw i(e);a=e,ut(F);var h=new d(s,n,o,a,u,f);if(ut(S,!0)){for(;(e=nt())!==T;){var c=r(e);switch(c){case O:K(h,c),ut(E);break;default:throw i(e)}}ut(E,!0)}else ut(E);t.add(h)}function Q(t,e){var n=nt();if(!m.test(n))throw i(n,"reference");if(ut(S,!0)){for(;(e=nt())!==T;){var s=r(e);switch(s){case b:case k:case x:C(t,s,n);break;default:if(!ft||!m.test(e))throw i(e);st(e),C(t,x,n)}}ut(E,!0)}else ut(E)}e||(e=new o);var Y,tt,et,it,rt=s(t),nt=rt.next,st=rt.push,ot=rt.peek,ut=rt.skip,at=!0,ft=!1;e||(e=new o);for(var lt,ht=e;null!==(lt=nt());){var ct=r(lt);switch(ct){case"package":if(!at)throw i(lt);V();break;case"import":if(!at)throw i(lt);P();break;case"syntax":if(!at)throw i(lt);R();break;case O:if(!at)throw i(lt);K(ht,lt),ut(E);break;default:if($(ht,lt)){at=!1;continue}throw i(lt)}}return{package:Y,imports:tt,weakImports:et,syntax:it,root:e}}e.exports=n;var s=t(22),o=t(18),u=t(23),a=t(8),f=t(10),l=t(14),h=t(7),c=t(21),d=t(11),p=t(24),v=t(25),y=v.camelCase,g=/^[a-zA-Z_][a-zA-Z_0-9]*$/,m=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,w=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,b="required",k="repeated",x="optional",O="option",A="name",N="type",S="{",T="}",j="(",F=")",E=";",B='"',J="'"},{10:10,11:11,14:14,18:18,21:21,22:22,23:23,24:24,25:25,7:7,8:8}],16:[function(t,e,i){"use strict";function r(t){if(t)for(var e=Object.keys(t),i=0;i "+t.len)}function n(){x.Long?(S.int64=a,S.uint64=l,S.sint64=c,S.fixed64=v,S.sfixed64=g):(S.int64=f,S.uint64=h,S.sint64=d,S.fixed64=y,S.sfixed64=m)}function s(t){this.buf=t,this.pos=0,this.len=t.length}function o(t,e){this.id=t,this.wireType=e}function u(){var t=0,e=0,i=0,n=0;if(this.len-this.pos>9){for(i=0;i<4;++i)if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i)if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}else{for(i=0;i<4;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<7*i,n<128)return new A(t>>>0,e>>>0)}if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],t|=(127&n)<<28,e|=(127&n)>>4,n<128)return new A(t>>>0,e>>>0);for(i=0;i<5;++i){if(this.pos>=this.len)throw r(this);if(n=this.buf[this.pos++],e|=(127&n)<<7*i+3,n<128)return new A(t>>>0,e>>>0)}}throw Error("invalid varint encoding")}function a(){return u.call(this).toLong()}function f(){return u.call(this).toNumber()}function l(){return u.call(this).toLong(!0)}function h(){return u.call(this).toNumber(!0)}function c(){return u.call(this).zzDecode().toLong()}function d(){return u.call(this).zzDecode().toNumber()}function p(){if(this.pos+8>this.len)throw r(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 v(){return p.call(this).toLong(!0)}function y(){return p.call(this).toNumber(!0)}function g(){return p.call(this).zzDecode().toLong()}function m(){return p.call(this).zzDecode().toNumber()}function w(t){F&&F(),s.call(this,t)}function b(t,e,i){return t.utf8Slice(e,i)}function k(t,e,i){return t.toString("utf8",e,i)}e.exports=s,s.BufferReader=w;var x=t(28),O=t(1),A=x.LongBits,N="undefined"!=typeof Uint8Array?Uint8Array:Array;s.configure=n,s.create=function(t){return new(x.Buffer&&x.Buffer.isBuffer(t)&&w||s)(t)};var S=s.prototype;S.h=N.prototype.subarray||N.prototype.slice,S.tag=function(){if(this.pos>=this.len)throw r(this);return new o(this.buf[this.pos]>>>3,7&this.buf[this.pos++])},S.int32=function(){var t=this.buf[this.pos++],e=127&t;if(t>127&&(t=this.buf[this.pos++],e|=(127&t)<<7,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<14,t>127&&(t=this.buf[this.pos++],e|=(127&t)<<21,t>127&&(t=this.buf[this.pos++],e|=t<<28,t>127&&(this.pos+=5))))),this.pos>this.len)throw this.pos=this.len,r(this);return e},S.uint32=function(){return this.int32()>>>0},S.sint32=function(){var t=this.int32();return t>>>1^-(1&t)},S.bool=function(){return 0!==this.int32()},S.fixed32=function(){if(this.pos+4>this.len)throw r(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},S.sfixed32=function(){var t=this.fixed32();return t>>>1^-(1&t)};var T="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r],t[0]}:function(i,r){return e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,23,4)};S.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=T(this.buf,this.pos);return this.pos+=4,t};var j="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r){return e[0]=i[r++],e[1]=i[r++],e[2]=i[r++],e[3]=i[r++],e[4]=i[r++],e[5]=i[r++],e[6]=i[r++],e[7]=i[r],t[0]}:function(i,r){return e[7]=i[r++],e[6]=i[r++],e[5]=i[r++],e[4]=i[r++],e[3]=i[r++],e[2]=i[r++],e[1]=i[r++],e[0]=i[r],t[0]}}():function(t,e){return O.read(t,e,!1,52,8)};S.double=function(){if(this.pos+8>this.len)throw r(this,4);var t=j(this.buf,this.pos);return this.pos+=8,t},S.bytes=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,e===i?new this.buf.constructor(0):this.h.call(this.buf,e,i)},S.string=function(){var t=this.bytes(),e=t.length;if(e){for(var i=new Array(e),r=0,n=0;r191&&s<224)i[n++]=(31&s)<<6|63&t[r++];else if(s>239&&s<365){var o=((7&s)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536;i[n++]=55296+(o>>10),i[n++]=56320+(1023&o)}else i[n++]=(15&s)<<12|(63&t[r++])<<6|63&t[r++]}return String.fromCharCode.apply(String,i.slice(0,n))}return""},S.skip=function(t){if(void 0===t){do if(this.pos>=this.len)throw r(this);while(128&this.buf[this.pos++])}else{if(this.pos+t>this.len)throw r(this,t);this.pos+=t}return this},S.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var e=this.tag();if(4===e.wireType)break;this.skipType(e.wireType)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type: "+t)}return this},S.reset=function(t){return t?(this.buf=t, +this.len=t.length):(this.buf=null,this.len=0),this.pos=0,this},S.finish=function(t){var e=this.pos?this.h.call(this.buf,this.pos):this.buf;return this.reset(t),e};var F=function(){if(!x.Buffer)throw Error("Buffer is not supported");E.h=x.Buffer.prototype.slice,B=x.Buffer.prototype.utf8Slice?b:k,F=!1},E=w.prototype=Object.create(s.prototype);E.constructor=w,"undefined"==typeof Float32Array&&(E.float=function(){if(this.pos+4>this.len)throw r(this,4);var t=this.buf.readFloatLE(this.pos,!0);return this.pos+=4,t}),"undefined"==typeof Float64Array&&(E.double=function(){if(this.pos+8>this.len)throw r(this,8);var t=this.buf.readDoubleLE(this.pos,!0);return this.pos+=8,t});var B;E.string=function(){var t=this.int32()>>>0,e=this.pos,i=this.pos+t;if(i>this.len)throw r(this,t);return this.pos+=t,B(this.buf,e,i)},E.finish=function(t){var e=this.pos?this.buf.slice(this.pos):this.buf;return this.reset(t),e},n()},{1:1,28:28}],18:[function(t,e,i){"use strict";function r(t){s.call(this,"",t),this.deferred=[],this.files=[]}function n(t){var e=t.parent.lookup(t.extend);if(e){var i=new u(t.getFullName(),t.id,t.type,t.rule,(void 0),t.options);return i.declaringField=t,t.extensionField=i,e.add(i),!0}return!1}e.exports=r;var s=t(12),o=s.extend(r),u=t(8),a=t(25),f=t(6);r.fromJSON=function(t,e){return e||(e=new r),e.setOptions(t.options).addJSON(t.nested)},o.resolvePath=a.resolvePath,o.load=function e(i,r){function n(t,e){if(r){var i=r;r=null,i(t,e)}}function s(e,i){try{if(a.isString(i)&&"{"===i.charAt(0)&&(i=JSON.parse(i)),a.isString(i)){var r=t(15)(i,u);r.imports&&r.imports.forEach(function(t){o(u.resolvePath(e,t))}),r.weakImports&&r.weakImports.forEach(function(t){o(u.resolvePath(e,t),!0)})}else u.setOptions(i.options).addJSON(i.nested)}catch(t){return void n(t)}l||n(null,u)}function o(t,e){var i=t.indexOf("google/protobuf/");if(i>-1){var o=t.substring(i);o in f&&(t=o)}if(!(u.files.indexOf(t)>-1)){if(u.files.push(t),t in f)return++l,void setTimeout(function(){--l,s(t,f[t])});++l,a.fetch(t,function(i,o){if(--l,r)return i?void(e||n(i)):void s(t,o)})}}var u=this;if(!r)return a.asPromise(e,u,i);var l=0;a.isString(i)&&(i=[i]),i.forEach(function(t){o(u.resolvePath("",t))}),l||n(null)},o.e=function(t){var e=this.deferred.slice();this.deferred=[];for(var i=0;i-1&&this.deferred.splice(e,1)}t.extensionField&&(t.extensionField.parent.remove(t.extensionField),t.extensionField=null)}else if(t instanceof s)for(var i=t.getNestedArray(),r=0;r-1&&this.i[t].splice(i,1)}else this.i[t]=[];else this.i={};return this},n.emit=function(t){if(this.i[t])for(var e=Array.prototype.slice.call(arguments,1),i=0;i0)return m.shift();if(w)return i();var r,o,u;do{if(v===y)return null;for(r=!1;/\s/.test(u=n(v));)if(u===a&&++g,++v===y)return null;if(n(v)===f){if(++v===y)throw e("comment");if(n(v)===f){for(;n(++v)!==a;)if(v===y)return null;++v,++g,r=!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,r=!0}}}while(r);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(t,e,i){"use strict";function r(t,e){s.call(this,t,e),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(t){return t.k=t.l=t.n=t.o=null,delete t.encode,delete t.decode,t}e.exports=r;var s=t(12),o=s.prototype,u=s.extend(r),a=t(7),f=t(14),l=t(8),h=t(21),c=t(16),d=t(17),p=t(29),v=t(9),y=t(25),g=t(2);y.props(u,{fieldsById:{get:function(){if(this.k)return this.k;this.k={};for(var t=Object.keys(this.fields),e=0;e0?e.splice(--n,2):i?e.splice(n,1):++n:"."===e[n]?e.splice(n,1):++n;return r+e.join("/")}var util=exports;util.isString=isString,util.isObject=function(t){return Boolean(t&&"object"==typeof t)},util.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},util.toArray=function(t){if(!t)return[];for(var e=Object.keys(t),i=e.length,r=new Array(i),n=0;n>>0,n=(t-i)/4294967296>>>0;return e&&(n=~n>>>0,i=~i>>>0,++i>4294967295&&(i=0,++n>4294967295&&(n=0))),new r(i,n)},r.from=function(t){switch(typeof t){case"number":return r.fromNumber(t);case"string":t=n.Long.fromString(t)}return(t.low||t.high)&&new r(t.low>>>0,t.high>>>0)||o},s.toNumber=function(t){return!t&&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(t){return new n.Long(this.lo,this.hi,t)};var u=String.prototype.charCodeAt;r.fromHash=function(t){return new r((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,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 t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},s.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},s.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<1<<21?3:4:e<16384?e<128?5:6:e<1<<21?7:8:i<128?9:10}},{25:25}],27:[function(t,e,i){"use strict";function r(t,e,i){var r=i||8192,n=r>>>1,s=null,o=r;return function(i){if(i>n)return t(i);o+i>r&&(s=t(r),o=0);var u=e.call(s,o,o+=i);return 7&o&&(o=(7|o)+1),u}}e.exports=r},{}],28:[function(t,e,i){(function(e){"use strict";var r=i,n=r.LongBits=t(26);r.pool=t(27);var s=r.isNode=Boolean(e.process&&e.process.versions&&e.process.versions.node);if(r.Buffer=null,s)try{r.Buffer=t("buffer").Buffer}catch(t){}if(r.Long=e.dcodeIO&&e.dcodeIO.Long||null,!r.Long&&s)try{r.Long=t("long")}catch(t){}r.longToHash=function(t){return t?n.from(t).toHash():"\0\0\0\0\0\0\0\0"},r.longFromHash=function(t,e){var i=n.fromHash(t);return r.Long?r.Long.fromBits(i.lo,i.hi,e):i.toNumber(Boolean(e))},r.longNeq=function(t,e){return"number"==typeof t?"number"==typeof e?t!==e:(t=n.fromNumber(t)).lo!==e.low||t.hi!==e.high:"number"==typeof e?(e=n.fromNumber(e)).lo!==t.low||e.hi!==t.high:t.low!==e.low||t.high!==e.high},r.props=function(t,e){Object.keys(e).forEach(function(i){r.prop(t,i,e[i])})},r.prop=function(t,e,i){var r=!-[1],n=e.substring(0,1).toUpperCase()+e.substring(1);i.get&&(t["get"+n]=i.get),i.set&&(t["set"+n]=r?function(t){i.set.call(this,t),this[e]=t}:i.set),r?void 0!==i.value&&(t[e]=i.value):Object.defineProperty(t,e,i)},r.emptyArray=Object.freeze([]),r.emptyObject=Object.freeze({})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{26:26,27:27,buffer:"buffer",long:"long"}],29:[function(t,e,i){"use strict";function r(t,e,i){this.fn=t,this.val=e,this.len=i,this.next=null}function n(){}function s(t,e){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=e}function o(){this.len=0,this.head=new r(n,0,0),this.tail=this.head,this.states=null}function u(t,e,i){t[e]=255&i}function a(t,e,i){for(;i>127;)t[e++]=127&i|128,i>>>=7;t[e]=i}function f(t,e,i){for(;i.hi;)t[e++]=127&i.lo|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0,i.hi>>>=7;for(;i.lo>127;)t[e++]=127&i.lo|128,i.lo=i.lo>>>7;t[e++]=i.lo}function l(t,e,i){t[e++]=255&i,t[e++]=i>>>8&255,t[e++]=i>>>16&255,t[e]=i>>>24}function h(t,e,i){for(var r=0;r>6|192,t[e++]=63&s|128):55296===(64512&s)&&56320===(64512&(n=i.charCodeAt(r+1)))?(s=65536+((1023&s)<<10)+(1023&n),++r,t[e++]=s>>18|240,t[e++]=s>>12&63|128,t[e++]=s>>6&63|128,t[e++]=63&s|128):(t[e++]=s>>12|224,t[e++]=s>>6&63|128,t[e++]=63&s|128)}}function c(t){for(var e=t.length>>>0,i=0,r=0;r>>=0,t<128?this.push(u,1,t):this.push(a,t<16384?2:t<2097152?3:t<268435456?4:5,t)},k.int32=function(t){return t<0?this.push(f,10,w.fromNumber(t)):this.uint32(t)},k.sint32=function(t){return this.uint32(t<<1^t>>31)},k.uint64=function(t){var e=w.from(t);return this.push(f,e.length(),e)},k.int64=k.uint64,k.sint64=function(t){var e=w.from(t).zzEncode();return this.push(f,e.length(),e)},k.bool=function(t){return this.push(u,1,t?1:0)},k.fixed32=function(t){return this.push(l,4,t>>>0)},k.sfixed32=function(t){return this.push(l,4,t<<1^t>>31)},k.fixed64=function(t){var e=w.from(t);return this.push(l,4,e.hi).push(l,4,e.lo)},k.sfixed64=function(t){var e=w.from(t).zzEncode();return this.push(l,4,e.hi).push(l,4,e.lo)};var x="undefined"!=typeof Float32Array?function(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[3]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r]=e[3]}:function(i,r,n){t[0]=n,i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,23,4)};k.float=function(t){return this.push(x,4,t)};var O="undefined"!=typeof Float64Array?function(){var t=new Float64Array(1),e=new Uint8Array(t.buffer);return t[0]=-0,e[7]?function(i,r,n){t[0]=n,i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r]=e[7]}:function(i,r,n){t[0]=n,i[r++]=e[7],i[r++]=e[6],i[r++]=e[5],i[r++]=e[4],i[r++]=e[3],i[r++]=e[2],i[r++]=e[1],i[r]=e[0]}}():function(t,e,i){m.write(t,i,e,!1,52,8)};k.double=function(t){return this.push(O,8,t)};var A=b.prototype.set?function(t,e,i){t.set(i,e)}:function(t,e,i){for(var r=0;r>>0;return e?this.uint32(e).push(A,e,t):this.push(u,1,0)},k.string=function(t){var e=c(t);return e?this.uint32(e).push(h,e,t):this.push(u,1,0)},k.fork=function(){return this.states=new s(this,this.states),this.head=this.tail=new r(n,0,0),this.len=0,this},k.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 r(n,0,0),this.len=0),this},k.ldelim=function(t){var e=this.head,i=this.tail,r=this.len;return this.reset(),void 0!==t&&this.tag(t,2),this.uint32(r),this.tail.next=e.next,this.tail=i,this.len+=r,this},k.finish=function(){var t=this.head.next,e=this.constructor.alloc(this.len);this.reset();for(var i=0;t;)t.fn(e,i,t.val),i+=t.len,t=t.next;return e},d.alloc=function(t){return d.alloc=g.Buffer.allocUnsafe?g.Buffer.allocUnsafe:function(t){return new g.Buffer(t)},d.alloc(t)};var N=d.prototype=Object.create(o.prototype);N.constructor=d,"undefined"==typeof Float32Array&&(N.float=function(t){return this.push(p,4,t)}),"undefined"==typeof Float64Array&&(N.double=function(t){return this.push(v,8,t)}),b.prototype.set&&g.Buffer&&g.Buffer.prototype.set||(N.bytes=function(t){var e=t.length>>>0;return e?this.uint32(e).push(y,e,t):this.push(u,1,0)});var S=function(){return g.Buffer&&g.Buffer.prototype.utf8Write?function(t,e,i){i.length<40?h(t,e,i):t.utf8Write(i,e)}:function(t,e,i){i.length<40?h(t,e,i):t.write(i,e)}}();N.string=function(t){var e=t.length<40?c(t):g.Buffer.byteLength(t);return e?this.uint32(e).push(S,e,t):this.push(u,1,0)}},{1:1,28:28}],30:[function(t,e,i){(function(e){"use strict";function r(t,e,i){return"function"==typeof e?(i=e,e=new n.Root):e||(e=new n.Root),e.load(t,i)}var n=e.protobuf=i;n.load=r,n.tokenize=t(22),n.parse=t(15),n.Writer=t(29),n.BufferWriter=n.Writer.BufferWriter,n.Reader=t(17),n.BufferReader=n.Reader.BufferReader,n.codegen=t(2),n.ReflectionObject=t(13),n.Namespace=t(12),n.Root=t(18),n.Enum=t(7),n.Type=t(23),n.Field=t(8),n.OneOf=t(14),n.MapField=t(10),n.Service=t(21),n.Method=t(11),n.Prototype=t(16),n.inherits=t(9),n.types=t(24),n.common=t(6),n.rpc=t(19),n.util=t(25),"function"==typeof define&&define.amd&&define(["long"],function(t){return t&&(n.util.Long=t,n.Reader.configure()),n})}).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,29:29,6:6,7:7,8:8,9:9}]},{},[30]); //# sourceMappingURL=protobuf.min.js.map diff --git a/dist/protobuf.min.js.gz b/dist/protobuf.min.js.gz index 7222e1d30c3ca6a677992b679757de4ea127b530..21329398f81a453792ff5570a74ebc28dc8d5692 100644 GIT binary patch delta 16549 zcmV(nK=QwZfdR&X0gy`s?A&&CkxxN?Q@{J%?{*qLfA|(lzKO;>&Y6$UO!)Wj4()MHle976 zc^EA+sCxLPz3Dn0=h#^8au%`FyVEJLo3OQa7fs#0Xqb$|7pJf5Fl~f^ql!9zL6G0B zcrtCI{9o%R<;|x2=wqFAvl)6R&(~?(2%*uvj)&=)O3P##wmJ=Be$#lBrb+5L--dCV z zb8pKQ%+$=8fZbM>!Y)gY=-w!oclbT&z9#oCe{G7hSf02oBEJJctGz zKZevXe06>Jm<0Kdx8|chPGjB*#w-gaO{{&e!0MA1FMSnrbN_7*eo7B_=Z0Q6+ka=0qJ(%|SBIAgS8Kh~9S6N57+^fGT0iI=dk6OKvop`{0F=`~27~Fa6@1~S z*mb}!I-3nn8_=VB2)|%OIs`^8CKX<0F85fJ!NlQXv*Az}raf?f*MUmJI)GFQ&j;XB zt?43xCg^jK%%I32eZP6z^B8~ThBm+s63@HnHk)p8aKOT60TyWmNo)Qh=nlq*p+B}k z*FBhH6XA=XhgDiF79L_1D!;%{$)U&wAi;&=2e1TID=}6G<}l!O!0n8AO~Ih!dHwiB zaNf^{QEM^+3_59luGyp&tl0Vx@rlJ2_9Yh=@n+4Ytsw4C0pqMniKvu_N>i#t*$1o9 zCg}FgpIvXa>~1?^z3S$3)){YPc^Zv#r>_ZU>RQw^cLmY?SJ6x?6w{E;% zELfP%)=M7e8LVe8MueYB8X&5r!F;Gv4!Wa$*3NmByQw!>h=NvY?1$=iv)O7zY;At- z$#1{~m&yXR0k!of&F0jUf~0iTXx%nUmij!mnKMj*vP7~pb2iHk7X-Hm^umlze+8oZo!9fEV zlg?b zI)v?c_{(tna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vF17rV$xt zHNh9w~0Pecofn_`yn7_sW`o4jo%^S&G6=bbY@WpXwpfn18ZYu1+<2$O|m?}Vp z`fqn5+T3aYx00_%jlg>&f7siHaPj*cP%4FS?43X5=Ao*blj`bf^bkI9Bao{ED-ySV zN)i~2iC-vFh`FSA)sZKSkfrMbhIozou?S8G3__b6=%X)OzRDJhn1LcRApDY|vv6aM zi}JL}Eu=yr`SyfxfsTt0QmEWQDilJ-dB({W!J{Uo3rO5P8V=jHQ z#f0Tka&h}ryj}_q?YK<=gT>o&aa)F)bg9(4n7>mV+;RJdaHVp)1cCSBDNgCr4FxEA zjf{;Ix3%ksboP$h(m5m(UfwZ9!_4FZbvU)uQd-Vv)qBWQ>~WlhU#9lZ+Xtq$}CjQ@`m*@dU;gz^57-#t<${1iT|V90MjY=`Fj zJ07> 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 = codegen;\r\n\r\nvar util = require(23);\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 {CodegenInstance} 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 CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} 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(4);\r\ncodegen.decode = require(3);\r\ncodegen.verify = require(5);\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(7),\r\n Reader = require(17),\r\n types = require(22),\r\n util = require(23),\r\n codegen = require(2);\r\n\r\n/**\r\n * Decodes a message of `this` message's 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 {Prototype} 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 decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link 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(13);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(21),\r\n Enum = require(7),\r\n MapField = require(10),\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. 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.role, 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 Prototype#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 = inherits;\r\n\r\nvar Prototype = require(16),\r\n Type = require(21),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Options passed to {@link inherits}, modifying its behavior.\r\n * @typedef InheritanceOptions\r\n * @type {Object}\r\n * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor\r\n * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type\r\n */\r\n\r\n/**\r\n * Inherits a custom class from the message prototype of the specified message type.\r\n * @param {*} clazz Inheriting class constructor\r\n * @param {Type} type Inherited message type\r\n * @param {InheritanceOptions} [options] Inheritance options\r\n * @returns {Prototype} Created prototype\r\n */\r\nfunction inherits(clazz, type, options) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"clazz\", \"a function\");\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n if (!options)\r\n options = {};\r\n\r\n /**\r\n * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library.\r\n * @name Class\r\n * @extends Prototype\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set on the message\r\n * @see {@link inherits}\r\n */\r\n\r\n var classProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Class.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n if (!options.noStatics)\r\n util.merge(classProperties, {\r\n\r\n /**\r\n * Encodes a message of this type to a buffer.\r\n * @name Class.encode\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encode: {\r\n value: function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Encodes a message of this type preceeded by its length as a varint to a buffer.\r\n * @name Class.encodeDelimited\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encodeDelimited: {\r\n value: function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type from a buffer.\r\n * @name Class.decode\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decode: {\r\n value: function decode(buffer) {\r\n return this.$type.decode(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type preceeded by its length as a varint from a buffer.\r\n * @name Class.decodeDelimited\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decodeDelimited: {\r\n value: function decodeDelimited(buffer) {\r\n return this.$type.decodeDelimited(buffer);\r\n }\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 {Prototype|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 verify: {\r\n value: function verify(message) {\r\n return this.$type.verify(message);\r\n }\r\n }\r\n\r\n }, true);\r\n\r\n util.props(clazz, classProperties);\r\n var prototype = inherits.defineProperties(new Prototype(), type);\r\n clazz.prototype = prototype;\r\n prototype.constructor = clazz;\r\n\r\n if (!options.noRegister)\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Defines the reflected type's default values and virtual oneof properties on the specified prototype.\r\n * @memberof inherits\r\n * @param {Prototype} prototype Prototype to define properties upon\r\n * @param {Type} type Reflected message type\r\n * @returns {Prototype} The specified prototype\r\n */\r\ninherits.defineProperties = function defineProperties(prototype, type) {\r\n\r\n var prototypeProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Prototype#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n // Initialize default values\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 // Define each oneof with a non-enumerable getter and setter for the present 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 util.props(prototype, prototypeProperties);\r\n return prototype;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(8);\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(7),\r\n types = require(22),\r\n util = require(23);\r\n\r\n/**\r\n * Constructs a new map field.\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 = Method;\r\n\r\nvar ReflectionObject = require(13);\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.\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(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(7),\r\n Type = require(21),\r\n Field = require(8),\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.\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(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new reflection object.\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} Prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var proto = constructor.prototype = Object.create(this.prototype);\r\n proto.constructor = constructor;\r\n constructor.extend = extend;\r\n return proto;\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(13);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(8),\r\n util = require(23);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof.\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(18),\r\n Type = require(21),\r\n Field = require(8),\r\n MapField = require(10),\r\n OneOf = require(14),\r\n Enum = require(7),\r\n Service = require(19),\r\n Method = require(11),\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 default-case, 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 = Prototype;\r\n\r\n/**\r\n * Constructs a new prototype.\r\n * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`.\r\n * @classdesc Runtime message prototype ready to be extended by custom classes or generated code.\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link inherits}\r\n * @see {@link Class}\r\n */\r\nfunction Prototype(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/**\r\n * Converts a runtime 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\nPrototype.prototype.asJSON = function asJSON(options) {\r\n var any = !(options && options.fieldsOnly),\r\n fields = this.constructor.$type.fields,\r\n json = {};\r\n var keys;\r\n if (options && 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 (any)\r\n json[key] = value;\r\n }\r\n return json;\r\n};\r\n","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(26),\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 * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\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\n/**\r\n * Constructs a new reader 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.\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\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(8),\r\n util = require(23),\r\n common = require(6);\r\n\r\n/**\r\n * Constructs a new root namespace.\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/**\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 {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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 // 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(15)(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 (!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 ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\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 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 (!queued)\r\n finish(null);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\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\nmodule.exports = Service;\r\n\r\nvar Namespace = require(12);\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(11),\r\n util = require(23);\r\n\r\n/**\r\n * Constructs a new service.\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 * @function\r\n * @param {Method} method Reflected method being called\r\n * @param {Uint8Array} requestData Request data\r\n * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data\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)} rpc 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 {Object} Runtime service\r\n */\r\nServicePrototype.create = function create(rpc, requestDelimited, responseDelimited) {\r\n var rpcService = {};\r\n util.prop(rpcService, \"$rpc\", {\r\n value: rpc\r\n });\r\n this.getMethodsArray().forEach(function(method) {\r\n var lcName = method.name.substring(0, 1).toLowerCase() + method.name.substring(1);\r\n rpcService[lcName] = function(request, callback) {\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 rpc(method, requestData, function(err, responseData) {\r\n if (err) {\r\n callback(err);\r\n return;\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 callback(err2);\r\n return;\r\n }\r\n callback(null, response);\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 default-case, 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 default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(12);\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(7),\r\n OneOf = require(14),\r\n Field = require(8),\r\n Service = require(19),\r\n Prototype = require(16),\r\n Reader = require(17),\r\n Writer = require(27),\r\n inherits = require(9),\r\n util = require(23),\r\n codegen = require(2);\r\n\r\n/**\r\n * Constructs a new message type.\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 {Prototype}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n if (this._ctor)\r\n return this._ctor;\r\n var ctor;\r\n if (codegen.supported)\r\n ctor = codegen(\"p\")(\"P.call(this,p)\").eof(this.getFullName() + \"$ctor\", {\r\n P: Prototype\r\n });\r\n else\r\n ctor = function GenericMessage(properties) {\r\n Prototype.call(this, properties);\r\n };\r\n ctor.prototype = inherits(ctor, this);\r\n this._ctor = ctor;\r\n return ctor;\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\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 * @param {*} [ctor] Constructor to use.\r\n * Defaults to use the internal constuctor.\r\n * @returns {Prototype} Message instance\r\n */\r\nTypePrototype.create = function create(properties, ctor) {\r\n if (!properties || typeof properties === 'function') {\r\n ctor = properties;\r\n properties = undefined;\r\n } else if (properties /* already */ instanceof Prototype)\r\n return properties;\r\n if (ctor) {\r\n if (!(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n } else\r\n ctor = this.getCtor();\r\n return new ctor(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Prototype|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 {Prototype|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).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 {Prototype} 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 {Prototype} 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 enum values are valid and that any required fields are present.\r\n * @param {Prototype|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 })\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(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 * Utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\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 * 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 * 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 * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\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 try {\r\n // Hide this from webpack. There is probably another, better way.\r\n return eval(['req','uire'].join(''))(\"fs\") // eslint-disable-line no-eval\r\n .readFile(path, \"utf8\", callback);\r\n } catch (e) { } // eslint-disable-line no-empty\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 (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\n// Merge in runtime utility\r\nutil.merge(util, require(26));\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 * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\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 new util.Long(this.lo, this.hi, 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 * 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\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(26),\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.\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.\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.\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 | val.hi << 25) >>> 0;\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.hi).push(writeFixed32, 4, bits.lo);\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.hi).push(writeFixed32, 4, bits.lo);\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\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\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} value Value 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 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#ldelim}, {@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 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.\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 // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\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 * 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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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:function):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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\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// 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\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.Prototype = require(\"./prototype\");\r\nprotobuf.inherits = require(\"./inherits\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.util = require(\"./util\");\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 protobuf.Reader.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/codegen.js","src/codegen/decode.js","src/codegen/encode.js","src/codegen/verify.js","src/common.js","src/enum.js","src/field.js","src/inherits.js","src/mapfield.js","src/method.js","src/namespace.js","src/object.js","src/oneof.js","src/parse.js","src/prototype.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/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","codegen","gen","line","util","sprintf","apply","arguments","level","indent","src","prev","blockOpenRe","test","branchRe","casingRe","inCase","breakRe","blockCloseRe","index","push","str","name","replace","args","join","eof","scope","undefined","source","verbose","console","keys","Object","Function","concat","map","key","Array","prototype","slice","supported","encode","decode","verify","Enum","Reader","types","fallback","readerOrBuffer","fields","this","getFieldsById","reader","create","limit","len","pos","message","getCtor","tag","field","id","resolve","type","resolvedType","keyType","resolvedKeyType","uint32","ks","vs","basic","longToHash","repeated","values","packed","wireType","plimit","skipType","generate","mtype","getFieldsArray","prop","safeProp","Writer","writer","fi","fork","mapKey","ldelim","required","long","longNeq","defaultValue","reset","keyWireType","Type","getFullName","getValuesById","reason","hasReasonVar","toArray","j","common","json","nested","google","protobuf","Any","type_url","timeType","Duration","seconds","nanos","Timestamp","Empty","Struct","Value","oneofs","kind","oneof","nullValue","numberValue","stringValue","boolValue","structValue","listValue","NullValue","NULL_VALUE","ListValue","rule","options","ReflectionObject","_valuesById","clearCache","enm","EnumPrototype","extend","_TypeError","props","valuesById","get","forEach","testJSON","Boolean","fromJSON","toJSON","add","isString","isInteger","remove","Field","isObject","toString","toLowerCase","optional","partOf","Long","extensionField","declaringField","_packed","FieldPrototype","MapField","isPacked","getOption","setOption","ifNotSet","role","resolved","typeDefault","defaults","parent","lookup","optionDefault","fromValue","jsonConvert","String","Number","toNumber","charAt","inherits","clazz","classProperties","$type","noStatics","merge","encodeDelimited","decodeDelimited","defineProperties","Prototype","constructor","noRegister","setCtor","prototypeProperties","isArray","emptyArray","emptyObject","getOneofsArray","indexOf","set","MapFieldPrototype","Method","requestType","responseType","requestStream","responseStream","resolvedRequestType","resolvedResponseType","MethodPrototype","Namespace","_nestedArray","namespace","arrayToJSON","array","obj","NamespacePrototype","Service","nestedTypes","nestedError","ctor","nestedArray","methods","addJSON","getNestedArray","nestedJson","ns","nestedName","object","setOptions","onAdd","onRemove","define","path","split","ptr","part","shift","resolveAll","parentAlreadyChecked","getRoot","found","proto","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","properties","asJSON","k","fieldsOnly","indexOutOfRange","writeLength","RangeError","configure","ReaderPrototype","int64","read_int64_long","uint64","read_uint64_long","sint64","read_sint64_long","fixed64","read_fixed64_long","sfixed64","read_sfixed64_long","read_int64_number","read_uint64_number","read_sint64_number","read_fixed64_number","read_sfixed64_number","buf","Tag","readLongVarint","lo","hi","b","LongBits","toLong","zzDecode","readLongFixed","BufferReader","initBufferReader","readStringBuffer_utf8Slice","utf8Slice","readStringBuffer_toString","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","deferred","files","handleExtension","extendedType","sisterField","RootPrototype","resolvePath","load","filename","callback","err","cb","process","JSON","parsed","self","fetch","queued","weak","idx","altname","setTimeout","asPromise","newDeferred","rpc","rpcImpl","$rpc","_listeners","ServicePrototype","on","evt","off","emit","_methodsArray","methodsArray","methodName","inherited","getMethodsArray","requestDelimited","responseDelimited","rpcService","lcName","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","expected","actual","equals","_fieldsById","_fieldsArray","_repeatedFieldsArray","_oneofsArray","_ctor","TypePrototype","fieldsById","names","fieldsArray","repeatedFieldsArray","filter","oneofsArray","P","fieldName","oneOfName","fld","bake","fn","ctx","Promise","reject","onload","xhr","status","responseText","eval","readFile","XMLHttpRequest","onreadystatechange","readyState","open","send","isAbsolutePath","normalizePath","parts","prefix","isFinite","description","TypeError","originPath","importPath","alreadyNormalized","dst","format","params","param","stringify","underScore","newBuffer","size","allocUnsafe","LongBitsPrototype","zero","zzEncode","fromNumber","from","fromString","low","high","unsigned","charCodeAt","fromHash","hash","toHash","mask","part0","part1","part2","pool","alloc","SIZE","MAX","slab","isNode","global","versions","node","dcodeIO","longFromHash","bits","fromBits","target","descriptors","descriptor","ie8","ucKey","defineProperty","freeze","Op","val","noop","State","tail","states","writeByte","writeVarint32","writeVarint64","writeFixed32","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,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F,OAAA5O,EAAA,IAGA8I,EAAAkF,UAAAhO,EAAA,IACA8I,EAAAyE,SAAAvN,EAAA,GAGA8I,EAAA5D,MAAAlF,EAAA,IACA8I,EAAAJ,OAAA1I,EAAA,GACA8I,EAAAgU,IAAA9c,EAAA,IACA8I,EAAAvG,KAAAvC,EAAA,IAGA,kBAAA0Q,SAAAA,OAAAuW,KACAvW,QAAA,QAAA,SAAA1E,GAKA,MAJAA,KACAlD,EAAAvG,KAAAyJ,KAAAA,EACAlD,EAAA7D,OAAAmS,aAEAtO","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 = 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 {CodegenInstance} 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 CodegenInstance\r\n * @type {function}\r\n * @param {string} format Format string\r\n * @param {...*} args Replacements\r\n * @returns {CodegenInstance} 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(4);\r\ncodegen.decode = require(3);\r\ncodegen.verify = require(5);\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(7),\r\n Reader = require(17),\r\n types = require(24),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Decodes a message of `this` message's 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 {Prototype} 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 decoder specific to the specified message type, with an identical signature to {@link codegen.decode.fallback}.\r\n * @param {Type} mtype Message type\r\n * @returns {CodegenInstance} {@link 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(13);\r\n/** @alias Field.prototype */\r\nvar FieldPrototype = ReflectionObject.extend(Field);\r\n\r\nvar Type = require(23),\r\n Enum = require(7),\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. 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.role, 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 Prototype#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 = inherits;\r\n\r\nvar Prototype = require(16),\r\n Type = require(23),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Options passed to {@link inherits}, modifying its behavior.\r\n * @typedef InheritanceOptions\r\n * @type {Object}\r\n * @property {boolean} [noStatics=false] Skips adding the default static methods on top of the constructor\r\n * @property {boolean} [noRegister=false] Skips registering the constructor with the reflected type\r\n */\r\n\r\n/**\r\n * Inherits a custom class from the message prototype of the specified message type.\r\n * @param {*} clazz Inheriting class constructor\r\n * @param {Type} type Inherited message type\r\n * @param {InheritanceOptions} [options] Inheritance options\r\n * @returns {Prototype} Created prototype\r\n */\r\nfunction inherits(clazz, type, options) {\r\n if (typeof clazz !== 'function')\r\n throw _TypeError(\"clazz\", \"a function\");\r\n if (!(type instanceof Type))\r\n throw _TypeError(\"type\", \"a Type\");\r\n if (!options)\r\n options = {};\r\n\r\n /**\r\n * This is not an actual type but stands as a reference for any constructor of a custom message class that you pass to the library.\r\n * @name Class\r\n * @extends Prototype\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set on the message\r\n * @see {@link inherits}\r\n */\r\n\r\n var classProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Class.$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n if (!options.noStatics)\r\n util.merge(classProperties, {\r\n\r\n /**\r\n * Encodes a message of this type to a buffer.\r\n * @name Class.encode\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encode: {\r\n value: function encode(message, writer) {\r\n return this.$type.encode(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Encodes a message of this type preceeded by its length as a varint to a buffer.\r\n * @name Class.encodeDelimited\r\n * @function\r\n * @param {Prototype|Object} message Message to encode\r\n * @param {Writer} [writer] Writer to use\r\n * @returns {Writer} Writer\r\n */\r\n encodeDelimited: {\r\n value: function encodeDelimited(message, writer) {\r\n return this.$type.encodeDelimited(message, writer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type from a buffer.\r\n * @name Class.decode\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decode: {\r\n value: function decode(buffer) {\r\n return this.$type.decode(buffer);\r\n }\r\n },\r\n\r\n /**\r\n * Decodes a message of this type preceeded by its length as a varint from a buffer.\r\n * @name Class.decodeDelimited\r\n * @function\r\n * @param {Uint8Array} buffer Buffer to decode\r\n * @returns {Prototype} Decoded message\r\n */\r\n decodeDelimited: {\r\n value: function decodeDelimited(buffer) {\r\n return this.$type.decodeDelimited(buffer);\r\n }\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 {Prototype|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 verify: {\r\n value: function verify(message) {\r\n return this.$type.verify(message);\r\n }\r\n }\r\n\r\n }, true);\r\n\r\n util.props(clazz, classProperties);\r\n var prototype = inherits.defineProperties(new Prototype(), type);\r\n clazz.prototype = prototype;\r\n prototype.constructor = clazz;\r\n\r\n if (!options.noRegister)\r\n type.setCtor(clazz);\r\n\r\n return prototype;\r\n}\r\n\r\n/**\r\n * Defines the reflected type's default values and virtual oneof properties on the specified prototype.\r\n * @memberof inherits\r\n * @param {Prototype} prototype Prototype to define properties upon\r\n * @param {Type} type Reflected message type\r\n * @returns {Prototype} The specified prototype\r\n */\r\ninherits.defineProperties = function defineProperties(prototype, type) {\r\n\r\n var prototypeProperties = {\r\n\r\n /**\r\n * Reference to the reflected type.\r\n * @name Prototype#$type\r\n * @type {Type}\r\n * @readonly\r\n */\r\n $type: {\r\n value: type\r\n }\r\n };\r\n\r\n // Initialize default values\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 // Define each oneof with a non-enumerable getter and setter for the present 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 util.props(prototype, prototypeProperties);\r\n return prototype;\r\n};\r\n","\"use strict\";\r\nmodule.exports = MapField;\r\n\r\nvar Field = require(8);\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(7),\r\n types = require(24),\r\n util = require(25);\r\n\r\n/**\r\n * Constructs a new map field.\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 = Method;\r\n\r\nvar ReflectionObject = require(13);\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.\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(13);\r\n/** @alias Namespace.prototype */\r\nvar NamespacePrototype = ReflectionObject.extend(Namespace);\r\n\r\nvar Enum = require(7),\r\n Type = require(23),\r\n Field = require(8),\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.\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.\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} Prototype\r\n * @this ReflectionObject\r\n */\r\nfunction extend(constructor) {\r\n var proto = constructor.prototype = Object.create(this.prototype);\r\n proto.constructor = constructor;\r\n constructor.extend = extend;\r\n return proto;\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(13);\r\n/** @alias OneOf.prototype */\r\nvar OneOfPrototype = ReflectionObject.extend(OneOf);\r\n\r\nvar Field = require(8),\r\n util = require(25);\r\n\r\nvar _TypeError = util._TypeError;\r\n\r\n/**\r\n * Constructs a new oneof.\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(8),\r\n MapField = require(10),\r\n OneOf = require(14),\r\n Enum = require(7),\r\n Service = require(21),\r\n Method = require(11),\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 default-case, 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 = Prototype;\r\n\r\n/**\r\n * Constructs a new prototype.\r\n * This method should be called from your custom constructors, i.e. `Prototype.call(this, properties)`.\r\n * @classdesc Runtime message prototype ready to be extended by custom classes or generated code.\r\n * @constructor\r\n * @param {Object.} [properties] Properties to set\r\n * @abstract\r\n * @see {@link inherits}\r\n * @see {@link Class}\r\n */\r\nfunction Prototype(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/**\r\n * Converts a runtime 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\nPrototype.prototype.asJSON = function asJSON(options) {\r\n if (!options)\r\n options = {};\r\n var fields = this.constructor.$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","\"use strict\";\r\nmodule.exports = Reader;\r\n\r\nReader.BufferReader = BufferReader;\r\n\r\nvar util = require(28),\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 * Configures the Reader interface according to the environment.\r\n * @memberof Reader\r\n * @returns {undefined}\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\n/**\r\n * Constructs a new reader 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.\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\nconfigure();\r\n","\"use strict\";\r\nmodule.exports = Root;\r\n\r\nvar Namespace = require(12);\r\n/** @alias Root.prototype */\r\nvar RootPrototype = Namespace.extend(Root);\r\n\r\nvar Field = require(8),\r\n util = require(25),\r\n common = require(6);\r\n\r\n/**\r\n * Constructs a new root namespace.\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/**\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 {function(?Error, Root=)} callback Node-style callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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 // 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(15)(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 (!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 ++queued;\r\n setTimeout(function() {\r\n --queued;\r\n process(filename, common[filename]);\r\n });\r\n return;\r\n }\r\n\r\n // Otherwise fetch from disk or network\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 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 (!queued)\r\n finish(null);\r\n return undefined;\r\n};\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string):Promise\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 * 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\n/**\r\n * Constructs a new RPC service.\r\n * @classdesc An RPC service as returned by {@link Service#create}.\r\n * @memberof rpc\r\n * @constructor\r\n * @param {RPCImpl} rpcImpl RPC implementation\r\n */\r\nfunction Service(rpcImpl) {\r\n\r\n /**\r\n * RPC implementation.\r\n * @type {RPCImpl}\r\n */\r\n this.$rpc = rpcImpl;\r\n\r\n /**\r\n * Service listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/** @alias rpc.Service.prototype */\r\nvar ServicePrototype = Service.prototype;\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name, one of `\"data\"`, `\"error\"`, `\"end\"`\r\n * @param {function} cb Listener\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.on = function on(evt, cb) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push(cb);\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} [cb] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.off = function off(evt, cb) {\r\n if (evt) {\r\n if (cb) {\r\n var p = (this._listeners[evt] || []).indexOf(cb);\r\n if (p > -1)\r\n this._listeners[evt].splice(p, 1);\r\n } else\r\n this._listeners[evt] = [];\r\n } else\r\n this._listeners = {};\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.emit = function emit(evt) {\r\n if (this._listeners[evt]) {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n for (var i = 0; i < this._listeners[evt].length; ++i)\r\n this._listeners[evt][i].apply(this, args);\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Ends this service and emits the `end` event.\r\n * @returns {rpc.Service} `this`\r\n */\r\nServicePrototype.end = function end() {\r\n return this.emit('end').off();\r\n};\r\n","\"use strict\";\r\nmodule.exports = Service;\r\n\r\nvar Namespace = require(12);\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(11),\r\n util = require(25),\r\n rpc = require(19);\r\n\r\n/**\r\n * Constructs a new service.\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 {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream.\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 var lcName = method.name.substring(0, 1).toLowerCase() + method.name.substring(1);\r\n rpcService[lcName] = function(request, callback) {\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);\r\n return callback ? callback(err) : undefined;\r\n }\r\n if (responseData === null) {\r\n rpcService.emit('end');\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);\r\n return callback ? callback('error', err2) : undefined;\r\n }\r\n rpcService.emit('data', response);\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 default-case, 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 default-case, callback-return */\r\n}","\"use strict\";\r\nmodule.exports = Type; \r\n\r\nvar Namespace = require(12);\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(7),\r\n OneOf = require(14),\r\n Field = require(8),\r\n Service = require(21),\r\n Prototype = require(16),\r\n Reader = require(17),\r\n Writer = require(29),\r\n inherits = require(9),\r\n util = require(25),\r\n codegen = require(2);\r\n\r\n/**\r\n * Constructs a new message type.\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 {Prototype}\r\n */\r\n ctor: {\r\n get: function getCtor() {\r\n if (this._ctor)\r\n return this._ctor;\r\n var ctor;\r\n if (codegen.supported)\r\n ctor = codegen(\"p\")(\"P.call(this,p)\").eof(this.getFullName() + \"$ctor\", {\r\n P: Prototype\r\n });\r\n else\r\n ctor = function GenericMessage(properties) {\r\n Prototype.call(this, properties);\r\n };\r\n ctor.prototype = inherits(ctor, this);\r\n this._ctor = ctor;\r\n return ctor;\r\n },\r\n set: function setCtor(ctor) {\r\n if (ctor && !(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\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 * @param {*} [ctor] Constructor to use.\r\n * Defaults to use the internal constuctor.\r\n * @returns {Prototype} Message instance\r\n */\r\nTypePrototype.create = function create(properties, ctor) {\r\n if (!properties || typeof properties === 'function') {\r\n ctor = properties;\r\n properties = undefined;\r\n } else if (properties /* already */ instanceof Prototype)\r\n return properties;\r\n if (ctor) {\r\n if (!(ctor.prototype instanceof Prototype))\r\n throw util._TypeError(\"ctor\", \"a constructor inheriting from Prototype\");\r\n } else\r\n ctor = this.getCtor();\r\n return new ctor(properties);\r\n};\r\n\r\n/**\r\n * Encodes a message of this type.\r\n * @param {Prototype|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 {Prototype|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).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 {Prototype} 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 {Prototype} 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 enum values are valid and that any required fields are present.\r\n * @param {Prototype|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 })\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 * Utility functions.\r\n * @namespace\r\n */\r\nvar util = exports;\r\n\r\n/**\r\n * Tests if the specified value is a string.\r\n * @memberof util\r\n * @param {*} value Value to test\r\n * @returns {boolean} `true` if the value is a string\r\n */\r\nfunction isString(value) {\r\n return typeof value === 'string' || value instanceof String;\r\n}\r\n\r\nutil.isString = isString;\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 * 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 * 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 * Fetches the contents of a file.\r\n * @memberof util\r\n * @param {string} path File path or url\r\n * @param {function(?Error, string=)} [callback] Node-style callback\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 try {\r\n // Hide this from webpack. There is probably another, better way.\r\n return eval(['req','uire'].join(''))(\"fs\") // eslint-disable-line no-eval\r\n .readFile(path, \"utf8\", callback);\r\n } catch (e) { } // eslint-disable-line no-empty\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 (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\n// Merge in runtime utility\r\nutil.merge(util, require(28));\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 * @throws {TypeError} If `value` is a string and no long library is present.\r\n */\r\nLongBits.from = function from(value) {\r\n switch (typeof value) { // eslint-disable-line default-case\r\n case 'number':\r\n return LongBits.fromNumber(value);\r\n case 'string':\r\n value = util.Long.fromString(value); // throws without a long lib\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 new util.Long(this.lo, this.hi, 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 * 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\nmodule.exports = Writer;\r\n\r\nWriter.BufferWriter = BufferWriter;\r\n\r\nvar util = require(28),\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.\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.\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.\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.hi).push(writeFixed32, 4, bits.lo);\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.hi).push(writeFixed32, 4, bits.lo);\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\nvar writeBytes = ArrayImpl.prototype.set\r\n ? function writeBytes_set(buf, pos, val) {\r\n buf.set(val, pos);\r\n }\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} value Value 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 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.\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 // This could probably be optimized just like writeStringBuffer, but most real use cases won't benefit much.\r\n}\r\n\r\nif (!(ArrayImpl.prototype.set && util.Buffer && util.Buffer.prototype.set)) // set is faster (node 6.9.1)\r\n/**\r\n * @override\r\n */\r\nBufferWriterPrototype.bytes = function write_bytes_buffer(value) {\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 * 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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\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:function):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 {function(?Error, Root=)} callback Callback function\r\n * @returns {undefined}\r\n * @throws {TypeError} If arguments are invalid\r\n * @variation 2\r\n */\r\n// function load(filename:string, callback:function):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 * @throws {TypeError} If arguments are invalid\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// 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\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.Prototype = require(\"./prototype\");\r\nprotobuf.inherits = require(\"./inherits\");\r\n\r\n// Utility\r\nprotobuf.types = require(\"./types\");\r\nprotobuf.common = require(\"./common\");\r\nprotobuf.rpc = require(\"./rpc\");\r\nprotobuf.util = require(\"./util\");\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 protobuf.Reader.configure();\r\n }\r\n return protobuf;\r\n });\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/package.json b/package.json index 58b25607a..f41819973 100644 --- a/package.json +++ b/package.json @@ -24,24 +24,22 @@ }, "types": "types/protobuf.js.d.ts", "scripts": { + "bench": "node bench", "build": "gulp", "docs": "jsdoc -c jsdoc.docs.json -R README.md", - "pages": "node scripts/pages", - "types": "jsdoc -c jsdoc.types.json && node scripts/types.js && tsc types/test.ts --lib es2015 --noEmit", "lint": "eslint src", + "pages": "node scripts/pages", + "prepublish": "node scripts/prepublish", + "prof": "node bench/prof", "test": "tape tests/*.js | tap-spec", + "types": "jsdoc -c jsdoc.types.json && node scripts/types.js && tsc types/test.ts --lib es2015 --noEmit", "zuul": "zuul --ui tape --no-coverage --concurrency 4 -- tests/*.js", - "zuul-local": "zuul --ui tape --no-coverage --concurrency 1 --local 8080 --disable-tunnel -- tests/*.js", - "bench": "node bench", - "prof": "node bench/prof", - "prepublish": "node scripts/prepublish" + "zuul-local": "zuul --ui tape --no-coverage --concurrency 1 --local 8080 --disable-tunnel -- tests/*.js" }, "optionalDependencies": { "long": "^3.2.0" }, "devDependencies": { - "@types/long": "^3.0.31", - "@types/node": "0.0.1", "benchmark": "^2.1.2", "browserify": "^13.1.1", "bundle-collapser": "^1.2.1", diff --git a/scripts/rpc-test.js b/scripts/rpc-test.js new file mode 100644 index 000000000..99afafbf2 --- /dev/null +++ b/scripts/rpc-test.js @@ -0,0 +1,74 @@ +var protobuf = require(".."); + +var root = protobuf.Root.fromJSON({ + nested: { + Greeter: { + methods: { + "SayHello": { + requestType: 'Hello', + requestStream: true, + responseType: 'World', + responseStream: true + } + } + }, + Hello: { + fields: { + name: { + type: "string", + id: 1 + } + } + }, + World: { + fields: { + message: { + type: "string", + id: 1 + } + } + } + } +}); + +var Greeter = root.lookup("Greeter"), + Hello = root.lookup("Hello"), + World = root.lookup("World"); + +function rpcImpl(method, requestData, callback) { + setTimeout(function() { + try { + // + var hello = Hello.decodeDelimited(requestData); + var responseData = World.encodeDelimited({ message: 'Hello ' + hello.name + ' !' }).finish(); + // + callback(null, responseData); + } catch (err) { + callback(err); + } + }, Math.random() * 500); +} + +var greeter = Greeter.create(rpcImpl, true, true); + +greeter.on("data", function(response) { + console.log("data:", response.message); +}); + +greeter.on("end", function() { + console.log("ended."); +}); + +greeter.on("error", function(err) { + console.log("error:", err); +}); + +greeter.sayHello({ name: 'node' }); +greeter.sayHello({ name: 'protobuf' }); +greeter.sayHello({ name: 'paralin' }); + +setTimeout(function() { + greeter.end(); + greeter.sayHello({ name: 'dcode' }); // does nothing +}, 1000); +// Likewise, the RPC impl can end the stream by calling its callback with an explicit null message diff --git a/src/index.js b/src/index.js index 4a0384bb0..76b192f9e 100644 --- a/src/index.js +++ b/src/index.js @@ -75,6 +75,7 @@ protobuf.inherits = require("./inherits"); // Utility protobuf.types = require("./types"); protobuf.common = require("./common"); +protobuf.rpc = require("./rpc"); protobuf.util = require("./util"); // Be nice to AMD diff --git a/src/prototype.js b/src/prototype.js index 443c1e0a2..846b9f963 100644 --- a/src/prototype.js +++ b/src/prototype.js @@ -33,11 +33,12 @@ function Prototype(properties) { * @returns {Object.} JSON object */ Prototype.prototype.asJSON = function asJSON(options) { - var any = !(options && options.fieldsOnly), - fields = this.constructor.$type.fields, + if (!options) + options = {}; + var fields = this.constructor.$type.fields, json = {}; var keys; - if (options && options.defaults) { + if (options.defaults) { keys = []; for (var k in this) // eslint-disable-line guard-for-in keys.push(k); @@ -56,7 +57,7 @@ Prototype.prototype.asJSON = function asJSON(options) { } } else json[key] = field.jsonConvert(value, options); - } else if (any) + } else if (!options.fieldsOnly) json[key] = value; } return json; diff --git a/src/rpc.js b/src/rpc.js new file mode 100644 index 000000000..70be9131a --- /dev/null +++ b/src/rpc.js @@ -0,0 +1,9 @@ +"use strict"; + +/** + * RPC helpers. + * @namespace + */ +var rpc = exports; + +rpc.Service = require("./rpc/service"); diff --git a/src/rpc/service.js b/src/rpc/service.js new file mode 100644 index 000000000..6b185ec56 --- /dev/null +++ b/src/rpc/service.js @@ -0,0 +1,81 @@ +"use strict"; +module.exports = Service; + +/** + * Constructs a new RPC service. + * @classdesc An RPC service as returned by {@link Service#create}. + * @memberof rpc + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + */ +function Service(rpcImpl) { + + /** + * RPC implementation. + * @type {RPCImpl} + */ + this.$rpc = rpcImpl; + + /** + * Service listeners. + * @type {Object.} + * @private + */ + this._listeners = {}; +} + +/** @alias rpc.Service.prototype */ +var ServicePrototype = Service.prototype; + +/** + * Registers an event listener. + * @param {string} evt Event name, one of `"data"`, `"error"`, `"end"` + * @param {function} cb Listener + * @returns {rpc.Service} `this` + */ +ServicePrototype.on = function on(evt, cb) { + (this._listeners[evt] || (this._listeners[evt] = [])).push(cb); + return this; +}; + +/** + * Removes an event listener. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [cb] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {rpc.Service} `this` + */ +ServicePrototype.off = function off(evt, cb) { + if (evt) { + if (cb) { + var p = (this._listeners[evt] || []).indexOf(cb); + if (p > -1) + this._listeners[evt].splice(p, 1); + } else + this._listeners[evt] = []; + } else + this._listeners = {}; + return this; +}; + +/** + * Emits an event. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {rpc.Service} `this` + */ +ServicePrototype.emit = function emit(evt) { + if (this._listeners[evt]) { + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < this._listeners[evt].length; ++i) + this._listeners[evt][i].apply(this, args); + } + return this; +}; + +/** + * Ends this service and emits the `end` event. + * @returns {rpc.Service} `this` + */ +ServicePrototype.end = function end() { + return this.emit('end').off(); +}; diff --git a/src/service.js b/src/service.js index 92b37ca9c..e35cb4cbc 100644 --- a/src/service.js +++ b/src/service.js @@ -8,7 +8,8 @@ var NamespacePrototype = Namespace.prototype; var ServicePrototype = Namespace.extend(Service); var Method = require("./method"), - util = require("./util"); + util = require("./util"), + rpc = require("./rpc"); /** * Constructs a new service. @@ -142,25 +143,22 @@ ServicePrototype.remove = function remove(object) { /** * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. * @typedef RPCImpl - * @function + * @type {function} * @param {Method} method Reflected method being called * @param {Uint8Array} requestData Request data - * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data + * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream. * @returns {undefined} */ /** * Creates a runtime service using the specified rpc implementation. - * @param {function(Method, Uint8Array, function)} rpc RPC implementation ({@link RPCImpl|see}) + * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see}) * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Object} Runtime service + * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed. */ -ServicePrototype.create = function create(rpc, requestDelimited, responseDelimited) { - var rpcService = {}; - util.prop(rpcService, "$rpc", { - value: rpc - }); +ServicePrototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl); this.getMethodsArray().forEach(function(method) { var lcName = method.name.substring(0, 1).toLowerCase() + method.name.substring(1); rpcService[lcName] = function(request, callback) { @@ -174,19 +172,24 @@ ServicePrototype.create = function create(rpc, requestDelimited, responseDelimit } // Calls the custom RPC implementation with the reflected method and binary request data // and expects the rpc implementation to call its callback with the binary response data. - rpc(method, requestData, function(err, responseData) { + rpcImpl(method, requestData, function(err, responseData) { if (err) { - callback(err); - return; + rpcService.emit('error', err); + return callback ? callback(err) : undefined; + } + if (responseData === null) { + rpcService.emit('end'); + return undefined; } var response; try { response = responseDelimited && method.resolvedResponseType.decodeDelimited(responseData) || method.resolvedResponseType.decode(responseData); } catch (err2) { - callback(err2); - return; + rpcService.emit('error', err2); + return callback ? callback('error', err2) : undefined; } - callback(null, response); + rpcService.emit('data', response); + return callback ? callback(null, response) : undefined; }); }; }); diff --git a/src/writer.js b/src/writer.js index 11530b287..74375a9b6 100644 --- a/src/writer.js +++ b/src/writer.js @@ -235,7 +235,7 @@ function writeVarint64(buf, pos, val) { } while (val.lo > 127) { buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.lo = val.lo >>> 7; } buf[pos++] = val.lo; } @@ -481,7 +481,7 @@ WriterPrototype.string = function write_string(value) { /** * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#ldelim}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state. + * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state. * @returns {Writer} `this` */ WriterPrototype.fork = function fork() { @@ -510,7 +510,7 @@ WriterPrototype.reset = function reset() { /** * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @param {number} [id] Id with wire type 2 to prepend where applicable + * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable * @returns {Writer} `this` */ WriterPrototype.ldelim = function ldelim(id) { diff --git a/types/protobuf.js.d.ts b/types/protobuf.js.d.ts index 162383063..07e97e064 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 Thu, 08 Dec 2016 13:22:46 UTC + * Generated Thu, 08 Dec 2016 16:19:16 UTC */ declare module "protobufjs" { @@ -1195,6 +1195,68 @@ declare module "protobufjs" { } + /** + * RPC helpers. + * @namespace + */ + module rpc { + /** + * Constructs a new RPC service. + * @classdesc An RPC service as returned by {@link Service#create}. + * @memberof rpc + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + */ + class Service { + /** + * Constructs a new RPC service. + * @classdesc An RPC service as returned by {@link Service#create}. + * @memberof rpc + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + */ + constructor(rpcImpl: RPCImpl); + + /** + * RPC implementation. + * @type {RPCImpl} + */ + $rpc: RPCImpl; + + /** + * Registers an event listener. + * @param {string} evt Event name, one of `"data"`, `"error"`, `"end"` + * @param {function} cb Listener + * @returns {rpc.Service} `this` + */ + on(evt: string, cb: (() => any)): rpc.Service; + + /** + * Removes an event listener. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {function} [cb] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {rpc.Service} `this` + */ + off(evt?: string, cb?: (() => any)): rpc.Service; + + /** + * Emits an event. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {rpc.Service} `this` + */ + emit(evt: string, args: any): rpc.Service; + + /** + * Ends this service and emits the `end` event. + * @returns {rpc.Service} `this` + */ + end(): rpc.Service; + + } + + } + /** * Constructs a new service. * @classdesc Reflected service. @@ -1248,25 +1310,25 @@ declare module "protobufjs" { /** * Creates a runtime service using the specified rpc implementation. - * @param {function(Method, Uint8Array, function)} rpc RPC implementation ({@link RPCImpl|see}) + * @param {function(Method, Uint8Array, function)} rpcImpl RPC implementation ({@link RPCImpl|see}) * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Object} Runtime service + * @returns {rpc.Service} Runtime RPC service. Useful where requests and/or responses are streamed. */ - create(rpc: (() => any), requestDelimited?: boolean, responseDelimited?: boolean): Object; + create(rpcImpl: (() => any), requestDelimited?: boolean, responseDelimited?: boolean): rpc.Service; } /** * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. * @typedef RPCImpl - * @function + * @type {function} * @param {Method} method Reflected method being called * @param {Uint8Array} requestData Request data - * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data + * @param {function(?Error, Uint8Array=)} callback Node-style callback called with the error, if any, and the response data. `null` as response data signals an ended stream. * @returns {undefined} */ - function RPCImpl(method: Method, requestData: Uint8Array, callback: (() => any)): void; + type RPCImpl = (method: Method, requestData: Uint8Array, callback: (() => any)) => void; /** * Handle object returned from {@link tokenize}. @@ -2003,7 +2065,7 @@ declare module "protobufjs" { /** * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#ldelim}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state. + * Calling {@link Writer#}, {@link Writer#reset} or {@link Writer#finish} resets the writer to the previous state. * @returns {Writer} `this` */ fork(): Writer; @@ -2016,7 +2078,7 @@ declare module "protobufjs" { /** * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @param {number} [id] Id with wire type 2 to prepend where applicable + * @param {number} [id] Id with wire type 2 to prepend as a tag where applicable * @returns {Writer} `this` */ ldelim(id?: number): Writer;