diff --git a/dist/realtime-core.browser.js b/dist/realtime-core.browser.js new file mode 100644 index 000000000..da363179d --- /dev/null +++ b/dist/realtime-core.browser.js @@ -0,0 +1,17724 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define('leancloud-realtime', ['exports'], factory) : + (factory((global.AV = global.AV || {}))); +}(this, (function (exports) { 'use strict'; + + var define = undefined; + var require = require || function(id) {throw new Error('Unexpected required ' + id)}; + + + + var process = (window && window.process) || {}; + process.env = process.env || {}; + + var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function commonjsRequire () { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); + } + + function unwrapExports (x) { + return x && x.__esModule ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + // 7.1.4 ToInteger + var ceil = Math.ceil; + var floor = Math.floor; + var _toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + + // 7.2.1 RequireObjectCoercible(argument) + var _defined = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; + }; + + // true -> String#at + // false -> String#codePointAt + var _stringAt = function (TO_STRING) { + return function (that, pos) { + var s = String(_defined(that)); + var i = _toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + + var _library = true; + + var _global = createCommonjsModule(function (module) { + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); + if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + }); + + var _core = createCommonjsModule(function (module) { + var core = module.exports = { version: '2.5.1' }; + if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + }); + + var _aFunction = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; + }; + + // optional / simple context binding + + var _ctx = function (fn, that, length) { + _aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; + }; + + var _isObject = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + + var _anObject = function (it) { + if (!_isObject(it)) throw TypeError(it + ' is not an object!'); + return it; + }; + + var _fails = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } + }; + + // Thank's IE8 for his funny defineProperty + var _descriptors = !_fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; + }); + + var document$1 = _global.document; + // typeof document.createElement is 'object' in old IE + var is = _isObject(document$1) && _isObject(document$1.createElement); + var _domCreate = function (it) { + return is ? document$1.createElement(it) : {}; + }; + + var _ie8DomDefine = !_descriptors && !_fails(function () { + return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; + }); + + // 7.1.1 ToPrimitive(input [, PreferredType]) + + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + var _toPrimitive = function (it, S) { + if (!_isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); + }; + + var dP = Object.defineProperty; + + var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { + _anObject(O); + P = _toPrimitive(P, true); + _anObject(Attributes); + if (_ie8DomDefine) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; + }; + + var _objectDp = { + f: f + }; + + var _propertyDesc = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; + }; + + var _hide = _descriptors ? function (object, key, value) { + return _objectDp.f(object, key, _propertyDesc(1, value)); + } : function (object, key, value) { + object[key] = value; + return object; + }; + + var PROTOTYPE = 'prototype'; + + var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && key in exports) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? _ctx(out, _global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out); + } + } + }; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + var _export = $export; + + var _redefine = _hide; + + var hasOwnProperty = {}.hasOwnProperty; + var _has = function (it, key) { + return hasOwnProperty.call(it, key); + }; + + var _iterators = {}; + + var toString = {}.toString; + + var _cof = function (it) { + return toString.call(it).slice(8, -1); + }; + + // fallback for non-array-like ES3 and non-enumerable old V8 strings + + // eslint-disable-next-line no-prototype-builtins + var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return _cof(it) == 'String' ? it.split('') : Object(it); + }; + + // to indexed object, toObject with fallback for non-array-like ES3 strings + + + var _toIobject = function (it) { + return _iobject(_defined(it)); + }; + + // 7.1.15 ToLength + + var min = Math.min; + var _toLength = function (it) { + return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + + var max = Math.max; + var min$1 = Math.min; + var _toAbsoluteIndex = function (index, length) { + index = _toInteger(index); + return index < 0 ? max(index + length, 0) : min$1(index, length); + }; + + // false -> Array#indexOf + // true -> Array#includes + + + + var _arrayIncludes = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = _toIobject($this); + var length = _toLength(O.length); + var index = _toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; + + var SHARED = '__core-js_shared__'; + var store = _global[SHARED] || (_global[SHARED] = {}); + var _shared = function (key) { + return store[key] || (store[key] = {}); + }; + + var id = 0; + var px = Math.random(); + var _uid = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + + var shared = _shared('keys'); + + var _sharedKey = function (key) { + return shared[key] || (shared[key] = _uid(key)); + }; + + var arrayIndexOf = _arrayIncludes(false); + var IE_PROTO$1 = _sharedKey('IE_PROTO'); + + var _objectKeysInternal = function (object, names) { + var O = _toIobject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO$1) _has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (_has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; + + // IE 8- don't enum bug keys + var _enumBugKeys = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' + ).split(','); + + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + + + + var _objectKeys = Object.keys || function keys(O) { + return _objectKeysInternal(O, _enumBugKeys); + }; + + var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) { + _anObject(O); + var keys = _objectKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]); + return O; + }; + + var document$2 = _global.document; + var _html = document$2 && document$2.documentElement; + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + + + + var IE_PROTO = _sharedKey('IE_PROTO'); + var Empty = function () { /* empty */ }; + var PROTOTYPE$1 = 'prototype'; + + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = _domCreate('iframe'); + var i = _enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + _html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]]; + return createDict(); + }; + + var _objectCreate = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE$1] = _anObject(O); + result = new Empty(); + Empty[PROTOTYPE$1] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : _objectDps(result, Properties); + }; + + var _wks = createCommonjsModule(function (module) { + var store = _shared('wks'); + + var Symbol = _global.Symbol; + var USE_SYMBOL = typeof Symbol == 'function'; + + var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name)); + }; + + $exports.store = store; + }); + + var def = _objectDp.f; + + var TAG = _wks('toStringTag'); + + var _setToStringTag = function (it, tag, stat) { + if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); + }; + + var IteratorPrototype = {}; + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + _hide(IteratorPrototype, _wks('iterator'), function () { return this; }); + + var _iterCreate = function (Constructor, NAME, next) { + Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) }); + _setToStringTag(Constructor, NAME + ' Iterator'); + }; + + // 7.1.13 ToObject(argument) + + var _toObject = function (it) { + return Object(_defined(it)); + }; + + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + + + var IE_PROTO$2 = _sharedKey('IE_PROTO'); + var ObjectProto = Object.prototype; + + var _objectGpo = Object.getPrototypeOf || function (O) { + O = _toObject(O); + if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }; + + var ITERATOR = _wks('iterator'); + var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` + var FF_ITERATOR = '@@iterator'; + var KEYS = 'keys'; + var VALUES = 'values'; + + var returnThis = function () { return this; }; + + var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + _iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = _objectGpo($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + _setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!_library && !_has(IteratorPrototype, ITERATOR)) _hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + _hide(proto, ITERATOR, $default); + } + // Plug for library + _iterators[NAME] = $default; + _iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) _redefine(proto, key, methods[key]); + } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; + + var $at = _stringAt(true); + + // 21.1.3.27 String.prototype[@@iterator]() + _iterDefine(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; + }); + + var _addToUnscopables = function () { /* empty */ }; + + var _iterStep = function (done, value) { + return { value: value, done: !!done }; + }; + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) { + this._t = _toIobject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return _iterStep(1); + } + if (kind == 'keys') return _iterStep(0, index); + if (kind == 'values') return _iterStep(0, O[index]); + return _iterStep(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + _iterators.Arguments = _iterators.Array; + + _addToUnscopables('keys'); + _addToUnscopables('values'); + _addToUnscopables('entries'); + + var TO_STRING_TAG = _wks('toStringTag'); + + var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + + 'TextTrackList,TouchList').split(','); + + for (var i = 0; i < DOMIterables.length; i++) { + var NAME = DOMIterables[i]; + var Collection = _global[NAME]; + var proto = Collection && Collection.prototype; + if (proto && !proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME); + _iterators[NAME] = _iterators.Array; + } + + // getting tag from 19.1.3.6 Object.prototype.toString() + + var TAG$1 = _wks('toStringTag'); + // ES3 wrong here + var ARG = _cof(function () { return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } + }; + + var _classof = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T + // builtinTag case + : ARG ? _cof(O) + // ES3 arguments fallback + : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + + var _anInstance = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; + }; + + // call something on iterator step with safe closing on error + + var _iterCall = function (iterator, fn, value, entries) { + try { + return entries ? fn(_anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) _anObject(ret.call(iterator)); + throw e; + } + }; + + // check on default Array iterator + + var ITERATOR$1 = _wks('iterator'); + var ArrayProto = Array.prototype; + + var _isArrayIter = function (it) { + return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$1] === it); + }; + + var ITERATOR$2 = _wks('iterator'); + + var core_getIteratorMethod = _core.getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR$2] + || it['@@iterator'] + || _iterators[_classof(it)]; + }; + + var _forOf = createCommonjsModule(function (module) { + var BREAK = {}; + var RETURN = {}; + var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable); + var f = _ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) { + result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = _iterCall(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } + }; + exports.BREAK = BREAK; + exports.RETURN = RETURN; + }); + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + + + var SPECIES = _wks('species'); + var _speciesConstructor = function (O, D) { + var C = _anObject(O).constructor; + var S; + return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S); + }; + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + var _invoke = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + + var process$2 = _global.process; + var setTask = _global.setImmediate; + var clearTask = _global.clearImmediate; + var MessageChannel = _global.MessageChannel; + var Dispatch = _global.Dispatch; + var counter = 0; + var queue = {}; + var ONREADYSTATECHANGE = 'onreadystatechange'; + var defer; + var channel; + var port; + var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listener = function (event) { + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + _invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (_cof(process$2) == 'process') { + defer = function (id) { + process$2.nextTick(_ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(_ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = _ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) { + defer = function (id) { + _global.postMessage(id + '', '*'); + }; + _global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in _domCreate('script')) { + defer = function (id) { + _html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () { + _html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(_ctx(run, id, 1), 0); + }; + } + } + var _task = { + set: setTask, + clear: clearTask + }; + + var macrotask = _task.set; + var Observer = _global.MutationObserver || _global.WebKitMutationObserver; + var process$3 = _global.process; + var Promise$1 = _global.Promise; + var isNode$1 = _cof(process$3) == 'process'; + + var _microtask = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode$1 && (parent = process$3.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode$1) { + notify = function () { + process$3.nextTick(flush); + }; + // browsers with MutationObserver + } else if (Observer) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise$1 && Promise$1.resolve) { + var promise = Promise$1.resolve(); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(_global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; + }; + + // 25.4.1.5 NewPromiseCapability(C) + + + function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = _aFunction(resolve); + this.reject = _aFunction(reject); + } + + var f$1 = function (C) { + return new PromiseCapability(C); + }; + + var _newPromiseCapability = { + f: f$1 + }; + + var _perform = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } + }; + + var _promiseResolve = function (C, x) { + _anObject(C); + if (_isObject(x) && x.constructor === C) return x; + var promiseCapability = _newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; + }; + + var _redefineAll = function (target, src, safe) { + for (var key in src) { + if (safe && target[key]) target[key] = src[key]; + else _hide(target, key, src[key]); + } return target; + }; + + var SPECIES$1 = _wks('species'); + + var _setSpecies = function (KEY) { + var C = typeof _core[KEY] == 'function' ? _core[KEY] : _global[KEY]; + if (_descriptors && C && !C[SPECIES$1]) _objectDp.f(C, SPECIES$1, { + configurable: true, + get: function () { return this; } + }); + }; + + var ITERATOR$3 = _wks('iterator'); + var SAFE_CLOSING = false; + + try { + var riter = [7][ITERATOR$3](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); + } catch (e) { /* empty */ } + + var _iterDetect = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR$3](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR$3] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; + }; + + var task = _task.set; + var microtask = _microtask(); + + + + var PROMISE = 'Promise'; + var TypeError$1 = _global.TypeError; + var process$1 = _global.process; + var $Promise = _global[PROMISE]; + var isNode = _classof(process$1) == 'process'; + var empty = function () { /* empty */ }; + var Internal; + var newGenericPromiseCapability; + var OwnPromiseCapability; + var Wrapper; + var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f; + + var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch (e) { /* empty */ } + }(); + + // helpers + var isThenable = function (it) { + var then; + return _isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); + if (domain) domain.exit(); + } + if (result === reaction.promise) { + reject(TypeError$1('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); + }; + var onUnhandled = function (promise) { + task.call(_global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = _perform(function () { + if (isNode) { + process$1.emit('unhandledRejection', value, promise); + } else if (handler = _global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = _global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); + }; + var isUnhandled = function (promise) { + if (promise._h == 1) return false; + var chain = promise._a || promise._c; + var i = 0; + var reaction; + while (chain.length > i) { + reaction = chain[i++]; + if (reaction.fail || !isUnhandled(reaction.promise)) return false; + } return true; + }; + var onHandleUnhandled = function (promise) { + task.call(_global, function () { + var handler; + if (isNode) { + process$1.emit('rejectionHandled', promise); + } else if (handler = _global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); + }; + var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); + }; + var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError$1("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } + }; + + // constructor polyfill + if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + _anInstance(this, $Promise, PROMISE, '_h'); + _aFunction(executor); + Internal.call(this); + try { + executor(_ctx($resolve, this, 1), _ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = _redefineAll($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(_speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process$1.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = _ctx($resolve, promise, 1); + this.reject = _ctx($reject, promise, 1); + }; + _newPromiseCapability.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; + } + + _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Promise: $Promise }); + _setToStringTag($Promise, PROMISE); + _setSpecies(PROMISE); + Wrapper = _core[PROMISE]; + + // statics + _export(_export.S + _export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + _export(_export.S + _export.F * (_library || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return _promiseResolve(_library && this === Wrapper ? $Promise : this, x); + } + }); + _export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) { + $Promise.all(iter)['catch'](empty); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = _perform(function () { + var values = []; + var index = 0; + var remaining = 1; + _forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = _perform(function () { + _forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } + }); + + _export(_export.P + _export.R, 'Promise', { 'finally': function (onFinally) { + var C = _speciesConstructor(this, _core.Promise || _global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return _promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return _promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); + } }); + + // https://github.com/tc39/proposal-promise-try + + + + + _export(_export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = _newPromiseCapability.f(this); + var result = _perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; + } }); + + var promise$1 = _core.Promise; + + var promise = createCommonjsModule(function (module) { + module.exports = { "default": promise$1, __esModule: true }; + }); + + var _Promise = unwrapExports(promise); + + var long_1 = createCommonjsModule(function (module) { + /* + Copyright 2013 Daniel Wirtz + Copyright 2009 The Closure Library Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS-IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license long.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/long.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined([], factory); + /* CommonJS */ else if (typeof commonjsRequire === 'function' && 'object' === "object" && module && module["exports"]) + module["exports"] = factory(); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = factory(); + + })(commonjsGlobal, function() { + "use strict"; + + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @constructor + */ + function Long(low, high, unsigned) { + + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; + } + + // The internal representation of a long is the two given signed, 32-bit values. + // We use 32-bit pieces because these are the size of integers on which + // Javascript performs bit-operations. For operations like addition and + // multiplication, we split each number into 16 bit pieces, which can easily be + // multiplied within Javascript's floating-point representation without overflow + // or change in sign. + // + // In the algorithms below, we frequently reduce the negative case to the + // positive case by negating the input(s) and then post-processing the result. + // Note that we must ALWAYS check specially whether those values are MIN_VALUE + // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + // a positive number, it overflows back into a negative). Not handling this + // case would often result in infinite recursion. + // + // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* + // methods on which they depend. + + /** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ + Long.prototype.__isLong__; + + Object.defineProperty(Long.prototype, "__isLong__", { + value: true, + enumerable: false, + configurable: false + }); + + /** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + + /** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ + Long.isLong = isLong; + + /** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ + var INT_CACHE = {}; + + /** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ + var UINT_CACHE = {}; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = (0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = (-128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + + /** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromInt = fromInt; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromNumber(value, unsigned) { + if (isNaN(value) || !isFinite(value)) + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } + if (value < 0) + return fromNumber(-value, unsigned).neg(); + return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromNumber = fromNumber; + + /** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBits = fromBits; + + /** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ + var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) + + /** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ + function fromString(str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + radix = unsigned, + unsigned = false; + } else { + unsigned = !! unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 8)); + + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + + /** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ + Long.fromString = fromString; + + /** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @returns {!Long} + * @inner + */ + function fromValue(val) { + if (val /* is compatible */ instanceof Long) + return val; + if (typeof val === 'number') + return fromNumber(val); + if (typeof val === 'string') + return fromString(val); + // Throws for non-objects, converts non-instanceof Long: + return fromBits(val.low, val.high, val.unsigned); + } + + /** + * Converts the specified value to a Long. + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value + * @returns {!Long} + */ + Long.fromValue = fromValue; + + // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be + // no runtime penalty for these. + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_16_DBL = 1 << 16; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_24_DBL = 1 << 24; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + + /** + * @type {!Long} + * @const + * @inner + */ + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + + /** + * @type {!Long} + * @inner + */ + var ZERO = fromInt(0); + + /** + * Signed zero. + * @type {!Long} + */ + Long.ZERO = ZERO; + + /** + * @type {!Long} + * @inner + */ + var UZERO = fromInt(0, true); + + /** + * Unsigned zero. + * @type {!Long} + */ + Long.UZERO = UZERO; + + /** + * @type {!Long} + * @inner + */ + var ONE = fromInt(1); + + /** + * Signed one. + * @type {!Long} + */ + Long.ONE = ONE; + + /** + * @type {!Long} + * @inner + */ + var UONE = fromInt(1, true); + + /** + * Unsigned one. + * @type {!Long} + */ + Long.UONE = UONE; + + /** + * @type {!Long} + * @inner + */ + var NEG_ONE = fromInt(-1); + + /** + * Signed negative one. + * @type {!Long} + */ + Long.NEG_ONE = NEG_ONE; + + /** + * @type {!Long} + * @inner + */ + var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false); + + /** + * Maximum signed value. + * @type {!Long} + */ + Long.MAX_VALUE = MAX_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true); + + /** + * Maximum unsigned value. + * @type {!Long} + */ + Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MIN_VALUE = fromBits(0, 0x80000000|0, false); + + /** + * Minimum signed value. + * @type {!Long} + */ + Long.MIN_VALUE = MIN_VALUE; + + /** + * @alias Long.prototype + * @inner + */ + var LongPrototype = Long.prototype; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @returns {number} + */ + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @returns {number} + */ + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + + /** + * Converts the Long to a string written in the specified radix. + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { // Unsigned Longs are never negative + if (this.eq(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else + return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; + var result = ''; + while (true) { + var remDiv = rem.div(radixToPower), + intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, + digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) + return digits + result; + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + + /** + * Gets the high 32 bits as a signed integer. + * @returns {number} Signed high bits + */ + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + + /** + * Gets the high 32 bits as an unsigned integer. + * @returns {number} Unsigned high bits + */ + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + + /** + * Gets the low 32 bits as a signed integer. + * @returns {number} Signed low bits + */ + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + + /** + * Gets the low 32 bits as an unsigned integer. + * @returns {number} Unsigned low bits + */ + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + * @returns {number} + */ + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) // Unsigned Longs are never negative + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) != 0) + break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + + /** + * Tests if this Long's value equals zero. + * @returns {boolean} + */ + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + + /** + * Tests if this Long's value is negative. + * @returns {boolean} + */ + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + + /** + * Tests if this Long's value is positive. + * @returns {boolean} + */ + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + + /** + * Tests if this Long's value is odd. + * @returns {boolean} + */ + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + + /** + * Tests if this Long's value is even. + * @returns {boolean} + */ + LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; + }; + + /** + * Tests if this Long's value equals the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.equals = function equals(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + + /** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.eq = LongPrototype.equals; + + /** + * Tests if this Long's value differs from the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.notEquals = function notEquals(other) { + return !this.eq(/* validates */ other); + }; + + /** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.neq = LongPrototype.notEquals; + + /** + * Tests if this Long's value is less than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThan = function lessThan(other) { + return this.comp(/* validates */ other) < 0; + }; + + /** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lt = LongPrototype.lessThan; + + /** + * Tests if this Long's value is less than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(/* validates */ other) <= 0; + }; + + /** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lte = LongPrototype.lessThanOrEqual; + + /** + * Tests if this Long's value is greater than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(/* validates */ other) > 0; + }; + + /** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.gt = LongPrototype.greaterThan; + + /** + * Tests if this Long's value is greater than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(/* validates */ other) >= 0; + }; + + /** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + + /** + * Compares this Long's value with the specified's. + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.compare = function compare(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; + }; + + /** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.comp = LongPrototype.compare; + + /** + * Negates this Long's value. + * @returns {!Long} Negated Long + */ + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) + return MIN_VALUE; + return this.not().add(ONE); + }; + + /** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ + LongPrototype.neg = LongPrototype.negate; + + /** + * Returns the sum of this and the specified Long. + * @param {!Long|number|string} addend Addend + * @returns {!Long} Sum + */ + LongPrototype.add = function add(addend) { + if (!isLong(addend)) + addend = fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xFFFF; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 + b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the difference of this and the specified Long. + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) + subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + + /** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.sub = LongPrototype.subtract; + + /** + * Returns the product of this and the specified Long. + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) + return ZERO; + if (!isLong(multiplier)) + multiplier = fromValue(multiplier); + if (multiplier.isZero()) + return ZERO; + if (this.eq(MIN_VALUE)) + return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) + return this.isOdd() ? MIN_VALUE : ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xFFFF; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.mul = LongPrototype.multiply; + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + if (this.isZero()) + return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(MIN_VALUE)) + return ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) + return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return UZERO; + if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true + return UONE; + res = UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2), + delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), + + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + approxRes = fromNumber(approx), + approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + + /** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.div = LongPrototype.divide; + + /** + * Returns this Long modulo the specified. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + return this.sub(this.div(divisor).mul(divisor)); + }; + + /** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.mod = LongPrototype.modulo; + + /** + * Returns the bitwise NOT of this Long. + * @returns {!Long} + */ + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + + /** + * Returns the bitwise AND of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.and = function and(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + + /** + * Returns the bitwise OR of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.or = function or(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + + /** + * Returns the bitwise XOR of this Long and the given one. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.xor = function xor(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shl = LongPrototype.shiftLeft; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shr = LongPrototype.shiftRight; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } else if (numBits === 32) + return fromBits(high, 0, this.unsigned); + else + return fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + + /** + * Converts this Long to signed. + * @returns {!Long} Signed long + */ + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) + return this; + return fromBits(this.low, this.high, false); + }; + + /** + * Converts this Long to unsigned. + * @returns {!Long} Unsigned long + */ + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) + return this; + return fromBits(this.low, this.high, true); + }; + + /** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {!Array.} Byte representation + */ + LongPrototype.toBytes = function(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + + /** + * Converts this Long to its little endian byte representation. + * @returns {!Array.} Little endian byte representation + */ + LongPrototype.toBytesLE = function() { + var hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + (lo >>> 24) & 0xff, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + (hi >>> 24) & 0xff + ]; + }; + + /** + * Converts this Long to its big endian byte representation. + * @returns {!Array.} Big endian byte representation + */ + LongPrototype.toBytesBE = function() { + var hi = this.high, + lo = this.low; + return [ + (hi >>> 24) & 0xff, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + (lo >>> 24) & 0xff, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + + return Long; + }); + }); + + var bytebuffer = createCommonjsModule(function (module) { + /* + Copyright 2013-2014 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license bytebuffer.js (c) 2015 Daniel Wirtz + * Backing buffer: ArrayBuffer, Accessor: Uint8Array + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/bytebuffer.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined(["long"], factory); + /* CommonJS */ else if (typeof commonjsRequire === 'function' && 'object' === "object" && module && module["exports"]) + module['exports'] = (function() { + var Long; try { Long = long_1; } catch (e) {} + return factory(Long); + })(); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = factory(global["dcodeIO"]["Long"]); + + })(commonjsGlobal, function(Long) { + "use strict"; + + /** + * Constructs a new ByteBuffer. + * @class The swiss army knife for binary data in JavaScript. + * @exports ByteBuffer + * @constructor + * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}. + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @expose + */ + var ByteBuffer = function(capacity, littleEndian, noAssert) { + if (typeof capacity === 'undefined') + capacity = ByteBuffer.DEFAULT_CAPACITY; + if (typeof littleEndian === 'undefined') + littleEndian = ByteBuffer.DEFAULT_ENDIAN; + if (typeof noAssert === 'undefined') + noAssert = ByteBuffer.DEFAULT_NOASSERT; + if (!noAssert) { + capacity = capacity | 0; + if (capacity < 0) + throw RangeError("Illegal capacity"); + littleEndian = !!littleEndian; + noAssert = !!noAssert; + } + + /** + * Backing ArrayBuffer. + * @type {!ArrayBuffer} + * @expose + */ + this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity); + + /** + * Uint8Array utilized to manipulate the backing buffer. Becomes `null` if the backing buffer has a capacity of `0`. + * @type {?Uint8Array} + * @expose + */ + this.view = capacity === 0 ? null : new Uint8Array(this.buffer); + + /** + * Absolute read/write offset. + * @type {number} + * @expose + * @see ByteBuffer#flip + * @see ByteBuffer#clear + */ + this.offset = 0; + + /** + * Marked offset. + * @type {number} + * @expose + * @see ByteBuffer#mark + * @see ByteBuffer#reset + */ + this.markedOffset = -1; + + /** + * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation. + * @type {number} + * @expose + * @see ByteBuffer#flip + * @see ByteBuffer#clear + */ + this.limit = capacity; + + /** + * Whether to use little endian byte order, defaults to `false` for big endian. + * @type {boolean} + * @expose + */ + this.littleEndian = littleEndian; + + /** + * Whether to skip assertions of offsets and values, defaults to `false`. + * @type {boolean} + * @expose + */ + this.noAssert = noAssert; + }; + + /** + * ByteBuffer version. + * @type {string} + * @const + * @expose + */ + ByteBuffer.VERSION = "5.0.1"; + + /** + * Little endian constant that can be used instead of its boolean value. Evaluates to `true`. + * @type {boolean} + * @const + * @expose + */ + ByteBuffer.LITTLE_ENDIAN = true; + + /** + * Big endian constant that can be used instead of its boolean value. Evaluates to `false`. + * @type {boolean} + * @const + * @expose + */ + ByteBuffer.BIG_ENDIAN = false; + + /** + * Default initial capacity of `16`. + * @type {number} + * @expose + */ + ByteBuffer.DEFAULT_CAPACITY = 16; + + /** + * Default endianess of `false` for big endian. + * @type {boolean} + * @expose + */ + ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN; + + /** + * Default no assertions flag of `false`. + * @type {boolean} + * @expose + */ + ByteBuffer.DEFAULT_NOASSERT = false; + + /** + * A `Long` class for representing a 64-bit two's-complement integer value. May be `null` if Long.js has not been loaded + * and int64 support is not available. + * @type {?Long} + * @const + * @see https://github.com/dcodeIO/long.js + * @expose + */ + ByteBuffer.Long = Long || null; + + /** + * @alias ByteBuffer.prototype + * @inner + */ + var ByteBufferPrototype = ByteBuffer.prototype; + + /** + * An indicator used to reliably determine if an object is a ByteBuffer or not. + * @type {boolean} + * @const + * @expose + * @private + */ + ByteBufferPrototype.__isByteBuffer__; + + Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", { + value: true, + enumerable: false, + configurable: false + }); + + // helpers + + /** + * @type {!ArrayBuffer} + * @inner + */ + var EMPTY_BUFFER = new ArrayBuffer(0); + + /** + * String.fromCharCode reference for compile-time renaming. + * @type {function(...number):string} + * @inner + */ + var stringFromCharCode = String.fromCharCode; + + /** + * Creates a source function for a string. + * @param {string} s String to read from + * @returns {function():number|null} Source function returning the next char code respectively `null` if there are + * no more characters left. + * @throws {TypeError} If the argument is invalid + * @inner + */ + function stringSource(s) { + var i=0; return function() { + return i < s.length ? s.charCodeAt(i++) : null; + }; + } + + /** + * Creates a destination function for a string. + * @returns {function(number=):undefined|string} Destination function successively called with the next char code. + * Returns the final string when called without arguments. + * @inner + */ + function stringDestination() { + var cs = [], ps = []; return function() { + if (arguments.length === 0) + return ps.join('')+stringFromCharCode.apply(String, cs); + if (cs.length + arguments.length > 1024) + ps.push(stringFromCharCode.apply(String, cs)), + cs.length = 0; + Array.prototype.push.apply(cs, arguments); + }; + } + + /** + * Gets the accessor type. + * @returns {Function} `Buffer` under node.js, `Uint8Array` respectively `DataView` in the browser (classes) + * @expose + */ + ByteBuffer.accessor = function() { + return Uint8Array; + }; + /** + * Allocates a new ByteBuffer backed by a buffer of the specified capacity. + * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}. + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} + * @expose + */ + ByteBuffer.allocate = function(capacity, littleEndian, noAssert) { + return new ByteBuffer(capacity, littleEndian, noAssert); + }; + + /** + * Concatenates multiple ByteBuffers into one. + * @param {!Array.} buffers Buffers to concatenate + * @param {(string|boolean)=} encoding String encoding if `buffers` contains a string ("base64", "hex", "binary", + * defaults to "utf8") + * @param {boolean=} littleEndian Whether to use little or big endian byte order for the resulting ByteBuffer. Defaults + * to {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values for the resulting ByteBuffer. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} Concatenated ByteBuffer + * @expose + */ + ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) { + if (typeof encoding === 'boolean' || typeof encoding !== 'string') { + noAssert = littleEndian; + littleEndian = encoding; + encoding = undefined; + } + var capacity = 0; + for (var i=0, k=buffers.length, length; i 0) capacity += length; + } + if (capacity === 0) + return new ByteBuffer(0, littleEndian, noAssert); + var bb = new ByteBuffer(capacity, littleEndian, noAssert), + bi; + i=0; while (i} buffer Anything that can be wrapped + * @param {(string|boolean)=} encoding String encoding if `buffer` is a string ("base64", "hex", "binary", defaults to + * "utf8") + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} A ByteBuffer wrapping `buffer` + * @expose + */ + ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) { + if (typeof encoding !== 'string') { + noAssert = littleEndian; + littleEndian = encoding; + encoding = undefined; + } + if (typeof buffer === 'string') { + if (typeof encoding === 'undefined') + encoding = "utf8"; + switch (encoding) { + case "base64": + return ByteBuffer.fromBase64(buffer, littleEndian); + case "hex": + return ByteBuffer.fromHex(buffer, littleEndian); + case "binary": + return ByteBuffer.fromBinary(buffer, littleEndian); + case "utf8": + return ByteBuffer.fromUTF8(buffer, littleEndian); + case "debug": + return ByteBuffer.fromDebug(buffer, littleEndian); + default: + throw Error("Unsupported encoding: "+encoding); + } + } + if (buffer === null || typeof buffer !== 'object') + throw TypeError("Illegal buffer"); + var bb; + if (ByteBuffer.isByteBuffer(buffer)) { + bb = ByteBufferPrototype.clone.call(buffer); + bb.markedOffset = -1; + return bb; + } + if (buffer instanceof Uint8Array) { // Extract ArrayBuffer from Uint8Array + bb = new ByteBuffer(0, littleEndian, noAssert); + if (buffer.length > 0) { // Avoid references to more than one EMPTY_BUFFER + bb.buffer = buffer.buffer; + bb.offset = buffer.byteOffset; + bb.limit = buffer.byteOffset + buffer.byteLength; + bb.view = new Uint8Array(buffer.buffer); + } + } else if (buffer instanceof ArrayBuffer) { // Reuse ArrayBuffer + bb = new ByteBuffer(0, littleEndian, noAssert); + if (buffer.byteLength > 0) { + bb.buffer = buffer; + bb.offset = 0; + bb.limit = buffer.byteLength; + bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null; + } + } else if (Object.prototype.toString.call(buffer) === "[object Array]") { // Create from octets + bb = new ByteBuffer(buffer.length, littleEndian, noAssert); + bb.limit = buffer.length; + for (var i=0; i} value Array of booleans to write + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {!ByteBuffer} + * @expose + */ + ByteBufferPrototype.writeBitSet = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (!(value instanceof Array)) + throw TypeError("Illegal BitSet: Not an array"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + + var start = offset, + bits = value.length, + bytes = (bits >> 3), + bit = 0, + k; + + offset += this.writeVarint32(bits,offset); + + while(bytes--) { + k = (!!value[bit++] & 1) | + ((!!value[bit++] & 1) << 1) | + ((!!value[bit++] & 1) << 2) | + ((!!value[bit++] & 1) << 3) | + ((!!value[bit++] & 1) << 4) | + ((!!value[bit++] & 1) << 5) | + ((!!value[bit++] & 1) << 6) | + ((!!value[bit++] & 1) << 7); + this.writeByte(k,offset++); + } + + if(bit < bits) { + var m = 0; k = 0; + while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++)); + this.writeByte(k,offset++); + } + + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a BitSet as an array of booleans. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {Array + * @expose + */ + ByteBufferPrototype.readBitSet = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + + var ret = this.readVarint32(offset), + bits = ret.value, + bytes = (bits >> 3), + bit = 0, + value = [], + k; + + offset += ret.length; + + while(bytes--) { + k = this.readByte(offset++); + value[bit++] = !!(k & 0x01); + value[bit++] = !!(k & 0x02); + value[bit++] = !!(k & 0x04); + value[bit++] = !!(k & 0x08); + value[bit++] = !!(k & 0x10); + value[bit++] = !!(k & 0x20); + value[bit++] = !!(k & 0x40); + value[bit++] = !!(k & 0x80); + } + + if(bit < bits) { + var m = 0; + k = this.readByte(offset++); + while(bit < bits) value[bit++] = !!((k >> (m++)) & 1); + } + + if (relative) { + this.offset = offset; + } + return value; + }; + /** + * Reads the specified number of bytes. + * @param {number} length Number of bytes to read + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {!ByteBuffer} + * @expose + */ + ByteBufferPrototype.readBytes = function(length, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + length > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength); + } + var slice = this.slice(offset, offset + length); + if (relative) this.offset += length; + return slice; + }; + + /** + * Writes a payload of bytes. This is an alias of {@link ByteBuffer#append}. + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to write. If `source` is a ByteBuffer, its offsets + * will be modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeBytes = ByteBufferPrototype.append; + + // types/ints/int8 + + /** + * Writes an 8bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeInt8 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 1; + var capacity0 = this.buffer.byteLength; + if (offset > capacity0) + this.resize((capacity0 *= 2) > offset ? capacity0 : offset); + offset -= 1; + this.view[offset] = value; + if (relative) this.offset += 1; + return this; + }; + + /** + * Writes an 8bit signed integer. This is an alias of {@link ByteBuffer#writeInt8}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8; + + /** + * Reads an 8bit signed integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt8 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var value = this.view[offset]; + if ((value & 0x80) === 0x80) value = -(0xFF - value + 1); // Cast to signed + if (relative) this.offset += 1; + return value; + }; + + /** + * Reads an 8bit signed integer. This is an alias of {@link ByteBuffer#readInt8}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8; + + /** + * Writes an 8bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUint8 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 1; + var capacity1 = this.buffer.byteLength; + if (offset > capacity1) + this.resize((capacity1 *= 2) > offset ? capacity1 : offset); + offset -= 1; + this.view[offset] = value; + if (relative) this.offset += 1; + return this; + }; + + /** + * Writes an 8bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint8}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8; + + /** + * Reads an 8bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUint8 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var value = this.view[offset]; + if (relative) this.offset += 1; + return value; + }; + + /** + * Reads an 8bit unsigned integer. This is an alias of {@link ByteBuffer#readUint8}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8; + + // types/ints/int16 + + /** + * Writes a 16bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeInt16 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 2; + var capacity2 = this.buffer.byteLength; + if (offset > capacity2) + this.resize((capacity2 *= 2) > offset ? capacity2 : offset); + offset -= 2; + if (this.littleEndian) { + this.view[offset+1] = (value & 0xFF00) >>> 8; + this.view[offset ] = value & 0x00FF; + } else { + this.view[offset] = (value & 0xFF00) >>> 8; + this.view[offset+1] = value & 0x00FF; + } + if (relative) this.offset += 2; + return this; + }; + + /** + * Writes a 16bit signed integer. This is an alias of {@link ByteBuffer#writeInt16}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16; + + /** + * Reads a 16bit signed integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readInt16 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 2 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset ]; + value |= this.view[offset+1] << 8; + } else { + value = this.view[offset ] << 8; + value |= this.view[offset+1]; + } + if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1); // Cast to signed + if (relative) this.offset += 2; + return value; + }; + + /** + * Reads a 16bit signed integer. This is an alias of {@link ByteBuffer#readInt16}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16; + + /** + * Writes a 16bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeUint16 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 2; + var capacity3 = this.buffer.byteLength; + if (offset > capacity3) + this.resize((capacity3 *= 2) > offset ? capacity3 : offset); + offset -= 2; + if (this.littleEndian) { + this.view[offset+1] = (value & 0xFF00) >>> 8; + this.view[offset ] = value & 0x00FF; + } else { + this.view[offset] = (value & 0xFF00) >>> 8; + this.view[offset+1] = value & 0x00FF; + } + if (relative) this.offset += 2; + return this; + }; + + /** + * Writes a 16bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint16}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16; + + /** + * Reads a 16bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readUint16 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 2 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset ]; + value |= this.view[offset+1] << 8; + } else { + value = this.view[offset ] << 8; + value |= this.view[offset+1]; + } + if (relative) this.offset += 2; + return value; + }; + + /** + * Reads a 16bit unsigned integer. This is an alias of {@link ByteBuffer#readUint16}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16; + + // types/ints/int32 + + /** + * Writes a 32bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeInt32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity4 = this.buffer.byteLength; + if (offset > capacity4) + this.resize((capacity4 *= 2) > offset ? capacity4 : offset); + offset -= 4; + if (this.littleEndian) { + this.view[offset+3] = (value >>> 24) & 0xFF; + this.view[offset+2] = (value >>> 16) & 0xFF; + this.view[offset+1] = (value >>> 8) & 0xFF; + this.view[offset ] = value & 0xFF; + } else { + this.view[offset ] = (value >>> 24) & 0xFF; + this.view[offset+1] = (value >>> 16) & 0xFF; + this.view[offset+2] = (value >>> 8) & 0xFF; + this.view[offset+3] = value & 0xFF; + } + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit signed integer. This is an alias of {@link ByteBuffer#writeInt32}. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32; + + /** + * Reads a 32bit signed integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset+2] << 16; + value |= this.view[offset+1] << 8; + value |= this.view[offset ]; + value += this.view[offset+3] << 24 >>> 0; + } else { + value = this.view[offset+1] << 16; + value |= this.view[offset+2] << 8; + value |= this.view[offset+3]; + value += this.view[offset ] << 24 >>> 0; + } + value |= 0; // Cast to signed + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit signed integer. This is an alias of {@link ByteBuffer#readInt32}. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32; + + /** + * Writes a 32bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeUint32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity5 = this.buffer.byteLength; + if (offset > capacity5) + this.resize((capacity5 *= 2) > offset ? capacity5 : offset); + offset -= 4; + if (this.littleEndian) { + this.view[offset+3] = (value >>> 24) & 0xFF; + this.view[offset+2] = (value >>> 16) & 0xFF; + this.view[offset+1] = (value >>> 8) & 0xFF; + this.view[offset ] = value & 0xFF; + } else { + this.view[offset ] = (value >>> 24) & 0xFF; + this.view[offset+1] = (value >>> 16) & 0xFF; + this.view[offset+2] = (value >>> 8) & 0xFF; + this.view[offset+3] = value & 0xFF; + } + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint32}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32; + + /** + * Reads a 32bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUint32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset+2] << 16; + value |= this.view[offset+1] << 8; + value |= this.view[offset ]; + value += this.view[offset+3] << 24 >>> 0; + } else { + value = this.view[offset+1] << 16; + value |= this.view[offset+2] << 8; + value |= this.view[offset+3]; + value += this.view[offset ] << 24 >>> 0; + } + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit unsigned integer. This is an alias of {@link ByteBuffer#readUint32}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32; + + // types/ints/int64 + + if (Long) { + + /** + * Writes a 64bit signed integer. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeInt64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + offset += 8; + var capacity6 = this.buffer.byteLength; + if (offset > capacity6) + this.resize((capacity6 *= 2) > offset ? capacity6 : offset); + offset -= 8; + var lo = value.low, + hi = value.high; + if (this.littleEndian) { + this.view[offset+3] = (lo >>> 24) & 0xFF; + this.view[offset+2] = (lo >>> 16) & 0xFF; + this.view[offset+1] = (lo >>> 8) & 0xFF; + this.view[offset ] = lo & 0xFF; + offset += 4; + this.view[offset+3] = (hi >>> 24) & 0xFF; + this.view[offset+2] = (hi >>> 16) & 0xFF; + this.view[offset+1] = (hi >>> 8) & 0xFF; + this.view[offset ] = hi & 0xFF; + } else { + this.view[offset ] = (hi >>> 24) & 0xFF; + this.view[offset+1] = (hi >>> 16) & 0xFF; + this.view[offset+2] = (hi >>> 8) & 0xFF; + this.view[offset+3] = hi & 0xFF; + offset += 4; + this.view[offset ] = (lo >>> 24) & 0xFF; + this.view[offset+1] = (lo >>> 16) & 0xFF; + this.view[offset+2] = (lo >>> 8) & 0xFF; + this.view[offset+3] = lo & 0xFF; + } + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit signed integer. This is an alias of {@link ByteBuffer#writeInt64}. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64; + + /** + * Reads a 64bit signed integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readInt64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var lo = 0, + hi = 0; + if (this.littleEndian) { + lo = this.view[offset+2] << 16; + lo |= this.view[offset+1] << 8; + lo |= this.view[offset ]; + lo += this.view[offset+3] << 24 >>> 0; + offset += 4; + hi = this.view[offset+2] << 16; + hi |= this.view[offset+1] << 8; + hi |= this.view[offset ]; + hi += this.view[offset+3] << 24 >>> 0; + } else { + hi = this.view[offset+1] << 16; + hi |= this.view[offset+2] << 8; + hi |= this.view[offset+3]; + hi += this.view[offset ] << 24 >>> 0; + offset += 4; + lo = this.view[offset+1] << 16; + lo |= this.view[offset+2] << 8; + lo |= this.view[offset+3]; + lo += this.view[offset ] << 24 >>> 0; + } + var value = new Long(lo, hi, false); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit signed integer. This is an alias of {@link ByteBuffer#readInt64}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64; + + /** + * Writes a 64bit unsigned integer. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUint64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + offset += 8; + var capacity7 = this.buffer.byteLength; + if (offset > capacity7) + this.resize((capacity7 *= 2) > offset ? capacity7 : offset); + offset -= 8; + var lo = value.low, + hi = value.high; + if (this.littleEndian) { + this.view[offset+3] = (lo >>> 24) & 0xFF; + this.view[offset+2] = (lo >>> 16) & 0xFF; + this.view[offset+1] = (lo >>> 8) & 0xFF; + this.view[offset ] = lo & 0xFF; + offset += 4; + this.view[offset+3] = (hi >>> 24) & 0xFF; + this.view[offset+2] = (hi >>> 16) & 0xFF; + this.view[offset+1] = (hi >>> 8) & 0xFF; + this.view[offset ] = hi & 0xFF; + } else { + this.view[offset ] = (hi >>> 24) & 0xFF; + this.view[offset+1] = (hi >>> 16) & 0xFF; + this.view[offset+2] = (hi >>> 8) & 0xFF; + this.view[offset+3] = hi & 0xFF; + offset += 4; + this.view[offset ] = (lo >>> 24) & 0xFF; + this.view[offset+1] = (lo >>> 16) & 0xFF; + this.view[offset+2] = (lo >>> 8) & 0xFF; + this.view[offset+3] = lo & 0xFF; + } + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint64}. + * @function + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64; + + /** + * Reads a 64bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readUint64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var lo = 0, + hi = 0; + if (this.littleEndian) { + lo = this.view[offset+2] << 16; + lo |= this.view[offset+1] << 8; + lo |= this.view[offset ]; + lo += this.view[offset+3] << 24 >>> 0; + offset += 4; + hi = this.view[offset+2] << 16; + hi |= this.view[offset+1] << 8; + hi |= this.view[offset ]; + hi += this.view[offset+3] << 24 >>> 0; + } else { + hi = this.view[offset+1] << 16; + hi |= this.view[offset+2] << 8; + hi |= this.view[offset+3]; + hi += this.view[offset ] << 24 >>> 0; + offset += 4; + lo = this.view[offset+1] << 16; + lo |= this.view[offset+2] << 8; + lo |= this.view[offset+3]; + lo += this.view[offset ] << 24 >>> 0; + } + var value = new Long(lo, hi, true); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit unsigned integer. This is an alias of {@link ByteBuffer#readUint64}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64; + + } // Long + + + // types/floats/float32 + + /* + ieee754 - https://github.com/feross/ieee754 + + The MIT License (MIT) + + Copyright (c) Feross Aboukhadijeh + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + + /** + * Reads an IEEE754 float from a byte array. + * @param {!Array} buffer + * @param {number} offset + * @param {boolean} isLE + * @param {number} mLen + * @param {number} nBytes + * @returns {number} + * @inner + */ + function ieee754_read(buffer, offset, isLE, mLen, nBytes) { + var e, m, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + nBits = -7, + i = isLE ? (nBytes - 1) : 0, + d = isLE ? -1 : 1, + s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity); + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + } + + /** + * Writes an IEEE754 float to a byte array. + * @param {!Array} buffer + * @param {number} value + * @param {number} offset + * @param {boolean} isLE + * @param {number} mLen + * @param {number} nBytes + * @inner + */ + function ieee754_write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), + i = isLE ? 0 : (nBytes - 1), + d = isLE ? 1 : -1, + s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + } + + /** + * Writes a 32bit float. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number') + throw TypeError("Illegal value: "+value+" (not a number)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity8 = this.buffer.byteLength; + if (offset > capacity8) + this.resize((capacity8 *= 2) > offset ? capacity8 : offset); + offset -= 4; + ieee754_write(this.view, value, offset, this.littleEndian, 23, 4); + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit float. This is an alias of {@link ByteBuffer#writeFloat32}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32; + + /** + * Reads a 32bit float. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4); + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit float. This is an alias of {@link ByteBuffer#readFloat32}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32; + + // types/floats/float64 + + /** + * Writes a 64bit float. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number') + throw TypeError("Illegal value: "+value+" (not a number)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 8; + var capacity9 = this.buffer.byteLength; + if (offset > capacity9) + this.resize((capacity9 *= 2) > offset ? capacity9 : offset); + offset -= 8; + ieee754_write(this.view, value, offset, this.littleEndian, 52, 8); + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit float. This is an alias of {@link ByteBuffer#writeFloat64}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64; + + /** + * Reads a 64bit float. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit float. This is an alias of {@link ByteBuffer#readFloat64}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64; + + + // types/varints/varint32 + + /** + * Maximum number of bytes required to store a 32bit base 128 variable-length integer. + * @type {number} + * @const + * @expose + */ + ByteBuffer.MAX_VARINT32_BYTES = 5; + + /** + * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer. + * @param {number} value Value to encode + * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT32_BYTES} + * @expose + */ + ByteBuffer.calculateVarint32 = function(value) { + // ref: src/google/protobuf/io/coded_stream.cc + value = value >>> 0; + if (value < 1 << 7 ) return 1; + else if (value < 1 << 14) return 2; + else if (value < 1 << 21) return 3; + else if (value < 1 << 28) return 4; + else return 5; + }; + + /** + * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding. + * @param {number} n Signed 32bit integer + * @returns {number} Unsigned zigzag encoded 32bit integer + * @expose + */ + ByteBuffer.zigZagEncode32 = function(n) { + return (((n |= 0) << 1) ^ (n >> 31)) >>> 0; // ref: src/google/protobuf/wire_format_lite.h + }; + + /** + * Decodes a zigzag encoded signed 32bit integer. + * @param {number} n Unsigned zigzag encoded 32bit integer + * @returns {number} Signed 32bit integer + * @expose + */ + ByteBuffer.zigZagDecode32 = function(n) { + return ((n >>> 1) ^ -(n & 1)) | 0; // // ref: src/google/protobuf/wire_format_lite.h + }; + + /** + * Writes a 32bit base 128 variable-length integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeVarint32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var size = ByteBuffer.calculateVarint32(value), + b; + offset += size; + var capacity10 = this.buffer.byteLength; + if (offset > capacity10) + this.resize((capacity10 *= 2) > offset ? capacity10 : offset); + offset -= size; + value >>>= 0; + while (value >= 0x80) { + b = (value & 0x7f) | 0x80; + this.view[offset++] = b; + value >>>= 7; + } + this.view[offset++] = value; + if (relative) { + this.offset = offset; + return this; + } + return size; + }; + + /** + * Writes a zig-zag encoded (signed) 32bit base 128 variable-length integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) { + return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset); + }; + + /** + * Reads a 32bit base 128 variable-length integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read + * and the actual number of bytes read. + * @throws {Error} If it's not a valid varint. Has a property `truncated = true` if there is not enough data available + * to fully decode the varint. + * @expose + */ + ByteBufferPrototype.readVarint32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var c = 0, + value = 0 >>> 0, + b; + do { + if (!this.noAssert && offset > this.limit) { + var err = Error("Truncated"); + err['truncated'] = true; + throw err; + } + b = this.view[offset++]; + if (c < 5) + value |= (b & 0x7f) << (7*c); + ++c; + } while ((b & 0x80) !== 0); + value |= 0; + if (relative) { + this.offset = offset; + return value; + } + return { + "value": value, + "length": c + }; + }; + + /** + * Reads a zig-zag encoded (signed) 32bit base 128 variable-length integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read + * and the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint32ZigZag = function(offset) { + var val = this.readVarint32(offset); + if (typeof val === 'object') + val["value"] = ByteBuffer.zigZagDecode32(val["value"]); + else + val = ByteBuffer.zigZagDecode32(val); + return val; + }; + + // types/varints/varint64 + + if (Long) { + + /** + * Maximum number of bytes required to store a 64bit base 128 variable-length integer. + * @type {number} + * @const + * @expose + */ + ByteBuffer.MAX_VARINT64_BYTES = 10; + + /** + * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer. + * @param {number|!Long} value Value to encode + * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT64_BYTES} + * @expose + */ + ByteBuffer.calculateVarint64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + // ref: src/google/protobuf/io/coded_stream.cc + var part0 = value.toInt() >>> 0, + part1 = value.shiftRightUnsigned(28).toInt() >>> 0, + part2 = value.shiftRightUnsigned(56).toInt() >>> 0; + if (part2 == 0) { + if (part1 == 0) { + if (part0 < 1 << 14) + return part0 < 1 << 7 ? 1 : 2; + else + return part0 < 1 << 21 ? 3 : 4; + } else { + if (part1 < 1 << 14) + return part1 < 1 << 7 ? 5 : 6; + else + return part1 < 1 << 21 ? 7 : 8; + } + } else + return part2 < 1 << 7 ? 9 : 10; + }; + + /** + * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding. + * @param {number|!Long} value Signed long + * @returns {!Long} Unsigned zigzag encoded long + * @expose + */ + ByteBuffer.zigZagEncode64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + // ref: src/google/protobuf/wire_format_lite.h + return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned(); + }; + + /** + * Decodes a zigzag encoded signed 64bit integer. + * @param {!Long|number} value Unsigned zigzag encoded long or JavaScript number + * @returns {!Long} Signed long + * @expose + */ + ByteBuffer.zigZagDecode64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + // ref: src/google/protobuf/wire_format_lite.h + return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned(); + }; + + /** + * Writes a 64bit base 128 variable-length integer. + * @param {number|Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeVarint64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + var size = ByteBuffer.calculateVarint64(value), + part0 = value.toInt() >>> 0, + part1 = value.shiftRightUnsigned(28).toInt() >>> 0, + part2 = value.shiftRightUnsigned(56).toInt() >>> 0; + offset += size; + var capacity11 = this.buffer.byteLength; + if (offset > capacity11) + this.resize((capacity11 *= 2) > offset ? capacity11 : offset); + offset -= size; + switch (size) { + case 10: this.view[offset+9] = (part2 >>> 7) & 0x01; + case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F; + case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F; + case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F; + case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F; + case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F; + case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F; + case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F; + case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F; + case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F; + } + if (relative) { + this.offset += size; + return this; + } else { + return size; + } + }; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer. + * @param {number|Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) { + return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset); + }; + + /** + * Reads a 64bit base 128 variable-length integer. Requires Long.js. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and + * the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + // ref: src/google/protobuf/io/coded_stream.cc + var start = offset, + part0 = 0, + part1 = 0, + part2 = 0, + b = 0; + b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + throw Error("Buffer overrun"); }}}}}}}}}} + var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false); + if (relative) { + this.offset = offset; + return value; + } else { + return { + 'value': value, + 'length': offset-start + }; + } + }; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and + * the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint64ZigZag = function(offset) { + var val = this.readVarint64(offset); + if (val && val['value'] instanceof Long) + val["value"] = ByteBuffer.zigZagDecode64(val["value"]); + else + val = ByteBuffer.zigZagDecode64(val); + return val; + }; + + } // Long + + + // types/strings/cstring + + /** + * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL + * characters itself. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * contained in `str` + 1 if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeCString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + var i, + k = str.length; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + for (i=0; i>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + // UTF8 strings do not contain zero bytes in between except for the zero character, so: + k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; + offset += k+1; + var capacity12 = this.buffer.byteLength; + if (offset > capacity12) + this.resize((capacity12 *= 2) > offset ? capacity12 : offset); + offset -= k+1; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + this.view[offset++] = 0; + if (relative) { + this.offset = offset; + return this; + } + return k; + }; + + /** + * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters + * itself. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readCString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var start = offset, + temp; + // UTF8 strings do not contain zero bytes in between except for the zero character itself, so: + var sd, b = -1; + utfx.decodeUTF8toUTF16(function() { + if (b === 0) return null; + if (offset >= this.limit) + throw RangeError("Illegal range: Truncated data, "+offset+" < "+this.limit); + b = this.view[offset++]; + return b === 0 ? null : b; + }.bind(this), sd = stringDestination(), true); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + "string": sd(), + "length": offset - start + }; + } + }; + + // types/strings/istring + + /** + * Writes a length as uint32 prefixed UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written + * @expose + * @see ByteBuffer#writeVarint32 + */ + ByteBufferPrototype.writeIString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var start = offset, + k; + k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1]; + offset += 4+k; + var capacity13 = this.buffer.byteLength; + if (offset > capacity13) + this.resize((capacity13 *= 2) > offset ? capacity13 : offset); + offset -= 4+k; + if (this.littleEndian) { + this.view[offset+3] = (k >>> 24) & 0xFF; + this.view[offset+2] = (k >>> 16) & 0xFF; + this.view[offset+1] = (k >>> 8) & 0xFF; + this.view[offset ] = k & 0xFF; + } else { + this.view[offset ] = (k >>> 24) & 0xFF; + this.view[offset+1] = (k >>> 16) & 0xFF; + this.view[offset+2] = (k >>> 8) & 0xFF; + this.view[offset+3] = k & 0xFF; + } + offset += 4; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (offset !== start + 4 + k) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+4+k)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a length as uint32 prefixed UTF8 encoded string. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + * @see ByteBuffer#readVarint32 + */ + ByteBufferPrototype.readIString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var start = offset; + var len = this.readUint32(offset); + var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4); + offset += str['length']; + if (relative) { + this.offset = offset; + return str['string']; + } else { + return { + 'string': str['string'], + 'length': offset - start + }; + } + }; + + // types/strings/utf8string + + /** + * Metrics representing number of UTF8 characters. Evaluates to `c`. + * @type {string} + * @const + * @expose + */ + ByteBuffer.METRICS_CHARS = 'c'; + + /** + * Metrics representing number of bytes. Evaluates to `b`. + * @type {string} + * @const + * @expose + */ + ByteBuffer.METRICS_BYTES = 'b'; + + /** + * Writes an UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeUTF8String = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var k; + var start = offset; + k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; + offset += k; + var capacity14 = this.buffer.byteLength; + if (offset > capacity14) + this.resize((capacity14 *= 2) > offset ? capacity14 : offset); + offset -= k; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Writes an UTF8 encoded string. This is an alias of {@link ByteBuffer#writeUTF8String}. + * @function + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String; + + /** + * Calculates the number of UTF8 characters of a string. JavaScript itself uses UTF-16, so that a string's + * `length` property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF. + * @param {string} str String to calculate + * @returns {number} Number of UTF8 characters + * @expose + */ + ByteBuffer.calculateUTF8Chars = function(str) { + return utfx.calculateUTF16asUTF8(stringSource(str))[0]; + }; + + /** + * Calculates the number of UTF8 bytes of a string. + * @param {string} str String to calculate + * @returns {number} Number of UTF8 bytes + * @expose + */ + ByteBuffer.calculateUTF8Bytes = function(str) { + return utfx.calculateUTF16asUTF8(stringSource(str))[1]; + }; + + /** + * Calculates the number of UTF8 bytes of a string. This is an alias of {@link ByteBuffer.calculateUTF8Bytes}. + * @function + * @param {string} str String to calculate + * @returns {number} Number of UTF8 bytes + * @expose + */ + ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes; + + /** + * Reads an UTF8 encoded string. + * @param {number} length Number of characters or bytes to read. + * @param {string=} metrics Metrics specifying what `length` is meant to count. Defaults to + * {@link ByteBuffer.METRICS_CHARS}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readUTF8String = function(length, metrics, offset) { + if (typeof metrics === 'number') { + offset = metrics; + metrics = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS; + if (!this.noAssert) { + if (typeof length !== 'number' || length % 1 !== 0) + throw TypeError("Illegal length: "+length+" (not an integer)"); + length |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var i = 0, + start = offset, + sd; + if (metrics === ByteBuffer.METRICS_CHARS) { // The same for node and the browser + sd = stringDestination(); + utfx.decodeUTF8(function() { + return i < length && offset < this.limit ? this.view[offset++] : null; + }.bind(this), function(cp) { + ++i; utfx.UTF8toUTF16(cp, sd); + }); + if (i !== length) + throw RangeError("Illegal range: Truncated data, "+i+" == "+length); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + "string": sd(), + "length": offset - start + }; + } + } else if (metrics === ByteBuffer.METRICS_BYTES) { + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + length > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength); + } + var k = offset + length; + utfx.decodeUTF8toUTF16(function() { + return offset < k ? this.view[offset++] : null; + }.bind(this), sd = stringDestination(), this.noAssert); + if (offset !== k) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+k); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + 'string': sd(), + 'length': offset - start + }; + } + } else + throw TypeError("Unsupported metrics: "+metrics); + }; + + /** + * Reads an UTF8 encoded string. This is an alias of {@link ByteBuffer#readUTF8String}. + * @function + * @param {number} length Number of characters or bytes to read + * @param {number=} metrics Metrics specifying what `n` is meant to count. Defaults to + * {@link ByteBuffer.METRICS_CHARS}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String; + + // types/strings/vstring + + /** + * Writes a length as varint32 prefixed UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written + * @expose + * @see ByteBuffer#writeVarint32 + */ + ByteBufferPrototype.writeVString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var start = offset, + k, l; + k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1]; + l = ByteBuffer.calculateVarint32(k); + offset += l+k; + var capacity15 = this.buffer.byteLength; + if (offset > capacity15) + this.resize((capacity15 *= 2) > offset ? capacity15 : offset); + offset -= l+k; + offset += this.writeVarint32(k, offset); + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (offset !== start+k+l) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+k+l)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + * @see ByteBuffer#readVarint32 + */ + ByteBufferPrototype.readVString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var start = offset; + var len = this.readVarint32(offset); + var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']); + offset += str['length']; + if (relative) { + this.offset = offset; + return str['string']; + } else { + return { + 'string': str['string'], + 'length': offset - start + }; + } + }; + + + /** + * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended + * data's length. + * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to append. If `source` is a ByteBuffer, its offsets + * will be modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to append at. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer} this + * @expose + * @example A relative `<01 02>03.append(<04 05>)` will result in `<01 02 04 05>, 04 05|` + * @example An absolute `<01 02>03.append(04 05>, 1)` will result in `<01 04>05, 04 05|` + */ + ByteBufferPrototype.append = function(source, encoding, offset) { + if (typeof encoding === 'number' || typeof encoding !== 'string') { + offset = encoding; + encoding = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (!(source instanceof ByteBuffer)) + source = ByteBuffer.wrap(source, encoding); + var length = source.limit - source.offset; + if (length <= 0) return this; // Nothing to append + offset += length; + var capacity16 = this.buffer.byteLength; + if (offset > capacity16) + this.resize((capacity16 *= 2) > offset ? capacity16 : offset); + offset -= length; + this.view.set(source.view.subarray(source.offset, source.limit), offset); + source.offset += length; + if (relative) this.offset += length; + return this; + }; + + /** + * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the + specified offset up to the length of this ByteBuffer's data. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!ByteBuffer} this + * @expose + * @see ByteBuffer#append + */ + ByteBufferPrototype.appendTo = function(target, offset) { + target.append(this, offset); + return this; + }; + + /** + * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to + * disable them if your code already makes sure that everything is valid. + * @param {boolean} assert `true` to enable assertions, otherwise `false` + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.assert = function(assert) { + this.noAssert = !assert; + return this; + }; + + /** + * Gets the capacity of this ByteBuffer's backing buffer. + * @returns {number} Capacity of the backing buffer + * @expose + */ + ByteBufferPrototype.capacity = function() { + return this.buffer.byteLength; + }; + /** + * Clears this ByteBuffer's offsets by setting {@link ByteBuffer#offset} to `0` and {@link ByteBuffer#limit} to the + * backing buffer's capacity. Discards {@link ByteBuffer#markedOffset}. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.clear = function() { + this.offset = 0; + this.limit = this.buffer.byteLength; + this.markedOffset = -1; + return this; + }; + + /** + * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for {@link ByteBuffer#offset}, + * {@link ByteBuffer#markedOffset} and {@link ByteBuffer#limit}. + * @param {boolean=} copy Whether to copy the backing buffer or to return another view on the same, defaults to `false` + * @returns {!ByteBuffer} Cloned instance + * @expose + */ + ByteBufferPrototype.clone = function(copy) { + var bb = new ByteBuffer(0, this.littleEndian, this.noAssert); + if (copy) { + bb.buffer = new ArrayBuffer(this.buffer.byteLength); + bb.view = new Uint8Array(bb.buffer); + } else { + bb.buffer = this.buffer; + bb.view = this.view; + } + bb.offset = this.offset; + bb.markedOffset = this.markedOffset; + bb.limit = this.limit; + return bb; + }; + + /** + * Compacts this ByteBuffer to be backed by a {@link ByteBuffer#buffer} of its contents' length. Contents are the bytes + * between {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will set `offset = 0` and `limit = capacity` and + * adapt {@link ByteBuffer#markedOffset} to the same relative position if set. + * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.compact = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === 0 && end === this.buffer.byteLength) + return this; // Already compacted + var len = end - begin; + if (len === 0) { + this.buffer = EMPTY_BUFFER; + this.view = null; + if (this.markedOffset >= 0) this.markedOffset -= begin; + this.offset = 0; + this.limit = 0; + return this; + } + var buffer = new ArrayBuffer(len); + var view = new Uint8Array(buffer); + view.set(this.view.subarray(begin, end)); + this.buffer = buffer; + this.view = view; + if (this.markedOffset >= 0) this.markedOffset -= begin; + this.offset = 0; + this.limit = len; + return this; + }; + + /** + * Creates a copy of this ByteBuffer's contents. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}. + * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} Copy + * @expose + */ + ByteBufferPrototype.copy = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === end) + return new ByteBuffer(0, this.littleEndian, this.noAssert); + var capacity = end - begin, + bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert); + bb.offset = 0; + bb.limit = capacity; + if (bb.markedOffset >= 0) bb.markedOffset -= begin; + this.copyTo(bb, 0, begin, end); + return bb; + }; + + /** + * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} targetOffset Offset to copy to. Will use and increase the target's {@link ByteBuffer#offset} + * by the number of bytes copied if omitted. + * @param {number=} sourceOffset Offset to start copying from. Will use and increase {@link ByteBuffer#offset} by the + * number of bytes copied if omitted. + * @param {number=} sourceLimit Offset to end copying from, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) { + var relative, + targetRelative; + if (!this.noAssert) { + if (!ByteBuffer.isByteBuffer(target)) + throw TypeError("Illegal target: Not a ByteBuffer"); + } + targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0; + sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0; + sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0; + + if (targetOffset < 0 || targetOffset > target.buffer.byteLength) + throw RangeError("Illegal target range: 0 <= "+targetOffset+" <= "+target.buffer.byteLength); + if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength) + throw RangeError("Illegal source range: 0 <= "+sourceOffset+" <= "+this.buffer.byteLength); + + var len = sourceLimit - sourceOffset; + if (len === 0) + return target; // Nothing to copy + + target.ensureCapacity(targetOffset + len); + + target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset); + + if (relative) this.offset += len; + if (targetRelative) target.offset += len; + + return this; + }; + + /** + * Makes sure that this ByteBuffer is backed by a {@link ByteBuffer#buffer} of at least the specified capacity. If the + * current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity, + * the required capacity will be used instead. + * @param {number} capacity Required capacity + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.ensureCapacity = function(capacity) { + var current = this.buffer.byteLength; + if (current < capacity) + return this.resize((current *= 2) > capacity ? current : capacity); + return this; + }; + + /** + * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. + * @param {number|string} value Byte value to fill with. If given as a string, the first character is used. + * @param {number=} begin Begin offset. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} this + * @expose + * @example `someByteBuffer.clear().fill(0)` fills the entire backing buffer with zeroes + */ + ByteBufferPrototype.fill = function(value, begin, end) { + var relative = typeof begin === 'undefined'; + if (relative) begin = this.offset; + if (typeof value === 'string' && value.length > 0) + value = value.charCodeAt(0); + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin >= end) + return this; // Nothing to fill + while (begin < end) this.view[begin++] = value; + if (relative) this.offset = begin; + return this; + }; + + /** + * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets `limit = offset` and + * `offset = 0`. Make sure always to flip a ByteBuffer when all relative read or write operations are complete. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.flip = function() { + this.limit = this.offset; + this.offset = 0; + return this; + }; + /** + * Marks an offset on this ByteBuffer to be used later. + * @param {number=} offset Offset to mark. Defaults to {@link ByteBuffer#offset}. + * @returns {!ByteBuffer} this + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @see ByteBuffer#reset + * @expose + */ + ByteBufferPrototype.mark = function(offset) { + offset = typeof offset === 'undefined' ? this.offset : offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + this.markedOffset = offset; + return this; + }; + /** + * Sets the byte order. + * @param {boolean} littleEndian `true` for little endian byte order, `false` for big endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.order = function(littleEndian) { + if (!this.noAssert) { + if (typeof littleEndian !== 'boolean') + throw TypeError("Illegal littleEndian: Not a boolean"); + } + this.littleEndian = !!littleEndian; + return this; + }; + + /** + * Switches (to) little endian byte order. + * @param {boolean=} littleEndian Defaults to `true`, otherwise uses big endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.LE = function(littleEndian) { + this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true; + return this; + }; + + /** + * Switches (to) big endian byte order. + * @param {boolean=} bigEndian Defaults to `true`, otherwise uses little endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.BE = function(bigEndian) { + this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false; + return this; + }; + /** + * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the + * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer + * will be resized and its contents moved accordingly. + * @param {!ByteBuffer|string|!ArrayBuffer} source Data to prepend. If `source` is a ByteBuffer, its offset will be + * modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes + * prepended if omitted. + * @returns {!ByteBuffer} this + * @expose + * @example A relative `00<01 02 03>.prepend(<04 05>)` results in `<04 05 01 02 03>, 04 05|` + * @example An absolute `00<01 02 03>.prepend(<04 05>, 2)` results in `04<05 02 03>, 04 05|` + */ + ByteBufferPrototype.prepend = function(source, encoding, offset) { + if (typeof encoding === 'number' || typeof encoding !== 'string') { + offset = encoding; + encoding = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (!(source instanceof ByteBuffer)) + source = ByteBuffer.wrap(source, encoding); + var len = source.limit - source.offset; + if (len <= 0) return this; // Nothing to prepend + var diff = len - offset; + if (diff > 0) { // Not enough space before offset, so resize + move + var buffer = new ArrayBuffer(this.buffer.byteLength + diff); + var view = new Uint8Array(buffer); + view.set(this.view.subarray(offset, this.buffer.byteLength), len); + this.buffer = buffer; + this.view = view; + this.offset += diff; + if (this.markedOffset >= 0) this.markedOffset += diff; + this.limit += diff; + offset += diff; + } else { + var arrayView = new Uint8Array(this.buffer); + } + this.view.set(source.view.subarray(source.offset, source.limit), offset - len); + + source.offset = source.limit; + if (relative) + this.offset -= len; + return this; + }; + + /** + * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the + * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer + * will be resized and its contents moved accordingly. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes + * prepended if omitted. + * @returns {!ByteBuffer} this + * @expose + * @see ByteBuffer#prepend + */ + ByteBufferPrototype.prependTo = function(target, offset) { + target.prepend(this, offset); + return this; + }; + /** + * Prints debug information about this ByteBuffer's contents. + * @param {function(string)=} out Output function to call, defaults to console.log + * @expose + */ + ByteBufferPrototype.printDebug = function(out) { + if (typeof out !== 'function') out = console.log.bind(console); + out( + this.toString()+"\n"+ + "-------------------------------------------------------------------\n"+ + this.toDebug(/* columns */ true) + ); + }; + + /** + * Gets the number of remaining readable bytes. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}, so this returns `limit - offset`. + * @returns {number} Remaining readable bytes. May be negative if `offset > limit`. + * @expose + */ + ByteBufferPrototype.remaining = function() { + return this.limit - this.offset; + }; + /** + * Resets this ByteBuffer's {@link ByteBuffer#offset}. If an offset has been marked through {@link ByteBuffer#mark} + * before, `offset` will be set to {@link ByteBuffer#markedOffset}, which will then be discarded. If no offset has been + * marked, sets `offset = 0`. + * @returns {!ByteBuffer} this + * @see ByteBuffer#mark + * @expose + */ + ByteBufferPrototype.reset = function() { + if (this.markedOffset >= 0) { + this.offset = this.markedOffset; + this.markedOffset = -1; + } else { + this.offset = 0; + } + return this; + }; + /** + * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that + * large or larger. + * @param {number} capacity Capacity required + * @returns {!ByteBuffer} this + * @throws {TypeError} If `capacity` is not a number + * @throws {RangeError} If `capacity < 0` + * @expose + */ + ByteBufferPrototype.resize = function(capacity) { + if (!this.noAssert) { + if (typeof capacity !== 'number' || capacity % 1 !== 0) + throw TypeError("Illegal capacity: "+capacity+" (not an integer)"); + capacity |= 0; + if (capacity < 0) + throw RangeError("Illegal capacity: 0 <= "+capacity); + } + if (this.buffer.byteLength < capacity) { + var buffer = new ArrayBuffer(capacity); + var view = new Uint8Array(buffer); + view.set(this.view); + this.buffer = buffer; + this.view = view; + } + return this; + }; + /** + * Reverses this ByteBuffer's contents. + * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.reverse = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === end) + return this; // Nothing to reverse + Array.prototype.reverse.call(this.view.subarray(begin, end)); + return this; + }; + /** + * Skips the next `length` bytes. This will just advance + * @param {number} length Number of bytes to skip. May also be negative to move the offset back. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.skip = function(length) { + if (!this.noAssert) { + if (typeof length !== 'number' || length % 1 !== 0) + throw TypeError("Illegal length: "+length+" (not an integer)"); + length |= 0; + } + var offset = this.offset + length; + if (!this.noAssert) { + if (offset < 0 || offset > this.buffer.byteLength) + throw RangeError("Illegal length: 0 <= "+this.offset+" + "+length+" <= "+this.buffer.byteLength); + } + this.offset = offset; + return this; + }; + + /** + * Slices this ByteBuffer by creating a cloned instance with `offset = begin` and `limit = end`. + * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} Clone of this ByteBuffer with slicing applied, backed by the same {@link ByteBuffer#buffer} + * @expose + */ + ByteBufferPrototype.slice = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var bb = this.clone(); + bb.offset = begin; + bb.limit = end; + return bb; + }; + /** + * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. + * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory if + * possible. Defaults to `false` + * @returns {!ArrayBuffer} Contents as an ArrayBuffer + * @expose + */ + ByteBufferPrototype.toBuffer = function(forceCopy) { + var offset = this.offset, + limit = this.limit; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: Not an integer"); + offset >>>= 0; + if (typeof limit !== 'number' || limit % 1 !== 0) + throw TypeError("Illegal limit: Not an integer"); + limit >>>= 0; + if (offset < 0 || offset > limit || limit > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+offset+" <= "+limit+" <= "+this.buffer.byteLength); + } + // NOTE: It's not possible to have another ArrayBuffer reference the same memory as the backing buffer. This is + // possible with Uint8Array#subarray only, but we have to return an ArrayBuffer by contract. So: + if (!forceCopy && offset === 0 && limit === this.buffer.byteLength) + return this.buffer; + if (offset === limit) + return EMPTY_BUFFER; + var buffer = new ArrayBuffer(limit - offset); + new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0); + return buffer; + }; + + /** + * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. This is an alias of {@link ByteBuffer#toBuffer}. + * @function + * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory. + * Defaults to `false` + * @returns {!ArrayBuffer} Contents as an ArrayBuffer + * @expose + */ + ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer; + + /** + * Converts the ByteBuffer's contents to a string. + * @param {string=} encoding Output encoding. Returns an informative string representation if omitted but also allows + * direct conversion to "utf8", "hex", "base64" and "binary" encoding. "debug" returns a hex representation with + * highlighted offsets. + * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {string} String representation + * @throws {Error} If `encoding` is invalid + * @expose + */ + ByteBufferPrototype.toString = function(encoding, begin, end) { + if (typeof encoding === 'undefined') + return "ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")"; + if (typeof encoding === 'number') + encoding = "utf8", + begin = encoding, + end = begin; + switch (encoding) { + case "utf8": + return this.toUTF8(begin, end); + case "base64": + return this.toBase64(begin, end); + case "hex": + return this.toHex(begin, end); + case "binary": + return this.toBinary(begin, end); + case "debug": + return this.toDebug(); + case "columns": + return this.toColumns(); + default: + throw Error("Unsupported encoding: "+encoding); + } + }; + + // lxiv-embeddable + + /** + * lxiv-embeddable (c) 2014 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/lxiv for details + */ + var lxiv = function() { + "use strict"; + + /** + * lxiv namespace. + * @type {!Object.} + * @exports lxiv + */ + var lxiv = {}; + + /** + * Character codes for output. + * @type {!Array.} + * @inner + */ + var aout = [ + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 + ]; + + /** + * Character codes for input. + * @type {!Array.} + * @inner + */ + var ain = []; + for (var i=0, k=aout.length; i>2)&0x3f]); + t = (b&0x3)<<4; + if ((b = src()) !== null) { + t |= (b>>4)&0xf; + dst(aout[(t|((b>>4)&0xf))&0x3f]); + t = (b&0xf)<<2; + if ((b = src()) !== null) + dst(aout[(t|((b>>6)&0x3))&0x3f]), + dst(aout[b&0x3f]); + else + dst(aout[t&0x3f]), + dst(61); + } else + dst(aout[t&0x3f]), + dst(61), + dst(61); + } + }; + + /** + * Decodes base64 char codes to bytes. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. + * @throws {Error} If a character code is invalid + */ + lxiv.decode = function(src, dst) { + var c, t1, t2; + function fail(c) { + throw Error("Illegal character code: "+c); + } + while ((c = src()) !== null) { + t1 = ain[c]; + if (typeof t1 === 'undefined') fail(c); + if ((c = src()) !== null) { + t2 = ain[c]; + if (typeof t2 === 'undefined') fail(c); + dst((t1<<2)>>>0|(t2&0x30)>>4); + if ((c = src()) !== null) { + t1 = ain[c]; + if (typeof t1 === 'undefined') + if (c === 61) break; else fail(c); + dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2); + if ((c = src()) !== null) { + t2 = ain[c]; + if (typeof t2 === 'undefined') + if (c === 61) break; else fail(c); + dst(((t1&0x3)<<6)>>>0|t2); + } + } + } + } + }; + + /** + * Tests if a string is valid base64. + * @param {string} str String to test + * @returns {boolean} `true` if valid, otherwise `false` + */ + lxiv.test = function(str) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str); + }; + + return lxiv; + }(); + + // encodings/base64 + + /** + * Encodes this ByteBuffer's contents to a base64 encoded string. + * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}. + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}. + * @returns {string} Base64 encoded string + * @throws {RangeError} If `begin` or `end` is out of bounds + * @expose + */ + ByteBufferPrototype.toBase64 = function(begin, end) { + if (typeof begin === 'undefined') + begin = this.offset; + if (typeof end === 'undefined') + end = this.limit; + begin = begin | 0; end = end | 0; + if (begin < 0 || end > this.capacity || begin > end) + throw RangeError("begin, end"); + var sd; lxiv.encode(function() { + return begin < end ? this.view[begin++] : null; + }.bind(this), sd = stringDestination()); + return sd(); + }; + + /** + * Decodes a base64 encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromBase64 = function(str, littleEndian) { + if (typeof str !== 'string') + throw TypeError("str"); + var bb = new ByteBuffer(str.length/4*3, littleEndian), + i = 0; + lxiv.decode(stringSource(str), function(b) { + bb.view[i++] = b; + }); + bb.limit = i; + return bb; + }; + + /** + * Encodes a binary string to base64 like `window.btoa` does. + * @param {string} str Binary string + * @returns {string} Base64 encoded string + * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa + * @expose + */ + ByteBuffer.btoa = function(str) { + return ByteBuffer.fromBinary(str).toBase64(); + }; + + /** + * Decodes a base64 encoded string to binary like `window.atob` does. + * @param {string} b64 Base64 encoded string + * @returns {string} Binary string + * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.atob + * @expose + */ + ByteBuffer.atob = function(b64) { + return ByteBuffer.fromBase64(b64).toBinary(); + }; + + // encodings/binary + + /** + * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes. + * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}. + * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}. + * @returns {string} Binary encoded string + * @throws {RangeError} If `offset > limit` + * @expose + */ + ByteBufferPrototype.toBinary = function(begin, end) { + if (typeof begin === 'undefined') + begin = this.offset; + if (typeof end === 'undefined') + end = this.limit; + begin |= 0; end |= 0; + if (begin < 0 || end > this.capacity() || begin > end) + throw RangeError("begin, end"); + if (begin === end) + return ""; + var chars = [], + parts = []; + while (begin < end) { + chars.push(this.view[begin++]); + if (chars.length >= 1024) + parts.push(String.fromCharCode.apply(String, chars)), + chars = []; + } + return parts.join('') + String.fromCharCode.apply(String, chars); + }; + + /** + * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromBinary = function(str, littleEndian) { + if (typeof str !== 'string') + throw TypeError("str"); + var i = 0, + k = str.length, + charCode, + bb = new ByteBuffer(k, littleEndian); + while (i 0xff) + throw RangeError("illegal char code: "+charCode); + bb.view[i++] = charCode; + } + bb.limit = k; + return bb; + }; + + // encodings/debug + + /** + * Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are: + * * `<` : offset, + * * `'` : markedOffset, + * * `>` : limit, + * * `|` : offset and limit, + * * `[` : offset and markedOffset, + * * `]` : markedOffset and limit, + * * `!` : offset, markedOffset and limit + * @param {boolean=} columns If `true` returns two columns hex + ascii, defaults to `false` + * @returns {string|!Array.} Debug string or array of lines if `asArray = true` + * @expose + * @example `>00'01 02<03` contains four bytes with `limit=0, markedOffset=1, offset=3` + * @example `00[01 02 03>` contains four bytes with `offset=markedOffset=1, limit=4` + * @example `00|01 02 03` contains four bytes with `offset=limit=1, markedOffset=-1` + * @example `|` contains zero bytes with `offset=limit=0, markedOffset=-1` + */ + ByteBufferPrototype.toDebug = function(columns) { + var i = -1, + k = this.buffer.byteLength, + b, + hex = "", + asc = "", + out = ""; + while (i 32 && b < 127 ? String.fromCharCode(b) : '.'; + } + ++i; + if (columns) { + if (i > 0 && i % 16 === 0 && i !== k) { + while (hex.length < 3*16+3) hex += " "; + out += hex+asc+"\n"; + hex = asc = ""; + } + } + if (i === this.offset && i === this.limit) + hex += i === this.markedOffset ? "!" : "|"; + else if (i === this.offset) + hex += i === this.markedOffset ? "[" : "<"; + else if (i === this.limit) + hex += i === this.markedOffset ? "]" : ">"; + else + hex += i === this.markedOffset ? "'" : (columns || (i !== 0 && i !== k) ? " " : ""); + } + if (columns && hex !== " ") { + while (hex.length < 3*16+3) + hex += " "; + out += hex + asc + "\n"; + } + return columns ? out : hex; + }; + + /** + * Decodes a hex encoded string with marked offsets to a ByteBuffer. + * @param {string} str Debug string to decode (not be generated with `columns = true`) + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + * @see ByteBuffer#toDebug + */ + ByteBuffer.fromDebug = function(str, littleEndian, noAssert) { + var k = str.length, + bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert); + var i = 0, j = 0, ch, b, + rs = false, // Require symbol next + ho = false, hm = false, hl = false, // Already has offset (ho), markedOffset (hm), limit (hl)? + fail = false; + while (i': + if (!noAssert) { + if (hl) { + fail = true; + break; + } + hl = true; + } + bb.limit = j; + rs = false; + break; + case "'": + if (!noAssert) { + if (hm) { + fail = true; + break; + } + hm = true; + } + bb.markedOffset = j; + rs = false; + break; + case ' ': + rs = false; + break; + default: + if (!noAssert) { + if (rs) { + fail = true; + break; + } + } + b = parseInt(ch+str.charAt(i++), 16); + if (!noAssert) { + if (isNaN(b) || b < 0 || b > 255) + throw TypeError("Illegal str: Not a debug encoded string"); + } + bb.view[j++] = b; + rs = true; + } + if (fail) + throw TypeError("Illegal str: Invalid symbol at "+i); + } + if (!noAssert) { + if (!ho || !hl) + throw TypeError("Illegal str: Missing offset or limit"); + if (j>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var out = new Array(end - begin), + b; + while (begin < end) { + b = this.view[begin++]; + if (b < 0x10) + out.push("0", b.toString(16)); + else out.push(b.toString(16)); + } + return out.join(''); + }; + + /** + * Decodes a hex encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromHex = function(str, littleEndian, noAssert) { + if (!noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (str.length % 2 !== 0) + throw TypeError("Illegal str: Length not a multiple of 2"); + } + var k = str.length, + bb = new ByteBuffer((k / 2) | 0, littleEndian), + b; + for (var i=0, j=0; i 255) + throw TypeError("Illegal str: Contains non-hex characters"); + bb.view[j++] = b; + } + bb.limit = j; + return bb; + }; + + // utfx-embeddable + + /** + * utfx-embeddable (c) 2014 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/utfx for details + */ + var utfx = function() { + "use strict"; + + /** + * utfx namespace. + * @inner + * @type {!Object.} + */ + var utfx = {}; + + /** + * Maximum valid code point. + * @type {number} + * @const + */ + utfx.MAX_CODEPOINT = 0x10FFFF; + + /** + * Encodes UTF8 code points to UTF8 bytes. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte + */ + utfx.encodeUTF8 = function(src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, + src = function() { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp < 0x80) + dst(cp&0x7F); + else if (cp < 0x800) + dst(((cp>>6)&0x1F)|0xC0), + dst((cp&0x3F)|0x80); + else if (cp < 0x10000) + dst(((cp>>12)&0x0F)|0xE0), + dst(((cp>>6)&0x3F)|0x80), + dst((cp&0x3F)|0x80); + else + dst(((cp>>18)&0x07)|0xF0), + dst(((cp>>12)&0x3F)|0x80), + dst(((cp>>6)&0x3F)|0x80), + dst((cp&0x3F)|0x80); + cp = null; + } + }; + + /** + * Decodes UTF8 bytes to UTF8 code points. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the + * remaining bytes. + */ + utfx.decodeUTF8 = function(src, dst) { + var a, b, c, d, fail = function(b) { + b = b.slice(0, b.indexOf(null)); + var err = Error(b.toString()); + err.name = "TruncatedError"; + err['bytes'] = b; + throw err; + }; + while ((a = src()) !== null) { + if ((a&0x80) === 0) + dst(a); + else if ((a&0xE0) === 0xC0) + ((b = src()) === null) && fail([a, b]), + dst(((a&0x1F)<<6) | (b&0x3F)); + else if ((a&0xF0) === 0xE0) + ((b=src()) === null || (c=src()) === null) && fail([a, b, c]), + dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F)); + else if ((a&0xF8) === 0xF0) + ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]), + dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F)); + else throw RangeError("Illegal starting byte: "+a); + } + }; + + /** + * Converts UTF16 characters to UTF8 code points. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @param {!function(number)} dst Code points destination as a function successively called with each converted code + * point. + */ + utfx.UTF16toUTF8 = function(src, dst) { + var c1, c2 = null; + while (true) { + if ((c1 = c2 !== null ? c2 : src()) === null) + break; + if (c1 >= 0xD800 && c1 <= 0xDFFF) { + if ((c2 = src()) !== null) { + if (c2 >= 0xDC00 && c2 <= 0xDFFF) { + dst((c1-0xD800)*0x400+c2-0xDC00+0x10000); + c2 = null; continue; + } + } + } + dst(c1); + } + if (c2 !== null) dst(c2); + }; + + /** + * Converts UTF8 code points to UTF16 characters. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a code point is out of range + */ + utfx.UTF8toUTF16 = function(src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, src = function() { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp <= 0xFFFF) + dst(cp); + else + cp -= 0x10000, + dst((cp>>10)+0xD800), + dst((cp%0x400)+0xDC00); + cp = null; + } + }; + + /** + * Converts and encodes UTF16 characters to UTF8 bytes. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null` + * if there are no more characters left. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. + */ + utfx.encodeUTF16toUTF8 = function(src, dst) { + utfx.UTF16toUTF8(src, function(cp) { + utfx.encodeUTF8(cp, dst); + }); + }; + + /** + * Decodes and converts UTF8 bytes to UTF16 characters. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes. + */ + utfx.decodeUTF8toUTF16 = function(src, dst) { + utfx.decodeUTF8(src, function(cp) { + utfx.UTF8toUTF16(cp, dst); + }); + }; + + /** + * Calculates the byte length of an UTF8 code point. + * @param {number} cp UTF8 code point + * @returns {number} Byte length + */ + utfx.calculateCodePoint = function(cp) { + return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + }; + + /** + * Calculates the number of UTF8 bytes required to store UTF8 code points. + * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively + * `null` if there are no more code points left. + * @returns {number} The number of UTF8 bytes required + */ + utfx.calculateUTF8 = function(src) { + var cp, l=0; + while ((cp = src()) !== null) + l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + return l; + }; + + /** + * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes. + * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1. + */ + utfx.calculateUTF16asUTF8 = function(src) { + var n=0, l=0; + utfx.UTF16toUTF8(src, function(cp) { + ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + }); + return [n,l]; + }; + + return utfx; + }(); + + // encodings/utf8 + + /** + * Encodes this ByteBuffer's contents between {@link ByteBuffer#offset} and {@link ByteBuffer#limit} to an UTF8 encoded + * string. + * @returns {string} Hex encoded string + * @throws {RangeError} If `offset > limit` + * @expose + */ + ByteBufferPrototype.toUTF8 = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var sd; try { + utfx.decodeUTF8toUTF16(function() { + return begin < end ? this.view[begin++] : null; + }.bind(this), sd = stringDestination()); + } catch (e) { + if (begin !== end) + throw RangeError("Illegal range: Truncated data, "+begin+" != "+end); + } + return sd(); + }; + + /** + * Decodes an UTF8 encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) { + if (!noAssert) + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert), + i = 0; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + bb.view[i++] = b; + }); + bb.limit = i; + return bb; + }; + + return ByteBuffer; + }); + }); + + var empty$1 = {}; + + + var empty$2 = Object.freeze({ + default: empty$1 + }); + + var require$$2 = ( empty$2 && empty$1 ) || empty$2; + + var protobufLight = createCommonjsModule(function (module) { + /* + Copyright 2013 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license protobuf.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/protobuf.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined(["bytebuffer"], factory); + /* CommonJS */ else if (typeof commonjsRequire === "function" && 'object' === "object" && module && module["exports"]) + module["exports"] = factory(bytebuffer, true); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]); + + })(commonjsGlobal, function(ByteBuffer, isCommonJS) { + "use strict"; + + /** + * The ProtoBuf namespace. + * @exports ProtoBuf + * @namespace + * @expose + */ + var ProtoBuf = {}; + + /** + * @type {!function(new: ByteBuffer, ...[*])} + * @expose + */ + ProtoBuf.ByteBuffer = ByteBuffer; + + /** + * @type {?function(new: Long, ...[*])} + * @expose + */ + ProtoBuf.Long = ByteBuffer.Long || null; + + /** + * ProtoBuf.js version. + * @type {string} + * @const + * @expose + */ + ProtoBuf.VERSION = "5.0.2"; + + /** + * Wire types. + * @type {Object.} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES = {}; + + /** + * Varint wire type. + * @type {number} + * @expose + */ + ProtoBuf.WIRE_TYPES.VARINT = 0; + + /** + * Fixed 64 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS64 = 1; + + /** + * Length delimited wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.LDELIM = 2; + + /** + * Start group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.STARTGROUP = 3; + + /** + * End group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.ENDGROUP = 4; + + /** + * Fixed 32 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS32 = 5; + + /** + * Packable wire types. + * @type {!Array.} + * @const + * @expose + */ + ProtoBuf.PACKABLE_WIRE_TYPES = [ + ProtoBuf.WIRE_TYPES.VARINT, + ProtoBuf.WIRE_TYPES.BITS64, + ProtoBuf.WIRE_TYPES.BITS32 + ]; + + /** + * Types. + * @dict + * @type {!Object.} + * @const + * @expose + */ + ProtoBuf.TYPES = { + // According to the protobuf spec. + "int32": { + name: "int32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "uint32": { + name: "uint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "sint32": { + name: "sint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "int64": { + name: "int64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "uint64": { + name: "uint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sint64": { + name: "sint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "bool": { + name: "bool", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: false + }, + "double": { + name: "double", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: 0 + }, + "string": { + name: "string", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: "" + }, + "bytes": { + name: "bytes", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null // overridden in the code, must be a unique instance + }, + "fixed32": { + name: "fixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "sfixed32": { + name: "sfixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "fixed64": { + name: "fixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sfixed64": { + name: "sfixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "float": { + name: "float", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "enum": { + name: "enum", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "message": { + name: "message", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null + }, + "group": { + name: "group", + wireType: ProtoBuf.WIRE_TYPES.STARTGROUP, + defaultValue: null + } + }; + + /** + * Valid map key types. + * @type {!Array.>} + * @const + * @expose + */ + ProtoBuf.MAP_KEY_TYPES = [ + ProtoBuf.TYPES["int32"], + ProtoBuf.TYPES["sint32"], + ProtoBuf.TYPES["sfixed32"], + ProtoBuf.TYPES["uint32"], + ProtoBuf.TYPES["fixed32"], + ProtoBuf.TYPES["int64"], + ProtoBuf.TYPES["sint64"], + ProtoBuf.TYPES["sfixed64"], + ProtoBuf.TYPES["uint64"], + ProtoBuf.TYPES["fixed64"], + ProtoBuf.TYPES["bool"], + ProtoBuf.TYPES["string"], + ProtoBuf.TYPES["bytes"] + ]; + + /** + * Minimum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MIN = 1; + + /** + * Maximum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MAX = 0x1FFFFFFF; + + /** + * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`. + * Must be set prior to parsing. + * @type {boolean} + * @expose + */ + ProtoBuf.convertFieldsToCamelCase = false; + + /** + * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by + * setting this to `false` prior to building messages. + * @type {boolean} + * @expose + */ + ProtoBuf.populateAccessors = true; + + /** + * By default, messages are populated with default values if a field is not present on the wire. To disable + * this behavior, set this setting to `false`. + * @type {boolean} + * @expose + */ + ProtoBuf.populateDefaults = true; + + /** + * @alias ProtoBuf.Util + * @expose + */ + ProtoBuf.Util = (function() { + "use strict"; + + /** + * ProtoBuf utilities. + * @exports ProtoBuf.Util + * @namespace + */ + var Util = {}; + + /** + * Flag if running in node or not. + * @type {boolean} + * @const + * @expose + */ + Util.IS_NODE = !!( + typeof process === 'object' && process+'' === '[object process]' && !process['browser'] + ); + + /** + * Constructs a XMLHttpRequest object. + * @return {XMLHttpRequest} + * @throws {Error} If XMLHttpRequest is not supported + * @expose + */ + Util.XHR = function() { + // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html + var XMLHttpFactories = [ + function () {return new XMLHttpRequest()}, + function () {return new ActiveXObject("Msxml2.XMLHTTP")}, + function () {return new ActiveXObject("Msxml3.XMLHTTP")}, + function () {return new ActiveXObject("Microsoft.XMLHTTP")} + ]; + /** @type {?XMLHttpRequest} */ + var xhr = null; + for (var i=0;i} + * @expose + */ + ProtoBuf.Lang = { + + // Characters always ending a statement + DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g, + + // Field rules + RULE: /^(?:required|optional|repeated|map)$/, + + // Field types + TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, + + // Names + NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, + + // Type definitions + TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, + + // Type references + TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/, + + // Fully qualified type references + FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/, + + // All numbers + NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/, + + // Decimal numbers + NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, + + // Hexadecimal numbers + NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/, + + // Octal numbers + NUMBER_OCT: /^0[0-7]+$/, + + // Floating point numbers + NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, + + // Booleans + BOOL: /^(?:true|false)$/i, + + // Id numbers + ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Negative id numbers (enum values) + NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Whitespaces + WHITESPACE: /\s/, + + // All strings + STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, + + // Double quoted strings + STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + + // Single quoted strings + STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g + }; + + + /** + * @alias ProtoBuf.Reflect + * @expose + */ + ProtoBuf.Reflect = (function(ProtoBuf) { + "use strict"; + + /** + * Reflection types. + * @exports ProtoBuf.Reflect + * @namespace + */ + var Reflect = {}; + + /** + * Constructs a Reflect base class. + * @exports ProtoBuf.Reflect.T + * @constructor + * @abstract + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.T} parent Parent object + * @param {string} name Object name + */ + var T = function(builder, parent, name) { + + /** + * Builder reference. + * @type {!ProtoBuf.Builder} + * @expose + */ + this.builder = builder; + + /** + * Parent object. + * @type {?ProtoBuf.Reflect.T} + * @expose + */ + this.parent = parent; + + /** + * Object name in namespace. + * @type {string} + * @expose + */ + this.name = name; + + /** + * Fully qualified class name + * @type {string} + * @expose + */ + this.className; + }; + + /** + * @alias ProtoBuf.Reflect.T.prototype + * @inner + */ + var TPrototype = T.prototype; + + /** + * Returns the fully qualified name of this object. + * @returns {string} Fully qualified name as of ".PATH.TO.THIS" + * @expose + */ + TPrototype.fqn = function() { + var name = this.name, + ptr = this; + do { + ptr = ptr.parent; + if (ptr == null) + break; + name = ptr.name+"."+name; + } while (true); + return name; + }; + + /** + * Returns a string representation of this Reflect object (its fully qualified name). + * @param {boolean=} includeClass Set to true to include the class name. Defaults to false. + * @return String representation + * @expose + */ + TPrototype.toString = function(includeClass) { + return (includeClass ? this.className + " " : "") + this.fqn(); + }; + + /** + * Builds this type. + * @throws {Error} If this type cannot be built directly + * @expose + */ + TPrototype.build = function() { + throw Error(this.toString(true)+" cannot be built directly"); + }; + + /** + * @alias ProtoBuf.Reflect.T + * @expose + */ + Reflect.T = T; + + /** + * Constructs a new Namespace. + * @exports ProtoBuf.Reflect.Namespace + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent + * @param {string} name Namespace name + * @param {Object.=} options Namespace options + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Namespace = function(builder, parent, name, options, syntax) { + T.call(this, builder, parent, name); + + /** + * @override + */ + this.className = "Namespace"; + + /** + * Children inside the namespace. + * @type {!Array.} + */ + this.children = []; + + /** + * Options. + * @type {!Object.} + */ + this.options = options || {}; + + /** + * Syntax level (e.g., proto2 or proto3). + * @type {!string} + */ + this.syntax = syntax || "proto2"; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace.prototype + * @inner + */ + var NamespacePrototype = Namespace.prototype = Object.create(T.prototype); + + /** + * Returns an array of the namespace's children. + * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children). + * @return {Array.} + * @expose + */ + NamespacePrototype.getChildren = function(type) { + type = type || null; + if (type == null) + return this.children.slice(); + var children = []; + for (var i=0, k=this.children.length; i} qn Qualified name to resolve + * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false` + * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found + * @expose + */ + NamespacePrototype.resolve = function(qn, excludeNonNamespace) { + var part = typeof qn === 'string' ? qn.split(".") : qn, + ptr = this, + i = 0; + if (part[i] === "") { // Fully qualified name, e.g. ".My.Message' + while (ptr.parent !== null) + ptr = ptr.parent; + i++; + } + var child; + do { + do { + if (!(ptr instanceof Reflect.Namespace)) { + ptr = null; + break; + } + child = ptr.getChild(part[i]); + if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) { + ptr = null; + break; + } + ptr = child; i++; + } while (i < part.length); + if (ptr != null) + break; // Found + // Else search the parent + if (this.parent !== null) + return this.parent.resolve(qn, excludeNonNamespace); + } while (ptr != null); + return ptr; + }; + + /** + * Determines the shortest qualified name of the specified type, if any, relative to this namespace. + * @param {!ProtoBuf.Reflect.T} t Reflection type + * @returns {string} The shortest qualified name or, if there is none, the fqn + * @expose + */ + NamespacePrototype.qn = function(t) { + var part = [], ptr = t; + do { + part.unshift(ptr.name); + ptr = ptr.parent; + } while (ptr !== null); + for (var len=1; len <= part.length; len++) { + var qn = part.slice(part.length-len); + if (t === this.resolve(qn, t instanceof Reflect.Namespace)) + return qn.join("."); + } + return t.fqn(); + }; + + /** + * Builds the namespace and returns the runtime counterpart. + * @return {Object.} Runtime namespace + * @expose + */ + NamespacePrototype.build = function() { + /** @dict */ + var ns = {}; + var children = this.children; + for (var i=0, k=children.length, child; i} + */ + NamespacePrototype.buildOpt = function() { + var opt = {}, + keys = Object.keys(this.options); + for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option + */ + NamespacePrototype.getOption = function(name) { + if (typeof name === 'undefined') + return this.options; + return typeof this.options[name] !== 'undefined' ? this.options[name] : null; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace + * @expose + */ + Reflect.Namespace = Namespace; + + /** + * Constructs a new Element implementation that checks and converts values for a + * particular field type, as appropriate. + * + * An Element represents a single value: either the value of a singular field, + * or a value contained in one entry of a repeated field or map field. This + * class does not implement these higher-level concepts; it only encapsulates + * the low-level typechecking and conversion. + * + * @exports ProtoBuf.Reflect.Element + * @param {{name: string, wireType: number}} type Resolved data type + * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant + * (e.g. submessage field). + * @param {boolean} isMapKey Is this element a Map key? The value will be + * converted to string form if so. + * @param {string} syntax Syntax level of defining message type, e.g., + * proto2 or proto3. + * @param {string} name Name of the field containing this element (for error + * messages) + * @constructor + */ + var Element = function(type, resolvedType, isMapKey, syntax, name) { + + /** + * Element type, as a string (e.g., int32). + * @type {{name: string, wireType: number}} + */ + this.type = type; + + /** + * Element type reference to submessage or enum definition, if needed. + * @type {ProtoBuf.Reflect.T|null} + */ + this.resolvedType = resolvedType; + + /** + * Element is a map key. + * @type {boolean} + */ + this.isMapKey = isMapKey; + + /** + * Syntax level of defining message type, e.g., proto2 or proto3. + * @type {string} + */ + this.syntax = syntax; + + /** + * Name of the field containing this element (for error messages) + * @type {string} + */ + this.name = name; + + if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0) + throw Error("Invalid map key type: " + type.name); + }; + + var ElementPrototype = Element.prototype; + + /** + * Obtains a (new) default value for the specified type. + * @param type {string|{name: string, wireType: number}} Field type + * @returns {*} Default value + * @inner + */ + function mkDefault(type) { + if (typeof type === 'string') + type = ProtoBuf.TYPES[type]; + if (typeof type.defaultValue === 'undefined') + throw Error("default value for type "+type.name+" is not supported"); + if (type == ProtoBuf.TYPES["bytes"]) + return new ByteBuffer(0); + return type.defaultValue; + } + + /** + * Returns the default value for this field in proto3. + * @function + * @param type {string|{name: string, wireType: number}} the field type + * @returns {*} Default value + */ + Element.defaultFieldValue = mkDefault; + + /** + * Makes a Long from a value. + * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for + * strings and numbers + * @returns {!Long} + * @throws {Error} If the value cannot be converted to a Long + * @inner + */ + function mkLong(value, unsigned) { + if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' + && value.low === value.low && value.high === value.high) + return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned); + if (typeof value === 'string') + return ProtoBuf.Long.fromString(value, unsigned || false, 10); + if (typeof value === 'number') + return ProtoBuf.Long.fromNumber(value, unsigned || false); + throw Error("not convertible to Long"); + } + + ElementPrototype.toString = function() { + return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element'; + }; + + /** + * Checks if the given value can be set for an element of this type (singular + * field or one element of a repeated field or map). + * @param {*} value Value to check + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be verified for this element slot + * @expose + */ + ElementPrototype.verifyValue = function(value) { + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + switch (this.type) { + // Signed 32bit + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + // Account for !NaN: value === value + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value > 4294967295 ? value | 0 : value; + + // Unsigned 32bit + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value < 0 ? value >>> 0 : value; + + // Signed 64bit + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, false); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Unsigned 64bit + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, true); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value !== 'boolean') + fail(typeof value, "not a boolean"); + return value; + + // Float + case ProtoBuf.TYPES["float"]: + case ProtoBuf.TYPES["double"]: + if (typeof value !== 'number') + fail(typeof value, "not a number"); + return value; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + if (typeof value !== 'string' && !(value && value instanceof String)) + fail(typeof value, "not a string"); + return ""+value; // Convert String object to string + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (ByteBuffer.isByteBuffer(value)) + return value; + return ByteBuffer.wrap(value, "base64"); + + // Constant enum value + case ProtoBuf.TYPES["enum"]: { + var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value); + for (i=0; i 4294967295 || value < 0) + fail(typeof value, "not in range for uint32"); + return value; + } else { + // proto2 requires enum values to be valid. + fail(value, "not a valid enum value"); + } + } + // Embedded message + case ProtoBuf.TYPES["group"]: + case ProtoBuf.TYPES["message"]: { + if (!value || typeof value !== 'object') + fail(typeof value, "object expected"); + if (value instanceof this.resolvedType.clazz) + return value; + if (value instanceof ProtoBuf.Builder.Message) { + // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180) + var obj = {}; + for (var i in value) + if (value.hasOwnProperty(i)) + obj[i] = value[i]; + value = obj; + } + // Else let's try to construct one from a key-value object + return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons + } + } + + // We should never end here + throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")"); + }; + + /** + * Calculates the byte length of an element on the wire. + * @param {number} id Field number + * @param {*} value Field value + * @returns {number} Byte length + * @throws {Error} If the value cannot be calculated + * @expose + */ + ElementPrototype.calculateLength = function(id, value) { + if (value === null) return 0; // Nothing to encode + // Tag has already been written + var n; + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["uint32"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["sint32"]: + return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value)); + case ProtoBuf.TYPES["fixed32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["float"]: + return 4; + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + return ByteBuffer.calculateVarint64(value); + case ProtoBuf.TYPES["sint64"]: + return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value)); + case ProtoBuf.TYPES["fixed64"]: + case ProtoBuf.TYPES["sfixed64"]: + return 8; + case ProtoBuf.TYPES["bool"]: + return 1; + case ProtoBuf.TYPES["enum"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["double"]: + return 8; + case ProtoBuf.TYPES["string"]: + n = ByteBuffer.calculateUTF8Bytes(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining(); + case ProtoBuf.TYPES["message"]: + n = this.resolvedType.calculate(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["group"]: + n = this.resolvedType.calculate(value); + return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + } + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + }; + + /** + * Encodes a value to the specified buffer. Does not encode the key. + * @param {number} id Field number + * @param {*} value Field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the value cannot be encoded + * @expose + */ + ElementPrototype.encodeValue = function(id, value, buffer) { + if (value === null) return buffer; // Nothing to encode + // Tag has already been written + + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes + // long – it is, effectively, treated like a very large unsigned integer." (see #122) + if (value < 0) + buffer.writeVarint64(value); + else + buffer.writeVarint32(value); + break; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + buffer.writeVarint32(value); + break; + + // 32bit varint zig-zag + case ProtoBuf.TYPES["sint32"]: + buffer.writeVarint32ZigZag(value); + break; + + // Fixed unsigned 32bit + case ProtoBuf.TYPES["fixed32"]: + buffer.writeUint32(value); + break; + + // Fixed signed 32bit + case ProtoBuf.TYPES["sfixed32"]: + buffer.writeInt32(value); + break; + + // 64bit varint as-is + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + buffer.writeVarint64(value); // throws + break; + + // 64bit varint zig-zag + case ProtoBuf.TYPES["sint64"]: + buffer.writeVarint64ZigZag(value); // throws + break; + + // Fixed unsigned 64bit + case ProtoBuf.TYPES["fixed64"]: + buffer.writeUint64(value); // throws + break; + + // Fixed signed 64bit + case ProtoBuf.TYPES["sfixed64"]: + buffer.writeInt64(value); // throws + break; + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value === 'string') + buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value); + else + buffer.writeVarint32(value ? 1 : 0); + break; + + // Constant enum value + case ProtoBuf.TYPES["enum"]: + buffer.writeVarint32(value); + break; + + // 32bit float + case ProtoBuf.TYPES["float"]: + buffer.writeFloat32(value); + break; + + // 64bit float + case ProtoBuf.TYPES["double"]: + buffer.writeFloat64(value); + break; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + buffer.writeVString(value); + break; + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + var prevOffset = value.offset; + buffer.writeVarint32(value.remaining()); + buffer.append(value); + value.offset = prevOffset; + break; + + // Embedded message + case ProtoBuf.TYPES["message"]: + var bb = new ByteBuffer().LE(); + this.resolvedType.encode(value, bb); + buffer.writeVarint32(bb.offset); + buffer.append(bb.flip()); + break; + + // Legacy group + case ProtoBuf.TYPES["group"]: + this.resolvedType.encode(value, buffer); + buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + break; + + default: + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + } + return buffer; + }; + + /** + * Decode one element value from the specified buffer. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number} wireType The field wire type + * @param {number} id The field number + * @return {*} Decoded value + * @throws {Error} If the field cannot be decoded + * @expose + */ + ElementPrototype.decode = function(buffer, wireType, id) { + if (wireType != this.type.wireType) + throw Error("Unexpected wire type for element"); + + var value, nBytes; + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + return buffer.readVarint32() | 0; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + return buffer.readVarint32() >>> 0; + + // 32bit signed varint zig-zag + case ProtoBuf.TYPES["sint32"]: + return buffer.readVarint32ZigZag() | 0; + + // Fixed 32bit unsigned + case ProtoBuf.TYPES["fixed32"]: + return buffer.readUint32() >>> 0; + + case ProtoBuf.TYPES["sfixed32"]: + return buffer.readInt32() | 0; + + // 64bit signed varint + case ProtoBuf.TYPES["int64"]: + return buffer.readVarint64(); + + // 64bit unsigned varint + case ProtoBuf.TYPES["uint64"]: + return buffer.readVarint64().toUnsigned(); + + // 64bit signed varint zig-zag + case ProtoBuf.TYPES["sint64"]: + return buffer.readVarint64ZigZag(); + + // Fixed 64bit unsigned + case ProtoBuf.TYPES["fixed64"]: + return buffer.readUint64(); + + // Fixed 64bit signed + case ProtoBuf.TYPES["sfixed64"]: + return buffer.readInt64(); + + // Bool varint + case ProtoBuf.TYPES["bool"]: + return !!buffer.readVarint32(); + + // Constant enum value (varint) + case ProtoBuf.TYPES["enum"]: + // The following Builder.Message#set will already throw + return buffer.readVarint32(); + + // 32bit float + case ProtoBuf.TYPES["float"]: + return buffer.readFloat(); + + // 64bit float + case ProtoBuf.TYPES["double"]: + return buffer.readDouble(); + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + return buffer.readVString(); + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: { + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + value = buffer.clone(); // Offset already set + value.limit = value.offset+nBytes; + buffer.offset += nBytes; + return value; + } + + // Length-delimited embedded message + case ProtoBuf.TYPES["message"]: { + nBytes = buffer.readVarint32(); + return this.resolvedType.decode(buffer, nBytes); + } + + // Legacy group + case ProtoBuf.TYPES["group"]: + return this.resolvedType.decode(buffer, -1, id); + } + + // We should never end here + throw Error("[INTERNAL] Illegal decode type"); + }; + + /** + * Converts a value from a string to the canonical element type. + * + * Legal only when isMapKey is true. + * + * @param {string} str The string value + * @returns {*} The value + */ + ElementPrototype.valueFromString = function(str) { + if (!this.isMapKey) { + throw Error("valueFromString() called on non-map-key element"); + } + + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + return this.verifyValue(parseInt(str)); + + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: + // Long-based fields support conversions from string already. + return this.verifyValue(str); + + case ProtoBuf.TYPES["bool"]: + return str === "true"; + + case ProtoBuf.TYPES["string"]: + return this.verifyValue(str); + + case ProtoBuf.TYPES["bytes"]: + return ByteBuffer.fromBinary(str); + } + }; + + /** + * Converts a value from the canonical element type to a string. + * + * It should be the case that `valueFromString(valueToString(val))` returns + * a value equivalent to `verifyValue(val)` for every legal value of `val` + * according to this element type. + * + * This may be used when the element must be stored or used as a string, + * e.g., as a map key on an Object. + * + * Legal only when isMapKey is true. + * + * @param {*} val The value + * @returns {string} The string form of the value. + */ + ElementPrototype.valueToString = function(value) { + if (!this.isMapKey) { + throw Error("valueToString() called on non-map-key element"); + } + + if (this.type === ProtoBuf.TYPES["bytes"]) { + return value.toString("binary"); + } else { + return value.toString(); + } + }; + + /** + * @alias ProtoBuf.Reflect.Element + * @expose + */ + Reflect.Element = Element; + + /** + * Constructs a new Message. + * @exports ProtoBuf.Reflect.Message + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace + * @param {string} name Message name + * @param {Object.=} options Message options + * @param {boolean=} isGroup `true` if this is a legacy group + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Message = function(builder, parent, name, options, isGroup, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Message"; + + /** + * Extensions range. + * @type {!Array.|undefined} + * @expose + */ + this.extensions = undefined; + + /** + * Runtime message class. + * @type {?function(new:ProtoBuf.Builder.Message)} + * @expose + */ + this.clazz = null; + + /** + * Whether this is a legacy group or not. + * @type {boolean} + * @expose + */ + this.isGroup = !!isGroup; + + // The following cached collections are used to efficiently iterate over or look up fields when decoding. + + /** + * Cached fields. + * @type {?Array.} + * @private + */ + this._fields = null; + + /** + * Cached fields by id. + * @type {?Object.} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields by name. + * @type {?Object.} + * @private + */ + this._fieldsByName = null; + }; + + /** + * @alias ProtoBuf.Reflect.Message.prototype + * @inner + */ + var MessagePrototype = Message.prototype = Object.create(Namespace.prototype); + + /** + * Builds the message and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Message + * @param {boolean=} rebuild Whether to rebuild or not, defaults to false + * @return {ProtoBuf.Reflect.Message} Message class + * @throws {Error} If the message cannot be built + * @expose + */ + MessagePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Message class in its own scope + var clazz = (function(ProtoBuf, T) { + + var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), + oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf); + + /** + * Constructs a new runtime Message. + * @name ProtoBuf.Builder.Message + * @class Barebone of all runtime messages. + * @param {!Object.|string} values Preset values + * @param {...string} var_args + * @constructor + * @throws {Error} If the message cannot be created + */ + var Message = function(values, var_args) { + ProtoBuf.Builder.Message.call(this); + + // Create virtual oneof properties + for (var i=0, k=oneofs.length; i 0) { + var value; + // Set field values from a values object + if (arguments.length === 1 && values !== null && typeof values === 'object' && + /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) && + /* not a repeated field */ !Array.isArray(values) && + /* not a Map */ !(values instanceof ProtoBuf.Map) && + /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) && + /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) && + /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) { + this.$set(values); + } else // Set field values from arguments, in declaration order + for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false` + * @returns {!ProtoBuf.Builder.Message} this + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.set = function(keyOrObj, value, noAssert) { + if (keyOrObj && typeof keyOrObj === 'object') { + noAssert = value; + for (var ikey in keyOrObj) { + // Check if virtual oneof field - don't set these + if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined) + this.$set(ikey, value, noAssert); + } + return this; + } + var field = T._fieldsByName[keyOrObj]; + if (!noAssert) { + if (!field) + throw Error(this+"#"+keyOrObj+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true)); + this[field.name] = (value = field.verifyValue(value)); // May throw + } else + this[keyOrObj] = value; + if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = this[field.oneof.name]; // Virtual field references currently set field + if (value !== null) { + if (currentField !== null && currentField !== field.name) + this[currentField] = null; // Clear currently set field + this[field.oneof.name] = field.name; // Point virtual field at this field + } else if (/* value === null && */currentField === keyOrObj) + this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared) + } + return this; + }; + + /** + * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}. + * @name ProtoBuf.Builder.Message#$set + * @function + * @param {string|!Object.} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert the value, defaults to `false` + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.$set = MessagePrototype.set; + + /** + * Gets a field's value. + * @name ProtoBuf.Builder.Message#get + * @function + * @param {string} key Key + * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false` + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.get = function(key, noAssert) { + if (noAssert) + return this[key]; + var field = T._fieldsByName[key]; + if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: "+field.toString(true)); + return this[field.name]; + }; + + /** + * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}. + * @name ProtoBuf.Builder.Message#$get + * @function + * @param {string} key Key + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.$get = MessagePrototype.get; + + // Getters and setters + + for (var i=0; i} data Data payload + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @expose + */ + Message.encode = function(data, buffer, noVerify) { + return new Message(data).encode(buffer, noVerify); + }; + + /** + * Calculates the byte length of the message. + * @name ProtoBuf.Builder.Message#calculate + * @function + * @returns {number} Byte length + * @throws {Error} If the message cannot be calculated or if required fields are missing. + * @expose + */ + MessagePrototype.calculate = function() { + return T.calculate(this); + }; + + /** + * Encodes the varint32 length-delimited message. + * @name ProtoBuf.Builder.Message#encodeDelimited + * @function + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ByteBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeDelimited = function(buffer, noVerify) { + var isNew = false; + if (!buffer) + buffer = new ByteBuffer(), + isNew = true; + var enc = new ByteBuffer().LE(); + T.encode(this, enc, noVerify).flip(); + buffer.writeVarint32(enc.remaining()); + buffer.append(enc); + return isNew ? buffer.flip() : buffer; + }; + + /** + * Directly encodes the message to an ArrayBuffer. + * @name ProtoBuf.Builder.Message#encodeAB + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeAB = function() { + try { + return this.encode().toArrayBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer(); + throw(e); + } + }; + + /** + * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}. + * @name ProtoBuf.Builder.Message#toArrayBuffer + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB; + + /** + * Directly encodes the message to a node Buffer. + * @name ProtoBuf.Builder.Message#encodeNB + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are + * missing. The later still returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeNB = function() { + try { + return this.encode().toBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer(); + throw(e); + } + }; + + /** + * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}. + * @name ProtoBuf.Builder.Message#toBuffer + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBuffer = MessagePrototype.encodeNB; + + /** + * Directly encodes the message to a base64 encoded string. + * @name ProtoBuf.Builder.Message#encode64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encode64 = function() { + try { + return this.encode().toBase64(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBase64(); + throw(e); + } + }; + + /** + * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}. + * @name ProtoBuf.Builder.Message#toBase64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBase64 = MessagePrototype.encode64; + + /** + * Directly encodes the message to a hex encoded string. + * @name ProtoBuf.Builder.Message#encodeHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeHex = function() { + try { + return this.encode().toHex(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toHex(); + throw(e); + } + }; + + /** + * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}. + * @name ProtoBuf.Builder.Message#toHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toHex = MessagePrototype.encodeHex; + + /** + * Clones a message object or field value to a raw object. + * @param {*} obj Object to clone + * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field + * @returns {*} Cloned object + * @inner + */ + function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) { + if (obj === null || typeof obj !== 'object') { + // Convert enum values to their respective names + if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) { + var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj); + if (name !== null) + return name; + } + // Pass-through string, number, boolean, null... + return obj; + } + // Convert ByteBuffers to raw buffer or strings + if (ByteBuffer.isByteBuffer(obj)) + return binaryAsBase64 ? obj.toBase64() : obj.toBuffer(); + // Convert Longs to proper objects or strings + if (ProtoBuf.Long.isLong(obj)) + return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj); + var clone; + // Clone arrays + if (Array.isArray(obj)) { + clone = []; + obj.forEach(function(v, k) { + clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType); + }); + return clone; + } + clone = {}; + // Convert maps to objects + if (obj instanceof ProtoBuf.Map) { + var it = obj.entries(); + for (var e = it.next(); !e.done; e = it.next()) + clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType); + return clone; + } + // Everything else is a non-null object + var type = obj.$type, + field = undefined; + for (var i in obj) + if (obj.hasOwnProperty(i)) { + if (type && (field = type.getChild(i))) + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType); + else + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings); + } + return clone; + } + + /** + * Returns the message's raw payload. + * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false` + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @returns {Object.} Raw payload + * @expose + */ + MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) { + return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type); + }; + + /** + * Encodes a message to JSON. + * @returns {string} JSON string + * @expose + */ + MessagePrototype.encodeJSON = function() { + return JSON.stringify( + cloneRaw(this, + /* binary-as-base64 */ true, + /* longs-as-strings */ true, + this.$type + ) + ); + }; + + /** + * Decodes a message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decode + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {(number|string)=} length Message length. Defaults to decode all the remainig data. + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + * @see ProtoBuf.Builder.Message.decode64 + * @see ProtoBuf.Builder.Message.decodeHex + */ + Message.decode = function(buffer, length, enc) { + if (typeof length === 'string') + enc = length, + length = -1; + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + var le = buffer.littleEndian; + try { + var msg = T.decode(buffer.LE(), length); + buffer.LE(le); + return msg; + } catch (e) { + buffer.LE(le); + throw(e); + } + }; + + /** + * Decodes a varint32 length-delimited message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decodeDelimited + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeDelimited = function(buffer, enc) { + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + if (buffer.remaining() < 1) + return null; + var off = buffer.offset, + len = buffer.readVarint32(); + if (buffer.remaining() < len) { + buffer.offset = off; + return null; + } + try { + var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE()); + buffer.offset += len; + return msg; + } catch (err) { + buffer.offset += len; + throw err; + } + }; + + /** + * Decodes the message from the specified base64 encoded string. + * @name ProtoBuf.Builder.Message.decode64 + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decode64 = function(str) { + return Message.decode(str, "base64"); + }; + + /** + * Decodes the message from the specified hex encoded string. + * @name ProtoBuf.Builder.Message.decodeHex + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeHex = function(str) { + return Message.decode(str, "hex"); + }; + + /** + * Decodes the message from a JSON string. + * @name ProtoBuf.Builder.Message.decodeJSON + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are + * missing. + * @expose + */ + Message.decodeJSON = function(str) { + return new Message(JSON.parse(str)); + }; + + // Utility + + /** + * Returns a string representation of this Message. + * @name ProtoBuf.Builder.Message#toString + * @function + * @return {string} String representation as of ".Fully.Qualified.MessageName" + * @expose + */ + MessagePrototype.toString = function() { + return T.toString(); + }; + + // Properties + + /** + * Message options. + * @name ProtoBuf.Builder.Message.$options + * @type {Object.} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Message options. + * @name ProtoBuf.Builder.Message#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message.$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message#$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Message, '$options', { "value": T.buildOpt() }), + Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }), + Object.defineProperty(Message, "$type", { "value": T }), + Object.defineProperty(MessagePrototype, "$type", { "value": T }); + + return Message; + + })(ProtoBuf, this); + + // Static enums and prototyped sub-messages / cached collections + this._fields = []; + this._fieldsById = {}; + this._fieldsByName = {}; + this._oneofsByName = {}; + for (var i=0, k=this.children.length, child; i>> 3; + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + do tag = buf.readUint8(); + while ((tag & 0x80) === 0x80); + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buf.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + tag = buf.readVarint32(); // reads the varint + buf.offset += tag; // skips n bytes + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + skipTillGroupEnd(id, buf); + break; + case ProtoBuf.WIRE_TYPES.ENDGROUP: + if (id === expectedId) + return false; + else + throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)"); + case ProtoBuf.WIRE_TYPES.BITS32: + buf.offset += 4; + break; + default: + throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType); + } + return true; + } + + /** + * Decodes an encoded message and returns the decoded message. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number=} length Message length. Defaults to decode all remaining data. + * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group + * @return {ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded + * @expose + */ + MessagePrototype.decode = function(buffer, length, expectedGroupEndId) { + if (typeof length !== 'number') + length = -1; + var start = buffer.offset, + msg = new (this.clazz)(), + tag, wireType, id, field; + while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) { + tag = buffer.readVarint32(); + wireType = tag & 0x07; + id = tag >>> 3; + if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) { + if (id !== expectedGroupEndId) + throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")"); + break; + } + if (!(field = this._fieldsById[id])) { + // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing." + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + buffer.readVarint32(); + break; + case ProtoBuf.WIRE_TYPES.BITS32: + buffer.offset += 4; + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buffer.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + var len = buffer.readVarint32(); + buffer.offset += len; + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + while (skipTillGroupEnd(id, buffer)) {} + break; + default: + throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType); + } + continue; + } + if (field.repeated && !field.options["packed"]) { + msg[field.name].push(field.decode(wireType, buffer)); + } else if (field.map) { + var keyval = field.decode(wireType, buffer); + msg[field.name].set(keyval[0], keyval[1]); + } else { + msg[field.name] = field.decode(wireType, buffer); + if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = msg[field.oneof.name]; // Virtual field references currently set field + if (currentField !== null && currentField !== field.name) + msg[currentField] = null; // Clear currently set field + msg[field.oneof.name] = field.name; // Point virtual field at this field + } + } + } + + // Check if all required fields are present and set default values for optional fields that are not + for (var i=0, k=this._fields.length; i=} options Options + * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) { + T.call(this, builder, message, name); + + /** + * @override + */ + this.className = "Message.Field"; + + /** + * Message field required flag. + * @type {boolean} + * @expose + */ + this.required = rule === "required"; + + /** + * Message field repeated flag. + * @type {boolean} + * @expose + */ + this.repeated = rule === "repeated"; + + /** + * Message field map flag. + * @type {boolean} + * @expose + */ + this.map = rule === "map"; + + /** + * Message field key type. Type reference string if unresolved, protobuf + * type if resolved. Valid only if this.map === true, null otherwise. + * @type {string|{name: string, wireType: number}|null} + * @expose + */ + this.keyType = keytype || null; + + /** + * Message field type. Type reference string if unresolved, protobuf type if + * resolved. In a map field, this is the value type. + * @type {string|{name: string, wireType: number}} + * @expose + */ + this.type = type; + + /** + * Resolved type reference inside the global namespace. + * @type {ProtoBuf.Reflect.T|null} + * @expose + */ + this.resolvedType = null; + + /** + * Unique message field id. + * @type {number} + * @expose + */ + this.id = id; + + /** + * Message field options. + * @type {!Object.} + * @dict + * @expose + */ + this.options = options || {}; + + /** + * Default value. + * @type {*} + * @expose + */ + this.defaultValue = null; + + /** + * Enclosing OneOf. + * @type {?ProtoBuf.Reflect.Message.OneOf} + * @expose + */ + this.oneof = oneof || null; + + /** + * Syntax level of this definition (e.g., proto3). + * @type {string} + * @expose + */ + this.syntax = syntax || 'proto2'; + + /** + * Original field name. + * @type {string} + * @expose + */ + this.originalName = this.name; // Used to revert camelcase transformation on naming collisions + + /** + * Element implementation. Created in build() after types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.element = null; + + /** + * Key element implementation, for map fields. Created in build() after + * types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.keyElement = null; + + // Convert field names to camel case notation if the override is set + if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField)) + this.name = ProtoBuf.Util.toCamelCase(this.name); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field.prototype + * @inner + */ + var FieldPrototype = Field.prototype = Object.create(T.prototype); + + /** + * Builds the field. + * @override + * @expose + */ + FieldPrototype.build = function() { + this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name); + if (this.map) + this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name); + + // In proto3, fields do not have field presence, and every field is set to + // its type's default value ("", 0, 0.0, or false). + if (this.syntax === 'proto3' && !this.repeated && !this.map) + this.defaultValue = Element.defaultFieldValue(this.type); + + // Otherwise, default values are present when explicitly specified + else if (typeof this.options['default'] !== 'undefined') + this.defaultValue = this.verifyValue(this.options['default']); + }; + + /** + * Checks if the given value can be set for this field. + * @param {*} value Value to check + * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false. + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be set for this field + * @expose + */ + FieldPrototype.verifyValue = function(value, skipRepeated) { + skipRepeated = skipRepeated || false; + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + if (value === null) { // NULL values for optional fields + if (this.required) + fail(typeof value, "required"); + if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"]) + fail(typeof value, "proto3 field without field presence cannot be null"); + return null; + } + var i; + if (this.repeated && !skipRepeated) { // Repeated values as arrays + if (!Array.isArray(value)) + value = [value]; + var res = []; + for (i=0; i 0; + + case ProtoBuf.TYPES["bytes"]: + return value.remaining() > 0; + + case ProtoBuf.TYPES["enum"]: + return value !== 0; + + case ProtoBuf.TYPES["message"]: + return value !== null; + default: + return true; + } + }; + + /** + * Encodes the specified field value to the specified buffer. + * @param {*} value Verified field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @param {!ProtoBuf.Builder.Message} message Runtime message + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the field cannot be encoded + * @expose + */ + FieldPrototype.encode = function(value, buffer, message) { + if (this.type === null || typeof this.type !== 'object') + throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type); + if (value === null || (this.repeated && value.length == 0)) + return buffer; // Optional omitted + try { + if (this.repeated) { + var i; + // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire + // types) can be declared 'packed'." + if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { + // "All of the elements of the field are packed into a single key-value pair with wire type 2 + // (length-delimited). Each element is encoded the same way it would be normally, except without a + // tag preceding it." + buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1 + var start = buffer.offset; // Remember where the contents begin + for (i=0; i 1) { // We need to move the contents + var contents = buffer.slice(start, buffer.offset); + start += varintLen-1; + buffer.offset = start; + buffer.append(contents); + } + buffer.writeVarint32(len, start-varintLen); + } else { + // "If your message definition has repeated elements (without the [packed=true] option), the encoded + // message has zero or more key-value pairs with the same tag number" + for (i=0; i= 0) { + n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + ni = 0; + for (i=0; i= 0) { + if (!skipRepeated) { + nBytes = buffer.readVarint32(); + nBytes = buffer.offset + nBytes; // Limit + var values = []; + while (buffer.offset < nBytes) + values.push(this.decode(this.type.wireType, buffer, true)); + return values; + } + // Read the next value otherwise... + } + + // Handle maps. + if (this.map) { + // Read one (key, value) submessage, and return [key, value] + var key = Element.defaultFieldValue(this.keyType); + value = Element.defaultFieldValue(this.type); + + // Read the length + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + + // Get a sub-buffer of this key/value submessage + var msgbuf = buffer.clone(); + msgbuf.limit = msgbuf.offset + nBytes; + buffer.offset += nBytes; + + while (msgbuf.remaining() > 0) { + var tag = msgbuf.readVarint32(); + wireType = tag & 0x07; + var id = tag >>> 3; + if (id === 1) { + key = this.keyElement.decode(msgbuf, wireType, id); + } else if (id === 2) { + value = this.element.decode(msgbuf, wireType, id); + } else { + throw Error("Unexpected tag in map field key/value submessage"); + } + } + + return [key, value]; + } + + // Handle singular and non-packed repeated field values. + return this.element.decode(buffer, wireType, this.id); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field + * @expose + */ + Reflect.Message.Field = Field; + + /** + * Constructs a new Message ExtensionField. + * @exports ProtoBuf.Reflect.Message.ExtensionField + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} rule Rule, one of requried, optional, repeated + * @param {string} type Data type, e.g. int32 + * @param {string} name Field name + * @param {number} id Unique field id + * @param {!Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Message.Field + */ + var ExtensionField = function(builder, message, rule, type, name, id, options) { + Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options); + + /** + * Extension reference. + * @type {!ProtoBuf.Reflect.Extension} + * @expose + */ + this.extension; + }; + + // Extends Field + ExtensionField.prototype = Object.create(Field.prototype); + + /** + * @alias ProtoBuf.Reflect.Message.ExtensionField + * @expose + */ + Reflect.Message.ExtensionField = ExtensionField; + + /** + * Constructs a new Message OneOf. + * @exports ProtoBuf.Reflect.Message.OneOf + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} name OneOf name + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var OneOf = function(builder, message, name) { + T.call(this, builder, message, name); + + /** + * Enclosed fields. + * @type {!Array.} + * @expose + */ + this.fields = []; + }; + + /** + * @alias ProtoBuf.Reflect.Message.OneOf + * @expose + */ + Reflect.Message.OneOf = OneOf; + + /** + * Constructs a new Enum. + * @exports ProtoBuf.Reflect.Enum + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object + * @param {string} name Enum name + * @param {Object.=} options Enum options + * @param {string?} syntax The syntax level (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Enum = function(builder, parent, name, options, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Enum"; + + /** + * Runtime enum object. + * @type {Object.|null} + * @expose + */ + this.object = null; + }; + + /** + * Gets the string name of an enum value. + * @param {!ProtoBuf.Builder.Enum} enm Runtime enum + * @param {number} value Enum value + * @returns {?string} Name or `null` if not present + * @expose + */ + Enum.getName = function(enm, value) { + var keys = Object.keys(enm); + for (var i=0, key; i} + * @expose + */ + EnumPrototype.build = function(rebuild) { + if (this.object && !rebuild) + return this.object; + var enm = new ProtoBuf.Builder.Enum(), + values = this.getChildren(Enum.Value); + for (var i=0, k=values.length; i=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Service = function(builder, root, name, options) { + Namespace.call(this, builder, root, name, options); + + /** + * @override + */ + this.className = "Service"; + + /** + * Built runtime service class. + * @type {?function(new:ProtoBuf.Builder.Service)} + */ + this.clazz = null; + }; + + /** + * @alias ProtoBuf.Reflect.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(Namespace.prototype); + + /** + * Builds the service and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Service + * @param {boolean=} rebuild Whether to rebuild or not + * @return {Function} Service class + * @throws {Error} If the message cannot be built + * @expose + */ + ServicePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Service class in its own scope + return this.clazz = (function(ProtoBuf, T) { + + /** + * Constructs a new runtime Service. + * @name ProtoBuf.Builder.Service + * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message + * @class Barebone of all runtime services. + * @constructor + * @throws {Error} If the service cannot be created + */ + var Service = function(rpcImpl) { + ProtoBuf.Builder.Service.call(this); + + /** + * Service implementation. + * @name ProtoBuf.Builder.Service#rpcImpl + * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} + * @expose + */ + this.rpcImpl = rpcImpl || function(name, msg, callback) { + // This is what a user has to implement: A function receiving the method name, the actual message to + // send (type checked) and the callback that's either provided with the error as its first + // argument or null and the actual response message. + setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async! + }; + }; + + /** + * @alias ProtoBuf.Builder.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype); + + /** + * Asynchronously performs an RPC call using the given RPC implementation. + * @name ProtoBuf.Builder.Service.[Method] + * @function + * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + /** + * Asynchronously performs an RPC call using the instance's RPC implementation. + * @name ProtoBuf.Builder.Service#[Method] + * @function + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod); + for (var i=0; i} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Service options. + * @name ProtoBuf.Builder.Service#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service.$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service#$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Service, "$options", { "value": T.buildOpt() }), + Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }), + Object.defineProperty(Service, "$type", { "value": T }), + Object.defineProperty(ServicePrototype, "$type", { "value": T }); + + return Service; + + })(ProtoBuf, this); + }; + + /** + * @alias ProtoBuf.Reflect.Service + * @expose + */ + Reflect.Service = Service; + + /** + * Abstract service method. + * @exports ProtoBuf.Reflect.Service.Method + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Method = function(builder, svc, name, options) { + T.call(this, builder, svc, name); + + /** + * @override + */ + this.className = "Service.Method"; + + /** + * Options. + * @type {Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Reflect.Service.Method.prototype + * @inner + */ + var MethodPrototype = Method.prototype = Object.create(T.prototype); + + /** + * Builds the method's '$options' property. + * @name ProtoBuf.Reflect.Service.Method#buildOpt + * @function + * @return {Object.} + */ + MethodPrototype.buildOpt = NamespacePrototype.buildOpt; + + /** + * @alias ProtoBuf.Reflect.Service.Method + * @expose + */ + Reflect.Service.Method = Method; + + /** + * RPC service method. + * @exports ProtoBuf.Reflect.Service.RPCMethod + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {string} request Request message name + * @param {string} response Response message name + * @param {boolean} request_stream Whether requests are streamed + * @param {boolean} response_stream Whether responses are streamed + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Service.Method + */ + var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) { + Method.call(this, builder, svc, name, options); + + /** + * @override + */ + this.className = "Service.RPCMethod"; + + /** + * Request message name. + * @type {string} + * @expose + */ + this.requestName = request; + + /** + * Response message name. + * @type {string} + * @expose + */ + this.responseName = response; + + /** + * Whether requests are streamed + * @type {bool} + * @expose + */ + this.requestStream = request_stream; + + /** + * Whether responses are streamed + * @type {bool} + * @expose + */ + this.responseStream = response_stream; + + /** + * Resolved request message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedRequestType = null; + + /** + * Resolved response message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedResponseType = null; + }; + + // Extends Method + RPCMethod.prototype = Object.create(Method.prototype); + + /** + * @alias ProtoBuf.Reflect.Service.RPCMethod + * @expose + */ + Reflect.Service.RPCMethod = RPCMethod; + + return Reflect; + + })(ProtoBuf); + + /** + * @alias ProtoBuf.Builder + * @expose + */ + ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) { + "use strict"; + + /** + * Constructs a new Builder. + * @exports ProtoBuf.Builder + * @class Provides the functionality to build protocol messages. + * @param {Object.=} options Options + * @constructor + */ + var Builder = function(options) { + + /** + * Namespace. + * @type {ProtoBuf.Reflect.Namespace} + * @expose + */ + this.ns = new Reflect.Namespace(this, null, ""); // Global namespace + + /** + * Namespace pointer. + * @type {ProtoBuf.Reflect.T} + * @expose + */ + this.ptr = this.ns; + + /** + * Resolved flag. + * @type {boolean} + * @expose + */ + this.resolved = false; + + /** + * The current building result. + * @type {Object.|null} + * @expose + */ + this.result = null; + + /** + * Imported files. + * @type {Array.} + * @expose + */ + this.files = {}; + + /** + * Import root override. + * @type {?string} + * @expose + */ + this.importRoot = null; + + /** + * Options. + * @type {!Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Builder.prototype + * @inner + */ + var BuilderPrototype = Builder.prototype; + + // ----- Definition tests ----- + + /** + * Tests if a definition most likely describes a message. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessage = function(def) { + // Messages require a string name + if (typeof def["name"] !== 'string') + return false; + // Messages do not contain values (enum) or rpc methods (service) + if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a message field. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessageField = function(def) { + // Message fields require a string rule, name and type and an id + if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an enum. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isEnum = function(def) { + // Enums require a string name + if (typeof def["name"] !== 'string') + return false; + // Enums require at least one value + if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a service. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isService = function(def) { + // Services require a string name and an rpc object + if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"]) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an extended message + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isExtend = function(def) { + // Extends rquire a string ref + if (typeof def["ref"] !== 'string') + return false; + return true; + }; + + // ----- Building ----- + + /** + * Resets the pointer to the root namespace. + * @returns {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.reset = function() { + this.ptr = this.ns; + return this; + }; + + /** + * Defines a namespace on top of the current pointer position and places the pointer on it. + * @param {string} namespace + * @return {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.define = function(namespace) { + if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace)) + throw Error("illegal namespace: "+namespace); + namespace.split(".").forEach(function(part) { + var ns = this.ptr.getChild(part); + if (ns === null) // Keep existing + this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part)); + this.ptr = ns; + }, this); + return this; + }; + + /** + * Creates the specified definitions at the current pointer position. + * @param {!Array.} defs Messages, enums or services to create + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If a message definition is invalid + * @expose + */ + BuilderPrototype.create = function(defs) { + if (!defs) + return this; // Nothing to create + if (!Array.isArray(defs)) + defs = [defs]; + else { + if (defs.length === 0) + return this; + defs = defs.slice(); + } + + // It's quite hard to keep track of scopes and memory here, so let's do this iteratively. + var stack = [defs]; + while (stack.length > 0) { + defs = stack.pop(); + + if (!Array.isArray(defs)) // Stack always contains entire namespaces + throw Error("not a valid namespace: "+JSON.stringify(defs)); + + while (defs.length > 0) { + var def = defs.shift(); // Namespaces always contain an array of messages, enums and services + + if (Builder.isMessage(def)) { + var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]); + + // Create OneOfs + var oneofs = {}; + if (def["oneofs"]) + Object.keys(def["oneofs"]).forEach(function(name) { + obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name)); + }, this); + + // Create fields + if (def["fields"]) + def["fields"].forEach(function(fld) { + if (obj.getChild(fld["id"]|0) !== null) + throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']); + if (fld["options"] && typeof fld["options"] !== 'object') + throw Error("illegal field options in "+obj.name+"#"+fld["name"]); + var oneof = null; + if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]])) + throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]); + fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]); + if (oneof) + oneof.fields.push(fld); + obj.addChild(fld); + }, this); + + // Push children to stack + var subObj = []; + if (def["enums"]) + def["enums"].forEach(function(enm) { + subObj.push(enm); + }); + if (def["messages"]) + def["messages"].forEach(function(msg) { + subObj.push(msg); + }); + if (def["services"]) + def["services"].forEach(function(svc) { + subObj.push(svc); + }); + + // Set extension ranges + if (def["extensions"]) { + if (typeof def["extensions"][0] === 'number') // pre 5.0.1 + obj.extensions = [ def["extensions"] ]; + else + obj.extensions = def["extensions"]; + } + + // Create on top of current namespace + this.ptr.addChild(obj); + if (subObj.length > 0) { + stack.push(defs); // Push the current level back + defs = subObj; // Continue processing sub level + subObj = null; + this.ptr = obj; // And move the pointer to this namespace + obj = null; + continue; + } + subObj = null; + + } else if (Builder.isEnum(def)) { + + obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]); + def["values"].forEach(function(val) { + obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isService(def)) { + + obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]); + Object.keys(def["rpc"]).forEach(function(name) { + var mtd = def["rpc"][name]; + obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isExtend(def)) { + + obj = this.ptr.resolve(def["ref"], true); + if (obj) { + def["fields"].forEach(function(fld) { + if (obj.getChild(fld['id']|0) !== null) + throw Error("duplicate extended field id in "+obj.name+": "+fld['id']); + // Check if field id is allowed to be extended + if (obj.extensions) { + var valid = false; + obj.extensions.forEach(function(range) { + if (fld["id"] >= range[0] && fld["id"] <= range[1]) + valid = true; + }); + if (!valid) + throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)"); + } + // Convert extension field names to camel case notation if the override is set + var name = fld["name"]; + if (this.options['convertFieldsToCamelCase']) + name = ProtoBuf.Util.toCamelCase(name); + // see #161: Extensions use their fully qualified name as their runtime key and... + var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]); + // ...are added on top of the current namespace as an extension which is used for + // resolving their type later on (the extension always keeps the original name to + // prevent naming collisions) + var ext = new Reflect.Extension(this, this.ptr, fld["name"], field); + field.extension = ext; + this.ptr.addChild(ext); + obj.addChild(field); + }, this); + + } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions + throw Error("extended message "+def["ref"]+" is not defined"); + + } else + throw Error("not a valid definition: "+JSON.stringify(def)); + + def = null; + obj = null; + } + // Break goes here + defs = null; + this.ptr = this.ptr.parent; // Namespace done, continue at parent + } + this.resolved = false; // Require re-resolve + this.result = null; // Require re-build + return this; + }; + + /** + * Propagates syntax to all children. + * @param {!Object} parent + * @inner + */ + function propagateSyntax(parent) { + if (parent['messages']) { + parent['messages'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + propagateSyntax(child); + }); + } + if (parent['enums']) { + parent['enums'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + }); + } + } + + /** + * Imports another definition into this builder. + * @param {Object.} json Parsed import + * @param {(string|{root: string, file: string})=} filename Imported file name + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If the definition or file cannot be imported + * @expose + */ + BuilderPrototype["import"] = function(json, filename) { + var delim = '/'; + + // Make sure to skip duplicate imports + + if (typeof filename === 'string') { + + if (ProtoBuf.Util.IS_NODE) + filename = require$$2['resolve'](filename); + if (this.files[filename] === true) + return this.reset(); + this.files[filename] = true; + + } else if (typeof filename === 'object') { // Object with root, file. + + var root = filename.root; + if (ProtoBuf.Util.IS_NODE) + root = require$$2['resolve'](root); + if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0) + delim = '\\'; + var fname; + if (ProtoBuf.Util.IS_NODE) + fname = require$$2['join'](root, filename.file); + else + fname = root + delim + filename.file; + if (this.files[fname] === true) + return this.reset(); + this.files[fname] = true; + } + + // Import imports + + if (json['imports'] && json['imports'].length > 0) { + var importRoot, + resetRoot = false; + + if (typeof filename === 'object') { // If an import root is specified, override + + this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards + importRoot = this.importRoot; + filename = filename["file"]; + if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) + delim = '\\'; + + } else if (typeof filename === 'string') { + + if (this.importRoot) // If import root is overridden, use it + importRoot = this.importRoot; + else { // Otherwise compute from filename + if (filename.indexOf("/") >= 0) { // Unix + importRoot = filename.replace(/\/[^\/]*$/, ""); + if (/* /file.proto */ importRoot === "") + importRoot = "/"; + } else if (filename.indexOf("\\") >= 0) { // Windows + importRoot = filename.replace(/\\[^\\]*$/, ""); + delim = '\\'; + } else + importRoot = "."; + } + + } else + importRoot = null; + + for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned. + * @returns {!ProtoBuf.Builder.Message|!Object.} + * @throws {Error} If a type could not be resolved + * @expose + */ + BuilderPrototype.build = function(path) { + this.reset(); + if (!this.resolved) + this.resolveAll(), + this.resolved = true, + this.result = null; // Require re-build + if (this.result === null) // (Re-)Build + this.result = this.ns.build(); + if (!path) + return this.result; + var part = typeof path === 'string' ? path.split(".") : path, + ptr = this.result; // Build namespace pointer (no hasChild etc.) + for (var i=0; i=} contents Initial contents + * @constructor + */ + var Map = function(field, contents) { + if (!field.map) + throw Error("field is not a map"); + + /** + * The field corresponding to this map. + * @type {!ProtoBuf.Reflect.Field} + */ + this.field = field; + + /** + * Element instance corresponding to key type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax); + + /** + * Element instance corresponding to value type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax); + + /** + * Internal map: stores mapping of (string form of key) -> (key, value) + * pair. + * + * We provide map semantics for arbitrary key types, but we build on top + * of an Object, which has only string keys. In order to avoid the need + * to convert a string key back to its native type in many situations, + * we store the native key value alongside the value. Thus, we only need + * a one-way mapping from a key type to its string form that guarantees + * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1 + * === K2). + * + * @type {!Object} + */ + this.map = {}; + + /** + * Returns the number of elements in the map. + */ + Object.defineProperty(this, "size", { + get: function() { return Object.keys(this.map).length; } + }); + + // Fill initial contents from a raw object. + if (contents) { + var keys = Object.keys(contents); + for (var i = 0; i < keys.length; i++) { + var key = this.keyElem.valueFromString(keys[i]); + var val = this.valueElem.verifyValue(contents[keys[i]]); + this.map[this.keyElem.valueToString(key)] = + { key: key, value: val }; + } + } + }; + + var MapPrototype = Map.prototype; + + /** + * Helper: return an iterator over an array. + * @param {!Array<*>} arr the array + * @returns {!Object} an iterator + * @inner + */ + function arrayIterator(arr) { + var idx = 0; + return { + next: function() { + if (idx < arr.length) + return { done: false, value: arr[idx++] }; + return { done: true }; + } + } + } + + /** + * Clears the map. + */ + MapPrototype.clear = function() { + this.map = {}; + }; + + /** + * Deletes a particular key from the map. + * @returns {boolean} Whether any entry with this key was deleted. + */ + MapPrototype["delete"] = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + var hadKey = keyValue in this.map; + delete this.map[keyValue]; + return hadKey; + }; + + /** + * Returns an iterator over [key, value] pairs in the map. + * @returns {Object} The iterator + */ + MapPrototype.entries = function() { + var entries = []; + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + entries.push([(entry=this.map[strKeys[i]]).key, entry.value]); + return arrayIterator(entries); + }; + + /** + * Returns an iterator over keys in the map. + * @returns {Object} The iterator + */ + MapPrototype.keys = function() { + var keys = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + keys.push(this.map[strKeys[i]].key); + return arrayIterator(keys); + }; + + /** + * Returns an iterator over values in the map. + * @returns {!Object} The iterator + */ + MapPrototype.values = function() { + var values = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + values.push(this.map[strKeys[i]].value); + return arrayIterator(values); + }; + + /** + * Iterates over entries in the map, calling a function on each. + * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments. + * @param {Object=} thisArg The `this` value for the callback + */ + MapPrototype.forEach = function(cb, thisArg) { + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this); + }; + + /** + * Sets a key in the map to the given value. + * @param {*} key The key + * @param {*} value The value + * @returns {!ProtoBuf.Map} The map instance + */ + MapPrototype.set = function(key, value) { + var keyValue = this.keyElem.verifyValue(key); + var valValue = this.valueElem.verifyValue(value); + this.map[this.keyElem.valueToString(keyValue)] = + { key: keyValue, value: valValue }; + return this; + }; + + /** + * Gets the value corresponding to a key in the map. + * @param {*} key The key + * @returns {*|undefined} The value, or `undefined` if key not present + */ + MapPrototype.get = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + if (!(keyValue in this.map)) + return undefined; + return this.map[keyValue].value; + }; + + /** + * Determines whether the given key is present in the map. + * @param {*} key The key + * @returns {boolean} `true` if the key is present + */ + MapPrototype.has = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + return (keyValue in this.map); + }; + + return Map; + })(ProtoBuf, ProtoBuf.Reflect); + + + /** + * Constructs a new empty Builder. + * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf + * @return {!ProtoBuf.Builder} Builder + * @expose + */ + ProtoBuf.newBuilder = function(options) { + options = options || {}; + if (typeof options['convertFieldsToCamelCase'] === 'undefined') + options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase; + if (typeof options['populateAccessors'] === 'undefined') + options['populateAccessors'] = ProtoBuf.populateAccessors; + return new ProtoBuf.Builder(options); + }; + + /** + * Loads a .json definition and returns the Builder. + * @param {!*|string} json JSON definition + * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted. + * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. + * @return {ProtoBuf.Builder} Builder to create new messages + * @throws {Error} If the definition cannot be parsed or built + * @expose + */ + ProtoBuf.loadJson = function(json, builder, filename) { + if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string')) + filename = builder, + builder = null; + if (!builder || typeof builder !== 'object') + builder = ProtoBuf.newBuilder(); + if (typeof json === 'string') + json = JSON.parse(json); + builder["import"](json, filename); + builder.resolveAll(); + return builder; + }; + + /** + * Loads a .json file and returns the Builder. + * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with + * an overridden 'root' path for all imported files. + * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and + * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the + * file will be read synchronously and this function will return the Builder. + * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. + * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the + * request has failed), else undefined + * @expose + */ + ProtoBuf.loadJsonFile = function(filename, callback, builder) { + if (callback && typeof callback === 'object') + builder = callback, + callback = null; + else if (!callback || typeof callback !== 'function') + callback = null; + if (callback) + return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) { + if (contents === null) { + callback(Error("Failed to fetch file")); + return; + } + try { + callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename)); + } catch (e) { + callback(e); + } + }); + var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename); + return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename); + }; + + return ProtoBuf; + }); + }); + + var messageCompiled = protobufLight.newBuilder({})['import']({ + "package": "push_server.messages2", + "syntax": "proto2", + "options": { + "objc_class_prefix": "AVIM" + }, + "messages": [{ + "name": "JsonObjectMessage", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "data", + "id": 1 + }] + }, { + "name": "UnreadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "required", + "type": "int32", + "name": "unread", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentioned", + "id": 8 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 9 + }] + }, { + "name": "LogItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "from", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "msgId", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "ackAt", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "readAt", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 9 + }, { + "rule": "optional", + "type": "bool", + "name": "bin", + "id": 10 + }] + }, { + "name": "DataCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 1 + }, { + "rule": "repeated", + "type": "JsonObjectMessage", + "name": "msg", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 3 + }] + }, { + "name": "SessionCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int64", + "name": "t", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "ua", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tag", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "deviceId", + "id": 7 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "onlineSessionPeerIds", + "id": 9 + }, { + "rule": "optional", + "type": "string", + "name": "st", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "stTtl", + "id": 11 + }, { + "rule": "optional", + "type": "int32", + "name": "code", + "id": 12 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "deviceToken", + "id": 14 + }, { + "rule": "optional", + "type": "bool", + "name": "sp", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 16 + }, { + "rule": "optional", + "type": "int64", + "name": "lastUnreadNotifTime", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 18 + }, { + "rule": "optional", + "type": "int64", + "name": "configBitmap", + "id": 19 + }] + }, { + "name": "ErrorCommand", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "required", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 4 + }] + }, { + "name": "DirectCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "msg", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "fromPeerId", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 5 + }, { + "rule": "optional", + "type": "bool", + "name": "hasMore", + "id": 6 + }, { + "rule": "repeated", + "type": "string", + "name": "toPeerIds", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 10 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "id", + "id": 12 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "dt", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "pushData", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "will", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 18 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 19 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 20 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 21 + }] + }, { + "name": "AckCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "fromts", + "id": 7 + }, { + "rule": "optional", + "type": "int64", + "name": "tots", + "id": 8 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 11 + }] + }, { + "name": "UnreadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "UnreadTuple", + "name": "convs", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "notifTime", + "id": 2 + }] + }, { + "name": "ConvCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "m", + "id": 1 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "unique", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "cdate", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "initBy", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "sort", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 8 + }, { + "rule": "optional", + "type": "int32", + "name": "skip", + "id": 9 + }, { + "rule": "optional", + "type": "int32", + "name": "flag", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "count", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "udate", + "id": 12 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 15 + }, { + "rule": "optional", + "type": "bool", + "name": "statusSub", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "statusPub", + "id": 17 + }, { + "rule": "optional", + "type": "int32", + "name": "statusTTL", + "id": 18 + }, { + "rule": "optional", + "type": "string", + "name": "uniqueId", + "id": 19 + }, { + "rule": "optional", + "type": "string", + "name": "targetClientId", + "id": 20 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 21 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 22 + }, { + "rule": "optional", + "type": "bool", + "name": "queryAllMembers", + "id": 23 + }, { + "rule": "repeated", + "type": "MaxReadTuple", + "name": "maxReadTuples", + "id": 24 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 25 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "results", + "id": 100 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "where", + "id": 101 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "attr", + "id": 103 + }] + }, { + "name": "RoomCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 5 + }, { + "rule": "repeated", + "type": "string", + "name": "roomPeerIds", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "byPeerId", + "id": 7 + }] + }, { + "name": "LogsCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int32", + "name": "l", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "tt", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tmid", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 7 + }, { + "rule": "optional", + "type": "string", + "name": "checksum", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "stored", + "id": 9 + }, { + "rule": "optional", + "type": "QueryDirection", + "name": "direction", + "id": 10, + "options": { + "default": "OLD" + } + }, { + "rule": "optional", + "type": "bool", + "name": "tIncluded", + "id": 11 + }, { + "rule": "optional", + "type": "bool", + "name": "ttIncluded", + "id": 12 + }, { + "rule": "repeated", + "type": "LogItem", + "name": "logs", + "id": 105 + }], + "enums": [{ + "name": "QueryDirection", + "syntax": "proto2", + "values": [{ + "name": "OLD", + "id": 1 + }, { + "name": "NEW", + "id": 2 + }] + }] + }, { + "name": "RcpCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "id", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "read", + "id": 4 + }] + }, { + "name": "ReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }] + }, { + "name": "MaxReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "pid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 3 + }] + }, { + "name": "ReadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 2 + }, { + "rule": "repeated", + "type": "ReadTuple", + "name": "convs", + "id": 3 + }] + }, { + "name": "PresenceCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "StatusType", + "name": "status", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 3 + }] + }, { + "name": "ReportCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "bool", + "name": "initiative", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 3 + }] + }, { + "name": "PatchItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "recall", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 7 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 10 + }] + }, { + "name": "PatchCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "PatchItem", + "name": "patches", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 2 + }] + }, { + "name": "GenericCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "CommandType", + "name": "cmd", + "id": 1 + }, { + "rule": "optional", + "type": "OpType", + "name": "op", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "appId", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "peerId", + "id": 4 + }, { + "rule": "optional", + "type": "int32", + "name": "i", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "installationId", + "id": 6 + }, { + "rule": "optional", + "type": "int32", + "name": "priority", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "service", + "id": 8 + }, { + "rule": "optional", + "type": "DataCommand", + "name": "dataMessage", + "id": 101 + }, { + "rule": "optional", + "type": "SessionCommand", + "name": "sessionMessage", + "id": 102 + }, { + "rule": "optional", + "type": "ErrorCommand", + "name": "errorMessage", + "id": 103 + }, { + "rule": "optional", + "type": "DirectCommand", + "name": "directMessage", + "id": 104 + }, { + "rule": "optional", + "type": "AckCommand", + "name": "ackMessage", + "id": 105 + }, { + "rule": "optional", + "type": "UnreadCommand", + "name": "unreadMessage", + "id": 106 + }, { + "rule": "optional", + "type": "ReadCommand", + "name": "readMessage", + "id": 107 + }, { + "rule": "optional", + "type": "RcpCommand", + "name": "rcpMessage", + "id": 108 + }, { + "rule": "optional", + "type": "LogsCommand", + "name": "logsMessage", + "id": 109 + }, { + "rule": "optional", + "type": "ConvCommand", + "name": "convMessage", + "id": 110 + }, { + "rule": "optional", + "type": "RoomCommand", + "name": "roomMessage", + "id": 111 + }, { + "rule": "optional", + "type": "PresenceCommand", + "name": "presenceMessage", + "id": 112 + }, { + "rule": "optional", + "type": "ReportCommand", + "name": "reportMessage", + "id": 113 + }, { + "rule": "optional", + "type": "PatchCommand", + "name": "patchMessage", + "id": 114 + }] + }], + "enums": [{ + "name": "CommandType", + "syntax": "proto2", + "values": [{ + "name": "session", + "id": 0 + }, { + "name": "conv", + "id": 1 + }, { + "name": "direct", + "id": 2 + }, { + "name": "ack", + "id": 3 + }, { + "name": "rcp", + "id": 4 + }, { + "name": "unread", + "id": 5 + }, { + "name": "logs", + "id": 6 + }, { + "name": "error", + "id": 7 + }, { + "name": "login", + "id": 8 + }, { + "name": "data", + "id": 9 + }, { + "name": "room", + "id": 10 + }, { + "name": "read", + "id": 11 + }, { + "name": "presence", + "id": 12 + }, { + "name": "report", + "id": 13 + }, { + "name": "echo", + "id": 14 + }, { + "name": "loggedin", + "id": 15 + }, { + "name": "logout", + "id": 16 + }, { + "name": "loggedout", + "id": 17 + }, { + "name": "patch", + "id": 18 + }] + }, { + "name": "OpType", + "syntax": "proto2", + "values": [{ + "name": "open", + "id": 1 + }, { + "name": "add", + "id": 2 + }, { + "name": "remove", + "id": 3 + }, { + "name": "close", + "id": 4 + }, { + "name": "opened", + "id": 5 + }, { + "name": "closed", + "id": 6 + }, { + "name": "query", + "id": 7 + }, { + "name": "query_result", + "id": 8 + }, { + "name": "conflict", + "id": 9 + }, { + "name": "added", + "id": 10 + }, { + "name": "removed", + "id": 11 + }, { + "name": "start", + "id": 30 + }, { + "name": "started", + "id": 31 + }, { + "name": "joined", + "id": 32 + }, { + "name": "members_joined", + "id": 33 + }, { + "name": "left", + "id": 39 + }, { + "name": "members_left", + "id": 40 + }, { + "name": "results", + "id": 42 + }, { + "name": "count", + "id": 43 + }, { + "name": "result", + "id": 44 + }, { + "name": "update", + "id": 45 + }, { + "name": "updated", + "id": 46 + }, { + "name": "mute", + "id": 47 + }, { + "name": "unmute", + "id": 48 + }, { + "name": "status", + "id": 49 + }, { + "name": "members", + "id": 50 + }, { + "name": "max_read", + "id": 51 + }, { + "name": "is_member", + "id": 52 + }, { + "name": "join", + "id": 80 + }, { + "name": "invite", + "id": 81 + }, { + "name": "leave", + "id": 82 + }, { + "name": "kick", + "id": 83 + }, { + "name": "reject", + "id": 84 + }, { + "name": "invited", + "id": 85 + }, { + "name": "kicked", + "id": 86 + }, { + "name": "upload", + "id": 100 + }, { + "name": "uploaded", + "id": 101 + }, { + "name": "modify", + "id": 150 + }, { + "name": "modified", + "id": 151 + }] + }, { + "name": "StatusType", + "syntax": "proto2", + "values": [{ + "name": "on", + "id": 1 + }, { + "name": "off", + "id": 2 + }] + }], + "isNamespace": true + }).build(); + + var _messages$push_server = messageCompiled.push_server.messages2; + var JsonObjectMessage = _messages$push_server.JsonObjectMessage; + var UnreadTuple = _messages$push_server.UnreadTuple; + var LogItem = _messages$push_server.LogItem; + var DataCommand = _messages$push_server.DataCommand; + var SessionCommand = _messages$push_server.SessionCommand; + var ErrorCommand = _messages$push_server.ErrorCommand; + var DirectCommand = _messages$push_server.DirectCommand; + var AckCommand = _messages$push_server.AckCommand; + var UnreadCommand = _messages$push_server.UnreadCommand; + var ConvCommand = _messages$push_server.ConvCommand; + var RoomCommand = _messages$push_server.RoomCommand; + var LogsCommand = _messages$push_server.LogsCommand; + var RcpCommand = _messages$push_server.RcpCommand; + var ReadTuple = _messages$push_server.ReadTuple; + var MaxReadTuple = _messages$push_server.MaxReadTuple; + var ReadCommand = _messages$push_server.ReadCommand; + var PresenceCommand = _messages$push_server.PresenceCommand; + var ReportCommand = _messages$push_server.ReportCommand; + var GenericCommand = _messages$push_server.GenericCommand; + var PatchCommand = _messages$push_server.PatchCommand; + var PatchItem = _messages$push_server.PatchItem; + var CommandType = _messages$push_server.CommandType; + var OpType = _messages$push_server.OpType; + var StatusType = _messages$push_server.StatusType; + + + + + var message = Object.freeze({ + JsonObjectMessage: JsonObjectMessage, + UnreadTuple: UnreadTuple, + LogItem: LogItem, + DataCommand: DataCommand, + SessionCommand: SessionCommand, + ErrorCommand: ErrorCommand, + DirectCommand: DirectCommand, + AckCommand: AckCommand, + UnreadCommand: UnreadCommand, + ConvCommand: ConvCommand, + RoomCommand: RoomCommand, + LogsCommand: LogsCommand, + RcpCommand: RcpCommand, + ReadTuple: ReadTuple, + MaxReadTuple: MaxReadTuple, + ReadCommand: ReadCommand, + PresenceCommand: PresenceCommand, + ReportCommand: ReportCommand, + GenericCommand: GenericCommand, + PatchCommand: PatchCommand, + PatchItem: PatchItem, + CommandType: CommandType, + OpType: OpType, + StatusType: StatusType + }); + + var eventemitter3 = createCommonjsModule(function (module) { + 'use strict'; + + var has = Object.prototype.hasOwnProperty + , prefix = '~'; + + /** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ + function Events() {} + + // + // We try to not inherit from `Object.prototype`. In some engines creating an + // instance in this way is faster than calling `Object.create(null)` directly. + // If `Object.create(null)` is not supported we prefix the event names with a + // character to make sure that the built-in object properties are not + // overridden or used as an attack vector. + // + if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; + } + + /** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ + function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; + } + + /** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ + function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; + } + + /** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ + EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; + }; + + /** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ + EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; + }; + + /** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ + EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; + }; + + /** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; + }; + + /** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; + }; + + // + // Alias methods names because people roll like that. + // + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + + // + // This function doesn't apply anymore. + // + EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; + }; + + // + // Expose the prefix. + // + EventEmitter.prefixed = prefix; + + // + // Allow `EventEmitter` to be imported as module namespace. + // + EventEmitter.EventEmitter = EventEmitter; + + // + // Expose the module. + // + { + module.exports = EventEmitter; + } + }); + + var runtime = createCommonjsModule(function (module) { + /** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + + !(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = 'object' === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + })( + // In sloppy mode, unbound `this` refers to the global object, fallback to + // Function constructor if we're in global strict mode. That is sadly a form + // of indirect eval which violates Content Security Policy. + (function() { return this })() || Function("return this")() + ); + }); + + // This method of obtaining a reference to the global object needs to be + // kept identical to the way it is obtained in runtime.js + var g = (function() { return this })() || Function("return this")(); + + // Use `getOwnPropertyNames` because not all browsers support calling + // `hasOwnProperty` on the global `self` object in a worker. See #183. + var hadRuntime = g.regeneratorRuntime && + Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; + + // Save the old regeneratorRuntime in case it needs to be restored later. + var oldRuntime = hadRuntime && g.regeneratorRuntime; + + // Force reevalutation of runtime.js. + g.regeneratorRuntime = undefined; + + var runtimeModule = runtime; + + if (hadRuntime) { + // Restore the original runtime. + g.regeneratorRuntime = oldRuntime; + } else { + // Remove the global property added by runtime.js. + try { + delete g.regeneratorRuntime; + } catch(e) { + g.regeneratorRuntime = undefined; + } + } + + var regenerator = runtimeModule; + + var f$2 = Object.getOwnPropertySymbols; + + var _objectGops = { + f: f$2 + }; + + var f$3 = {}.propertyIsEnumerable; + + var _objectPie = { + f: f$3 + }; + + // 19.1.2.1 Object.assign(target, source, ...) + + + + + + var $assign = Object.assign; + + // should work with symbols and should have deterministic property order (V8 bug) + var _objectAssign = !$assign || _fails(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; + }) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = _toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = _objectGops.f; + var isEnum = _objectPie.f; + while (aLen > index) { + var S = _iobject(arguments[index++]); + var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; + } : $assign; + + // 19.1.3.1 Object.assign(target, source) + + + _export(_export.S + _export.F, 'Object', { assign: _objectAssign }); + + var assign$1 = _core.Object.assign; + + var assign = createCommonjsModule(function (module) { + module.exports = { "default": assign$1, __esModule: true }; + }); + + var _Object$assign = unwrapExports(assign); + + var _extends = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _assign2 = _interopRequireDefault(assign); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + }); + + var _extends$1 = unwrapExports(_extends); + + var asyncToGenerator = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _promise2 = _interopRequireDefault(promise); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (fn) { + return function () { + var gen = fn.apply(this, arguments); + return new _promise2.default(function (resolve, reject) { + function step(key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + return _promise2.default.resolve(value).then(function (value) { + step("next", value); + }, function (err) { + step("throw", err); + }); + } + } + + return step("next"); + }); + }; + }; + }); + + var _asyncToGenerator = unwrapExports(asyncToGenerator); + + var _createProperty = function (object, index, value) { + if (index in object) _objectDp.f(object, index, _propertyDesc(0, value)); + else object[index] = value; + }; + + _export(_export.S + _export.F * !_iterDetect(function (iter) { Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = _toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iterFn = core_getIteratorMethod(O); + var length, result, step, iterator; + if (mapping) mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + _createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = _toLength(O.length); + for (result = new C(length); length > index; index++) { + _createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } + }); + + var from$1 = _core.Array.from; + + var from = createCommonjsModule(function (module) { + module.exports = { "default": from$1, __esModule: true }; + }); + + var toConsumableArray = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _from2 = _interopRequireDefault(from); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } else { + return (0, _from2.default)(arr); + } + }; + }); + + var _toConsumableArray = unwrapExports(toConsumableArray); + + var _meta = createCommonjsModule(function (module) { + var META = _uid('meta'); + + + var setDesc = _objectDp.f; + var id = 0; + var isExtensible = Object.isExtensible || function () { + return true; + }; + var FREEZE = !_fails(function () { + return isExtensible(Object.preventExtensions({})); + }); + var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); + }; + var fastKey = function (it, create) { + // return primitive with prefix + if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!_has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; + }; + var getWeak = function (it, create) { + if (!_has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; + }; + // add metadata on freeze-family methods calling + var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it); + return it; + }; + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + }; + }); + + var _validateCollection = function (it, TYPE) { + if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; + }; + + var dP$1 = _objectDp.f; + + + + + + + + + + var fastKey = _meta.fastKey; + + var SIZE = _descriptors ? '_s' : 'size'; + + var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } + }; + + var _collectionStrong = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + _anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = _objectCreate(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); + }); + _redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = _validateCollection(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + _validateCollection(this, NAME); + var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(_validateCollection(this, NAME), key); + } + }); + if (_descriptors) dP$1(C.prototype, 'size', { + get: function () { + return _validateCollection(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + _iterDefine(C, NAME, function (iterated, kind) { + this._t = _validateCollection(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return _iterStep(1); + } + // return step by kind + if (kind == 'keys') return _iterStep(0, entry.k); + if (kind == 'values') return _iterStep(0, entry.v); + return _iterStep(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + _setSpecies(NAME); + } + }; + + // 7.2.2 IsArray(argument) + + var _isArray = Array.isArray || function isArray(arg) { + return _cof(arg) == 'Array'; + }; + + var SPECIES$2 = _wks('species'); + + var _arraySpeciesConstructor = function (original) { + var C; + if (_isArray(original)) { + C = original.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined; + if (_isObject(C)) { + C = C[SPECIES$2]; + if (C === null) C = undefined; + } + } return C === undefined ? Array : C; + }; + + // 9.4.2.3 ArraySpeciesCreate(originalArray, length) + + + var _arraySpeciesCreate = function (original, length) { + return new (_arraySpeciesConstructor(original))(length); + }; + + // 0 -> Array#forEach + // 1 -> Array#map + // 2 -> Array#filter + // 3 -> Array#some + // 4 -> Array#every + // 5 -> Array#find + // 6 -> Array#findIndex + + + + + + var _arrayMethods = function (TYPE, $create) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + var create = $create || _arraySpeciesCreate; + return function ($this, callbackfn, that) { + var O = _toObject($this); + var self = _iobject(O); + var f = _ctx(callbackfn, that, 3); + var length = _toLength(self.length); + var index = 0; + var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var val, res; + for (;length > index; index++) if (NO_HOLES || index in self) { + val = self[index]; + res = f(val, index, O); + if (TYPE) { + if (IS_MAP) result[index] = res; // map + else if (res) switch (TYPE) { + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; + }; + + var dP$2 = _objectDp.f; + var each = _arrayMethods(0); + + + var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = _global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + if (!_descriptors || typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + _redefineAll(C.prototype, methods); + _meta.NEED = true; + } else { + C = wrapper(function (target, iterable) { + _anInstance(target, C, NAME, '_c'); + target._c = new Base(); + if (iterable != undefined) _forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if (KEY in proto && !(IS_WEAK && KEY == 'clear')) _hide(C.prototype, KEY, function (a, b) { + _anInstance(this, C, KEY); + if (!IS_ADDER && IS_WEAK && !_isObject(a)) return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + IS_WEAK || dP$2(C.prototype, 'size', { + get: function () { + return this._c.size; + } + }); + } + + _setToStringTag(C, NAME); + + O[NAME] = C; + _export(_export.G + _export.W + _export.F, O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; + }; + + var SET = 'Set'; + + // 23.2 Set Objects + var es6_set = _collection(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return _collectionStrong.def(_validateCollection(this, SET), value = value === 0 ? 0 : value, value); + } + }, _collectionStrong); + + var _arrayFromIterable = function (iter, ITERATOR) { + var result = []; + _forOf(iter, false, result.push, result, ITERATOR); + return result; + }; + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + + + var _collectionToJson = function (NAME) { + return function toJSON() { + if (_classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return _arrayFromIterable(this); + }; + }; + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + + + _export(_export.P + _export.R, 'Set', { toJSON: _collectionToJson('Set') }); + + // https://tc39.github.io/proposal-setmap-offrom/ + + + var _setCollectionOf = function (COLLECTION) { + _export(_export.S, COLLECTION, { of: function of() { + var length = arguments.length; + var A = Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); + } }); + }; + + // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of + _setCollectionOf('Set'); + + // https://tc39.github.io/proposal-setmap-offrom/ + + + + + + var _setCollectionFrom = function (COLLECTION) { + _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + _aFunction(this); + mapping = mapFn !== undefined; + if (mapping) _aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + cb = _ctx(mapFn, arguments[2], 2); + _forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + _forOf(source, false, A.push, A); + } + return new this(A); + } }); + }; + + // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from + _setCollectionFrom('Set'); + + var set$1 = _core.Set; + + var set = createCommonjsModule(function (module) { + module.exports = { "default": set$1, __esModule: true }; + }); + + var _Set = unwrapExports(set); + + var classCallCheck = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + }); + + var _classCallCheck = unwrapExports(classCallCheck); + + var f$4 = _wks; + + var _wksExt = { + f: f$4 + }; + + var iterator$2 = _wksExt.f('iterator'); + + var iterator = createCommonjsModule(function (module) { + module.exports = { "default": iterator$2, __esModule: true }; + }); + + var defineProperty = _objectDp.f; + var _wksDefine = function (name) { + var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) }); + }; + + // all enumerable object keys, includes symbols + + + + var _enumKeys = function (it) { + var result = _objectKeys(it); + var getSymbols = _objectGops.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = _objectPie.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; + }; + + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + + var hiddenKeys = _enumBugKeys.concat('length', 'prototype'); + + var f$6 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return _objectKeysInternal(O, hiddenKeys); + }; + + var _objectGopn = { + f: f$6 + }; + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + + var gOPN$1 = _objectGopn.f; + var toString$1 = {}.toString; + + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function (it) { + try { + return gOPN$1(it); + } catch (e) { + return windowNames.slice(); + } + }; + + var f$5 = function getOwnPropertyNames(it) { + return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN$1(_toIobject(it)); + }; + + var _objectGopnExt = { + f: f$5 + }; + + var gOPD$1 = Object.getOwnPropertyDescriptor; + + var f$7 = _descriptors ? gOPD$1 : function getOwnPropertyDescriptor(O, P) { + O = _toIobject(O); + P = _toPrimitive(P, true); + if (_ie8DomDefine) try { + return gOPD$1(O, P); + } catch (e) { /* empty */ } + if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]); + }; + + var _objectGopd = { + f: f$7 + }; + + // ECMAScript 6 symbols shim + + + + + + var META = _meta.KEY; + + + + + + + + + + + + + + + + + + + var gOPD = _objectGopd.f; + var dP$3 = _objectDp.f; + var gOPN = _objectGopnExt.f; + var $Symbol = _global.Symbol; + var $JSON = _global.JSON; + var _stringify = $JSON && $JSON.stringify; + var PROTOTYPE$2 = 'prototype'; + var HIDDEN = _wks('_hidden'); + var TO_PRIMITIVE = _wks('toPrimitive'); + var isEnum = {}.propertyIsEnumerable; + var SymbolRegistry = _shared('symbol-registry'); + var AllSymbols = _shared('symbols'); + var OPSymbols = _shared('op-symbols'); + var ObjectProto$1 = Object[PROTOTYPE$2]; + var USE_NATIVE$1 = typeof $Symbol == 'function'; + var QObject = _global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = _descriptors && _fails(function () { + return _objectCreate(dP$3({}, 'a', { + get: function () { return dP$3(this, 'a', { value: 7 }).a; } + })).a != 7; + }) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto$1, key); + if (protoDesc) delete ObjectProto$1[key]; + dP$3(it, key, D); + if (protoDesc && it !== ObjectProto$1) dP$3(ObjectProto$1, key, protoDesc); + } : dP$3; + + var wrap = function (tag) { + var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]); + sym._k = tag; + return sym; + }; + + var isSymbol = USE_NATIVE$1 && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; + } : function (it) { + return it instanceof $Symbol; + }; + + var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto$1) $defineProperty(OPSymbols, key, D); + _anObject(it); + key = _toPrimitive(key, true); + _anObject(D); + if (_has(AllSymbols, key)) { + if (!D.enumerable) { + if (!_has(it, HIDDEN)) dP$3(it, HIDDEN, _propertyDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _objectCreate(D, { enumerable: _propertyDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP$3(it, key, D); + }; + var $defineProperties = function defineProperties(it, P) { + _anObject(it); + var keys = _enumKeys(P = _toIobject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P) { + return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = _toPrimitive(key, true)); + if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false; + return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = _toIobject(it); + key = _toPrimitive(key, true); + if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(_toIobject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto$1; + var names = gOPN(IS_OP ? OPSymbols : _toIobject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto$1, key) : true)) result.push(AllSymbols[key]); + } return result; + }; + + // 19.4.1.1 Symbol([description]) + if (!USE_NATIVE$1) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = _uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto$1) $set.call(OPSymbols, value); + if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, _propertyDesc(1, value)); + }; + if (_descriptors && setter) setSymbolDesc(ObjectProto$1, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() { + return this._k; + }); + + _objectGopd.f = $getOwnPropertyDescriptor; + _objectDp.f = $defineProperty; + _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames; + _objectPie.f = $propertyIsEnumerable; + _objectGops.f = $getOwnPropertySymbols; + + if (_descriptors && !_library) { + _redefine(ObjectProto$1, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + _wksExt.f = function (name) { + return wrap(_wks(name)); + }; + } + + _export(_export.G + _export.W + _export.F * !USE_NATIVE$1, { Symbol: $Symbol }); + + for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' + ).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]); + + for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]); + + _export(_export.S + _export.F * !USE_NATIVE$1, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return _has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } + }); + + _export(_export.S + _export.F * !USE_NATIVE$1, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && _export(_export.S + _export.F * (!USE_NATIVE$1 || _fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; + })), 'JSON', { + stringify: function stringify(it) { + if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + replacer = args[1]; + if (typeof replacer == 'function') $replacer = replacer; + if ($replacer || !_isArray(replacer)) replacer = function (key, value) { + if ($replacer) value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } + }); + + // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf); + // 19.4.3.5 Symbol.prototype[@@toStringTag] + _setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + _setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + _setToStringTag(_global.JSON, 'JSON', true); + + _wksDefine('asyncIterator'); + + _wksDefine('observable'); + + var symbol$1 = _core.Symbol; + + var symbol = createCommonjsModule(function (module) { + module.exports = { "default": symbol$1, __esModule: true }; + }); + + var _Symbol = unwrapExports(symbol); + + var _typeof_1 = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _iterator2 = _interopRequireDefault(iterator); + + + + var _symbol2 = _interopRequireDefault(symbol); + + var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); + } : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); + }; + }); + + var _typeof = unwrapExports(_typeof_1); + + var possibleConstructorReturn = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _typeof3 = _interopRequireDefault(_typeof_1); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; + }; + }); + + var _possibleConstructorReturn = unwrapExports(possibleConstructorReturn); + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + + + var check = function (O, proto) { + _anObject(O); + if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); + }; + var _setProto = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + + _export(_export.S, 'Object', { setPrototypeOf: _setProto.set }); + + var setPrototypeOf$2 = _core.Object.setPrototypeOf; + + var setPrototypeOf = createCommonjsModule(function (module) { + module.exports = { "default": setPrototypeOf$2, __esModule: true }; + }); + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + _export(_export.S, 'Object', { create: _objectCreate }); + + var $Object = _core.Object; + var create$2 = function create(P, D) { + return $Object.create(P, D); + }; + + var create = createCommonjsModule(function (module) { + module.exports = { "default": create$2, __esModule: true }; + }); + + var inherits = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _setPrototypeOf2 = _interopRequireDefault(setPrototypeOf); + + + + var _create2 = _interopRequireDefault(create); + + + + var _typeof3 = _interopRequireDefault(_typeof_1); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } + + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; + }; + }); + + var _inherits = unwrapExports(inherits); + + /** + * Helpers. + */ + + var s = 1000; + var m = s * 60; + var h = m * 60; + var d$1 = h * 24; + var y = d$1 * 365.25; + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + var ms = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); + }; + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d$1; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + if (ms >= d$1) { + return Math.round(ms / d$1) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + return plural(ms, d$1, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; + } + + /** + * Pluralization helper. + */ + + function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; + } + + var debug$1 = createCommonjsModule(function (module, exports) { + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; + exports.coerce = coerce; + exports.disable = disable; + exports.enable = enable; + exports.enabled = enabled; + exports.humanize = ms; + + /** + * The currently active debug mode names, and names to skip. + */ + + exports.names = []; + exports.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + + exports.formatters = {}; + + /** + * Previous log timestamp. + */ + + var prevTime; + + /** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + + function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; + } + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms$$1 = curr - (prevTime || curr); + self.diff = ms$$1; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @api public + */ + + function disable() { + exports.enable(''); + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; + } + }); + + var browser$1 = createCommonjsModule(function (module, exports) { + /** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = debug$1; + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + + /** + * Colors. + */ + + exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + } + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } + }; + + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + } + + /** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; + } + + /** + * Enable namespaces listed in `localStorage.debug` initially. + */ + + exports.enable(load()); + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage() { + try { + return window.localStorage; + } catch (e) {} + } + }); + + var bind = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; + }; + + /*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + + // The _isBuffer check is for Safari 5-7 support, because it's missing + // Object.prototype.constructor. Remove this eventually + var isBuffer_1 = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) + }; + + function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) + } + + // For Node v0.10 support. Remove this eventually. + function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) + } + + /*global toString:true*/ + + // utils is a library of generic helper functions non-specific to axios + + var toString$2 = Object.prototype.toString; + + /** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ + function isArray$1(val) { + return toString$2.call(val) === '[object Array]'; + } + + /** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ + function isArrayBuffer(val) { + return toString$2.call(val) === '[object ArrayBuffer]'; + } + + /** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ + function isFormData(val) { + return typeof FormData !== 'undefined' && val instanceof FormData; + } + + /** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ + function isArrayBufferView(val) { + var result; + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && val.buffer instanceof ArrayBuffer; + } + return result; + } + + /** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ + function isString(val) { + return typeof val === 'string'; + } + + /** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ + function isNumber(val) { + return typeof val === 'number'; + } + + /** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ + function isUndefined(val) { + return typeof val === 'undefined'; + } + + /** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ + function isObject$1(val) { + return val !== null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object'; + } + + /** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ + function isDate(val) { + return toString$2.call(val) === '[object Date]'; + } + + /** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ + function isFile(val) { + return toString$2.call(val) === '[object File]'; + } + + /** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ + function isBlob(val) { + return toString$2.call(val) === '[object Blob]'; + } + + /** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ + function isFunction(val) { + return toString$2.call(val) === '[object Function]'; + } + + /** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ + function isStream(val) { + return isObject$1(val) && isFunction(val.pipe); + } + + /** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ + function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; + } + + /** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ + function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); + } + + /** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + */ + function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + return false; + } + return typeof window !== 'undefined' && typeof document !== 'undefined'; + } + + /** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ + function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && !isArray$1(obj)) { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray$1(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } + } + + /** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ + function merge() /* obj1, obj2, obj3, ... */{ + var result = {}; + function assignValue(val, key) { + if (_typeof(result[key]) === 'object' && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; + } + + /** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ + function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; + } + + var utils = { + isArray: isArray$1, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer_1, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject$1, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim + }; + + var $JSON$1 = _core.JSON || (_core.JSON = { stringify: JSON.stringify }); + var stringify$1 = function stringify(it) { // eslint-disable-line no-unused-vars + return $JSON$1.stringify.apply($JSON$1, arguments); + }; + + var stringify = createCommonjsModule(function (module) { + module.exports = { "default": stringify$1, __esModule: true }; + }); + + var _JSON$stringify = unwrapExports(stringify); + + var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); + }; + + /** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ + + var enhanceError = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + error.request = request; + error.response = response; + return error; + }; + + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ + var createError = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); + }; + + /** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ + var settle = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + // Note: status is not exposed by XDomainRequest + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError('Request failed with status code ' + response.status, response.config, null, response.request, response)); + } + }; + + function encode(val) { + return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + } + + /** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ + var buildURL = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } + + if (!utils.isArray(val)) { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = _JSON$stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; + }; + + /** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ + var parseHeaders = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { + return parsed; + } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; + }; + + var isURLSameOrigin = utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() : + + // Non standard browser envs (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + }(); + + // btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js + + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + function E() { + this.message = 'String contains an invalid character'; + } + E.prototype = new Error(); + E.prototype.code = 5; + E.prototype.name = 'InvalidCharacterError'; + + function btoa$1(input) { + var str = String(input); + var output = ''; + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars; + // if the next str index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + str.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { + charCode = str.charCodeAt(idx += 3 / 4); + if (charCode > 0xFF) { + throw new E(); + } + block = block << 8 | charCode; + } + return output; + } + + var btoa_1 = btoa$1; + + var cookies = utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return match ? decodeURIComponent(match[3]) : null; + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + }() : + + // Non standard browser env (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { + return null; + }, + remove: function remove() {} + }; + }(); + + var btoa = typeof window !== 'undefined' && window.btoa && window.btoa.bind(window) || btoa_1; + + var xhr = function xhrAdapter(config) { + return new _Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + var loadEvent = 'onreadystatechange'; + var xDomain = false; + + // For IE 8/9 CORS support + // Only supports POST and GET calls and doesn't returns the response headers. + // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest. + if (process.env.NODE_ENV !== 'test' && typeof window !== 'undefined' && window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) { + request = new window.XDomainRequest(); + loadEvent = 'onload'; + xDomain = true; + request.onprogress = function handleProgress() {}; + request.ontimeout = function handleTimeout() {}; + } + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + // Listen for ready state + request[loadEvent] = function handleLoad() { + if (!request || request.readyState !== 4 && !xDomain) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201) + status: request.status === 1223 ? 204 : request.status, + statusText: request.status === 1223 ? 'No Content' : request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + var cookies$$1 = cookies; + + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? cookies$$1.read(config.xsrfCookieName) : undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (config.withCredentials) { + request.withCredentials = true; + } + + // Add responseType to request if needed + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. + // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. + if (config.responseType !== 'json') { + throw e; + } + } + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (requestData === undefined) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); + }; + + var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } + } + + function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = xhr; + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter + adapter = xhr; + } + return adapter; + } + + var defaults = { + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return _JSON$stringify(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) {/* Ignore */} + } + return data; + }], + + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } + }; + + defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } + }; + + utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); + }); + + var defaults_1 = defaults; + + function InterceptorManager() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + InterceptorManager.prototype.use = function use(fulfilled, rejected) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }); + return this.handlers.length - 1; + }; + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ + InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + }; + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ + InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + }; + + var InterceptorManager_1 = InterceptorManager; + + /** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ + var transformData = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; + }; + + var isCancel = function isCancel(value) { + return !!(value && value.__CANCEL__); + }; + + /** + * Throws a `Cancel` if cancellation has been requested. + */ + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + } + + /** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ + var dispatchRequest = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData(config.data, config.headers, config.transformRequest); + + // Flatten headers + config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers || {}); + + utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { + delete config.headers[method]; + }); + + var adapter = config.adapter || defaults_1.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData(response.data, response.headers, config.transformResponse); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData(reason.response.data, reason.response.headers, config.transformResponse); + } + } + + return _Promise.reject(reason); + }); + }; + + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + + var isAbsoluteURL = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return (/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url) + ); + }; + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ + + var combineURLs = function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; + }; + + /** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ + function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager_1(), + response: new InterceptorManager_1() + }; + } + + /** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ + Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = utils.merge({ + url: arguments[0] + }, arguments[1]); + } + + config = utils.merge(defaults_1, this.defaults, { method: 'get' }, config); + config.method = config.method.toLowerCase(); + + // Support baseURL config + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } + + // Hook up interceptors middleware + var chain = [dispatchRequest, undefined]; + var promise$$1 = _Promise.resolve(config); + + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected); + }); + + while (chain.length) { + promise$$1 = promise$$1.then(chain.shift(), chain.shift()); + } + + return promise$$1; + }; + + // Provide aliases for supported request methods + utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url + })); + }; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; + }); + + var Axios_1 = Axios; + + /** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ + + function Cancel(message) { + this.message = message; + } + + Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); + }; + + Cancel.prototype.__CANCEL__ = true; + + var Cancel_1 = Cancel; + + /** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ + function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new _Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel_1(message); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `Cancel` if cancellation has been requested. + */ + CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } + }; + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; + }; + + var CancelToken_1 = CancelToken; + + /** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ + + var spread = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + }; + + /** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ + function createInstance(defaultConfig) { + var context = new Axios_1(defaultConfig); + var instance = bind(Axios_1.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios_1.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; + } + + // Create the default instance to be exported + var axios$2 = createInstance(defaults_1); + + // Expose Axios class to allow class inheritance + axios$2.Axios = Axios_1; + + // Factory for creating new instances + axios$2.create = function create(instanceConfig) { + return createInstance(utils.merge(defaults_1, instanceConfig)); + }; + + // Expose Cancel & CancelToken + axios$2.Cancel = Cancel_1; + axios$2.CancelToken = CancelToken_1; + axios$2.isCancel = isCancel; + + // Expose all/spread + axios$2.all = function all(promises) { + return _Promise.all(promises); + }; + axios$2.spread = spread; + + var axios_1 = axios$2; + + // Allow use of default import syntax in TypeScript + var default_1 = axios$2; + + axios_1.default = default_1; + + var axios = axios_1; + + // most Object methods by ES6 should accept primitives + + + + var _objectSap = function (KEY, exec) { + var fn = (_core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp); + }; + + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + + var $getOwnPropertyDescriptor$1 = _objectGopd.f; + + _objectSap('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor$1(_toIobject(it), key); + }; + }); + + var $Object$1 = _core.Object; + var getOwnPropertyDescriptor$1 = function getOwnPropertyDescriptor(it, key) { + return $Object$1.getOwnPropertyDescriptor(it, key); + }; + + var getOwnPropertyDescriptor = createCommonjsModule(function (module) { + module.exports = { "default": getOwnPropertyDescriptor$1, __esModule: true }; + }); + + var _Object$getOwnPropertyDescriptor = unwrapExports(getOwnPropertyDescriptor); + + var stateMachine = createCommonjsModule(function (module, exports) { + /* + + Javascript State Machine Library - https://github.com/jakesgordon/javascript-state-machine + + Copyright (c) 2012, 2013, 2014, 2015, Jake Gordon and contributors + Released under the MIT license - https://github.com/jakesgordon/javascript-state-machine/blob/master/LICENSE + + */ + + (function () { + + var StateMachine = { + + //--------------------------------------------------------------------------- + + VERSION: "2.4.0", + + //--------------------------------------------------------------------------- + + Result: { + SUCCEEDED: 1, // the event transitioned successfully from one state to another + NOTRANSITION: 2, // the event was successfull but no state transition was necessary + CANCELLED: 3, // the event was cancelled by the caller in a beforeEvent callback + PENDING: 4 // the event is asynchronous and the caller is in control of when the transition occurs + }, + + Error: { + INVALID_TRANSITION: 100, // caller tried to fire an event that was innapropriate in the current state + PENDING_TRANSITION: 200, // caller tried to fire an event while an async transition was still pending + INVALID_CALLBACK: 300 // caller provided callback function threw an exception + }, + + WILDCARD: '*', + ASYNC: 'async', + + //--------------------------------------------------------------------------- + + create: function(cfg, target) { + + var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial; // allow for a simple string, or an object with { state: 'foo', event: 'setup', defer: true|false } + var terminal = cfg.terminal || cfg['final']; + var fsm = target || cfg.target || {}; + var events = cfg.events || []; + var callbacks = cfg.callbacks || {}; + var map = {}; // track state transitions allowed for an event { event: { from: [ to ] } } + var transitions = {}; // track events allowed from a state { state: [ event ] } + + var add = function(e) { + var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]); // allow 'wildcard' transition if 'from' is not specified + map[e.name] = map[e.name] || {}; + for (var n = 0 ; n < from.length ; n++) { + transitions[from[n]] = transitions[from[n]] || []; + transitions[from[n]].push(e.name); + + map[e.name][from[n]] = e.to || from[n]; // allow no-op transition if 'to' is not specified + } + if (e.to) + transitions[e.to] = transitions[e.to] || []; + }; + + if (initial) { + initial.event = initial.event || 'startup'; + add({ name: initial.event, from: 'none', to: initial.state }); + } + + for(var n = 0 ; n < events.length ; n++) + add(events[n]); + + for(var name in map) { + if (map.hasOwnProperty(name)) + fsm[name] = StateMachine.buildEvent(name, map[name]); + } + + for(var name in callbacks) { + if (callbacks.hasOwnProperty(name)) + fsm[name] = callbacks[name]; + } + + fsm.current = 'none'; + fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); }; + fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }; + fsm.cannot = function(event) { return !this.can(event); }; + fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); }; + fsm.isFinished = function() { return this.is(terminal); }; + fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; }; // default behavior when something unexpected happens is to throw an exception, but caller can override this behavior if desired (see github issue #3 and #17) + fsm.states = function() { return Object.keys(transitions).sort() }; + + if (initial && !initial.defer) + fsm[initial.event](); + + return fsm; + + }, + + //=========================================================================== + + doCallback: function(fsm, func, name, from, to, args) { + if (func) { + try { + return func.apply(fsm, [name, from, to].concat(args)); + } + catch(e) { + return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, "an exception occurred in a caller-provided callback function", e); + } + } + }, + + beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); }, + afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); }, + leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); }, + enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); }, + changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); }, + + beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); }, + afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); }, + leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); }, + enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); }, + + beforeEvent: function(fsm, name, from, to, args) { + if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) || + (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args))) + return false; + }, + + afterEvent: function(fsm, name, from, to, args) { + StateMachine.afterThisEvent(fsm, name, from, to, args); + StateMachine.afterAnyEvent( fsm, name, from, to, args); + }, + + leaveState: function(fsm, name, from, to, args) { + var specific = StateMachine.leaveThisState(fsm, name, from, to, args), + general = StateMachine.leaveAnyState( fsm, name, from, to, args); + if ((false === specific) || (false === general)) + return false; + else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general)) + return StateMachine.ASYNC; + }, + + enterState: function(fsm, name, from, to, args) { + StateMachine.enterThisState(fsm, name, from, to, args); + StateMachine.enterAnyState( fsm, name, from, to, args); + }, + + //=========================================================================== + + buildEvent: function(name, map) { + return function() { + + var from = this.current; + var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from; + var args = Array.prototype.slice.call(arguments); // turn arguments into pure array + + if (this.transition) + return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, "event " + name + " inappropriate because previous transition did not complete"); + + if (this.cannot(name)) + return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, "event " + name + " inappropriate in current state " + this.current); + + if (false === StateMachine.beforeEvent(this, name, from, to, args)) + return StateMachine.Result.CANCELLED; + + if (from === to) { + StateMachine.afterEvent(this, name, from, to, args); + return StateMachine.Result.NOTRANSITION; + } + + // prepare a transition method for use EITHER lower down, or by caller if they want an async transition (indicated by an ASYNC return value from leaveState) + var fsm = this; + this.transition = function() { + fsm.transition = null; // this method should only ever be called once + fsm.current = to; + StateMachine.enterState( fsm, name, from, to, args); + StateMachine.changeState(fsm, name, from, to, args); + StateMachine.afterEvent( fsm, name, from, to, args); + return StateMachine.Result.SUCCEEDED; + }; + this.transition.cancel = function() { // provide a way for caller to cancel async transition if desired (issue #22) + fsm.transition = null; + StateMachine.afterEvent(fsm, name, from, to, args); + }; + + var leave = StateMachine.leaveState(this, name, from, to, args); + if (false === leave) { + this.transition = null; + return StateMachine.Result.CANCELLED; + } + else if (StateMachine.ASYNC === leave) { + return StateMachine.Result.PENDING; + } + else { + if (this.transition) // need to check in case user manually called transition() but forgot to return StateMachine.ASYNC + return this.transition(); + } + + }; + } + + }; // StateMachine + + //=========================================================================== + + //====== + // NODE + //====== + { + if ('object' !== 'undefined' && module.exports) { + exports = module.exports = StateMachine; + } + exports.StateMachine = StateMachine; + } + + }()); + }); + + var getWeak = _meta.getWeak; + + + + + + + + var arrayFind = _arrayMethods(5); + var arrayFindIndex = _arrayMethods(6); + var id$1 = 0; + + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function (that) { + return that._l || (that._l = new UncaughtFrozenStore()); + }; + var UncaughtFrozenStore = function () { + this.a = []; + }; + var findUncaughtFrozen = function (store, key) { + return arrayFind(store.a, function (it) { + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function (key) { + var index = arrayFindIndex(this.a, function (it) { + return it[0] === key; + }); + if (~index) this.a.splice(index, 1); + return !!~index; + } + }; + + var _collectionWeak = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + _anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = id$1++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); + }); + _redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + if (!_isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME))['delete'](key); + return data && _has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + if (!_isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME)).has(key); + return data && _has(data, this._i); + } + }); + return C; + }, + def: function (that, key, value) { + var data = getWeak(_anObject(key), true); + if (data === true) uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore + }; + + var es6_weakMap = createCommonjsModule(function (module) { + 'use strict'; + var each = _arrayMethods(0); + + + + + + + + var WEAK_MAP = 'WeakMap'; + var getWeak = _meta.getWeak; + var isExtensible = Object.isExtensible; + var uncaughtFrozenStore = _collectionWeak.ufstore; + var tmp = {}; + var InternalMap; + + var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; + }; + + var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + if (_isObject(key)) { + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, WEAK_MAP)).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return _collectionWeak.def(_validateCollection(this, WEAK_MAP), key, value); + } + }; + + // 23.3 WeakMap Objects + var $WeakMap = module.exports = _collection(WEAK_MAP, wrapper, methods, _collectionWeak, true, true); + + // IE11 WeakMap frozen keys fix + if (_fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + InternalMap = _collectionWeak.getConstructor(wrapper, WEAK_MAP); + _objectAssign(InternalMap.prototype, methods); + _meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function (key) { + var proto = $WeakMap.prototype; + var method = proto[key]; + _redefine(proto, key, function (a, b) { + // store frozen objects on internal weakmap shim + if (_isObject(a) && !isExtensible(a)) { + if (!this._f) this._f = new InternalMap(); + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); + } + }); + + // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of + _setCollectionOf('WeakMap'); + + // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from + _setCollectionFrom('WeakMap'); + + var weakMap$1 = _core.WeakMap; + + var weakMap = createCommonjsModule(function (module) { + module.exports = { "default": weakMap$1, __esModule: true }; + }); + + var _WeakMap = unwrapExports(weakMap); + + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + _export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f }); + + var $Object$2 = _core.Object; + var defineProperty$4 = function defineProperty(it, key, desc) { + return $Object$2.defineProperty(it, key, desc); + }; + + var defineProperty$2 = createCommonjsModule(function (module) { + module.exports = { "default": defineProperty$4, __esModule: true }; + }); + + var defineProperty$1 = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _defineProperty2 = _interopRequireDefault(defineProperty$2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (obj, key, value) { + if (key in obj) { + (0, _defineProperty2.default)(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + }; + }); + + var _defineProperty = unwrapExports(defineProperty$1); + + // 19.1.2.14 Object.keys(O) + + + + _objectSap('keys', function () { + return function keys(it) { + return _objectKeys(_toObject(it)); + }; + }); + + var keys$1 = _core.Object.keys; + + var keys = createCommonjsModule(function (module) { + module.exports = { "default": keys$1, __esModule: true }; + }); + + var _Object$keys = unwrapExports(keys); + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + + var _freeGlobal = freeGlobal; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = _freeGlobal || freeSelf || Function('return this')(); + + var _root = root; + + /** Built-in value references. */ + var Symbol$1 = _root.Symbol; + + var _Symbol$1 = Symbol$1; + + /** Used for built-in method references. */ + var objectProto$1 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$2 = objectProto$1.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto$1.toString; + + /** Built-in value references. */ + var symToStringTag$1 = _Symbol$1 ? _Symbol$1.toStringTag : undefined; + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty$2.call(value, symToStringTag$1), + tag = value[symToStringTag$1]; + + try { + value[symToStringTag$1] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag$1] = tag; + } else { + delete value[symToStringTag$1]; + } + } + return result; + } + + var _getRawTag = getRawTag; + + /** Used for built-in method references. */ + var objectProto$2 = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString$1 = objectProto$2.toString; + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString$1.call(value); + } + + var _objectToString = objectToString; + + /** `Object#toString` result references. */ + var nullTag = '[object Null]'; + var undefinedTag = '[object Undefined]'; + + /** Built-in value references. */ + var symToStringTag = _Symbol$1 ? _Symbol$1.toStringTag : undefined; + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? _getRawTag(value) + : _objectToString(value); + } + + var _baseGetTag = baseGetTag; + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + var _overArg = overArg; + + /** Built-in value references. */ + var getPrototype = _overArg(Object.getPrototypeOf, Object); + + var _getPrototype = getPrototype; + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + var isObjectLike_1 = isObjectLike; + + /** `Object#toString` result references. */ + var objectTag = '[object Object]'; + + /** Used for built-in method references. */ + var funcProto = Function.prototype; + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty$1 = objectProto.hasOwnProperty; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) { + return false; + } + var proto = _getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty$1.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + var isPlainObject_1 = isPlainObject; + + /* eslint-disable */ + var global$2 = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {}; + + var createClass = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _defineProperty2 = _interopRequireDefault(defineProperty$2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + }); + + var _createClass = unwrapExports(createClass); + + var EXPIRED = _Symbol('expired'); + var debug$5 = browser$1('LC:Expirable'); + + var Expirable = function () { + function Expirable(value, ttl) { + _classCallCheck(this, Expirable); + + this._value = value; + if (typeof ttl === 'number') { + this.expiredAt = Date.now() + ttl; + } + } + + _createClass(Expirable, [{ + key: 'value', + get: function get() { + var expired = this.expiredAt && this.expiredAt < Date.now(); + if (expired) debug$5('expired: ' + this._value); + return expired ? EXPIRED : this._value; + } + }]); + + return Expirable; + }(); + + Expirable.EXPIRED = EXPIRED; + + var debug$6 = browser$1('LC:Cache'); + + var Cache = function () { + function Cache() { + var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'anonymous'; + + _classCallCheck(this, Cache); + + this.name = name; + this._map = {}; + } + + Cache.prototype.get = function get(key) { + var cache = this._map[key]; + if (cache) { + var value = cache.value; + if (value !== Expirable.EXPIRED) { + debug$6('[%s] hit: %s %O', this.name, key, value); + return value; + } + delete this._map[key]; + } + debug$6('[' + this.name + '] missed: ' + key); + return null; + }; + + Cache.prototype.set = function set(key, value, ttl) { + debug$6('[%s] set: %s %O %d', this.name, key, value, ttl); + this._map[key] = new Expirable(value, ttl); + }; + + return Cache; + }(); + + var tryAll = function tryAll(promiseConstructors) { + var promise$$1 = new _Promise(promiseConstructors[0]); + if (promiseConstructors.length === 1) { + return promise$$1; + } + return promise$$1.catch(function () { + return tryAll(promiseConstructors.slice(1)); + }); + }; + + var tap = function tap(interceptor) { + return function (value) { + return interceptor(value), value; + }; + }; + + + + + + var isIE10 = global$2.navigator && global$2.navigator.userAgent && global$2.navigator.userAgent.indexOf('MSIE 10.') !== -1; + + /* eslint-disable no-proto */ + + /* eslint-enable no-proto */ + + + + + var map = new _WeakMap(); + + // protected property helper + var internal = function internal(object) { + if (!map.has(object)) { + map.set(object, {}); + } + return map.get(object); + }; + + // debug utility + var removeNull = function removeNull(obj) { + if (!isPlainObject_1(obj)) return obj; + var object = _Object$assign({}, obj); + // eslint-disable-next-line no-restricted-syntax + for (var prop in object) { + if ({}.hasOwnProperty.call(object, prop)) { + var value = object[prop]; + if (value === null) { + delete object[prop]; + } else { + object[prop] = removeNull(value); + } + } + } + return object; + }; + var trim$1 = function trim(message) { + return removeNull(JSON.parse(_JSON$stringify(message))); + }; + + var ensureArray = function ensureArray(target) { + if (Array.isArray(target)) { + return target; + } + if (target === undefined || target === null) { + return []; + } + return [target]; + }; + + + + // eslint-disable-next-line no-undef + var isWeapp = (typeof wx === 'undefined' ? 'undefined' : _typeof(wx)) === 'object' && typeof wx.connectSocket === 'function'; + + // throttle decorator + + var WebSocket = global$2.WebSocket || global$2.MozWebSocket; + + var _class; + + function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; + } + + // WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface. + + var debug$4 = browser$1('LC:WebSocketPlus'); + + var HEARTBEAT_TIME = 180000; + var TIMEOUT_TIME = 380000; + + var DEFAULT_RETRY_STRATEGY = function DEFAULT_RETRY_STRATEGY(attempt) { + return Math.min(1000 * Math.pow(2, attempt), 300000); + }; + + var requireConnected = function requireConnected(target, name, descriptor) { + return _Object$assign({}, descriptor, { + value: function requireConnectedWrapper() { + var _descriptor$value; + + if (!this.is('connected')) { + var currentState = this.current; + console.warn(name + ' should not be called when the connection is ' + currentState); + if (this.is('disconnected') || this.is('reconnecting')) { + console.warn('disconnect and reconnect event should be handled to avoid such calls.'); + } + throw new Error('Connection unavailable'); + } + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return (_descriptor$value = descriptor.value).call.apply(_descriptor$value, [this].concat(args)); + } + }); + }; + + var WebSocketPlus = (_class = function (_EventEmitter) { + _inherits(WebSocketPlus, _EventEmitter); + + function WebSocketPlus(getUrls, protocol) { + _classCallCheck(this, WebSocketPlus); + + if (typeof WebSocket === 'undefined') { + throw new Error('WebSocket is undefined. Polyfill is required in this runtime.'); + } + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof getUrls !== 'function') { + _this._getUrls = function () { + return _Promise.resolve(getUrls); + }; + } else { + _this._getUrls = getUrls; + } + _this._protocol = protocol; + _this.init(); + _this._createWs(_this._getUrls, _this._protocol).then(function () { + _this.__postponeTimeoutTimer = _this._postponeTimeoutTimer.bind(_this); + if (global$2.addEventListener) { + _this.__pause = function () { + return _this.pause(); + }; + _this.__resume = function () { + return _this.resume(); + }; + global$2.addEventListener('offline', _this.__pause); + global$2.addEventListener('online', _this.__resume); + } + _this.open(); + }).catch(_this.throw.bind(_this)); + return _this; + } + + WebSocketPlus.prototype._createWs = function _createWs(getUrls, protocol) { + var _this2 = this; + + return getUrls().then(function (wsUrls) { + var urls = wsUrls; + if (!(urls instanceof Array)) { + urls = [urls]; + } + return tryAll(urls.map(function (url) { + return function (resolve, reject) { + debug$4('connect [' + url + '] ' + protocol); + var ws = protocol ? new WebSocket(url, protocol) : new WebSocket(url); + ws.binaryType = _this2.binaryType || 'arraybuffer'; + ws.onopen = function () { + return resolve(ws); + }; + ws.onclose = function (error) { + if (error instanceof Error) { + return reject(error); + } + // in browser, error event is useless + return reject(new Error('Failed to connect [' + url + ']')); + }; + ws.onerror = ws.onclose; + }; + })).then(function (ws) { + _this2._ws = ws; + _this2._ws.onclose = _this2._handleClose.bind(_this2); + _this2._ws.onmessage = _this2._handleMessage.bind(_this2); + return ws; + }); + }); + }; + + WebSocketPlus.prototype._destroyWs = function _destroyWs() { + var ws = this._ws; + if (!ws) return; + ws.onopen = null; + ws.onclose = null; + ws.onerror = null; + ws.onmessage = null; + this._ws = null; + ws.close(); + }; + + // eslint-disable-next-line class-methods-use-this + + + WebSocketPlus.prototype.onbeforeevent = function onbeforeevent(event, from, to) { + for (var _len2 = arguments.length, payload = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) { + payload[_key2 - 3] = arguments[_key2]; + } + + debug$4.apply(undefined, [event + ': ' + from + ' -> ' + to].concat(payload)); + }; + + WebSocketPlus.prototype.onopen = function onopen() { + this.emit('open'); + }; + + WebSocketPlus.prototype.onconnected = function onconnected() { + this._startConnectionKeeper(); + }; + + WebSocketPlus.prototype.onleaveconnected = function onleaveconnected(event, from, to) { + this._stopConnectionKeeper(); + this._destroyWs(); + if (to === 'offline' || to === 'disconnected') { + this.emit('disconnect'); + } + }; + + WebSocketPlus.prototype.onpause = function onpause() { + this.emit('offline'); + }; + + WebSocketPlus.prototype.onbeforeresume = function onbeforeresume() { + this.emit('online'); + }; + + WebSocketPlus.prototype.onreconnect = function onreconnect() { + this.emit('reconnect'); + }; + + WebSocketPlus.prototype.ondisconnected = function ondisconnected(event, from, to) { + var _this3 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + var delay = DEFAULT_RETRY_STRATEGY.call(null, attempt); + debug$4('schedule attempt=' + attempt + ' delay=' + delay); + this.emit('schedule', attempt, delay); + if (this.__scheduledRetry) { + clearTimeout(this.__scheduledRetry); + } + this.__scheduledRetry = setTimeout(function () { + if (_this3.is('disconnected')) { + _this3.retry(attempt); + } + }, delay); + }; + + WebSocketPlus.prototype.onretry = function onretry(event, from, to) { + var _this4 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + this.emit('retry', attempt); + this._createWs(this._getUrls, this._protocol).then(function () { + return _this4.can('reconnect') ? _this4.reconnect() : _this4._destroyWs(); + }, function () { + return _this4.can('fail') && _this4.fail(attempt + 1); + }); + }; + + WebSocketPlus.prototype.onerror = function onerror(event, from, to, error) { + this.emit('error', error); + }; + + WebSocketPlus.prototype.onclose = function onclose() { + if (global$2.removeEventListener) { + if (this.__pause) global$2.removeEventListener('offline', this.__pause); + if (this.__resume) global$2.removeEventListener('online', this.__resume); + } + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype._ping = function _ping() { + debug$4('ping'); + try { + this.ping(); + } catch (error) { + console.warn('websocket ping error: ' + error.message); + } + }; + + WebSocketPlus.prototype.ping = function ping() { + if (this._ws.ping) { + this._ws.ping(); + } else { + console.warn('The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.'); + } + }; + + WebSocketPlus.prototype._postponeTimeoutTimer = function _postponeTimeoutTimer() { + var _this5 = this; + + debug$4('_postponeTimeoutTimer'); + this._clearTimeoutTimers(); + this._timeoutTimer = setTimeout(function () { + debug$4('timeout'); + _this5.disconnect(); + }, TIMEOUT_TIME); + }; + + WebSocketPlus.prototype._clearTimeoutTimers = function _clearTimeoutTimers() { + if (this._timeoutTimer) { + clearTimeout(this._timeoutTimer); + } + }; + + WebSocketPlus.prototype._startConnectionKeeper = function _startConnectionKeeper() { + debug$4('start connection keeper'); + this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME); + var addListener = this._ws.addListener || this._ws.addEventListener; + addListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._postponeTimeoutTimer(); + }; + + WebSocketPlus.prototype._stopConnectionKeeper = function _stopConnectionKeeper() { + debug$4('stop connection keeper'); + // websockets/ws#489 + var removeListener = this._ws.removeListener || this._ws.removeEventListener; + removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._clearTimeoutTimers(); + if (this._heartbeatTimer) { + clearInterval(this._heartbeatTimer); + } + }; + + WebSocketPlus.prototype._handleClose = function _handleClose(event) { + debug$4('ws closed [' + event.code + '] ' + event.reason); + // socket closed manually, ignore close event. + if (this.isFinished()) return; + this.handleClose(event); + }; + + WebSocketPlus.prototype.handleClose = function handleClose() { + // reconnect + this.disconnect(); + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype.send = function send(data) { + debug$4('send', data); + this._ws.send(data); + }; + + WebSocketPlus.prototype._handleMessage = function _handleMessage(event) { + debug$4('message', event.data); + this.handleMessage(event.data); + }; + + WebSocketPlus.prototype.handleMessage = function handleMessage(message) { + this.emit('message', message); + }; + + return WebSocketPlus; + }(eventemitter3), (_applyDecoratedDescriptor(_class.prototype, '_ping', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, '_ping'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'send', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, 'send'), _class.prototype)), _class); + + + stateMachine.create({ + target: WebSocketPlus.prototype, + initial: { + state: 'initialized', + event: 'init', + defer: true + }, + terminal: 'closed', + events: [{ + name: 'open', + from: 'initialized', + to: 'connected' + }, { + name: 'disconnect', + from: 'connected', + to: 'disconnected' + }, { + name: 'retry', + from: 'disconnected', + to: 'reconnecting' + }, { + name: 'fail', + from: 'reconnecting', + to: 'disconnected' + }, { + name: 'reconnect', + from: 'reconnecting', + to: 'connected' + }, { + name: 'pause', + from: ['connected', 'disconnected', 'reconnecting'], + to: 'offline' + }, {}, { + name: 'resume', + from: 'offline', + to: 'disconnected' + }, { + name: 'close', + from: ['connected', 'disconnected', 'reconnecting', 'offline'], + to: 'closed' + }, { + name: 'throw', + from: '*', + to: 'error' + }] + }); + + // 19.1.2.5 Object.freeze(O) + + var meta = _meta.onFreeze; + + _objectSap('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && _isObject(it) ? $freeze(meta(it)) : it; + }; + }); + + var freeze$1 = _core.Object.freeze; + + var freeze = createCommonjsModule(function (module) { + module.exports = { "default": freeze$1, __esModule: true }; + }); + + var _Object$freeze = unwrapExports(freeze); + + var error = _Object$freeze({ + 1000: { + name: 'CLOSE_NORMAL' + }, + 1006: { + name: 'CLOSE_ABNORMAL' + }, + 4100: { + name: 'APP_NOT_AVAILABLE', + message: 'App not exists or realtime message service is disabled.' + }, + 4103: { + name: 'INVALID_LOGIN', + message: 'Malformed clientId.' + }, + 4105: { + name: 'SESSION_REQUIRED', + message: 'Message sent before session opened. ' + }, + 4107: { + name: 'READ_TIMEOUT' + }, + 4108: { + name: 'LOGIN_TIMEOUT' + }, + 4109: { + name: 'FRAME_TOO_LONG' + }, + 4110: { + name: 'INVALID_ORIGIN', + message: 'Access denied by domain whitelist.' + }, + 4111: { + name: 'SESSION_CONFLICT' + }, + 4112: { + name: 'SESSION_TOKEN_EXPIRED' + }, + 4200: { + name: 'INTERNAL_ERROR', + message: 'Internal error, please contact LeanCloud for support.' + }, + 4201: { + name: 'SEND_MESSAGE_TIMEOUT' + }, + 4302: { + name: 'CONVERSATION_SIGNATURE_FAILED' + }, + 4303: { + name: 'CONVERSATION_NOT_FOUND' + }, + 4304: { + name: 'CONVERSATION_FULL' + }, + 4305: { + name: 'CONVERSATION_REJECTED_BY_APP' + }, + 4306: { + name: 'CONVERSATION_UPDATE_FAILED' + }, + 4307: { + name: 'CONVERSATION_READ_ONLY' + }, + 4308: { + name: 'CONVERSATION_NOT_ALLOWED' + }, + 4401: { + name: 'INVALID_MESSAGING_TARGET' + }, + 4402: { + name: 'MESSAGE_REJECTED_BY_APP' + } + }); + + var ErrorCode = _Object$freeze(_Object$keys(error).reduce(function (result, code) { + return _Object$assign(result, _defineProperty({}, error[code].name, Number(code))); + }, {})); + + var createError$3 = function createError(errorMessage) { + var code = errorMessage.code, + reason = errorMessage.reason, + appCode = errorMessage.appCode, + detail = errorMessage.detail; + + var message = reason || detail; + if (!message && error[code]) { + message = error[code].message || error[code].name; + } + if (!message) { + message = 'Unknow Error: ' + code; + } + var err = new Error(message); + return _Object$assign(err, { + code: code, appCode: appCode, detail: detail + }); + }; + + var debug$3 = browser$1('LC:Connection'); + + var COMMAND_TIMEOUT = 20000; + + var Connection = function (_WebSocketPlus) { + _inherits(Connection, _WebSocketPlus); + + function Connection(getUrl, _ref) { + var format = _ref.format, + version = _ref.version; + + _classCallCheck(this, Connection); + + debug$3('initializing Connection'); + var protocolString = 'lc.' + format + '.' + version; + if (!isWeapp) { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl, protocolString)); + } else { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl().then(function (urls) { + return urls.map(function (url) { + return '' + url + (url.indexOf('?') === -1 ? '?' : '&') + 'subprotocol=' + encodeURIComponent(protocolString); + }); + }))); + } + _this._protocalFormat = format; + _this._commands = {}; + _this._serialId = 0; + return _possibleConstructorReturn(_this); + } + + Connection.prototype.send = function send(command) { + var _this2 = this; + + var waitingForRespond = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + var serialId = void 0; + if (waitingForRespond) { + this._serialId += 1; + serialId = this._serialId; + command.i = serialId; // eslint-disable-line no-param-reassign + } + debug$3('↑ %O sent', trim$1(command)); + + var message = void 0; + if (this._protocalFormat === 'proto2base64') { + message = command.toBase64(); + } else if (command.toArrayBuffer) { + message = command.toArrayBuffer(); + } + if (!message) { + throw new TypeError(command + ' is not a GenericCommand'); + } + + _WebSocketPlus.prototype.send.call(this, message); + + if (!waitingForRespond) { + return _Promise.resolve(); + } + return new _Promise(function (resolve, reject) { + _this2._commands[serialId] = { + resolve: resolve, + reject: reject, + timeout: setTimeout(function () { + if (_this2._commands[serialId]) { + debug$3('✗ %O timeout', trim$1(command)); + reject(new Error('Command Timeout.')); + delete _this2._commands[serialId]; + } + }, COMMAND_TIMEOUT) + }; + }); + }; + + Connection.prototype.handleMessage = function handleMessage(msg) { + var message = void 0; + try { + message = GenericCommand.decode(msg); + debug$3('↓ %O received', trim$1(message)); + } catch (e) { + console.warn('Decode message failed', msg); + } + this.emit('allmessage', message); + var serialId = message.i; + if (serialId) { + if (this._commands[serialId]) { + clearTimeout(this._commands[serialId].timeout); + if (message.cmd === CommandType.error) { + this._commands[serialId].reject(createError$3(message.errorMessage)); + } else { + this._commands[serialId].resolve(message); + } + delete this._commands[serialId]; + } else { + console.warn('Unexpected command received with serialId [' + serialId + '],\n which have timed out or never been requested.'); + } + } else if (message.cmd === CommandType.error) { + this.emit('error', createError$3(message.errorMessage)); + } else { + this.emit('message', message); + } + }; + + Connection.prototype.ping = function ping() { + return this.send(new GenericCommand({ + cmd: CommandType.echo + })).catch(function (error$$1) { + return debug$3('ping failed:', error$$1); + }); + }; + + return Connection; + }(WebSocketPlus); + + /* eslint-disable max-len */ + + /** + * 插件接口 + * + *

+ * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类: + *

+ * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。 + * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。 + *

+ * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。 + * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。 + * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。 + *

+ * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。 + * + * @interface Plugin + * @since 3.1.0 + */ + + /* eslint-enable max-len */ + + /** + * 插件名称,用于在日志中显示异常的插件 + * + * @name Plugin.name + * @type string + */ + + /** + * 插件注册的消息类型 + * + * @name Plugin.messageClasses + * @type AVMessage[] + */ + + /** + * 在 Realtime 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Realtime 实例。 + * + * @name Plugin.onRealtimeCreate + * @type Function + */ + + /** + * 在 IMClient 实例化后对其进行修饰。 + *

+ * 接受一个参数为 IMClient 实例。 + * + * @name Plugin.onIMClientCreate + * @type Function + */ + + /** + * 在 Conversation 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Conversation 实例。 + * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook, + * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。 + * + * @name Plugin.onConversationCreate + * @type Function + */ + + /** + * 在对消息进行 parse 之前,对原始消息进行修改。 + *

+ * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。 + * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。 + * + * @name Plugin.beforeMessageParse + * @type Function + */ + + /** + * 在对消息进行 parse 之后,对消息实例进行修改。 + *

+ * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。 + * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.afterMessageParse + * @type Function + */ + + /** + * 在收到消息之后,派发消息之前,控制是否派发这条消息。 + *

+ * 接受参数为 message 与 conversation。 + * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。 + * 如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.beforeMessageDispatch + * @type Function + * @since 3.4.0 + */ + + var applyDecorators = function applyDecorators(decorators, target) { + if (decorators) { + decorators.forEach(function (decorator) { + try { + decorator(target); + } catch (error) { + if (decorator._pluginName) { + error.message += '[' + decorator._pluginName + ']'; + } + throw error; + } + }); + } + }; + + + + var applyDispatcher = function applyDispatcher(dispatchers, payload) { + return ensureArray(dispatchers).reduce(function (resultPromise, dispatcher) { + return resultPromise.then(function (shouldDispatch) { + return shouldDispatch === false ? false : dispatcher.apply(undefined, _toConsumableArray(payload)); + }).catch(function (error) { + if (dispatcher._pluginName) { + // eslint-disable-next-line no-param-reassign + error.message += '[' + dispatcher._pluginName + ']'; + } + throw error; + }); + }, _Promise.resolve(true)); + }; + + var debug = browser$1('LC:Realtime'); + + var routerCache = new Cache('push-router'); + + var Realtime = function (_EventEmitter) { + _inherits(Realtime, _EventEmitter); + + /** + * @extends EventEmitter + * @param {Object} options + * @param {String} options.appId + * @param {String} options.appKey (since 4.0.0) + * @param {String} [options.region='cn'] 节点 id + * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式) + * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。 + * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序) + * @param {Boolean} [options.ssl=true] 使用 wss 进行连接 + * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0) + */ + function Realtime(options) { + _classCallCheck(this, Realtime); + + debug('initializing Realtime'); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof options.appId !== 'string') { + throw new TypeError('appId [' + options.appId + '] is not a string'); + } + if (typeof options.appKey !== 'string') { + throw new TypeError('appKey [' + options.appKey + '] is not a string'); + } + _this._options = _Object$assign({ + appId: undefined, + appKey: undefined, + region: 'cn', + pushOfflineMessages: false, + noBinary: isWeapp, + ssl: true, + server: process.env.SERVER + }, options); + _this._cache = new Cache('endpoints'); + internal(_this).clients = new _Set(); + _this._plugins = [].concat(_toConsumableArray(ensureArray(Realtime.__preRegisteredPlugins)), _toConsumableArray(ensureArray(options.plugins))).reduce(function (result, plugin) { + // eslint-disable-next-line no-restricted-syntax + for (var hook in plugin) { + if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') { + if (plugin.name) { + ensureArray(plugin[hook]).forEach(function (value) { + // eslint-disable-next-line no-param-reassign + value._pluginName = plugin.name; + }); + } + // eslint-disable-next-line no-param-reassign + result[hook] = ensureArray(result[hook]).concat(plugin[hook]); + } + } + return result; + }, {}); + // onRealtimeCreate hook + applyDecorators(_this._plugins.onRealtimeCreate, _this); + return _this; + } + + Realtime.prototype._request = function () { + var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) { + var method = _ref.method, + _ref$version = _ref.version, + version = _ref$version === undefined ? '1.1' : _ref$version, + path = _ref.path, + query = _ref.query, + headers = _ref.headers, + _ref$data = _ref.data, + data = _ref$data === undefined ? {} : _ref$data; + + var _options, appId, region, _ref3, api, url; + + return regenerator.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _options = this._options, appId = _options.appId, region = _options.region; + _context.next = 3; + return this.constructor._fetchAppRouter({ appId: appId, region: region }); + + case 3: + _ref3 = _context.sent; + api = _ref3.api; + url = 'https://' + api + '/' + version + path; + return _context.abrupt('return', axios(url, { + method: method, + params: query, + headers: _extends$1({ + 'X-LC-Id': this._options.appId, + 'X-LC-Key': this._options.appKey + }, headers), + data: data + }).then(function (response) { + return response.data; + })); + + case 7: + case 'end': + return _context.stop(); + } + } + }, _callee, this); + })); + + function _request(_x) { + return _ref2.apply(this, arguments); + } + + return _request; + }(); + + Realtime.prototype._open = function _open() { + var _this2 = this; + + if (this._openPromise) return this._openPromise; + + var format = 'protobuf2'; + if (this._options.noBinary) { + // 不发送 binary data,fallback to base64 string + format = 'proto2base64'; + } + var version = 3; + if (this._options.pushOfflineMessages) { + // 不推送离线消息,而是发送对话的未读通知 + version = 1; + } + var protocol = { + format: format, + version: version + }; + this._openPromise = new _Promise(function (resolve, reject) { + debug('No connection established, create a new one.'); + var connection = new Connection(function () { + return _this2._getEndpoints(_this2._options); + }, protocol); + connection.on('open', function () { + return resolve(connection); + }); + connection.on('error', reject); + connection.on('message', _this2._dispatchCommand.bind(_this2)); + /** + * 连接断开。 + * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。 + * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。 + * @event Realtime#disconnect + */ + /** + * 计划在一段时间后尝试重新连接 + * @event Realtime#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + */ + /** + * 正在尝试重新连接 + * @event Realtime#retry + * @param {Number} attempt 尝试重连的次数 + */ + /** + * 连接恢复正常。 + * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素 + * @event Realtime#reconnect + */ + + /** + * 客户端连接断开 + * @event IMClient#disconnect + * @see Realtime#event:disconnect + * @since 3.2.0 + */ + /** + * 计划在一段时间后尝试重新连接 + * @event IMClient#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + * @since 3.2.0 + */ + /** + * 正在尝试重新连接 + * @event IMClient#retry + * @param {Number} attempt 尝试重连的次数 + * @since 3.2.0 + */ + + /** + * 客户端进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event Realtime#offline + * @since 3.4.0 + */ + /** + * 客户端恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event Realtime#online + * @since 3.4.0 + */ + /** + * 进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event IMClient#offline + * @since 3.4.0 + */ + /** + * 恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event IMClient#online + * @since 3.4.0 + */ + + // event proxy + ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(function (event) { + return connection.on(event, function () { + for (var _len = arguments.length, payload = Array(_len), _key = 0; _key < _len; _key++) { + payload[_key] = arguments[_key]; + } + + debug(event + ' event emitted. %O', payload); + _this2.emit.apply(_this2, [event].concat(payload)); + if (event !== 'reconnect') { + internal(_this2).clients.forEach(function (client) { + client.emit.apply(client, [event].concat(payload)); + }); + } + }); + }); + // override handleClose + connection.handleClose = function handleClose(event) { + var isFatal = [ErrorCode.APP_NOT_AVAILABLE, ErrorCode.INVALID_LOGIN, ErrorCode.INVALID_ORIGIN].some(function (errorCode) { + return errorCode === event.code; + }); + if (isFatal) { + // in these cases, SDK should throw. + this.throw(createError$3(event)); + } else { + // reconnect + this.disconnect(); + } + }; + internal(_this2).connection = connection; + }); + + return this._openPromise; + }; + + Realtime.prototype._getEndpoints = function _getEndpoints(options) { + var _this3 = this; + + return _Promise.resolve(this._cache.get('endpoints') || this.constructor._fetchEndpointsInfo(options).then(tap(function (info) { + return _this3._cache.set('endpoints', info, info.ttl * 1000); + }))).then(function (info) { + debug('endpoint info: %O', info); + return [info.server, info.secondary]; + }); + }; + + Realtime._fetchAppRouter = function _fetchAppRouter(_ref4) { + var appId = _ref4.appId, + region = _ref4.region; + + debug('fetch router'); + switch (region) { + case 'cn': + { + var cachedRouter = routerCache.get(appId); + if (cachedRouter) { + return _Promise.resolve(cachedRouter); + } + return axios.get('https://app-router.leancloud.cn/2/route', { + params: { + appId: appId + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)).then(function (_ref5) { + var rtmRouter = _ref5.rtm_router_server, + api = _ref5.api_server, + _ref5$ttl = _ref5.ttl, + ttl = _ref5$ttl === undefined ? 3600 : _ref5$ttl; + + if (!rtmRouter) { + throw new Error('rtm router not exists'); + } + var router = { + rtmRouter: rtmRouter, + api: api + }; + routerCache.set(appId, router, ttl * 1000); + return router; + }).catch(function () { + var id = appId.slice(0, 8).toLowerCase(); + return { + rtmRouter: id + '.rtm.lncld.net', + api: id + '.api.lncld.net' + }; + }); + } + case 'us': + return _Promise.resolve({ + rtmRouter: 'router-a0-push.leancloud.cn', + api: 'us-api.leancloud.cn' + }); + default: + throw new Error('Region [' + region + '] is not supported.'); + } + }; + + Realtime._fetchEndpointsInfo = function _fetchEndpointsInfo(_ref6) { + var appId = _ref6.appId, + region = _ref6.region, + ssl = _ref6.ssl, + server = _ref6.server; + + debug('fetch endpoint info'); + return this._fetchAppRouter({ appId: appId, region: region }).then(tap(debug)).then(function (_ref7) { + var rtmRouter = _ref7.rtmRouter; + return axios.get('https://' + rtmRouter + '/v1/route', { + params: { + appId: appId, + secure: ssl, + features: isWeapp ? 'wechat' : undefined, + server: server, + _t: Date.now() + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)); + }); + }; + + Realtime.prototype._close = function _close() { + if (this._openPromise) { + this._openPromise.then(function (connection) { + return connection.close(); + }); + } + delete this._openPromise; + }; + + /** + * 手动进行重连。 + * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。 + * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。 + */ + + + Realtime.prototype.retry = function retry() { + var connection = internal(this).connection; + if (!connection) { + throw new Error('no connection established'); + } + if (connection.cannot('retry')) { + throw new Error('retrying not allowed when not disconnected. the connection is now ' + connection.current); + } + return connection.retry(); + }; + /** + * 暂停,使 SDK 进入离线状态。 + * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。 + * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。 + * + * @since 3.4.0 + * @see Realtime#event:offline + */ + + + Realtime.prototype.pause = function pause() { + // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。 + // 因此不像 retry,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('pause')) connection.pause(); + }; + /** + * 恢复在线状态。 + * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。 + * + * @since 3.4.0 + * @see Realtime#event:online + */ + + + Realtime.prototype.resume = function resume() { + // 与 pause 一样,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('resume')) connection.resume(); + }; + + Realtime.prototype._register = function _register(client) { + internal(this).clients.add(client); + }; + + Realtime.prototype._deregister = function _deregister(client) { + internal(this).clients.delete(client); + if (internal(this).clients.size === 0) { + this._close(); + } + }; + + Realtime.prototype._dispatchCommand = function _dispatchCommand(command) { + return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this]).then(function (shouldDispatch) { + // no plugin handled this command + if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim$1(command)); + return false; + }); + }; + + return Realtime; + }(eventemitter3); + + exports.Protocals = message; + exports.Promise = _Promise; + exports.EventEmitter = eventemitter3; + exports.Realtime = Realtime; + exports.ErrorCode = ErrorCode; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + +//# sourceMappingURL=realtime-core.browser.js.map \ No newline at end of file diff --git a/dist/realtime-core.browser.js.map b/dist/realtime-core.browser.js.map new file mode 100644 index 000000000..83942171a --- /dev/null +++ b/dist/realtime-core.browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":null,"sources":["/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-integer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_defined.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_string-at.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_library.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_global.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_core.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_a-function.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_ctx.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_an-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_fails.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_descriptors.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_dom-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_ie8-dom-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-primitive.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-dp.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_property-desc.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_hide.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_export.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_redefine.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_has.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iterators.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_cof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iobject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-iobject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-length.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-absolute-index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-includes.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_shared.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_uid.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_shared-key.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-keys-internal.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_enum-bug-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-dps.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_html.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-to-string-tag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gpo.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.string.iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_add-to-unscopables.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-step.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.array.iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/web.dom.iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_classof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_an-instance.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-call.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-array-iter.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/core.get-iterator-method.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_for-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_species-constructor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_invoke.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_task.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_microtask.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_new-promise-capability.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_perform.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_promise-resolve.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_redefine-all.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-species.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-detect.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.promise.finally.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.promise.try.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/long/dist/long.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/bytebuffer/dist/bytebuffer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/@leeyeh/rollup-plugin-node-resolve/src/empty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/protobufjs/dist/protobuf-light.js","/home/travis/build/leancloud/js-realtime-sdk/proto/message-compiled.js","/home/travis/build/leancloud/js-realtime-sdk/proto/message.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/eventemitter3/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/regenerator-runtime/runtime.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/regenerator-runtime/runtime-module.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/regenerator/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gops.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-pie.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/extends.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/asyncToGenerator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_create-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.array.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/array/from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/array/from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/toConsumableArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_meta.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_validate-collection.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-strong.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-array.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-species-constructor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-species-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-methods.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-from-iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-to-json.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.to-json.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-collection-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-collection-from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/classCallCheck.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks-ext.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/symbol/iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/symbol/iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_enum-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopn-ext.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopd.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.symbol.async-iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.symbol.observable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/symbol/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/typeof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/possibleConstructorReturn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-proto.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/inherits.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/ms/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/debug/src/debug.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/debug/src/browser.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/bind.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/is-buffer/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/utils.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/json/stringify.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/json/stringify.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/normalizeHeaderName.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/enhanceError.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/createError.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/settle.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/buildURL.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/parseHeaders.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/isURLSameOrigin.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/btoa.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/cookies.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/adapters/xhr.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/defaults.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/InterceptorManager.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/transformData.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/isCancel.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/dispatchRequest.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/isAbsoluteURL.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/combineURLs.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/Axios.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/Cancel.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/CancelToken.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/spread.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/axios.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-sap.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/javascript-state-machine/state-machine.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-weak.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.weak-map.of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.weak-map.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/defineProperty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_freeGlobal.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_root.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getRawTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_objectToString.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseGetTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_overArg.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getPrototype.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isObjectLike.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isPlainObject.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/global.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/createClass.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/expirable.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/cache.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/index.js","/home/travis/build/leancloud/js-realtime-sdk/src/polyfills/ws-browser.js","/home/travis/build/leancloud/js-realtime-sdk/src/websocket-plus.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.freeze.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/freeze.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/freeze.js","/home/travis/build/leancloud/js-realtime-sdk/src/error.js","/home/travis/build/leancloud/js-realtime-sdk/src/connection.js","/home/travis/build/leancloud/js-realtime-sdk/src/plugin.js","/home/travis/build/leancloud/js-realtime-sdk/src/realtime.js"],"sourcesContent":["// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","module.exports = true;\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.5.1' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && key in exports) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = require('./_hide');\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","module.exports = {};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","module.exports = function () { /* empty */ };\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","require('./es6.array.iterator');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar TO_STRING_TAG = require('./_wks')('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if (Observer) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n var promise = Promise.resolve();\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var hide = require('./_hide');\nmodule.exports = function (target, src, safe) {\n for (var key in src) {\n if (safe && target[key]) target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n","'use strict';\nvar global = require('./_global');\nvar core = require('./_core');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value);\n if (domain) domain.exit();\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n if (promise._h == 1) return false;\n var chain = promise._a || promise._c;\n var i = 0;\n var reaction;\n while (chain.length > i) {\n reaction = chain[i++];\n if (reaction.fail || !isUnhandled(reaction.promise)) return false;\n } return true;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n","'use strict';\n// https://github.com/tc39/proposal-promise-try\nvar $export = require('./_export');\nvar newPromiseCapability = require('./_new-promise-capability');\nvar perform = require('./_perform');\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.promise');\nrequire('../modules/es7.promise.finally');\nrequire('../modules/es7.promise.try');\nmodule.exports = require('../modules/_core').Promise;\n","module.exports = { \"default\": require(\"core-js/library/fn/promise\"), __esModule: true };","/*\r\n Copyright 2013 Daniel Wirtz \r\n Copyright 2009 The Closure Library Authors. All Rights Reserved.\r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS-IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license long.js (c) 2013 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/long.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n define([], factory);\r\n /* CommonJS */ else if (typeof require === 'function' && typeof module === \"object\" && module && module[\"exports\"])\r\n module[\"exports\"] = factory();\r\n /* Global */ else\r\n (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"Long\"] = factory();\r\n\r\n})(this, function() {\r\n \"use strict\";\r\n\r\n /**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @constructor\r\n */\r\n function Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n }\r\n\r\n // The internal representation of a long is the two given signed, 32-bit values.\r\n // We use 32-bit pieces because these are the size of integers on which\r\n // Javascript performs bit-operations. For operations like addition and\r\n // multiplication, we split each number into 16 bit pieces, which can easily be\r\n // multiplied within Javascript's floating-point representation without overflow\r\n // or change in sign.\r\n //\r\n // In the algorithms below, we frequently reduce the negative case to the\r\n // positive case by negating the input(s) and then post-processing the result.\r\n // Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n // a positive number, it overflows back into a negative). Not handling this\r\n // case would often result in infinite recursion.\r\n //\r\n // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n // methods on which they depend.\r\n\r\n /**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\n Long.prototype.__isLong__;\r\n\r\n Object.defineProperty(Long.prototype, \"__isLong__\", {\r\n value: true,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n\r\n /**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\n function isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n }\r\n\r\n /**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\n Long.isLong = isLong;\r\n\r\n /**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\n var INT_CACHE = {};\r\n\r\n /**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\n var UINT_CACHE = {};\r\n\r\n /**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n }\r\n\r\n /**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromInt = fromInt;\r\n\r\n /**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromNumber(value, unsigned) {\r\n if (isNaN(value) || !isFinite(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n }\r\n\r\n /**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromNumber = fromNumber;\r\n\r\n /**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n }\r\n\r\n /**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromBits = fromBits;\r\n\r\n /**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\n var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n /**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromString = fromString;\r\n\r\n /**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromValue(val) {\r\n if (val /* is compatible */ instanceof Long)\r\n return val;\r\n if (typeof val === 'number')\r\n return fromNumber(val);\r\n if (typeof val === 'string')\r\n return fromString(val);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, val.unsigned);\r\n }\r\n\r\n /**\r\n * Converts the specified value to a Long.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @returns {!Long}\r\n */\r\n Long.fromValue = fromValue;\r\n\r\n // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n // no runtime penalty for these.\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_16_DBL = 1 << 16;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_24_DBL = 1 << 24;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n /**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var ZERO = fromInt(0);\r\n\r\n /**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\n Long.ZERO = ZERO;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var UZERO = fromInt(0, true);\r\n\r\n /**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\n Long.UZERO = UZERO;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var ONE = fromInt(1);\r\n\r\n /**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\n Long.ONE = ONE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var UONE = fromInt(1, true);\r\n\r\n /**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\n Long.UONE = UONE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var NEG_ONE = fromInt(-1);\r\n\r\n /**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\n Long.NEG_ONE = NEG_ONE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n /**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\n Long.MAX_VALUE = MAX_VALUE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n /**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\n Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n /**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\n Long.MIN_VALUE = MIN_VALUE;\r\n\r\n /**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\n var LongPrototype = Long.prototype;\r\n\r\n /**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\n LongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n };\r\n\r\n /**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\n LongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n };\r\n\r\n /**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\n LongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\n LongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n };\r\n\r\n /**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\n LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n };\r\n\r\n /**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\n LongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n };\r\n\r\n /**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\n LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n };\r\n\r\n /**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\n LongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.eq = LongPrototype.equals;\r\n\r\n /**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n };\r\n\r\n /**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.neq = LongPrototype.notEquals;\r\n\r\n /**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lt = LongPrototype.lessThan;\r\n\r\n /**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n /**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n /**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n /**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\n LongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n };\r\n\r\n /**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\n LongPrototype.comp = LongPrototype.compare;\r\n\r\n /**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\n LongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n };\r\n\r\n /**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\n LongPrototype.neg = LongPrototype.negate;\r\n\r\n /**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\n LongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\n LongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n };\r\n\r\n /**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\n LongPrototype.sub = LongPrototype.subtract;\r\n\r\n /**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\n LongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\n LongPrototype.mul = LongPrototype.multiply;\r\n\r\n /**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\n LongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n };\r\n\r\n /**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\n LongPrototype.div = LongPrototype.divide;\r\n\r\n /**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\n LongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n return this.sub(this.div(divisor).mul(divisor));\r\n };\r\n\r\n /**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\n LongPrototype.mod = LongPrototype.modulo;\r\n\r\n /**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\n LongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\n LongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\n LongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\n LongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n /**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n /**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n };\r\n\r\n /**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n /**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\n LongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n };\r\n\r\n /**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\n LongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n };\r\n\r\n /**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\n LongPrototype.toBytes = function(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n }\r\n\r\n /**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\n LongPrototype.toBytesLE = function() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n (lo >>> 8) & 0xff,\r\n (lo >>> 16) & 0xff,\r\n (lo >>> 24) & 0xff,\r\n hi & 0xff,\r\n (hi >>> 8) & 0xff,\r\n (hi >>> 16) & 0xff,\r\n (hi >>> 24) & 0xff\r\n ];\r\n }\r\n\r\n /**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\n LongPrototype.toBytesBE = function() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n (hi >>> 24) & 0xff,\r\n (hi >>> 16) & 0xff,\r\n (hi >>> 8) & 0xff,\r\n hi & 0xff,\r\n (lo >>> 24) & 0xff,\r\n (lo >>> 16) & 0xff,\r\n (lo >>> 8) & 0xff,\r\n lo & 0xff\r\n ];\r\n }\r\n\r\n return Long;\r\n});\r\n","/*\r\n Copyright 2013-2014 Daniel Wirtz \r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license bytebuffer.js (c) 2015 Daniel Wirtz \r\n * Backing buffer: ArrayBuffer, Accessor: Uint8Array\r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/bytebuffer.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n define([\"long\"], factory);\r\n /* CommonJS */ else if (typeof require === 'function' && typeof module === \"object\" && module && module[\"exports\"])\r\n module['exports'] = (function() {\r\n var Long; try { Long = require(\"long\"); } catch (e) {}\r\n return factory(Long);\r\n })();\r\n /* Global */ else\r\n (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"ByteBuffer\"] = factory(global[\"dcodeIO\"][\"Long\"]);\r\n\r\n})(this, function(Long) {\r\n \"use strict\";\r\n\r\n /**\r\n * Constructs a new ByteBuffer.\r\n * @class The swiss army knife for binary data in JavaScript.\r\n * @exports ByteBuffer\r\n * @constructor\r\n * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @expose\r\n */\r\n var ByteBuffer = function(capacity, littleEndian, noAssert) {\r\n if (typeof capacity === 'undefined')\r\n capacity = ByteBuffer.DEFAULT_CAPACITY;\r\n if (typeof littleEndian === 'undefined')\r\n littleEndian = ByteBuffer.DEFAULT_ENDIAN;\r\n if (typeof noAssert === 'undefined')\r\n noAssert = ByteBuffer.DEFAULT_NOASSERT;\r\n if (!noAssert) {\r\n capacity = capacity | 0;\r\n if (capacity < 0)\r\n throw RangeError(\"Illegal capacity\");\r\n littleEndian = !!littleEndian;\r\n noAssert = !!noAssert;\r\n }\r\n\r\n /**\r\n * Backing ArrayBuffer.\r\n * @type {!ArrayBuffer}\r\n * @expose\r\n */\r\n this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity);\r\n\r\n /**\r\n * Uint8Array utilized to manipulate the backing buffer. Becomes `null` if the backing buffer has a capacity of `0`.\r\n * @type {?Uint8Array}\r\n * @expose\r\n */\r\n this.view = capacity === 0 ? null : new Uint8Array(this.buffer);\r\n\r\n /**\r\n * Absolute read/write offset.\r\n * @type {number}\r\n * @expose\r\n * @see ByteBuffer#flip\r\n * @see ByteBuffer#clear\r\n */\r\n this.offset = 0;\r\n\r\n /**\r\n * Marked offset.\r\n * @type {number}\r\n * @expose\r\n * @see ByteBuffer#mark\r\n * @see ByteBuffer#reset\r\n */\r\n this.markedOffset = -1;\r\n\r\n /**\r\n * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.\r\n * @type {number}\r\n * @expose\r\n * @see ByteBuffer#flip\r\n * @see ByteBuffer#clear\r\n */\r\n this.limit = capacity;\r\n\r\n /**\r\n * Whether to use little endian byte order, defaults to `false` for big endian.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.littleEndian = littleEndian;\r\n\r\n /**\r\n * Whether to skip assertions of offsets and values, defaults to `false`.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.noAssert = noAssert;\r\n };\r\n\r\n /**\r\n * ByteBuffer version.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.VERSION = \"5.0.1\";\r\n\r\n /**\r\n * Little endian constant that can be used instead of its boolean value. Evaluates to `true`.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.LITTLE_ENDIAN = true;\r\n\r\n /**\r\n * Big endian constant that can be used instead of its boolean value. Evaluates to `false`.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.BIG_ENDIAN = false;\r\n\r\n /**\r\n * Default initial capacity of `16`.\r\n * @type {number}\r\n * @expose\r\n */\r\n ByteBuffer.DEFAULT_CAPACITY = 16;\r\n\r\n /**\r\n * Default endianess of `false` for big endian.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;\r\n\r\n /**\r\n * Default no assertions flag of `false`.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ByteBuffer.DEFAULT_NOASSERT = false;\r\n\r\n /**\r\n * A `Long` class for representing a 64-bit two's-complement integer value. May be `null` if Long.js has not been loaded\r\n * and int64 support is not available.\r\n * @type {?Long}\r\n * @const\r\n * @see https://github.com/dcodeIO/long.js\r\n * @expose\r\n */\r\n ByteBuffer.Long = Long || null;\r\n\r\n /**\r\n * @alias ByteBuffer.prototype\r\n * @inner\r\n */\r\n var ByteBufferPrototype = ByteBuffer.prototype;\r\n\r\n /**\r\n * An indicator used to reliably determine if an object is a ByteBuffer or not.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n * @private\r\n */\r\n ByteBufferPrototype.__isByteBuffer__;\r\n\r\n Object.defineProperty(ByteBufferPrototype, \"__isByteBuffer__\", {\r\n value: true,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n\r\n // helpers\r\n\r\n /**\r\n * @type {!ArrayBuffer}\r\n * @inner\r\n */\r\n var EMPTY_BUFFER = new ArrayBuffer(0);\r\n\r\n /**\r\n * String.fromCharCode reference for compile-time renaming.\r\n * @type {function(...number):string}\r\n * @inner\r\n */\r\n var stringFromCharCode = String.fromCharCode;\r\n\r\n /**\r\n * Creates a source function for a string.\r\n * @param {string} s String to read from\r\n * @returns {function():number|null} Source function returning the next char code respectively `null` if there are\r\n * no more characters left.\r\n * @throws {TypeError} If the argument is invalid\r\n * @inner\r\n */\r\n function stringSource(s) {\r\n var i=0; return function() {\r\n return i < s.length ? s.charCodeAt(i++) : null;\r\n };\r\n }\r\n\r\n /**\r\n * Creates a destination function for a string.\r\n * @returns {function(number=):undefined|string} Destination function successively called with the next char code.\r\n * Returns the final string when called without arguments.\r\n * @inner\r\n */\r\n function stringDestination() {\r\n var cs = [], ps = []; return function() {\r\n if (arguments.length === 0)\r\n return ps.join('')+stringFromCharCode.apply(String, cs);\r\n if (cs.length + arguments.length > 1024)\r\n ps.push(stringFromCharCode.apply(String, cs)),\r\n cs.length = 0;\r\n Array.prototype.push.apply(cs, arguments);\r\n };\r\n }\r\n\r\n /**\r\n * Gets the accessor type.\r\n * @returns {Function} `Buffer` under node.js, `Uint8Array` respectively `DataView` in the browser (classes)\r\n * @expose\r\n */\r\n ByteBuffer.accessor = function() {\r\n return Uint8Array;\r\n };\r\n /**\r\n * Allocates a new ByteBuffer backed by a buffer of the specified capacity.\r\n * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer}\r\n * @expose\r\n */\r\n ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {\r\n return new ByteBuffer(capacity, littleEndian, noAssert);\r\n };\r\n\r\n /**\r\n * Concatenates multiple ByteBuffers into one.\r\n * @param {!Array.} buffers Buffers to concatenate\r\n * @param {(string|boolean)=} encoding String encoding if `buffers` contains a string (\"base64\", \"hex\", \"binary\",\r\n * defaults to \"utf8\")\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order for the resulting ByteBuffer. Defaults\r\n * to {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values for the resulting ByteBuffer. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} Concatenated ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {\r\n if (typeof encoding === 'boolean' || typeof encoding !== 'string') {\r\n noAssert = littleEndian;\r\n littleEndian = encoding;\r\n encoding = undefined;\r\n }\r\n var capacity = 0;\r\n for (var i=0, k=buffers.length, length; i 0) capacity += length;\r\n }\r\n if (capacity === 0)\r\n return new ByteBuffer(0, littleEndian, noAssert);\r\n var bb = new ByteBuffer(capacity, littleEndian, noAssert),\r\n bi;\r\n i=0; while (i} buffer Anything that can be wrapped\r\n * @param {(string|boolean)=} encoding String encoding if `buffer` is a string (\"base64\", \"hex\", \"binary\", defaults to\r\n * \"utf8\")\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} A ByteBuffer wrapping `buffer`\r\n * @expose\r\n */\r\n ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {\r\n if (typeof encoding !== 'string') {\r\n noAssert = littleEndian;\r\n littleEndian = encoding;\r\n encoding = undefined;\r\n }\r\n if (typeof buffer === 'string') {\r\n if (typeof encoding === 'undefined')\r\n encoding = \"utf8\";\r\n switch (encoding) {\r\n case \"base64\":\r\n return ByteBuffer.fromBase64(buffer, littleEndian);\r\n case \"hex\":\r\n return ByteBuffer.fromHex(buffer, littleEndian);\r\n case \"binary\":\r\n return ByteBuffer.fromBinary(buffer, littleEndian);\r\n case \"utf8\":\r\n return ByteBuffer.fromUTF8(buffer, littleEndian);\r\n case \"debug\":\r\n return ByteBuffer.fromDebug(buffer, littleEndian);\r\n default:\r\n throw Error(\"Unsupported encoding: \"+encoding);\r\n }\r\n }\r\n if (buffer === null || typeof buffer !== 'object')\r\n throw TypeError(\"Illegal buffer\");\r\n var bb;\r\n if (ByteBuffer.isByteBuffer(buffer)) {\r\n bb = ByteBufferPrototype.clone.call(buffer);\r\n bb.markedOffset = -1;\r\n return bb;\r\n }\r\n if (buffer instanceof Uint8Array) { // Extract ArrayBuffer from Uint8Array\r\n bb = new ByteBuffer(0, littleEndian, noAssert);\r\n if (buffer.length > 0) { // Avoid references to more than one EMPTY_BUFFER\r\n bb.buffer = buffer.buffer;\r\n bb.offset = buffer.byteOffset;\r\n bb.limit = buffer.byteOffset + buffer.byteLength;\r\n bb.view = new Uint8Array(buffer.buffer);\r\n }\r\n } else if (buffer instanceof ArrayBuffer) { // Reuse ArrayBuffer\r\n bb = new ByteBuffer(0, littleEndian, noAssert);\r\n if (buffer.byteLength > 0) {\r\n bb.buffer = buffer;\r\n bb.offset = 0;\r\n bb.limit = buffer.byteLength;\r\n bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null;\r\n }\r\n } else if (Object.prototype.toString.call(buffer) === \"[object Array]\") { // Create from octets\r\n bb = new ByteBuffer(buffer.length, littleEndian, noAssert);\r\n bb.limit = buffer.length;\r\n for (var i=0; i} value Array of booleans to write\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n * @returns {!ByteBuffer}\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeBitSet = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (!(value instanceof Array))\r\n throw TypeError(\"Illegal BitSet: Not an array\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n\r\n var start = offset,\r\n bits = value.length,\r\n bytes = (bits >> 3),\r\n bit = 0,\r\n k;\r\n\r\n offset += this.writeVarint32(bits,offset);\r\n\r\n while(bytes--) {\r\n k = (!!value[bit++] & 1) |\r\n ((!!value[bit++] & 1) << 1) |\r\n ((!!value[bit++] & 1) << 2) |\r\n ((!!value[bit++] & 1) << 3) |\r\n ((!!value[bit++] & 1) << 4) |\r\n ((!!value[bit++] & 1) << 5) |\r\n ((!!value[bit++] & 1) << 6) |\r\n ((!!value[bit++] & 1) << 7);\r\n this.writeByte(k,offset++);\r\n }\r\n\r\n if(bit < bits) {\r\n var m = 0; k = 0;\r\n while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++));\r\n this.writeByte(k,offset++);\r\n }\r\n\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n }\r\n\r\n /**\r\n * Reads a BitSet as an array of booleans.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n * @returns {Array\r\n * @expose\r\n */\r\n ByteBufferPrototype.readBitSet = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n\r\n var ret = this.readVarint32(offset),\r\n bits = ret.value,\r\n bytes = (bits >> 3),\r\n bit = 0,\r\n value = [],\r\n k;\r\n\r\n offset += ret.length;\r\n\r\n while(bytes--) {\r\n k = this.readByte(offset++);\r\n value[bit++] = !!(k & 0x01);\r\n value[bit++] = !!(k & 0x02);\r\n value[bit++] = !!(k & 0x04);\r\n value[bit++] = !!(k & 0x08);\r\n value[bit++] = !!(k & 0x10);\r\n value[bit++] = !!(k & 0x20);\r\n value[bit++] = !!(k & 0x40);\r\n value[bit++] = !!(k & 0x80);\r\n }\r\n\r\n if(bit < bits) {\r\n var m = 0;\r\n k = this.readByte(offset++);\r\n while(bit < bits) value[bit++] = !!((k >> (m++)) & 1);\r\n }\r\n\r\n if (relative) {\r\n this.offset = offset;\r\n }\r\n return value;\r\n }\r\n /**\r\n * Reads the specified number of bytes.\r\n * @param {number} length Number of bytes to read\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n * @returns {!ByteBuffer}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readBytes = function(length, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + length > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+length+\") <= \"+this.buffer.byteLength);\n }\r\n var slice = this.slice(offset, offset + length);\r\n if (relative) this.offset += length;\n return slice;\r\n };\r\n\r\n /**\r\n * Writes a payload of bytes. This is an alias of {@link ByteBuffer#append}.\r\n * @function\r\n * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to write. If `source` is a ByteBuffer, its offsets\r\n * will be modified according to the performed read operation.\r\n * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeBytes = ByteBufferPrototype.append;\r\n\r\n // types/ints/int8\r\n\r\n /**\r\n * Writes an 8bit signed integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt8 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 1;\n var capacity0 = this.buffer.byteLength;\n if (offset > capacity0)\n this.resize((capacity0 *= 2) > offset ? capacity0 : offset);\n offset -= 1;\n this.view[offset] = value;\r\n if (relative) this.offset += 1;\n return this;\r\n };\r\n\r\n /**\r\n * Writes an 8bit signed integer. This is an alias of {@link ByteBuffer#writeInt8}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;\r\n\r\n /**\r\n * Reads an 8bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt8 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var value = this.view[offset];\r\n if ((value & 0x80) === 0x80) value = -(0xFF - value + 1); // Cast to signed\r\n if (relative) this.offset += 1;\n return value;\r\n };\r\n\r\n /**\r\n * Reads an 8bit signed integer. This is an alias of {@link ByteBuffer#readInt8}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;\r\n\r\n /**\r\n * Writes an 8bit unsigned integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint8 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value >>>= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 1;\n var capacity1 = this.buffer.byteLength;\n if (offset > capacity1)\n this.resize((capacity1 *= 2) > offset ? capacity1 : offset);\n offset -= 1;\n this.view[offset] = value;\r\n if (relative) this.offset += 1;\n return this;\r\n };\r\n\r\n /**\r\n * Writes an 8bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint8}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8;\r\n\r\n /**\r\n * Reads an 8bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint8 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var value = this.view[offset];\r\n if (relative) this.offset += 1;\n return value;\r\n };\r\n\r\n /**\r\n * Reads an 8bit unsigned integer. This is an alias of {@link ByteBuffer#readUint8}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8;\r\n\r\n // types/ints/int16\r\n\r\n /**\r\n * Writes a 16bit signed integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt16 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 2;\n var capacity2 = this.buffer.byteLength;\n if (offset > capacity2)\n this.resize((capacity2 *= 2) > offset ? capacity2 : offset);\n offset -= 2;\n if (this.littleEndian) {\r\n this.view[offset+1] = (value & 0xFF00) >>> 8;\r\n this.view[offset ] = value & 0x00FF;\r\n } else {\r\n this.view[offset] = (value & 0xFF00) >>> 8;\r\n this.view[offset+1] = value & 0x00FF;\r\n }\r\n if (relative) this.offset += 2;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 16bit signed integer. This is an alias of {@link ByteBuffer#writeInt16}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;\r\n\r\n /**\r\n * Reads a 16bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt16 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 2 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+2+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\r\n value = this.view[offset ];\r\n value |= this.view[offset+1] << 8;\r\n } else {\r\n value = this.view[offset ] << 8;\r\n value |= this.view[offset+1];\r\n }\r\n if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1); // Cast to signed\r\n if (relative) this.offset += 2;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 16bit signed integer. This is an alias of {@link ByteBuffer#readInt16}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;\r\n\r\n /**\r\n * Writes a 16bit unsigned integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint16 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value >>>= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 2;\n var capacity3 = this.buffer.byteLength;\n if (offset > capacity3)\n this.resize((capacity3 *= 2) > offset ? capacity3 : offset);\n offset -= 2;\n if (this.littleEndian) {\r\n this.view[offset+1] = (value & 0xFF00) >>> 8;\r\n this.view[offset ] = value & 0x00FF;\r\n } else {\r\n this.view[offset] = (value & 0xFF00) >>> 8;\r\n this.view[offset+1] = value & 0x00FF;\r\n }\r\n if (relative) this.offset += 2;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 16bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint16}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16;\r\n\r\n /**\r\n * Reads a 16bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint16 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 2 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+2+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\r\n value = this.view[offset ];\r\n value |= this.view[offset+1] << 8;\r\n } else {\r\n value = this.view[offset ] << 8;\r\n value |= this.view[offset+1];\r\n }\r\n if (relative) this.offset += 2;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 16bit unsigned integer. This is an alias of {@link ByteBuffer#readUint16}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16;\r\n\r\n // types/ints/int32\r\n\r\n /**\r\n * Writes a 32bit signed integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 4;\n var capacity4 = this.buffer.byteLength;\n if (offset > capacity4)\n this.resize((capacity4 *= 2) > offset ? capacity4 : offset);\n offset -= 4;\n if (this.littleEndian) {\n this.view[offset+3] = (value >>> 24) & 0xFF;\n this.view[offset+2] = (value >>> 16) & 0xFF;\n this.view[offset+1] = (value >>> 8) & 0xFF;\n this.view[offset ] = value & 0xFF;\n } else {\n this.view[offset ] = (value >>> 24) & 0xFF;\n this.view[offset+1] = (value >>> 16) & 0xFF;\n this.view[offset+2] = (value >>> 8) & 0xFF;\n this.view[offset+3] = value & 0xFF;\n }\n if (relative) this.offset += 4;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 32bit signed integer. This is an alias of {@link ByteBuffer#writeInt32}.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;\r\n\r\n /**\r\n * Reads a 32bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\n value = this.view[offset+2] << 16;\n value |= this.view[offset+1] << 8;\n value |= this.view[offset ];\n value += this.view[offset+3] << 24 >>> 0;\n } else {\n value = this.view[offset+1] << 16;\n value |= this.view[offset+2] << 8;\n value |= this.view[offset+3];\n value += this.view[offset ] << 24 >>> 0;\n }\n value |= 0; // Cast to signed\r\n if (relative) this.offset += 4;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 32bit signed integer. This is an alias of {@link ByteBuffer#readInt32}.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;\r\n\r\n /**\r\n * Writes a 32bit unsigned integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value >>>= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 4;\n var capacity5 = this.buffer.byteLength;\n if (offset > capacity5)\n this.resize((capacity5 *= 2) > offset ? capacity5 : offset);\n offset -= 4;\n if (this.littleEndian) {\n this.view[offset+3] = (value >>> 24) & 0xFF;\n this.view[offset+2] = (value >>> 16) & 0xFF;\n this.view[offset+1] = (value >>> 8) & 0xFF;\n this.view[offset ] = value & 0xFF;\n } else {\n this.view[offset ] = (value >>> 24) & 0xFF;\n this.view[offset+1] = (value >>> 16) & 0xFF;\n this.view[offset+2] = (value >>> 8) & 0xFF;\n this.view[offset+3] = value & 0xFF;\n }\n if (relative) this.offset += 4;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 32bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint32}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32;\r\n\r\n /**\r\n * Reads a 32bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\n value = this.view[offset+2] << 16;\n value |= this.view[offset+1] << 8;\n value |= this.view[offset ];\n value += this.view[offset+3] << 24 >>> 0;\n } else {\n value = this.view[offset+1] << 16;\n value |= this.view[offset+2] << 8;\n value |= this.view[offset+3];\n value += this.view[offset ] << 24 >>> 0;\n }\n if (relative) this.offset += 4;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 32bit unsigned integer. This is an alias of {@link ByteBuffer#readUint32}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32;\r\n\r\n // types/ints/int64\r\n\r\n if (Long) {\r\n\r\n /**\r\n * Writes a 64bit signed integer.\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n else if (!(value && value instanceof Long))\n throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n offset += 8;\n var capacity6 = this.buffer.byteLength;\n if (offset > capacity6)\n this.resize((capacity6 *= 2) > offset ? capacity6 : offset);\n offset -= 8;\n var lo = value.low,\r\n hi = value.high;\r\n if (this.littleEndian) {\r\n this.view[offset+3] = (lo >>> 24) & 0xFF;\n this.view[offset+2] = (lo >>> 16) & 0xFF;\n this.view[offset+1] = (lo >>> 8) & 0xFF;\n this.view[offset ] = lo & 0xFF;\n offset += 4;\r\n this.view[offset+3] = (hi >>> 24) & 0xFF;\n this.view[offset+2] = (hi >>> 16) & 0xFF;\n this.view[offset+1] = (hi >>> 8) & 0xFF;\n this.view[offset ] = hi & 0xFF;\n } else {\r\n this.view[offset ] = (hi >>> 24) & 0xFF;\n this.view[offset+1] = (hi >>> 16) & 0xFF;\n this.view[offset+2] = (hi >>> 8) & 0xFF;\n this.view[offset+3] = hi & 0xFF;\n offset += 4;\r\n this.view[offset ] = (lo >>> 24) & 0xFF;\n this.view[offset+1] = (lo >>> 16) & 0xFF;\n this.view[offset+2] = (lo >>> 8) & 0xFF;\n this.view[offset+3] = lo & 0xFF;\n }\r\n if (relative) this.offset += 8;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 64bit signed integer. This is an alias of {@link ByteBuffer#writeInt64}.\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;\r\n\r\n /**\r\n * Reads a 64bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 8 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n }\r\n var lo = 0,\r\n hi = 0;\r\n if (this.littleEndian) {\r\n lo = this.view[offset+2] << 16;\n lo |= this.view[offset+1] << 8;\n lo |= this.view[offset ];\n lo += this.view[offset+3] << 24 >>> 0;\n offset += 4;\r\n hi = this.view[offset+2] << 16;\n hi |= this.view[offset+1] << 8;\n hi |= this.view[offset ];\n hi += this.view[offset+3] << 24 >>> 0;\n } else {\r\n hi = this.view[offset+1] << 16;\n hi |= this.view[offset+2] << 8;\n hi |= this.view[offset+3];\n hi += this.view[offset ] << 24 >>> 0;\n offset += 4;\r\n lo = this.view[offset+1] << 16;\n lo |= this.view[offset+2] << 8;\n lo |= this.view[offset+3];\n lo += this.view[offset ] << 24 >>> 0;\n }\r\n var value = new Long(lo, hi, false);\r\n if (relative) this.offset += 8;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 64bit signed integer. This is an alias of {@link ByteBuffer#readInt64}.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;\r\n\r\n /**\r\n * Writes a 64bit unsigned integer.\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n else if (!(value && value instanceof Long))\n throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n offset += 8;\n var capacity7 = this.buffer.byteLength;\n if (offset > capacity7)\n this.resize((capacity7 *= 2) > offset ? capacity7 : offset);\n offset -= 8;\n var lo = value.low,\r\n hi = value.high;\r\n if (this.littleEndian) {\r\n this.view[offset+3] = (lo >>> 24) & 0xFF;\n this.view[offset+2] = (lo >>> 16) & 0xFF;\n this.view[offset+1] = (lo >>> 8) & 0xFF;\n this.view[offset ] = lo & 0xFF;\n offset += 4;\r\n this.view[offset+3] = (hi >>> 24) & 0xFF;\n this.view[offset+2] = (hi >>> 16) & 0xFF;\n this.view[offset+1] = (hi >>> 8) & 0xFF;\n this.view[offset ] = hi & 0xFF;\n } else {\r\n this.view[offset ] = (hi >>> 24) & 0xFF;\n this.view[offset+1] = (hi >>> 16) & 0xFF;\n this.view[offset+2] = (hi >>> 8) & 0xFF;\n this.view[offset+3] = hi & 0xFF;\n offset += 4;\r\n this.view[offset ] = (lo >>> 24) & 0xFF;\n this.view[offset+1] = (lo >>> 16) & 0xFF;\n this.view[offset+2] = (lo >>> 8) & 0xFF;\n this.view[offset+3] = lo & 0xFF;\n }\r\n if (relative) this.offset += 8;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 64bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint64}.\r\n * @function\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64;\r\n\r\n /**\r\n * Reads a 64bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 8 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n }\r\n var lo = 0,\r\n hi = 0;\r\n if (this.littleEndian) {\r\n lo = this.view[offset+2] << 16;\n lo |= this.view[offset+1] << 8;\n lo |= this.view[offset ];\n lo += this.view[offset+3] << 24 >>> 0;\n offset += 4;\r\n hi = this.view[offset+2] << 16;\n hi |= this.view[offset+1] << 8;\n hi |= this.view[offset ];\n hi += this.view[offset+3] << 24 >>> 0;\n } else {\r\n hi = this.view[offset+1] << 16;\n hi |= this.view[offset+2] << 8;\n hi |= this.view[offset+3];\n hi += this.view[offset ] << 24 >>> 0;\n offset += 4;\r\n lo = this.view[offset+1] << 16;\n lo |= this.view[offset+2] << 8;\n lo |= this.view[offset+3];\n lo += this.view[offset ] << 24 >>> 0;\n }\r\n var value = new Long(lo, hi, true);\r\n if (relative) this.offset += 8;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 64bit unsigned integer. This is an alias of {@link ByteBuffer#readUint64}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64;\r\n\r\n } // Long\r\n\r\n\r\n // types/floats/float32\r\n\r\n /*\r\n ieee754 - https://github.com/feross/ieee754\r\n\r\n The MIT License (MIT)\r\n\r\n Copyright (c) Feross Aboukhadijeh\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be included in\r\n all copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n THE SOFTWARE.\r\n */\r\n\r\n /**\r\n * Reads an IEEE754 float from a byte array.\r\n * @param {!Array} buffer\r\n * @param {number} offset\r\n * @param {boolean} isLE\r\n * @param {number} mLen\r\n * @param {number} nBytes\r\n * @returns {number}\r\n * @inner\r\n */\r\n function ieee754_read(buffer, offset, isLE, mLen, nBytes) {\r\n var e, m,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n nBits = -7,\r\n i = isLE ? (nBytes - 1) : 0,\r\n d = isLE ? -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\n /**\r\n * Writes an IEEE754 float to a byte array.\r\n * @param {!Array} buffer\r\n * @param {number} value\r\n * @param {number} offset\r\n * @param {boolean} isLE\r\n * @param {number} mLen\r\n * @param {number} nBytes\r\n * @inner\r\n */\r\n function ieee754_write(buffer, value, offset, isLE, 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 = isLE ? 0 : (nBytes - 1),\r\n d = isLE ? 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\r\n /**\r\n * Writes a 32bit float.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeFloat32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number')\r\n throw TypeError(\"Illegal value: \"+value+\" (not a number)\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 4;\n var capacity8 = this.buffer.byteLength;\n if (offset > capacity8)\n this.resize((capacity8 *= 2) > offset ? capacity8 : offset);\n offset -= 4;\n ieee754_write(this.view, value, offset, this.littleEndian, 23, 4);\r\n if (relative) this.offset += 4;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 32bit float. This is an alias of {@link ByteBuffer#writeFloat32}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;\r\n\r\n /**\r\n * Reads a 32bit float.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readFloat32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4);\r\n if (relative) this.offset += 4;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 32bit float. This is an alias of {@link ByteBuffer#readFloat32}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;\r\n\r\n // types/floats/float64\r\n\r\n /**\r\n * Writes a 64bit float.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeFloat64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number')\r\n throw TypeError(\"Illegal value: \"+value+\" (not a number)\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 8;\n var capacity9 = this.buffer.byteLength;\n if (offset > capacity9)\n this.resize((capacity9 *= 2) > offset ? capacity9 : offset);\n offset -= 8;\n ieee754_write(this.view, value, offset, this.littleEndian, 52, 8);\r\n if (relative) this.offset += 8;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 64bit float. This is an alias of {@link ByteBuffer#writeFloat64}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;\r\n\r\n /**\r\n * Reads a 64bit float.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readFloat64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 8 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n }\r\n var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8);\r\n if (relative) this.offset += 8;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 64bit float. This is an alias of {@link ByteBuffer#readFloat64}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;\r\n\r\n\r\n // types/varints/varint32\r\n\r\n /**\r\n * Maximum number of bytes required to store a 32bit base 128 variable-length integer.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.MAX_VARINT32_BYTES = 5;\r\n\r\n /**\r\n * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.\r\n * @param {number} value Value to encode\r\n * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT32_BYTES}\r\n * @expose\r\n */\r\n ByteBuffer.calculateVarint32 = function(value) {\r\n // ref: src/google/protobuf/io/coded_stream.cc\r\n value = value >>> 0;\r\n if (value < 1 << 7 ) return 1;\r\n else if (value < 1 << 14) return 2;\r\n else if (value < 1 << 21) return 3;\r\n else if (value < 1 << 28) return 4;\r\n else return 5;\r\n };\r\n\r\n /**\r\n * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding.\r\n * @param {number} n Signed 32bit integer\r\n * @returns {number} Unsigned zigzag encoded 32bit integer\r\n * @expose\r\n */\r\n ByteBuffer.zigZagEncode32 = function(n) {\r\n return (((n |= 0) << 1) ^ (n >> 31)) >>> 0; // ref: src/google/protobuf/wire_format_lite.h\r\n };\r\n\r\n /**\r\n * Decodes a zigzag encoded signed 32bit integer.\r\n * @param {number} n Unsigned zigzag encoded 32bit integer\r\n * @returns {number} Signed 32bit integer\r\n * @expose\r\n */\r\n ByteBuffer.zigZagDecode32 = function(n) {\r\n return ((n >>> 1) ^ -(n & 1)) | 0; // // ref: src/google/protobuf/wire_format_lite.h\r\n };\r\n\r\n /**\r\n * Writes a 32bit base 128 variable-length integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var size = ByteBuffer.calculateVarint32(value),\r\n b;\r\n offset += size;\n var capacity10 = this.buffer.byteLength;\n if (offset > capacity10)\n this.resize((capacity10 *= 2) > offset ? capacity10 : offset);\n offset -= size;\n value >>>= 0;\r\n while (value >= 0x80) {\r\n b = (value & 0x7f) | 0x80;\r\n this.view[offset++] = b;\r\n value >>>= 7;\r\n }\r\n this.view[offset++] = value;\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return size;\r\n };\r\n\r\n /**\r\n * Writes a zig-zag encoded (signed) 32bit base 128 variable-length integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {\r\n return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);\r\n };\r\n\r\n /**\r\n * Reads a 32bit base 128 variable-length integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read\r\n * and the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint. Has a property `truncated = true` if there is not enough data available\r\n * to fully decode the varint.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var c = 0,\r\n value = 0 >>> 0,\r\n b;\r\n do {\r\n if (!this.noAssert && offset > this.limit) {\r\n var err = Error(\"Truncated\");\r\n err['truncated'] = true;\r\n throw err;\r\n }\r\n b = this.view[offset++];\r\n if (c < 5)\r\n value |= (b & 0x7f) << (7*c);\r\n ++c;\r\n } while ((b & 0x80) !== 0);\r\n value |= 0;\r\n if (relative) {\r\n this.offset = offset;\r\n return value;\r\n }\r\n return {\r\n \"value\": value,\r\n \"length\": c\r\n };\r\n };\r\n\r\n /**\r\n * Reads a zig-zag encoded (signed) 32bit base 128 variable-length integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read\r\n * and the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint32ZigZag = function(offset) {\r\n var val = this.readVarint32(offset);\r\n if (typeof val === 'object')\r\n val[\"value\"] = ByteBuffer.zigZagDecode32(val[\"value\"]);\r\n else\r\n val = ByteBuffer.zigZagDecode32(val);\r\n return val;\r\n };\r\n\r\n // types/varints/varint64\r\n\r\n if (Long) {\r\n\r\n /**\r\n * Maximum number of bytes required to store a 64bit base 128 variable-length integer.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.MAX_VARINT64_BYTES = 10;\r\n\r\n /**\r\n * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.\r\n * @param {number|!Long} value Value to encode\r\n * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT64_BYTES}\r\n * @expose\r\n */\r\n ByteBuffer.calculateVarint64 = function(value) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n // ref: src/google/protobuf/io/coded_stream.cc\r\n var part0 = value.toInt() >>> 0,\r\n part1 = value.shiftRightUnsigned(28).toInt() >>> 0,\r\n part2 = value.shiftRightUnsigned(56).toInt() >>> 0;\r\n if (part2 == 0) {\r\n if (part1 == 0) {\r\n if (part0 < 1 << 14)\r\n return part0 < 1 << 7 ? 1 : 2;\r\n else\r\n return part0 < 1 << 21 ? 3 : 4;\r\n } else {\r\n if (part1 < 1 << 14)\r\n return part1 < 1 << 7 ? 5 : 6;\r\n else\r\n return part1 < 1 << 21 ? 7 : 8;\r\n }\r\n } else\r\n return part2 < 1 << 7 ? 9 : 10;\r\n };\r\n\r\n /**\r\n * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding.\r\n * @param {number|!Long} value Signed long\r\n * @returns {!Long} Unsigned zigzag encoded long\r\n * @expose\r\n */\r\n ByteBuffer.zigZagEncode64 = function(value) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value, false);\n else if (typeof value === 'string')\n value = Long.fromString(value, false);\n else if (value.unsigned !== false) value = value.toSigned();\n // ref: src/google/protobuf/wire_format_lite.h\r\n return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();\r\n };\r\n\r\n /**\r\n * Decodes a zigzag encoded signed 64bit integer.\r\n * @param {!Long|number} value Unsigned zigzag encoded long or JavaScript number\r\n * @returns {!Long} Signed long\r\n * @expose\r\n */\r\n ByteBuffer.zigZagDecode64 = function(value) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value, false);\n else if (typeof value === 'string')\n value = Long.fromString(value, false);\n else if (value.unsigned !== false) value = value.toSigned();\n // ref: src/google/protobuf/wire_format_lite.h\r\n return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();\r\n };\r\n\r\n /**\r\n * Writes a 64bit base 128 variable-length integer.\r\n * @param {number|Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n else if (!(value && value instanceof Long))\n throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (typeof value === 'number')\n value = Long.fromNumber(value, false);\n else if (typeof value === 'string')\n value = Long.fromString(value, false);\n else if (value.unsigned !== false) value = value.toSigned();\n var size = ByteBuffer.calculateVarint64(value),\r\n part0 = value.toInt() >>> 0,\r\n part1 = value.shiftRightUnsigned(28).toInt() >>> 0,\r\n part2 = value.shiftRightUnsigned(56).toInt() >>> 0;\r\n offset += size;\n var capacity11 = this.buffer.byteLength;\n if (offset > capacity11)\n this.resize((capacity11 *= 2) > offset ? capacity11 : offset);\n offset -= size;\n switch (size) {\r\n case 10: this.view[offset+9] = (part2 >>> 7) & 0x01;\r\n case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F;\r\n case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F;\r\n case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F;\r\n case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F;\r\n case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F;\r\n case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F;\r\n case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F;\r\n case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F;\r\n case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F;\r\n }\r\n if (relative) {\r\n this.offset += size;\r\n return this;\r\n } else {\r\n return size;\r\n }\r\n };\r\n\r\n /**\r\n * Writes a zig-zag encoded 64bit base 128 variable-length integer.\r\n * @param {number|Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {\r\n return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);\r\n };\r\n\r\n /**\r\n * Reads a 64bit base 128 variable-length integer. Requires Long.js.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and\r\n * the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n // ref: src/google/protobuf/io/coded_stream.cc\r\n var start = offset,\r\n part0 = 0,\r\n part1 = 0,\r\n part2 = 0,\r\n b = 0;\r\n b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) {\r\n b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n throw Error(\"Buffer overrun\"); }}}}}}}}}}\r\n var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false);\r\n if (relative) {\r\n this.offset = offset;\r\n return value;\r\n } else {\r\n return {\r\n 'value': value,\r\n 'length': offset-start\r\n };\r\n }\r\n };\r\n\r\n /**\r\n * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and\r\n * the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint64ZigZag = function(offset) {\r\n var val = this.readVarint64(offset);\r\n if (val && val['value'] instanceof Long)\r\n val[\"value\"] = ByteBuffer.zigZagDecode64(val[\"value\"]);\r\n else\r\n val = ByteBuffer.zigZagDecode64(val);\r\n return val;\r\n };\r\n\r\n } // Long\r\n\r\n\r\n // types/strings/cstring\r\n\r\n /**\r\n * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL\r\n * characters itself.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * contained in `str` + 1 if omitted.\r\n * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeCString = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n var i,\r\n k = str.length;\r\n if (!this.noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n for (i=0; i>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n // UTF8 strings do not contain zero bytes in between except for the zero character, so:\r\n k = utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n offset += k+1;\n var capacity12 = this.buffer.byteLength;\n if (offset > capacity12)\n this.resize((capacity12 *= 2) > offset ? capacity12 : offset);\n offset -= k+1;\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n this.view[offset++] = 0;\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return k;\r\n };\r\n\r\n /**\r\n * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters\r\n * itself.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readCString = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset,\r\n temp;\r\n // UTF8 strings do not contain zero bytes in between except for the zero character itself, so:\r\n var sd, b = -1;\r\n utfx.decodeUTF8toUTF16(function() {\r\n if (b === 0) return null;\r\n if (offset >= this.limit)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" < \"+this.limit);\r\n b = this.view[offset++];\r\n return b === 0 ? null : b;\r\n }.bind(this), sd = stringDestination(), true);\r\n if (relative) {\r\n this.offset = offset;\r\n return sd();\r\n } else {\r\n return {\r\n \"string\": sd(),\r\n \"length\": offset - start\r\n };\r\n }\r\n };\r\n\r\n // types/strings/istring\r\n\r\n /**\r\n * Writes a length as uint32 prefixed UTF8 encoded string.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n * @see ByteBuffer#writeVarint32\r\n */\r\n ByteBufferPrototype.writeIString = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset,\r\n k;\r\n k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];\r\n offset += 4+k;\n var capacity13 = this.buffer.byteLength;\n if (offset > capacity13)\n this.resize((capacity13 *= 2) > offset ? capacity13 : offset);\n offset -= 4+k;\n if (this.littleEndian) {\n this.view[offset+3] = (k >>> 24) & 0xFF;\n this.view[offset+2] = (k >>> 16) & 0xFF;\n this.view[offset+1] = (k >>> 8) & 0xFF;\n this.view[offset ] = k & 0xFF;\n } else {\n this.view[offset ] = (k >>> 24) & 0xFF;\n this.view[offset+1] = (k >>> 16) & 0xFF;\n this.view[offset+2] = (k >>> 8) & 0xFF;\n this.view[offset+3] = k & 0xFF;\n }\n offset += 4;\r\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n if (offset !== start + 4 + k)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+(offset+4+k));\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n };\r\n\r\n /**\r\n * Reads a length as uint32 prefixed UTF8 encoded string.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n * @see ByteBuffer#readVarint32\r\n */\r\n ByteBufferPrototype.readIString = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset;\r\n var len = this.readUint32(offset);\r\n var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4);\r\n offset += str['length'];\r\n if (relative) {\r\n this.offset = offset;\r\n return str['string'];\r\n } else {\r\n return {\r\n 'string': str['string'],\r\n 'length': offset - start\r\n };\r\n }\r\n };\r\n\r\n // types/strings/utf8string\r\n\r\n /**\r\n * Metrics representing number of UTF8 characters. Evaluates to `c`.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.METRICS_CHARS = 'c';\r\n\r\n /**\r\n * Metrics representing number of bytes. Evaluates to `b`.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.METRICS_BYTES = 'b';\r\n\r\n /**\r\n * Writes an UTF8 encoded string.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.\r\n * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUTF8String = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var k;\r\n var start = offset;\r\n k = utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n offset += k;\n var capacity14 = this.buffer.byteLength;\n if (offset > capacity14)\n this.resize((capacity14 *= 2) > offset ? capacity14 : offset);\n offset -= k;\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n };\r\n\r\n /**\r\n * Writes an UTF8 encoded string. This is an alias of {@link ByteBuffer#writeUTF8String}.\r\n * @function\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.\r\n * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;\r\n\r\n /**\r\n * Calculates the number of UTF8 characters of a string. JavaScript itself uses UTF-16, so that a string's\r\n * `length` property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF.\r\n * @param {string} str String to calculate\r\n * @returns {number} Number of UTF8 characters\r\n * @expose\r\n */\r\n ByteBuffer.calculateUTF8Chars = function(str) {\r\n return utfx.calculateUTF16asUTF8(stringSource(str))[0];\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 bytes of a string.\r\n * @param {string} str String to calculate\r\n * @returns {number} Number of UTF8 bytes\r\n * @expose\r\n */\r\n ByteBuffer.calculateUTF8Bytes = function(str) {\r\n return utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 bytes of a string. This is an alias of {@link ByteBuffer.calculateUTF8Bytes}.\r\n * @function\r\n * @param {string} str String to calculate\r\n * @returns {number} Number of UTF8 bytes\r\n * @expose\r\n */\r\n ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes;\r\n\r\n /**\r\n * Reads an UTF8 encoded string.\r\n * @param {number} length Number of characters or bytes to read.\r\n * @param {string=} metrics Metrics specifying what `length` is meant to count. Defaults to\r\n * {@link ByteBuffer.METRICS_CHARS}.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {\r\n if (typeof metrics === 'number') {\r\n offset = metrics;\r\n metrics = undefined;\r\n }\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS;\r\n if (!this.noAssert) {\r\n if (typeof length !== 'number' || length % 1 !== 0)\n throw TypeError(\"Illegal length: \"+length+\" (not an integer)\");\n length |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var i = 0,\r\n start = offset,\r\n sd;\r\n if (metrics === ByteBuffer.METRICS_CHARS) { // The same for node and the browser\r\n sd = stringDestination();\r\n utfx.decodeUTF8(function() {\r\n return i < length && offset < this.limit ? this.view[offset++] : null;\r\n }.bind(this), function(cp) {\r\n ++i; utfx.UTF8toUTF16(cp, sd);\r\n });\r\n if (i !== length)\r\n throw RangeError(\"Illegal range: Truncated data, \"+i+\" == \"+length);\r\n if (relative) {\r\n this.offset = offset;\r\n return sd();\r\n } else {\r\n return {\r\n \"string\": sd(),\r\n \"length\": offset - start\r\n };\r\n }\r\n } else if (metrics === ByteBuffer.METRICS_BYTES) {\r\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + length > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+length+\") <= \"+this.buffer.byteLength);\n }\r\n var k = offset + length;\r\n utfx.decodeUTF8toUTF16(function() {\r\n return offset < k ? this.view[offset++] : null;\r\n }.bind(this), sd = stringDestination(), this.noAssert);\r\n if (offset !== k)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+k);\r\n if (relative) {\r\n this.offset = offset;\r\n return sd();\r\n } else {\r\n return {\r\n 'string': sd(),\r\n 'length': offset - start\r\n };\r\n }\r\n } else\r\n throw TypeError(\"Unsupported metrics: \"+metrics);\r\n };\r\n\r\n /**\r\n * Reads an UTF8 encoded string. This is an alias of {@link ByteBuffer#readUTF8String}.\r\n * @function\r\n * @param {number} length Number of characters or bytes to read\r\n * @param {number=} metrics Metrics specifying what `n` is meant to count. Defaults to\r\n * {@link ByteBuffer.METRICS_CHARS}.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;\r\n\r\n // types/strings/vstring\r\n\r\n /**\r\n * Writes a length as varint32 prefixed UTF8 encoded string.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n * @see ByteBuffer#writeVarint32\r\n */\r\n ByteBufferPrototype.writeVString = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset,\r\n k, l;\r\n k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];\r\n l = ByteBuffer.calculateVarint32(k);\r\n offset += l+k;\n var capacity15 = this.buffer.byteLength;\n if (offset > capacity15)\n this.resize((capacity15 *= 2) > offset ? capacity15 : offset);\n offset -= l+k;\n offset += this.writeVarint32(k, offset);\r\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n if (offset !== start+k+l)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+(offset+k+l));\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n };\r\n\r\n /**\r\n * Reads a length as varint32 prefixed UTF8 encoded string.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n * @see ByteBuffer#readVarint32\r\n */\r\n ByteBufferPrototype.readVString = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset;\r\n var len = this.readVarint32(offset);\r\n var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']);\r\n offset += str['length'];\r\n if (relative) {\r\n this.offset = offset;\r\n return str['string'];\r\n } else {\r\n return {\r\n 'string': str['string'],\r\n 'length': offset - start\r\n };\r\n }\r\n };\r\n\r\n\r\n /**\r\n * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended\r\n * data's length.\r\n * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to append. If `source` is a ByteBuffer, its offsets\r\n * will be modified according to the performed read operation.\r\n * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n * @param {number=} offset Offset to append at. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @example A relative `<01 02>03.append(<04 05>)` will result in `<01 02 04 05>, 04 05|`\r\n * @example An absolute `<01 02>03.append(04 05>, 1)` will result in `<01 04>05, 04 05|`\r\n */\r\n ByteBufferPrototype.append = function(source, encoding, offset) {\r\n if (typeof encoding === 'number' || typeof encoding !== 'string') {\r\n offset = encoding;\r\n encoding = undefined;\r\n }\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (!(source instanceof ByteBuffer))\r\n source = ByteBuffer.wrap(source, encoding);\r\n var length = source.limit - source.offset;\r\n if (length <= 0) return this; // Nothing to append\r\n offset += length;\n var capacity16 = this.buffer.byteLength;\n if (offset > capacity16)\n this.resize((capacity16 *= 2) > offset ? capacity16 : offset);\n offset -= length;\n this.view.set(source.view.subarray(source.offset, source.limit), offset);\r\n source.offset += length;\r\n if (relative) this.offset += length;\n return this;\r\n };\r\n\r\n /**\r\n * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the\r\n specified offset up to the length of this ByteBuffer's data.\r\n * @param {!ByteBuffer} target Target ByteBuffer\r\n * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @see ByteBuffer#append\r\n */\r\n ByteBufferPrototype.appendTo = function(target, offset) {\r\n target.append(this, offset);\r\n return this;\r\n };\r\n\r\n /**\r\n * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to\r\n * disable them if your code already makes sure that everything is valid.\r\n * @param {boolean} assert `true` to enable assertions, otherwise `false`\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.assert = function(assert) {\r\n this.noAssert = !assert;\r\n return this;\r\n };\r\n\r\n /**\r\n * Gets the capacity of this ByteBuffer's backing buffer.\r\n * @returns {number} Capacity of the backing buffer\r\n * @expose\r\n */\r\n ByteBufferPrototype.capacity = function() {\r\n return this.buffer.byteLength;\r\n };\r\n /**\r\n * Clears this ByteBuffer's offsets by setting {@link ByteBuffer#offset} to `0` and {@link ByteBuffer#limit} to the\r\n * backing buffer's capacity. Discards {@link ByteBuffer#markedOffset}.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.clear = function() {\r\n this.offset = 0;\r\n this.limit = this.buffer.byteLength;\r\n this.markedOffset = -1;\r\n return this;\r\n };\r\n\r\n /**\r\n * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for {@link ByteBuffer#offset},\r\n * {@link ByteBuffer#markedOffset} and {@link ByteBuffer#limit}.\r\n * @param {boolean=} copy Whether to copy the backing buffer or to return another view on the same, defaults to `false`\r\n * @returns {!ByteBuffer} Cloned instance\r\n * @expose\r\n */\r\n ByteBufferPrototype.clone = function(copy) {\r\n var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);\r\n if (copy) {\r\n bb.buffer = new ArrayBuffer(this.buffer.byteLength);\r\n bb.view = new Uint8Array(bb.buffer);\r\n } else {\r\n bb.buffer = this.buffer;\r\n bb.view = this.view;\r\n }\r\n bb.offset = this.offset;\r\n bb.markedOffset = this.markedOffset;\r\n bb.limit = this.limit;\r\n return bb;\r\n };\r\n\r\n /**\r\n * Compacts this ByteBuffer to be backed by a {@link ByteBuffer#buffer} of its contents' length. Contents are the bytes\r\n * between {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will set `offset = 0` and `limit = capacity` and\r\n * adapt {@link ByteBuffer#markedOffset} to the same relative position if set.\r\n * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.compact = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin === 0 && end === this.buffer.byteLength)\r\n return this; // Already compacted\r\n var len = end - begin;\r\n if (len === 0) {\r\n this.buffer = EMPTY_BUFFER;\r\n this.view = null;\r\n if (this.markedOffset >= 0) this.markedOffset -= begin;\r\n this.offset = 0;\r\n this.limit = 0;\r\n return this;\r\n }\r\n var buffer = new ArrayBuffer(len);\r\n var view = new Uint8Array(buffer);\r\n view.set(this.view.subarray(begin, end));\r\n this.buffer = buffer;\r\n this.view = view;\r\n if (this.markedOffset >= 0) this.markedOffset -= begin;\r\n this.offset = 0;\r\n this.limit = len;\r\n return this;\r\n };\r\n\r\n /**\r\n * Creates a copy of this ByteBuffer's contents. Contents are the bytes between {@link ByteBuffer#offset} and\r\n * {@link ByteBuffer#limit}.\r\n * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n * @returns {!ByteBuffer} Copy\r\n * @expose\r\n */\r\n ByteBufferPrototype.copy = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin === end)\r\n return new ByteBuffer(0, this.littleEndian, this.noAssert);\r\n var capacity = end - begin,\r\n bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);\r\n bb.offset = 0;\r\n bb.limit = capacity;\r\n if (bb.markedOffset >= 0) bb.markedOffset -= begin;\r\n this.copyTo(bb, 0, begin, end);\r\n return bb;\r\n };\r\n\r\n /**\r\n * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between {@link ByteBuffer#offset} and\r\n * {@link ByteBuffer#limit}.\r\n * @param {!ByteBuffer} target Target ByteBuffer\r\n * @param {number=} targetOffset Offset to copy to. Will use and increase the target's {@link ByteBuffer#offset}\r\n * by the number of bytes copied if omitted.\r\n * @param {number=} sourceOffset Offset to start copying from. Will use and increase {@link ByteBuffer#offset} by the\r\n * number of bytes copied if omitted.\r\n * @param {number=} sourceLimit Offset to end copying from, defaults to {@link ByteBuffer#limit}\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {\r\n var relative,\r\n targetRelative;\r\n if (!this.noAssert) {\r\n if (!ByteBuffer.isByteBuffer(target))\r\n throw TypeError(\"Illegal target: Not a ByteBuffer\");\r\n }\r\n targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0;\r\n sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0;\r\n sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0;\r\n\r\n if (targetOffset < 0 || targetOffset > target.buffer.byteLength)\r\n throw RangeError(\"Illegal target range: 0 <= \"+targetOffset+\" <= \"+target.buffer.byteLength);\r\n if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength)\r\n throw RangeError(\"Illegal source range: 0 <= \"+sourceOffset+\" <= \"+this.buffer.byteLength);\r\n\r\n var len = sourceLimit - sourceOffset;\r\n if (len === 0)\r\n return target; // Nothing to copy\r\n\r\n target.ensureCapacity(targetOffset + len);\r\n\r\n target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset);\r\n\r\n if (relative) this.offset += len;\r\n if (targetRelative) target.offset += len;\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Makes sure that this ByteBuffer is backed by a {@link ByteBuffer#buffer} of at least the specified capacity. If the\r\n * current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity,\r\n * the required capacity will be used instead.\r\n * @param {number} capacity Required capacity\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.ensureCapacity = function(capacity) {\r\n var current = this.buffer.byteLength;\r\n if (current < capacity)\r\n return this.resize((current *= 2) > capacity ? current : capacity);\r\n return this;\r\n };\r\n\r\n /**\r\n * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between\r\n * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}.\r\n * @param {number|string} value Byte value to fill with. If given as a string, the first character is used.\r\n * @param {number=} begin Begin offset. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted. defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @example `someByteBuffer.clear().fill(0)` fills the entire backing buffer with zeroes\r\n */\r\n ByteBufferPrototype.fill = function(value, begin, end) {\r\n var relative = typeof begin === 'undefined';\n if (relative) begin = this.offset;\n if (typeof value === 'string' && value.length > 0)\r\n value = value.charCodeAt(0);\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin >= end)\r\n return this; // Nothing to fill\r\n while (begin < end) this.view[begin++] = value;\r\n if (relative) this.offset = begin;\r\n return this;\r\n };\r\n\r\n /**\r\n * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets `limit = offset` and\r\n * `offset = 0`. Make sure always to flip a ByteBuffer when all relative read or write operations are complete.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.flip = function() {\r\n this.limit = this.offset;\r\n this.offset = 0;\r\n return this;\r\n };\r\n /**\r\n * Marks an offset on this ByteBuffer to be used later.\r\n * @param {number=} offset Offset to mark. Defaults to {@link ByteBuffer#offset}.\r\n * @returns {!ByteBuffer} this\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @see ByteBuffer#reset\r\n * @expose\r\n */\r\n ByteBufferPrototype.mark = function(offset) {\r\n offset = typeof offset === 'undefined' ? this.offset : offset;\r\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n this.markedOffset = offset;\r\n return this;\r\n };\r\n /**\r\n * Sets the byte order.\r\n * @param {boolean} littleEndian `true` for little endian byte order, `false` for big endian\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.order = function(littleEndian) {\r\n if (!this.noAssert) {\r\n if (typeof littleEndian !== 'boolean')\r\n throw TypeError(\"Illegal littleEndian: Not a boolean\");\r\n }\r\n this.littleEndian = !!littleEndian;\r\n return this;\r\n };\r\n\r\n /**\r\n * Switches (to) little endian byte order.\r\n * @param {boolean=} littleEndian Defaults to `true`, otherwise uses big endian\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.LE = function(littleEndian) {\r\n this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true;\r\n return this;\r\n };\r\n\r\n /**\r\n * Switches (to) big endian byte order.\r\n * @param {boolean=} bigEndian Defaults to `true`, otherwise uses little endian\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.BE = function(bigEndian) {\r\n this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false;\r\n return this;\r\n };\r\n /**\r\n * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the\r\n * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer\r\n * will be resized and its contents moved accordingly.\r\n * @param {!ByteBuffer|string|!ArrayBuffer} source Data to prepend. If `source` is a ByteBuffer, its offset will be\r\n * modified according to the performed read operation.\r\n * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes\r\n * prepended if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @example A relative `00<01 02 03>.prepend(<04 05>)` results in `<04 05 01 02 03>, 04 05|`\r\n * @example An absolute `00<01 02 03>.prepend(<04 05>, 2)` results in `04<05 02 03>, 04 05|`\r\n */\r\n ByteBufferPrototype.prepend = function(source, encoding, offset) {\r\n if (typeof encoding === 'number' || typeof encoding !== 'string') {\r\n offset = encoding;\r\n encoding = undefined;\r\n }\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (!(source instanceof ByteBuffer))\r\n source = ByteBuffer.wrap(source, encoding);\r\n var len = source.limit - source.offset;\r\n if (len <= 0) return this; // Nothing to prepend\r\n var diff = len - offset;\r\n if (diff > 0) { // Not enough space before offset, so resize + move\r\n var buffer = new ArrayBuffer(this.buffer.byteLength + diff);\r\n var view = new Uint8Array(buffer);\r\n view.set(this.view.subarray(offset, this.buffer.byteLength), len);\r\n this.buffer = buffer;\r\n this.view = view;\r\n this.offset += diff;\r\n if (this.markedOffset >= 0) this.markedOffset += diff;\r\n this.limit += diff;\r\n offset += diff;\r\n } else {\r\n var arrayView = new Uint8Array(this.buffer);\r\n }\r\n this.view.set(source.view.subarray(source.offset, source.limit), offset - len);\r\n\r\n source.offset = source.limit;\r\n if (relative)\r\n this.offset -= len;\r\n return this;\r\n };\r\n\r\n /**\r\n * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the\r\n * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer\r\n * will be resized and its contents moved accordingly.\r\n * @param {!ByteBuffer} target Target ByteBuffer\r\n * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes\r\n * prepended if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @see ByteBuffer#prepend\r\n */\r\n ByteBufferPrototype.prependTo = function(target, offset) {\r\n target.prepend(this, offset);\r\n return this;\r\n };\r\n /**\r\n * Prints debug information about this ByteBuffer's contents.\r\n * @param {function(string)=} out Output function to call, defaults to console.log\r\n * @expose\r\n */\r\n ByteBufferPrototype.printDebug = function(out) {\r\n if (typeof out !== 'function') out = console.log.bind(console);\r\n out(\r\n this.toString()+\"\\n\"+\r\n \"-------------------------------------------------------------------\\n\"+\r\n this.toDebug(/* columns */ true)\r\n );\r\n };\r\n\r\n /**\r\n * Gets the number of remaining readable bytes. Contents are the bytes between {@link ByteBuffer#offset} and\r\n * {@link ByteBuffer#limit}, so this returns `limit - offset`.\r\n * @returns {number} Remaining readable bytes. May be negative if `offset > limit`.\r\n * @expose\r\n */\r\n ByteBufferPrototype.remaining = function() {\r\n return this.limit - this.offset;\r\n };\r\n /**\r\n * Resets this ByteBuffer's {@link ByteBuffer#offset}. If an offset has been marked through {@link ByteBuffer#mark}\r\n * before, `offset` will be set to {@link ByteBuffer#markedOffset}, which will then be discarded. If no offset has been\r\n * marked, sets `offset = 0`.\r\n * @returns {!ByteBuffer} this\r\n * @see ByteBuffer#mark\r\n * @expose\r\n */\r\n ByteBufferPrototype.reset = function() {\r\n if (this.markedOffset >= 0) {\r\n this.offset = this.markedOffset;\r\n this.markedOffset = -1;\r\n } else {\r\n this.offset = 0;\r\n }\r\n return this;\r\n };\r\n /**\r\n * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that\r\n * large or larger.\r\n * @param {number} capacity Capacity required\r\n * @returns {!ByteBuffer} this\r\n * @throws {TypeError} If `capacity` is not a number\r\n * @throws {RangeError} If `capacity < 0`\r\n * @expose\r\n */\r\n ByteBufferPrototype.resize = function(capacity) {\r\n if (!this.noAssert) {\r\n if (typeof capacity !== 'number' || capacity % 1 !== 0)\n throw TypeError(\"Illegal capacity: \"+capacity+\" (not an integer)\");\n capacity |= 0;\n if (capacity < 0)\r\n throw RangeError(\"Illegal capacity: 0 <= \"+capacity);\r\n }\r\n if (this.buffer.byteLength < capacity) {\r\n var buffer = new ArrayBuffer(capacity);\r\n var view = new Uint8Array(buffer);\r\n view.set(this.view);\r\n this.buffer = buffer;\r\n this.view = view;\r\n }\r\n return this;\r\n };\r\n /**\r\n * Reverses this ByteBuffer's contents.\r\n * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.reverse = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin === end)\r\n return this; // Nothing to reverse\r\n Array.prototype.reverse.call(this.view.subarray(begin, end));\r\n return this;\r\n };\r\n /**\r\n * Skips the next `length` bytes. This will just advance\r\n * @param {number} length Number of bytes to skip. May also be negative to move the offset back.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.skip = function(length) {\r\n if (!this.noAssert) {\r\n if (typeof length !== 'number' || length % 1 !== 0)\n throw TypeError(\"Illegal length: \"+length+\" (not an integer)\");\n length |= 0;\n }\r\n var offset = this.offset + length;\r\n if (!this.noAssert) {\r\n if (offset < 0 || offset > this.buffer.byteLength)\r\n throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+length+\" <= \"+this.buffer.byteLength);\r\n }\r\n this.offset = offset;\r\n return this;\r\n };\r\n\r\n /**\r\n * Slices this ByteBuffer by creating a cloned instance with `offset = begin` and `limit = end`.\r\n * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n * @returns {!ByteBuffer} Clone of this ByteBuffer with slicing applied, backed by the same {@link ByteBuffer#buffer}\r\n * @expose\r\n */\r\n ByteBufferPrototype.slice = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n var bb = this.clone();\r\n bb.offset = begin;\r\n bb.limit = end;\r\n return bb;\r\n };\r\n /**\r\n * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between\r\n * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}.\r\n * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory if\r\n * possible. Defaults to `false`\r\n * @returns {!ArrayBuffer} Contents as an ArrayBuffer\r\n * @expose\r\n */\r\n ByteBufferPrototype.toBuffer = function(forceCopy) {\r\n var offset = this.offset,\r\n limit = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: Not an integer\");\n offset >>>= 0;\n if (typeof limit !== 'number' || limit % 1 !== 0)\n throw TypeError(\"Illegal limit: Not an integer\");\n limit >>>= 0;\n if (offset < 0 || offset > limit || limit > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+offset+\" <= \"+limit+\" <= \"+this.buffer.byteLength);\n }\r\n // NOTE: It's not possible to have another ArrayBuffer reference the same memory as the backing buffer. This is\r\n // possible with Uint8Array#subarray only, but we have to return an ArrayBuffer by contract. So:\r\n if (!forceCopy && offset === 0 && limit === this.buffer.byteLength)\r\n return this.buffer;\r\n if (offset === limit)\r\n return EMPTY_BUFFER;\r\n var buffer = new ArrayBuffer(limit - offset);\r\n new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);\r\n return buffer;\r\n };\r\n\r\n /**\r\n * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between\r\n * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. This is an alias of {@link ByteBuffer#toBuffer}.\r\n * @function\r\n * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory.\r\n * Defaults to `false`\r\n * @returns {!ArrayBuffer} Contents as an ArrayBuffer\r\n * @expose\r\n */\r\n ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;\r\n\r\n /**\r\n * Converts the ByteBuffer's contents to a string.\r\n * @param {string=} encoding Output encoding. Returns an informative string representation if omitted but also allows\r\n * direct conversion to \"utf8\", \"hex\", \"base64\" and \"binary\" encoding. \"debug\" returns a hex representation with\r\n * highlighted offsets.\r\n * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n * @returns {string} String representation\r\n * @throws {Error} If `encoding` is invalid\r\n * @expose\r\n */\r\n ByteBufferPrototype.toString = function(encoding, begin, end) {\r\n if (typeof encoding === 'undefined')\r\n return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";\r\n if (typeof encoding === 'number')\r\n encoding = \"utf8\",\r\n begin = encoding,\r\n end = begin;\r\n switch (encoding) {\r\n case \"utf8\":\r\n return this.toUTF8(begin, end);\r\n case \"base64\":\r\n return this.toBase64(begin, end);\r\n case \"hex\":\r\n return this.toHex(begin, end);\r\n case \"binary\":\r\n return this.toBinary(begin, end);\r\n case \"debug\":\r\n return this.toDebug();\r\n case \"columns\":\r\n return this.toColumns();\r\n default:\r\n throw Error(\"Unsupported encoding: \"+encoding);\r\n }\r\n };\r\n\r\n // lxiv-embeddable\r\n\r\n /**\r\n * lxiv-embeddable (c) 2014 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/lxiv for details\r\n */\r\n var lxiv = function() {\r\n \"use strict\";\r\n\r\n /**\r\n * lxiv namespace.\r\n * @type {!Object.}\r\n * @exports lxiv\r\n */\r\n var lxiv = {};\r\n\r\n /**\r\n * Character codes for output.\r\n * @type {!Array.}\r\n * @inner\r\n */\r\n var aout = [\r\n 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\r\n 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,\r\n 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\r\n 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\r\n ];\r\n\r\n /**\r\n * Character codes for input.\r\n * @type {!Array.}\r\n * @inner\r\n */\r\n var ain = [];\r\n for (var i=0, k=aout.length; i>2)&0x3f]);\r\n t = (b&0x3)<<4;\r\n if ((b = src()) !== null) {\r\n t |= (b>>4)&0xf;\r\n dst(aout[(t|((b>>4)&0xf))&0x3f]);\r\n t = (b&0xf)<<2;\r\n if ((b = src()) !== null)\r\n dst(aout[(t|((b>>6)&0x3))&0x3f]),\r\n dst(aout[b&0x3f]);\r\n else\r\n dst(aout[t&0x3f]),\r\n dst(61);\r\n } else\r\n dst(aout[t&0x3f]),\r\n dst(61),\r\n dst(61);\r\n }\r\n };\r\n\r\n /**\r\n * Decodes base64 char codes to bytes.\r\n * @param {!function():number|null} src Characters source as a function returning the next char code respectively\r\n * `null` if there are no more characters left.\r\n * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.\r\n * @throws {Error} If a character code is invalid\r\n */\r\n lxiv.decode = function(src, dst) {\r\n var c, t1, t2;\r\n function fail(c) {\r\n throw Error(\"Illegal character code: \"+c);\r\n }\r\n while ((c = src()) !== null) {\r\n t1 = ain[c];\r\n if (typeof t1 === 'undefined') fail(c);\r\n if ((c = src()) !== null) {\r\n t2 = ain[c];\r\n if (typeof t2 === 'undefined') fail(c);\r\n dst((t1<<2)>>>0|(t2&0x30)>>4);\r\n if ((c = src()) !== null) {\r\n t1 = ain[c];\r\n if (typeof t1 === 'undefined')\r\n if (c === 61) break; else fail(c);\r\n dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2);\r\n if ((c = src()) !== null) {\r\n t2 = ain[c];\r\n if (typeof t2 === 'undefined')\r\n if (c === 61) break; else fail(c);\r\n dst(((t1&0x3)<<6)>>>0|t2);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Tests if a string is valid base64.\r\n * @param {string} str String to test\r\n * @returns {boolean} `true` if valid, otherwise `false`\r\n */\r\n lxiv.test = function(str) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);\r\n };\r\n\r\n return lxiv;\r\n }();\r\n\r\n // encodings/base64\r\n\r\n /**\r\n * Encodes this ByteBuffer's contents to a base64 encoded string.\r\n * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}.\r\n * @returns {string} Base64 encoded string\r\n * @throws {RangeError} If `begin` or `end` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.toBase64 = function(begin, end) {\r\n if (typeof begin === 'undefined')\r\n begin = this.offset;\r\n if (typeof end === 'undefined')\r\n end = this.limit;\r\n begin = begin | 0; end = end | 0;\r\n if (begin < 0 || end > this.capacity || begin > end)\r\n throw RangeError(\"begin, end\");\r\n var sd; lxiv.encode(function() {\r\n return begin < end ? this.view[begin++] : null;\r\n }.bind(this), sd = stringDestination());\r\n return sd();\r\n };\r\n\r\n /**\r\n * Decodes a base64 encoded string to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromBase64 = function(str, littleEndian) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"str\");\r\n var bb = new ByteBuffer(str.length/4*3, littleEndian),\r\n i = 0;\r\n lxiv.decode(stringSource(str), function(b) {\r\n bb.view[i++] = b;\r\n });\r\n bb.limit = i;\r\n return bb;\r\n };\r\n\r\n /**\r\n * Encodes a binary string to base64 like `window.btoa` does.\r\n * @param {string} str Binary string\r\n * @returns {string} Base64 encoded string\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa\r\n * @expose\r\n */\r\n ByteBuffer.btoa = function(str) {\r\n return ByteBuffer.fromBinary(str).toBase64();\r\n };\r\n\r\n /**\r\n * Decodes a base64 encoded string to binary like `window.atob` does.\r\n * @param {string} b64 Base64 encoded string\r\n * @returns {string} Binary string\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.atob\r\n * @expose\r\n */\r\n ByteBuffer.atob = function(b64) {\r\n return ByteBuffer.fromBase64(b64).toBinary();\r\n };\r\n\r\n // encodings/binary\r\n\r\n /**\r\n * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes.\r\n * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}.\r\n * @returns {string} Binary encoded string\r\n * @throws {RangeError} If `offset > limit`\r\n * @expose\r\n */\r\n ByteBufferPrototype.toBinary = function(begin, end) {\r\n if (typeof begin === 'undefined')\r\n begin = this.offset;\r\n if (typeof end === 'undefined')\r\n end = this.limit;\r\n begin |= 0; end |= 0;\r\n if (begin < 0 || end > this.capacity() || begin > end)\r\n throw RangeError(\"begin, end\");\r\n if (begin === end)\r\n return \"\";\r\n var chars = [],\r\n parts = [];\r\n while (begin < end) {\r\n chars.push(this.view[begin++]);\r\n if (chars.length >= 1024)\r\n parts.push(String.fromCharCode.apply(String, chars)),\r\n chars = [];\r\n }\r\n return parts.join('') + String.fromCharCode.apply(String, chars);\r\n };\r\n\r\n /**\r\n * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromBinary = function(str, littleEndian) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"str\");\r\n var i = 0,\r\n k = str.length,\r\n charCode,\r\n bb = new ByteBuffer(k, littleEndian);\r\n while (i 0xff)\r\n throw RangeError(\"illegal char code: \"+charCode);\r\n bb.view[i++] = charCode;\r\n }\r\n bb.limit = k;\r\n return bb;\r\n };\r\n\r\n // encodings/debug\r\n\r\n /**\r\n * Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are:\r\n * * `<` : offset,\r\n * * `'` : markedOffset,\r\n * * `>` : limit,\r\n * * `|` : offset and limit,\r\n * * `[` : offset and markedOffset,\r\n * * `]` : markedOffset and limit,\r\n * * `!` : offset, markedOffset and limit\r\n * @param {boolean=} columns If `true` returns two columns hex + ascii, defaults to `false`\r\n * @returns {string|!Array.} Debug string or array of lines if `asArray = true`\r\n * @expose\r\n * @example `>00'01 02<03` contains four bytes with `limit=0, markedOffset=1, offset=3`\r\n * @example `00[01 02 03>` contains four bytes with `offset=markedOffset=1, limit=4`\r\n * @example `00|01 02 03` contains four bytes with `offset=limit=1, markedOffset=-1`\r\n * @example `|` contains zero bytes with `offset=limit=0, markedOffset=-1`\r\n */\r\n ByteBufferPrototype.toDebug = function(columns) {\r\n var i = -1,\r\n k = this.buffer.byteLength,\r\n b,\r\n hex = \"\",\r\n asc = \"\",\r\n out = \"\";\r\n while (i 32 && b < 127 ? String.fromCharCode(b) : '.';\r\n }\r\n ++i;\r\n if (columns) {\r\n if (i > 0 && i % 16 === 0 && i !== k) {\r\n while (hex.length < 3*16+3) hex += \" \";\r\n out += hex+asc+\"\\n\";\r\n hex = asc = \"\";\r\n }\r\n }\r\n if (i === this.offset && i === this.limit)\r\n hex += i === this.markedOffset ? \"!\" : \"|\";\r\n else if (i === this.offset)\r\n hex += i === this.markedOffset ? \"[\" : \"<\";\r\n else if (i === this.limit)\r\n hex += i === this.markedOffset ? \"]\" : \">\";\r\n else\r\n hex += i === this.markedOffset ? \"'\" : (columns || (i !== 0 && i !== k) ? \" \" : \"\");\r\n }\r\n if (columns && hex !== \" \") {\r\n while (hex.length < 3*16+3)\r\n hex += \" \";\r\n out += hex + asc + \"\\n\";\r\n }\r\n return columns ? out : hex;\r\n };\r\n\r\n /**\r\n * Decodes a hex encoded string with marked offsets to a ByteBuffer.\r\n * @param {string} str Debug string to decode (not be generated with `columns = true`)\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n * @see ByteBuffer#toDebug\r\n */\r\n ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {\r\n var k = str.length,\r\n bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert);\r\n var i = 0, j = 0, ch, b,\r\n rs = false, // Require symbol next\r\n ho = false, hm = false, hl = false, // Already has offset (ho), markedOffset (hm), limit (hl)?\r\n fail = false;\r\n while (i':\r\n if (!noAssert) {\r\n if (hl) {\r\n fail = true;\r\n break;\r\n }\r\n hl = true;\r\n }\r\n bb.limit = j;\r\n rs = false;\r\n break;\r\n case \"'\":\r\n if (!noAssert) {\r\n if (hm) {\r\n fail = true;\r\n break;\r\n }\r\n hm = true;\r\n }\r\n bb.markedOffset = j;\r\n rs = false;\r\n break;\r\n case ' ':\r\n rs = false;\r\n break;\r\n default:\r\n if (!noAssert) {\r\n if (rs) {\r\n fail = true;\r\n break;\r\n }\r\n }\r\n b = parseInt(ch+str.charAt(i++), 16);\r\n if (!noAssert) {\r\n if (isNaN(b) || b < 0 || b > 255)\r\n throw TypeError(\"Illegal str: Not a debug encoded string\");\r\n }\r\n bb.view[j++] = b;\r\n rs = true;\r\n }\r\n if (fail)\r\n throw TypeError(\"Illegal str: Invalid symbol at \"+i);\r\n }\r\n if (!noAssert) {\r\n if (!ho || !hl)\r\n throw TypeError(\"Illegal str: Missing offset or limit\");\r\n if (j>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n var out = new Array(end - begin),\r\n b;\r\n while (begin < end) {\r\n b = this.view[begin++];\r\n if (b < 0x10)\r\n out.push(\"0\", b.toString(16));\r\n else out.push(b.toString(16));\r\n }\r\n return out.join('');\r\n };\r\n\r\n /**\r\n * Decodes a hex encoded string to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromHex = function(str, littleEndian, noAssert) {\r\n if (!noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n if (str.length % 2 !== 0)\r\n throw TypeError(\"Illegal str: Length not a multiple of 2\");\r\n }\r\n var k = str.length,\r\n bb = new ByteBuffer((k / 2) | 0, littleEndian),\r\n b;\r\n for (var i=0, j=0; i 255)\r\n throw TypeError(\"Illegal str: Contains non-hex characters\");\r\n bb.view[j++] = b;\r\n }\r\n bb.limit = j;\r\n return bb;\r\n };\r\n\r\n // utfx-embeddable\r\n\r\n /**\r\n * utfx-embeddable (c) 2014 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/utfx for details\r\n */\r\n var utfx = function() {\r\n \"use strict\";\r\n\r\n /**\r\n * utfx namespace.\r\n * @inner\r\n * @type {!Object.}\r\n */\r\n var utfx = {};\r\n\r\n /**\r\n * Maximum valid code point.\r\n * @type {number}\r\n * @const\r\n */\r\n utfx.MAX_CODEPOINT = 0x10FFFF;\r\n\r\n /**\r\n * Encodes UTF8 code points to UTF8 bytes.\r\n * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point\r\n * respectively `null` if there are no more code points left or a single numeric code point.\r\n * @param {!function(number)} dst Bytes destination as a function successively called with the next byte\r\n */\r\n utfx.encodeUTF8 = function(src, dst) {\r\n var cp = null;\r\n if (typeof src === 'number')\r\n cp = src,\r\n src = function() { return null; };\r\n while (cp !== null || (cp = src()) !== null) {\r\n if (cp < 0x80)\r\n dst(cp&0x7F);\r\n else if (cp < 0x800)\r\n dst(((cp>>6)&0x1F)|0xC0),\r\n dst((cp&0x3F)|0x80);\r\n else if (cp < 0x10000)\r\n dst(((cp>>12)&0x0F)|0xE0),\r\n dst(((cp>>6)&0x3F)|0x80),\r\n dst((cp&0x3F)|0x80);\r\n else\r\n dst(((cp>>18)&0x07)|0xF0),\r\n dst(((cp>>12)&0x3F)|0x80),\r\n dst(((cp>>6)&0x3F)|0x80),\r\n dst((cp&0x3F)|0x80);\r\n cp = null;\r\n }\r\n };\r\n\r\n /**\r\n * Decodes UTF8 bytes to UTF8 code points.\r\n * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there\r\n * are no more bytes left.\r\n * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point.\r\n * @throws {RangeError} If a starting byte is invalid in UTF8\r\n * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the\r\n * remaining bytes.\r\n */\r\n utfx.decodeUTF8 = function(src, dst) {\r\n var a, b, c, d, fail = function(b) {\r\n b = b.slice(0, b.indexOf(null));\r\n var err = Error(b.toString());\r\n err.name = \"TruncatedError\";\r\n err['bytes'] = b;\r\n throw err;\r\n };\r\n while ((a = src()) !== null) {\r\n if ((a&0x80) === 0)\r\n dst(a);\r\n else if ((a&0xE0) === 0xC0)\r\n ((b = src()) === null) && fail([a, b]),\r\n dst(((a&0x1F)<<6) | (b&0x3F));\r\n else if ((a&0xF0) === 0xE0)\r\n ((b=src()) === null || (c=src()) === null) && fail([a, b, c]),\r\n dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F));\r\n else if ((a&0xF8) === 0xF0)\r\n ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]),\r\n dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F));\r\n else throw RangeError(\"Illegal starting byte: \"+a);\r\n }\r\n };\r\n\r\n /**\r\n * Converts UTF16 characters to UTF8 code points.\r\n * @param {!function():number|null} src Characters source as a function returning the next char code respectively\r\n * `null` if there are no more characters left.\r\n * @param {!function(number)} dst Code points destination as a function successively called with each converted code\r\n * point.\r\n */\r\n utfx.UTF16toUTF8 = function(src, dst) {\r\n var c1, c2 = null;\r\n while (true) {\r\n if ((c1 = c2 !== null ? c2 : src()) === null)\r\n break;\r\n if (c1 >= 0xD800 && c1 <= 0xDFFF) {\r\n if ((c2 = src()) !== null) {\r\n if (c2 >= 0xDC00 && c2 <= 0xDFFF) {\r\n dst((c1-0xD800)*0x400+c2-0xDC00+0x10000);\r\n c2 = null; continue;\r\n }\r\n }\r\n }\r\n dst(c1);\r\n }\r\n if (c2 !== null) dst(c2);\r\n };\r\n\r\n /**\r\n * Converts UTF8 code points to UTF16 characters.\r\n * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point\r\n * respectively `null` if there are no more code points left or a single numeric code point.\r\n * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.\r\n * @throws {RangeError} If a code point is out of range\r\n */\r\n utfx.UTF8toUTF16 = function(src, dst) {\r\n var cp = null;\r\n if (typeof src === 'number')\r\n cp = src, src = function() { return null; };\r\n while (cp !== null || (cp = src()) !== null) {\r\n if (cp <= 0xFFFF)\r\n dst(cp);\r\n else\r\n cp -= 0x10000,\r\n dst((cp>>10)+0xD800),\r\n dst((cp%0x400)+0xDC00);\r\n cp = null;\r\n }\r\n };\r\n\r\n /**\r\n * Converts and encodes UTF16 characters to UTF8 bytes.\r\n * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`\r\n * if there are no more characters left.\r\n * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.\r\n */\r\n utfx.encodeUTF16toUTF8 = function(src, dst) {\r\n utfx.UTF16toUTF8(src, function(cp) {\r\n utfx.encodeUTF8(cp, dst);\r\n });\r\n };\r\n\r\n /**\r\n * Decodes and converts UTF8 bytes to UTF16 characters.\r\n * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there\r\n * are no more bytes left.\r\n * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.\r\n * @throws {RangeError} If a starting byte is invalid in UTF8\r\n * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes.\r\n */\r\n utfx.decodeUTF8toUTF16 = function(src, dst) {\r\n utfx.decodeUTF8(src, function(cp) {\r\n utfx.UTF8toUTF16(cp, dst);\r\n });\r\n };\r\n\r\n /**\r\n * Calculates the byte length of an UTF8 code point.\r\n * @param {number} cp UTF8 code point\r\n * @returns {number} Byte length\r\n */\r\n utfx.calculateCodePoint = function(cp) {\r\n return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 bytes required to store UTF8 code points.\r\n * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively\r\n * `null` if there are no more code points left.\r\n * @returns {number} The number of UTF8 bytes required\r\n */\r\n utfx.calculateUTF8 = function(src) {\r\n var cp, l=0;\r\n while ((cp = src()) !== null)\r\n l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n return l;\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes.\r\n * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively\r\n * `null` if there are no more characters left.\r\n * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1.\r\n */\r\n utfx.calculateUTF16asUTF8 = function(src) {\r\n var n=0, l=0;\r\n utfx.UTF16toUTF8(src, function(cp) {\r\n ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n });\r\n return [n,l];\r\n };\r\n\r\n return utfx;\r\n }();\r\n\r\n // encodings/utf8\r\n\r\n /**\r\n * Encodes this ByteBuffer's contents between {@link ByteBuffer#offset} and {@link ByteBuffer#limit} to an UTF8 encoded\r\n * string.\r\n * @returns {string} Hex encoded string\r\n * @throws {RangeError} If `offset > limit`\r\n * @expose\r\n */\r\n ByteBufferPrototype.toUTF8 = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n var sd; try {\r\n utfx.decodeUTF8toUTF16(function() {\r\n return begin < end ? this.view[begin++] : null;\r\n }.bind(this), sd = stringDestination());\r\n } catch (e) {\r\n if (begin !== end)\r\n throw RangeError(\"Illegal range: Truncated data, \"+begin+\" != \"+end);\r\n }\r\n return sd();\r\n };\r\n\r\n /**\r\n * Decodes an UTF8 encoded string to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {\r\n if (!noAssert)\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert),\r\n i = 0;\r\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n bb.view[i++] = b;\r\n });\r\n bb.limit = i;\r\n return bb;\r\n };\r\n\r\n return ByteBuffer;\r\n});\r\n","export default {};\n","/*\r\n Copyright 2013 Daniel Wirtz \r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license protobuf.js (c) 2013 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/protobuf.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n define([\"bytebuffer\"], factory);\r\n /* CommonJS */ else if (typeof require === \"function\" && typeof module === \"object\" && module && module[\"exports\"])\r\n module[\"exports\"] = factory(require(\"bytebuffer\"), true);\r\n /* Global */ else\r\n (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"ProtoBuf\"] = factory(global[\"dcodeIO\"][\"ByteBuffer\"]);\r\n\r\n})(this, function(ByteBuffer, isCommonJS) {\r\n \"use strict\";\r\n\r\n /**\r\n * The ProtoBuf namespace.\r\n * @exports ProtoBuf\r\n * @namespace\r\n * @expose\r\n */\r\n var ProtoBuf = {};\r\n\r\n /**\r\n * @type {!function(new: ByteBuffer, ...[*])}\r\n * @expose\r\n */\r\n ProtoBuf.ByteBuffer = ByteBuffer;\r\n\r\n /**\r\n * @type {?function(new: Long, ...[*])}\r\n * @expose\r\n */\r\n ProtoBuf.Long = ByteBuffer.Long || null;\r\n\r\n /**\r\n * ProtoBuf.js version.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.VERSION = \"5.0.2\";\r\n\r\n /**\r\n * Wire types.\r\n * @type {Object.}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES = {};\r\n\r\n /**\r\n * Varint wire type.\r\n * @type {number}\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.VARINT = 0;\r\n\r\n /**\r\n * Fixed 64 bits wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.BITS64 = 1;\r\n\r\n /**\r\n * Length delimited wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.LDELIM = 2;\r\n\r\n /**\r\n * Start group wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.STARTGROUP = 3;\r\n\r\n /**\r\n * End group wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.ENDGROUP = 4;\r\n\r\n /**\r\n * Fixed 32 bits wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.BITS32 = 5;\r\n\r\n /**\r\n * Packable wire types.\r\n * @type {!Array.}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.PACKABLE_WIRE_TYPES = [\r\n ProtoBuf.WIRE_TYPES.VARINT,\r\n ProtoBuf.WIRE_TYPES.BITS64,\r\n ProtoBuf.WIRE_TYPES.BITS32\r\n ];\r\n\r\n /**\r\n * Types.\r\n * @dict\r\n * @type {!Object.}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.TYPES = {\r\n // According to the protobuf spec.\r\n \"int32\": {\r\n name: \"int32\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"uint32\": {\r\n name: \"uint32\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"sint32\": {\r\n name: \"sint32\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"int64\": {\r\n name: \"int64\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n },\r\n \"uint64\": {\r\n name: \"uint64\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r\n },\r\n \"sint64\": {\r\n name: \"sint64\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n },\r\n \"bool\": {\r\n name: \"bool\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: false\r\n },\r\n \"double\": {\r\n name: \"double\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n defaultValue: 0\r\n },\r\n \"string\": {\r\n name: \"string\",\r\n wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n defaultValue: \"\"\r\n },\r\n \"bytes\": {\r\n name: \"bytes\",\r\n wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n defaultValue: null // overridden in the code, must be a unique instance\r\n },\r\n \"fixed32\": {\r\n name: \"fixed32\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n defaultValue: 0\r\n },\r\n \"sfixed32\": {\r\n name: \"sfixed32\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n defaultValue: 0\r\n },\r\n \"fixed64\": {\r\n name: \"fixed64\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r\n },\r\n \"sfixed64\": {\r\n name: \"sfixed64\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n },\r\n \"float\": {\r\n name: \"float\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n defaultValue: 0\r\n },\r\n \"enum\": {\r\n name: \"enum\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"message\": {\r\n name: \"message\",\r\n wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n defaultValue: null\r\n },\r\n \"group\": {\r\n name: \"group\",\r\n wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,\r\n defaultValue: null\r\n }\r\n };\r\n\r\n /**\r\n * Valid map key types.\r\n * @type {!Array.>}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.MAP_KEY_TYPES = [\r\n ProtoBuf.TYPES[\"int32\"],\r\n ProtoBuf.TYPES[\"sint32\"],\r\n ProtoBuf.TYPES[\"sfixed32\"],\r\n ProtoBuf.TYPES[\"uint32\"],\r\n ProtoBuf.TYPES[\"fixed32\"],\r\n ProtoBuf.TYPES[\"int64\"],\r\n ProtoBuf.TYPES[\"sint64\"],\r\n ProtoBuf.TYPES[\"sfixed64\"],\r\n ProtoBuf.TYPES[\"uint64\"],\r\n ProtoBuf.TYPES[\"fixed64\"],\r\n ProtoBuf.TYPES[\"bool\"],\r\n ProtoBuf.TYPES[\"string\"],\r\n ProtoBuf.TYPES[\"bytes\"]\r\n ];\r\n\r\n /**\r\n * Minimum field id.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.ID_MIN = 1;\r\n\r\n /**\r\n * Maximum field id.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.ID_MAX = 0x1FFFFFFF;\r\n\r\n /**\r\n * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.\r\n * Must be set prior to parsing.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ProtoBuf.convertFieldsToCamelCase = false;\r\n\r\n /**\r\n * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by\r\n * setting this to `false` prior to building messages.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ProtoBuf.populateAccessors = true;\r\n\r\n /**\r\n * By default, messages are populated with default values if a field is not present on the wire. To disable\r\n * this behavior, set this setting to `false`.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ProtoBuf.populateDefaults = true;\r\n\r\n /**\r\n * @alias ProtoBuf.Util\r\n * @expose\r\n */\r\n ProtoBuf.Util = (function() {\r\n \"use strict\";\r\n\r\n /**\r\n * ProtoBuf utilities.\r\n * @exports ProtoBuf.Util\r\n * @namespace\r\n */\r\n var Util = {};\r\n\r\n /**\r\n * Flag if running in node or not.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n */\r\n Util.IS_NODE = !!(\r\n typeof process === 'object' && process+'' === '[object process]' && !process['browser']\r\n );\r\n\r\n /**\r\n * Constructs a XMLHttpRequest object.\r\n * @return {XMLHttpRequest}\r\n * @throws {Error} If XMLHttpRequest is not supported\r\n * @expose\r\n */\r\n Util.XHR = function() {\r\n // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html\r\n var XMLHttpFactories = [\r\n function () {return new XMLHttpRequest()},\r\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\r\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\r\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\r\n ];\r\n /** @type {?XMLHttpRequest} */\r\n var xhr = null;\r\n for (var i=0;i}\r\n * @expose\r\n */\r\n ProtoBuf.Lang = {\r\n\r\n // Characters always ending a statement\r\n DELIM: /[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,\r\n\r\n // Field rules\r\n RULE: /^(?:required|optional|repeated|map)$/,\r\n\r\n // Field types\r\n TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\r\n\r\n // Names\r\n NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n\r\n // Type definitions\r\n TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\r\n\r\n // Type references\r\n TYPEREF: /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n\r\n // Fully qualified type references\r\n FQTYPEREF: /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,\r\n\r\n // All numbers\r\n NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\r\n\r\n // Decimal numbers\r\n NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\r\n\r\n // Hexadecimal numbers\r\n NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\r\n\r\n // Octal numbers\r\n NUMBER_OCT: /^0[0-7]+$/,\r\n\r\n // Floating point numbers\r\n NUMBER_FLT: /^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\r\n\r\n // Booleans\r\n BOOL: /^(?:true|false)$/i,\r\n\r\n // Id numbers\r\n ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r\n\r\n // Negative id numbers (enum values)\r\n NEGID: /^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r\n\r\n // Whitespaces\r\n WHITESPACE: /\\s/,\r\n\r\n // All strings\r\n STRING: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,\r\n\r\n // Double quoted strings\r\n STRING_DQ: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n\r\n // Single quoted strings\r\n STRING_SQ: /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g\r\n };\r\n\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect\r\n * @expose\r\n */\r\n ProtoBuf.Reflect = (function(ProtoBuf) {\r\n \"use strict\";\r\n\r\n /**\r\n * Reflection types.\r\n * @exports ProtoBuf.Reflect\r\n * @namespace\r\n */\r\n var Reflect = {};\r\n\r\n /**\r\n * Constructs a Reflect base class.\r\n * @exports ProtoBuf.Reflect.T\r\n * @constructor\r\n * @abstract\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {?ProtoBuf.Reflect.T} parent Parent object\r\n * @param {string} name Object name\r\n */\r\n var T = function(builder, parent, name) {\r\n\r\n /**\r\n * Builder reference.\r\n * @type {!ProtoBuf.Builder}\r\n * @expose\r\n */\r\n this.builder = builder;\r\n\r\n /**\r\n * Parent object.\r\n * @type {?ProtoBuf.Reflect.T}\r\n * @expose\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * Object name in namespace.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Fully qualified class name\r\n * @type {string}\r\n * @expose\r\n */\r\n this.className;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.T.prototype\r\n * @inner\r\n */\r\n var TPrototype = T.prototype;\r\n\r\n /**\r\n * Returns the fully qualified name of this object.\r\n * @returns {string} Fully qualified name as of \".PATH.TO.THIS\"\r\n * @expose\r\n */\r\n TPrototype.fqn = function() {\r\n var name = this.name,\r\n ptr = this;\r\n do {\r\n ptr = ptr.parent;\r\n if (ptr == null)\r\n break;\r\n name = ptr.name+\".\"+name;\r\n } while (true);\r\n return name;\r\n };\r\n\r\n /**\r\n * Returns a string representation of this Reflect object (its fully qualified name).\r\n * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.\r\n * @return String representation\r\n * @expose\r\n */\r\n TPrototype.toString = function(includeClass) {\r\n return (includeClass ? this.className + \" \" : \"\") + this.fqn();\r\n };\r\n\r\n /**\r\n * Builds this type.\r\n * @throws {Error} If this type cannot be built directly\r\n * @expose\r\n */\r\n TPrototype.build = function() {\r\n throw Error(this.toString(true)+\" cannot be built directly\");\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.T\r\n * @expose\r\n */\r\n Reflect.T = T;\r\n\r\n /**\r\n * Constructs a new Namespace.\r\n * @exports ProtoBuf.Reflect.Namespace\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent\r\n * @param {string} name Namespace name\r\n * @param {Object.=} options Namespace options\r\n * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var Namespace = function(builder, parent, name, options, syntax) {\r\n T.call(this, builder, parent, name);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Namespace\";\r\n\r\n /**\r\n * Children inside the namespace.\r\n * @type {!Array.}\r\n */\r\n this.children = [];\r\n\r\n /**\r\n * Options.\r\n * @type {!Object.}\r\n */\r\n this.options = options || {};\r\n\r\n /**\r\n * Syntax level (e.g., proto2 or proto3).\r\n * @type {!string}\r\n */\r\n this.syntax = syntax || \"proto2\";\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Namespace.prototype\r\n * @inner\r\n */\r\n var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);\r\n\r\n /**\r\n * Returns an array of the namespace's children.\r\n * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).\r\n * @return {Array.}\r\n * @expose\r\n */\r\n NamespacePrototype.getChildren = function(type) {\r\n type = type || null;\r\n if (type == null)\r\n return this.children.slice();\r\n var children = [];\r\n for (var i=0, k=this.children.length; i} qn Qualified name to resolve\r\n * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false`\r\n * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found\r\n * @expose\r\n */\r\n NamespacePrototype.resolve = function(qn, excludeNonNamespace) {\r\n var part = typeof qn === 'string' ? qn.split(\".\") : qn,\r\n ptr = this,\r\n i = 0;\r\n if (part[i] === \"\") { // Fully qualified name, e.g. \".My.Message'\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n i++;\r\n }\r\n var child;\r\n do {\r\n do {\r\n if (!(ptr instanceof Reflect.Namespace)) {\r\n ptr = null;\r\n break;\r\n }\r\n child = ptr.getChild(part[i]);\r\n if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {\r\n ptr = null;\r\n break;\r\n }\r\n ptr = child; i++;\r\n } while (i < part.length);\r\n if (ptr != null)\r\n break; // Found\r\n // Else search the parent\r\n if (this.parent !== null)\r\n return this.parent.resolve(qn, excludeNonNamespace);\r\n } while (ptr != null);\r\n return ptr;\r\n };\r\n\r\n /**\r\n * Determines the shortest qualified name of the specified type, if any, relative to this namespace.\r\n * @param {!ProtoBuf.Reflect.T} t Reflection type\r\n * @returns {string} The shortest qualified name or, if there is none, the fqn\r\n * @expose\r\n */\r\n NamespacePrototype.qn = function(t) {\r\n var part = [], ptr = t;\r\n do {\r\n part.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n } while (ptr !== null);\r\n for (var len=1; len <= part.length; len++) {\r\n var qn = part.slice(part.length-len);\r\n if (t === this.resolve(qn, t instanceof Reflect.Namespace))\r\n return qn.join(\".\");\r\n }\r\n return t.fqn();\r\n };\r\n\r\n /**\r\n * Builds the namespace and returns the runtime counterpart.\r\n * @return {Object.} Runtime namespace\r\n * @expose\r\n */\r\n NamespacePrototype.build = function() {\r\n /** @dict */\r\n var ns = {};\r\n var children = this.children;\r\n for (var i=0, k=children.length, child; i}\r\n */\r\n NamespacePrototype.buildOpt = function() {\r\n var opt = {},\r\n keys = Object.keys(this.options);\r\n for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option\r\n */\r\n NamespacePrototype.getOption = function(name) {\r\n if (typeof name === 'undefined')\r\n return this.options;\r\n return typeof this.options[name] !== 'undefined' ? this.options[name] : null;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Namespace\r\n * @expose\r\n */\r\n Reflect.Namespace = Namespace;\r\n\r\n /**\r\n * Constructs a new Element implementation that checks and converts values for a\r\n * particular field type, as appropriate.\r\n *\r\n * An Element represents a single value: either the value of a singular field,\r\n * or a value contained in one entry of a repeated field or map field. This\r\n * class does not implement these higher-level concepts; it only encapsulates\r\n * the low-level typechecking and conversion.\r\n *\r\n * @exports ProtoBuf.Reflect.Element\r\n * @param {{name: string, wireType: number}} type Resolved data type\r\n * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant\r\n * (e.g. submessage field).\r\n * @param {boolean} isMapKey Is this element a Map key? The value will be\r\n * converted to string form if so.\r\n * @param {string} syntax Syntax level of defining message type, e.g.,\r\n * proto2 or proto3.\r\n * @param {string} name Name of the field containing this element (for error\r\n * messages)\r\n * @constructor\r\n */\r\n var Element = function(type, resolvedType, isMapKey, syntax, name) {\r\n\r\n /**\r\n * Element type, as a string (e.g., int32).\r\n * @type {{name: string, wireType: number}}\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Element type reference to submessage or enum definition, if needed.\r\n * @type {ProtoBuf.Reflect.T|null}\r\n */\r\n this.resolvedType = resolvedType;\r\n\r\n /**\r\n * Element is a map key.\r\n * @type {boolean}\r\n */\r\n this.isMapKey = isMapKey;\r\n\r\n /**\r\n * Syntax level of defining message type, e.g., proto2 or proto3.\r\n * @type {string}\r\n */\r\n this.syntax = syntax;\r\n\r\n /**\r\n * Name of the field containing this element (for error messages)\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)\r\n throw Error(\"Invalid map key type: \" + type.name);\r\n };\r\n\r\n var ElementPrototype = Element.prototype;\r\n\r\n /**\r\n * Obtains a (new) default value for the specified type.\r\n * @param type {string|{name: string, wireType: number}} Field type\r\n * @returns {*} Default value\r\n * @inner\r\n */\r\n function mkDefault(type) {\r\n if (typeof type === 'string')\r\n type = ProtoBuf.TYPES[type];\r\n if (typeof type.defaultValue === 'undefined')\r\n throw Error(\"default value for type \"+type.name+\" is not supported\");\r\n if (type == ProtoBuf.TYPES[\"bytes\"])\r\n return new ByteBuffer(0);\r\n return type.defaultValue;\r\n }\r\n\r\n /**\r\n * Returns the default value for this field in proto3.\r\n * @function\r\n * @param type {string|{name: string, wireType: number}} the field type\r\n * @returns {*} Default value\r\n */\r\n Element.defaultFieldValue = mkDefault;\r\n\r\n /**\r\n * Makes a Long from a value.\r\n * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for\r\n * strings and numbers\r\n * @returns {!Long}\r\n * @throws {Error} If the value cannot be converted to a Long\r\n * @inner\r\n */\r\n function mkLong(value, unsigned) {\r\n if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'\r\n && value.low === value.low && value.high === value.high)\r\n return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);\r\n if (typeof value === 'string')\r\n return ProtoBuf.Long.fromString(value, unsigned || false, 10);\r\n if (typeof value === 'number')\r\n return ProtoBuf.Long.fromNumber(value, unsigned || false);\r\n throw Error(\"not convertible to Long\");\r\n }\r\n\r\n ElementPrototype.toString = function() {\r\n return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';\r\n }\r\n\r\n /**\r\n * Checks if the given value can be set for an element of this type (singular\r\n * field or one element of a repeated field or map).\r\n * @param {*} value Value to check\r\n * @return {*} Verified, maybe adjusted, value\r\n * @throws {Error} If the value cannot be verified for this element slot\r\n * @expose\r\n */\r\n ElementPrototype.verifyValue = function(value) {\r\n var self = this;\r\n function fail(val, msg) {\r\n throw Error(\"Illegal value for \"+self.toString(true)+\" of type \"+self.type.name+\": \"+val+\" (\"+msg+\")\");\r\n }\r\n switch (this.type) {\r\n // Signed 32bit\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n // Account for !NaN: value === value\r\n if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r\n fail(typeof value, \"not an integer\");\r\n return value > 4294967295 ? value | 0 : value;\r\n\r\n // Unsigned 32bit\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r\n fail(typeof value, \"not an integer\");\r\n return value < 0 ? value >>> 0 : value;\r\n\r\n // Signed 64bit\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n case ProtoBuf.TYPES[\"sfixed64\"]: {\r\n if (ProtoBuf.Long)\r\n try {\r\n return mkLong(value, false);\r\n } catch (e) {\r\n fail(typeof value, e.message);\r\n }\r\n else\r\n fail(typeof value, \"requires Long.js\");\r\n }\r\n\r\n // Unsigned 64bit\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n case ProtoBuf.TYPES[\"fixed64\"]: {\r\n if (ProtoBuf.Long)\r\n try {\r\n return mkLong(value, true);\r\n } catch (e) {\r\n fail(typeof value, e.message);\r\n }\r\n else\r\n fail(typeof value, \"requires Long.js\");\r\n }\r\n\r\n // Bool\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n if (typeof value !== 'boolean')\r\n fail(typeof value, \"not a boolean\");\r\n return value;\r\n\r\n // Float\r\n case ProtoBuf.TYPES[\"float\"]:\r\n case ProtoBuf.TYPES[\"double\"]:\r\n if (typeof value !== 'number')\r\n fail(typeof value, \"not a number\");\r\n return value;\r\n\r\n // Length-delimited string\r\n case ProtoBuf.TYPES[\"string\"]:\r\n if (typeof value !== 'string' && !(value && value instanceof String))\r\n fail(typeof value, \"not a string\");\r\n return \"\"+value; // Convert String object to string\r\n\r\n // Length-delimited bytes\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n if (ByteBuffer.isByteBuffer(value))\r\n return value;\r\n return ByteBuffer.wrap(value, \"base64\");\r\n\r\n // Constant enum value\r\n case ProtoBuf.TYPES[\"enum\"]: {\r\n var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);\r\n for (i=0; i 4294967295 || value < 0)\r\n fail(typeof value, \"not in range for uint32\")\r\n return value;\r\n } else {\r\n // proto2 requires enum values to be valid.\r\n fail(value, \"not a valid enum value\");\r\n }\r\n }\r\n // Embedded message\r\n case ProtoBuf.TYPES[\"group\"]:\r\n case ProtoBuf.TYPES[\"message\"]: {\r\n if (!value || typeof value !== 'object')\r\n fail(typeof value, \"object expected\");\r\n if (value instanceof this.resolvedType.clazz)\r\n return value;\r\n if (value instanceof ProtoBuf.Builder.Message) {\r\n // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)\r\n var obj = {};\r\n for (var i in value)\r\n if (value.hasOwnProperty(i))\r\n obj[i] = value[i];\r\n value = obj;\r\n }\r\n // Else let's try to construct one from a key-value object\r\n return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons\r\n }\r\n }\r\n\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal value for \"+this.toString(true)+\": \"+value+\" (undefined type \"+this.type+\")\");\r\n };\r\n\r\n /**\r\n * Calculates the byte length of an element on the wire.\r\n * @param {number} id Field number\r\n * @param {*} value Field value\r\n * @returns {number} Byte length\r\n * @throws {Error} If the value cannot be calculated\r\n * @expose\r\n */\r\n ElementPrototype.calculateLength = function(id, value) {\r\n if (value === null) return 0; // Nothing to encode\r\n // Tag has already been written\r\n var n;\r\n switch (this.type) {\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n return ByteBuffer.calculateVarint32(value);\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n case ProtoBuf.TYPES[\"float\"]:\r\n return 4;\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n return ByteBuffer.calculateVarint64(value);\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n return 8;\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n return 1;\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n return ByteBuffer.calculateVarint32(value);\r\n case ProtoBuf.TYPES[\"double\"]:\r\n return 8;\r\n case ProtoBuf.TYPES[\"string\"]:\r\n n = ByteBuffer.calculateUTF8Bytes(value);\r\n return ByteBuffer.calculateVarint32(n) + n;\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n if (value.remaining() < 0)\r\n throw Error(\"Illegal value for \"+this.toString(true)+\": \"+value.remaining()+\" bytes remaining\");\r\n return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();\r\n case ProtoBuf.TYPES[\"message\"]:\r\n n = this.resolvedType.calculate(value);\r\n return ByteBuffer.calculateVarint32(n) + n;\r\n case ProtoBuf.TYPES[\"group\"]:\r\n n = this.resolvedType.calculate(value);\r\n return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r\n }\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+value+\" (unknown type)\");\r\n };\r\n\r\n /**\r\n * Encodes a value to the specified buffer. Does not encode the key.\r\n * @param {number} id Field number\r\n * @param {*} value Field value\r\n * @param {ByteBuffer} buffer ByteBuffer to encode to\r\n * @return {ByteBuffer} The ByteBuffer for chaining\r\n * @throws {Error} If the value cannot be encoded\r\n * @expose\r\n */\r\n ElementPrototype.encodeValue = function(id, value, buffer) {\r\n if (value === null) return buffer; // Nothing to encode\r\n // Tag has already been written\r\n\r\n switch (this.type) {\r\n // 32bit signed varint\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n // \"If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes\r\n // long – it is, effectively, treated like a very large unsigned integer.\" (see #122)\r\n if (value < 0)\r\n buffer.writeVarint64(value);\r\n else\r\n buffer.writeVarint32(value);\r\n break;\r\n\r\n // 32bit unsigned varint\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n buffer.writeVarint32(value);\r\n break;\r\n\r\n // 32bit varint zig-zag\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n buffer.writeVarint32ZigZag(value);\r\n break;\r\n\r\n // Fixed unsigned 32bit\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n buffer.writeUint32(value);\r\n break;\r\n\r\n // Fixed signed 32bit\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n buffer.writeInt32(value);\r\n break;\r\n\r\n // 64bit varint as-is\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n buffer.writeVarint64(value); // throws\r\n break;\r\n\r\n // 64bit varint zig-zag\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n buffer.writeVarint64ZigZag(value); // throws\r\n break;\r\n\r\n // Fixed unsigned 64bit\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n buffer.writeUint64(value); // throws\r\n break;\r\n\r\n // Fixed signed 64bit\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n buffer.writeInt64(value); // throws\r\n break;\r\n\r\n // Bool\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n if (typeof value === 'string')\r\n buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);\r\n else\r\n buffer.writeVarint32(value ? 1 : 0);\r\n break;\r\n\r\n // Constant enum value\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n buffer.writeVarint32(value);\r\n break;\r\n\r\n // 32bit float\r\n case ProtoBuf.TYPES[\"float\"]:\r\n buffer.writeFloat32(value);\r\n break;\r\n\r\n // 64bit float\r\n case ProtoBuf.TYPES[\"double\"]:\r\n buffer.writeFloat64(value);\r\n break;\r\n\r\n // Length-delimited string\r\n case ProtoBuf.TYPES[\"string\"]:\r\n buffer.writeVString(value);\r\n break;\r\n\r\n // Length-delimited bytes\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n if (value.remaining() < 0)\r\n throw Error(\"Illegal value for \"+this.toString(true)+\": \"+value.remaining()+\" bytes remaining\");\r\n var prevOffset = value.offset;\r\n buffer.writeVarint32(value.remaining());\r\n buffer.append(value);\r\n value.offset = prevOffset;\r\n break;\r\n\r\n // Embedded message\r\n case ProtoBuf.TYPES[\"message\"]:\r\n var bb = new ByteBuffer().LE();\r\n this.resolvedType.encode(value, bb);\r\n buffer.writeVarint32(bb.offset);\r\n buffer.append(bb.flip());\r\n break;\r\n\r\n // Legacy group\r\n case ProtoBuf.TYPES[\"group\"]:\r\n this.resolvedType.encode(value, buffer);\r\n buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r\n break;\r\n\r\n default:\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+value+\" (unknown type)\");\r\n }\r\n return buffer;\r\n };\r\n\r\n /**\r\n * Decode one element value from the specified buffer.\r\n * @param {ByteBuffer} buffer ByteBuffer to decode from\r\n * @param {number} wireType The field wire type\r\n * @param {number} id The field number\r\n * @return {*} Decoded value\r\n * @throws {Error} If the field cannot be decoded\r\n * @expose\r\n */\r\n ElementPrototype.decode = function(buffer, wireType, id) {\r\n if (wireType != this.type.wireType)\r\n throw Error(\"Unexpected wire type for element\");\r\n\r\n var value, nBytes;\r\n switch (this.type) {\r\n // 32bit signed varint\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n return buffer.readVarint32() | 0;\r\n\r\n // 32bit unsigned varint\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n return buffer.readVarint32() >>> 0;\r\n\r\n // 32bit signed varint zig-zag\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n return buffer.readVarint32ZigZag() | 0;\r\n\r\n // Fixed 32bit unsigned\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n return buffer.readUint32() >>> 0;\r\n\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n return buffer.readInt32() | 0;\r\n\r\n // 64bit signed varint\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n return buffer.readVarint64();\r\n\r\n // 64bit unsigned varint\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n return buffer.readVarint64().toUnsigned();\r\n\r\n // 64bit signed varint zig-zag\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n return buffer.readVarint64ZigZag();\r\n\r\n // Fixed 64bit unsigned\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n return buffer.readUint64();\r\n\r\n // Fixed 64bit signed\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n return buffer.readInt64();\r\n\r\n // Bool varint\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n return !!buffer.readVarint32();\r\n\r\n // Constant enum value (varint)\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n // The following Builder.Message#set will already throw\r\n return buffer.readVarint32();\r\n\r\n // 32bit float\r\n case ProtoBuf.TYPES[\"float\"]:\r\n return buffer.readFloat();\r\n\r\n // 64bit float\r\n case ProtoBuf.TYPES[\"double\"]:\r\n return buffer.readDouble();\r\n\r\n // Length-delimited string\r\n case ProtoBuf.TYPES[\"string\"]:\r\n return buffer.readVString();\r\n\r\n // Length-delimited bytes\r\n case ProtoBuf.TYPES[\"bytes\"]: {\r\n nBytes = buffer.readVarint32();\r\n if (buffer.remaining() < nBytes)\r\n throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+nBytes+\" required but got only \"+buffer.remaining());\r\n value = buffer.clone(); // Offset already set\r\n value.limit = value.offset+nBytes;\r\n buffer.offset += nBytes;\r\n return value;\r\n }\r\n\r\n // Length-delimited embedded message\r\n case ProtoBuf.TYPES[\"message\"]: {\r\n nBytes = buffer.readVarint32();\r\n return this.resolvedType.decode(buffer, nBytes);\r\n }\r\n\r\n // Legacy group\r\n case ProtoBuf.TYPES[\"group\"]:\r\n return this.resolvedType.decode(buffer, -1, id);\r\n }\r\n\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal decode type\");\r\n };\r\n\r\n /**\r\n * Converts a value from a string to the canonical element type.\r\n *\r\n * Legal only when isMapKey is true.\r\n *\r\n * @param {string} str The string value\r\n * @returns {*} The value\r\n */\r\n ElementPrototype.valueFromString = function(str) {\r\n if (!this.isMapKey) {\r\n throw Error(\"valueFromString() called on non-map-key element\");\r\n }\r\n\r\n switch (this.type) {\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n return this.verifyValue(parseInt(str));\r\n\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n // Long-based fields support conversions from string already.\r\n return this.verifyValue(str);\r\n\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n return str === \"true\";\r\n\r\n case ProtoBuf.TYPES[\"string\"]:\r\n return this.verifyValue(str);\r\n\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n return ByteBuffer.fromBinary(str);\r\n }\r\n };\r\n\r\n /**\r\n * Converts a value from the canonical element type to a string.\r\n *\r\n * It should be the case that `valueFromString(valueToString(val))` returns\r\n * a value equivalent to `verifyValue(val)` for every legal value of `val`\r\n * according to this element type.\r\n *\r\n * This may be used when the element must be stored or used as a string,\r\n * e.g., as a map key on an Object.\r\n *\r\n * Legal only when isMapKey is true.\r\n *\r\n * @param {*} val The value\r\n * @returns {string} The string form of the value.\r\n */\r\n ElementPrototype.valueToString = function(value) {\r\n if (!this.isMapKey) {\r\n throw Error(\"valueToString() called on non-map-key element\");\r\n }\r\n\r\n if (this.type === ProtoBuf.TYPES[\"bytes\"]) {\r\n return value.toString(\"binary\");\r\n } else {\r\n return value.toString();\r\n }\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Element\r\n * @expose\r\n */\r\n Reflect.Element = Element;\r\n\r\n /**\r\n * Constructs a new Message.\r\n * @exports ProtoBuf.Reflect.Message\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace\r\n * @param {string} name Message name\r\n * @param {Object.=} options Message options\r\n * @param {boolean=} isGroup `true` if this is a legacy group\r\n * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Namespace\r\n */\r\n var Message = function(builder, parent, name, options, isGroup, syntax) {\r\n Namespace.call(this, builder, parent, name, options, syntax);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Message\";\r\n\r\n /**\r\n * Extensions range.\r\n * @type {!Array.|undefined}\r\n * @expose\r\n */\r\n this.extensions = undefined;\r\n\r\n /**\r\n * Runtime message class.\r\n * @type {?function(new:ProtoBuf.Builder.Message)}\r\n * @expose\r\n */\r\n this.clazz = null;\r\n\r\n /**\r\n * Whether this is a legacy group or not.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.isGroup = !!isGroup;\r\n\r\n // The following cached collections are used to efficiently iterate over or look up fields when decoding.\r\n\r\n /**\r\n * Cached fields.\r\n * @type {?Array.}\r\n * @private\r\n */\r\n this._fields = null;\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 by name.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsByName = null;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.prototype\r\n * @inner\r\n */\r\n var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);\r\n\r\n /**\r\n * Builds the message and returns the runtime counterpart, which is a fully functional class.\r\n * @see ProtoBuf.Builder.Message\r\n * @param {boolean=} rebuild Whether to rebuild or not, defaults to false\r\n * @return {ProtoBuf.Reflect.Message} Message class\r\n * @throws {Error} If the message cannot be built\r\n * @expose\r\n */\r\n MessagePrototype.build = function(rebuild) {\r\n if (this.clazz && !rebuild)\r\n return this.clazz;\r\n\r\n // Create the runtime Message class in its own scope\r\n var clazz = (function(ProtoBuf, T) {\r\n\r\n var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),\r\n oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);\r\n\r\n /**\r\n * Constructs a new runtime Message.\r\n * @name ProtoBuf.Builder.Message\r\n * @class Barebone of all runtime messages.\r\n * @param {!Object.|string} values Preset values\r\n * @param {...string} var_args\r\n * @constructor\r\n * @throws {Error} If the message cannot be created\r\n */\r\n var Message = function(values, var_args) {\r\n ProtoBuf.Builder.Message.call(this);\r\n\r\n // Create virtual oneof properties\r\n for (var i=0, k=oneofs.length; i 0) {\r\n var value;\r\n // Set field values from a values object\r\n if (arguments.length === 1 && values !== null && typeof values === 'object' &&\r\n /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &&\r\n /* not a repeated field */ !Array.isArray(values) &&\r\n /* not a Map */ !(values instanceof ProtoBuf.Map) &&\r\n /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &&\r\n /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &&\r\n /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {\r\n this.$set(values);\r\n } else // Set field values from arguments, in declaration order\r\n for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values\r\n * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r\n * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`\r\n * @returns {!ProtoBuf.Builder.Message} this\r\n * @throws {Error} If the value cannot be set\r\n * @expose\r\n */\r\n MessagePrototype.set = function(keyOrObj, value, noAssert) {\r\n if (keyOrObj && typeof keyOrObj === 'object') {\r\n noAssert = value;\r\n for (var ikey in keyOrObj) {\r\n // Check if virtual oneof field - don't set these\r\n if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)\r\n this.$set(ikey, value, noAssert);\r\n }\r\n return this;\r\n }\r\n var field = T._fieldsByName[keyOrObj];\r\n if (!noAssert) {\r\n if (!field)\r\n throw Error(this+\"#\"+keyOrObj+\" is not a field: undefined\");\r\n if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r\n throw Error(this+\"#\"+keyOrObj+\" is not a field: \"+field.toString(true));\r\n this[field.name] = (value = field.verifyValue(value)); // May throw\r\n } else\r\n this[keyOrObj] = value;\r\n if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r\n var currentField = this[field.oneof.name]; // Virtual field references currently set field\r\n if (value !== null) {\r\n if (currentField !== null && currentField !== field.name)\r\n this[currentField] = null; // Clear currently set field\r\n this[field.oneof.name] = field.name; // Point virtual field at this field\r\n } else if (/* value === null && */currentField === keyOrObj)\r\n this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)\r\n }\r\n return this;\r\n };\r\n\r\n /**\r\n * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.\r\n * @name ProtoBuf.Builder.Message#$set\r\n * @function\r\n * @param {string|!Object.} keyOrObj String key or plain object holding multiple values\r\n * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r\n * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r\n * @throws {Error} If the value cannot be set\r\n * @expose\r\n */\r\n MessagePrototype.$set = MessagePrototype.set;\r\n\r\n /**\r\n * Gets a field's value.\r\n * @name ProtoBuf.Builder.Message#get\r\n * @function\r\n * @param {string} key Key\r\n * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`\r\n * @return {*} Value\r\n * @throws {Error} If there is no such field\r\n * @expose\r\n */\r\n MessagePrototype.get = function(key, noAssert) {\r\n if (noAssert)\r\n return this[key];\r\n var field = T._fieldsByName[key];\r\n if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))\r\n throw Error(this+\"#\"+key+\" is not a field: undefined\");\r\n if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r\n throw Error(this+\"#\"+key+\" is not a field: \"+field.toString(true));\r\n return this[field.name];\r\n };\r\n\r\n /**\r\n * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.\r\n * @name ProtoBuf.Builder.Message#$get\r\n * @function\r\n * @param {string} key Key\r\n * @return {*} Value\r\n * @throws {Error} If there is no such field\r\n * @expose\r\n */\r\n MessagePrototype.$get = MessagePrototype.get;\r\n\r\n // Getters and setters\r\n\r\n for (var i=0; i} data Data payload\r\n * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r\n * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r\n * @return {!ByteBuffer} Encoded message as a ByteBuffer\r\n * @expose\r\n */\r\n Message.encode = function(data, buffer, noVerify) {\r\n return new Message(data).encode(buffer, noVerify);\r\n };\r\n\r\n /**\r\n * Calculates the byte length of the message.\r\n * @name ProtoBuf.Builder.Message#calculate\r\n * @function\r\n * @returns {number} Byte length\r\n * @throws {Error} If the message cannot be calculated or if required fields are missing.\r\n * @expose\r\n */\r\n MessagePrototype.calculate = function() {\r\n return T.calculate(this);\r\n };\r\n\r\n /**\r\n * Encodes the varint32 length-delimited message.\r\n * @name ProtoBuf.Builder.Message#encodeDelimited\r\n * @function\r\n * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r\n * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r\n * @return {!ByteBuffer} Encoded message as a ByteBuffer\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded ByteBuffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeDelimited = function(buffer, noVerify) {\r\n var isNew = false;\r\n if (!buffer)\r\n buffer = new ByteBuffer(),\r\n isNew = true;\r\n var enc = new ByteBuffer().LE();\r\n T.encode(this, enc, noVerify).flip();\r\n buffer.writeVarint32(enc.remaining());\r\n buffer.append(enc);\r\n return isNew ? buffer.flip() : buffer;\r\n };\r\n\r\n /**\r\n * Directly encodes the message to an ArrayBuffer.\r\n * @name ProtoBuf.Builder.Message#encodeAB\r\n * @function\r\n * @return {ArrayBuffer} Encoded message as ArrayBuffer\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded ArrayBuffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeAB = function() {\r\n try {\r\n return this.encode().toArrayBuffer();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toArrayBuffer();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.\r\n * @name ProtoBuf.Builder.Message#toArrayBuffer\r\n * @function\r\n * @return {ArrayBuffer} Encoded message as ArrayBuffer\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded ArrayBuffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;\r\n\r\n /**\r\n * Directly encodes the message to a node Buffer.\r\n * @name ProtoBuf.Builder.Message#encodeNB\r\n * @function\r\n * @return {!Buffer}\r\n * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are\r\n * missing. The later still returns the encoded node Buffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeNB = function() {\r\n try {\r\n return this.encode().toBuffer();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toBuffer();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.\r\n * @name ProtoBuf.Builder.Message#toBuffer\r\n * @function\r\n * @return {!Buffer}\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded node Buffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toBuffer = MessagePrototype.encodeNB;\r\n\r\n /**\r\n * Directly encodes the message to a base64 encoded string.\r\n * @name ProtoBuf.Builder.Message#encode64\r\n * @function\r\n * @return {string} Base64 encoded string\r\n * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r\n * still returns the encoded base64 string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encode64 = function() {\r\n try {\r\n return this.encode().toBase64();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toBase64();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.\r\n * @name ProtoBuf.Builder.Message#toBase64\r\n * @function\r\n * @return {string} Base64 encoded string\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded base64 string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toBase64 = MessagePrototype.encode64;\r\n\r\n /**\r\n * Directly encodes the message to a hex encoded string.\r\n * @name ProtoBuf.Builder.Message#encodeHex\r\n * @function\r\n * @return {string} Hex encoded string\r\n * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r\n * still returns the encoded hex string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeHex = function() {\r\n try {\r\n return this.encode().toHex();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toHex();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.\r\n * @name ProtoBuf.Builder.Message#toHex\r\n * @function\r\n * @return {string} Hex encoded string\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded hex string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toHex = MessagePrototype.encodeHex;\r\n\r\n /**\r\n * Clones a message object or field value to a raw object.\r\n * @param {*} obj Object to clone\r\n * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise\r\n * @param {boolean} longsAsStrings Whether to encode longs as strings\r\n * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field\r\n * @returns {*} Cloned object\r\n * @inner\r\n */\r\n function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {\r\n if (obj === null || typeof obj !== 'object') {\r\n // Convert enum values to their respective names\r\n if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {\r\n var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);\r\n if (name !== null)\r\n return name;\r\n }\r\n // Pass-through string, number, boolean, null...\r\n return obj;\r\n }\r\n // Convert ByteBuffers to raw buffer or strings\r\n if (ByteBuffer.isByteBuffer(obj))\r\n return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();\r\n // Convert Longs to proper objects or strings\r\n if (ProtoBuf.Long.isLong(obj))\r\n return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);\r\n var clone;\r\n // Clone arrays\r\n if (Array.isArray(obj)) {\r\n clone = [];\r\n obj.forEach(function(v, k) {\r\n clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);\r\n });\r\n return clone;\r\n }\r\n clone = {};\r\n // Convert maps to objects\r\n if (obj instanceof ProtoBuf.Map) {\r\n var it = obj.entries();\r\n for (var e = it.next(); !e.done; e = it.next())\r\n clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);\r\n return clone;\r\n }\r\n // Everything else is a non-null object\r\n var type = obj.$type,\r\n field = undefined;\r\n for (var i in obj)\r\n if (obj.hasOwnProperty(i)) {\r\n if (type && (field = type.getChild(i)))\r\n clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);\r\n else\r\n clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);\r\n }\r\n return clone;\r\n }\r\n\r\n /**\r\n * Returns the message's raw payload.\r\n * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`\r\n * @param {boolean} longsAsStrings Whether to encode longs as strings\r\n * @returns {Object.} Raw payload\r\n * @expose\r\n */\r\n MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {\r\n return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);\r\n };\r\n\r\n /**\r\n * Encodes a message to JSON.\r\n * @returns {string} JSON string\r\n * @expose\r\n */\r\n MessagePrototype.encodeJSON = function() {\r\n return JSON.stringify(\r\n cloneRaw(this,\r\n /* binary-as-base64 */ true,\r\n /* longs-as-strings */ true,\r\n this.$type\r\n )\r\n );\r\n };\r\n\r\n /**\r\n * Decodes a message from the specified buffer or string.\r\n * @name ProtoBuf.Builder.Message.decode\r\n * @function\r\n * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r\n * @param {(number|string)=} length Message length. Defaults to decode all the remainig data.\r\n * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n * @see ProtoBuf.Builder.Message.decode64\r\n * @see ProtoBuf.Builder.Message.decodeHex\r\n */\r\n Message.decode = function(buffer, length, enc) {\r\n if (typeof length === 'string')\r\n enc = length,\r\n length = -1;\r\n if (typeof buffer === 'string')\r\n buffer = ByteBuffer.wrap(buffer, enc ? enc : \"base64\");\r\n else if (!ByteBuffer.isByteBuffer(buffer))\r\n buffer = ByteBuffer.wrap(buffer); // May throw\r\n var le = buffer.littleEndian;\r\n try {\r\n var msg = T.decode(buffer.LE(), length);\r\n buffer.LE(le);\r\n return msg;\r\n } catch (e) {\r\n buffer.LE(le);\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Decodes a varint32 length-delimited message from the specified buffer or string.\r\n * @name ProtoBuf.Builder.Message.decodeDelimited\r\n * @function\r\n * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r\n * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r\n * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n */\r\n Message.decodeDelimited = function(buffer, enc) {\r\n if (typeof buffer === 'string')\r\n buffer = ByteBuffer.wrap(buffer, enc ? enc : \"base64\");\r\n else if (!ByteBuffer.isByteBuffer(buffer))\r\n buffer = ByteBuffer.wrap(buffer); // May throw\r\n if (buffer.remaining() < 1)\r\n return null;\r\n var off = buffer.offset,\r\n len = buffer.readVarint32();\r\n if (buffer.remaining() < len) {\r\n buffer.offset = off;\r\n return null;\r\n }\r\n try {\r\n var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());\r\n buffer.offset += len;\r\n return msg;\r\n } catch (err) {\r\n buffer.offset += len;\r\n throw err;\r\n }\r\n };\r\n\r\n /**\r\n * Decodes the message from the specified base64 encoded string.\r\n * @name ProtoBuf.Builder.Message.decode64\r\n * @function\r\n * @param {string} str String to decode from\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n */\r\n Message.decode64 = function(str) {\r\n return Message.decode(str, \"base64\");\r\n };\r\n\r\n /**\r\n * Decodes the message from the specified hex encoded string.\r\n * @name ProtoBuf.Builder.Message.decodeHex\r\n * @function\r\n * @param {string} str String to decode from\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n */\r\n Message.decodeHex = function(str) {\r\n return Message.decode(str, \"hex\");\r\n };\r\n\r\n /**\r\n * Decodes the message from a JSON string.\r\n * @name ProtoBuf.Builder.Message.decodeJSON\r\n * @function\r\n * @param {string} str String to decode from\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are\r\n * missing.\r\n * @expose\r\n */\r\n Message.decodeJSON = function(str) {\r\n return new Message(JSON.parse(str));\r\n };\r\n\r\n // Utility\r\n\r\n /**\r\n * Returns a string representation of this Message.\r\n * @name ProtoBuf.Builder.Message#toString\r\n * @function\r\n * @return {string} String representation as of \".Fully.Qualified.MessageName\"\r\n * @expose\r\n */\r\n MessagePrototype.toString = function() {\r\n return T.toString();\r\n };\r\n\r\n // Properties\r\n\r\n /**\r\n * Message options.\r\n * @name ProtoBuf.Builder.Message.$options\r\n * @type {Object.}\r\n * @expose\r\n */\r\n var $optionsS; // cc needs this\r\n\r\n /**\r\n * Message options.\r\n * @name ProtoBuf.Builder.Message#$options\r\n * @type {Object.}\r\n * @expose\r\n */\r\n var $options;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Message.$type\r\n * @type {!ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n var $typeS;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Message#$type\r\n * @type {!ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n var $type;\r\n\r\n if (Object.defineProperty)\r\n Object.defineProperty(Message, '$options', { \"value\": T.buildOpt() }),\r\n Object.defineProperty(MessagePrototype, \"$options\", { \"value\": Message[\"$options\"] }),\r\n Object.defineProperty(Message, \"$type\", { \"value\": T }),\r\n Object.defineProperty(MessagePrototype, \"$type\", { \"value\": T });\r\n\r\n return Message;\r\n\r\n })(ProtoBuf, this);\r\n\r\n // Static enums and prototyped sub-messages / cached collections\r\n this._fields = [];\r\n this._fieldsById = {};\r\n this._fieldsByName = {};\r\n this._oneofsByName = {};\r\n for (var i=0, k=this.children.length, child; i>> 3;\r\n switch (wireType) {\r\n case ProtoBuf.WIRE_TYPES.VARINT:\r\n do tag = buf.readUint8();\r\n while ((tag & 0x80) === 0x80);\r\n break;\r\n case ProtoBuf.WIRE_TYPES.BITS64:\r\n buf.offset += 8;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.LDELIM:\r\n tag = buf.readVarint32(); // reads the varint\r\n buf.offset += tag; // skips n bytes\r\n break;\r\n case ProtoBuf.WIRE_TYPES.STARTGROUP:\r\n skipTillGroupEnd(id, buf);\r\n break;\r\n case ProtoBuf.WIRE_TYPES.ENDGROUP:\r\n if (id === expectedId)\r\n return false;\r\n else\r\n throw Error(\"Illegal GROUPEND after unknown group: \"+id+\" (\"+expectedId+\" expected)\");\r\n case ProtoBuf.WIRE_TYPES.BITS32:\r\n buf.offset += 4;\r\n break;\r\n default:\r\n throw Error(\"Illegal wire type in unknown group \"+expectedId+\": \"+wireType);\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Decodes an encoded message and returns the decoded message.\r\n * @param {ByteBuffer} buffer ByteBuffer to decode from\r\n * @param {number=} length Message length. Defaults to decode all remaining data.\r\n * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group\r\n * @return {ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded\r\n * @expose\r\n */\r\n MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {\r\n if (typeof length !== 'number')\r\n length = -1;\r\n var start = buffer.offset,\r\n msg = new (this.clazz)(),\r\n tag, wireType, id, field;\r\n while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {\r\n tag = buffer.readVarint32();\r\n wireType = tag & 0x07;\r\n id = tag >>> 3;\r\n if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {\r\n if (id !== expectedGroupEndId)\r\n throw Error(\"Illegal group end indicator for \"+this.toString(true)+\": \"+id+\" (\"+(expectedGroupEndId ? expectedGroupEndId+\" expected\" : \"not a group\")+\")\");\r\n break;\r\n }\r\n if (!(field = this._fieldsById[id])) {\r\n // \"messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing.\"\r\n switch (wireType) {\r\n case ProtoBuf.WIRE_TYPES.VARINT:\r\n buffer.readVarint32();\r\n break;\r\n case ProtoBuf.WIRE_TYPES.BITS32:\r\n buffer.offset += 4;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.BITS64:\r\n buffer.offset += 8;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.LDELIM:\r\n var len = buffer.readVarint32();\r\n buffer.offset += len;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.STARTGROUP:\r\n while (skipTillGroupEnd(id, buffer)) {}\r\n break;\r\n default:\r\n throw Error(\"Illegal wire type for unknown field \"+id+\" in \"+this.toString(true)+\"#decode: \"+wireType);\r\n }\r\n continue;\r\n }\r\n if (field.repeated && !field.options[\"packed\"]) {\r\n msg[field.name].push(field.decode(wireType, buffer));\r\n } else if (field.map) {\r\n var keyval = field.decode(wireType, buffer);\r\n msg[field.name].set(keyval[0], keyval[1]);\r\n } else {\r\n msg[field.name] = field.decode(wireType, buffer);\r\n if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r\n var currentField = msg[field.oneof.name]; // Virtual field references currently set field\r\n if (currentField !== null && currentField !== field.name)\r\n msg[currentField] = null; // Clear currently set field\r\n msg[field.oneof.name] = field.name; // Point virtual field at this field\r\n }\r\n }\r\n }\r\n\r\n // Check if all required fields are present and set default values for optional fields that are not\r\n for (var i=0, k=this._fields.length; i=} options Options\r\n * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf\r\n * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {\r\n T.call(this, builder, message, name);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Message.Field\";\r\n\r\n /**\r\n * Message field required flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Message field repeated flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Message field map flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.map = rule === \"map\";\r\n\r\n /**\r\n * Message field key type. Type reference string if unresolved, protobuf\r\n * type if resolved. Valid only if this.map === true, null otherwise.\r\n * @type {string|{name: string, wireType: number}|null}\r\n * @expose\r\n */\r\n this.keyType = keytype || null;\r\n\r\n /**\r\n * Message field type. Type reference string if unresolved, protobuf type if\r\n * resolved. In a map field, this is the value type.\r\n * @type {string|{name: string, wireType: number}}\r\n * @expose\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Resolved type reference inside the global namespace.\r\n * @type {ProtoBuf.Reflect.T|null}\r\n * @expose\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Unique message field id.\r\n * @type {number}\r\n * @expose\r\n */\r\n this.id = id;\r\n\r\n /**\r\n * Message field options.\r\n * @type {!Object.}\r\n * @dict\r\n * @expose\r\n */\r\n this.options = options || {};\r\n\r\n /**\r\n * Default value.\r\n * @type {*}\r\n * @expose\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Enclosing OneOf.\r\n * @type {?ProtoBuf.Reflect.Message.OneOf}\r\n * @expose\r\n */\r\n this.oneof = oneof || null;\r\n\r\n /**\r\n * Syntax level of this definition (e.g., proto3).\r\n * @type {string}\r\n * @expose\r\n */\r\n this.syntax = syntax || 'proto2';\r\n\r\n /**\r\n * Original field name.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.originalName = this.name; // Used to revert camelcase transformation on naming collisions\r\n\r\n /**\r\n * Element implementation. Created in build() after types are resolved.\r\n * @type {ProtoBuf.Element}\r\n * @expose\r\n */\r\n this.element = null;\r\n\r\n /**\r\n * Key element implementation, for map fields. Created in build() after\r\n * types are resolved.\r\n * @type {ProtoBuf.Element}\r\n * @expose\r\n */\r\n this.keyElement = null;\r\n\r\n // Convert field names to camel case notation if the override is set\r\n if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))\r\n this.name = ProtoBuf.Util.toCamelCase(this.name);\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.Field.prototype\r\n * @inner\r\n */\r\n var FieldPrototype = Field.prototype = Object.create(T.prototype);\r\n\r\n /**\r\n * Builds the field.\r\n * @override\r\n * @expose\r\n */\r\n FieldPrototype.build = function() {\r\n this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);\r\n if (this.map)\r\n this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);\r\n\r\n // In proto3, fields do not have field presence, and every field is set to\r\n // its type's default value (\"\", 0, 0.0, or false).\r\n if (this.syntax === 'proto3' && !this.repeated && !this.map)\r\n this.defaultValue = Element.defaultFieldValue(this.type);\r\n\r\n // Otherwise, default values are present when explicitly specified\r\n else if (typeof this.options['default'] !== 'undefined')\r\n this.defaultValue = this.verifyValue(this.options['default']);\r\n };\r\n\r\n /**\r\n * Checks if the given value can be set for this field.\r\n * @param {*} value Value to check\r\n * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.\r\n * @return {*} Verified, maybe adjusted, value\r\n * @throws {Error} If the value cannot be set for this field\r\n * @expose\r\n */\r\n FieldPrototype.verifyValue = function(value, skipRepeated) {\r\n skipRepeated = skipRepeated || false;\r\n var self = this;\r\n function fail(val, msg) {\r\n throw Error(\"Illegal value for \"+self.toString(true)+\" of type \"+self.type.name+\": \"+val+\" (\"+msg+\")\");\r\n }\r\n if (value === null) { // NULL values for optional fields\r\n if (this.required)\r\n fail(typeof value, \"required\");\r\n if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES[\"message\"])\r\n fail(typeof value, \"proto3 field without field presence cannot be null\");\r\n return null;\r\n }\r\n var i;\r\n if (this.repeated && !skipRepeated) { // Repeated values as arrays\r\n if (!Array.isArray(value))\r\n value = [value];\r\n var res = [];\r\n for (i=0; i 0;\r\n\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n return value.remaining() > 0;\r\n\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n return value !== 0;\r\n\r\n case ProtoBuf.TYPES[\"message\"]:\r\n return value !== null;\r\n default:\r\n return true;\r\n }\r\n };\r\n\r\n /**\r\n * Encodes the specified field value to the specified buffer.\r\n * @param {*} value Verified field value\r\n * @param {ByteBuffer} buffer ByteBuffer to encode to\r\n * @param {!ProtoBuf.Builder.Message} message Runtime message\r\n * @return {ByteBuffer} The ByteBuffer for chaining\r\n * @throws {Error} If the field cannot be encoded\r\n * @expose\r\n */\r\n FieldPrototype.encode = function(value, buffer, message) {\r\n if (this.type === null || typeof this.type !== 'object')\r\n throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(true)+\": \"+this.type);\r\n if (value === null || (this.repeated && value.length == 0))\r\n return buffer; // Optional omitted\r\n try {\r\n if (this.repeated) {\r\n var i;\r\n // \"Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire\r\n // types) can be declared 'packed'.\"\r\n if (this.options[\"packed\"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r\n // \"All of the elements of the field are packed into a single key-value pair with wire type 2\r\n // (length-delimited). Each element is encoded the same way it would be normally, except without a\r\n // tag preceding it.\"\r\n buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r\n buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1\r\n var start = buffer.offset; // Remember where the contents begin\r\n for (i=0; i 1) { // We need to move the contents\r\n var contents = buffer.slice(start, buffer.offset);\r\n start += varintLen-1;\r\n buffer.offset = start;\r\n buffer.append(contents);\r\n }\r\n buffer.writeVarint32(len, start-varintLen);\r\n } else {\r\n // \"If your message definition has repeated elements (without the [packed=true] option), the encoded\r\n // message has zero or more key-value pairs with the same tag number\"\r\n for (i=0; i= 0) {\r\n n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r\n ni = 0;\r\n for (i=0; i= 0) {\r\n if (!skipRepeated) {\r\n nBytes = buffer.readVarint32();\r\n nBytes = buffer.offset + nBytes; // Limit\r\n var values = [];\r\n while (buffer.offset < nBytes)\r\n values.push(this.decode(this.type.wireType, buffer, true));\r\n return values;\r\n }\r\n // Read the next value otherwise...\r\n }\r\n\r\n // Handle maps.\r\n if (this.map) {\r\n // Read one (key, value) submessage, and return [key, value]\r\n var key = Element.defaultFieldValue(this.keyType);\r\n value = Element.defaultFieldValue(this.type);\r\n\r\n // Read the length\r\n nBytes = buffer.readVarint32();\r\n if (buffer.remaining() < nBytes)\r\n throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+nBytes+\" required but got only \"+buffer.remaining());\r\n\r\n // Get a sub-buffer of this key/value submessage\r\n var msgbuf = buffer.clone();\r\n msgbuf.limit = msgbuf.offset + nBytes;\r\n buffer.offset += nBytes;\r\n\r\n while (msgbuf.remaining() > 0) {\r\n var tag = msgbuf.readVarint32();\r\n wireType = tag & 0x07;\r\n var id = tag >>> 3;\r\n if (id === 1) {\r\n key = this.keyElement.decode(msgbuf, wireType, id);\r\n } else if (id === 2) {\r\n value = this.element.decode(msgbuf, wireType, id);\r\n } else {\r\n throw Error(\"Unexpected tag in map field key/value submessage\");\r\n }\r\n }\r\n\r\n return [key, value];\r\n }\r\n\r\n // Handle singular and non-packed repeated field values.\r\n return this.element.decode(buffer, wireType, this.id);\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.Field\r\n * @expose\r\n */\r\n Reflect.Message.Field = Field;\r\n\r\n /**\r\n * Constructs a new Message ExtensionField.\r\n * @exports ProtoBuf.Reflect.Message.ExtensionField\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Message} message Message reference\r\n * @param {string} rule Rule, one of requried, optional, repeated\r\n * @param {string} type Data type, e.g. int32\r\n * @param {string} name Field name\r\n * @param {number} id Unique field id\r\n * @param {!Object.=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Message.Field\r\n */\r\n var ExtensionField = function(builder, message, rule, type, name, id, options) {\r\n Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options);\r\n\r\n /**\r\n * Extension reference.\r\n * @type {!ProtoBuf.Reflect.Extension}\r\n * @expose\r\n */\r\n this.extension;\r\n };\r\n\r\n // Extends Field\r\n ExtensionField.prototype = Object.create(Field.prototype);\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.ExtensionField\r\n * @expose\r\n */\r\n Reflect.Message.ExtensionField = ExtensionField;\r\n\r\n /**\r\n * Constructs a new Message OneOf.\r\n * @exports ProtoBuf.Reflect.Message.OneOf\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Message} message Message reference\r\n * @param {string} name OneOf name\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var OneOf = function(builder, message, name) {\r\n T.call(this, builder, message, name);\r\n\r\n /**\r\n * Enclosed fields.\r\n * @type {!Array.}\r\n * @expose\r\n */\r\n this.fields = [];\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.OneOf\r\n * @expose\r\n */\r\n Reflect.Message.OneOf = OneOf;\r\n\r\n /**\r\n * Constructs a new Enum.\r\n * @exports ProtoBuf.Reflect.Enum\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object\r\n * @param {string} name Enum name\r\n * @param {Object.=} options Enum options\r\n * @param {string?} syntax The syntax level (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Namespace\r\n */\r\n var Enum = function(builder, parent, name, options, syntax) {\r\n Namespace.call(this, builder, parent, name, options, syntax);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Enum\";\r\n\r\n /**\r\n * Runtime enum object.\r\n * @type {Object.|null}\r\n * @expose\r\n */\r\n this.object = null;\r\n };\r\n\r\n /**\r\n * Gets the string name of an enum value.\r\n * @param {!ProtoBuf.Builder.Enum} enm Runtime enum\r\n * @param {number} value Enum value\r\n * @returns {?string} Name or `null` if not present\r\n * @expose\r\n */\r\n Enum.getName = function(enm, value) {\r\n var keys = Object.keys(enm);\r\n for (var i=0, key; i}\r\n * @expose\r\n */\r\n EnumPrototype.build = function(rebuild) {\r\n if (this.object && !rebuild)\r\n return this.object;\r\n var enm = new ProtoBuf.Builder.Enum(),\r\n values = this.getChildren(Enum.Value);\r\n for (var i=0, k=values.length; i=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Namespace\r\n */\r\n var Service = function(builder, root, name, options) {\r\n Namespace.call(this, builder, root, name, options);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Service\";\r\n\r\n /**\r\n * Built runtime service class.\r\n * @type {?function(new:ProtoBuf.Builder.Service)}\r\n */\r\n this.clazz = null;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.prototype\r\n * @inner\r\n */\r\n var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r\n\r\n /**\r\n * Builds the service and returns the runtime counterpart, which is a fully functional class.\r\n * @see ProtoBuf.Builder.Service\r\n * @param {boolean=} rebuild Whether to rebuild or not\r\n * @return {Function} Service class\r\n * @throws {Error} If the message cannot be built\r\n * @expose\r\n */\r\n ServicePrototype.build = function(rebuild) {\r\n if (this.clazz && !rebuild)\r\n return this.clazz;\r\n\r\n // Create the runtime Service class in its own scope\r\n return this.clazz = (function(ProtoBuf, T) {\r\n\r\n /**\r\n * Constructs a new runtime Service.\r\n * @name ProtoBuf.Builder.Service\r\n * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message\r\n * @class Barebone of all runtime services.\r\n * @constructor\r\n * @throws {Error} If the service cannot be created\r\n */\r\n var Service = function(rpcImpl) {\r\n ProtoBuf.Builder.Service.call(this);\r\n\r\n /**\r\n * Service implementation.\r\n * @name ProtoBuf.Builder.Service#rpcImpl\r\n * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r\n * @expose\r\n */\r\n this.rpcImpl = rpcImpl || function(name, msg, callback) {\r\n // This is what a user has to implement: A function receiving the method name, the actual message to\r\n // send (type checked) and the callback that's either provided with the error as its first\r\n // argument or null and the actual response message.\r\n setTimeout(callback.bind(this, Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")), 0); // Must be async!\r\n };\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Builder.Service.prototype\r\n * @inner\r\n */\r\n var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);\r\n\r\n /**\r\n * Asynchronously performs an RPC call using the given RPC implementation.\r\n * @name ProtoBuf.Builder.Service.[Method]\r\n * @function\r\n * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation\r\n * @param {ProtoBuf.Builder.Message} req Request\r\n * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r\n * the error if any and the response either as a pre-parsed message or as its raw bytes\r\n * @abstract\r\n */\r\n\r\n /**\r\n * Asynchronously performs an RPC call using the instance's RPC implementation.\r\n * @name ProtoBuf.Builder.Service#[Method]\r\n * @function\r\n * @param {ProtoBuf.Builder.Message} req Request\r\n * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r\n * the error if any and the response either as a pre-parsed message or as its raw bytes\r\n * @abstract\r\n */\r\n\r\n var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);\r\n for (var i=0; i}\r\n * @expose\r\n */\r\n var $optionsS; // cc needs this\r\n\r\n /**\r\n * Service options.\r\n * @name ProtoBuf.Builder.Service#$options\r\n * @type {Object.}\r\n * @expose\r\n */\r\n var $options;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Service.$type\r\n * @type {!ProtoBuf.Reflect.Service}\r\n * @expose\r\n */\r\n var $typeS;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Service#$type\r\n * @type {!ProtoBuf.Reflect.Service}\r\n * @expose\r\n */\r\n var $type;\r\n\r\n if (Object.defineProperty)\r\n Object.defineProperty(Service, \"$options\", { \"value\": T.buildOpt() }),\r\n Object.defineProperty(ServicePrototype, \"$options\", { \"value\": Service[\"$options\"] }),\r\n Object.defineProperty(Service, \"$type\", { \"value\": T }),\r\n Object.defineProperty(ServicePrototype, \"$type\", { \"value\": T });\r\n\r\n return Service;\r\n\r\n })(ProtoBuf, this);\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service\r\n * @expose\r\n */\r\n Reflect.Service = Service;\r\n\r\n /**\r\n * Abstract service method.\r\n * @exports ProtoBuf.Reflect.Service.Method\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Service} svc Service\r\n * @param {string} name Method name\r\n * @param {Object.=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var Method = function(builder, svc, name, options) {\r\n T.call(this, builder, svc, name);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Service.Method\";\r\n\r\n /**\r\n * Options.\r\n * @type {Object.}\r\n * @expose\r\n */\r\n this.options = options || {};\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.Method.prototype\r\n * @inner\r\n */\r\n var MethodPrototype = Method.prototype = Object.create(T.prototype);\r\n\r\n /**\r\n * Builds the method's '$options' property.\r\n * @name ProtoBuf.Reflect.Service.Method#buildOpt\r\n * @function\r\n * @return {Object.}\r\n */\r\n MethodPrototype.buildOpt = NamespacePrototype.buildOpt;\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.Method\r\n * @expose\r\n */\r\n Reflect.Service.Method = Method;\r\n\r\n /**\r\n * RPC service method.\r\n * @exports ProtoBuf.Reflect.Service.RPCMethod\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Service} svc Service\r\n * @param {string} name Method name\r\n * @param {string} request Request message name\r\n * @param {string} response Response message name\r\n * @param {boolean} request_stream Whether requests are streamed\r\n * @param {boolean} response_stream Whether responses are streamed\r\n * @param {Object.=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Service.Method\r\n */\r\n var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {\r\n Method.call(this, builder, svc, name, options);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Service.RPCMethod\";\r\n\r\n /**\r\n * Request message name.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.requestName = request;\r\n\r\n /**\r\n * Response message name.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.responseName = response;\r\n\r\n /**\r\n * Whether requests are streamed\r\n * @type {bool}\r\n * @expose\r\n */\r\n this.requestStream = request_stream;\r\n\r\n /**\r\n * Whether responses are streamed\r\n * @type {bool}\r\n * @expose\r\n */\r\n this.responseStream = response_stream;\r\n\r\n /**\r\n * Resolved request message type.\r\n * @type {ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response message type.\r\n * @type {ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n this.resolvedResponseType = null;\r\n };\r\n\r\n // Extends Method\r\n RPCMethod.prototype = Object.create(Method.prototype);\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.RPCMethod\r\n * @expose\r\n */\r\n Reflect.Service.RPCMethod = RPCMethod;\r\n\r\n return Reflect;\r\n\r\n })(ProtoBuf);\r\n\r\n /**\r\n * @alias ProtoBuf.Builder\r\n * @expose\r\n */\r\n ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {\r\n \"use strict\";\r\n\r\n /**\r\n * Constructs a new Builder.\r\n * @exports ProtoBuf.Builder\r\n * @class Provides the functionality to build protocol messages.\r\n * @param {Object.=} options Options\r\n * @constructor\r\n */\r\n var Builder = function(options) {\r\n\r\n /**\r\n * Namespace.\r\n * @type {ProtoBuf.Reflect.Namespace}\r\n * @expose\r\n */\r\n this.ns = new Reflect.Namespace(this, null, \"\"); // Global namespace\r\n\r\n /**\r\n * Namespace pointer.\r\n * @type {ProtoBuf.Reflect.T}\r\n * @expose\r\n */\r\n this.ptr = this.ns;\r\n\r\n /**\r\n * Resolved flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.resolved = false;\r\n\r\n /**\r\n * The current building result.\r\n * @type {Object.|null}\r\n * @expose\r\n */\r\n this.result = null;\r\n\r\n /**\r\n * Imported files.\r\n * @type {Array.}\r\n * @expose\r\n */\r\n this.files = {};\r\n\r\n /**\r\n * Import root override.\r\n * @type {?string}\r\n * @expose\r\n */\r\n this.importRoot = null;\r\n\r\n /**\r\n * Options.\r\n * @type {!Object.}\r\n * @expose\r\n */\r\n this.options = options || {};\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Builder.prototype\r\n * @inner\r\n */\r\n var BuilderPrototype = Builder.prototype;\r\n\r\n // ----- Definition tests -----\r\n\r\n /**\r\n * Tests if a definition most likely describes a message.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isMessage = function(def) {\r\n // Messages require a string name\r\n if (typeof def[\"name\"] !== 'string')\r\n return false;\r\n // Messages do not contain values (enum) or rpc methods (service)\r\n if (typeof def[\"values\"] !== 'undefined' || typeof def[\"rpc\"] !== 'undefined')\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes a message field.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isMessageField = function(def) {\r\n // Message fields require a string rule, name and type and an id\r\n if (typeof def[\"rule\"] !== 'string' || typeof def[\"name\"] !== 'string' || typeof def[\"type\"] !== 'string' || typeof def[\"id\"] === 'undefined')\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes an enum.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isEnum = function(def) {\r\n // Enums require a string name\r\n if (typeof def[\"name\"] !== 'string')\r\n return false;\r\n // Enums require at least one value\r\n if (typeof def[\"values\"] === 'undefined' || !Array.isArray(def[\"values\"]) || def[\"values\"].length === 0)\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes a service.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isService = function(def) {\r\n // Services require a string name and an rpc object\r\n if (typeof def[\"name\"] !== 'string' || typeof def[\"rpc\"] !== 'object' || !def[\"rpc\"])\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes an extended message\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isExtend = function(def) {\r\n // Extends rquire a string ref\r\n if (typeof def[\"ref\"] !== 'string')\r\n return false;\r\n return true;\r\n };\r\n\r\n // ----- Building -----\r\n\r\n /**\r\n * Resets the pointer to the root namespace.\r\n * @returns {!ProtoBuf.Builder} this\r\n * @expose\r\n */\r\n BuilderPrototype.reset = function() {\r\n this.ptr = this.ns;\r\n return this;\r\n };\r\n\r\n /**\r\n * Defines a namespace on top of the current pointer position and places the pointer on it.\r\n * @param {string} namespace\r\n * @return {!ProtoBuf.Builder} this\r\n * @expose\r\n */\r\n BuilderPrototype.define = function(namespace) {\r\n if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))\r\n throw Error(\"illegal namespace: \"+namespace);\r\n namespace.split(\".\").forEach(function(part) {\r\n var ns = this.ptr.getChild(part);\r\n if (ns === null) // Keep existing\r\n this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));\r\n this.ptr = ns;\r\n }, this);\r\n return this;\r\n };\r\n\r\n /**\r\n * Creates the specified definitions at the current pointer position.\r\n * @param {!Array.} defs Messages, enums or services to create\r\n * @returns {!ProtoBuf.Builder} this\r\n * @throws {Error} If a message definition is invalid\r\n * @expose\r\n */\r\n BuilderPrototype.create = function(defs) {\r\n if (!defs)\r\n return this; // Nothing to create\r\n if (!Array.isArray(defs))\r\n defs = [defs];\r\n else {\r\n if (defs.length === 0)\r\n return this;\r\n defs = defs.slice();\r\n }\r\n\r\n // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.\r\n var stack = [defs];\r\n while (stack.length > 0) {\r\n defs = stack.pop();\r\n\r\n if (!Array.isArray(defs)) // Stack always contains entire namespaces\r\n throw Error(\"not a valid namespace: \"+JSON.stringify(defs));\r\n\r\n while (defs.length > 0) {\r\n var def = defs.shift(); // Namespaces always contain an array of messages, enums and services\r\n\r\n if (Builder.isMessage(def)) {\r\n var obj = new Reflect.Message(this, this.ptr, def[\"name\"], def[\"options\"], def[\"isGroup\"], def[\"syntax\"]);\r\n\r\n // Create OneOfs\r\n var oneofs = {};\r\n if (def[\"oneofs\"])\r\n Object.keys(def[\"oneofs\"]).forEach(function(name) {\r\n obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));\r\n }, this);\r\n\r\n // Create fields\r\n if (def[\"fields\"])\r\n def[\"fields\"].forEach(function(fld) {\r\n if (obj.getChild(fld[\"id\"]|0) !== null)\r\n throw Error(\"duplicate or invalid field id in \"+obj.name+\": \"+fld['id']);\r\n if (fld[\"options\"] && typeof fld[\"options\"] !== 'object')\r\n throw Error(\"illegal field options in \"+obj.name+\"#\"+fld[\"name\"]);\r\n var oneof = null;\r\n if (typeof fld[\"oneof\"] === 'string' && !(oneof = oneofs[fld[\"oneof\"]]))\r\n throw Error(\"illegal oneof in \"+obj.name+\"#\"+fld[\"name\"]+\": \"+fld[\"oneof\"]);\r\n fld = new Reflect.Message.Field(this, obj, fld[\"rule\"], fld[\"keytype\"], fld[\"type\"], fld[\"name\"], fld[\"id\"], fld[\"options\"], oneof, def[\"syntax\"]);\r\n if (oneof)\r\n oneof.fields.push(fld);\r\n obj.addChild(fld);\r\n }, this);\r\n\r\n // Push children to stack\r\n var subObj = [];\r\n if (def[\"enums\"])\r\n def[\"enums\"].forEach(function(enm) {\r\n subObj.push(enm);\r\n });\r\n if (def[\"messages\"])\r\n def[\"messages\"].forEach(function(msg) {\r\n subObj.push(msg);\r\n });\r\n if (def[\"services\"])\r\n def[\"services\"].forEach(function(svc) {\r\n subObj.push(svc);\r\n });\r\n\r\n // Set extension ranges\r\n if (def[\"extensions\"]) {\r\n if (typeof def[\"extensions\"][0] === 'number') // pre 5.0.1\r\n obj.extensions = [ def[\"extensions\"] ];\r\n else\r\n obj.extensions = def[\"extensions\"];\r\n }\r\n\r\n // Create on top of current namespace\r\n this.ptr.addChild(obj);\r\n if (subObj.length > 0) {\r\n stack.push(defs); // Push the current level back\r\n defs = subObj; // Continue processing sub level\r\n subObj = null;\r\n this.ptr = obj; // And move the pointer to this namespace\r\n obj = null;\r\n continue;\r\n }\r\n subObj = null;\r\n\r\n } else if (Builder.isEnum(def)) {\r\n\r\n obj = new Reflect.Enum(this, this.ptr, def[\"name\"], def[\"options\"], def[\"syntax\"]);\r\n def[\"values\"].forEach(function(val) {\r\n obj.addChild(new Reflect.Enum.Value(this, obj, val[\"name\"], val[\"id\"]));\r\n }, this);\r\n this.ptr.addChild(obj);\r\n\r\n } else if (Builder.isService(def)) {\r\n\r\n obj = new Reflect.Service(this, this.ptr, def[\"name\"], def[\"options\"]);\r\n Object.keys(def[\"rpc\"]).forEach(function(name) {\r\n var mtd = def[\"rpc\"][name];\r\n obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd[\"request\"], mtd[\"response\"], !!mtd[\"request_stream\"], !!mtd[\"response_stream\"], mtd[\"options\"]));\r\n }, this);\r\n this.ptr.addChild(obj);\r\n\r\n } else if (Builder.isExtend(def)) {\r\n\r\n obj = this.ptr.resolve(def[\"ref\"], true);\r\n if (obj) {\r\n def[\"fields\"].forEach(function(fld) {\r\n if (obj.getChild(fld['id']|0) !== null)\r\n throw Error(\"duplicate extended field id in \"+obj.name+\": \"+fld['id']);\r\n // Check if field id is allowed to be extended\r\n if (obj.extensions) {\r\n var valid = false;\r\n obj.extensions.forEach(function(range) {\r\n if (fld[\"id\"] >= range[0] && fld[\"id\"] <= range[1])\r\n valid = true;\r\n });\r\n if (!valid)\r\n throw Error(\"illegal extended field id in \"+obj.name+\": \"+fld['id']+\" (not within valid ranges)\");\r\n }\r\n // Convert extension field names to camel case notation if the override is set\r\n var name = fld[\"name\"];\r\n if (this.options['convertFieldsToCamelCase'])\r\n name = ProtoBuf.Util.toCamelCase(name);\r\n // see #161: Extensions use their fully qualified name as their runtime key and...\r\n var field = new Reflect.Message.ExtensionField(this, obj, fld[\"rule\"], fld[\"type\"], this.ptr.fqn()+'.'+name, fld[\"id\"], fld[\"options\"]);\r\n // ...are added on top of the current namespace as an extension which is used for\r\n // resolving their type later on (the extension always keeps the original name to\r\n // prevent naming collisions)\r\n var ext = new Reflect.Extension(this, this.ptr, fld[\"name\"], field);\r\n field.extension = ext;\r\n this.ptr.addChild(ext);\r\n obj.addChild(field);\r\n }, this);\r\n\r\n } else if (!/\\.?google\\.protobuf\\./.test(def[\"ref\"])) // Silently skip internal extensions\r\n throw Error(\"extended message \"+def[\"ref\"]+\" is not defined\");\r\n\r\n } else\r\n throw Error(\"not a valid definition: \"+JSON.stringify(def));\r\n\r\n def = null;\r\n obj = null;\r\n }\r\n // Break goes here\r\n defs = null;\r\n this.ptr = this.ptr.parent; // Namespace done, continue at parent\r\n }\r\n this.resolved = false; // Require re-resolve\r\n this.result = null; // Require re-build\r\n return this;\r\n };\r\n\r\n /**\r\n * Propagates syntax to all children.\r\n * @param {!Object} parent\r\n * @inner\r\n */\r\n function propagateSyntax(parent) {\r\n if (parent['messages']) {\r\n parent['messages'].forEach(function(child) {\r\n child[\"syntax\"] = parent[\"syntax\"];\r\n propagateSyntax(child);\r\n });\r\n }\r\n if (parent['enums']) {\r\n parent['enums'].forEach(function(child) {\r\n child[\"syntax\"] = parent[\"syntax\"];\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Imports another definition into this builder.\r\n * @param {Object.} json Parsed import\r\n * @param {(string|{root: string, file: string})=} filename Imported file name\r\n * @returns {!ProtoBuf.Builder} this\r\n * @throws {Error} If the definition or file cannot be imported\r\n * @expose\r\n */\r\n BuilderPrototype[\"import\"] = function(json, filename) {\r\n var delim = '/';\r\n\r\n // Make sure to skip duplicate imports\r\n\r\n if (typeof filename === 'string') {\r\n\r\n if (ProtoBuf.Util.IS_NODE)\r\n filename = require(\"path\")['resolve'](filename);\r\n if (this.files[filename] === true)\r\n return this.reset();\r\n this.files[filename] = true;\r\n\r\n } else if (typeof filename === 'object') { // Object with root, file.\r\n\r\n var root = filename.root;\r\n if (ProtoBuf.Util.IS_NODE)\r\n root = require(\"path\")['resolve'](root);\r\n if (root.indexOf(\"\\\\\") >= 0 || filename.file.indexOf(\"\\\\\") >= 0)\r\n delim = '\\\\';\r\n var fname;\r\n if (ProtoBuf.Util.IS_NODE)\r\n fname = require(\"path\")['join'](root, filename.file);\r\n else\r\n fname = root + delim + filename.file;\r\n if (this.files[fname] === true)\r\n return this.reset();\r\n this.files[fname] = true;\r\n }\r\n\r\n // Import imports\r\n\r\n if (json['imports'] && json['imports'].length > 0) {\r\n var importRoot,\r\n resetRoot = false;\r\n\r\n if (typeof filename === 'object') { // If an import root is specified, override\r\n\r\n this.importRoot = filename[\"root\"]; resetRoot = true; // ... and reset afterwards\r\n importRoot = this.importRoot;\r\n filename = filename[\"file\"];\r\n if (importRoot.indexOf(\"\\\\\") >= 0 || filename.indexOf(\"\\\\\") >= 0)\r\n delim = '\\\\';\r\n\r\n } else if (typeof filename === 'string') {\r\n\r\n if (this.importRoot) // If import root is overridden, use it\r\n importRoot = this.importRoot;\r\n else { // Otherwise compute from filename\r\n if (filename.indexOf(\"/\") >= 0) { // Unix\r\n importRoot = filename.replace(/\\/[^\\/]*$/, \"\");\r\n if (/* /file.proto */ importRoot === \"\")\r\n importRoot = \"/\";\r\n } else if (filename.indexOf(\"\\\\\") >= 0) { // Windows\r\n importRoot = filename.replace(/\\\\[^\\\\]*$/, \"\");\r\n delim = '\\\\';\r\n } else\r\n importRoot = \".\";\r\n }\r\n\r\n } else\r\n importRoot = null;\r\n\r\n for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned.\r\n * @returns {!ProtoBuf.Builder.Message|!Object.}\r\n * @throws {Error} If a type could not be resolved\r\n * @expose\r\n */\r\n BuilderPrototype.build = function(path) {\r\n this.reset();\r\n if (!this.resolved)\r\n this.resolveAll(),\r\n this.resolved = true,\r\n this.result = null; // Require re-build\r\n if (this.result === null) // (Re-)Build\r\n this.result = this.ns.build();\r\n if (!path)\r\n return this.result;\r\n var part = typeof path === 'string' ? path.split(\".\") : path,\r\n ptr = this.result; // Build namespace pointer (no hasChild etc.)\r\n for (var i=0; i=} contents Initial contents\r\n * @constructor\r\n */\r\n var Map = function(field, contents) {\r\n if (!field.map)\r\n throw Error(\"field is not a map\");\r\n\r\n /**\r\n * The field corresponding to this map.\r\n * @type {!ProtoBuf.Reflect.Field}\r\n */\r\n this.field = field;\r\n\r\n /**\r\n * Element instance corresponding to key type.\r\n * @type {!ProtoBuf.Reflect.Element}\r\n */\r\n this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);\r\n\r\n /**\r\n * Element instance corresponding to value type.\r\n * @type {!ProtoBuf.Reflect.Element}\r\n */\r\n this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);\r\n\r\n /**\r\n * Internal map: stores mapping of (string form of key) -> (key, value)\r\n * pair.\r\n *\r\n * We provide map semantics for arbitrary key types, but we build on top\r\n * of an Object, which has only string keys. In order to avoid the need\r\n * to convert a string key back to its native type in many situations,\r\n * we store the native key value alongside the value. Thus, we only need\r\n * a one-way mapping from a key type to its string form that guarantees\r\n * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1\r\n * === K2).\r\n *\r\n * @type {!Object}\r\n */\r\n this.map = {};\r\n\r\n /**\r\n * Returns the number of elements in the map.\r\n */\r\n Object.defineProperty(this, \"size\", {\r\n get: function() { return Object.keys(this.map).length; }\r\n });\r\n\r\n // Fill initial contents from a raw object.\r\n if (contents) {\r\n var keys = Object.keys(contents);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = this.keyElem.valueFromString(keys[i]);\r\n var val = this.valueElem.verifyValue(contents[keys[i]]);\r\n this.map[this.keyElem.valueToString(key)] =\r\n { key: key, value: val };\r\n }\r\n }\r\n };\r\n\r\n var MapPrototype = Map.prototype;\r\n\r\n /**\r\n * Helper: return an iterator over an array.\r\n * @param {!Array<*>} arr the array\r\n * @returns {!Object} an iterator\r\n * @inner\r\n */\r\n function arrayIterator(arr) {\r\n var idx = 0;\r\n return {\r\n next: function() {\r\n if (idx < arr.length)\r\n return { done: false, value: arr[idx++] };\r\n return { done: true };\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clears the map.\r\n */\r\n MapPrototype.clear = function() {\r\n this.map = {};\r\n };\r\n\r\n /**\r\n * Deletes a particular key from the map.\r\n * @returns {boolean} Whether any entry with this key was deleted.\r\n */\r\n MapPrototype[\"delete\"] = function(key) {\r\n var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n var hadKey = keyValue in this.map;\r\n delete this.map[keyValue];\r\n return hadKey;\r\n };\r\n\r\n /**\r\n * Returns an iterator over [key, value] pairs in the map.\r\n * @returns {Object} The iterator\r\n */\r\n MapPrototype.entries = function() {\r\n var entries = [];\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0, entry; i < strKeys.length; i++)\r\n entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);\r\n return arrayIterator(entries);\r\n };\r\n\r\n /**\r\n * Returns an iterator over keys in the map.\r\n * @returns {Object} The iterator\r\n */\r\n MapPrototype.keys = function() {\r\n var keys = [];\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0; i < strKeys.length; i++)\r\n keys.push(this.map[strKeys[i]].key);\r\n return arrayIterator(keys);\r\n };\r\n\r\n /**\r\n * Returns an iterator over values in the map.\r\n * @returns {!Object} The iterator\r\n */\r\n MapPrototype.values = function() {\r\n var values = [];\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0; i < strKeys.length; i++)\r\n values.push(this.map[strKeys[i]].value);\r\n return arrayIterator(values);\r\n };\r\n\r\n /**\r\n * Iterates over entries in the map, calling a function on each.\r\n * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments.\r\n * @param {Object=} thisArg The `this` value for the callback\r\n */\r\n MapPrototype.forEach = function(cb, thisArg) {\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0, entry; i < strKeys.length; i++)\r\n cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);\r\n };\r\n\r\n /**\r\n * Sets a key in the map to the given value.\r\n * @param {*} key The key\r\n * @param {*} value The value\r\n * @returns {!ProtoBuf.Map} The map instance\r\n */\r\n MapPrototype.set = function(key, value) {\r\n var keyValue = this.keyElem.verifyValue(key);\r\n var valValue = this.valueElem.verifyValue(value);\r\n this.map[this.keyElem.valueToString(keyValue)] =\r\n { key: keyValue, value: valValue };\r\n return this;\r\n };\r\n\r\n /**\r\n * Gets the value corresponding to a key in the map.\r\n * @param {*} key The key\r\n * @returns {*|undefined} The value, or `undefined` if key not present\r\n */\r\n MapPrototype.get = function(key) {\r\n var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n if (!(keyValue in this.map))\r\n return undefined;\r\n return this.map[keyValue].value;\r\n };\r\n\r\n /**\r\n * Determines whether the given key is present in the map.\r\n * @param {*} key The key\r\n * @returns {boolean} `true` if the key is present\r\n */\r\n MapPrototype.has = function(key) {\r\n var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n return (keyValue in this.map);\r\n };\r\n\r\n return Map;\r\n })(ProtoBuf, ProtoBuf.Reflect);\r\n\r\n\r\n /**\r\n * Constructs a new empty Builder.\r\n * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf\r\n * @return {!ProtoBuf.Builder} Builder\r\n * @expose\r\n */\r\n ProtoBuf.newBuilder = function(options) {\r\n options = options || {};\r\n if (typeof options['convertFieldsToCamelCase'] === 'undefined')\r\n options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;\r\n if (typeof options['populateAccessors'] === 'undefined')\r\n options['populateAccessors'] = ProtoBuf.populateAccessors;\r\n return new ProtoBuf.Builder(options);\r\n };\r\n\r\n /**\r\n * Loads a .json definition and returns the Builder.\r\n * @param {!*|string} json JSON definition\r\n * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r\n * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r\n * @return {ProtoBuf.Builder} Builder to create new messages\r\n * @throws {Error} If the definition cannot be parsed or built\r\n * @expose\r\n */\r\n ProtoBuf.loadJson = function(json, builder, filename) {\r\n if (typeof builder === 'string' || (builder && typeof builder[\"file\"] === 'string' && typeof builder[\"root\"] === 'string'))\r\n filename = builder,\r\n builder = null;\r\n if (!builder || typeof builder !== 'object')\r\n builder = ProtoBuf.newBuilder();\r\n if (typeof json === 'string')\r\n json = JSON.parse(json);\r\n builder[\"import\"](json, filename);\r\n builder.resolveAll();\r\n return builder;\r\n };\r\n\r\n /**\r\n * Loads a .json file and returns the Builder.\r\n * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with\r\n * an overridden 'root' path for all imported files.\r\n * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r\n * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r\n * file will be read synchronously and this function will return the Builder.\r\n * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r\n * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r\n * request has failed), else undefined\r\n * @expose\r\n */\r\n ProtoBuf.loadJsonFile = function(filename, callback, builder) {\r\n if (callback && typeof callback === 'object')\r\n builder = callback,\r\n callback = null;\r\n else if (!callback || typeof callback !== 'function')\r\n callback = null;\r\n if (callback)\r\n return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename[\"root\"]+\"/\"+filename[\"file\"], function(contents) {\r\n if (contents === null) {\r\n callback(Error(\"Failed to fetch file\"));\r\n return;\r\n }\r\n try {\r\n callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));\r\n } catch (e) {\r\n callback(e);\r\n }\r\n });\r\n var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename[\"root\"]+\"/\"+filename[\"file\"] : filename);\r\n return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);\r\n };\r\n\r\n return ProtoBuf;\r\n});\r\n","module.exports = require(\"protobufjs/dist/protobuf-light\").newBuilder({})['import']({\n \"package\": \"push_server.messages2\",\n \"syntax\": \"proto2\",\n \"options\": {\n \"objc_class_prefix\": \"AVIM\"\n },\n \"messages\": [\n {\n \"name\": \"JsonObjectMessage\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 1\n }\n ]\n },\n {\n \"name\": \"UnreadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"required\",\n \"type\": \"int32\",\n \"name\": \"unread\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentioned\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 9\n }\n ]\n },\n {\n \"name\": \"LogItem\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"msgId\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"ackAt\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"readAt\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 8\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"bin\",\n \"id\": 10\n }\n ]\n },\n {\n \"name\": \"DataCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"ids\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"msg\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"offline\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"SessionCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"ua\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"r\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"tag\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"deviceId\",\n \"id\": 7\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"sessionPeerIds\",\n \"id\": 8\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"onlineSessionPeerIds\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"st\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"stTtl\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"deviceToken\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"sp\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"detail\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastUnreadNotifTime\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastPatchTime\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"configBitmap\",\n \"id\": 19\n }\n ]\n },\n {\n \"name\": \"ErrorCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 1\n },\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"appCode\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"detail\",\n \"id\": 4\n }\n ]\n },\n {\n \"name\": \"DirectCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"msg\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"fromPeerId\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"offline\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"hasMore\",\n \"id\": 6\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"toPeerIds\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"r\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"id\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"dt\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"roomId\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"pushData\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"will\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 19\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 20\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 21\n }\n ]\n },\n {\n \"name\": \"AckCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uid\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"fromts\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"tots\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"type\",\n \"id\": 9\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"ids\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"appCode\",\n \"id\": 11\n }\n ]\n },\n {\n \"name\": \"UnreadCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"UnreadTuple\",\n \"name\": \"convs\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"notifTime\",\n \"id\": 2\n }\n ]\n },\n {\n \"name\": \"ConvCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"m\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"unique\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cdate\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"initBy\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"sort\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"limit\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"skip\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"flag\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"count\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"udate\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"statusSub\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"statusPub\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"statusTTL\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uniqueId\",\n \"id\": 19\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"targetClientId\",\n \"id\": 20\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxReadTimestamp\",\n \"id\": 21\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxAckTimestamp\",\n \"id\": 22\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"queryAllMembers\",\n \"id\": 23\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"MaxReadTuple\",\n \"name\": \"maxReadTuples\",\n \"id\": 24\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"cids\",\n \"id\": 25\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"results\",\n \"id\": 100\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"where\",\n \"id\": 101\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"attr\",\n \"id\": 103\n }\n ]\n },\n {\n \"name\": \"RoomCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"roomId\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 5\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"roomPeerIds\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"byPeerId\",\n \"id\": 7\n }\n ]\n },\n {\n \"name\": \"LogsCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"l\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"limit\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"tt\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"tmid\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"checksum\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"stored\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"QueryDirection\",\n \"name\": \"direction\",\n \"id\": 10,\n \"options\": {\n \"default\": \"OLD\"\n }\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"tIncluded\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"ttIncluded\",\n \"id\": 12\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"LogItem\",\n \"name\": \"logs\",\n \"id\": 105\n }\n ],\n \"enums\": [\n {\n \"name\": \"QueryDirection\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"OLD\",\n \"id\": 1\n },\n {\n \"name\": \"NEW\",\n \"id\": 2\n }\n ]\n }\n ]\n },\n {\n \"name\": \"RcpCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"id\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"read\",\n \"id\": 4\n }\n ]\n },\n {\n \"name\": \"ReadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"MaxReadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"pid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxAckTimestamp\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxReadTimestamp\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"ReadCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"cids\",\n \"id\": 2\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"ReadTuple\",\n \"name\": \"convs\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"PresenceCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"StatusType\",\n \"name\": \"status\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"sessionPeerIds\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"ReportCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"initiative\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"type\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"PatchItem\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"recall\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 9\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 10\n }\n ]\n },\n {\n \"name\": \"PatchCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"PatchItem\",\n \"name\": \"patches\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastPatchTime\",\n \"id\": 2\n }\n ]\n },\n {\n \"name\": \"GenericCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"CommandType\",\n \"name\": \"cmd\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"OpType\",\n \"name\": \"op\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"appId\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"peerId\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"i\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"installationId\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"priority\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"service\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"DataCommand\",\n \"name\": \"dataMessage\",\n \"id\": 101\n },\n {\n \"rule\": \"optional\",\n \"type\": \"SessionCommand\",\n \"name\": \"sessionMessage\",\n \"id\": 102\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ErrorCommand\",\n \"name\": \"errorMessage\",\n \"id\": 103\n },\n {\n \"rule\": \"optional\",\n \"type\": \"DirectCommand\",\n \"name\": \"directMessage\",\n \"id\": 104\n },\n {\n \"rule\": \"optional\",\n \"type\": \"AckCommand\",\n \"name\": \"ackMessage\",\n \"id\": 105\n },\n {\n \"rule\": \"optional\",\n \"type\": \"UnreadCommand\",\n \"name\": \"unreadMessage\",\n \"id\": 106\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ReadCommand\",\n \"name\": \"readMessage\",\n \"id\": 107\n },\n {\n \"rule\": \"optional\",\n \"type\": \"RcpCommand\",\n \"name\": \"rcpMessage\",\n \"id\": 108\n },\n {\n \"rule\": \"optional\",\n \"type\": \"LogsCommand\",\n \"name\": \"logsMessage\",\n \"id\": 109\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ConvCommand\",\n \"name\": \"convMessage\",\n \"id\": 110\n },\n {\n \"rule\": \"optional\",\n \"type\": \"RoomCommand\",\n \"name\": \"roomMessage\",\n \"id\": 111\n },\n {\n \"rule\": \"optional\",\n \"type\": \"PresenceCommand\",\n \"name\": \"presenceMessage\",\n \"id\": 112\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ReportCommand\",\n \"name\": \"reportMessage\",\n \"id\": 113\n },\n {\n \"rule\": \"optional\",\n \"type\": \"PatchCommand\",\n \"name\": \"patchMessage\",\n \"id\": 114\n }\n ]\n }\n ],\n \"enums\": [\n {\n \"name\": \"CommandType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"session\",\n \"id\": 0\n },\n {\n \"name\": \"conv\",\n \"id\": 1\n },\n {\n \"name\": \"direct\",\n \"id\": 2\n },\n {\n \"name\": \"ack\",\n \"id\": 3\n },\n {\n \"name\": \"rcp\",\n \"id\": 4\n },\n {\n \"name\": \"unread\",\n \"id\": 5\n },\n {\n \"name\": \"logs\",\n \"id\": 6\n },\n {\n \"name\": \"error\",\n \"id\": 7\n },\n {\n \"name\": \"login\",\n \"id\": 8\n },\n {\n \"name\": \"data\",\n \"id\": 9\n },\n {\n \"name\": \"room\",\n \"id\": 10\n },\n {\n \"name\": \"read\",\n \"id\": 11\n },\n {\n \"name\": \"presence\",\n \"id\": 12\n },\n {\n \"name\": \"report\",\n \"id\": 13\n },\n {\n \"name\": \"echo\",\n \"id\": 14\n },\n {\n \"name\": \"loggedin\",\n \"id\": 15\n },\n {\n \"name\": \"logout\",\n \"id\": 16\n },\n {\n \"name\": \"loggedout\",\n \"id\": 17\n },\n {\n \"name\": \"patch\",\n \"id\": 18\n }\n ]\n },\n {\n \"name\": \"OpType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"open\",\n \"id\": 1\n },\n {\n \"name\": \"add\",\n \"id\": 2\n },\n {\n \"name\": \"remove\",\n \"id\": 3\n },\n {\n \"name\": \"close\",\n \"id\": 4\n },\n {\n \"name\": \"opened\",\n \"id\": 5\n },\n {\n \"name\": \"closed\",\n \"id\": 6\n },\n {\n \"name\": \"query\",\n \"id\": 7\n },\n {\n \"name\": \"query_result\",\n \"id\": 8\n },\n {\n \"name\": \"conflict\",\n \"id\": 9\n },\n {\n \"name\": \"added\",\n \"id\": 10\n },\n {\n \"name\": \"removed\",\n \"id\": 11\n },\n {\n \"name\": \"start\",\n \"id\": 30\n },\n {\n \"name\": \"started\",\n \"id\": 31\n },\n {\n \"name\": \"joined\",\n \"id\": 32\n },\n {\n \"name\": \"members_joined\",\n \"id\": 33\n },\n {\n \"name\": \"left\",\n \"id\": 39\n },\n {\n \"name\": \"members_left\",\n \"id\": 40\n },\n {\n \"name\": \"results\",\n \"id\": 42\n },\n {\n \"name\": \"count\",\n \"id\": 43\n },\n {\n \"name\": \"result\",\n \"id\": 44\n },\n {\n \"name\": \"update\",\n \"id\": 45\n },\n {\n \"name\": \"updated\",\n \"id\": 46\n },\n {\n \"name\": \"mute\",\n \"id\": 47\n },\n {\n \"name\": \"unmute\",\n \"id\": 48\n },\n {\n \"name\": \"status\",\n \"id\": 49\n },\n {\n \"name\": \"members\",\n \"id\": 50\n },\n {\n \"name\": \"max_read\",\n \"id\": 51\n },\n {\n \"name\": \"is_member\",\n \"id\": 52\n },\n {\n \"name\": \"join\",\n \"id\": 80\n },\n {\n \"name\": \"invite\",\n \"id\": 81\n },\n {\n \"name\": \"leave\",\n \"id\": 82\n },\n {\n \"name\": \"kick\",\n \"id\": 83\n },\n {\n \"name\": \"reject\",\n \"id\": 84\n },\n {\n \"name\": \"invited\",\n \"id\": 85\n },\n {\n \"name\": \"kicked\",\n \"id\": 86\n },\n {\n \"name\": \"upload\",\n \"id\": 100\n },\n {\n \"name\": \"uploaded\",\n \"id\": 101\n },\n {\n \"name\": \"modify\",\n \"id\": 150\n },\n {\n \"name\": \"modified\",\n \"id\": 151\n }\n ]\n },\n {\n \"name\": \"StatusType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"on\",\n \"id\": 1\n },\n {\n \"name\": \"off\",\n \"id\": 2\n }\n ]\n }\n ],\n \"isNamespace\": true\n}).build();\n","import messages from './message-compiled';\n\nconst {\n JsonObjectMessage,\n UnreadTuple,\n LogItem,\n DataCommand,\n SessionCommand,\n ErrorCommand,\n DirectCommand,\n AckCommand,\n UnreadCommand,\n ConvCommand,\n RoomCommand,\n LogsCommand,\n RcpCommand,\n ReadTuple,\n MaxReadTuple,\n ReadCommand,\n PresenceCommand,\n ReportCommand,\n GenericCommand,\n PatchCommand,\n PatchItem,\n CommandType,\n OpType,\n StatusType,\n} = messages.push_server.messages2;\n\nexport {\n JsonObjectMessage,\n UnreadTuple,\n LogItem,\n DataCommand,\n SessionCommand,\n ErrorCommand,\n DirectCommand,\n AckCommand,\n UnreadCommand,\n ConvCommand,\n RoomCommand,\n LogsCommand,\n RcpCommand,\n ReadTuple,\n MaxReadTuple,\n ReadCommand,\n PresenceCommand,\n ReportCommand,\n GenericCommand,\n PatchCommand,\n PatchItem,\n CommandType,\n OpType,\n StatusType,\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // In sloppy mode, unbound `this` refers to the global object, fallback to\n // Function constructor if we're in global strict mode. That is sadly a form\n // of indirect eval which violates Content Security Policy.\n (function() { return this })() || Function(\"return this\")()\n);\n","// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g = (function() { return this })() || Function(\"return this\")();\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n Object.getOwnPropertyNames(g).indexOf(\"regeneratorRuntime\") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = require(\"./runtime\");\n\nif (hadRuntime) {\n // Restore the original runtime.\n g.regeneratorRuntime = oldRuntime;\n} else {\n // Remove the global property added by runtime.js.\n try {\n delete g.regeneratorRuntime;\n } catch(e) {\n g.regeneratorRuntime = undefined;\n }\n}\n","module.exports = require(\"regenerator-runtime\");\n","exports.f = Object.getOwnPropertySymbols;\n","exports.f = {}.propertyIsEnumerable;\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _assign = require(\"../core-js/object/assign\");\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _assign2.default || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _promise = require(\"../core-js/promise\");\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new _promise2.default(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return _promise2.default.resolve(value).then(function (value) {\n step(\"next\", value);\n }, function (err) {\n step(\"throw\", err);\n });\n }\n }\n\n return step(\"next\");\n });\n };\n};","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/es6.array.from');\nmodule.exports = require('../../modules/_core').Array.from;\n","module.exports = { \"default\": require(\"core-js/library/fn/array/from\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _from = require(\"../core-js/array/from\");\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return (0, _from2.default)(arr);\n }\n};","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar meta = require('./_meta');\nvar fails = require('./_fails');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar setToStringTag = require('./_set-to-string-tag');\nvar dP = require('./_object-dp').f;\nvar each = require('./_array-methods')(0);\nvar DESCRIPTORS = require('./_descriptors');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME, '_c');\n target._c = new Base();\n if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);\n });\n each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {\n anInstance(this, C, KEY);\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = this._c[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n });\n IS_WEAK || dP(C.prototype, 'size', {\n get: function () {\n return this._c.size;\n }\n });\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F, O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","var forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') });\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\nrequire('./_set-collection-of')('Set');\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\nrequire('./_set-collection-from')('Set');\n","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.set');\nrequire('../modules/es7.set.to-json');\nrequire('../modules/es7.set.of');\nrequire('../modules/es7.set.from');\nmodule.exports = require('../modules/_core').Set;\n","module.exports = { \"default\": require(\"core-js/library/fn/set\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","exports.f = require('./_wks');\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n replacer = args[1];\n if (typeof replacer == 'function') $replacer = replacer;\n if ($replacer || !isArray(replacer)) replacer = function (key, value) {\n if ($replacer) value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _iterator = require(\"../core-js/symbol/iterator\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = require(\"../core-js/symbol\");\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","require('../../modules/es6.object.set-prototype-of');\nmodule.exports = require('../../modules/_core').Object.setPrototypeOf;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/set-prototype-of\"), __esModule: true };","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","require('../../modules/es6.object.create');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/create\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = require(\"../core-js/object/create\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object' && !isArray(obj)) {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","var core = require('../../modules/_core');\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/json/stringify\"), __esModule: true };","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n","require('../../modules/es6.object.get-own-property-descriptor');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function getOwnPropertyDescriptor(it, key) {\n return $Object.getOwnPropertyDescriptor(it, key);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/get-own-property-descriptor\"), __esModule: true };","/*\n\n Javascript State Machine Library - https://github.com/jakesgordon/javascript-state-machine\n\n Copyright (c) 2012, 2013, 2014, 2015, Jake Gordon and contributors\n Released under the MIT license - https://github.com/jakesgordon/javascript-state-machine/blob/master/LICENSE\n\n*/\n\n(function () {\n\n var StateMachine = {\n\n //---------------------------------------------------------------------------\n\n VERSION: \"2.4.0\",\n\n //---------------------------------------------------------------------------\n\n Result: {\n SUCCEEDED: 1, // the event transitioned successfully from one state to another\n NOTRANSITION: 2, // the event was successfull but no state transition was necessary\n CANCELLED: 3, // the event was cancelled by the caller in a beforeEvent callback\n PENDING: 4 // the event is asynchronous and the caller is in control of when the transition occurs\n },\n\n Error: {\n INVALID_TRANSITION: 100, // caller tried to fire an event that was innapropriate in the current state\n PENDING_TRANSITION: 200, // caller tried to fire an event while an async transition was still pending\n INVALID_CALLBACK: 300 // caller provided callback function threw an exception\n },\n\n WILDCARD: '*',\n ASYNC: 'async',\n\n //---------------------------------------------------------------------------\n\n create: function(cfg, target) {\n\n var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial; // allow for a simple string, or an object with { state: 'foo', event: 'setup', defer: true|false }\n var terminal = cfg.terminal || cfg['final'];\n var fsm = target || cfg.target || {};\n var events = cfg.events || [];\n var callbacks = cfg.callbacks || {};\n var map = {}; // track state transitions allowed for an event { event: { from: [ to ] } }\n var transitions = {}; // track events allowed from a state { state: [ event ] }\n\n var add = function(e) {\n var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]); // allow 'wildcard' transition if 'from' is not specified\n map[e.name] = map[e.name] || {};\n for (var n = 0 ; n < from.length ; n++) {\n transitions[from[n]] = transitions[from[n]] || [];\n transitions[from[n]].push(e.name);\n\n map[e.name][from[n]] = e.to || from[n]; // allow no-op transition if 'to' is not specified\n }\n if (e.to)\n transitions[e.to] = transitions[e.to] || [];\n };\n\n if (initial) {\n initial.event = initial.event || 'startup';\n add({ name: initial.event, from: 'none', to: initial.state });\n }\n\n for(var n = 0 ; n < events.length ; n++)\n add(events[n]);\n\n for(var name in map) {\n if (map.hasOwnProperty(name))\n fsm[name] = StateMachine.buildEvent(name, map[name]);\n }\n\n for(var name in callbacks) {\n if (callbacks.hasOwnProperty(name))\n fsm[name] = callbacks[name]\n }\n\n fsm.current = 'none';\n fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); };\n fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }\n fsm.cannot = function(event) { return !this.can(event); };\n fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); };\n fsm.isFinished = function() { return this.is(terminal); };\n fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; }; // default behavior when something unexpected happens is to throw an exception, but caller can override this behavior if desired (see github issue #3 and #17)\n fsm.states = function() { return Object.keys(transitions).sort() };\n\n if (initial && !initial.defer)\n fsm[initial.event]();\n\n return fsm;\n\n },\n\n //===========================================================================\n\n doCallback: function(fsm, func, name, from, to, args) {\n if (func) {\n try {\n return func.apply(fsm, [name, from, to].concat(args));\n }\n catch(e) {\n return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, \"an exception occurred in a caller-provided callback function\", e);\n }\n }\n },\n\n beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); },\n afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); },\n leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); },\n enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); },\n changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); },\n\n beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); },\n afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); },\n leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); },\n enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); },\n\n beforeEvent: function(fsm, name, from, to, args) {\n if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) ||\n (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args)))\n return false;\n },\n\n afterEvent: function(fsm, name, from, to, args) {\n StateMachine.afterThisEvent(fsm, name, from, to, args);\n StateMachine.afterAnyEvent( fsm, name, from, to, args);\n },\n\n leaveState: function(fsm, name, from, to, args) {\n var specific = StateMachine.leaveThisState(fsm, name, from, to, args),\n general = StateMachine.leaveAnyState( fsm, name, from, to, args);\n if ((false === specific) || (false === general))\n return false;\n else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general))\n return StateMachine.ASYNC;\n },\n\n enterState: function(fsm, name, from, to, args) {\n StateMachine.enterThisState(fsm, name, from, to, args);\n StateMachine.enterAnyState( fsm, name, from, to, args);\n },\n\n //===========================================================================\n\n buildEvent: function(name, map) {\n return function() {\n\n var from = this.current;\n var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from;\n var args = Array.prototype.slice.call(arguments); // turn arguments into pure array\n\n if (this.transition)\n return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, \"event \" + name + \" inappropriate because previous transition did not complete\");\n\n if (this.cannot(name))\n return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, \"event \" + name + \" inappropriate in current state \" + this.current);\n\n if (false === StateMachine.beforeEvent(this, name, from, to, args))\n return StateMachine.Result.CANCELLED;\n\n if (from === to) {\n StateMachine.afterEvent(this, name, from, to, args);\n return StateMachine.Result.NOTRANSITION;\n }\n\n // prepare a transition method for use EITHER lower down, or by caller if they want an async transition (indicated by an ASYNC return value from leaveState)\n var fsm = this;\n this.transition = function() {\n fsm.transition = null; // this method should only ever be called once\n fsm.current = to;\n StateMachine.enterState( fsm, name, from, to, args);\n StateMachine.changeState(fsm, name, from, to, args);\n StateMachine.afterEvent( fsm, name, from, to, args);\n return StateMachine.Result.SUCCEEDED;\n };\n this.transition.cancel = function() { // provide a way for caller to cancel async transition if desired (issue #22)\n fsm.transition = null;\n StateMachine.afterEvent(fsm, name, from, to, args);\n }\n\n var leave = StateMachine.leaveState(this, name, from, to, args);\n if (false === leave) {\n this.transition = null;\n return StateMachine.Result.CANCELLED;\n }\n else if (StateMachine.ASYNC === leave) {\n return StateMachine.Result.PENDING;\n }\n else {\n if (this.transition) // need to check in case user manually called transition() but forgot to return StateMachine.ASYNC\n return this.transition();\n }\n\n };\n }\n\n }; // StateMachine\n\n //===========================================================================\n\n //======\n // NODE\n //======\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = StateMachine;\n }\n exports.StateMachine = StateMachine;\n }\n //============\n // AMD/REQUIRE\n //============\n else if (typeof define === 'function' && define.amd) {\n define(function(require) { return StateMachine; });\n }\n //========\n // BROWSER\n //========\n else if (typeof window !== 'undefined') {\n window.StateMachine = StateMachine;\n }\n //===========\n // WEB WORKER\n //===========\n else if (typeof self !== 'undefined') {\n self.StateMachine = StateMachine;\n }\n\n}());\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\nrequire('./_set-collection-of')('WeakMap');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\nrequire('./_set-collection-from')('WeakMap');\n","require('../modules/es6.object.to-string');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.weak-map');\nrequire('../modules/es7.weak-map.of');\nrequire('../modules/es7.weak-map.from');\nmodule.exports = require('../modules/_core').WeakMap;\n","module.exports = { \"default\": require(\"core-js/library/fn/weak-map\"), __esModule: true };","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n if (key in obj) {\n (0, _defineProperty2.default)(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","/* eslint-disable */\nexport default typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {};\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();","import d from 'debug';\n\nconst EXPIRED = Symbol('expired');\nconst debug = d('LC:Expirable');\nexport default class Expirable {\n constructor(value, ttl) {\n this._value = value;\n if (typeof ttl === 'number') {\n this.expiredAt = Date.now() + ttl;\n }\n }\n\n get value() {\n const expired = this.expiredAt && this.expiredAt < Date.now();\n if (expired) debug(`expired: ${this._value}`);\n return expired ? EXPIRED : this._value;\n }\n}\nExpirable.EXPIRED = EXPIRED;\n","import d from 'debug';\nimport Expirable from './expirable';\n\nconst debug = d('LC:Cache');\nexport default class Cache {\n constructor(name = 'anonymous') {\n this.name = name;\n this._map = {};\n }\n\n get(key) {\n const cache = this._map[key];\n if (cache) {\n const value = cache.value;\n if (value !== Expirable.EXPIRED) {\n debug('[%s] hit: %s %O', this.name, key, value);\n return value;\n }\n delete this._map[key];\n }\n debug(`[${this.name}] missed: ${key}`);\n return null;\n }\n\n set(key, value, ttl) {\n debug('[%s] set: %s %O %d', this.name, key, value, ttl);\n this._map[key] = new Expirable(value, ttl);\n }\n}\n","import isPlainObject from 'lodash/isPlainObject';\nimport global from './global';\n\nexport { global };\n\nexport const tryAll = (promiseConstructors) => {\n const promise = new Promise(promiseConstructors[0]);\n if (promiseConstructors.length === 1) {\n return promise;\n }\n return promise.catch(() => tryAll(promiseConstructors.slice(1)));\n};\n\nexport const tap = interceptor => value => ((interceptor(value), value));\n\nexport { default as Expirable } from './expirable';\nexport { default as Cache } from './cache';\n\nexport const decodeDate = (date) => {\n if (!date) return date;\n if (typeof date === 'string') {\n return new Date(date);\n }\n if (date.__type === 'Date' && date.iso) {\n return new Date(date.iso);\n }\n // Long\n if (typeof date.toNumber === 'function') {\n return new Date(date.toNumber());\n }\n return date;\n};\n\nexport const keyRemap = (keymap, obj) =>\n Object.keys(obj).reduce((newObj, key) => {\n const newKey = keymap[key] || key;\n return Object.assign(newObj, {\n [newKey]: obj[key],\n });\n }, {});\n\nexport const isIE10 = (\n global.navigator &&\n global.navigator.userAgent &&\n global.navigator.userAgent.indexOf('MSIE 10.') !== -1\n);\n\n/* eslint-disable no-proto */\nexport const getStaticProperty = (klass, property) =>\n (klass[property] || (klass.__proto__ ? getStaticProperty(klass.__proto__, property) : undefined));\n/* eslint-enable no-proto */\n\nexport const union = (a, b) => Array.from(new Set([...a, ...b]));\nexport const difference = (a, b) => Array.from(\n (bSet => new Set(a.filter(x => !bSet.has(x))))(new Set(b)),\n);\n\nconst map = new WeakMap();\n\n// protected property helper\nexport const internal = (object) => {\n if (!map.has(object)) {\n map.set(object, {});\n }\n return map.get(object);\n};\n\n// debug utility\nconst removeNull = (obj) => {\n if (!isPlainObject(obj)) return obj;\n const object = Object.assign({}, obj);\n // eslint-disable-next-line no-restricted-syntax\n for (const prop in object) {\n if ({}.hasOwnProperty.call(object, prop)) {\n const value = object[prop];\n if (value === null) {\n delete object[prop];\n } else {\n object[prop] = removeNull(value);\n }\n }\n }\n return object;\n};\nexport const trim = message => removeNull(JSON.parse(JSON.stringify(message)));\n\nexport const ensureArray = (target) => {\n if (Array.isArray(target)) {\n return target;\n }\n if (target === undefined || target === null) {\n return [];\n }\n return [target];\n};\n\nexport const setValue = (target, key, value) => {\n // '.' is not allowed in Class keys, escaping is not in concern now.\n const segs = key.split('.');\n const lastSeg = segs.pop();\n let currentTarget = target;\n segs.forEach((seg) => {\n if (currentTarget[seg] === undefined) currentTarget[seg] = {};\n currentTarget = currentTarget[seg];\n });\n currentTarget[lastSeg] = value;\n return target;\n};\n\n// eslint-disable-next-line no-undef\nexport const isWeapp = typeof wx === 'object' && typeof wx.connectSocket === 'function';\n\n// throttle decorator\nexport const throttle = wait => (target, property, descriptor) => {\n const callback = descriptor.value;\n // very naive, internal use only\n if (callback.length) {\n throw new Error('throttled function should not accept any arguments');\n }\n return {\n ...descriptor,\n value() {\n let {\n throttleMeta,\n } = internal(this);\n if (!throttleMeta) {\n throttleMeta = {};\n internal(this).throttleMeta = throttleMeta;\n }\n let {\n [property]: propertyMeta,\n } = throttleMeta;\n if (!propertyMeta) {\n propertyMeta = {};\n throttleMeta[property] = propertyMeta;\n }\n const {\n previouseTimestamp = 0,\n timeout,\n } = propertyMeta;\n const now = Date.now();\n const remainingTime = wait - (now - previouseTimestamp);\n if (remainingTime <= 0) {\n throttleMeta[property].previouseTimestamp = now;\n callback.apply(this);\n } else if (!timeout) {\n propertyMeta.timeout = setTimeout(() => {\n propertyMeta.previouseTimestamp = Date.now();\n delete propertyMeta.timeout;\n callback.apply(this);\n }, remainingTime);\n }\n },\n };\n};\n","import { global } from '../utils';\n\nconst WebSocket = global.WebSocket || global.MozWebSocket;\nexport default WebSocket;\n","// WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface.\n\nimport d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport StateMachine from 'javascript-state-machine';\n\nimport WebSocket from 'ws';\n\nimport { tryAll, global } from './utils';\n\nconst debug = d('LC:WebSocketPlus');\n\nconst HEARTBEAT_TIME = 180000;\nconst TIMEOUT_TIME = 380000;\n\nconst DEFAULT_RETRY_STRATEGY = attempt => Math.min(1000 * (2 ** attempt), 300000);\n\nconst requireConnected = (target, name, descriptor) =>\n Object.assign({}, descriptor, {\n value: function requireConnectedWrapper(...args) {\n if (!this.is('connected')) {\n const currentState = this.current;\n console.warn(`${name} should not be called when the connection is ${currentState}`);\n if (this.is('disconnected') || this.is('reconnecting')) {\n console.warn('disconnect and reconnect event should be handled to avoid such calls.');\n }\n throw new Error('Connection unavailable');\n }\n return descriptor.value.call(this, ...args);\n },\n });\n\nclass WebSocketPlus extends EventEmitter {\n constructor(getUrls, protocol) {\n if (typeof WebSocket === 'undefined') {\n throw new Error('WebSocket is undefined. Polyfill is required in this runtime.');\n }\n super();\n if (typeof getUrls !== 'function') {\n this._getUrls = () => Promise.resolve(getUrls);\n } else {\n this._getUrls = getUrls;\n }\n this._protocol = protocol;\n this.init();\n this._createWs(this._getUrls, this._protocol).then(\n () => {\n this.__postponeTimeoutTimer = this._postponeTimeoutTimer.bind(this);\n if (global.addEventListener) {\n this.__pause = () => this.pause();\n this.__resume = () => this.resume();\n global.addEventListener('offline', this.__pause);\n global.addEventListener('online', this.__resume);\n }\n this.open();\n },\n ).catch(this.throw.bind(this));\n }\n\n _createWs(getUrls, protocol) {\n return getUrls().then((wsUrls) => {\n let urls = wsUrls;\n if (!(urls instanceof Array)) {\n urls = [urls];\n }\n return tryAll(\n urls.map(url => (resolve, reject) => {\n debug(`connect [${url}] ${protocol}`);\n const ws = protocol ? new WebSocket(\n url, protocol,\n ) : new WebSocket(url);\n ws.binaryType = this.binaryType || 'arraybuffer';\n ws.onopen = () => resolve(ws);\n ws.onclose = (error) => {\n if (error instanceof Error) {\n return reject(error);\n }\n // in browser, error event is useless\n return reject(new Error(`Failed to connect [${url}]`));\n };\n ws.onerror = ws.onclose;\n }),\n ).then((ws) => {\n this._ws = ws;\n this._ws.onclose = this._handleClose.bind(this);\n this._ws.onmessage = this._handleMessage.bind(this);\n return ws;\n });\n });\n }\n _destroyWs() {\n const ws = this._ws;\n if (!ws) return;\n ws.onopen = null;\n ws.onclose = null;\n ws.onerror = null;\n ws.onmessage = null;\n this._ws = null;\n ws.close();\n }\n\n // eslint-disable-next-line class-methods-use-this\n onbeforeevent(event, from, to, ...payload) {\n debug(`${event}: ${from} -> ${to}`, ...payload);\n }\n onopen() {\n this.emit('open');\n }\n onconnected() {\n this._startConnectionKeeper();\n }\n onleaveconnected(event, from, to) {\n this._stopConnectionKeeper();\n this._destroyWs();\n if (to === 'offline' || to === 'disconnected') {\n this.emit('disconnect');\n }\n }\n onpause() {\n this.emit('offline');\n }\n onbeforeresume() {\n this.emit('online');\n }\n onreconnect() {\n this.emit('reconnect');\n }\n ondisconnected(event, from, to, attempt = 0) {\n const delay = DEFAULT_RETRY_STRATEGY.call(null, attempt);\n debug(`schedule attempt=${attempt} delay=${delay}`);\n this.emit('schedule', attempt, delay);\n if (this.__scheduledRetry) {\n clearTimeout(this.__scheduledRetry);\n }\n this.__scheduledRetry = setTimeout(() => {\n if (this.is('disconnected')) {\n this.retry(attempt);\n }\n }, delay);\n }\n onretry(event, from, to, attempt = 0) {\n this.emit('retry', attempt);\n this._createWs(this._getUrls, this._protocol).then(\n () => (this.can('reconnect') ? this.reconnect() : this._destroyWs()),\n () => this.can('fail') && this.fail(attempt + 1),\n );\n }\n onerror(event, from, to, error) {\n this.emit('error', error);\n }\n onclose() {\n if (global.removeEventListener) {\n if (this.__pause) global.removeEventListener('offline', this.__pause);\n if (this.__resume) global.removeEventListener('online', this.__resume);\n }\n }\n\n // jsdoc-ignore-start\n @requireConnected\n // jsdoc-ignore-end\n _ping() {\n debug('ping');\n try {\n this.ping();\n } catch (error) {\n console.warn(`websocket ping error: ${error.message}`);\n }\n }\n ping() {\n if (this._ws.ping) {\n this._ws.ping();\n } else {\n console.warn(`The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.`);\n }\n }\n\n _postponeTimeoutTimer() {\n debug('_postponeTimeoutTimer');\n this._clearTimeoutTimers();\n this._timeoutTimer = setTimeout(() => {\n debug('timeout');\n this.disconnect();\n }, TIMEOUT_TIME);\n }\n _clearTimeoutTimers() {\n if (this._timeoutTimer) {\n clearTimeout(this._timeoutTimer);\n }\n }\n _startConnectionKeeper() {\n debug('start connection keeper');\n this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME);\n const addListener = this._ws.addListener || this._ws.addEventListener;\n addListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n this._postponeTimeoutTimer();\n }\n _stopConnectionKeeper() {\n debug('stop connection keeper');\n // websockets/ws#489\n const removeListener = this._ws.removeListener || this._ws.removeEventListener;\n removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n this._clearTimeoutTimers();\n if (this._heartbeatTimer) {\n clearInterval(this._heartbeatTimer);\n }\n }\n\n _handleClose(event) {\n debug(`ws closed [${event.code}] ${event.reason}`);\n // socket closed manually, ignore close event.\n if (this.isFinished()) return;\n this.handleClose(event);\n }\n handleClose() {\n // reconnect\n this.disconnect();\n }\n\n // jsdoc-ignore-start\n @requireConnected\n // jsdoc-ignore-end\n send(data) {\n debug('send', data);\n this._ws.send(data);\n }\n\n _handleMessage(event) {\n debug('message', event.data);\n this.handleMessage(event.data);\n }\n handleMessage(message) {\n this.emit('message', message);\n }\n}\n\nStateMachine.create({\n target: WebSocketPlus.prototype,\n initial: {\n state: 'initialized',\n event: 'init',\n defer: true,\n },\n terminal: 'closed',\n events: [{\n name: 'open',\n from: 'initialized',\n to: 'connected',\n }, {\n name: 'disconnect',\n from: 'connected',\n to: 'disconnected',\n }, {\n name: 'retry',\n from: 'disconnected',\n to: 'reconnecting',\n }, {\n name: 'fail',\n from: 'reconnecting',\n to: 'disconnected',\n }, {\n name: 'reconnect',\n from: 'reconnecting',\n to: 'connected',\n }, {\n name: 'pause',\n from: ['connected', 'disconnected', 'reconnecting'],\n to: 'offline',\n }, {\n }, {\n name: 'resume',\n from: 'offline',\n to: 'disconnected',\n }, {\n name: 'close',\n from: ['connected', 'disconnected', 'reconnecting', 'offline'],\n to: 'closed',\n }, {\n name: 'throw',\n from: '*',\n to: 'error',\n }],\n});\n\nexport default WebSocketPlus;\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","require('../../modules/es6.object.freeze');\nmodule.exports = require('../../modules/_core').Object.freeze;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/freeze\"), __esModule: true };","export const error = Object.freeze({\n 1000: {\n name: 'CLOSE_NORMAL',\n },\n 1006: {\n name: 'CLOSE_ABNORMAL',\n },\n 4100: {\n name: 'APP_NOT_AVAILABLE',\n message: 'App not exists or realtime message service is disabled.',\n },\n 4103: {\n name: 'INVALID_LOGIN',\n message: 'Malformed clientId.',\n },\n 4105: {\n name: 'SESSION_REQUIRED',\n message: 'Message sent before session opened. ',\n },\n 4107: {\n name: 'READ_TIMEOUT',\n },\n 4108: {\n name: 'LOGIN_TIMEOUT',\n },\n 4109: {\n name: 'FRAME_TOO_LONG',\n },\n 4110: {\n name: 'INVALID_ORIGIN',\n message: 'Access denied by domain whitelist.',\n },\n 4111: {\n name: 'SESSION_CONFLICT',\n },\n 4112: {\n name: 'SESSION_TOKEN_EXPIRED',\n },\n 4200: {\n name: 'INTERNAL_ERROR',\n message: 'Internal error, please contact LeanCloud for support.',\n },\n 4201: {\n name: 'SEND_MESSAGE_TIMEOUT',\n },\n 4302: {\n name: 'CONVERSATION_SIGNATURE_FAILED',\n },\n 4303: {\n name: 'CONVERSATION_NOT_FOUND',\n },\n 4304: {\n name: 'CONVERSATION_FULL',\n },\n 4305: {\n name: 'CONVERSATION_REJECTED_BY_APP',\n },\n 4306: {\n name: 'CONVERSATION_UPDATE_FAILED',\n },\n 4307: {\n name: 'CONVERSATION_READ_ONLY',\n },\n 4308: {\n name: 'CONVERSATION_NOT_ALLOWED',\n },\n 4401: {\n name: 'INVALID_MESSAGING_TARGET',\n },\n 4402: {\n name: 'MESSAGE_REJECTED_BY_APP',\n },\n});\n\nexport const ErrorCode = Object.freeze(\n Object.keys(error).reduce((result, code) => Object.assign(result, {\n [error[code].name]: Number(code),\n }), {}),\n);\n\nexport const createError = (errorMessage) => {\n const {\n code, reason, appCode, detail,\n } = errorMessage;\n let message = reason || detail;\n if (!message && error[code]) {\n message = error[code].message || error[code].name;\n }\n if (!message) {\n message = `Unknow Error: ${code}`;\n }\n const err = new Error(message);\n return Object.assign(err, {\n code, appCode, detail,\n });\n};\n","import d from 'debug';\nimport WebSocketPlus from './websocket-plus';\nimport { createError } from './error';\nimport { GenericCommand, CommandType } from '../proto/message';\nimport { trim, isWeapp } from './utils';\n\nconst debug = d('LC:Connection');\n\nconst COMMAND_TIMEOUT = 20000;\n\nexport default class Connection extends WebSocketPlus {\n constructor(getUrl, { format, version }) {\n debug('initializing Connection');\n const protocolString = `lc.${format}.${version}`;\n if (!isWeapp) {\n super(getUrl, protocolString);\n } else {\n super(getUrl().then(urls => urls.map(url =>\n `${url}${url.indexOf('?') === -1 ? '?' : '&'}subprotocol=${encodeURIComponent(protocolString)}`,\n )));\n }\n this._protocalFormat = format;\n this._commands = {};\n this._serialId = 0;\n }\n\n send(command, waitingForRespond = true) {\n let serialId;\n if (waitingForRespond) {\n this._serialId += 1;\n serialId = this._serialId;\n command.i = serialId; // eslint-disable-line no-param-reassign\n }\n debug('↑ %O sent', trim(command));\n\n let message;\n if (this._protocalFormat === 'proto2base64') {\n message = command.toBase64();\n } else if (command.toArrayBuffer) {\n message = command.toArrayBuffer();\n }\n if (!message) {\n throw new TypeError(`${command} is not a GenericCommand`);\n }\n\n super.send(message);\n\n if (!waitingForRespond) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n this._commands[serialId] = {\n resolve,\n reject,\n timeout: setTimeout(\n () => {\n if (this._commands[serialId]) {\n debug('✗ %O timeout', trim(command));\n reject(new Error('Command Timeout.'));\n delete this._commands[serialId];\n }\n },\n COMMAND_TIMEOUT,\n ),\n };\n });\n }\n\n handleMessage(msg) {\n let message;\n try {\n message = GenericCommand.decode(msg);\n debug('↓ %O received', trim(message));\n } catch (e) {\n console.warn('Decode message failed', msg);\n }\n this.emit('allmessage', message);\n const serialId = message.i;\n if (serialId) {\n if (this._commands[serialId]) {\n clearTimeout(this._commands[serialId].timeout);\n if (message.cmd === CommandType.error) {\n this\n ._commands[serialId]\n .reject(createError(message.errorMessage));\n } else {\n this\n ._commands[serialId]\n .resolve(message);\n }\n delete this._commands[serialId];\n } else {\n console.warn(`Unexpected command received with serialId [${serialId}],\n which have timed out or never been requested.`);\n }\n } else if (message.cmd === CommandType.error) {\n this.emit('error', createError(message.errorMessage));\n } else {\n this.emit('message', message);\n }\n }\n\n ping() {\n return this.send(new GenericCommand({\n cmd: CommandType.echo,\n })).catch(error => debug('ping failed:', error));\n }\n}\n","/* eslint-disable max-len */\n\n/**\n * 插件接口\n *\n *

\n * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类:\n *

\n * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。\n * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。\n *

\n * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。\n * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。\n * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。\n *

\n * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。\n *\n * @interface Plugin\n * @since 3.1.0\n */\n\n/* eslint-enable max-len */\n\n/**\n * 插件名称,用于在日志中显示异常的插件\n *\n * @name Plugin.name\n * @type string\n */\n\n/**\n * 插件注册的消息类型\n *\n * @name Plugin.messageClasses\n * @type AVMessage[]\n */\n\n/**\n * 在 Realtime 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Realtime 实例。\n *\n * @name Plugin.onRealtimeCreate\n * @type Function\n */\n\n/**\n * 在 IMClient 实例化后对其进行修饰。\n *

\n * 接受一个参数为 IMClient 实例。\n *\n * @name Plugin.onIMClientCreate\n * @type Function\n */\n\n/**\n * 在 Conversation 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Conversation 实例。\n * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook,\n * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。\n *\n * @name Plugin.onConversationCreate\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之前,对原始消息进行修改。\n *

\n * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。\n * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。\n *\n * @name Plugin.beforeMessageParse\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之后,对消息实例进行修改。\n *

\n * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。\n * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.afterMessageParse\n * @type Function\n */\n\n/**\n * 在收到消息之后,派发消息之前,控制是否派发这条消息。\n *

\n * 接受参数为 message 与 conversation。\n * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。\n * 如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.beforeMessageDispatch\n * @type Function\n * @since 3.4.0\n */\n\nimport { ensureArray, tap } from './utils';\n\nconst checkType = middleware => (param) => {\n const { constructor } = param;\n return Promise.resolve(param).then(middleware).then(tap((result) => {\n if (result === undefined || result === null) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns ${result} while a ${param.constructor.name} expected.`);\n }\n if (!(result instanceof constructor)) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns a ${result.constructor.name} while a ${param.constructor.name} expected.`);\n }\n return 0;\n }));\n};\n\nexport const applyDecorators = (decorators, target) => {\n if (decorators) {\n decorators.forEach((decorator) => {\n try {\n decorator(target);\n } catch (error) {\n if (decorator._pluginName) {\n error.message += `[${decorator._pluginName}]`;\n }\n throw error;\n }\n });\n }\n};\n\nexport const applyMiddlewares = middlewares => target =>\n ensureArray(middlewares).reduce(\n (previousPromise, middleware) => previousPromise\n .then(checkType(middleware))\n .catch((error) => {\n if (middleware._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${middleware._pluginName}]`;\n }\n throw error;\n }),\n Promise.resolve(target),\n );\n\nexport const applyDispatcher = (dispatchers, payload) =>\n ensureArray(dispatchers).reduce(\n (resultPromise, dispatcher) => resultPromise.then(shouldDispatch =>\n (shouldDispatch === false ? false : dispatcher(...payload)),\n ).catch((error) => {\n if (dispatcher._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${dispatcher._pluginName}]`;\n }\n throw error;\n }), Promise.resolve(true),\n );\n","import d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport axios from 'axios';\nimport Connection from './connection';\nimport { ErrorCode, createError } from './error';\nimport { tap, Cache, trim, internal, ensureArray, isWeapp } from './utils';\nimport { applyDecorators, applyDispatcher } from './plugin';\n\nconst debug = d('LC:Realtime');\n\nconst routerCache = new Cache('push-router');\n\nexport default class Realtime extends EventEmitter {\n /**\n * @extends EventEmitter\n * @param {Object} options\n * @param {String} options.appId\n * @param {String} options.appKey (since 4.0.0)\n * @param {String} [options.region='cn'] 节点 id\n * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式)\n * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。\n * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序)\n * @param {Boolean} [options.ssl=true] 使用 wss 进行连接\n * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0)\n */\n constructor(options) {\n debug('initializing Realtime');\n super();\n if (typeof options.appId !== 'string') {\n throw new TypeError(`appId [${options.appId}] is not a string`);\n }\n if (typeof options.appKey !== 'string') {\n throw new TypeError(`appKey [${options.appKey}] is not a string`);\n }\n this._options = Object.assign({\n appId: undefined,\n appKey: undefined,\n region: 'cn',\n pushOfflineMessages: false,\n noBinary: isWeapp,\n ssl: true,\n server: process.env.SERVER,\n }, options);\n this._cache = new Cache('endpoints');\n internal(this).clients = new Set();\n this._plugins = [\n ...ensureArray(Realtime.__preRegisteredPlugins),\n ...ensureArray(options.plugins),\n ].reduce(\n (result, plugin) => {\n // eslint-disable-next-line no-restricted-syntax\n for (const hook in plugin) {\n if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') {\n if (plugin.name) {\n ensureArray(plugin[hook]).forEach((value) => {\n // eslint-disable-next-line no-param-reassign\n value._pluginName = plugin.name;\n });\n }\n // eslint-disable-next-line no-param-reassign\n result[hook] = ensureArray(result[hook]).concat(plugin[hook]);\n }\n }\n return result;\n },\n {},\n );\n // onRealtimeCreate hook\n applyDecorators(this._plugins.onRealtimeCreate, this);\n }\n\n async _request({\n method,\n version = '1.1',\n path,\n query,\n headers,\n data = {},\n }) {\n const { appId, region } = this._options;\n const { api } = await this.constructor._fetchAppRouter({ appId, region });\n const url = `https://${api}/${version}${path}`;\n return axios(url, {\n method,\n params: query,\n headers: {\n 'X-LC-Id': this._options.appId,\n 'X-LC-Key': this._options.appKey,\n ...headers,\n },\n data,\n }).then(response => response.data);\n }\n\n _open() {\n if (this._openPromise) return this._openPromise;\n\n let format = 'protobuf2';\n if (this._options.noBinary) {\n // 不发送 binary data,fallback to base64 string\n format = 'proto2base64';\n }\n let version = 3;\n if (this._options.pushOfflineMessages) {\n // 不推送离线消息,而是发送对话的未读通知\n version = 1;\n }\n const protocol = {\n format,\n version,\n };\n this._openPromise = new Promise((resolve, reject) => {\n debug('No connection established, create a new one.');\n const connection = new Connection(\n () => this._getEndpoints(this._options),\n protocol,\n );\n connection.on('open', () => resolve(connection));\n connection.on('error', reject);\n connection.on('message', this._dispatchCommand.bind(this));\n /**\n * 连接断开。\n * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。\n * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。\n * @event Realtime#disconnect\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event Realtime#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n */\n /**\n * 正在尝试重新连接\n * @event Realtime#retry\n * @param {Number} attempt 尝试重连的次数\n */\n /**\n * 连接恢复正常。\n * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素\n * @event Realtime#reconnect\n */\n\n /**\n * 客户端连接断开\n * @event IMClient#disconnect\n * @see Realtime#event:disconnect\n * @since 3.2.0\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event IMClient#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n * @since 3.2.0\n */\n /**\n * 正在尝试重新连接\n * @event IMClient#retry\n * @param {Number} attempt 尝试重连的次数\n * @since 3.2.0\n */\n\n /**\n * 客户端进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event Realtime#offline\n * @since 3.4.0\n */\n /**\n * 客户端恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event Realtime#online\n * @since 3.4.0\n */\n /**\n * 进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event IMClient#offline\n * @since 3.4.0\n */\n /**\n * 恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event IMClient#online\n * @since 3.4.0\n */\n\n // event proxy\n ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(\n event => connection.on(event, (...payload) => {\n debug(`${event} event emitted. %O`, payload);\n this.emit(event, ...payload);\n if (event !== 'reconnect') {\n internal(this).clients.forEach((client) => {\n client.emit(event, ...payload);\n });\n }\n }),\n );\n // override handleClose\n connection.handleClose = function handleClose(event) {\n const isFatal = [\n ErrorCode.APP_NOT_AVAILABLE,\n ErrorCode.INVALID_LOGIN,\n ErrorCode.INVALID_ORIGIN,\n ].some(errorCode => errorCode === event.code);\n if (isFatal) {\n // in these cases, SDK should throw.\n this.throw(createError(event));\n } else {\n // reconnect\n this.disconnect();\n }\n };\n internal(this).connection = connection;\n });\n\n return this._openPromise;\n }\n\n _getEndpoints(options) {\n return Promise.resolve(\n this._cache.get('endpoints') ||\n this\n .constructor\n ._fetchEndpointsInfo(options)\n .then(\n tap(info => this._cache.set('endpoints', info, info.ttl * 1000)),\n ),\n ).then((info) => {\n debug('endpoint info: %O', info);\n return [info.server, info.secondary];\n });\n }\n\n static _fetchAppRouter({ appId, region }) {\n debug('fetch router');\n switch (region) {\n case 'cn': {\n const cachedRouter = routerCache.get(appId);\n if (cachedRouter) {\n return Promise.resolve(cachedRouter);\n }\n return axios\n .get('https://app-router.leancloud.cn/2/route', {\n params: {\n appId,\n },\n timeout: 20000,\n })\n .then(\n res => res.data,\n )\n .then(tap(debug))\n .then(\n ({\n rtm_router_server: rtmRouter,\n api_server: api,\n ttl = 3600,\n }) => {\n if (!rtmRouter) {\n throw new Error('rtm router not exists');\n }\n const router = {\n rtmRouter,\n api,\n };\n routerCache.set(appId, router, ttl * 1000);\n return router;\n },\n )\n .catch(() => {\n const id = appId.slice(0, 8).toLowerCase();\n return {\n rtmRouter: `${id}.rtm.lncld.net`,\n api: `${id}.api.lncld.net`,\n };\n });\n }\n case 'us':\n return Promise.resolve({\n rtmRouter: 'router-a0-push.leancloud.cn',\n api: 'us-api.leancloud.cn',\n });\n default:\n throw new Error(`Region [${region}] is not supported.`);\n }\n }\n\n static _fetchEndpointsInfo({ appId, region, ssl, server }) {\n debug('fetch endpoint info');\n return this._fetchAppRouter({ appId, region })\n .then(tap(debug))\n .then(({ rtmRouter }) =>\n axios.get(`https://${rtmRouter}/v1/route`, {\n params: {\n appId,\n secure: ssl,\n features: isWeapp ? 'wechat' : undefined,\n server,\n _t: Date.now(),\n },\n timeout: 20000,\n }).then(\n res => res.data,\n ).then(tap(debug)),\n );\n }\n\n _close() {\n if (this._openPromise) {\n this._openPromise.then(connection => connection.close());\n }\n delete this._openPromise;\n }\n\n /**\n * 手动进行重连。\n * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。\n * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。\n */\n retry() {\n const connection = internal(this).connection;\n if (!connection) {\n throw new Error('no connection established');\n }\n if (connection.cannot('retry')) {\n throw new Error(\n `retrying not allowed when not disconnected. the connection is now ${connection.current}`,\n );\n }\n return connection.retry();\n }\n /**\n * 暂停,使 SDK 进入离线状态。\n * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。\n * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。\n *\n * @since 3.4.0\n * @see Realtime#event:offline\n */\n pause() {\n // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。\n // 因此不像 retry,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('pause')) connection.pause();\n }\n /**\n * 恢复在线状态。\n * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。\n *\n * @since 3.4.0\n * @see Realtime#event:online\n */\n resume() {\n // 与 pause 一样,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('resume')) connection.resume();\n }\n\n _register(client) {\n internal(this).clients.add(client);\n }\n\n _deregister(client) {\n internal(this).clients.delete(client);\n if (internal(this).clients.size === 0) {\n this._close();\n }\n }\n\n _dispatchCommand(command) {\n return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this])\n .then((shouldDispatch) => {\n // no plugin handled this command\n if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim(command));\n return false;\n });\n }\n}\n"],"names":["defined","toInteger","aFunction","isObject","require$$0","document","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","core","global","ctx","hide","cof","IObject","min","toIObject","toLength","toAbsoluteIndex","uid","IE_PROTO","has","$keys","enumBugKeys","getKeys","PROTOTYPE","dPs","create","descriptor","setToStringTag","toObject","$iterCreate","getPrototypeOf","LIBRARY","Iterators","redefine","$export","step","addToUnscopables","TAG","ITERATOR","classof","getIterFn","isArrayIter","call","process","invoke","cel","html","Promise","isNode","newPromiseCapability","SPECIES","DESCRIPTORS","TypeError","newPromiseCapabilityModule","perform","anInstance","require$$3","speciesConstructor","require$$4","require$$5","require$$6","promiseResolve","require$$7","forOf","define","require","this","newBuilder","build","messages","push_server","messages2","JsonObjectMessage","UnreadTuple","LogItem","DataCommand","SessionCommand","ErrorCommand","DirectCommand","AckCommand","UnreadCommand","ConvCommand","RoomCommand","LogsCommand","RcpCommand","ReadTuple","MaxReadTuple","ReadCommand","PresenceCommand","ReportCommand","GenericCommand","PatchCommand","PatchItem","CommandType","OpType","StatusType","gOPS","pIE","_assign","_promise","$defineProperty","createProperty","_from","redefineAll","validate","$iterDefine","setSpecies","isArray","asc","fails","meta","strong","from","wksExt","gOPN","toString","gOPD","$GOPD","$DP","gOPNExt","wks","shared","ObjectProto","USE_NATIVE","$fails","_create","enumKeys","wksDefine","_iterator","_symbol","_typeof2","_setPrototypeOf","d","ms","bind","fn","thisArg","wrap","args","Array","arguments","length","i","apply","Object","prototype","val","isArrayBuffer","isFormData","FormData","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isUndefined","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","str","replace","isStandardBrowserEnv","navigator","product","window","forEach","obj","l","key","hasOwnProperty","merge","assignValue","extend","a","b","isBuffer","$JSON","normalizeHeaderName","headers","normalizedName","utils","processHeader","value","name","toUpperCase","enhanceError","error","config","code","request","response","createError","message","Error","settle","resolve","reject","validateStatus","status","encode","encodeURIComponent","buildURL","url","params","paramsSerializer","serializedParams","parts","serialize","parseValue","v","toISOString","push","join","indexOf","parseHeaders","parsed","split","parser","line","substr","toLowerCase","standardBrowserEnv","msie","test","userAgent","urlParsingNode","createElement","originURL","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","isURLSameOrigin","requestURL","nonStandardBrowserEnv","chars","E","btoa","input","String","output","block","charCode","idx","map","charCodeAt","write","expires","path","domain","secure","cookie","Date","toGMTString","read","match","RegExp","decodeURIComponent","remove","now","xhrAdapter","dispatchXhrRequest","requestData","data","requestHeaders","XMLHttpRequest","loadEvent","xDomain","env","NODE_ENV","XDomainRequest","onprogress","handleProgress","ontimeout","handleTimeout","auth","username","password","Authorization","open","method","timeout","handleLoad","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseData","responseType","responseText","statusText","onerror","handleError","cookies","xsrfValue","withCredentials","xsrfCookieName","undefined","xsrfHeaderName","setRequestHeader","e","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","onCanceled","cancel","abort","send","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","getDefaultAdapter","adapter","defaults","transformRequest","transformResponse","JSON","parse","maxContentLength","common","forEachMethodNoData","forEachMethodWithData","InterceptorManager","handlers","use","fulfilled","rejected","eject","id","forEachHandler","h","transformData","fns","transform","isCancel","__CANCEL__","throwIfCancellationRequested","throwIfRequested","dispatchRequest","cleanHeaderConfig","onAdapterResolution","onAdapterRejection","reason","isAbsoluteURL","combineURLs","baseURL","relativeURL","Axios","instanceConfig","interceptors","chain","unshiftRequestInterceptors","interceptor","unshift","pushResponseInterceptors","shift","Cancel","CancelToken","executor","resolvePromise","promiseExecutor","token","source","c","spread","callback","arr","createInstance","defaultConfig","context","instance","axios","all","promises","$getOwnPropertyDescriptor","$Object","createArrayMethod","$has","weak","assign","_defineProperty","freeGlobal","Symbol","root","objectProto","symToStringTag","nativeObjectToString","getRawTag","objectToString","overArg","isObjectLike","baseGetTag","getPrototype","EXPIRED","debug","Expirable","ttl","_value","expiredAt","expired","Cache","_map","get","cache","set","tryAll","promiseConstructors","catch","slice","tap","isIE10","internal","object","removeNull","isPlainObject","prop","ensureArray","target","isWeapp","wx","connectSocket","WebSocket","MozWebSocket","HEARTBEAT_TIME","TIMEOUT_TIME","DEFAULT_RETRY_STRATEGY","Math","attempt","requireConnected","requireConnectedWrapper","is","currentState","current","console","warn","WebSocketPlus","getUrls","_getUrls","_protocol","init","_createWs","__postponeTimeoutTimer","_postponeTimeoutTimer","__pause","pause","__resume","resume","throw","wsUrls","urls","ws","binaryType","onopen","onclose","_ws","_handleClose","onmessage","_handleMessage","_destroyWs","close","onbeforeevent","event","to","payload","emit","onconnected","_startConnectionKeeper","onleaveconnected","_stopConnectionKeeper","onpause","onbeforeresume","onreconnect","ondisconnected","delay","__scheduledRetry","clearTimeout","setTimeout","retry","onretry","can","reconnect","fail","removeEventListener","_ping","ping","_clearTimeoutTimers","_timeoutTimer","disconnect","_heartbeatTimer","setInterval","addListener","removeListener","clearInterval","isFinished","handleClose","handleMessage","EventEmitter","StateMachine","initial","state","defer","terminal","events","ErrorCode","reduce","Number","errorMessage","appCode","detail","err","COMMAND_TIMEOUT","Connection","getUrl","format","version","protocolString","_protocalFormat","_commands","_serialId","command","waitingForRespond","serialId","toBase64","toArrayBuffer","msg","decode","cmd","echo","applyDecorators","decorators","decorator","_pluginName","applyDispatcher","dispatchers","resultPromise","dispatcher","shouldDispatch","routerCache","Realtime","options","appId","appKey","_options","region","pushOfflineMessages","noBinary","ssl","server","SERVER","_cache","clients","_plugins","__preRegisteredPlugins","plugins","plugin","hook","concat","onRealtimeCreate","_request","query","constructor","_fetchAppRouter","api","_open","_openPromise","connection","_getEndpoints","on","_dispatchCommand","client","isFatal","APP_NOT_AVAILABLE","INVALID_LOGIN","INVALID_ORIGIN","some","errorCode","_fetchEndpointsInfo","info","secondary","cachedRouter","res","rtmRouter","rtm_router_server","api_server","router","features","_t","_close","cannot","_register","add","_deregister","delete","size","beforeCommandDispatch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;AACA,KAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AACrB,KAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AACvB,eAAc,GAAG,UAAU,EAAE,EAAE;GAC7B,OAAO,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;EAC1D;;CCLD;AACA,aAAc,GAAG,UAAU,EAAE,EAAE;GAC7B,IAAI,EAAE,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAC;GACpE,OA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AC9B,YAAM,IAAItZ,KAAJ,wEACiE+X,WAAWrI,OAD5E,CAAN;CAGD;CACD,WAAOqI,WAAWxF,KAAX,EAAP;CACD;CACD;;;;;;;;;;sBAQAjC,yBAAQ;CACN;CACA;CACA,QAAMyH,aAAa1J,SAAS,IAAT,EAAe0J,UAAlC;CACA,QAAI,CAACA,UAAL,EAAiB;CACjB,QAAIA,WAAWtF,GAAX,CAAe,OAAf,CAAJ,EAA6BsF,WAAWzH,KAAX;CAC9B;CACD;;;;;;;;;sBAOAE,2BAAS;CACP;CACA,QAAMuH,aAAa1J,SAAS,IAAT,EAAe0J,UAAlC;CACA,QAAI,CAACA,UAAL,EAAiB;CACjB,QAAIA,WAAWtF,GAAX,CAAe,QAAf,CAAJ,EAA8BsF,WAAWvH,MAAX;CAC/B;;sBAED+I,+BAAUpB,QAAQ;CAChB9J,aAAS,IAAT,EAAe2I,OAAf,CAAuBwC,GAAvB,CAA2BrB,MAA3B;CACD;;sBAEDsB,mCAAYtB,QAAQ;CAClB9J,aAAS,IAAT,EAAe2I,OAAf,CAAuB0C,MAAvB,CAA8BvB,MAA9B;CACA,QAAI9J,SAAS,IAAT,EAAe2I,OAAf,CAAuB2C,IAAvB,KAAgC,CAApC,EAAuC;CACrC,WAAKN,MAAL;CACD;CACF;;sBAEDnB,6CAAiBjD,SAAS;CACxB,WAAOa,gBAAgB,KAAKmB,QAAL,CAAc2C,qBAA9B,EAAqD,CAAC3E,OAAD,EAAU,IAAV,CAArD,EACJvN,IADI,CACC,UAACwO,cAAD,EAAoB;CACxB;CACA,UAAIA,cAAJ,EAAoB,OAAO9I,MAAM,wCAAN,EAAgDvP,OAAKoX,OAAL,CAAhD,CAAP;CACpB,aAAO,KAAP;CACD,KALI,CAAP;CAMD;;;GAjXmCvB;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/realtime-core.js b/dist/realtime-core.js new file mode 100644 index 000000000..458bef4fc --- /dev/null +++ b/dist/realtime-core.js @@ -0,0 +1,2558 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var _Promise = _interopDefault(require('babel-runtime/core-js/promise')); +var protobufLight = _interopDefault(require('protobufjs/dist/protobuf-light')); +var EventEmitter = _interopDefault(require('eventemitter3')); +var _regeneratorRuntime = _interopDefault(require('babel-runtime/regenerator')); +var _extends = _interopDefault(require('babel-runtime/helpers/extends')); +var _asyncToGenerator = _interopDefault(require('babel-runtime/helpers/asyncToGenerator')); +var _toConsumableArray = _interopDefault(require('babel-runtime/helpers/toConsumableArray')); +var _Set = _interopDefault(require('babel-runtime/core-js/set')); +var _Object$assign = _interopDefault(require('babel-runtime/core-js/object/assign')); +var _classCallCheck = _interopDefault(require('babel-runtime/helpers/classCallCheck')); +var _possibleConstructorReturn = _interopDefault(require('babel-runtime/helpers/possibleConstructorReturn')); +var _inherits = _interopDefault(require('babel-runtime/helpers/inherits')); +var d = _interopDefault(require('debug')); +var axios = _interopDefault(require('axios')); +var _Object$getOwnPropertyDescriptor = _interopDefault(require('babel-runtime/core-js/object/get-own-property-descriptor')); +var StateMachine = _interopDefault(require('javascript-state-machine')); +var WebSocket = _interopDefault(require('ws')); +var _typeof = _interopDefault(require('babel-runtime/helpers/typeof')); +var _JSON$stringify = _interopDefault(require('babel-runtime/core-js/json/stringify')); +var _WeakMap = _interopDefault(require('babel-runtime/core-js/weak-map')); +var _Array$from = _interopDefault(require('babel-runtime/core-js/array/from')); +var _defineProperty = _interopDefault(require('babel-runtime/helpers/defineProperty')); +var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys')); +var isPlainObject = _interopDefault(require('lodash/isPlainObject')); +var _createClass = _interopDefault(require('babel-runtime/helpers/createClass')); +var _Symbol = _interopDefault(require('babel-runtime/core-js/symbol')); +var _Object$freeze = _interopDefault(require('babel-runtime/core-js/object/freeze')); + +var messageCompiled = protobufLight.newBuilder({})['import']({ + "package": "push_server.messages2", + "syntax": "proto2", + "options": { + "objc_class_prefix": "AVIM" + }, + "messages": [{ + "name": "JsonObjectMessage", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "data", + "id": 1 + }] + }, { + "name": "UnreadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "required", + "type": "int32", + "name": "unread", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentioned", + "id": 8 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 9 + }] + }, { + "name": "LogItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "from", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "msgId", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "ackAt", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "readAt", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 9 + }, { + "rule": "optional", + "type": "bool", + "name": "bin", + "id": 10 + }] + }, { + "name": "DataCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 1 + }, { + "rule": "repeated", + "type": "JsonObjectMessage", + "name": "msg", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 3 + }] + }, { + "name": "SessionCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int64", + "name": "t", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "ua", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tag", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "deviceId", + "id": 7 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "onlineSessionPeerIds", + "id": 9 + }, { + "rule": "optional", + "type": "string", + "name": "st", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "stTtl", + "id": 11 + }, { + "rule": "optional", + "type": "int32", + "name": "code", + "id": 12 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "deviceToken", + "id": 14 + }, { + "rule": "optional", + "type": "bool", + "name": "sp", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 16 + }, { + "rule": "optional", + "type": "int64", + "name": "lastUnreadNotifTime", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 18 + }, { + "rule": "optional", + "type": "int64", + "name": "configBitmap", + "id": 19 + }] + }, { + "name": "ErrorCommand", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "required", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 4 + }] + }, { + "name": "DirectCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "msg", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "fromPeerId", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 5 + }, { + "rule": "optional", + "type": "bool", + "name": "hasMore", + "id": 6 + }, { + "rule": "repeated", + "type": "string", + "name": "toPeerIds", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 10 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "id", + "id": 12 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "dt", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "pushData", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "will", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 18 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 19 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 20 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 21 + }] + }, { + "name": "AckCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "fromts", + "id": 7 + }, { + "rule": "optional", + "type": "int64", + "name": "tots", + "id": 8 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 11 + }] + }, { + "name": "UnreadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "UnreadTuple", + "name": "convs", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "notifTime", + "id": 2 + }] + }, { + "name": "ConvCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "m", + "id": 1 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "unique", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "cdate", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "initBy", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "sort", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 8 + }, { + "rule": "optional", + "type": "int32", + "name": "skip", + "id": 9 + }, { + "rule": "optional", + "type": "int32", + "name": "flag", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "count", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "udate", + "id": 12 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 15 + }, { + "rule": "optional", + "type": "bool", + "name": "statusSub", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "statusPub", + "id": 17 + }, { + "rule": "optional", + "type": "int32", + "name": "statusTTL", + "id": 18 + }, { + "rule": "optional", + "type": "string", + "name": "uniqueId", + "id": 19 + }, { + "rule": "optional", + "type": "string", + "name": "targetClientId", + "id": 20 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 21 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 22 + }, { + "rule": "optional", + "type": "bool", + "name": "queryAllMembers", + "id": 23 + }, { + "rule": "repeated", + "type": "MaxReadTuple", + "name": "maxReadTuples", + "id": 24 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 25 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "results", + "id": 100 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "where", + "id": 101 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "attr", + "id": 103 + }] + }, { + "name": "RoomCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 5 + }, { + "rule": "repeated", + "type": "string", + "name": "roomPeerIds", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "byPeerId", + "id": 7 + }] + }, { + "name": "LogsCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int32", + "name": "l", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "tt", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tmid", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 7 + }, { + "rule": "optional", + "type": "string", + "name": "checksum", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "stored", + "id": 9 + }, { + "rule": "optional", + "type": "QueryDirection", + "name": "direction", + "id": 10, + "options": { + "default": "OLD" + } + }, { + "rule": "optional", + "type": "bool", + "name": "tIncluded", + "id": 11 + }, { + "rule": "optional", + "type": "bool", + "name": "ttIncluded", + "id": 12 + }, { + "rule": "repeated", + "type": "LogItem", + "name": "logs", + "id": 105 + }], + "enums": [{ + "name": "QueryDirection", + "syntax": "proto2", + "values": [{ + "name": "OLD", + "id": 1 + }, { + "name": "NEW", + "id": 2 + }] + }] + }, { + "name": "RcpCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "id", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "read", + "id": 4 + }] + }, { + "name": "ReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }] + }, { + "name": "MaxReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "pid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 3 + }] + }, { + "name": "ReadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 2 + }, { + "rule": "repeated", + "type": "ReadTuple", + "name": "convs", + "id": 3 + }] + }, { + "name": "PresenceCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "StatusType", + "name": "status", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 3 + }] + }, { + "name": "ReportCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "bool", + "name": "initiative", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 3 + }] + }, { + "name": "PatchItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "recall", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 7 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 10 + }] + }, { + "name": "PatchCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "PatchItem", + "name": "patches", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 2 + }] + }, { + "name": "GenericCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "CommandType", + "name": "cmd", + "id": 1 + }, { + "rule": "optional", + "type": "OpType", + "name": "op", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "appId", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "peerId", + "id": 4 + }, { + "rule": "optional", + "type": "int32", + "name": "i", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "installationId", + "id": 6 + }, { + "rule": "optional", + "type": "int32", + "name": "priority", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "service", + "id": 8 + }, { + "rule": "optional", + "type": "DataCommand", + "name": "dataMessage", + "id": 101 + }, { + "rule": "optional", + "type": "SessionCommand", + "name": "sessionMessage", + "id": 102 + }, { + "rule": "optional", + "type": "ErrorCommand", + "name": "errorMessage", + "id": 103 + }, { + "rule": "optional", + "type": "DirectCommand", + "name": "directMessage", + "id": 104 + }, { + "rule": "optional", + "type": "AckCommand", + "name": "ackMessage", + "id": 105 + }, { + "rule": "optional", + "type": "UnreadCommand", + "name": "unreadMessage", + "id": 106 + }, { + "rule": "optional", + "type": "ReadCommand", + "name": "readMessage", + "id": 107 + }, { + "rule": "optional", + "type": "RcpCommand", + "name": "rcpMessage", + "id": 108 + }, { + "rule": "optional", + "type": "LogsCommand", + "name": "logsMessage", + "id": 109 + }, { + "rule": "optional", + "type": "ConvCommand", + "name": "convMessage", + "id": 110 + }, { + "rule": "optional", + "type": "RoomCommand", + "name": "roomMessage", + "id": 111 + }, { + "rule": "optional", + "type": "PresenceCommand", + "name": "presenceMessage", + "id": 112 + }, { + "rule": "optional", + "type": "ReportCommand", + "name": "reportMessage", + "id": 113 + }, { + "rule": "optional", + "type": "PatchCommand", + "name": "patchMessage", + "id": 114 + }] + }], + "enums": [{ + "name": "CommandType", + "syntax": "proto2", + "values": [{ + "name": "session", + "id": 0 + }, { + "name": "conv", + "id": 1 + }, { + "name": "direct", + "id": 2 + }, { + "name": "ack", + "id": 3 + }, { + "name": "rcp", + "id": 4 + }, { + "name": "unread", + "id": 5 + }, { + "name": "logs", + "id": 6 + }, { + "name": "error", + "id": 7 + }, { + "name": "login", + "id": 8 + }, { + "name": "data", + "id": 9 + }, { + "name": "room", + "id": 10 + }, { + "name": "read", + "id": 11 + }, { + "name": "presence", + "id": 12 + }, { + "name": "report", + "id": 13 + }, { + "name": "echo", + "id": 14 + }, { + "name": "loggedin", + "id": 15 + }, { + "name": "logout", + "id": 16 + }, { + "name": "loggedout", + "id": 17 + }, { + "name": "patch", + "id": 18 + }] + }, { + "name": "OpType", + "syntax": "proto2", + "values": [{ + "name": "open", + "id": 1 + }, { + "name": "add", + "id": 2 + }, { + "name": "remove", + "id": 3 + }, { + "name": "close", + "id": 4 + }, { + "name": "opened", + "id": 5 + }, { + "name": "closed", + "id": 6 + }, { + "name": "query", + "id": 7 + }, { + "name": "query_result", + "id": 8 + }, { + "name": "conflict", + "id": 9 + }, { + "name": "added", + "id": 10 + }, { + "name": "removed", + "id": 11 + }, { + "name": "start", + "id": 30 + }, { + "name": "started", + "id": 31 + }, { + "name": "joined", + "id": 32 + }, { + "name": "members_joined", + "id": 33 + }, { + "name": "left", + "id": 39 + }, { + "name": "members_left", + "id": 40 + }, { + "name": "results", + "id": 42 + }, { + "name": "count", + "id": 43 + }, { + "name": "result", + "id": 44 + }, { + "name": "update", + "id": 45 + }, { + "name": "updated", + "id": 46 + }, { + "name": "mute", + "id": 47 + }, { + "name": "unmute", + "id": 48 + }, { + "name": "status", + "id": 49 + }, { + "name": "members", + "id": 50 + }, { + "name": "max_read", + "id": 51 + }, { + "name": "is_member", + "id": 52 + }, { + "name": "join", + "id": 80 + }, { + "name": "invite", + "id": 81 + }, { + "name": "leave", + "id": 82 + }, { + "name": "kick", + "id": 83 + }, { + "name": "reject", + "id": 84 + }, { + "name": "invited", + "id": 85 + }, { + "name": "kicked", + "id": 86 + }, { + "name": "upload", + "id": 100 + }, { + "name": "uploaded", + "id": 101 + }, { + "name": "modify", + "id": 150 + }, { + "name": "modified", + "id": 151 + }] + }, { + "name": "StatusType", + "syntax": "proto2", + "values": [{ + "name": "on", + "id": 1 + }, { + "name": "off", + "id": 2 + }] + }], + "isNamespace": true +}).build(); + +var _messages$push_server = messageCompiled.push_server.messages2; +var JsonObjectMessage = _messages$push_server.JsonObjectMessage; +var UnreadTuple = _messages$push_server.UnreadTuple; +var LogItem = _messages$push_server.LogItem; +var DataCommand = _messages$push_server.DataCommand; +var SessionCommand = _messages$push_server.SessionCommand; +var ErrorCommand = _messages$push_server.ErrorCommand; +var DirectCommand = _messages$push_server.DirectCommand; +var AckCommand = _messages$push_server.AckCommand; +var UnreadCommand = _messages$push_server.UnreadCommand; +var ConvCommand = _messages$push_server.ConvCommand; +var RoomCommand = _messages$push_server.RoomCommand; +var LogsCommand = _messages$push_server.LogsCommand; +var RcpCommand = _messages$push_server.RcpCommand; +var ReadTuple = _messages$push_server.ReadTuple; +var MaxReadTuple = _messages$push_server.MaxReadTuple; +var ReadCommand = _messages$push_server.ReadCommand; +var PresenceCommand = _messages$push_server.PresenceCommand; +var ReportCommand = _messages$push_server.ReportCommand; +var GenericCommand = _messages$push_server.GenericCommand; +var PatchCommand = _messages$push_server.PatchCommand; +var PatchItem = _messages$push_server.PatchItem; +var CommandType = _messages$push_server.CommandType; +var OpType = _messages$push_server.OpType; +var StatusType = _messages$push_server.StatusType; + + + + +var message = Object.freeze({ + JsonObjectMessage: JsonObjectMessage, + UnreadTuple: UnreadTuple, + LogItem: LogItem, + DataCommand: DataCommand, + SessionCommand: SessionCommand, + ErrorCommand: ErrorCommand, + DirectCommand: DirectCommand, + AckCommand: AckCommand, + UnreadCommand: UnreadCommand, + ConvCommand: ConvCommand, + RoomCommand: RoomCommand, + LogsCommand: LogsCommand, + RcpCommand: RcpCommand, + ReadTuple: ReadTuple, + MaxReadTuple: MaxReadTuple, + ReadCommand: ReadCommand, + PresenceCommand: PresenceCommand, + ReportCommand: ReportCommand, + GenericCommand: GenericCommand, + PatchCommand: PatchCommand, + PatchItem: PatchItem, + CommandType: CommandType, + OpType: OpType, + StatusType: StatusType +}); + +/* eslint-disable */ +var global$1 = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {}; + +var EXPIRED = _Symbol('expired'); +var debug$3 = d('LC:Expirable'); + +var Expirable = function () { + function Expirable(value, ttl) { + _classCallCheck(this, Expirable); + + this._value = value; + if (typeof ttl === 'number') { + this.expiredAt = Date.now() + ttl; + } + } + + _createClass(Expirable, [{ + key: 'value', + get: function get() { + var expired = this.expiredAt && this.expiredAt < Date.now(); + if (expired) debug$3('expired: ' + this._value); + return expired ? EXPIRED : this._value; + } + }]); + + return Expirable; +}(); + +Expirable.EXPIRED = EXPIRED; + +var debug$4 = d('LC:Cache'); + +var Cache = function () { + function Cache() { + var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'anonymous'; + + _classCallCheck(this, Cache); + + this.name = name; + this._map = {}; + } + + Cache.prototype.get = function get(key) { + var cache = this._map[key]; + if (cache) { + var value = cache.value; + if (value !== Expirable.EXPIRED) { + debug$4('[%s] hit: %s %O', this.name, key, value); + return value; + } + delete this._map[key]; + } + debug$4('[' + this.name + '] missed: ' + key); + return null; + }; + + Cache.prototype.set = function set(key, value, ttl) { + debug$4('[%s] set: %s %O %d', this.name, key, value, ttl); + this._map[key] = new Expirable(value, ttl); + }; + + return Cache; +}(); + +var tryAll = function tryAll(promiseConstructors) { + var promise = new _Promise(promiseConstructors[0]); + if (promiseConstructors.length === 1) { + return promise; + } + return promise.catch(function () { + return tryAll(promiseConstructors.slice(1)); + }); +}; + +var tap = function tap(interceptor) { + return function (value) { + return interceptor(value), value; + }; +}; + + + + + +var isIE10 = global$1.navigator && global$1.navigator.userAgent && global$1.navigator.userAgent.indexOf('MSIE 10.') !== -1; + +/* eslint-disable no-proto */ + +/* eslint-enable no-proto */ + + + + +var map = new _WeakMap(); + +// protected property helper +var internal = function internal(object) { + if (!map.has(object)) { + map.set(object, {}); + } + return map.get(object); +}; + +// debug utility +var removeNull = function removeNull(obj) { + if (!isPlainObject(obj)) return obj; + var object = _Object$assign({}, obj); + // eslint-disable-next-line no-restricted-syntax + for (var prop in object) { + if ({}.hasOwnProperty.call(object, prop)) { + var value = object[prop]; + if (value === null) { + delete object[prop]; + } else { + object[prop] = removeNull(value); + } + } + } + return object; +}; +var trim = function trim(message) { + return removeNull(JSON.parse(_JSON$stringify(message))); +}; + +var ensureArray = function ensureArray(target) { + if (Array.isArray(target)) { + return target; + } + if (target === undefined || target === null) { + return []; + } + return [target]; +}; + + + +// eslint-disable-next-line no-undef +var isWeapp = (typeof wx === 'undefined' ? 'undefined' : _typeof(wx)) === 'object' && typeof wx.connectSocket === 'function'; + +// throttle decorator + +var _class; + +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; +} + +// WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface. + +var debug$2 = d('LC:WebSocketPlus'); + +var HEARTBEAT_TIME = 180000; +var TIMEOUT_TIME = 380000; + +var DEFAULT_RETRY_STRATEGY = function DEFAULT_RETRY_STRATEGY(attempt) { + return Math.min(1000 * Math.pow(2, attempt), 300000); +}; + +var requireConnected = function requireConnected(target, name, descriptor) { + return _Object$assign({}, descriptor, { + value: function requireConnectedWrapper() { + var _descriptor$value; + + if (!this.is('connected')) { + var currentState = this.current; + console.warn(name + ' should not be called when the connection is ' + currentState); + if (this.is('disconnected') || this.is('reconnecting')) { + console.warn('disconnect and reconnect event should be handled to avoid such calls.'); + } + throw new Error('Connection unavailable'); + } + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return (_descriptor$value = descriptor.value).call.apply(_descriptor$value, [this].concat(args)); + } + }); +}; + +var WebSocketPlus = (_class = function (_EventEmitter) { + _inherits(WebSocketPlus, _EventEmitter); + + function WebSocketPlus(getUrls, protocol) { + _classCallCheck(this, WebSocketPlus); + + if (typeof WebSocket === 'undefined') { + throw new Error('WebSocket is undefined. Polyfill is required in this runtime.'); + } + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof getUrls !== 'function') { + _this._getUrls = function () { + return _Promise.resolve(getUrls); + }; + } else { + _this._getUrls = getUrls; + } + _this._protocol = protocol; + _this.init(); + _this._createWs(_this._getUrls, _this._protocol).then(function () { + _this.__postponeTimeoutTimer = _this._postponeTimeoutTimer.bind(_this); + if (global$1.addEventListener) { + _this.__pause = function () { + return _this.pause(); + }; + _this.__resume = function () { + return _this.resume(); + }; + global$1.addEventListener('offline', _this.__pause); + global$1.addEventListener('online', _this.__resume); + } + _this.open(); + }).catch(_this.throw.bind(_this)); + return _this; + } + + WebSocketPlus.prototype._createWs = function _createWs(getUrls, protocol) { + var _this2 = this; + + return getUrls().then(function (wsUrls) { + var urls = wsUrls; + if (!(urls instanceof Array)) { + urls = [urls]; + } + return tryAll(urls.map(function (url) { + return function (resolve, reject) { + debug$2('connect [' + url + '] ' + protocol); + var ws = protocol ? new WebSocket(url, protocol) : new WebSocket(url); + ws.binaryType = _this2.binaryType || 'arraybuffer'; + ws.onopen = function () { + return resolve(ws); + }; + ws.onclose = function (error) { + if (error instanceof Error) { + return reject(error); + } + // in browser, error event is useless + return reject(new Error('Failed to connect [' + url + ']')); + }; + ws.onerror = ws.onclose; + }; + })).then(function (ws) { + _this2._ws = ws; + _this2._ws.onclose = _this2._handleClose.bind(_this2); + _this2._ws.onmessage = _this2._handleMessage.bind(_this2); + return ws; + }); + }); + }; + + WebSocketPlus.prototype._destroyWs = function _destroyWs() { + var ws = this._ws; + if (!ws) return; + ws.onopen = null; + ws.onclose = null; + ws.onerror = null; + ws.onmessage = null; + this._ws = null; + ws.close(); + }; + + // eslint-disable-next-line class-methods-use-this + + + WebSocketPlus.prototype.onbeforeevent = function onbeforeevent(event, from, to) { + for (var _len2 = arguments.length, payload = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) { + payload[_key2 - 3] = arguments[_key2]; + } + + debug$2.apply(undefined, [event + ': ' + from + ' -> ' + to].concat(payload)); + }; + + WebSocketPlus.prototype.onopen = function onopen() { + this.emit('open'); + }; + + WebSocketPlus.prototype.onconnected = function onconnected() { + this._startConnectionKeeper(); + }; + + WebSocketPlus.prototype.onleaveconnected = function onleaveconnected(event, from, to) { + this._stopConnectionKeeper(); + this._destroyWs(); + if (to === 'offline' || to === 'disconnected') { + this.emit('disconnect'); + } + }; + + WebSocketPlus.prototype.onpause = function onpause() { + this.emit('offline'); + }; + + WebSocketPlus.prototype.onbeforeresume = function onbeforeresume() { + this.emit('online'); + }; + + WebSocketPlus.prototype.onreconnect = function onreconnect() { + this.emit('reconnect'); + }; + + WebSocketPlus.prototype.ondisconnected = function ondisconnected(event, from, to) { + var _this3 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + var delay = DEFAULT_RETRY_STRATEGY.call(null, attempt); + debug$2('schedule attempt=' + attempt + ' delay=' + delay); + this.emit('schedule', attempt, delay); + if (this.__scheduledRetry) { + clearTimeout(this.__scheduledRetry); + } + this.__scheduledRetry = setTimeout(function () { + if (_this3.is('disconnected')) { + _this3.retry(attempt); + } + }, delay); + }; + + WebSocketPlus.prototype.onretry = function onretry(event, from, to) { + var _this4 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + this.emit('retry', attempt); + this._createWs(this._getUrls, this._protocol).then(function () { + return _this4.can('reconnect') ? _this4.reconnect() : _this4._destroyWs(); + }, function () { + return _this4.can('fail') && _this4.fail(attempt + 1); + }); + }; + + WebSocketPlus.prototype.onerror = function onerror(event, from, to, error) { + this.emit('error', error); + }; + + WebSocketPlus.prototype.onclose = function onclose() { + if (global$1.removeEventListener) { + if (this.__pause) global$1.removeEventListener('offline', this.__pause); + if (this.__resume) global$1.removeEventListener('online', this.__resume); + } + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype._ping = function _ping() { + debug$2('ping'); + try { + this.ping(); + } catch (error) { + console.warn('websocket ping error: ' + error.message); + } + }; + + WebSocketPlus.prototype.ping = function ping() { + if (this._ws.ping) { + this._ws.ping(); + } else { + console.warn('The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.'); + } + }; + + WebSocketPlus.prototype._postponeTimeoutTimer = function _postponeTimeoutTimer() { + var _this5 = this; + + debug$2('_postponeTimeoutTimer'); + this._clearTimeoutTimers(); + this._timeoutTimer = setTimeout(function () { + debug$2('timeout'); + _this5.disconnect(); + }, TIMEOUT_TIME); + }; + + WebSocketPlus.prototype._clearTimeoutTimers = function _clearTimeoutTimers() { + if (this._timeoutTimer) { + clearTimeout(this._timeoutTimer); + } + }; + + WebSocketPlus.prototype._startConnectionKeeper = function _startConnectionKeeper() { + debug$2('start connection keeper'); + this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME); + var addListener = this._ws.addListener || this._ws.addEventListener; + addListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._postponeTimeoutTimer(); + }; + + WebSocketPlus.prototype._stopConnectionKeeper = function _stopConnectionKeeper() { + debug$2('stop connection keeper'); + // websockets/ws#489 + var removeListener = this._ws.removeListener || this._ws.removeEventListener; + removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._clearTimeoutTimers(); + if (this._heartbeatTimer) { + clearInterval(this._heartbeatTimer); + } + }; + + WebSocketPlus.prototype._handleClose = function _handleClose(event) { + debug$2('ws closed [' + event.code + '] ' + event.reason); + // socket closed manually, ignore close event. + if (this.isFinished()) return; + this.handleClose(event); + }; + + WebSocketPlus.prototype.handleClose = function handleClose() { + // reconnect + this.disconnect(); + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype.send = function send(data) { + debug$2('send', data); + this._ws.send(data); + }; + + WebSocketPlus.prototype._handleMessage = function _handleMessage(event) { + debug$2('message', event.data); + this.handleMessage(event.data); + }; + + WebSocketPlus.prototype.handleMessage = function handleMessage(message) { + this.emit('message', message); + }; + + return WebSocketPlus; +}(EventEmitter), (_applyDecoratedDescriptor(_class.prototype, '_ping', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, '_ping'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'send', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, 'send'), _class.prototype)), _class); + + +StateMachine.create({ + target: WebSocketPlus.prototype, + initial: { + state: 'initialized', + event: 'init', + defer: true + }, + terminal: 'closed', + events: [{ + name: 'open', + from: 'initialized', + to: 'connected' + }, { + name: 'disconnect', + from: 'connected', + to: 'disconnected' + }, { + name: 'retry', + from: 'disconnected', + to: 'reconnecting' + }, { + name: 'fail', + from: 'reconnecting', + to: 'disconnected' + }, { + name: 'reconnect', + from: 'reconnecting', + to: 'connected' + }, { + name: 'pause', + from: ['connected', 'disconnected', 'reconnecting'], + to: 'offline' + }, {}, { + name: 'resume', + from: 'offline', + to: 'disconnected' + }, { + name: 'close', + from: ['connected', 'disconnected', 'reconnecting', 'offline'], + to: 'closed' + }, { + name: 'throw', + from: '*', + to: 'error' + }] +}); + +var error = _Object$freeze({ + 1000: { + name: 'CLOSE_NORMAL' + }, + 1006: { + name: 'CLOSE_ABNORMAL' + }, + 4100: { + name: 'APP_NOT_AVAILABLE', + message: 'App not exists or realtime message service is disabled.' + }, + 4103: { + name: 'INVALID_LOGIN', + message: 'Malformed clientId.' + }, + 4105: { + name: 'SESSION_REQUIRED', + message: 'Message sent before session opened. ' + }, + 4107: { + name: 'READ_TIMEOUT' + }, + 4108: { + name: 'LOGIN_TIMEOUT' + }, + 4109: { + name: 'FRAME_TOO_LONG' + }, + 4110: { + name: 'INVALID_ORIGIN', + message: 'Access denied by domain whitelist.' + }, + 4111: { + name: 'SESSION_CONFLICT' + }, + 4112: { + name: 'SESSION_TOKEN_EXPIRED' + }, + 4200: { + name: 'INTERNAL_ERROR', + message: 'Internal error, please contact LeanCloud for support.' + }, + 4201: { + name: 'SEND_MESSAGE_TIMEOUT' + }, + 4302: { + name: 'CONVERSATION_SIGNATURE_FAILED' + }, + 4303: { + name: 'CONVERSATION_NOT_FOUND' + }, + 4304: { + name: 'CONVERSATION_FULL' + }, + 4305: { + name: 'CONVERSATION_REJECTED_BY_APP' + }, + 4306: { + name: 'CONVERSATION_UPDATE_FAILED' + }, + 4307: { + name: 'CONVERSATION_READ_ONLY' + }, + 4308: { + name: 'CONVERSATION_NOT_ALLOWED' + }, + 4401: { + name: 'INVALID_MESSAGING_TARGET' + }, + 4402: { + name: 'MESSAGE_REJECTED_BY_APP' + } +}); + +var ErrorCode = _Object$freeze(_Object$keys(error).reduce(function (result, code) { + return _Object$assign(result, _defineProperty({}, error[code].name, Number(code))); +}, {})); + +var createError = function createError(errorMessage) { + var code = errorMessage.code, + reason = errorMessage.reason, + appCode = errorMessage.appCode, + detail = errorMessage.detail; + + var message = reason || detail; + if (!message && error[code]) { + message = error[code].message || error[code].name; + } + if (!message) { + message = 'Unknow Error: ' + code; + } + var err = new Error(message); + return _Object$assign(err, { + code: code, appCode: appCode, detail: detail + }); +}; + +var debug$1 = d('LC:Connection'); + +var COMMAND_TIMEOUT = 20000; + +var Connection = function (_WebSocketPlus) { + _inherits(Connection, _WebSocketPlus); + + function Connection(getUrl, _ref) { + var format = _ref.format, + version = _ref.version; + + _classCallCheck(this, Connection); + + debug$1('initializing Connection'); + var protocolString = 'lc.' + format + '.' + version; + if (!isWeapp) { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl, protocolString)); + } else { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl().then(function (urls) { + return urls.map(function (url) { + return '' + url + (url.indexOf('?') === -1 ? '?' : '&') + 'subprotocol=' + encodeURIComponent(protocolString); + }); + }))); + } + _this._protocalFormat = format; + _this._commands = {}; + _this._serialId = 0; + return _possibleConstructorReturn(_this); + } + + Connection.prototype.send = function send(command) { + var _this2 = this; + + var waitingForRespond = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + var serialId = void 0; + if (waitingForRespond) { + this._serialId += 1; + serialId = this._serialId; + command.i = serialId; // eslint-disable-line no-param-reassign + } + debug$1('↑ %O sent', trim(command)); + + var message = void 0; + if (this._protocalFormat === 'proto2base64') { + message = command.toBase64(); + } else if (command.toArrayBuffer) { + message = command.toArrayBuffer(); + } + if (!message) { + throw new TypeError(command + ' is not a GenericCommand'); + } + + _WebSocketPlus.prototype.send.call(this, message); + + if (!waitingForRespond) { + return _Promise.resolve(); + } + return new _Promise(function (resolve, reject) { + _this2._commands[serialId] = { + resolve: resolve, + reject: reject, + timeout: setTimeout(function () { + if (_this2._commands[serialId]) { + debug$1('✗ %O timeout', trim(command)); + reject(new Error('Command Timeout.')); + delete _this2._commands[serialId]; + } + }, COMMAND_TIMEOUT) + }; + }); + }; + + Connection.prototype.handleMessage = function handleMessage(msg) { + var message = void 0; + try { + message = GenericCommand.decode(msg); + debug$1('↓ %O received', trim(message)); + } catch (e) { + console.warn('Decode message failed', msg); + } + this.emit('allmessage', message); + var serialId = message.i; + if (serialId) { + if (this._commands[serialId]) { + clearTimeout(this._commands[serialId].timeout); + if (message.cmd === CommandType.error) { + this._commands[serialId].reject(createError(message.errorMessage)); + } else { + this._commands[serialId].resolve(message); + } + delete this._commands[serialId]; + } else { + console.warn('Unexpected command received with serialId [' + serialId + '],\n which have timed out or never been requested.'); + } + } else if (message.cmd === CommandType.error) { + this.emit('error', createError(message.errorMessage)); + } else { + this.emit('message', message); + } + }; + + Connection.prototype.ping = function ping() { + return this.send(new GenericCommand({ + cmd: CommandType.echo + })).catch(function (error$$1) { + return debug$1('ping failed:', error$$1); + }); + }; + + return Connection; +}(WebSocketPlus); + +/* eslint-disable max-len */ + +/** + * 插件接口 + * + *

+ * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类: + *

+ * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。 + * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。 + *

+ * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。 + * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。 + * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。 + *

+ * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。 + * + * @interface Plugin + * @since 3.1.0 + */ + +/* eslint-enable max-len */ + +/** + * 插件名称,用于在日志中显示异常的插件 + * + * @name Plugin.name + * @type string + */ + +/** + * 插件注册的消息类型 + * + * @name Plugin.messageClasses + * @type AVMessage[] + */ + +/** + * 在 Realtime 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Realtime 实例。 + * + * @name Plugin.onRealtimeCreate + * @type Function + */ + +/** + * 在 IMClient 实例化后对其进行修饰。 + *

+ * 接受一个参数为 IMClient 实例。 + * + * @name Plugin.onIMClientCreate + * @type Function + */ + +/** + * 在 Conversation 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Conversation 实例。 + * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook, + * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。 + * + * @name Plugin.onConversationCreate + * @type Function + */ + +/** + * 在对消息进行 parse 之前,对原始消息进行修改。 + *

+ * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。 + * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。 + * + * @name Plugin.beforeMessageParse + * @type Function + */ + +/** + * 在对消息进行 parse 之后,对消息实例进行修改。 + *

+ * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。 + * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.afterMessageParse + * @type Function + */ + +/** + * 在收到消息之后,派发消息之前,控制是否派发这条消息。 + *

+ * 接受参数为 message 与 conversation。 + * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。 + * 如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.beforeMessageDispatch + * @type Function + * @since 3.4.0 + */ + +var applyDecorators = function applyDecorators(decorators, target) { + if (decorators) { + decorators.forEach(function (decorator) { + try { + decorator(target); + } catch (error) { + if (decorator._pluginName) { + error.message += '[' + decorator._pluginName + ']'; + } + throw error; + } + }); + } +}; + + + +var applyDispatcher = function applyDispatcher(dispatchers, payload) { + return ensureArray(dispatchers).reduce(function (resultPromise, dispatcher) { + return resultPromise.then(function (shouldDispatch) { + return shouldDispatch === false ? false : dispatcher.apply(undefined, _toConsumableArray(payload)); + }).catch(function (error) { + if (dispatcher._pluginName) { + // eslint-disable-next-line no-param-reassign + error.message += '[' + dispatcher._pluginName + ']'; + } + throw error; + }); + }, _Promise.resolve(true)); +}; + +var debug = d('LC:Realtime'); + +var routerCache = new Cache('push-router'); + +var Realtime = function (_EventEmitter) { + _inherits(Realtime, _EventEmitter); + + /** + * @extends EventEmitter + * @param {Object} options + * @param {String} options.appId + * @param {String} options.appKey (since 4.0.0) + * @param {String} [options.region='cn'] 节点 id + * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式) + * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。 + * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序) + * @param {Boolean} [options.ssl=true] 使用 wss 进行连接 + * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0) + */ + function Realtime(options) { + _classCallCheck(this, Realtime); + + debug('initializing Realtime'); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof options.appId !== 'string') { + throw new TypeError('appId [' + options.appId + '] is not a string'); + } + if (typeof options.appKey !== 'string') { + throw new TypeError('appKey [' + options.appKey + '] is not a string'); + } + _this._options = _Object$assign({ + appId: undefined, + appKey: undefined, + region: 'cn', + pushOfflineMessages: false, + noBinary: isWeapp, + ssl: true, + server: process.env.SERVER + }, options); + _this._cache = new Cache('endpoints'); + internal(_this).clients = new _Set(); + _this._plugins = [].concat(_toConsumableArray(ensureArray(Realtime.__preRegisteredPlugins)), _toConsumableArray(ensureArray(options.plugins))).reduce(function (result, plugin) { + // eslint-disable-next-line no-restricted-syntax + for (var hook in plugin) { + if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') { + if (plugin.name) { + ensureArray(plugin[hook]).forEach(function (value) { + // eslint-disable-next-line no-param-reassign + value._pluginName = plugin.name; + }); + } + // eslint-disable-next-line no-param-reassign + result[hook] = ensureArray(result[hook]).concat(plugin[hook]); + } + } + return result; + }, {}); + // onRealtimeCreate hook + applyDecorators(_this._plugins.onRealtimeCreate, _this); + return _this; + } + + Realtime.prototype._request = function () { + var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) { + var method = _ref.method, + _ref$version = _ref.version, + version = _ref$version === undefined ? '1.1' : _ref$version, + path = _ref.path, + query = _ref.query, + headers = _ref.headers, + _ref$data = _ref.data, + data = _ref$data === undefined ? {} : _ref$data; + + var _options, appId, region, _ref3, api, url; + + return _regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _options = this._options, appId = _options.appId, region = _options.region; + _context.next = 3; + return this.constructor._fetchAppRouter({ appId: appId, region: region }); + + case 3: + _ref3 = _context.sent; + api = _ref3.api; + url = 'https://' + api + '/' + version + path; + return _context.abrupt('return', axios(url, { + method: method, + params: query, + headers: _extends({ + 'X-LC-Id': this._options.appId, + 'X-LC-Key': this._options.appKey + }, headers), + data: data + }).then(function (response) { + return response.data; + })); + + case 7: + case 'end': + return _context.stop(); + } + } + }, _callee, this); + })); + + function _request(_x) { + return _ref2.apply(this, arguments); + } + + return _request; + }(); + + Realtime.prototype._open = function _open() { + var _this2 = this; + + if (this._openPromise) return this._openPromise; + + var format = 'protobuf2'; + if (this._options.noBinary) { + // 不发送 binary data,fallback to base64 string + format = 'proto2base64'; + } + var version = 3; + if (this._options.pushOfflineMessages) { + // 不推送离线消息,而是发送对话的未读通知 + version = 1; + } + var protocol = { + format: format, + version: version + }; + this._openPromise = new _Promise(function (resolve, reject) { + debug('No connection established, create a new one.'); + var connection = new Connection(function () { + return _this2._getEndpoints(_this2._options); + }, protocol); + connection.on('open', function () { + return resolve(connection); + }); + connection.on('error', reject); + connection.on('message', _this2._dispatchCommand.bind(_this2)); + /** + * 连接断开。 + * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。 + * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。 + * @event Realtime#disconnect + */ + /** + * 计划在一段时间后尝试重新连接 + * @event Realtime#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + */ + /** + * 正在尝试重新连接 + * @event Realtime#retry + * @param {Number} attempt 尝试重连的次数 + */ + /** + * 连接恢复正常。 + * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素 + * @event Realtime#reconnect + */ + + /** + * 客户端连接断开 + * @event IMClient#disconnect + * @see Realtime#event:disconnect + * @since 3.2.0 + */ + /** + * 计划在一段时间后尝试重新连接 + * @event IMClient#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + * @since 3.2.0 + */ + /** + * 正在尝试重新连接 + * @event IMClient#retry + * @param {Number} attempt 尝试重连的次数 + * @since 3.2.0 + */ + + /** + * 客户端进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event Realtime#offline + * @since 3.4.0 + */ + /** + * 客户端恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event Realtime#online + * @since 3.4.0 + */ + /** + * 进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event IMClient#offline + * @since 3.4.0 + */ + /** + * 恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event IMClient#online + * @since 3.4.0 + */ + + // event proxy + ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(function (event) { + return connection.on(event, function () { + for (var _len = arguments.length, payload = Array(_len), _key = 0; _key < _len; _key++) { + payload[_key] = arguments[_key]; + } + + debug(event + ' event emitted. %O', payload); + _this2.emit.apply(_this2, [event].concat(payload)); + if (event !== 'reconnect') { + internal(_this2).clients.forEach(function (client) { + client.emit.apply(client, [event].concat(payload)); + }); + } + }); + }); + // override handleClose + connection.handleClose = function handleClose(event) { + var isFatal = [ErrorCode.APP_NOT_AVAILABLE, ErrorCode.INVALID_LOGIN, ErrorCode.INVALID_ORIGIN].some(function (errorCode) { + return errorCode === event.code; + }); + if (isFatal) { + // in these cases, SDK should throw. + this.throw(createError(event)); + } else { + // reconnect + this.disconnect(); + } + }; + internal(_this2).connection = connection; + }); + + return this._openPromise; + }; + + Realtime.prototype._getEndpoints = function _getEndpoints(options) { + var _this3 = this; + + return _Promise.resolve(this._cache.get('endpoints') || this.constructor._fetchEndpointsInfo(options).then(tap(function (info) { + return _this3._cache.set('endpoints', info, info.ttl * 1000); + }))).then(function (info) { + debug('endpoint info: %O', info); + return [info.server, info.secondary]; + }); + }; + + Realtime._fetchAppRouter = function _fetchAppRouter(_ref4) { + var appId = _ref4.appId, + region = _ref4.region; + + debug('fetch router'); + switch (region) { + case 'cn': + { + var cachedRouter = routerCache.get(appId); + if (cachedRouter) { + return _Promise.resolve(cachedRouter); + } + return axios.get('https://app-router.leancloud.cn/2/route', { + params: { + appId: appId + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)).then(function (_ref5) { + var rtmRouter = _ref5.rtm_router_server, + api = _ref5.api_server, + _ref5$ttl = _ref5.ttl, + ttl = _ref5$ttl === undefined ? 3600 : _ref5$ttl; + + if (!rtmRouter) { + throw new Error('rtm router not exists'); + } + var router = { + rtmRouter: rtmRouter, + api: api + }; + routerCache.set(appId, router, ttl * 1000); + return router; + }).catch(function () { + var id = appId.slice(0, 8).toLowerCase(); + return { + rtmRouter: id + '.rtm.lncld.net', + api: id + '.api.lncld.net' + }; + }); + } + case 'us': + return _Promise.resolve({ + rtmRouter: 'router-a0-push.leancloud.cn', + api: 'us-api.leancloud.cn' + }); + default: + throw new Error('Region [' + region + '] is not supported.'); + } + }; + + Realtime._fetchEndpointsInfo = function _fetchEndpointsInfo(_ref6) { + var appId = _ref6.appId, + region = _ref6.region, + ssl = _ref6.ssl, + server = _ref6.server; + + debug('fetch endpoint info'); + return this._fetchAppRouter({ appId: appId, region: region }).then(tap(debug)).then(function (_ref7) { + var rtmRouter = _ref7.rtmRouter; + return axios.get('https://' + rtmRouter + '/v1/route', { + params: { + appId: appId, + secure: ssl, + features: isWeapp ? 'wechat' : undefined, + server: server, + _t: Date.now() + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)); + }); + }; + + Realtime.prototype._close = function _close() { + if (this._openPromise) { + this._openPromise.then(function (connection) { + return connection.close(); + }); + } + delete this._openPromise; + }; + + /** + * 手动进行重连。 + * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。 + * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。 + */ + + + Realtime.prototype.retry = function retry() { + var connection = internal(this).connection; + if (!connection) { + throw new Error('no connection established'); + } + if (connection.cannot('retry')) { + throw new Error('retrying not allowed when not disconnected. the connection is now ' + connection.current); + } + return connection.retry(); + }; + /** + * 暂停,使 SDK 进入离线状态。 + * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。 + * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。 + * + * @since 3.4.0 + * @see Realtime#event:offline + */ + + + Realtime.prototype.pause = function pause() { + // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。 + // 因此不像 retry,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('pause')) connection.pause(); + }; + /** + * 恢复在线状态。 + * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。 + * + * @since 3.4.0 + * @see Realtime#event:online + */ + + + Realtime.prototype.resume = function resume() { + // 与 pause 一样,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('resume')) connection.resume(); + }; + + Realtime.prototype._register = function _register(client) { + internal(this).clients.add(client); + }; + + Realtime.prototype._deregister = function _deregister(client) { + internal(this).clients.delete(client); + if (internal(this).clients.size === 0) { + this._close(); + } + }; + + Realtime.prototype._dispatchCommand = function _dispatchCommand(command) { + return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this]).then(function (shouldDispatch) { + // no plugin handled this command + if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim(command)); + return false; + }); + }; + + return Realtime; +}(EventEmitter); + +exports.Protocals = message; +exports.Promise = _Promise; +exports.EventEmitter = EventEmitter; +exports.Realtime = Realtime; +exports.ErrorCode = ErrorCode; + +//# sourceMappingURL=realtime-core.js.map \ No newline at end of file diff --git a/dist/realtime-core.js.map b/dist/realtime-core.js.map new file mode 100644 index 000000000..c3cc8a95a --- /dev/null +++ b/dist/realtime-core.js.map @@ -0,0 +1 @@ +{"version":3,"file":null,"sources":["/home/travis/build/leancloud/js-realtime-sdk/proto/message-compiled.js","/home/travis/build/leancloud/js-realtime-sdk/proto/message.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/global.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/expirable.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/cache.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/index.js","/home/travis/build/leancloud/js-realtime-sdk/src/websocket-plus.js","/home/travis/build/leancloud/js-realtime-sdk/src/error.js","/home/travis/build/leancloud/js-realtime-sdk/src/connection.js","/home/travis/build/leancloud/js-realtime-sdk/src/plugin.js","/home/travis/build/leancloud/js-realtime-sdk/src/realtime.js"],"sourcesContent":["module.exports = require(\"protobufjs/dist/protobuf-light\").newBuilder({})['import']({\n \"package\": \"push_server.messages2\",\n \"syntax\": \"proto2\",\n \"options\": {\n \"objc_class_prefix\": \"AVIM\"\n },\n \"messages\": [\n {\n \"name\": \"JsonObjectMessage\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 1\n }\n ]\n },\n {\n \"name\": \"UnreadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"required\",\n \"type\": \"int32\",\n \"name\": \"unread\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentioned\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 9\n }\n ]\n },\n {\n \"name\": \"LogItem\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"msgId\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"ackAt\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"readAt\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 8\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"bin\",\n \"id\": 10\n }\n ]\n },\n {\n \"name\": \"DataCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"ids\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"msg\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"offline\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"SessionCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"ua\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"r\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"tag\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"deviceId\",\n \"id\": 7\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"sessionPeerIds\",\n \"id\": 8\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"onlineSessionPeerIds\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"st\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"stTtl\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"deviceToken\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"sp\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"detail\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastUnreadNotifTime\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastPatchTime\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"configBitmap\",\n \"id\": 19\n }\n ]\n },\n {\n \"name\": \"ErrorCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 1\n },\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"appCode\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"detail\",\n \"id\": 4\n }\n ]\n },\n {\n \"name\": \"DirectCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"msg\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"fromPeerId\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"offline\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"hasMore\",\n \"id\": 6\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"toPeerIds\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"r\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"id\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"dt\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"roomId\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"pushData\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"will\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 19\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 20\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 21\n }\n ]\n },\n {\n \"name\": \"AckCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uid\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"fromts\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"tots\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"type\",\n \"id\": 9\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"ids\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"appCode\",\n \"id\": 11\n }\n ]\n },\n {\n \"name\": \"UnreadCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"UnreadTuple\",\n \"name\": \"convs\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"notifTime\",\n \"id\": 2\n }\n ]\n },\n {\n \"name\": \"ConvCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"m\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"unique\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cdate\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"initBy\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"sort\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"limit\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"skip\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"flag\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"count\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"udate\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"statusSub\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"statusPub\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"statusTTL\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uniqueId\",\n \"id\": 19\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"targetClientId\",\n \"id\": 20\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxReadTimestamp\",\n \"id\": 21\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxAckTimestamp\",\n \"id\": 22\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"queryAllMembers\",\n \"id\": 23\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"MaxReadTuple\",\n \"name\": \"maxReadTuples\",\n \"id\": 24\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"cids\",\n \"id\": 25\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"results\",\n \"id\": 100\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"where\",\n \"id\": 101\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"attr\",\n \"id\": 103\n }\n ]\n },\n {\n \"name\": \"RoomCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"roomId\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 5\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"roomPeerIds\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"byPeerId\",\n \"id\": 7\n }\n ]\n },\n {\n \"name\": \"LogsCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"l\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"limit\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"tt\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"tmid\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"checksum\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"stored\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"QueryDirection\",\n \"name\": \"direction\",\n \"id\": 10,\n \"options\": {\n \"default\": \"OLD\"\n }\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"tIncluded\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"ttIncluded\",\n \"id\": 12\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"LogItem\",\n \"name\": \"logs\",\n \"id\": 105\n }\n ],\n \"enums\": [\n {\n \"name\": \"QueryDirection\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"OLD\",\n \"id\": 1\n },\n {\n \"name\": \"NEW\",\n \"id\": 2\n }\n ]\n }\n ]\n },\n {\n \"name\": \"RcpCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"id\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"read\",\n \"id\": 4\n }\n ]\n },\n {\n \"name\": \"ReadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"MaxReadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"pid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxAckTimestamp\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxReadTimestamp\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"ReadCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"cids\",\n \"id\": 2\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"ReadTuple\",\n \"name\": \"convs\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"PresenceCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"StatusType\",\n \"name\": \"status\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"sessionPeerIds\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"ReportCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"initiative\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"type\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"PatchItem\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"recall\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 9\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 10\n }\n ]\n },\n {\n \"name\": \"PatchCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"PatchItem\",\n \"name\": \"patches\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastPatchTime\",\n \"id\": 2\n }\n ]\n },\n {\n \"name\": \"GenericCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"CommandType\",\n \"name\": \"cmd\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"OpType\",\n \"name\": \"op\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"appId\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"peerId\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"i\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"installationId\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"priority\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"service\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"DataCommand\",\n \"name\": \"dataMessage\",\n \"id\": 101\n },\n {\n \"rule\": \"optional\",\n \"type\": \"SessionCommand\",\n \"name\": \"sessionMessage\",\n \"id\": 102\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ErrorCommand\",\n \"name\": \"errorMessage\",\n \"id\": 103\n },\n {\n \"rule\": \"optional\",\n \"type\": \"DirectCommand\",\n \"name\": \"directMessage\",\n \"id\": 104\n },\n {\n \"rule\": \"optional\",\n \"type\": \"AckCommand\",\n \"name\": \"ackMessage\",\n \"id\": 105\n },\n {\n \"rule\": \"optional\",\n \"type\": \"UnreadCommand\",\n \"name\": \"unreadMessage\",\n \"id\": 106\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ReadCommand\",\n \"name\": \"readMessage\",\n \"id\": 107\n },\n {\n \"rule\": \"optional\",\n \"type\": \"RcpCommand\",\n \"name\": \"rcpMessage\",\n \"id\": 108\n },\n {\n \"rule\": \"optional\",\n \"type\": \"LogsCommand\",\n \"name\": \"logsMessage\",\n \"id\": 109\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ConvCommand\",\n \"name\": \"convMessage\",\n \"id\": 110\n },\n {\n \"rule\": \"optional\",\n \"type\": \"RoomCommand\",\n \"name\": \"roomMessage\",\n \"id\": 111\n },\n {\n \"rule\": \"optional\",\n \"type\": \"PresenceCommand\",\n \"name\": \"presenceMessage\",\n \"id\": 112\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ReportCommand\",\n \"name\": \"reportMessage\",\n \"id\": 113\n },\n {\n \"rule\": \"optional\",\n \"type\": \"PatchCommand\",\n \"name\": \"patchMessage\",\n \"id\": 114\n }\n ]\n }\n ],\n \"enums\": [\n {\n \"name\": \"CommandType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"session\",\n \"id\": 0\n },\n {\n \"name\": \"conv\",\n \"id\": 1\n },\n {\n \"name\": \"direct\",\n \"id\": 2\n },\n {\n \"name\": \"ack\",\n \"id\": 3\n },\n {\n \"name\": \"rcp\",\n \"id\": 4\n },\n {\n \"name\": \"unread\",\n \"id\": 5\n },\n {\n \"name\": \"logs\",\n \"id\": 6\n },\n {\n \"name\": \"error\",\n \"id\": 7\n },\n {\n \"name\": \"login\",\n \"id\": 8\n },\n {\n \"name\": \"data\",\n \"id\": 9\n },\n {\n \"name\": \"room\",\n \"id\": 10\n },\n {\n \"name\": \"read\",\n \"id\": 11\n },\n {\n \"name\": \"presence\",\n \"id\": 12\n },\n {\n \"name\": \"report\",\n \"id\": 13\n },\n {\n \"name\": \"echo\",\n \"id\": 14\n },\n {\n \"name\": \"loggedin\",\n \"id\": 15\n },\n {\n \"name\": \"logout\",\n \"id\": 16\n },\n {\n \"name\": \"loggedout\",\n \"id\": 17\n },\n {\n \"name\": \"patch\",\n \"id\": 18\n }\n ]\n },\n {\n \"name\": \"OpType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"open\",\n \"id\": 1\n },\n {\n \"name\": \"add\",\n \"id\": 2\n },\n {\n \"name\": \"remove\",\n \"id\": 3\n },\n {\n \"name\": \"close\",\n \"id\": 4\n },\n {\n \"name\": \"opened\",\n \"id\": 5\n },\n {\n \"name\": \"closed\",\n \"id\": 6\n },\n {\n \"name\": \"query\",\n \"id\": 7\n },\n {\n \"name\": \"query_result\",\n \"id\": 8\n },\n {\n \"name\": \"conflict\",\n \"id\": 9\n },\n {\n \"name\": \"added\",\n \"id\": 10\n },\n {\n \"name\": \"removed\",\n \"id\": 11\n },\n {\n \"name\": \"start\",\n \"id\": 30\n },\n {\n \"name\": \"started\",\n \"id\": 31\n },\n {\n \"name\": \"joined\",\n \"id\": 32\n },\n {\n \"name\": \"members_joined\",\n \"id\": 33\n },\n {\n \"name\": \"left\",\n \"id\": 39\n },\n {\n \"name\": \"members_left\",\n \"id\": 40\n },\n {\n \"name\": \"results\",\n \"id\": 42\n },\n {\n \"name\": \"count\",\n \"id\": 43\n },\n {\n \"name\": \"result\",\n \"id\": 44\n },\n {\n \"name\": \"update\",\n \"id\": 45\n },\n {\n \"name\": \"updated\",\n \"id\": 46\n },\n {\n \"name\": \"mute\",\n \"id\": 47\n },\n {\n \"name\": \"unmute\",\n \"id\": 48\n },\n {\n \"name\": \"status\",\n \"id\": 49\n },\n {\n \"name\": \"members\",\n \"id\": 50\n },\n {\n \"name\": \"max_read\",\n \"id\": 51\n },\n {\n \"name\": \"is_member\",\n \"id\": 52\n },\n {\n \"name\": \"join\",\n \"id\": 80\n },\n {\n \"name\": \"invite\",\n \"id\": 81\n },\n {\n \"name\": \"leave\",\n \"id\": 82\n },\n {\n \"name\": \"kick\",\n \"id\": 83\n },\n {\n \"name\": \"reject\",\n \"id\": 84\n },\n {\n \"name\": \"invited\",\n \"id\": 85\n },\n {\n \"name\": \"kicked\",\n \"id\": 86\n },\n {\n \"name\": \"upload\",\n \"id\": 100\n },\n {\n \"name\": \"uploaded\",\n \"id\": 101\n },\n {\n \"name\": \"modify\",\n \"id\": 150\n },\n {\n \"name\": \"modified\",\n \"id\": 151\n }\n ]\n },\n {\n \"name\": \"StatusType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"on\",\n \"id\": 1\n },\n {\n \"name\": \"off\",\n \"id\": 2\n }\n ]\n }\n ],\n \"isNamespace\": true\n}).build();\n","import messages from './message-compiled';\n\nconst {\n JsonObjectMessage,\n UnreadTuple,\n LogItem,\n DataCommand,\n SessionCommand,\n ErrorCommand,\n DirectCommand,\n AckCommand,\n UnreadCommand,\n ConvCommand,\n RoomCommand,\n LogsCommand,\n RcpCommand,\n ReadTuple,\n MaxReadTuple,\n ReadCommand,\n PresenceCommand,\n ReportCommand,\n GenericCommand,\n PatchCommand,\n PatchItem,\n CommandType,\n OpType,\n StatusType,\n} = messages.push_server.messages2;\n\nexport {\n JsonObjectMessage,\n UnreadTuple,\n LogItem,\n DataCommand,\n SessionCommand,\n ErrorCommand,\n DirectCommand,\n AckCommand,\n UnreadCommand,\n ConvCommand,\n RoomCommand,\n LogsCommand,\n RcpCommand,\n ReadTuple,\n MaxReadTuple,\n ReadCommand,\n PresenceCommand,\n ReportCommand,\n GenericCommand,\n PatchCommand,\n PatchItem,\n CommandType,\n OpType,\n StatusType,\n};\n","/* eslint-disable */\nexport default typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {};\n","import d from 'debug';\n\nconst EXPIRED = Symbol('expired');\nconst debug = d('LC:Expirable');\nexport default class Expirable {\n constructor(value, ttl) {\n this._value = value;\n if (typeof ttl === 'number') {\n this.expiredAt = Date.now() + ttl;\n }\n }\n\n get value() {\n const expired = this.expiredAt && this.expiredAt < Date.now();\n if (expired) debug(`expired: ${this._value}`);\n return expired ? EXPIRED : this._value;\n }\n}\nExpirable.EXPIRED = EXPIRED;\n","import d from 'debug';\nimport Expirable from './expirable';\n\nconst debug = d('LC:Cache');\nexport default class Cache {\n constructor(name = 'anonymous') {\n this.name = name;\n this._map = {};\n }\n\n get(key) {\n const cache = this._map[key];\n if (cache) {\n const value = cache.value;\n if (value !== Expirable.EXPIRED) {\n debug('[%s] hit: %s %O', this.name, key, value);\n return value;\n }\n delete this._map[key];\n }\n debug(`[${this.name}] missed: ${key}`);\n return null;\n }\n\n set(key, value, ttl) {\n debug('[%s] set: %s %O %d', this.name, key, value, ttl);\n this._map[key] = new Expirable(value, ttl);\n }\n}\n","import isPlainObject from 'lodash/isPlainObject';\nimport global from './global';\n\nexport { global };\n\nexport const tryAll = (promiseConstructors) => {\n const promise = new Promise(promiseConstructors[0]);\n if (promiseConstructors.length === 1) {\n return promise;\n }\n return promise.catch(() => tryAll(promiseConstructors.slice(1)));\n};\n\nexport const tap = interceptor => value => ((interceptor(value), value));\n\nexport { default as Expirable } from './expirable';\nexport { default as Cache } from './cache';\n\nexport const decodeDate = (date) => {\n if (!date) return date;\n if (typeof date === 'string') {\n return new Date(date);\n }\n if (date.__type === 'Date' && date.iso) {\n return new Date(date.iso);\n }\n // Long\n if (typeof date.toNumber === 'function') {\n return new Date(date.toNumber());\n }\n return date;\n};\n\nexport const keyRemap = (keymap, obj) =>\n Object.keys(obj).reduce((newObj, key) => {\n const newKey = keymap[key] || key;\n return Object.assign(newObj, {\n [newKey]: obj[key],\n });\n }, {});\n\nexport const isIE10 = (\n global.navigator &&\n global.navigator.userAgent &&\n global.navigator.userAgent.indexOf('MSIE 10.') !== -1\n);\n\n/* eslint-disable no-proto */\nexport const getStaticProperty = (klass, property) =>\n (klass[property] || (klass.__proto__ ? getStaticProperty(klass.__proto__, property) : undefined));\n/* eslint-enable no-proto */\n\nexport const union = (a, b) => Array.from(new Set([...a, ...b]));\nexport const difference = (a, b) => Array.from(\n (bSet => new Set(a.filter(x => !bSet.has(x))))(new Set(b)),\n);\n\nconst map = new WeakMap();\n\n// protected property helper\nexport const internal = (object) => {\n if (!map.has(object)) {\n map.set(object, {});\n }\n return map.get(object);\n};\n\n// debug utility\nconst removeNull = (obj) => {\n if (!isPlainObject(obj)) return obj;\n const object = Object.assign({}, obj);\n // eslint-disable-next-line no-restricted-syntax\n for (const prop in object) {\n if ({}.hasOwnProperty.call(object, prop)) {\n const value = object[prop];\n if (value === null) {\n delete object[prop];\n } else {\n object[prop] = removeNull(value);\n }\n }\n }\n return object;\n};\nexport const trim = message => removeNull(JSON.parse(JSON.stringify(message)));\n\nexport const ensureArray = (target) => {\n if (Array.isArray(target)) {\n return target;\n }\n if (target === undefined || target === null) {\n return [];\n }\n return [target];\n};\n\nexport const setValue = (target, key, value) => {\n // '.' is not allowed in Class keys, escaping is not in concern now.\n const segs = key.split('.');\n const lastSeg = segs.pop();\n let currentTarget = target;\n segs.forEach((seg) => {\n if (currentTarget[seg] === undefined) currentTarget[seg] = {};\n currentTarget = currentTarget[seg];\n });\n currentTarget[lastSeg] = value;\n return target;\n};\n\n// eslint-disable-next-line no-undef\nexport const isWeapp = typeof wx === 'object' && typeof wx.connectSocket === 'function';\n\n// throttle decorator\nexport const throttle = wait => (target, property, descriptor) => {\n const callback = descriptor.value;\n // very naive, internal use only\n if (callback.length) {\n throw new Error('throttled function should not accept any arguments');\n }\n return {\n ...descriptor,\n value() {\n let {\n throttleMeta,\n } = internal(this);\n if (!throttleMeta) {\n throttleMeta = {};\n internal(this).throttleMeta = throttleMeta;\n }\n let {\n [property]: propertyMeta,\n } = throttleMeta;\n if (!propertyMeta) {\n propertyMeta = {};\n throttleMeta[property] = propertyMeta;\n }\n const {\n previouseTimestamp = 0,\n timeout,\n } = propertyMeta;\n const now = Date.now();\n const remainingTime = wait - (now - previouseTimestamp);\n if (remainingTime <= 0) {\n throttleMeta[property].previouseTimestamp = now;\n callback.apply(this);\n } else if (!timeout) {\n propertyMeta.timeout = setTimeout(() => {\n propertyMeta.previouseTimestamp = Date.now();\n delete propertyMeta.timeout;\n callback.apply(this);\n }, remainingTime);\n }\n },\n };\n};\n","// WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface.\n\nimport d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport StateMachine from 'javascript-state-machine';\n\nimport WebSocket from 'ws';\n\nimport { tryAll, global } from './utils';\n\nconst debug = d('LC:WebSocketPlus');\n\nconst HEARTBEAT_TIME = 180000;\nconst TIMEOUT_TIME = 380000;\n\nconst DEFAULT_RETRY_STRATEGY = attempt => Math.min(1000 * (2 ** attempt), 300000);\n\nconst requireConnected = (target, name, descriptor) =>\n Object.assign({}, descriptor, {\n value: function requireConnectedWrapper(...args) {\n if (!this.is('connected')) {\n const currentState = this.current;\n console.warn(`${name} should not be called when the connection is ${currentState}`);\n if (this.is('disconnected') || this.is('reconnecting')) {\n console.warn('disconnect and reconnect event should be handled to avoid such calls.');\n }\n throw new Error('Connection unavailable');\n }\n return descriptor.value.call(this, ...args);\n },\n });\n\nclass WebSocketPlus extends EventEmitter {\n constructor(getUrls, protocol) {\n if (typeof WebSocket === 'undefined') {\n throw new Error('WebSocket is undefined. Polyfill is required in this runtime.');\n }\n super();\n if (typeof getUrls !== 'function') {\n this._getUrls = () => Promise.resolve(getUrls);\n } else {\n this._getUrls = getUrls;\n }\n this._protocol = protocol;\n this.init();\n this._createWs(this._getUrls, this._protocol).then(\n () => {\n this.__postponeTimeoutTimer = this._postponeTimeoutTimer.bind(this);\n if (global.addEventListener) {\n this.__pause = () => this.pause();\n this.__resume = () => this.resume();\n global.addEventListener('offline', this.__pause);\n global.addEventListener('online', this.__resume);\n }\n this.open();\n },\n ).catch(this.throw.bind(this));\n }\n\n _createWs(getUrls, protocol) {\n return getUrls().then((wsUrls) => {\n let urls = wsUrls;\n if (!(urls instanceof Array)) {\n urls = [urls];\n }\n return tryAll(\n urls.map(url => (resolve, reject) => {\n debug(`connect [${url}] ${protocol}`);\n const ws = protocol ? new WebSocket(\n url, protocol,\n ) : new WebSocket(url);\n ws.binaryType = this.binaryType || 'arraybuffer';\n ws.onopen = () => resolve(ws);\n ws.onclose = (error) => {\n if (error instanceof Error) {\n return reject(error);\n }\n // in browser, error event is useless\n return reject(new Error(`Failed to connect [${url}]`));\n };\n ws.onerror = ws.onclose;\n }),\n ).then((ws) => {\n this._ws = ws;\n this._ws.onclose = this._handleClose.bind(this);\n this._ws.onmessage = this._handleMessage.bind(this);\n return ws;\n });\n });\n }\n _destroyWs() {\n const ws = this._ws;\n if (!ws) return;\n ws.onopen = null;\n ws.onclose = null;\n ws.onerror = null;\n ws.onmessage = null;\n this._ws = null;\n ws.close();\n }\n\n // eslint-disable-next-line class-methods-use-this\n onbeforeevent(event, from, to, ...payload) {\n debug(`${event}: ${from} -> ${to}`, ...payload);\n }\n onopen() {\n this.emit('open');\n }\n onconnected() {\n this._startConnectionKeeper();\n }\n onleaveconnected(event, from, to) {\n this._stopConnectionKeeper();\n this._destroyWs();\n if (to === 'offline' || to === 'disconnected') {\n this.emit('disconnect');\n }\n }\n onpause() {\n this.emit('offline');\n }\n onbeforeresume() {\n this.emit('online');\n }\n onreconnect() {\n this.emit('reconnect');\n }\n ondisconnected(event, from, to, attempt = 0) {\n const delay = DEFAULT_RETRY_STRATEGY.call(null, attempt);\n debug(`schedule attempt=${attempt} delay=${delay}`);\n this.emit('schedule', attempt, delay);\n if (this.__scheduledRetry) {\n clearTimeout(this.__scheduledRetry);\n }\n this.__scheduledRetry = setTimeout(() => {\n if (this.is('disconnected')) {\n this.retry(attempt);\n }\n }, delay);\n }\n onretry(event, from, to, attempt = 0) {\n this.emit('retry', attempt);\n this._createWs(this._getUrls, this._protocol).then(\n () => (this.can('reconnect') ? this.reconnect() : this._destroyWs()),\n () => this.can('fail') && this.fail(attempt + 1),\n );\n }\n onerror(event, from, to, error) {\n this.emit('error', error);\n }\n onclose() {\n if (global.removeEventListener) {\n if (this.__pause) global.removeEventListener('offline', this.__pause);\n if (this.__resume) global.removeEventListener('online', this.__resume);\n }\n }\n\n // jsdoc-ignore-start\n @requireConnected\n // jsdoc-ignore-end\n _ping() {\n debug('ping');\n try {\n this.ping();\n } catch (error) {\n console.warn(`websocket ping error: ${error.message}`);\n }\n }\n ping() {\n if (this._ws.ping) {\n this._ws.ping();\n } else {\n console.warn(`The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.`);\n }\n }\n\n _postponeTimeoutTimer() {\n debug('_postponeTimeoutTimer');\n this._clearTimeoutTimers();\n this._timeoutTimer = setTimeout(() => {\n debug('timeout');\n this.disconnect();\n }, TIMEOUT_TIME);\n }\n _clearTimeoutTimers() {\n if (this._timeoutTimer) {\n clearTimeout(this._timeoutTimer);\n }\n }\n _startConnectionKeeper() {\n debug('start connection keeper');\n this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME);\n const addListener = this._ws.addListener || this._ws.addEventListener;\n addListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n this._postponeTimeoutTimer();\n }\n _stopConnectionKeeper() {\n debug('stop connection keeper');\n // websockets/ws#489\n const removeListener = this._ws.removeListener || this._ws.removeEventListener;\n removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n this._clearTimeoutTimers();\n if (this._heartbeatTimer) {\n clearInterval(this._heartbeatTimer);\n }\n }\n\n _handleClose(event) {\n debug(`ws closed [${event.code}] ${event.reason}`);\n // socket closed manually, ignore close event.\n if (this.isFinished()) return;\n this.handleClose(event);\n }\n handleClose() {\n // reconnect\n this.disconnect();\n }\n\n // jsdoc-ignore-start\n @requireConnected\n // jsdoc-ignore-end\n send(data) {\n debug('send', data);\n this._ws.send(data);\n }\n\n _handleMessage(event) {\n debug('message', event.data);\n this.handleMessage(event.data);\n }\n handleMessage(message) {\n this.emit('message', message);\n }\n}\n\nStateMachine.create({\n target: WebSocketPlus.prototype,\n initial: {\n state: 'initialized',\n event: 'init',\n defer: true,\n },\n terminal: 'closed',\n events: [{\n name: 'open',\n from: 'initialized',\n to: 'connected',\n }, {\n name: 'disconnect',\n from: 'connected',\n to: 'disconnected',\n }, {\n name: 'retry',\n from: 'disconnected',\n to: 'reconnecting',\n }, {\n name: 'fail',\n from: 'reconnecting',\n to: 'disconnected',\n }, {\n name: 'reconnect',\n from: 'reconnecting',\n to: 'connected',\n }, {\n name: 'pause',\n from: ['connected', 'disconnected', 'reconnecting'],\n to: 'offline',\n }, {\n }, {\n name: 'resume',\n from: 'offline',\n to: 'disconnected',\n }, {\n name: 'close',\n from: ['connected', 'disconnected', 'reconnecting', 'offline'],\n to: 'closed',\n }, {\n name: 'throw',\n from: '*',\n to: 'error',\n }],\n});\n\nexport default WebSocketPlus;\n","export const error = Object.freeze({\n 1000: {\n name: 'CLOSE_NORMAL',\n },\n 1006: {\n name: 'CLOSE_ABNORMAL',\n },\n 4100: {\n name: 'APP_NOT_AVAILABLE',\n message: 'App not exists or realtime message service is disabled.',\n },\n 4103: {\n name: 'INVALID_LOGIN',\n message: 'Malformed clientId.',\n },\n 4105: {\n name: 'SESSION_REQUIRED',\n message: 'Message sent before session opened. ',\n },\n 4107: {\n name: 'READ_TIMEOUT',\n },\n 4108: {\n name: 'LOGIN_TIMEOUT',\n },\n 4109: {\n name: 'FRAME_TOO_LONG',\n },\n 4110: {\n name: 'INVALID_ORIGIN',\n message: 'Access denied by domain whitelist.',\n },\n 4111: {\n name: 'SESSION_CONFLICT',\n },\n 4112: {\n name: 'SESSION_TOKEN_EXPIRED',\n },\n 4200: {\n name: 'INTERNAL_ERROR',\n message: 'Internal error, please contact LeanCloud for support.',\n },\n 4201: {\n name: 'SEND_MESSAGE_TIMEOUT',\n },\n 4302: {\n name: 'CONVERSATION_SIGNATURE_FAILED',\n },\n 4303: {\n name: 'CONVERSATION_NOT_FOUND',\n },\n 4304: {\n name: 'CONVERSATION_FULL',\n },\n 4305: {\n name: 'CONVERSATION_REJECTED_BY_APP',\n },\n 4306: {\n name: 'CONVERSATION_UPDATE_FAILED',\n },\n 4307: {\n name: 'CONVERSATION_READ_ONLY',\n },\n 4308: {\n name: 'CONVERSATION_NOT_ALLOWED',\n },\n 4401: {\n name: 'INVALID_MESSAGING_TARGET',\n },\n 4402: {\n name: 'MESSAGE_REJECTED_BY_APP',\n },\n});\n\nexport const ErrorCode = Object.freeze(\n Object.keys(error).reduce((result, code) => Object.assign(result, {\n [error[code].name]: Number(code),\n }), {}),\n);\n\nexport const createError = (errorMessage) => {\n const {\n code, reason, appCode, detail,\n } = errorMessage;\n let message = reason || detail;\n if (!message && error[code]) {\n message = error[code].message || error[code].name;\n }\n if (!message) {\n message = `Unknow Error: ${code}`;\n }\n const err = new Error(message);\n return Object.assign(err, {\n code, appCode, detail,\n });\n};\n","import d from 'debug';\nimport WebSocketPlus from './websocket-plus';\nimport { createError } from './error';\nimport { GenericCommand, CommandType } from '../proto/message';\nimport { trim, isWeapp } from './utils';\n\nconst debug = d('LC:Connection');\n\nconst COMMAND_TIMEOUT = 20000;\n\nexport default class Connection extends WebSocketPlus {\n constructor(getUrl, { format, version }) {\n debug('initializing Connection');\n const protocolString = `lc.${format}.${version}`;\n if (!isWeapp) {\n super(getUrl, protocolString);\n } else {\n super(getUrl().then(urls => urls.map(url =>\n `${url}${url.indexOf('?') === -1 ? '?' : '&'}subprotocol=${encodeURIComponent(protocolString)}`,\n )));\n }\n this._protocalFormat = format;\n this._commands = {};\n this._serialId = 0;\n }\n\n send(command, waitingForRespond = true) {\n let serialId;\n if (waitingForRespond) {\n this._serialId += 1;\n serialId = this._serialId;\n command.i = serialId; // eslint-disable-line no-param-reassign\n }\n debug('↑ %O sent', trim(command));\n\n let message;\n if (this._protocalFormat === 'proto2base64') {\n message = command.toBase64();\n } else if (command.toArrayBuffer) {\n message = command.toArrayBuffer();\n }\n if (!message) {\n throw new TypeError(`${command} is not a GenericCommand`);\n }\n\n super.send(message);\n\n if (!waitingForRespond) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n this._commands[serialId] = {\n resolve,\n reject,\n timeout: setTimeout(\n () => {\n if (this._commands[serialId]) {\n debug('✗ %O timeout', trim(command));\n reject(new Error('Command Timeout.'));\n delete this._commands[serialId];\n }\n },\n COMMAND_TIMEOUT,\n ),\n };\n });\n }\n\n handleMessage(msg) {\n let message;\n try {\n message = GenericCommand.decode(msg);\n debug('↓ %O received', trim(message));\n } catch (e) {\n console.warn('Decode message failed', msg);\n }\n this.emit('allmessage', message);\n const serialId = message.i;\n if (serialId) {\n if (this._commands[serialId]) {\n clearTimeout(this._commands[serialId].timeout);\n if (message.cmd === CommandType.error) {\n this\n ._commands[serialId]\n .reject(createError(message.errorMessage));\n } else {\n this\n ._commands[serialId]\n .resolve(message);\n }\n delete this._commands[serialId];\n } else {\n console.warn(`Unexpected command received with serialId [${serialId}],\n which have timed out or never been requested.`);\n }\n } else if (message.cmd === CommandType.error) {\n this.emit('error', createError(message.errorMessage));\n } else {\n this.emit('message', message);\n }\n }\n\n ping() {\n return this.send(new GenericCommand({\n cmd: CommandType.echo,\n })).catch(error => debug('ping failed:', error));\n }\n}\n","/* eslint-disable max-len */\n\n/**\n * 插件接口\n *\n *

\n * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类:\n *

\n * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。\n * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。\n *

\n * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。\n * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。\n * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。\n *

\n * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。\n *\n * @interface Plugin\n * @since 3.1.0\n */\n\n/* eslint-enable max-len */\n\n/**\n * 插件名称,用于在日志中显示异常的插件\n *\n * @name Plugin.name\n * @type string\n */\n\n/**\n * 插件注册的消息类型\n *\n * @name Plugin.messageClasses\n * @type AVMessage[]\n */\n\n/**\n * 在 Realtime 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Realtime 实例。\n *\n * @name Plugin.onRealtimeCreate\n * @type Function\n */\n\n/**\n * 在 IMClient 实例化后对其进行修饰。\n *

\n * 接受一个参数为 IMClient 实例。\n *\n * @name Plugin.onIMClientCreate\n * @type Function\n */\n\n/**\n * 在 Conversation 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Conversation 实例。\n * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook,\n * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。\n *\n * @name Plugin.onConversationCreate\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之前,对原始消息进行修改。\n *

\n * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。\n * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。\n *\n * @name Plugin.beforeMessageParse\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之后,对消息实例进行修改。\n *

\n * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。\n * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.afterMessageParse\n * @type Function\n */\n\n/**\n * 在收到消息之后,派发消息之前,控制是否派发这条消息。\n *

\n * 接受参数为 message 与 conversation。\n * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。\n * 如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.beforeMessageDispatch\n * @type Function\n * @since 3.4.0\n */\n\nimport { ensureArray, tap } from './utils';\n\nconst checkType = middleware => (param) => {\n const { constructor } = param;\n return Promise.resolve(param).then(middleware).then(tap((result) => {\n if (result === undefined || result === null) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns ${result} while a ${param.constructor.name} expected.`);\n }\n if (!(result instanceof constructor)) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns a ${result.constructor.name} while a ${param.constructor.name} expected.`);\n }\n return 0;\n }));\n};\n\nexport const applyDecorators = (decorators, target) => {\n if (decorators) {\n decorators.forEach((decorator) => {\n try {\n decorator(target);\n } catch (error) {\n if (decorator._pluginName) {\n error.message += `[${decorator._pluginName}]`;\n }\n throw error;\n }\n });\n }\n};\n\nexport const applyMiddlewares = middlewares => target =>\n ensureArray(middlewares).reduce(\n (previousPromise, middleware) => previousPromise\n .then(checkType(middleware))\n .catch((error) => {\n if (middleware._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${middleware._pluginName}]`;\n }\n throw error;\n }),\n Promise.resolve(target),\n );\n\nexport const applyDispatcher = (dispatchers, payload) =>\n ensureArray(dispatchers).reduce(\n (resultPromise, dispatcher) => resultPromise.then(shouldDispatch =>\n (shouldDispatch === false ? false : dispatcher(...payload)),\n ).catch((error) => {\n if (dispatcher._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${dispatcher._pluginName}]`;\n }\n throw error;\n }), Promise.resolve(true),\n );\n","import d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport axios from 'axios';\nimport Connection from './connection';\nimport { ErrorCode, createError } from './error';\nimport { tap, Cache, trim, internal, ensureArray, isWeapp } from './utils';\nimport { applyDecorators, applyDispatcher } from './plugin';\n\nconst debug = d('LC:Realtime');\n\nconst routerCache = new Cache('push-router');\n\nexport default class Realtime extends EventEmitter {\n /**\n * @extends EventEmitter\n * @param {Object} options\n * @param {String} options.appId\n * @param {String} options.appKey (since 4.0.0)\n * @param {String} [options.region='cn'] 节点 id\n * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式)\n * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。\n * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序)\n * @param {Boolean} [options.ssl=true] 使用 wss 进行连接\n * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0)\n */\n constructor(options) {\n debug('initializing Realtime');\n super();\n if (typeof options.appId !== 'string') {\n throw new TypeError(`appId [${options.appId}] is not a string`);\n }\n if (typeof options.appKey !== 'string') {\n throw new TypeError(`appKey [${options.appKey}] is not a string`);\n }\n this._options = Object.assign({\n appId: undefined,\n appKey: undefined,\n region: 'cn',\n pushOfflineMessages: false,\n noBinary: isWeapp,\n ssl: true,\n server: process.env.SERVER,\n }, options);\n this._cache = new Cache('endpoints');\n internal(this).clients = new Set();\n this._plugins = [\n ...ensureArray(Realtime.__preRegisteredPlugins),\n ...ensureArray(options.plugins),\n ].reduce(\n (result, plugin) => {\n // eslint-disable-next-line no-restricted-syntax\n for (const hook in plugin) {\n if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') {\n if (plugin.name) {\n ensureArray(plugin[hook]).forEach((value) => {\n // eslint-disable-next-line no-param-reassign\n value._pluginName = plugin.name;\n });\n }\n // eslint-disable-next-line no-param-reassign\n result[hook] = ensureArray(result[hook]).concat(plugin[hook]);\n }\n }\n return result;\n },\n {},\n );\n // onRealtimeCreate hook\n applyDecorators(this._plugins.onRealtimeCreate, this);\n }\n\n async _request({\n method,\n version = '1.1',\n path,\n query,\n headers,\n data = {},\n }) {\n const { appId, region } = this._options;\n const { api } = await this.constructor._fetchAppRouter({ appId, region });\n const url = `https://${api}/${version}${path}`;\n return axios(url, {\n method,\n params: query,\n headers: {\n 'X-LC-Id': this._options.appId,\n 'X-LC-Key': this._options.appKey,\n ...headers,\n },\n data,\n }).then(response => response.data);\n }\n\n _open() {\n if (this._openPromise) return this._openPromise;\n\n let format = 'protobuf2';\n if (this._options.noBinary) {\n // 不发送 binary data,fallback to base64 string\n format = 'proto2base64';\n }\n let version = 3;\n if (this._options.pushOfflineMessages) {\n // 不推送离线消息,而是发送对话的未读通知\n version = 1;\n }\n const protocol = {\n format,\n version,\n };\n this._openPromise = new Promise((resolve, reject) => {\n debug('No connection established, create a new one.');\n const connection = new Connection(\n () => this._getEndpoints(this._options),\n protocol,\n );\n connection.on('open', () => resolve(connection));\n connection.on('error', reject);\n connection.on('message', this._dispatchCommand.bind(this));\n /**\n * 连接断开。\n * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。\n * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。\n * @event Realtime#disconnect\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event Realtime#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n */\n /**\n * 正在尝试重新连接\n * @event Realtime#retry\n * @param {Number} attempt 尝试重连的次数\n */\n /**\n * 连接恢复正常。\n * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素\n * @event Realtime#reconnect\n */\n\n /**\n * 客户端连接断开\n * @event IMClient#disconnect\n * @see Realtime#event:disconnect\n * @since 3.2.0\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event IMClient#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n * @since 3.2.0\n */\n /**\n * 正在尝试重新连接\n * @event IMClient#retry\n * @param {Number} attempt 尝试重连的次数\n * @since 3.2.0\n */\n\n /**\n * 客户端进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event Realtime#offline\n * @since 3.4.0\n */\n /**\n * 客户端恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event Realtime#online\n * @since 3.4.0\n */\n /**\n * 进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event IMClient#offline\n * @since 3.4.0\n */\n /**\n * 恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event IMClient#online\n * @since 3.4.0\n */\n\n // event proxy\n ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(\n event => connection.on(event, (...payload) => {\n debug(`${event} event emitted. %O`, payload);\n this.emit(event, ...payload);\n if (event !== 'reconnect') {\n internal(this).clients.forEach((client) => {\n client.emit(event, ...payload);\n });\n }\n }),\n );\n // override handleClose\n connection.handleClose = function handleClose(event) {\n const isFatal = [\n ErrorCode.APP_NOT_AVAILABLE,\n ErrorCode.INVALID_LOGIN,\n ErrorCode.INVALID_ORIGIN,\n ].some(errorCode => errorCode === event.code);\n if (isFatal) {\n // in these cases, SDK should throw.\n this.throw(createError(event));\n } else {\n // reconnect\n this.disconnect();\n }\n };\n internal(this).connection = connection;\n });\n\n return this._openPromise;\n }\n\n _getEndpoints(options) {\n return Promise.resolve(\n this._cache.get('endpoints') ||\n this\n .constructor\n ._fetchEndpointsInfo(options)\n .then(\n tap(info => this._cache.set('endpoints', info, info.ttl * 1000)),\n ),\n ).then((info) => {\n debug('endpoint info: %O', info);\n return [info.server, info.secondary];\n });\n }\n\n static _fetchAppRouter({ appId, region }) {\n debug('fetch router');\n switch (region) {\n case 'cn': {\n const cachedRouter = routerCache.get(appId);\n if (cachedRouter) {\n return Promise.resolve(cachedRouter);\n }\n return axios\n .get('https://app-router.leancloud.cn/2/route', {\n params: {\n appId,\n },\n timeout: 20000,\n })\n .then(\n res => res.data,\n )\n .then(tap(debug))\n .then(\n ({\n rtm_router_server: rtmRouter,\n api_server: api,\n ttl = 3600,\n }) => {\n if (!rtmRouter) {\n throw new Error('rtm router not exists');\n }\n const router = {\n rtmRouter,\n api,\n };\n routerCache.set(appId, router, ttl * 1000);\n return router;\n },\n )\n .catch(() => {\n const id = appId.slice(0, 8).toLowerCase();\n return {\n rtmRouter: `${id}.rtm.lncld.net`,\n api: `${id}.api.lncld.net`,\n };\n });\n }\n case 'us':\n return Promise.resolve({\n rtmRouter: 'router-a0-push.leancloud.cn',\n api: 'us-api.leancloud.cn',\n });\n default:\n throw new Error(`Region [${region}] is not supported.`);\n }\n }\n\n static _fetchEndpointsInfo({ appId, region, ssl, server }) {\n debug('fetch endpoint info');\n return this._fetchAppRouter({ appId, region })\n .then(tap(debug))\n .then(({ rtmRouter }) =>\n axios.get(`https://${rtmRouter}/v1/route`, {\n params: {\n appId,\n secure: ssl,\n features: isWeapp ? 'wechat' : undefined,\n server,\n _t: Date.now(),\n },\n timeout: 20000,\n }).then(\n res => res.data,\n ).then(tap(debug)),\n );\n }\n\n _close() {\n if (this._openPromise) {\n this._openPromise.then(connection => connection.close());\n }\n delete this._openPromise;\n }\n\n /**\n * 手动进行重连。\n * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。\n * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。\n */\n retry() {\n const connection = internal(this).connection;\n if (!connection) {\n throw new Error('no connection established');\n }\n if (connection.cannot('retry')) {\n throw new Error(\n `retrying not allowed when not disconnected. the connection is now ${connection.current}`,\n );\n }\n return connection.retry();\n }\n /**\n * 暂停,使 SDK 进入离线状态。\n * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。\n * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。\n *\n * @since 3.4.0\n * @see Realtime#event:offline\n */\n pause() {\n // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。\n // 因此不像 retry,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('pause')) connection.pause();\n }\n /**\n * 恢复在线状态。\n * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。\n *\n * @since 3.4.0\n * @see Realtime#event:online\n */\n resume() {\n // 与 pause 一样,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('resume')) connection.resume();\n }\n\n _register(client) {\n internal(this).clients.add(client);\n }\n\n _deregister(client) {\n internal(this).clients.delete(client);\n if (internal(this).clients.size === 0) {\n this._close();\n }\n }\n\n _dispatchCommand(command) {\n return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this])\n .then((shouldDispatch) => {\n // no plugin handled this command\n if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim(command));\n return false;\n });\n }\n}\n"],"names":["module","require","newBuilder","build","messages","push_server","messages2","JsonObjectMessage","UnreadTuple","LogItem","DataCommand","SessionCommand","ErrorCommand","DirectCommand","AckCommand","UnreadCommand","ConvCommand","RoomCommand","LogsCommand","RcpCommand","ReadTuple","MaxReadTuple","ReadCommand","PresenceCommand","ReportCommand","GenericCommand","PatchCommand","PatchItem","CommandType","OpType","StatusType","global","window","EXPIRED","debug","d","Expirable","value","ttl","_value","expiredAt","Date","now","expired","Cache","name","_map","get","key","cache","set","tryAll","promiseConstructors","promise","length","catch","slice","tap","interceptor","isIE10","navigator","userAgent","indexOf","map","internal","object","has","removeNull","obj","isPlainObject","prop","hasOwnProperty","call","trim","JSON","parse","message","ensureArray","target","Array","isArray","undefined","isWeapp","wx","connectSocket","HEARTBEAT_TIME","TIMEOUT_TIME","DEFAULT_RETRY_STRATEGY","Math","min","attempt","requireConnected","descriptor","requireConnectedWrapper","is","currentState","current","warn","Error","args","WebSocketPlus","getUrls","protocol","WebSocket","_getUrls","resolve","_protocol","init","_createWs","then","__postponeTimeoutTimer","_postponeTimeoutTimer","bind","addEventListener","__pause","pause","__resume","resume","open","throw","wsUrls","urls","reject","url","ws","binaryType","onopen","onclose","error","onerror","_ws","_handleClose","onmessage","_handleMessage","_destroyWs","close","onbeforeevent","event","from","to","payload","emit","onconnected","_startConnectionKeeper","onleaveconnected","_stopConnectionKeeper","onpause","onbeforeresume","onreconnect","ondisconnected","delay","__scheduledRetry","setTimeout","retry","onretry","can","reconnect","fail","removeEventListener","_ping","ping","_clearTimeoutTimers","_timeoutTimer","disconnect","_heartbeatTimer","setInterval","addListener","removeListener","code","reason","isFinished","handleClose","send","data","handleMessage","EventEmitter","StateMachine","create","prototype","ErrorCode","reduce","result","Number","createError","errorMessage","appCode","detail","err","COMMAND_TIMEOUT","Connection","getUrl","format","version","protocolString","encodeURIComponent","_protocalFormat","_commands","_serialId","command","waitingForRespond","serialId","i","toBase64","toArrayBuffer","TypeError","msg","decode","e","timeout","cmd","echo","applyDecorators","decorators","forEach","decorator","_pluginName","applyDispatcher","dispatchers","resultPromise","dispatcher","shouldDispatch","routerCache","Realtime","options","appId","appKey","_options","process","env","SERVER","_cache","clients","_plugins","__preRegisteredPlugins","plugins","plugin","hook","concat","onRealtimeCreate","_request","method","path","query","headers","region","constructor","_fetchAppRouter","api","axios","response","_open","_openPromise","noBinary","pushOfflineMessages","connection","_getEndpoints","on","_dispatchCommand","client","isFatal","APP_NOT_AVAILABLE","INVALID_LOGIN","INVALID_ORIGIN","some","errorCode","_fetchEndpointsInfo","info","server","secondary","cachedRouter","res","rtmRouter","rtm_router_server","api_server","router","id","toLowerCase","ssl","_close","cannot","_register","add","_deregister","delete","size","beforeCommandDispatch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,mBAAA,GAAiBC,cAA0CC,UAA1C,CAAqD,EAArD,EAAyD,QAAzD,EAAmE;eACrE,uBADqE;cAEtE,QAFsE;eAGrE;6BACc;KAJuD;gBAMpE,CACR;gBACY,mBADZ;kBAEc,QAFd;kBAGc,CACN;oBACY,UADZ;oBAEY,QAFZ;oBAGY,MAHZ;kBAIU;SALJ;KAJN,EAaR;gBACY,aADZ;kBAEc,QAFd;kBAGc,CACN;oBACY,UADZ;oBAEY,QAFZ;oBAGY,KAHZ;kBAIU;SALJ,EAON;oBACY,UADZ;oBAEY,OAFZ;oBAGY,QAHZ;kBAIU;SAXJ,EAaN;oBACY,UADZ;oBAEY,QAFZ;oBAGY,KAHZ;kBAIU;SAjBJ,EAmBN;oBACY,UADZ;oBAEY,OAFZ;oBAGY,WAHZ;kBAIU;SAvBJ,EAyBN;oBACY,UADZ;oBAEY,QAFZ;oBAGY,MAHZ;kBAIU;SA7BJ,EA+BN;oBACY,UADZ;oBAEY,QAFZ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rL,KAAJ,wEACiE4J,WAAW9J,OAD5E,CAAN;;WAIK8J,WAAWrG,KAAX,EAAP;;;;;;;;;;;;qBAUFtC,yBAAQ;;;QAGA2I,aAAa9L,SAAS,IAAT,EAAe8L,UAAlC;QACI,CAACA,UAAL,EAAiB;QACbA,WAAWnG,GAAX,CAAe,OAAf,CAAJ,EAA6BmG,WAAW3I,KAAX;;;;;;;;;;;qBAS/BE,2BAAS;;QAEDyI,aAAa9L,SAAS,IAAT,EAAe8L,UAAlC;QACI,CAACA,UAAL,EAAiB;QACbA,WAAWnG,GAAX,CAAe,QAAf,CAAJ,EAA8BmG,WAAWzI,MAAX;;;qBAGhCmK,+BAAUtB,QAAQ;aACP,IAAT,EAAe3B,OAAf,CAAuBkD,GAAvB,CAA2BvB,MAA3B;;;qBAGFwB,mCAAYxB,QAAQ;aACT,IAAT,EAAe3B,OAAf,CAAuBoD,MAAvB,CAA8BzB,MAA9B;QACIlM,SAAS,IAAT,EAAeuK,OAAf,CAAuBqD,IAAvB,KAAgC,CAApC,EAAuC;WAChCN,MAAL;;;;qBAIJrB,6CAAiB3D,SAAS;WACjBkB,gBAAgB,KAAKgB,QAAL,CAAcqD,qBAA9B,EAAqD,CAACvF,OAAD,EAAU,IAAV,CAArD,EACJzF,IADI,CACC,UAAC+G,cAAD,EAAoB;;UAEpBA,cAAJ,EAAoB,OAAO1L,MAAM,wCAAN,EAAgDuC,KAAK6H,OAAL,CAAhD,CAAP;aACb,KAAP;KAJG,CAAP;;;;EA3WkCvB;;;;;;;;"} \ No newline at end of file diff --git a/dist/realtime-core.weapp.js b/dist/realtime-core.weapp.js new file mode 100644 index 000000000..ebae50425 --- /dev/null +++ b/dist/realtime-core.weapp.js @@ -0,0 +1,18779 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define('leancloud-realtime', ['exports'], factory) : + (factory((global.AV = global.AV || {}))); +}(this, (function (exports) { 'use strict'; + + var define = undefined; + var require = require || function(id) {throw new Error('Unexpected required ' + id)}; + + + + var process = (window && window.process) || {}; + process.env = process.env || {}; + + var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function commonjsRequire () { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); + } + + function unwrapExports (x) { + return x && x.__esModule ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + // 7.1.4 ToInteger + var ceil = Math.ceil; + var floor = Math.floor; + var _toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + + // 7.2.1 RequireObjectCoercible(argument) + var _defined = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; + }; + + // true -> String#at + // false -> String#codePointAt + var _stringAt = function (TO_STRING) { + return function (that, pos) { + var s = String(_defined(that)); + var i = _toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + + var _library = true; + + var _global = createCommonjsModule(function (module) { + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); + if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + }); + + var _core = createCommonjsModule(function (module) { + var core = module.exports = { version: '2.5.1' }; + if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + }); + + var _aFunction = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; + }; + + // optional / simple context binding + + var _ctx = function (fn, that, length) { + _aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; + }; + + var _isObject = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + + var _anObject = function (it) { + if (!_isObject(it)) throw TypeError(it + ' is not an object!'); + return it; + }; + + var _fails = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } + }; + + // Thank's IE8 for his funny defineProperty + var _descriptors = !_fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; + }); + + var document$1 = _global.document; + // typeof document.createElement is 'object' in old IE + var is = _isObject(document$1) && _isObject(document$1.createElement); + var _domCreate = function (it) { + return is ? document$1.createElement(it) : {}; + }; + + var _ie8DomDefine = !_descriptors && !_fails(function () { + return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; + }); + + // 7.1.1 ToPrimitive(input [, PreferredType]) + + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + var _toPrimitive = function (it, S) { + if (!_isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); + }; + + var dP = Object.defineProperty; + + var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { + _anObject(O); + P = _toPrimitive(P, true); + _anObject(Attributes); + if (_ie8DomDefine) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; + }; + + var _objectDp = { + f: f + }; + + var _propertyDesc = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; + }; + + var _hide = _descriptors ? function (object, key, value) { + return _objectDp.f(object, key, _propertyDesc(1, value)); + } : function (object, key, value) { + object[key] = value; + return object; + }; + + var PROTOTYPE = 'prototype'; + + var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && key in exports) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? _ctx(out, _global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out); + } + } + }; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + var _export = $export; + + var _redefine = _hide; + + var hasOwnProperty = {}.hasOwnProperty; + var _has = function (it, key) { + return hasOwnProperty.call(it, key); + }; + + var _iterators = {}; + + var toString = {}.toString; + + var _cof = function (it) { + return toString.call(it).slice(8, -1); + }; + + // fallback for non-array-like ES3 and non-enumerable old V8 strings + + // eslint-disable-next-line no-prototype-builtins + var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return _cof(it) == 'String' ? it.split('') : Object(it); + }; + + // to indexed object, toObject with fallback for non-array-like ES3 strings + + + var _toIobject = function (it) { + return _iobject(_defined(it)); + }; + + // 7.1.15 ToLength + + var min = Math.min; + var _toLength = function (it) { + return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + + var max = Math.max; + var min$1 = Math.min; + var _toAbsoluteIndex = function (index, length) { + index = _toInteger(index); + return index < 0 ? max(index + length, 0) : min$1(index, length); + }; + + // false -> Array#indexOf + // true -> Array#includes + + + + var _arrayIncludes = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = _toIobject($this); + var length = _toLength(O.length); + var index = _toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; + + var SHARED = '__core-js_shared__'; + var store = _global[SHARED] || (_global[SHARED] = {}); + var _shared = function (key) { + return store[key] || (store[key] = {}); + }; + + var id = 0; + var px = Math.random(); + var _uid = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + + var shared = _shared('keys'); + + var _sharedKey = function (key) { + return shared[key] || (shared[key] = _uid(key)); + }; + + var arrayIndexOf = _arrayIncludes(false); + var IE_PROTO$1 = _sharedKey('IE_PROTO'); + + var _objectKeysInternal = function (object, names) { + var O = _toIobject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO$1) _has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (_has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; + + // IE 8- don't enum bug keys + var _enumBugKeys = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' + ).split(','); + + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + + + + var _objectKeys = Object.keys || function keys(O) { + return _objectKeysInternal(O, _enumBugKeys); + }; + + var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) { + _anObject(O); + var keys = _objectKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]); + return O; + }; + + var document$2 = _global.document; + var _html = document$2 && document$2.documentElement; + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + + + + var IE_PROTO = _sharedKey('IE_PROTO'); + var Empty = function () { /* empty */ }; + var PROTOTYPE$1 = 'prototype'; + + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = _domCreate('iframe'); + var i = _enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + _html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]]; + return createDict(); + }; + + var _objectCreate = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE$1] = _anObject(O); + result = new Empty(); + Empty[PROTOTYPE$1] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : _objectDps(result, Properties); + }; + + var _wks = createCommonjsModule(function (module) { + var store = _shared('wks'); + + var Symbol = _global.Symbol; + var USE_SYMBOL = typeof Symbol == 'function'; + + var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name)); + }; + + $exports.store = store; + }); + + var def = _objectDp.f; + + var TAG = _wks('toStringTag'); + + var _setToStringTag = function (it, tag, stat) { + if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); + }; + + var IteratorPrototype = {}; + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + _hide(IteratorPrototype, _wks('iterator'), function () { return this; }); + + var _iterCreate = function (Constructor, NAME, next) { + Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) }); + _setToStringTag(Constructor, NAME + ' Iterator'); + }; + + // 7.1.13 ToObject(argument) + + var _toObject = function (it) { + return Object(_defined(it)); + }; + + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + + + var IE_PROTO$2 = _sharedKey('IE_PROTO'); + var ObjectProto = Object.prototype; + + var _objectGpo = Object.getPrototypeOf || function (O) { + O = _toObject(O); + if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }; + + var ITERATOR = _wks('iterator'); + var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` + var FF_ITERATOR = '@@iterator'; + var KEYS = 'keys'; + var VALUES = 'values'; + + var returnThis = function () { return this; }; + + var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + _iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = _objectGpo($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + _setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!_library && !_has(IteratorPrototype, ITERATOR)) _hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + _hide(proto, ITERATOR, $default); + } + // Plug for library + _iterators[NAME] = $default; + _iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) _redefine(proto, key, methods[key]); + } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; + + var $at = _stringAt(true); + + // 21.1.3.27 String.prototype[@@iterator]() + _iterDefine(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; + }); + + var _addToUnscopables = function () { /* empty */ }; + + var _iterStep = function (done, value) { + return { value: value, done: !!done }; + }; + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) { + this._t = _toIobject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return _iterStep(1); + } + if (kind == 'keys') return _iterStep(0, index); + if (kind == 'values') return _iterStep(0, O[index]); + return _iterStep(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + _iterators.Arguments = _iterators.Array; + + _addToUnscopables('keys'); + _addToUnscopables('values'); + _addToUnscopables('entries'); + + var TO_STRING_TAG = _wks('toStringTag'); + + var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + + 'TextTrackList,TouchList').split(','); + + for (var i = 0; i < DOMIterables.length; i++) { + var NAME = DOMIterables[i]; + var Collection = _global[NAME]; + var proto = Collection && Collection.prototype; + if (proto && !proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME); + _iterators[NAME] = _iterators.Array; + } + + // getting tag from 19.1.3.6 Object.prototype.toString() + + var TAG$1 = _wks('toStringTag'); + // ES3 wrong here + var ARG = _cof(function () { return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } + }; + + var _classof = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T + // builtinTag case + : ARG ? _cof(O) + // ES3 arguments fallback + : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + + var _anInstance = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; + }; + + // call something on iterator step with safe closing on error + + var _iterCall = function (iterator, fn, value, entries) { + try { + return entries ? fn(_anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) _anObject(ret.call(iterator)); + throw e; + } + }; + + // check on default Array iterator + + var ITERATOR$1 = _wks('iterator'); + var ArrayProto = Array.prototype; + + var _isArrayIter = function (it) { + return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$1] === it); + }; + + var ITERATOR$2 = _wks('iterator'); + + var core_getIteratorMethod = _core.getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR$2] + || it['@@iterator'] + || _iterators[_classof(it)]; + }; + + var _forOf = createCommonjsModule(function (module) { + var BREAK = {}; + var RETURN = {}; + var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable); + var f = _ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) { + result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = _iterCall(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } + }; + exports.BREAK = BREAK; + exports.RETURN = RETURN; + }); + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + + + var SPECIES = _wks('species'); + var _speciesConstructor = function (O, D) { + var C = _anObject(O).constructor; + var S; + return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S); + }; + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + var _invoke = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + + var process$2 = _global.process; + var setTask = _global.setImmediate; + var clearTask = _global.clearImmediate; + var MessageChannel = _global.MessageChannel; + var Dispatch = _global.Dispatch; + var counter = 0; + var queue = {}; + var ONREADYSTATECHANGE = 'onreadystatechange'; + var defer; + var channel; + var port; + var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listener = function (event) { + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + _invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (_cof(process$2) == 'process') { + defer = function (id) { + process$2.nextTick(_ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(_ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = _ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) { + defer = function (id) { + _global.postMessage(id + '', '*'); + }; + _global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in _domCreate('script')) { + defer = function (id) { + _html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () { + _html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(_ctx(run, id, 1), 0); + }; + } + } + var _task = { + set: setTask, + clear: clearTask + }; + + var macrotask = _task.set; + var Observer = _global.MutationObserver || _global.WebKitMutationObserver; + var process$3 = _global.process; + var Promise$1 = _global.Promise; + var isNode$1 = _cof(process$3) == 'process'; + + var _microtask = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode$1 && (parent = process$3.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode$1) { + notify = function () { + process$3.nextTick(flush); + }; + // browsers with MutationObserver + } else if (Observer) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise$1 && Promise$1.resolve) { + var promise = Promise$1.resolve(); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(_global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; + }; + + // 25.4.1.5 NewPromiseCapability(C) + + + function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = _aFunction(resolve); + this.reject = _aFunction(reject); + } + + var f$1 = function (C) { + return new PromiseCapability(C); + }; + + var _newPromiseCapability = { + f: f$1 + }; + + var _perform = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } + }; + + var _promiseResolve = function (C, x) { + _anObject(C); + if (_isObject(x) && x.constructor === C) return x; + var promiseCapability = _newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; + }; + + var _redefineAll = function (target, src, safe) { + for (var key in src) { + if (safe && target[key]) target[key] = src[key]; + else _hide(target, key, src[key]); + } return target; + }; + + var SPECIES$1 = _wks('species'); + + var _setSpecies = function (KEY) { + var C = typeof _core[KEY] == 'function' ? _core[KEY] : _global[KEY]; + if (_descriptors && C && !C[SPECIES$1]) _objectDp.f(C, SPECIES$1, { + configurable: true, + get: function () { return this; } + }); + }; + + var ITERATOR$3 = _wks('iterator'); + var SAFE_CLOSING = false; + + try { + var riter = [7][ITERATOR$3](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); + } catch (e) { /* empty */ } + + var _iterDetect = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR$3](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR$3] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; + }; + + var task = _task.set; + var microtask = _microtask(); + + + + var PROMISE = 'Promise'; + var TypeError$1 = _global.TypeError; + var process$1 = _global.process; + var $Promise = _global[PROMISE]; + var isNode = _classof(process$1) == 'process'; + var empty = function () { /* empty */ }; + var Internal; + var newGenericPromiseCapability; + var OwnPromiseCapability; + var Wrapper; + var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f; + + var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch (e) { /* empty */ } + }(); + + // helpers + var isThenable = function (it) { + var then; + return _isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); + if (domain) domain.exit(); + } + if (result === reaction.promise) { + reject(TypeError$1('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); + }; + var onUnhandled = function (promise) { + task.call(_global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = _perform(function () { + if (isNode) { + process$1.emit('unhandledRejection', value, promise); + } else if (handler = _global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = _global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); + }; + var isUnhandled = function (promise) { + if (promise._h == 1) return false; + var chain = promise._a || promise._c; + var i = 0; + var reaction; + while (chain.length > i) { + reaction = chain[i++]; + if (reaction.fail || !isUnhandled(reaction.promise)) return false; + } return true; + }; + var onHandleUnhandled = function (promise) { + task.call(_global, function () { + var handler; + if (isNode) { + process$1.emit('rejectionHandled', promise); + } else if (handler = _global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); + }; + var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); + }; + var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError$1("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } + }; + + // constructor polyfill + if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + _anInstance(this, $Promise, PROMISE, '_h'); + _aFunction(executor); + Internal.call(this); + try { + executor(_ctx($resolve, this, 1), _ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = _redefineAll($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(_speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process$1.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = _ctx($resolve, promise, 1); + this.reject = _ctx($reject, promise, 1); + }; + _newPromiseCapability.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; + } + + _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Promise: $Promise }); + _setToStringTag($Promise, PROMISE); + _setSpecies(PROMISE); + Wrapper = _core[PROMISE]; + + // statics + _export(_export.S + _export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + _export(_export.S + _export.F * (_library || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return _promiseResolve(_library && this === Wrapper ? $Promise : this, x); + } + }); + _export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) { + $Promise.all(iter)['catch'](empty); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = _perform(function () { + var values = []; + var index = 0; + var remaining = 1; + _forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = _perform(function () { + _forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } + }); + + _export(_export.P + _export.R, 'Promise', { 'finally': function (onFinally) { + var C = _speciesConstructor(this, _core.Promise || _global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return _promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return _promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); + } }); + + // https://github.com/tc39/proposal-promise-try + + + + + _export(_export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = _newPromiseCapability.f(this); + var result = _perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; + } }); + + var promise$1 = _core.Promise; + + var promise = createCommonjsModule(function (module) { + module.exports = { "default": promise$1, __esModule: true }; + }); + + var _Promise = unwrapExports(promise); + + var f$2 = _wks; + + var _wksExt = { + f: f$2 + }; + + var iterator$2 = _wksExt.f('iterator'); + + var iterator = createCommonjsModule(function (module) { + module.exports = { "default": iterator$2, __esModule: true }; + }); + + var _meta = createCommonjsModule(function (module) { + var META = _uid('meta'); + + + var setDesc = _objectDp.f; + var id = 0; + var isExtensible = Object.isExtensible || function () { + return true; + }; + var FREEZE = !_fails(function () { + return isExtensible(Object.preventExtensions({})); + }); + var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); + }; + var fastKey = function (it, create) { + // return primitive with prefix + if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!_has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; + }; + var getWeak = function (it, create) { + if (!_has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; + }; + // add metadata on freeze-family methods calling + var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it); + return it; + }; + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + }; + }); + + var defineProperty = _objectDp.f; + var _wksDefine = function (name) { + var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) }); + }; + + var f$3 = Object.getOwnPropertySymbols; + + var _objectGops = { + f: f$3 + }; + + var f$4 = {}.propertyIsEnumerable; + + var _objectPie = { + f: f$4 + }; + + // all enumerable object keys, includes symbols + + + + var _enumKeys = function (it) { + var result = _objectKeys(it); + var getSymbols = _objectGops.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = _objectPie.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; + }; + + // 7.2.2 IsArray(argument) + + var _isArray = Array.isArray || function isArray(arg) { + return _cof(arg) == 'Array'; + }; + + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + + var hiddenKeys = _enumBugKeys.concat('length', 'prototype'); + + var f$6 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return _objectKeysInternal(O, hiddenKeys); + }; + + var _objectGopn = { + f: f$6 + }; + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + + var gOPN$1 = _objectGopn.f; + var toString$1 = {}.toString; + + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function (it) { + try { + return gOPN$1(it); + } catch (e) { + return windowNames.slice(); + } + }; + + var f$5 = function getOwnPropertyNames(it) { + return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN$1(_toIobject(it)); + }; + + var _objectGopnExt = { + f: f$5 + }; + + var gOPD$1 = Object.getOwnPropertyDescriptor; + + var f$7 = _descriptors ? gOPD$1 : function getOwnPropertyDescriptor(O, P) { + O = _toIobject(O); + P = _toPrimitive(P, true); + if (_ie8DomDefine) try { + return gOPD$1(O, P); + } catch (e) { /* empty */ } + if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]); + }; + + var _objectGopd = { + f: f$7 + }; + + // ECMAScript 6 symbols shim + + + + + + var META = _meta.KEY; + + + + + + + + + + + + + + + + + + + var gOPD = _objectGopd.f; + var dP$1 = _objectDp.f; + var gOPN = _objectGopnExt.f; + var $Symbol = _global.Symbol; + var $JSON = _global.JSON; + var _stringify = $JSON && $JSON.stringify; + var PROTOTYPE$2 = 'prototype'; + var HIDDEN = _wks('_hidden'); + var TO_PRIMITIVE = _wks('toPrimitive'); + var isEnum = {}.propertyIsEnumerable; + var SymbolRegistry = _shared('symbol-registry'); + var AllSymbols = _shared('symbols'); + var OPSymbols = _shared('op-symbols'); + var ObjectProto$1 = Object[PROTOTYPE$2]; + var USE_NATIVE$1 = typeof $Symbol == 'function'; + var QObject = _global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = _descriptors && _fails(function () { + return _objectCreate(dP$1({}, 'a', { + get: function () { return dP$1(this, 'a', { value: 7 }).a; } + })).a != 7; + }) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto$1, key); + if (protoDesc) delete ObjectProto$1[key]; + dP$1(it, key, D); + if (protoDesc && it !== ObjectProto$1) dP$1(ObjectProto$1, key, protoDesc); + } : dP$1; + + var wrap = function (tag) { + var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]); + sym._k = tag; + return sym; + }; + + var isSymbol = USE_NATIVE$1 && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; + } : function (it) { + return it instanceof $Symbol; + }; + + var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto$1) $defineProperty(OPSymbols, key, D); + _anObject(it); + key = _toPrimitive(key, true); + _anObject(D); + if (_has(AllSymbols, key)) { + if (!D.enumerable) { + if (!_has(it, HIDDEN)) dP$1(it, HIDDEN, _propertyDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _objectCreate(D, { enumerable: _propertyDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP$1(it, key, D); + }; + var $defineProperties = function defineProperties(it, P) { + _anObject(it); + var keys = _enumKeys(P = _toIobject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P) { + return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = _toPrimitive(key, true)); + if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false; + return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = _toIobject(it); + key = _toPrimitive(key, true); + if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(_toIobject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto$1; + var names = gOPN(IS_OP ? OPSymbols : _toIobject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto$1, key) : true)) result.push(AllSymbols[key]); + } return result; + }; + + // 19.4.1.1 Symbol([description]) + if (!USE_NATIVE$1) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = _uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto$1) $set.call(OPSymbols, value); + if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, _propertyDesc(1, value)); + }; + if (_descriptors && setter) setSymbolDesc(ObjectProto$1, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() { + return this._k; + }); + + _objectGopd.f = $getOwnPropertyDescriptor; + _objectDp.f = $defineProperty; + _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames; + _objectPie.f = $propertyIsEnumerable; + _objectGops.f = $getOwnPropertySymbols; + + if (_descriptors && !_library) { + _redefine(ObjectProto$1, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + _wksExt.f = function (name) { + return wrap(_wks(name)); + }; + } + + _export(_export.G + _export.W + _export.F * !USE_NATIVE$1, { Symbol: $Symbol }); + + for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' + ).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]); + + for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]); + + _export(_export.S + _export.F * !USE_NATIVE$1, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return _has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } + }); + + _export(_export.S + _export.F * !USE_NATIVE$1, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && _export(_export.S + _export.F * (!USE_NATIVE$1 || _fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; + })), 'JSON', { + stringify: function stringify(it) { + if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + replacer = args[1]; + if (typeof replacer == 'function') $replacer = replacer; + if ($replacer || !_isArray(replacer)) replacer = function (key, value) { + if ($replacer) value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } + }); + + // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf); + // 19.4.3.5 Symbol.prototype[@@toStringTag] + _setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + _setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + _setToStringTag(_global.JSON, 'JSON', true); + + _wksDefine('asyncIterator'); + + _wksDefine('observable'); + + var symbol$1 = _core.Symbol; + + var symbol = createCommonjsModule(function (module) { + module.exports = { "default": symbol$1, __esModule: true }; + }); + + var _Symbol = unwrapExports(symbol); + + var _typeof_1 = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _iterator2 = _interopRequireDefault(iterator); + + + + var _symbol2 = _interopRequireDefault(symbol); + + var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); + } : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); + }; + }); + + var _typeof = unwrapExports(_typeof_1); + + var classCallCheck = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + }); + + var _classCallCheck = unwrapExports(classCallCheck); + + var Storage = function () { + function Storage() { + _classCallCheck(this, Storage); + } + + Storage.prototype.getItem = function getItem(key) { + return wx.getStorageSync(key); + }; + + Storage.prototype.setItem = function setItem(key, value) { + return wx.setStorageSync(key, value); + }; + + Storage.prototype.removeItem = function removeItem(key) { + return this.setItem(key, ''); + }; + + Storage.prototype.clear = function clear() { + return wx.clearStorageSync(); + }; + + return Storage; + }(); + + var localstorage = new Storage(); + + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + _export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f }); + + var $Object = _core.Object; + var defineProperty$4 = function defineProperty(it, key, desc) { + return $Object.defineProperty(it, key, desc); + }; + + var defineProperty$2 = createCommonjsModule(function (module) { + module.exports = { "default": defineProperty$4, __esModule: true }; + }); + + var defineProperty$1 = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _defineProperty2 = _interopRequireDefault(defineProperty$2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (obj, key, value) { + if (key in obj) { + (0, _defineProperty2.default)(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + }; + }); + + var _defineProperty = unwrapExports(defineProperty$1); + + var possibleConstructorReturn = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _typeof3 = _interopRequireDefault(_typeof_1); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; + }; + }); + + var _possibleConstructorReturn = unwrapExports(possibleConstructorReturn); + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + + + var check = function (O, proto) { + _anObject(O); + if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); + }; + var _setProto = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + + _export(_export.S, 'Object', { setPrototypeOf: _setProto.set }); + + var setPrototypeOf$2 = _core.Object.setPrototypeOf; + + var setPrototypeOf = createCommonjsModule(function (module) { + module.exports = { "default": setPrototypeOf$2, __esModule: true }; + }); + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + _export(_export.S, 'Object', { create: _objectCreate }); + + var $Object$1 = _core.Object; + var create$3 = function create(P, D) { + return $Object$1.create(P, D); + }; + + var create$1 = createCommonjsModule(function (module) { + module.exports = { "default": create$3, __esModule: true }; + }); + + var inherits = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _setPrototypeOf2 = _interopRequireDefault(setPrototypeOf); + + + + var _create2 = _interopRequireDefault(create$1); + + + + var _typeof3 = _interopRequireDefault(_typeof_1); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } + + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; + }; + }); + + var _inherits = unwrapExports(inherits); + + var $JSON$1 = _core.JSON || (_core.JSON = { stringify: JSON.stringify }); + var stringify$1 = function stringify(it) { // eslint-disable-line no-unused-vars + return $JSON$1.stringify.apply($JSON$1, arguments); + }; + + var stringify = createCommonjsModule(function (module) { + module.exports = { "default": stringify$1, __esModule: true }; + }); + + var _JSON$stringify = unwrapExports(stringify); + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject$1(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + + var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject$1(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty$1.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + var commons = createCommonjsModule(function (module, exports) { + /** + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + + "use strict"; + + /** + * Creates a unique key. + * + * @param {string} name - A name to create. + * @returns {symbol|string} + * @private + */ + var createUniqueKey = exports.createUniqueKey = (typeof Symbol !== "undefined" ? + Symbol : + function createUniqueKey(name) { + return "[[" + name + "_" + Math.random().toFixed(8).slice(2) + "]]"; + }); + + /** + * The key of listeners. + * + * @type {symbol|string} + * @private + */ + exports.LISTENERS = createUniqueKey("listeners"); + + /** + * A value of kind for listeners which are registered in the capturing phase. + * + * @type {number} + * @private + */ + exports.CAPTURE = 1; + + /** + * A value of kind for listeners which are registered in the bubbling phase. + * + * @type {number} + * @private + */ + exports.BUBBLE = 2; + + /** + * A value of kind for listeners which are registered as an attribute. + * + * @type {number} + * @private + */ + exports.ATTRIBUTE = 3; + + /** + * @typedef object ListenerNode + * @property {function} listener - A listener function. + * @property {number} kind - The kind of the listener. + * @property {ListenerNode|null} next - The next node. + * If this node is the last, this is `null`. + */ + + /** + * Creates a node of singly linked list for a list of listeners. + * + * @param {function} listener - A listener function. + * @param {number} kind - The kind of the listener. + * @returns {ListenerNode} The created listener node. + */ + exports.newNode = function newNode(listener, kind) { + return {listener: listener, kind: kind, next: null}; + }; + }); + + //----------------------------------------------------------------------------- + // Requirements + //----------------------------------------------------------------------------- + + + var LISTENERS = commons.LISTENERS; + var ATTRIBUTE = commons.ATTRIBUTE; + var newNode = commons.newNode; + + //----------------------------------------------------------------------------- + // Helpers + //----------------------------------------------------------------------------- + + /** + * Gets a specified attribute listener from a given EventTarget object. + * + * @param {EventTarget} eventTarget - An EventTarget object to get. + * @param {string} type - An event type to get. + * @returns {function|null} The found attribute listener. + */ + function getAttributeListener(eventTarget, type) { + var node = eventTarget[LISTENERS][type]; + while (node != null) { + if (node.kind === ATTRIBUTE) { + return node.listener; + } + node = node.next; + } + return null; + } + + /** + * Sets a specified attribute listener to a given EventTarget object. + * + * @param {EventTarget} eventTarget - An EventTarget object to set. + * @param {string} type - An event type to set. + * @param {function|null} listener - A listener to be set. + * @returns {void} + */ + function setAttributeListener(eventTarget, type, listener) { + if (typeof listener !== "function" && typeof listener !== "object") { + listener = null; // eslint-disable-line no-param-reassign + } + + var prev = null; + var node = eventTarget[LISTENERS][type]; + while (node != null) { + if (node.kind === ATTRIBUTE) { + // Remove old value. + if (prev == null) { + eventTarget[LISTENERS][type] = node.next; + } + else { + prev.next = node.next; + } + } + else { + prev = node; + } + + node = node.next; + } + + // Add new value. + if (listener != null) { + if (prev == null) { + eventTarget[LISTENERS][type] = newNode(listener, ATTRIBUTE); + } + else { + prev.next = newNode(listener, ATTRIBUTE); + } + } + } + + //----------------------------------------------------------------------------- + // Public Interface + //----------------------------------------------------------------------------- + + /** + * Defines an `EventTarget` implementation which has `onfoobar` attributes. + * + * @param {EventTarget} EventTargetBase - A base implementation of EventTarget. + * @param {string[]} types - A list of event types which are defined as attribute listeners. + * @returns {EventTarget} The defined `EventTarget` implementation which has attribute listeners. + */ + var defineCustomEventTarget = function(EventTargetBase, types) { + function EventTarget() { + EventTargetBase.call(this); + } + + var descripter = { + constructor: { + value: EventTarget, + configurable: true, + writable: true + } + }; + + types.forEach(function(type) { + descripter["on" + type] = { + get: function() { return getAttributeListener(this, type); }, + set: function(listener) { setAttributeListener(this, type, listener); }, + configurable: true, + enumerable: true + }; + }); + + EventTarget.prototype = Object.create(EventTargetBase.prototype, descripter); + + return EventTarget; + }; + + var customEventTarget = { + defineCustomEventTarget: defineCustomEventTarget + }; + + //----------------------------------------------------------------------------- + // Requirements + //----------------------------------------------------------------------------- + + var createUniqueKey = commons.createUniqueKey; + + //----------------------------------------------------------------------------- + // Constsnts + //----------------------------------------------------------------------------- + + /** + * The key of the flag which is turned on by `stopImmediatePropagation` method. + * + * @type {symbol|string} + * @private + */ + var STOP_IMMEDIATE_PROPAGATION_FLAG = + createUniqueKey("stop_immediate_propagation_flag"); + + /** + * The key of the flag which is turned on by `preventDefault` method. + * + * @type {symbol|string} + * @private + */ + var CANCELED_FLAG = createUniqueKey("canceled_flag"); + + /** + * The key of the original event object. + * + * @type {symbol|string} + * @private + */ + var ORIGINAL_EVENT = createUniqueKey("original_event"); + + /** + * Method definitions for the event wrapper. + * + * @type {object} + * @private + */ + var wrapperPrototypeDefinition = Object.freeze({ + stopPropagation: Object.freeze({ + value: function stopPropagation() { + var e = this[ORIGINAL_EVENT]; + if (typeof e.stopPropagation === "function") { + e.stopPropagation(); + } + }, + writable: true, + configurable: true + }), + + stopImmediatePropagation: Object.freeze({ + value: function stopImmediatePropagation() { + this[STOP_IMMEDIATE_PROPAGATION_FLAG] = true; + + var e = this[ORIGINAL_EVENT]; + if (typeof e.stopImmediatePropagation === "function") { + e.stopImmediatePropagation(); + } + }, + writable: true, + configurable: true + }), + + preventDefault: Object.freeze({ + value: function preventDefault() { + if (this.cancelable === true) { + this[CANCELED_FLAG] = true; + } + + var e = this[ORIGINAL_EVENT]; + if (typeof e.preventDefault === "function") { + e.preventDefault(); + } + }, + writable: true, + configurable: true + }), + + defaultPrevented: Object.freeze({ + get: function defaultPrevented() { return this[CANCELED_FLAG]; }, + enumerable: true, + configurable: true + }) + }); + + //----------------------------------------------------------------------------- + // Public Interface + //----------------------------------------------------------------------------- + + var STOP_IMMEDIATE_PROPAGATION_FLAG_1 = STOP_IMMEDIATE_PROPAGATION_FLAG; + + /** + * Creates an event wrapper. + * + * We cannot modify several properties of `Event` object, so we need to create the wrapper. + * Plus, this wrapper supports non `Event` objects. + * + * @param {Event|{type: string}} event - An original event to create the wrapper. + * @param {EventTarget} eventTarget - The event target of the event. + * @returns {Event} The created wrapper. This object is implemented `Event` interface. + * @private + */ + var createEventWrapper = function createEventWrapper(event, eventTarget) { + var timeStamp = ( + typeof event.timeStamp === "number" ? event.timeStamp : Date.now() + ); + var propertyDefinition = { + type: {value: event.type, enumerable: true}, + target: {value: eventTarget, enumerable: true}, + currentTarget: {value: eventTarget, enumerable: true}, + eventPhase: {value: 2, enumerable: true}, + bubbles: {value: Boolean(event.bubbles), enumerable: true}, + cancelable: {value: Boolean(event.cancelable), enumerable: true}, + timeStamp: {value: timeStamp, enumerable: true}, + isTrusted: {value: false, enumerable: true} + }; + propertyDefinition[STOP_IMMEDIATE_PROPAGATION_FLAG] = {value: false, writable: true}; + propertyDefinition[CANCELED_FLAG] = {value: false, writable: true}; + propertyDefinition[ORIGINAL_EVENT] = {value: event}; + + // For CustomEvent. + if (typeof event.detail !== "undefined") { + propertyDefinition.detail = {value: event.detail, enumerable: true}; + } + + return Object.create( + Object.create(event, wrapperPrototypeDefinition), + propertyDefinition + ); + }; + + var eventWrapper = { + STOP_IMMEDIATE_PROPAGATION_FLAG: STOP_IMMEDIATE_PROPAGATION_FLAG_1, + createEventWrapper: createEventWrapper + }; + + var eventTarget = createCommonjsModule(function (module) { + /** + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + + "use strict"; + + //----------------------------------------------------------------------------- + // Requirements + //----------------------------------------------------------------------------- + + + + + var LISTENERS = commons.LISTENERS; + var CAPTURE = commons.CAPTURE; + var BUBBLE = commons.BUBBLE; + var ATTRIBUTE = commons.ATTRIBUTE; + var newNode = commons.newNode; + var defineCustomEventTarget = customEventTarget.defineCustomEventTarget; + var createEventWrapper = eventWrapper.createEventWrapper; + var STOP_IMMEDIATE_PROPAGATION_FLAG = + eventWrapper.STOP_IMMEDIATE_PROPAGATION_FLAG; + + //----------------------------------------------------------------------------- + // Constants + //----------------------------------------------------------------------------- + + /** + * A flag which shows there is the native `EventTarget` interface object. + * + * @type {boolean} + * @private + */ + var HAS_EVENTTARGET_INTERFACE = ( + typeof window !== "undefined" && + typeof window.EventTarget !== "undefined" + ); + + //----------------------------------------------------------------------------- + // Public Interface + //----------------------------------------------------------------------------- + + /** + * An implementation for `EventTarget` interface. + * + * @constructor + * @public + */ + var EventTarget = module.exports = function EventTarget() { + if (this instanceof EventTarget) { + // this[LISTENERS] is a Map. + // Its key is event type. + // Its value is ListenerNode object or null. + // + // interface ListenerNode { + // var listener: Function + // var kind: CAPTURE|BUBBLE|ATTRIBUTE + // var next: ListenerNode|null + // } + Object.defineProperty(this, LISTENERS, {value: Object.create(null)}); + } + else if (arguments.length === 1 && Array.isArray(arguments[0])) { + return defineCustomEventTarget(EventTarget, arguments[0]); + } + else if (arguments.length > 0) { + var types = Array(arguments.length); + for (var i = 0; i < arguments.length; ++i) { + types[i] = arguments[i]; + } + + // To use to extend with attribute listener properties. + // e.g. + // class MyCustomObject extends EventTarget("message", "error") { + // //... + // } + return defineCustomEventTarget(EventTarget, types); + } + else { + throw new TypeError("Cannot call a class as a function"); + } + }; + + EventTarget.prototype = Object.create( + (HAS_EVENTTARGET_INTERFACE ? window.EventTarget : Object).prototype, + { + constructor: { + value: EventTarget, + writable: true, + configurable: true + }, + + addEventListener: { + value: function addEventListener(type, listener, capture) { + if (listener == null) { + return false; + } + if (typeof listener !== "function" && typeof listener !== "object") { + throw new TypeError("\"listener\" is not an object."); + } + + var kind = (capture ? CAPTURE : BUBBLE); + var node = this[LISTENERS][type]; + if (node == null) { + this[LISTENERS][type] = newNode(listener, kind); + return true; + } + + var prev = null; + while (node != null) { + if (node.listener === listener && node.kind === kind) { + // Should ignore a duplicated listener. + return false; + } + prev = node; + node = node.next; + } + + prev.next = newNode(listener, kind); + return true; + }, + configurable: true, + writable: true + }, + + removeEventListener: { + value: function removeEventListener(type, listener, capture) { + if (listener == null) { + return false; + } + + var kind = (capture ? CAPTURE : BUBBLE); + var prev = null; + var node = this[LISTENERS][type]; + while (node != null) { + if (node.listener === listener && node.kind === kind) { + if (prev == null) { + this[LISTENERS][type] = node.next; + } + else { + prev.next = node.next; + } + return true; + } + + prev = node; + node = node.next; + } + + return false; + }, + configurable: true, + writable: true + }, + + dispatchEvent: { + value: function dispatchEvent(event) { + // If listeners aren't registered, terminate. + var node = this[LISTENERS][event.type]; + if (node == null) { + return true; + } + + // Since we cannot rewrite several properties, so wrap object. + var wrapped = createEventWrapper(event, this); + + // This doesn't process capturing phase and bubbling phase. + // This isn't participating in a tree. + while (node != null) { + if (typeof node.listener === "function") { + node.listener.call(this, wrapped); + } + else if (node.kind !== ATTRIBUTE && typeof node.listener.handleEvent === "function") { + node.listener.handleEvent(wrapped); + } + + if (wrapped[STOP_IMMEDIATE_PROPAGATION_FLAG]) { + break; + } + node = node.next; + } + + return !wrapped.defaultPrevented; + }, + configurable: true, + writable: true + } + } + ); + }); + + var FormData$1 = function () { + function FormData() { + _classCallCheck(this, FormData); + + this._entries = []; + } + + FormData.prototype.append = function append(name, value) { + if (typeof name !== 'string') { + throw new TypeError('FormData name must be a string'); + } + if (typeof value !== 'string') { + if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || typeof value.uri !== 'string') { + throw new TypeError('FormData value must be a string or { uri: tempFilePath }'); + } + } + this._entries.push([name, value]); + }; + + FormData.prototype.set = function set(name, value) { + var entry = this.get(name); + if (entry) { + entry[1] = value; + } else { + this.append(name, value); + } + }; + + FormData.prototype.delete = function _delete(name) { + this._entries = this._entries.filter(function (entry) { + return entry[0] !== name; + }); + }; + + FormData.prototype.entries = function entries() { + return this._entries; + }; + + FormData.prototype.get = function get(name) { + return this._entries.find(function (entry) { + return entry[0] === name; + }); + }; + + FormData.prototype.getAll = function getAll(name) { + return this._entries.filter(function (entry) { + return entry[0] === name; + }); + }; + + FormData.prototype.has = function has(name) { + return this._entries.some(function (entry) { + return entry[0] === name; + }); + }; + + FormData.prototype.keys = function keys() { + return this._entries.map(function (entry) { + return entry[0]; + }); + }; + + FormData.prototype.values = function values() { + return this._entries.map(function (entry) { + return entry[1]; + }); + }; + + return FormData; + }(); + + var formdata = FormData$1; + + var UNSENT = 0; + var OPENED = 1; + var HEADERS_RECEIVED = 2; + var LOADING = 3; + var DONE = 4; + + var REQUEST_EVENTS = ['abort', 'error', 'load', 'loadstart', 'progress', 'timeout', 'loadend', 'readystatechange']; + + function successCallback(response) { + this.status = response.statusCode; + this.statusText = response.statusCode; + var text = response.data; + if (typeof text !== 'string') { + text = _JSON$stringify(text); + } + this.responseText = this.response = text; + this.readyState = DONE; + this.dispatchEvent({ type: 'readystatechange' }); + } + + var XMLHttpRequest$1 = function (_EventTarget) { + _inherits(XMLHttpRequest, _EventTarget); + + function XMLHttpRequest() { + _classCallCheck(this, XMLHttpRequest); + + var _this = _possibleConstructorReturn(this, _EventTarget.call(this)); + + _this.readyState = UNSENT; + _this._headers = {}; + return _this; + } + + XMLHttpRequest.prototype.abort = function abort() { + throw new Error('not supported in weapp'); + }; + + XMLHttpRequest.prototype.getAllResponseHeaders = function getAllResponseHeaders() { + console.warn('getAllResponseHeaders always returns \'\''); + return ''; + }; + + XMLHttpRequest.prototype.getResponseHeader = function getResponseHeader(key) { + if (key === 'content-type') { + console.warn('get content-type always returns \'application/json\''); + return 'application/json'; + } + console.warn('getResponseHeader always returns \'\''); + return ''; + }; + + XMLHttpRequest.prototype.overrideMimeType = function overrideMimeType() { + throw new Error('not supported in weapp'); + }; + + XMLHttpRequest.prototype.open = function open(method, url) { + var async = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + + if (this.readyState !== UNSENT) { + throw new Error('request is already opened'); + } + if (!async) { + throw new Error('sync request is not supported'); + } + this._method = method; + this._url = url; + this.readyState = OPENED; + this.dispatchEvent({ type: 'readystatechange' }); + }; + + XMLHttpRequest.prototype.setRequestHeader = function setRequestHeader(header, value) { + if (this.readyState !== OPENED) { + throw new Error('request is not opened'); + } + this._headers[header.toLowerCase()] = value; + }; + + XMLHttpRequest.prototype.send = function send(data) { + var _this2 = this; + + if (this.readyState !== OPENED) { + throw new Error('request is not opened'); + } + if (data instanceof formdata) { + var entries = data.entries(); + var blobs = entries.filter(function (entry) { + return typeof entry[1] !== 'string'; + }); + if (blobs.length === 0) { + throw new Error('Must specify a Blob field in FormData'); + } + if (blobs.length > 1) { + console.warn('Only the first Blob will be send in Weapp'); + } + var restData = entries.filter(function (entry) { + return typeof entry[1] === 'string'; + }).reduce(function (result, entry) { + return objectAssign(result, _defineProperty({}, entry[0], entry[1])); + }, {}); + wx.uploadFile({ + url: this._url, + name: blobs[0][0], + filePath: blobs[0][1].uri, + formData: restData, + header: this._headers, + success: successCallback.bind(this), + fail: function fail(error) { + _this2.status = 0; + _this2.readyState = DONE; + _this2.dispatchEvent({ type: 'readystatechange' }); + _this2.dispatchEvent({ type: 'error' }); + } + }); + } else { + wx.request({ + url: this._url, + data: data || '', + // method 的 value 居然必须为大写 + method: this._method.toUpperCase(), + header: this._headers, + success: successCallback.bind(this), + fail: function fail(error) { + _this2.status = 0; + _this2.readyState = DONE; + _this2.dispatchEvent({ type: 'readystatechange' }); + _this2.dispatchEvent({ type: 'error' }); + } + }); + } + }; + + return XMLHttpRequest; + }(eventTarget(REQUEST_EVENTS)); + + objectAssign(XMLHttpRequest$1, { + UNSENT: UNSENT, + OPENED: OPENED, + HEADERS_RECEIVED: HEADERS_RECEIVED, + LOADING: LOADING, + DONE: DONE + }); + + var xmlhttprequest = XMLHttpRequest$1; + + var createClass = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _defineProperty2 = _interopRequireDefault(defineProperty$2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + }); + + var _createClass = unwrapExports(createClass); + + var CONNECTING = 0; + var OPEN = 1; + var CLOSING = 2; + var CLOSED = 3; + + var EVENTS = ['open', 'error', 'message', 'close']; + + var instance = void 0; + + function errorHandler(event) { + // 安卓小程序会诡异地触发 onSocketError 回调 + // 通过比较 message 过滤掉 + if (event.message === "") return; + if (instance) { + instance._readyState = CLOSED; + instance.dispatchEvent({ + type: 'error', + message: event.errMsg + }); + } + } + + var WebSocket$1 = function (_EventTarget) { + _inherits(WebSocket, _EventTarget); + + function WebSocket(url, protocal) { + _classCallCheck(this, WebSocket); + + if (!url) { + throw new TypeError('Failed to construct \'WebSocket\': url required'); + } + if (protocal) { + throw new Error('subprotocal not supported in weapp'); + } + + var _this = _possibleConstructorReturn(this, _EventTarget.call(this)); + + _this._url = url; + _this._protocal = ''; // default value according to specs + _this._readyState = CONNECTING; + if (instance) { + instance.dispatchEvent({ + type: 'close' + }); + } + instance = _this; + + wx.onSocketOpen(function (event) { + if (instance) { + instance._readyState = OPEN; + instance.dispatchEvent({ + type: 'open' + }); + } + }); + wx.onSocketError(errorHandler); + wx.onSocketMessage(function (event) { + if (instance) { + var data = event.data, + origin = event.origin, + ports = event.ports, + source = event.source; + + instance.dispatchEvent({ + data: data, + origin: origin, + ports: ports, + source: source, + type: 'message' + }); + } + }); + wx.onSocketClose(function (event) { + if (instance) { + instance._readyState = CLOSED; + var code = event.code, + reason = event.reason, + wasClean = event.wasClean; + + instance.dispatchEvent({ + code: code, + reason: reason, + wasClean: wasClean, + type: 'close' + }); + instance = null; + } + }); + + wx.connectSocket({ + url: url, + fail: function fail(error) { + return setTimeout(function () { + return errorHandler(error); + }, 0); + } + }); + return _this; + } + + WebSocket.prototype.close = function close() { + if (this.readyState === CONNECTING) { + console.warn('close WebSocket which is connecting might not work'); + } + wx.closeSocket(); + }; + + WebSocket.prototype.send = function send(data) { + if (this.readyState !== OPEN) { + throw new Error('INVALID_STATE_ERR'); + } + + if (typeof data !== 'string') { + throw new TypeError('only string typed data are supported'); + } + + wx.sendSocketMessage({ + data: data + }); + }; + + _createClass(WebSocket, [{ + key: 'url', + get: function get() { + return this._url; + } + }, { + key: 'protocal', + get: function get() { + return this._protocal; + } + }, { + key: 'readyState', + get: function get() { + return this._readyState; + } + }]); + + return WebSocket; + }(eventTarget(EVENTS)); + + objectAssign(WebSocket$1, { + CONNECTING: CONNECTING, + OPEN: OPEN, + CLOSING: CLOSING, + CLOSED: CLOSED + }); + + var websocket = WebSocket$1; + + var navigator$1 = {}; + + var weappPolyfill = { + polyfill: function polyfill() { + var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : commonjsGlobal || window; + + if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) !== 'object') { + throw new Error('polyfill target is not an Object'); + } + var polyfills = { + localStorage: localstorage, + XMLHttpRequest: xmlhttprequest, + FormData: formdata, + WebSocket: websocket, + Object: Object, + navigator: navigator$1 + }; + for (var k in polyfills) { + if (!target[k]) target[k] = polyfills[k]; + } + }, + + localStorage: localstorage, + XMLHttpRequest: xmlhttprequest, + FormData: formdata, + WebSocket: websocket + }; + + var polyfill = weappPolyfill.polyfill; + window = window || {}; + polyfill(); + polyfill(window); + try { + localStorage = localStorage || localstorage; + } catch (e) {} + try { + XMLHttpRequest = XMLHttpRequest || xmlhttprequest; + } catch (e) {} + try { + FormData = FormData || formdata; + } catch (e) {} + try { + WebSocket = WebSocket || websocket; + } catch (e) {} + try { + navigator = navigator || navigator$1; + } catch (e) {} + + // eslint-disable-next-line import/no-extraneous-dependencies + + var long_1 = createCommonjsModule(function (module) { + /* + Copyright 2013 Daniel Wirtz + Copyright 2009 The Closure Library Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS-IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license long.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/long.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined([], factory); + /* CommonJS */ else if (typeof commonjsRequire === 'function' && 'object' === "object" && module && module["exports"]) + module["exports"] = factory(); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = factory(); + + })(commonjsGlobal, function() { + "use strict"; + + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @constructor + */ + function Long(low, high, unsigned) { + + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; + } + + // The internal representation of a long is the two given signed, 32-bit values. + // We use 32-bit pieces because these are the size of integers on which + // Javascript performs bit-operations. For operations like addition and + // multiplication, we split each number into 16 bit pieces, which can easily be + // multiplied within Javascript's floating-point representation without overflow + // or change in sign. + // + // In the algorithms below, we frequently reduce the negative case to the + // positive case by negating the input(s) and then post-processing the result. + // Note that we must ALWAYS check specially whether those values are MIN_VALUE + // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + // a positive number, it overflows back into a negative). Not handling this + // case would often result in infinite recursion. + // + // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* + // methods on which they depend. + + /** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ + Long.prototype.__isLong__; + + Object.defineProperty(Long.prototype, "__isLong__", { + value: true, + enumerable: false, + configurable: false + }); + + /** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + + /** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ + Long.isLong = isLong; + + /** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ + var INT_CACHE = {}; + + /** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ + var UINT_CACHE = {}; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = (0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = (-128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + + /** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromInt = fromInt; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromNumber(value, unsigned) { + if (isNaN(value) || !isFinite(value)) + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } + if (value < 0) + return fromNumber(-value, unsigned).neg(); + return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromNumber = fromNumber; + + /** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBits = fromBits; + + /** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ + var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) + + /** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ + function fromString(str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + radix = unsigned, + unsigned = false; + } else { + unsigned = !! unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 8)); + + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + + /** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ + Long.fromString = fromString; + + /** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @returns {!Long} + * @inner + */ + function fromValue(val) { + if (val /* is compatible */ instanceof Long) + return val; + if (typeof val === 'number') + return fromNumber(val); + if (typeof val === 'string') + return fromString(val); + // Throws for non-objects, converts non-instanceof Long: + return fromBits(val.low, val.high, val.unsigned); + } + + /** + * Converts the specified value to a Long. + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value + * @returns {!Long} + */ + Long.fromValue = fromValue; + + // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be + // no runtime penalty for these. + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_16_DBL = 1 << 16; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_24_DBL = 1 << 24; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + + /** + * @type {!Long} + * @const + * @inner + */ + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + + /** + * @type {!Long} + * @inner + */ + var ZERO = fromInt(0); + + /** + * Signed zero. + * @type {!Long} + */ + Long.ZERO = ZERO; + + /** + * @type {!Long} + * @inner + */ + var UZERO = fromInt(0, true); + + /** + * Unsigned zero. + * @type {!Long} + */ + Long.UZERO = UZERO; + + /** + * @type {!Long} + * @inner + */ + var ONE = fromInt(1); + + /** + * Signed one. + * @type {!Long} + */ + Long.ONE = ONE; + + /** + * @type {!Long} + * @inner + */ + var UONE = fromInt(1, true); + + /** + * Unsigned one. + * @type {!Long} + */ + Long.UONE = UONE; + + /** + * @type {!Long} + * @inner + */ + var NEG_ONE = fromInt(-1); + + /** + * Signed negative one. + * @type {!Long} + */ + Long.NEG_ONE = NEG_ONE; + + /** + * @type {!Long} + * @inner + */ + var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false); + + /** + * Maximum signed value. + * @type {!Long} + */ + Long.MAX_VALUE = MAX_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true); + + /** + * Maximum unsigned value. + * @type {!Long} + */ + Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MIN_VALUE = fromBits(0, 0x80000000|0, false); + + /** + * Minimum signed value. + * @type {!Long} + */ + Long.MIN_VALUE = MIN_VALUE; + + /** + * @alias Long.prototype + * @inner + */ + var LongPrototype = Long.prototype; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @returns {number} + */ + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @returns {number} + */ + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + + /** + * Converts the Long to a string written in the specified radix. + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { // Unsigned Longs are never negative + if (this.eq(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else + return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; + var result = ''; + while (true) { + var remDiv = rem.div(radixToPower), + intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, + digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) + return digits + result; + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + + /** + * Gets the high 32 bits as a signed integer. + * @returns {number} Signed high bits + */ + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + + /** + * Gets the high 32 bits as an unsigned integer. + * @returns {number} Unsigned high bits + */ + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + + /** + * Gets the low 32 bits as a signed integer. + * @returns {number} Signed low bits + */ + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + + /** + * Gets the low 32 bits as an unsigned integer. + * @returns {number} Unsigned low bits + */ + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + * @returns {number} + */ + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) // Unsigned Longs are never negative + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) != 0) + break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + + /** + * Tests if this Long's value equals zero. + * @returns {boolean} + */ + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + + /** + * Tests if this Long's value is negative. + * @returns {boolean} + */ + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + + /** + * Tests if this Long's value is positive. + * @returns {boolean} + */ + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + + /** + * Tests if this Long's value is odd. + * @returns {boolean} + */ + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + + /** + * Tests if this Long's value is even. + * @returns {boolean} + */ + LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; + }; + + /** + * Tests if this Long's value equals the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.equals = function equals(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + + /** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.eq = LongPrototype.equals; + + /** + * Tests if this Long's value differs from the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.notEquals = function notEquals(other) { + return !this.eq(/* validates */ other); + }; + + /** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.neq = LongPrototype.notEquals; + + /** + * Tests if this Long's value is less than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThan = function lessThan(other) { + return this.comp(/* validates */ other) < 0; + }; + + /** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lt = LongPrototype.lessThan; + + /** + * Tests if this Long's value is less than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(/* validates */ other) <= 0; + }; + + /** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lte = LongPrototype.lessThanOrEqual; + + /** + * Tests if this Long's value is greater than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(/* validates */ other) > 0; + }; + + /** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.gt = LongPrototype.greaterThan; + + /** + * Tests if this Long's value is greater than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(/* validates */ other) >= 0; + }; + + /** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + + /** + * Compares this Long's value with the specified's. + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.compare = function compare(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; + }; + + /** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.comp = LongPrototype.compare; + + /** + * Negates this Long's value. + * @returns {!Long} Negated Long + */ + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) + return MIN_VALUE; + return this.not().add(ONE); + }; + + /** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ + LongPrototype.neg = LongPrototype.negate; + + /** + * Returns the sum of this and the specified Long. + * @param {!Long|number|string} addend Addend + * @returns {!Long} Sum + */ + LongPrototype.add = function add(addend) { + if (!isLong(addend)) + addend = fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xFFFF; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 + b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the difference of this and the specified Long. + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) + subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + + /** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.sub = LongPrototype.subtract; + + /** + * Returns the product of this and the specified Long. + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) + return ZERO; + if (!isLong(multiplier)) + multiplier = fromValue(multiplier); + if (multiplier.isZero()) + return ZERO; + if (this.eq(MIN_VALUE)) + return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) + return this.isOdd() ? MIN_VALUE : ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xFFFF; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.mul = LongPrototype.multiply; + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + if (this.isZero()) + return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(MIN_VALUE)) + return ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) + return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return UZERO; + if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true + return UONE; + res = UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2), + delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), + + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + approxRes = fromNumber(approx), + approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + + /** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.div = LongPrototype.divide; + + /** + * Returns this Long modulo the specified. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + return this.sub(this.div(divisor).mul(divisor)); + }; + + /** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.mod = LongPrototype.modulo; + + /** + * Returns the bitwise NOT of this Long. + * @returns {!Long} + */ + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + + /** + * Returns the bitwise AND of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.and = function and(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + + /** + * Returns the bitwise OR of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.or = function or(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + + /** + * Returns the bitwise XOR of this Long and the given one. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.xor = function xor(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shl = LongPrototype.shiftLeft; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shr = LongPrototype.shiftRight; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } else if (numBits === 32) + return fromBits(high, 0, this.unsigned); + else + return fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + + /** + * Converts this Long to signed. + * @returns {!Long} Signed long + */ + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) + return this; + return fromBits(this.low, this.high, false); + }; + + /** + * Converts this Long to unsigned. + * @returns {!Long} Unsigned long + */ + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) + return this; + return fromBits(this.low, this.high, true); + }; + + /** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {!Array.} Byte representation + */ + LongPrototype.toBytes = function(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + + /** + * Converts this Long to its little endian byte representation. + * @returns {!Array.} Little endian byte representation + */ + LongPrototype.toBytesLE = function() { + var hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + (lo >>> 24) & 0xff, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + (hi >>> 24) & 0xff + ]; + }; + + /** + * Converts this Long to its big endian byte representation. + * @returns {!Array.} Big endian byte representation + */ + LongPrototype.toBytesBE = function() { + var hi = this.high, + lo = this.low; + return [ + (hi >>> 24) & 0xff, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + (lo >>> 24) & 0xff, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + + return Long; + }); + }); + + var bytebuffer = createCommonjsModule(function (module) { + /* + Copyright 2013-2014 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license bytebuffer.js (c) 2015 Daniel Wirtz + * Backing buffer: ArrayBuffer, Accessor: Uint8Array + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/bytebuffer.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined(["long"], factory); + /* CommonJS */ else if (typeof commonjsRequire === 'function' && 'object' === "object" && module && module["exports"]) + module['exports'] = (function() { + var Long; try { Long = long_1; } catch (e) {} + return factory(Long); + })(); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = factory(global["dcodeIO"]["Long"]); + + })(commonjsGlobal, function(Long) { + "use strict"; + + /** + * Constructs a new ByteBuffer. + * @class The swiss army knife for binary data in JavaScript. + * @exports ByteBuffer + * @constructor + * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}. + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @expose + */ + var ByteBuffer = function(capacity, littleEndian, noAssert) { + if (typeof capacity === 'undefined') + capacity = ByteBuffer.DEFAULT_CAPACITY; + if (typeof littleEndian === 'undefined') + littleEndian = ByteBuffer.DEFAULT_ENDIAN; + if (typeof noAssert === 'undefined') + noAssert = ByteBuffer.DEFAULT_NOASSERT; + if (!noAssert) { + capacity = capacity | 0; + if (capacity < 0) + throw RangeError("Illegal capacity"); + littleEndian = !!littleEndian; + noAssert = !!noAssert; + } + + /** + * Backing ArrayBuffer. + * @type {!ArrayBuffer} + * @expose + */ + this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity); + + /** + * Uint8Array utilized to manipulate the backing buffer. Becomes `null` if the backing buffer has a capacity of `0`. + * @type {?Uint8Array} + * @expose + */ + this.view = capacity === 0 ? null : new Uint8Array(this.buffer); + + /** + * Absolute read/write offset. + * @type {number} + * @expose + * @see ByteBuffer#flip + * @see ByteBuffer#clear + */ + this.offset = 0; + + /** + * Marked offset. + * @type {number} + * @expose + * @see ByteBuffer#mark + * @see ByteBuffer#reset + */ + this.markedOffset = -1; + + /** + * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation. + * @type {number} + * @expose + * @see ByteBuffer#flip + * @see ByteBuffer#clear + */ + this.limit = capacity; + + /** + * Whether to use little endian byte order, defaults to `false` for big endian. + * @type {boolean} + * @expose + */ + this.littleEndian = littleEndian; + + /** + * Whether to skip assertions of offsets and values, defaults to `false`. + * @type {boolean} + * @expose + */ + this.noAssert = noAssert; + }; + + /** + * ByteBuffer version. + * @type {string} + * @const + * @expose + */ + ByteBuffer.VERSION = "5.0.1"; + + /** + * Little endian constant that can be used instead of its boolean value. Evaluates to `true`. + * @type {boolean} + * @const + * @expose + */ + ByteBuffer.LITTLE_ENDIAN = true; + + /** + * Big endian constant that can be used instead of its boolean value. Evaluates to `false`. + * @type {boolean} + * @const + * @expose + */ + ByteBuffer.BIG_ENDIAN = false; + + /** + * Default initial capacity of `16`. + * @type {number} + * @expose + */ + ByteBuffer.DEFAULT_CAPACITY = 16; + + /** + * Default endianess of `false` for big endian. + * @type {boolean} + * @expose + */ + ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN; + + /** + * Default no assertions flag of `false`. + * @type {boolean} + * @expose + */ + ByteBuffer.DEFAULT_NOASSERT = false; + + /** + * A `Long` class for representing a 64-bit two's-complement integer value. May be `null` if Long.js has not been loaded + * and int64 support is not available. + * @type {?Long} + * @const + * @see https://github.com/dcodeIO/long.js + * @expose + */ + ByteBuffer.Long = Long || null; + + /** + * @alias ByteBuffer.prototype + * @inner + */ + var ByteBufferPrototype = ByteBuffer.prototype; + + /** + * An indicator used to reliably determine if an object is a ByteBuffer or not. + * @type {boolean} + * @const + * @expose + * @private + */ + ByteBufferPrototype.__isByteBuffer__; + + Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", { + value: true, + enumerable: false, + configurable: false + }); + + // helpers + + /** + * @type {!ArrayBuffer} + * @inner + */ + var EMPTY_BUFFER = new ArrayBuffer(0); + + /** + * String.fromCharCode reference for compile-time renaming. + * @type {function(...number):string} + * @inner + */ + var stringFromCharCode = String.fromCharCode; + + /** + * Creates a source function for a string. + * @param {string} s String to read from + * @returns {function():number|null} Source function returning the next char code respectively `null` if there are + * no more characters left. + * @throws {TypeError} If the argument is invalid + * @inner + */ + function stringSource(s) { + var i=0; return function() { + return i < s.length ? s.charCodeAt(i++) : null; + }; + } + + /** + * Creates a destination function for a string. + * @returns {function(number=):undefined|string} Destination function successively called with the next char code. + * Returns the final string when called without arguments. + * @inner + */ + function stringDestination() { + var cs = [], ps = []; return function() { + if (arguments.length === 0) + return ps.join('')+stringFromCharCode.apply(String, cs); + if (cs.length + arguments.length > 1024) + ps.push(stringFromCharCode.apply(String, cs)), + cs.length = 0; + Array.prototype.push.apply(cs, arguments); + }; + } + + /** + * Gets the accessor type. + * @returns {Function} `Buffer` under node.js, `Uint8Array` respectively `DataView` in the browser (classes) + * @expose + */ + ByteBuffer.accessor = function() { + return Uint8Array; + }; + /** + * Allocates a new ByteBuffer backed by a buffer of the specified capacity. + * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}. + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} + * @expose + */ + ByteBuffer.allocate = function(capacity, littleEndian, noAssert) { + return new ByteBuffer(capacity, littleEndian, noAssert); + }; + + /** + * Concatenates multiple ByteBuffers into one. + * @param {!Array.} buffers Buffers to concatenate + * @param {(string|boolean)=} encoding String encoding if `buffers` contains a string ("base64", "hex", "binary", + * defaults to "utf8") + * @param {boolean=} littleEndian Whether to use little or big endian byte order for the resulting ByteBuffer. Defaults + * to {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values for the resulting ByteBuffer. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} Concatenated ByteBuffer + * @expose + */ + ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) { + if (typeof encoding === 'boolean' || typeof encoding !== 'string') { + noAssert = littleEndian; + littleEndian = encoding; + encoding = undefined; + } + var capacity = 0; + for (var i=0, k=buffers.length, length; i 0) capacity += length; + } + if (capacity === 0) + return new ByteBuffer(0, littleEndian, noAssert); + var bb = new ByteBuffer(capacity, littleEndian, noAssert), + bi; + i=0; while (i} buffer Anything that can be wrapped + * @param {(string|boolean)=} encoding String encoding if `buffer` is a string ("base64", "hex", "binary", defaults to + * "utf8") + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} A ByteBuffer wrapping `buffer` + * @expose + */ + ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) { + if (typeof encoding !== 'string') { + noAssert = littleEndian; + littleEndian = encoding; + encoding = undefined; + } + if (typeof buffer === 'string') { + if (typeof encoding === 'undefined') + encoding = "utf8"; + switch (encoding) { + case "base64": + return ByteBuffer.fromBase64(buffer, littleEndian); + case "hex": + return ByteBuffer.fromHex(buffer, littleEndian); + case "binary": + return ByteBuffer.fromBinary(buffer, littleEndian); + case "utf8": + return ByteBuffer.fromUTF8(buffer, littleEndian); + case "debug": + return ByteBuffer.fromDebug(buffer, littleEndian); + default: + throw Error("Unsupported encoding: "+encoding); + } + } + if (buffer === null || typeof buffer !== 'object') + throw TypeError("Illegal buffer"); + var bb; + if (ByteBuffer.isByteBuffer(buffer)) { + bb = ByteBufferPrototype.clone.call(buffer); + bb.markedOffset = -1; + return bb; + } + if (buffer instanceof Uint8Array) { // Extract ArrayBuffer from Uint8Array + bb = new ByteBuffer(0, littleEndian, noAssert); + if (buffer.length > 0) { // Avoid references to more than one EMPTY_BUFFER + bb.buffer = buffer.buffer; + bb.offset = buffer.byteOffset; + bb.limit = buffer.byteOffset + buffer.byteLength; + bb.view = new Uint8Array(buffer.buffer); + } + } else if (buffer instanceof ArrayBuffer) { // Reuse ArrayBuffer + bb = new ByteBuffer(0, littleEndian, noAssert); + if (buffer.byteLength > 0) { + bb.buffer = buffer; + bb.offset = 0; + bb.limit = buffer.byteLength; + bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null; + } + } else if (Object.prototype.toString.call(buffer) === "[object Array]") { // Create from octets + bb = new ByteBuffer(buffer.length, littleEndian, noAssert); + bb.limit = buffer.length; + for (var i=0; i} value Array of booleans to write + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {!ByteBuffer} + * @expose + */ + ByteBufferPrototype.writeBitSet = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (!(value instanceof Array)) + throw TypeError("Illegal BitSet: Not an array"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + + var start = offset, + bits = value.length, + bytes = (bits >> 3), + bit = 0, + k; + + offset += this.writeVarint32(bits,offset); + + while(bytes--) { + k = (!!value[bit++] & 1) | + ((!!value[bit++] & 1) << 1) | + ((!!value[bit++] & 1) << 2) | + ((!!value[bit++] & 1) << 3) | + ((!!value[bit++] & 1) << 4) | + ((!!value[bit++] & 1) << 5) | + ((!!value[bit++] & 1) << 6) | + ((!!value[bit++] & 1) << 7); + this.writeByte(k,offset++); + } + + if(bit < bits) { + var m = 0; k = 0; + while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++)); + this.writeByte(k,offset++); + } + + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a BitSet as an array of booleans. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {Array + * @expose + */ + ByteBufferPrototype.readBitSet = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + + var ret = this.readVarint32(offset), + bits = ret.value, + bytes = (bits >> 3), + bit = 0, + value = [], + k; + + offset += ret.length; + + while(bytes--) { + k = this.readByte(offset++); + value[bit++] = !!(k & 0x01); + value[bit++] = !!(k & 0x02); + value[bit++] = !!(k & 0x04); + value[bit++] = !!(k & 0x08); + value[bit++] = !!(k & 0x10); + value[bit++] = !!(k & 0x20); + value[bit++] = !!(k & 0x40); + value[bit++] = !!(k & 0x80); + } + + if(bit < bits) { + var m = 0; + k = this.readByte(offset++); + while(bit < bits) value[bit++] = !!((k >> (m++)) & 1); + } + + if (relative) { + this.offset = offset; + } + return value; + }; + /** + * Reads the specified number of bytes. + * @param {number} length Number of bytes to read + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {!ByteBuffer} + * @expose + */ + ByteBufferPrototype.readBytes = function(length, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + length > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength); + } + var slice = this.slice(offset, offset + length); + if (relative) this.offset += length; + return slice; + }; + + /** + * Writes a payload of bytes. This is an alias of {@link ByteBuffer#append}. + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to write. If `source` is a ByteBuffer, its offsets + * will be modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeBytes = ByteBufferPrototype.append; + + // types/ints/int8 + + /** + * Writes an 8bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeInt8 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 1; + var capacity0 = this.buffer.byteLength; + if (offset > capacity0) + this.resize((capacity0 *= 2) > offset ? capacity0 : offset); + offset -= 1; + this.view[offset] = value; + if (relative) this.offset += 1; + return this; + }; + + /** + * Writes an 8bit signed integer. This is an alias of {@link ByteBuffer#writeInt8}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8; + + /** + * Reads an 8bit signed integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt8 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var value = this.view[offset]; + if ((value & 0x80) === 0x80) value = -(0xFF - value + 1); // Cast to signed + if (relative) this.offset += 1; + return value; + }; + + /** + * Reads an 8bit signed integer. This is an alias of {@link ByteBuffer#readInt8}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8; + + /** + * Writes an 8bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUint8 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 1; + var capacity1 = this.buffer.byteLength; + if (offset > capacity1) + this.resize((capacity1 *= 2) > offset ? capacity1 : offset); + offset -= 1; + this.view[offset] = value; + if (relative) this.offset += 1; + return this; + }; + + /** + * Writes an 8bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint8}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8; + + /** + * Reads an 8bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUint8 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var value = this.view[offset]; + if (relative) this.offset += 1; + return value; + }; + + /** + * Reads an 8bit unsigned integer. This is an alias of {@link ByteBuffer#readUint8}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8; + + // types/ints/int16 + + /** + * Writes a 16bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeInt16 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 2; + var capacity2 = this.buffer.byteLength; + if (offset > capacity2) + this.resize((capacity2 *= 2) > offset ? capacity2 : offset); + offset -= 2; + if (this.littleEndian) { + this.view[offset+1] = (value & 0xFF00) >>> 8; + this.view[offset ] = value & 0x00FF; + } else { + this.view[offset] = (value & 0xFF00) >>> 8; + this.view[offset+1] = value & 0x00FF; + } + if (relative) this.offset += 2; + return this; + }; + + /** + * Writes a 16bit signed integer. This is an alias of {@link ByteBuffer#writeInt16}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16; + + /** + * Reads a 16bit signed integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readInt16 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 2 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset ]; + value |= this.view[offset+1] << 8; + } else { + value = this.view[offset ] << 8; + value |= this.view[offset+1]; + } + if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1); // Cast to signed + if (relative) this.offset += 2; + return value; + }; + + /** + * Reads a 16bit signed integer. This is an alias of {@link ByteBuffer#readInt16}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16; + + /** + * Writes a 16bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeUint16 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 2; + var capacity3 = this.buffer.byteLength; + if (offset > capacity3) + this.resize((capacity3 *= 2) > offset ? capacity3 : offset); + offset -= 2; + if (this.littleEndian) { + this.view[offset+1] = (value & 0xFF00) >>> 8; + this.view[offset ] = value & 0x00FF; + } else { + this.view[offset] = (value & 0xFF00) >>> 8; + this.view[offset+1] = value & 0x00FF; + } + if (relative) this.offset += 2; + return this; + }; + + /** + * Writes a 16bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint16}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16; + + /** + * Reads a 16bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readUint16 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 2 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset ]; + value |= this.view[offset+1] << 8; + } else { + value = this.view[offset ] << 8; + value |= this.view[offset+1]; + } + if (relative) this.offset += 2; + return value; + }; + + /** + * Reads a 16bit unsigned integer. This is an alias of {@link ByteBuffer#readUint16}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16; + + // types/ints/int32 + + /** + * Writes a 32bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeInt32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity4 = this.buffer.byteLength; + if (offset > capacity4) + this.resize((capacity4 *= 2) > offset ? capacity4 : offset); + offset -= 4; + if (this.littleEndian) { + this.view[offset+3] = (value >>> 24) & 0xFF; + this.view[offset+2] = (value >>> 16) & 0xFF; + this.view[offset+1] = (value >>> 8) & 0xFF; + this.view[offset ] = value & 0xFF; + } else { + this.view[offset ] = (value >>> 24) & 0xFF; + this.view[offset+1] = (value >>> 16) & 0xFF; + this.view[offset+2] = (value >>> 8) & 0xFF; + this.view[offset+3] = value & 0xFF; + } + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit signed integer. This is an alias of {@link ByteBuffer#writeInt32}. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32; + + /** + * Reads a 32bit signed integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset+2] << 16; + value |= this.view[offset+1] << 8; + value |= this.view[offset ]; + value += this.view[offset+3] << 24 >>> 0; + } else { + value = this.view[offset+1] << 16; + value |= this.view[offset+2] << 8; + value |= this.view[offset+3]; + value += this.view[offset ] << 24 >>> 0; + } + value |= 0; // Cast to signed + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit signed integer. This is an alias of {@link ByteBuffer#readInt32}. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32; + + /** + * Writes a 32bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeUint32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity5 = this.buffer.byteLength; + if (offset > capacity5) + this.resize((capacity5 *= 2) > offset ? capacity5 : offset); + offset -= 4; + if (this.littleEndian) { + this.view[offset+3] = (value >>> 24) & 0xFF; + this.view[offset+2] = (value >>> 16) & 0xFF; + this.view[offset+1] = (value >>> 8) & 0xFF; + this.view[offset ] = value & 0xFF; + } else { + this.view[offset ] = (value >>> 24) & 0xFF; + this.view[offset+1] = (value >>> 16) & 0xFF; + this.view[offset+2] = (value >>> 8) & 0xFF; + this.view[offset+3] = value & 0xFF; + } + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint32}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32; + + /** + * Reads a 32bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUint32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset+2] << 16; + value |= this.view[offset+1] << 8; + value |= this.view[offset ]; + value += this.view[offset+3] << 24 >>> 0; + } else { + value = this.view[offset+1] << 16; + value |= this.view[offset+2] << 8; + value |= this.view[offset+3]; + value += this.view[offset ] << 24 >>> 0; + } + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit unsigned integer. This is an alias of {@link ByteBuffer#readUint32}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32; + + // types/ints/int64 + + if (Long) { + + /** + * Writes a 64bit signed integer. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeInt64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + offset += 8; + var capacity6 = this.buffer.byteLength; + if (offset > capacity6) + this.resize((capacity6 *= 2) > offset ? capacity6 : offset); + offset -= 8; + var lo = value.low, + hi = value.high; + if (this.littleEndian) { + this.view[offset+3] = (lo >>> 24) & 0xFF; + this.view[offset+2] = (lo >>> 16) & 0xFF; + this.view[offset+1] = (lo >>> 8) & 0xFF; + this.view[offset ] = lo & 0xFF; + offset += 4; + this.view[offset+3] = (hi >>> 24) & 0xFF; + this.view[offset+2] = (hi >>> 16) & 0xFF; + this.view[offset+1] = (hi >>> 8) & 0xFF; + this.view[offset ] = hi & 0xFF; + } else { + this.view[offset ] = (hi >>> 24) & 0xFF; + this.view[offset+1] = (hi >>> 16) & 0xFF; + this.view[offset+2] = (hi >>> 8) & 0xFF; + this.view[offset+3] = hi & 0xFF; + offset += 4; + this.view[offset ] = (lo >>> 24) & 0xFF; + this.view[offset+1] = (lo >>> 16) & 0xFF; + this.view[offset+2] = (lo >>> 8) & 0xFF; + this.view[offset+3] = lo & 0xFF; + } + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit signed integer. This is an alias of {@link ByteBuffer#writeInt64}. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64; + + /** + * Reads a 64bit signed integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readInt64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var lo = 0, + hi = 0; + if (this.littleEndian) { + lo = this.view[offset+2] << 16; + lo |= this.view[offset+1] << 8; + lo |= this.view[offset ]; + lo += this.view[offset+3] << 24 >>> 0; + offset += 4; + hi = this.view[offset+2] << 16; + hi |= this.view[offset+1] << 8; + hi |= this.view[offset ]; + hi += this.view[offset+3] << 24 >>> 0; + } else { + hi = this.view[offset+1] << 16; + hi |= this.view[offset+2] << 8; + hi |= this.view[offset+3]; + hi += this.view[offset ] << 24 >>> 0; + offset += 4; + lo = this.view[offset+1] << 16; + lo |= this.view[offset+2] << 8; + lo |= this.view[offset+3]; + lo += this.view[offset ] << 24 >>> 0; + } + var value = new Long(lo, hi, false); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit signed integer. This is an alias of {@link ByteBuffer#readInt64}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64; + + /** + * Writes a 64bit unsigned integer. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUint64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + offset += 8; + var capacity7 = this.buffer.byteLength; + if (offset > capacity7) + this.resize((capacity7 *= 2) > offset ? capacity7 : offset); + offset -= 8; + var lo = value.low, + hi = value.high; + if (this.littleEndian) { + this.view[offset+3] = (lo >>> 24) & 0xFF; + this.view[offset+2] = (lo >>> 16) & 0xFF; + this.view[offset+1] = (lo >>> 8) & 0xFF; + this.view[offset ] = lo & 0xFF; + offset += 4; + this.view[offset+3] = (hi >>> 24) & 0xFF; + this.view[offset+2] = (hi >>> 16) & 0xFF; + this.view[offset+1] = (hi >>> 8) & 0xFF; + this.view[offset ] = hi & 0xFF; + } else { + this.view[offset ] = (hi >>> 24) & 0xFF; + this.view[offset+1] = (hi >>> 16) & 0xFF; + this.view[offset+2] = (hi >>> 8) & 0xFF; + this.view[offset+3] = hi & 0xFF; + offset += 4; + this.view[offset ] = (lo >>> 24) & 0xFF; + this.view[offset+1] = (lo >>> 16) & 0xFF; + this.view[offset+2] = (lo >>> 8) & 0xFF; + this.view[offset+3] = lo & 0xFF; + } + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint64}. + * @function + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64; + + /** + * Reads a 64bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readUint64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var lo = 0, + hi = 0; + if (this.littleEndian) { + lo = this.view[offset+2] << 16; + lo |= this.view[offset+1] << 8; + lo |= this.view[offset ]; + lo += this.view[offset+3] << 24 >>> 0; + offset += 4; + hi = this.view[offset+2] << 16; + hi |= this.view[offset+1] << 8; + hi |= this.view[offset ]; + hi += this.view[offset+3] << 24 >>> 0; + } else { + hi = this.view[offset+1] << 16; + hi |= this.view[offset+2] << 8; + hi |= this.view[offset+3]; + hi += this.view[offset ] << 24 >>> 0; + offset += 4; + lo = this.view[offset+1] << 16; + lo |= this.view[offset+2] << 8; + lo |= this.view[offset+3]; + lo += this.view[offset ] << 24 >>> 0; + } + var value = new Long(lo, hi, true); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit unsigned integer. This is an alias of {@link ByteBuffer#readUint64}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64; + + } // Long + + + // types/floats/float32 + + /* + ieee754 - https://github.com/feross/ieee754 + + The MIT License (MIT) + + Copyright (c) Feross Aboukhadijeh + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + + /** + * Reads an IEEE754 float from a byte array. + * @param {!Array} buffer + * @param {number} offset + * @param {boolean} isLE + * @param {number} mLen + * @param {number} nBytes + * @returns {number} + * @inner + */ + function ieee754_read(buffer, offset, isLE, mLen, nBytes) { + var e, m, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + nBits = -7, + i = isLE ? (nBytes - 1) : 0, + d = isLE ? -1 : 1, + s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity); + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + } + + /** + * Writes an IEEE754 float to a byte array. + * @param {!Array} buffer + * @param {number} value + * @param {number} offset + * @param {boolean} isLE + * @param {number} mLen + * @param {number} nBytes + * @inner + */ + function ieee754_write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), + i = isLE ? 0 : (nBytes - 1), + d = isLE ? 1 : -1, + s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + } + + /** + * Writes a 32bit float. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number') + throw TypeError("Illegal value: "+value+" (not a number)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity8 = this.buffer.byteLength; + if (offset > capacity8) + this.resize((capacity8 *= 2) > offset ? capacity8 : offset); + offset -= 4; + ieee754_write(this.view, value, offset, this.littleEndian, 23, 4); + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit float. This is an alias of {@link ByteBuffer#writeFloat32}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32; + + /** + * Reads a 32bit float. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4); + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit float. This is an alias of {@link ByteBuffer#readFloat32}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32; + + // types/floats/float64 + + /** + * Writes a 64bit float. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number') + throw TypeError("Illegal value: "+value+" (not a number)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 8; + var capacity9 = this.buffer.byteLength; + if (offset > capacity9) + this.resize((capacity9 *= 2) > offset ? capacity9 : offset); + offset -= 8; + ieee754_write(this.view, value, offset, this.littleEndian, 52, 8); + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit float. This is an alias of {@link ByteBuffer#writeFloat64}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64; + + /** + * Reads a 64bit float. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit float. This is an alias of {@link ByteBuffer#readFloat64}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64; + + + // types/varints/varint32 + + /** + * Maximum number of bytes required to store a 32bit base 128 variable-length integer. + * @type {number} + * @const + * @expose + */ + ByteBuffer.MAX_VARINT32_BYTES = 5; + + /** + * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer. + * @param {number} value Value to encode + * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT32_BYTES} + * @expose + */ + ByteBuffer.calculateVarint32 = function(value) { + // ref: src/google/protobuf/io/coded_stream.cc + value = value >>> 0; + if (value < 1 << 7 ) return 1; + else if (value < 1 << 14) return 2; + else if (value < 1 << 21) return 3; + else if (value < 1 << 28) return 4; + else return 5; + }; + + /** + * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding. + * @param {number} n Signed 32bit integer + * @returns {number} Unsigned zigzag encoded 32bit integer + * @expose + */ + ByteBuffer.zigZagEncode32 = function(n) { + return (((n |= 0) << 1) ^ (n >> 31)) >>> 0; // ref: src/google/protobuf/wire_format_lite.h + }; + + /** + * Decodes a zigzag encoded signed 32bit integer. + * @param {number} n Unsigned zigzag encoded 32bit integer + * @returns {number} Signed 32bit integer + * @expose + */ + ByteBuffer.zigZagDecode32 = function(n) { + return ((n >>> 1) ^ -(n & 1)) | 0; // // ref: src/google/protobuf/wire_format_lite.h + }; + + /** + * Writes a 32bit base 128 variable-length integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeVarint32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var size = ByteBuffer.calculateVarint32(value), + b; + offset += size; + var capacity10 = this.buffer.byteLength; + if (offset > capacity10) + this.resize((capacity10 *= 2) > offset ? capacity10 : offset); + offset -= size; + value >>>= 0; + while (value >= 0x80) { + b = (value & 0x7f) | 0x80; + this.view[offset++] = b; + value >>>= 7; + } + this.view[offset++] = value; + if (relative) { + this.offset = offset; + return this; + } + return size; + }; + + /** + * Writes a zig-zag encoded (signed) 32bit base 128 variable-length integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) { + return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset); + }; + + /** + * Reads a 32bit base 128 variable-length integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read + * and the actual number of bytes read. + * @throws {Error} If it's not a valid varint. Has a property `truncated = true` if there is not enough data available + * to fully decode the varint. + * @expose + */ + ByteBufferPrototype.readVarint32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var c = 0, + value = 0 >>> 0, + b; + do { + if (!this.noAssert && offset > this.limit) { + var err = Error("Truncated"); + err['truncated'] = true; + throw err; + } + b = this.view[offset++]; + if (c < 5) + value |= (b & 0x7f) << (7*c); + ++c; + } while ((b & 0x80) !== 0); + value |= 0; + if (relative) { + this.offset = offset; + return value; + } + return { + "value": value, + "length": c + }; + }; + + /** + * Reads a zig-zag encoded (signed) 32bit base 128 variable-length integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read + * and the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint32ZigZag = function(offset) { + var val = this.readVarint32(offset); + if (typeof val === 'object') + val["value"] = ByteBuffer.zigZagDecode32(val["value"]); + else + val = ByteBuffer.zigZagDecode32(val); + return val; + }; + + // types/varints/varint64 + + if (Long) { + + /** + * Maximum number of bytes required to store a 64bit base 128 variable-length integer. + * @type {number} + * @const + * @expose + */ + ByteBuffer.MAX_VARINT64_BYTES = 10; + + /** + * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer. + * @param {number|!Long} value Value to encode + * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT64_BYTES} + * @expose + */ + ByteBuffer.calculateVarint64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + // ref: src/google/protobuf/io/coded_stream.cc + var part0 = value.toInt() >>> 0, + part1 = value.shiftRightUnsigned(28).toInt() >>> 0, + part2 = value.shiftRightUnsigned(56).toInt() >>> 0; + if (part2 == 0) { + if (part1 == 0) { + if (part0 < 1 << 14) + return part0 < 1 << 7 ? 1 : 2; + else + return part0 < 1 << 21 ? 3 : 4; + } else { + if (part1 < 1 << 14) + return part1 < 1 << 7 ? 5 : 6; + else + return part1 < 1 << 21 ? 7 : 8; + } + } else + return part2 < 1 << 7 ? 9 : 10; + }; + + /** + * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding. + * @param {number|!Long} value Signed long + * @returns {!Long} Unsigned zigzag encoded long + * @expose + */ + ByteBuffer.zigZagEncode64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + // ref: src/google/protobuf/wire_format_lite.h + return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned(); + }; + + /** + * Decodes a zigzag encoded signed 64bit integer. + * @param {!Long|number} value Unsigned zigzag encoded long or JavaScript number + * @returns {!Long} Signed long + * @expose + */ + ByteBuffer.zigZagDecode64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + // ref: src/google/protobuf/wire_format_lite.h + return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned(); + }; + + /** + * Writes a 64bit base 128 variable-length integer. + * @param {number|Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeVarint64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + var size = ByteBuffer.calculateVarint64(value), + part0 = value.toInt() >>> 0, + part1 = value.shiftRightUnsigned(28).toInt() >>> 0, + part2 = value.shiftRightUnsigned(56).toInt() >>> 0; + offset += size; + var capacity11 = this.buffer.byteLength; + if (offset > capacity11) + this.resize((capacity11 *= 2) > offset ? capacity11 : offset); + offset -= size; + switch (size) { + case 10: this.view[offset+9] = (part2 >>> 7) & 0x01; + case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F; + case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F; + case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F; + case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F; + case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F; + case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F; + case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F; + case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F; + case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F; + } + if (relative) { + this.offset += size; + return this; + } else { + return size; + } + }; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer. + * @param {number|Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) { + return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset); + }; + + /** + * Reads a 64bit base 128 variable-length integer. Requires Long.js. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and + * the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + // ref: src/google/protobuf/io/coded_stream.cc + var start = offset, + part0 = 0, + part1 = 0, + part2 = 0, + b = 0; + b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + throw Error("Buffer overrun"); }}}}}}}}}} + var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false); + if (relative) { + this.offset = offset; + return value; + } else { + return { + 'value': value, + 'length': offset-start + }; + } + }; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and + * the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint64ZigZag = function(offset) { + var val = this.readVarint64(offset); + if (val && val['value'] instanceof Long) + val["value"] = ByteBuffer.zigZagDecode64(val["value"]); + else + val = ByteBuffer.zigZagDecode64(val); + return val; + }; + + } // Long + + + // types/strings/cstring + + /** + * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL + * characters itself. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * contained in `str` + 1 if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeCString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + var i, + k = str.length; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + for (i=0; i>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + // UTF8 strings do not contain zero bytes in between except for the zero character, so: + k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; + offset += k+1; + var capacity12 = this.buffer.byteLength; + if (offset > capacity12) + this.resize((capacity12 *= 2) > offset ? capacity12 : offset); + offset -= k+1; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + this.view[offset++] = 0; + if (relative) { + this.offset = offset; + return this; + } + return k; + }; + + /** + * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters + * itself. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readCString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var start = offset, + temp; + // UTF8 strings do not contain zero bytes in between except for the zero character itself, so: + var sd, b = -1; + utfx.decodeUTF8toUTF16(function() { + if (b === 0) return null; + if (offset >= this.limit) + throw RangeError("Illegal range: Truncated data, "+offset+" < "+this.limit); + b = this.view[offset++]; + return b === 0 ? null : b; + }.bind(this), sd = stringDestination(), true); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + "string": sd(), + "length": offset - start + }; + } + }; + + // types/strings/istring + + /** + * Writes a length as uint32 prefixed UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written + * @expose + * @see ByteBuffer#writeVarint32 + */ + ByteBufferPrototype.writeIString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var start = offset, + k; + k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1]; + offset += 4+k; + var capacity13 = this.buffer.byteLength; + if (offset > capacity13) + this.resize((capacity13 *= 2) > offset ? capacity13 : offset); + offset -= 4+k; + if (this.littleEndian) { + this.view[offset+3] = (k >>> 24) & 0xFF; + this.view[offset+2] = (k >>> 16) & 0xFF; + this.view[offset+1] = (k >>> 8) & 0xFF; + this.view[offset ] = k & 0xFF; + } else { + this.view[offset ] = (k >>> 24) & 0xFF; + this.view[offset+1] = (k >>> 16) & 0xFF; + this.view[offset+2] = (k >>> 8) & 0xFF; + this.view[offset+3] = k & 0xFF; + } + offset += 4; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (offset !== start + 4 + k) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+4+k)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a length as uint32 prefixed UTF8 encoded string. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + * @see ByteBuffer#readVarint32 + */ + ByteBufferPrototype.readIString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var start = offset; + var len = this.readUint32(offset); + var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4); + offset += str['length']; + if (relative) { + this.offset = offset; + return str['string']; + } else { + return { + 'string': str['string'], + 'length': offset - start + }; + } + }; + + // types/strings/utf8string + + /** + * Metrics representing number of UTF8 characters. Evaluates to `c`. + * @type {string} + * @const + * @expose + */ + ByteBuffer.METRICS_CHARS = 'c'; + + /** + * Metrics representing number of bytes. Evaluates to `b`. + * @type {string} + * @const + * @expose + */ + ByteBuffer.METRICS_BYTES = 'b'; + + /** + * Writes an UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeUTF8String = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var k; + var start = offset; + k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; + offset += k; + var capacity14 = this.buffer.byteLength; + if (offset > capacity14) + this.resize((capacity14 *= 2) > offset ? capacity14 : offset); + offset -= k; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Writes an UTF8 encoded string. This is an alias of {@link ByteBuffer#writeUTF8String}. + * @function + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String; + + /** + * Calculates the number of UTF8 characters of a string. JavaScript itself uses UTF-16, so that a string's + * `length` property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF. + * @param {string} str String to calculate + * @returns {number} Number of UTF8 characters + * @expose + */ + ByteBuffer.calculateUTF8Chars = function(str) { + return utfx.calculateUTF16asUTF8(stringSource(str))[0]; + }; + + /** + * Calculates the number of UTF8 bytes of a string. + * @param {string} str String to calculate + * @returns {number} Number of UTF8 bytes + * @expose + */ + ByteBuffer.calculateUTF8Bytes = function(str) { + return utfx.calculateUTF16asUTF8(stringSource(str))[1]; + }; + + /** + * Calculates the number of UTF8 bytes of a string. This is an alias of {@link ByteBuffer.calculateUTF8Bytes}. + * @function + * @param {string} str String to calculate + * @returns {number} Number of UTF8 bytes + * @expose + */ + ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes; + + /** + * Reads an UTF8 encoded string. + * @param {number} length Number of characters or bytes to read. + * @param {string=} metrics Metrics specifying what `length` is meant to count. Defaults to + * {@link ByteBuffer.METRICS_CHARS}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readUTF8String = function(length, metrics, offset) { + if (typeof metrics === 'number') { + offset = metrics; + metrics = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS; + if (!this.noAssert) { + if (typeof length !== 'number' || length % 1 !== 0) + throw TypeError("Illegal length: "+length+" (not an integer)"); + length |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var i = 0, + start = offset, + sd; + if (metrics === ByteBuffer.METRICS_CHARS) { // The same for node and the browser + sd = stringDestination(); + utfx.decodeUTF8(function() { + return i < length && offset < this.limit ? this.view[offset++] : null; + }.bind(this), function(cp) { + ++i; utfx.UTF8toUTF16(cp, sd); + }); + if (i !== length) + throw RangeError("Illegal range: Truncated data, "+i+" == "+length); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + "string": sd(), + "length": offset - start + }; + } + } else if (metrics === ByteBuffer.METRICS_BYTES) { + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + length > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength); + } + var k = offset + length; + utfx.decodeUTF8toUTF16(function() { + return offset < k ? this.view[offset++] : null; + }.bind(this), sd = stringDestination(), this.noAssert); + if (offset !== k) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+k); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + 'string': sd(), + 'length': offset - start + }; + } + } else + throw TypeError("Unsupported metrics: "+metrics); + }; + + /** + * Reads an UTF8 encoded string. This is an alias of {@link ByteBuffer#readUTF8String}. + * @function + * @param {number} length Number of characters or bytes to read + * @param {number=} metrics Metrics specifying what `n` is meant to count. Defaults to + * {@link ByteBuffer.METRICS_CHARS}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String; + + // types/strings/vstring + + /** + * Writes a length as varint32 prefixed UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written + * @expose + * @see ByteBuffer#writeVarint32 + */ + ByteBufferPrototype.writeVString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var start = offset, + k, l; + k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1]; + l = ByteBuffer.calculateVarint32(k); + offset += l+k; + var capacity15 = this.buffer.byteLength; + if (offset > capacity15) + this.resize((capacity15 *= 2) > offset ? capacity15 : offset); + offset -= l+k; + offset += this.writeVarint32(k, offset); + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (offset !== start+k+l) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+k+l)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + * @see ByteBuffer#readVarint32 + */ + ByteBufferPrototype.readVString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var start = offset; + var len = this.readVarint32(offset); + var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']); + offset += str['length']; + if (relative) { + this.offset = offset; + return str['string']; + } else { + return { + 'string': str['string'], + 'length': offset - start + }; + } + }; + + + /** + * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended + * data's length. + * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to append. If `source` is a ByteBuffer, its offsets + * will be modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to append at. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer} this + * @expose + * @example A relative `<01 02>03.append(<04 05>)` will result in `<01 02 04 05>, 04 05|` + * @example An absolute `<01 02>03.append(04 05>, 1)` will result in `<01 04>05, 04 05|` + */ + ByteBufferPrototype.append = function(source, encoding, offset) { + if (typeof encoding === 'number' || typeof encoding !== 'string') { + offset = encoding; + encoding = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (!(source instanceof ByteBuffer)) + source = ByteBuffer.wrap(source, encoding); + var length = source.limit - source.offset; + if (length <= 0) return this; // Nothing to append + offset += length; + var capacity16 = this.buffer.byteLength; + if (offset > capacity16) + this.resize((capacity16 *= 2) > offset ? capacity16 : offset); + offset -= length; + this.view.set(source.view.subarray(source.offset, source.limit), offset); + source.offset += length; + if (relative) this.offset += length; + return this; + }; + + /** + * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the + specified offset up to the length of this ByteBuffer's data. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!ByteBuffer} this + * @expose + * @see ByteBuffer#append + */ + ByteBufferPrototype.appendTo = function(target, offset) { + target.append(this, offset); + return this; + }; + + /** + * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to + * disable them if your code already makes sure that everything is valid. + * @param {boolean} assert `true` to enable assertions, otherwise `false` + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.assert = function(assert) { + this.noAssert = !assert; + return this; + }; + + /** + * Gets the capacity of this ByteBuffer's backing buffer. + * @returns {number} Capacity of the backing buffer + * @expose + */ + ByteBufferPrototype.capacity = function() { + return this.buffer.byteLength; + }; + /** + * Clears this ByteBuffer's offsets by setting {@link ByteBuffer#offset} to `0` and {@link ByteBuffer#limit} to the + * backing buffer's capacity. Discards {@link ByteBuffer#markedOffset}. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.clear = function() { + this.offset = 0; + this.limit = this.buffer.byteLength; + this.markedOffset = -1; + return this; + }; + + /** + * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for {@link ByteBuffer#offset}, + * {@link ByteBuffer#markedOffset} and {@link ByteBuffer#limit}. + * @param {boolean=} copy Whether to copy the backing buffer or to return another view on the same, defaults to `false` + * @returns {!ByteBuffer} Cloned instance + * @expose + */ + ByteBufferPrototype.clone = function(copy) { + var bb = new ByteBuffer(0, this.littleEndian, this.noAssert); + if (copy) { + bb.buffer = new ArrayBuffer(this.buffer.byteLength); + bb.view = new Uint8Array(bb.buffer); + } else { + bb.buffer = this.buffer; + bb.view = this.view; + } + bb.offset = this.offset; + bb.markedOffset = this.markedOffset; + bb.limit = this.limit; + return bb; + }; + + /** + * Compacts this ByteBuffer to be backed by a {@link ByteBuffer#buffer} of its contents' length. Contents are the bytes + * between {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will set `offset = 0` and `limit = capacity` and + * adapt {@link ByteBuffer#markedOffset} to the same relative position if set. + * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.compact = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === 0 && end === this.buffer.byteLength) + return this; // Already compacted + var len = end - begin; + if (len === 0) { + this.buffer = EMPTY_BUFFER; + this.view = null; + if (this.markedOffset >= 0) this.markedOffset -= begin; + this.offset = 0; + this.limit = 0; + return this; + } + var buffer = new ArrayBuffer(len); + var view = new Uint8Array(buffer); + view.set(this.view.subarray(begin, end)); + this.buffer = buffer; + this.view = view; + if (this.markedOffset >= 0) this.markedOffset -= begin; + this.offset = 0; + this.limit = len; + return this; + }; + + /** + * Creates a copy of this ByteBuffer's contents. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}. + * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} Copy + * @expose + */ + ByteBufferPrototype.copy = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === end) + return new ByteBuffer(0, this.littleEndian, this.noAssert); + var capacity = end - begin, + bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert); + bb.offset = 0; + bb.limit = capacity; + if (bb.markedOffset >= 0) bb.markedOffset -= begin; + this.copyTo(bb, 0, begin, end); + return bb; + }; + + /** + * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} targetOffset Offset to copy to. Will use and increase the target's {@link ByteBuffer#offset} + * by the number of bytes copied if omitted. + * @param {number=} sourceOffset Offset to start copying from. Will use and increase {@link ByteBuffer#offset} by the + * number of bytes copied if omitted. + * @param {number=} sourceLimit Offset to end copying from, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) { + var relative, + targetRelative; + if (!this.noAssert) { + if (!ByteBuffer.isByteBuffer(target)) + throw TypeError("Illegal target: Not a ByteBuffer"); + } + targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0; + sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0; + sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0; + + if (targetOffset < 0 || targetOffset > target.buffer.byteLength) + throw RangeError("Illegal target range: 0 <= "+targetOffset+" <= "+target.buffer.byteLength); + if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength) + throw RangeError("Illegal source range: 0 <= "+sourceOffset+" <= "+this.buffer.byteLength); + + var len = sourceLimit - sourceOffset; + if (len === 0) + return target; // Nothing to copy + + target.ensureCapacity(targetOffset + len); + + target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset); + + if (relative) this.offset += len; + if (targetRelative) target.offset += len; + + return this; + }; + + /** + * Makes sure that this ByteBuffer is backed by a {@link ByteBuffer#buffer} of at least the specified capacity. If the + * current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity, + * the required capacity will be used instead. + * @param {number} capacity Required capacity + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.ensureCapacity = function(capacity) { + var current = this.buffer.byteLength; + if (current < capacity) + return this.resize((current *= 2) > capacity ? current : capacity); + return this; + }; + + /** + * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. + * @param {number|string} value Byte value to fill with. If given as a string, the first character is used. + * @param {number=} begin Begin offset. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} this + * @expose + * @example `someByteBuffer.clear().fill(0)` fills the entire backing buffer with zeroes + */ + ByteBufferPrototype.fill = function(value, begin, end) { + var relative = typeof begin === 'undefined'; + if (relative) begin = this.offset; + if (typeof value === 'string' && value.length > 0) + value = value.charCodeAt(0); + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin >= end) + return this; // Nothing to fill + while (begin < end) this.view[begin++] = value; + if (relative) this.offset = begin; + return this; + }; + + /** + * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets `limit = offset` and + * `offset = 0`. Make sure always to flip a ByteBuffer when all relative read or write operations are complete. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.flip = function() { + this.limit = this.offset; + this.offset = 0; + return this; + }; + /** + * Marks an offset on this ByteBuffer to be used later. + * @param {number=} offset Offset to mark. Defaults to {@link ByteBuffer#offset}. + * @returns {!ByteBuffer} this + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @see ByteBuffer#reset + * @expose + */ + ByteBufferPrototype.mark = function(offset) { + offset = typeof offset === 'undefined' ? this.offset : offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + this.markedOffset = offset; + return this; + }; + /** + * Sets the byte order. + * @param {boolean} littleEndian `true` for little endian byte order, `false` for big endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.order = function(littleEndian) { + if (!this.noAssert) { + if (typeof littleEndian !== 'boolean') + throw TypeError("Illegal littleEndian: Not a boolean"); + } + this.littleEndian = !!littleEndian; + return this; + }; + + /** + * Switches (to) little endian byte order. + * @param {boolean=} littleEndian Defaults to `true`, otherwise uses big endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.LE = function(littleEndian) { + this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true; + return this; + }; + + /** + * Switches (to) big endian byte order. + * @param {boolean=} bigEndian Defaults to `true`, otherwise uses little endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.BE = function(bigEndian) { + this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false; + return this; + }; + /** + * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the + * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer + * will be resized and its contents moved accordingly. + * @param {!ByteBuffer|string|!ArrayBuffer} source Data to prepend. If `source` is a ByteBuffer, its offset will be + * modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes + * prepended if omitted. + * @returns {!ByteBuffer} this + * @expose + * @example A relative `00<01 02 03>.prepend(<04 05>)` results in `<04 05 01 02 03>, 04 05|` + * @example An absolute `00<01 02 03>.prepend(<04 05>, 2)` results in `04<05 02 03>, 04 05|` + */ + ByteBufferPrototype.prepend = function(source, encoding, offset) { + if (typeof encoding === 'number' || typeof encoding !== 'string') { + offset = encoding; + encoding = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (!(source instanceof ByteBuffer)) + source = ByteBuffer.wrap(source, encoding); + var len = source.limit - source.offset; + if (len <= 0) return this; // Nothing to prepend + var diff = len - offset; + if (diff > 0) { // Not enough space before offset, so resize + move + var buffer = new ArrayBuffer(this.buffer.byteLength + diff); + var view = new Uint8Array(buffer); + view.set(this.view.subarray(offset, this.buffer.byteLength), len); + this.buffer = buffer; + this.view = view; + this.offset += diff; + if (this.markedOffset >= 0) this.markedOffset += diff; + this.limit += diff; + offset += diff; + } else { + var arrayView = new Uint8Array(this.buffer); + } + this.view.set(source.view.subarray(source.offset, source.limit), offset - len); + + source.offset = source.limit; + if (relative) + this.offset -= len; + return this; + }; + + /** + * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the + * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer + * will be resized and its contents moved accordingly. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes + * prepended if omitted. + * @returns {!ByteBuffer} this + * @expose + * @see ByteBuffer#prepend + */ + ByteBufferPrototype.prependTo = function(target, offset) { + target.prepend(this, offset); + return this; + }; + /** + * Prints debug information about this ByteBuffer's contents. + * @param {function(string)=} out Output function to call, defaults to console.log + * @expose + */ + ByteBufferPrototype.printDebug = function(out) { + if (typeof out !== 'function') out = console.log.bind(console); + out( + this.toString()+"\n"+ + "-------------------------------------------------------------------\n"+ + this.toDebug(/* columns */ true) + ); + }; + + /** + * Gets the number of remaining readable bytes. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}, so this returns `limit - offset`. + * @returns {number} Remaining readable bytes. May be negative if `offset > limit`. + * @expose + */ + ByteBufferPrototype.remaining = function() { + return this.limit - this.offset; + }; + /** + * Resets this ByteBuffer's {@link ByteBuffer#offset}. If an offset has been marked through {@link ByteBuffer#mark} + * before, `offset` will be set to {@link ByteBuffer#markedOffset}, which will then be discarded. If no offset has been + * marked, sets `offset = 0`. + * @returns {!ByteBuffer} this + * @see ByteBuffer#mark + * @expose + */ + ByteBufferPrototype.reset = function() { + if (this.markedOffset >= 0) { + this.offset = this.markedOffset; + this.markedOffset = -1; + } else { + this.offset = 0; + } + return this; + }; + /** + * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that + * large or larger. + * @param {number} capacity Capacity required + * @returns {!ByteBuffer} this + * @throws {TypeError} If `capacity` is not a number + * @throws {RangeError} If `capacity < 0` + * @expose + */ + ByteBufferPrototype.resize = function(capacity) { + if (!this.noAssert) { + if (typeof capacity !== 'number' || capacity % 1 !== 0) + throw TypeError("Illegal capacity: "+capacity+" (not an integer)"); + capacity |= 0; + if (capacity < 0) + throw RangeError("Illegal capacity: 0 <= "+capacity); + } + if (this.buffer.byteLength < capacity) { + var buffer = new ArrayBuffer(capacity); + var view = new Uint8Array(buffer); + view.set(this.view); + this.buffer = buffer; + this.view = view; + } + return this; + }; + /** + * Reverses this ByteBuffer's contents. + * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.reverse = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === end) + return this; // Nothing to reverse + Array.prototype.reverse.call(this.view.subarray(begin, end)); + return this; + }; + /** + * Skips the next `length` bytes. This will just advance + * @param {number} length Number of bytes to skip. May also be negative to move the offset back. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.skip = function(length) { + if (!this.noAssert) { + if (typeof length !== 'number' || length % 1 !== 0) + throw TypeError("Illegal length: "+length+" (not an integer)"); + length |= 0; + } + var offset = this.offset + length; + if (!this.noAssert) { + if (offset < 0 || offset > this.buffer.byteLength) + throw RangeError("Illegal length: 0 <= "+this.offset+" + "+length+" <= "+this.buffer.byteLength); + } + this.offset = offset; + return this; + }; + + /** + * Slices this ByteBuffer by creating a cloned instance with `offset = begin` and `limit = end`. + * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} Clone of this ByteBuffer with slicing applied, backed by the same {@link ByteBuffer#buffer} + * @expose + */ + ByteBufferPrototype.slice = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var bb = this.clone(); + bb.offset = begin; + bb.limit = end; + return bb; + }; + /** + * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. + * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory if + * possible. Defaults to `false` + * @returns {!ArrayBuffer} Contents as an ArrayBuffer + * @expose + */ + ByteBufferPrototype.toBuffer = function(forceCopy) { + var offset = this.offset, + limit = this.limit; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: Not an integer"); + offset >>>= 0; + if (typeof limit !== 'number' || limit % 1 !== 0) + throw TypeError("Illegal limit: Not an integer"); + limit >>>= 0; + if (offset < 0 || offset > limit || limit > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+offset+" <= "+limit+" <= "+this.buffer.byteLength); + } + // NOTE: It's not possible to have another ArrayBuffer reference the same memory as the backing buffer. This is + // possible with Uint8Array#subarray only, but we have to return an ArrayBuffer by contract. So: + if (!forceCopy && offset === 0 && limit === this.buffer.byteLength) + return this.buffer; + if (offset === limit) + return EMPTY_BUFFER; + var buffer = new ArrayBuffer(limit - offset); + new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0); + return buffer; + }; + + /** + * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. This is an alias of {@link ByteBuffer#toBuffer}. + * @function + * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory. + * Defaults to `false` + * @returns {!ArrayBuffer} Contents as an ArrayBuffer + * @expose + */ + ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer; + + /** + * Converts the ByteBuffer's contents to a string. + * @param {string=} encoding Output encoding. Returns an informative string representation if omitted but also allows + * direct conversion to "utf8", "hex", "base64" and "binary" encoding. "debug" returns a hex representation with + * highlighted offsets. + * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {string} String representation + * @throws {Error} If `encoding` is invalid + * @expose + */ + ByteBufferPrototype.toString = function(encoding, begin, end) { + if (typeof encoding === 'undefined') + return "ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")"; + if (typeof encoding === 'number') + encoding = "utf8", + begin = encoding, + end = begin; + switch (encoding) { + case "utf8": + return this.toUTF8(begin, end); + case "base64": + return this.toBase64(begin, end); + case "hex": + return this.toHex(begin, end); + case "binary": + return this.toBinary(begin, end); + case "debug": + return this.toDebug(); + case "columns": + return this.toColumns(); + default: + throw Error("Unsupported encoding: "+encoding); + } + }; + + // lxiv-embeddable + + /** + * lxiv-embeddable (c) 2014 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/lxiv for details + */ + var lxiv = function() { + "use strict"; + + /** + * lxiv namespace. + * @type {!Object.} + * @exports lxiv + */ + var lxiv = {}; + + /** + * Character codes for output. + * @type {!Array.} + * @inner + */ + var aout = [ + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 + ]; + + /** + * Character codes for input. + * @type {!Array.} + * @inner + */ + var ain = []; + for (var i=0, k=aout.length; i>2)&0x3f]); + t = (b&0x3)<<4; + if ((b = src()) !== null) { + t |= (b>>4)&0xf; + dst(aout[(t|((b>>4)&0xf))&0x3f]); + t = (b&0xf)<<2; + if ((b = src()) !== null) + dst(aout[(t|((b>>6)&0x3))&0x3f]), + dst(aout[b&0x3f]); + else + dst(aout[t&0x3f]), + dst(61); + } else + dst(aout[t&0x3f]), + dst(61), + dst(61); + } + }; + + /** + * Decodes base64 char codes to bytes. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. + * @throws {Error} If a character code is invalid + */ + lxiv.decode = function(src, dst) { + var c, t1, t2; + function fail(c) { + throw Error("Illegal character code: "+c); + } + while ((c = src()) !== null) { + t1 = ain[c]; + if (typeof t1 === 'undefined') fail(c); + if ((c = src()) !== null) { + t2 = ain[c]; + if (typeof t2 === 'undefined') fail(c); + dst((t1<<2)>>>0|(t2&0x30)>>4); + if ((c = src()) !== null) { + t1 = ain[c]; + if (typeof t1 === 'undefined') + if (c === 61) break; else fail(c); + dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2); + if ((c = src()) !== null) { + t2 = ain[c]; + if (typeof t2 === 'undefined') + if (c === 61) break; else fail(c); + dst(((t1&0x3)<<6)>>>0|t2); + } + } + } + } + }; + + /** + * Tests if a string is valid base64. + * @param {string} str String to test + * @returns {boolean} `true` if valid, otherwise `false` + */ + lxiv.test = function(str) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str); + }; + + return lxiv; + }(); + + // encodings/base64 + + /** + * Encodes this ByteBuffer's contents to a base64 encoded string. + * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}. + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}. + * @returns {string} Base64 encoded string + * @throws {RangeError} If `begin` or `end` is out of bounds + * @expose + */ + ByteBufferPrototype.toBase64 = function(begin, end) { + if (typeof begin === 'undefined') + begin = this.offset; + if (typeof end === 'undefined') + end = this.limit; + begin = begin | 0; end = end | 0; + if (begin < 0 || end > this.capacity || begin > end) + throw RangeError("begin, end"); + var sd; lxiv.encode(function() { + return begin < end ? this.view[begin++] : null; + }.bind(this), sd = stringDestination()); + return sd(); + }; + + /** + * Decodes a base64 encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromBase64 = function(str, littleEndian) { + if (typeof str !== 'string') + throw TypeError("str"); + var bb = new ByteBuffer(str.length/4*3, littleEndian), + i = 0; + lxiv.decode(stringSource(str), function(b) { + bb.view[i++] = b; + }); + bb.limit = i; + return bb; + }; + + /** + * Encodes a binary string to base64 like `window.btoa` does. + * @param {string} str Binary string + * @returns {string} Base64 encoded string + * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa + * @expose + */ + ByteBuffer.btoa = function(str) { + return ByteBuffer.fromBinary(str).toBase64(); + }; + + /** + * Decodes a base64 encoded string to binary like `window.atob` does. + * @param {string} b64 Base64 encoded string + * @returns {string} Binary string + * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.atob + * @expose + */ + ByteBuffer.atob = function(b64) { + return ByteBuffer.fromBase64(b64).toBinary(); + }; + + // encodings/binary + + /** + * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes. + * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}. + * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}. + * @returns {string} Binary encoded string + * @throws {RangeError} If `offset > limit` + * @expose + */ + ByteBufferPrototype.toBinary = function(begin, end) { + if (typeof begin === 'undefined') + begin = this.offset; + if (typeof end === 'undefined') + end = this.limit; + begin |= 0; end |= 0; + if (begin < 0 || end > this.capacity() || begin > end) + throw RangeError("begin, end"); + if (begin === end) + return ""; + var chars = [], + parts = []; + while (begin < end) { + chars.push(this.view[begin++]); + if (chars.length >= 1024) + parts.push(String.fromCharCode.apply(String, chars)), + chars = []; + } + return parts.join('') + String.fromCharCode.apply(String, chars); + }; + + /** + * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromBinary = function(str, littleEndian) { + if (typeof str !== 'string') + throw TypeError("str"); + var i = 0, + k = str.length, + charCode, + bb = new ByteBuffer(k, littleEndian); + while (i 0xff) + throw RangeError("illegal char code: "+charCode); + bb.view[i++] = charCode; + } + bb.limit = k; + return bb; + }; + + // encodings/debug + + /** + * Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are: + * * `<` : offset, + * * `'` : markedOffset, + * * `>` : limit, + * * `|` : offset and limit, + * * `[` : offset and markedOffset, + * * `]` : markedOffset and limit, + * * `!` : offset, markedOffset and limit + * @param {boolean=} columns If `true` returns two columns hex + ascii, defaults to `false` + * @returns {string|!Array.} Debug string or array of lines if `asArray = true` + * @expose + * @example `>00'01 02<03` contains four bytes with `limit=0, markedOffset=1, offset=3` + * @example `00[01 02 03>` contains four bytes with `offset=markedOffset=1, limit=4` + * @example `00|01 02 03` contains four bytes with `offset=limit=1, markedOffset=-1` + * @example `|` contains zero bytes with `offset=limit=0, markedOffset=-1` + */ + ByteBufferPrototype.toDebug = function(columns) { + var i = -1, + k = this.buffer.byteLength, + b, + hex = "", + asc = "", + out = ""; + while (i 32 && b < 127 ? String.fromCharCode(b) : '.'; + } + ++i; + if (columns) { + if (i > 0 && i % 16 === 0 && i !== k) { + while (hex.length < 3*16+3) hex += " "; + out += hex+asc+"\n"; + hex = asc = ""; + } + } + if (i === this.offset && i === this.limit) + hex += i === this.markedOffset ? "!" : "|"; + else if (i === this.offset) + hex += i === this.markedOffset ? "[" : "<"; + else if (i === this.limit) + hex += i === this.markedOffset ? "]" : ">"; + else + hex += i === this.markedOffset ? "'" : (columns || (i !== 0 && i !== k) ? " " : ""); + } + if (columns && hex !== " ") { + while (hex.length < 3*16+3) + hex += " "; + out += hex + asc + "\n"; + } + return columns ? out : hex; + }; + + /** + * Decodes a hex encoded string with marked offsets to a ByteBuffer. + * @param {string} str Debug string to decode (not be generated with `columns = true`) + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + * @see ByteBuffer#toDebug + */ + ByteBuffer.fromDebug = function(str, littleEndian, noAssert) { + var k = str.length, + bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert); + var i = 0, j = 0, ch, b, + rs = false, // Require symbol next + ho = false, hm = false, hl = false, // Already has offset (ho), markedOffset (hm), limit (hl)? + fail = false; + while (i': + if (!noAssert) { + if (hl) { + fail = true; + break; + } + hl = true; + } + bb.limit = j; + rs = false; + break; + case "'": + if (!noAssert) { + if (hm) { + fail = true; + break; + } + hm = true; + } + bb.markedOffset = j; + rs = false; + break; + case ' ': + rs = false; + break; + default: + if (!noAssert) { + if (rs) { + fail = true; + break; + } + } + b = parseInt(ch+str.charAt(i++), 16); + if (!noAssert) { + if (isNaN(b) || b < 0 || b > 255) + throw TypeError("Illegal str: Not a debug encoded string"); + } + bb.view[j++] = b; + rs = true; + } + if (fail) + throw TypeError("Illegal str: Invalid symbol at "+i); + } + if (!noAssert) { + if (!ho || !hl) + throw TypeError("Illegal str: Missing offset or limit"); + if (j>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var out = new Array(end - begin), + b; + while (begin < end) { + b = this.view[begin++]; + if (b < 0x10) + out.push("0", b.toString(16)); + else out.push(b.toString(16)); + } + return out.join(''); + }; + + /** + * Decodes a hex encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromHex = function(str, littleEndian, noAssert) { + if (!noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (str.length % 2 !== 0) + throw TypeError("Illegal str: Length not a multiple of 2"); + } + var k = str.length, + bb = new ByteBuffer((k / 2) | 0, littleEndian), + b; + for (var i=0, j=0; i 255) + throw TypeError("Illegal str: Contains non-hex characters"); + bb.view[j++] = b; + } + bb.limit = j; + return bb; + }; + + // utfx-embeddable + + /** + * utfx-embeddable (c) 2014 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/utfx for details + */ + var utfx = function() { + "use strict"; + + /** + * utfx namespace. + * @inner + * @type {!Object.} + */ + var utfx = {}; + + /** + * Maximum valid code point. + * @type {number} + * @const + */ + utfx.MAX_CODEPOINT = 0x10FFFF; + + /** + * Encodes UTF8 code points to UTF8 bytes. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte + */ + utfx.encodeUTF8 = function(src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, + src = function() { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp < 0x80) + dst(cp&0x7F); + else if (cp < 0x800) + dst(((cp>>6)&0x1F)|0xC0), + dst((cp&0x3F)|0x80); + else if (cp < 0x10000) + dst(((cp>>12)&0x0F)|0xE0), + dst(((cp>>6)&0x3F)|0x80), + dst((cp&0x3F)|0x80); + else + dst(((cp>>18)&0x07)|0xF0), + dst(((cp>>12)&0x3F)|0x80), + dst(((cp>>6)&0x3F)|0x80), + dst((cp&0x3F)|0x80); + cp = null; + } + }; + + /** + * Decodes UTF8 bytes to UTF8 code points. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the + * remaining bytes. + */ + utfx.decodeUTF8 = function(src, dst) { + var a, b, c, d, fail = function(b) { + b = b.slice(0, b.indexOf(null)); + var err = Error(b.toString()); + err.name = "TruncatedError"; + err['bytes'] = b; + throw err; + }; + while ((a = src()) !== null) { + if ((a&0x80) === 0) + dst(a); + else if ((a&0xE0) === 0xC0) + ((b = src()) === null) && fail([a, b]), + dst(((a&0x1F)<<6) | (b&0x3F)); + else if ((a&0xF0) === 0xE0) + ((b=src()) === null || (c=src()) === null) && fail([a, b, c]), + dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F)); + else if ((a&0xF8) === 0xF0) + ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]), + dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F)); + else throw RangeError("Illegal starting byte: "+a); + } + }; + + /** + * Converts UTF16 characters to UTF8 code points. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @param {!function(number)} dst Code points destination as a function successively called with each converted code + * point. + */ + utfx.UTF16toUTF8 = function(src, dst) { + var c1, c2 = null; + while (true) { + if ((c1 = c2 !== null ? c2 : src()) === null) + break; + if (c1 >= 0xD800 && c1 <= 0xDFFF) { + if ((c2 = src()) !== null) { + if (c2 >= 0xDC00 && c2 <= 0xDFFF) { + dst((c1-0xD800)*0x400+c2-0xDC00+0x10000); + c2 = null; continue; + } + } + } + dst(c1); + } + if (c2 !== null) dst(c2); + }; + + /** + * Converts UTF8 code points to UTF16 characters. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a code point is out of range + */ + utfx.UTF8toUTF16 = function(src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, src = function() { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp <= 0xFFFF) + dst(cp); + else + cp -= 0x10000, + dst((cp>>10)+0xD800), + dst((cp%0x400)+0xDC00); + cp = null; + } + }; + + /** + * Converts and encodes UTF16 characters to UTF8 bytes. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null` + * if there are no more characters left. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. + */ + utfx.encodeUTF16toUTF8 = function(src, dst) { + utfx.UTF16toUTF8(src, function(cp) { + utfx.encodeUTF8(cp, dst); + }); + }; + + /** + * Decodes and converts UTF8 bytes to UTF16 characters. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes. + */ + utfx.decodeUTF8toUTF16 = function(src, dst) { + utfx.decodeUTF8(src, function(cp) { + utfx.UTF8toUTF16(cp, dst); + }); + }; + + /** + * Calculates the byte length of an UTF8 code point. + * @param {number} cp UTF8 code point + * @returns {number} Byte length + */ + utfx.calculateCodePoint = function(cp) { + return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + }; + + /** + * Calculates the number of UTF8 bytes required to store UTF8 code points. + * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively + * `null` if there are no more code points left. + * @returns {number} The number of UTF8 bytes required + */ + utfx.calculateUTF8 = function(src) { + var cp, l=0; + while ((cp = src()) !== null) + l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + return l; + }; + + /** + * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes. + * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1. + */ + utfx.calculateUTF16asUTF8 = function(src) { + var n=0, l=0; + utfx.UTF16toUTF8(src, function(cp) { + ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + }); + return [n,l]; + }; + + return utfx; + }(); + + // encodings/utf8 + + /** + * Encodes this ByteBuffer's contents between {@link ByteBuffer#offset} and {@link ByteBuffer#limit} to an UTF8 encoded + * string. + * @returns {string} Hex encoded string + * @throws {RangeError} If `offset > limit` + * @expose + */ + ByteBufferPrototype.toUTF8 = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var sd; try { + utfx.decodeUTF8toUTF16(function() { + return begin < end ? this.view[begin++] : null; + }.bind(this), sd = stringDestination()); + } catch (e) { + if (begin !== end) + throw RangeError("Illegal range: Truncated data, "+begin+" != "+end); + } + return sd(); + }; + + /** + * Decodes an UTF8 encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) { + if (!noAssert) + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert), + i = 0; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + bb.view[i++] = b; + }); + bb.limit = i; + return bb; + }; + + return ByteBuffer; + }); + }); + + var empty$1 = {}; + + + var empty$2 = Object.freeze({ + default: empty$1 + }); + + var require$$2 = ( empty$2 && empty$1 ) || empty$2; + + var protobufLight = createCommonjsModule(function (module) { + /* + Copyright 2013 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license protobuf.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/protobuf.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined(["bytebuffer"], factory); + /* CommonJS */ else if (typeof commonjsRequire === "function" && 'object' === "object" && module && module["exports"]) + module["exports"] = factory(bytebuffer, true); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]); + + })(commonjsGlobal, function(ByteBuffer, isCommonJS) { + "use strict"; + + /** + * The ProtoBuf namespace. + * @exports ProtoBuf + * @namespace + * @expose + */ + var ProtoBuf = {}; + + /** + * @type {!function(new: ByteBuffer, ...[*])} + * @expose + */ + ProtoBuf.ByteBuffer = ByteBuffer; + + /** + * @type {?function(new: Long, ...[*])} + * @expose + */ + ProtoBuf.Long = ByteBuffer.Long || null; + + /** + * ProtoBuf.js version. + * @type {string} + * @const + * @expose + */ + ProtoBuf.VERSION = "5.0.2"; + + /** + * Wire types. + * @type {Object.} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES = {}; + + /** + * Varint wire type. + * @type {number} + * @expose + */ + ProtoBuf.WIRE_TYPES.VARINT = 0; + + /** + * Fixed 64 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS64 = 1; + + /** + * Length delimited wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.LDELIM = 2; + + /** + * Start group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.STARTGROUP = 3; + + /** + * End group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.ENDGROUP = 4; + + /** + * Fixed 32 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS32 = 5; + + /** + * Packable wire types. + * @type {!Array.} + * @const + * @expose + */ + ProtoBuf.PACKABLE_WIRE_TYPES = [ + ProtoBuf.WIRE_TYPES.VARINT, + ProtoBuf.WIRE_TYPES.BITS64, + ProtoBuf.WIRE_TYPES.BITS32 + ]; + + /** + * Types. + * @dict + * @type {!Object.} + * @const + * @expose + */ + ProtoBuf.TYPES = { + // According to the protobuf spec. + "int32": { + name: "int32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "uint32": { + name: "uint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "sint32": { + name: "sint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "int64": { + name: "int64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "uint64": { + name: "uint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sint64": { + name: "sint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "bool": { + name: "bool", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: false + }, + "double": { + name: "double", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: 0 + }, + "string": { + name: "string", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: "" + }, + "bytes": { + name: "bytes", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null // overridden in the code, must be a unique instance + }, + "fixed32": { + name: "fixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "sfixed32": { + name: "sfixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "fixed64": { + name: "fixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sfixed64": { + name: "sfixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "float": { + name: "float", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "enum": { + name: "enum", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "message": { + name: "message", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null + }, + "group": { + name: "group", + wireType: ProtoBuf.WIRE_TYPES.STARTGROUP, + defaultValue: null + } + }; + + /** + * Valid map key types. + * @type {!Array.>} + * @const + * @expose + */ + ProtoBuf.MAP_KEY_TYPES = [ + ProtoBuf.TYPES["int32"], + ProtoBuf.TYPES["sint32"], + ProtoBuf.TYPES["sfixed32"], + ProtoBuf.TYPES["uint32"], + ProtoBuf.TYPES["fixed32"], + ProtoBuf.TYPES["int64"], + ProtoBuf.TYPES["sint64"], + ProtoBuf.TYPES["sfixed64"], + ProtoBuf.TYPES["uint64"], + ProtoBuf.TYPES["fixed64"], + ProtoBuf.TYPES["bool"], + ProtoBuf.TYPES["string"], + ProtoBuf.TYPES["bytes"] + ]; + + /** + * Minimum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MIN = 1; + + /** + * Maximum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MAX = 0x1FFFFFFF; + + /** + * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`. + * Must be set prior to parsing. + * @type {boolean} + * @expose + */ + ProtoBuf.convertFieldsToCamelCase = false; + + /** + * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by + * setting this to `false` prior to building messages. + * @type {boolean} + * @expose + */ + ProtoBuf.populateAccessors = true; + + /** + * By default, messages are populated with default values if a field is not present on the wire. To disable + * this behavior, set this setting to `false`. + * @type {boolean} + * @expose + */ + ProtoBuf.populateDefaults = true; + + /** + * @alias ProtoBuf.Util + * @expose + */ + ProtoBuf.Util = (function() { + "use strict"; + + /** + * ProtoBuf utilities. + * @exports ProtoBuf.Util + * @namespace + */ + var Util = {}; + + /** + * Flag if running in node or not. + * @type {boolean} + * @const + * @expose + */ + Util.IS_NODE = !!( + typeof process === 'object' && process+'' === '[object process]' && !process['browser'] + ); + + /** + * Constructs a XMLHttpRequest object. + * @return {XMLHttpRequest} + * @throws {Error} If XMLHttpRequest is not supported + * @expose + */ + Util.XHR = function() { + // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html + var XMLHttpFactories = [ + function () {return new XMLHttpRequest()}, + function () {return new ActiveXObject("Msxml2.XMLHTTP")}, + function () {return new ActiveXObject("Msxml3.XMLHTTP")}, + function () {return new ActiveXObject("Microsoft.XMLHTTP")} + ]; + /** @type {?XMLHttpRequest} */ + var xhr = null; + for (var i=0;i} + * @expose + */ + ProtoBuf.Lang = { + + // Characters always ending a statement + DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g, + + // Field rules + RULE: /^(?:required|optional|repeated|map)$/, + + // Field types + TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, + + // Names + NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, + + // Type definitions + TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, + + // Type references + TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/, + + // Fully qualified type references + FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/, + + // All numbers + NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/, + + // Decimal numbers + NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, + + // Hexadecimal numbers + NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/, + + // Octal numbers + NUMBER_OCT: /^0[0-7]+$/, + + // Floating point numbers + NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, + + // Booleans + BOOL: /^(?:true|false)$/i, + + // Id numbers + ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Negative id numbers (enum values) + NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Whitespaces + WHITESPACE: /\s/, + + // All strings + STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, + + // Double quoted strings + STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + + // Single quoted strings + STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g + }; + + + /** + * @alias ProtoBuf.Reflect + * @expose + */ + ProtoBuf.Reflect = (function(ProtoBuf) { + "use strict"; + + /** + * Reflection types. + * @exports ProtoBuf.Reflect + * @namespace + */ + var Reflect = {}; + + /** + * Constructs a Reflect base class. + * @exports ProtoBuf.Reflect.T + * @constructor + * @abstract + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.T} parent Parent object + * @param {string} name Object name + */ + var T = function(builder, parent, name) { + + /** + * Builder reference. + * @type {!ProtoBuf.Builder} + * @expose + */ + this.builder = builder; + + /** + * Parent object. + * @type {?ProtoBuf.Reflect.T} + * @expose + */ + this.parent = parent; + + /** + * Object name in namespace. + * @type {string} + * @expose + */ + this.name = name; + + /** + * Fully qualified class name + * @type {string} + * @expose + */ + this.className; + }; + + /** + * @alias ProtoBuf.Reflect.T.prototype + * @inner + */ + var TPrototype = T.prototype; + + /** + * Returns the fully qualified name of this object. + * @returns {string} Fully qualified name as of ".PATH.TO.THIS" + * @expose + */ + TPrototype.fqn = function() { + var name = this.name, + ptr = this; + do { + ptr = ptr.parent; + if (ptr == null) + break; + name = ptr.name+"."+name; + } while (true); + return name; + }; + + /** + * Returns a string representation of this Reflect object (its fully qualified name). + * @param {boolean=} includeClass Set to true to include the class name. Defaults to false. + * @return String representation + * @expose + */ + TPrototype.toString = function(includeClass) { + return (includeClass ? this.className + " " : "") + this.fqn(); + }; + + /** + * Builds this type. + * @throws {Error} If this type cannot be built directly + * @expose + */ + TPrototype.build = function() { + throw Error(this.toString(true)+" cannot be built directly"); + }; + + /** + * @alias ProtoBuf.Reflect.T + * @expose + */ + Reflect.T = T; + + /** + * Constructs a new Namespace. + * @exports ProtoBuf.Reflect.Namespace + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent + * @param {string} name Namespace name + * @param {Object.=} options Namespace options + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Namespace = function(builder, parent, name, options, syntax) { + T.call(this, builder, parent, name); + + /** + * @override + */ + this.className = "Namespace"; + + /** + * Children inside the namespace. + * @type {!Array.} + */ + this.children = []; + + /** + * Options. + * @type {!Object.} + */ + this.options = options || {}; + + /** + * Syntax level (e.g., proto2 or proto3). + * @type {!string} + */ + this.syntax = syntax || "proto2"; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace.prototype + * @inner + */ + var NamespacePrototype = Namespace.prototype = Object.create(T.prototype); + + /** + * Returns an array of the namespace's children. + * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children). + * @return {Array.} + * @expose + */ + NamespacePrototype.getChildren = function(type) { + type = type || null; + if (type == null) + return this.children.slice(); + var children = []; + for (var i=0, k=this.children.length; i} qn Qualified name to resolve + * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false` + * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found + * @expose + */ + NamespacePrototype.resolve = function(qn, excludeNonNamespace) { + var part = typeof qn === 'string' ? qn.split(".") : qn, + ptr = this, + i = 0; + if (part[i] === "") { // Fully qualified name, e.g. ".My.Message' + while (ptr.parent !== null) + ptr = ptr.parent; + i++; + } + var child; + do { + do { + if (!(ptr instanceof Reflect.Namespace)) { + ptr = null; + break; + } + child = ptr.getChild(part[i]); + if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) { + ptr = null; + break; + } + ptr = child; i++; + } while (i < part.length); + if (ptr != null) + break; // Found + // Else search the parent + if (this.parent !== null) + return this.parent.resolve(qn, excludeNonNamespace); + } while (ptr != null); + return ptr; + }; + + /** + * Determines the shortest qualified name of the specified type, if any, relative to this namespace. + * @param {!ProtoBuf.Reflect.T} t Reflection type + * @returns {string} The shortest qualified name or, if there is none, the fqn + * @expose + */ + NamespacePrototype.qn = function(t) { + var part = [], ptr = t; + do { + part.unshift(ptr.name); + ptr = ptr.parent; + } while (ptr !== null); + for (var len=1; len <= part.length; len++) { + var qn = part.slice(part.length-len); + if (t === this.resolve(qn, t instanceof Reflect.Namespace)) + return qn.join("."); + } + return t.fqn(); + }; + + /** + * Builds the namespace and returns the runtime counterpart. + * @return {Object.} Runtime namespace + * @expose + */ + NamespacePrototype.build = function() { + /** @dict */ + var ns = {}; + var children = this.children; + for (var i=0, k=children.length, child; i} + */ + NamespacePrototype.buildOpt = function() { + var opt = {}, + keys = Object.keys(this.options); + for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option + */ + NamespacePrototype.getOption = function(name) { + if (typeof name === 'undefined') + return this.options; + return typeof this.options[name] !== 'undefined' ? this.options[name] : null; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace + * @expose + */ + Reflect.Namespace = Namespace; + + /** + * Constructs a new Element implementation that checks and converts values for a + * particular field type, as appropriate. + * + * An Element represents a single value: either the value of a singular field, + * or a value contained in one entry of a repeated field or map field. This + * class does not implement these higher-level concepts; it only encapsulates + * the low-level typechecking and conversion. + * + * @exports ProtoBuf.Reflect.Element + * @param {{name: string, wireType: number}} type Resolved data type + * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant + * (e.g. submessage field). + * @param {boolean} isMapKey Is this element a Map key? The value will be + * converted to string form if so. + * @param {string} syntax Syntax level of defining message type, e.g., + * proto2 or proto3. + * @param {string} name Name of the field containing this element (for error + * messages) + * @constructor + */ + var Element = function(type, resolvedType, isMapKey, syntax, name) { + + /** + * Element type, as a string (e.g., int32). + * @type {{name: string, wireType: number}} + */ + this.type = type; + + /** + * Element type reference to submessage or enum definition, if needed. + * @type {ProtoBuf.Reflect.T|null} + */ + this.resolvedType = resolvedType; + + /** + * Element is a map key. + * @type {boolean} + */ + this.isMapKey = isMapKey; + + /** + * Syntax level of defining message type, e.g., proto2 or proto3. + * @type {string} + */ + this.syntax = syntax; + + /** + * Name of the field containing this element (for error messages) + * @type {string} + */ + this.name = name; + + if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0) + throw Error("Invalid map key type: " + type.name); + }; + + var ElementPrototype = Element.prototype; + + /** + * Obtains a (new) default value for the specified type. + * @param type {string|{name: string, wireType: number}} Field type + * @returns {*} Default value + * @inner + */ + function mkDefault(type) { + if (typeof type === 'string') + type = ProtoBuf.TYPES[type]; + if (typeof type.defaultValue === 'undefined') + throw Error("default value for type "+type.name+" is not supported"); + if (type == ProtoBuf.TYPES["bytes"]) + return new ByteBuffer(0); + return type.defaultValue; + } + + /** + * Returns the default value for this field in proto3. + * @function + * @param type {string|{name: string, wireType: number}} the field type + * @returns {*} Default value + */ + Element.defaultFieldValue = mkDefault; + + /** + * Makes a Long from a value. + * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for + * strings and numbers + * @returns {!Long} + * @throws {Error} If the value cannot be converted to a Long + * @inner + */ + function mkLong(value, unsigned) { + if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' + && value.low === value.low && value.high === value.high) + return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned); + if (typeof value === 'string') + return ProtoBuf.Long.fromString(value, unsigned || false, 10); + if (typeof value === 'number') + return ProtoBuf.Long.fromNumber(value, unsigned || false); + throw Error("not convertible to Long"); + } + + ElementPrototype.toString = function() { + return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element'; + }; + + /** + * Checks if the given value can be set for an element of this type (singular + * field or one element of a repeated field or map). + * @param {*} value Value to check + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be verified for this element slot + * @expose + */ + ElementPrototype.verifyValue = function(value) { + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + switch (this.type) { + // Signed 32bit + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + // Account for !NaN: value === value + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value > 4294967295 ? value | 0 : value; + + // Unsigned 32bit + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value < 0 ? value >>> 0 : value; + + // Signed 64bit + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, false); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Unsigned 64bit + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, true); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value !== 'boolean') + fail(typeof value, "not a boolean"); + return value; + + // Float + case ProtoBuf.TYPES["float"]: + case ProtoBuf.TYPES["double"]: + if (typeof value !== 'number') + fail(typeof value, "not a number"); + return value; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + if (typeof value !== 'string' && !(value && value instanceof String)) + fail(typeof value, "not a string"); + return ""+value; // Convert String object to string + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (ByteBuffer.isByteBuffer(value)) + return value; + return ByteBuffer.wrap(value, "base64"); + + // Constant enum value + case ProtoBuf.TYPES["enum"]: { + var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value); + for (i=0; i 4294967295 || value < 0) + fail(typeof value, "not in range for uint32"); + return value; + } else { + // proto2 requires enum values to be valid. + fail(value, "not a valid enum value"); + } + } + // Embedded message + case ProtoBuf.TYPES["group"]: + case ProtoBuf.TYPES["message"]: { + if (!value || typeof value !== 'object') + fail(typeof value, "object expected"); + if (value instanceof this.resolvedType.clazz) + return value; + if (value instanceof ProtoBuf.Builder.Message) { + // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180) + var obj = {}; + for (var i in value) + if (value.hasOwnProperty(i)) + obj[i] = value[i]; + value = obj; + } + // Else let's try to construct one from a key-value object + return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons + } + } + + // We should never end here + throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")"); + }; + + /** + * Calculates the byte length of an element on the wire. + * @param {number} id Field number + * @param {*} value Field value + * @returns {number} Byte length + * @throws {Error} If the value cannot be calculated + * @expose + */ + ElementPrototype.calculateLength = function(id, value) { + if (value === null) return 0; // Nothing to encode + // Tag has already been written + var n; + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["uint32"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["sint32"]: + return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value)); + case ProtoBuf.TYPES["fixed32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["float"]: + return 4; + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + return ByteBuffer.calculateVarint64(value); + case ProtoBuf.TYPES["sint64"]: + return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value)); + case ProtoBuf.TYPES["fixed64"]: + case ProtoBuf.TYPES["sfixed64"]: + return 8; + case ProtoBuf.TYPES["bool"]: + return 1; + case ProtoBuf.TYPES["enum"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["double"]: + return 8; + case ProtoBuf.TYPES["string"]: + n = ByteBuffer.calculateUTF8Bytes(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining(); + case ProtoBuf.TYPES["message"]: + n = this.resolvedType.calculate(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["group"]: + n = this.resolvedType.calculate(value); + return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + } + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + }; + + /** + * Encodes a value to the specified buffer. Does not encode the key. + * @param {number} id Field number + * @param {*} value Field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the value cannot be encoded + * @expose + */ + ElementPrototype.encodeValue = function(id, value, buffer) { + if (value === null) return buffer; // Nothing to encode + // Tag has already been written + + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes + // long – it is, effectively, treated like a very large unsigned integer." (see #122) + if (value < 0) + buffer.writeVarint64(value); + else + buffer.writeVarint32(value); + break; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + buffer.writeVarint32(value); + break; + + // 32bit varint zig-zag + case ProtoBuf.TYPES["sint32"]: + buffer.writeVarint32ZigZag(value); + break; + + // Fixed unsigned 32bit + case ProtoBuf.TYPES["fixed32"]: + buffer.writeUint32(value); + break; + + // Fixed signed 32bit + case ProtoBuf.TYPES["sfixed32"]: + buffer.writeInt32(value); + break; + + // 64bit varint as-is + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + buffer.writeVarint64(value); // throws + break; + + // 64bit varint zig-zag + case ProtoBuf.TYPES["sint64"]: + buffer.writeVarint64ZigZag(value); // throws + break; + + // Fixed unsigned 64bit + case ProtoBuf.TYPES["fixed64"]: + buffer.writeUint64(value); // throws + break; + + // Fixed signed 64bit + case ProtoBuf.TYPES["sfixed64"]: + buffer.writeInt64(value); // throws + break; + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value === 'string') + buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value); + else + buffer.writeVarint32(value ? 1 : 0); + break; + + // Constant enum value + case ProtoBuf.TYPES["enum"]: + buffer.writeVarint32(value); + break; + + // 32bit float + case ProtoBuf.TYPES["float"]: + buffer.writeFloat32(value); + break; + + // 64bit float + case ProtoBuf.TYPES["double"]: + buffer.writeFloat64(value); + break; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + buffer.writeVString(value); + break; + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + var prevOffset = value.offset; + buffer.writeVarint32(value.remaining()); + buffer.append(value); + value.offset = prevOffset; + break; + + // Embedded message + case ProtoBuf.TYPES["message"]: + var bb = new ByteBuffer().LE(); + this.resolvedType.encode(value, bb); + buffer.writeVarint32(bb.offset); + buffer.append(bb.flip()); + break; + + // Legacy group + case ProtoBuf.TYPES["group"]: + this.resolvedType.encode(value, buffer); + buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + break; + + default: + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + } + return buffer; + }; + + /** + * Decode one element value from the specified buffer. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number} wireType The field wire type + * @param {number} id The field number + * @return {*} Decoded value + * @throws {Error} If the field cannot be decoded + * @expose + */ + ElementPrototype.decode = function(buffer, wireType, id) { + if (wireType != this.type.wireType) + throw Error("Unexpected wire type for element"); + + var value, nBytes; + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + return buffer.readVarint32() | 0; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + return buffer.readVarint32() >>> 0; + + // 32bit signed varint zig-zag + case ProtoBuf.TYPES["sint32"]: + return buffer.readVarint32ZigZag() | 0; + + // Fixed 32bit unsigned + case ProtoBuf.TYPES["fixed32"]: + return buffer.readUint32() >>> 0; + + case ProtoBuf.TYPES["sfixed32"]: + return buffer.readInt32() | 0; + + // 64bit signed varint + case ProtoBuf.TYPES["int64"]: + return buffer.readVarint64(); + + // 64bit unsigned varint + case ProtoBuf.TYPES["uint64"]: + return buffer.readVarint64().toUnsigned(); + + // 64bit signed varint zig-zag + case ProtoBuf.TYPES["sint64"]: + return buffer.readVarint64ZigZag(); + + // Fixed 64bit unsigned + case ProtoBuf.TYPES["fixed64"]: + return buffer.readUint64(); + + // Fixed 64bit signed + case ProtoBuf.TYPES["sfixed64"]: + return buffer.readInt64(); + + // Bool varint + case ProtoBuf.TYPES["bool"]: + return !!buffer.readVarint32(); + + // Constant enum value (varint) + case ProtoBuf.TYPES["enum"]: + // The following Builder.Message#set will already throw + return buffer.readVarint32(); + + // 32bit float + case ProtoBuf.TYPES["float"]: + return buffer.readFloat(); + + // 64bit float + case ProtoBuf.TYPES["double"]: + return buffer.readDouble(); + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + return buffer.readVString(); + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: { + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + value = buffer.clone(); // Offset already set + value.limit = value.offset+nBytes; + buffer.offset += nBytes; + return value; + } + + // Length-delimited embedded message + case ProtoBuf.TYPES["message"]: { + nBytes = buffer.readVarint32(); + return this.resolvedType.decode(buffer, nBytes); + } + + // Legacy group + case ProtoBuf.TYPES["group"]: + return this.resolvedType.decode(buffer, -1, id); + } + + // We should never end here + throw Error("[INTERNAL] Illegal decode type"); + }; + + /** + * Converts a value from a string to the canonical element type. + * + * Legal only when isMapKey is true. + * + * @param {string} str The string value + * @returns {*} The value + */ + ElementPrototype.valueFromString = function(str) { + if (!this.isMapKey) { + throw Error("valueFromString() called on non-map-key element"); + } + + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + return this.verifyValue(parseInt(str)); + + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: + // Long-based fields support conversions from string already. + return this.verifyValue(str); + + case ProtoBuf.TYPES["bool"]: + return str === "true"; + + case ProtoBuf.TYPES["string"]: + return this.verifyValue(str); + + case ProtoBuf.TYPES["bytes"]: + return ByteBuffer.fromBinary(str); + } + }; + + /** + * Converts a value from the canonical element type to a string. + * + * It should be the case that `valueFromString(valueToString(val))` returns + * a value equivalent to `verifyValue(val)` for every legal value of `val` + * according to this element type. + * + * This may be used when the element must be stored or used as a string, + * e.g., as a map key on an Object. + * + * Legal only when isMapKey is true. + * + * @param {*} val The value + * @returns {string} The string form of the value. + */ + ElementPrototype.valueToString = function(value) { + if (!this.isMapKey) { + throw Error("valueToString() called on non-map-key element"); + } + + if (this.type === ProtoBuf.TYPES["bytes"]) { + return value.toString("binary"); + } else { + return value.toString(); + } + }; + + /** + * @alias ProtoBuf.Reflect.Element + * @expose + */ + Reflect.Element = Element; + + /** + * Constructs a new Message. + * @exports ProtoBuf.Reflect.Message + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace + * @param {string} name Message name + * @param {Object.=} options Message options + * @param {boolean=} isGroup `true` if this is a legacy group + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Message = function(builder, parent, name, options, isGroup, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Message"; + + /** + * Extensions range. + * @type {!Array.|undefined} + * @expose + */ + this.extensions = undefined; + + /** + * Runtime message class. + * @type {?function(new:ProtoBuf.Builder.Message)} + * @expose + */ + this.clazz = null; + + /** + * Whether this is a legacy group or not. + * @type {boolean} + * @expose + */ + this.isGroup = !!isGroup; + + // The following cached collections are used to efficiently iterate over or look up fields when decoding. + + /** + * Cached fields. + * @type {?Array.} + * @private + */ + this._fields = null; + + /** + * Cached fields by id. + * @type {?Object.} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields by name. + * @type {?Object.} + * @private + */ + this._fieldsByName = null; + }; + + /** + * @alias ProtoBuf.Reflect.Message.prototype + * @inner + */ + var MessagePrototype = Message.prototype = Object.create(Namespace.prototype); + + /** + * Builds the message and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Message + * @param {boolean=} rebuild Whether to rebuild or not, defaults to false + * @return {ProtoBuf.Reflect.Message} Message class + * @throws {Error} If the message cannot be built + * @expose + */ + MessagePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Message class in its own scope + var clazz = (function(ProtoBuf, T) { + + var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), + oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf); + + /** + * Constructs a new runtime Message. + * @name ProtoBuf.Builder.Message + * @class Barebone of all runtime messages. + * @param {!Object.|string} values Preset values + * @param {...string} var_args + * @constructor + * @throws {Error} If the message cannot be created + */ + var Message = function(values, var_args) { + ProtoBuf.Builder.Message.call(this); + + // Create virtual oneof properties + for (var i=0, k=oneofs.length; i 0) { + var value; + // Set field values from a values object + if (arguments.length === 1 && values !== null && typeof values === 'object' && + /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) && + /* not a repeated field */ !Array.isArray(values) && + /* not a Map */ !(values instanceof ProtoBuf.Map) && + /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) && + /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) && + /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) { + this.$set(values); + } else // Set field values from arguments, in declaration order + for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false` + * @returns {!ProtoBuf.Builder.Message} this + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.set = function(keyOrObj, value, noAssert) { + if (keyOrObj && typeof keyOrObj === 'object') { + noAssert = value; + for (var ikey in keyOrObj) { + // Check if virtual oneof field - don't set these + if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined) + this.$set(ikey, value, noAssert); + } + return this; + } + var field = T._fieldsByName[keyOrObj]; + if (!noAssert) { + if (!field) + throw Error(this+"#"+keyOrObj+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true)); + this[field.name] = (value = field.verifyValue(value)); // May throw + } else + this[keyOrObj] = value; + if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = this[field.oneof.name]; // Virtual field references currently set field + if (value !== null) { + if (currentField !== null && currentField !== field.name) + this[currentField] = null; // Clear currently set field + this[field.oneof.name] = field.name; // Point virtual field at this field + } else if (/* value === null && */currentField === keyOrObj) + this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared) + } + return this; + }; + + /** + * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}. + * @name ProtoBuf.Builder.Message#$set + * @function + * @param {string|!Object.} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert the value, defaults to `false` + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.$set = MessagePrototype.set; + + /** + * Gets a field's value. + * @name ProtoBuf.Builder.Message#get + * @function + * @param {string} key Key + * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false` + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.get = function(key, noAssert) { + if (noAssert) + return this[key]; + var field = T._fieldsByName[key]; + if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: "+field.toString(true)); + return this[field.name]; + }; + + /** + * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}. + * @name ProtoBuf.Builder.Message#$get + * @function + * @param {string} key Key + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.$get = MessagePrototype.get; + + // Getters and setters + + for (var i=0; i} data Data payload + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @expose + */ + Message.encode = function(data, buffer, noVerify) { + return new Message(data).encode(buffer, noVerify); + }; + + /** + * Calculates the byte length of the message. + * @name ProtoBuf.Builder.Message#calculate + * @function + * @returns {number} Byte length + * @throws {Error} If the message cannot be calculated or if required fields are missing. + * @expose + */ + MessagePrototype.calculate = function() { + return T.calculate(this); + }; + + /** + * Encodes the varint32 length-delimited message. + * @name ProtoBuf.Builder.Message#encodeDelimited + * @function + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ByteBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeDelimited = function(buffer, noVerify) { + var isNew = false; + if (!buffer) + buffer = new ByteBuffer(), + isNew = true; + var enc = new ByteBuffer().LE(); + T.encode(this, enc, noVerify).flip(); + buffer.writeVarint32(enc.remaining()); + buffer.append(enc); + return isNew ? buffer.flip() : buffer; + }; + + /** + * Directly encodes the message to an ArrayBuffer. + * @name ProtoBuf.Builder.Message#encodeAB + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeAB = function() { + try { + return this.encode().toArrayBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer(); + throw(e); + } + }; + + /** + * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}. + * @name ProtoBuf.Builder.Message#toArrayBuffer + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB; + + /** + * Directly encodes the message to a node Buffer. + * @name ProtoBuf.Builder.Message#encodeNB + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are + * missing. The later still returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeNB = function() { + try { + return this.encode().toBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer(); + throw(e); + } + }; + + /** + * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}. + * @name ProtoBuf.Builder.Message#toBuffer + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBuffer = MessagePrototype.encodeNB; + + /** + * Directly encodes the message to a base64 encoded string. + * @name ProtoBuf.Builder.Message#encode64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encode64 = function() { + try { + return this.encode().toBase64(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBase64(); + throw(e); + } + }; + + /** + * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}. + * @name ProtoBuf.Builder.Message#toBase64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBase64 = MessagePrototype.encode64; + + /** + * Directly encodes the message to a hex encoded string. + * @name ProtoBuf.Builder.Message#encodeHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeHex = function() { + try { + return this.encode().toHex(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toHex(); + throw(e); + } + }; + + /** + * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}. + * @name ProtoBuf.Builder.Message#toHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toHex = MessagePrototype.encodeHex; + + /** + * Clones a message object or field value to a raw object. + * @param {*} obj Object to clone + * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field + * @returns {*} Cloned object + * @inner + */ + function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) { + if (obj === null || typeof obj !== 'object') { + // Convert enum values to their respective names + if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) { + var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj); + if (name !== null) + return name; + } + // Pass-through string, number, boolean, null... + return obj; + } + // Convert ByteBuffers to raw buffer or strings + if (ByteBuffer.isByteBuffer(obj)) + return binaryAsBase64 ? obj.toBase64() : obj.toBuffer(); + // Convert Longs to proper objects or strings + if (ProtoBuf.Long.isLong(obj)) + return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj); + var clone; + // Clone arrays + if (Array.isArray(obj)) { + clone = []; + obj.forEach(function(v, k) { + clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType); + }); + return clone; + } + clone = {}; + // Convert maps to objects + if (obj instanceof ProtoBuf.Map) { + var it = obj.entries(); + for (var e = it.next(); !e.done; e = it.next()) + clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType); + return clone; + } + // Everything else is a non-null object + var type = obj.$type, + field = undefined; + for (var i in obj) + if (obj.hasOwnProperty(i)) { + if (type && (field = type.getChild(i))) + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType); + else + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings); + } + return clone; + } + + /** + * Returns the message's raw payload. + * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false` + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @returns {Object.} Raw payload + * @expose + */ + MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) { + return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type); + }; + + /** + * Encodes a message to JSON. + * @returns {string} JSON string + * @expose + */ + MessagePrototype.encodeJSON = function() { + return JSON.stringify( + cloneRaw(this, + /* binary-as-base64 */ true, + /* longs-as-strings */ true, + this.$type + ) + ); + }; + + /** + * Decodes a message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decode + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {(number|string)=} length Message length. Defaults to decode all the remainig data. + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + * @see ProtoBuf.Builder.Message.decode64 + * @see ProtoBuf.Builder.Message.decodeHex + */ + Message.decode = function(buffer, length, enc) { + if (typeof length === 'string') + enc = length, + length = -1; + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + var le = buffer.littleEndian; + try { + var msg = T.decode(buffer.LE(), length); + buffer.LE(le); + return msg; + } catch (e) { + buffer.LE(le); + throw(e); + } + }; + + /** + * Decodes a varint32 length-delimited message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decodeDelimited + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeDelimited = function(buffer, enc) { + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + if (buffer.remaining() < 1) + return null; + var off = buffer.offset, + len = buffer.readVarint32(); + if (buffer.remaining() < len) { + buffer.offset = off; + return null; + } + try { + var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE()); + buffer.offset += len; + return msg; + } catch (err) { + buffer.offset += len; + throw err; + } + }; + + /** + * Decodes the message from the specified base64 encoded string. + * @name ProtoBuf.Builder.Message.decode64 + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decode64 = function(str) { + return Message.decode(str, "base64"); + }; + + /** + * Decodes the message from the specified hex encoded string. + * @name ProtoBuf.Builder.Message.decodeHex + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeHex = function(str) { + return Message.decode(str, "hex"); + }; + + /** + * Decodes the message from a JSON string. + * @name ProtoBuf.Builder.Message.decodeJSON + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are + * missing. + * @expose + */ + Message.decodeJSON = function(str) { + return new Message(JSON.parse(str)); + }; + + // Utility + + /** + * Returns a string representation of this Message. + * @name ProtoBuf.Builder.Message#toString + * @function + * @return {string} String representation as of ".Fully.Qualified.MessageName" + * @expose + */ + MessagePrototype.toString = function() { + return T.toString(); + }; + + // Properties + + /** + * Message options. + * @name ProtoBuf.Builder.Message.$options + * @type {Object.} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Message options. + * @name ProtoBuf.Builder.Message#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message.$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message#$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Message, '$options', { "value": T.buildOpt() }), + Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }), + Object.defineProperty(Message, "$type", { "value": T }), + Object.defineProperty(MessagePrototype, "$type", { "value": T }); + + return Message; + + })(ProtoBuf, this); + + // Static enums and prototyped sub-messages / cached collections + this._fields = []; + this._fieldsById = {}; + this._fieldsByName = {}; + this._oneofsByName = {}; + for (var i=0, k=this.children.length, child; i>> 3; + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + do tag = buf.readUint8(); + while ((tag & 0x80) === 0x80); + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buf.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + tag = buf.readVarint32(); // reads the varint + buf.offset += tag; // skips n bytes + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + skipTillGroupEnd(id, buf); + break; + case ProtoBuf.WIRE_TYPES.ENDGROUP: + if (id === expectedId) + return false; + else + throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)"); + case ProtoBuf.WIRE_TYPES.BITS32: + buf.offset += 4; + break; + default: + throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType); + } + return true; + } + + /** + * Decodes an encoded message and returns the decoded message. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number=} length Message length. Defaults to decode all remaining data. + * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group + * @return {ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded + * @expose + */ + MessagePrototype.decode = function(buffer, length, expectedGroupEndId) { + if (typeof length !== 'number') + length = -1; + var start = buffer.offset, + msg = new (this.clazz)(), + tag, wireType, id, field; + while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) { + tag = buffer.readVarint32(); + wireType = tag & 0x07; + id = tag >>> 3; + if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) { + if (id !== expectedGroupEndId) + throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")"); + break; + } + if (!(field = this._fieldsById[id])) { + // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing." + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + buffer.readVarint32(); + break; + case ProtoBuf.WIRE_TYPES.BITS32: + buffer.offset += 4; + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buffer.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + var len = buffer.readVarint32(); + buffer.offset += len; + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + while (skipTillGroupEnd(id, buffer)) {} + break; + default: + throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType); + } + continue; + } + if (field.repeated && !field.options["packed"]) { + msg[field.name].push(field.decode(wireType, buffer)); + } else if (field.map) { + var keyval = field.decode(wireType, buffer); + msg[field.name].set(keyval[0], keyval[1]); + } else { + msg[field.name] = field.decode(wireType, buffer); + if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = msg[field.oneof.name]; // Virtual field references currently set field + if (currentField !== null && currentField !== field.name) + msg[currentField] = null; // Clear currently set field + msg[field.oneof.name] = field.name; // Point virtual field at this field + } + } + } + + // Check if all required fields are present and set default values for optional fields that are not + for (var i=0, k=this._fields.length; i=} options Options + * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) { + T.call(this, builder, message, name); + + /** + * @override + */ + this.className = "Message.Field"; + + /** + * Message field required flag. + * @type {boolean} + * @expose + */ + this.required = rule === "required"; + + /** + * Message field repeated flag. + * @type {boolean} + * @expose + */ + this.repeated = rule === "repeated"; + + /** + * Message field map flag. + * @type {boolean} + * @expose + */ + this.map = rule === "map"; + + /** + * Message field key type. Type reference string if unresolved, protobuf + * type if resolved. Valid only if this.map === true, null otherwise. + * @type {string|{name: string, wireType: number}|null} + * @expose + */ + this.keyType = keytype || null; + + /** + * Message field type. Type reference string if unresolved, protobuf type if + * resolved. In a map field, this is the value type. + * @type {string|{name: string, wireType: number}} + * @expose + */ + this.type = type; + + /** + * Resolved type reference inside the global namespace. + * @type {ProtoBuf.Reflect.T|null} + * @expose + */ + this.resolvedType = null; + + /** + * Unique message field id. + * @type {number} + * @expose + */ + this.id = id; + + /** + * Message field options. + * @type {!Object.} + * @dict + * @expose + */ + this.options = options || {}; + + /** + * Default value. + * @type {*} + * @expose + */ + this.defaultValue = null; + + /** + * Enclosing OneOf. + * @type {?ProtoBuf.Reflect.Message.OneOf} + * @expose + */ + this.oneof = oneof || null; + + /** + * Syntax level of this definition (e.g., proto3). + * @type {string} + * @expose + */ + this.syntax = syntax || 'proto2'; + + /** + * Original field name. + * @type {string} + * @expose + */ + this.originalName = this.name; // Used to revert camelcase transformation on naming collisions + + /** + * Element implementation. Created in build() after types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.element = null; + + /** + * Key element implementation, for map fields. Created in build() after + * types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.keyElement = null; + + // Convert field names to camel case notation if the override is set + if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField)) + this.name = ProtoBuf.Util.toCamelCase(this.name); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field.prototype + * @inner + */ + var FieldPrototype = Field.prototype = Object.create(T.prototype); + + /** + * Builds the field. + * @override + * @expose + */ + FieldPrototype.build = function() { + this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name); + if (this.map) + this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name); + + // In proto3, fields do not have field presence, and every field is set to + // its type's default value ("", 0, 0.0, or false). + if (this.syntax === 'proto3' && !this.repeated && !this.map) + this.defaultValue = Element.defaultFieldValue(this.type); + + // Otherwise, default values are present when explicitly specified + else if (typeof this.options['default'] !== 'undefined') + this.defaultValue = this.verifyValue(this.options['default']); + }; + + /** + * Checks if the given value can be set for this field. + * @param {*} value Value to check + * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false. + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be set for this field + * @expose + */ + FieldPrototype.verifyValue = function(value, skipRepeated) { + skipRepeated = skipRepeated || false; + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + if (value === null) { // NULL values for optional fields + if (this.required) + fail(typeof value, "required"); + if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"]) + fail(typeof value, "proto3 field without field presence cannot be null"); + return null; + } + var i; + if (this.repeated && !skipRepeated) { // Repeated values as arrays + if (!Array.isArray(value)) + value = [value]; + var res = []; + for (i=0; i 0; + + case ProtoBuf.TYPES["bytes"]: + return value.remaining() > 0; + + case ProtoBuf.TYPES["enum"]: + return value !== 0; + + case ProtoBuf.TYPES["message"]: + return value !== null; + default: + return true; + } + }; + + /** + * Encodes the specified field value to the specified buffer. + * @param {*} value Verified field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @param {!ProtoBuf.Builder.Message} message Runtime message + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the field cannot be encoded + * @expose + */ + FieldPrototype.encode = function(value, buffer, message) { + if (this.type === null || typeof this.type !== 'object') + throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type); + if (value === null || (this.repeated && value.length == 0)) + return buffer; // Optional omitted + try { + if (this.repeated) { + var i; + // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire + // types) can be declared 'packed'." + if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { + // "All of the elements of the field are packed into a single key-value pair with wire type 2 + // (length-delimited). Each element is encoded the same way it would be normally, except without a + // tag preceding it." + buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1 + var start = buffer.offset; // Remember where the contents begin + for (i=0; i 1) { // We need to move the contents + var contents = buffer.slice(start, buffer.offset); + start += varintLen-1; + buffer.offset = start; + buffer.append(contents); + } + buffer.writeVarint32(len, start-varintLen); + } else { + // "If your message definition has repeated elements (without the [packed=true] option), the encoded + // message has zero or more key-value pairs with the same tag number" + for (i=0; i= 0) { + n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + ni = 0; + for (i=0; i= 0) { + if (!skipRepeated) { + nBytes = buffer.readVarint32(); + nBytes = buffer.offset + nBytes; // Limit + var values = []; + while (buffer.offset < nBytes) + values.push(this.decode(this.type.wireType, buffer, true)); + return values; + } + // Read the next value otherwise... + } + + // Handle maps. + if (this.map) { + // Read one (key, value) submessage, and return [key, value] + var key = Element.defaultFieldValue(this.keyType); + value = Element.defaultFieldValue(this.type); + + // Read the length + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + + // Get a sub-buffer of this key/value submessage + var msgbuf = buffer.clone(); + msgbuf.limit = msgbuf.offset + nBytes; + buffer.offset += nBytes; + + while (msgbuf.remaining() > 0) { + var tag = msgbuf.readVarint32(); + wireType = tag & 0x07; + var id = tag >>> 3; + if (id === 1) { + key = this.keyElement.decode(msgbuf, wireType, id); + } else if (id === 2) { + value = this.element.decode(msgbuf, wireType, id); + } else { + throw Error("Unexpected tag in map field key/value submessage"); + } + } + + return [key, value]; + } + + // Handle singular and non-packed repeated field values. + return this.element.decode(buffer, wireType, this.id); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field + * @expose + */ + Reflect.Message.Field = Field; + + /** + * Constructs a new Message ExtensionField. + * @exports ProtoBuf.Reflect.Message.ExtensionField + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} rule Rule, one of requried, optional, repeated + * @param {string} type Data type, e.g. int32 + * @param {string} name Field name + * @param {number} id Unique field id + * @param {!Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Message.Field + */ + var ExtensionField = function(builder, message, rule, type, name, id, options) { + Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options); + + /** + * Extension reference. + * @type {!ProtoBuf.Reflect.Extension} + * @expose + */ + this.extension; + }; + + // Extends Field + ExtensionField.prototype = Object.create(Field.prototype); + + /** + * @alias ProtoBuf.Reflect.Message.ExtensionField + * @expose + */ + Reflect.Message.ExtensionField = ExtensionField; + + /** + * Constructs a new Message OneOf. + * @exports ProtoBuf.Reflect.Message.OneOf + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} name OneOf name + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var OneOf = function(builder, message, name) { + T.call(this, builder, message, name); + + /** + * Enclosed fields. + * @type {!Array.} + * @expose + */ + this.fields = []; + }; + + /** + * @alias ProtoBuf.Reflect.Message.OneOf + * @expose + */ + Reflect.Message.OneOf = OneOf; + + /** + * Constructs a new Enum. + * @exports ProtoBuf.Reflect.Enum + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object + * @param {string} name Enum name + * @param {Object.=} options Enum options + * @param {string?} syntax The syntax level (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Enum = function(builder, parent, name, options, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Enum"; + + /** + * Runtime enum object. + * @type {Object.|null} + * @expose + */ + this.object = null; + }; + + /** + * Gets the string name of an enum value. + * @param {!ProtoBuf.Builder.Enum} enm Runtime enum + * @param {number} value Enum value + * @returns {?string} Name or `null` if not present + * @expose + */ + Enum.getName = function(enm, value) { + var keys = Object.keys(enm); + for (var i=0, key; i} + * @expose + */ + EnumPrototype.build = function(rebuild) { + if (this.object && !rebuild) + return this.object; + var enm = new ProtoBuf.Builder.Enum(), + values = this.getChildren(Enum.Value); + for (var i=0, k=values.length; i=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Service = function(builder, root, name, options) { + Namespace.call(this, builder, root, name, options); + + /** + * @override + */ + this.className = "Service"; + + /** + * Built runtime service class. + * @type {?function(new:ProtoBuf.Builder.Service)} + */ + this.clazz = null; + }; + + /** + * @alias ProtoBuf.Reflect.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(Namespace.prototype); + + /** + * Builds the service and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Service + * @param {boolean=} rebuild Whether to rebuild or not + * @return {Function} Service class + * @throws {Error} If the message cannot be built + * @expose + */ + ServicePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Service class in its own scope + return this.clazz = (function(ProtoBuf, T) { + + /** + * Constructs a new runtime Service. + * @name ProtoBuf.Builder.Service + * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message + * @class Barebone of all runtime services. + * @constructor + * @throws {Error} If the service cannot be created + */ + var Service = function(rpcImpl) { + ProtoBuf.Builder.Service.call(this); + + /** + * Service implementation. + * @name ProtoBuf.Builder.Service#rpcImpl + * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} + * @expose + */ + this.rpcImpl = rpcImpl || function(name, msg, callback) { + // This is what a user has to implement: A function receiving the method name, the actual message to + // send (type checked) and the callback that's either provided with the error as its first + // argument or null and the actual response message. + setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async! + }; + }; + + /** + * @alias ProtoBuf.Builder.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype); + + /** + * Asynchronously performs an RPC call using the given RPC implementation. + * @name ProtoBuf.Builder.Service.[Method] + * @function + * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + /** + * Asynchronously performs an RPC call using the instance's RPC implementation. + * @name ProtoBuf.Builder.Service#[Method] + * @function + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod); + for (var i=0; i} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Service options. + * @name ProtoBuf.Builder.Service#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service.$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service#$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Service, "$options", { "value": T.buildOpt() }), + Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }), + Object.defineProperty(Service, "$type", { "value": T }), + Object.defineProperty(ServicePrototype, "$type", { "value": T }); + + return Service; + + })(ProtoBuf, this); + }; + + /** + * @alias ProtoBuf.Reflect.Service + * @expose + */ + Reflect.Service = Service; + + /** + * Abstract service method. + * @exports ProtoBuf.Reflect.Service.Method + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Method = function(builder, svc, name, options) { + T.call(this, builder, svc, name); + + /** + * @override + */ + this.className = "Service.Method"; + + /** + * Options. + * @type {Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Reflect.Service.Method.prototype + * @inner + */ + var MethodPrototype = Method.prototype = Object.create(T.prototype); + + /** + * Builds the method's '$options' property. + * @name ProtoBuf.Reflect.Service.Method#buildOpt + * @function + * @return {Object.} + */ + MethodPrototype.buildOpt = NamespacePrototype.buildOpt; + + /** + * @alias ProtoBuf.Reflect.Service.Method + * @expose + */ + Reflect.Service.Method = Method; + + /** + * RPC service method. + * @exports ProtoBuf.Reflect.Service.RPCMethod + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {string} request Request message name + * @param {string} response Response message name + * @param {boolean} request_stream Whether requests are streamed + * @param {boolean} response_stream Whether responses are streamed + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Service.Method + */ + var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) { + Method.call(this, builder, svc, name, options); + + /** + * @override + */ + this.className = "Service.RPCMethod"; + + /** + * Request message name. + * @type {string} + * @expose + */ + this.requestName = request; + + /** + * Response message name. + * @type {string} + * @expose + */ + this.responseName = response; + + /** + * Whether requests are streamed + * @type {bool} + * @expose + */ + this.requestStream = request_stream; + + /** + * Whether responses are streamed + * @type {bool} + * @expose + */ + this.responseStream = response_stream; + + /** + * Resolved request message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedRequestType = null; + + /** + * Resolved response message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedResponseType = null; + }; + + // Extends Method + RPCMethod.prototype = Object.create(Method.prototype); + + /** + * @alias ProtoBuf.Reflect.Service.RPCMethod + * @expose + */ + Reflect.Service.RPCMethod = RPCMethod; + + return Reflect; + + })(ProtoBuf); + + /** + * @alias ProtoBuf.Builder + * @expose + */ + ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) { + "use strict"; + + /** + * Constructs a new Builder. + * @exports ProtoBuf.Builder + * @class Provides the functionality to build protocol messages. + * @param {Object.=} options Options + * @constructor + */ + var Builder = function(options) { + + /** + * Namespace. + * @type {ProtoBuf.Reflect.Namespace} + * @expose + */ + this.ns = new Reflect.Namespace(this, null, ""); // Global namespace + + /** + * Namespace pointer. + * @type {ProtoBuf.Reflect.T} + * @expose + */ + this.ptr = this.ns; + + /** + * Resolved flag. + * @type {boolean} + * @expose + */ + this.resolved = false; + + /** + * The current building result. + * @type {Object.|null} + * @expose + */ + this.result = null; + + /** + * Imported files. + * @type {Array.} + * @expose + */ + this.files = {}; + + /** + * Import root override. + * @type {?string} + * @expose + */ + this.importRoot = null; + + /** + * Options. + * @type {!Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Builder.prototype + * @inner + */ + var BuilderPrototype = Builder.prototype; + + // ----- Definition tests ----- + + /** + * Tests if a definition most likely describes a message. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessage = function(def) { + // Messages require a string name + if (typeof def["name"] !== 'string') + return false; + // Messages do not contain values (enum) or rpc methods (service) + if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a message field. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessageField = function(def) { + // Message fields require a string rule, name and type and an id + if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an enum. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isEnum = function(def) { + // Enums require a string name + if (typeof def["name"] !== 'string') + return false; + // Enums require at least one value + if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a service. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isService = function(def) { + // Services require a string name and an rpc object + if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"]) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an extended message + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isExtend = function(def) { + // Extends rquire a string ref + if (typeof def["ref"] !== 'string') + return false; + return true; + }; + + // ----- Building ----- + + /** + * Resets the pointer to the root namespace. + * @returns {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.reset = function() { + this.ptr = this.ns; + return this; + }; + + /** + * Defines a namespace on top of the current pointer position and places the pointer on it. + * @param {string} namespace + * @return {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.define = function(namespace) { + if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace)) + throw Error("illegal namespace: "+namespace); + namespace.split(".").forEach(function(part) { + var ns = this.ptr.getChild(part); + if (ns === null) // Keep existing + this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part)); + this.ptr = ns; + }, this); + return this; + }; + + /** + * Creates the specified definitions at the current pointer position. + * @param {!Array.} defs Messages, enums or services to create + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If a message definition is invalid + * @expose + */ + BuilderPrototype.create = function(defs) { + if (!defs) + return this; // Nothing to create + if (!Array.isArray(defs)) + defs = [defs]; + else { + if (defs.length === 0) + return this; + defs = defs.slice(); + } + + // It's quite hard to keep track of scopes and memory here, so let's do this iteratively. + var stack = [defs]; + while (stack.length > 0) { + defs = stack.pop(); + + if (!Array.isArray(defs)) // Stack always contains entire namespaces + throw Error("not a valid namespace: "+JSON.stringify(defs)); + + while (defs.length > 0) { + var def = defs.shift(); // Namespaces always contain an array of messages, enums and services + + if (Builder.isMessage(def)) { + var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]); + + // Create OneOfs + var oneofs = {}; + if (def["oneofs"]) + Object.keys(def["oneofs"]).forEach(function(name) { + obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name)); + }, this); + + // Create fields + if (def["fields"]) + def["fields"].forEach(function(fld) { + if (obj.getChild(fld["id"]|0) !== null) + throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']); + if (fld["options"] && typeof fld["options"] !== 'object') + throw Error("illegal field options in "+obj.name+"#"+fld["name"]); + var oneof = null; + if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]])) + throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]); + fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]); + if (oneof) + oneof.fields.push(fld); + obj.addChild(fld); + }, this); + + // Push children to stack + var subObj = []; + if (def["enums"]) + def["enums"].forEach(function(enm) { + subObj.push(enm); + }); + if (def["messages"]) + def["messages"].forEach(function(msg) { + subObj.push(msg); + }); + if (def["services"]) + def["services"].forEach(function(svc) { + subObj.push(svc); + }); + + // Set extension ranges + if (def["extensions"]) { + if (typeof def["extensions"][0] === 'number') // pre 5.0.1 + obj.extensions = [ def["extensions"] ]; + else + obj.extensions = def["extensions"]; + } + + // Create on top of current namespace + this.ptr.addChild(obj); + if (subObj.length > 0) { + stack.push(defs); // Push the current level back + defs = subObj; // Continue processing sub level + subObj = null; + this.ptr = obj; // And move the pointer to this namespace + obj = null; + continue; + } + subObj = null; + + } else if (Builder.isEnum(def)) { + + obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]); + def["values"].forEach(function(val) { + obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isService(def)) { + + obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]); + Object.keys(def["rpc"]).forEach(function(name) { + var mtd = def["rpc"][name]; + obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isExtend(def)) { + + obj = this.ptr.resolve(def["ref"], true); + if (obj) { + def["fields"].forEach(function(fld) { + if (obj.getChild(fld['id']|0) !== null) + throw Error("duplicate extended field id in "+obj.name+": "+fld['id']); + // Check if field id is allowed to be extended + if (obj.extensions) { + var valid = false; + obj.extensions.forEach(function(range) { + if (fld["id"] >= range[0] && fld["id"] <= range[1]) + valid = true; + }); + if (!valid) + throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)"); + } + // Convert extension field names to camel case notation if the override is set + var name = fld["name"]; + if (this.options['convertFieldsToCamelCase']) + name = ProtoBuf.Util.toCamelCase(name); + // see #161: Extensions use their fully qualified name as their runtime key and... + var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]); + // ...are added on top of the current namespace as an extension which is used for + // resolving their type later on (the extension always keeps the original name to + // prevent naming collisions) + var ext = new Reflect.Extension(this, this.ptr, fld["name"], field); + field.extension = ext; + this.ptr.addChild(ext); + obj.addChild(field); + }, this); + + } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions + throw Error("extended message "+def["ref"]+" is not defined"); + + } else + throw Error("not a valid definition: "+JSON.stringify(def)); + + def = null; + obj = null; + } + // Break goes here + defs = null; + this.ptr = this.ptr.parent; // Namespace done, continue at parent + } + this.resolved = false; // Require re-resolve + this.result = null; // Require re-build + return this; + }; + + /** + * Propagates syntax to all children. + * @param {!Object} parent + * @inner + */ + function propagateSyntax(parent) { + if (parent['messages']) { + parent['messages'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + propagateSyntax(child); + }); + } + if (parent['enums']) { + parent['enums'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + }); + } + } + + /** + * Imports another definition into this builder. + * @param {Object.} json Parsed import + * @param {(string|{root: string, file: string})=} filename Imported file name + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If the definition or file cannot be imported + * @expose + */ + BuilderPrototype["import"] = function(json, filename) { + var delim = '/'; + + // Make sure to skip duplicate imports + + if (typeof filename === 'string') { + + if (ProtoBuf.Util.IS_NODE) + filename = require$$2['resolve'](filename); + if (this.files[filename] === true) + return this.reset(); + this.files[filename] = true; + + } else if (typeof filename === 'object') { // Object with root, file. + + var root = filename.root; + if (ProtoBuf.Util.IS_NODE) + root = require$$2['resolve'](root); + if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0) + delim = '\\'; + var fname; + if (ProtoBuf.Util.IS_NODE) + fname = require$$2['join'](root, filename.file); + else + fname = root + delim + filename.file; + if (this.files[fname] === true) + return this.reset(); + this.files[fname] = true; + } + + // Import imports + + if (json['imports'] && json['imports'].length > 0) { + var importRoot, + resetRoot = false; + + if (typeof filename === 'object') { // If an import root is specified, override + + this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards + importRoot = this.importRoot; + filename = filename["file"]; + if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) + delim = '\\'; + + } else if (typeof filename === 'string') { + + if (this.importRoot) // If import root is overridden, use it + importRoot = this.importRoot; + else { // Otherwise compute from filename + if (filename.indexOf("/") >= 0) { // Unix + importRoot = filename.replace(/\/[^\/]*$/, ""); + if (/* /file.proto */ importRoot === "") + importRoot = "/"; + } else if (filename.indexOf("\\") >= 0) { // Windows + importRoot = filename.replace(/\\[^\\]*$/, ""); + delim = '\\'; + } else + importRoot = "."; + } + + } else + importRoot = null; + + for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned. + * @returns {!ProtoBuf.Builder.Message|!Object.} + * @throws {Error} If a type could not be resolved + * @expose + */ + BuilderPrototype.build = function(path) { + this.reset(); + if (!this.resolved) + this.resolveAll(), + this.resolved = true, + this.result = null; // Require re-build + if (this.result === null) // (Re-)Build + this.result = this.ns.build(); + if (!path) + return this.result; + var part = typeof path === 'string' ? path.split(".") : path, + ptr = this.result; // Build namespace pointer (no hasChild etc.) + for (var i=0; i=} contents Initial contents + * @constructor + */ + var Map = function(field, contents) { + if (!field.map) + throw Error("field is not a map"); + + /** + * The field corresponding to this map. + * @type {!ProtoBuf.Reflect.Field} + */ + this.field = field; + + /** + * Element instance corresponding to key type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax); + + /** + * Element instance corresponding to value type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax); + + /** + * Internal map: stores mapping of (string form of key) -> (key, value) + * pair. + * + * We provide map semantics for arbitrary key types, but we build on top + * of an Object, which has only string keys. In order to avoid the need + * to convert a string key back to its native type in many situations, + * we store the native key value alongside the value. Thus, we only need + * a one-way mapping from a key type to its string form that guarantees + * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1 + * === K2). + * + * @type {!Object} + */ + this.map = {}; + + /** + * Returns the number of elements in the map. + */ + Object.defineProperty(this, "size", { + get: function() { return Object.keys(this.map).length; } + }); + + // Fill initial contents from a raw object. + if (contents) { + var keys = Object.keys(contents); + for (var i = 0; i < keys.length; i++) { + var key = this.keyElem.valueFromString(keys[i]); + var val = this.valueElem.verifyValue(contents[keys[i]]); + this.map[this.keyElem.valueToString(key)] = + { key: key, value: val }; + } + } + }; + + var MapPrototype = Map.prototype; + + /** + * Helper: return an iterator over an array. + * @param {!Array<*>} arr the array + * @returns {!Object} an iterator + * @inner + */ + function arrayIterator(arr) { + var idx = 0; + return { + next: function() { + if (idx < arr.length) + return { done: false, value: arr[idx++] }; + return { done: true }; + } + } + } + + /** + * Clears the map. + */ + MapPrototype.clear = function() { + this.map = {}; + }; + + /** + * Deletes a particular key from the map. + * @returns {boolean} Whether any entry with this key was deleted. + */ + MapPrototype["delete"] = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + var hadKey = keyValue in this.map; + delete this.map[keyValue]; + return hadKey; + }; + + /** + * Returns an iterator over [key, value] pairs in the map. + * @returns {Object} The iterator + */ + MapPrototype.entries = function() { + var entries = []; + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + entries.push([(entry=this.map[strKeys[i]]).key, entry.value]); + return arrayIterator(entries); + }; + + /** + * Returns an iterator over keys in the map. + * @returns {Object} The iterator + */ + MapPrototype.keys = function() { + var keys = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + keys.push(this.map[strKeys[i]].key); + return arrayIterator(keys); + }; + + /** + * Returns an iterator over values in the map. + * @returns {!Object} The iterator + */ + MapPrototype.values = function() { + var values = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + values.push(this.map[strKeys[i]].value); + return arrayIterator(values); + }; + + /** + * Iterates over entries in the map, calling a function on each. + * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments. + * @param {Object=} thisArg The `this` value for the callback + */ + MapPrototype.forEach = function(cb, thisArg) { + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this); + }; + + /** + * Sets a key in the map to the given value. + * @param {*} key The key + * @param {*} value The value + * @returns {!ProtoBuf.Map} The map instance + */ + MapPrototype.set = function(key, value) { + var keyValue = this.keyElem.verifyValue(key); + var valValue = this.valueElem.verifyValue(value); + this.map[this.keyElem.valueToString(keyValue)] = + { key: keyValue, value: valValue }; + return this; + }; + + /** + * Gets the value corresponding to a key in the map. + * @param {*} key The key + * @returns {*|undefined} The value, or `undefined` if key not present + */ + MapPrototype.get = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + if (!(keyValue in this.map)) + return undefined; + return this.map[keyValue].value; + }; + + /** + * Determines whether the given key is present in the map. + * @param {*} key The key + * @returns {boolean} `true` if the key is present + */ + MapPrototype.has = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + return (keyValue in this.map); + }; + + return Map; + })(ProtoBuf, ProtoBuf.Reflect); + + + /** + * Constructs a new empty Builder. + * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf + * @return {!ProtoBuf.Builder} Builder + * @expose + */ + ProtoBuf.newBuilder = function(options) { + options = options || {}; + if (typeof options['convertFieldsToCamelCase'] === 'undefined') + options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase; + if (typeof options['populateAccessors'] === 'undefined') + options['populateAccessors'] = ProtoBuf.populateAccessors; + return new ProtoBuf.Builder(options); + }; + + /** + * Loads a .json definition and returns the Builder. + * @param {!*|string} json JSON definition + * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted. + * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. + * @return {ProtoBuf.Builder} Builder to create new messages + * @throws {Error} If the definition cannot be parsed or built + * @expose + */ + ProtoBuf.loadJson = function(json, builder, filename) { + if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string')) + filename = builder, + builder = null; + if (!builder || typeof builder !== 'object') + builder = ProtoBuf.newBuilder(); + if (typeof json === 'string') + json = JSON.parse(json); + builder["import"](json, filename); + builder.resolveAll(); + return builder; + }; + + /** + * Loads a .json file and returns the Builder. + * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with + * an overridden 'root' path for all imported files. + * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and + * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the + * file will be read synchronously and this function will return the Builder. + * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. + * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the + * request has failed), else undefined + * @expose + */ + ProtoBuf.loadJsonFile = function(filename, callback, builder) { + if (callback && typeof callback === 'object') + builder = callback, + callback = null; + else if (!callback || typeof callback !== 'function') + callback = null; + if (callback) + return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) { + if (contents === null) { + callback(Error("Failed to fetch file")); + return; + } + try { + callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename)); + } catch (e) { + callback(e); + } + }); + var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename); + return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename); + }; + + return ProtoBuf; + }); + }); + + var messageCompiled = protobufLight.newBuilder({})['import']({ + "package": "push_server.messages2", + "syntax": "proto2", + "options": { + "objc_class_prefix": "AVIM" + }, + "messages": [{ + "name": "JsonObjectMessage", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "data", + "id": 1 + }] + }, { + "name": "UnreadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "required", + "type": "int32", + "name": "unread", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentioned", + "id": 8 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 9 + }] + }, { + "name": "LogItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "from", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "msgId", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "ackAt", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "readAt", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 9 + }, { + "rule": "optional", + "type": "bool", + "name": "bin", + "id": 10 + }] + }, { + "name": "DataCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 1 + }, { + "rule": "repeated", + "type": "JsonObjectMessage", + "name": "msg", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 3 + }] + }, { + "name": "SessionCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int64", + "name": "t", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "ua", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tag", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "deviceId", + "id": 7 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "onlineSessionPeerIds", + "id": 9 + }, { + "rule": "optional", + "type": "string", + "name": "st", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "stTtl", + "id": 11 + }, { + "rule": "optional", + "type": "int32", + "name": "code", + "id": 12 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "deviceToken", + "id": 14 + }, { + "rule": "optional", + "type": "bool", + "name": "sp", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 16 + }, { + "rule": "optional", + "type": "int64", + "name": "lastUnreadNotifTime", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 18 + }, { + "rule": "optional", + "type": "int64", + "name": "configBitmap", + "id": 19 + }] + }, { + "name": "ErrorCommand", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "required", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 4 + }] + }, { + "name": "DirectCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "msg", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "fromPeerId", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 5 + }, { + "rule": "optional", + "type": "bool", + "name": "hasMore", + "id": 6 + }, { + "rule": "repeated", + "type": "string", + "name": "toPeerIds", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 10 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "id", + "id": 12 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "dt", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "pushData", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "will", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 18 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 19 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 20 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 21 + }] + }, { + "name": "AckCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "fromts", + "id": 7 + }, { + "rule": "optional", + "type": "int64", + "name": "tots", + "id": 8 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 11 + }] + }, { + "name": "UnreadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "UnreadTuple", + "name": "convs", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "notifTime", + "id": 2 + }] + }, { + "name": "ConvCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "m", + "id": 1 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "unique", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "cdate", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "initBy", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "sort", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 8 + }, { + "rule": "optional", + "type": "int32", + "name": "skip", + "id": 9 + }, { + "rule": "optional", + "type": "int32", + "name": "flag", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "count", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "udate", + "id": 12 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 15 + }, { + "rule": "optional", + "type": "bool", + "name": "statusSub", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "statusPub", + "id": 17 + }, { + "rule": "optional", + "type": "int32", + "name": "statusTTL", + "id": 18 + }, { + "rule": "optional", + "type": "string", + "name": "uniqueId", + "id": 19 + }, { + "rule": "optional", + "type": "string", + "name": "targetClientId", + "id": 20 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 21 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 22 + }, { + "rule": "optional", + "type": "bool", + "name": "queryAllMembers", + "id": 23 + }, { + "rule": "repeated", + "type": "MaxReadTuple", + "name": "maxReadTuples", + "id": 24 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 25 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "results", + "id": 100 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "where", + "id": 101 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "attr", + "id": 103 + }] + }, { + "name": "RoomCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 5 + }, { + "rule": "repeated", + "type": "string", + "name": "roomPeerIds", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "byPeerId", + "id": 7 + }] + }, { + "name": "LogsCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int32", + "name": "l", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "tt", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tmid", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 7 + }, { + "rule": "optional", + "type": "string", + "name": "checksum", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "stored", + "id": 9 + }, { + "rule": "optional", + "type": "QueryDirection", + "name": "direction", + "id": 10, + "options": { + "default": "OLD" + } + }, { + "rule": "optional", + "type": "bool", + "name": "tIncluded", + "id": 11 + }, { + "rule": "optional", + "type": "bool", + "name": "ttIncluded", + "id": 12 + }, { + "rule": "repeated", + "type": "LogItem", + "name": "logs", + "id": 105 + }], + "enums": [{ + "name": "QueryDirection", + "syntax": "proto2", + "values": [{ + "name": "OLD", + "id": 1 + }, { + "name": "NEW", + "id": 2 + }] + }] + }, { + "name": "RcpCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "id", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "read", + "id": 4 + }] + }, { + "name": "ReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }] + }, { + "name": "MaxReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "pid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 3 + }] + }, { + "name": "ReadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 2 + }, { + "rule": "repeated", + "type": "ReadTuple", + "name": "convs", + "id": 3 + }] + }, { + "name": "PresenceCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "StatusType", + "name": "status", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 3 + }] + }, { + "name": "ReportCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "bool", + "name": "initiative", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 3 + }] + }, { + "name": "PatchItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "recall", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 7 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 10 + }] + }, { + "name": "PatchCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "PatchItem", + "name": "patches", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 2 + }] + }, { + "name": "GenericCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "CommandType", + "name": "cmd", + "id": 1 + }, { + "rule": "optional", + "type": "OpType", + "name": "op", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "appId", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "peerId", + "id": 4 + }, { + "rule": "optional", + "type": "int32", + "name": "i", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "installationId", + "id": 6 + }, { + "rule": "optional", + "type": "int32", + "name": "priority", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "service", + "id": 8 + }, { + "rule": "optional", + "type": "DataCommand", + "name": "dataMessage", + "id": 101 + }, { + "rule": "optional", + "type": "SessionCommand", + "name": "sessionMessage", + "id": 102 + }, { + "rule": "optional", + "type": "ErrorCommand", + "name": "errorMessage", + "id": 103 + }, { + "rule": "optional", + "type": "DirectCommand", + "name": "directMessage", + "id": 104 + }, { + "rule": "optional", + "type": "AckCommand", + "name": "ackMessage", + "id": 105 + }, { + "rule": "optional", + "type": "UnreadCommand", + "name": "unreadMessage", + "id": 106 + }, { + "rule": "optional", + "type": "ReadCommand", + "name": "readMessage", + "id": 107 + }, { + "rule": "optional", + "type": "RcpCommand", + "name": "rcpMessage", + "id": 108 + }, { + "rule": "optional", + "type": "LogsCommand", + "name": "logsMessage", + "id": 109 + }, { + "rule": "optional", + "type": "ConvCommand", + "name": "convMessage", + "id": 110 + }, { + "rule": "optional", + "type": "RoomCommand", + "name": "roomMessage", + "id": 111 + }, { + "rule": "optional", + "type": "PresenceCommand", + "name": "presenceMessage", + "id": 112 + }, { + "rule": "optional", + "type": "ReportCommand", + "name": "reportMessage", + "id": 113 + }, { + "rule": "optional", + "type": "PatchCommand", + "name": "patchMessage", + "id": 114 + }] + }], + "enums": [{ + "name": "CommandType", + "syntax": "proto2", + "values": [{ + "name": "session", + "id": 0 + }, { + "name": "conv", + "id": 1 + }, { + "name": "direct", + "id": 2 + }, { + "name": "ack", + "id": 3 + }, { + "name": "rcp", + "id": 4 + }, { + "name": "unread", + "id": 5 + }, { + "name": "logs", + "id": 6 + }, { + "name": "error", + "id": 7 + }, { + "name": "login", + "id": 8 + }, { + "name": "data", + "id": 9 + }, { + "name": "room", + "id": 10 + }, { + "name": "read", + "id": 11 + }, { + "name": "presence", + "id": 12 + }, { + "name": "report", + "id": 13 + }, { + "name": "echo", + "id": 14 + }, { + "name": "loggedin", + "id": 15 + }, { + "name": "logout", + "id": 16 + }, { + "name": "loggedout", + "id": 17 + }, { + "name": "patch", + "id": 18 + }] + }, { + "name": "OpType", + "syntax": "proto2", + "values": [{ + "name": "open", + "id": 1 + }, { + "name": "add", + "id": 2 + }, { + "name": "remove", + "id": 3 + }, { + "name": "close", + "id": 4 + }, { + "name": "opened", + "id": 5 + }, { + "name": "closed", + "id": 6 + }, { + "name": "query", + "id": 7 + }, { + "name": "query_result", + "id": 8 + }, { + "name": "conflict", + "id": 9 + }, { + "name": "added", + "id": 10 + }, { + "name": "removed", + "id": 11 + }, { + "name": "start", + "id": 30 + }, { + "name": "started", + "id": 31 + }, { + "name": "joined", + "id": 32 + }, { + "name": "members_joined", + "id": 33 + }, { + "name": "left", + "id": 39 + }, { + "name": "members_left", + "id": 40 + }, { + "name": "results", + "id": 42 + }, { + "name": "count", + "id": 43 + }, { + "name": "result", + "id": 44 + }, { + "name": "update", + "id": 45 + }, { + "name": "updated", + "id": 46 + }, { + "name": "mute", + "id": 47 + }, { + "name": "unmute", + "id": 48 + }, { + "name": "status", + "id": 49 + }, { + "name": "members", + "id": 50 + }, { + "name": "max_read", + "id": 51 + }, { + "name": "is_member", + "id": 52 + }, { + "name": "join", + "id": 80 + }, { + "name": "invite", + "id": 81 + }, { + "name": "leave", + "id": 82 + }, { + "name": "kick", + "id": 83 + }, { + "name": "reject", + "id": 84 + }, { + "name": "invited", + "id": 85 + }, { + "name": "kicked", + "id": 86 + }, { + "name": "upload", + "id": 100 + }, { + "name": "uploaded", + "id": 101 + }, { + "name": "modify", + "id": 150 + }, { + "name": "modified", + "id": 151 + }] + }, { + "name": "StatusType", + "syntax": "proto2", + "values": [{ + "name": "on", + "id": 1 + }, { + "name": "off", + "id": 2 + }] + }], + "isNamespace": true + }).build(); + + var _messages$push_server = messageCompiled.push_server.messages2; + var JsonObjectMessage = _messages$push_server.JsonObjectMessage; + var UnreadTuple = _messages$push_server.UnreadTuple; + var LogItem = _messages$push_server.LogItem; + var DataCommand = _messages$push_server.DataCommand; + var SessionCommand = _messages$push_server.SessionCommand; + var ErrorCommand = _messages$push_server.ErrorCommand; + var DirectCommand = _messages$push_server.DirectCommand; + var AckCommand = _messages$push_server.AckCommand; + var UnreadCommand = _messages$push_server.UnreadCommand; + var ConvCommand = _messages$push_server.ConvCommand; + var RoomCommand = _messages$push_server.RoomCommand; + var LogsCommand = _messages$push_server.LogsCommand; + var RcpCommand = _messages$push_server.RcpCommand; + var ReadTuple = _messages$push_server.ReadTuple; + var MaxReadTuple = _messages$push_server.MaxReadTuple; + var ReadCommand = _messages$push_server.ReadCommand; + var PresenceCommand = _messages$push_server.PresenceCommand; + var ReportCommand = _messages$push_server.ReportCommand; + var GenericCommand = _messages$push_server.GenericCommand; + var PatchCommand = _messages$push_server.PatchCommand; + var PatchItem = _messages$push_server.PatchItem; + var CommandType = _messages$push_server.CommandType; + var OpType = _messages$push_server.OpType; + var StatusType = _messages$push_server.StatusType; + + + + + var message = Object.freeze({ + JsonObjectMessage: JsonObjectMessage, + UnreadTuple: UnreadTuple, + LogItem: LogItem, + DataCommand: DataCommand, + SessionCommand: SessionCommand, + ErrorCommand: ErrorCommand, + DirectCommand: DirectCommand, + AckCommand: AckCommand, + UnreadCommand: UnreadCommand, + ConvCommand: ConvCommand, + RoomCommand: RoomCommand, + LogsCommand: LogsCommand, + RcpCommand: RcpCommand, + ReadTuple: ReadTuple, + MaxReadTuple: MaxReadTuple, + ReadCommand: ReadCommand, + PresenceCommand: PresenceCommand, + ReportCommand: ReportCommand, + GenericCommand: GenericCommand, + PatchCommand: PatchCommand, + PatchItem: PatchItem, + CommandType: CommandType, + OpType: OpType, + StatusType: StatusType + }); + + var eventemitter3 = createCommonjsModule(function (module) { + 'use strict'; + + var has = Object.prototype.hasOwnProperty + , prefix = '~'; + + /** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ + function Events() {} + + // + // We try to not inherit from `Object.prototype`. In some engines creating an + // instance in this way is faster than calling `Object.create(null)` directly. + // If `Object.create(null)` is not supported we prefix the event names with a + // character to make sure that the built-in object properties are not + // overridden or used as an attack vector. + // + if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; + } + + /** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ + function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; + } + + /** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ + function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; + } + + /** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ + EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; + }; + + /** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ + EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; + }; + + /** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ + EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; + }; + + /** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; + }; + + /** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; + }; + + // + // Alias methods names because people roll like that. + // + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + + // + // This function doesn't apply anymore. + // + EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; + }; + + // + // Expose the prefix. + // + EventEmitter.prefixed = prefix; + + // + // Allow `EventEmitter` to be imported as module namespace. + // + EventEmitter.EventEmitter = EventEmitter; + + // + // Expose the module. + // + { + module.exports = EventEmitter; + } + }); + + var runtime = createCommonjsModule(function (module) { + /** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + + !(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = 'object' === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + })( + // In sloppy mode, unbound `this` refers to the global object, fallback to + // Function constructor if we're in global strict mode. That is sadly a form + // of indirect eval which violates Content Security Policy. + (function() { return this })() || Function("return this")() + ); + }); + + // This method of obtaining a reference to the global object needs to be + // kept identical to the way it is obtained in runtime.js + var g = (function() { return this })() || Function("return this")(); + + // Use `getOwnPropertyNames` because not all browsers support calling + // `hasOwnProperty` on the global `self` object in a worker. See #183. + var hadRuntime = g.regeneratorRuntime && + Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; + + // Save the old regeneratorRuntime in case it needs to be restored later. + var oldRuntime = hadRuntime && g.regeneratorRuntime; + + // Force reevalutation of runtime.js. + g.regeneratorRuntime = undefined; + + var runtimeModule = runtime; + + if (hadRuntime) { + // Restore the original runtime. + g.regeneratorRuntime = oldRuntime; + } else { + // Remove the global property added by runtime.js. + try { + delete g.regeneratorRuntime; + } catch(e) { + g.regeneratorRuntime = undefined; + } + } + + var regenerator = runtimeModule; + + // 19.1.2.1 Object.assign(target, source, ...) + + + + + + var $assign = Object.assign; + + // should work with symbols and should have deterministic property order (V8 bug) + var _objectAssign = !$assign || _fails(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; + }) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = _toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = _objectGops.f; + var isEnum = _objectPie.f; + while (aLen > index) { + var S = _iobject(arguments[index++]); + var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; + } : $assign; + + // 19.1.3.1 Object.assign(target, source) + + + _export(_export.S + _export.F, 'Object', { assign: _objectAssign }); + + var assign$2 = _core.Object.assign; + + var assign$1 = createCommonjsModule(function (module) { + module.exports = { "default": assign$2, __esModule: true }; + }); + + var _Object$assign = unwrapExports(assign$1); + + var _extends = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _assign2 = _interopRequireDefault(assign$1); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + }); + + var _extends$1 = unwrapExports(_extends); + + var asyncToGenerator = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _promise2 = _interopRequireDefault(promise); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (fn) { + return function () { + var gen = fn.apply(this, arguments); + return new _promise2.default(function (resolve, reject) { + function step(key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + return _promise2.default.resolve(value).then(function (value) { + step("next", value); + }, function (err) { + step("throw", err); + }); + } + } + + return step("next"); + }); + }; + }; + }); + + var _asyncToGenerator = unwrapExports(asyncToGenerator); + + var _createProperty = function (object, index, value) { + if (index in object) _objectDp.f(object, index, _propertyDesc(0, value)); + else object[index] = value; + }; + + _export(_export.S + _export.F * !_iterDetect(function (iter) { Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = _toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iterFn = core_getIteratorMethod(O); + var length, result, step, iterator; + if (mapping) mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + _createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = _toLength(O.length); + for (result = new C(length); length > index; index++) { + _createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } + }); + + var from$1 = _core.Array.from; + + var from = createCommonjsModule(function (module) { + module.exports = { "default": from$1, __esModule: true }; + }); + + var toConsumableArray = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _from2 = _interopRequireDefault(from); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } else { + return (0, _from2.default)(arr); + } + }; + }); + + var _toConsumableArray = unwrapExports(toConsumableArray); + + var _validateCollection = function (it, TYPE) { + if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; + }; + + var dP$2 = _objectDp.f; + + + + + + + + + + var fastKey = _meta.fastKey; + + var SIZE = _descriptors ? '_s' : 'size'; + + var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } + }; + + var _collectionStrong = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + _anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = _objectCreate(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); + }); + _redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = _validateCollection(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + _validateCollection(this, NAME); + var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(_validateCollection(this, NAME), key); + } + }); + if (_descriptors) dP$2(C.prototype, 'size', { + get: function () { + return _validateCollection(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + _iterDefine(C, NAME, function (iterated, kind) { + this._t = _validateCollection(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return _iterStep(1); + } + // return step by kind + if (kind == 'keys') return _iterStep(0, entry.k); + if (kind == 'values') return _iterStep(0, entry.v); + return _iterStep(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + _setSpecies(NAME); + } + }; + + var SPECIES$2 = _wks('species'); + + var _arraySpeciesConstructor = function (original) { + var C; + if (_isArray(original)) { + C = original.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined; + if (_isObject(C)) { + C = C[SPECIES$2]; + if (C === null) C = undefined; + } + } return C === undefined ? Array : C; + }; + + // 9.4.2.3 ArraySpeciesCreate(originalArray, length) + + + var _arraySpeciesCreate = function (original, length) { + return new (_arraySpeciesConstructor(original))(length); + }; + + // 0 -> Array#forEach + // 1 -> Array#map + // 2 -> Array#filter + // 3 -> Array#some + // 4 -> Array#every + // 5 -> Array#find + // 6 -> Array#findIndex + + + + + + var _arrayMethods = function (TYPE, $create) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + var create = $create || _arraySpeciesCreate; + return function ($this, callbackfn, that) { + var O = _toObject($this); + var self = _iobject(O); + var f = _ctx(callbackfn, that, 3); + var length = _toLength(self.length); + var index = 0; + var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var val, res; + for (;length > index; index++) if (NO_HOLES || index in self) { + val = self[index]; + res = f(val, index, O); + if (TYPE) { + if (IS_MAP) result[index] = res; // map + else if (res) switch (TYPE) { + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; + }; + + var dP$3 = _objectDp.f; + var each = _arrayMethods(0); + + + var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = _global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + if (!_descriptors || typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + _redefineAll(C.prototype, methods); + _meta.NEED = true; + } else { + C = wrapper(function (target, iterable) { + _anInstance(target, C, NAME, '_c'); + target._c = new Base(); + if (iterable != undefined) _forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if (KEY in proto && !(IS_WEAK && KEY == 'clear')) _hide(C.prototype, KEY, function (a, b) { + _anInstance(this, C, KEY); + if (!IS_ADDER && IS_WEAK && !_isObject(a)) return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + IS_WEAK || dP$3(C.prototype, 'size', { + get: function () { + return this._c.size; + } + }); + } + + _setToStringTag(C, NAME); + + O[NAME] = C; + _export(_export.G + _export.W + _export.F, O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; + }; + + var SET = 'Set'; + + // 23.2 Set Objects + var es6_set = _collection(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return _collectionStrong.def(_validateCollection(this, SET), value = value === 0 ? 0 : value, value); + } + }, _collectionStrong); + + var _arrayFromIterable = function (iter, ITERATOR) { + var result = []; + _forOf(iter, false, result.push, result, ITERATOR); + return result; + }; + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + + + var _collectionToJson = function (NAME) { + return function toJSON() { + if (_classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return _arrayFromIterable(this); + }; + }; + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + + + _export(_export.P + _export.R, 'Set', { toJSON: _collectionToJson('Set') }); + + // https://tc39.github.io/proposal-setmap-offrom/ + + + var _setCollectionOf = function (COLLECTION) { + _export(_export.S, COLLECTION, { of: function of() { + var length = arguments.length; + var A = Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); + } }); + }; + + // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of + _setCollectionOf('Set'); + + // https://tc39.github.io/proposal-setmap-offrom/ + + + + + + var _setCollectionFrom = function (COLLECTION) { + _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + _aFunction(this); + mapping = mapFn !== undefined; + if (mapping) _aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + cb = _ctx(mapFn, arguments[2], 2); + _forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + _forOf(source, false, A.push, A); + } + return new this(A); + } }); + }; + + // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from + _setCollectionFrom('Set'); + + var set$1 = _core.Set; + + var set = createCommonjsModule(function (module) { + module.exports = { "default": set$1, __esModule: true }; + }); + + var _Set = unwrapExports(set); + + /** + * Helpers. + */ + + var s = 1000; + var m = s * 60; + var h = m * 60; + var d$1 = h * 24; + var y = d$1 * 365.25; + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + var ms = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); + }; + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d$1; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + if (ms >= d$1) { + return Math.round(ms / d$1) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + return plural(ms, d$1, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; + } + + /** + * Pluralization helper. + */ + + function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; + } + + var debug$1 = createCommonjsModule(function (module, exports) { + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; + exports.coerce = coerce; + exports.disable = disable; + exports.enable = enable; + exports.enabled = enabled; + exports.humanize = ms; + + /** + * The currently active debug mode names, and names to skip. + */ + + exports.names = []; + exports.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + + exports.formatters = {}; + + /** + * Previous log timestamp. + */ + + var prevTime; + + /** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + + function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; + } + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms$$1 = curr - (prevTime || curr); + self.diff = ms$$1; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @api public + */ + + function disable() { + exports.enable(''); + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; + } + }); + + var browser$1 = createCommonjsModule(function (module, exports) { + /** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = debug$1; + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + + /** + * Colors. + */ + + exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + } + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } + }; + + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + } + + /** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; + } + + /** + * Enable namespaces listed in `localStorage.debug` initially. + */ + + exports.enable(load()); + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage() { + try { + return window.localStorage; + } catch (e) {} + } + }); + + var bind = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; + }; + + /*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + + // The _isBuffer check is for Safari 5-7 support, because it's missing + // Object.prototype.constructor. Remove this eventually + var isBuffer_1 = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) + }; + + function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) + } + + // For Node v0.10 support. Remove this eventually. + function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) + } + + /*global toString:true*/ + + // utils is a library of generic helper functions non-specific to axios + + var toString$2 = Object.prototype.toString; + + /** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ + function isArray$1(val) { + return toString$2.call(val) === '[object Array]'; + } + + /** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ + function isArrayBuffer(val) { + return toString$2.call(val) === '[object ArrayBuffer]'; + } + + /** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ + function isFormData(val) { + return typeof FormData !== 'undefined' && val instanceof FormData; + } + + /** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ + function isArrayBufferView(val) { + var result; + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && val.buffer instanceof ArrayBuffer; + } + return result; + } + + /** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ + function isString(val) { + return typeof val === 'string'; + } + + /** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ + function isNumber(val) { + return typeof val === 'number'; + } + + /** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ + function isUndefined(val) { + return typeof val === 'undefined'; + } + + /** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ + function isObject$1(val) { + return val !== null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object'; + } + + /** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ + function isDate(val) { + return toString$2.call(val) === '[object Date]'; + } + + /** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ + function isFile(val) { + return toString$2.call(val) === '[object File]'; + } + + /** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ + function isBlob(val) { + return toString$2.call(val) === '[object Blob]'; + } + + /** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ + function isFunction(val) { + return toString$2.call(val) === '[object Function]'; + } + + /** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ + function isStream(val) { + return isObject$1(val) && isFunction(val.pipe); + } + + /** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ + function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; + } + + /** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ + function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); + } + + /** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + */ + function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + return false; + } + return typeof window !== 'undefined' && typeof document !== 'undefined'; + } + + /** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ + function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && !isArray$1(obj)) { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray$1(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } + } + + /** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ + function merge() /* obj1, obj2, obj3, ... */{ + var result = {}; + function assignValue(val, key) { + if (_typeof(result[key]) === 'object' && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; + } + + /** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ + function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; + } + + var utils = { + isArray: isArray$1, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer_1, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject$1, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim + }; + + var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); + }; + + /** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ + + var enhanceError = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + error.request = request; + error.response = response; + return error; + }; + + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ + var createError = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); + }; + + /** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ + var settle = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + // Note: status is not exposed by XDomainRequest + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError('Request failed with status code ' + response.status, response.config, null, response.request, response)); + } + }; + + function encode(val) { + return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + } + + /** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ + var buildURL = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } + + if (!utils.isArray(val)) { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = _JSON$stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; + }; + + /** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ + var parseHeaders = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { + return parsed; + } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; + }; + + var isURLSameOrigin = utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() : + + // Non standard browser envs (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + }(); + + // btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js + + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + function E() { + this.message = 'String contains an invalid character'; + } + E.prototype = new Error(); + E.prototype.code = 5; + E.prototype.name = 'InvalidCharacterError'; + + function btoa$1(input) { + var str = String(input); + var output = ''; + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars; + // if the next str index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + str.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { + charCode = str.charCodeAt(idx += 3 / 4); + if (charCode > 0xFF) { + throw new E(); + } + block = block << 8 | charCode; + } + return output; + } + + var btoa_1 = btoa$1; + + var cookies = utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return match ? decodeURIComponent(match[3]) : null; + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + }() : + + // Non standard browser env (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { + return null; + }, + remove: function remove() {} + }; + }(); + + var btoa = typeof window !== 'undefined' && window.btoa && window.btoa.bind(window) || btoa_1; + + var xhr = function xhrAdapter(config) { + return new _Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + var loadEvent = 'onreadystatechange'; + var xDomain = false; + + // For IE 8/9 CORS support + // Only supports POST and GET calls and doesn't returns the response headers. + // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest. + if (process.env.NODE_ENV !== 'test' && typeof window !== 'undefined' && window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) { + request = new window.XDomainRequest(); + loadEvent = 'onload'; + xDomain = true; + request.onprogress = function handleProgress() {}; + request.ontimeout = function handleTimeout() {}; + } + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + // Listen for ready state + request[loadEvent] = function handleLoad() { + if (!request || request.readyState !== 4 && !xDomain) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201) + status: request.status === 1223 ? 204 : request.status, + statusText: request.status === 1223 ? 'No Content' : request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + var cookies$$1 = cookies; + + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? cookies$$1.read(config.xsrfCookieName) : undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (config.withCredentials) { + request.withCredentials = true; + } + + // Add responseType to request if needed + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. + // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. + if (config.responseType !== 'json') { + throw e; + } + } + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (requestData === undefined) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); + }; + + var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } + } + + function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = xhr; + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter + adapter = xhr; + } + return adapter; + } + + var defaults = { + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return _JSON$stringify(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) {/* Ignore */} + } + return data; + }], + + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } + }; + + defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } + }; + + utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); + }); + + var defaults_1 = defaults; + + function InterceptorManager() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + InterceptorManager.prototype.use = function use(fulfilled, rejected) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }); + return this.handlers.length - 1; + }; + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ + InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + }; + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ + InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + }; + + var InterceptorManager_1 = InterceptorManager; + + /** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ + var transformData = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; + }; + + var isCancel = function isCancel(value) { + return !!(value && value.__CANCEL__); + }; + + /** + * Throws a `Cancel` if cancellation has been requested. + */ + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + } + + /** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ + var dispatchRequest = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData(config.data, config.headers, config.transformRequest); + + // Flatten headers + config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers || {}); + + utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { + delete config.headers[method]; + }); + + var adapter = config.adapter || defaults_1.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData(response.data, response.headers, config.transformResponse); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData(reason.response.data, reason.response.headers, config.transformResponse); + } + } + + return _Promise.reject(reason); + }); + }; + + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + + var isAbsoluteURL = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return (/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url) + ); + }; + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ + + var combineURLs = function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; + }; + + /** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ + function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager_1(), + response: new InterceptorManager_1() + }; + } + + /** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ + Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = utils.merge({ + url: arguments[0] + }, arguments[1]); + } + + config = utils.merge(defaults_1, this.defaults, { method: 'get' }, config); + config.method = config.method.toLowerCase(); + + // Support baseURL config + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } + + // Hook up interceptors middleware + var chain = [dispatchRequest, undefined]; + var promise$$1 = _Promise.resolve(config); + + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected); + }); + + while (chain.length) { + promise$$1 = promise$$1.then(chain.shift(), chain.shift()); + } + + return promise$$1; + }; + + // Provide aliases for supported request methods + utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url + })); + }; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; + }); + + var Axios_1 = Axios; + + /** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ + + function Cancel(message) { + this.message = message; + } + + Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); + }; + + Cancel.prototype.__CANCEL__ = true; + + var Cancel_1 = Cancel; + + /** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ + function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new _Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel_1(message); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `Cancel` if cancellation has been requested. + */ + CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } + }; + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; + }; + + var CancelToken_1 = CancelToken; + + /** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ + + var spread = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + }; + + /** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ + function createInstance(defaultConfig) { + var context = new Axios_1(defaultConfig); + var instance = bind(Axios_1.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios_1.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; + } + + // Create the default instance to be exported + var axios$2 = createInstance(defaults_1); + + // Expose Axios class to allow class inheritance + axios$2.Axios = Axios_1; + + // Factory for creating new instances + axios$2.create = function create(instanceConfig) { + return createInstance(utils.merge(defaults_1, instanceConfig)); + }; + + // Expose Cancel & CancelToken + axios$2.Cancel = Cancel_1; + axios$2.CancelToken = CancelToken_1; + axios$2.isCancel = isCancel; + + // Expose all/spread + axios$2.all = function all(promises) { + return _Promise.all(promises); + }; + axios$2.spread = spread; + + var axios_1 = axios$2; + + // Allow use of default import syntax in TypeScript + var default_1 = axios$2; + + axios_1.default = default_1; + + var axios = axios_1; + + // most Object methods by ES6 should accept primitives + + + + var _objectSap = function (KEY, exec) { + var fn = (_core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp); + }; + + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + + var $getOwnPropertyDescriptor$1 = _objectGopd.f; + + _objectSap('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor$1(_toIobject(it), key); + }; + }); + + var $Object$2 = _core.Object; + var getOwnPropertyDescriptor$1 = function getOwnPropertyDescriptor(it, key) { + return $Object$2.getOwnPropertyDescriptor(it, key); + }; + + var getOwnPropertyDescriptor = createCommonjsModule(function (module) { + module.exports = { "default": getOwnPropertyDescriptor$1, __esModule: true }; + }); + + var _Object$getOwnPropertyDescriptor = unwrapExports(getOwnPropertyDescriptor); + + var stateMachine = createCommonjsModule(function (module, exports) { + /* + + Javascript State Machine Library - https://github.com/jakesgordon/javascript-state-machine + + Copyright (c) 2012, 2013, 2014, 2015, Jake Gordon and contributors + Released under the MIT license - https://github.com/jakesgordon/javascript-state-machine/blob/master/LICENSE + + */ + + (function () { + + var StateMachine = { + + //--------------------------------------------------------------------------- + + VERSION: "2.4.0", + + //--------------------------------------------------------------------------- + + Result: { + SUCCEEDED: 1, // the event transitioned successfully from one state to another + NOTRANSITION: 2, // the event was successfull but no state transition was necessary + CANCELLED: 3, // the event was cancelled by the caller in a beforeEvent callback + PENDING: 4 // the event is asynchronous and the caller is in control of when the transition occurs + }, + + Error: { + INVALID_TRANSITION: 100, // caller tried to fire an event that was innapropriate in the current state + PENDING_TRANSITION: 200, // caller tried to fire an event while an async transition was still pending + INVALID_CALLBACK: 300 // caller provided callback function threw an exception + }, + + WILDCARD: '*', + ASYNC: 'async', + + //--------------------------------------------------------------------------- + + create: function(cfg, target) { + + var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial; // allow for a simple string, or an object with { state: 'foo', event: 'setup', defer: true|false } + var terminal = cfg.terminal || cfg['final']; + var fsm = target || cfg.target || {}; + var events = cfg.events || []; + var callbacks = cfg.callbacks || {}; + var map = {}; // track state transitions allowed for an event { event: { from: [ to ] } } + var transitions = {}; // track events allowed from a state { state: [ event ] } + + var add = function(e) { + var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]); // allow 'wildcard' transition if 'from' is not specified + map[e.name] = map[e.name] || {}; + for (var n = 0 ; n < from.length ; n++) { + transitions[from[n]] = transitions[from[n]] || []; + transitions[from[n]].push(e.name); + + map[e.name][from[n]] = e.to || from[n]; // allow no-op transition if 'to' is not specified + } + if (e.to) + transitions[e.to] = transitions[e.to] || []; + }; + + if (initial) { + initial.event = initial.event || 'startup'; + add({ name: initial.event, from: 'none', to: initial.state }); + } + + for(var n = 0 ; n < events.length ; n++) + add(events[n]); + + for(var name in map) { + if (map.hasOwnProperty(name)) + fsm[name] = StateMachine.buildEvent(name, map[name]); + } + + for(var name in callbacks) { + if (callbacks.hasOwnProperty(name)) + fsm[name] = callbacks[name]; + } + + fsm.current = 'none'; + fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); }; + fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }; + fsm.cannot = function(event) { return !this.can(event); }; + fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); }; + fsm.isFinished = function() { return this.is(terminal); }; + fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; }; // default behavior when something unexpected happens is to throw an exception, but caller can override this behavior if desired (see github issue #3 and #17) + fsm.states = function() { return Object.keys(transitions).sort() }; + + if (initial && !initial.defer) + fsm[initial.event](); + + return fsm; + + }, + + //=========================================================================== + + doCallback: function(fsm, func, name, from, to, args) { + if (func) { + try { + return func.apply(fsm, [name, from, to].concat(args)); + } + catch(e) { + return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, "an exception occurred in a caller-provided callback function", e); + } + } + }, + + beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); }, + afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); }, + leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); }, + enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); }, + changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); }, + + beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); }, + afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); }, + leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); }, + enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); }, + + beforeEvent: function(fsm, name, from, to, args) { + if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) || + (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args))) + return false; + }, + + afterEvent: function(fsm, name, from, to, args) { + StateMachine.afterThisEvent(fsm, name, from, to, args); + StateMachine.afterAnyEvent( fsm, name, from, to, args); + }, + + leaveState: function(fsm, name, from, to, args) { + var specific = StateMachine.leaveThisState(fsm, name, from, to, args), + general = StateMachine.leaveAnyState( fsm, name, from, to, args); + if ((false === specific) || (false === general)) + return false; + else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general)) + return StateMachine.ASYNC; + }, + + enterState: function(fsm, name, from, to, args) { + StateMachine.enterThisState(fsm, name, from, to, args); + StateMachine.enterAnyState( fsm, name, from, to, args); + }, + + //=========================================================================== + + buildEvent: function(name, map) { + return function() { + + var from = this.current; + var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from; + var args = Array.prototype.slice.call(arguments); // turn arguments into pure array + + if (this.transition) + return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, "event " + name + " inappropriate because previous transition did not complete"); + + if (this.cannot(name)) + return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, "event " + name + " inappropriate in current state " + this.current); + + if (false === StateMachine.beforeEvent(this, name, from, to, args)) + return StateMachine.Result.CANCELLED; + + if (from === to) { + StateMachine.afterEvent(this, name, from, to, args); + return StateMachine.Result.NOTRANSITION; + } + + // prepare a transition method for use EITHER lower down, or by caller if they want an async transition (indicated by an ASYNC return value from leaveState) + var fsm = this; + this.transition = function() { + fsm.transition = null; // this method should only ever be called once + fsm.current = to; + StateMachine.enterState( fsm, name, from, to, args); + StateMachine.changeState(fsm, name, from, to, args); + StateMachine.afterEvent( fsm, name, from, to, args); + return StateMachine.Result.SUCCEEDED; + }; + this.transition.cancel = function() { // provide a way for caller to cancel async transition if desired (issue #22) + fsm.transition = null; + StateMachine.afterEvent(fsm, name, from, to, args); + }; + + var leave = StateMachine.leaveState(this, name, from, to, args); + if (false === leave) { + this.transition = null; + return StateMachine.Result.CANCELLED; + } + else if (StateMachine.ASYNC === leave) { + return StateMachine.Result.PENDING; + } + else { + if (this.transition) // need to check in case user manually called transition() but forgot to return StateMachine.ASYNC + return this.transition(); + } + + }; + } + + }; // StateMachine + + //=========================================================================== + + //====== + // NODE + //====== + { + if ('object' !== 'undefined' && module.exports) { + exports = module.exports = StateMachine; + } + exports.StateMachine = StateMachine; + } + + }()); + }); + + var getWeak = _meta.getWeak; + + + + + + + + var arrayFind = _arrayMethods(5); + var arrayFindIndex = _arrayMethods(6); + var id$1 = 0; + + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function (that) { + return that._l || (that._l = new UncaughtFrozenStore()); + }; + var UncaughtFrozenStore = function () { + this.a = []; + }; + var findUncaughtFrozen = function (store, key) { + return arrayFind(store.a, function (it) { + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function (key) { + var index = arrayFindIndex(this.a, function (it) { + return it[0] === key; + }); + if (~index) this.a.splice(index, 1); + return !!~index; + } + }; + + var _collectionWeak = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + _anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = id$1++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); + }); + _redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + if (!_isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME))['delete'](key); + return data && _has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + if (!_isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME)).has(key); + return data && _has(data, this._i); + } + }); + return C; + }, + def: function (that, key, value) { + var data = getWeak(_anObject(key), true); + if (data === true) uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore + }; + + var es6_weakMap = createCommonjsModule(function (module) { + 'use strict'; + var each = _arrayMethods(0); + + + + + + + + var WEAK_MAP = 'WeakMap'; + var getWeak = _meta.getWeak; + var isExtensible = Object.isExtensible; + var uncaughtFrozenStore = _collectionWeak.ufstore; + var tmp = {}; + var InternalMap; + + var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; + }; + + var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + if (_isObject(key)) { + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, WEAK_MAP)).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return _collectionWeak.def(_validateCollection(this, WEAK_MAP), key, value); + } + }; + + // 23.3 WeakMap Objects + var $WeakMap = module.exports = _collection(WEAK_MAP, wrapper, methods, _collectionWeak, true, true); + + // IE11 WeakMap frozen keys fix + if (_fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + InternalMap = _collectionWeak.getConstructor(wrapper, WEAK_MAP); + _objectAssign(InternalMap.prototype, methods); + _meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function (key) { + var proto = $WeakMap.prototype; + var method = proto[key]; + _redefine(proto, key, function (a, b) { + // store frozen objects on internal weakmap shim + if (_isObject(a) && !isExtensible(a)) { + if (!this._f) this._f = new InternalMap(); + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); + } + }); + + // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of + _setCollectionOf('WeakMap'); + + // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from + _setCollectionFrom('WeakMap'); + + var weakMap$1 = _core.WeakMap; + + var weakMap = createCommonjsModule(function (module) { + module.exports = { "default": weakMap$1, __esModule: true }; + }); + + var _WeakMap = unwrapExports(weakMap); + + // 19.1.2.14 Object.keys(O) + + + + _objectSap('keys', function () { + return function keys(it) { + return _objectKeys(_toObject(it)); + }; + }); + + var keys$1 = _core.Object.keys; + + var keys = createCommonjsModule(function (module) { + module.exports = { "default": keys$1, __esModule: true }; + }); + + var _Object$keys = unwrapExports(keys); + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + + var _freeGlobal = freeGlobal; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = _freeGlobal || freeSelf || Function('return this')(); + + var _root = root; + + /** Built-in value references. */ + var Symbol$1 = _root.Symbol; + + var _Symbol$1 = Symbol$1; + + /** Used for built-in method references. */ + var objectProto$1 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$3 = objectProto$1.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto$1.toString; + + /** Built-in value references. */ + var symToStringTag$1 = _Symbol$1 ? _Symbol$1.toStringTag : undefined; + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), + tag = value[symToStringTag$1]; + + try { + value[symToStringTag$1] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag$1] = tag; + } else { + delete value[symToStringTag$1]; + } + } + return result; + } + + var _getRawTag = getRawTag; + + /** Used for built-in method references. */ + var objectProto$2 = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString$1 = objectProto$2.toString; + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString$1.call(value); + } + + var _objectToString = objectToString; + + /** `Object#toString` result references. */ + var nullTag = '[object Null]'; + var undefinedTag = '[object Undefined]'; + + /** Built-in value references. */ + var symToStringTag = _Symbol$1 ? _Symbol$1.toStringTag : undefined; + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? _getRawTag(value) + : _objectToString(value); + } + + var _baseGetTag = baseGetTag; + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + var _overArg = overArg; + + /** Built-in value references. */ + var getPrototype = _overArg(Object.getPrototypeOf, Object); + + var _getPrototype = getPrototype; + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + var isObjectLike_1 = isObjectLike; + + /** `Object#toString` result references. */ + var objectTag = '[object Object]'; + + /** Used for built-in method references. */ + var funcProto = Function.prototype; + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty$2 = objectProto.hasOwnProperty; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) { + return false; + } + var proto = _getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + var isPlainObject_1 = isPlainObject; + + /* eslint-disable */ + var global$2 = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {}; + + var EXPIRED = _Symbol('expired'); + var debug$5 = browser$1('LC:Expirable'); + + var Expirable = function () { + function Expirable(value, ttl) { + _classCallCheck(this, Expirable); + + this._value = value; + if (typeof ttl === 'number') { + this.expiredAt = Date.now() + ttl; + } + } + + _createClass(Expirable, [{ + key: 'value', + get: function get() { + var expired = this.expiredAt && this.expiredAt < Date.now(); + if (expired) debug$5('expired: ' + this._value); + return expired ? EXPIRED : this._value; + } + }]); + + return Expirable; + }(); + + Expirable.EXPIRED = EXPIRED; + + var debug$6 = browser$1('LC:Cache'); + + var Cache = function () { + function Cache() { + var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'anonymous'; + + _classCallCheck(this, Cache); + + this.name = name; + this._map = {}; + } + + Cache.prototype.get = function get(key) { + var cache = this._map[key]; + if (cache) { + var value = cache.value; + if (value !== Expirable.EXPIRED) { + debug$6('[%s] hit: %s %O', this.name, key, value); + return value; + } + delete this._map[key]; + } + debug$6('[' + this.name + '] missed: ' + key); + return null; + }; + + Cache.prototype.set = function set(key, value, ttl) { + debug$6('[%s] set: %s %O %d', this.name, key, value, ttl); + this._map[key] = new Expirable(value, ttl); + }; + + return Cache; + }(); + + var tryAll = function tryAll(promiseConstructors) { + var promise$$1 = new _Promise(promiseConstructors[0]); + if (promiseConstructors.length === 1) { + return promise$$1; + } + return promise$$1.catch(function () { + return tryAll(promiseConstructors.slice(1)); + }); + }; + + var tap = function tap(interceptor) { + return function (value) { + return interceptor(value), value; + }; + }; + + + + + + var isIE10 = global$2.navigator && global$2.navigator.userAgent && global$2.navigator.userAgent.indexOf('MSIE 10.') !== -1; + + /* eslint-disable no-proto */ + + /* eslint-enable no-proto */ + + + + + var map = new _WeakMap(); + + // protected property helper + var internal = function internal(object) { + if (!map.has(object)) { + map.set(object, {}); + } + return map.get(object); + }; + + // debug utility + var removeNull = function removeNull(obj) { + if (!isPlainObject_1(obj)) return obj; + var object = _Object$assign({}, obj); + // eslint-disable-next-line no-restricted-syntax + for (var prop in object) { + if ({}.hasOwnProperty.call(object, prop)) { + var value = object[prop]; + if (value === null) { + delete object[prop]; + } else { + object[prop] = removeNull(value); + } + } + } + return object; + }; + var trim$1 = function trim(message) { + return removeNull(JSON.parse(_JSON$stringify(message))); + }; + + var ensureArray = function ensureArray(target) { + if (Array.isArray(target)) { + return target; + } + if (target === undefined || target === null) { + return []; + } + return [target]; + }; + + + + // eslint-disable-next-line no-undef + var isWeapp = (typeof wx === 'undefined' ? 'undefined' : _typeof(wx)) === 'object' && typeof wx.connectSocket === 'function'; + + // throttle decorator + + var WebSocket$3 = global$2.WebSocket || global$2.MozWebSocket; + + var _class; + + function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; + } + + // WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface. + + var debug$4 = browser$1('LC:WebSocketPlus'); + + var HEARTBEAT_TIME = 180000; + var TIMEOUT_TIME = 380000; + + var DEFAULT_RETRY_STRATEGY = function DEFAULT_RETRY_STRATEGY(attempt) { + return Math.min(1000 * Math.pow(2, attempt), 300000); + }; + + var requireConnected = function requireConnected(target, name, descriptor) { + return _Object$assign({}, descriptor, { + value: function requireConnectedWrapper() { + var _descriptor$value; + + if (!this.is('connected')) { + var currentState = this.current; + console.warn(name + ' should not be called when the connection is ' + currentState); + if (this.is('disconnected') || this.is('reconnecting')) { + console.warn('disconnect and reconnect event should be handled to avoid such calls.'); + } + throw new Error('Connection unavailable'); + } + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return (_descriptor$value = descriptor.value).call.apply(_descriptor$value, [this].concat(args)); + } + }); + }; + + var WebSocketPlus = (_class = function (_EventEmitter) { + _inherits(WebSocketPlus, _EventEmitter); + + function WebSocketPlus(getUrls, protocol) { + _classCallCheck(this, WebSocketPlus); + + if (typeof WebSocket$3 === 'undefined') { + throw new Error('WebSocket is undefined. Polyfill is required in this runtime.'); + } + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof getUrls !== 'function') { + _this._getUrls = function () { + return _Promise.resolve(getUrls); + }; + } else { + _this._getUrls = getUrls; + } + _this._protocol = protocol; + _this.init(); + _this._createWs(_this._getUrls, _this._protocol).then(function () { + _this.__postponeTimeoutTimer = _this._postponeTimeoutTimer.bind(_this); + if (global$2.addEventListener) { + _this.__pause = function () { + return _this.pause(); + }; + _this.__resume = function () { + return _this.resume(); + }; + global$2.addEventListener('offline', _this.__pause); + global$2.addEventListener('online', _this.__resume); + } + _this.open(); + }).catch(_this.throw.bind(_this)); + return _this; + } + + WebSocketPlus.prototype._createWs = function _createWs(getUrls, protocol) { + var _this2 = this; + + return getUrls().then(function (wsUrls) { + var urls = wsUrls; + if (!(urls instanceof Array)) { + urls = [urls]; + } + return tryAll(urls.map(function (url) { + return function (resolve, reject) { + debug$4('connect [' + url + '] ' + protocol); + var ws = protocol ? new WebSocket$3(url, protocol) : new WebSocket$3(url); + ws.binaryType = _this2.binaryType || 'arraybuffer'; + ws.onopen = function () { + return resolve(ws); + }; + ws.onclose = function (error) { + if (error instanceof Error) { + return reject(error); + } + // in browser, error event is useless + return reject(new Error('Failed to connect [' + url + ']')); + }; + ws.onerror = ws.onclose; + }; + })).then(function (ws) { + _this2._ws = ws; + _this2._ws.onclose = _this2._handleClose.bind(_this2); + _this2._ws.onmessage = _this2._handleMessage.bind(_this2); + return ws; + }); + }); + }; + + WebSocketPlus.prototype._destroyWs = function _destroyWs() { + var ws = this._ws; + if (!ws) return; + ws.onopen = null; + ws.onclose = null; + ws.onerror = null; + ws.onmessage = null; + this._ws = null; + ws.close(); + }; + + // eslint-disable-next-line class-methods-use-this + + + WebSocketPlus.prototype.onbeforeevent = function onbeforeevent(event, from, to) { + for (var _len2 = arguments.length, payload = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) { + payload[_key2 - 3] = arguments[_key2]; + } + + debug$4.apply(undefined, [event + ': ' + from + ' -> ' + to].concat(payload)); + }; + + WebSocketPlus.prototype.onopen = function onopen() { + this.emit('open'); + }; + + WebSocketPlus.prototype.onconnected = function onconnected() { + this._startConnectionKeeper(); + }; + + WebSocketPlus.prototype.onleaveconnected = function onleaveconnected(event, from, to) { + this._stopConnectionKeeper(); + this._destroyWs(); + if (to === 'offline' || to === 'disconnected') { + this.emit('disconnect'); + } + }; + + WebSocketPlus.prototype.onpause = function onpause() { + this.emit('offline'); + }; + + WebSocketPlus.prototype.onbeforeresume = function onbeforeresume() { + this.emit('online'); + }; + + WebSocketPlus.prototype.onreconnect = function onreconnect() { + this.emit('reconnect'); + }; + + WebSocketPlus.prototype.ondisconnected = function ondisconnected(event, from, to) { + var _this3 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + var delay = DEFAULT_RETRY_STRATEGY.call(null, attempt); + debug$4('schedule attempt=' + attempt + ' delay=' + delay); + this.emit('schedule', attempt, delay); + if (this.__scheduledRetry) { + clearTimeout(this.__scheduledRetry); + } + this.__scheduledRetry = setTimeout(function () { + if (_this3.is('disconnected')) { + _this3.retry(attempt); + } + }, delay); + }; + + WebSocketPlus.prototype.onretry = function onretry(event, from, to) { + var _this4 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + this.emit('retry', attempt); + this._createWs(this._getUrls, this._protocol).then(function () { + return _this4.can('reconnect') ? _this4.reconnect() : _this4._destroyWs(); + }, function () { + return _this4.can('fail') && _this4.fail(attempt + 1); + }); + }; + + WebSocketPlus.prototype.onerror = function onerror(event, from, to, error) { + this.emit('error', error); + }; + + WebSocketPlus.prototype.onclose = function onclose() { + if (global$2.removeEventListener) { + if (this.__pause) global$2.removeEventListener('offline', this.__pause); + if (this.__resume) global$2.removeEventListener('online', this.__resume); + } + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype._ping = function _ping() { + debug$4('ping'); + try { + this.ping(); + } catch (error) { + console.warn('websocket ping error: ' + error.message); + } + }; + + WebSocketPlus.prototype.ping = function ping() { + if (this._ws.ping) { + this._ws.ping(); + } else { + console.warn('The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.'); + } + }; + + WebSocketPlus.prototype._postponeTimeoutTimer = function _postponeTimeoutTimer() { + var _this5 = this; + + debug$4('_postponeTimeoutTimer'); + this._clearTimeoutTimers(); + this._timeoutTimer = setTimeout(function () { + debug$4('timeout'); + _this5.disconnect(); + }, TIMEOUT_TIME); + }; + + WebSocketPlus.prototype._clearTimeoutTimers = function _clearTimeoutTimers() { + if (this._timeoutTimer) { + clearTimeout(this._timeoutTimer); + } + }; + + WebSocketPlus.prototype._startConnectionKeeper = function _startConnectionKeeper() { + debug$4('start connection keeper'); + this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME); + var addListener = this._ws.addListener || this._ws.addEventListener; + addListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._postponeTimeoutTimer(); + }; + + WebSocketPlus.prototype._stopConnectionKeeper = function _stopConnectionKeeper() { + debug$4('stop connection keeper'); + // websockets/ws#489 + var removeListener = this._ws.removeListener || this._ws.removeEventListener; + removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._clearTimeoutTimers(); + if (this._heartbeatTimer) { + clearInterval(this._heartbeatTimer); + } + }; + + WebSocketPlus.prototype._handleClose = function _handleClose(event) { + debug$4('ws closed [' + event.code + '] ' + event.reason); + // socket closed manually, ignore close event. + if (this.isFinished()) return; + this.handleClose(event); + }; + + WebSocketPlus.prototype.handleClose = function handleClose() { + // reconnect + this.disconnect(); + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype.send = function send(data) { + debug$4('send', data); + this._ws.send(data); + }; + + WebSocketPlus.prototype._handleMessage = function _handleMessage(event) { + debug$4('message', event.data); + this.handleMessage(event.data); + }; + + WebSocketPlus.prototype.handleMessage = function handleMessage(message) { + this.emit('message', message); + }; + + return WebSocketPlus; + }(eventemitter3), (_applyDecoratedDescriptor(_class.prototype, '_ping', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, '_ping'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'send', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, 'send'), _class.prototype)), _class); + + + stateMachine.create({ + target: WebSocketPlus.prototype, + initial: { + state: 'initialized', + event: 'init', + defer: true + }, + terminal: 'closed', + events: [{ + name: 'open', + from: 'initialized', + to: 'connected' + }, { + name: 'disconnect', + from: 'connected', + to: 'disconnected' + }, { + name: 'retry', + from: 'disconnected', + to: 'reconnecting' + }, { + name: 'fail', + from: 'reconnecting', + to: 'disconnected' + }, { + name: 'reconnect', + from: 'reconnecting', + to: 'connected' + }, { + name: 'pause', + from: ['connected', 'disconnected', 'reconnecting'], + to: 'offline' + }, {}, { + name: 'resume', + from: 'offline', + to: 'disconnected' + }, { + name: 'close', + from: ['connected', 'disconnected', 'reconnecting', 'offline'], + to: 'closed' + }, { + name: 'throw', + from: '*', + to: 'error' + }] + }); + + // 19.1.2.5 Object.freeze(O) + + var meta = _meta.onFreeze; + + _objectSap('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && _isObject(it) ? $freeze(meta(it)) : it; + }; + }); + + var freeze$1 = _core.Object.freeze; + + var freeze = createCommonjsModule(function (module) { + module.exports = { "default": freeze$1, __esModule: true }; + }); + + var _Object$freeze = unwrapExports(freeze); + + var error = _Object$freeze({ + 1000: { + name: 'CLOSE_NORMAL' + }, + 1006: { + name: 'CLOSE_ABNORMAL' + }, + 4100: { + name: 'APP_NOT_AVAILABLE', + message: 'App not exists or realtime message service is disabled.' + }, + 4103: { + name: 'INVALID_LOGIN', + message: 'Malformed clientId.' + }, + 4105: { + name: 'SESSION_REQUIRED', + message: 'Message sent before session opened. ' + }, + 4107: { + name: 'READ_TIMEOUT' + }, + 4108: { + name: 'LOGIN_TIMEOUT' + }, + 4109: { + name: 'FRAME_TOO_LONG' + }, + 4110: { + name: 'INVALID_ORIGIN', + message: 'Access denied by domain whitelist.' + }, + 4111: { + name: 'SESSION_CONFLICT' + }, + 4112: { + name: 'SESSION_TOKEN_EXPIRED' + }, + 4200: { + name: 'INTERNAL_ERROR', + message: 'Internal error, please contact LeanCloud for support.' + }, + 4201: { + name: 'SEND_MESSAGE_TIMEOUT' + }, + 4302: { + name: 'CONVERSATION_SIGNATURE_FAILED' + }, + 4303: { + name: 'CONVERSATION_NOT_FOUND' + }, + 4304: { + name: 'CONVERSATION_FULL' + }, + 4305: { + name: 'CONVERSATION_REJECTED_BY_APP' + }, + 4306: { + name: 'CONVERSATION_UPDATE_FAILED' + }, + 4307: { + name: 'CONVERSATION_READ_ONLY' + }, + 4308: { + name: 'CONVERSATION_NOT_ALLOWED' + }, + 4401: { + name: 'INVALID_MESSAGING_TARGET' + }, + 4402: { + name: 'MESSAGE_REJECTED_BY_APP' + } + }); + + var ErrorCode = _Object$freeze(_Object$keys(error).reduce(function (result, code) { + return _Object$assign(result, _defineProperty({}, error[code].name, Number(code))); + }, {})); + + var createError$3 = function createError(errorMessage) { + var code = errorMessage.code, + reason = errorMessage.reason, + appCode = errorMessage.appCode, + detail = errorMessage.detail; + + var message = reason || detail; + if (!message && error[code]) { + message = error[code].message || error[code].name; + } + if (!message) { + message = 'Unknow Error: ' + code; + } + var err = new Error(message); + return _Object$assign(err, { + code: code, appCode: appCode, detail: detail + }); + }; + + var debug$3 = browser$1('LC:Connection'); + + var COMMAND_TIMEOUT = 20000; + + var Connection = function (_WebSocketPlus) { + _inherits(Connection, _WebSocketPlus); + + function Connection(getUrl, _ref) { + var format = _ref.format, + version = _ref.version; + + _classCallCheck(this, Connection); + + debug$3('initializing Connection'); + var protocolString = 'lc.' + format + '.' + version; + if (!isWeapp) { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl, protocolString)); + } else { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl().then(function (urls) { + return urls.map(function (url) { + return '' + url + (url.indexOf('?') === -1 ? '?' : '&') + 'subprotocol=' + encodeURIComponent(protocolString); + }); + }))); + } + _this._protocalFormat = format; + _this._commands = {}; + _this._serialId = 0; + return _possibleConstructorReturn(_this); + } + + Connection.prototype.send = function send(command) { + var _this2 = this; + + var waitingForRespond = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + var serialId = void 0; + if (waitingForRespond) { + this._serialId += 1; + serialId = this._serialId; + command.i = serialId; // eslint-disable-line no-param-reassign + } + debug$3('↑ %O sent', trim$1(command)); + + var message = void 0; + if (this._protocalFormat === 'proto2base64') { + message = command.toBase64(); + } else if (command.toArrayBuffer) { + message = command.toArrayBuffer(); + } + if (!message) { + throw new TypeError(command + ' is not a GenericCommand'); + } + + _WebSocketPlus.prototype.send.call(this, message); + + if (!waitingForRespond) { + return _Promise.resolve(); + } + return new _Promise(function (resolve, reject) { + _this2._commands[serialId] = { + resolve: resolve, + reject: reject, + timeout: setTimeout(function () { + if (_this2._commands[serialId]) { + debug$3('✗ %O timeout', trim$1(command)); + reject(new Error('Command Timeout.')); + delete _this2._commands[serialId]; + } + }, COMMAND_TIMEOUT) + }; + }); + }; + + Connection.prototype.handleMessage = function handleMessage(msg) { + var message = void 0; + try { + message = GenericCommand.decode(msg); + debug$3('↓ %O received', trim$1(message)); + } catch (e) { + console.warn('Decode message failed', msg); + } + this.emit('allmessage', message); + var serialId = message.i; + if (serialId) { + if (this._commands[serialId]) { + clearTimeout(this._commands[serialId].timeout); + if (message.cmd === CommandType.error) { + this._commands[serialId].reject(createError$3(message.errorMessage)); + } else { + this._commands[serialId].resolve(message); + } + delete this._commands[serialId]; + } else { + console.warn('Unexpected command received with serialId [' + serialId + '],\n which have timed out or never been requested.'); + } + } else if (message.cmd === CommandType.error) { + this.emit('error', createError$3(message.errorMessage)); + } else { + this.emit('message', message); + } + }; + + Connection.prototype.ping = function ping() { + return this.send(new GenericCommand({ + cmd: CommandType.echo + })).catch(function (error$$1) { + return debug$3('ping failed:', error$$1); + }); + }; + + return Connection; + }(WebSocketPlus); + + /* eslint-disable max-len */ + + /** + * 插件接口 + * + *

+ * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类: + *

+ * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。 + * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。 + *

+ * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。 + * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。 + * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。 + *

+ * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。 + * + * @interface Plugin + * @since 3.1.0 + */ + + /* eslint-enable max-len */ + + /** + * 插件名称,用于在日志中显示异常的插件 + * + * @name Plugin.name + * @type string + */ + + /** + * 插件注册的消息类型 + * + * @name Plugin.messageClasses + * @type AVMessage[] + */ + + /** + * 在 Realtime 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Realtime 实例。 + * + * @name Plugin.onRealtimeCreate + * @type Function + */ + + /** + * 在 IMClient 实例化后对其进行修饰。 + *

+ * 接受一个参数为 IMClient 实例。 + * + * @name Plugin.onIMClientCreate + * @type Function + */ + + /** + * 在 Conversation 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Conversation 实例。 + * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook, + * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。 + * + * @name Plugin.onConversationCreate + * @type Function + */ + + /** + * 在对消息进行 parse 之前,对原始消息进行修改。 + *

+ * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。 + * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。 + * + * @name Plugin.beforeMessageParse + * @type Function + */ + + /** + * 在对消息进行 parse 之后,对消息实例进行修改。 + *

+ * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。 + * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.afterMessageParse + * @type Function + */ + + /** + * 在收到消息之后,派发消息之前,控制是否派发这条消息。 + *

+ * 接受参数为 message 与 conversation。 + * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。 + * 如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.beforeMessageDispatch + * @type Function + * @since 3.4.0 + */ + + var applyDecorators = function applyDecorators(decorators, target) { + if (decorators) { + decorators.forEach(function (decorator) { + try { + decorator(target); + } catch (error) { + if (decorator._pluginName) { + error.message += '[' + decorator._pluginName + ']'; + } + throw error; + } + }); + } + }; + + + + var applyDispatcher = function applyDispatcher(dispatchers, payload) { + return ensureArray(dispatchers).reduce(function (resultPromise, dispatcher) { + return resultPromise.then(function (shouldDispatch) { + return shouldDispatch === false ? false : dispatcher.apply(undefined, _toConsumableArray(payload)); + }).catch(function (error) { + if (dispatcher._pluginName) { + // eslint-disable-next-line no-param-reassign + error.message += '[' + dispatcher._pluginName + ']'; + } + throw error; + }); + }, _Promise.resolve(true)); + }; + + var debug = browser$1('LC:Realtime'); + + var routerCache = new Cache('push-router'); + + var Realtime = function (_EventEmitter) { + _inherits(Realtime, _EventEmitter); + + /** + * @extends EventEmitter + * @param {Object} options + * @param {String} options.appId + * @param {String} options.appKey (since 4.0.0) + * @param {String} [options.region='cn'] 节点 id + * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式) + * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。 + * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序) + * @param {Boolean} [options.ssl=true] 使用 wss 进行连接 + * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0) + */ + function Realtime(options) { + _classCallCheck(this, Realtime); + + debug('initializing Realtime'); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof options.appId !== 'string') { + throw new TypeError('appId [' + options.appId + '] is not a string'); + } + if (typeof options.appKey !== 'string') { + throw new TypeError('appKey [' + options.appKey + '] is not a string'); + } + _this._options = _Object$assign({ + appId: undefined, + appKey: undefined, + region: 'cn', + pushOfflineMessages: false, + noBinary: isWeapp, + ssl: true, + server: process.env.SERVER + }, options); + _this._cache = new Cache('endpoints'); + internal(_this).clients = new _Set(); + _this._plugins = [].concat(_toConsumableArray(ensureArray(Realtime.__preRegisteredPlugins)), _toConsumableArray(ensureArray(options.plugins))).reduce(function (result, plugin) { + // eslint-disable-next-line no-restricted-syntax + for (var hook in plugin) { + if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') { + if (plugin.name) { + ensureArray(plugin[hook]).forEach(function (value) { + // eslint-disable-next-line no-param-reassign + value._pluginName = plugin.name; + }); + } + // eslint-disable-next-line no-param-reassign + result[hook] = ensureArray(result[hook]).concat(plugin[hook]); + } + } + return result; + }, {}); + // onRealtimeCreate hook + applyDecorators(_this._plugins.onRealtimeCreate, _this); + return _this; + } + + Realtime.prototype._request = function () { + var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) { + var method = _ref.method, + _ref$version = _ref.version, + version = _ref$version === undefined ? '1.1' : _ref$version, + path = _ref.path, + query = _ref.query, + headers = _ref.headers, + _ref$data = _ref.data, + data = _ref$data === undefined ? {} : _ref$data; + + var _options, appId, region, _ref3, api, url; + + return regenerator.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _options = this._options, appId = _options.appId, region = _options.region; + _context.next = 3; + return this.constructor._fetchAppRouter({ appId: appId, region: region }); + + case 3: + _ref3 = _context.sent; + api = _ref3.api; + url = 'https://' + api + '/' + version + path; + return _context.abrupt('return', axios(url, { + method: method, + params: query, + headers: _extends$1({ + 'X-LC-Id': this._options.appId, + 'X-LC-Key': this._options.appKey + }, headers), + data: data + }).then(function (response) { + return response.data; + })); + + case 7: + case 'end': + return _context.stop(); + } + } + }, _callee, this); + })); + + function _request(_x) { + return _ref2.apply(this, arguments); + } + + return _request; + }(); + + Realtime.prototype._open = function _open() { + var _this2 = this; + + if (this._openPromise) return this._openPromise; + + var format = 'protobuf2'; + if (this._options.noBinary) { + // 不发送 binary data,fallback to base64 string + format = 'proto2base64'; + } + var version = 3; + if (this._options.pushOfflineMessages) { + // 不推送离线消息,而是发送对话的未读通知 + version = 1; + } + var protocol = { + format: format, + version: version + }; + this._openPromise = new _Promise(function (resolve, reject) { + debug('No connection established, create a new one.'); + var connection = new Connection(function () { + return _this2._getEndpoints(_this2._options); + }, protocol); + connection.on('open', function () { + return resolve(connection); + }); + connection.on('error', reject); + connection.on('message', _this2._dispatchCommand.bind(_this2)); + /** + * 连接断开。 + * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。 + * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。 + * @event Realtime#disconnect + */ + /** + * 计划在一段时间后尝试重新连接 + * @event Realtime#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + */ + /** + * 正在尝试重新连接 + * @event Realtime#retry + * @param {Number} attempt 尝试重连的次数 + */ + /** + * 连接恢复正常。 + * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素 + * @event Realtime#reconnect + */ + + /** + * 客户端连接断开 + * @event IMClient#disconnect + * @see Realtime#event:disconnect + * @since 3.2.0 + */ + /** + * 计划在一段时间后尝试重新连接 + * @event IMClient#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + * @since 3.2.0 + */ + /** + * 正在尝试重新连接 + * @event IMClient#retry + * @param {Number} attempt 尝试重连的次数 + * @since 3.2.0 + */ + + /** + * 客户端进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event Realtime#offline + * @since 3.4.0 + */ + /** + * 客户端恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event Realtime#online + * @since 3.4.0 + */ + /** + * 进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event IMClient#offline + * @since 3.4.0 + */ + /** + * 恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event IMClient#online + * @since 3.4.0 + */ + + // event proxy + ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(function (event) { + return connection.on(event, function () { + for (var _len = arguments.length, payload = Array(_len), _key = 0; _key < _len; _key++) { + payload[_key] = arguments[_key]; + } + + debug(event + ' event emitted. %O', payload); + _this2.emit.apply(_this2, [event].concat(payload)); + if (event !== 'reconnect') { + internal(_this2).clients.forEach(function (client) { + client.emit.apply(client, [event].concat(payload)); + }); + } + }); + }); + // override handleClose + connection.handleClose = function handleClose(event) { + var isFatal = [ErrorCode.APP_NOT_AVAILABLE, ErrorCode.INVALID_LOGIN, ErrorCode.INVALID_ORIGIN].some(function (errorCode) { + return errorCode === event.code; + }); + if (isFatal) { + // in these cases, SDK should throw. + this.throw(createError$3(event)); + } else { + // reconnect + this.disconnect(); + } + }; + internal(_this2).connection = connection; + }); + + return this._openPromise; + }; + + Realtime.prototype._getEndpoints = function _getEndpoints(options) { + var _this3 = this; + + return _Promise.resolve(this._cache.get('endpoints') || this.constructor._fetchEndpointsInfo(options).then(tap(function (info) { + return _this3._cache.set('endpoints', info, info.ttl * 1000); + }))).then(function (info) { + debug('endpoint info: %O', info); + return [info.server, info.secondary]; + }); + }; + + Realtime._fetchAppRouter = function _fetchAppRouter(_ref4) { + var appId = _ref4.appId, + region = _ref4.region; + + debug('fetch router'); + switch (region) { + case 'cn': + { + var cachedRouter = routerCache.get(appId); + if (cachedRouter) { + return _Promise.resolve(cachedRouter); + } + return axios.get('https://app-router.leancloud.cn/2/route', { + params: { + appId: appId + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)).then(function (_ref5) { + var rtmRouter = _ref5.rtm_router_server, + api = _ref5.api_server, + _ref5$ttl = _ref5.ttl, + ttl = _ref5$ttl === undefined ? 3600 : _ref5$ttl; + + if (!rtmRouter) { + throw new Error('rtm router not exists'); + } + var router = { + rtmRouter: rtmRouter, + api: api + }; + routerCache.set(appId, router, ttl * 1000); + return router; + }).catch(function () { + var id = appId.slice(0, 8).toLowerCase(); + return { + rtmRouter: id + '.rtm.lncld.net', + api: id + '.api.lncld.net' + }; + }); + } + case 'us': + return _Promise.resolve({ + rtmRouter: 'router-a0-push.leancloud.cn', + api: 'us-api.leancloud.cn' + }); + default: + throw new Error('Region [' + region + '] is not supported.'); + } + }; + + Realtime._fetchEndpointsInfo = function _fetchEndpointsInfo(_ref6) { + var appId = _ref6.appId, + region = _ref6.region, + ssl = _ref6.ssl, + server = _ref6.server; + + debug('fetch endpoint info'); + return this._fetchAppRouter({ appId: appId, region: region }).then(tap(debug)).then(function (_ref7) { + var rtmRouter = _ref7.rtmRouter; + return axios.get('https://' + rtmRouter + '/v1/route', { + params: { + appId: appId, + secure: ssl, + features: isWeapp ? 'wechat' : undefined, + server: server, + _t: Date.now() + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)); + }); + }; + + Realtime.prototype._close = function _close() { + if (this._openPromise) { + this._openPromise.then(function (connection) { + return connection.close(); + }); + } + delete this._openPromise; + }; + + /** + * 手动进行重连。 + * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。 + * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。 + */ + + + Realtime.prototype.retry = function retry() { + var connection = internal(this).connection; + if (!connection) { + throw new Error('no connection established'); + } + if (connection.cannot('retry')) { + throw new Error('retrying not allowed when not disconnected. the connection is now ' + connection.current); + } + return connection.retry(); + }; + /** + * 暂停,使 SDK 进入离线状态。 + * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。 + * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。 + * + * @since 3.4.0 + * @see Realtime#event:offline + */ + + + Realtime.prototype.pause = function pause() { + // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。 + // 因此不像 retry,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('pause')) connection.pause(); + }; + /** + * 恢复在线状态。 + * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。 + * + * @since 3.4.0 + * @see Realtime#event:online + */ + + + Realtime.prototype.resume = function resume() { + // 与 pause 一样,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('resume')) connection.resume(); + }; + + Realtime.prototype._register = function _register(client) { + internal(this).clients.add(client); + }; + + Realtime.prototype._deregister = function _deregister(client) { + internal(this).clients.delete(client); + if (internal(this).clients.size === 0) { + this._close(); + } + }; + + Realtime.prototype._dispatchCommand = function _dispatchCommand(command) { + return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this]).then(function (shouldDispatch) { + // no plugin handled this command + if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim$1(command)); + return false; + }); + }; + + return Realtime; + }(eventemitter3); + + exports.Protocals = message; + exports.Promise = _Promise; + exports.EventEmitter = eventemitter3; + exports.Realtime = Realtime; + exports.ErrorCode = ErrorCode; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + +//# sourceMappingURL=realtime-core.weapp.js.map \ No newline at end of file diff --git a/dist/realtime-core.weapp.js.map b/dist/realtime-core.weapp.js.map new file mode 100644 index 000000000..500a3d893 --- /dev/null +++ b/dist/realtime-core.weapp.js.map @@ -0,0 +1 @@ +{"version":3,"file":null,"sources":["/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-integer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_defined.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_string-at.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_library.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_global.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_core.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_a-function.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_ctx.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_an-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_fails.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_descriptors.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_dom-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_ie8-dom-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-primitive.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-dp.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_property-desc.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_hide.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_export.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_redefine.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_has.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iterators.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_cof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iobject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-iobject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-length.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-absolute-index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-includes.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_shared.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_uid.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_shared-key.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-keys-internal.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_enum-bug-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-dps.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_html.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-to-string-tag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gpo.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.string.iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_add-to-unscopables.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-step.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.array.iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/web.dom.iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_classof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_an-instance.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-call.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-array-iter.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/core.get-iterator-method.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_for-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_species-constructor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_invoke.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_task.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_microtask.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_new-promise-capability.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_perform.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_promise-resolve.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_redefine-all.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-species.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-detect.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.promise.finally.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.promise.try.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks-ext.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/symbol/iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/symbol/iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_meta.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gops.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-pie.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_enum-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-array.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopn-ext.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopd.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.symbol.async-iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.symbol.observable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/symbol/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/typeof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/classCallCheck.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/weapp-polyfill/localstorage.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/defineProperty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/possibleConstructorReturn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-proto.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/inherits.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/json/stringify.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/json/stringify.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/object-assign/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/event-target-shim/lib/commons.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/event-target-shim/lib/custom-event-target.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/event-target-shim/lib/event-wrapper.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/event-target-shim/lib/event-target.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/weapp-polyfill/formdata.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/weapp-polyfill/xmlhttprequest.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/createClass.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/weapp-polyfill/websocket.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/weapp-polyfill/navigator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/weapp-polyfill/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/weapp-polyfill/auto-polyfill.js","/home/travis/build/leancloud/js-realtime-sdk/src/polyfills/polyfills-weapp.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/long/dist/long.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/bytebuffer/dist/bytebuffer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/@leeyeh/rollup-plugin-node-resolve/src/empty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/protobufjs/dist/protobuf-light.js","/home/travis/build/leancloud/js-realtime-sdk/proto/message-compiled.js","/home/travis/build/leancloud/js-realtime-sdk/proto/message.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/eventemitter3/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/regenerator-runtime/runtime.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/regenerator-runtime/runtime-module.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/regenerator/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/extends.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/asyncToGenerator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_create-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.array.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/array/from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/array/from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/toConsumableArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_validate-collection.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-strong.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-species-constructor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-species-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-methods.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-from-iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-to-json.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.to-json.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-collection-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-collection-from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/ms/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/debug/src/debug.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/debug/src/browser.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/bind.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/is-buffer/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/utils.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/normalizeHeaderName.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/enhanceError.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/createError.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/settle.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/buildURL.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/parseHeaders.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/isURLSameOrigin.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/btoa.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/cookies.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/adapters/xhr.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/defaults.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/InterceptorManager.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/transformData.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/isCancel.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/dispatchRequest.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/isAbsoluteURL.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/combineURLs.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/Axios.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/Cancel.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/CancelToken.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/spread.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/axios.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-sap.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/javascript-state-machine/state-machine.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-weak.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.weak-map.of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.weak-map.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_freeGlobal.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_root.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getRawTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_objectToString.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseGetTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_overArg.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getPrototype.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isObjectLike.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isPlainObject.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/global.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/expirable.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/cache.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/index.js","/home/travis/build/leancloud/js-realtime-sdk/src/polyfills/ws-browser.js","/home/travis/build/leancloud/js-realtime-sdk/src/websocket-plus.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.freeze.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/freeze.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/freeze.js","/home/travis/build/leancloud/js-realtime-sdk/src/error.js","/home/travis/build/leancloud/js-realtime-sdk/src/connection.js","/home/travis/build/leancloud/js-realtime-sdk/src/plugin.js","/home/travis/build/leancloud/js-realtime-sdk/src/realtime.js"],"sourcesContent":["// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","module.exports = true;\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.5.1' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && key in exports) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = require('./_hide');\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","module.exports = {};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","module.exports = function () { /* empty */ };\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","require('./es6.array.iterator');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar TO_STRING_TAG = require('./_wks')('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver\n } else if (Observer) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n var promise = Promise.resolve();\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var hide = require('./_hide');\nmodule.exports = function (target, src, safe) {\n for (var key in src) {\n if (safe && target[key]) target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n","'use strict';\nvar global = require('./_global');\nvar core = require('./_core');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value);\n if (domain) domain.exit();\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n if (promise._h == 1) return false;\n var chain = promise._a || promise._c;\n var i = 0;\n var reaction;\n while (chain.length > i) {\n reaction = chain[i++];\n if (reaction.fail || !isUnhandled(reaction.promise)) return false;\n } return true;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n","'use strict';\n// https://github.com/tc39/proposal-promise-try\nvar $export = require('./_export');\nvar newPromiseCapability = require('./_new-promise-capability');\nvar perform = require('./_perform');\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.promise');\nrequire('../modules/es7.promise.finally');\nrequire('../modules/es7.promise.try');\nmodule.exports = require('../modules/_core').Promise;\n","module.exports = { \"default\": require(\"core-js/library/fn/promise\"), __esModule: true };","exports.f = require('./_wks');\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","exports.f = Object.getOwnPropertySymbols;\n","exports.f = {}.propertyIsEnumerable;\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n replacer = args[1];\n if (typeof replacer == 'function') $replacer = replacer;\n if ($replacer || !isArray(replacer)) replacer = function (key, value) {\n if ($replacer) value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _iterator = require(\"../core-js/symbol/iterator\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = require(\"../core-js/symbol\");\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","class Storage {\n getItem(key) {\n return wx.getStorageSync(key);\n }\n\n setItem(key, value) {\n return wx.setStorageSync(key, value);\n }\n\n removeItem(key) {\n return this.setItem(key, '');\n }\n\n clear() {\n return wx.clearStorageSync();\n }\n}\n\nmodule.exports = new Storage();\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n if (key in obj) {\n (0, _defineProperty2.default)(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","require('../../modules/es6.object.set-prototype-of');\nmodule.exports = require('../../modules/_core').Object.setPrototypeOf;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/set-prototype-of\"), __esModule: true };","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","require('../../modules/es6.object.create');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/create\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = require(\"../core-js/object/create\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};","var core = require('../../modules/_core');\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/json/stringify\"), __esModule: true };","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/**\n * @author Toru Nagashima\n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n\"use strict\";\n\n/**\n * Creates a unique key.\n *\n * @param {string} name - A name to create.\n * @returns {symbol|string}\n * @private\n */\nvar createUniqueKey = exports.createUniqueKey = (typeof Symbol !== \"undefined\" ?\n Symbol :\n function createUniqueKey(name) {\n return \"[[\" + name + \"_\" + Math.random().toFixed(8).slice(2) + \"]]\";\n });\n\n/**\n * The key of listeners.\n *\n * @type {symbol|string}\n * @private\n */\nexports.LISTENERS = createUniqueKey(\"listeners\");\n\n/**\n * A value of kind for listeners which are registered in the capturing phase.\n *\n * @type {number}\n * @private\n */\nexports.CAPTURE = 1;\n\n/**\n * A value of kind for listeners which are registered in the bubbling phase.\n *\n * @type {number}\n * @private\n */\nexports.BUBBLE = 2;\n\n/**\n * A value of kind for listeners which are registered as an attribute.\n *\n * @type {number}\n * @private\n */\nexports.ATTRIBUTE = 3;\n\n/**\n * @typedef object ListenerNode\n * @property {function} listener - A listener function.\n * @property {number} kind - The kind of the listener.\n * @property {ListenerNode|null} next - The next node.\n * If this node is the last, this is `null`.\n */\n\n/**\n * Creates a node of singly linked list for a list of listeners.\n *\n * @param {function} listener - A listener function.\n * @param {number} kind - The kind of the listener.\n * @returns {ListenerNode} The created listener node.\n */\nexports.newNode = function newNode(listener, kind) {\n return {listener: listener, kind: kind, next: null};\n};\n","/**\n * @author Toru Nagashima\n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n\"use strict\";\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nvar Commons = require(\"./commons\");\nvar LISTENERS = Commons.LISTENERS;\nvar ATTRIBUTE = Commons.ATTRIBUTE;\nvar newNode = Commons.newNode;\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/**\n * Gets a specified attribute listener from a given EventTarget object.\n *\n * @param {EventTarget} eventTarget - An EventTarget object to get.\n * @param {string} type - An event type to get.\n * @returns {function|null} The found attribute listener.\n */\nfunction getAttributeListener(eventTarget, type) {\n var node = eventTarget[LISTENERS][type];\n while (node != null) {\n if (node.kind === ATTRIBUTE) {\n return node.listener;\n }\n node = node.next;\n }\n return null;\n}\n\n/**\n * Sets a specified attribute listener to a given EventTarget object.\n *\n * @param {EventTarget} eventTarget - An EventTarget object to set.\n * @param {string} type - An event type to set.\n * @param {function|null} listener - A listener to be set.\n * @returns {void}\n */\nfunction setAttributeListener(eventTarget, type, listener) {\n if (typeof listener !== \"function\" && typeof listener !== \"object\") {\n listener = null; // eslint-disable-line no-param-reassign\n }\n\n var prev = null;\n var node = eventTarget[LISTENERS][type];\n while (node != null) {\n if (node.kind === ATTRIBUTE) {\n // Remove old value.\n if (prev == null) {\n eventTarget[LISTENERS][type] = node.next;\n }\n else {\n prev.next = node.next;\n }\n }\n else {\n prev = node;\n }\n\n node = node.next;\n }\n\n // Add new value.\n if (listener != null) {\n if (prev == null) {\n eventTarget[LISTENERS][type] = newNode(listener, ATTRIBUTE);\n }\n else {\n prev.next = newNode(listener, ATTRIBUTE);\n }\n }\n}\n\n//-----------------------------------------------------------------------------\n// Public Interface\n//-----------------------------------------------------------------------------\n\n/**\n * Defines an `EventTarget` implementation which has `onfoobar` attributes.\n *\n * @param {EventTarget} EventTargetBase - A base implementation of EventTarget.\n * @param {string[]} types - A list of event types which are defined as attribute listeners.\n * @returns {EventTarget} The defined `EventTarget` implementation which has attribute listeners.\n */\nexports.defineCustomEventTarget = function(EventTargetBase, types) {\n function EventTarget() {\n EventTargetBase.call(this);\n }\n\n var descripter = {\n constructor: {\n value: EventTarget,\n configurable: true,\n writable: true\n }\n };\n\n types.forEach(function(type) {\n descripter[\"on\" + type] = {\n get: function() { return getAttributeListener(this, type); },\n set: function(listener) { setAttributeListener(this, type, listener); },\n configurable: true,\n enumerable: true\n };\n });\n\n EventTarget.prototype = Object.create(EventTargetBase.prototype, descripter);\n\n return EventTarget;\n};\n","/**\n * @author Toru Nagashima\n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n\"use strict\";\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nvar createUniqueKey = require(\"./commons\").createUniqueKey;\n\n//-----------------------------------------------------------------------------\n// Constsnts\n//-----------------------------------------------------------------------------\n\n/**\n * The key of the flag which is turned on by `stopImmediatePropagation` method.\n *\n * @type {symbol|string}\n * @private\n */\nvar STOP_IMMEDIATE_PROPAGATION_FLAG =\n createUniqueKey(\"stop_immediate_propagation_flag\");\n\n/**\n * The key of the flag which is turned on by `preventDefault` method.\n *\n * @type {symbol|string}\n * @private\n */\nvar CANCELED_FLAG = createUniqueKey(\"canceled_flag\");\n\n/**\n * The key of the original event object.\n *\n * @type {symbol|string}\n * @private\n */\nvar ORIGINAL_EVENT = createUniqueKey(\"original_event\");\n\n/**\n * Method definitions for the event wrapper.\n *\n * @type {object}\n * @private\n */\nvar wrapperPrototypeDefinition = Object.freeze({\n stopPropagation: Object.freeze({\n value: function stopPropagation() {\n var e = this[ORIGINAL_EVENT];\n if (typeof e.stopPropagation === \"function\") {\n e.stopPropagation();\n }\n },\n writable: true,\n configurable: true\n }),\n\n stopImmediatePropagation: Object.freeze({\n value: function stopImmediatePropagation() {\n this[STOP_IMMEDIATE_PROPAGATION_FLAG] = true;\n\n var e = this[ORIGINAL_EVENT];\n if (typeof e.stopImmediatePropagation === \"function\") {\n e.stopImmediatePropagation();\n }\n },\n writable: true,\n configurable: true\n }),\n\n preventDefault: Object.freeze({\n value: function preventDefault() {\n if (this.cancelable === true) {\n this[CANCELED_FLAG] = true;\n }\n\n var e = this[ORIGINAL_EVENT];\n if (typeof e.preventDefault === \"function\") {\n e.preventDefault();\n }\n },\n writable: true,\n configurable: true\n }),\n\n defaultPrevented: Object.freeze({\n get: function defaultPrevented() { return this[CANCELED_FLAG]; },\n enumerable: true,\n configurable: true\n })\n});\n\n//-----------------------------------------------------------------------------\n// Public Interface\n//-----------------------------------------------------------------------------\n\nexports.STOP_IMMEDIATE_PROPAGATION_FLAG = STOP_IMMEDIATE_PROPAGATION_FLAG;\n\n/**\n * Creates an event wrapper.\n *\n * We cannot modify several properties of `Event` object, so we need to create the wrapper.\n * Plus, this wrapper supports non `Event` objects.\n *\n * @param {Event|{type: string}} event - An original event to create the wrapper.\n * @param {EventTarget} eventTarget - The event target of the event.\n * @returns {Event} The created wrapper. This object is implemented `Event` interface.\n * @private\n */\nexports.createEventWrapper = function createEventWrapper(event, eventTarget) {\n var timeStamp = (\n typeof event.timeStamp === \"number\" ? event.timeStamp : Date.now()\n );\n var propertyDefinition = {\n type: {value: event.type, enumerable: true},\n target: {value: eventTarget, enumerable: true},\n currentTarget: {value: eventTarget, enumerable: true},\n eventPhase: {value: 2, enumerable: true},\n bubbles: {value: Boolean(event.bubbles), enumerable: true},\n cancelable: {value: Boolean(event.cancelable), enumerable: true},\n timeStamp: {value: timeStamp, enumerable: true},\n isTrusted: {value: false, enumerable: true}\n };\n propertyDefinition[STOP_IMMEDIATE_PROPAGATION_FLAG] = {value: false, writable: true};\n propertyDefinition[CANCELED_FLAG] = {value: false, writable: true};\n propertyDefinition[ORIGINAL_EVENT] = {value: event};\n\n // For CustomEvent.\n if (typeof event.detail !== \"undefined\") {\n propertyDefinition.detail = {value: event.detail, enumerable: true};\n }\n\n return Object.create(\n Object.create(event, wrapperPrototypeDefinition),\n propertyDefinition\n );\n};\n","/**\n * @author Toru Nagashima\n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n\"use strict\";\n\n//-----------------------------------------------------------------------------\n// Requirements\n//-----------------------------------------------------------------------------\n\nvar Commons = require(\"./commons\");\nvar CustomEventTarget = require(\"./custom-event-target\");\nvar EventWrapper = require(\"./event-wrapper\");\nvar LISTENERS = Commons.LISTENERS;\nvar CAPTURE = Commons.CAPTURE;\nvar BUBBLE = Commons.BUBBLE;\nvar ATTRIBUTE = Commons.ATTRIBUTE;\nvar newNode = Commons.newNode;\nvar defineCustomEventTarget = CustomEventTarget.defineCustomEventTarget;\nvar createEventWrapper = EventWrapper.createEventWrapper;\nvar STOP_IMMEDIATE_PROPAGATION_FLAG =\n EventWrapper.STOP_IMMEDIATE_PROPAGATION_FLAG;\n\n//-----------------------------------------------------------------------------\n// Constants\n//-----------------------------------------------------------------------------\n\n/**\n * A flag which shows there is the native `EventTarget` interface object.\n *\n * @type {boolean}\n * @private\n */\nvar HAS_EVENTTARGET_INTERFACE = (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n);\n\n//-----------------------------------------------------------------------------\n// Public Interface\n//-----------------------------------------------------------------------------\n\n/**\n * An implementation for `EventTarget` interface.\n *\n * @constructor\n * @public\n */\nvar EventTarget = module.exports = function EventTarget() {\n if (this instanceof EventTarget) {\n // this[LISTENERS] is a Map.\n // Its key is event type.\n // Its value is ListenerNode object or null.\n //\n // interface ListenerNode {\n // var listener: Function\n // var kind: CAPTURE|BUBBLE|ATTRIBUTE\n // var next: ListenerNode|null\n // }\n Object.defineProperty(this, LISTENERS, {value: Object.create(null)});\n }\n else if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(EventTarget, arguments[0]);\n }\n else if (arguments.length > 0) {\n var types = Array(arguments.length);\n for (var i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i];\n }\n\n // To use to extend with attribute listener properties.\n // e.g.\n // class MyCustomObject extends EventTarget(\"message\", \"error\") {\n // //...\n // }\n return defineCustomEventTarget(EventTarget, types);\n }\n else {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nEventTarget.prototype = Object.create(\n (HAS_EVENTTARGET_INTERFACE ? window.EventTarget : Object).prototype,\n {\n constructor: {\n value: EventTarget,\n writable: true,\n configurable: true\n },\n\n addEventListener: {\n value: function addEventListener(type, listener, capture) {\n if (listener == null) {\n return false;\n }\n if (typeof listener !== \"function\" && typeof listener !== \"object\") {\n throw new TypeError(\"\\\"listener\\\" is not an object.\");\n }\n\n var kind = (capture ? CAPTURE : BUBBLE);\n var node = this[LISTENERS][type];\n if (node == null) {\n this[LISTENERS][type] = newNode(listener, kind);\n return true;\n }\n\n var prev = null;\n while (node != null) {\n if (node.listener === listener && node.kind === kind) {\n // Should ignore a duplicated listener.\n return false;\n }\n prev = node;\n node = node.next;\n }\n\n prev.next = newNode(listener, kind);\n return true;\n },\n configurable: true,\n writable: true\n },\n\n removeEventListener: {\n value: function removeEventListener(type, listener, capture) {\n if (listener == null) {\n return false;\n }\n\n var kind = (capture ? CAPTURE : BUBBLE);\n var prev = null;\n var node = this[LISTENERS][type];\n while (node != null) {\n if (node.listener === listener && node.kind === kind) {\n if (prev == null) {\n this[LISTENERS][type] = node.next;\n }\n else {\n prev.next = node.next;\n }\n return true;\n }\n\n prev = node;\n node = node.next;\n }\n\n return false;\n },\n configurable: true,\n writable: true\n },\n\n dispatchEvent: {\n value: function dispatchEvent(event) {\n // If listeners aren't registered, terminate.\n var node = this[LISTENERS][event.type];\n if (node == null) {\n return true;\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n var wrapped = createEventWrapper(event, this);\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n while (node != null) {\n if (typeof node.listener === \"function\") {\n node.listener.call(this, wrapped);\n }\n else if (node.kind !== ATTRIBUTE && typeof node.listener.handleEvent === \"function\") {\n node.listener.handleEvent(wrapped);\n }\n\n if (wrapped[STOP_IMMEDIATE_PROPAGATION_FLAG]) {\n break;\n }\n node = node.next;\n }\n\n return !wrapped.defaultPrevented;\n },\n configurable: true,\n writable: true\n }\n }\n);\n","class FormData {\n constructor() {\n this._entries = [];\n }\n\n append(name, value) {\n if (typeof name !== 'string') {\n throw new TypeError('FormData name must be a string');\n }\n if (typeof value !== 'string') {\n if (typeof value !== 'object' || typeof value.uri !== 'string') {\n throw new TypeError('FormData value must be a string or { uri: tempFilePath }')\n }\n }\n this._entries.push([name, value]);\n }\n\n set(name, value) {\n const entry = this.get(name);\n if (entry) {\n entry[1] = value;\n } else {\n this.append(name, value);\n }\n }\n\n delete(name) {\n this._entries = this._entries.filter(entry => entry[0] !== name);\n }\n\n entries() {\n return this._entries;\n }\n\n get(name) {\n return this._entries.find(entry => entry[0] === name);\n }\n\n getAll(name) {\n return this._entries.filter(entry => entry[0] === name);\n }\n\n has(name) {\n return this._entries.some(entry => entry[0] === name);\n }\n\n keys() {\n return this._entries.map(entry => entry[0]);\n }\n\n values() {\n return this._entries.map(entry => entry[1]);\n }\n}\n\nmodule.exports = FormData;\n","const assign = require('object-assign');\nconst EventTarget = require('event-target-shim');\nconst FormData = require('./formdata.js');\n\nconst UNSENT = 0;\nconst OPENED = 1;\nconst HEADERS_RECEIVED = 2;\nconst LOADING = 3;\nconst DONE = 4;\n\nconst REQUEST_EVENTS = [\n 'abort',\n 'error',\n 'load',\n 'loadstart',\n 'progress',\n 'timeout',\n 'loadend',\n 'readystatechange'\n];\n\nfunction successCallback(response) {\n this.status = response.statusCode;\n this.statusText = response.statusCode;\n let text = response.data;\n if (typeof text !== 'string') {\n text = JSON.stringify(text);\n }\n this.responseText = this.response = text;\n this.readyState = DONE;\n this.dispatchEvent({ type: 'readystatechange' });\n}\n\nclass XMLHttpRequest extends EventTarget(REQUEST_EVENTS) {\n\n constructor() {\n super();\n this.readyState = UNSENT;\n this._headers = {};\n }\n\n abort() {\n throw new Error('not supported in weapp');\n }\n getAllResponseHeaders() {\n console.warn('getAllResponseHeaders always returns \\'\\'');\n return '';\n }\n getResponseHeader(key) {\n if (key === 'content-type') {\n console.warn('get content-type always returns \\'application/json\\'');\n return 'application/json';\n }\n console.warn('getResponseHeader always returns \\'\\'');\n return '';\n }\n overrideMimeType() {\n throw new Error('not supported in weapp');\n }\n open(method, url, async = true) {\n if (this.readyState !== UNSENT) {\n throw new Error('request is already opened');\n }\n if (!async) {\n throw new Error('sync request is not supported');\n }\n this._method = method;\n this._url = url;\n this.readyState = OPENED;\n this.dispatchEvent({ type: 'readystatechange' });\n }\n setRequestHeader(header, value) {\n if (this.readyState !== OPENED) {\n throw new Error('request is not opened');\n }\n this._headers[header.toLowerCase()] = value;\n }\n send(data) {\n if (this.readyState !== OPENED) {\n throw new Error('request is not opened');\n }\n if (data instanceof FormData) {\n const entries = data.entries();\n const blobs = entries.filter(entry => typeof entry[1] !== 'string');\n if (blobs.length === 0) {\n throw new Error('Must specify a Blob field in FormData');\n }\n if (blobs.length > 1) {\n console.warn('Only the first Blob will be send in Weapp');\n }\n const restData = entries\n .filter(entry => typeof entry[1] === 'string')\n .reduce((result, entry) => assign(result, { [entry[0]]: entry[1] }), {});\n wx.uploadFile({\n url: this._url,\n name: blobs[0][0],\n filePath: blobs[0][1].uri,\n formData: restData,\n header: this._headers,\n success: successCallback.bind(this),\n fail: (error) => {\n this.status = 0;\n this.readyState = DONE;\n this.dispatchEvent({ type: 'readystatechange' });\n this.dispatchEvent({ type: 'error' });\n }\n })\n } else {\n wx.request({\n url: this._url,\n data: data || '',\n // method 的 value 居然必须为大写\n method: this._method.toUpperCase(),\n header: this._headers,\n success: successCallback.bind(this),\n fail: (error) => {\n this.status = 0;\n this.readyState = DONE;\n this.dispatchEvent({ type: 'readystatechange' });\n this.dispatchEvent({ type: 'error' });\n }\n });\n }\n }\n}\n\nassign(XMLHttpRequest, {\n UNSENT,\n OPENED,\n HEADERS_RECEIVED,\n LOADING,\n DONE,\n});\n\nmodule.exports = XMLHttpRequest;\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();","const assign = require('object-assign');\nconst EventTarget = require('event-target-shim');\n\nconst CONNECTING = 0;\nconst OPEN = 1;\nconst CLOSING = 2;\nconst CLOSED = 3;\n\nconst EVENTS = [\n 'open',\n 'error',\n 'message',\n 'close',\n];\n\nlet instance;\n\nfunction errorHandler(event) {\n // 安卓小程序会诡异地触发 onSocketError 回调\n // 通过比较 message 过滤掉\n if (event.message === \"\") return;\n if (instance) {\n instance._readyState = CLOSED;\n instance.dispatchEvent({\n type: 'error',\n message: event.errMsg,\n });\n }\n}\n\nclass WebSocket extends EventTarget(EVENTS) {\n constructor(url, protocal) {\n if (!url) {\n throw new TypeError('Failed to construct \\'WebSocket\\': url required');\n }\n if (protocal) {\n throw new Error('subprotocal not supported in weapp');\n }\n super();\n this._url = url;\n this._protocal = ''; // default value according to specs\n this._readyState = CONNECTING;\n if (instance) {\n instance.dispatchEvent({\n type: 'close'\n });\n }\n instance = this;\n \n wx.onSocketOpen(function (event) {\n if (instance) {\n instance._readyState = OPEN;\n instance.dispatchEvent({\n type: 'open'\n });\n }\n });\n wx.onSocketError(errorHandler);\n wx.onSocketMessage(function (event) {\n if (instance) {\n var {\n data,\n origin,\n ports,\n source,\n } = event;\n instance.dispatchEvent({\n data,\n origin,\n ports,\n source,\n type: 'message',\n });\n }\n });\n wx.onSocketClose(function (event) {\n if (instance) {\n instance._readyState = CLOSED;\n var {\n code,\n reason,\n wasClean,\n } = event;\n instance.dispatchEvent({\n code,\n reason,\n wasClean,\n type: 'close',\n });\n instance = null;\n }\n });\n \n wx.connectSocket({\n url,\n fail: (error) => setTimeout(() => errorHandler(error), 0),\n });\n }\n\n get url() {\n return this._url;\n }\n get protocal() {\n return this._protocal;\n }\n get readyState() {\n return this._readyState;\n }\n\n close() {\n if (this.readyState === CONNECTING) {\n console.warn('close WebSocket which is connecting might not work');\n }\n wx.closeSocket();\n }\n\n send(data) {\n if (this.readyState !== OPEN) {\n throw new Error('INVALID_STATE_ERR');\n }\n\n if (typeof data !== 'string') {\n throw new TypeError('only string typed data are supported');\n }\n\n wx.sendSocketMessage({\n data\n });\n }\n\n}\n\nassign(WebSocket, {\n CONNECTING,\n OPEN,\n CLOSING,\n CLOSED,\n});\n\nmodule.exports = WebSocket;\n","module.exports = {};\n","var localStorage = require('./localstorage.js');\nvar XMLHttpRequest = require('./xmlhttprequest.js');\nvar FormData = require('./formdata.js');\nvar WebSocket = require('./websocket.js');\nvar navigator = require('./navigator');\n\nmodule.exports = {\n polyfill(target = global || window) {\n if (typeof target !== 'object') {\n throw new Error('polyfill target is not an Object');\n }\n const polyfills = {\n localStorage,\n XMLHttpRequest,\n FormData,\n WebSocket,\n Object,\n navigator,\n };\n for (let k in polyfills) {\n if (!target[k]) target[k] = polyfills[k];\n }\n },\n localStorage,\n XMLHttpRequest,\n FormData,\n WebSocket,\n}\n","var polyfill = require('./index.js').polyfill;\nwindow = window || {};\npolyfill();\npolyfill(window);\ntry {\n localStorage = localStorage || require('./localstorage.js');\n} catch (e) {}\ntry {\n XMLHttpRequest = XMLHttpRequest || require('./xmlhttprequest.js');\n} catch (e) {}\ntry {\n FormData = FormData || require('./formdata.js');\n} catch (e) {}\ntry {\n WebSocket = WebSocket || require('./websocket.js');\n} catch (e) {}\ntry {\n navigator = navigator || require('./navigator.js');\n} catch (e) {}\n","// eslint-disable-next-line import/no-extraneous-dependencies\nimport 'weapp-polyfill/auto-polyfill';\n","/*\r\n Copyright 2013 Daniel Wirtz \r\n Copyright 2009 The Closure Library Authors. All Rights Reserved.\r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS-IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license long.js (c) 2013 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/long.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n define([], factory);\r\n /* CommonJS */ else if (typeof require === 'function' && typeof module === \"object\" && module && module[\"exports\"])\r\n module[\"exports\"] = factory();\r\n /* Global */ else\r\n (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"Long\"] = factory();\r\n\r\n})(this, function() {\r\n \"use strict\";\r\n\r\n /**\r\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n * See the from* functions below for more convenient ways of constructing Longs.\r\n * @exports Long\r\n * @class A Long class for representing a 64 bit two's-complement integer value.\r\n * @param {number} low The low (signed) 32 bits of the long\r\n * @param {number} high The high (signed) 32 bits of the long\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @constructor\r\n */\r\n function Long(low, high, unsigned) {\r\n\r\n /**\r\n * The low 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.low = low | 0;\r\n\r\n /**\r\n * The high 32 bits as a signed value.\r\n * @type {number}\r\n */\r\n this.high = high | 0;\r\n\r\n /**\r\n * Whether unsigned or not.\r\n * @type {boolean}\r\n */\r\n this.unsigned = !!unsigned;\r\n }\r\n\r\n // The internal representation of a long is the two given signed, 32-bit values.\r\n // We use 32-bit pieces because these are the size of integers on which\r\n // Javascript performs bit-operations. For operations like addition and\r\n // multiplication, we split each number into 16 bit pieces, which can easily be\r\n // multiplied within Javascript's floating-point representation without overflow\r\n // or change in sign.\r\n //\r\n // In the algorithms below, we frequently reduce the negative case to the\r\n // positive case by negating the input(s) and then post-processing the result.\r\n // Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n // a positive number, it overflows back into a negative). Not handling this\r\n // case would often result in infinite recursion.\r\n //\r\n // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n // methods on which they depend.\r\n\r\n /**\r\n * An indicator used to reliably determine if an object is a Long or not.\r\n * @type {boolean}\r\n * @const\r\n * @private\r\n */\r\n Long.prototype.__isLong__;\r\n\r\n Object.defineProperty(Long.prototype, \"__isLong__\", {\r\n value: true,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n\r\n /**\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n * @inner\r\n */\r\n function isLong(obj) {\r\n return (obj && obj[\"__isLong__\"]) === true;\r\n }\r\n\r\n /**\r\n * Tests if the specified object is a Long.\r\n * @function\r\n * @param {*} obj Object\r\n * @returns {boolean}\r\n */\r\n Long.isLong = isLong;\r\n\r\n /**\r\n * A cache of the Long representations of small integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\n var INT_CACHE = {};\r\n\r\n /**\r\n * A cache of the Long representations of small unsigned integer values.\r\n * @type {!Object}\r\n * @inner\r\n */\r\n var UINT_CACHE = {};\r\n\r\n /**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromInt(value, unsigned) {\r\n var obj, cachedObj, cache;\r\n if (unsigned) {\r\n value >>>= 0;\r\n if (cache = (0 <= value && value < 256)) {\r\n cachedObj = UINT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n if (cache)\r\n UINT_CACHE[value] = obj;\r\n return obj;\r\n } else {\r\n value |= 0;\r\n if (cache = (-128 <= value && value < 128)) {\r\n cachedObj = INT_CACHE[value];\r\n if (cachedObj)\r\n return cachedObj;\r\n }\r\n obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n if (cache)\r\n INT_CACHE[value] = obj;\r\n return obj;\r\n }\r\n }\r\n\r\n /**\r\n * Returns a Long representing the given 32 bit integer value.\r\n * @function\r\n * @param {number} value The 32 bit integer in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromInt = fromInt;\r\n\r\n /**\r\n * @param {number} value\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromNumber(value, unsigned) {\r\n if (isNaN(value) || !isFinite(value))\r\n return unsigned ? UZERO : ZERO;\r\n if (unsigned) {\r\n if (value < 0)\r\n return UZERO;\r\n if (value >= TWO_PWR_64_DBL)\r\n return MAX_UNSIGNED_VALUE;\r\n } else {\r\n if (value <= -TWO_PWR_63_DBL)\r\n return MIN_VALUE;\r\n if (value + 1 >= TWO_PWR_63_DBL)\r\n return MAX_VALUE;\r\n }\r\n if (value < 0)\r\n return fromNumber(-value, unsigned).neg();\r\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n }\r\n\r\n /**\r\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n * @function\r\n * @param {number} value The number in question\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromNumber = fromNumber;\r\n\r\n /**\r\n * @param {number} lowBits\r\n * @param {number} highBits\r\n * @param {boolean=} unsigned\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromBits(lowBits, highBits, unsigned) {\r\n return new Long(lowBits, highBits, unsigned);\r\n }\r\n\r\n /**\r\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n * assumed to use 32 bits.\r\n * @function\r\n * @param {number} lowBits The low 32 bits\r\n * @param {number} highBits The high 32 bits\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromBits = fromBits;\r\n\r\n /**\r\n * @function\r\n * @param {number} base\r\n * @param {number} exponent\r\n * @returns {number}\r\n * @inner\r\n */\r\n var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n /**\r\n * @param {string} str\r\n * @param {(boolean|number)=} unsigned\r\n * @param {number=} radix\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromString(str, unsigned, radix) {\r\n if (str.length === 0)\r\n throw Error('empty string');\r\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n return ZERO;\r\n if (typeof unsigned === 'number') {\r\n // For goog.math.long compatibility\r\n radix = unsigned,\r\n unsigned = false;\r\n } else {\r\n unsigned = !! unsigned;\r\n }\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n\r\n var p;\r\n if ((p = str.indexOf('-')) > 0)\r\n throw Error('interior hyphen');\r\n else if (p === 0) {\r\n return fromString(str.substring(1), unsigned, radix).neg();\r\n }\r\n\r\n // Do several (8) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n var result = ZERO;\r\n for (var i = 0; i < str.length; i += 8) {\r\n var size = Math.min(8, str.length - i),\r\n value = parseInt(str.substring(i, i + size), radix);\r\n if (size < 8) {\r\n var power = fromNumber(pow_dbl(radix, size));\r\n result = result.mul(power).add(fromNumber(value));\r\n } else {\r\n result = result.mul(radixToPower);\r\n result = result.add(fromNumber(value));\r\n }\r\n }\r\n result.unsigned = unsigned;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a Long representation of the given string, written using the specified radix.\r\n * @function\r\n * @param {string} str The textual representation of the Long\r\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n * @returns {!Long} The corresponding Long value\r\n */\r\n Long.fromString = fromString;\r\n\r\n /**\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n * @returns {!Long}\r\n * @inner\r\n */\r\n function fromValue(val) {\r\n if (val /* is compatible */ instanceof Long)\r\n return val;\r\n if (typeof val === 'number')\r\n return fromNumber(val);\r\n if (typeof val === 'string')\r\n return fromString(val);\r\n // Throws for non-objects, converts non-instanceof Long:\r\n return fromBits(val.low, val.high, val.unsigned);\r\n }\r\n\r\n /**\r\n * Converts the specified value to a Long.\r\n * @function\r\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n * @returns {!Long}\r\n */\r\n Long.fromValue = fromValue;\r\n\r\n // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n // no runtime penalty for these.\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_16_DBL = 1 << 16;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_24_DBL = 1 << 24;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n /**\r\n * @type {number}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n /**\r\n * @type {!Long}\r\n * @const\r\n * @inner\r\n */\r\n var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var ZERO = fromInt(0);\r\n\r\n /**\r\n * Signed zero.\r\n * @type {!Long}\r\n */\r\n Long.ZERO = ZERO;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var UZERO = fromInt(0, true);\r\n\r\n /**\r\n * Unsigned zero.\r\n * @type {!Long}\r\n */\r\n Long.UZERO = UZERO;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var ONE = fromInt(1);\r\n\r\n /**\r\n * Signed one.\r\n * @type {!Long}\r\n */\r\n Long.ONE = ONE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var UONE = fromInt(1, true);\r\n\r\n /**\r\n * Unsigned one.\r\n * @type {!Long}\r\n */\r\n Long.UONE = UONE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var NEG_ONE = fromInt(-1);\r\n\r\n /**\r\n * Signed negative one.\r\n * @type {!Long}\r\n */\r\n Long.NEG_ONE = NEG_ONE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n /**\r\n * Maximum signed value.\r\n * @type {!Long}\r\n */\r\n Long.MAX_VALUE = MAX_VALUE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n /**\r\n * Maximum unsigned value.\r\n * @type {!Long}\r\n */\r\n Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n /**\r\n * @type {!Long}\r\n * @inner\r\n */\r\n var MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n /**\r\n * Minimum signed value.\r\n * @type {!Long}\r\n */\r\n Long.MIN_VALUE = MIN_VALUE;\r\n\r\n /**\r\n * @alias Long.prototype\r\n * @inner\r\n */\r\n var LongPrototype = Long.prototype;\r\n\r\n /**\r\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n * @returns {number}\r\n */\r\n LongPrototype.toInt = function toInt() {\r\n return this.unsigned ? this.low >>> 0 : this.low;\r\n };\r\n\r\n /**\r\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n * @returns {number}\r\n */\r\n LongPrototype.toNumber = function toNumber() {\r\n if (this.unsigned)\r\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n };\r\n\r\n /**\r\n * Converts the Long to a string written in the specified radix.\r\n * @param {number=} radix Radix (2-36), defaults to 10\r\n * @returns {string}\r\n * @override\r\n * @throws {RangeError} If `radix` is out of range\r\n */\r\n LongPrototype.toString = function toString(radix) {\r\n radix = radix || 10;\r\n if (radix < 2 || 36 < radix)\r\n throw RangeError('radix');\r\n if (this.isZero())\r\n return '0';\r\n if (this.isNegative()) { // Unsigned Longs are never negative\r\n if (this.eq(MIN_VALUE)) {\r\n // We need to change the Long value before it can be negated, so we remove\r\n // the bottom-most digit in this base and then recurse to do the rest.\r\n var radixLong = fromNumber(radix),\r\n div = this.div(radixLong),\r\n rem1 = div.mul(radixLong).sub(this);\r\n return div.toString(radix) + rem1.toInt().toString(radix);\r\n } else\r\n return '-' + this.neg().toString(radix);\r\n }\r\n\r\n // Do several (6) digits each time through the loop, so as to\r\n // minimize the calls to the very expensive emulated div.\r\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n rem = this;\r\n var result = '';\r\n while (true) {\r\n var remDiv = rem.div(radixToPower),\r\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n digits = intval.toString(radix);\r\n rem = remDiv;\r\n if (rem.isZero())\r\n return digits + result;\r\n else {\r\n while (digits.length < 6)\r\n digits = '0' + digits;\r\n result = '' + digits + result;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Gets the high 32 bits as a signed integer.\r\n * @returns {number} Signed high bits\r\n */\r\n LongPrototype.getHighBits = function getHighBits() {\r\n return this.high;\r\n };\r\n\r\n /**\r\n * Gets the high 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned high bits\r\n */\r\n LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n return this.high >>> 0;\r\n };\r\n\r\n /**\r\n * Gets the low 32 bits as a signed integer.\r\n * @returns {number} Signed low bits\r\n */\r\n LongPrototype.getLowBits = function getLowBits() {\r\n return this.low;\r\n };\r\n\r\n /**\r\n * Gets the low 32 bits as an unsigned integer.\r\n * @returns {number} Unsigned low bits\r\n */\r\n LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n return this.low >>> 0;\r\n };\r\n\r\n /**\r\n * Gets the number of bits needed to represent the absolute value of this Long.\r\n * @returns {number}\r\n */\r\n LongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n if (this.isNegative()) // Unsigned Longs are never negative\r\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n var val = this.high != 0 ? this.high : this.low;\r\n for (var bit = 31; bit > 0; bit--)\r\n if ((val & (1 << bit)) != 0)\r\n break;\r\n return this.high != 0 ? bit + 33 : bit + 1;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value equals zero.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isZero = function isZero() {\r\n return this.high === 0 && this.low === 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is negative.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isNegative = function isNegative() {\r\n return !this.unsigned && this.high < 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is positive.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isPositive = function isPositive() {\r\n return this.unsigned || this.high >= 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is odd.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isOdd = function isOdd() {\r\n return (this.low & 1) === 1;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is even.\r\n * @returns {boolean}\r\n */\r\n LongPrototype.isEven = function isEven() {\r\n return (this.low & 1) === 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value equals the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.equals = function equals(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n return false;\r\n return this.high === other.high && this.low === other.low;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.eq = LongPrototype.equals;\r\n\r\n /**\r\n * Tests if this Long's value differs from the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.notEquals = function notEquals(other) {\r\n return !this.eq(/* validates */ other);\r\n };\r\n\r\n /**\r\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.neq = LongPrototype.notEquals;\r\n\r\n /**\r\n * Tests if this Long's value is less than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lessThan = function lessThan(other) {\r\n return this.comp(/* validates */ other) < 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lt = LongPrototype.lessThan;\r\n\r\n /**\r\n * Tests if this Long's value is less than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n return this.comp(/* validates */ other) <= 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n /**\r\n * Tests if this Long's value is greater than the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.greaterThan = function greaterThan(other) {\r\n return this.comp(/* validates */ other) > 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n /**\r\n * Tests if this Long's value is greater than or equal the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n return this.comp(/* validates */ other) >= 0;\r\n };\r\n\r\n /**\r\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {boolean}\r\n */\r\n LongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n /**\r\n * Compares this Long's value with the specified's.\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\n LongPrototype.compare = function compare(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n if (this.eq(other))\r\n return 0;\r\n var thisNeg = this.isNegative(),\r\n otherNeg = other.isNegative();\r\n if (thisNeg && !otherNeg)\r\n return -1;\r\n if (!thisNeg && otherNeg)\r\n return 1;\r\n // At this point the sign bits are the same\r\n if (!this.unsigned)\r\n return this.sub(other).isNegative() ? -1 : 1;\r\n // Both are positive if at least one is unsigned\r\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n };\r\n\r\n /**\r\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n * @function\r\n * @param {!Long|number|string} other Other value\r\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n * if the given one is greater\r\n */\r\n LongPrototype.comp = LongPrototype.compare;\r\n\r\n /**\r\n * Negates this Long's value.\r\n * @returns {!Long} Negated Long\r\n */\r\n LongPrototype.negate = function negate() {\r\n if (!this.unsigned && this.eq(MIN_VALUE))\r\n return MIN_VALUE;\r\n return this.not().add(ONE);\r\n };\r\n\r\n /**\r\n * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n * @function\r\n * @returns {!Long} Negated Long\r\n */\r\n LongPrototype.neg = LongPrototype.negate;\r\n\r\n /**\r\n * Returns the sum of this and the specified Long.\r\n * @param {!Long|number|string} addend Addend\r\n * @returns {!Long} Sum\r\n */\r\n LongPrototype.add = function add(addend) {\r\n if (!isLong(addend))\r\n addend = fromValue(addend);\r\n\r\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = addend.high >>> 16;\r\n var b32 = addend.high & 0xFFFF;\r\n var b16 = addend.low >>> 16;\r\n var b00 = addend.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 + b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 + b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 + b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 + b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the difference of this and the specified Long.\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\n LongPrototype.subtract = function subtract(subtrahend) {\r\n if (!isLong(subtrahend))\r\n subtrahend = fromValue(subtrahend);\r\n return this.add(subtrahend.neg());\r\n };\r\n\r\n /**\r\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n * @function\r\n * @param {!Long|number|string} subtrahend Subtrahend\r\n * @returns {!Long} Difference\r\n */\r\n LongPrototype.sub = LongPrototype.subtract;\r\n\r\n /**\r\n * Returns the product of this and the specified Long.\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\n LongPrototype.multiply = function multiply(multiplier) {\r\n if (this.isZero())\r\n return ZERO;\r\n if (!isLong(multiplier))\r\n multiplier = fromValue(multiplier);\r\n if (multiplier.isZero())\r\n return ZERO;\r\n if (this.eq(MIN_VALUE))\r\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n if (multiplier.eq(MIN_VALUE))\r\n return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n if (this.isNegative()) {\r\n if (multiplier.isNegative())\r\n return this.neg().mul(multiplier.neg());\r\n else\r\n return this.neg().mul(multiplier).neg();\r\n } else if (multiplier.isNegative())\r\n return this.mul(multiplier.neg()).neg();\r\n\r\n // If both longs are small, use float multiplication\r\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n // We can skip products that would overflow.\r\n\r\n var a48 = this.high >>> 16;\r\n var a32 = this.high & 0xFFFF;\r\n var a16 = this.low >>> 16;\r\n var a00 = this.low & 0xFFFF;\r\n\r\n var b48 = multiplier.high >>> 16;\r\n var b32 = multiplier.high & 0xFFFF;\r\n var b16 = multiplier.low >>> 16;\r\n var b00 = multiplier.low & 0xFFFF;\r\n\r\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n c00 += a00 * b00;\r\n c16 += c00 >>> 16;\r\n c00 &= 0xFFFF;\r\n c16 += a16 * b00;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c16 += a00 * b16;\r\n c32 += c16 >>> 16;\r\n c16 &= 0xFFFF;\r\n c32 += a32 * b00;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a16 * b16;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c32 += a00 * b32;\r\n c48 += c32 >>> 16;\r\n c32 &= 0xFFFF;\r\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n c48 &= 0xFFFF;\r\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n * @function\r\n * @param {!Long|number|string} multiplier Multiplier\r\n * @returns {!Long} Product\r\n */\r\n LongPrototype.mul = LongPrototype.multiply;\r\n\r\n /**\r\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n * unsigned if this Long is unsigned.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\n LongPrototype.divide = function divide(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n if (divisor.isZero())\r\n throw Error('division by zero');\r\n if (this.isZero())\r\n return this.unsigned ? UZERO : ZERO;\r\n var approx, rem, res;\r\n if (!this.unsigned) {\r\n // This section is only relevant for signed longs and is derived from the\r\n // closure library as a whole.\r\n if (this.eq(MIN_VALUE)) {\r\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\r\n else if (divisor.eq(MIN_VALUE))\r\n return ONE;\r\n else {\r\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n var halfThis = this.shr(1);\r\n approx = halfThis.div(divisor).shl(1);\r\n if (approx.eq(ZERO)) {\r\n return divisor.isNegative() ? ONE : NEG_ONE;\r\n } else {\r\n rem = this.sub(divisor.mul(approx));\r\n res = approx.add(rem.div(divisor));\r\n return res;\r\n }\r\n }\r\n } else if (divisor.eq(MIN_VALUE))\r\n return this.unsigned ? UZERO : ZERO;\r\n if (this.isNegative()) {\r\n if (divisor.isNegative())\r\n return this.neg().div(divisor.neg());\r\n return this.neg().div(divisor).neg();\r\n } else if (divisor.isNegative())\r\n return this.div(divisor.neg()).neg();\r\n res = ZERO;\r\n } else {\r\n // The algorithm below has not been made for unsigned longs. It's therefore\r\n // required to take special care of the MSB prior to running it.\r\n if (!divisor.unsigned)\r\n divisor = divisor.toUnsigned();\r\n if (divisor.gt(this))\r\n return UZERO;\r\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n return UONE;\r\n res = UZERO;\r\n }\r\n\r\n // Repeat the following until the remainder is less than other: find a\r\n // floating-point that approximates remainder / other *from below*, add this\r\n // into the result, and subtract it from the remainder. It is critical that\r\n // the approximate value is less than or equal to the real value so that the\r\n // remainder never becomes negative.\r\n rem = this;\r\n while (rem.gte(divisor)) {\r\n // Approximate the result of division. This may be a little greater or\r\n // smaller than the actual value.\r\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n // We will tweak the approximate result by changing it in the 48-th digit or\r\n // the smallest non-fractional digit, whichever is larger.\r\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n // Decrease the approximation until it is smaller than the remainder. Note\r\n // that if it is too large, the product overflows and is negative.\r\n approxRes = fromNumber(approx),\r\n approxRem = approxRes.mul(divisor);\r\n while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n approx -= delta;\r\n approxRes = fromNumber(approx, this.unsigned);\r\n approxRem = approxRes.mul(divisor);\r\n }\r\n\r\n // We know the answer can't be zero... and actually, zero would cause\r\n // infinite recursion since we would make no progress.\r\n if (approxRes.isZero())\r\n approxRes = ONE;\r\n\r\n res = res.add(approxRes);\r\n rem = rem.sub(approxRem);\r\n }\r\n return res;\r\n };\r\n\r\n /**\r\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Quotient\r\n */\r\n LongPrototype.div = LongPrototype.divide;\r\n\r\n /**\r\n * Returns this Long modulo the specified.\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\n LongPrototype.modulo = function modulo(divisor) {\r\n if (!isLong(divisor))\r\n divisor = fromValue(divisor);\r\n return this.sub(this.div(divisor).mul(divisor));\r\n };\r\n\r\n /**\r\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n * @function\r\n * @param {!Long|number|string} divisor Divisor\r\n * @returns {!Long} Remainder\r\n */\r\n LongPrototype.mod = LongPrototype.modulo;\r\n\r\n /**\r\n * Returns the bitwise NOT of this Long.\r\n * @returns {!Long}\r\n */\r\n LongPrototype.not = function not() {\r\n return fromBits(~this.low, ~this.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the bitwise AND of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\n LongPrototype.and = function and(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the bitwise OR of this Long and the specified.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\n LongPrototype.or = function or(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns the bitwise XOR of this Long and the given one.\r\n * @param {!Long|number|string} other Other Long\r\n * @returns {!Long}\r\n */\r\n LongPrototype.xor = function xor(other) {\r\n if (!isLong(other))\r\n other = fromValue(other);\r\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns this Long with bits shifted to the left by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n else\r\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n /**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shiftRight = function shiftRight(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n if ((numBits &= 63) === 0)\r\n return this;\r\n else if (numBits < 32)\r\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n else\r\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n };\r\n\r\n /**\r\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n /**\r\n * Returns this Long with bits logically shifted to the right by the given amount.\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n if (isLong(numBits))\r\n numBits = numBits.toInt();\r\n numBits &= 63;\r\n if (numBits === 0)\r\n return this;\r\n else {\r\n var high = this.high;\r\n if (numBits < 32) {\r\n var low = this.low;\r\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n } else if (numBits === 32)\r\n return fromBits(high, 0, this.unsigned);\r\n else\r\n return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n }\r\n };\r\n\r\n /**\r\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n * @function\r\n * @param {number|!Long} numBits Number of bits\r\n * @returns {!Long} Shifted Long\r\n */\r\n LongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n /**\r\n * Converts this Long to signed.\r\n * @returns {!Long} Signed long\r\n */\r\n LongPrototype.toSigned = function toSigned() {\r\n if (!this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, false);\r\n };\r\n\r\n /**\r\n * Converts this Long to unsigned.\r\n * @returns {!Long} Unsigned long\r\n */\r\n LongPrototype.toUnsigned = function toUnsigned() {\r\n if (this.unsigned)\r\n return this;\r\n return fromBits(this.low, this.high, true);\r\n };\r\n\r\n /**\r\n * Converts this Long to its byte representation.\r\n * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n * @returns {!Array.} Byte representation\r\n */\r\n LongPrototype.toBytes = function(le) {\r\n return le ? this.toBytesLE() : this.toBytesBE();\r\n }\r\n\r\n /**\r\n * Converts this Long to its little endian byte representation.\r\n * @returns {!Array.} Little endian byte representation\r\n */\r\n LongPrototype.toBytesLE = function() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n lo & 0xff,\r\n (lo >>> 8) & 0xff,\r\n (lo >>> 16) & 0xff,\r\n (lo >>> 24) & 0xff,\r\n hi & 0xff,\r\n (hi >>> 8) & 0xff,\r\n (hi >>> 16) & 0xff,\r\n (hi >>> 24) & 0xff\r\n ];\r\n }\r\n\r\n /**\r\n * Converts this Long to its big endian byte representation.\r\n * @returns {!Array.} Big endian byte representation\r\n */\r\n LongPrototype.toBytesBE = function() {\r\n var hi = this.high,\r\n lo = this.low;\r\n return [\r\n (hi >>> 24) & 0xff,\r\n (hi >>> 16) & 0xff,\r\n (hi >>> 8) & 0xff,\r\n hi & 0xff,\r\n (lo >>> 24) & 0xff,\r\n (lo >>> 16) & 0xff,\r\n (lo >>> 8) & 0xff,\r\n lo & 0xff\r\n ];\r\n }\r\n\r\n return Long;\r\n});\r\n","/*\r\n Copyright 2013-2014 Daniel Wirtz \r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license bytebuffer.js (c) 2015 Daniel Wirtz \r\n * Backing buffer: ArrayBuffer, Accessor: Uint8Array\r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/bytebuffer.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n define([\"long\"], factory);\r\n /* CommonJS */ else if (typeof require === 'function' && typeof module === \"object\" && module && module[\"exports\"])\r\n module['exports'] = (function() {\r\n var Long; try { Long = require(\"long\"); } catch (e) {}\r\n return factory(Long);\r\n })();\r\n /* Global */ else\r\n (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"ByteBuffer\"] = factory(global[\"dcodeIO\"][\"Long\"]);\r\n\r\n})(this, function(Long) {\r\n \"use strict\";\r\n\r\n /**\r\n * Constructs a new ByteBuffer.\r\n * @class The swiss army knife for binary data in JavaScript.\r\n * @exports ByteBuffer\r\n * @constructor\r\n * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @expose\r\n */\r\n var ByteBuffer = function(capacity, littleEndian, noAssert) {\r\n if (typeof capacity === 'undefined')\r\n capacity = ByteBuffer.DEFAULT_CAPACITY;\r\n if (typeof littleEndian === 'undefined')\r\n littleEndian = ByteBuffer.DEFAULT_ENDIAN;\r\n if (typeof noAssert === 'undefined')\r\n noAssert = ByteBuffer.DEFAULT_NOASSERT;\r\n if (!noAssert) {\r\n capacity = capacity | 0;\r\n if (capacity < 0)\r\n throw RangeError(\"Illegal capacity\");\r\n littleEndian = !!littleEndian;\r\n noAssert = !!noAssert;\r\n }\r\n\r\n /**\r\n * Backing ArrayBuffer.\r\n * @type {!ArrayBuffer}\r\n * @expose\r\n */\r\n this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity);\r\n\r\n /**\r\n * Uint8Array utilized to manipulate the backing buffer. Becomes `null` if the backing buffer has a capacity of `0`.\r\n * @type {?Uint8Array}\r\n * @expose\r\n */\r\n this.view = capacity === 0 ? null : new Uint8Array(this.buffer);\r\n\r\n /**\r\n * Absolute read/write offset.\r\n * @type {number}\r\n * @expose\r\n * @see ByteBuffer#flip\r\n * @see ByteBuffer#clear\r\n */\r\n this.offset = 0;\r\n\r\n /**\r\n * Marked offset.\r\n * @type {number}\r\n * @expose\r\n * @see ByteBuffer#mark\r\n * @see ByteBuffer#reset\r\n */\r\n this.markedOffset = -1;\r\n\r\n /**\r\n * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.\r\n * @type {number}\r\n * @expose\r\n * @see ByteBuffer#flip\r\n * @see ByteBuffer#clear\r\n */\r\n this.limit = capacity;\r\n\r\n /**\r\n * Whether to use little endian byte order, defaults to `false` for big endian.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.littleEndian = littleEndian;\r\n\r\n /**\r\n * Whether to skip assertions of offsets and values, defaults to `false`.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.noAssert = noAssert;\r\n };\r\n\r\n /**\r\n * ByteBuffer version.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.VERSION = \"5.0.1\";\r\n\r\n /**\r\n * Little endian constant that can be used instead of its boolean value. Evaluates to `true`.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.LITTLE_ENDIAN = true;\r\n\r\n /**\r\n * Big endian constant that can be used instead of its boolean value. Evaluates to `false`.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.BIG_ENDIAN = false;\r\n\r\n /**\r\n * Default initial capacity of `16`.\r\n * @type {number}\r\n * @expose\r\n */\r\n ByteBuffer.DEFAULT_CAPACITY = 16;\r\n\r\n /**\r\n * Default endianess of `false` for big endian.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;\r\n\r\n /**\r\n * Default no assertions flag of `false`.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ByteBuffer.DEFAULT_NOASSERT = false;\r\n\r\n /**\r\n * A `Long` class for representing a 64-bit two's-complement integer value. May be `null` if Long.js has not been loaded\r\n * and int64 support is not available.\r\n * @type {?Long}\r\n * @const\r\n * @see https://github.com/dcodeIO/long.js\r\n * @expose\r\n */\r\n ByteBuffer.Long = Long || null;\r\n\r\n /**\r\n * @alias ByteBuffer.prototype\r\n * @inner\r\n */\r\n var ByteBufferPrototype = ByteBuffer.prototype;\r\n\r\n /**\r\n * An indicator used to reliably determine if an object is a ByteBuffer or not.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n * @private\r\n */\r\n ByteBufferPrototype.__isByteBuffer__;\r\n\r\n Object.defineProperty(ByteBufferPrototype, \"__isByteBuffer__\", {\r\n value: true,\r\n enumerable: false,\r\n configurable: false\r\n });\r\n\r\n // helpers\r\n\r\n /**\r\n * @type {!ArrayBuffer}\r\n * @inner\r\n */\r\n var EMPTY_BUFFER = new ArrayBuffer(0);\r\n\r\n /**\r\n * String.fromCharCode reference for compile-time renaming.\r\n * @type {function(...number):string}\r\n * @inner\r\n */\r\n var stringFromCharCode = String.fromCharCode;\r\n\r\n /**\r\n * Creates a source function for a string.\r\n * @param {string} s String to read from\r\n * @returns {function():number|null} Source function returning the next char code respectively `null` if there are\r\n * no more characters left.\r\n * @throws {TypeError} If the argument is invalid\r\n * @inner\r\n */\r\n function stringSource(s) {\r\n var i=0; return function() {\r\n return i < s.length ? s.charCodeAt(i++) : null;\r\n };\r\n }\r\n\r\n /**\r\n * Creates a destination function for a string.\r\n * @returns {function(number=):undefined|string} Destination function successively called with the next char code.\r\n * Returns the final string when called without arguments.\r\n * @inner\r\n */\r\n function stringDestination() {\r\n var cs = [], ps = []; return function() {\r\n if (arguments.length === 0)\r\n return ps.join('')+stringFromCharCode.apply(String, cs);\r\n if (cs.length + arguments.length > 1024)\r\n ps.push(stringFromCharCode.apply(String, cs)),\r\n cs.length = 0;\r\n Array.prototype.push.apply(cs, arguments);\r\n };\r\n }\r\n\r\n /**\r\n * Gets the accessor type.\r\n * @returns {Function} `Buffer` under node.js, `Uint8Array` respectively `DataView` in the browser (classes)\r\n * @expose\r\n */\r\n ByteBuffer.accessor = function() {\r\n return Uint8Array;\r\n };\r\n /**\r\n * Allocates a new ByteBuffer backed by a buffer of the specified capacity.\r\n * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer}\r\n * @expose\r\n */\r\n ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {\r\n return new ByteBuffer(capacity, littleEndian, noAssert);\r\n };\r\n\r\n /**\r\n * Concatenates multiple ByteBuffers into one.\r\n * @param {!Array.} buffers Buffers to concatenate\r\n * @param {(string|boolean)=} encoding String encoding if `buffers` contains a string (\"base64\", \"hex\", \"binary\",\r\n * defaults to \"utf8\")\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order for the resulting ByteBuffer. Defaults\r\n * to {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values for the resulting ByteBuffer. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} Concatenated ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {\r\n if (typeof encoding === 'boolean' || typeof encoding !== 'string') {\r\n noAssert = littleEndian;\r\n littleEndian = encoding;\r\n encoding = undefined;\r\n }\r\n var capacity = 0;\r\n for (var i=0, k=buffers.length, length; i 0) capacity += length;\r\n }\r\n if (capacity === 0)\r\n return new ByteBuffer(0, littleEndian, noAssert);\r\n var bb = new ByteBuffer(capacity, littleEndian, noAssert),\r\n bi;\r\n i=0; while (i} buffer Anything that can be wrapped\r\n * @param {(string|boolean)=} encoding String encoding if `buffer` is a string (\"base64\", \"hex\", \"binary\", defaults to\r\n * \"utf8\")\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} A ByteBuffer wrapping `buffer`\r\n * @expose\r\n */\r\n ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {\r\n if (typeof encoding !== 'string') {\r\n noAssert = littleEndian;\r\n littleEndian = encoding;\r\n encoding = undefined;\r\n }\r\n if (typeof buffer === 'string') {\r\n if (typeof encoding === 'undefined')\r\n encoding = \"utf8\";\r\n switch (encoding) {\r\n case \"base64\":\r\n return ByteBuffer.fromBase64(buffer, littleEndian);\r\n case \"hex\":\r\n return ByteBuffer.fromHex(buffer, littleEndian);\r\n case \"binary\":\r\n return ByteBuffer.fromBinary(buffer, littleEndian);\r\n case \"utf8\":\r\n return ByteBuffer.fromUTF8(buffer, littleEndian);\r\n case \"debug\":\r\n return ByteBuffer.fromDebug(buffer, littleEndian);\r\n default:\r\n throw Error(\"Unsupported encoding: \"+encoding);\r\n }\r\n }\r\n if (buffer === null || typeof buffer !== 'object')\r\n throw TypeError(\"Illegal buffer\");\r\n var bb;\r\n if (ByteBuffer.isByteBuffer(buffer)) {\r\n bb = ByteBufferPrototype.clone.call(buffer);\r\n bb.markedOffset = -1;\r\n return bb;\r\n }\r\n if (buffer instanceof Uint8Array) { // Extract ArrayBuffer from Uint8Array\r\n bb = new ByteBuffer(0, littleEndian, noAssert);\r\n if (buffer.length > 0) { // Avoid references to more than one EMPTY_BUFFER\r\n bb.buffer = buffer.buffer;\r\n bb.offset = buffer.byteOffset;\r\n bb.limit = buffer.byteOffset + buffer.byteLength;\r\n bb.view = new Uint8Array(buffer.buffer);\r\n }\r\n } else if (buffer instanceof ArrayBuffer) { // Reuse ArrayBuffer\r\n bb = new ByteBuffer(0, littleEndian, noAssert);\r\n if (buffer.byteLength > 0) {\r\n bb.buffer = buffer;\r\n bb.offset = 0;\r\n bb.limit = buffer.byteLength;\r\n bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null;\r\n }\r\n } else if (Object.prototype.toString.call(buffer) === \"[object Array]\") { // Create from octets\r\n bb = new ByteBuffer(buffer.length, littleEndian, noAssert);\r\n bb.limit = buffer.length;\r\n for (var i=0; i} value Array of booleans to write\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n * @returns {!ByteBuffer}\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeBitSet = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (!(value instanceof Array))\r\n throw TypeError(\"Illegal BitSet: Not an array\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n\r\n var start = offset,\r\n bits = value.length,\r\n bytes = (bits >> 3),\r\n bit = 0,\r\n k;\r\n\r\n offset += this.writeVarint32(bits,offset);\r\n\r\n while(bytes--) {\r\n k = (!!value[bit++] & 1) |\r\n ((!!value[bit++] & 1) << 1) |\r\n ((!!value[bit++] & 1) << 2) |\r\n ((!!value[bit++] & 1) << 3) |\r\n ((!!value[bit++] & 1) << 4) |\r\n ((!!value[bit++] & 1) << 5) |\r\n ((!!value[bit++] & 1) << 6) |\r\n ((!!value[bit++] & 1) << 7);\r\n this.writeByte(k,offset++);\r\n }\r\n\r\n if(bit < bits) {\r\n var m = 0; k = 0;\r\n while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++));\r\n this.writeByte(k,offset++);\r\n }\r\n\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n }\r\n\r\n /**\r\n * Reads a BitSet as an array of booleans.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n * @returns {Array\r\n * @expose\r\n */\r\n ByteBufferPrototype.readBitSet = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n\r\n var ret = this.readVarint32(offset),\r\n bits = ret.value,\r\n bytes = (bits >> 3),\r\n bit = 0,\r\n value = [],\r\n k;\r\n\r\n offset += ret.length;\r\n\r\n while(bytes--) {\r\n k = this.readByte(offset++);\r\n value[bit++] = !!(k & 0x01);\r\n value[bit++] = !!(k & 0x02);\r\n value[bit++] = !!(k & 0x04);\r\n value[bit++] = !!(k & 0x08);\r\n value[bit++] = !!(k & 0x10);\r\n value[bit++] = !!(k & 0x20);\r\n value[bit++] = !!(k & 0x40);\r\n value[bit++] = !!(k & 0x80);\r\n }\r\n\r\n if(bit < bits) {\r\n var m = 0;\r\n k = this.readByte(offset++);\r\n while(bit < bits) value[bit++] = !!((k >> (m++)) & 1);\r\n }\r\n\r\n if (relative) {\r\n this.offset = offset;\r\n }\r\n return value;\r\n }\r\n /**\r\n * Reads the specified number of bytes.\r\n * @param {number} length Number of bytes to read\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n * @returns {!ByteBuffer}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readBytes = function(length, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + length > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+length+\") <= \"+this.buffer.byteLength);\n }\r\n var slice = this.slice(offset, offset + length);\r\n if (relative) this.offset += length;\n return slice;\r\n };\r\n\r\n /**\r\n * Writes a payload of bytes. This is an alias of {@link ByteBuffer#append}.\r\n * @function\r\n * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to write. If `source` is a ByteBuffer, its offsets\r\n * will be modified according to the performed read operation.\r\n * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeBytes = ByteBufferPrototype.append;\r\n\r\n // types/ints/int8\r\n\r\n /**\r\n * Writes an 8bit signed integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt8 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 1;\n var capacity0 = this.buffer.byteLength;\n if (offset > capacity0)\n this.resize((capacity0 *= 2) > offset ? capacity0 : offset);\n offset -= 1;\n this.view[offset] = value;\r\n if (relative) this.offset += 1;\n return this;\r\n };\r\n\r\n /**\r\n * Writes an 8bit signed integer. This is an alias of {@link ByteBuffer#writeInt8}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;\r\n\r\n /**\r\n * Reads an 8bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt8 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var value = this.view[offset];\r\n if ((value & 0x80) === 0x80) value = -(0xFF - value + 1); // Cast to signed\r\n if (relative) this.offset += 1;\n return value;\r\n };\r\n\r\n /**\r\n * Reads an 8bit signed integer. This is an alias of {@link ByteBuffer#readInt8}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;\r\n\r\n /**\r\n * Writes an 8bit unsigned integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint8 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value >>>= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 1;\n var capacity1 = this.buffer.byteLength;\n if (offset > capacity1)\n this.resize((capacity1 *= 2) > offset ? capacity1 : offset);\n offset -= 1;\n this.view[offset] = value;\r\n if (relative) this.offset += 1;\n return this;\r\n };\r\n\r\n /**\r\n * Writes an 8bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint8}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8;\r\n\r\n /**\r\n * Reads an 8bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint8 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var value = this.view[offset];\r\n if (relative) this.offset += 1;\n return value;\r\n };\r\n\r\n /**\r\n * Reads an 8bit unsigned integer. This is an alias of {@link ByteBuffer#readUint8}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8;\r\n\r\n // types/ints/int16\r\n\r\n /**\r\n * Writes a 16bit signed integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt16 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 2;\n var capacity2 = this.buffer.byteLength;\n if (offset > capacity2)\n this.resize((capacity2 *= 2) > offset ? capacity2 : offset);\n offset -= 2;\n if (this.littleEndian) {\r\n this.view[offset+1] = (value & 0xFF00) >>> 8;\r\n this.view[offset ] = value & 0x00FF;\r\n } else {\r\n this.view[offset] = (value & 0xFF00) >>> 8;\r\n this.view[offset+1] = value & 0x00FF;\r\n }\r\n if (relative) this.offset += 2;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 16bit signed integer. This is an alias of {@link ByteBuffer#writeInt16}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;\r\n\r\n /**\r\n * Reads a 16bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt16 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 2 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+2+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\r\n value = this.view[offset ];\r\n value |= this.view[offset+1] << 8;\r\n } else {\r\n value = this.view[offset ] << 8;\r\n value |= this.view[offset+1];\r\n }\r\n if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1); // Cast to signed\r\n if (relative) this.offset += 2;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 16bit signed integer. This is an alias of {@link ByteBuffer#readInt16}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;\r\n\r\n /**\r\n * Writes a 16bit unsigned integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint16 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value >>>= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 2;\n var capacity3 = this.buffer.byteLength;\n if (offset > capacity3)\n this.resize((capacity3 *= 2) > offset ? capacity3 : offset);\n offset -= 2;\n if (this.littleEndian) {\r\n this.view[offset+1] = (value & 0xFF00) >>> 8;\r\n this.view[offset ] = value & 0x00FF;\r\n } else {\r\n this.view[offset] = (value & 0xFF00) >>> 8;\r\n this.view[offset+1] = value & 0x00FF;\r\n }\r\n if (relative) this.offset += 2;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 16bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint16}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @throws {TypeError} If `offset` or `value` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16;\r\n\r\n /**\r\n * Reads a 16bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint16 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 2 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+2+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\r\n value = this.view[offset ];\r\n value |= this.view[offset+1] << 8;\r\n } else {\r\n value = this.view[offset ] << 8;\r\n value |= this.view[offset+1];\r\n }\r\n if (relative) this.offset += 2;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 16bit unsigned integer. This is an alias of {@link ByteBuffer#readUint16}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n * @returns {number} Value read\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16;\r\n\r\n // types/ints/int32\r\n\r\n /**\r\n * Writes a 32bit signed integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 4;\n var capacity4 = this.buffer.byteLength;\n if (offset > capacity4)\n this.resize((capacity4 *= 2) > offset ? capacity4 : offset);\n offset -= 4;\n if (this.littleEndian) {\n this.view[offset+3] = (value >>> 24) & 0xFF;\n this.view[offset+2] = (value >>> 16) & 0xFF;\n this.view[offset+1] = (value >>> 8) & 0xFF;\n this.view[offset ] = value & 0xFF;\n } else {\n this.view[offset ] = (value >>> 24) & 0xFF;\n this.view[offset+1] = (value >>> 16) & 0xFF;\n this.view[offset+2] = (value >>> 8) & 0xFF;\n this.view[offset+3] = value & 0xFF;\n }\n if (relative) this.offset += 4;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 32bit signed integer. This is an alias of {@link ByteBuffer#writeInt32}.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;\r\n\r\n /**\r\n * Reads a 32bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\n value = this.view[offset+2] << 16;\n value |= this.view[offset+1] << 8;\n value |= this.view[offset ];\n value += this.view[offset+3] << 24 >>> 0;\n } else {\n value = this.view[offset+1] << 16;\n value |= this.view[offset+2] << 8;\n value |= this.view[offset+3];\n value += this.view[offset ] << 24 >>> 0;\n }\n value |= 0; // Cast to signed\r\n if (relative) this.offset += 4;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 32bit signed integer. This is an alias of {@link ByteBuffer#readInt32}.\r\n * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;\r\n\r\n /**\r\n * Writes a 32bit unsigned integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value >>>= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 4;\n var capacity5 = this.buffer.byteLength;\n if (offset > capacity5)\n this.resize((capacity5 *= 2) > offset ? capacity5 : offset);\n offset -= 4;\n if (this.littleEndian) {\n this.view[offset+3] = (value >>> 24) & 0xFF;\n this.view[offset+2] = (value >>> 16) & 0xFF;\n this.view[offset+1] = (value >>> 8) & 0xFF;\n this.view[offset ] = value & 0xFF;\n } else {\n this.view[offset ] = (value >>> 24) & 0xFF;\n this.view[offset+1] = (value >>> 16) & 0xFF;\n this.view[offset+2] = (value >>> 8) & 0xFF;\n this.view[offset+3] = value & 0xFF;\n }\n if (relative) this.offset += 4;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 32bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint32}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32;\r\n\r\n /**\r\n * Reads a 32bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var value = 0;\r\n if (this.littleEndian) {\n value = this.view[offset+2] << 16;\n value |= this.view[offset+1] << 8;\n value |= this.view[offset ];\n value += this.view[offset+3] << 24 >>> 0;\n } else {\n value = this.view[offset+1] << 16;\n value |= this.view[offset+2] << 8;\n value |= this.view[offset+3];\n value += this.view[offset ] << 24 >>> 0;\n }\n if (relative) this.offset += 4;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 32bit unsigned integer. This is an alias of {@link ByteBuffer#readUint32}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number} Value read\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32;\r\n\r\n // types/ints/int64\r\n\r\n if (Long) {\r\n\r\n /**\r\n * Writes a 64bit signed integer.\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeInt64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n else if (!(value && value instanceof Long))\n throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n offset += 8;\n var capacity6 = this.buffer.byteLength;\n if (offset > capacity6)\n this.resize((capacity6 *= 2) > offset ? capacity6 : offset);\n offset -= 8;\n var lo = value.low,\r\n hi = value.high;\r\n if (this.littleEndian) {\r\n this.view[offset+3] = (lo >>> 24) & 0xFF;\n this.view[offset+2] = (lo >>> 16) & 0xFF;\n this.view[offset+1] = (lo >>> 8) & 0xFF;\n this.view[offset ] = lo & 0xFF;\n offset += 4;\r\n this.view[offset+3] = (hi >>> 24) & 0xFF;\n this.view[offset+2] = (hi >>> 16) & 0xFF;\n this.view[offset+1] = (hi >>> 8) & 0xFF;\n this.view[offset ] = hi & 0xFF;\n } else {\r\n this.view[offset ] = (hi >>> 24) & 0xFF;\n this.view[offset+1] = (hi >>> 16) & 0xFF;\n this.view[offset+2] = (hi >>> 8) & 0xFF;\n this.view[offset+3] = hi & 0xFF;\n offset += 4;\r\n this.view[offset ] = (lo >>> 24) & 0xFF;\n this.view[offset+1] = (lo >>> 16) & 0xFF;\n this.view[offset+2] = (lo >>> 8) & 0xFF;\n this.view[offset+3] = lo & 0xFF;\n }\r\n if (relative) this.offset += 8;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 64bit signed integer. This is an alias of {@link ByteBuffer#writeInt64}.\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;\r\n\r\n /**\r\n * Reads a 64bit signed integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readInt64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 8 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n }\r\n var lo = 0,\r\n hi = 0;\r\n if (this.littleEndian) {\r\n lo = this.view[offset+2] << 16;\n lo |= this.view[offset+1] << 8;\n lo |= this.view[offset ];\n lo += this.view[offset+3] << 24 >>> 0;\n offset += 4;\r\n hi = this.view[offset+2] << 16;\n hi |= this.view[offset+1] << 8;\n hi |= this.view[offset ];\n hi += this.view[offset+3] << 24 >>> 0;\n } else {\r\n hi = this.view[offset+1] << 16;\n hi |= this.view[offset+2] << 8;\n hi |= this.view[offset+3];\n hi += this.view[offset ] << 24 >>> 0;\n offset += 4;\r\n lo = this.view[offset+1] << 16;\n lo |= this.view[offset+2] << 8;\n lo |= this.view[offset+3];\n lo += this.view[offset ] << 24 >>> 0;\n }\r\n var value = new Long(lo, hi, false);\r\n if (relative) this.offset += 8;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 64bit signed integer. This is an alias of {@link ByteBuffer#readInt64}.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;\r\n\r\n /**\r\n * Writes a 64bit unsigned integer.\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUint64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n else if (!(value && value instanceof Long))\n throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n offset += 8;\n var capacity7 = this.buffer.byteLength;\n if (offset > capacity7)\n this.resize((capacity7 *= 2) > offset ? capacity7 : offset);\n offset -= 8;\n var lo = value.low,\r\n hi = value.high;\r\n if (this.littleEndian) {\r\n this.view[offset+3] = (lo >>> 24) & 0xFF;\n this.view[offset+2] = (lo >>> 16) & 0xFF;\n this.view[offset+1] = (lo >>> 8) & 0xFF;\n this.view[offset ] = lo & 0xFF;\n offset += 4;\r\n this.view[offset+3] = (hi >>> 24) & 0xFF;\n this.view[offset+2] = (hi >>> 16) & 0xFF;\n this.view[offset+1] = (hi >>> 8) & 0xFF;\n this.view[offset ] = hi & 0xFF;\n } else {\r\n this.view[offset ] = (hi >>> 24) & 0xFF;\n this.view[offset+1] = (hi >>> 16) & 0xFF;\n this.view[offset+2] = (hi >>> 8) & 0xFF;\n this.view[offset+3] = hi & 0xFF;\n offset += 4;\r\n this.view[offset ] = (lo >>> 24) & 0xFF;\n this.view[offset+1] = (lo >>> 16) & 0xFF;\n this.view[offset+2] = (lo >>> 8) & 0xFF;\n this.view[offset+3] = lo & 0xFF;\n }\r\n if (relative) this.offset += 8;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 64bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint64}.\r\n * @function\r\n * @param {number|!Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64;\r\n\r\n /**\r\n * Reads a 64bit unsigned integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUint64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 8 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n }\r\n var lo = 0,\r\n hi = 0;\r\n if (this.littleEndian) {\r\n lo = this.view[offset+2] << 16;\n lo |= this.view[offset+1] << 8;\n lo |= this.view[offset ];\n lo += this.view[offset+3] << 24 >>> 0;\n offset += 4;\r\n hi = this.view[offset+2] << 16;\n hi |= this.view[offset+1] << 8;\n hi |= this.view[offset ];\n hi += this.view[offset+3] << 24 >>> 0;\n } else {\r\n hi = this.view[offset+1] << 16;\n hi |= this.view[offset+2] << 8;\n hi |= this.view[offset+3];\n hi += this.view[offset ] << 24 >>> 0;\n offset += 4;\r\n lo = this.view[offset+1] << 16;\n lo |= this.view[offset+2] << 8;\n lo |= this.view[offset+3];\n lo += this.view[offset ] << 24 >>> 0;\n }\r\n var value = new Long(lo, hi, true);\r\n if (relative) this.offset += 8;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 64bit unsigned integer. This is an alias of {@link ByteBuffer#readUint64}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!Long}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64;\r\n\r\n } // Long\r\n\r\n\r\n // types/floats/float32\r\n\r\n /*\r\n ieee754 - https://github.com/feross/ieee754\r\n\r\n The MIT License (MIT)\r\n\r\n Copyright (c) Feross Aboukhadijeh\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be included in\r\n all copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n THE SOFTWARE.\r\n */\r\n\r\n /**\r\n * Reads an IEEE754 float from a byte array.\r\n * @param {!Array} buffer\r\n * @param {number} offset\r\n * @param {boolean} isLE\r\n * @param {number} mLen\r\n * @param {number} nBytes\r\n * @returns {number}\r\n * @inner\r\n */\r\n function ieee754_read(buffer, offset, isLE, mLen, nBytes) {\r\n var e, m,\r\n eLen = nBytes * 8 - mLen - 1,\r\n eMax = (1 << eLen) - 1,\r\n eBias = eMax >> 1,\r\n nBits = -7,\r\n i = isLE ? (nBytes - 1) : 0,\r\n d = isLE ? -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\n /**\r\n * Writes an IEEE754 float to a byte array.\r\n * @param {!Array} buffer\r\n * @param {number} value\r\n * @param {number} offset\r\n * @param {boolean} isLE\r\n * @param {number} mLen\r\n * @param {number} nBytes\r\n * @inner\r\n */\r\n function ieee754_write(buffer, value, offset, isLE, 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 = isLE ? 0 : (nBytes - 1),\r\n d = isLE ? 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\r\n /**\r\n * Writes a 32bit float.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeFloat32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number')\r\n throw TypeError(\"Illegal value: \"+value+\" (not a number)\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 4;\n var capacity8 = this.buffer.byteLength;\n if (offset > capacity8)\n this.resize((capacity8 *= 2) > offset ? capacity8 : offset);\n offset -= 4;\n ieee754_write(this.view, value, offset, this.littleEndian, 23, 4);\r\n if (relative) this.offset += 4;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 32bit float. This is an alias of {@link ByteBuffer#writeFloat32}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;\r\n\r\n /**\r\n * Reads a 32bit float.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readFloat32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4);\r\n if (relative) this.offset += 4;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 32bit float. This is an alias of {@link ByteBuffer#readFloat32}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;\r\n\r\n // types/floats/float64\r\n\r\n /**\r\n * Writes a 64bit float.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeFloat64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number')\r\n throw TypeError(\"Illegal value: \"+value+\" (not a number)\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n offset += 8;\n var capacity9 = this.buffer.byteLength;\n if (offset > capacity9)\n this.resize((capacity9 *= 2) > offset ? capacity9 : offset);\n offset -= 8;\n ieee754_write(this.view, value, offset, this.littleEndian, 52, 8);\r\n if (relative) this.offset += 8;\n return this;\r\n };\r\n\r\n /**\r\n * Writes a 64bit float. This is an alias of {@link ByteBuffer#writeFloat64}.\r\n * @function\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;\r\n\r\n /**\r\n * Reads a 64bit float.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readFloat64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 8 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n }\r\n var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8);\r\n if (relative) this.offset += 8;\n return value;\r\n };\r\n\r\n /**\r\n * Reads a 64bit float. This is an alias of {@link ByteBuffer#readFloat64}.\r\n * @function\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n * @returns {number}\r\n * @expose\r\n */\r\n ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;\r\n\r\n\r\n // types/varints/varint32\r\n\r\n /**\r\n * Maximum number of bytes required to store a 32bit base 128 variable-length integer.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.MAX_VARINT32_BYTES = 5;\r\n\r\n /**\r\n * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.\r\n * @param {number} value Value to encode\r\n * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT32_BYTES}\r\n * @expose\r\n */\r\n ByteBuffer.calculateVarint32 = function(value) {\r\n // ref: src/google/protobuf/io/coded_stream.cc\r\n value = value >>> 0;\r\n if (value < 1 << 7 ) return 1;\r\n else if (value < 1 << 14) return 2;\r\n else if (value < 1 << 21) return 3;\r\n else if (value < 1 << 28) return 4;\r\n else return 5;\r\n };\r\n\r\n /**\r\n * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding.\r\n * @param {number} n Signed 32bit integer\r\n * @returns {number} Unsigned zigzag encoded 32bit integer\r\n * @expose\r\n */\r\n ByteBuffer.zigZagEncode32 = function(n) {\r\n return (((n |= 0) << 1) ^ (n >> 31)) >>> 0; // ref: src/google/protobuf/wire_format_lite.h\r\n };\r\n\r\n /**\r\n * Decodes a zigzag encoded signed 32bit integer.\r\n * @param {number} n Unsigned zigzag encoded 32bit integer\r\n * @returns {number} Signed 32bit integer\r\n * @expose\r\n */\r\n ByteBuffer.zigZagDecode32 = function(n) {\r\n return ((n >>> 1) ^ -(n & 1)) | 0; // // ref: src/google/protobuf/wire_format_lite.h\r\n };\r\n\r\n /**\r\n * Writes a 32bit base 128 variable-length integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint32 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var size = ByteBuffer.calculateVarint32(value),\r\n b;\r\n offset += size;\n var capacity10 = this.buffer.byteLength;\n if (offset > capacity10)\n this.resize((capacity10 *= 2) > offset ? capacity10 : offset);\n offset -= size;\n value >>>= 0;\r\n while (value >= 0x80) {\r\n b = (value & 0x7f) | 0x80;\r\n this.view[offset++] = b;\r\n value >>>= 7;\r\n }\r\n this.view[offset++] = value;\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return size;\r\n };\r\n\r\n /**\r\n * Writes a zig-zag encoded (signed) 32bit base 128 variable-length integer.\r\n * @param {number} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {\r\n return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);\r\n };\r\n\r\n /**\r\n * Reads a 32bit base 128 variable-length integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read\r\n * and the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint. Has a property `truncated = true` if there is not enough data available\r\n * to fully decode the varint.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint32 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var c = 0,\r\n value = 0 >>> 0,\r\n b;\r\n do {\r\n if (!this.noAssert && offset > this.limit) {\r\n var err = Error(\"Truncated\");\r\n err['truncated'] = true;\r\n throw err;\r\n }\r\n b = this.view[offset++];\r\n if (c < 5)\r\n value |= (b & 0x7f) << (7*c);\r\n ++c;\r\n } while ((b & 0x80) !== 0);\r\n value |= 0;\r\n if (relative) {\r\n this.offset = offset;\r\n return value;\r\n }\r\n return {\r\n \"value\": value,\r\n \"length\": c\r\n };\r\n };\r\n\r\n /**\r\n * Reads a zig-zag encoded (signed) 32bit base 128 variable-length integer.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read\r\n * and the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint32ZigZag = function(offset) {\r\n var val = this.readVarint32(offset);\r\n if (typeof val === 'object')\r\n val[\"value\"] = ByteBuffer.zigZagDecode32(val[\"value\"]);\r\n else\r\n val = ByteBuffer.zigZagDecode32(val);\r\n return val;\r\n };\r\n\r\n // types/varints/varint64\r\n\r\n if (Long) {\r\n\r\n /**\r\n * Maximum number of bytes required to store a 64bit base 128 variable-length integer.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.MAX_VARINT64_BYTES = 10;\r\n\r\n /**\r\n * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.\r\n * @param {number|!Long} value Value to encode\r\n * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT64_BYTES}\r\n * @expose\r\n */\r\n ByteBuffer.calculateVarint64 = function(value) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n // ref: src/google/protobuf/io/coded_stream.cc\r\n var part0 = value.toInt() >>> 0,\r\n part1 = value.shiftRightUnsigned(28).toInt() >>> 0,\r\n part2 = value.shiftRightUnsigned(56).toInt() >>> 0;\r\n if (part2 == 0) {\r\n if (part1 == 0) {\r\n if (part0 < 1 << 14)\r\n return part0 < 1 << 7 ? 1 : 2;\r\n else\r\n return part0 < 1 << 21 ? 3 : 4;\r\n } else {\r\n if (part1 < 1 << 14)\r\n return part1 < 1 << 7 ? 5 : 6;\r\n else\r\n return part1 < 1 << 21 ? 7 : 8;\r\n }\r\n } else\r\n return part2 < 1 << 7 ? 9 : 10;\r\n };\r\n\r\n /**\r\n * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding.\r\n * @param {number|!Long} value Signed long\r\n * @returns {!Long} Unsigned zigzag encoded long\r\n * @expose\r\n */\r\n ByteBuffer.zigZagEncode64 = function(value) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value, false);\n else if (typeof value === 'string')\n value = Long.fromString(value, false);\n else if (value.unsigned !== false) value = value.toSigned();\n // ref: src/google/protobuf/wire_format_lite.h\r\n return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();\r\n };\r\n\r\n /**\r\n * Decodes a zigzag encoded signed 64bit integer.\r\n * @param {!Long|number} value Unsigned zigzag encoded long or JavaScript number\r\n * @returns {!Long} Signed long\r\n * @expose\r\n */\r\n ByteBuffer.zigZagDecode64 = function(value) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value, false);\n else if (typeof value === 'string')\n value = Long.fromString(value, false);\n else if (value.unsigned !== false) value = value.toSigned();\n // ref: src/google/protobuf/wire_format_lite.h\r\n return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();\r\n };\r\n\r\n /**\r\n * Writes a 64bit base 128 variable-length integer.\r\n * @param {number|Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint64 = function(value, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof value === 'number')\n value = Long.fromNumber(value);\n else if (typeof value === 'string')\n value = Long.fromString(value);\n else if (!(value && value instanceof Long))\n throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (typeof value === 'number')\n value = Long.fromNumber(value, false);\n else if (typeof value === 'string')\n value = Long.fromString(value, false);\n else if (value.unsigned !== false) value = value.toSigned();\n var size = ByteBuffer.calculateVarint64(value),\r\n part0 = value.toInt() >>> 0,\r\n part1 = value.shiftRightUnsigned(28).toInt() >>> 0,\r\n part2 = value.shiftRightUnsigned(56).toInt() >>> 0;\r\n offset += size;\n var capacity11 = this.buffer.byteLength;\n if (offset > capacity11)\n this.resize((capacity11 *= 2) > offset ? capacity11 : offset);\n offset -= size;\n switch (size) {\r\n case 10: this.view[offset+9] = (part2 >>> 7) & 0x01;\r\n case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F;\r\n case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F;\r\n case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F;\r\n case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F;\r\n case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F;\r\n case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F;\r\n case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F;\r\n case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F;\r\n case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F;\r\n }\r\n if (relative) {\r\n this.offset += size;\r\n return this;\r\n } else {\r\n return size;\r\n }\r\n };\r\n\r\n /**\r\n * Writes a zig-zag encoded 64bit base 128 variable-length integer.\r\n * @param {number|Long} value Value to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {\r\n return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);\r\n };\r\n\r\n /**\r\n * Reads a 64bit base 128 variable-length integer. Requires Long.js.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and\r\n * the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint64 = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n // ref: src/google/protobuf/io/coded_stream.cc\r\n var start = offset,\r\n part0 = 0,\r\n part1 = 0,\r\n part2 = 0,\r\n b = 0;\r\n b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) {\r\n b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n throw Error(\"Buffer overrun\"); }}}}}}}}}}\r\n var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false);\r\n if (relative) {\r\n this.offset = offset;\r\n return value;\r\n } else {\r\n return {\r\n 'value': value,\r\n 'length': offset-start\r\n };\r\n }\r\n };\r\n\r\n /**\r\n * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and\r\n * the actual number of bytes read.\r\n * @throws {Error} If it's not a valid varint\r\n * @expose\r\n */\r\n ByteBufferPrototype.readVarint64ZigZag = function(offset) {\r\n var val = this.readVarint64(offset);\r\n if (val && val['value'] instanceof Long)\r\n val[\"value\"] = ByteBuffer.zigZagDecode64(val[\"value\"]);\r\n else\r\n val = ByteBuffer.zigZagDecode64(val);\r\n return val;\r\n };\r\n\r\n } // Long\r\n\r\n\r\n // types/strings/cstring\r\n\r\n /**\r\n * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL\r\n * characters itself.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * contained in `str` + 1 if omitted.\r\n * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeCString = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n var i,\r\n k = str.length;\r\n if (!this.noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n for (i=0; i>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n // UTF8 strings do not contain zero bytes in between except for the zero character, so:\r\n k = utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n offset += k+1;\n var capacity12 = this.buffer.byteLength;\n if (offset > capacity12)\n this.resize((capacity12 *= 2) > offset ? capacity12 : offset);\n offset -= k+1;\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n this.view[offset++] = 0;\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return k;\r\n };\r\n\r\n /**\r\n * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters\r\n * itself.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readCString = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset,\r\n temp;\r\n // UTF8 strings do not contain zero bytes in between except for the zero character itself, so:\r\n var sd, b = -1;\r\n utfx.decodeUTF8toUTF16(function() {\r\n if (b === 0) return null;\r\n if (offset >= this.limit)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" < \"+this.limit);\r\n b = this.view[offset++];\r\n return b === 0 ? null : b;\r\n }.bind(this), sd = stringDestination(), true);\r\n if (relative) {\r\n this.offset = offset;\r\n return sd();\r\n } else {\r\n return {\r\n \"string\": sd(),\r\n \"length\": offset - start\r\n };\r\n }\r\n };\r\n\r\n // types/strings/istring\r\n\r\n /**\r\n * Writes a length as uint32 prefixed UTF8 encoded string.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n * @see ByteBuffer#writeVarint32\r\n */\r\n ByteBufferPrototype.writeIString = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset,\r\n k;\r\n k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];\r\n offset += 4+k;\n var capacity13 = this.buffer.byteLength;\n if (offset > capacity13)\n this.resize((capacity13 *= 2) > offset ? capacity13 : offset);\n offset -= 4+k;\n if (this.littleEndian) {\n this.view[offset+3] = (k >>> 24) & 0xFF;\n this.view[offset+2] = (k >>> 16) & 0xFF;\n this.view[offset+1] = (k >>> 8) & 0xFF;\n this.view[offset ] = k & 0xFF;\n } else {\n this.view[offset ] = (k >>> 24) & 0xFF;\n this.view[offset+1] = (k >>> 16) & 0xFF;\n this.view[offset+2] = (k >>> 8) & 0xFF;\n this.view[offset+3] = k & 0xFF;\n }\n offset += 4;\r\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n if (offset !== start + 4 + k)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+(offset+4+k));\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n };\r\n\r\n /**\r\n * Reads a length as uint32 prefixed UTF8 encoded string.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n * @see ByteBuffer#readVarint32\r\n */\r\n ByteBufferPrototype.readIString = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 4 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset;\r\n var len = this.readUint32(offset);\r\n var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4);\r\n offset += str['length'];\r\n if (relative) {\r\n this.offset = offset;\r\n return str['string'];\r\n } else {\r\n return {\r\n 'string': str['string'],\r\n 'length': offset - start\r\n };\r\n }\r\n };\r\n\r\n // types/strings/utf8string\r\n\r\n /**\r\n * Metrics representing number of UTF8 characters. Evaluates to `c`.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.METRICS_CHARS = 'c';\r\n\r\n /**\r\n * Metrics representing number of bytes. Evaluates to `b`.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ByteBuffer.METRICS_BYTES = 'b';\r\n\r\n /**\r\n * Writes an UTF8 encoded string.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.\r\n * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeUTF8String = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var k;\r\n var start = offset;\r\n k = utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n offset += k;\n var capacity14 = this.buffer.byteLength;\n if (offset > capacity14)\n this.resize((capacity14 *= 2) > offset ? capacity14 : offset);\n offset -= k;\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n };\r\n\r\n /**\r\n * Writes an UTF8 encoded string. This is an alias of {@link ByteBuffer#writeUTF8String}.\r\n * @function\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.\r\n * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.\r\n * @expose\r\n */\r\n ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;\r\n\r\n /**\r\n * Calculates the number of UTF8 characters of a string. JavaScript itself uses UTF-16, so that a string's\r\n * `length` property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF.\r\n * @param {string} str String to calculate\r\n * @returns {number} Number of UTF8 characters\r\n * @expose\r\n */\r\n ByteBuffer.calculateUTF8Chars = function(str) {\r\n return utfx.calculateUTF16asUTF8(stringSource(str))[0];\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 bytes of a string.\r\n * @param {string} str String to calculate\r\n * @returns {number} Number of UTF8 bytes\r\n * @expose\r\n */\r\n ByteBuffer.calculateUTF8Bytes = function(str) {\r\n return utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 bytes of a string. This is an alias of {@link ByteBuffer.calculateUTF8Bytes}.\r\n * @function\r\n * @param {string} str String to calculate\r\n * @returns {number} Number of UTF8 bytes\r\n * @expose\r\n */\r\n ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes;\r\n\r\n /**\r\n * Reads an UTF8 encoded string.\r\n * @param {number} length Number of characters or bytes to read.\r\n * @param {string=} metrics Metrics specifying what `length` is meant to count. Defaults to\r\n * {@link ByteBuffer.METRICS_CHARS}.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {\r\n if (typeof metrics === 'number') {\r\n offset = metrics;\r\n metrics = undefined;\r\n }\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS;\r\n if (!this.noAssert) {\r\n if (typeof length !== 'number' || length % 1 !== 0)\n throw TypeError(\"Illegal length: \"+length+\" (not an integer)\");\n length |= 0;\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var i = 0,\r\n start = offset,\r\n sd;\r\n if (metrics === ByteBuffer.METRICS_CHARS) { // The same for node and the browser\r\n sd = stringDestination();\r\n utfx.decodeUTF8(function() {\r\n return i < length && offset < this.limit ? this.view[offset++] : null;\r\n }.bind(this), function(cp) {\r\n ++i; utfx.UTF8toUTF16(cp, sd);\r\n });\r\n if (i !== length)\r\n throw RangeError(\"Illegal range: Truncated data, \"+i+\" == \"+length);\r\n if (relative) {\r\n this.offset = offset;\r\n return sd();\r\n } else {\r\n return {\r\n \"string\": sd(),\r\n \"length\": offset - start\r\n };\r\n }\r\n } else if (metrics === ByteBuffer.METRICS_BYTES) {\r\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + length > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+length+\") <= \"+this.buffer.byteLength);\n }\r\n var k = offset + length;\r\n utfx.decodeUTF8toUTF16(function() {\r\n return offset < k ? this.view[offset++] : null;\r\n }.bind(this), sd = stringDestination(), this.noAssert);\r\n if (offset !== k)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+k);\r\n if (relative) {\r\n this.offset = offset;\r\n return sd();\r\n } else {\r\n return {\r\n 'string': sd(),\r\n 'length': offset - start\r\n };\r\n }\r\n } else\r\n throw TypeError(\"Unsupported metrics: \"+metrics);\r\n };\r\n\r\n /**\r\n * Reads an UTF8 encoded string. This is an alias of {@link ByteBuffer#readUTF8String}.\r\n * @function\r\n * @param {number} length Number of characters or bytes to read\r\n * @param {number=} metrics Metrics specifying what `n` is meant to count. Defaults to\r\n * {@link ByteBuffer.METRICS_CHARS}.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n */\r\n ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;\r\n\r\n // types/strings/vstring\r\n\r\n /**\r\n * Writes a length as varint32 prefixed UTF8 encoded string.\r\n * @param {string} str String to write\r\n * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written\r\n * @expose\r\n * @see ByteBuffer#writeVarint32\r\n */\r\n ByteBufferPrototype.writeVString = function(str, offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset,\r\n k, l;\r\n k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];\r\n l = ByteBuffer.calculateVarint32(k);\r\n offset += l+k;\n var capacity15 = this.buffer.byteLength;\n if (offset > capacity15)\n this.resize((capacity15 *= 2) > offset ? capacity15 : offset);\n offset -= l+k;\n offset += this.writeVarint32(k, offset);\r\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n this.view[offset++] = b;\r\n }.bind(this));\r\n if (offset !== start+k+l)\r\n throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+(offset+k+l));\r\n if (relative) {\r\n this.offset = offset;\r\n return this;\r\n }\r\n return offset - start;\r\n };\r\n\r\n /**\r\n * Reads a length as varint32 prefixed UTF8 encoded string.\r\n * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n * read and the actual number of bytes read.\r\n * @expose\r\n * @see ByteBuffer#readVarint32\r\n */\r\n ByteBufferPrototype.readVString = function(offset) {\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 1 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n }\r\n var start = offset;\r\n var len = this.readVarint32(offset);\r\n var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']);\r\n offset += str['length'];\r\n if (relative) {\r\n this.offset = offset;\r\n return str['string'];\r\n } else {\r\n return {\r\n 'string': str['string'],\r\n 'length': offset - start\r\n };\r\n }\r\n };\r\n\r\n\r\n /**\r\n * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended\r\n * data's length.\r\n * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to append. If `source` is a ByteBuffer, its offsets\r\n * will be modified according to the performed read operation.\r\n * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n * @param {number=} offset Offset to append at. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @example A relative `<01 02>03.append(<04 05>)` will result in `<01 02 04 05>, 04 05|`\r\n * @example An absolute `<01 02>03.append(04 05>, 1)` will result in `<01 04>05, 04 05|`\r\n */\r\n ByteBufferPrototype.append = function(source, encoding, offset) {\r\n if (typeof encoding === 'number' || typeof encoding !== 'string') {\r\n offset = encoding;\r\n encoding = undefined;\r\n }\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (!(source instanceof ByteBuffer))\r\n source = ByteBuffer.wrap(source, encoding);\r\n var length = source.limit - source.offset;\r\n if (length <= 0) return this; // Nothing to append\r\n offset += length;\n var capacity16 = this.buffer.byteLength;\n if (offset > capacity16)\n this.resize((capacity16 *= 2) > offset ? capacity16 : offset);\n offset -= length;\n this.view.set(source.view.subarray(source.offset, source.limit), offset);\r\n source.offset += length;\r\n if (relative) this.offset += length;\n return this;\r\n };\r\n\r\n /**\r\n * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the\r\n specified offset up to the length of this ByteBuffer's data.\r\n * @param {!ByteBuffer} target Target ByteBuffer\r\n * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * read if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @see ByteBuffer#append\r\n */\r\n ByteBufferPrototype.appendTo = function(target, offset) {\r\n target.append(this, offset);\r\n return this;\r\n };\r\n\r\n /**\r\n * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to\r\n * disable them if your code already makes sure that everything is valid.\r\n * @param {boolean} assert `true` to enable assertions, otherwise `false`\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.assert = function(assert) {\r\n this.noAssert = !assert;\r\n return this;\r\n };\r\n\r\n /**\r\n * Gets the capacity of this ByteBuffer's backing buffer.\r\n * @returns {number} Capacity of the backing buffer\r\n * @expose\r\n */\r\n ByteBufferPrototype.capacity = function() {\r\n return this.buffer.byteLength;\r\n };\r\n /**\r\n * Clears this ByteBuffer's offsets by setting {@link ByteBuffer#offset} to `0` and {@link ByteBuffer#limit} to the\r\n * backing buffer's capacity. Discards {@link ByteBuffer#markedOffset}.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.clear = function() {\r\n this.offset = 0;\r\n this.limit = this.buffer.byteLength;\r\n this.markedOffset = -1;\r\n return this;\r\n };\r\n\r\n /**\r\n * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for {@link ByteBuffer#offset},\r\n * {@link ByteBuffer#markedOffset} and {@link ByteBuffer#limit}.\r\n * @param {boolean=} copy Whether to copy the backing buffer or to return another view on the same, defaults to `false`\r\n * @returns {!ByteBuffer} Cloned instance\r\n * @expose\r\n */\r\n ByteBufferPrototype.clone = function(copy) {\r\n var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);\r\n if (copy) {\r\n bb.buffer = new ArrayBuffer(this.buffer.byteLength);\r\n bb.view = new Uint8Array(bb.buffer);\r\n } else {\r\n bb.buffer = this.buffer;\r\n bb.view = this.view;\r\n }\r\n bb.offset = this.offset;\r\n bb.markedOffset = this.markedOffset;\r\n bb.limit = this.limit;\r\n return bb;\r\n };\r\n\r\n /**\r\n * Compacts this ByteBuffer to be backed by a {@link ByteBuffer#buffer} of its contents' length. Contents are the bytes\r\n * between {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will set `offset = 0` and `limit = capacity` and\r\n * adapt {@link ByteBuffer#markedOffset} to the same relative position if set.\r\n * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.compact = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin === 0 && end === this.buffer.byteLength)\r\n return this; // Already compacted\r\n var len = end - begin;\r\n if (len === 0) {\r\n this.buffer = EMPTY_BUFFER;\r\n this.view = null;\r\n if (this.markedOffset >= 0) this.markedOffset -= begin;\r\n this.offset = 0;\r\n this.limit = 0;\r\n return this;\r\n }\r\n var buffer = new ArrayBuffer(len);\r\n var view = new Uint8Array(buffer);\r\n view.set(this.view.subarray(begin, end));\r\n this.buffer = buffer;\r\n this.view = view;\r\n if (this.markedOffset >= 0) this.markedOffset -= begin;\r\n this.offset = 0;\r\n this.limit = len;\r\n return this;\r\n };\r\n\r\n /**\r\n * Creates a copy of this ByteBuffer's contents. Contents are the bytes between {@link ByteBuffer#offset} and\r\n * {@link ByteBuffer#limit}.\r\n * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n * @returns {!ByteBuffer} Copy\r\n * @expose\r\n */\r\n ByteBufferPrototype.copy = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin === end)\r\n return new ByteBuffer(0, this.littleEndian, this.noAssert);\r\n var capacity = end - begin,\r\n bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);\r\n bb.offset = 0;\r\n bb.limit = capacity;\r\n if (bb.markedOffset >= 0) bb.markedOffset -= begin;\r\n this.copyTo(bb, 0, begin, end);\r\n return bb;\r\n };\r\n\r\n /**\r\n * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between {@link ByteBuffer#offset} and\r\n * {@link ByteBuffer#limit}.\r\n * @param {!ByteBuffer} target Target ByteBuffer\r\n * @param {number=} targetOffset Offset to copy to. Will use and increase the target's {@link ByteBuffer#offset}\r\n * by the number of bytes copied if omitted.\r\n * @param {number=} sourceOffset Offset to start copying from. Will use and increase {@link ByteBuffer#offset} by the\r\n * number of bytes copied if omitted.\r\n * @param {number=} sourceLimit Offset to end copying from, defaults to {@link ByteBuffer#limit}\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {\r\n var relative,\r\n targetRelative;\r\n if (!this.noAssert) {\r\n if (!ByteBuffer.isByteBuffer(target))\r\n throw TypeError(\"Illegal target: Not a ByteBuffer\");\r\n }\r\n targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0;\r\n sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0;\r\n sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0;\r\n\r\n if (targetOffset < 0 || targetOffset > target.buffer.byteLength)\r\n throw RangeError(\"Illegal target range: 0 <= \"+targetOffset+\" <= \"+target.buffer.byteLength);\r\n if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength)\r\n throw RangeError(\"Illegal source range: 0 <= \"+sourceOffset+\" <= \"+this.buffer.byteLength);\r\n\r\n var len = sourceLimit - sourceOffset;\r\n if (len === 0)\r\n return target; // Nothing to copy\r\n\r\n target.ensureCapacity(targetOffset + len);\r\n\r\n target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset);\r\n\r\n if (relative) this.offset += len;\r\n if (targetRelative) target.offset += len;\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Makes sure that this ByteBuffer is backed by a {@link ByteBuffer#buffer} of at least the specified capacity. If the\r\n * current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity,\r\n * the required capacity will be used instead.\r\n * @param {number} capacity Required capacity\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.ensureCapacity = function(capacity) {\r\n var current = this.buffer.byteLength;\r\n if (current < capacity)\r\n return this.resize((current *= 2) > capacity ? current : capacity);\r\n return this;\r\n };\r\n\r\n /**\r\n * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between\r\n * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}.\r\n * @param {number|string} value Byte value to fill with. If given as a string, the first character is used.\r\n * @param {number=} begin Begin offset. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n * written if omitted. defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @example `someByteBuffer.clear().fill(0)` fills the entire backing buffer with zeroes\r\n */\r\n ByteBufferPrototype.fill = function(value, begin, end) {\r\n var relative = typeof begin === 'undefined';\n if (relative) begin = this.offset;\n if (typeof value === 'string' && value.length > 0)\r\n value = value.charCodeAt(0);\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof value !== 'number' || value % 1 !== 0)\n throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n value |= 0;\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin >= end)\r\n return this; // Nothing to fill\r\n while (begin < end) this.view[begin++] = value;\r\n if (relative) this.offset = begin;\r\n return this;\r\n };\r\n\r\n /**\r\n * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets `limit = offset` and\r\n * `offset = 0`. Make sure always to flip a ByteBuffer when all relative read or write operations are complete.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.flip = function() {\r\n this.limit = this.offset;\r\n this.offset = 0;\r\n return this;\r\n };\r\n /**\r\n * Marks an offset on this ByteBuffer to be used later.\r\n * @param {number=} offset Offset to mark. Defaults to {@link ByteBuffer#offset}.\r\n * @returns {!ByteBuffer} this\r\n * @throws {TypeError} If `offset` is not a valid number\r\n * @throws {RangeError} If `offset` is out of bounds\r\n * @see ByteBuffer#reset\r\n * @expose\r\n */\r\n ByteBufferPrototype.mark = function(offset) {\r\n offset = typeof offset === 'undefined' ? this.offset : offset;\r\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n this.markedOffset = offset;\r\n return this;\r\n };\r\n /**\r\n * Sets the byte order.\r\n * @param {boolean} littleEndian `true` for little endian byte order, `false` for big endian\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.order = function(littleEndian) {\r\n if (!this.noAssert) {\r\n if (typeof littleEndian !== 'boolean')\r\n throw TypeError(\"Illegal littleEndian: Not a boolean\");\r\n }\r\n this.littleEndian = !!littleEndian;\r\n return this;\r\n };\r\n\r\n /**\r\n * Switches (to) little endian byte order.\r\n * @param {boolean=} littleEndian Defaults to `true`, otherwise uses big endian\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.LE = function(littleEndian) {\r\n this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true;\r\n return this;\r\n };\r\n\r\n /**\r\n * Switches (to) big endian byte order.\r\n * @param {boolean=} bigEndian Defaults to `true`, otherwise uses little endian\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.BE = function(bigEndian) {\r\n this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false;\r\n return this;\r\n };\r\n /**\r\n * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the\r\n * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer\r\n * will be resized and its contents moved accordingly.\r\n * @param {!ByteBuffer|string|!ArrayBuffer} source Data to prepend. If `source` is a ByteBuffer, its offset will be\r\n * modified according to the performed read operation.\r\n * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes\r\n * prepended if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @example A relative `00<01 02 03>.prepend(<04 05>)` results in `<04 05 01 02 03>, 04 05|`\r\n * @example An absolute `00<01 02 03>.prepend(<04 05>, 2)` results in `04<05 02 03>, 04 05|`\r\n */\r\n ByteBufferPrototype.prepend = function(source, encoding, offset) {\r\n if (typeof encoding === 'number' || typeof encoding !== 'string') {\r\n offset = encoding;\r\n encoding = undefined;\r\n }\r\n var relative = typeof offset === 'undefined';\n if (relative) offset = this.offset;\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n offset >>>= 0;\n if (offset < 0 || offset + 0 > this.buffer.byteLength)\n throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n }\r\n if (!(source instanceof ByteBuffer))\r\n source = ByteBuffer.wrap(source, encoding);\r\n var len = source.limit - source.offset;\r\n if (len <= 0) return this; // Nothing to prepend\r\n var diff = len - offset;\r\n if (diff > 0) { // Not enough space before offset, so resize + move\r\n var buffer = new ArrayBuffer(this.buffer.byteLength + diff);\r\n var view = new Uint8Array(buffer);\r\n view.set(this.view.subarray(offset, this.buffer.byteLength), len);\r\n this.buffer = buffer;\r\n this.view = view;\r\n this.offset += diff;\r\n if (this.markedOffset >= 0) this.markedOffset += diff;\r\n this.limit += diff;\r\n offset += diff;\r\n } else {\r\n var arrayView = new Uint8Array(this.buffer);\r\n }\r\n this.view.set(source.view.subarray(source.offset, source.limit), offset - len);\r\n\r\n source.offset = source.limit;\r\n if (relative)\r\n this.offset -= len;\r\n return this;\r\n };\r\n\r\n /**\r\n * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the\r\n * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer\r\n * will be resized and its contents moved accordingly.\r\n * @param {!ByteBuffer} target Target ByteBuffer\r\n * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes\r\n * prepended if omitted.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n * @see ByteBuffer#prepend\r\n */\r\n ByteBufferPrototype.prependTo = function(target, offset) {\r\n target.prepend(this, offset);\r\n return this;\r\n };\r\n /**\r\n * Prints debug information about this ByteBuffer's contents.\r\n * @param {function(string)=} out Output function to call, defaults to console.log\r\n * @expose\r\n */\r\n ByteBufferPrototype.printDebug = function(out) {\r\n if (typeof out !== 'function') out = console.log.bind(console);\r\n out(\r\n this.toString()+\"\\n\"+\r\n \"-------------------------------------------------------------------\\n\"+\r\n this.toDebug(/* columns */ true)\r\n );\r\n };\r\n\r\n /**\r\n * Gets the number of remaining readable bytes. Contents are the bytes between {@link ByteBuffer#offset} and\r\n * {@link ByteBuffer#limit}, so this returns `limit - offset`.\r\n * @returns {number} Remaining readable bytes. May be negative if `offset > limit`.\r\n * @expose\r\n */\r\n ByteBufferPrototype.remaining = function() {\r\n return this.limit - this.offset;\r\n };\r\n /**\r\n * Resets this ByteBuffer's {@link ByteBuffer#offset}. If an offset has been marked through {@link ByteBuffer#mark}\r\n * before, `offset` will be set to {@link ByteBuffer#markedOffset}, which will then be discarded. If no offset has been\r\n * marked, sets `offset = 0`.\r\n * @returns {!ByteBuffer} this\r\n * @see ByteBuffer#mark\r\n * @expose\r\n */\r\n ByteBufferPrototype.reset = function() {\r\n if (this.markedOffset >= 0) {\r\n this.offset = this.markedOffset;\r\n this.markedOffset = -1;\r\n } else {\r\n this.offset = 0;\r\n }\r\n return this;\r\n };\r\n /**\r\n * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that\r\n * large or larger.\r\n * @param {number} capacity Capacity required\r\n * @returns {!ByteBuffer} this\r\n * @throws {TypeError} If `capacity` is not a number\r\n * @throws {RangeError} If `capacity < 0`\r\n * @expose\r\n */\r\n ByteBufferPrototype.resize = function(capacity) {\r\n if (!this.noAssert) {\r\n if (typeof capacity !== 'number' || capacity % 1 !== 0)\n throw TypeError(\"Illegal capacity: \"+capacity+\" (not an integer)\");\n capacity |= 0;\n if (capacity < 0)\r\n throw RangeError(\"Illegal capacity: 0 <= \"+capacity);\r\n }\r\n if (this.buffer.byteLength < capacity) {\r\n var buffer = new ArrayBuffer(capacity);\r\n var view = new Uint8Array(buffer);\r\n view.set(this.view);\r\n this.buffer = buffer;\r\n this.view = view;\r\n }\r\n return this;\r\n };\r\n /**\r\n * Reverses this ByteBuffer's contents.\r\n * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.reverse = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n if (begin === end)\r\n return this; // Nothing to reverse\r\n Array.prototype.reverse.call(this.view.subarray(begin, end));\r\n return this;\r\n };\r\n /**\r\n * Skips the next `length` bytes. This will just advance\r\n * @param {number} length Number of bytes to skip. May also be negative to move the offset back.\r\n * @returns {!ByteBuffer} this\r\n * @expose\r\n */\r\n ByteBufferPrototype.skip = function(length) {\r\n if (!this.noAssert) {\r\n if (typeof length !== 'number' || length % 1 !== 0)\n throw TypeError(\"Illegal length: \"+length+\" (not an integer)\");\n length |= 0;\n }\r\n var offset = this.offset + length;\r\n if (!this.noAssert) {\r\n if (offset < 0 || offset > this.buffer.byteLength)\r\n throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+length+\" <= \"+this.buffer.byteLength);\r\n }\r\n this.offset = offset;\r\n return this;\r\n };\r\n\r\n /**\r\n * Slices this ByteBuffer by creating a cloned instance with `offset = begin` and `limit = end`.\r\n * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n * @returns {!ByteBuffer} Clone of this ByteBuffer with slicing applied, backed by the same {@link ByteBuffer#buffer}\r\n * @expose\r\n */\r\n ByteBufferPrototype.slice = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n var bb = this.clone();\r\n bb.offset = begin;\r\n bb.limit = end;\r\n return bb;\r\n };\r\n /**\r\n * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between\r\n * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}.\r\n * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory if\r\n * possible. Defaults to `false`\r\n * @returns {!ArrayBuffer} Contents as an ArrayBuffer\r\n * @expose\r\n */\r\n ByteBufferPrototype.toBuffer = function(forceCopy) {\r\n var offset = this.offset,\r\n limit = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof offset !== 'number' || offset % 1 !== 0)\n throw TypeError(\"Illegal offset: Not an integer\");\n offset >>>= 0;\n if (typeof limit !== 'number' || limit % 1 !== 0)\n throw TypeError(\"Illegal limit: Not an integer\");\n limit >>>= 0;\n if (offset < 0 || offset > limit || limit > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+offset+\" <= \"+limit+\" <= \"+this.buffer.byteLength);\n }\r\n // NOTE: It's not possible to have another ArrayBuffer reference the same memory as the backing buffer. This is\r\n // possible with Uint8Array#subarray only, but we have to return an ArrayBuffer by contract. So:\r\n if (!forceCopy && offset === 0 && limit === this.buffer.byteLength)\r\n return this.buffer;\r\n if (offset === limit)\r\n return EMPTY_BUFFER;\r\n var buffer = new ArrayBuffer(limit - offset);\r\n new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);\r\n return buffer;\r\n };\r\n\r\n /**\r\n * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between\r\n * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. This is an alias of {@link ByteBuffer#toBuffer}.\r\n * @function\r\n * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory.\r\n * Defaults to `false`\r\n * @returns {!ArrayBuffer} Contents as an ArrayBuffer\r\n * @expose\r\n */\r\n ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;\r\n\r\n /**\r\n * Converts the ByteBuffer's contents to a string.\r\n * @param {string=} encoding Output encoding. Returns an informative string representation if omitted but also allows\r\n * direct conversion to \"utf8\", \"hex\", \"base64\" and \"binary\" encoding. \"debug\" returns a hex representation with\r\n * highlighted offsets.\r\n * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n * @returns {string} String representation\r\n * @throws {Error} If `encoding` is invalid\r\n * @expose\r\n */\r\n ByteBufferPrototype.toString = function(encoding, begin, end) {\r\n if (typeof encoding === 'undefined')\r\n return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";\r\n if (typeof encoding === 'number')\r\n encoding = \"utf8\",\r\n begin = encoding,\r\n end = begin;\r\n switch (encoding) {\r\n case \"utf8\":\r\n return this.toUTF8(begin, end);\r\n case \"base64\":\r\n return this.toBase64(begin, end);\r\n case \"hex\":\r\n return this.toHex(begin, end);\r\n case \"binary\":\r\n return this.toBinary(begin, end);\r\n case \"debug\":\r\n return this.toDebug();\r\n case \"columns\":\r\n return this.toColumns();\r\n default:\r\n throw Error(\"Unsupported encoding: \"+encoding);\r\n }\r\n };\r\n\r\n // lxiv-embeddable\r\n\r\n /**\r\n * lxiv-embeddable (c) 2014 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/lxiv for details\r\n */\r\n var lxiv = function() {\r\n \"use strict\";\r\n\r\n /**\r\n * lxiv namespace.\r\n * @type {!Object.}\r\n * @exports lxiv\r\n */\r\n var lxiv = {};\r\n\r\n /**\r\n * Character codes for output.\r\n * @type {!Array.}\r\n * @inner\r\n */\r\n var aout = [\r\n 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\r\n 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,\r\n 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\r\n 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\r\n ];\r\n\r\n /**\r\n * Character codes for input.\r\n * @type {!Array.}\r\n * @inner\r\n */\r\n var ain = [];\r\n for (var i=0, k=aout.length; i>2)&0x3f]);\r\n t = (b&0x3)<<4;\r\n if ((b = src()) !== null) {\r\n t |= (b>>4)&0xf;\r\n dst(aout[(t|((b>>4)&0xf))&0x3f]);\r\n t = (b&0xf)<<2;\r\n if ((b = src()) !== null)\r\n dst(aout[(t|((b>>6)&0x3))&0x3f]),\r\n dst(aout[b&0x3f]);\r\n else\r\n dst(aout[t&0x3f]),\r\n dst(61);\r\n } else\r\n dst(aout[t&0x3f]),\r\n dst(61),\r\n dst(61);\r\n }\r\n };\r\n\r\n /**\r\n * Decodes base64 char codes to bytes.\r\n * @param {!function():number|null} src Characters source as a function returning the next char code respectively\r\n * `null` if there are no more characters left.\r\n * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.\r\n * @throws {Error} If a character code is invalid\r\n */\r\n lxiv.decode = function(src, dst) {\r\n var c, t1, t2;\r\n function fail(c) {\r\n throw Error(\"Illegal character code: \"+c);\r\n }\r\n while ((c = src()) !== null) {\r\n t1 = ain[c];\r\n if (typeof t1 === 'undefined') fail(c);\r\n if ((c = src()) !== null) {\r\n t2 = ain[c];\r\n if (typeof t2 === 'undefined') fail(c);\r\n dst((t1<<2)>>>0|(t2&0x30)>>4);\r\n if ((c = src()) !== null) {\r\n t1 = ain[c];\r\n if (typeof t1 === 'undefined')\r\n if (c === 61) break; else fail(c);\r\n dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2);\r\n if ((c = src()) !== null) {\r\n t2 = ain[c];\r\n if (typeof t2 === 'undefined')\r\n if (c === 61) break; else fail(c);\r\n dst(((t1&0x3)<<6)>>>0|t2);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Tests if a string is valid base64.\r\n * @param {string} str String to test\r\n * @returns {boolean} `true` if valid, otherwise `false`\r\n */\r\n lxiv.test = function(str) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);\r\n };\r\n\r\n return lxiv;\r\n }();\r\n\r\n // encodings/base64\r\n\r\n /**\r\n * Encodes this ByteBuffer's contents to a base64 encoded string.\r\n * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}.\r\n * @returns {string} Base64 encoded string\r\n * @throws {RangeError} If `begin` or `end` is out of bounds\r\n * @expose\r\n */\r\n ByteBufferPrototype.toBase64 = function(begin, end) {\r\n if (typeof begin === 'undefined')\r\n begin = this.offset;\r\n if (typeof end === 'undefined')\r\n end = this.limit;\r\n begin = begin | 0; end = end | 0;\r\n if (begin < 0 || end > this.capacity || begin > end)\r\n throw RangeError(\"begin, end\");\r\n var sd; lxiv.encode(function() {\r\n return begin < end ? this.view[begin++] : null;\r\n }.bind(this), sd = stringDestination());\r\n return sd();\r\n };\r\n\r\n /**\r\n * Decodes a base64 encoded string to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromBase64 = function(str, littleEndian) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"str\");\r\n var bb = new ByteBuffer(str.length/4*3, littleEndian),\r\n i = 0;\r\n lxiv.decode(stringSource(str), function(b) {\r\n bb.view[i++] = b;\r\n });\r\n bb.limit = i;\r\n return bb;\r\n };\r\n\r\n /**\r\n * Encodes a binary string to base64 like `window.btoa` does.\r\n * @param {string} str Binary string\r\n * @returns {string} Base64 encoded string\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa\r\n * @expose\r\n */\r\n ByteBuffer.btoa = function(str) {\r\n return ByteBuffer.fromBinary(str).toBase64();\r\n };\r\n\r\n /**\r\n * Decodes a base64 encoded string to binary like `window.atob` does.\r\n * @param {string} b64 Base64 encoded string\r\n * @returns {string} Binary string\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.atob\r\n * @expose\r\n */\r\n ByteBuffer.atob = function(b64) {\r\n return ByteBuffer.fromBase64(b64).toBinary();\r\n };\r\n\r\n // encodings/binary\r\n\r\n /**\r\n * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes.\r\n * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}.\r\n * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}.\r\n * @returns {string} Binary encoded string\r\n * @throws {RangeError} If `offset > limit`\r\n * @expose\r\n */\r\n ByteBufferPrototype.toBinary = function(begin, end) {\r\n if (typeof begin === 'undefined')\r\n begin = this.offset;\r\n if (typeof end === 'undefined')\r\n end = this.limit;\r\n begin |= 0; end |= 0;\r\n if (begin < 0 || end > this.capacity() || begin > end)\r\n throw RangeError(\"begin, end\");\r\n if (begin === end)\r\n return \"\";\r\n var chars = [],\r\n parts = [];\r\n while (begin < end) {\r\n chars.push(this.view[begin++]);\r\n if (chars.length >= 1024)\r\n parts.push(String.fromCharCode.apply(String, chars)),\r\n chars = [];\r\n }\r\n return parts.join('') + String.fromCharCode.apply(String, chars);\r\n };\r\n\r\n /**\r\n * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromBinary = function(str, littleEndian) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"str\");\r\n var i = 0,\r\n k = str.length,\r\n charCode,\r\n bb = new ByteBuffer(k, littleEndian);\r\n while (i 0xff)\r\n throw RangeError(\"illegal char code: \"+charCode);\r\n bb.view[i++] = charCode;\r\n }\r\n bb.limit = k;\r\n return bb;\r\n };\r\n\r\n // encodings/debug\r\n\r\n /**\r\n * Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are:\r\n * * `<` : offset,\r\n * * `'` : markedOffset,\r\n * * `>` : limit,\r\n * * `|` : offset and limit,\r\n * * `[` : offset and markedOffset,\r\n * * `]` : markedOffset and limit,\r\n * * `!` : offset, markedOffset and limit\r\n * @param {boolean=} columns If `true` returns two columns hex + ascii, defaults to `false`\r\n * @returns {string|!Array.} Debug string or array of lines if `asArray = true`\r\n * @expose\r\n * @example `>00'01 02<03` contains four bytes with `limit=0, markedOffset=1, offset=3`\r\n * @example `00[01 02 03>` contains four bytes with `offset=markedOffset=1, limit=4`\r\n * @example `00|01 02 03` contains four bytes with `offset=limit=1, markedOffset=-1`\r\n * @example `|` contains zero bytes with `offset=limit=0, markedOffset=-1`\r\n */\r\n ByteBufferPrototype.toDebug = function(columns) {\r\n var i = -1,\r\n k = this.buffer.byteLength,\r\n b,\r\n hex = \"\",\r\n asc = \"\",\r\n out = \"\";\r\n while (i 32 && b < 127 ? String.fromCharCode(b) : '.';\r\n }\r\n ++i;\r\n if (columns) {\r\n if (i > 0 && i % 16 === 0 && i !== k) {\r\n while (hex.length < 3*16+3) hex += \" \";\r\n out += hex+asc+\"\\n\";\r\n hex = asc = \"\";\r\n }\r\n }\r\n if (i === this.offset && i === this.limit)\r\n hex += i === this.markedOffset ? \"!\" : \"|\";\r\n else if (i === this.offset)\r\n hex += i === this.markedOffset ? \"[\" : \"<\";\r\n else if (i === this.limit)\r\n hex += i === this.markedOffset ? \"]\" : \">\";\r\n else\r\n hex += i === this.markedOffset ? \"'\" : (columns || (i !== 0 && i !== k) ? \" \" : \"\");\r\n }\r\n if (columns && hex !== \" \") {\r\n while (hex.length < 3*16+3)\r\n hex += \" \";\r\n out += hex + asc + \"\\n\";\r\n }\r\n return columns ? out : hex;\r\n };\r\n\r\n /**\r\n * Decodes a hex encoded string with marked offsets to a ByteBuffer.\r\n * @param {string} str Debug string to decode (not be generated with `columns = true`)\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n * @see ByteBuffer#toDebug\r\n */\r\n ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {\r\n var k = str.length,\r\n bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert);\r\n var i = 0, j = 0, ch, b,\r\n rs = false, // Require symbol next\r\n ho = false, hm = false, hl = false, // Already has offset (ho), markedOffset (hm), limit (hl)?\r\n fail = false;\r\n while (i':\r\n if (!noAssert) {\r\n if (hl) {\r\n fail = true;\r\n break;\r\n }\r\n hl = true;\r\n }\r\n bb.limit = j;\r\n rs = false;\r\n break;\r\n case \"'\":\r\n if (!noAssert) {\r\n if (hm) {\r\n fail = true;\r\n break;\r\n }\r\n hm = true;\r\n }\r\n bb.markedOffset = j;\r\n rs = false;\r\n break;\r\n case ' ':\r\n rs = false;\r\n break;\r\n default:\r\n if (!noAssert) {\r\n if (rs) {\r\n fail = true;\r\n break;\r\n }\r\n }\r\n b = parseInt(ch+str.charAt(i++), 16);\r\n if (!noAssert) {\r\n if (isNaN(b) || b < 0 || b > 255)\r\n throw TypeError(\"Illegal str: Not a debug encoded string\");\r\n }\r\n bb.view[j++] = b;\r\n rs = true;\r\n }\r\n if (fail)\r\n throw TypeError(\"Illegal str: Invalid symbol at \"+i);\r\n }\r\n if (!noAssert) {\r\n if (!ho || !hl)\r\n throw TypeError(\"Illegal str: Missing offset or limit\");\r\n if (j>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n var out = new Array(end - begin),\r\n b;\r\n while (begin < end) {\r\n b = this.view[begin++];\r\n if (b < 0x10)\r\n out.push(\"0\", b.toString(16));\r\n else out.push(b.toString(16));\r\n }\r\n return out.join('');\r\n };\r\n\r\n /**\r\n * Decodes a hex encoded string to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromHex = function(str, littleEndian, noAssert) {\r\n if (!noAssert) {\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n if (str.length % 2 !== 0)\r\n throw TypeError(\"Illegal str: Length not a multiple of 2\");\r\n }\r\n var k = str.length,\r\n bb = new ByteBuffer((k / 2) | 0, littleEndian),\r\n b;\r\n for (var i=0, j=0; i 255)\r\n throw TypeError(\"Illegal str: Contains non-hex characters\");\r\n bb.view[j++] = b;\r\n }\r\n bb.limit = j;\r\n return bb;\r\n };\r\n\r\n // utfx-embeddable\r\n\r\n /**\r\n * utfx-embeddable (c) 2014 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/utfx for details\r\n */\r\n var utfx = function() {\r\n \"use strict\";\r\n\r\n /**\r\n * utfx namespace.\r\n * @inner\r\n * @type {!Object.}\r\n */\r\n var utfx = {};\r\n\r\n /**\r\n * Maximum valid code point.\r\n * @type {number}\r\n * @const\r\n */\r\n utfx.MAX_CODEPOINT = 0x10FFFF;\r\n\r\n /**\r\n * Encodes UTF8 code points to UTF8 bytes.\r\n * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point\r\n * respectively `null` if there are no more code points left or a single numeric code point.\r\n * @param {!function(number)} dst Bytes destination as a function successively called with the next byte\r\n */\r\n utfx.encodeUTF8 = function(src, dst) {\r\n var cp = null;\r\n if (typeof src === 'number')\r\n cp = src,\r\n src = function() { return null; };\r\n while (cp !== null || (cp = src()) !== null) {\r\n if (cp < 0x80)\r\n dst(cp&0x7F);\r\n else if (cp < 0x800)\r\n dst(((cp>>6)&0x1F)|0xC0),\r\n dst((cp&0x3F)|0x80);\r\n else if (cp < 0x10000)\r\n dst(((cp>>12)&0x0F)|0xE0),\r\n dst(((cp>>6)&0x3F)|0x80),\r\n dst((cp&0x3F)|0x80);\r\n else\r\n dst(((cp>>18)&0x07)|0xF0),\r\n dst(((cp>>12)&0x3F)|0x80),\r\n dst(((cp>>6)&0x3F)|0x80),\r\n dst((cp&0x3F)|0x80);\r\n cp = null;\r\n }\r\n };\r\n\r\n /**\r\n * Decodes UTF8 bytes to UTF8 code points.\r\n * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there\r\n * are no more bytes left.\r\n * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point.\r\n * @throws {RangeError} If a starting byte is invalid in UTF8\r\n * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the\r\n * remaining bytes.\r\n */\r\n utfx.decodeUTF8 = function(src, dst) {\r\n var a, b, c, d, fail = function(b) {\r\n b = b.slice(0, b.indexOf(null));\r\n var err = Error(b.toString());\r\n err.name = \"TruncatedError\";\r\n err['bytes'] = b;\r\n throw err;\r\n };\r\n while ((a = src()) !== null) {\r\n if ((a&0x80) === 0)\r\n dst(a);\r\n else if ((a&0xE0) === 0xC0)\r\n ((b = src()) === null) && fail([a, b]),\r\n dst(((a&0x1F)<<6) | (b&0x3F));\r\n else if ((a&0xF0) === 0xE0)\r\n ((b=src()) === null || (c=src()) === null) && fail([a, b, c]),\r\n dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F));\r\n else if ((a&0xF8) === 0xF0)\r\n ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]),\r\n dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F));\r\n else throw RangeError(\"Illegal starting byte: \"+a);\r\n }\r\n };\r\n\r\n /**\r\n * Converts UTF16 characters to UTF8 code points.\r\n * @param {!function():number|null} src Characters source as a function returning the next char code respectively\r\n * `null` if there are no more characters left.\r\n * @param {!function(number)} dst Code points destination as a function successively called with each converted code\r\n * point.\r\n */\r\n utfx.UTF16toUTF8 = function(src, dst) {\r\n var c1, c2 = null;\r\n while (true) {\r\n if ((c1 = c2 !== null ? c2 : src()) === null)\r\n break;\r\n if (c1 >= 0xD800 && c1 <= 0xDFFF) {\r\n if ((c2 = src()) !== null) {\r\n if (c2 >= 0xDC00 && c2 <= 0xDFFF) {\r\n dst((c1-0xD800)*0x400+c2-0xDC00+0x10000);\r\n c2 = null; continue;\r\n }\r\n }\r\n }\r\n dst(c1);\r\n }\r\n if (c2 !== null) dst(c2);\r\n };\r\n\r\n /**\r\n * Converts UTF8 code points to UTF16 characters.\r\n * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point\r\n * respectively `null` if there are no more code points left or a single numeric code point.\r\n * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.\r\n * @throws {RangeError} If a code point is out of range\r\n */\r\n utfx.UTF8toUTF16 = function(src, dst) {\r\n var cp = null;\r\n if (typeof src === 'number')\r\n cp = src, src = function() { return null; };\r\n while (cp !== null || (cp = src()) !== null) {\r\n if (cp <= 0xFFFF)\r\n dst(cp);\r\n else\r\n cp -= 0x10000,\r\n dst((cp>>10)+0xD800),\r\n dst((cp%0x400)+0xDC00);\r\n cp = null;\r\n }\r\n };\r\n\r\n /**\r\n * Converts and encodes UTF16 characters to UTF8 bytes.\r\n * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`\r\n * if there are no more characters left.\r\n * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.\r\n */\r\n utfx.encodeUTF16toUTF8 = function(src, dst) {\r\n utfx.UTF16toUTF8(src, function(cp) {\r\n utfx.encodeUTF8(cp, dst);\r\n });\r\n };\r\n\r\n /**\r\n * Decodes and converts UTF8 bytes to UTF16 characters.\r\n * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there\r\n * are no more bytes left.\r\n * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.\r\n * @throws {RangeError} If a starting byte is invalid in UTF8\r\n * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes.\r\n */\r\n utfx.decodeUTF8toUTF16 = function(src, dst) {\r\n utfx.decodeUTF8(src, function(cp) {\r\n utfx.UTF8toUTF16(cp, dst);\r\n });\r\n };\r\n\r\n /**\r\n * Calculates the byte length of an UTF8 code point.\r\n * @param {number} cp UTF8 code point\r\n * @returns {number} Byte length\r\n */\r\n utfx.calculateCodePoint = function(cp) {\r\n return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 bytes required to store UTF8 code points.\r\n * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively\r\n * `null` if there are no more code points left.\r\n * @returns {number} The number of UTF8 bytes required\r\n */\r\n utfx.calculateUTF8 = function(src) {\r\n var cp, l=0;\r\n while ((cp = src()) !== null)\r\n l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n return l;\r\n };\r\n\r\n /**\r\n * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes.\r\n * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively\r\n * `null` if there are no more characters left.\r\n * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1.\r\n */\r\n utfx.calculateUTF16asUTF8 = function(src) {\r\n var n=0, l=0;\r\n utfx.UTF16toUTF8(src, function(cp) {\r\n ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n });\r\n return [n,l];\r\n };\r\n\r\n return utfx;\r\n }();\r\n\r\n // encodings/utf8\r\n\r\n /**\r\n * Encodes this ByteBuffer's contents between {@link ByteBuffer#offset} and {@link ByteBuffer#limit} to an UTF8 encoded\r\n * string.\r\n * @returns {string} Hex encoded string\r\n * @throws {RangeError} If `offset > limit`\r\n * @expose\r\n */\r\n ByteBufferPrototype.toUTF8 = function(begin, end) {\r\n if (typeof begin === 'undefined') begin = this.offset;\r\n if (typeof end === 'undefined') end = this.limit;\r\n if (!this.noAssert) {\r\n if (typeof begin !== 'number' || begin % 1 !== 0)\n throw TypeError(\"Illegal begin: Not an integer\");\n begin >>>= 0;\n if (typeof end !== 'number' || end % 1 !== 0)\n throw TypeError(\"Illegal end: Not an integer\");\n end >>>= 0;\n if (begin < 0 || begin > end || end > this.buffer.byteLength)\n throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n }\r\n var sd; try {\r\n utfx.decodeUTF8toUTF16(function() {\r\n return begin < end ? this.view[begin++] : null;\r\n }.bind(this), sd = stringDestination());\r\n } catch (e) {\r\n if (begin !== end)\r\n throw RangeError(\"Illegal range: Truncated data, \"+begin+\" != \"+end);\r\n }\r\n return sd();\r\n };\r\n\r\n /**\r\n * Decodes an UTF8 encoded string to a ByteBuffer.\r\n * @param {string} str String to decode\r\n * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n * {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n * {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n * @returns {!ByteBuffer} ByteBuffer\r\n * @expose\r\n */\r\n ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {\r\n if (!noAssert)\r\n if (typeof str !== 'string')\r\n throw TypeError(\"Illegal str: Not a string\");\r\n var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert),\r\n i = 0;\r\n utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n bb.view[i++] = b;\r\n });\r\n bb.limit = i;\r\n return bb;\r\n };\r\n\r\n return ByteBuffer;\r\n});\r\n","export default {};\n","/*\r\n Copyright 2013 Daniel Wirtz \r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license protobuf.js (c) 2013 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/protobuf.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n define([\"bytebuffer\"], factory);\r\n /* CommonJS */ else if (typeof require === \"function\" && typeof module === \"object\" && module && module[\"exports\"])\r\n module[\"exports\"] = factory(require(\"bytebuffer\"), true);\r\n /* Global */ else\r\n (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"ProtoBuf\"] = factory(global[\"dcodeIO\"][\"ByteBuffer\"]);\r\n\r\n})(this, function(ByteBuffer, isCommonJS) {\r\n \"use strict\";\r\n\r\n /**\r\n * The ProtoBuf namespace.\r\n * @exports ProtoBuf\r\n * @namespace\r\n * @expose\r\n */\r\n var ProtoBuf = {};\r\n\r\n /**\r\n * @type {!function(new: ByteBuffer, ...[*])}\r\n * @expose\r\n */\r\n ProtoBuf.ByteBuffer = ByteBuffer;\r\n\r\n /**\r\n * @type {?function(new: Long, ...[*])}\r\n * @expose\r\n */\r\n ProtoBuf.Long = ByteBuffer.Long || null;\r\n\r\n /**\r\n * ProtoBuf.js version.\r\n * @type {string}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.VERSION = \"5.0.2\";\r\n\r\n /**\r\n * Wire types.\r\n * @type {Object.}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES = {};\r\n\r\n /**\r\n * Varint wire type.\r\n * @type {number}\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.VARINT = 0;\r\n\r\n /**\r\n * Fixed 64 bits wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.BITS64 = 1;\r\n\r\n /**\r\n * Length delimited wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.LDELIM = 2;\r\n\r\n /**\r\n * Start group wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.STARTGROUP = 3;\r\n\r\n /**\r\n * End group wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.ENDGROUP = 4;\r\n\r\n /**\r\n * Fixed 32 bits wire type.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.WIRE_TYPES.BITS32 = 5;\r\n\r\n /**\r\n * Packable wire types.\r\n * @type {!Array.}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.PACKABLE_WIRE_TYPES = [\r\n ProtoBuf.WIRE_TYPES.VARINT,\r\n ProtoBuf.WIRE_TYPES.BITS64,\r\n ProtoBuf.WIRE_TYPES.BITS32\r\n ];\r\n\r\n /**\r\n * Types.\r\n * @dict\r\n * @type {!Object.}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.TYPES = {\r\n // According to the protobuf spec.\r\n \"int32\": {\r\n name: \"int32\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"uint32\": {\r\n name: \"uint32\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"sint32\": {\r\n name: \"sint32\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"int64\": {\r\n name: \"int64\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n },\r\n \"uint64\": {\r\n name: \"uint64\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r\n },\r\n \"sint64\": {\r\n name: \"sint64\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n },\r\n \"bool\": {\r\n name: \"bool\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: false\r\n },\r\n \"double\": {\r\n name: \"double\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n defaultValue: 0\r\n },\r\n \"string\": {\r\n name: \"string\",\r\n wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n defaultValue: \"\"\r\n },\r\n \"bytes\": {\r\n name: \"bytes\",\r\n wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n defaultValue: null // overridden in the code, must be a unique instance\r\n },\r\n \"fixed32\": {\r\n name: \"fixed32\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n defaultValue: 0\r\n },\r\n \"sfixed32\": {\r\n name: \"sfixed32\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n defaultValue: 0\r\n },\r\n \"fixed64\": {\r\n name: \"fixed64\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r\n },\r\n \"sfixed64\": {\r\n name: \"sfixed64\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n },\r\n \"float\": {\r\n name: \"float\",\r\n wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n defaultValue: 0\r\n },\r\n \"enum\": {\r\n name: \"enum\",\r\n wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n defaultValue: 0\r\n },\r\n \"message\": {\r\n name: \"message\",\r\n wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n defaultValue: null\r\n },\r\n \"group\": {\r\n name: \"group\",\r\n wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,\r\n defaultValue: null\r\n }\r\n };\r\n\r\n /**\r\n * Valid map key types.\r\n * @type {!Array.>}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.MAP_KEY_TYPES = [\r\n ProtoBuf.TYPES[\"int32\"],\r\n ProtoBuf.TYPES[\"sint32\"],\r\n ProtoBuf.TYPES[\"sfixed32\"],\r\n ProtoBuf.TYPES[\"uint32\"],\r\n ProtoBuf.TYPES[\"fixed32\"],\r\n ProtoBuf.TYPES[\"int64\"],\r\n ProtoBuf.TYPES[\"sint64\"],\r\n ProtoBuf.TYPES[\"sfixed64\"],\r\n ProtoBuf.TYPES[\"uint64\"],\r\n ProtoBuf.TYPES[\"fixed64\"],\r\n ProtoBuf.TYPES[\"bool\"],\r\n ProtoBuf.TYPES[\"string\"],\r\n ProtoBuf.TYPES[\"bytes\"]\r\n ];\r\n\r\n /**\r\n * Minimum field id.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.ID_MIN = 1;\r\n\r\n /**\r\n * Maximum field id.\r\n * @type {number}\r\n * @const\r\n * @expose\r\n */\r\n ProtoBuf.ID_MAX = 0x1FFFFFFF;\r\n\r\n /**\r\n * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.\r\n * Must be set prior to parsing.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ProtoBuf.convertFieldsToCamelCase = false;\r\n\r\n /**\r\n * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by\r\n * setting this to `false` prior to building messages.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ProtoBuf.populateAccessors = true;\r\n\r\n /**\r\n * By default, messages are populated with default values if a field is not present on the wire. To disable\r\n * this behavior, set this setting to `false`.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n ProtoBuf.populateDefaults = true;\r\n\r\n /**\r\n * @alias ProtoBuf.Util\r\n * @expose\r\n */\r\n ProtoBuf.Util = (function() {\r\n \"use strict\";\r\n\r\n /**\r\n * ProtoBuf utilities.\r\n * @exports ProtoBuf.Util\r\n * @namespace\r\n */\r\n var Util = {};\r\n\r\n /**\r\n * Flag if running in node or not.\r\n * @type {boolean}\r\n * @const\r\n * @expose\r\n */\r\n Util.IS_NODE = !!(\r\n typeof process === 'object' && process+'' === '[object process]' && !process['browser']\r\n );\r\n\r\n /**\r\n * Constructs a XMLHttpRequest object.\r\n * @return {XMLHttpRequest}\r\n * @throws {Error} If XMLHttpRequest is not supported\r\n * @expose\r\n */\r\n Util.XHR = function() {\r\n // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html\r\n var XMLHttpFactories = [\r\n function () {return new XMLHttpRequest()},\r\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\r\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\r\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\r\n ];\r\n /** @type {?XMLHttpRequest} */\r\n var xhr = null;\r\n for (var i=0;i}\r\n * @expose\r\n */\r\n ProtoBuf.Lang = {\r\n\r\n // Characters always ending a statement\r\n DELIM: /[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,\r\n\r\n // Field rules\r\n RULE: /^(?:required|optional|repeated|map)$/,\r\n\r\n // Field types\r\n TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\r\n\r\n // Names\r\n NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n\r\n // Type definitions\r\n TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\r\n\r\n // Type references\r\n TYPEREF: /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n\r\n // Fully qualified type references\r\n FQTYPEREF: /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,\r\n\r\n // All numbers\r\n NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\r\n\r\n // Decimal numbers\r\n NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\r\n\r\n // Hexadecimal numbers\r\n NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\r\n\r\n // Octal numbers\r\n NUMBER_OCT: /^0[0-7]+$/,\r\n\r\n // Floating point numbers\r\n NUMBER_FLT: /^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\r\n\r\n // Booleans\r\n BOOL: /^(?:true|false)$/i,\r\n\r\n // Id numbers\r\n ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r\n\r\n // Negative id numbers (enum values)\r\n NEGID: /^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r\n\r\n // Whitespaces\r\n WHITESPACE: /\\s/,\r\n\r\n // All strings\r\n STRING: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,\r\n\r\n // Double quoted strings\r\n STRING_DQ: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n\r\n // Single quoted strings\r\n STRING_SQ: /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g\r\n };\r\n\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect\r\n * @expose\r\n */\r\n ProtoBuf.Reflect = (function(ProtoBuf) {\r\n \"use strict\";\r\n\r\n /**\r\n * Reflection types.\r\n * @exports ProtoBuf.Reflect\r\n * @namespace\r\n */\r\n var Reflect = {};\r\n\r\n /**\r\n * Constructs a Reflect base class.\r\n * @exports ProtoBuf.Reflect.T\r\n * @constructor\r\n * @abstract\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {?ProtoBuf.Reflect.T} parent Parent object\r\n * @param {string} name Object name\r\n */\r\n var T = function(builder, parent, name) {\r\n\r\n /**\r\n * Builder reference.\r\n * @type {!ProtoBuf.Builder}\r\n * @expose\r\n */\r\n this.builder = builder;\r\n\r\n /**\r\n * Parent object.\r\n * @type {?ProtoBuf.Reflect.T}\r\n * @expose\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * Object name in namespace.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Fully qualified class name\r\n * @type {string}\r\n * @expose\r\n */\r\n this.className;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.T.prototype\r\n * @inner\r\n */\r\n var TPrototype = T.prototype;\r\n\r\n /**\r\n * Returns the fully qualified name of this object.\r\n * @returns {string} Fully qualified name as of \".PATH.TO.THIS\"\r\n * @expose\r\n */\r\n TPrototype.fqn = function() {\r\n var name = this.name,\r\n ptr = this;\r\n do {\r\n ptr = ptr.parent;\r\n if (ptr == null)\r\n break;\r\n name = ptr.name+\".\"+name;\r\n } while (true);\r\n return name;\r\n };\r\n\r\n /**\r\n * Returns a string representation of this Reflect object (its fully qualified name).\r\n * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.\r\n * @return String representation\r\n * @expose\r\n */\r\n TPrototype.toString = function(includeClass) {\r\n return (includeClass ? this.className + \" \" : \"\") + this.fqn();\r\n };\r\n\r\n /**\r\n * Builds this type.\r\n * @throws {Error} If this type cannot be built directly\r\n * @expose\r\n */\r\n TPrototype.build = function() {\r\n throw Error(this.toString(true)+\" cannot be built directly\");\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.T\r\n * @expose\r\n */\r\n Reflect.T = T;\r\n\r\n /**\r\n * Constructs a new Namespace.\r\n * @exports ProtoBuf.Reflect.Namespace\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent\r\n * @param {string} name Namespace name\r\n * @param {Object.=} options Namespace options\r\n * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var Namespace = function(builder, parent, name, options, syntax) {\r\n T.call(this, builder, parent, name);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Namespace\";\r\n\r\n /**\r\n * Children inside the namespace.\r\n * @type {!Array.}\r\n */\r\n this.children = [];\r\n\r\n /**\r\n * Options.\r\n * @type {!Object.}\r\n */\r\n this.options = options || {};\r\n\r\n /**\r\n * Syntax level (e.g., proto2 or proto3).\r\n * @type {!string}\r\n */\r\n this.syntax = syntax || \"proto2\";\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Namespace.prototype\r\n * @inner\r\n */\r\n var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);\r\n\r\n /**\r\n * Returns an array of the namespace's children.\r\n * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).\r\n * @return {Array.}\r\n * @expose\r\n */\r\n NamespacePrototype.getChildren = function(type) {\r\n type = type || null;\r\n if (type == null)\r\n return this.children.slice();\r\n var children = [];\r\n for (var i=0, k=this.children.length; i} qn Qualified name to resolve\r\n * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false`\r\n * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found\r\n * @expose\r\n */\r\n NamespacePrototype.resolve = function(qn, excludeNonNamespace) {\r\n var part = typeof qn === 'string' ? qn.split(\".\") : qn,\r\n ptr = this,\r\n i = 0;\r\n if (part[i] === \"\") { // Fully qualified name, e.g. \".My.Message'\r\n while (ptr.parent !== null)\r\n ptr = ptr.parent;\r\n i++;\r\n }\r\n var child;\r\n do {\r\n do {\r\n if (!(ptr instanceof Reflect.Namespace)) {\r\n ptr = null;\r\n break;\r\n }\r\n child = ptr.getChild(part[i]);\r\n if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {\r\n ptr = null;\r\n break;\r\n }\r\n ptr = child; i++;\r\n } while (i < part.length);\r\n if (ptr != null)\r\n break; // Found\r\n // Else search the parent\r\n if (this.parent !== null)\r\n return this.parent.resolve(qn, excludeNonNamespace);\r\n } while (ptr != null);\r\n return ptr;\r\n };\r\n\r\n /**\r\n * Determines the shortest qualified name of the specified type, if any, relative to this namespace.\r\n * @param {!ProtoBuf.Reflect.T} t Reflection type\r\n * @returns {string} The shortest qualified name or, if there is none, the fqn\r\n * @expose\r\n */\r\n NamespacePrototype.qn = function(t) {\r\n var part = [], ptr = t;\r\n do {\r\n part.unshift(ptr.name);\r\n ptr = ptr.parent;\r\n } while (ptr !== null);\r\n for (var len=1; len <= part.length; len++) {\r\n var qn = part.slice(part.length-len);\r\n if (t === this.resolve(qn, t instanceof Reflect.Namespace))\r\n return qn.join(\".\");\r\n }\r\n return t.fqn();\r\n };\r\n\r\n /**\r\n * Builds the namespace and returns the runtime counterpart.\r\n * @return {Object.} Runtime namespace\r\n * @expose\r\n */\r\n NamespacePrototype.build = function() {\r\n /** @dict */\r\n var ns = {};\r\n var children = this.children;\r\n for (var i=0, k=children.length, child; i}\r\n */\r\n NamespacePrototype.buildOpt = function() {\r\n var opt = {},\r\n keys = Object.keys(this.options);\r\n for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option\r\n */\r\n NamespacePrototype.getOption = function(name) {\r\n if (typeof name === 'undefined')\r\n return this.options;\r\n return typeof this.options[name] !== 'undefined' ? this.options[name] : null;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Namespace\r\n * @expose\r\n */\r\n Reflect.Namespace = Namespace;\r\n\r\n /**\r\n * Constructs a new Element implementation that checks and converts values for a\r\n * particular field type, as appropriate.\r\n *\r\n * An Element represents a single value: either the value of a singular field,\r\n * or a value contained in one entry of a repeated field or map field. This\r\n * class does not implement these higher-level concepts; it only encapsulates\r\n * the low-level typechecking and conversion.\r\n *\r\n * @exports ProtoBuf.Reflect.Element\r\n * @param {{name: string, wireType: number}} type Resolved data type\r\n * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant\r\n * (e.g. submessage field).\r\n * @param {boolean} isMapKey Is this element a Map key? The value will be\r\n * converted to string form if so.\r\n * @param {string} syntax Syntax level of defining message type, e.g.,\r\n * proto2 or proto3.\r\n * @param {string} name Name of the field containing this element (for error\r\n * messages)\r\n * @constructor\r\n */\r\n var Element = function(type, resolvedType, isMapKey, syntax, name) {\r\n\r\n /**\r\n * Element type, as a string (e.g., int32).\r\n * @type {{name: string, wireType: number}}\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Element type reference to submessage or enum definition, if needed.\r\n * @type {ProtoBuf.Reflect.T|null}\r\n */\r\n this.resolvedType = resolvedType;\r\n\r\n /**\r\n * Element is a map key.\r\n * @type {boolean}\r\n */\r\n this.isMapKey = isMapKey;\r\n\r\n /**\r\n * Syntax level of defining message type, e.g., proto2 or proto3.\r\n * @type {string}\r\n */\r\n this.syntax = syntax;\r\n\r\n /**\r\n * Name of the field containing this element (for error messages)\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)\r\n throw Error(\"Invalid map key type: \" + type.name);\r\n };\r\n\r\n var ElementPrototype = Element.prototype;\r\n\r\n /**\r\n * Obtains a (new) default value for the specified type.\r\n * @param type {string|{name: string, wireType: number}} Field type\r\n * @returns {*} Default value\r\n * @inner\r\n */\r\n function mkDefault(type) {\r\n if (typeof type === 'string')\r\n type = ProtoBuf.TYPES[type];\r\n if (typeof type.defaultValue === 'undefined')\r\n throw Error(\"default value for type \"+type.name+\" is not supported\");\r\n if (type == ProtoBuf.TYPES[\"bytes\"])\r\n return new ByteBuffer(0);\r\n return type.defaultValue;\r\n }\r\n\r\n /**\r\n * Returns the default value for this field in proto3.\r\n * @function\r\n * @param type {string|{name: string, wireType: number}} the field type\r\n * @returns {*} Default value\r\n */\r\n Element.defaultFieldValue = mkDefault;\r\n\r\n /**\r\n * Makes a Long from a value.\r\n * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value\r\n * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for\r\n * strings and numbers\r\n * @returns {!Long}\r\n * @throws {Error} If the value cannot be converted to a Long\r\n * @inner\r\n */\r\n function mkLong(value, unsigned) {\r\n if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'\r\n && value.low === value.low && value.high === value.high)\r\n return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);\r\n if (typeof value === 'string')\r\n return ProtoBuf.Long.fromString(value, unsigned || false, 10);\r\n if (typeof value === 'number')\r\n return ProtoBuf.Long.fromNumber(value, unsigned || false);\r\n throw Error(\"not convertible to Long\");\r\n }\r\n\r\n ElementPrototype.toString = function() {\r\n return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';\r\n }\r\n\r\n /**\r\n * Checks if the given value can be set for an element of this type (singular\r\n * field or one element of a repeated field or map).\r\n * @param {*} value Value to check\r\n * @return {*} Verified, maybe adjusted, value\r\n * @throws {Error} If the value cannot be verified for this element slot\r\n * @expose\r\n */\r\n ElementPrototype.verifyValue = function(value) {\r\n var self = this;\r\n function fail(val, msg) {\r\n throw Error(\"Illegal value for \"+self.toString(true)+\" of type \"+self.type.name+\": \"+val+\" (\"+msg+\")\");\r\n }\r\n switch (this.type) {\r\n // Signed 32bit\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n // Account for !NaN: value === value\r\n if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r\n fail(typeof value, \"not an integer\");\r\n return value > 4294967295 ? value | 0 : value;\r\n\r\n // Unsigned 32bit\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r\n fail(typeof value, \"not an integer\");\r\n return value < 0 ? value >>> 0 : value;\r\n\r\n // Signed 64bit\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n case ProtoBuf.TYPES[\"sfixed64\"]: {\r\n if (ProtoBuf.Long)\r\n try {\r\n return mkLong(value, false);\r\n } catch (e) {\r\n fail(typeof value, e.message);\r\n }\r\n else\r\n fail(typeof value, \"requires Long.js\");\r\n }\r\n\r\n // Unsigned 64bit\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n case ProtoBuf.TYPES[\"fixed64\"]: {\r\n if (ProtoBuf.Long)\r\n try {\r\n return mkLong(value, true);\r\n } catch (e) {\r\n fail(typeof value, e.message);\r\n }\r\n else\r\n fail(typeof value, \"requires Long.js\");\r\n }\r\n\r\n // Bool\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n if (typeof value !== 'boolean')\r\n fail(typeof value, \"not a boolean\");\r\n return value;\r\n\r\n // Float\r\n case ProtoBuf.TYPES[\"float\"]:\r\n case ProtoBuf.TYPES[\"double\"]:\r\n if (typeof value !== 'number')\r\n fail(typeof value, \"not a number\");\r\n return value;\r\n\r\n // Length-delimited string\r\n case ProtoBuf.TYPES[\"string\"]:\r\n if (typeof value !== 'string' && !(value && value instanceof String))\r\n fail(typeof value, \"not a string\");\r\n return \"\"+value; // Convert String object to string\r\n\r\n // Length-delimited bytes\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n if (ByteBuffer.isByteBuffer(value))\r\n return value;\r\n return ByteBuffer.wrap(value, \"base64\");\r\n\r\n // Constant enum value\r\n case ProtoBuf.TYPES[\"enum\"]: {\r\n var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);\r\n for (i=0; i 4294967295 || value < 0)\r\n fail(typeof value, \"not in range for uint32\")\r\n return value;\r\n } else {\r\n // proto2 requires enum values to be valid.\r\n fail(value, \"not a valid enum value\");\r\n }\r\n }\r\n // Embedded message\r\n case ProtoBuf.TYPES[\"group\"]:\r\n case ProtoBuf.TYPES[\"message\"]: {\r\n if (!value || typeof value !== 'object')\r\n fail(typeof value, \"object expected\");\r\n if (value instanceof this.resolvedType.clazz)\r\n return value;\r\n if (value instanceof ProtoBuf.Builder.Message) {\r\n // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)\r\n var obj = {};\r\n for (var i in value)\r\n if (value.hasOwnProperty(i))\r\n obj[i] = value[i];\r\n value = obj;\r\n }\r\n // Else let's try to construct one from a key-value object\r\n return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons\r\n }\r\n }\r\n\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal value for \"+this.toString(true)+\": \"+value+\" (undefined type \"+this.type+\")\");\r\n };\r\n\r\n /**\r\n * Calculates the byte length of an element on the wire.\r\n * @param {number} id Field number\r\n * @param {*} value Field value\r\n * @returns {number} Byte length\r\n * @throws {Error} If the value cannot be calculated\r\n * @expose\r\n */\r\n ElementPrototype.calculateLength = function(id, value) {\r\n if (value === null) return 0; // Nothing to encode\r\n // Tag has already been written\r\n var n;\r\n switch (this.type) {\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n return ByteBuffer.calculateVarint32(value);\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n case ProtoBuf.TYPES[\"float\"]:\r\n return 4;\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n return ByteBuffer.calculateVarint64(value);\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n return 8;\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n return 1;\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n return ByteBuffer.calculateVarint32(value);\r\n case ProtoBuf.TYPES[\"double\"]:\r\n return 8;\r\n case ProtoBuf.TYPES[\"string\"]:\r\n n = ByteBuffer.calculateUTF8Bytes(value);\r\n return ByteBuffer.calculateVarint32(n) + n;\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n if (value.remaining() < 0)\r\n throw Error(\"Illegal value for \"+this.toString(true)+\": \"+value.remaining()+\" bytes remaining\");\r\n return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();\r\n case ProtoBuf.TYPES[\"message\"]:\r\n n = this.resolvedType.calculate(value);\r\n return ByteBuffer.calculateVarint32(n) + n;\r\n case ProtoBuf.TYPES[\"group\"]:\r\n n = this.resolvedType.calculate(value);\r\n return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r\n }\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+value+\" (unknown type)\");\r\n };\r\n\r\n /**\r\n * Encodes a value to the specified buffer. Does not encode the key.\r\n * @param {number} id Field number\r\n * @param {*} value Field value\r\n * @param {ByteBuffer} buffer ByteBuffer to encode to\r\n * @return {ByteBuffer} The ByteBuffer for chaining\r\n * @throws {Error} If the value cannot be encoded\r\n * @expose\r\n */\r\n ElementPrototype.encodeValue = function(id, value, buffer) {\r\n if (value === null) return buffer; // Nothing to encode\r\n // Tag has already been written\r\n\r\n switch (this.type) {\r\n // 32bit signed varint\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n // \"If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes\r\n // long – it is, effectively, treated like a very large unsigned integer.\" (see #122)\r\n if (value < 0)\r\n buffer.writeVarint64(value);\r\n else\r\n buffer.writeVarint32(value);\r\n break;\r\n\r\n // 32bit unsigned varint\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n buffer.writeVarint32(value);\r\n break;\r\n\r\n // 32bit varint zig-zag\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n buffer.writeVarint32ZigZag(value);\r\n break;\r\n\r\n // Fixed unsigned 32bit\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n buffer.writeUint32(value);\r\n break;\r\n\r\n // Fixed signed 32bit\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n buffer.writeInt32(value);\r\n break;\r\n\r\n // 64bit varint as-is\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n buffer.writeVarint64(value); // throws\r\n break;\r\n\r\n // 64bit varint zig-zag\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n buffer.writeVarint64ZigZag(value); // throws\r\n break;\r\n\r\n // Fixed unsigned 64bit\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n buffer.writeUint64(value); // throws\r\n break;\r\n\r\n // Fixed signed 64bit\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n buffer.writeInt64(value); // throws\r\n break;\r\n\r\n // Bool\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n if (typeof value === 'string')\r\n buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);\r\n else\r\n buffer.writeVarint32(value ? 1 : 0);\r\n break;\r\n\r\n // Constant enum value\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n buffer.writeVarint32(value);\r\n break;\r\n\r\n // 32bit float\r\n case ProtoBuf.TYPES[\"float\"]:\r\n buffer.writeFloat32(value);\r\n break;\r\n\r\n // 64bit float\r\n case ProtoBuf.TYPES[\"double\"]:\r\n buffer.writeFloat64(value);\r\n break;\r\n\r\n // Length-delimited string\r\n case ProtoBuf.TYPES[\"string\"]:\r\n buffer.writeVString(value);\r\n break;\r\n\r\n // Length-delimited bytes\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n if (value.remaining() < 0)\r\n throw Error(\"Illegal value for \"+this.toString(true)+\": \"+value.remaining()+\" bytes remaining\");\r\n var prevOffset = value.offset;\r\n buffer.writeVarint32(value.remaining());\r\n buffer.append(value);\r\n value.offset = prevOffset;\r\n break;\r\n\r\n // Embedded message\r\n case ProtoBuf.TYPES[\"message\"]:\r\n var bb = new ByteBuffer().LE();\r\n this.resolvedType.encode(value, bb);\r\n buffer.writeVarint32(bb.offset);\r\n buffer.append(bb.flip());\r\n break;\r\n\r\n // Legacy group\r\n case ProtoBuf.TYPES[\"group\"]:\r\n this.resolvedType.encode(value, buffer);\r\n buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r\n break;\r\n\r\n default:\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+value+\" (unknown type)\");\r\n }\r\n return buffer;\r\n };\r\n\r\n /**\r\n * Decode one element value from the specified buffer.\r\n * @param {ByteBuffer} buffer ByteBuffer to decode from\r\n * @param {number} wireType The field wire type\r\n * @param {number} id The field number\r\n * @return {*} Decoded value\r\n * @throws {Error} If the field cannot be decoded\r\n * @expose\r\n */\r\n ElementPrototype.decode = function(buffer, wireType, id) {\r\n if (wireType != this.type.wireType)\r\n throw Error(\"Unexpected wire type for element\");\r\n\r\n var value, nBytes;\r\n switch (this.type) {\r\n // 32bit signed varint\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n return buffer.readVarint32() | 0;\r\n\r\n // 32bit unsigned varint\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n return buffer.readVarint32() >>> 0;\r\n\r\n // 32bit signed varint zig-zag\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n return buffer.readVarint32ZigZag() | 0;\r\n\r\n // Fixed 32bit unsigned\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n return buffer.readUint32() >>> 0;\r\n\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n return buffer.readInt32() | 0;\r\n\r\n // 64bit signed varint\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n return buffer.readVarint64();\r\n\r\n // 64bit unsigned varint\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n return buffer.readVarint64().toUnsigned();\r\n\r\n // 64bit signed varint zig-zag\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n return buffer.readVarint64ZigZag();\r\n\r\n // Fixed 64bit unsigned\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n return buffer.readUint64();\r\n\r\n // Fixed 64bit signed\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n return buffer.readInt64();\r\n\r\n // Bool varint\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n return !!buffer.readVarint32();\r\n\r\n // Constant enum value (varint)\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n // The following Builder.Message#set will already throw\r\n return buffer.readVarint32();\r\n\r\n // 32bit float\r\n case ProtoBuf.TYPES[\"float\"]:\r\n return buffer.readFloat();\r\n\r\n // 64bit float\r\n case ProtoBuf.TYPES[\"double\"]:\r\n return buffer.readDouble();\r\n\r\n // Length-delimited string\r\n case ProtoBuf.TYPES[\"string\"]:\r\n return buffer.readVString();\r\n\r\n // Length-delimited bytes\r\n case ProtoBuf.TYPES[\"bytes\"]: {\r\n nBytes = buffer.readVarint32();\r\n if (buffer.remaining() < nBytes)\r\n throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+nBytes+\" required but got only \"+buffer.remaining());\r\n value = buffer.clone(); // Offset already set\r\n value.limit = value.offset+nBytes;\r\n buffer.offset += nBytes;\r\n return value;\r\n }\r\n\r\n // Length-delimited embedded message\r\n case ProtoBuf.TYPES[\"message\"]: {\r\n nBytes = buffer.readVarint32();\r\n return this.resolvedType.decode(buffer, nBytes);\r\n }\r\n\r\n // Legacy group\r\n case ProtoBuf.TYPES[\"group\"]:\r\n return this.resolvedType.decode(buffer, -1, id);\r\n }\r\n\r\n // We should never end here\r\n throw Error(\"[INTERNAL] Illegal decode type\");\r\n };\r\n\r\n /**\r\n * Converts a value from a string to the canonical element type.\r\n *\r\n * Legal only when isMapKey is true.\r\n *\r\n * @param {string} str The string value\r\n * @returns {*} The value\r\n */\r\n ElementPrototype.valueFromString = function(str) {\r\n if (!this.isMapKey) {\r\n throw Error(\"valueFromString() called on non-map-key element\");\r\n }\r\n\r\n switch (this.type) {\r\n case ProtoBuf.TYPES[\"int32\"]:\r\n case ProtoBuf.TYPES[\"sint32\"]:\r\n case ProtoBuf.TYPES[\"sfixed32\"]:\r\n case ProtoBuf.TYPES[\"uint32\"]:\r\n case ProtoBuf.TYPES[\"fixed32\"]:\r\n return this.verifyValue(parseInt(str));\r\n\r\n case ProtoBuf.TYPES[\"int64\"]:\r\n case ProtoBuf.TYPES[\"sint64\"]:\r\n case ProtoBuf.TYPES[\"sfixed64\"]:\r\n case ProtoBuf.TYPES[\"uint64\"]:\r\n case ProtoBuf.TYPES[\"fixed64\"]:\r\n // Long-based fields support conversions from string already.\r\n return this.verifyValue(str);\r\n\r\n case ProtoBuf.TYPES[\"bool\"]:\r\n return str === \"true\";\r\n\r\n case ProtoBuf.TYPES[\"string\"]:\r\n return this.verifyValue(str);\r\n\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n return ByteBuffer.fromBinary(str);\r\n }\r\n };\r\n\r\n /**\r\n * Converts a value from the canonical element type to a string.\r\n *\r\n * It should be the case that `valueFromString(valueToString(val))` returns\r\n * a value equivalent to `verifyValue(val)` for every legal value of `val`\r\n * according to this element type.\r\n *\r\n * This may be used when the element must be stored or used as a string,\r\n * e.g., as a map key on an Object.\r\n *\r\n * Legal only when isMapKey is true.\r\n *\r\n * @param {*} val The value\r\n * @returns {string} The string form of the value.\r\n */\r\n ElementPrototype.valueToString = function(value) {\r\n if (!this.isMapKey) {\r\n throw Error(\"valueToString() called on non-map-key element\");\r\n }\r\n\r\n if (this.type === ProtoBuf.TYPES[\"bytes\"]) {\r\n return value.toString(\"binary\");\r\n } else {\r\n return value.toString();\r\n }\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Element\r\n * @expose\r\n */\r\n Reflect.Element = Element;\r\n\r\n /**\r\n * Constructs a new Message.\r\n * @exports ProtoBuf.Reflect.Message\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace\r\n * @param {string} name Message name\r\n * @param {Object.=} options Message options\r\n * @param {boolean=} isGroup `true` if this is a legacy group\r\n * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Namespace\r\n */\r\n var Message = function(builder, parent, name, options, isGroup, syntax) {\r\n Namespace.call(this, builder, parent, name, options, syntax);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Message\";\r\n\r\n /**\r\n * Extensions range.\r\n * @type {!Array.|undefined}\r\n * @expose\r\n */\r\n this.extensions = undefined;\r\n\r\n /**\r\n * Runtime message class.\r\n * @type {?function(new:ProtoBuf.Builder.Message)}\r\n * @expose\r\n */\r\n this.clazz = null;\r\n\r\n /**\r\n * Whether this is a legacy group or not.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.isGroup = !!isGroup;\r\n\r\n // The following cached collections are used to efficiently iterate over or look up fields when decoding.\r\n\r\n /**\r\n * Cached fields.\r\n * @type {?Array.}\r\n * @private\r\n */\r\n this._fields = null;\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 by name.\r\n * @type {?Object.}\r\n * @private\r\n */\r\n this._fieldsByName = null;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.prototype\r\n * @inner\r\n */\r\n var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);\r\n\r\n /**\r\n * Builds the message and returns the runtime counterpart, which is a fully functional class.\r\n * @see ProtoBuf.Builder.Message\r\n * @param {boolean=} rebuild Whether to rebuild or not, defaults to false\r\n * @return {ProtoBuf.Reflect.Message} Message class\r\n * @throws {Error} If the message cannot be built\r\n * @expose\r\n */\r\n MessagePrototype.build = function(rebuild) {\r\n if (this.clazz && !rebuild)\r\n return this.clazz;\r\n\r\n // Create the runtime Message class in its own scope\r\n var clazz = (function(ProtoBuf, T) {\r\n\r\n var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),\r\n oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);\r\n\r\n /**\r\n * Constructs a new runtime Message.\r\n * @name ProtoBuf.Builder.Message\r\n * @class Barebone of all runtime messages.\r\n * @param {!Object.|string} values Preset values\r\n * @param {...string} var_args\r\n * @constructor\r\n * @throws {Error} If the message cannot be created\r\n */\r\n var Message = function(values, var_args) {\r\n ProtoBuf.Builder.Message.call(this);\r\n\r\n // Create virtual oneof properties\r\n for (var i=0, k=oneofs.length; i 0) {\r\n var value;\r\n // Set field values from a values object\r\n if (arguments.length === 1 && values !== null && typeof values === 'object' &&\r\n /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &&\r\n /* not a repeated field */ !Array.isArray(values) &&\r\n /* not a Map */ !(values instanceof ProtoBuf.Map) &&\r\n /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &&\r\n /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &&\r\n /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {\r\n this.$set(values);\r\n } else // Set field values from arguments, in declaration order\r\n for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values\r\n * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r\n * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`\r\n * @returns {!ProtoBuf.Builder.Message} this\r\n * @throws {Error} If the value cannot be set\r\n * @expose\r\n */\r\n MessagePrototype.set = function(keyOrObj, value, noAssert) {\r\n if (keyOrObj && typeof keyOrObj === 'object') {\r\n noAssert = value;\r\n for (var ikey in keyOrObj) {\r\n // Check if virtual oneof field - don't set these\r\n if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)\r\n this.$set(ikey, value, noAssert);\r\n }\r\n return this;\r\n }\r\n var field = T._fieldsByName[keyOrObj];\r\n if (!noAssert) {\r\n if (!field)\r\n throw Error(this+\"#\"+keyOrObj+\" is not a field: undefined\");\r\n if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r\n throw Error(this+\"#\"+keyOrObj+\" is not a field: \"+field.toString(true));\r\n this[field.name] = (value = field.verifyValue(value)); // May throw\r\n } else\r\n this[keyOrObj] = value;\r\n if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r\n var currentField = this[field.oneof.name]; // Virtual field references currently set field\r\n if (value !== null) {\r\n if (currentField !== null && currentField !== field.name)\r\n this[currentField] = null; // Clear currently set field\r\n this[field.oneof.name] = field.name; // Point virtual field at this field\r\n } else if (/* value === null && */currentField === keyOrObj)\r\n this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)\r\n }\r\n return this;\r\n };\r\n\r\n /**\r\n * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.\r\n * @name ProtoBuf.Builder.Message#$set\r\n * @function\r\n * @param {string|!Object.} keyOrObj String key or plain object holding multiple values\r\n * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r\n * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r\n * @throws {Error} If the value cannot be set\r\n * @expose\r\n */\r\n MessagePrototype.$set = MessagePrototype.set;\r\n\r\n /**\r\n * Gets a field's value.\r\n * @name ProtoBuf.Builder.Message#get\r\n * @function\r\n * @param {string} key Key\r\n * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`\r\n * @return {*} Value\r\n * @throws {Error} If there is no such field\r\n * @expose\r\n */\r\n MessagePrototype.get = function(key, noAssert) {\r\n if (noAssert)\r\n return this[key];\r\n var field = T._fieldsByName[key];\r\n if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))\r\n throw Error(this+\"#\"+key+\" is not a field: undefined\");\r\n if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r\n throw Error(this+\"#\"+key+\" is not a field: \"+field.toString(true));\r\n return this[field.name];\r\n };\r\n\r\n /**\r\n * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.\r\n * @name ProtoBuf.Builder.Message#$get\r\n * @function\r\n * @param {string} key Key\r\n * @return {*} Value\r\n * @throws {Error} If there is no such field\r\n * @expose\r\n */\r\n MessagePrototype.$get = MessagePrototype.get;\r\n\r\n // Getters and setters\r\n\r\n for (var i=0; i} data Data payload\r\n * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r\n * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r\n * @return {!ByteBuffer} Encoded message as a ByteBuffer\r\n * @expose\r\n */\r\n Message.encode = function(data, buffer, noVerify) {\r\n return new Message(data).encode(buffer, noVerify);\r\n };\r\n\r\n /**\r\n * Calculates the byte length of the message.\r\n * @name ProtoBuf.Builder.Message#calculate\r\n * @function\r\n * @returns {number} Byte length\r\n * @throws {Error} If the message cannot be calculated or if required fields are missing.\r\n * @expose\r\n */\r\n MessagePrototype.calculate = function() {\r\n return T.calculate(this);\r\n };\r\n\r\n /**\r\n * Encodes the varint32 length-delimited message.\r\n * @name ProtoBuf.Builder.Message#encodeDelimited\r\n * @function\r\n * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r\n * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r\n * @return {!ByteBuffer} Encoded message as a ByteBuffer\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded ByteBuffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeDelimited = function(buffer, noVerify) {\r\n var isNew = false;\r\n if (!buffer)\r\n buffer = new ByteBuffer(),\r\n isNew = true;\r\n var enc = new ByteBuffer().LE();\r\n T.encode(this, enc, noVerify).flip();\r\n buffer.writeVarint32(enc.remaining());\r\n buffer.append(enc);\r\n return isNew ? buffer.flip() : buffer;\r\n };\r\n\r\n /**\r\n * Directly encodes the message to an ArrayBuffer.\r\n * @name ProtoBuf.Builder.Message#encodeAB\r\n * @function\r\n * @return {ArrayBuffer} Encoded message as ArrayBuffer\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded ArrayBuffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeAB = function() {\r\n try {\r\n return this.encode().toArrayBuffer();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toArrayBuffer();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.\r\n * @name ProtoBuf.Builder.Message#toArrayBuffer\r\n * @function\r\n * @return {ArrayBuffer} Encoded message as ArrayBuffer\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded ArrayBuffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;\r\n\r\n /**\r\n * Directly encodes the message to a node Buffer.\r\n * @name ProtoBuf.Builder.Message#encodeNB\r\n * @function\r\n * @return {!Buffer}\r\n * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are\r\n * missing. The later still returns the encoded node Buffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeNB = function() {\r\n try {\r\n return this.encode().toBuffer();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toBuffer();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.\r\n * @name ProtoBuf.Builder.Message#toBuffer\r\n * @function\r\n * @return {!Buffer}\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded node Buffer in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toBuffer = MessagePrototype.encodeNB;\r\n\r\n /**\r\n * Directly encodes the message to a base64 encoded string.\r\n * @name ProtoBuf.Builder.Message#encode64\r\n * @function\r\n * @return {string} Base64 encoded string\r\n * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r\n * still returns the encoded base64 string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encode64 = function() {\r\n try {\r\n return this.encode().toBase64();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toBase64();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.\r\n * @name ProtoBuf.Builder.Message#toBase64\r\n * @function\r\n * @return {string} Base64 encoded string\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded base64 string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toBase64 = MessagePrototype.encode64;\r\n\r\n /**\r\n * Directly encodes the message to a hex encoded string.\r\n * @name ProtoBuf.Builder.Message#encodeHex\r\n * @function\r\n * @return {string} Hex encoded string\r\n * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r\n * still returns the encoded hex string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.encodeHex = function() {\r\n try {\r\n return this.encode().toHex();\r\n } catch (e) {\r\n if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toHex();\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.\r\n * @name ProtoBuf.Builder.Message#toHex\r\n * @function\r\n * @return {string} Hex encoded string\r\n * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n * returns the encoded hex string in the `encoded` property on the error.\r\n * @expose\r\n */\r\n MessagePrototype.toHex = MessagePrototype.encodeHex;\r\n\r\n /**\r\n * Clones a message object or field value to a raw object.\r\n * @param {*} obj Object to clone\r\n * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise\r\n * @param {boolean} longsAsStrings Whether to encode longs as strings\r\n * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field\r\n * @returns {*} Cloned object\r\n * @inner\r\n */\r\n function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {\r\n if (obj === null || typeof obj !== 'object') {\r\n // Convert enum values to their respective names\r\n if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {\r\n var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);\r\n if (name !== null)\r\n return name;\r\n }\r\n // Pass-through string, number, boolean, null...\r\n return obj;\r\n }\r\n // Convert ByteBuffers to raw buffer or strings\r\n if (ByteBuffer.isByteBuffer(obj))\r\n return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();\r\n // Convert Longs to proper objects or strings\r\n if (ProtoBuf.Long.isLong(obj))\r\n return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);\r\n var clone;\r\n // Clone arrays\r\n if (Array.isArray(obj)) {\r\n clone = [];\r\n obj.forEach(function(v, k) {\r\n clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);\r\n });\r\n return clone;\r\n }\r\n clone = {};\r\n // Convert maps to objects\r\n if (obj instanceof ProtoBuf.Map) {\r\n var it = obj.entries();\r\n for (var e = it.next(); !e.done; e = it.next())\r\n clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);\r\n return clone;\r\n }\r\n // Everything else is a non-null object\r\n var type = obj.$type,\r\n field = undefined;\r\n for (var i in obj)\r\n if (obj.hasOwnProperty(i)) {\r\n if (type && (field = type.getChild(i)))\r\n clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);\r\n else\r\n clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);\r\n }\r\n return clone;\r\n }\r\n\r\n /**\r\n * Returns the message's raw payload.\r\n * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`\r\n * @param {boolean} longsAsStrings Whether to encode longs as strings\r\n * @returns {Object.} Raw payload\r\n * @expose\r\n */\r\n MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {\r\n return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);\r\n };\r\n\r\n /**\r\n * Encodes a message to JSON.\r\n * @returns {string} JSON string\r\n * @expose\r\n */\r\n MessagePrototype.encodeJSON = function() {\r\n return JSON.stringify(\r\n cloneRaw(this,\r\n /* binary-as-base64 */ true,\r\n /* longs-as-strings */ true,\r\n this.$type\r\n )\r\n );\r\n };\r\n\r\n /**\r\n * Decodes a message from the specified buffer or string.\r\n * @name ProtoBuf.Builder.Message.decode\r\n * @function\r\n * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r\n * @param {(number|string)=} length Message length. Defaults to decode all the remainig data.\r\n * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n * @see ProtoBuf.Builder.Message.decode64\r\n * @see ProtoBuf.Builder.Message.decodeHex\r\n */\r\n Message.decode = function(buffer, length, enc) {\r\n if (typeof length === 'string')\r\n enc = length,\r\n length = -1;\r\n if (typeof buffer === 'string')\r\n buffer = ByteBuffer.wrap(buffer, enc ? enc : \"base64\");\r\n else if (!ByteBuffer.isByteBuffer(buffer))\r\n buffer = ByteBuffer.wrap(buffer); // May throw\r\n var le = buffer.littleEndian;\r\n try {\r\n var msg = T.decode(buffer.LE(), length);\r\n buffer.LE(le);\r\n return msg;\r\n } catch (e) {\r\n buffer.LE(le);\r\n throw(e);\r\n }\r\n };\r\n\r\n /**\r\n * Decodes a varint32 length-delimited message from the specified buffer or string.\r\n * @name ProtoBuf.Builder.Message.decodeDelimited\r\n * @function\r\n * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r\n * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r\n * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n */\r\n Message.decodeDelimited = function(buffer, enc) {\r\n if (typeof buffer === 'string')\r\n buffer = ByteBuffer.wrap(buffer, enc ? enc : \"base64\");\r\n else if (!ByteBuffer.isByteBuffer(buffer))\r\n buffer = ByteBuffer.wrap(buffer); // May throw\r\n if (buffer.remaining() < 1)\r\n return null;\r\n var off = buffer.offset,\r\n len = buffer.readVarint32();\r\n if (buffer.remaining() < len) {\r\n buffer.offset = off;\r\n return null;\r\n }\r\n try {\r\n var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());\r\n buffer.offset += len;\r\n return msg;\r\n } catch (err) {\r\n buffer.offset += len;\r\n throw err;\r\n }\r\n };\r\n\r\n /**\r\n * Decodes the message from the specified base64 encoded string.\r\n * @name ProtoBuf.Builder.Message.decode64\r\n * @function\r\n * @param {string} str String to decode from\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n */\r\n Message.decode64 = function(str) {\r\n return Message.decode(str, \"base64\");\r\n };\r\n\r\n /**\r\n * Decodes the message from the specified hex encoded string.\r\n * @name ProtoBuf.Builder.Message.decodeHex\r\n * @function\r\n * @param {string} str String to decode from\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n * returns the decoded message with missing fields in the `decoded` property on the error.\r\n * @expose\r\n */\r\n Message.decodeHex = function(str) {\r\n return Message.decode(str, \"hex\");\r\n };\r\n\r\n /**\r\n * Decodes the message from a JSON string.\r\n * @name ProtoBuf.Builder.Message.decodeJSON\r\n * @function\r\n * @param {string} str String to decode from\r\n * @return {!ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded or if required fields are\r\n * missing.\r\n * @expose\r\n */\r\n Message.decodeJSON = function(str) {\r\n return new Message(JSON.parse(str));\r\n };\r\n\r\n // Utility\r\n\r\n /**\r\n * Returns a string representation of this Message.\r\n * @name ProtoBuf.Builder.Message#toString\r\n * @function\r\n * @return {string} String representation as of \".Fully.Qualified.MessageName\"\r\n * @expose\r\n */\r\n MessagePrototype.toString = function() {\r\n return T.toString();\r\n };\r\n\r\n // Properties\r\n\r\n /**\r\n * Message options.\r\n * @name ProtoBuf.Builder.Message.$options\r\n * @type {Object.}\r\n * @expose\r\n */\r\n var $optionsS; // cc needs this\r\n\r\n /**\r\n * Message options.\r\n * @name ProtoBuf.Builder.Message#$options\r\n * @type {Object.}\r\n * @expose\r\n */\r\n var $options;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Message.$type\r\n * @type {!ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n var $typeS;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Message#$type\r\n * @type {!ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n var $type;\r\n\r\n if (Object.defineProperty)\r\n Object.defineProperty(Message, '$options', { \"value\": T.buildOpt() }),\r\n Object.defineProperty(MessagePrototype, \"$options\", { \"value\": Message[\"$options\"] }),\r\n Object.defineProperty(Message, \"$type\", { \"value\": T }),\r\n Object.defineProperty(MessagePrototype, \"$type\", { \"value\": T });\r\n\r\n return Message;\r\n\r\n })(ProtoBuf, this);\r\n\r\n // Static enums and prototyped sub-messages / cached collections\r\n this._fields = [];\r\n this._fieldsById = {};\r\n this._fieldsByName = {};\r\n this._oneofsByName = {};\r\n for (var i=0, k=this.children.length, child; i>> 3;\r\n switch (wireType) {\r\n case ProtoBuf.WIRE_TYPES.VARINT:\r\n do tag = buf.readUint8();\r\n while ((tag & 0x80) === 0x80);\r\n break;\r\n case ProtoBuf.WIRE_TYPES.BITS64:\r\n buf.offset += 8;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.LDELIM:\r\n tag = buf.readVarint32(); // reads the varint\r\n buf.offset += tag; // skips n bytes\r\n break;\r\n case ProtoBuf.WIRE_TYPES.STARTGROUP:\r\n skipTillGroupEnd(id, buf);\r\n break;\r\n case ProtoBuf.WIRE_TYPES.ENDGROUP:\r\n if (id === expectedId)\r\n return false;\r\n else\r\n throw Error(\"Illegal GROUPEND after unknown group: \"+id+\" (\"+expectedId+\" expected)\");\r\n case ProtoBuf.WIRE_TYPES.BITS32:\r\n buf.offset += 4;\r\n break;\r\n default:\r\n throw Error(\"Illegal wire type in unknown group \"+expectedId+\": \"+wireType);\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Decodes an encoded message and returns the decoded message.\r\n * @param {ByteBuffer} buffer ByteBuffer to decode from\r\n * @param {number=} length Message length. Defaults to decode all remaining data.\r\n * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group\r\n * @return {ProtoBuf.Builder.Message} Decoded message\r\n * @throws {Error} If the message cannot be decoded\r\n * @expose\r\n */\r\n MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {\r\n if (typeof length !== 'number')\r\n length = -1;\r\n var start = buffer.offset,\r\n msg = new (this.clazz)(),\r\n tag, wireType, id, field;\r\n while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {\r\n tag = buffer.readVarint32();\r\n wireType = tag & 0x07;\r\n id = tag >>> 3;\r\n if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {\r\n if (id !== expectedGroupEndId)\r\n throw Error(\"Illegal group end indicator for \"+this.toString(true)+\": \"+id+\" (\"+(expectedGroupEndId ? expectedGroupEndId+\" expected\" : \"not a group\")+\")\");\r\n break;\r\n }\r\n if (!(field = this._fieldsById[id])) {\r\n // \"messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing.\"\r\n switch (wireType) {\r\n case ProtoBuf.WIRE_TYPES.VARINT:\r\n buffer.readVarint32();\r\n break;\r\n case ProtoBuf.WIRE_TYPES.BITS32:\r\n buffer.offset += 4;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.BITS64:\r\n buffer.offset += 8;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.LDELIM:\r\n var len = buffer.readVarint32();\r\n buffer.offset += len;\r\n break;\r\n case ProtoBuf.WIRE_TYPES.STARTGROUP:\r\n while (skipTillGroupEnd(id, buffer)) {}\r\n break;\r\n default:\r\n throw Error(\"Illegal wire type for unknown field \"+id+\" in \"+this.toString(true)+\"#decode: \"+wireType);\r\n }\r\n continue;\r\n }\r\n if (field.repeated && !field.options[\"packed\"]) {\r\n msg[field.name].push(field.decode(wireType, buffer));\r\n } else if (field.map) {\r\n var keyval = field.decode(wireType, buffer);\r\n msg[field.name].set(keyval[0], keyval[1]);\r\n } else {\r\n msg[field.name] = field.decode(wireType, buffer);\r\n if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r\n var currentField = msg[field.oneof.name]; // Virtual field references currently set field\r\n if (currentField !== null && currentField !== field.name)\r\n msg[currentField] = null; // Clear currently set field\r\n msg[field.oneof.name] = field.name; // Point virtual field at this field\r\n }\r\n }\r\n }\r\n\r\n // Check if all required fields are present and set default values for optional fields that are not\r\n for (var i=0, k=this._fields.length; i=} options Options\r\n * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf\r\n * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {\r\n T.call(this, builder, message, name);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Message.Field\";\r\n\r\n /**\r\n * Message field required flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.required = rule === \"required\";\r\n\r\n /**\r\n * Message field repeated flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.repeated = rule === \"repeated\";\r\n\r\n /**\r\n * Message field map flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.map = rule === \"map\";\r\n\r\n /**\r\n * Message field key type. Type reference string if unresolved, protobuf\r\n * type if resolved. Valid only if this.map === true, null otherwise.\r\n * @type {string|{name: string, wireType: number}|null}\r\n * @expose\r\n */\r\n this.keyType = keytype || null;\r\n\r\n /**\r\n * Message field type. Type reference string if unresolved, protobuf type if\r\n * resolved. In a map field, this is the value type.\r\n * @type {string|{name: string, wireType: number}}\r\n * @expose\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Resolved type reference inside the global namespace.\r\n * @type {ProtoBuf.Reflect.T|null}\r\n * @expose\r\n */\r\n this.resolvedType = null;\r\n\r\n /**\r\n * Unique message field id.\r\n * @type {number}\r\n * @expose\r\n */\r\n this.id = id;\r\n\r\n /**\r\n * Message field options.\r\n * @type {!Object.}\r\n * @dict\r\n * @expose\r\n */\r\n this.options = options || {};\r\n\r\n /**\r\n * Default value.\r\n * @type {*}\r\n * @expose\r\n */\r\n this.defaultValue = null;\r\n\r\n /**\r\n * Enclosing OneOf.\r\n * @type {?ProtoBuf.Reflect.Message.OneOf}\r\n * @expose\r\n */\r\n this.oneof = oneof || null;\r\n\r\n /**\r\n * Syntax level of this definition (e.g., proto3).\r\n * @type {string}\r\n * @expose\r\n */\r\n this.syntax = syntax || 'proto2';\r\n\r\n /**\r\n * Original field name.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.originalName = this.name; // Used to revert camelcase transformation on naming collisions\r\n\r\n /**\r\n * Element implementation. Created in build() after types are resolved.\r\n * @type {ProtoBuf.Element}\r\n * @expose\r\n */\r\n this.element = null;\r\n\r\n /**\r\n * Key element implementation, for map fields. Created in build() after\r\n * types are resolved.\r\n * @type {ProtoBuf.Element}\r\n * @expose\r\n */\r\n this.keyElement = null;\r\n\r\n // Convert field names to camel case notation if the override is set\r\n if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))\r\n this.name = ProtoBuf.Util.toCamelCase(this.name);\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.Field.prototype\r\n * @inner\r\n */\r\n var FieldPrototype = Field.prototype = Object.create(T.prototype);\r\n\r\n /**\r\n * Builds the field.\r\n * @override\r\n * @expose\r\n */\r\n FieldPrototype.build = function() {\r\n this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);\r\n if (this.map)\r\n this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);\r\n\r\n // In proto3, fields do not have field presence, and every field is set to\r\n // its type's default value (\"\", 0, 0.0, or false).\r\n if (this.syntax === 'proto3' && !this.repeated && !this.map)\r\n this.defaultValue = Element.defaultFieldValue(this.type);\r\n\r\n // Otherwise, default values are present when explicitly specified\r\n else if (typeof this.options['default'] !== 'undefined')\r\n this.defaultValue = this.verifyValue(this.options['default']);\r\n };\r\n\r\n /**\r\n * Checks if the given value can be set for this field.\r\n * @param {*} value Value to check\r\n * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.\r\n * @return {*} Verified, maybe adjusted, value\r\n * @throws {Error} If the value cannot be set for this field\r\n * @expose\r\n */\r\n FieldPrototype.verifyValue = function(value, skipRepeated) {\r\n skipRepeated = skipRepeated || false;\r\n var self = this;\r\n function fail(val, msg) {\r\n throw Error(\"Illegal value for \"+self.toString(true)+\" of type \"+self.type.name+\": \"+val+\" (\"+msg+\")\");\r\n }\r\n if (value === null) { // NULL values for optional fields\r\n if (this.required)\r\n fail(typeof value, \"required\");\r\n if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES[\"message\"])\r\n fail(typeof value, \"proto3 field without field presence cannot be null\");\r\n return null;\r\n }\r\n var i;\r\n if (this.repeated && !skipRepeated) { // Repeated values as arrays\r\n if (!Array.isArray(value))\r\n value = [value];\r\n var res = [];\r\n for (i=0; i 0;\r\n\r\n case ProtoBuf.TYPES[\"bytes\"]:\r\n return value.remaining() > 0;\r\n\r\n case ProtoBuf.TYPES[\"enum\"]:\r\n return value !== 0;\r\n\r\n case ProtoBuf.TYPES[\"message\"]:\r\n return value !== null;\r\n default:\r\n return true;\r\n }\r\n };\r\n\r\n /**\r\n * Encodes the specified field value to the specified buffer.\r\n * @param {*} value Verified field value\r\n * @param {ByteBuffer} buffer ByteBuffer to encode to\r\n * @param {!ProtoBuf.Builder.Message} message Runtime message\r\n * @return {ByteBuffer} The ByteBuffer for chaining\r\n * @throws {Error} If the field cannot be encoded\r\n * @expose\r\n */\r\n FieldPrototype.encode = function(value, buffer, message) {\r\n if (this.type === null || typeof this.type !== 'object')\r\n throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(true)+\": \"+this.type);\r\n if (value === null || (this.repeated && value.length == 0))\r\n return buffer; // Optional omitted\r\n try {\r\n if (this.repeated) {\r\n var i;\r\n // \"Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire\r\n // types) can be declared 'packed'.\"\r\n if (this.options[\"packed\"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r\n // \"All of the elements of the field are packed into a single key-value pair with wire type 2\r\n // (length-delimited). Each element is encoded the same way it would be normally, except without a\r\n // tag preceding it.\"\r\n buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r\n buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1\r\n var start = buffer.offset; // Remember where the contents begin\r\n for (i=0; i 1) { // We need to move the contents\r\n var contents = buffer.slice(start, buffer.offset);\r\n start += varintLen-1;\r\n buffer.offset = start;\r\n buffer.append(contents);\r\n }\r\n buffer.writeVarint32(len, start-varintLen);\r\n } else {\r\n // \"If your message definition has repeated elements (without the [packed=true] option), the encoded\r\n // message has zero or more key-value pairs with the same tag number\"\r\n for (i=0; i= 0) {\r\n n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r\n ni = 0;\r\n for (i=0; i= 0) {\r\n if (!skipRepeated) {\r\n nBytes = buffer.readVarint32();\r\n nBytes = buffer.offset + nBytes; // Limit\r\n var values = [];\r\n while (buffer.offset < nBytes)\r\n values.push(this.decode(this.type.wireType, buffer, true));\r\n return values;\r\n }\r\n // Read the next value otherwise...\r\n }\r\n\r\n // Handle maps.\r\n if (this.map) {\r\n // Read one (key, value) submessage, and return [key, value]\r\n var key = Element.defaultFieldValue(this.keyType);\r\n value = Element.defaultFieldValue(this.type);\r\n\r\n // Read the length\r\n nBytes = buffer.readVarint32();\r\n if (buffer.remaining() < nBytes)\r\n throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+nBytes+\" required but got only \"+buffer.remaining());\r\n\r\n // Get a sub-buffer of this key/value submessage\r\n var msgbuf = buffer.clone();\r\n msgbuf.limit = msgbuf.offset + nBytes;\r\n buffer.offset += nBytes;\r\n\r\n while (msgbuf.remaining() > 0) {\r\n var tag = msgbuf.readVarint32();\r\n wireType = tag & 0x07;\r\n var id = tag >>> 3;\r\n if (id === 1) {\r\n key = this.keyElement.decode(msgbuf, wireType, id);\r\n } else if (id === 2) {\r\n value = this.element.decode(msgbuf, wireType, id);\r\n } else {\r\n throw Error(\"Unexpected tag in map field key/value submessage\");\r\n }\r\n }\r\n\r\n return [key, value];\r\n }\r\n\r\n // Handle singular and non-packed repeated field values.\r\n return this.element.decode(buffer, wireType, this.id);\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.Field\r\n * @expose\r\n */\r\n Reflect.Message.Field = Field;\r\n\r\n /**\r\n * Constructs a new Message ExtensionField.\r\n * @exports ProtoBuf.Reflect.Message.ExtensionField\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Message} message Message reference\r\n * @param {string} rule Rule, one of requried, optional, repeated\r\n * @param {string} type Data type, e.g. int32\r\n * @param {string} name Field name\r\n * @param {number} id Unique field id\r\n * @param {!Object.=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Message.Field\r\n */\r\n var ExtensionField = function(builder, message, rule, type, name, id, options) {\r\n Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options);\r\n\r\n /**\r\n * Extension reference.\r\n * @type {!ProtoBuf.Reflect.Extension}\r\n * @expose\r\n */\r\n this.extension;\r\n };\r\n\r\n // Extends Field\r\n ExtensionField.prototype = Object.create(Field.prototype);\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.ExtensionField\r\n * @expose\r\n */\r\n Reflect.Message.ExtensionField = ExtensionField;\r\n\r\n /**\r\n * Constructs a new Message OneOf.\r\n * @exports ProtoBuf.Reflect.Message.OneOf\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Message} message Message reference\r\n * @param {string} name OneOf name\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var OneOf = function(builder, message, name) {\r\n T.call(this, builder, message, name);\r\n\r\n /**\r\n * Enclosed fields.\r\n * @type {!Array.}\r\n * @expose\r\n */\r\n this.fields = [];\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Message.OneOf\r\n * @expose\r\n */\r\n Reflect.Message.OneOf = OneOf;\r\n\r\n /**\r\n * Constructs a new Enum.\r\n * @exports ProtoBuf.Reflect.Enum\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object\r\n * @param {string} name Enum name\r\n * @param {Object.=} options Enum options\r\n * @param {string?} syntax The syntax level (e.g., proto3)\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Namespace\r\n */\r\n var Enum = function(builder, parent, name, options, syntax) {\r\n Namespace.call(this, builder, parent, name, options, syntax);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Enum\";\r\n\r\n /**\r\n * Runtime enum object.\r\n * @type {Object.|null}\r\n * @expose\r\n */\r\n this.object = null;\r\n };\r\n\r\n /**\r\n * Gets the string name of an enum value.\r\n * @param {!ProtoBuf.Builder.Enum} enm Runtime enum\r\n * @param {number} value Enum value\r\n * @returns {?string} Name or `null` if not present\r\n * @expose\r\n */\r\n Enum.getName = function(enm, value) {\r\n var keys = Object.keys(enm);\r\n for (var i=0, key; i}\r\n * @expose\r\n */\r\n EnumPrototype.build = function(rebuild) {\r\n if (this.object && !rebuild)\r\n return this.object;\r\n var enm = new ProtoBuf.Builder.Enum(),\r\n values = this.getChildren(Enum.Value);\r\n for (var i=0, k=values.length; i=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Namespace\r\n */\r\n var Service = function(builder, root, name, options) {\r\n Namespace.call(this, builder, root, name, options);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Service\";\r\n\r\n /**\r\n * Built runtime service class.\r\n * @type {?function(new:ProtoBuf.Builder.Service)}\r\n */\r\n this.clazz = null;\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.prototype\r\n * @inner\r\n */\r\n var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r\n\r\n /**\r\n * Builds the service and returns the runtime counterpart, which is a fully functional class.\r\n * @see ProtoBuf.Builder.Service\r\n * @param {boolean=} rebuild Whether to rebuild or not\r\n * @return {Function} Service class\r\n * @throws {Error} If the message cannot be built\r\n * @expose\r\n */\r\n ServicePrototype.build = function(rebuild) {\r\n if (this.clazz && !rebuild)\r\n return this.clazz;\r\n\r\n // Create the runtime Service class in its own scope\r\n return this.clazz = (function(ProtoBuf, T) {\r\n\r\n /**\r\n * Constructs a new runtime Service.\r\n * @name ProtoBuf.Builder.Service\r\n * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message\r\n * @class Barebone of all runtime services.\r\n * @constructor\r\n * @throws {Error} If the service cannot be created\r\n */\r\n var Service = function(rpcImpl) {\r\n ProtoBuf.Builder.Service.call(this);\r\n\r\n /**\r\n * Service implementation.\r\n * @name ProtoBuf.Builder.Service#rpcImpl\r\n * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r\n * @expose\r\n */\r\n this.rpcImpl = rpcImpl || function(name, msg, callback) {\r\n // This is what a user has to implement: A function receiving the method name, the actual message to\r\n // send (type checked) and the callback that's either provided with the error as its first\r\n // argument or null and the actual response message.\r\n setTimeout(callback.bind(this, Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")), 0); // Must be async!\r\n };\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Builder.Service.prototype\r\n * @inner\r\n */\r\n var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);\r\n\r\n /**\r\n * Asynchronously performs an RPC call using the given RPC implementation.\r\n * @name ProtoBuf.Builder.Service.[Method]\r\n * @function\r\n * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation\r\n * @param {ProtoBuf.Builder.Message} req Request\r\n * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r\n * the error if any and the response either as a pre-parsed message or as its raw bytes\r\n * @abstract\r\n */\r\n\r\n /**\r\n * Asynchronously performs an RPC call using the instance's RPC implementation.\r\n * @name ProtoBuf.Builder.Service#[Method]\r\n * @function\r\n * @param {ProtoBuf.Builder.Message} req Request\r\n * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r\n * the error if any and the response either as a pre-parsed message or as its raw bytes\r\n * @abstract\r\n */\r\n\r\n var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);\r\n for (var i=0; i}\r\n * @expose\r\n */\r\n var $optionsS; // cc needs this\r\n\r\n /**\r\n * Service options.\r\n * @name ProtoBuf.Builder.Service#$options\r\n * @type {Object.}\r\n * @expose\r\n */\r\n var $options;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Service.$type\r\n * @type {!ProtoBuf.Reflect.Service}\r\n * @expose\r\n */\r\n var $typeS;\r\n\r\n /**\r\n * Reflection type.\r\n * @name ProtoBuf.Builder.Service#$type\r\n * @type {!ProtoBuf.Reflect.Service}\r\n * @expose\r\n */\r\n var $type;\r\n\r\n if (Object.defineProperty)\r\n Object.defineProperty(Service, \"$options\", { \"value\": T.buildOpt() }),\r\n Object.defineProperty(ServicePrototype, \"$options\", { \"value\": Service[\"$options\"] }),\r\n Object.defineProperty(Service, \"$type\", { \"value\": T }),\r\n Object.defineProperty(ServicePrototype, \"$type\", { \"value\": T });\r\n\r\n return Service;\r\n\r\n })(ProtoBuf, this);\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service\r\n * @expose\r\n */\r\n Reflect.Service = Service;\r\n\r\n /**\r\n * Abstract service method.\r\n * @exports ProtoBuf.Reflect.Service.Method\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Service} svc Service\r\n * @param {string} name Method name\r\n * @param {Object.=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.T\r\n */\r\n var Method = function(builder, svc, name, options) {\r\n T.call(this, builder, svc, name);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Service.Method\";\r\n\r\n /**\r\n * Options.\r\n * @type {Object.}\r\n * @expose\r\n */\r\n this.options = options || {};\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.Method.prototype\r\n * @inner\r\n */\r\n var MethodPrototype = Method.prototype = Object.create(T.prototype);\r\n\r\n /**\r\n * Builds the method's '$options' property.\r\n * @name ProtoBuf.Reflect.Service.Method#buildOpt\r\n * @function\r\n * @return {Object.}\r\n */\r\n MethodPrototype.buildOpt = NamespacePrototype.buildOpt;\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.Method\r\n * @expose\r\n */\r\n Reflect.Service.Method = Method;\r\n\r\n /**\r\n * RPC service method.\r\n * @exports ProtoBuf.Reflect.Service.RPCMethod\r\n * @param {!ProtoBuf.Builder} builder Builder reference\r\n * @param {!ProtoBuf.Reflect.Service} svc Service\r\n * @param {string} name Method name\r\n * @param {string} request Request message name\r\n * @param {string} response Response message name\r\n * @param {boolean} request_stream Whether requests are streamed\r\n * @param {boolean} response_stream Whether responses are streamed\r\n * @param {Object.=} options Options\r\n * @constructor\r\n * @extends ProtoBuf.Reflect.Service.Method\r\n */\r\n var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {\r\n Method.call(this, builder, svc, name, options);\r\n\r\n /**\r\n * @override\r\n */\r\n this.className = \"Service.RPCMethod\";\r\n\r\n /**\r\n * Request message name.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.requestName = request;\r\n\r\n /**\r\n * Response message name.\r\n * @type {string}\r\n * @expose\r\n */\r\n this.responseName = response;\r\n\r\n /**\r\n * Whether requests are streamed\r\n * @type {bool}\r\n * @expose\r\n */\r\n this.requestStream = request_stream;\r\n\r\n /**\r\n * Whether responses are streamed\r\n * @type {bool}\r\n * @expose\r\n */\r\n this.responseStream = response_stream;\r\n\r\n /**\r\n * Resolved request message type.\r\n * @type {ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n this.resolvedRequestType = null;\r\n\r\n /**\r\n * Resolved response message type.\r\n * @type {ProtoBuf.Reflect.Message}\r\n * @expose\r\n */\r\n this.resolvedResponseType = null;\r\n };\r\n\r\n // Extends Method\r\n RPCMethod.prototype = Object.create(Method.prototype);\r\n\r\n /**\r\n * @alias ProtoBuf.Reflect.Service.RPCMethod\r\n * @expose\r\n */\r\n Reflect.Service.RPCMethod = RPCMethod;\r\n\r\n return Reflect;\r\n\r\n })(ProtoBuf);\r\n\r\n /**\r\n * @alias ProtoBuf.Builder\r\n * @expose\r\n */\r\n ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {\r\n \"use strict\";\r\n\r\n /**\r\n * Constructs a new Builder.\r\n * @exports ProtoBuf.Builder\r\n * @class Provides the functionality to build protocol messages.\r\n * @param {Object.=} options Options\r\n * @constructor\r\n */\r\n var Builder = function(options) {\r\n\r\n /**\r\n * Namespace.\r\n * @type {ProtoBuf.Reflect.Namespace}\r\n * @expose\r\n */\r\n this.ns = new Reflect.Namespace(this, null, \"\"); // Global namespace\r\n\r\n /**\r\n * Namespace pointer.\r\n * @type {ProtoBuf.Reflect.T}\r\n * @expose\r\n */\r\n this.ptr = this.ns;\r\n\r\n /**\r\n * Resolved flag.\r\n * @type {boolean}\r\n * @expose\r\n */\r\n this.resolved = false;\r\n\r\n /**\r\n * The current building result.\r\n * @type {Object.|null}\r\n * @expose\r\n */\r\n this.result = null;\r\n\r\n /**\r\n * Imported files.\r\n * @type {Array.}\r\n * @expose\r\n */\r\n this.files = {};\r\n\r\n /**\r\n * Import root override.\r\n * @type {?string}\r\n * @expose\r\n */\r\n this.importRoot = null;\r\n\r\n /**\r\n * Options.\r\n * @type {!Object.}\r\n * @expose\r\n */\r\n this.options = options || {};\r\n };\r\n\r\n /**\r\n * @alias ProtoBuf.Builder.prototype\r\n * @inner\r\n */\r\n var BuilderPrototype = Builder.prototype;\r\n\r\n // ----- Definition tests -----\r\n\r\n /**\r\n * Tests if a definition most likely describes a message.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isMessage = function(def) {\r\n // Messages require a string name\r\n if (typeof def[\"name\"] !== 'string')\r\n return false;\r\n // Messages do not contain values (enum) or rpc methods (service)\r\n if (typeof def[\"values\"] !== 'undefined' || typeof def[\"rpc\"] !== 'undefined')\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes a message field.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isMessageField = function(def) {\r\n // Message fields require a string rule, name and type and an id\r\n if (typeof def[\"rule\"] !== 'string' || typeof def[\"name\"] !== 'string' || typeof def[\"type\"] !== 'string' || typeof def[\"id\"] === 'undefined')\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes an enum.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isEnum = function(def) {\r\n // Enums require a string name\r\n if (typeof def[\"name\"] !== 'string')\r\n return false;\r\n // Enums require at least one value\r\n if (typeof def[\"values\"] === 'undefined' || !Array.isArray(def[\"values\"]) || def[\"values\"].length === 0)\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes a service.\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isService = function(def) {\r\n // Services require a string name and an rpc object\r\n if (typeof def[\"name\"] !== 'string' || typeof def[\"rpc\"] !== 'object' || !def[\"rpc\"])\r\n return false;\r\n return true;\r\n };\r\n\r\n /**\r\n * Tests if a definition most likely describes an extended message\r\n * @param {!Object} def\r\n * @returns {boolean}\r\n * @expose\r\n */\r\n Builder.isExtend = function(def) {\r\n // Extends rquire a string ref\r\n if (typeof def[\"ref\"] !== 'string')\r\n return false;\r\n return true;\r\n };\r\n\r\n // ----- Building -----\r\n\r\n /**\r\n * Resets the pointer to the root namespace.\r\n * @returns {!ProtoBuf.Builder} this\r\n * @expose\r\n */\r\n BuilderPrototype.reset = function() {\r\n this.ptr = this.ns;\r\n return this;\r\n };\r\n\r\n /**\r\n * Defines a namespace on top of the current pointer position and places the pointer on it.\r\n * @param {string} namespace\r\n * @return {!ProtoBuf.Builder} this\r\n * @expose\r\n */\r\n BuilderPrototype.define = function(namespace) {\r\n if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))\r\n throw Error(\"illegal namespace: \"+namespace);\r\n namespace.split(\".\").forEach(function(part) {\r\n var ns = this.ptr.getChild(part);\r\n if (ns === null) // Keep existing\r\n this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));\r\n this.ptr = ns;\r\n }, this);\r\n return this;\r\n };\r\n\r\n /**\r\n * Creates the specified definitions at the current pointer position.\r\n * @param {!Array.} defs Messages, enums or services to create\r\n * @returns {!ProtoBuf.Builder} this\r\n * @throws {Error} If a message definition is invalid\r\n * @expose\r\n */\r\n BuilderPrototype.create = function(defs) {\r\n if (!defs)\r\n return this; // Nothing to create\r\n if (!Array.isArray(defs))\r\n defs = [defs];\r\n else {\r\n if (defs.length === 0)\r\n return this;\r\n defs = defs.slice();\r\n }\r\n\r\n // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.\r\n var stack = [defs];\r\n while (stack.length > 0) {\r\n defs = stack.pop();\r\n\r\n if (!Array.isArray(defs)) // Stack always contains entire namespaces\r\n throw Error(\"not a valid namespace: \"+JSON.stringify(defs));\r\n\r\n while (defs.length > 0) {\r\n var def = defs.shift(); // Namespaces always contain an array of messages, enums and services\r\n\r\n if (Builder.isMessage(def)) {\r\n var obj = new Reflect.Message(this, this.ptr, def[\"name\"], def[\"options\"], def[\"isGroup\"], def[\"syntax\"]);\r\n\r\n // Create OneOfs\r\n var oneofs = {};\r\n if (def[\"oneofs\"])\r\n Object.keys(def[\"oneofs\"]).forEach(function(name) {\r\n obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));\r\n }, this);\r\n\r\n // Create fields\r\n if (def[\"fields\"])\r\n def[\"fields\"].forEach(function(fld) {\r\n if (obj.getChild(fld[\"id\"]|0) !== null)\r\n throw Error(\"duplicate or invalid field id in \"+obj.name+\": \"+fld['id']);\r\n if (fld[\"options\"] && typeof fld[\"options\"] !== 'object')\r\n throw Error(\"illegal field options in \"+obj.name+\"#\"+fld[\"name\"]);\r\n var oneof = null;\r\n if (typeof fld[\"oneof\"] === 'string' && !(oneof = oneofs[fld[\"oneof\"]]))\r\n throw Error(\"illegal oneof in \"+obj.name+\"#\"+fld[\"name\"]+\": \"+fld[\"oneof\"]);\r\n fld = new Reflect.Message.Field(this, obj, fld[\"rule\"], fld[\"keytype\"], fld[\"type\"], fld[\"name\"], fld[\"id\"], fld[\"options\"], oneof, def[\"syntax\"]);\r\n if (oneof)\r\n oneof.fields.push(fld);\r\n obj.addChild(fld);\r\n }, this);\r\n\r\n // Push children to stack\r\n var subObj = [];\r\n if (def[\"enums\"])\r\n def[\"enums\"].forEach(function(enm) {\r\n subObj.push(enm);\r\n });\r\n if (def[\"messages\"])\r\n def[\"messages\"].forEach(function(msg) {\r\n subObj.push(msg);\r\n });\r\n if (def[\"services\"])\r\n def[\"services\"].forEach(function(svc) {\r\n subObj.push(svc);\r\n });\r\n\r\n // Set extension ranges\r\n if (def[\"extensions\"]) {\r\n if (typeof def[\"extensions\"][0] === 'number') // pre 5.0.1\r\n obj.extensions = [ def[\"extensions\"] ];\r\n else\r\n obj.extensions = def[\"extensions\"];\r\n }\r\n\r\n // Create on top of current namespace\r\n this.ptr.addChild(obj);\r\n if (subObj.length > 0) {\r\n stack.push(defs); // Push the current level back\r\n defs = subObj; // Continue processing sub level\r\n subObj = null;\r\n this.ptr = obj; // And move the pointer to this namespace\r\n obj = null;\r\n continue;\r\n }\r\n subObj = null;\r\n\r\n } else if (Builder.isEnum(def)) {\r\n\r\n obj = new Reflect.Enum(this, this.ptr, def[\"name\"], def[\"options\"], def[\"syntax\"]);\r\n def[\"values\"].forEach(function(val) {\r\n obj.addChild(new Reflect.Enum.Value(this, obj, val[\"name\"], val[\"id\"]));\r\n }, this);\r\n this.ptr.addChild(obj);\r\n\r\n } else if (Builder.isService(def)) {\r\n\r\n obj = new Reflect.Service(this, this.ptr, def[\"name\"], def[\"options\"]);\r\n Object.keys(def[\"rpc\"]).forEach(function(name) {\r\n var mtd = def[\"rpc\"][name];\r\n obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd[\"request\"], mtd[\"response\"], !!mtd[\"request_stream\"], !!mtd[\"response_stream\"], mtd[\"options\"]));\r\n }, this);\r\n this.ptr.addChild(obj);\r\n\r\n } else if (Builder.isExtend(def)) {\r\n\r\n obj = this.ptr.resolve(def[\"ref\"], true);\r\n if (obj) {\r\n def[\"fields\"].forEach(function(fld) {\r\n if (obj.getChild(fld['id']|0) !== null)\r\n throw Error(\"duplicate extended field id in \"+obj.name+\": \"+fld['id']);\r\n // Check if field id is allowed to be extended\r\n if (obj.extensions) {\r\n var valid = false;\r\n obj.extensions.forEach(function(range) {\r\n if (fld[\"id\"] >= range[0] && fld[\"id\"] <= range[1])\r\n valid = true;\r\n });\r\n if (!valid)\r\n throw Error(\"illegal extended field id in \"+obj.name+\": \"+fld['id']+\" (not within valid ranges)\");\r\n }\r\n // Convert extension field names to camel case notation if the override is set\r\n var name = fld[\"name\"];\r\n if (this.options['convertFieldsToCamelCase'])\r\n name = ProtoBuf.Util.toCamelCase(name);\r\n // see #161: Extensions use their fully qualified name as their runtime key and...\r\n var field = new Reflect.Message.ExtensionField(this, obj, fld[\"rule\"], fld[\"type\"], this.ptr.fqn()+'.'+name, fld[\"id\"], fld[\"options\"]);\r\n // ...are added on top of the current namespace as an extension which is used for\r\n // resolving their type later on (the extension always keeps the original name to\r\n // prevent naming collisions)\r\n var ext = new Reflect.Extension(this, this.ptr, fld[\"name\"], field);\r\n field.extension = ext;\r\n this.ptr.addChild(ext);\r\n obj.addChild(field);\r\n }, this);\r\n\r\n } else if (!/\\.?google\\.protobuf\\./.test(def[\"ref\"])) // Silently skip internal extensions\r\n throw Error(\"extended message \"+def[\"ref\"]+\" is not defined\");\r\n\r\n } else\r\n throw Error(\"not a valid definition: \"+JSON.stringify(def));\r\n\r\n def = null;\r\n obj = null;\r\n }\r\n // Break goes here\r\n defs = null;\r\n this.ptr = this.ptr.parent; // Namespace done, continue at parent\r\n }\r\n this.resolved = false; // Require re-resolve\r\n this.result = null; // Require re-build\r\n return this;\r\n };\r\n\r\n /**\r\n * Propagates syntax to all children.\r\n * @param {!Object} parent\r\n * @inner\r\n */\r\n function propagateSyntax(parent) {\r\n if (parent['messages']) {\r\n parent['messages'].forEach(function(child) {\r\n child[\"syntax\"] = parent[\"syntax\"];\r\n propagateSyntax(child);\r\n });\r\n }\r\n if (parent['enums']) {\r\n parent['enums'].forEach(function(child) {\r\n child[\"syntax\"] = parent[\"syntax\"];\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Imports another definition into this builder.\r\n * @param {Object.} json Parsed import\r\n * @param {(string|{root: string, file: string})=} filename Imported file name\r\n * @returns {!ProtoBuf.Builder} this\r\n * @throws {Error} If the definition or file cannot be imported\r\n * @expose\r\n */\r\n BuilderPrototype[\"import\"] = function(json, filename) {\r\n var delim = '/';\r\n\r\n // Make sure to skip duplicate imports\r\n\r\n if (typeof filename === 'string') {\r\n\r\n if (ProtoBuf.Util.IS_NODE)\r\n filename = require(\"path\")['resolve'](filename);\r\n if (this.files[filename] === true)\r\n return this.reset();\r\n this.files[filename] = true;\r\n\r\n } else if (typeof filename === 'object') { // Object with root, file.\r\n\r\n var root = filename.root;\r\n if (ProtoBuf.Util.IS_NODE)\r\n root = require(\"path\")['resolve'](root);\r\n if (root.indexOf(\"\\\\\") >= 0 || filename.file.indexOf(\"\\\\\") >= 0)\r\n delim = '\\\\';\r\n var fname;\r\n if (ProtoBuf.Util.IS_NODE)\r\n fname = require(\"path\")['join'](root, filename.file);\r\n else\r\n fname = root + delim + filename.file;\r\n if (this.files[fname] === true)\r\n return this.reset();\r\n this.files[fname] = true;\r\n }\r\n\r\n // Import imports\r\n\r\n if (json['imports'] && json['imports'].length > 0) {\r\n var importRoot,\r\n resetRoot = false;\r\n\r\n if (typeof filename === 'object') { // If an import root is specified, override\r\n\r\n this.importRoot = filename[\"root\"]; resetRoot = true; // ... and reset afterwards\r\n importRoot = this.importRoot;\r\n filename = filename[\"file\"];\r\n if (importRoot.indexOf(\"\\\\\") >= 0 || filename.indexOf(\"\\\\\") >= 0)\r\n delim = '\\\\';\r\n\r\n } else if (typeof filename === 'string') {\r\n\r\n if (this.importRoot) // If import root is overridden, use it\r\n importRoot = this.importRoot;\r\n else { // Otherwise compute from filename\r\n if (filename.indexOf(\"/\") >= 0) { // Unix\r\n importRoot = filename.replace(/\\/[^\\/]*$/, \"\");\r\n if (/* /file.proto */ importRoot === \"\")\r\n importRoot = \"/\";\r\n } else if (filename.indexOf(\"\\\\\") >= 0) { // Windows\r\n importRoot = filename.replace(/\\\\[^\\\\]*$/, \"\");\r\n delim = '\\\\';\r\n } else\r\n importRoot = \".\";\r\n }\r\n\r\n } else\r\n importRoot = null;\r\n\r\n for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned.\r\n * @returns {!ProtoBuf.Builder.Message|!Object.}\r\n * @throws {Error} If a type could not be resolved\r\n * @expose\r\n */\r\n BuilderPrototype.build = function(path) {\r\n this.reset();\r\n if (!this.resolved)\r\n this.resolveAll(),\r\n this.resolved = true,\r\n this.result = null; // Require re-build\r\n if (this.result === null) // (Re-)Build\r\n this.result = this.ns.build();\r\n if (!path)\r\n return this.result;\r\n var part = typeof path === 'string' ? path.split(\".\") : path,\r\n ptr = this.result; // Build namespace pointer (no hasChild etc.)\r\n for (var i=0; i=} contents Initial contents\r\n * @constructor\r\n */\r\n var Map = function(field, contents) {\r\n if (!field.map)\r\n throw Error(\"field is not a map\");\r\n\r\n /**\r\n * The field corresponding to this map.\r\n * @type {!ProtoBuf.Reflect.Field}\r\n */\r\n this.field = field;\r\n\r\n /**\r\n * Element instance corresponding to key type.\r\n * @type {!ProtoBuf.Reflect.Element}\r\n */\r\n this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);\r\n\r\n /**\r\n * Element instance corresponding to value type.\r\n * @type {!ProtoBuf.Reflect.Element}\r\n */\r\n this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);\r\n\r\n /**\r\n * Internal map: stores mapping of (string form of key) -> (key, value)\r\n * pair.\r\n *\r\n * We provide map semantics for arbitrary key types, but we build on top\r\n * of an Object, which has only string keys. In order to avoid the need\r\n * to convert a string key back to its native type in many situations,\r\n * we store the native key value alongside the value. Thus, we only need\r\n * a one-way mapping from a key type to its string form that guarantees\r\n * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1\r\n * === K2).\r\n *\r\n * @type {!Object}\r\n */\r\n this.map = {};\r\n\r\n /**\r\n * Returns the number of elements in the map.\r\n */\r\n Object.defineProperty(this, \"size\", {\r\n get: function() { return Object.keys(this.map).length; }\r\n });\r\n\r\n // Fill initial contents from a raw object.\r\n if (contents) {\r\n var keys = Object.keys(contents);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = this.keyElem.valueFromString(keys[i]);\r\n var val = this.valueElem.verifyValue(contents[keys[i]]);\r\n this.map[this.keyElem.valueToString(key)] =\r\n { key: key, value: val };\r\n }\r\n }\r\n };\r\n\r\n var MapPrototype = Map.prototype;\r\n\r\n /**\r\n * Helper: return an iterator over an array.\r\n * @param {!Array<*>} arr the array\r\n * @returns {!Object} an iterator\r\n * @inner\r\n */\r\n function arrayIterator(arr) {\r\n var idx = 0;\r\n return {\r\n next: function() {\r\n if (idx < arr.length)\r\n return { done: false, value: arr[idx++] };\r\n return { done: true };\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clears the map.\r\n */\r\n MapPrototype.clear = function() {\r\n this.map = {};\r\n };\r\n\r\n /**\r\n * Deletes a particular key from the map.\r\n * @returns {boolean} Whether any entry with this key was deleted.\r\n */\r\n MapPrototype[\"delete\"] = function(key) {\r\n var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n var hadKey = keyValue in this.map;\r\n delete this.map[keyValue];\r\n return hadKey;\r\n };\r\n\r\n /**\r\n * Returns an iterator over [key, value] pairs in the map.\r\n * @returns {Object} The iterator\r\n */\r\n MapPrototype.entries = function() {\r\n var entries = [];\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0, entry; i < strKeys.length; i++)\r\n entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);\r\n return arrayIterator(entries);\r\n };\r\n\r\n /**\r\n * Returns an iterator over keys in the map.\r\n * @returns {Object} The iterator\r\n */\r\n MapPrototype.keys = function() {\r\n var keys = [];\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0; i < strKeys.length; i++)\r\n keys.push(this.map[strKeys[i]].key);\r\n return arrayIterator(keys);\r\n };\r\n\r\n /**\r\n * Returns an iterator over values in the map.\r\n * @returns {!Object} The iterator\r\n */\r\n MapPrototype.values = function() {\r\n var values = [];\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0; i < strKeys.length; i++)\r\n values.push(this.map[strKeys[i]].value);\r\n return arrayIterator(values);\r\n };\r\n\r\n /**\r\n * Iterates over entries in the map, calling a function on each.\r\n * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments.\r\n * @param {Object=} thisArg The `this` value for the callback\r\n */\r\n MapPrototype.forEach = function(cb, thisArg) {\r\n var strKeys = Object.keys(this.map);\r\n for (var i = 0, entry; i < strKeys.length; i++)\r\n cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);\r\n };\r\n\r\n /**\r\n * Sets a key in the map to the given value.\r\n * @param {*} key The key\r\n * @param {*} value The value\r\n * @returns {!ProtoBuf.Map} The map instance\r\n */\r\n MapPrototype.set = function(key, value) {\r\n var keyValue = this.keyElem.verifyValue(key);\r\n var valValue = this.valueElem.verifyValue(value);\r\n this.map[this.keyElem.valueToString(keyValue)] =\r\n { key: keyValue, value: valValue };\r\n return this;\r\n };\r\n\r\n /**\r\n * Gets the value corresponding to a key in the map.\r\n * @param {*} key The key\r\n * @returns {*|undefined} The value, or `undefined` if key not present\r\n */\r\n MapPrototype.get = function(key) {\r\n var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n if (!(keyValue in this.map))\r\n return undefined;\r\n return this.map[keyValue].value;\r\n };\r\n\r\n /**\r\n * Determines whether the given key is present in the map.\r\n * @param {*} key The key\r\n * @returns {boolean} `true` if the key is present\r\n */\r\n MapPrototype.has = function(key) {\r\n var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n return (keyValue in this.map);\r\n };\r\n\r\n return Map;\r\n })(ProtoBuf, ProtoBuf.Reflect);\r\n\r\n\r\n /**\r\n * Constructs a new empty Builder.\r\n * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf\r\n * @return {!ProtoBuf.Builder} Builder\r\n * @expose\r\n */\r\n ProtoBuf.newBuilder = function(options) {\r\n options = options || {};\r\n if (typeof options['convertFieldsToCamelCase'] === 'undefined')\r\n options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;\r\n if (typeof options['populateAccessors'] === 'undefined')\r\n options['populateAccessors'] = ProtoBuf.populateAccessors;\r\n return new ProtoBuf.Builder(options);\r\n };\r\n\r\n /**\r\n * Loads a .json definition and returns the Builder.\r\n * @param {!*|string} json JSON definition\r\n * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r\n * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r\n * @return {ProtoBuf.Builder} Builder to create new messages\r\n * @throws {Error} If the definition cannot be parsed or built\r\n * @expose\r\n */\r\n ProtoBuf.loadJson = function(json, builder, filename) {\r\n if (typeof builder === 'string' || (builder && typeof builder[\"file\"] === 'string' && typeof builder[\"root\"] === 'string'))\r\n filename = builder,\r\n builder = null;\r\n if (!builder || typeof builder !== 'object')\r\n builder = ProtoBuf.newBuilder();\r\n if (typeof json === 'string')\r\n json = JSON.parse(json);\r\n builder[\"import\"](json, filename);\r\n builder.resolveAll();\r\n return builder;\r\n };\r\n\r\n /**\r\n * Loads a .json file and returns the Builder.\r\n * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with\r\n * an overridden 'root' path for all imported files.\r\n * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r\n * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r\n * file will be read synchronously and this function will return the Builder.\r\n * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r\n * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r\n * request has failed), else undefined\r\n * @expose\r\n */\r\n ProtoBuf.loadJsonFile = function(filename, callback, builder) {\r\n if (callback && typeof callback === 'object')\r\n builder = callback,\r\n callback = null;\r\n else if (!callback || typeof callback !== 'function')\r\n callback = null;\r\n if (callback)\r\n return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename[\"root\"]+\"/\"+filename[\"file\"], function(contents) {\r\n if (contents === null) {\r\n callback(Error(\"Failed to fetch file\"));\r\n return;\r\n }\r\n try {\r\n callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));\r\n } catch (e) {\r\n callback(e);\r\n }\r\n });\r\n var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename[\"root\"]+\"/\"+filename[\"file\"] : filename);\r\n return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);\r\n };\r\n\r\n return ProtoBuf;\r\n});\r\n","module.exports = require(\"protobufjs/dist/protobuf-light\").newBuilder({})['import']({\n \"package\": \"push_server.messages2\",\n \"syntax\": \"proto2\",\n \"options\": {\n \"objc_class_prefix\": \"AVIM\"\n },\n \"messages\": [\n {\n \"name\": \"JsonObjectMessage\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 1\n }\n ]\n },\n {\n \"name\": \"UnreadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"required\",\n \"type\": \"int32\",\n \"name\": \"unread\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentioned\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 9\n }\n ]\n },\n {\n \"name\": \"LogItem\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"msgId\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"ackAt\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"readAt\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 8\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"bin\",\n \"id\": 10\n }\n ]\n },\n {\n \"name\": \"DataCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"ids\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"msg\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"offline\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"SessionCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"ua\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"r\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"tag\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"deviceId\",\n \"id\": 7\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"sessionPeerIds\",\n \"id\": 8\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"onlineSessionPeerIds\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"st\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"stTtl\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"deviceToken\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"sp\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"detail\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastUnreadNotifTime\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastPatchTime\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"configBitmap\",\n \"id\": 19\n }\n ]\n },\n {\n \"name\": \"ErrorCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 1\n },\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"appCode\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"detail\",\n \"id\": 4\n }\n ]\n },\n {\n \"name\": \"DirectCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"msg\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"fromPeerId\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"offline\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"hasMore\",\n \"id\": 6\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"toPeerIds\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"r\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"id\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"dt\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"roomId\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"pushData\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"will\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 19\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 20\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 21\n }\n ]\n },\n {\n \"name\": \"AckCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"code\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"reason\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uid\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"fromts\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"tots\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"type\",\n \"id\": 9\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"ids\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"appCode\",\n \"id\": 11\n }\n ]\n },\n {\n \"name\": \"UnreadCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"UnreadTuple\",\n \"name\": \"convs\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"notifTime\",\n \"id\": 2\n }\n ]\n },\n {\n \"name\": \"ConvCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"m\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"unique\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cdate\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"initBy\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"sort\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"limit\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"skip\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"flag\",\n \"id\": 10\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"count\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"udate\",\n \"id\": 12\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 13\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 14\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 15\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"statusSub\",\n \"id\": 16\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"statusPub\",\n \"id\": 17\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"statusTTL\",\n \"id\": 18\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"uniqueId\",\n \"id\": 19\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"targetClientId\",\n \"id\": 20\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxReadTimestamp\",\n \"id\": 21\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxAckTimestamp\",\n \"id\": 22\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"queryAllMembers\",\n \"id\": 23\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"MaxReadTuple\",\n \"name\": \"maxReadTuples\",\n \"id\": 24\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"cids\",\n \"id\": 25\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"results\",\n \"id\": 100\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"where\",\n \"id\": 101\n },\n {\n \"rule\": \"optional\",\n \"type\": \"JsonObjectMessage\",\n \"name\": \"attr\",\n \"id\": 103\n }\n ]\n },\n {\n \"name\": \"RoomCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"roomId\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"s\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"n\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"transient\",\n \"id\": 5\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"roomPeerIds\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"byPeerId\",\n \"id\": 7\n }\n ]\n },\n {\n \"name\": \"LogsCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"l\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"limit\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"tt\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"tmid\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"checksum\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"stored\",\n \"id\": 9\n },\n {\n \"rule\": \"optional\",\n \"type\": \"QueryDirection\",\n \"name\": \"direction\",\n \"id\": 10,\n \"options\": {\n \"default\": \"OLD\"\n }\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"tIncluded\",\n \"id\": 11\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"ttIncluded\",\n \"id\": 12\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"LogItem\",\n \"name\": \"logs\",\n \"id\": 105\n }\n ],\n \"enums\": [\n {\n \"name\": \"QueryDirection\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"OLD\",\n \"id\": 1\n },\n {\n \"name\": \"NEW\",\n \"id\": 2\n }\n ]\n }\n ]\n },\n {\n \"name\": \"RcpCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"id\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"t\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"read\",\n \"id\": 4\n }\n ]\n },\n {\n \"name\": \"ReadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"required\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"MaxReadTuple\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"pid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxAckTimestamp\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"maxReadTimestamp\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"ReadCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"cids\",\n \"id\": 2\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"ReadTuple\",\n \"name\": \"convs\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"PresenceCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"StatusType\",\n \"name\": \"status\",\n \"id\": 1\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"sessionPeerIds\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"ReportCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"initiative\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"type\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 3\n }\n ]\n },\n {\n \"name\": \"PatchItem\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"cid\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"mid\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"timestamp\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"recall\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"data\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"patchTimestamp\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"from\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bytes\",\n \"name\": \"binaryMsg\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"bool\",\n \"name\": \"mentionAll\",\n \"id\": 9\n },\n {\n \"rule\": \"repeated\",\n \"type\": \"string\",\n \"name\": \"mentionPids\",\n \"id\": 10\n }\n ]\n },\n {\n \"name\": \"PatchCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"repeated\",\n \"type\": \"PatchItem\",\n \"name\": \"patches\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int64\",\n \"name\": \"lastPatchTime\",\n \"id\": 2\n }\n ]\n },\n {\n \"name\": \"GenericCommand\",\n \"syntax\": \"proto2\",\n \"fields\": [\n {\n \"rule\": \"optional\",\n \"type\": \"CommandType\",\n \"name\": \"cmd\",\n \"id\": 1\n },\n {\n \"rule\": \"optional\",\n \"type\": \"OpType\",\n \"name\": \"op\",\n \"id\": 2\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"appId\",\n \"id\": 3\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"peerId\",\n \"id\": 4\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"i\",\n \"id\": 5\n },\n {\n \"rule\": \"optional\",\n \"type\": \"string\",\n \"name\": \"installationId\",\n \"id\": 6\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"priority\",\n \"id\": 7\n },\n {\n \"rule\": \"optional\",\n \"type\": \"int32\",\n \"name\": \"service\",\n \"id\": 8\n },\n {\n \"rule\": \"optional\",\n \"type\": \"DataCommand\",\n \"name\": \"dataMessage\",\n \"id\": 101\n },\n {\n \"rule\": \"optional\",\n \"type\": \"SessionCommand\",\n \"name\": \"sessionMessage\",\n \"id\": 102\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ErrorCommand\",\n \"name\": \"errorMessage\",\n \"id\": 103\n },\n {\n \"rule\": \"optional\",\n \"type\": \"DirectCommand\",\n \"name\": \"directMessage\",\n \"id\": 104\n },\n {\n \"rule\": \"optional\",\n \"type\": \"AckCommand\",\n \"name\": \"ackMessage\",\n \"id\": 105\n },\n {\n \"rule\": \"optional\",\n \"type\": \"UnreadCommand\",\n \"name\": \"unreadMessage\",\n \"id\": 106\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ReadCommand\",\n \"name\": \"readMessage\",\n \"id\": 107\n },\n {\n \"rule\": \"optional\",\n \"type\": \"RcpCommand\",\n \"name\": \"rcpMessage\",\n \"id\": 108\n },\n {\n \"rule\": \"optional\",\n \"type\": \"LogsCommand\",\n \"name\": \"logsMessage\",\n \"id\": 109\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ConvCommand\",\n \"name\": \"convMessage\",\n \"id\": 110\n },\n {\n \"rule\": \"optional\",\n \"type\": \"RoomCommand\",\n \"name\": \"roomMessage\",\n \"id\": 111\n },\n {\n \"rule\": \"optional\",\n \"type\": \"PresenceCommand\",\n \"name\": \"presenceMessage\",\n \"id\": 112\n },\n {\n \"rule\": \"optional\",\n \"type\": \"ReportCommand\",\n \"name\": \"reportMessage\",\n \"id\": 113\n },\n {\n \"rule\": \"optional\",\n \"type\": \"PatchCommand\",\n \"name\": \"patchMessage\",\n \"id\": 114\n }\n ]\n }\n ],\n \"enums\": [\n {\n \"name\": \"CommandType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"session\",\n \"id\": 0\n },\n {\n \"name\": \"conv\",\n \"id\": 1\n },\n {\n \"name\": \"direct\",\n \"id\": 2\n },\n {\n \"name\": \"ack\",\n \"id\": 3\n },\n {\n \"name\": \"rcp\",\n \"id\": 4\n },\n {\n \"name\": \"unread\",\n \"id\": 5\n },\n {\n \"name\": \"logs\",\n \"id\": 6\n },\n {\n \"name\": \"error\",\n \"id\": 7\n },\n {\n \"name\": \"login\",\n \"id\": 8\n },\n {\n \"name\": \"data\",\n \"id\": 9\n },\n {\n \"name\": \"room\",\n \"id\": 10\n },\n {\n \"name\": \"read\",\n \"id\": 11\n },\n {\n \"name\": \"presence\",\n \"id\": 12\n },\n {\n \"name\": \"report\",\n \"id\": 13\n },\n {\n \"name\": \"echo\",\n \"id\": 14\n },\n {\n \"name\": \"loggedin\",\n \"id\": 15\n },\n {\n \"name\": \"logout\",\n \"id\": 16\n },\n {\n \"name\": \"loggedout\",\n \"id\": 17\n },\n {\n \"name\": \"patch\",\n \"id\": 18\n }\n ]\n },\n {\n \"name\": \"OpType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"open\",\n \"id\": 1\n },\n {\n \"name\": \"add\",\n \"id\": 2\n },\n {\n \"name\": \"remove\",\n \"id\": 3\n },\n {\n \"name\": \"close\",\n \"id\": 4\n },\n {\n \"name\": \"opened\",\n \"id\": 5\n },\n {\n \"name\": \"closed\",\n \"id\": 6\n },\n {\n \"name\": \"query\",\n \"id\": 7\n },\n {\n \"name\": \"query_result\",\n \"id\": 8\n },\n {\n \"name\": \"conflict\",\n \"id\": 9\n },\n {\n \"name\": \"added\",\n \"id\": 10\n },\n {\n \"name\": \"removed\",\n \"id\": 11\n },\n {\n \"name\": \"start\",\n \"id\": 30\n },\n {\n \"name\": \"started\",\n \"id\": 31\n },\n {\n \"name\": \"joined\",\n \"id\": 32\n },\n {\n \"name\": \"members_joined\",\n \"id\": 33\n },\n {\n \"name\": \"left\",\n \"id\": 39\n },\n {\n \"name\": \"members_left\",\n \"id\": 40\n },\n {\n \"name\": \"results\",\n \"id\": 42\n },\n {\n \"name\": \"count\",\n \"id\": 43\n },\n {\n \"name\": \"result\",\n \"id\": 44\n },\n {\n \"name\": \"update\",\n \"id\": 45\n },\n {\n \"name\": \"updated\",\n \"id\": 46\n },\n {\n \"name\": \"mute\",\n \"id\": 47\n },\n {\n \"name\": \"unmute\",\n \"id\": 48\n },\n {\n \"name\": \"status\",\n \"id\": 49\n },\n {\n \"name\": \"members\",\n \"id\": 50\n },\n {\n \"name\": \"max_read\",\n \"id\": 51\n },\n {\n \"name\": \"is_member\",\n \"id\": 52\n },\n {\n \"name\": \"join\",\n \"id\": 80\n },\n {\n \"name\": \"invite\",\n \"id\": 81\n },\n {\n \"name\": \"leave\",\n \"id\": 82\n },\n {\n \"name\": \"kick\",\n \"id\": 83\n },\n {\n \"name\": \"reject\",\n \"id\": 84\n },\n {\n \"name\": \"invited\",\n \"id\": 85\n },\n {\n \"name\": \"kicked\",\n \"id\": 86\n },\n {\n \"name\": \"upload\",\n \"id\": 100\n },\n {\n \"name\": \"uploaded\",\n \"id\": 101\n },\n {\n \"name\": \"modify\",\n \"id\": 150\n },\n {\n \"name\": \"modified\",\n \"id\": 151\n }\n ]\n },\n {\n \"name\": \"StatusType\",\n \"syntax\": \"proto2\",\n \"values\": [\n {\n \"name\": \"on\",\n \"id\": 1\n },\n {\n \"name\": \"off\",\n \"id\": 2\n }\n ]\n }\n ],\n \"isNamespace\": true\n}).build();\n","import messages from './message-compiled';\n\nconst {\n JsonObjectMessage,\n UnreadTuple,\n LogItem,\n DataCommand,\n SessionCommand,\n ErrorCommand,\n DirectCommand,\n AckCommand,\n UnreadCommand,\n ConvCommand,\n RoomCommand,\n LogsCommand,\n RcpCommand,\n ReadTuple,\n MaxReadTuple,\n ReadCommand,\n PresenceCommand,\n ReportCommand,\n GenericCommand,\n PatchCommand,\n PatchItem,\n CommandType,\n OpType,\n StatusType,\n} = messages.push_server.messages2;\n\nexport {\n JsonObjectMessage,\n UnreadTuple,\n LogItem,\n DataCommand,\n SessionCommand,\n ErrorCommand,\n DirectCommand,\n AckCommand,\n UnreadCommand,\n ConvCommand,\n RoomCommand,\n LogsCommand,\n RcpCommand,\n ReadTuple,\n MaxReadTuple,\n ReadCommand,\n PresenceCommand,\n ReportCommand,\n GenericCommand,\n PatchCommand,\n PatchItem,\n CommandType,\n OpType,\n StatusType,\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // In sloppy mode, unbound `this` refers to the global object, fallback to\n // Function constructor if we're in global strict mode. That is sadly a form\n // of indirect eval which violates Content Security Policy.\n (function() { return this })() || Function(\"return this\")()\n);\n","// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g = (function() { return this })() || Function(\"return this\")();\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n Object.getOwnPropertyNames(g).indexOf(\"regeneratorRuntime\") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = require(\"./runtime\");\n\nif (hadRuntime) {\n // Restore the original runtime.\n g.regeneratorRuntime = oldRuntime;\n} else {\n // Remove the global property added by runtime.js.\n try {\n delete g.regeneratorRuntime;\n } catch(e) {\n g.regeneratorRuntime = undefined;\n }\n}\n","module.exports = require(\"regenerator-runtime\");\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _assign = require(\"../core-js/object/assign\");\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _assign2.default || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _promise = require(\"../core-js/promise\");\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new _promise2.default(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return _promise2.default.resolve(value).then(function (value) {\n step(\"next\", value);\n }, function (err) {\n step(\"throw\", err);\n });\n }\n }\n\n return step(\"next\");\n });\n };\n};","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/es6.array.from');\nmodule.exports = require('../../modules/_core').Array.from;\n","module.exports = { \"default\": require(\"core-js/library/fn/array/from\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _from = require(\"../core-js/array/from\");\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return (0, _from2.default)(arr);\n }\n};","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar meta = require('./_meta');\nvar fails = require('./_fails');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar setToStringTag = require('./_set-to-string-tag');\nvar dP = require('./_object-dp').f;\nvar each = require('./_array-methods')(0);\nvar DESCRIPTORS = require('./_descriptors');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME, '_c');\n target._c = new Base();\n if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);\n });\n each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {\n anInstance(this, C, KEY);\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = this._c[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n });\n IS_WEAK || dP(C.prototype, 'size', {\n get: function () {\n return this._c.size;\n }\n });\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F, O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","var forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') });\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\nrequire('./_set-collection-of')('Set');\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\nrequire('./_set-collection-from')('Set');\n","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.set');\nrequire('../modules/es7.set.to-json');\nrequire('../modules/es7.set.of');\nrequire('../modules/es7.set.from');\nmodule.exports = require('../modules/_core').Set;\n","module.exports = { \"default\": require(\"core-js/library/fn/set\"), __esModule: true };","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object' && !isArray(obj)) {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n }\n\n if (!utils.isArray(val)) {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if (process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n config.method = config.method.toLowerCase();\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n","require('../../modules/es6.object.get-own-property-descriptor');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function getOwnPropertyDescriptor(it, key) {\n return $Object.getOwnPropertyDescriptor(it, key);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/get-own-property-descriptor\"), __esModule: true };","/*\n\n Javascript State Machine Library - https://github.com/jakesgordon/javascript-state-machine\n\n Copyright (c) 2012, 2013, 2014, 2015, Jake Gordon and contributors\n Released under the MIT license - https://github.com/jakesgordon/javascript-state-machine/blob/master/LICENSE\n\n*/\n\n(function () {\n\n var StateMachine = {\n\n //---------------------------------------------------------------------------\n\n VERSION: \"2.4.0\",\n\n //---------------------------------------------------------------------------\n\n Result: {\n SUCCEEDED: 1, // the event transitioned successfully from one state to another\n NOTRANSITION: 2, // the event was successfull but no state transition was necessary\n CANCELLED: 3, // the event was cancelled by the caller in a beforeEvent callback\n PENDING: 4 // the event is asynchronous and the caller is in control of when the transition occurs\n },\n\n Error: {\n INVALID_TRANSITION: 100, // caller tried to fire an event that was innapropriate in the current state\n PENDING_TRANSITION: 200, // caller tried to fire an event while an async transition was still pending\n INVALID_CALLBACK: 300 // caller provided callback function threw an exception\n },\n\n WILDCARD: '*',\n ASYNC: 'async',\n\n //---------------------------------------------------------------------------\n\n create: function(cfg, target) {\n\n var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial; // allow for a simple string, or an object with { state: 'foo', event: 'setup', defer: true|false }\n var terminal = cfg.terminal || cfg['final'];\n var fsm = target || cfg.target || {};\n var events = cfg.events || [];\n var callbacks = cfg.callbacks || {};\n var map = {}; // track state transitions allowed for an event { event: { from: [ to ] } }\n var transitions = {}; // track events allowed from a state { state: [ event ] }\n\n var add = function(e) {\n var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]); // allow 'wildcard' transition if 'from' is not specified\n map[e.name] = map[e.name] || {};\n for (var n = 0 ; n < from.length ; n++) {\n transitions[from[n]] = transitions[from[n]] || [];\n transitions[from[n]].push(e.name);\n\n map[e.name][from[n]] = e.to || from[n]; // allow no-op transition if 'to' is not specified\n }\n if (e.to)\n transitions[e.to] = transitions[e.to] || [];\n };\n\n if (initial) {\n initial.event = initial.event || 'startup';\n add({ name: initial.event, from: 'none', to: initial.state });\n }\n\n for(var n = 0 ; n < events.length ; n++)\n add(events[n]);\n\n for(var name in map) {\n if (map.hasOwnProperty(name))\n fsm[name] = StateMachine.buildEvent(name, map[name]);\n }\n\n for(var name in callbacks) {\n if (callbacks.hasOwnProperty(name))\n fsm[name] = callbacks[name]\n }\n\n fsm.current = 'none';\n fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); };\n fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }\n fsm.cannot = function(event) { return !this.can(event); };\n fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); };\n fsm.isFinished = function() { return this.is(terminal); };\n fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; }; // default behavior when something unexpected happens is to throw an exception, but caller can override this behavior if desired (see github issue #3 and #17)\n fsm.states = function() { return Object.keys(transitions).sort() };\n\n if (initial && !initial.defer)\n fsm[initial.event]();\n\n return fsm;\n\n },\n\n //===========================================================================\n\n doCallback: function(fsm, func, name, from, to, args) {\n if (func) {\n try {\n return func.apply(fsm, [name, from, to].concat(args));\n }\n catch(e) {\n return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, \"an exception occurred in a caller-provided callback function\", e);\n }\n }\n },\n\n beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); },\n afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); },\n leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); },\n enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); },\n changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); },\n\n beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); },\n afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); },\n leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); },\n enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); },\n\n beforeEvent: function(fsm, name, from, to, args) {\n if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) ||\n (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args)))\n return false;\n },\n\n afterEvent: function(fsm, name, from, to, args) {\n StateMachine.afterThisEvent(fsm, name, from, to, args);\n StateMachine.afterAnyEvent( fsm, name, from, to, args);\n },\n\n leaveState: function(fsm, name, from, to, args) {\n var specific = StateMachine.leaveThisState(fsm, name, from, to, args),\n general = StateMachine.leaveAnyState( fsm, name, from, to, args);\n if ((false === specific) || (false === general))\n return false;\n else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general))\n return StateMachine.ASYNC;\n },\n\n enterState: function(fsm, name, from, to, args) {\n StateMachine.enterThisState(fsm, name, from, to, args);\n StateMachine.enterAnyState( fsm, name, from, to, args);\n },\n\n //===========================================================================\n\n buildEvent: function(name, map) {\n return function() {\n\n var from = this.current;\n var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from;\n var args = Array.prototype.slice.call(arguments); // turn arguments into pure array\n\n if (this.transition)\n return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, \"event \" + name + \" inappropriate because previous transition did not complete\");\n\n if (this.cannot(name))\n return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, \"event \" + name + \" inappropriate in current state \" + this.current);\n\n if (false === StateMachine.beforeEvent(this, name, from, to, args))\n return StateMachine.Result.CANCELLED;\n\n if (from === to) {\n StateMachine.afterEvent(this, name, from, to, args);\n return StateMachine.Result.NOTRANSITION;\n }\n\n // prepare a transition method for use EITHER lower down, or by caller if they want an async transition (indicated by an ASYNC return value from leaveState)\n var fsm = this;\n this.transition = function() {\n fsm.transition = null; // this method should only ever be called once\n fsm.current = to;\n StateMachine.enterState( fsm, name, from, to, args);\n StateMachine.changeState(fsm, name, from, to, args);\n StateMachine.afterEvent( fsm, name, from, to, args);\n return StateMachine.Result.SUCCEEDED;\n };\n this.transition.cancel = function() { // provide a way for caller to cancel async transition if desired (issue #22)\n fsm.transition = null;\n StateMachine.afterEvent(fsm, name, from, to, args);\n }\n\n var leave = StateMachine.leaveState(this, name, from, to, args);\n if (false === leave) {\n this.transition = null;\n return StateMachine.Result.CANCELLED;\n }\n else if (StateMachine.ASYNC === leave) {\n return StateMachine.Result.PENDING;\n }\n else {\n if (this.transition) // need to check in case user manually called transition() but forgot to return StateMachine.ASYNC\n return this.transition();\n }\n\n };\n }\n\n }; // StateMachine\n\n //===========================================================================\n\n //======\n // NODE\n //======\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = StateMachine;\n }\n exports.StateMachine = StateMachine;\n }\n //============\n // AMD/REQUIRE\n //============\n else if (typeof define === 'function' && define.amd) {\n define(function(require) { return StateMachine; });\n }\n //========\n // BROWSER\n //========\n else if (typeof window !== 'undefined') {\n window.StateMachine = StateMachine;\n }\n //===========\n // WEB WORKER\n //===========\n else if (typeof self !== 'undefined') {\n self.StateMachine = StateMachine;\n }\n\n}());\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\nrequire('./_set-collection-of')('WeakMap');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\nrequire('./_set-collection-from')('WeakMap');\n","require('../modules/es6.object.to-string');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.weak-map');\nrequire('../modules/es7.weak-map.of');\nrequire('../modules/es7.weak-map.from');\nmodule.exports = require('../modules/_core').WeakMap;\n","module.exports = { \"default\": require(\"core-js/library/fn/weak-map\"), __esModule: true };","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","/* eslint-disable */\nexport default typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {};\n","import d from 'debug';\n\nconst EXPIRED = Symbol('expired');\nconst debug = d('LC:Expirable');\nexport default class Expirable {\n constructor(value, ttl) {\n this._value = value;\n if (typeof ttl === 'number') {\n this.expiredAt = Date.now() + ttl;\n }\n }\n\n get value() {\n const expired = this.expiredAt && this.expiredAt < Date.now();\n if (expired) debug(`expired: ${this._value}`);\n return expired ? EXPIRED : this._value;\n }\n}\nExpirable.EXPIRED = EXPIRED;\n","import d from 'debug';\nimport Expirable from './expirable';\n\nconst debug = d('LC:Cache');\nexport default class Cache {\n constructor(name = 'anonymous') {\n this.name = name;\n this._map = {};\n }\n\n get(key) {\n const cache = this._map[key];\n if (cache) {\n const value = cache.value;\n if (value !== Expirable.EXPIRED) {\n debug('[%s] hit: %s %O', this.name, key, value);\n return value;\n }\n delete this._map[key];\n }\n debug(`[${this.name}] missed: ${key}`);\n return null;\n }\n\n set(key, value, ttl) {\n debug('[%s] set: %s %O %d', this.name, key, value, ttl);\n this._map[key] = new Expirable(value, ttl);\n }\n}\n","import isPlainObject from 'lodash/isPlainObject';\nimport global from './global';\n\nexport { global };\n\nexport const tryAll = (promiseConstructors) => {\n const promise = new Promise(promiseConstructors[0]);\n if (promiseConstructors.length === 1) {\n return promise;\n }\n return promise.catch(() => tryAll(promiseConstructors.slice(1)));\n};\n\nexport const tap = interceptor => value => ((interceptor(value), value));\n\nexport { default as Expirable } from './expirable';\nexport { default as Cache } from './cache';\n\nexport const decodeDate = (date) => {\n if (!date) return date;\n if (typeof date === 'string') {\n return new Date(date);\n }\n if (date.__type === 'Date' && date.iso) {\n return new Date(date.iso);\n }\n // Long\n if (typeof date.toNumber === 'function') {\n return new Date(date.toNumber());\n }\n return date;\n};\n\nexport const keyRemap = (keymap, obj) =>\n Object.keys(obj).reduce((newObj, key) => {\n const newKey = keymap[key] || key;\n return Object.assign(newObj, {\n [newKey]: obj[key],\n });\n }, {});\n\nexport const isIE10 = (\n global.navigator &&\n global.navigator.userAgent &&\n global.navigator.userAgent.indexOf('MSIE 10.') !== -1\n);\n\n/* eslint-disable no-proto */\nexport const getStaticProperty = (klass, property) =>\n (klass[property] || (klass.__proto__ ? getStaticProperty(klass.__proto__, property) : undefined));\n/* eslint-enable no-proto */\n\nexport const union = (a, b) => Array.from(new Set([...a, ...b]));\nexport const difference = (a, b) => Array.from(\n (bSet => new Set(a.filter(x => !bSet.has(x))))(new Set(b)),\n);\n\nconst map = new WeakMap();\n\n// protected property helper\nexport const internal = (object) => {\n if (!map.has(object)) {\n map.set(object, {});\n }\n return map.get(object);\n};\n\n// debug utility\nconst removeNull = (obj) => {\n if (!isPlainObject(obj)) return obj;\n const object = Object.assign({}, obj);\n // eslint-disable-next-line no-restricted-syntax\n for (const prop in object) {\n if ({}.hasOwnProperty.call(object, prop)) {\n const value = object[prop];\n if (value === null) {\n delete object[prop];\n } else {\n object[prop] = removeNull(value);\n }\n }\n }\n return object;\n};\nexport const trim = message => removeNull(JSON.parse(JSON.stringify(message)));\n\nexport const ensureArray = (target) => {\n if (Array.isArray(target)) {\n return target;\n }\n if (target === undefined || target === null) {\n return [];\n }\n return [target];\n};\n\nexport const setValue = (target, key, value) => {\n // '.' is not allowed in Class keys, escaping is not in concern now.\n const segs = key.split('.');\n const lastSeg = segs.pop();\n let currentTarget = target;\n segs.forEach((seg) => {\n if (currentTarget[seg] === undefined) currentTarget[seg] = {};\n currentTarget = currentTarget[seg];\n });\n currentTarget[lastSeg] = value;\n return target;\n};\n\n// eslint-disable-next-line no-undef\nexport const isWeapp = typeof wx === 'object' && typeof wx.connectSocket === 'function';\n\n// throttle decorator\nexport const throttle = wait => (target, property, descriptor) => {\n const callback = descriptor.value;\n // very naive, internal use only\n if (callback.length) {\n throw new Error('throttled function should not accept any arguments');\n }\n return {\n ...descriptor,\n value() {\n let {\n throttleMeta,\n } = internal(this);\n if (!throttleMeta) {\n throttleMeta = {};\n internal(this).throttleMeta = throttleMeta;\n }\n let {\n [property]: propertyMeta,\n } = throttleMeta;\n if (!propertyMeta) {\n propertyMeta = {};\n throttleMeta[property] = propertyMeta;\n }\n const {\n previouseTimestamp = 0,\n timeout,\n } = propertyMeta;\n const now = Date.now();\n const remainingTime = wait - (now - previouseTimestamp);\n if (remainingTime <= 0) {\n throttleMeta[property].previouseTimestamp = now;\n callback.apply(this);\n } else if (!timeout) {\n propertyMeta.timeout = setTimeout(() => {\n propertyMeta.previouseTimestamp = Date.now();\n delete propertyMeta.timeout;\n callback.apply(this);\n }, remainingTime);\n }\n },\n };\n};\n","import { global } from '../utils';\n\nconst WebSocket = global.WebSocket || global.MozWebSocket;\nexport default WebSocket;\n","// WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface.\n\nimport d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport StateMachine from 'javascript-state-machine';\n\nimport WebSocket from 'ws';\n\nimport { tryAll, global } from './utils';\n\nconst debug = d('LC:WebSocketPlus');\n\nconst HEARTBEAT_TIME = 180000;\nconst TIMEOUT_TIME = 380000;\n\nconst DEFAULT_RETRY_STRATEGY = attempt => Math.min(1000 * (2 ** attempt), 300000);\n\nconst requireConnected = (target, name, descriptor) =>\n Object.assign({}, descriptor, {\n value: function requireConnectedWrapper(...args) {\n if (!this.is('connected')) {\n const currentState = this.current;\n console.warn(`${name} should not be called when the connection is ${currentState}`);\n if (this.is('disconnected') || this.is('reconnecting')) {\n console.warn('disconnect and reconnect event should be handled to avoid such calls.');\n }\n throw new Error('Connection unavailable');\n }\n return descriptor.value.call(this, ...args);\n },\n });\n\nclass WebSocketPlus extends EventEmitter {\n constructor(getUrls, protocol) {\n if (typeof WebSocket === 'undefined') {\n throw new Error('WebSocket is undefined. Polyfill is required in this runtime.');\n }\n super();\n if (typeof getUrls !== 'function') {\n this._getUrls = () => Promise.resolve(getUrls);\n } else {\n this._getUrls = getUrls;\n }\n this._protocol = protocol;\n this.init();\n this._createWs(this._getUrls, this._protocol).then(\n () => {\n this.__postponeTimeoutTimer = this._postponeTimeoutTimer.bind(this);\n if (global.addEventListener) {\n this.__pause = () => this.pause();\n this.__resume = () => this.resume();\n global.addEventListener('offline', this.__pause);\n global.addEventListener('online', this.__resume);\n }\n this.open();\n },\n ).catch(this.throw.bind(this));\n }\n\n _createWs(getUrls, protocol) {\n return getUrls().then((wsUrls) => {\n let urls = wsUrls;\n if (!(urls instanceof Array)) {\n urls = [urls];\n }\n return tryAll(\n urls.map(url => (resolve, reject) => {\n debug(`connect [${url}] ${protocol}`);\n const ws = protocol ? new WebSocket(\n url, protocol,\n ) : new WebSocket(url);\n ws.binaryType = this.binaryType || 'arraybuffer';\n ws.onopen = () => resolve(ws);\n ws.onclose = (error) => {\n if (error instanceof Error) {\n return reject(error);\n }\n // in browser, error event is useless\n return reject(new Error(`Failed to connect [${url}]`));\n };\n ws.onerror = ws.onclose;\n }),\n ).then((ws) => {\n this._ws = ws;\n this._ws.onclose = this._handleClose.bind(this);\n this._ws.onmessage = this._handleMessage.bind(this);\n return ws;\n });\n });\n }\n _destroyWs() {\n const ws = this._ws;\n if (!ws) return;\n ws.onopen = null;\n ws.onclose = null;\n ws.onerror = null;\n ws.onmessage = null;\n this._ws = null;\n ws.close();\n }\n\n // eslint-disable-next-line class-methods-use-this\n onbeforeevent(event, from, to, ...payload) {\n debug(`${event}: ${from} -> ${to}`, ...payload);\n }\n onopen() {\n this.emit('open');\n }\n onconnected() {\n this._startConnectionKeeper();\n }\n onleaveconnected(event, from, to) {\n this._stopConnectionKeeper();\n this._destroyWs();\n if (to === 'offline' || to === 'disconnected') {\n this.emit('disconnect');\n }\n }\n onpause() {\n this.emit('offline');\n }\n onbeforeresume() {\n this.emit('online');\n }\n onreconnect() {\n this.emit('reconnect');\n }\n ondisconnected(event, from, to, attempt = 0) {\n const delay = DEFAULT_RETRY_STRATEGY.call(null, attempt);\n debug(`schedule attempt=${attempt} delay=${delay}`);\n this.emit('schedule', attempt, delay);\n if (this.__scheduledRetry) {\n clearTimeout(this.__scheduledRetry);\n }\n this.__scheduledRetry = setTimeout(() => {\n if (this.is('disconnected')) {\n this.retry(attempt);\n }\n }, delay);\n }\n onretry(event, from, to, attempt = 0) {\n this.emit('retry', attempt);\n this._createWs(this._getUrls, this._protocol).then(\n () => (this.can('reconnect') ? this.reconnect() : this._destroyWs()),\n () => this.can('fail') && this.fail(attempt + 1),\n );\n }\n onerror(event, from, to, error) {\n this.emit('error', error);\n }\n onclose() {\n if (global.removeEventListener) {\n if (this.__pause) global.removeEventListener('offline', this.__pause);\n if (this.__resume) global.removeEventListener('online', this.__resume);\n }\n }\n\n // jsdoc-ignore-start\n @requireConnected\n // jsdoc-ignore-end\n _ping() {\n debug('ping');\n try {\n this.ping();\n } catch (error) {\n console.warn(`websocket ping error: ${error.message}`);\n }\n }\n ping() {\n if (this._ws.ping) {\n this._ws.ping();\n } else {\n console.warn(`The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.`);\n }\n }\n\n _postponeTimeoutTimer() {\n debug('_postponeTimeoutTimer');\n this._clearTimeoutTimers();\n this._timeoutTimer = setTimeout(() => {\n debug('timeout');\n this.disconnect();\n }, TIMEOUT_TIME);\n }\n _clearTimeoutTimers() {\n if (this._timeoutTimer) {\n clearTimeout(this._timeoutTimer);\n }\n }\n _startConnectionKeeper() {\n debug('start connection keeper');\n this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME);\n const addListener = this._ws.addListener || this._ws.addEventListener;\n addListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n this._postponeTimeoutTimer();\n }\n _stopConnectionKeeper() {\n debug('stop connection keeper');\n // websockets/ws#489\n const removeListener = this._ws.removeListener || this._ws.removeEventListener;\n removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n this._clearTimeoutTimers();\n if (this._heartbeatTimer) {\n clearInterval(this._heartbeatTimer);\n }\n }\n\n _handleClose(event) {\n debug(`ws closed [${event.code}] ${event.reason}`);\n // socket closed manually, ignore close event.\n if (this.isFinished()) return;\n this.handleClose(event);\n }\n handleClose() {\n // reconnect\n this.disconnect();\n }\n\n // jsdoc-ignore-start\n @requireConnected\n // jsdoc-ignore-end\n send(data) {\n debug('send', data);\n this._ws.send(data);\n }\n\n _handleMessage(event) {\n debug('message', event.data);\n this.handleMessage(event.data);\n }\n handleMessage(message) {\n this.emit('message', message);\n }\n}\n\nStateMachine.create({\n target: WebSocketPlus.prototype,\n initial: {\n state: 'initialized',\n event: 'init',\n defer: true,\n },\n terminal: 'closed',\n events: [{\n name: 'open',\n from: 'initialized',\n to: 'connected',\n }, {\n name: 'disconnect',\n from: 'connected',\n to: 'disconnected',\n }, {\n name: 'retry',\n from: 'disconnected',\n to: 'reconnecting',\n }, {\n name: 'fail',\n from: 'reconnecting',\n to: 'disconnected',\n }, {\n name: 'reconnect',\n from: 'reconnecting',\n to: 'connected',\n }, {\n name: 'pause',\n from: ['connected', 'disconnected', 'reconnecting'],\n to: 'offline',\n }, {\n }, {\n name: 'resume',\n from: 'offline',\n to: 'disconnected',\n }, {\n name: 'close',\n from: ['connected', 'disconnected', 'reconnecting', 'offline'],\n to: 'closed',\n }, {\n name: 'throw',\n from: '*',\n to: 'error',\n }],\n});\n\nexport default WebSocketPlus;\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","require('../../modules/es6.object.freeze');\nmodule.exports = require('../../modules/_core').Object.freeze;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/freeze\"), __esModule: true };","export const error = Object.freeze({\n 1000: {\n name: 'CLOSE_NORMAL',\n },\n 1006: {\n name: 'CLOSE_ABNORMAL',\n },\n 4100: {\n name: 'APP_NOT_AVAILABLE',\n message: 'App not exists or realtime message service is disabled.',\n },\n 4103: {\n name: 'INVALID_LOGIN',\n message: 'Malformed clientId.',\n },\n 4105: {\n name: 'SESSION_REQUIRED',\n message: 'Message sent before session opened. ',\n },\n 4107: {\n name: 'READ_TIMEOUT',\n },\n 4108: {\n name: 'LOGIN_TIMEOUT',\n },\n 4109: {\n name: 'FRAME_TOO_LONG',\n },\n 4110: {\n name: 'INVALID_ORIGIN',\n message: 'Access denied by domain whitelist.',\n },\n 4111: {\n name: 'SESSION_CONFLICT',\n },\n 4112: {\n name: 'SESSION_TOKEN_EXPIRED',\n },\n 4200: {\n name: 'INTERNAL_ERROR',\n message: 'Internal error, please contact LeanCloud for support.',\n },\n 4201: {\n name: 'SEND_MESSAGE_TIMEOUT',\n },\n 4302: {\n name: 'CONVERSATION_SIGNATURE_FAILED',\n },\n 4303: {\n name: 'CONVERSATION_NOT_FOUND',\n },\n 4304: {\n name: 'CONVERSATION_FULL',\n },\n 4305: {\n name: 'CONVERSATION_REJECTED_BY_APP',\n },\n 4306: {\n name: 'CONVERSATION_UPDATE_FAILED',\n },\n 4307: {\n name: 'CONVERSATION_READ_ONLY',\n },\n 4308: {\n name: 'CONVERSATION_NOT_ALLOWED',\n },\n 4401: {\n name: 'INVALID_MESSAGING_TARGET',\n },\n 4402: {\n name: 'MESSAGE_REJECTED_BY_APP',\n },\n});\n\nexport const ErrorCode = Object.freeze(\n Object.keys(error).reduce((result, code) => Object.assign(result, {\n [error[code].name]: Number(code),\n }), {}),\n);\n\nexport const createError = (errorMessage) => {\n const {\n code, reason, appCode, detail,\n } = errorMessage;\n let message = reason || detail;\n if (!message && error[code]) {\n message = error[code].message || error[code].name;\n }\n if (!message) {\n message = `Unknow Error: ${code}`;\n }\n const err = new Error(message);\n return Object.assign(err, {\n code, appCode, detail,\n });\n};\n","import d from 'debug';\nimport WebSocketPlus from './websocket-plus';\nimport { createError } from './error';\nimport { GenericCommand, CommandType } from '../proto/message';\nimport { trim, isWeapp } from './utils';\n\nconst debug = d('LC:Connection');\n\nconst COMMAND_TIMEOUT = 20000;\n\nexport default class Connection extends WebSocketPlus {\n constructor(getUrl, { format, version }) {\n debug('initializing Connection');\n const protocolString = `lc.${format}.${version}`;\n if (!isWeapp) {\n super(getUrl, protocolString);\n } else {\n super(getUrl().then(urls => urls.map(url =>\n `${url}${url.indexOf('?') === -1 ? '?' : '&'}subprotocol=${encodeURIComponent(protocolString)}`,\n )));\n }\n this._protocalFormat = format;\n this._commands = {};\n this._serialId = 0;\n }\n\n send(command, waitingForRespond = true) {\n let serialId;\n if (waitingForRespond) {\n this._serialId += 1;\n serialId = this._serialId;\n command.i = serialId; // eslint-disable-line no-param-reassign\n }\n debug('↑ %O sent', trim(command));\n\n let message;\n if (this._protocalFormat === 'proto2base64') {\n message = command.toBase64();\n } else if (command.toArrayBuffer) {\n message = command.toArrayBuffer();\n }\n if (!message) {\n throw new TypeError(`${command} is not a GenericCommand`);\n }\n\n super.send(message);\n\n if (!waitingForRespond) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n this._commands[serialId] = {\n resolve,\n reject,\n timeout: setTimeout(\n () => {\n if (this._commands[serialId]) {\n debug('✗ %O timeout', trim(command));\n reject(new Error('Command Timeout.'));\n delete this._commands[serialId];\n }\n },\n COMMAND_TIMEOUT,\n ),\n };\n });\n }\n\n handleMessage(msg) {\n let message;\n try {\n message = GenericCommand.decode(msg);\n debug('↓ %O received', trim(message));\n } catch (e) {\n console.warn('Decode message failed', msg);\n }\n this.emit('allmessage', message);\n const serialId = message.i;\n if (serialId) {\n if (this._commands[serialId]) {\n clearTimeout(this._commands[serialId].timeout);\n if (message.cmd === CommandType.error) {\n this\n ._commands[serialId]\n .reject(createError(message.errorMessage));\n } else {\n this\n ._commands[serialId]\n .resolve(message);\n }\n delete this._commands[serialId];\n } else {\n console.warn(`Unexpected command received with serialId [${serialId}],\n which have timed out or never been requested.`);\n }\n } else if (message.cmd === CommandType.error) {\n this.emit('error', createError(message.errorMessage));\n } else {\n this.emit('message', message);\n }\n }\n\n ping() {\n return this.send(new GenericCommand({\n cmd: CommandType.echo,\n })).catch(error => debug('ping failed:', error));\n }\n}\n","/* eslint-disable max-len */\n\n/**\n * 插件接口\n *\n *

\n * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类:\n *

\n * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。\n * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。\n *

\n * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。\n * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。\n * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。\n *

\n * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。\n *\n * @interface Plugin\n * @since 3.1.0\n */\n\n/* eslint-enable max-len */\n\n/**\n * 插件名称,用于在日志中显示异常的插件\n *\n * @name Plugin.name\n * @type string\n */\n\n/**\n * 插件注册的消息类型\n *\n * @name Plugin.messageClasses\n * @type AVMessage[]\n */\n\n/**\n * 在 Realtime 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Realtime 实例。\n *\n * @name Plugin.onRealtimeCreate\n * @type Function\n */\n\n/**\n * 在 IMClient 实例化后对其进行修饰。\n *

\n * 接受一个参数为 IMClient 实例。\n *\n * @name Plugin.onIMClientCreate\n * @type Function\n */\n\n/**\n * 在 Conversation 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Conversation 实例。\n * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook,\n * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。\n *\n * @name Plugin.onConversationCreate\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之前,对原始消息进行修改。\n *

\n * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。\n * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。\n *\n * @name Plugin.beforeMessageParse\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之后,对消息实例进行修改。\n *

\n * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。\n * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.afterMessageParse\n * @type Function\n */\n\n/**\n * 在收到消息之后,派发消息之前,控制是否派发这条消息。\n *

\n * 接受参数为 message 与 conversation。\n * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。\n * 如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.beforeMessageDispatch\n * @type Function\n * @since 3.4.0\n */\n\nimport { ensureArray, tap } from './utils';\n\nconst checkType = middleware => (param) => {\n const { constructor } = param;\n return Promise.resolve(param).then(middleware).then(tap((result) => {\n if (result === undefined || result === null) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns ${result} while a ${param.constructor.name} expected.`);\n }\n if (!(result instanceof constructor)) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns a ${result.constructor.name} while a ${param.constructor.name} expected.`);\n }\n return 0;\n }));\n};\n\nexport const applyDecorators = (decorators, target) => {\n if (decorators) {\n decorators.forEach((decorator) => {\n try {\n decorator(target);\n } catch (error) {\n if (decorator._pluginName) {\n error.message += `[${decorator._pluginName}]`;\n }\n throw error;\n }\n });\n }\n};\n\nexport const applyMiddlewares = middlewares => target =>\n ensureArray(middlewares).reduce(\n (previousPromise, middleware) => previousPromise\n .then(checkType(middleware))\n .catch((error) => {\n if (middleware._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${middleware._pluginName}]`;\n }\n throw error;\n }),\n Promise.resolve(target),\n );\n\nexport const applyDispatcher = (dispatchers, payload) =>\n ensureArray(dispatchers).reduce(\n (resultPromise, dispatcher) => resultPromise.then(shouldDispatch =>\n (shouldDispatch === false ? false : dispatcher(...payload)),\n ).catch((error) => {\n if (dispatcher._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${dispatcher._pluginName}]`;\n }\n throw error;\n }), Promise.resolve(true),\n );\n","import d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport axios from 'axios';\nimport Connection from './connection';\nimport { ErrorCode, createError } from './error';\nimport { tap, Cache, trim, internal, ensureArray, isWeapp } from './utils';\nimport { applyDecorators, applyDispatcher } from './plugin';\n\nconst debug = d('LC:Realtime');\n\nconst routerCache = new Cache('push-router');\n\nexport default class Realtime extends EventEmitter {\n /**\n * @extends EventEmitter\n * @param {Object} options\n * @param {String} options.appId\n * @param {String} options.appKey (since 4.0.0)\n * @param {String} [options.region='cn'] 节点 id\n * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式)\n * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。\n * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序)\n * @param {Boolean} [options.ssl=true] 使用 wss 进行连接\n * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0)\n */\n constructor(options) {\n debug('initializing Realtime');\n super();\n if (typeof options.appId !== 'string') {\n throw new TypeError(`appId [${options.appId}] is not a string`);\n }\n if (typeof options.appKey !== 'string') {\n throw new TypeError(`appKey [${options.appKey}] is not a string`);\n }\n this._options = Object.assign({\n appId: undefined,\n appKey: undefined,\n region: 'cn',\n pushOfflineMessages: false,\n noBinary: isWeapp,\n ssl: true,\n server: process.env.SERVER,\n }, options);\n this._cache = new Cache('endpoints');\n internal(this).clients = new Set();\n this._plugins = [\n ...ensureArray(Realtime.__preRegisteredPlugins),\n ...ensureArray(options.plugins),\n ].reduce(\n (result, plugin) => {\n // eslint-disable-next-line no-restricted-syntax\n for (const hook in plugin) {\n if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') {\n if (plugin.name) {\n ensureArray(plugin[hook]).forEach((value) => {\n // eslint-disable-next-line no-param-reassign\n value._pluginName = plugin.name;\n });\n }\n // eslint-disable-next-line no-param-reassign\n result[hook] = ensureArray(result[hook]).concat(plugin[hook]);\n }\n }\n return result;\n },\n {},\n );\n // onRealtimeCreate hook\n applyDecorators(this._plugins.onRealtimeCreate, this);\n }\n\n async _request({\n method,\n version = '1.1',\n path,\n query,\n headers,\n data = {},\n }) {\n const { appId, region } = this._options;\n const { api } = await this.constructor._fetchAppRouter({ appId, region });\n const url = `https://${api}/${version}${path}`;\n return axios(url, {\n method,\n params: query,\n headers: {\n 'X-LC-Id': this._options.appId,\n 'X-LC-Key': this._options.appKey,\n ...headers,\n },\n data,\n }).then(response => response.data);\n }\n\n _open() {\n if (this._openPromise) return this._openPromise;\n\n let format = 'protobuf2';\n if (this._options.noBinary) {\n // 不发送 binary data,fallback to base64 string\n format = 'proto2base64';\n }\n let version = 3;\n if (this._options.pushOfflineMessages) {\n // 不推送离线消息,而是发送对话的未读通知\n version = 1;\n }\n const protocol = {\n format,\n version,\n };\n this._openPromise = new Promise((resolve, reject) => {\n debug('No connection established, create a new one.');\n const connection = new Connection(\n () => this._getEndpoints(this._options),\n protocol,\n );\n connection.on('open', () => resolve(connection));\n connection.on('error', reject);\n connection.on('message', this._dispatchCommand.bind(this));\n /**\n * 连接断开。\n * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。\n * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。\n * @event Realtime#disconnect\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event Realtime#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n */\n /**\n * 正在尝试重新连接\n * @event Realtime#retry\n * @param {Number} attempt 尝试重连的次数\n */\n /**\n * 连接恢复正常。\n * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素\n * @event Realtime#reconnect\n */\n\n /**\n * 客户端连接断开\n * @event IMClient#disconnect\n * @see Realtime#event:disconnect\n * @since 3.2.0\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event IMClient#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n * @since 3.2.0\n */\n /**\n * 正在尝试重新连接\n * @event IMClient#retry\n * @param {Number} attempt 尝试重连的次数\n * @since 3.2.0\n */\n\n /**\n * 客户端进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event Realtime#offline\n * @since 3.4.0\n */\n /**\n * 客户端恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event Realtime#online\n * @since 3.4.0\n */\n /**\n * 进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event IMClient#offline\n * @since 3.4.0\n */\n /**\n * 恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event IMClient#online\n * @since 3.4.0\n */\n\n // event proxy\n ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(\n event => connection.on(event, (...payload) => {\n debug(`${event} event emitted. %O`, payload);\n this.emit(event, ...payload);\n if (event !== 'reconnect') {\n internal(this).clients.forEach((client) => {\n client.emit(event, ...payload);\n });\n }\n }),\n );\n // override handleClose\n connection.handleClose = function handleClose(event) {\n const isFatal = [\n ErrorCode.APP_NOT_AVAILABLE,\n ErrorCode.INVALID_LOGIN,\n ErrorCode.INVALID_ORIGIN,\n ].some(errorCode => errorCode === event.code);\n if (isFatal) {\n // in these cases, SDK should throw.\n this.throw(createError(event));\n } else {\n // reconnect\n this.disconnect();\n }\n };\n internal(this).connection = connection;\n });\n\n return this._openPromise;\n }\n\n _getEndpoints(options) {\n return Promise.resolve(\n this._cache.get('endpoints') ||\n this\n .constructor\n ._fetchEndpointsInfo(options)\n .then(\n tap(info => this._cache.set('endpoints', info, info.ttl * 1000)),\n ),\n ).then((info) => {\n debug('endpoint info: %O', info);\n return [info.server, info.secondary];\n });\n }\n\n static _fetchAppRouter({ appId, region }) {\n debug('fetch router');\n switch (region) {\n case 'cn': {\n const cachedRouter = routerCache.get(appId);\n if (cachedRouter) {\n return Promise.resolve(cachedRouter);\n }\n return axios\n .get('https://app-router.leancloud.cn/2/route', {\n params: {\n appId,\n },\n timeout: 20000,\n })\n .then(\n res => res.data,\n )\n .then(tap(debug))\n .then(\n ({\n rtm_router_server: rtmRouter,\n api_server: api,\n ttl = 3600,\n }) => {\n if (!rtmRouter) {\n throw new Error('rtm router not exists');\n }\n const router = {\n rtmRouter,\n api,\n };\n routerCache.set(appId, router, ttl * 1000);\n return router;\n },\n )\n .catch(() => {\n const id = appId.slice(0, 8).toLowerCase();\n return {\n rtmRouter: `${id}.rtm.lncld.net`,\n api: `${id}.api.lncld.net`,\n };\n });\n }\n case 'us':\n return Promise.resolve({\n rtmRouter: 'router-a0-push.leancloud.cn',\n api: 'us-api.leancloud.cn',\n });\n default:\n throw new Error(`Region [${region}] is not supported.`);\n }\n }\n\n static _fetchEndpointsInfo({ appId, region, ssl, server }) {\n debug('fetch endpoint info');\n return this._fetchAppRouter({ appId, region })\n .then(tap(debug))\n .then(({ rtmRouter }) =>\n axios.get(`https://${rtmRouter}/v1/route`, {\n params: {\n appId,\n secure: ssl,\n features: isWeapp ? 'wechat' : undefined,\n server,\n _t: Date.now(),\n },\n timeout: 20000,\n }).then(\n res => res.data,\n ).then(tap(debug)),\n );\n }\n\n _close() {\n if (this._openPromise) {\n this._openPromise.then(connection => connection.close());\n }\n delete this._openPromise;\n }\n\n /**\n * 手动进行重连。\n * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。\n * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。\n */\n retry() {\n const connection = internal(this).connection;\n if (!connection) {\n throw new Error('no connection established');\n }\n if (connection.cannot('retry')) {\n throw new Error(\n `retrying not allowed when not disconnected. the connection is now ${connection.current}`,\n );\n }\n return connection.retry();\n }\n /**\n * 暂停,使 SDK 进入离线状态。\n * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。\n * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。\n *\n * @since 3.4.0\n * @see Realtime#event:offline\n */\n pause() {\n // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。\n // 因此不像 retry,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('pause')) connection.pause();\n }\n /**\n * 恢复在线状态。\n * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。\n *\n * @since 3.4.0\n * @see Realtime#event:online\n */\n resume() {\n // 与 pause 一样,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('resume')) connection.resume();\n }\n\n _register(client) {\n internal(this).clients.add(client);\n }\n\n _deregister(client) {\n internal(this).clients.delete(client);\n if (internal(this).clients.size === 0) {\n this._close();\n }\n }\n\n _dispatchCommand(command) {\n return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this])\n .then((shouldDispatch) => {\n // no plugin handled this command\n if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim(command));\n return false;\n });\n }\n}\n"],"names":["defined","toInteger","aFunction","isObject","require$$0","document","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","core","global","ctx","hide","cof","IObject","min","toIObject","toLength","toAbsoluteIndex","uid","IE_PROTO","has","$keys","enumBugKeys","getKeys","PROTOTYPE","dPs","create","descriptor","setToStringTag","toObject","$iterCreate","getPrototypeOf","LIBRARY","Iterators","redefine","$export","step","addToUnscopables","TAG","ITERATOR","classof","getIterFn","isArrayIter","call","process","invoke","cel","html","Promise","isNode","newPromiseCapability","SPECIES","DESCRIPTORS","TypeError","newPromiseCapabilityModule","perform","anInstance","require$$3","speciesConstructor","require$$4","require$$5","require$$6","promiseResolve","require$$7","forOf","wksExt","gOPS","pIE","gOPN","toString","gOPD","$GOPD","$DP","gOPNExt","wks","shared","ObjectProto","USE_NATIVE","$fails","_create","enumKeys","wksDefine","isArray","_iterator","_symbol","Storage","getItem","key","wx","getStorageSync","setItem","value","setStorageSync","removeItem","clear","clearStorageSync","_defineProperty","_typeof2","$Object","_setPrototypeOf","$JSON","hasOwnProperty","Commons","CustomEventTarget","EventWrapper","FormData","_entries","append","name","uri","push","set","entry","get","delete","filter","entries","find","getAll","some","keys","map","values","UNSENT","OPENED","HEADERS_RECEIVED","LOADING","DONE","REQUEST_EVENTS","successCallback","response","status","statusCode","statusText","text","data","responseText","readyState","dispatchEvent","type","XMLHttpRequest","_headers","abort","Error","getAllResponseHeaders","console","warn","getResponseHeader","overrideMimeType","open","method","url","async","_method","_url","setRequestHeader","header","toLowerCase","send","blobs","length","restData","reduce","result","assign","uploadFile","filePath","formData","success","bind","fail","error","request","toUpperCase","EventTarget","CONNECTING","OPEN","CLOSING","CLOSED","EVENTS","instance","errorHandler","event","message","_readyState","errMsg","WebSocket","protocal","_protocal","onSocketOpen","onSocketError","onSocketMessage","origin","ports","source","onSocketClose","code","reason","wasClean","connectSocket","setTimeout","close","closeSocket","sendSocketMessage","polyfill","target","window","polyfills","localStorage","Object","navigator","k","e","define","require","this","newBuilder","build","messages","push_server","messages2","JsonObjectMessage","UnreadTuple","LogItem","DataCommand","SessionCommand","ErrorCommand","DirectCommand","AckCommand","UnreadCommand","ConvCommand","RoomCommand","LogsCommand","RcpCommand","ReadTuple","MaxReadTuple","ReadCommand","PresenceCommand","ReportCommand","GenericCommand","PatchCommand","PatchItem","CommandType","OpType","StatusType","_assign","_promise","$defineProperty","createProperty","_from","redefineAll","validate","$iterDefine","setSpecies","asc","fails","meta","strong","from","d","ms","fn","thisArg","wrap","args","Array","arguments","i","apply","prototype","val","isArrayBuffer","isFormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isUndefined","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","str","replace","isStandardBrowserEnv","product","forEach","obj","l","merge","assignValue","extend","a","b","isBuffer","normalizeHeaderName","headers","normalizedName","utils","processHeader","enhanceError","config","createError","settle","resolve","reject","validateStatus","encode","encodeURIComponent","buildURL","params","paramsSerializer","serializedParams","parts","serialize","parseValue","v","toISOString","join","indexOf","parseHeaders","parsed","split","parser","line","substr","standardBrowserEnv","msie","test","userAgent","urlParsingNode","createElement","originURL","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","isURLSameOrigin","requestURL","nonStandardBrowserEnv","chars","E","btoa","input","String","output","block","charCode","idx","charCodeAt","write","expires","path","domain","secure","cookie","Date","toGMTString","read","match","RegExp","decodeURIComponent","remove","now","xhrAdapter","dispatchXhrRequest","requestData","requestHeaders","loadEvent","xDomain","env","NODE_ENV","XDomainRequest","onprogress","handleProgress","ontimeout","handleTimeout","auth","username","password","Authorization","timeout","handleLoad","responseURL","responseHeaders","responseData","responseType","onerror","handleError","cookies","xsrfValue","withCredentials","xsrfCookieName","undefined","xsrfHeaderName","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","onCanceled","cancel","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","getDefaultAdapter","adapter","defaults","transformRequest","transformResponse","JSON","parse","maxContentLength","common","forEachMethodNoData","forEachMethodWithData","InterceptorManager","handlers","use","fulfilled","rejected","eject","id","forEachHandler","h","transformData","fns","transform","isCancel","__CANCEL__","throwIfCancellationRequested","throwIfRequested","dispatchRequest","cleanHeaderConfig","onAdapterResolution","onAdapterRejection","isAbsoluteURL","combineURLs","baseURL","relativeURL","Axios","instanceConfig","interceptors","chain","unshiftRequestInterceptors","interceptor","unshift","pushResponseInterceptors","shift","Cancel","CancelToken","executor","resolvePromise","promiseExecutor","token","c","spread","callback","arr","createInstance","defaultConfig","context","axios","all","promises","$getOwnPropertyDescriptor","createArrayMethod","$has","weak","freeGlobal","Symbol","root","objectProto","symToStringTag","nativeObjectToString","getRawTag","objectToString","overArg","isObjectLike","baseGetTag","getPrototype","EXPIRED","debug","Expirable","ttl","_value","expiredAt","expired","Cache","_map","cache","tryAll","promiseConstructors","catch","slice","tap","isIE10","internal","object","removeNull","isPlainObject","prop","ensureArray","isWeapp","MozWebSocket","HEARTBEAT_TIME","TIMEOUT_TIME","DEFAULT_RETRY_STRATEGY","Math","attempt","requireConnected","requireConnectedWrapper","is","currentState","current","WebSocketPlus","getUrls","_getUrls","_protocol","init","_createWs","__postponeTimeoutTimer","_postponeTimeoutTimer","__pause","pause","__resume","resume","throw","wsUrls","urls","ws","binaryType","onopen","onclose","_ws","_handleClose","onmessage","_handleMessage","_destroyWs","onbeforeevent","to","payload","emit","onconnected","_startConnectionKeeper","onleaveconnected","_stopConnectionKeeper","onpause","onbeforeresume","onreconnect","ondisconnected","delay","__scheduledRetry","clearTimeout","retry","onretry","can","reconnect","removeEventListener","_ping","ping","_clearTimeoutTimers","_timeoutTimer","disconnect","_heartbeatTimer","setInterval","addListener","removeListener","clearInterval","isFinished","handleClose","handleMessage","EventEmitter","StateMachine","initial","state","defer","terminal","events","ErrorCode","Number","errorMessage","appCode","detail","err","COMMAND_TIMEOUT","Connection","getUrl","format","version","protocolString","_protocalFormat","_commands","_serialId","command","waitingForRespond","serialId","toBase64","toArrayBuffer","msg","decode","cmd","echo","applyDecorators","decorators","decorator","_pluginName","applyDispatcher","dispatchers","resultPromise","dispatcher","shouldDispatch","routerCache","Realtime","options","appId","appKey","_options","region","pushOfflineMessages","noBinary","ssl","server","SERVER","_cache","clients","_plugins","__preRegisteredPlugins","plugins","plugin","hook","concat","onRealtimeCreate","_request","query","constructor","_fetchAppRouter","api","_open","_openPromise","connection","_getEndpoints","on","_dispatchCommand","client","isFatal","APP_NOT_AVAILABLE","INVALID_LOGIN","INVALID_ORIGIN","errorCode","_fetchEndpointsInfo","info","secondary","cachedRouter","res","rtmRouter","rtm_router_server","api_server","router","features","_t","_close","cannot","_register","add","_deregister","size","beforeCommandDispatch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;AACA,KAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AACrB,KAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AACvB,eAAc,GAAG,UAAU,EAAE,EAAE;GAC7B,OAAO,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;EAC1D;;CCLD;AACA,aAAc,GAAG,UAAU,EAAE,EAAE;GAC7B,IAAI,EAAE,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAC;GACpE,OAAO,EAAE,CAAC;EACX;;CCFD;;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BAEDyI,+BAAUnB,QAAQ;CAChBnJ,aAAS,IAAT,EAAegI,OAAf,CAAuBuC,GAAvB,CAA2BpB,MAA3B;CACD;;sBAEDqB,mCAAYrB,QAAQ;CAClBnJ,aAAS,IAAT,EAAegI,OAAf,CAAuB/gB,MAAvB,CAA8BkiB,MAA9B;CACA,QAAInJ,SAAS,IAAT,EAAegI,OAAf,CAAuByC,IAAvB,KAAgC,CAApC,EAAuC;CACrC,WAAKL,MAAL;CACD;CACF;;sBAEDlB,6CAAiBjD,SAAS;CACxB,WAAOa,gBAAgB,KAAKmB,QAAL,CAAcyC,qBAA9B,EAAqD,CAACzE,OAAD,EAAU,IAAV,CAArD,EACJlM,IADI,CACC,UAACmN,cAAD,EAAoB;CACxB;CACA,UAAIA,cAAJ,EAAoB,OAAOjI,MAAM,wCAAN,EAAgDlN,OAAKkU,OAAL,CAAhD,CAAP;CACpB,aAAO,KAAP;CACD,KALI,CAAP;CAMD;;;GAjXmCtB;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/realtime.browser.js b/dist/realtime.browser.js new file mode 100644 index 000000000..9bd2d5544 --- /dev/null +++ b/dist/realtime.browser.js @@ -0,0 +1,24756 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define('leancloud-realtime', ['exports'], factory) : + (factory((global.AV = global.AV || {}))); +}(this, (function (exports) { 'use strict'; + + var define = undefined; + var require = require || function(id) {throw new Error('Unexpected required ' + id)}; + + + + var process = (window && window.process) || {}; + process.env = process.env || {}; + + var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function commonjsRequire () { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); + } + + function unwrapExports (x) { + return x && x.__esModule ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + // 7.1.4 ToInteger + var ceil = Math.ceil; + var floor = Math.floor; + var _toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + + // 7.2.1 RequireObjectCoercible(argument) + var _defined = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; + }; + + // true -> String#at + // false -> String#codePointAt + var _stringAt = function (TO_STRING) { + return function (that, pos) { + var s = String(_defined(that)); + var i = _toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + + var _library = true; + + var _global = createCommonjsModule(function (module) { + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); + if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + }); + + var _core = createCommonjsModule(function (module) { + var core = module.exports = { version: '2.5.1' }; + if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + }); + + var _aFunction = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; + }; + + // optional / simple context binding + + var _ctx = function (fn, that, length) { + _aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; + }; + + var _isObject = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + + var _anObject = function (it) { + if (!_isObject(it)) throw TypeError(it + ' is not an object!'); + return it; + }; + + var _fails = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } + }; + + // Thank's IE8 for his funny defineProperty + var _descriptors = !_fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; + }); + + var document$1 = _global.document; + // typeof document.createElement is 'object' in old IE + var is = _isObject(document$1) && _isObject(document$1.createElement); + var _domCreate = function (it) { + return is ? document$1.createElement(it) : {}; + }; + + var _ie8DomDefine = !_descriptors && !_fails(function () { + return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; + }); + + // 7.1.1 ToPrimitive(input [, PreferredType]) + + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + var _toPrimitive = function (it, S) { + if (!_isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); + }; + + var dP = Object.defineProperty; + + var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { + _anObject(O); + P = _toPrimitive(P, true); + _anObject(Attributes); + if (_ie8DomDefine) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; + }; + + var _objectDp = { + f: f + }; + + var _propertyDesc = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; + }; + + var _hide = _descriptors ? function (object, key, value) { + return _objectDp.f(object, key, _propertyDesc(1, value)); + } : function (object, key, value) { + object[key] = value; + return object; + }; + + var PROTOTYPE = 'prototype'; + + var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && key in exports) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? _ctx(out, _global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out); + } + } + }; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + var _export = $export; + + var _redefine = _hide; + + var hasOwnProperty = {}.hasOwnProperty; + var _has = function (it, key) { + return hasOwnProperty.call(it, key); + }; + + var _iterators = {}; + + var toString = {}.toString; + + var _cof = function (it) { + return toString.call(it).slice(8, -1); + }; + + // fallback for non-array-like ES3 and non-enumerable old V8 strings + + // eslint-disable-next-line no-prototype-builtins + var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return _cof(it) == 'String' ? it.split('') : Object(it); + }; + + // to indexed object, toObject with fallback for non-array-like ES3 strings + + + var _toIobject = function (it) { + return _iobject(_defined(it)); + }; + + // 7.1.15 ToLength + + var min = Math.min; + var _toLength = function (it) { + return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + + var max = Math.max; + var min$1 = Math.min; + var _toAbsoluteIndex = function (index, length) { + index = _toInteger(index); + return index < 0 ? max(index + length, 0) : min$1(index, length); + }; + + // false -> Array#indexOf + // true -> Array#includes + + + + var _arrayIncludes = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = _toIobject($this); + var length = _toLength(O.length); + var index = _toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; + + var SHARED = '__core-js_shared__'; + var store = _global[SHARED] || (_global[SHARED] = {}); + var _shared = function (key) { + return store[key] || (store[key] = {}); + }; + + var id = 0; + var px = Math.random(); + var _uid = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + + var shared = _shared('keys'); + + var _sharedKey = function (key) { + return shared[key] || (shared[key] = _uid(key)); + }; + + var arrayIndexOf = _arrayIncludes(false); + var IE_PROTO$1 = _sharedKey('IE_PROTO'); + + var _objectKeysInternal = function (object, names) { + var O = _toIobject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO$1) _has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (_has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; + + // IE 8- don't enum bug keys + var _enumBugKeys = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' + ).split(','); + + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + + + + var _objectKeys = Object.keys || function keys(O) { + return _objectKeysInternal(O, _enumBugKeys); + }; + + var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) { + _anObject(O); + var keys = _objectKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]); + return O; + }; + + var document$2 = _global.document; + var _html = document$2 && document$2.documentElement; + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + + + + var IE_PROTO = _sharedKey('IE_PROTO'); + var Empty = function () { /* empty */ }; + var PROTOTYPE$1 = 'prototype'; + + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = _domCreate('iframe'); + var i = _enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + _html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]]; + return createDict(); + }; + + var _objectCreate = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE$1] = _anObject(O); + result = new Empty(); + Empty[PROTOTYPE$1] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : _objectDps(result, Properties); + }; + + var _wks = createCommonjsModule(function (module) { + var store = _shared('wks'); + + var Symbol = _global.Symbol; + var USE_SYMBOL = typeof Symbol == 'function'; + + var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name)); + }; + + $exports.store = store; + }); + + var def = _objectDp.f; + + var TAG = _wks('toStringTag'); + + var _setToStringTag = function (it, tag, stat) { + if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); + }; + + var IteratorPrototype = {}; + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + _hide(IteratorPrototype, _wks('iterator'), function () { return this; }); + + var _iterCreate = function (Constructor, NAME, next) { + Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) }); + _setToStringTag(Constructor, NAME + ' Iterator'); + }; + + // 7.1.13 ToObject(argument) + + var _toObject = function (it) { + return Object(_defined(it)); + }; + + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + + + var IE_PROTO$2 = _sharedKey('IE_PROTO'); + var ObjectProto = Object.prototype; + + var _objectGpo = Object.getPrototypeOf || function (O) { + O = _toObject(O); + if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }; + + var ITERATOR = _wks('iterator'); + var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` + var FF_ITERATOR = '@@iterator'; + var KEYS = 'keys'; + var VALUES = 'values'; + + var returnThis = function () { return this; }; + + var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + _iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = _objectGpo($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + _setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!_library && !_has(IteratorPrototype, ITERATOR)) _hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + _hide(proto, ITERATOR, $default); + } + // Plug for library + _iterators[NAME] = $default; + _iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) _redefine(proto, key, methods[key]); + } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; + + var $at = _stringAt(true); + + // 21.1.3.27 String.prototype[@@iterator]() + _iterDefine(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; + }); + + var _addToUnscopables = function () { /* empty */ }; + + var _iterStep = function (done, value) { + return { value: value, done: !!done }; + }; + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) { + this._t = _toIobject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return _iterStep(1); + } + if (kind == 'keys') return _iterStep(0, index); + if (kind == 'values') return _iterStep(0, O[index]); + return _iterStep(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + _iterators.Arguments = _iterators.Array; + + _addToUnscopables('keys'); + _addToUnscopables('values'); + _addToUnscopables('entries'); + + var TO_STRING_TAG = _wks('toStringTag'); + + var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + + 'TextTrackList,TouchList').split(','); + + for (var i = 0; i < DOMIterables.length; i++) { + var NAME = DOMIterables[i]; + var Collection = _global[NAME]; + var proto = Collection && Collection.prototype; + if (proto && !proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME); + _iterators[NAME] = _iterators.Array; + } + + // getting tag from 19.1.3.6 Object.prototype.toString() + + var TAG$1 = _wks('toStringTag'); + // ES3 wrong here + var ARG = _cof(function () { return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } + }; + + var _classof = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T + // builtinTag case + : ARG ? _cof(O) + // ES3 arguments fallback + : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + + var _anInstance = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; + }; + + // call something on iterator step with safe closing on error + + var _iterCall = function (iterator, fn, value, entries) { + try { + return entries ? fn(_anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) _anObject(ret.call(iterator)); + throw e; + } + }; + + // check on default Array iterator + + var ITERATOR$1 = _wks('iterator'); + var ArrayProto = Array.prototype; + + var _isArrayIter = function (it) { + return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$1] === it); + }; + + var ITERATOR$2 = _wks('iterator'); + + var core_getIteratorMethod = _core.getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR$2] + || it['@@iterator'] + || _iterators[_classof(it)]; + }; + + var _forOf = createCommonjsModule(function (module) { + var BREAK = {}; + var RETURN = {}; + var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable); + var f = _ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) { + result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = _iterCall(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } + }; + exports.BREAK = BREAK; + exports.RETURN = RETURN; + }); + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + + + var SPECIES = _wks('species'); + var _speciesConstructor = function (O, D) { + var C = _anObject(O).constructor; + var S; + return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S); + }; + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + var _invoke = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + + var process$2 = _global.process; + var setTask = _global.setImmediate; + var clearTask = _global.clearImmediate; + var MessageChannel = _global.MessageChannel; + var Dispatch = _global.Dispatch; + var counter = 0; + var queue = {}; + var ONREADYSTATECHANGE = 'onreadystatechange'; + var defer; + var channel; + var port; + var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listener = function (event) { + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + _invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (_cof(process$2) == 'process') { + defer = function (id) { + process$2.nextTick(_ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(_ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = _ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) { + defer = function (id) { + _global.postMessage(id + '', '*'); + }; + _global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in _domCreate('script')) { + defer = function (id) { + _html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () { + _html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(_ctx(run, id, 1), 0); + }; + } + } + var _task = { + set: setTask, + clear: clearTask + }; + + var macrotask = _task.set; + var Observer = _global.MutationObserver || _global.WebKitMutationObserver; + var process$3 = _global.process; + var Promise$1 = _global.Promise; + var isNode$1 = _cof(process$3) == 'process'; + + var _microtask = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode$1 && (parent = process$3.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode$1) { + notify = function () { + process$3.nextTick(flush); + }; + // browsers with MutationObserver + } else if (Observer) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise$1 && Promise$1.resolve) { + var promise = Promise$1.resolve(); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(_global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; + }; + + // 25.4.1.5 NewPromiseCapability(C) + + + function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = _aFunction(resolve); + this.reject = _aFunction(reject); + } + + var f$1 = function (C) { + return new PromiseCapability(C); + }; + + var _newPromiseCapability = { + f: f$1 + }; + + var _perform = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } + }; + + var _promiseResolve = function (C, x) { + _anObject(C); + if (_isObject(x) && x.constructor === C) return x; + var promiseCapability = _newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; + }; + + var _redefineAll = function (target, src, safe) { + for (var key in src) { + if (safe && target[key]) target[key] = src[key]; + else _hide(target, key, src[key]); + } return target; + }; + + var SPECIES$1 = _wks('species'); + + var _setSpecies = function (KEY) { + var C = typeof _core[KEY] == 'function' ? _core[KEY] : _global[KEY]; + if (_descriptors && C && !C[SPECIES$1]) _objectDp.f(C, SPECIES$1, { + configurable: true, + get: function () { return this; } + }); + }; + + var ITERATOR$3 = _wks('iterator'); + var SAFE_CLOSING = false; + + try { + var riter = [7][ITERATOR$3](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); + } catch (e) { /* empty */ } + + var _iterDetect = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR$3](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR$3] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; + }; + + var task = _task.set; + var microtask = _microtask(); + + + + var PROMISE = 'Promise'; + var TypeError$1 = _global.TypeError; + var process$1 = _global.process; + var $Promise = _global[PROMISE]; + var isNode = _classof(process$1) == 'process'; + var empty = function () { /* empty */ }; + var Internal; + var newGenericPromiseCapability; + var OwnPromiseCapability; + var Wrapper; + var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f; + + var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch (e) { /* empty */ } + }(); + + // helpers + var isThenable = function (it) { + var then; + return _isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); + if (domain) domain.exit(); + } + if (result === reaction.promise) { + reject(TypeError$1('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); + }; + var onUnhandled = function (promise) { + task.call(_global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = _perform(function () { + if (isNode) { + process$1.emit('unhandledRejection', value, promise); + } else if (handler = _global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = _global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); + }; + var isUnhandled = function (promise) { + if (promise._h == 1) return false; + var chain = promise._a || promise._c; + var i = 0; + var reaction; + while (chain.length > i) { + reaction = chain[i++]; + if (reaction.fail || !isUnhandled(reaction.promise)) return false; + } return true; + }; + var onHandleUnhandled = function (promise) { + task.call(_global, function () { + var handler; + if (isNode) { + process$1.emit('rejectionHandled', promise); + } else if (handler = _global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); + }; + var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); + }; + var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError$1("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } + }; + + // constructor polyfill + if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + _anInstance(this, $Promise, PROMISE, '_h'); + _aFunction(executor); + Internal.call(this); + try { + executor(_ctx($resolve, this, 1), _ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = _redefineAll($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(_speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process$1.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = _ctx($resolve, promise, 1); + this.reject = _ctx($reject, promise, 1); + }; + _newPromiseCapability.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; + } + + _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Promise: $Promise }); + _setToStringTag($Promise, PROMISE); + _setSpecies(PROMISE); + Wrapper = _core[PROMISE]; + + // statics + _export(_export.S + _export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + _export(_export.S + _export.F * (_library || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return _promiseResolve(_library && this === Wrapper ? $Promise : this, x); + } + }); + _export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) { + $Promise.all(iter)['catch'](empty); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = _perform(function () { + var values = []; + var index = 0; + var remaining = 1; + _forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = _perform(function () { + _forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } + }); + + _export(_export.P + _export.R, 'Promise', { 'finally': function (onFinally) { + var C = _speciesConstructor(this, _core.Promise || _global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return _promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return _promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); + } }); + + // https://github.com/tc39/proposal-promise-try + + + + + _export(_export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = _newPromiseCapability.f(this); + var result = _perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; + } }); + + var promise$1 = _core.Promise; + + var promise = createCommonjsModule(function (module) { + module.exports = { "default": promise$1, __esModule: true }; + }); + + var _Promise = unwrapExports(promise); + + var long_1 = createCommonjsModule(function (module) { + /* + Copyright 2013 Daniel Wirtz + Copyright 2009 The Closure Library Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS-IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license long.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/long.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined([], factory); + /* CommonJS */ else if (typeof commonjsRequire === 'function' && 'object' === "object" && module && module["exports"]) + module["exports"] = factory(); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["Long"] = factory(); + + })(commonjsGlobal, function() { + "use strict"; + + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @constructor + */ + function Long(low, high, unsigned) { + + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; + } + + // The internal representation of a long is the two given signed, 32-bit values. + // We use 32-bit pieces because these are the size of integers on which + // Javascript performs bit-operations. For operations like addition and + // multiplication, we split each number into 16 bit pieces, which can easily be + // multiplied within Javascript's floating-point representation without overflow + // or change in sign. + // + // In the algorithms below, we frequently reduce the negative case to the + // positive case by negating the input(s) and then post-processing the result. + // Note that we must ALWAYS check specially whether those values are MIN_VALUE + // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + // a positive number, it overflows back into a negative). Not handling this + // case would often result in infinite recursion. + // + // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* + // methods on which they depend. + + /** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ + Long.prototype.__isLong__; + + Object.defineProperty(Long.prototype, "__isLong__", { + value: true, + enumerable: false, + configurable: false + }); + + /** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + + /** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ + Long.isLong = isLong; + + /** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ + var INT_CACHE = {}; + + /** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ + var UINT_CACHE = {}; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = (0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = (-128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + + /** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromInt = fromInt; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromNumber(value, unsigned) { + if (isNaN(value) || !isFinite(value)) + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } + if (value < 0) + return fromNumber(-value, unsigned).neg(); + return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromNumber = fromNumber; + + /** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBits = fromBits; + + /** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ + var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) + + /** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ + function fromString(str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + radix = unsigned, + unsigned = false; + } else { + unsigned = !! unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 8)); + + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + + /** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ + Long.fromString = fromString; + + /** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @returns {!Long} + * @inner + */ + function fromValue(val) { + if (val /* is compatible */ instanceof Long) + return val; + if (typeof val === 'number') + return fromNumber(val); + if (typeof val === 'string') + return fromString(val); + // Throws for non-objects, converts non-instanceof Long: + return fromBits(val.low, val.high, val.unsigned); + } + + /** + * Converts the specified value to a Long. + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value + * @returns {!Long} + */ + Long.fromValue = fromValue; + + // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be + // no runtime penalty for these. + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_16_DBL = 1 << 16; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_24_DBL = 1 << 24; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + + /** + * @type {!Long} + * @const + * @inner + */ + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + + /** + * @type {!Long} + * @inner + */ + var ZERO = fromInt(0); + + /** + * Signed zero. + * @type {!Long} + */ + Long.ZERO = ZERO; + + /** + * @type {!Long} + * @inner + */ + var UZERO = fromInt(0, true); + + /** + * Unsigned zero. + * @type {!Long} + */ + Long.UZERO = UZERO; + + /** + * @type {!Long} + * @inner + */ + var ONE = fromInt(1); + + /** + * Signed one. + * @type {!Long} + */ + Long.ONE = ONE; + + /** + * @type {!Long} + * @inner + */ + var UONE = fromInt(1, true); + + /** + * Unsigned one. + * @type {!Long} + */ + Long.UONE = UONE; + + /** + * @type {!Long} + * @inner + */ + var NEG_ONE = fromInt(-1); + + /** + * Signed negative one. + * @type {!Long} + */ + Long.NEG_ONE = NEG_ONE; + + /** + * @type {!Long} + * @inner + */ + var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false); + + /** + * Maximum signed value. + * @type {!Long} + */ + Long.MAX_VALUE = MAX_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true); + + /** + * Maximum unsigned value. + * @type {!Long} + */ + Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MIN_VALUE = fromBits(0, 0x80000000|0, false); + + /** + * Minimum signed value. + * @type {!Long} + */ + Long.MIN_VALUE = MIN_VALUE; + + /** + * @alias Long.prototype + * @inner + */ + var LongPrototype = Long.prototype; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @returns {number} + */ + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @returns {number} + */ + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + + /** + * Converts the Long to a string written in the specified radix. + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { // Unsigned Longs are never negative + if (this.eq(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else + return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; + var result = ''; + while (true) { + var remDiv = rem.div(radixToPower), + intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, + digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) + return digits + result; + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + + /** + * Gets the high 32 bits as a signed integer. + * @returns {number} Signed high bits + */ + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + + /** + * Gets the high 32 bits as an unsigned integer. + * @returns {number} Unsigned high bits + */ + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + + /** + * Gets the low 32 bits as a signed integer. + * @returns {number} Signed low bits + */ + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + + /** + * Gets the low 32 bits as an unsigned integer. + * @returns {number} Unsigned low bits + */ + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + * @returns {number} + */ + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) // Unsigned Longs are never negative + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) != 0) + break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + + /** + * Tests if this Long's value equals zero. + * @returns {boolean} + */ + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + + /** + * Tests if this Long's value is negative. + * @returns {boolean} + */ + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + + /** + * Tests if this Long's value is positive. + * @returns {boolean} + */ + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + + /** + * Tests if this Long's value is odd. + * @returns {boolean} + */ + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + + /** + * Tests if this Long's value is even. + * @returns {boolean} + */ + LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; + }; + + /** + * Tests if this Long's value equals the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.equals = function equals(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + + /** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.eq = LongPrototype.equals; + + /** + * Tests if this Long's value differs from the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.notEquals = function notEquals(other) { + return !this.eq(/* validates */ other); + }; + + /** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.neq = LongPrototype.notEquals; + + /** + * Tests if this Long's value is less than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThan = function lessThan(other) { + return this.comp(/* validates */ other) < 0; + }; + + /** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lt = LongPrototype.lessThan; + + /** + * Tests if this Long's value is less than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(/* validates */ other) <= 0; + }; + + /** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.lte = LongPrototype.lessThanOrEqual; + + /** + * Tests if this Long's value is greater than the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(/* validates */ other) > 0; + }; + + /** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.gt = LongPrototype.greaterThan; + + /** + * Tests if this Long's value is greater than or equal the specified's. + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(/* validates */ other) >= 0; + }; + + /** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|string} other Other value + * @returns {boolean} + */ + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + + /** + * Compares this Long's value with the specified's. + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.compare = function compare(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1; + }; + + /** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.comp = LongPrototype.compare; + + /** + * Negates this Long's value. + * @returns {!Long} Negated Long + */ + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) + return MIN_VALUE; + return this.not().add(ONE); + }; + + /** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ + LongPrototype.neg = LongPrototype.negate; + + /** + * Returns the sum of this and the specified Long. + * @param {!Long|number|string} addend Addend + * @returns {!Long} Sum + */ + LongPrototype.add = function add(addend) { + if (!isLong(addend)) + addend = fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xFFFF; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 + b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the difference of this and the specified Long. + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) + subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + + /** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.sub = LongPrototype.subtract; + + /** + * Returns the product of this and the specified Long. + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) + return ZERO; + if (!isLong(multiplier)) + multiplier = fromValue(multiplier); + if (multiplier.isZero()) + return ZERO; + if (this.eq(MIN_VALUE)) + return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) + return this.isOdd() ? MIN_VALUE : ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xFFFF; + var a16 = this.low >>> 16; + var a00 = this.low & 0xFFFF; + + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xFFFF; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xFFFF; + + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xFFFF; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xFFFF; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xFFFF; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.mul = LongPrototype.multiply; + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + if (this.isZero()) + return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(MIN_VALUE)) + return ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) + return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return UZERO; + if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true + return UONE; + res = UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2), + delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), + + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + approxRes = fromNumber(approx), + approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + + /** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.div = LongPrototype.divide; + + /** + * Returns this Long modulo the specified. + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + return this.sub(this.div(divisor).mul(divisor)); + }; + + /** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.mod = LongPrototype.modulo; + + /** + * Returns the bitwise NOT of this Long. + * @returns {!Long} + */ + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + + /** + * Returns the bitwise AND of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.and = function and(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + + /** + * Returns the bitwise OR of this Long and the specified. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.or = function or(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + + /** + * Returns the bitwise XOR of this Long and the given one. + * @param {!Long|number|string} other Other Long + * @returns {!Long} + */ + LongPrototype.xor = function xor(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shl = LongPrototype.shiftLeft; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shr = LongPrototype.shiftRight; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } else if (numBits === 32) + return fromBits(high, 0, this.unsigned); + else + return fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + + /** + * Converts this Long to signed. + * @returns {!Long} Signed long + */ + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) + return this; + return fromBits(this.low, this.high, false); + }; + + /** + * Converts this Long to unsigned. + * @returns {!Long} Unsigned long + */ + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) + return this; + return fromBits(this.low, this.high, true); + }; + + /** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {!Array.} Byte representation + */ + LongPrototype.toBytes = function(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + + /** + * Converts this Long to its little endian byte representation. + * @returns {!Array.} Little endian byte representation + */ + LongPrototype.toBytesLE = function() { + var hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + (lo >>> 24) & 0xff, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + (hi >>> 24) & 0xff + ]; + }; + + /** + * Converts this Long to its big endian byte representation. + * @returns {!Array.} Big endian byte representation + */ + LongPrototype.toBytesBE = function() { + var hi = this.high, + lo = this.low; + return [ + (hi >>> 24) & 0xff, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + (lo >>> 24) & 0xff, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + + return Long; + }); + }); + + var bytebuffer = createCommonjsModule(function (module) { + /* + Copyright 2013-2014 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license bytebuffer.js (c) 2015 Daniel Wirtz + * Backing buffer: ArrayBuffer, Accessor: Uint8Array + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/bytebuffer.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined(["long"], factory); + /* CommonJS */ else if (typeof commonjsRequire === 'function' && 'object' === "object" && module && module["exports"]) + module['exports'] = (function() { + var Long; try { Long = long_1; } catch (e) {} + return factory(Long); + })(); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ByteBuffer"] = factory(global["dcodeIO"]["Long"]); + + })(commonjsGlobal, function(Long) { + "use strict"; + + /** + * Constructs a new ByteBuffer. + * @class The swiss army knife for binary data in JavaScript. + * @exports ByteBuffer + * @constructor + * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}. + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @expose + */ + var ByteBuffer = function(capacity, littleEndian, noAssert) { + if (typeof capacity === 'undefined') + capacity = ByteBuffer.DEFAULT_CAPACITY; + if (typeof littleEndian === 'undefined') + littleEndian = ByteBuffer.DEFAULT_ENDIAN; + if (typeof noAssert === 'undefined') + noAssert = ByteBuffer.DEFAULT_NOASSERT; + if (!noAssert) { + capacity = capacity | 0; + if (capacity < 0) + throw RangeError("Illegal capacity"); + littleEndian = !!littleEndian; + noAssert = !!noAssert; + } + + /** + * Backing ArrayBuffer. + * @type {!ArrayBuffer} + * @expose + */ + this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity); + + /** + * Uint8Array utilized to manipulate the backing buffer. Becomes `null` if the backing buffer has a capacity of `0`. + * @type {?Uint8Array} + * @expose + */ + this.view = capacity === 0 ? null : new Uint8Array(this.buffer); + + /** + * Absolute read/write offset. + * @type {number} + * @expose + * @see ByteBuffer#flip + * @see ByteBuffer#clear + */ + this.offset = 0; + + /** + * Marked offset. + * @type {number} + * @expose + * @see ByteBuffer#mark + * @see ByteBuffer#reset + */ + this.markedOffset = -1; + + /** + * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation. + * @type {number} + * @expose + * @see ByteBuffer#flip + * @see ByteBuffer#clear + */ + this.limit = capacity; + + /** + * Whether to use little endian byte order, defaults to `false` for big endian. + * @type {boolean} + * @expose + */ + this.littleEndian = littleEndian; + + /** + * Whether to skip assertions of offsets and values, defaults to `false`. + * @type {boolean} + * @expose + */ + this.noAssert = noAssert; + }; + + /** + * ByteBuffer version. + * @type {string} + * @const + * @expose + */ + ByteBuffer.VERSION = "5.0.1"; + + /** + * Little endian constant that can be used instead of its boolean value. Evaluates to `true`. + * @type {boolean} + * @const + * @expose + */ + ByteBuffer.LITTLE_ENDIAN = true; + + /** + * Big endian constant that can be used instead of its boolean value. Evaluates to `false`. + * @type {boolean} + * @const + * @expose + */ + ByteBuffer.BIG_ENDIAN = false; + + /** + * Default initial capacity of `16`. + * @type {number} + * @expose + */ + ByteBuffer.DEFAULT_CAPACITY = 16; + + /** + * Default endianess of `false` for big endian. + * @type {boolean} + * @expose + */ + ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN; + + /** + * Default no assertions flag of `false`. + * @type {boolean} + * @expose + */ + ByteBuffer.DEFAULT_NOASSERT = false; + + /** + * A `Long` class for representing a 64-bit two's-complement integer value. May be `null` if Long.js has not been loaded + * and int64 support is not available. + * @type {?Long} + * @const + * @see https://github.com/dcodeIO/long.js + * @expose + */ + ByteBuffer.Long = Long || null; + + /** + * @alias ByteBuffer.prototype + * @inner + */ + var ByteBufferPrototype = ByteBuffer.prototype; + + /** + * An indicator used to reliably determine if an object is a ByteBuffer or not. + * @type {boolean} + * @const + * @expose + * @private + */ + ByteBufferPrototype.__isByteBuffer__; + + Object.defineProperty(ByteBufferPrototype, "__isByteBuffer__", { + value: true, + enumerable: false, + configurable: false + }); + + // helpers + + /** + * @type {!ArrayBuffer} + * @inner + */ + var EMPTY_BUFFER = new ArrayBuffer(0); + + /** + * String.fromCharCode reference for compile-time renaming. + * @type {function(...number):string} + * @inner + */ + var stringFromCharCode = String.fromCharCode; + + /** + * Creates a source function for a string. + * @param {string} s String to read from + * @returns {function():number|null} Source function returning the next char code respectively `null` if there are + * no more characters left. + * @throws {TypeError} If the argument is invalid + * @inner + */ + function stringSource(s) { + var i=0; return function() { + return i < s.length ? s.charCodeAt(i++) : null; + }; + } + + /** + * Creates a destination function for a string. + * @returns {function(number=):undefined|string} Destination function successively called with the next char code. + * Returns the final string when called without arguments. + * @inner + */ + function stringDestination() { + var cs = [], ps = []; return function() { + if (arguments.length === 0) + return ps.join('')+stringFromCharCode.apply(String, cs); + if (cs.length + arguments.length > 1024) + ps.push(stringFromCharCode.apply(String, cs)), + cs.length = 0; + Array.prototype.push.apply(cs, arguments); + }; + } + + /** + * Gets the accessor type. + * @returns {Function} `Buffer` under node.js, `Uint8Array` respectively `DataView` in the browser (classes) + * @expose + */ + ByteBuffer.accessor = function() { + return Uint8Array; + }; + /** + * Allocates a new ByteBuffer backed by a buffer of the specified capacity. + * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}. + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} + * @expose + */ + ByteBuffer.allocate = function(capacity, littleEndian, noAssert) { + return new ByteBuffer(capacity, littleEndian, noAssert); + }; + + /** + * Concatenates multiple ByteBuffers into one. + * @param {!Array.} buffers Buffers to concatenate + * @param {(string|boolean)=} encoding String encoding if `buffers` contains a string ("base64", "hex", "binary", + * defaults to "utf8") + * @param {boolean=} littleEndian Whether to use little or big endian byte order for the resulting ByteBuffer. Defaults + * to {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values for the resulting ByteBuffer. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} Concatenated ByteBuffer + * @expose + */ + ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) { + if (typeof encoding === 'boolean' || typeof encoding !== 'string') { + noAssert = littleEndian; + littleEndian = encoding; + encoding = undefined; + } + var capacity = 0; + for (var i=0, k=buffers.length, length; i 0) capacity += length; + } + if (capacity === 0) + return new ByteBuffer(0, littleEndian, noAssert); + var bb = new ByteBuffer(capacity, littleEndian, noAssert), + bi; + i=0; while (i} buffer Anything that can be wrapped + * @param {(string|boolean)=} encoding String encoding if `buffer` is a string ("base64", "hex", "binary", defaults to + * "utf8") + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} A ByteBuffer wrapping `buffer` + * @expose + */ + ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) { + if (typeof encoding !== 'string') { + noAssert = littleEndian; + littleEndian = encoding; + encoding = undefined; + } + if (typeof buffer === 'string') { + if (typeof encoding === 'undefined') + encoding = "utf8"; + switch (encoding) { + case "base64": + return ByteBuffer.fromBase64(buffer, littleEndian); + case "hex": + return ByteBuffer.fromHex(buffer, littleEndian); + case "binary": + return ByteBuffer.fromBinary(buffer, littleEndian); + case "utf8": + return ByteBuffer.fromUTF8(buffer, littleEndian); + case "debug": + return ByteBuffer.fromDebug(buffer, littleEndian); + default: + throw Error("Unsupported encoding: "+encoding); + } + } + if (buffer === null || typeof buffer !== 'object') + throw TypeError("Illegal buffer"); + var bb; + if (ByteBuffer.isByteBuffer(buffer)) { + bb = ByteBufferPrototype.clone.call(buffer); + bb.markedOffset = -1; + return bb; + } + if (buffer instanceof Uint8Array) { // Extract ArrayBuffer from Uint8Array + bb = new ByteBuffer(0, littleEndian, noAssert); + if (buffer.length > 0) { // Avoid references to more than one EMPTY_BUFFER + bb.buffer = buffer.buffer; + bb.offset = buffer.byteOffset; + bb.limit = buffer.byteOffset + buffer.byteLength; + bb.view = new Uint8Array(buffer.buffer); + } + } else if (buffer instanceof ArrayBuffer) { // Reuse ArrayBuffer + bb = new ByteBuffer(0, littleEndian, noAssert); + if (buffer.byteLength > 0) { + bb.buffer = buffer; + bb.offset = 0; + bb.limit = buffer.byteLength; + bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null; + } + } else if (Object.prototype.toString.call(buffer) === "[object Array]") { // Create from octets + bb = new ByteBuffer(buffer.length, littleEndian, noAssert); + bb.limit = buffer.length; + for (var i=0; i} value Array of booleans to write + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {!ByteBuffer} + * @expose + */ + ByteBufferPrototype.writeBitSet = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (!(value instanceof Array)) + throw TypeError("Illegal BitSet: Not an array"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + + var start = offset, + bits = value.length, + bytes = (bits >> 3), + bit = 0, + k; + + offset += this.writeVarint32(bits,offset); + + while(bytes--) { + k = (!!value[bit++] & 1) | + ((!!value[bit++] & 1) << 1) | + ((!!value[bit++] & 1) << 2) | + ((!!value[bit++] & 1) << 3) | + ((!!value[bit++] & 1) << 4) | + ((!!value[bit++] & 1) << 5) | + ((!!value[bit++] & 1) << 6) | + ((!!value[bit++] & 1) << 7); + this.writeByte(k,offset++); + } + + if(bit < bits) { + var m = 0; k = 0; + while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++)); + this.writeByte(k,offset++); + } + + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a BitSet as an array of booleans. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {Array + * @expose + */ + ByteBufferPrototype.readBitSet = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + + var ret = this.readVarint32(offset), + bits = ret.value, + bytes = (bits >> 3), + bit = 0, + value = [], + k; + + offset += ret.length; + + while(bytes--) { + k = this.readByte(offset++); + value[bit++] = !!(k & 0x01); + value[bit++] = !!(k & 0x02); + value[bit++] = !!(k & 0x04); + value[bit++] = !!(k & 0x08); + value[bit++] = !!(k & 0x10); + value[bit++] = !!(k & 0x20); + value[bit++] = !!(k & 0x40); + value[bit++] = !!(k & 0x80); + } + + if(bit < bits) { + var m = 0; + k = this.readByte(offset++); + while(bit < bits) value[bit++] = !!((k >> (m++)) & 1); + } + + if (relative) { + this.offset = offset; + } + return value; + }; + /** + * Reads the specified number of bytes. + * @param {number} length Number of bytes to read + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted. + * @returns {!ByteBuffer} + * @expose + */ + ByteBufferPrototype.readBytes = function(length, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + length > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength); + } + var slice = this.slice(offset, offset + length); + if (relative) this.offset += length; + return slice; + }; + + /** + * Writes a payload of bytes. This is an alias of {@link ByteBuffer#append}. + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to write. If `source` is a ByteBuffer, its offsets + * will be modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeBytes = ByteBufferPrototype.append; + + // types/ints/int8 + + /** + * Writes an 8bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeInt8 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 1; + var capacity0 = this.buffer.byteLength; + if (offset > capacity0) + this.resize((capacity0 *= 2) > offset ? capacity0 : offset); + offset -= 1; + this.view[offset] = value; + if (relative) this.offset += 1; + return this; + }; + + /** + * Writes an 8bit signed integer. This is an alias of {@link ByteBuffer#writeInt8}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8; + + /** + * Reads an 8bit signed integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt8 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var value = this.view[offset]; + if ((value & 0x80) === 0x80) value = -(0xFF - value + 1); // Cast to signed + if (relative) this.offset += 1; + return value; + }; + + /** + * Reads an 8bit signed integer. This is an alias of {@link ByteBuffer#readInt8}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8; + + /** + * Writes an 8bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUint8 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 1; + var capacity1 = this.buffer.byteLength; + if (offset > capacity1) + this.resize((capacity1 *= 2) > offset ? capacity1 : offset); + offset -= 1; + this.view[offset] = value; + if (relative) this.offset += 1; + return this; + }; + + /** + * Writes an 8bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint8}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8; + + /** + * Reads an 8bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUint8 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var value = this.view[offset]; + if (relative) this.offset += 1; + return value; + }; + + /** + * Reads an 8bit unsigned integer. This is an alias of {@link ByteBuffer#readUint8}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8; + + // types/ints/int16 + + /** + * Writes a 16bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeInt16 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 2; + var capacity2 = this.buffer.byteLength; + if (offset > capacity2) + this.resize((capacity2 *= 2) > offset ? capacity2 : offset); + offset -= 2; + if (this.littleEndian) { + this.view[offset+1] = (value & 0xFF00) >>> 8; + this.view[offset ] = value & 0x00FF; + } else { + this.view[offset] = (value & 0xFF00) >>> 8; + this.view[offset+1] = value & 0x00FF; + } + if (relative) this.offset += 2; + return this; + }; + + /** + * Writes a 16bit signed integer. This is an alias of {@link ByteBuffer#writeInt16}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16; + + /** + * Reads a 16bit signed integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readInt16 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 2 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset ]; + value |= this.view[offset+1] << 8; + } else { + value = this.view[offset ] << 8; + value |= this.view[offset+1]; + } + if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1); // Cast to signed + if (relative) this.offset += 2; + return value; + }; + + /** + * Reads a 16bit signed integer. This is an alias of {@link ByteBuffer#readInt16}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16; + + /** + * Writes a 16bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeUint16 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 2; + var capacity3 = this.buffer.byteLength; + if (offset > capacity3) + this.resize((capacity3 *= 2) > offset ? capacity3 : offset); + offset -= 2; + if (this.littleEndian) { + this.view[offset+1] = (value & 0xFF00) >>> 8; + this.view[offset ] = value & 0x00FF; + } else { + this.view[offset] = (value & 0xFF00) >>> 8; + this.view[offset+1] = value & 0x00FF; + } + if (relative) this.offset += 2; + return this; + }; + + /** + * Writes a 16bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint16}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @throws {TypeError} If `offset` or `value` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16; + + /** + * Reads a 16bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readUint16 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 2 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+2+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset ]; + value |= this.view[offset+1] << 8; + } else { + value = this.view[offset ] << 8; + value |= this.view[offset+1]; + } + if (relative) this.offset += 2; + return value; + }; + + /** + * Reads a 16bit unsigned integer. This is an alias of {@link ByteBuffer#readUint16}. + * @function + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted. + * @returns {number} Value read + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @expose + */ + ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16; + + // types/ints/int32 + + /** + * Writes a 32bit signed integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeInt32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity4 = this.buffer.byteLength; + if (offset > capacity4) + this.resize((capacity4 *= 2) > offset ? capacity4 : offset); + offset -= 4; + if (this.littleEndian) { + this.view[offset+3] = (value >>> 24) & 0xFF; + this.view[offset+2] = (value >>> 16) & 0xFF; + this.view[offset+1] = (value >>> 8) & 0xFF; + this.view[offset ] = value & 0xFF; + } else { + this.view[offset ] = (value >>> 24) & 0xFF; + this.view[offset+1] = (value >>> 16) & 0xFF; + this.view[offset+2] = (value >>> 8) & 0xFF; + this.view[offset+3] = value & 0xFF; + } + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit signed integer. This is an alias of {@link ByteBuffer#writeInt32}. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32; + + /** + * Reads a 32bit signed integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset+2] << 16; + value |= this.view[offset+1] << 8; + value |= this.view[offset ]; + value += this.view[offset+3] << 24 >>> 0; + } else { + value = this.view[offset+1] << 16; + value |= this.view[offset+2] << 8; + value |= this.view[offset+3]; + value += this.view[offset ] << 24 >>> 0; + } + value |= 0; // Cast to signed + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit signed integer. This is an alias of {@link ByteBuffer#readInt32}. + * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32; + + /** + * Writes a 32bit unsigned integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeUint32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value >>>= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity5 = this.buffer.byteLength; + if (offset > capacity5) + this.resize((capacity5 *= 2) > offset ? capacity5 : offset); + offset -= 4; + if (this.littleEndian) { + this.view[offset+3] = (value >>> 24) & 0xFF; + this.view[offset+2] = (value >>> 16) & 0xFF; + this.view[offset+1] = (value >>> 8) & 0xFF; + this.view[offset ] = value & 0xFF; + } else { + this.view[offset ] = (value >>> 24) & 0xFF; + this.view[offset+1] = (value >>> 16) & 0xFF; + this.view[offset+2] = (value >>> 8) & 0xFF; + this.view[offset+3] = value & 0xFF; + } + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint32}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @expose + */ + ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32; + + /** + * Reads a 32bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUint32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = 0; + if (this.littleEndian) { + value = this.view[offset+2] << 16; + value |= this.view[offset+1] << 8; + value |= this.view[offset ]; + value += this.view[offset+3] << 24 >>> 0; + } else { + value = this.view[offset+1] << 16; + value |= this.view[offset+2] << 8; + value |= this.view[offset+3]; + value += this.view[offset ] << 24 >>> 0; + } + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit unsigned integer. This is an alias of {@link ByteBuffer#readUint32}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} Value read + * @expose + */ + ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32; + + // types/ints/int64 + + if (Long) { + + /** + * Writes a 64bit signed integer. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeInt64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + offset += 8; + var capacity6 = this.buffer.byteLength; + if (offset > capacity6) + this.resize((capacity6 *= 2) > offset ? capacity6 : offset); + offset -= 8; + var lo = value.low, + hi = value.high; + if (this.littleEndian) { + this.view[offset+3] = (lo >>> 24) & 0xFF; + this.view[offset+2] = (lo >>> 16) & 0xFF; + this.view[offset+1] = (lo >>> 8) & 0xFF; + this.view[offset ] = lo & 0xFF; + offset += 4; + this.view[offset+3] = (hi >>> 24) & 0xFF; + this.view[offset+2] = (hi >>> 16) & 0xFF; + this.view[offset+1] = (hi >>> 8) & 0xFF; + this.view[offset ] = hi & 0xFF; + } else { + this.view[offset ] = (hi >>> 24) & 0xFF; + this.view[offset+1] = (hi >>> 16) & 0xFF; + this.view[offset+2] = (hi >>> 8) & 0xFF; + this.view[offset+3] = hi & 0xFF; + offset += 4; + this.view[offset ] = (lo >>> 24) & 0xFF; + this.view[offset+1] = (lo >>> 16) & 0xFF; + this.view[offset+2] = (lo >>> 8) & 0xFF; + this.view[offset+3] = lo & 0xFF; + } + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit signed integer. This is an alias of {@link ByteBuffer#writeInt64}. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64; + + /** + * Reads a 64bit signed integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readInt64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var lo = 0, + hi = 0; + if (this.littleEndian) { + lo = this.view[offset+2] << 16; + lo |= this.view[offset+1] << 8; + lo |= this.view[offset ]; + lo += this.view[offset+3] << 24 >>> 0; + offset += 4; + hi = this.view[offset+2] << 16; + hi |= this.view[offset+1] << 8; + hi |= this.view[offset ]; + hi += this.view[offset+3] << 24 >>> 0; + } else { + hi = this.view[offset+1] << 16; + hi |= this.view[offset+2] << 8; + hi |= this.view[offset+3]; + hi += this.view[offset ] << 24 >>> 0; + offset += 4; + lo = this.view[offset+1] << 16; + lo |= this.view[offset+2] << 8; + lo |= this.view[offset+3]; + lo += this.view[offset ] << 24 >>> 0; + } + var value = new Long(lo, hi, false); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit signed integer. This is an alias of {@link ByteBuffer#readInt64}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64; + + /** + * Writes a 64bit unsigned integer. + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUint64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + offset += 8; + var capacity7 = this.buffer.byteLength; + if (offset > capacity7) + this.resize((capacity7 *= 2) > offset ? capacity7 : offset); + offset -= 8; + var lo = value.low, + hi = value.high; + if (this.littleEndian) { + this.view[offset+3] = (lo >>> 24) & 0xFF; + this.view[offset+2] = (lo >>> 16) & 0xFF; + this.view[offset+1] = (lo >>> 8) & 0xFF; + this.view[offset ] = lo & 0xFF; + offset += 4; + this.view[offset+3] = (hi >>> 24) & 0xFF; + this.view[offset+2] = (hi >>> 16) & 0xFF; + this.view[offset+1] = (hi >>> 8) & 0xFF; + this.view[offset ] = hi & 0xFF; + } else { + this.view[offset ] = (hi >>> 24) & 0xFF; + this.view[offset+1] = (hi >>> 16) & 0xFF; + this.view[offset+2] = (hi >>> 8) & 0xFF; + this.view[offset+3] = hi & 0xFF; + offset += 4; + this.view[offset ] = (lo >>> 24) & 0xFF; + this.view[offset+1] = (lo >>> 16) & 0xFF; + this.view[offset+2] = (lo >>> 8) & 0xFF; + this.view[offset+3] = lo & 0xFF; + } + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint64}. + * @function + * @param {number|!Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64; + + /** + * Reads a 64bit unsigned integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readUint64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var lo = 0, + hi = 0; + if (this.littleEndian) { + lo = this.view[offset+2] << 16; + lo |= this.view[offset+1] << 8; + lo |= this.view[offset ]; + lo += this.view[offset+3] << 24 >>> 0; + offset += 4; + hi = this.view[offset+2] << 16; + hi |= this.view[offset+1] << 8; + hi |= this.view[offset ]; + hi += this.view[offset+3] << 24 >>> 0; + } else { + hi = this.view[offset+1] << 16; + hi |= this.view[offset+2] << 8; + hi |= this.view[offset+3]; + hi += this.view[offset ] << 24 >>> 0; + offset += 4; + lo = this.view[offset+1] << 16; + lo |= this.view[offset+2] << 8; + lo |= this.view[offset+3]; + lo += this.view[offset ] << 24 >>> 0; + } + var value = new Long(lo, hi, true); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit unsigned integer. This is an alias of {@link ByteBuffer#readUint64}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!Long} + * @expose + */ + ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64; + + } // Long + + + // types/floats/float32 + + /* + ieee754 - https://github.com/feross/ieee754 + + The MIT License (MIT) + + Copyright (c) Feross Aboukhadijeh + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + + /** + * Reads an IEEE754 float from a byte array. + * @param {!Array} buffer + * @param {number} offset + * @param {boolean} isLE + * @param {number} mLen + * @param {number} nBytes + * @returns {number} + * @inner + */ + function ieee754_read(buffer, offset, isLE, mLen, nBytes) { + var e, m, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + nBits = -7, + i = isLE ? (nBytes - 1) : 0, + d = isLE ? -1 : 1, + s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity); + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + } + + /** + * Writes an IEEE754 float to a byte array. + * @param {!Array} buffer + * @param {number} value + * @param {number} offset + * @param {boolean} isLE + * @param {number} mLen + * @param {number} nBytes + * @inner + */ + function ieee754_write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), + i = isLE ? 0 : (nBytes - 1), + d = isLE ? 1 : -1, + s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + } + + /** + * Writes a 32bit float. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number') + throw TypeError("Illegal value: "+value+" (not a number)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 4; + var capacity8 = this.buffer.byteLength; + if (offset > capacity8) + this.resize((capacity8 *= 2) > offset ? capacity8 : offset); + offset -= 4; + ieee754_write(this.view, value, offset, this.littleEndian, 23, 4); + if (relative) this.offset += 4; + return this; + }; + + /** + * Writes a 32bit float. This is an alias of {@link ByteBuffer#writeFloat32}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32; + + /** + * Reads a 32bit float. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4); + if (relative) this.offset += 4; + return value; + }; + + /** + * Reads a 32bit float. This is an alias of {@link ByteBuffer#readFloat32}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32; + + // types/floats/float64 + + /** + * Writes a 64bit float. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeFloat64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number') + throw TypeError("Illegal value: "+value+" (not a number)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + offset += 8; + var capacity9 = this.buffer.byteLength; + if (offset > capacity9) + this.resize((capacity9 *= 2) > offset ? capacity9 : offset); + offset -= 8; + ieee754_write(this.view, value, offset, this.littleEndian, 52, 8); + if (relative) this.offset += 8; + return this; + }; + + /** + * Writes a 64bit float. This is an alias of {@link ByteBuffer#writeFloat64}. + * @function + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64; + + /** + * Reads a 64bit float. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readFloat64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 8 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.byteLength); + } + var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8); + if (relative) this.offset += 8; + return value; + }; + + /** + * Reads a 64bit float. This is an alias of {@link ByteBuffer#readFloat64}. + * @function + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted. + * @returns {number} + * @expose + */ + ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64; + + + // types/varints/varint32 + + /** + * Maximum number of bytes required to store a 32bit base 128 variable-length integer. + * @type {number} + * @const + * @expose + */ + ByteBuffer.MAX_VARINT32_BYTES = 5; + + /** + * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer. + * @param {number} value Value to encode + * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT32_BYTES} + * @expose + */ + ByteBuffer.calculateVarint32 = function(value) { + // ref: src/google/protobuf/io/coded_stream.cc + value = value >>> 0; + if (value < 1 << 7 ) return 1; + else if (value < 1 << 14) return 2; + else if (value < 1 << 21) return 3; + else if (value < 1 << 28) return 4; + else return 5; + }; + + /** + * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding. + * @param {number} n Signed 32bit integer + * @returns {number} Unsigned zigzag encoded 32bit integer + * @expose + */ + ByteBuffer.zigZagEncode32 = function(n) { + return (((n |= 0) << 1) ^ (n >> 31)) >>> 0; // ref: src/google/protobuf/wire_format_lite.h + }; + + /** + * Decodes a zigzag encoded signed 32bit integer. + * @param {number} n Unsigned zigzag encoded 32bit integer + * @returns {number} Signed 32bit integer + * @expose + */ + ByteBuffer.zigZagDecode32 = function(n) { + return ((n >>> 1) ^ -(n & 1)) | 0; // // ref: src/google/protobuf/wire_format_lite.h + }; + + /** + * Writes a 32bit base 128 variable-length integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeVarint32 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var size = ByteBuffer.calculateVarint32(value), + b; + offset += size; + var capacity10 = this.buffer.byteLength; + if (offset > capacity10) + this.resize((capacity10 *= 2) > offset ? capacity10 : offset); + offset -= size; + value >>>= 0; + while (value >= 0x80) { + b = (value & 0x7f) | 0x80; + this.view[offset++] = b; + value >>>= 7; + } + this.view[offset++] = value; + if (relative) { + this.offset = offset; + return this; + } + return size; + }; + + /** + * Writes a zig-zag encoded (signed) 32bit base 128 variable-length integer. + * @param {number} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) { + return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset); + }; + + /** + * Reads a 32bit base 128 variable-length integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read + * and the actual number of bytes read. + * @throws {Error} If it's not a valid varint. Has a property `truncated = true` if there is not enough data available + * to fully decode the varint. + * @expose + */ + ByteBufferPrototype.readVarint32 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var c = 0, + value = 0 >>> 0, + b; + do { + if (!this.noAssert && offset > this.limit) { + var err = Error("Truncated"); + err['truncated'] = true; + throw err; + } + b = this.view[offset++]; + if (c < 5) + value |= (b & 0x7f) << (7*c); + ++c; + } while ((b & 0x80) !== 0); + value |= 0; + if (relative) { + this.offset = offset; + return value; + } + return { + "value": value, + "length": c + }; + }; + + /** + * Reads a zig-zag encoded (signed) 32bit base 128 variable-length integer. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read + * and the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint32ZigZag = function(offset) { + var val = this.readVarint32(offset); + if (typeof val === 'object') + val["value"] = ByteBuffer.zigZagDecode32(val["value"]); + else + val = ByteBuffer.zigZagDecode32(val); + return val; + }; + + // types/varints/varint64 + + if (Long) { + + /** + * Maximum number of bytes required to store a 64bit base 128 variable-length integer. + * @type {number} + * @const + * @expose + */ + ByteBuffer.MAX_VARINT64_BYTES = 10; + + /** + * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer. + * @param {number|!Long} value Value to encode + * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT64_BYTES} + * @expose + */ + ByteBuffer.calculateVarint64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + // ref: src/google/protobuf/io/coded_stream.cc + var part0 = value.toInt() >>> 0, + part1 = value.shiftRightUnsigned(28).toInt() >>> 0, + part2 = value.shiftRightUnsigned(56).toInt() >>> 0; + if (part2 == 0) { + if (part1 == 0) { + if (part0 < 1 << 14) + return part0 < 1 << 7 ? 1 : 2; + else + return part0 < 1 << 21 ? 3 : 4; + } else { + if (part1 < 1 << 14) + return part1 < 1 << 7 ? 5 : 6; + else + return part1 < 1 << 21 ? 7 : 8; + } + } else + return part2 < 1 << 7 ? 9 : 10; + }; + + /** + * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding. + * @param {number|!Long} value Signed long + * @returns {!Long} Unsigned zigzag encoded long + * @expose + */ + ByteBuffer.zigZagEncode64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + // ref: src/google/protobuf/wire_format_lite.h + return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned(); + }; + + /** + * Decodes a zigzag encoded signed 64bit integer. + * @param {!Long|number} value Unsigned zigzag encoded long or JavaScript number + * @returns {!Long} Signed long + * @expose + */ + ByteBuffer.zigZagDecode64 = function(value) { + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + // ref: src/google/protobuf/wire_format_lite.h + return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned(); + }; + + /** + * Writes a 64bit base 128 variable-length integer. + * @param {number|Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeVarint64 = function(value, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof value === 'number') + value = Long.fromNumber(value); + else if (typeof value === 'string') + value = Long.fromString(value); + else if (!(value && value instanceof Long)) + throw TypeError("Illegal value: "+value+" (not an integer or Long)"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (typeof value === 'number') + value = Long.fromNumber(value, false); + else if (typeof value === 'string') + value = Long.fromString(value, false); + else if (value.unsigned !== false) value = value.toSigned(); + var size = ByteBuffer.calculateVarint64(value), + part0 = value.toInt() >>> 0, + part1 = value.shiftRightUnsigned(28).toInt() >>> 0, + part2 = value.shiftRightUnsigned(56).toInt() >>> 0; + offset += size; + var capacity11 = this.buffer.byteLength; + if (offset > capacity11) + this.resize((capacity11 *= 2) > offset ? capacity11 : offset); + offset -= size; + switch (size) { + case 10: this.view[offset+9] = (part2 >>> 7) & 0x01; + case 9 : this.view[offset+8] = size !== 9 ? (part2 ) | 0x80 : (part2 ) & 0x7F; + case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F; + case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F; + case 6 : this.view[offset+5] = size !== 6 ? (part1 >>> 7) | 0x80 : (part1 >>> 7) & 0x7F; + case 5 : this.view[offset+4] = size !== 5 ? (part1 ) | 0x80 : (part1 ) & 0x7F; + case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F; + case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F; + case 2 : this.view[offset+1] = size !== 2 ? (part0 >>> 7) | 0x80 : (part0 >>> 7) & 0x7F; + case 1 : this.view[offset ] = size !== 1 ? (part0 ) | 0x80 : (part0 ) & 0x7F; + } + if (relative) { + this.offset += size; + return this; + } else { + return size; + } + }; + + /** + * Writes a zig-zag encoded 64bit base 128 variable-length integer. + * @param {number|Long} value Value to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) { + return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset); + }; + + /** + * Reads a 64bit base 128 variable-length integer. Requires Long.js. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and + * the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint64 = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + // ref: src/google/protobuf/io/coded_stream.cc + var start = offset, + part0 = 0, + part1 = 0, + part2 = 0, + b = 0; + b = this.view[offset++]; part0 = (b & 0x7F) ; if ( b & 0x80 ) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part2 = (b & 0x7F) ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + b = this.view[offset++]; part2 |= (b & 0x7F) << 7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) { + throw Error("Buffer overrun"); }}}}}}}}}} + var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false); + if (relative) { + this.offset = offset; + return value; + } else { + return { + 'value': value, + 'length': offset-start + }; + } + }; + + /** + * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and + * the actual number of bytes read. + * @throws {Error} If it's not a valid varint + * @expose + */ + ByteBufferPrototype.readVarint64ZigZag = function(offset) { + var val = this.readVarint64(offset); + if (val && val['value'] instanceof Long) + val["value"] = ByteBuffer.zigZagDecode64(val["value"]); + else + val = ByteBuffer.zigZagDecode64(val); + return val; + }; + + } // Long + + + // types/strings/cstring + + /** + * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL + * characters itself. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * contained in `str` + 1 if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written + * @expose + */ + ByteBufferPrototype.writeCString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + var i, + k = str.length; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + for (i=0; i>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + // UTF8 strings do not contain zero bytes in between except for the zero character, so: + k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; + offset += k+1; + var capacity12 = this.buffer.byteLength; + if (offset > capacity12) + this.resize((capacity12 *= 2) > offset ? capacity12 : offset); + offset -= k+1; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + this.view[offset++] = 0; + if (relative) { + this.offset = offset; + return this; + } + return k; + }; + + /** + * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters + * itself. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readCString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var start = offset, + temp; + // UTF8 strings do not contain zero bytes in between except for the zero character itself, so: + var sd, b = -1; + utfx.decodeUTF8toUTF16(function() { + if (b === 0) return null; + if (offset >= this.limit) + throw RangeError("Illegal range: Truncated data, "+offset+" < "+this.limit); + b = this.view[offset++]; + return b === 0 ? null : b; + }.bind(this), sd = stringDestination(), true); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + "string": sd(), + "length": offset - start + }; + } + }; + + // types/strings/istring + + /** + * Writes a length as uint32 prefixed UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written + * @expose + * @see ByteBuffer#writeVarint32 + */ + ByteBufferPrototype.writeIString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var start = offset, + k; + k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1]; + offset += 4+k; + var capacity13 = this.buffer.byteLength; + if (offset > capacity13) + this.resize((capacity13 *= 2) > offset ? capacity13 : offset); + offset -= 4+k; + if (this.littleEndian) { + this.view[offset+3] = (k >>> 24) & 0xFF; + this.view[offset+2] = (k >>> 16) & 0xFF; + this.view[offset+1] = (k >>> 8) & 0xFF; + this.view[offset ] = k & 0xFF; + } else { + this.view[offset ] = (k >>> 24) & 0xFF; + this.view[offset+1] = (k >>> 16) & 0xFF; + this.view[offset+2] = (k >>> 8) & 0xFF; + this.view[offset+3] = k & 0xFF; + } + offset += 4; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (offset !== start + 4 + k) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+4+k)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a length as uint32 prefixed UTF8 encoded string. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + * @see ByteBuffer#readVarint32 + */ + ByteBufferPrototype.readIString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 4 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+4+") <= "+this.buffer.byteLength); + } + var start = offset; + var len = this.readUint32(offset); + var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4); + offset += str['length']; + if (relative) { + this.offset = offset; + return str['string']; + } else { + return { + 'string': str['string'], + 'length': offset - start + }; + } + }; + + // types/strings/utf8string + + /** + * Metrics representing number of UTF8 characters. Evaluates to `c`. + * @type {string} + * @const + * @expose + */ + ByteBuffer.METRICS_CHARS = 'c'; + + /** + * Metrics representing number of bytes. Evaluates to `b`. + * @type {string} + * @const + * @expose + */ + ByteBuffer.METRICS_BYTES = 'b'; + + /** + * Writes an UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeUTF8String = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var k; + var start = offset; + k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; + offset += k; + var capacity14 = this.buffer.byteLength; + if (offset > capacity14) + this.resize((capacity14 *= 2) > offset ? capacity14 : offset); + offset -= k; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Writes an UTF8 encoded string. This is an alias of {@link ByteBuffer#writeUTF8String}. + * @function + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted. + * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written. + * @expose + */ + ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String; + + /** + * Calculates the number of UTF8 characters of a string. JavaScript itself uses UTF-16, so that a string's + * `length` property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF. + * @param {string} str String to calculate + * @returns {number} Number of UTF8 characters + * @expose + */ + ByteBuffer.calculateUTF8Chars = function(str) { + return utfx.calculateUTF16asUTF8(stringSource(str))[0]; + }; + + /** + * Calculates the number of UTF8 bytes of a string. + * @param {string} str String to calculate + * @returns {number} Number of UTF8 bytes + * @expose + */ + ByteBuffer.calculateUTF8Bytes = function(str) { + return utfx.calculateUTF16asUTF8(stringSource(str))[1]; + }; + + /** + * Calculates the number of UTF8 bytes of a string. This is an alias of {@link ByteBuffer.calculateUTF8Bytes}. + * @function + * @param {string} str String to calculate + * @returns {number} Number of UTF8 bytes + * @expose + */ + ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes; + + /** + * Reads an UTF8 encoded string. + * @param {number} length Number of characters or bytes to read. + * @param {string=} metrics Metrics specifying what `length` is meant to count. Defaults to + * {@link ByteBuffer.METRICS_CHARS}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readUTF8String = function(length, metrics, offset) { + if (typeof metrics === 'number') { + offset = metrics; + metrics = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS; + if (!this.noAssert) { + if (typeof length !== 'number' || length % 1 !== 0) + throw TypeError("Illegal length: "+length+" (not an integer)"); + length |= 0; + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var i = 0, + start = offset, + sd; + if (metrics === ByteBuffer.METRICS_CHARS) { // The same for node and the browser + sd = stringDestination(); + utfx.decodeUTF8(function() { + return i < length && offset < this.limit ? this.view[offset++] : null; + }.bind(this), function(cp) { + ++i; utfx.UTF8toUTF16(cp, sd); + }); + if (i !== length) + throw RangeError("Illegal range: Truncated data, "+i+" == "+length); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + "string": sd(), + "length": offset - start + }; + } + } else if (metrics === ByteBuffer.METRICS_BYTES) { + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + length > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+length+") <= "+this.buffer.byteLength); + } + var k = offset + length; + utfx.decodeUTF8toUTF16(function() { + return offset < k ? this.view[offset++] : null; + }.bind(this), sd = stringDestination(), this.noAssert); + if (offset !== k) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+k); + if (relative) { + this.offset = offset; + return sd(); + } else { + return { + 'string': sd(), + 'length': offset - start + }; + } + } else + throw TypeError("Unsupported metrics: "+metrics); + }; + + /** + * Reads an UTF8 encoded string. This is an alias of {@link ByteBuffer#readUTF8String}. + * @function + * @param {number} length Number of characters or bytes to read + * @param {number=} metrics Metrics specifying what `n` is meant to count. Defaults to + * {@link ByteBuffer.METRICS_CHARS}. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + */ + ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String; + + // types/strings/vstring + + /** + * Writes a length as varint32 prefixed UTF8 encoded string. + * @param {string} str String to write + * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written + * @expose + * @see ByteBuffer#writeVarint32 + */ + ByteBufferPrototype.writeVString = function(str, offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + var start = offset, + k, l; + k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1]; + l = ByteBuffer.calculateVarint32(k); + offset += l+k; + var capacity15 = this.buffer.byteLength; + if (offset > capacity15) + this.resize((capacity15 *= 2) > offset ? capacity15 : offset); + offset -= l+k; + offset += this.writeVarint32(k, offset); + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + this.view[offset++] = b; + }.bind(this)); + if (offset !== start+k+l) + throw RangeError("Illegal range: Truncated data, "+offset+" == "+(offset+k+l)); + if (relative) { + this.offset = offset; + return this; + } + return offset - start; + }; + + /** + * Reads a length as varint32 prefixed UTF8 encoded string. + * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string + * read and the actual number of bytes read. + * @expose + * @see ByteBuffer#readVarint32 + */ + ByteBufferPrototype.readVString = function(offset) { + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 1 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+1+") <= "+this.buffer.byteLength); + } + var start = offset; + var len = this.readVarint32(offset); + var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']); + offset += str['length']; + if (relative) { + this.offset = offset; + return str['string']; + } else { + return { + 'string': str['string'], + 'length': offset - start + }; + } + }; + + + /** + * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended + * data's length. + * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to append. If `source` is a ByteBuffer, its offsets + * will be modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to append at. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. + * @returns {!ByteBuffer} this + * @expose + * @example A relative `<01 02>03.append(<04 05>)` will result in `<01 02 04 05>, 04 05|` + * @example An absolute `<01 02>03.append(04 05>, 1)` will result in `<01 04>05, 04 05|` + */ + ByteBufferPrototype.append = function(source, encoding, offset) { + if (typeof encoding === 'number' || typeof encoding !== 'string') { + offset = encoding; + encoding = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (!(source instanceof ByteBuffer)) + source = ByteBuffer.wrap(source, encoding); + var length = source.limit - source.offset; + if (length <= 0) return this; // Nothing to append + offset += length; + var capacity16 = this.buffer.byteLength; + if (offset > capacity16) + this.resize((capacity16 *= 2) > offset ? capacity16 : offset); + offset -= length; + this.view.set(source.view.subarray(source.offset, source.limit), offset); + source.offset += length; + if (relative) this.offset += length; + return this; + }; + + /** + * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the + specified offset up to the length of this ByteBuffer's data. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * read if omitted. + * @returns {!ByteBuffer} this + * @expose + * @see ByteBuffer#append + */ + ByteBufferPrototype.appendTo = function(target, offset) { + target.append(this, offset); + return this; + }; + + /** + * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to + * disable them if your code already makes sure that everything is valid. + * @param {boolean} assert `true` to enable assertions, otherwise `false` + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.assert = function(assert) { + this.noAssert = !assert; + return this; + }; + + /** + * Gets the capacity of this ByteBuffer's backing buffer. + * @returns {number} Capacity of the backing buffer + * @expose + */ + ByteBufferPrototype.capacity = function() { + return this.buffer.byteLength; + }; + /** + * Clears this ByteBuffer's offsets by setting {@link ByteBuffer#offset} to `0` and {@link ByteBuffer#limit} to the + * backing buffer's capacity. Discards {@link ByteBuffer#markedOffset}. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.clear = function() { + this.offset = 0; + this.limit = this.buffer.byteLength; + this.markedOffset = -1; + return this; + }; + + /** + * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for {@link ByteBuffer#offset}, + * {@link ByteBuffer#markedOffset} and {@link ByteBuffer#limit}. + * @param {boolean=} copy Whether to copy the backing buffer or to return another view on the same, defaults to `false` + * @returns {!ByteBuffer} Cloned instance + * @expose + */ + ByteBufferPrototype.clone = function(copy) { + var bb = new ByteBuffer(0, this.littleEndian, this.noAssert); + if (copy) { + bb.buffer = new ArrayBuffer(this.buffer.byteLength); + bb.view = new Uint8Array(bb.buffer); + } else { + bb.buffer = this.buffer; + bb.view = this.view; + } + bb.offset = this.offset; + bb.markedOffset = this.markedOffset; + bb.limit = this.limit; + return bb; + }; + + /** + * Compacts this ByteBuffer to be backed by a {@link ByteBuffer#buffer} of its contents' length. Contents are the bytes + * between {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will set `offset = 0` and `limit = capacity` and + * adapt {@link ByteBuffer#markedOffset} to the same relative position if set. + * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.compact = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === 0 && end === this.buffer.byteLength) + return this; // Already compacted + var len = end - begin; + if (len === 0) { + this.buffer = EMPTY_BUFFER; + this.view = null; + if (this.markedOffset >= 0) this.markedOffset -= begin; + this.offset = 0; + this.limit = 0; + return this; + } + var buffer = new ArrayBuffer(len); + var view = new Uint8Array(buffer); + view.set(this.view.subarray(begin, end)); + this.buffer = buffer; + this.view = view; + if (this.markedOffset >= 0) this.markedOffset -= begin; + this.offset = 0; + this.limit = len; + return this; + }; + + /** + * Creates a copy of this ByteBuffer's contents. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}. + * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} Copy + * @expose + */ + ByteBufferPrototype.copy = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === end) + return new ByteBuffer(0, this.littleEndian, this.noAssert); + var capacity = end - begin, + bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert); + bb.offset = 0; + bb.limit = capacity; + if (bb.markedOffset >= 0) bb.markedOffset -= begin; + this.copyTo(bb, 0, begin, end); + return bb; + }; + + /** + * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} targetOffset Offset to copy to. Will use and increase the target's {@link ByteBuffer#offset} + * by the number of bytes copied if omitted. + * @param {number=} sourceOffset Offset to start copying from. Will use and increase {@link ByteBuffer#offset} by the + * number of bytes copied if omitted. + * @param {number=} sourceLimit Offset to end copying from, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) { + var relative, + targetRelative; + if (!this.noAssert) { + if (!ByteBuffer.isByteBuffer(target)) + throw TypeError("Illegal target: Not a ByteBuffer"); + } + targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0; + sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0; + sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0; + + if (targetOffset < 0 || targetOffset > target.buffer.byteLength) + throw RangeError("Illegal target range: 0 <= "+targetOffset+" <= "+target.buffer.byteLength); + if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength) + throw RangeError("Illegal source range: 0 <= "+sourceOffset+" <= "+this.buffer.byteLength); + + var len = sourceLimit - sourceOffset; + if (len === 0) + return target; // Nothing to copy + + target.ensureCapacity(targetOffset + len); + + target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset); + + if (relative) this.offset += len; + if (targetRelative) target.offset += len; + + return this; + }; + + /** + * Makes sure that this ByteBuffer is backed by a {@link ByteBuffer#buffer} of at least the specified capacity. If the + * current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity, + * the required capacity will be used instead. + * @param {number} capacity Required capacity + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.ensureCapacity = function(capacity) { + var current = this.buffer.byteLength; + if (current < capacity) + return this.resize((current *= 2) > capacity ? current : capacity); + return this; + }; + + /** + * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. + * @param {number|string} value Byte value to fill with. If given as a string, the first character is used. + * @param {number=} begin Begin offset. Will use and increase {@link ByteBuffer#offset} by the number of bytes + * written if omitted. defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} this + * @expose + * @example `someByteBuffer.clear().fill(0)` fills the entire backing buffer with zeroes + */ + ByteBufferPrototype.fill = function(value, begin, end) { + var relative = typeof begin === 'undefined'; + if (relative) begin = this.offset; + if (typeof value === 'string' && value.length > 0) + value = value.charCodeAt(0); + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof value !== 'number' || value % 1 !== 0) + throw TypeError("Illegal value: "+value+" (not an integer)"); + value |= 0; + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin >= end) + return this; // Nothing to fill + while (begin < end) this.view[begin++] = value; + if (relative) this.offset = begin; + return this; + }; + + /** + * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets `limit = offset` and + * `offset = 0`. Make sure always to flip a ByteBuffer when all relative read or write operations are complete. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.flip = function() { + this.limit = this.offset; + this.offset = 0; + return this; + }; + /** + * Marks an offset on this ByteBuffer to be used later. + * @param {number=} offset Offset to mark. Defaults to {@link ByteBuffer#offset}. + * @returns {!ByteBuffer} this + * @throws {TypeError} If `offset` is not a valid number + * @throws {RangeError} If `offset` is out of bounds + * @see ByteBuffer#reset + * @expose + */ + ByteBufferPrototype.mark = function(offset) { + offset = typeof offset === 'undefined' ? this.offset : offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + this.markedOffset = offset; + return this; + }; + /** + * Sets the byte order. + * @param {boolean} littleEndian `true` for little endian byte order, `false` for big endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.order = function(littleEndian) { + if (!this.noAssert) { + if (typeof littleEndian !== 'boolean') + throw TypeError("Illegal littleEndian: Not a boolean"); + } + this.littleEndian = !!littleEndian; + return this; + }; + + /** + * Switches (to) little endian byte order. + * @param {boolean=} littleEndian Defaults to `true`, otherwise uses big endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.LE = function(littleEndian) { + this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true; + return this; + }; + + /** + * Switches (to) big endian byte order. + * @param {boolean=} bigEndian Defaults to `true`, otherwise uses little endian + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.BE = function(bigEndian) { + this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false; + return this; + }; + /** + * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the + * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer + * will be resized and its contents moved accordingly. + * @param {!ByteBuffer|string|!ArrayBuffer} source Data to prepend. If `source` is a ByteBuffer, its offset will be + * modified according to the performed read operation. + * @param {(string|number)=} encoding Encoding if `data` is a string ("base64", "hex", "binary", defaults to "utf8") + * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes + * prepended if omitted. + * @returns {!ByteBuffer} this + * @expose + * @example A relative `00<01 02 03>.prepend(<04 05>)` results in `<04 05 01 02 03>, 04 05|` + * @example An absolute `00<01 02 03>.prepend(<04 05>, 2)` results in `04<05 02 03>, 04 05|` + */ + ByteBufferPrototype.prepend = function(source, encoding, offset) { + if (typeof encoding === 'number' || typeof encoding !== 'string') { + offset = encoding; + encoding = undefined; + } + var relative = typeof offset === 'undefined'; + if (relative) offset = this.offset; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: "+offset+" (not an integer)"); + offset >>>= 0; + if (offset < 0 || offset + 0 > this.buffer.byteLength) + throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); + } + if (!(source instanceof ByteBuffer)) + source = ByteBuffer.wrap(source, encoding); + var len = source.limit - source.offset; + if (len <= 0) return this; // Nothing to prepend + var diff = len - offset; + if (diff > 0) { // Not enough space before offset, so resize + move + var buffer = new ArrayBuffer(this.buffer.byteLength + diff); + var view = new Uint8Array(buffer); + view.set(this.view.subarray(offset, this.buffer.byteLength), len); + this.buffer = buffer; + this.view = view; + this.offset += diff; + if (this.markedOffset >= 0) this.markedOffset += diff; + this.limit += diff; + offset += diff; + } else { + var arrayView = new Uint8Array(this.buffer); + } + this.view.set(source.view.subarray(source.offset, source.limit), offset - len); + + source.offset = source.limit; + if (relative) + this.offset -= len; + return this; + }; + + /** + * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the + * prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer + * will be resized and its contents moved accordingly. + * @param {!ByteBuffer} target Target ByteBuffer + * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes + * prepended if omitted. + * @returns {!ByteBuffer} this + * @expose + * @see ByteBuffer#prepend + */ + ByteBufferPrototype.prependTo = function(target, offset) { + target.prepend(this, offset); + return this; + }; + /** + * Prints debug information about this ByteBuffer's contents. + * @param {function(string)=} out Output function to call, defaults to console.log + * @expose + */ + ByteBufferPrototype.printDebug = function(out) { + if (typeof out !== 'function') out = console.log.bind(console); + out( + this.toString()+"\n"+ + "-------------------------------------------------------------------\n"+ + this.toDebug(/* columns */ true) + ); + }; + + /** + * Gets the number of remaining readable bytes. Contents are the bytes between {@link ByteBuffer#offset} and + * {@link ByteBuffer#limit}, so this returns `limit - offset`. + * @returns {number} Remaining readable bytes. May be negative if `offset > limit`. + * @expose + */ + ByteBufferPrototype.remaining = function() { + return this.limit - this.offset; + }; + /** + * Resets this ByteBuffer's {@link ByteBuffer#offset}. If an offset has been marked through {@link ByteBuffer#mark} + * before, `offset` will be set to {@link ByteBuffer#markedOffset}, which will then be discarded. If no offset has been + * marked, sets `offset = 0`. + * @returns {!ByteBuffer} this + * @see ByteBuffer#mark + * @expose + */ + ByteBufferPrototype.reset = function() { + if (this.markedOffset >= 0) { + this.offset = this.markedOffset; + this.markedOffset = -1; + } else { + this.offset = 0; + } + return this; + }; + /** + * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that + * large or larger. + * @param {number} capacity Capacity required + * @returns {!ByteBuffer} this + * @throws {TypeError} If `capacity` is not a number + * @throws {RangeError} If `capacity < 0` + * @expose + */ + ByteBufferPrototype.resize = function(capacity) { + if (!this.noAssert) { + if (typeof capacity !== 'number' || capacity % 1 !== 0) + throw TypeError("Illegal capacity: "+capacity+" (not an integer)"); + capacity |= 0; + if (capacity < 0) + throw RangeError("Illegal capacity: 0 <= "+capacity); + } + if (this.buffer.byteLength < capacity) { + var buffer = new ArrayBuffer(capacity); + var view = new Uint8Array(buffer); + view.set(this.view); + this.buffer = buffer; + this.view = view; + } + return this; + }; + /** + * Reverses this ByteBuffer's contents. + * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.reverse = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + if (begin === end) + return this; // Nothing to reverse + Array.prototype.reverse.call(this.view.subarray(begin, end)); + return this; + }; + /** + * Skips the next `length` bytes. This will just advance + * @param {number} length Number of bytes to skip. May also be negative to move the offset back. + * @returns {!ByteBuffer} this + * @expose + */ + ByteBufferPrototype.skip = function(length) { + if (!this.noAssert) { + if (typeof length !== 'number' || length % 1 !== 0) + throw TypeError("Illegal length: "+length+" (not an integer)"); + length |= 0; + } + var offset = this.offset + length; + if (!this.noAssert) { + if (offset < 0 || offset > this.buffer.byteLength) + throw RangeError("Illegal length: 0 <= "+this.offset+" + "+length+" <= "+this.buffer.byteLength); + } + this.offset = offset; + return this; + }; + + /** + * Slices this ByteBuffer by creating a cloned instance with `offset = begin` and `limit = end`. + * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}. + * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}. + * @returns {!ByteBuffer} Clone of this ByteBuffer with slicing applied, backed by the same {@link ByteBuffer#buffer} + * @expose + */ + ByteBufferPrototype.slice = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var bb = this.clone(); + bb.offset = begin; + bb.limit = end; + return bb; + }; + /** + * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. + * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory if + * possible. Defaults to `false` + * @returns {!ArrayBuffer} Contents as an ArrayBuffer + * @expose + */ + ByteBufferPrototype.toBuffer = function(forceCopy) { + var offset = this.offset, + limit = this.limit; + if (!this.noAssert) { + if (typeof offset !== 'number' || offset % 1 !== 0) + throw TypeError("Illegal offset: Not an integer"); + offset >>>= 0; + if (typeof limit !== 'number' || limit % 1 !== 0) + throw TypeError("Illegal limit: Not an integer"); + limit >>>= 0; + if (offset < 0 || offset > limit || limit > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+offset+" <= "+limit+" <= "+this.buffer.byteLength); + } + // NOTE: It's not possible to have another ArrayBuffer reference the same memory as the backing buffer. This is + // possible with Uint8Array#subarray only, but we have to return an ArrayBuffer by contract. So: + if (!forceCopy && offset === 0 && limit === this.buffer.byteLength) + return this.buffer; + if (offset === limit) + return EMPTY_BUFFER; + var buffer = new ArrayBuffer(limit - offset); + new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0); + return buffer; + }; + + /** + * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between + * {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. This is an alias of {@link ByteBuffer#toBuffer}. + * @function + * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory. + * Defaults to `false` + * @returns {!ArrayBuffer} Contents as an ArrayBuffer + * @expose + */ + ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer; + + /** + * Converts the ByteBuffer's contents to a string. + * @param {string=} encoding Output encoding. Returns an informative string representation if omitted but also allows + * direct conversion to "utf8", "hex", "base64" and "binary" encoding. "debug" returns a hex representation with + * highlighted offsets. + * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset} + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit} + * @returns {string} String representation + * @throws {Error} If `encoding` is invalid + * @expose + */ + ByteBufferPrototype.toString = function(encoding, begin, end) { + if (typeof encoding === 'undefined') + return "ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")"; + if (typeof encoding === 'number') + encoding = "utf8", + begin = encoding, + end = begin; + switch (encoding) { + case "utf8": + return this.toUTF8(begin, end); + case "base64": + return this.toBase64(begin, end); + case "hex": + return this.toHex(begin, end); + case "binary": + return this.toBinary(begin, end); + case "debug": + return this.toDebug(); + case "columns": + return this.toColumns(); + default: + throw Error("Unsupported encoding: "+encoding); + } + }; + + // lxiv-embeddable + + /** + * lxiv-embeddable (c) 2014 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/lxiv for details + */ + var lxiv = function() { + "use strict"; + + /** + * lxiv namespace. + * @type {!Object.} + * @exports lxiv + */ + var lxiv = {}; + + /** + * Character codes for output. + * @type {!Array.} + * @inner + */ + var aout = [ + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47 + ]; + + /** + * Character codes for input. + * @type {!Array.} + * @inner + */ + var ain = []; + for (var i=0, k=aout.length; i>2)&0x3f]); + t = (b&0x3)<<4; + if ((b = src()) !== null) { + t |= (b>>4)&0xf; + dst(aout[(t|((b>>4)&0xf))&0x3f]); + t = (b&0xf)<<2; + if ((b = src()) !== null) + dst(aout[(t|((b>>6)&0x3))&0x3f]), + dst(aout[b&0x3f]); + else + dst(aout[t&0x3f]), + dst(61); + } else + dst(aout[t&0x3f]), + dst(61), + dst(61); + } + }; + + /** + * Decodes base64 char codes to bytes. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. + * @throws {Error} If a character code is invalid + */ + lxiv.decode = function(src, dst) { + var c, t1, t2; + function fail(c) { + throw Error("Illegal character code: "+c); + } + while ((c = src()) !== null) { + t1 = ain[c]; + if (typeof t1 === 'undefined') fail(c); + if ((c = src()) !== null) { + t2 = ain[c]; + if (typeof t2 === 'undefined') fail(c); + dst((t1<<2)>>>0|(t2&0x30)>>4); + if ((c = src()) !== null) { + t1 = ain[c]; + if (typeof t1 === 'undefined') + if (c === 61) break; else fail(c); + dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2); + if ((c = src()) !== null) { + t2 = ain[c]; + if (typeof t2 === 'undefined') + if (c === 61) break; else fail(c); + dst(((t1&0x3)<<6)>>>0|t2); + } + } + } + } + }; + + /** + * Tests if a string is valid base64. + * @param {string} str String to test + * @returns {boolean} `true` if valid, otherwise `false` + */ + lxiv.test = function(str) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str); + }; + + return lxiv; + }(); + + // encodings/base64 + + /** + * Encodes this ByteBuffer's contents to a base64 encoded string. + * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}. + * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}. + * @returns {string} Base64 encoded string + * @throws {RangeError} If `begin` or `end` is out of bounds + * @expose + */ + ByteBufferPrototype.toBase64 = function(begin, end) { + if (typeof begin === 'undefined') + begin = this.offset; + if (typeof end === 'undefined') + end = this.limit; + begin = begin | 0; end = end | 0; + if (begin < 0 || end > this.capacity || begin > end) + throw RangeError("begin, end"); + var sd; lxiv.encode(function() { + return begin < end ? this.view[begin++] : null; + }.bind(this), sd = stringDestination()); + return sd(); + }; + + /** + * Decodes a base64 encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromBase64 = function(str, littleEndian) { + if (typeof str !== 'string') + throw TypeError("str"); + var bb = new ByteBuffer(str.length/4*3, littleEndian), + i = 0; + lxiv.decode(stringSource(str), function(b) { + bb.view[i++] = b; + }); + bb.limit = i; + return bb; + }; + + /** + * Encodes a binary string to base64 like `window.btoa` does. + * @param {string} str Binary string + * @returns {string} Base64 encoded string + * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa + * @expose + */ + ByteBuffer.btoa = function(str) { + return ByteBuffer.fromBinary(str).toBase64(); + }; + + /** + * Decodes a base64 encoded string to binary like `window.atob` does. + * @param {string} b64 Base64 encoded string + * @returns {string} Binary string + * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.atob + * @expose + */ + ByteBuffer.atob = function(b64) { + return ByteBuffer.fromBase64(b64).toBinary(); + }; + + // encodings/binary + + /** + * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes. + * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}. + * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}. + * @returns {string} Binary encoded string + * @throws {RangeError} If `offset > limit` + * @expose + */ + ByteBufferPrototype.toBinary = function(begin, end) { + if (typeof begin === 'undefined') + begin = this.offset; + if (typeof end === 'undefined') + end = this.limit; + begin |= 0; end |= 0; + if (begin < 0 || end > this.capacity() || begin > end) + throw RangeError("begin, end"); + if (begin === end) + return ""; + var chars = [], + parts = []; + while (begin < end) { + chars.push(this.view[begin++]); + if (chars.length >= 1024) + parts.push(String.fromCharCode.apply(String, chars)), + chars = []; + } + return parts.join('') + String.fromCharCode.apply(String, chars); + }; + + /** + * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromBinary = function(str, littleEndian) { + if (typeof str !== 'string') + throw TypeError("str"); + var i = 0, + k = str.length, + charCode, + bb = new ByteBuffer(k, littleEndian); + while (i 0xff) + throw RangeError("illegal char code: "+charCode); + bb.view[i++] = charCode; + } + bb.limit = k; + return bb; + }; + + // encodings/debug + + /** + * Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are: + * * `<` : offset, + * * `'` : markedOffset, + * * `>` : limit, + * * `|` : offset and limit, + * * `[` : offset and markedOffset, + * * `]` : markedOffset and limit, + * * `!` : offset, markedOffset and limit + * @param {boolean=} columns If `true` returns two columns hex + ascii, defaults to `false` + * @returns {string|!Array.} Debug string or array of lines if `asArray = true` + * @expose + * @example `>00'01 02<03` contains four bytes with `limit=0, markedOffset=1, offset=3` + * @example `00[01 02 03>` contains four bytes with `offset=markedOffset=1, limit=4` + * @example `00|01 02 03` contains four bytes with `offset=limit=1, markedOffset=-1` + * @example `|` contains zero bytes with `offset=limit=0, markedOffset=-1` + */ + ByteBufferPrototype.toDebug = function(columns) { + var i = -1, + k = this.buffer.byteLength, + b, + hex = "", + asc = "", + out = ""; + while (i 32 && b < 127 ? String.fromCharCode(b) : '.'; + } + ++i; + if (columns) { + if (i > 0 && i % 16 === 0 && i !== k) { + while (hex.length < 3*16+3) hex += " "; + out += hex+asc+"\n"; + hex = asc = ""; + } + } + if (i === this.offset && i === this.limit) + hex += i === this.markedOffset ? "!" : "|"; + else if (i === this.offset) + hex += i === this.markedOffset ? "[" : "<"; + else if (i === this.limit) + hex += i === this.markedOffset ? "]" : ">"; + else + hex += i === this.markedOffset ? "'" : (columns || (i !== 0 && i !== k) ? " " : ""); + } + if (columns && hex !== " ") { + while (hex.length < 3*16+3) + hex += " "; + out += hex + asc + "\n"; + } + return columns ? out : hex; + }; + + /** + * Decodes a hex encoded string with marked offsets to a ByteBuffer. + * @param {string} str Debug string to decode (not be generated with `columns = true`) + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + * @see ByteBuffer#toDebug + */ + ByteBuffer.fromDebug = function(str, littleEndian, noAssert) { + var k = str.length, + bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert); + var i = 0, j = 0, ch, b, + rs = false, // Require symbol next + ho = false, hm = false, hl = false, // Already has offset (ho), markedOffset (hm), limit (hl)? + fail = false; + while (i': + if (!noAssert) { + if (hl) { + fail = true; + break; + } + hl = true; + } + bb.limit = j; + rs = false; + break; + case "'": + if (!noAssert) { + if (hm) { + fail = true; + break; + } + hm = true; + } + bb.markedOffset = j; + rs = false; + break; + case ' ': + rs = false; + break; + default: + if (!noAssert) { + if (rs) { + fail = true; + break; + } + } + b = parseInt(ch+str.charAt(i++), 16); + if (!noAssert) { + if (isNaN(b) || b < 0 || b > 255) + throw TypeError("Illegal str: Not a debug encoded string"); + } + bb.view[j++] = b; + rs = true; + } + if (fail) + throw TypeError("Illegal str: Invalid symbol at "+i); + } + if (!noAssert) { + if (!ho || !hl) + throw TypeError("Illegal str: Missing offset or limit"); + if (j>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var out = new Array(end - begin), + b; + while (begin < end) { + b = this.view[begin++]; + if (b < 0x10) + out.push("0", b.toString(16)); + else out.push(b.toString(16)); + } + return out.join(''); + }; + + /** + * Decodes a hex encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromHex = function(str, littleEndian, noAssert) { + if (!noAssert) { + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + if (str.length % 2 !== 0) + throw TypeError("Illegal str: Length not a multiple of 2"); + } + var k = str.length, + bb = new ByteBuffer((k / 2) | 0, littleEndian), + b; + for (var i=0, j=0; i 255) + throw TypeError("Illegal str: Contains non-hex characters"); + bb.view[j++] = b; + } + bb.limit = j; + return bb; + }; + + // utfx-embeddable + + /** + * utfx-embeddable (c) 2014 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/utfx for details + */ + var utfx = function() { + "use strict"; + + /** + * utfx namespace. + * @inner + * @type {!Object.} + */ + var utfx = {}; + + /** + * Maximum valid code point. + * @type {number} + * @const + */ + utfx.MAX_CODEPOINT = 0x10FFFF; + + /** + * Encodes UTF8 code points to UTF8 bytes. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte + */ + utfx.encodeUTF8 = function(src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, + src = function() { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp < 0x80) + dst(cp&0x7F); + else if (cp < 0x800) + dst(((cp>>6)&0x1F)|0xC0), + dst((cp&0x3F)|0x80); + else if (cp < 0x10000) + dst(((cp>>12)&0x0F)|0xE0), + dst(((cp>>6)&0x3F)|0x80), + dst((cp&0x3F)|0x80); + else + dst(((cp>>18)&0x07)|0xF0), + dst(((cp>>12)&0x3F)|0x80), + dst(((cp>>6)&0x3F)|0x80), + dst((cp&0x3F)|0x80); + cp = null; + } + }; + + /** + * Decodes UTF8 bytes to UTF8 code points. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the + * remaining bytes. + */ + utfx.decodeUTF8 = function(src, dst) { + var a, b, c, d, fail = function(b) { + b = b.slice(0, b.indexOf(null)); + var err = Error(b.toString()); + err.name = "TruncatedError"; + err['bytes'] = b; + throw err; + }; + while ((a = src()) !== null) { + if ((a&0x80) === 0) + dst(a); + else if ((a&0xE0) === 0xC0) + ((b = src()) === null) && fail([a, b]), + dst(((a&0x1F)<<6) | (b&0x3F)); + else if ((a&0xF0) === 0xE0) + ((b=src()) === null || (c=src()) === null) && fail([a, b, c]), + dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F)); + else if ((a&0xF8) === 0xF0) + ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]), + dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F)); + else throw RangeError("Illegal starting byte: "+a); + } + }; + + /** + * Converts UTF16 characters to UTF8 code points. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @param {!function(number)} dst Code points destination as a function successively called with each converted code + * point. + */ + utfx.UTF16toUTF8 = function(src, dst) { + var c1, c2 = null; + while (true) { + if ((c1 = c2 !== null ? c2 : src()) === null) + break; + if (c1 >= 0xD800 && c1 <= 0xDFFF) { + if ((c2 = src()) !== null) { + if (c2 >= 0xDC00 && c2 <= 0xDFFF) { + dst((c1-0xD800)*0x400+c2-0xDC00+0x10000); + c2 = null; continue; + } + } + } + dst(c1); + } + if (c2 !== null) dst(c2); + }; + + /** + * Converts UTF8 code points to UTF16 characters. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a code point is out of range + */ + utfx.UTF8toUTF16 = function(src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, src = function() { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp <= 0xFFFF) + dst(cp); + else + cp -= 0x10000, + dst((cp>>10)+0xD800), + dst((cp%0x400)+0xDC00); + cp = null; + } + }; + + /** + * Converts and encodes UTF16 characters to UTF8 bytes. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null` + * if there are no more characters left. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. + */ + utfx.encodeUTF16toUTF8 = function(src, dst) { + utfx.UTF16toUTF8(src, function(cp) { + utfx.encodeUTF8(cp, dst); + }); + }; + + /** + * Decodes and converts UTF8 bytes to UTF16 characters. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes. + */ + utfx.decodeUTF8toUTF16 = function(src, dst) { + utfx.decodeUTF8(src, function(cp) { + utfx.UTF8toUTF16(cp, dst); + }); + }; + + /** + * Calculates the byte length of an UTF8 code point. + * @param {number} cp UTF8 code point + * @returns {number} Byte length + */ + utfx.calculateCodePoint = function(cp) { + return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + }; + + /** + * Calculates the number of UTF8 bytes required to store UTF8 code points. + * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively + * `null` if there are no more code points left. + * @returns {number} The number of UTF8 bytes required + */ + utfx.calculateUTF8 = function(src) { + var cp, l=0; + while ((cp = src()) !== null) + l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + return l; + }; + + /** + * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes. + * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1. + */ + utfx.calculateUTF16asUTF8 = function(src) { + var n=0, l=0; + utfx.UTF16toUTF8(src, function(cp) { + ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + }); + return [n,l]; + }; + + return utfx; + }(); + + // encodings/utf8 + + /** + * Encodes this ByteBuffer's contents between {@link ByteBuffer#offset} and {@link ByteBuffer#limit} to an UTF8 encoded + * string. + * @returns {string} Hex encoded string + * @throws {RangeError} If `offset > limit` + * @expose + */ + ByteBufferPrototype.toUTF8 = function(begin, end) { + if (typeof begin === 'undefined') begin = this.offset; + if (typeof end === 'undefined') end = this.limit; + if (!this.noAssert) { + if (typeof begin !== 'number' || begin % 1 !== 0) + throw TypeError("Illegal begin: Not an integer"); + begin >>>= 0; + if (typeof end !== 'number' || end % 1 !== 0) + throw TypeError("Illegal end: Not an integer"); + end >>>= 0; + if (begin < 0 || begin > end || end > this.buffer.byteLength) + throw RangeError("Illegal range: 0 <= "+begin+" <= "+end+" <= "+this.buffer.byteLength); + } + var sd; try { + utfx.decodeUTF8toUTF16(function() { + return begin < end ? this.view[begin++] : null; + }.bind(this), sd = stringDestination()); + } catch (e) { + if (begin !== end) + throw RangeError("Illegal range: Truncated data, "+begin+" != "+end); + } + return sd(); + }; + + /** + * Decodes an UTF8 encoded string to a ByteBuffer. + * @param {string} str String to decode + * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to + * {@link ByteBuffer.DEFAULT_ENDIAN}. + * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to + * {@link ByteBuffer.DEFAULT_NOASSERT}. + * @returns {!ByteBuffer} ByteBuffer + * @expose + */ + ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) { + if (!noAssert) + if (typeof str !== 'string') + throw TypeError("Illegal str: Not a string"); + var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert), + i = 0; + utfx.encodeUTF16toUTF8(stringSource(str), function(b) { + bb.view[i++] = b; + }); + bb.limit = i; + return bb; + }; + + return ByteBuffer; + }); + }); + + var empty$1 = {}; + + + var empty$2 = Object.freeze({ + default: empty$1 + }); + + var require$$2 = ( empty$2 && empty$1 ) || empty$2; + + var protobufLight = createCommonjsModule(function (module) { + /* + Copyright 2013 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + /** + * @license protobuf.js (c) 2013 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/protobuf.js for details + */ + (function(global, factory) { + + /* AMD */ if (typeof undefined === 'function' && undefined["amd"]) + undefined(["bytebuffer"], factory); + /* CommonJS */ else if (typeof commonjsRequire === "function" && 'object' === "object" && module && module["exports"]) + module["exports"] = factory(bytebuffer, true); + /* Global */ else + (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]); + + })(commonjsGlobal, function(ByteBuffer, isCommonJS) { + "use strict"; + + /** + * The ProtoBuf namespace. + * @exports ProtoBuf + * @namespace + * @expose + */ + var ProtoBuf = {}; + + /** + * @type {!function(new: ByteBuffer, ...[*])} + * @expose + */ + ProtoBuf.ByteBuffer = ByteBuffer; + + /** + * @type {?function(new: Long, ...[*])} + * @expose + */ + ProtoBuf.Long = ByteBuffer.Long || null; + + /** + * ProtoBuf.js version. + * @type {string} + * @const + * @expose + */ + ProtoBuf.VERSION = "5.0.2"; + + /** + * Wire types. + * @type {Object.} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES = {}; + + /** + * Varint wire type. + * @type {number} + * @expose + */ + ProtoBuf.WIRE_TYPES.VARINT = 0; + + /** + * Fixed 64 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS64 = 1; + + /** + * Length delimited wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.LDELIM = 2; + + /** + * Start group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.STARTGROUP = 3; + + /** + * End group wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.ENDGROUP = 4; + + /** + * Fixed 32 bits wire type. + * @type {number} + * @const + * @expose + */ + ProtoBuf.WIRE_TYPES.BITS32 = 5; + + /** + * Packable wire types. + * @type {!Array.} + * @const + * @expose + */ + ProtoBuf.PACKABLE_WIRE_TYPES = [ + ProtoBuf.WIRE_TYPES.VARINT, + ProtoBuf.WIRE_TYPES.BITS64, + ProtoBuf.WIRE_TYPES.BITS32 + ]; + + /** + * Types. + * @dict + * @type {!Object.} + * @const + * @expose + */ + ProtoBuf.TYPES = { + // According to the protobuf spec. + "int32": { + name: "int32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "uint32": { + name: "uint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "sint32": { + name: "sint32", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "int64": { + name: "int64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "uint64": { + name: "uint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sint64": { + name: "sint64", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "bool": { + name: "bool", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: false + }, + "double": { + name: "double", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: 0 + }, + "string": { + name: "string", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: "" + }, + "bytes": { + name: "bytes", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null // overridden in the code, must be a unique instance + }, + "fixed32": { + name: "fixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "sfixed32": { + name: "sfixed32", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "fixed64": { + name: "fixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined + }, + "sfixed64": { + name: "sfixed64", + wireType: ProtoBuf.WIRE_TYPES.BITS64, + defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined + }, + "float": { + name: "float", + wireType: ProtoBuf.WIRE_TYPES.BITS32, + defaultValue: 0 + }, + "enum": { + name: "enum", + wireType: ProtoBuf.WIRE_TYPES.VARINT, + defaultValue: 0 + }, + "message": { + name: "message", + wireType: ProtoBuf.WIRE_TYPES.LDELIM, + defaultValue: null + }, + "group": { + name: "group", + wireType: ProtoBuf.WIRE_TYPES.STARTGROUP, + defaultValue: null + } + }; + + /** + * Valid map key types. + * @type {!Array.>} + * @const + * @expose + */ + ProtoBuf.MAP_KEY_TYPES = [ + ProtoBuf.TYPES["int32"], + ProtoBuf.TYPES["sint32"], + ProtoBuf.TYPES["sfixed32"], + ProtoBuf.TYPES["uint32"], + ProtoBuf.TYPES["fixed32"], + ProtoBuf.TYPES["int64"], + ProtoBuf.TYPES["sint64"], + ProtoBuf.TYPES["sfixed64"], + ProtoBuf.TYPES["uint64"], + ProtoBuf.TYPES["fixed64"], + ProtoBuf.TYPES["bool"], + ProtoBuf.TYPES["string"], + ProtoBuf.TYPES["bytes"] + ]; + + /** + * Minimum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MIN = 1; + + /** + * Maximum field id. + * @type {number} + * @const + * @expose + */ + ProtoBuf.ID_MAX = 0x1FFFFFFF; + + /** + * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`. + * Must be set prior to parsing. + * @type {boolean} + * @expose + */ + ProtoBuf.convertFieldsToCamelCase = false; + + /** + * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by + * setting this to `false` prior to building messages. + * @type {boolean} + * @expose + */ + ProtoBuf.populateAccessors = true; + + /** + * By default, messages are populated with default values if a field is not present on the wire. To disable + * this behavior, set this setting to `false`. + * @type {boolean} + * @expose + */ + ProtoBuf.populateDefaults = true; + + /** + * @alias ProtoBuf.Util + * @expose + */ + ProtoBuf.Util = (function() { + "use strict"; + + /** + * ProtoBuf utilities. + * @exports ProtoBuf.Util + * @namespace + */ + var Util = {}; + + /** + * Flag if running in node or not. + * @type {boolean} + * @const + * @expose + */ + Util.IS_NODE = !!( + typeof process === 'object' && process+'' === '[object process]' && !process['browser'] + ); + + /** + * Constructs a XMLHttpRequest object. + * @return {XMLHttpRequest} + * @throws {Error} If XMLHttpRequest is not supported + * @expose + */ + Util.XHR = function() { + // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html + var XMLHttpFactories = [ + function () {return new XMLHttpRequest()}, + function () {return new ActiveXObject("Msxml2.XMLHTTP")}, + function () {return new ActiveXObject("Msxml3.XMLHTTP")}, + function () {return new ActiveXObject("Microsoft.XMLHTTP")} + ]; + /** @type {?XMLHttpRequest} */ + var xhr = null; + for (var i=0;i} + * @expose + */ + ProtoBuf.Lang = { + + // Characters always ending a statement + DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g, + + // Field rules + RULE: /^(?:required|optional|repeated|map)$/, + + // Field types + TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/, + + // Names + NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/, + + // Type definitions + TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/, + + // Type references + TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/, + + // Fully qualified type references + FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/, + + // All numbers + NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/, + + // Decimal numbers + NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/, + + // Hexadecimal numbers + NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/, + + // Octal numbers + NUMBER_OCT: /^0[0-7]+$/, + + // Floating point numbers + NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/, + + // Booleans + BOOL: /^(?:true|false)$/i, + + // Id numbers + ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Negative id numbers (enum values) + NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/, + + // Whitespaces + WHITESPACE: /\s/, + + // All strings + STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, + + // Double quoted strings + STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, + + // Single quoted strings + STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g + }; + + + /** + * @alias ProtoBuf.Reflect + * @expose + */ + ProtoBuf.Reflect = (function(ProtoBuf) { + "use strict"; + + /** + * Reflection types. + * @exports ProtoBuf.Reflect + * @namespace + */ + var Reflect = {}; + + /** + * Constructs a Reflect base class. + * @exports ProtoBuf.Reflect.T + * @constructor + * @abstract + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.T} parent Parent object + * @param {string} name Object name + */ + var T = function(builder, parent, name) { + + /** + * Builder reference. + * @type {!ProtoBuf.Builder} + * @expose + */ + this.builder = builder; + + /** + * Parent object. + * @type {?ProtoBuf.Reflect.T} + * @expose + */ + this.parent = parent; + + /** + * Object name in namespace. + * @type {string} + * @expose + */ + this.name = name; + + /** + * Fully qualified class name + * @type {string} + * @expose + */ + this.className; + }; + + /** + * @alias ProtoBuf.Reflect.T.prototype + * @inner + */ + var TPrototype = T.prototype; + + /** + * Returns the fully qualified name of this object. + * @returns {string} Fully qualified name as of ".PATH.TO.THIS" + * @expose + */ + TPrototype.fqn = function() { + var name = this.name, + ptr = this; + do { + ptr = ptr.parent; + if (ptr == null) + break; + name = ptr.name+"."+name; + } while (true); + return name; + }; + + /** + * Returns a string representation of this Reflect object (its fully qualified name). + * @param {boolean=} includeClass Set to true to include the class name. Defaults to false. + * @return String representation + * @expose + */ + TPrototype.toString = function(includeClass) { + return (includeClass ? this.className + " " : "") + this.fqn(); + }; + + /** + * Builds this type. + * @throws {Error} If this type cannot be built directly + * @expose + */ + TPrototype.build = function() { + throw Error(this.toString(true)+" cannot be built directly"); + }; + + /** + * @alias ProtoBuf.Reflect.T + * @expose + */ + Reflect.T = T; + + /** + * Constructs a new Namespace. + * @exports ProtoBuf.Reflect.Namespace + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent + * @param {string} name Namespace name + * @param {Object.=} options Namespace options + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Namespace = function(builder, parent, name, options, syntax) { + T.call(this, builder, parent, name); + + /** + * @override + */ + this.className = "Namespace"; + + /** + * Children inside the namespace. + * @type {!Array.} + */ + this.children = []; + + /** + * Options. + * @type {!Object.} + */ + this.options = options || {}; + + /** + * Syntax level (e.g., proto2 or proto3). + * @type {!string} + */ + this.syntax = syntax || "proto2"; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace.prototype + * @inner + */ + var NamespacePrototype = Namespace.prototype = Object.create(T.prototype); + + /** + * Returns an array of the namespace's children. + * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children). + * @return {Array.} + * @expose + */ + NamespacePrototype.getChildren = function(type) { + type = type || null; + if (type == null) + return this.children.slice(); + var children = []; + for (var i=0, k=this.children.length; i} qn Qualified name to resolve + * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false` + * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found + * @expose + */ + NamespacePrototype.resolve = function(qn, excludeNonNamespace) { + var part = typeof qn === 'string' ? qn.split(".") : qn, + ptr = this, + i = 0; + if (part[i] === "") { // Fully qualified name, e.g. ".My.Message' + while (ptr.parent !== null) + ptr = ptr.parent; + i++; + } + var child; + do { + do { + if (!(ptr instanceof Reflect.Namespace)) { + ptr = null; + break; + } + child = ptr.getChild(part[i]); + if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) { + ptr = null; + break; + } + ptr = child; i++; + } while (i < part.length); + if (ptr != null) + break; // Found + // Else search the parent + if (this.parent !== null) + return this.parent.resolve(qn, excludeNonNamespace); + } while (ptr != null); + return ptr; + }; + + /** + * Determines the shortest qualified name of the specified type, if any, relative to this namespace. + * @param {!ProtoBuf.Reflect.T} t Reflection type + * @returns {string} The shortest qualified name or, if there is none, the fqn + * @expose + */ + NamespacePrototype.qn = function(t) { + var part = [], ptr = t; + do { + part.unshift(ptr.name); + ptr = ptr.parent; + } while (ptr !== null); + for (var len=1; len <= part.length; len++) { + var qn = part.slice(part.length-len); + if (t === this.resolve(qn, t instanceof Reflect.Namespace)) + return qn.join("."); + } + return t.fqn(); + }; + + /** + * Builds the namespace and returns the runtime counterpart. + * @return {Object.} Runtime namespace + * @expose + */ + NamespacePrototype.build = function() { + /** @dict */ + var ns = {}; + var children = this.children; + for (var i=0, k=children.length, child; i} + */ + NamespacePrototype.buildOpt = function() { + var opt = {}, + keys = Object.keys(this.options); + for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option + */ + NamespacePrototype.getOption = function(name) { + if (typeof name === 'undefined') + return this.options; + return typeof this.options[name] !== 'undefined' ? this.options[name] : null; + }; + + /** + * @alias ProtoBuf.Reflect.Namespace + * @expose + */ + Reflect.Namespace = Namespace; + + /** + * Constructs a new Element implementation that checks and converts values for a + * particular field type, as appropriate. + * + * An Element represents a single value: either the value of a singular field, + * or a value contained in one entry of a repeated field or map field. This + * class does not implement these higher-level concepts; it only encapsulates + * the low-level typechecking and conversion. + * + * @exports ProtoBuf.Reflect.Element + * @param {{name: string, wireType: number}} type Resolved data type + * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant + * (e.g. submessage field). + * @param {boolean} isMapKey Is this element a Map key? The value will be + * converted to string form if so. + * @param {string} syntax Syntax level of defining message type, e.g., + * proto2 or proto3. + * @param {string} name Name of the field containing this element (for error + * messages) + * @constructor + */ + var Element = function(type, resolvedType, isMapKey, syntax, name) { + + /** + * Element type, as a string (e.g., int32). + * @type {{name: string, wireType: number}} + */ + this.type = type; + + /** + * Element type reference to submessage or enum definition, if needed. + * @type {ProtoBuf.Reflect.T|null} + */ + this.resolvedType = resolvedType; + + /** + * Element is a map key. + * @type {boolean} + */ + this.isMapKey = isMapKey; + + /** + * Syntax level of defining message type, e.g., proto2 or proto3. + * @type {string} + */ + this.syntax = syntax; + + /** + * Name of the field containing this element (for error messages) + * @type {string} + */ + this.name = name; + + if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0) + throw Error("Invalid map key type: " + type.name); + }; + + var ElementPrototype = Element.prototype; + + /** + * Obtains a (new) default value for the specified type. + * @param type {string|{name: string, wireType: number}} Field type + * @returns {*} Default value + * @inner + */ + function mkDefault(type) { + if (typeof type === 'string') + type = ProtoBuf.TYPES[type]; + if (typeof type.defaultValue === 'undefined') + throw Error("default value for type "+type.name+" is not supported"); + if (type == ProtoBuf.TYPES["bytes"]) + return new ByteBuffer(0); + return type.defaultValue; + } + + /** + * Returns the default value for this field in proto3. + * @function + * @param type {string|{name: string, wireType: number}} the field type + * @returns {*} Default value + */ + Element.defaultFieldValue = mkDefault; + + /** + * Makes a Long from a value. + * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for + * strings and numbers + * @returns {!Long} + * @throws {Error} If the value cannot be converted to a Long + * @inner + */ + function mkLong(value, unsigned) { + if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' + && value.low === value.low && value.high === value.high) + return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned); + if (typeof value === 'string') + return ProtoBuf.Long.fromString(value, unsigned || false, 10); + if (typeof value === 'number') + return ProtoBuf.Long.fromNumber(value, unsigned || false); + throw Error("not convertible to Long"); + } + + ElementPrototype.toString = function() { + return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element'; + }; + + /** + * Checks if the given value can be set for an element of this type (singular + * field or one element of a repeated field or map). + * @param {*} value Value to check + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be verified for this element slot + * @expose + */ + ElementPrototype.verifyValue = function(value) { + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + switch (this.type) { + // Signed 32bit + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + // Account for !NaN: value === value + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value > 4294967295 ? value | 0 : value; + + // Unsigned 32bit + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + if (typeof value !== 'number' || (value === value && value % 1 !== 0)) + fail(typeof value, "not an integer"); + return value < 0 ? value >>> 0 : value; + + // Signed 64bit + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, false); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Unsigned 64bit + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: { + if (ProtoBuf.Long) + try { + return mkLong(value, true); + } catch (e) { + fail(typeof value, e.message); + } + else + fail(typeof value, "requires Long.js"); + } + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value !== 'boolean') + fail(typeof value, "not a boolean"); + return value; + + // Float + case ProtoBuf.TYPES["float"]: + case ProtoBuf.TYPES["double"]: + if (typeof value !== 'number') + fail(typeof value, "not a number"); + return value; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + if (typeof value !== 'string' && !(value && value instanceof String)) + fail(typeof value, "not a string"); + return ""+value; // Convert String object to string + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (ByteBuffer.isByteBuffer(value)) + return value; + return ByteBuffer.wrap(value, "base64"); + + // Constant enum value + case ProtoBuf.TYPES["enum"]: { + var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value); + for (i=0; i 4294967295 || value < 0) + fail(typeof value, "not in range for uint32"); + return value; + } else { + // proto2 requires enum values to be valid. + fail(value, "not a valid enum value"); + } + } + // Embedded message + case ProtoBuf.TYPES["group"]: + case ProtoBuf.TYPES["message"]: { + if (!value || typeof value !== 'object') + fail(typeof value, "object expected"); + if (value instanceof this.resolvedType.clazz) + return value; + if (value instanceof ProtoBuf.Builder.Message) { + // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180) + var obj = {}; + for (var i in value) + if (value.hasOwnProperty(i)) + obj[i] = value[i]; + value = obj; + } + // Else let's try to construct one from a key-value object + return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons + } + } + + // We should never end here + throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")"); + }; + + /** + * Calculates the byte length of an element on the wire. + * @param {number} id Field number + * @param {*} value Field value + * @returns {number} Byte length + * @throws {Error} If the value cannot be calculated + * @expose + */ + ElementPrototype.calculateLength = function(id, value) { + if (value === null) return 0; // Nothing to encode + // Tag has already been written + var n; + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["uint32"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["sint32"]: + return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value)); + case ProtoBuf.TYPES["fixed32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["float"]: + return 4; + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + return ByteBuffer.calculateVarint64(value); + case ProtoBuf.TYPES["sint64"]: + return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value)); + case ProtoBuf.TYPES["fixed64"]: + case ProtoBuf.TYPES["sfixed64"]: + return 8; + case ProtoBuf.TYPES["bool"]: + return 1; + case ProtoBuf.TYPES["enum"]: + return ByteBuffer.calculateVarint32(value); + case ProtoBuf.TYPES["double"]: + return 8; + case ProtoBuf.TYPES["string"]: + n = ByteBuffer.calculateUTF8Bytes(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining(); + case ProtoBuf.TYPES["message"]: + n = this.resolvedType.calculate(value); + return ByteBuffer.calculateVarint32(n) + n; + case ProtoBuf.TYPES["group"]: + n = this.resolvedType.calculate(value); + return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + } + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + }; + + /** + * Encodes a value to the specified buffer. Does not encode the key. + * @param {number} id Field number + * @param {*} value Field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the value cannot be encoded + * @expose + */ + ElementPrototype.encodeValue = function(id, value, buffer) { + if (value === null) return buffer; // Nothing to encode + // Tag has already been written + + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes + // long – it is, effectively, treated like a very large unsigned integer." (see #122) + if (value < 0) + buffer.writeVarint64(value); + else + buffer.writeVarint32(value); + break; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + buffer.writeVarint32(value); + break; + + // 32bit varint zig-zag + case ProtoBuf.TYPES["sint32"]: + buffer.writeVarint32ZigZag(value); + break; + + // Fixed unsigned 32bit + case ProtoBuf.TYPES["fixed32"]: + buffer.writeUint32(value); + break; + + // Fixed signed 32bit + case ProtoBuf.TYPES["sfixed32"]: + buffer.writeInt32(value); + break; + + // 64bit varint as-is + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["uint64"]: + buffer.writeVarint64(value); // throws + break; + + // 64bit varint zig-zag + case ProtoBuf.TYPES["sint64"]: + buffer.writeVarint64ZigZag(value); // throws + break; + + // Fixed unsigned 64bit + case ProtoBuf.TYPES["fixed64"]: + buffer.writeUint64(value); // throws + break; + + // Fixed signed 64bit + case ProtoBuf.TYPES["sfixed64"]: + buffer.writeInt64(value); // throws + break; + + // Bool + case ProtoBuf.TYPES["bool"]: + if (typeof value === 'string') + buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value); + else + buffer.writeVarint32(value ? 1 : 0); + break; + + // Constant enum value + case ProtoBuf.TYPES["enum"]: + buffer.writeVarint32(value); + break; + + // 32bit float + case ProtoBuf.TYPES["float"]: + buffer.writeFloat32(value); + break; + + // 64bit float + case ProtoBuf.TYPES["double"]: + buffer.writeFloat64(value); + break; + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + buffer.writeVString(value); + break; + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: + if (value.remaining() < 0) + throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining"); + var prevOffset = value.offset; + buffer.writeVarint32(value.remaining()); + buffer.append(value); + value.offset = prevOffset; + break; + + // Embedded message + case ProtoBuf.TYPES["message"]: + var bb = new ByteBuffer().LE(); + this.resolvedType.encode(value, bb); + buffer.writeVarint32(bb.offset); + buffer.append(bb.flip()); + break; + + // Legacy group + case ProtoBuf.TYPES["group"]: + this.resolvedType.encode(value, buffer); + buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP); + break; + + default: + // We should never end here + throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)"); + } + return buffer; + }; + + /** + * Decode one element value from the specified buffer. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number} wireType The field wire type + * @param {number} id The field number + * @return {*} Decoded value + * @throws {Error} If the field cannot be decoded + * @expose + */ + ElementPrototype.decode = function(buffer, wireType, id) { + if (wireType != this.type.wireType) + throw Error("Unexpected wire type for element"); + + var value, nBytes; + switch (this.type) { + // 32bit signed varint + case ProtoBuf.TYPES["int32"]: + return buffer.readVarint32() | 0; + + // 32bit unsigned varint + case ProtoBuf.TYPES["uint32"]: + return buffer.readVarint32() >>> 0; + + // 32bit signed varint zig-zag + case ProtoBuf.TYPES["sint32"]: + return buffer.readVarint32ZigZag() | 0; + + // Fixed 32bit unsigned + case ProtoBuf.TYPES["fixed32"]: + return buffer.readUint32() >>> 0; + + case ProtoBuf.TYPES["sfixed32"]: + return buffer.readInt32() | 0; + + // 64bit signed varint + case ProtoBuf.TYPES["int64"]: + return buffer.readVarint64(); + + // 64bit unsigned varint + case ProtoBuf.TYPES["uint64"]: + return buffer.readVarint64().toUnsigned(); + + // 64bit signed varint zig-zag + case ProtoBuf.TYPES["sint64"]: + return buffer.readVarint64ZigZag(); + + // Fixed 64bit unsigned + case ProtoBuf.TYPES["fixed64"]: + return buffer.readUint64(); + + // Fixed 64bit signed + case ProtoBuf.TYPES["sfixed64"]: + return buffer.readInt64(); + + // Bool varint + case ProtoBuf.TYPES["bool"]: + return !!buffer.readVarint32(); + + // Constant enum value (varint) + case ProtoBuf.TYPES["enum"]: + // The following Builder.Message#set will already throw + return buffer.readVarint32(); + + // 32bit float + case ProtoBuf.TYPES["float"]: + return buffer.readFloat(); + + // 64bit float + case ProtoBuf.TYPES["double"]: + return buffer.readDouble(); + + // Length-delimited string + case ProtoBuf.TYPES["string"]: + return buffer.readVString(); + + // Length-delimited bytes + case ProtoBuf.TYPES["bytes"]: { + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + value = buffer.clone(); // Offset already set + value.limit = value.offset+nBytes; + buffer.offset += nBytes; + return value; + } + + // Length-delimited embedded message + case ProtoBuf.TYPES["message"]: { + nBytes = buffer.readVarint32(); + return this.resolvedType.decode(buffer, nBytes); + } + + // Legacy group + case ProtoBuf.TYPES["group"]: + return this.resolvedType.decode(buffer, -1, id); + } + + // We should never end here + throw Error("[INTERNAL] Illegal decode type"); + }; + + /** + * Converts a value from a string to the canonical element type. + * + * Legal only when isMapKey is true. + * + * @param {string} str The string value + * @returns {*} The value + */ + ElementPrototype.valueFromString = function(str) { + if (!this.isMapKey) { + throw Error("valueFromString() called on non-map-key element"); + } + + switch (this.type) { + case ProtoBuf.TYPES["int32"]: + case ProtoBuf.TYPES["sint32"]: + case ProtoBuf.TYPES["sfixed32"]: + case ProtoBuf.TYPES["uint32"]: + case ProtoBuf.TYPES["fixed32"]: + return this.verifyValue(parseInt(str)); + + case ProtoBuf.TYPES["int64"]: + case ProtoBuf.TYPES["sint64"]: + case ProtoBuf.TYPES["sfixed64"]: + case ProtoBuf.TYPES["uint64"]: + case ProtoBuf.TYPES["fixed64"]: + // Long-based fields support conversions from string already. + return this.verifyValue(str); + + case ProtoBuf.TYPES["bool"]: + return str === "true"; + + case ProtoBuf.TYPES["string"]: + return this.verifyValue(str); + + case ProtoBuf.TYPES["bytes"]: + return ByteBuffer.fromBinary(str); + } + }; + + /** + * Converts a value from the canonical element type to a string. + * + * It should be the case that `valueFromString(valueToString(val))` returns + * a value equivalent to `verifyValue(val)` for every legal value of `val` + * according to this element type. + * + * This may be used when the element must be stored or used as a string, + * e.g., as a map key on an Object. + * + * Legal only when isMapKey is true. + * + * @param {*} val The value + * @returns {string} The string form of the value. + */ + ElementPrototype.valueToString = function(value) { + if (!this.isMapKey) { + throw Error("valueToString() called on non-map-key element"); + } + + if (this.type === ProtoBuf.TYPES["bytes"]) { + return value.toString("binary"); + } else { + return value.toString(); + } + }; + + /** + * @alias ProtoBuf.Reflect.Element + * @expose + */ + Reflect.Element = Element; + + /** + * Constructs a new Message. + * @exports ProtoBuf.Reflect.Message + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace + * @param {string} name Message name + * @param {Object.=} options Message options + * @param {boolean=} isGroup `true` if this is a legacy group + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Message = function(builder, parent, name, options, isGroup, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Message"; + + /** + * Extensions range. + * @type {!Array.|undefined} + * @expose + */ + this.extensions = undefined; + + /** + * Runtime message class. + * @type {?function(new:ProtoBuf.Builder.Message)} + * @expose + */ + this.clazz = null; + + /** + * Whether this is a legacy group or not. + * @type {boolean} + * @expose + */ + this.isGroup = !!isGroup; + + // The following cached collections are used to efficiently iterate over or look up fields when decoding. + + /** + * Cached fields. + * @type {?Array.} + * @private + */ + this._fields = null; + + /** + * Cached fields by id. + * @type {?Object.} + * @private + */ + this._fieldsById = null; + + /** + * Cached fields by name. + * @type {?Object.} + * @private + */ + this._fieldsByName = null; + }; + + /** + * @alias ProtoBuf.Reflect.Message.prototype + * @inner + */ + var MessagePrototype = Message.prototype = Object.create(Namespace.prototype); + + /** + * Builds the message and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Message + * @param {boolean=} rebuild Whether to rebuild or not, defaults to false + * @return {ProtoBuf.Reflect.Message} Message class + * @throws {Error} If the message cannot be built + * @expose + */ + MessagePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Message class in its own scope + var clazz = (function(ProtoBuf, T) { + + var fields = T.getChildren(ProtoBuf.Reflect.Message.Field), + oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf); + + /** + * Constructs a new runtime Message. + * @name ProtoBuf.Builder.Message + * @class Barebone of all runtime messages. + * @param {!Object.|string} values Preset values + * @param {...string} var_args + * @constructor + * @throws {Error} If the message cannot be created + */ + var Message = function(values, var_args) { + ProtoBuf.Builder.Message.call(this); + + // Create virtual oneof properties + for (var i=0, k=oneofs.length; i 0) { + var value; + // Set field values from a values object + if (arguments.length === 1 && values !== null && typeof values === 'object' && + /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) && + /* not a repeated field */ !Array.isArray(values) && + /* not a Map */ !(values instanceof ProtoBuf.Map) && + /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) && + /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) && + /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) { + this.$set(values); + } else // Set field values from arguments, in declaration order + for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false` + * @returns {!ProtoBuf.Builder.Message} this + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.set = function(keyOrObj, value, noAssert) { + if (keyOrObj && typeof keyOrObj === 'object') { + noAssert = value; + for (var ikey in keyOrObj) { + // Check if virtual oneof field - don't set these + if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined) + this.$set(ikey, value, noAssert); + } + return this; + } + var field = T._fieldsByName[keyOrObj]; + if (!noAssert) { + if (!field) + throw Error(this+"#"+keyOrObj+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true)); + this[field.name] = (value = field.verifyValue(value)); // May throw + } else + this[keyOrObj] = value; + if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = this[field.oneof.name]; // Virtual field references currently set field + if (value !== null) { + if (currentField !== null && currentField !== field.name) + this[currentField] = null; // Clear currently set field + this[field.oneof.name] = field.name; // Point virtual field at this field + } else if (/* value === null && */currentField === keyOrObj) + this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared) + } + return this; + }; + + /** + * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}. + * @name ProtoBuf.Builder.Message#$set + * @function + * @param {string|!Object.} keyOrObj String key or plain object holding multiple values + * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted + * @param {boolean=} noAssert Whether to not assert the value, defaults to `false` + * @throws {Error} If the value cannot be set + * @expose + */ + MessagePrototype.$set = MessagePrototype.set; + + /** + * Gets a field's value. + * @name ProtoBuf.Builder.Message#get + * @function + * @param {string} key Key + * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false` + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.get = function(key, noAssert) { + if (noAssert) + return this[key]; + var field = T._fieldsByName[key]; + if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: undefined"); + if (!(field instanceof ProtoBuf.Reflect.Message.Field)) + throw Error(this+"#"+key+" is not a field: "+field.toString(true)); + return this[field.name]; + }; + + /** + * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}. + * @name ProtoBuf.Builder.Message#$get + * @function + * @param {string} key Key + * @return {*} Value + * @throws {Error} If there is no such field + * @expose + */ + MessagePrototype.$get = MessagePrototype.get; + + // Getters and setters + + for (var i=0; i} data Data payload + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @expose + */ + Message.encode = function(data, buffer, noVerify) { + return new Message(data).encode(buffer, noVerify); + }; + + /** + * Calculates the byte length of the message. + * @name ProtoBuf.Builder.Message#calculate + * @function + * @returns {number} Byte length + * @throws {Error} If the message cannot be calculated or if required fields are missing. + * @expose + */ + MessagePrototype.calculate = function() { + return T.calculate(this); + }; + + /** + * Encodes the varint32 length-delimited message. + * @name ProtoBuf.Builder.Message#encodeDelimited + * @function + * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted. + * @param {boolean=} noVerify Whether to not verify field values, defaults to `false` + * @return {!ByteBuffer} Encoded message as a ByteBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ByteBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeDelimited = function(buffer, noVerify) { + var isNew = false; + if (!buffer) + buffer = new ByteBuffer(), + isNew = true; + var enc = new ByteBuffer().LE(); + T.encode(this, enc, noVerify).flip(); + buffer.writeVarint32(enc.remaining()); + buffer.append(enc); + return isNew ? buffer.flip() : buffer; + }; + + /** + * Directly encodes the message to an ArrayBuffer. + * @name ProtoBuf.Builder.Message#encodeAB + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeAB = function() { + try { + return this.encode().toArrayBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer(); + throw(e); + } + }; + + /** + * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}. + * @name ProtoBuf.Builder.Message#toArrayBuffer + * @function + * @return {ArrayBuffer} Encoded message as ArrayBuffer + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded ArrayBuffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB; + + /** + * Directly encodes the message to a node Buffer. + * @name ProtoBuf.Builder.Message#encodeNB + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are + * missing. The later still returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeNB = function() { + try { + return this.encode().toBuffer(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer(); + throw(e); + } + }; + + /** + * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}. + * @name ProtoBuf.Builder.Message#toBuffer + * @function + * @return {!Buffer} + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded node Buffer in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBuffer = MessagePrototype.encodeNB; + + /** + * Directly encodes the message to a base64 encoded string. + * @name ProtoBuf.Builder.Message#encode64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encode64 = function() { + try { + return this.encode().toBase64(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toBase64(); + throw(e); + } + }; + + /** + * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}. + * @name ProtoBuf.Builder.Message#toBase64 + * @function + * @return {string} Base64 encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded base64 string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toBase64 = MessagePrototype.encode64; + + /** + * Directly encodes the message to a hex encoded string. + * @name ProtoBuf.Builder.Message#encodeHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later + * still returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.encodeHex = function() { + try { + return this.encode().toHex(); + } catch (e) { + if (e["encoded"]) e["encoded"] = e["encoded"].toHex(); + throw(e); + } + }; + + /** + * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}. + * @name ProtoBuf.Builder.Message#toHex + * @function + * @return {string} Hex encoded string + * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still + * returns the encoded hex string in the `encoded` property on the error. + * @expose + */ + MessagePrototype.toHex = MessagePrototype.encodeHex; + + /** + * Clones a message object or field value to a raw object. + * @param {*} obj Object to clone + * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field + * @returns {*} Cloned object + * @inner + */ + function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) { + if (obj === null || typeof obj !== 'object') { + // Convert enum values to their respective names + if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) { + var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj); + if (name !== null) + return name; + } + // Pass-through string, number, boolean, null... + return obj; + } + // Convert ByteBuffers to raw buffer or strings + if (ByteBuffer.isByteBuffer(obj)) + return binaryAsBase64 ? obj.toBase64() : obj.toBuffer(); + // Convert Longs to proper objects or strings + if (ProtoBuf.Long.isLong(obj)) + return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj); + var clone; + // Clone arrays + if (Array.isArray(obj)) { + clone = []; + obj.forEach(function(v, k) { + clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType); + }); + return clone; + } + clone = {}; + // Convert maps to objects + if (obj instanceof ProtoBuf.Map) { + var it = obj.entries(); + for (var e = it.next(); !e.done; e = it.next()) + clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType); + return clone; + } + // Everything else is a non-null object + var type = obj.$type, + field = undefined; + for (var i in obj) + if (obj.hasOwnProperty(i)) { + if (type && (field = type.getChild(i))) + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType); + else + clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings); + } + return clone; + } + + /** + * Returns the message's raw payload. + * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false` + * @param {boolean} longsAsStrings Whether to encode longs as strings + * @returns {Object.} Raw payload + * @expose + */ + MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) { + return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type); + }; + + /** + * Encodes a message to JSON. + * @returns {string} JSON string + * @expose + */ + MessagePrototype.encodeJSON = function() { + return JSON.stringify( + cloneRaw(this, + /* binary-as-base64 */ true, + /* longs-as-strings */ true, + this.$type + ) + ); + }; + + /** + * Decodes a message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decode + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {(number|string)=} length Message length. Defaults to decode all the remainig data. + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + * @see ProtoBuf.Builder.Message.decode64 + * @see ProtoBuf.Builder.Message.decodeHex + */ + Message.decode = function(buffer, length, enc) { + if (typeof length === 'string') + enc = length, + length = -1; + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + var le = buffer.littleEndian; + try { + var msg = T.decode(buffer.LE(), length); + buffer.LE(le); + return msg; + } catch (e) { + buffer.LE(le); + throw(e); + } + }; + + /** + * Decodes a varint32 length-delimited message from the specified buffer or string. + * @name ProtoBuf.Builder.Message.decodeDelimited + * @function + * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from + * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64 + * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeDelimited = function(buffer, enc) { + if (typeof buffer === 'string') + buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64"); + else if (!ByteBuffer.isByteBuffer(buffer)) + buffer = ByteBuffer.wrap(buffer); // May throw + if (buffer.remaining() < 1) + return null; + var off = buffer.offset, + len = buffer.readVarint32(); + if (buffer.remaining() < len) { + buffer.offset = off; + return null; + } + try { + var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE()); + buffer.offset += len; + return msg; + } catch (err) { + buffer.offset += len; + throw err; + } + }; + + /** + * Decodes the message from the specified base64 encoded string. + * @name ProtoBuf.Builder.Message.decode64 + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decode64 = function(str) { + return Message.decode(str, "base64"); + }; + + /** + * Decodes the message from the specified hex encoded string. + * @name ProtoBuf.Builder.Message.decodeHex + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still + * returns the decoded message with missing fields in the `decoded` property on the error. + * @expose + */ + Message.decodeHex = function(str) { + return Message.decode(str, "hex"); + }; + + /** + * Decodes the message from a JSON string. + * @name ProtoBuf.Builder.Message.decodeJSON + * @function + * @param {string} str String to decode from + * @return {!ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded or if required fields are + * missing. + * @expose + */ + Message.decodeJSON = function(str) { + return new Message(JSON.parse(str)); + }; + + // Utility + + /** + * Returns a string representation of this Message. + * @name ProtoBuf.Builder.Message#toString + * @function + * @return {string} String representation as of ".Fully.Qualified.MessageName" + * @expose + */ + MessagePrototype.toString = function() { + return T.toString(); + }; + + // Properties + + /** + * Message options. + * @name ProtoBuf.Builder.Message.$options + * @type {Object.} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Message options. + * @name ProtoBuf.Builder.Message#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message.$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Message#$type + * @type {!ProtoBuf.Reflect.Message} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Message, '$options', { "value": T.buildOpt() }), + Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }), + Object.defineProperty(Message, "$type", { "value": T }), + Object.defineProperty(MessagePrototype, "$type", { "value": T }); + + return Message; + + })(ProtoBuf, this); + + // Static enums and prototyped sub-messages / cached collections + this._fields = []; + this._fieldsById = {}; + this._fieldsByName = {}; + this._oneofsByName = {}; + for (var i=0, k=this.children.length, child; i>> 3; + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + do tag = buf.readUint8(); + while ((tag & 0x80) === 0x80); + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buf.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + tag = buf.readVarint32(); // reads the varint + buf.offset += tag; // skips n bytes + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + skipTillGroupEnd(id, buf); + break; + case ProtoBuf.WIRE_TYPES.ENDGROUP: + if (id === expectedId) + return false; + else + throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)"); + case ProtoBuf.WIRE_TYPES.BITS32: + buf.offset += 4; + break; + default: + throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType); + } + return true; + } + + /** + * Decodes an encoded message and returns the decoded message. + * @param {ByteBuffer} buffer ByteBuffer to decode from + * @param {number=} length Message length. Defaults to decode all remaining data. + * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group + * @return {ProtoBuf.Builder.Message} Decoded message + * @throws {Error} If the message cannot be decoded + * @expose + */ + MessagePrototype.decode = function(buffer, length, expectedGroupEndId) { + if (typeof length !== 'number') + length = -1; + var start = buffer.offset, + msg = new (this.clazz)(), + tag, wireType, id, field; + while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) { + tag = buffer.readVarint32(); + wireType = tag & 0x07; + id = tag >>> 3; + if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) { + if (id !== expectedGroupEndId) + throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")"); + break; + } + if (!(field = this._fieldsById[id])) { + // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing." + switch (wireType) { + case ProtoBuf.WIRE_TYPES.VARINT: + buffer.readVarint32(); + break; + case ProtoBuf.WIRE_TYPES.BITS32: + buffer.offset += 4; + break; + case ProtoBuf.WIRE_TYPES.BITS64: + buffer.offset += 8; + break; + case ProtoBuf.WIRE_TYPES.LDELIM: + var len = buffer.readVarint32(); + buffer.offset += len; + break; + case ProtoBuf.WIRE_TYPES.STARTGROUP: + while (skipTillGroupEnd(id, buffer)) {} + break; + default: + throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType); + } + continue; + } + if (field.repeated && !field.options["packed"]) { + msg[field.name].push(field.decode(wireType, buffer)); + } else if (field.map) { + var keyval = field.decode(wireType, buffer); + msg[field.name].set(keyval[0], keyval[1]); + } else { + msg[field.name] = field.decode(wireType, buffer); + if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field) + var currentField = msg[field.oneof.name]; // Virtual field references currently set field + if (currentField !== null && currentField !== field.name) + msg[currentField] = null; // Clear currently set field + msg[field.oneof.name] = field.name; // Point virtual field at this field + } + } + } + + // Check if all required fields are present and set default values for optional fields that are not + for (var i=0, k=this._fields.length; i=} options Options + * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf + * @param {string?} syntax The syntax level of this definition (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) { + T.call(this, builder, message, name); + + /** + * @override + */ + this.className = "Message.Field"; + + /** + * Message field required flag. + * @type {boolean} + * @expose + */ + this.required = rule === "required"; + + /** + * Message field repeated flag. + * @type {boolean} + * @expose + */ + this.repeated = rule === "repeated"; + + /** + * Message field map flag. + * @type {boolean} + * @expose + */ + this.map = rule === "map"; + + /** + * Message field key type. Type reference string if unresolved, protobuf + * type if resolved. Valid only if this.map === true, null otherwise. + * @type {string|{name: string, wireType: number}|null} + * @expose + */ + this.keyType = keytype || null; + + /** + * Message field type. Type reference string if unresolved, protobuf type if + * resolved. In a map field, this is the value type. + * @type {string|{name: string, wireType: number}} + * @expose + */ + this.type = type; + + /** + * Resolved type reference inside the global namespace. + * @type {ProtoBuf.Reflect.T|null} + * @expose + */ + this.resolvedType = null; + + /** + * Unique message field id. + * @type {number} + * @expose + */ + this.id = id; + + /** + * Message field options. + * @type {!Object.} + * @dict + * @expose + */ + this.options = options || {}; + + /** + * Default value. + * @type {*} + * @expose + */ + this.defaultValue = null; + + /** + * Enclosing OneOf. + * @type {?ProtoBuf.Reflect.Message.OneOf} + * @expose + */ + this.oneof = oneof || null; + + /** + * Syntax level of this definition (e.g., proto3). + * @type {string} + * @expose + */ + this.syntax = syntax || 'proto2'; + + /** + * Original field name. + * @type {string} + * @expose + */ + this.originalName = this.name; // Used to revert camelcase transformation on naming collisions + + /** + * Element implementation. Created in build() after types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.element = null; + + /** + * Key element implementation, for map fields. Created in build() after + * types are resolved. + * @type {ProtoBuf.Element} + * @expose + */ + this.keyElement = null; + + // Convert field names to camel case notation if the override is set + if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField)) + this.name = ProtoBuf.Util.toCamelCase(this.name); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field.prototype + * @inner + */ + var FieldPrototype = Field.prototype = Object.create(T.prototype); + + /** + * Builds the field. + * @override + * @expose + */ + FieldPrototype.build = function() { + this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name); + if (this.map) + this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name); + + // In proto3, fields do not have field presence, and every field is set to + // its type's default value ("", 0, 0.0, or false). + if (this.syntax === 'proto3' && !this.repeated && !this.map) + this.defaultValue = Element.defaultFieldValue(this.type); + + // Otherwise, default values are present when explicitly specified + else if (typeof this.options['default'] !== 'undefined') + this.defaultValue = this.verifyValue(this.options['default']); + }; + + /** + * Checks if the given value can be set for this field. + * @param {*} value Value to check + * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false. + * @return {*} Verified, maybe adjusted, value + * @throws {Error} If the value cannot be set for this field + * @expose + */ + FieldPrototype.verifyValue = function(value, skipRepeated) { + skipRepeated = skipRepeated || false; + var self = this; + function fail(val, msg) { + throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")"); + } + if (value === null) { // NULL values for optional fields + if (this.required) + fail(typeof value, "required"); + if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"]) + fail(typeof value, "proto3 field without field presence cannot be null"); + return null; + } + var i; + if (this.repeated && !skipRepeated) { // Repeated values as arrays + if (!Array.isArray(value)) + value = [value]; + var res = []; + for (i=0; i 0; + + case ProtoBuf.TYPES["bytes"]: + return value.remaining() > 0; + + case ProtoBuf.TYPES["enum"]: + return value !== 0; + + case ProtoBuf.TYPES["message"]: + return value !== null; + default: + return true; + } + }; + + /** + * Encodes the specified field value to the specified buffer. + * @param {*} value Verified field value + * @param {ByteBuffer} buffer ByteBuffer to encode to + * @param {!ProtoBuf.Builder.Message} message Runtime message + * @return {ByteBuffer} The ByteBuffer for chaining + * @throws {Error} If the field cannot be encoded + * @expose + */ + FieldPrototype.encode = function(value, buffer, message) { + if (this.type === null || typeof this.type !== 'object') + throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type); + if (value === null || (this.repeated && value.length == 0)) + return buffer; // Optional omitted + try { + if (this.repeated) { + var i; + // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire + // types) can be declared 'packed'." + if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) { + // "All of the elements of the field are packed into a single key-value pair with wire type 2 + // (length-delimited). Each element is encoded the same way it would be normally, except without a + // tag preceding it." + buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1 + var start = buffer.offset; // Remember where the contents begin + for (i=0; i 1) { // We need to move the contents + var contents = buffer.slice(start, buffer.offset); + start += varintLen-1; + buffer.offset = start; + buffer.append(contents); + } + buffer.writeVarint32(len, start-varintLen); + } else { + // "If your message definition has repeated elements (without the [packed=true] option), the encoded + // message has zero or more key-value pairs with the same tag number" + for (i=0; i= 0) { + n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM); + ni = 0; + for (i=0; i= 0) { + if (!skipRepeated) { + nBytes = buffer.readVarint32(); + nBytes = buffer.offset + nBytes; // Limit + var values = []; + while (buffer.offset < nBytes) + values.push(this.decode(this.type.wireType, buffer, true)); + return values; + } + // Read the next value otherwise... + } + + // Handle maps. + if (this.map) { + // Read one (key, value) submessage, and return [key, value] + var key = Element.defaultFieldValue(this.keyType); + value = Element.defaultFieldValue(this.type); + + // Read the length + nBytes = buffer.readVarint32(); + if (buffer.remaining() < nBytes) + throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining()); + + // Get a sub-buffer of this key/value submessage + var msgbuf = buffer.clone(); + msgbuf.limit = msgbuf.offset + nBytes; + buffer.offset += nBytes; + + while (msgbuf.remaining() > 0) { + var tag = msgbuf.readVarint32(); + wireType = tag & 0x07; + var id = tag >>> 3; + if (id === 1) { + key = this.keyElement.decode(msgbuf, wireType, id); + } else if (id === 2) { + value = this.element.decode(msgbuf, wireType, id); + } else { + throw Error("Unexpected tag in map field key/value submessage"); + } + } + + return [key, value]; + } + + // Handle singular and non-packed repeated field values. + return this.element.decode(buffer, wireType, this.id); + }; + + /** + * @alias ProtoBuf.Reflect.Message.Field + * @expose + */ + Reflect.Message.Field = Field; + + /** + * Constructs a new Message ExtensionField. + * @exports ProtoBuf.Reflect.Message.ExtensionField + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} rule Rule, one of requried, optional, repeated + * @param {string} type Data type, e.g. int32 + * @param {string} name Field name + * @param {number} id Unique field id + * @param {!Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Message.Field + */ + var ExtensionField = function(builder, message, rule, type, name, id, options) { + Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options); + + /** + * Extension reference. + * @type {!ProtoBuf.Reflect.Extension} + * @expose + */ + this.extension; + }; + + // Extends Field + ExtensionField.prototype = Object.create(Field.prototype); + + /** + * @alias ProtoBuf.Reflect.Message.ExtensionField + * @expose + */ + Reflect.Message.ExtensionField = ExtensionField; + + /** + * Constructs a new Message OneOf. + * @exports ProtoBuf.Reflect.Message.OneOf + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Message} message Message reference + * @param {string} name OneOf name + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var OneOf = function(builder, message, name) { + T.call(this, builder, message, name); + + /** + * Enclosed fields. + * @type {!Array.} + * @expose + */ + this.fields = []; + }; + + /** + * @alias ProtoBuf.Reflect.Message.OneOf + * @expose + */ + Reflect.Message.OneOf = OneOf; + + /** + * Constructs a new Enum. + * @exports ProtoBuf.Reflect.Enum + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object + * @param {string} name Enum name + * @param {Object.=} options Enum options + * @param {string?} syntax The syntax level (e.g., proto3) + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Enum = function(builder, parent, name, options, syntax) { + Namespace.call(this, builder, parent, name, options, syntax); + + /** + * @override + */ + this.className = "Enum"; + + /** + * Runtime enum object. + * @type {Object.|null} + * @expose + */ + this.object = null; + }; + + /** + * Gets the string name of an enum value. + * @param {!ProtoBuf.Builder.Enum} enm Runtime enum + * @param {number} value Enum value + * @returns {?string} Name or `null` if not present + * @expose + */ + Enum.getName = function(enm, value) { + var keys = Object.keys(enm); + for (var i=0, key; i} + * @expose + */ + EnumPrototype.build = function(rebuild) { + if (this.object && !rebuild) + return this.object; + var enm = new ProtoBuf.Builder.Enum(), + values = this.getChildren(Enum.Value); + for (var i=0, k=values.length; i=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Namespace + */ + var Service = function(builder, root, name, options) { + Namespace.call(this, builder, root, name, options); + + /** + * @override + */ + this.className = "Service"; + + /** + * Built runtime service class. + * @type {?function(new:ProtoBuf.Builder.Service)} + */ + this.clazz = null; + }; + + /** + * @alias ProtoBuf.Reflect.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(Namespace.prototype); + + /** + * Builds the service and returns the runtime counterpart, which is a fully functional class. + * @see ProtoBuf.Builder.Service + * @param {boolean=} rebuild Whether to rebuild or not + * @return {Function} Service class + * @throws {Error} If the message cannot be built + * @expose + */ + ServicePrototype.build = function(rebuild) { + if (this.clazz && !rebuild) + return this.clazz; + + // Create the runtime Service class in its own scope + return this.clazz = (function(ProtoBuf, T) { + + /** + * Constructs a new runtime Service. + * @name ProtoBuf.Builder.Service + * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message + * @class Barebone of all runtime services. + * @constructor + * @throws {Error} If the service cannot be created + */ + var Service = function(rpcImpl) { + ProtoBuf.Builder.Service.call(this); + + /** + * Service implementation. + * @name ProtoBuf.Builder.Service#rpcImpl + * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} + * @expose + */ + this.rpcImpl = rpcImpl || function(name, msg, callback) { + // This is what a user has to implement: A function receiving the method name, the actual message to + // send (type checked) and the callback that's either provided with the error as its first + // argument or null and the actual response message. + setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async! + }; + }; + + /** + * @alias ProtoBuf.Builder.Service.prototype + * @inner + */ + var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype); + + /** + * Asynchronously performs an RPC call using the given RPC implementation. + * @name ProtoBuf.Builder.Service.[Method] + * @function + * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + /** + * Asynchronously performs an RPC call using the instance's RPC implementation. + * @name ProtoBuf.Builder.Service#[Method] + * @function + * @param {ProtoBuf.Builder.Message} req Request + * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving + * the error if any and the response either as a pre-parsed message or as its raw bytes + * @abstract + */ + + var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod); + for (var i=0; i} + * @expose + */ + var $optionsS; // cc needs this + + /** + * Service options. + * @name ProtoBuf.Builder.Service#$options + * @type {Object.} + * @expose + */ + var $options; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service.$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $typeS; + + /** + * Reflection type. + * @name ProtoBuf.Builder.Service#$type + * @type {!ProtoBuf.Reflect.Service} + * @expose + */ + var $type; + + if (Object.defineProperty) + Object.defineProperty(Service, "$options", { "value": T.buildOpt() }), + Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }), + Object.defineProperty(Service, "$type", { "value": T }), + Object.defineProperty(ServicePrototype, "$type", { "value": T }); + + return Service; + + })(ProtoBuf, this); + }; + + /** + * @alias ProtoBuf.Reflect.Service + * @expose + */ + Reflect.Service = Service; + + /** + * Abstract service method. + * @exports ProtoBuf.Reflect.Service.Method + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.T + */ + var Method = function(builder, svc, name, options) { + T.call(this, builder, svc, name); + + /** + * @override + */ + this.className = "Service.Method"; + + /** + * Options. + * @type {Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Reflect.Service.Method.prototype + * @inner + */ + var MethodPrototype = Method.prototype = Object.create(T.prototype); + + /** + * Builds the method's '$options' property. + * @name ProtoBuf.Reflect.Service.Method#buildOpt + * @function + * @return {Object.} + */ + MethodPrototype.buildOpt = NamespacePrototype.buildOpt; + + /** + * @alias ProtoBuf.Reflect.Service.Method + * @expose + */ + Reflect.Service.Method = Method; + + /** + * RPC service method. + * @exports ProtoBuf.Reflect.Service.RPCMethod + * @param {!ProtoBuf.Builder} builder Builder reference + * @param {!ProtoBuf.Reflect.Service} svc Service + * @param {string} name Method name + * @param {string} request Request message name + * @param {string} response Response message name + * @param {boolean} request_stream Whether requests are streamed + * @param {boolean} response_stream Whether responses are streamed + * @param {Object.=} options Options + * @constructor + * @extends ProtoBuf.Reflect.Service.Method + */ + var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) { + Method.call(this, builder, svc, name, options); + + /** + * @override + */ + this.className = "Service.RPCMethod"; + + /** + * Request message name. + * @type {string} + * @expose + */ + this.requestName = request; + + /** + * Response message name. + * @type {string} + * @expose + */ + this.responseName = response; + + /** + * Whether requests are streamed + * @type {bool} + * @expose + */ + this.requestStream = request_stream; + + /** + * Whether responses are streamed + * @type {bool} + * @expose + */ + this.responseStream = response_stream; + + /** + * Resolved request message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedRequestType = null; + + /** + * Resolved response message type. + * @type {ProtoBuf.Reflect.Message} + * @expose + */ + this.resolvedResponseType = null; + }; + + // Extends Method + RPCMethod.prototype = Object.create(Method.prototype); + + /** + * @alias ProtoBuf.Reflect.Service.RPCMethod + * @expose + */ + Reflect.Service.RPCMethod = RPCMethod; + + return Reflect; + + })(ProtoBuf); + + /** + * @alias ProtoBuf.Builder + * @expose + */ + ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) { + "use strict"; + + /** + * Constructs a new Builder. + * @exports ProtoBuf.Builder + * @class Provides the functionality to build protocol messages. + * @param {Object.=} options Options + * @constructor + */ + var Builder = function(options) { + + /** + * Namespace. + * @type {ProtoBuf.Reflect.Namespace} + * @expose + */ + this.ns = new Reflect.Namespace(this, null, ""); // Global namespace + + /** + * Namespace pointer. + * @type {ProtoBuf.Reflect.T} + * @expose + */ + this.ptr = this.ns; + + /** + * Resolved flag. + * @type {boolean} + * @expose + */ + this.resolved = false; + + /** + * The current building result. + * @type {Object.|null} + * @expose + */ + this.result = null; + + /** + * Imported files. + * @type {Array.} + * @expose + */ + this.files = {}; + + /** + * Import root override. + * @type {?string} + * @expose + */ + this.importRoot = null; + + /** + * Options. + * @type {!Object.} + * @expose + */ + this.options = options || {}; + }; + + /** + * @alias ProtoBuf.Builder.prototype + * @inner + */ + var BuilderPrototype = Builder.prototype; + + // ----- Definition tests ----- + + /** + * Tests if a definition most likely describes a message. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessage = function(def) { + // Messages require a string name + if (typeof def["name"] !== 'string') + return false; + // Messages do not contain values (enum) or rpc methods (service) + if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a message field. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isMessageField = function(def) { + // Message fields require a string rule, name and type and an id + if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined') + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an enum. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isEnum = function(def) { + // Enums require a string name + if (typeof def["name"] !== 'string') + return false; + // Enums require at least one value + if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes a service. + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isService = function(def) { + // Services require a string name and an rpc object + if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"]) + return false; + return true; + }; + + /** + * Tests if a definition most likely describes an extended message + * @param {!Object} def + * @returns {boolean} + * @expose + */ + Builder.isExtend = function(def) { + // Extends rquire a string ref + if (typeof def["ref"] !== 'string') + return false; + return true; + }; + + // ----- Building ----- + + /** + * Resets the pointer to the root namespace. + * @returns {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.reset = function() { + this.ptr = this.ns; + return this; + }; + + /** + * Defines a namespace on top of the current pointer position and places the pointer on it. + * @param {string} namespace + * @return {!ProtoBuf.Builder} this + * @expose + */ + BuilderPrototype.define = function(namespace) { + if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace)) + throw Error("illegal namespace: "+namespace); + namespace.split(".").forEach(function(part) { + var ns = this.ptr.getChild(part); + if (ns === null) // Keep existing + this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part)); + this.ptr = ns; + }, this); + return this; + }; + + /** + * Creates the specified definitions at the current pointer position. + * @param {!Array.} defs Messages, enums or services to create + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If a message definition is invalid + * @expose + */ + BuilderPrototype.create = function(defs) { + if (!defs) + return this; // Nothing to create + if (!Array.isArray(defs)) + defs = [defs]; + else { + if (defs.length === 0) + return this; + defs = defs.slice(); + } + + // It's quite hard to keep track of scopes and memory here, so let's do this iteratively. + var stack = [defs]; + while (stack.length > 0) { + defs = stack.pop(); + + if (!Array.isArray(defs)) // Stack always contains entire namespaces + throw Error("not a valid namespace: "+JSON.stringify(defs)); + + while (defs.length > 0) { + var def = defs.shift(); // Namespaces always contain an array of messages, enums and services + + if (Builder.isMessage(def)) { + var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]); + + // Create OneOfs + var oneofs = {}; + if (def["oneofs"]) + Object.keys(def["oneofs"]).forEach(function(name) { + obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name)); + }, this); + + // Create fields + if (def["fields"]) + def["fields"].forEach(function(fld) { + if (obj.getChild(fld["id"]|0) !== null) + throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']); + if (fld["options"] && typeof fld["options"] !== 'object') + throw Error("illegal field options in "+obj.name+"#"+fld["name"]); + var oneof = null; + if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]])) + throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]); + fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]); + if (oneof) + oneof.fields.push(fld); + obj.addChild(fld); + }, this); + + // Push children to stack + var subObj = []; + if (def["enums"]) + def["enums"].forEach(function(enm) { + subObj.push(enm); + }); + if (def["messages"]) + def["messages"].forEach(function(msg) { + subObj.push(msg); + }); + if (def["services"]) + def["services"].forEach(function(svc) { + subObj.push(svc); + }); + + // Set extension ranges + if (def["extensions"]) { + if (typeof def["extensions"][0] === 'number') // pre 5.0.1 + obj.extensions = [ def["extensions"] ]; + else + obj.extensions = def["extensions"]; + } + + // Create on top of current namespace + this.ptr.addChild(obj); + if (subObj.length > 0) { + stack.push(defs); // Push the current level back + defs = subObj; // Continue processing sub level + subObj = null; + this.ptr = obj; // And move the pointer to this namespace + obj = null; + continue; + } + subObj = null; + + } else if (Builder.isEnum(def)) { + + obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]); + def["values"].forEach(function(val) { + obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isService(def)) { + + obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]); + Object.keys(def["rpc"]).forEach(function(name) { + var mtd = def["rpc"][name]; + obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"])); + }, this); + this.ptr.addChild(obj); + + } else if (Builder.isExtend(def)) { + + obj = this.ptr.resolve(def["ref"], true); + if (obj) { + def["fields"].forEach(function(fld) { + if (obj.getChild(fld['id']|0) !== null) + throw Error("duplicate extended field id in "+obj.name+": "+fld['id']); + // Check if field id is allowed to be extended + if (obj.extensions) { + var valid = false; + obj.extensions.forEach(function(range) { + if (fld["id"] >= range[0] && fld["id"] <= range[1]) + valid = true; + }); + if (!valid) + throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)"); + } + // Convert extension field names to camel case notation if the override is set + var name = fld["name"]; + if (this.options['convertFieldsToCamelCase']) + name = ProtoBuf.Util.toCamelCase(name); + // see #161: Extensions use their fully qualified name as their runtime key and... + var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]); + // ...are added on top of the current namespace as an extension which is used for + // resolving their type later on (the extension always keeps the original name to + // prevent naming collisions) + var ext = new Reflect.Extension(this, this.ptr, fld["name"], field); + field.extension = ext; + this.ptr.addChild(ext); + obj.addChild(field); + }, this); + + } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions + throw Error("extended message "+def["ref"]+" is not defined"); + + } else + throw Error("not a valid definition: "+JSON.stringify(def)); + + def = null; + obj = null; + } + // Break goes here + defs = null; + this.ptr = this.ptr.parent; // Namespace done, continue at parent + } + this.resolved = false; // Require re-resolve + this.result = null; // Require re-build + return this; + }; + + /** + * Propagates syntax to all children. + * @param {!Object} parent + * @inner + */ + function propagateSyntax(parent) { + if (parent['messages']) { + parent['messages'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + propagateSyntax(child); + }); + } + if (parent['enums']) { + parent['enums'].forEach(function(child) { + child["syntax"] = parent["syntax"]; + }); + } + } + + /** + * Imports another definition into this builder. + * @param {Object.} json Parsed import + * @param {(string|{root: string, file: string})=} filename Imported file name + * @returns {!ProtoBuf.Builder} this + * @throws {Error} If the definition or file cannot be imported + * @expose + */ + BuilderPrototype["import"] = function(json, filename) { + var delim = '/'; + + // Make sure to skip duplicate imports + + if (typeof filename === 'string') { + + if (ProtoBuf.Util.IS_NODE) + filename = require$$2['resolve'](filename); + if (this.files[filename] === true) + return this.reset(); + this.files[filename] = true; + + } else if (typeof filename === 'object') { // Object with root, file. + + var root = filename.root; + if (ProtoBuf.Util.IS_NODE) + root = require$$2['resolve'](root); + if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0) + delim = '\\'; + var fname; + if (ProtoBuf.Util.IS_NODE) + fname = require$$2['join'](root, filename.file); + else + fname = root + delim + filename.file; + if (this.files[fname] === true) + return this.reset(); + this.files[fname] = true; + } + + // Import imports + + if (json['imports'] && json['imports'].length > 0) { + var importRoot, + resetRoot = false; + + if (typeof filename === 'object') { // If an import root is specified, override + + this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards + importRoot = this.importRoot; + filename = filename["file"]; + if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0) + delim = '\\'; + + } else if (typeof filename === 'string') { + + if (this.importRoot) // If import root is overridden, use it + importRoot = this.importRoot; + else { // Otherwise compute from filename + if (filename.indexOf("/") >= 0) { // Unix + importRoot = filename.replace(/\/[^\/]*$/, ""); + if (/* /file.proto */ importRoot === "") + importRoot = "/"; + } else if (filename.indexOf("\\") >= 0) { // Windows + importRoot = filename.replace(/\\[^\\]*$/, ""); + delim = '\\'; + } else + importRoot = "."; + } + + } else + importRoot = null; + + for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned. + * @returns {!ProtoBuf.Builder.Message|!Object.} + * @throws {Error} If a type could not be resolved + * @expose + */ + BuilderPrototype.build = function(path) { + this.reset(); + if (!this.resolved) + this.resolveAll(), + this.resolved = true, + this.result = null; // Require re-build + if (this.result === null) // (Re-)Build + this.result = this.ns.build(); + if (!path) + return this.result; + var part = typeof path === 'string' ? path.split(".") : path, + ptr = this.result; // Build namespace pointer (no hasChild etc.) + for (var i=0; i=} contents Initial contents + * @constructor + */ + var Map = function(field, contents) { + if (!field.map) + throw Error("field is not a map"); + + /** + * The field corresponding to this map. + * @type {!ProtoBuf.Reflect.Field} + */ + this.field = field; + + /** + * Element instance corresponding to key type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax); + + /** + * Element instance corresponding to value type. + * @type {!ProtoBuf.Reflect.Element} + */ + this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax); + + /** + * Internal map: stores mapping of (string form of key) -> (key, value) + * pair. + * + * We provide map semantics for arbitrary key types, but we build on top + * of an Object, which has only string keys. In order to avoid the need + * to convert a string key back to its native type in many situations, + * we store the native key value alongside the value. Thus, we only need + * a one-way mapping from a key type to its string form that guarantees + * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1 + * === K2). + * + * @type {!Object} + */ + this.map = {}; + + /** + * Returns the number of elements in the map. + */ + Object.defineProperty(this, "size", { + get: function() { return Object.keys(this.map).length; } + }); + + // Fill initial contents from a raw object. + if (contents) { + var keys = Object.keys(contents); + for (var i = 0; i < keys.length; i++) { + var key = this.keyElem.valueFromString(keys[i]); + var val = this.valueElem.verifyValue(contents[keys[i]]); + this.map[this.keyElem.valueToString(key)] = + { key: key, value: val }; + } + } + }; + + var MapPrototype = Map.prototype; + + /** + * Helper: return an iterator over an array. + * @param {!Array<*>} arr the array + * @returns {!Object} an iterator + * @inner + */ + function arrayIterator(arr) { + var idx = 0; + return { + next: function() { + if (idx < arr.length) + return { done: false, value: arr[idx++] }; + return { done: true }; + } + } + } + + /** + * Clears the map. + */ + MapPrototype.clear = function() { + this.map = {}; + }; + + /** + * Deletes a particular key from the map. + * @returns {boolean} Whether any entry with this key was deleted. + */ + MapPrototype["delete"] = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + var hadKey = keyValue in this.map; + delete this.map[keyValue]; + return hadKey; + }; + + /** + * Returns an iterator over [key, value] pairs in the map. + * @returns {Object} The iterator + */ + MapPrototype.entries = function() { + var entries = []; + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + entries.push([(entry=this.map[strKeys[i]]).key, entry.value]); + return arrayIterator(entries); + }; + + /** + * Returns an iterator over keys in the map. + * @returns {Object} The iterator + */ + MapPrototype.keys = function() { + var keys = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + keys.push(this.map[strKeys[i]].key); + return arrayIterator(keys); + }; + + /** + * Returns an iterator over values in the map. + * @returns {!Object} The iterator + */ + MapPrototype.values = function() { + var values = []; + var strKeys = Object.keys(this.map); + for (var i = 0; i < strKeys.length; i++) + values.push(this.map[strKeys[i]].value); + return arrayIterator(values); + }; + + /** + * Iterates over entries in the map, calling a function on each. + * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments. + * @param {Object=} thisArg The `this` value for the callback + */ + MapPrototype.forEach = function(cb, thisArg) { + var strKeys = Object.keys(this.map); + for (var i = 0, entry; i < strKeys.length; i++) + cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this); + }; + + /** + * Sets a key in the map to the given value. + * @param {*} key The key + * @param {*} value The value + * @returns {!ProtoBuf.Map} The map instance + */ + MapPrototype.set = function(key, value) { + var keyValue = this.keyElem.verifyValue(key); + var valValue = this.valueElem.verifyValue(value); + this.map[this.keyElem.valueToString(keyValue)] = + { key: keyValue, value: valValue }; + return this; + }; + + /** + * Gets the value corresponding to a key in the map. + * @param {*} key The key + * @returns {*|undefined} The value, or `undefined` if key not present + */ + MapPrototype.get = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + if (!(keyValue in this.map)) + return undefined; + return this.map[keyValue].value; + }; + + /** + * Determines whether the given key is present in the map. + * @param {*} key The key + * @returns {boolean} `true` if the key is present + */ + MapPrototype.has = function(key) { + var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key)); + return (keyValue in this.map); + }; + + return Map; + })(ProtoBuf, ProtoBuf.Reflect); + + + /** + * Constructs a new empty Builder. + * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf + * @return {!ProtoBuf.Builder} Builder + * @expose + */ + ProtoBuf.newBuilder = function(options) { + options = options || {}; + if (typeof options['convertFieldsToCamelCase'] === 'undefined') + options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase; + if (typeof options['populateAccessors'] === 'undefined') + options['populateAccessors'] = ProtoBuf.populateAccessors; + return new ProtoBuf.Builder(options); + }; + + /** + * Loads a .json definition and returns the Builder. + * @param {!*|string} json JSON definition + * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted. + * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports. + * @return {ProtoBuf.Builder} Builder to create new messages + * @throws {Error} If the definition cannot be parsed or built + * @expose + */ + ProtoBuf.loadJson = function(json, builder, filename) { + if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string')) + filename = builder, + builder = null; + if (!builder || typeof builder !== 'object') + builder = ProtoBuf.newBuilder(); + if (typeof json === 'string') + json = JSON.parse(json); + builder["import"](json, filename); + builder.resolveAll(); + return builder; + }; + + /** + * Loads a .json file and returns the Builder. + * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with + * an overridden 'root' path for all imported files. + * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and + * the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the + * file will be read synchronously and this function will return the Builder. + * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted. + * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the + * request has failed), else undefined + * @expose + */ + ProtoBuf.loadJsonFile = function(filename, callback, builder) { + if (callback && typeof callback === 'object') + builder = callback, + callback = null; + else if (!callback || typeof callback !== 'function') + callback = null; + if (callback) + return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) { + if (contents === null) { + callback(Error("Failed to fetch file")); + return; + } + try { + callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename)); + } catch (e) { + callback(e); + } + }); + var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename); + return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename); + }; + + return ProtoBuf; + }); + }); + + var messageCompiled = protobufLight.newBuilder({})['import']({ + "package": "push_server.messages2", + "syntax": "proto2", + "options": { + "objc_class_prefix": "AVIM" + }, + "messages": [{ + "name": "JsonObjectMessage", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "data", + "id": 1 + }] + }, { + "name": "UnreadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "required", + "type": "int32", + "name": "unread", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentioned", + "id": 8 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 9 + }] + }, { + "name": "LogItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "from", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "msgId", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "ackAt", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "readAt", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 9 + }, { + "rule": "optional", + "type": "bool", + "name": "bin", + "id": 10 + }] + }, { + "name": "DataCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 1 + }, { + "rule": "repeated", + "type": "JsonObjectMessage", + "name": "msg", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 3 + }] + }, { + "name": "SessionCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int64", + "name": "t", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "ua", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tag", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "deviceId", + "id": 7 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 8 + }, { + "rule": "repeated", + "type": "string", + "name": "onlineSessionPeerIds", + "id": 9 + }, { + "rule": "optional", + "type": "string", + "name": "st", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "stTtl", + "id": 11 + }, { + "rule": "optional", + "type": "int32", + "name": "code", + "id": 12 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "deviceToken", + "id": 14 + }, { + "rule": "optional", + "type": "bool", + "name": "sp", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 16 + }, { + "rule": "optional", + "type": "int64", + "name": "lastUnreadNotifTime", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 18 + }, { + "rule": "optional", + "type": "int64", + "name": "configBitmap", + "id": 19 + }] + }, { + "name": "ErrorCommand", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "required", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "detail", + "id": 4 + }] + }, { + "name": "DirectCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "msg", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "fromPeerId", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "offline", + "id": 5 + }, { + "rule": "optional", + "type": "bool", + "name": "hasMore", + "id": 6 + }, { + "rule": "repeated", + "type": "string", + "name": "toPeerIds", + "id": 7 + }, { + "rule": "optional", + "type": "bool", + "name": "r", + "id": 10 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "id", + "id": 12 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "dt", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 15 + }, { + "rule": "optional", + "type": "string", + "name": "pushData", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "will", + "id": 17 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 18 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 19 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 20 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 21 + }] + }, { + "name": "AckCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "int32", + "name": "code", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "reason", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "uid", + "id": 6 + }, { + "rule": "optional", + "type": "int64", + "name": "fromts", + "id": 7 + }, { + "rule": "optional", + "type": "int64", + "name": "tots", + "id": 8 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "ids", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "appCode", + "id": 11 + }] + }, { + "name": "UnreadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "UnreadTuple", + "name": "convs", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "notifTime", + "id": 2 + }] + }, { + "name": "ConvCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "string", + "name": "m", + "id": 1 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 2 + }, { + "rule": "optional", + "type": "bool", + "name": "unique", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "cdate", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "initBy", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "sort", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 8 + }, { + "rule": "optional", + "type": "int32", + "name": "skip", + "id": 9 + }, { + "rule": "optional", + "type": "int32", + "name": "flag", + "id": 10 + }, { + "rule": "optional", + "type": "int32", + "name": "count", + "id": 11 + }, { + "rule": "optional", + "type": "string", + "name": "udate", + "id": 12 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 13 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 14 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 15 + }, { + "rule": "optional", + "type": "bool", + "name": "statusSub", + "id": 16 + }, { + "rule": "optional", + "type": "bool", + "name": "statusPub", + "id": 17 + }, { + "rule": "optional", + "type": "int32", + "name": "statusTTL", + "id": 18 + }, { + "rule": "optional", + "type": "string", + "name": "uniqueId", + "id": 19 + }, { + "rule": "optional", + "type": "string", + "name": "targetClientId", + "id": 20 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 21 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 22 + }, { + "rule": "optional", + "type": "bool", + "name": "queryAllMembers", + "id": 23 + }, { + "rule": "repeated", + "type": "MaxReadTuple", + "name": "maxReadTuples", + "id": 24 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 25 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "results", + "id": 100 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "where", + "id": 101 + }, { + "rule": "optional", + "type": "JsonObjectMessage", + "name": "attr", + "id": 103 + }] + }, { + "name": "RoomCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "roomId", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "s", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "n", + "id": 4 + }, { + "rule": "optional", + "type": "bool", + "name": "transient", + "id": 5 + }, { + "rule": "repeated", + "type": "string", + "name": "roomPeerIds", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "byPeerId", + "id": 7 + }] + }, { + "name": "LogsCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int32", + "name": "l", + "id": 2 + }, { + "rule": "optional", + "type": "int32", + "name": "limit", + "id": 3 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 4 + }, { + "rule": "optional", + "type": "int64", + "name": "tt", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "tmid", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 7 + }, { + "rule": "optional", + "type": "string", + "name": "checksum", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "stored", + "id": 9 + }, { + "rule": "optional", + "type": "QueryDirection", + "name": "direction", + "id": 10, + "options": { + "default": "OLD" + } + }, { + "rule": "optional", + "type": "bool", + "name": "tIncluded", + "id": 11 + }, { + "rule": "optional", + "type": "bool", + "name": "ttIncluded", + "id": 12 + }, { + "rule": "repeated", + "type": "LogItem", + "name": "logs", + "id": 105 + }], + "enums": [{ + "name": "QueryDirection", + "syntax": "proto2", + "values": [{ + "name": "OLD", + "id": 1 + }, { + "name": "NEW", + "id": 2 + }] + }] + }, { + "name": "RcpCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "id", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "t", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "read", + "id": 4 + }] + }, { + "name": "ReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "required", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 3 + }] + }, { + "name": "MaxReadTuple", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "pid", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "maxAckTimestamp", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "maxReadTimestamp", + "id": 3 + }] + }, { + "name": "ReadCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "cids", + "id": 2 + }, { + "rule": "repeated", + "type": "ReadTuple", + "name": "convs", + "id": 3 + }] + }, { + "name": "PresenceCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "StatusType", + "name": "status", + "id": 1 + }, { + "rule": "repeated", + "type": "string", + "name": "sessionPeerIds", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "cid", + "id": 3 + }] + }, { + "name": "ReportCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "bool", + "name": "initiative", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "type", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 3 + }] + }, { + "name": "PatchItem", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "string", + "name": "cid", + "id": 1 + }, { + "rule": "optional", + "type": "string", + "name": "mid", + "id": 2 + }, { + "rule": "optional", + "type": "int64", + "name": "timestamp", + "id": 3 + }, { + "rule": "optional", + "type": "bool", + "name": "recall", + "id": 4 + }, { + "rule": "optional", + "type": "string", + "name": "data", + "id": 5 + }, { + "rule": "optional", + "type": "int64", + "name": "patchTimestamp", + "id": 6 + }, { + "rule": "optional", + "type": "string", + "name": "from", + "id": 7 + }, { + "rule": "optional", + "type": "bytes", + "name": "binaryMsg", + "id": 8 + }, { + "rule": "optional", + "type": "bool", + "name": "mentionAll", + "id": 9 + }, { + "rule": "repeated", + "type": "string", + "name": "mentionPids", + "id": 10 + }] + }, { + "name": "PatchCommand", + "syntax": "proto2", + "fields": [{ + "rule": "repeated", + "type": "PatchItem", + "name": "patches", + "id": 1 + }, { + "rule": "optional", + "type": "int64", + "name": "lastPatchTime", + "id": 2 + }] + }, { + "name": "GenericCommand", + "syntax": "proto2", + "fields": [{ + "rule": "optional", + "type": "CommandType", + "name": "cmd", + "id": 1 + }, { + "rule": "optional", + "type": "OpType", + "name": "op", + "id": 2 + }, { + "rule": "optional", + "type": "string", + "name": "appId", + "id": 3 + }, { + "rule": "optional", + "type": "string", + "name": "peerId", + "id": 4 + }, { + "rule": "optional", + "type": "int32", + "name": "i", + "id": 5 + }, { + "rule": "optional", + "type": "string", + "name": "installationId", + "id": 6 + }, { + "rule": "optional", + "type": "int32", + "name": "priority", + "id": 7 + }, { + "rule": "optional", + "type": "int32", + "name": "service", + "id": 8 + }, { + "rule": "optional", + "type": "DataCommand", + "name": "dataMessage", + "id": 101 + }, { + "rule": "optional", + "type": "SessionCommand", + "name": "sessionMessage", + "id": 102 + }, { + "rule": "optional", + "type": "ErrorCommand", + "name": "errorMessage", + "id": 103 + }, { + "rule": "optional", + "type": "DirectCommand", + "name": "directMessage", + "id": 104 + }, { + "rule": "optional", + "type": "AckCommand", + "name": "ackMessage", + "id": 105 + }, { + "rule": "optional", + "type": "UnreadCommand", + "name": "unreadMessage", + "id": 106 + }, { + "rule": "optional", + "type": "ReadCommand", + "name": "readMessage", + "id": 107 + }, { + "rule": "optional", + "type": "RcpCommand", + "name": "rcpMessage", + "id": 108 + }, { + "rule": "optional", + "type": "LogsCommand", + "name": "logsMessage", + "id": 109 + }, { + "rule": "optional", + "type": "ConvCommand", + "name": "convMessage", + "id": 110 + }, { + "rule": "optional", + "type": "RoomCommand", + "name": "roomMessage", + "id": 111 + }, { + "rule": "optional", + "type": "PresenceCommand", + "name": "presenceMessage", + "id": 112 + }, { + "rule": "optional", + "type": "ReportCommand", + "name": "reportMessage", + "id": 113 + }, { + "rule": "optional", + "type": "PatchCommand", + "name": "patchMessage", + "id": 114 + }] + }], + "enums": [{ + "name": "CommandType", + "syntax": "proto2", + "values": [{ + "name": "session", + "id": 0 + }, { + "name": "conv", + "id": 1 + }, { + "name": "direct", + "id": 2 + }, { + "name": "ack", + "id": 3 + }, { + "name": "rcp", + "id": 4 + }, { + "name": "unread", + "id": 5 + }, { + "name": "logs", + "id": 6 + }, { + "name": "error", + "id": 7 + }, { + "name": "login", + "id": 8 + }, { + "name": "data", + "id": 9 + }, { + "name": "room", + "id": 10 + }, { + "name": "read", + "id": 11 + }, { + "name": "presence", + "id": 12 + }, { + "name": "report", + "id": 13 + }, { + "name": "echo", + "id": 14 + }, { + "name": "loggedin", + "id": 15 + }, { + "name": "logout", + "id": 16 + }, { + "name": "loggedout", + "id": 17 + }, { + "name": "patch", + "id": 18 + }] + }, { + "name": "OpType", + "syntax": "proto2", + "values": [{ + "name": "open", + "id": 1 + }, { + "name": "add", + "id": 2 + }, { + "name": "remove", + "id": 3 + }, { + "name": "close", + "id": 4 + }, { + "name": "opened", + "id": 5 + }, { + "name": "closed", + "id": 6 + }, { + "name": "query", + "id": 7 + }, { + "name": "query_result", + "id": 8 + }, { + "name": "conflict", + "id": 9 + }, { + "name": "added", + "id": 10 + }, { + "name": "removed", + "id": 11 + }, { + "name": "start", + "id": 30 + }, { + "name": "started", + "id": 31 + }, { + "name": "joined", + "id": 32 + }, { + "name": "members_joined", + "id": 33 + }, { + "name": "left", + "id": 39 + }, { + "name": "members_left", + "id": 40 + }, { + "name": "results", + "id": 42 + }, { + "name": "count", + "id": 43 + }, { + "name": "result", + "id": 44 + }, { + "name": "update", + "id": 45 + }, { + "name": "updated", + "id": 46 + }, { + "name": "mute", + "id": 47 + }, { + "name": "unmute", + "id": 48 + }, { + "name": "status", + "id": 49 + }, { + "name": "members", + "id": 50 + }, { + "name": "max_read", + "id": 51 + }, { + "name": "is_member", + "id": 52 + }, { + "name": "join", + "id": 80 + }, { + "name": "invite", + "id": 81 + }, { + "name": "leave", + "id": 82 + }, { + "name": "kick", + "id": 83 + }, { + "name": "reject", + "id": 84 + }, { + "name": "invited", + "id": 85 + }, { + "name": "kicked", + "id": 86 + }, { + "name": "upload", + "id": 100 + }, { + "name": "uploaded", + "id": 101 + }, { + "name": "modify", + "id": 150 + }, { + "name": "modified", + "id": 151 + }] + }, { + "name": "StatusType", + "syntax": "proto2", + "values": [{ + "name": "on", + "id": 1 + }, { + "name": "off", + "id": 2 + }] + }], + "isNamespace": true + }).build(); + + var _messages$push_server = messageCompiled.push_server.messages2; + var JsonObjectMessage = _messages$push_server.JsonObjectMessage; + var UnreadTuple = _messages$push_server.UnreadTuple; + var LogItem = _messages$push_server.LogItem; + var DataCommand = _messages$push_server.DataCommand; + var SessionCommand = _messages$push_server.SessionCommand; + var ErrorCommand = _messages$push_server.ErrorCommand; + var DirectCommand = _messages$push_server.DirectCommand; + var AckCommand = _messages$push_server.AckCommand; + var UnreadCommand = _messages$push_server.UnreadCommand; + var ConvCommand = _messages$push_server.ConvCommand; + var RoomCommand = _messages$push_server.RoomCommand; + var LogsCommand = _messages$push_server.LogsCommand; + var RcpCommand = _messages$push_server.RcpCommand; + var ReadTuple = _messages$push_server.ReadTuple; + var MaxReadTuple = _messages$push_server.MaxReadTuple; + var ReadCommand = _messages$push_server.ReadCommand; + var PresenceCommand = _messages$push_server.PresenceCommand; + var ReportCommand = _messages$push_server.ReportCommand; + var GenericCommand = _messages$push_server.GenericCommand; + var PatchCommand = _messages$push_server.PatchCommand; + var PatchItem = _messages$push_server.PatchItem; + var CommandType = _messages$push_server.CommandType; + var OpType = _messages$push_server.OpType; + var StatusType = _messages$push_server.StatusType; + + + + + var message = Object.freeze({ + JsonObjectMessage: JsonObjectMessage, + UnreadTuple: UnreadTuple, + LogItem: LogItem, + DataCommand: DataCommand, + SessionCommand: SessionCommand, + ErrorCommand: ErrorCommand, + DirectCommand: DirectCommand, + AckCommand: AckCommand, + UnreadCommand: UnreadCommand, + ConvCommand: ConvCommand, + RoomCommand: RoomCommand, + LogsCommand: LogsCommand, + RcpCommand: RcpCommand, + ReadTuple: ReadTuple, + MaxReadTuple: MaxReadTuple, + ReadCommand: ReadCommand, + PresenceCommand: PresenceCommand, + ReportCommand: ReportCommand, + GenericCommand: GenericCommand, + PatchCommand: PatchCommand, + PatchItem: PatchItem, + CommandType: CommandType, + OpType: OpType, + StatusType: StatusType + }); + + var eventemitter3 = createCommonjsModule(function (module) { + 'use strict'; + + var has = Object.prototype.hasOwnProperty + , prefix = '~'; + + /** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ + function Events() {} + + // + // We try to not inherit from `Object.prototype`. In some engines creating an + // instance in this way is faster than calling `Object.create(null)` directly. + // If `Object.create(null)` is not supported we prefix the event names with a + // character to make sure that the built-in object properties are not + // overridden or used as an attack vector. + // + if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; + } + + /** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ + function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; + } + + /** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ + function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; + } + + /** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ + EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; + }; + + /** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ + EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; + }; + + /** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ + EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; + }; + + /** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; + }; + + /** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; + }; + + /** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ + EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; + }; + + // + // Alias methods names because people roll like that. + // + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + + // + // This function doesn't apply anymore. + // + EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; + }; + + // + // Expose the prefix. + // + EventEmitter.prefixed = prefix; + + // + // Allow `EventEmitter` to be imported as module namespace. + // + EventEmitter.EventEmitter = EventEmitter; + + // + // Expose the module. + // + { + module.exports = EventEmitter; + } + }); + + var runtime = createCommonjsModule(function (module) { + /** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + + !(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = 'object' === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + })( + // In sloppy mode, unbound `this` refers to the global object, fallback to + // Function constructor if we're in global strict mode. That is sadly a form + // of indirect eval which violates Content Security Policy. + (function() { return this })() || Function("return this")() + ); + }); + + // This method of obtaining a reference to the global object needs to be + // kept identical to the way it is obtained in runtime.js + var g = (function() { return this })() || Function("return this")(); + + // Use `getOwnPropertyNames` because not all browsers support calling + // `hasOwnProperty` on the global `self` object in a worker. See #183. + var hadRuntime = g.regeneratorRuntime && + Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; + + // Save the old regeneratorRuntime in case it needs to be restored later. + var oldRuntime = hadRuntime && g.regeneratorRuntime; + + // Force reevalutation of runtime.js. + g.regeneratorRuntime = undefined; + + var runtimeModule = runtime; + + if (hadRuntime) { + // Restore the original runtime. + g.regeneratorRuntime = oldRuntime; + } else { + // Remove the global property added by runtime.js. + try { + delete g.regeneratorRuntime; + } catch(e) { + g.regeneratorRuntime = undefined; + } + } + + var regenerator = runtimeModule; + + var f$2 = Object.getOwnPropertySymbols; + + var _objectGops = { + f: f$2 + }; + + var f$3 = {}.propertyIsEnumerable; + + var _objectPie = { + f: f$3 + }; + + // 19.1.2.1 Object.assign(target, source, ...) + + + + + + var $assign = Object.assign; + + // should work with symbols and should have deterministic property order (V8 bug) + var _objectAssign = !$assign || _fails(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; + }) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = _toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = _objectGops.f; + var isEnum = _objectPie.f; + while (aLen > index) { + var S = _iobject(arguments[index++]); + var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; + } : $assign; + + // 19.1.3.1 Object.assign(target, source) + + + _export(_export.S + _export.F, 'Object', { assign: _objectAssign }); + + var assign$1 = _core.Object.assign; + + var assign = createCommonjsModule(function (module) { + module.exports = { "default": assign$1, __esModule: true }; + }); + + var _Object$assign = unwrapExports(assign); + + var _extends = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _assign2 = _interopRequireDefault(assign); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + }); + + var _extends$1 = unwrapExports(_extends); + + var asyncToGenerator = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _promise2 = _interopRequireDefault(promise); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (fn) { + return function () { + var gen = fn.apply(this, arguments); + return new _promise2.default(function (resolve, reject) { + function step(key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + return _promise2.default.resolve(value).then(function (value) { + step("next", value); + }, function (err) { + step("throw", err); + }); + } + } + + return step("next"); + }); + }; + }; + }); + + var _asyncToGenerator = unwrapExports(asyncToGenerator); + + var _createProperty = function (object, index, value) { + if (index in object) _objectDp.f(object, index, _propertyDesc(0, value)); + else object[index] = value; + }; + + _export(_export.S + _export.F * !_iterDetect(function (iter) { Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = _toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iterFn = core_getIteratorMethod(O); + var length, result, step, iterator; + if (mapping) mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + _createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = _toLength(O.length); + for (result = new C(length); length > index; index++) { + _createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } + }); + + var from$1 = _core.Array.from; + + var from = createCommonjsModule(function (module) { + module.exports = { "default": from$1, __esModule: true }; + }); + + var _Array$from = unwrapExports(from); + + var toConsumableArray = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _from2 = _interopRequireDefault(from); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } else { + return (0, _from2.default)(arr); + } + }; + }); + + var _toConsumableArray = unwrapExports(toConsumableArray); + + var _meta = createCommonjsModule(function (module) { + var META = _uid('meta'); + + + var setDesc = _objectDp.f; + var id = 0; + var isExtensible = Object.isExtensible || function () { + return true; + }; + var FREEZE = !_fails(function () { + return isExtensible(Object.preventExtensions({})); + }); + var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); + }; + var fastKey = function (it, create) { + // return primitive with prefix + if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!_has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; + }; + var getWeak = function (it, create) { + if (!_has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; + }; + // add metadata on freeze-family methods calling + var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it); + return it; + }; + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + }; + }); + + var _validateCollection = function (it, TYPE) { + if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; + }; + + var dP$1 = _objectDp.f; + + + + + + + + + + var fastKey = _meta.fastKey; + + var SIZE = _descriptors ? '_s' : 'size'; + + var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } + }; + + var _collectionStrong = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + _anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = _objectCreate(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); + }); + _redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = _validateCollection(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + _validateCollection(this, NAME); + var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(_validateCollection(this, NAME), key); + } + }); + if (_descriptors) dP$1(C.prototype, 'size', { + get: function () { + return _validateCollection(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + _iterDefine(C, NAME, function (iterated, kind) { + this._t = _validateCollection(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return _iterStep(1); + } + // return step by kind + if (kind == 'keys') return _iterStep(0, entry.k); + if (kind == 'values') return _iterStep(0, entry.v); + return _iterStep(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + _setSpecies(NAME); + } + }; + + // 7.2.2 IsArray(argument) + + var _isArray = Array.isArray || function isArray(arg) { + return _cof(arg) == 'Array'; + }; + + var SPECIES$2 = _wks('species'); + + var _arraySpeciesConstructor = function (original) { + var C; + if (_isArray(original)) { + C = original.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined; + if (_isObject(C)) { + C = C[SPECIES$2]; + if (C === null) C = undefined; + } + } return C === undefined ? Array : C; + }; + + // 9.4.2.3 ArraySpeciesCreate(originalArray, length) + + + var _arraySpeciesCreate = function (original, length) { + return new (_arraySpeciesConstructor(original))(length); + }; + + // 0 -> Array#forEach + // 1 -> Array#map + // 2 -> Array#filter + // 3 -> Array#some + // 4 -> Array#every + // 5 -> Array#find + // 6 -> Array#findIndex + + + + + + var _arrayMethods = function (TYPE, $create) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + var create = $create || _arraySpeciesCreate; + return function ($this, callbackfn, that) { + var O = _toObject($this); + var self = _iobject(O); + var f = _ctx(callbackfn, that, 3); + var length = _toLength(self.length); + var index = 0; + var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var val, res; + for (;length > index; index++) if (NO_HOLES || index in self) { + val = self[index]; + res = f(val, index, O); + if (TYPE) { + if (IS_MAP) result[index] = res; // map + else if (res) switch (TYPE) { + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; + }; + + var dP$2 = _objectDp.f; + var each = _arrayMethods(0); + + + var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = _global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + if (!_descriptors || typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + _redefineAll(C.prototype, methods); + _meta.NEED = true; + } else { + C = wrapper(function (target, iterable) { + _anInstance(target, C, NAME, '_c'); + target._c = new Base(); + if (iterable != undefined) _forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if (KEY in proto && !(IS_WEAK && KEY == 'clear')) _hide(C.prototype, KEY, function (a, b) { + _anInstance(this, C, KEY); + if (!IS_ADDER && IS_WEAK && !_isObject(a)) return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + IS_WEAK || dP$2(C.prototype, 'size', { + get: function () { + return this._c.size; + } + }); + } + + _setToStringTag(C, NAME); + + O[NAME] = C; + _export(_export.G + _export.W + _export.F, O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; + }; + + var SET = 'Set'; + + // 23.2 Set Objects + var es6_set = _collection(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return _collectionStrong.def(_validateCollection(this, SET), value = value === 0 ? 0 : value, value); + } + }, _collectionStrong); + + var _arrayFromIterable = function (iter, ITERATOR) { + var result = []; + _forOf(iter, false, result.push, result, ITERATOR); + return result; + }; + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + + + var _collectionToJson = function (NAME) { + return function toJSON() { + if (_classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return _arrayFromIterable(this); + }; + }; + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + + + _export(_export.P + _export.R, 'Set', { toJSON: _collectionToJson('Set') }); + + // https://tc39.github.io/proposal-setmap-offrom/ + + + var _setCollectionOf = function (COLLECTION) { + _export(_export.S, COLLECTION, { of: function of() { + var length = arguments.length; + var A = Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); + } }); + }; + + // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of + _setCollectionOf('Set'); + + // https://tc39.github.io/proposal-setmap-offrom/ + + + + + + var _setCollectionFrom = function (COLLECTION) { + _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + _aFunction(this); + mapping = mapFn !== undefined; + if (mapping) _aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + cb = _ctx(mapFn, arguments[2], 2); + _forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + _forOf(source, false, A.push, A); + } + return new this(A); + } }); + }; + + // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from + _setCollectionFrom('Set'); + + var set$1 = _core.Set; + + var set = createCommonjsModule(function (module) { + module.exports = { "default": set$1, __esModule: true }; + }); + + var _Set = unwrapExports(set); + + var classCallCheck = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + }); + + var _classCallCheck = unwrapExports(classCallCheck); + + var f$4 = _wks; + + var _wksExt = { + f: f$4 + }; + + var iterator$2 = _wksExt.f('iterator'); + + var iterator = createCommonjsModule(function (module) { + module.exports = { "default": iterator$2, __esModule: true }; + }); + + var defineProperty = _objectDp.f; + var _wksDefine = function (name) { + var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) }); + }; + + // all enumerable object keys, includes symbols + + + + var _enumKeys = function (it) { + var result = _objectKeys(it); + var getSymbols = _objectGops.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = _objectPie.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; + }; + + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + + var hiddenKeys = _enumBugKeys.concat('length', 'prototype'); + + var f$6 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return _objectKeysInternal(O, hiddenKeys); + }; + + var _objectGopn = { + f: f$6 + }; + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + + var gOPN$1 = _objectGopn.f; + var toString$1 = {}.toString; + + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function (it) { + try { + return gOPN$1(it); + } catch (e) { + return windowNames.slice(); + } + }; + + var f$5 = function getOwnPropertyNames(it) { + return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN$1(_toIobject(it)); + }; + + var _objectGopnExt = { + f: f$5 + }; + + var gOPD$1 = Object.getOwnPropertyDescriptor; + + var f$7 = _descriptors ? gOPD$1 : function getOwnPropertyDescriptor(O, P) { + O = _toIobject(O); + P = _toPrimitive(P, true); + if (_ie8DomDefine) try { + return gOPD$1(O, P); + } catch (e) { /* empty */ } + if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]); + }; + + var _objectGopd = { + f: f$7 + }; + + // ECMAScript 6 symbols shim + + + + + + var META = _meta.KEY; + + + + + + + + + + + + + + + + + + + var gOPD = _objectGopd.f; + var dP$3 = _objectDp.f; + var gOPN = _objectGopnExt.f; + var $Symbol = _global.Symbol; + var $JSON = _global.JSON; + var _stringify = $JSON && $JSON.stringify; + var PROTOTYPE$2 = 'prototype'; + var HIDDEN = _wks('_hidden'); + var TO_PRIMITIVE = _wks('toPrimitive'); + var isEnum = {}.propertyIsEnumerable; + var SymbolRegistry = _shared('symbol-registry'); + var AllSymbols = _shared('symbols'); + var OPSymbols = _shared('op-symbols'); + var ObjectProto$1 = Object[PROTOTYPE$2]; + var USE_NATIVE$1 = typeof $Symbol == 'function'; + var QObject = _global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = _descriptors && _fails(function () { + return _objectCreate(dP$3({}, 'a', { + get: function () { return dP$3(this, 'a', { value: 7 }).a; } + })).a != 7; + }) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto$1, key); + if (protoDesc) delete ObjectProto$1[key]; + dP$3(it, key, D); + if (protoDesc && it !== ObjectProto$1) dP$3(ObjectProto$1, key, protoDesc); + } : dP$3; + + var wrap = function (tag) { + var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]); + sym._k = tag; + return sym; + }; + + var isSymbol = USE_NATIVE$1 && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; + } : function (it) { + return it instanceof $Symbol; + }; + + var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto$1) $defineProperty(OPSymbols, key, D); + _anObject(it); + key = _toPrimitive(key, true); + _anObject(D); + if (_has(AllSymbols, key)) { + if (!D.enumerable) { + if (!_has(it, HIDDEN)) dP$3(it, HIDDEN, _propertyDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _objectCreate(D, { enumerable: _propertyDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP$3(it, key, D); + }; + var $defineProperties = function defineProperties(it, P) { + _anObject(it); + var keys = _enumKeys(P = _toIobject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P) { + return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = _toPrimitive(key, true)); + if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false; + return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = _toIobject(it); + key = _toPrimitive(key, true); + if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(_toIobject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto$1; + var names = gOPN(IS_OP ? OPSymbols : _toIobject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto$1, key) : true)) result.push(AllSymbols[key]); + } return result; + }; + + // 19.4.1.1 Symbol([description]) + if (!USE_NATIVE$1) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = _uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto$1) $set.call(OPSymbols, value); + if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, _propertyDesc(1, value)); + }; + if (_descriptors && setter) setSymbolDesc(ObjectProto$1, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() { + return this._k; + }); + + _objectGopd.f = $getOwnPropertyDescriptor; + _objectDp.f = $defineProperty; + _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames; + _objectPie.f = $propertyIsEnumerable; + _objectGops.f = $getOwnPropertySymbols; + + if (_descriptors && !_library) { + _redefine(ObjectProto$1, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + _wksExt.f = function (name) { + return wrap(_wks(name)); + }; + } + + _export(_export.G + _export.W + _export.F * !USE_NATIVE$1, { Symbol: $Symbol }); + + for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' + ).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]); + + for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]); + + _export(_export.S + _export.F * !USE_NATIVE$1, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return _has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } + }); + + _export(_export.S + _export.F * !USE_NATIVE$1, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && _export(_export.S + _export.F * (!USE_NATIVE$1 || _fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; + })), 'JSON', { + stringify: function stringify(it) { + if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + replacer = args[1]; + if (typeof replacer == 'function') $replacer = replacer; + if ($replacer || !_isArray(replacer)) replacer = function (key, value) { + if ($replacer) value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } + }); + + // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf); + // 19.4.3.5 Symbol.prototype[@@toStringTag] + _setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + _setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + _setToStringTag(_global.JSON, 'JSON', true); + + _wksDefine('asyncIterator'); + + _wksDefine('observable'); + + var symbol$1 = _core.Symbol; + + var symbol = createCommonjsModule(function (module) { + module.exports = { "default": symbol$1, __esModule: true }; + }); + + var _Symbol = unwrapExports(symbol); + + var _typeof_1 = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _iterator2 = _interopRequireDefault(iterator); + + + + var _symbol2 = _interopRequireDefault(symbol); + + var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); + } : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); + }; + }); + + var _typeof = unwrapExports(_typeof_1); + + var possibleConstructorReturn = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _typeof3 = _interopRequireDefault(_typeof_1); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; + }; + }); + + var _possibleConstructorReturn = unwrapExports(possibleConstructorReturn); + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + + + var check = function (O, proto) { + _anObject(O); + if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); + }; + var _setProto = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + + _export(_export.S, 'Object', { setPrototypeOf: _setProto.set }); + + var setPrototypeOf$2 = _core.Object.setPrototypeOf; + + var setPrototypeOf = createCommonjsModule(function (module) { + module.exports = { "default": setPrototypeOf$2, __esModule: true }; + }); + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + _export(_export.S, 'Object', { create: _objectCreate }); + + var $Object = _core.Object; + var create$2 = function create(P, D) { + return $Object.create(P, D); + }; + + var create = createCommonjsModule(function (module) { + module.exports = { "default": create$2, __esModule: true }; + }); + + var inherits = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _setPrototypeOf2 = _interopRequireDefault(setPrototypeOf); + + + + var _create2 = _interopRequireDefault(create); + + + + var _typeof3 = _interopRequireDefault(_typeof_1); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } + + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; + }; + }); + + var _inherits = unwrapExports(inherits); + + /** + * Helpers. + */ + + var s = 1000; + var m = s * 60; + var h = m * 60; + var d$1 = h * 24; + var y = d$1 * 365.25; + + /** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + + var ms = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); + }; + + /** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d$1; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } + } + + /** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtShort(ms) { + if (ms >= d$1) { + return Math.round(ms / d$1) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; + } + + /** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + + function fmtLong(ms) { + return plural(ms, d$1, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; + } + + /** + * Pluralization helper. + */ + + function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; + } + + var debug$1 = createCommonjsModule(function (module, exports) { + /** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; + exports.coerce = coerce; + exports.disable = disable; + exports.enable = enable; + exports.enabled = enabled; + exports.humanize = ms; + + /** + * The currently active debug mode names, and names to skip. + */ + + exports.names = []; + exports.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + + exports.formatters = {}; + + /** + * Previous log timestamp. + */ + + var prevTime; + + /** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + + function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; + } + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + + function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms$$1 = curr - (prevTime || curr); + self.diff = ms$$1; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + + function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @api public + */ + + function disable() { + exports.enable(''); + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + + function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + + function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; + } + }); + + var browser$1 = createCommonjsModule(function (module, exports) { + /** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + + exports = module.exports = debug$1; + exports.log = log; + exports.formatArgs = formatArgs; + exports.save = save; + exports.load = load; + exports.useColors = useColors; + exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + + /** + * Colors. + */ + + exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' + ]; + + /** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + + function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + } + + /** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + + exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } + }; + + + /** + * Colorize log arguments if enabled. + * + * @api public + */ + + function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + } + + /** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + + function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); + } + + /** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + + function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} + } + + /** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + + function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; + } + + /** + * Enable namespaces listed in `localStorage.debug` initially. + */ + + exports.enable(load()); + + /** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + + function localstorage() { + try { + return window.localStorage; + } catch (e) {} + } + }); + + var bind = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; + }; + + /*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + + // The _isBuffer check is for Safari 5-7 support, because it's missing + // Object.prototype.constructor. Remove this eventually + var isBuffer_1 = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) + }; + + function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) + } + + // For Node v0.10 support. Remove this eventually. + function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) + } + + /*global toString:true*/ + + // utils is a library of generic helper functions non-specific to axios + + var toString$2 = Object.prototype.toString; + + /** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ + function isArray$1(val) { + return toString$2.call(val) === '[object Array]'; + } + + /** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ + function isArrayBuffer(val) { + return toString$2.call(val) === '[object ArrayBuffer]'; + } + + /** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ + function isFormData(val) { + return typeof FormData !== 'undefined' && val instanceof FormData; + } + + /** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ + function isArrayBufferView(val) { + var result; + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && val.buffer instanceof ArrayBuffer; + } + return result; + } + + /** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ + function isString(val) { + return typeof val === 'string'; + } + + /** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ + function isNumber(val) { + return typeof val === 'number'; + } + + /** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ + function isUndefined(val) { + return typeof val === 'undefined'; + } + + /** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ + function isObject$1(val) { + return val !== null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object'; + } + + /** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ + function isDate(val) { + return toString$2.call(val) === '[object Date]'; + } + + /** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ + function isFile(val) { + return toString$2.call(val) === '[object File]'; + } + + /** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ + function isBlob(val) { + return toString$2.call(val) === '[object Blob]'; + } + + /** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ + function isFunction(val) { + return toString$2.call(val) === '[object Function]'; + } + + /** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ + function isStream(val) { + return isObject$1(val) && isFunction(val.pipe); + } + + /** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ + function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; + } + + /** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ + function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); + } + + /** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + */ + function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + return false; + } + return typeof window !== 'undefined' && typeof document !== 'undefined'; + } + + /** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ + function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && !isArray$1(obj)) { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray$1(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } + } + + /** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ + function merge() /* obj1, obj2, obj3, ... */{ + var result = {}; + function assignValue(val, key) { + if (_typeof(result[key]) === 'object' && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; + } + + /** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ + function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; + } + + var utils = { + isArray: isArray$1, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer_1, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject$1, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim + }; + + var $JSON$1 = _core.JSON || (_core.JSON = { stringify: JSON.stringify }); + var stringify$1 = function stringify(it) { // eslint-disable-line no-unused-vars + return $JSON$1.stringify.apply($JSON$1, arguments); + }; + + var stringify = createCommonjsModule(function (module) { + module.exports = { "default": stringify$1, __esModule: true }; + }); + + var _JSON$stringify = unwrapExports(stringify); + + var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); + }; + + /** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ + + var enhanceError = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + error.request = request; + error.response = response; + return error; + }; + + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ + var createError = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); + }; + + /** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ + var settle = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + // Note: status is not exposed by XDomainRequest + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError('Request failed with status code ' + response.status, response.config, null, response.request, response)); + } + }; + + function encode(val) { + return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + } + + /** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ + var buildURL = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } + + if (!utils.isArray(val)) { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = _JSON$stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; + }; + + /** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ + var parseHeaders = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { + return parsed; + } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; + }; + + var isURLSameOrigin = utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() : + + // Non standard browser envs (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + }(); + + // btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js + + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + function E() { + this.message = 'String contains an invalid character'; + } + E.prototype = new Error(); + E.prototype.code = 5; + E.prototype.name = 'InvalidCharacterError'; + + function btoa$1(input) { + var str = String(input); + var output = ''; + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars; + // if the next str index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + str.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { + charCode = str.charCodeAt(idx += 3 / 4); + if (charCode > 0xFF) { + throw new E(); + } + block = block << 8 | charCode; + } + return output; + } + + var btoa_1 = btoa$1; + + var cookies = utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return match ? decodeURIComponent(match[3]) : null; + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + }() : + + // Non standard browser env (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { + return null; + }, + remove: function remove() {} + }; + }(); + + var btoa = typeof window !== 'undefined' && window.btoa && window.btoa.bind(window) || btoa_1; + + var xhr = function xhrAdapter(config) { + return new _Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + var loadEvent = 'onreadystatechange'; + var xDomain = false; + + // For IE 8/9 CORS support + // Only supports POST and GET calls and doesn't returns the response headers. + // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest. + if (process.env.NODE_ENV !== 'test' && typeof window !== 'undefined' && window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) { + request = new window.XDomainRequest(); + loadEvent = 'onload'; + xDomain = true; + request.onprogress = function handleProgress() {}; + request.ontimeout = function handleTimeout() {}; + } + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + // Listen for ready state + request[loadEvent] = function handleLoad() { + if (!request || request.readyState !== 4 && !xDomain) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201) + status: request.status === 1223 ? 204 : request.status, + statusText: request.status === 1223 ? 'No Content' : request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + var cookies$$1 = cookies; + + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? cookies$$1.read(config.xsrfCookieName) : undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (config.withCredentials) { + request.withCredentials = true; + } + + // Add responseType to request if needed + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. + // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. + if (config.responseType !== 'json') { + throw e; + } + } + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (requestData === undefined) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); + }; + + var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } + } + + function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = xhr; + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter + adapter = xhr; + } + return adapter; + } + + var defaults = { + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return _JSON$stringify(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) {/* Ignore */} + } + return data; + }], + + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } + }; + + defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } + }; + + utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); + }); + + var defaults_1 = defaults; + + function InterceptorManager() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + InterceptorManager.prototype.use = function use(fulfilled, rejected) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }); + return this.handlers.length - 1; + }; + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ + InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + }; + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ + InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + }; + + var InterceptorManager_1 = InterceptorManager; + + /** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ + var transformData = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; + }; + + var isCancel = function isCancel(value) { + return !!(value && value.__CANCEL__); + }; + + /** + * Throws a `Cancel` if cancellation has been requested. + */ + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + } + + /** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ + var dispatchRequest = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData(config.data, config.headers, config.transformRequest); + + // Flatten headers + config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers || {}); + + utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { + delete config.headers[method]; + }); + + var adapter = config.adapter || defaults_1.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData(response.data, response.headers, config.transformResponse); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData(reason.response.data, reason.response.headers, config.transformResponse); + } + } + + return _Promise.reject(reason); + }); + }; + + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + + var isAbsoluteURL = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return (/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url) + ); + }; + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ + + var combineURLs = function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; + }; + + /** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ + function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager_1(), + response: new InterceptorManager_1() + }; + } + + /** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ + Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = utils.merge({ + url: arguments[0] + }, arguments[1]); + } + + config = utils.merge(defaults_1, this.defaults, { method: 'get' }, config); + config.method = config.method.toLowerCase(); + + // Support baseURL config + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } + + // Hook up interceptors middleware + var chain = [dispatchRequest, undefined]; + var promise$$1 = _Promise.resolve(config); + + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected); + }); + + while (chain.length) { + promise$$1 = promise$$1.then(chain.shift(), chain.shift()); + } + + return promise$$1; + }; + + // Provide aliases for supported request methods + utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url + })); + }; + }); + + utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; + }); + + var Axios_1 = Axios; + + /** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ + + function Cancel(message) { + this.message = message; + } + + Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); + }; + + Cancel.prototype.__CANCEL__ = true; + + var Cancel_1 = Cancel; + + /** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ + function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new _Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel_1(message); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `Cancel` if cancellation has been requested. + */ + CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } + }; + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; + }; + + var CancelToken_1 = CancelToken; + + /** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ + + var spread = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + }; + + /** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ + function createInstance(defaultConfig) { + var context = new Axios_1(defaultConfig); + var instance = bind(Axios_1.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios_1.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; + } + + // Create the default instance to be exported + var axios$2 = createInstance(defaults_1); + + // Expose Axios class to allow class inheritance + axios$2.Axios = Axios_1; + + // Factory for creating new instances + axios$2.create = function create(instanceConfig) { + return createInstance(utils.merge(defaults_1, instanceConfig)); + }; + + // Expose Cancel & CancelToken + axios$2.Cancel = Cancel_1; + axios$2.CancelToken = CancelToken_1; + axios$2.isCancel = isCancel; + + // Expose all/spread + axios$2.all = function all(promises) { + return _Promise.all(promises); + }; + axios$2.spread = spread; + + var axios_1 = axios$2; + + // Allow use of default import syntax in TypeScript + var default_1 = axios$2; + + axios_1.default = default_1; + + var axios = axios_1; + + // most Object methods by ES6 should accept primitives + + + + var _objectSap = function (KEY, exec) { + var fn = (_core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp); + }; + + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + + var $getOwnPropertyDescriptor$1 = _objectGopd.f; + + _objectSap('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor$1(_toIobject(it), key); + }; + }); + + var $Object$1 = _core.Object; + var getOwnPropertyDescriptor$1 = function getOwnPropertyDescriptor(it, key) { + return $Object$1.getOwnPropertyDescriptor(it, key); + }; + + var getOwnPropertyDescriptor = createCommonjsModule(function (module) { + module.exports = { "default": getOwnPropertyDescriptor$1, __esModule: true }; + }); + + var _Object$getOwnPropertyDescriptor = unwrapExports(getOwnPropertyDescriptor); + + var stateMachine = createCommonjsModule(function (module, exports) { + /* + + Javascript State Machine Library - https://github.com/jakesgordon/javascript-state-machine + + Copyright (c) 2012, 2013, 2014, 2015, Jake Gordon and contributors + Released under the MIT license - https://github.com/jakesgordon/javascript-state-machine/blob/master/LICENSE + + */ + + (function () { + + var StateMachine = { + + //--------------------------------------------------------------------------- + + VERSION: "2.4.0", + + //--------------------------------------------------------------------------- + + Result: { + SUCCEEDED: 1, // the event transitioned successfully from one state to another + NOTRANSITION: 2, // the event was successfull but no state transition was necessary + CANCELLED: 3, // the event was cancelled by the caller in a beforeEvent callback + PENDING: 4 // the event is asynchronous and the caller is in control of when the transition occurs + }, + + Error: { + INVALID_TRANSITION: 100, // caller tried to fire an event that was innapropriate in the current state + PENDING_TRANSITION: 200, // caller tried to fire an event while an async transition was still pending + INVALID_CALLBACK: 300 // caller provided callback function threw an exception + }, + + WILDCARD: '*', + ASYNC: 'async', + + //--------------------------------------------------------------------------- + + create: function(cfg, target) { + + var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial; // allow for a simple string, or an object with { state: 'foo', event: 'setup', defer: true|false } + var terminal = cfg.terminal || cfg['final']; + var fsm = target || cfg.target || {}; + var events = cfg.events || []; + var callbacks = cfg.callbacks || {}; + var map = {}; // track state transitions allowed for an event { event: { from: [ to ] } } + var transitions = {}; // track events allowed from a state { state: [ event ] } + + var add = function(e) { + var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]); // allow 'wildcard' transition if 'from' is not specified + map[e.name] = map[e.name] || {}; + for (var n = 0 ; n < from.length ; n++) { + transitions[from[n]] = transitions[from[n]] || []; + transitions[from[n]].push(e.name); + + map[e.name][from[n]] = e.to || from[n]; // allow no-op transition if 'to' is not specified + } + if (e.to) + transitions[e.to] = transitions[e.to] || []; + }; + + if (initial) { + initial.event = initial.event || 'startup'; + add({ name: initial.event, from: 'none', to: initial.state }); + } + + for(var n = 0 ; n < events.length ; n++) + add(events[n]); + + for(var name in map) { + if (map.hasOwnProperty(name)) + fsm[name] = StateMachine.buildEvent(name, map[name]); + } + + for(var name in callbacks) { + if (callbacks.hasOwnProperty(name)) + fsm[name] = callbacks[name]; + } + + fsm.current = 'none'; + fsm.is = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); }; + fsm.can = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }; + fsm.cannot = function(event) { return !this.can(event); }; + fsm.transitions = function() { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); }; + fsm.isFinished = function() { return this.is(terminal); }; + fsm.error = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; }; // default behavior when something unexpected happens is to throw an exception, but caller can override this behavior if desired (see github issue #3 and #17) + fsm.states = function() { return Object.keys(transitions).sort() }; + + if (initial && !initial.defer) + fsm[initial.event](); + + return fsm; + + }, + + //=========================================================================== + + doCallback: function(fsm, func, name, from, to, args) { + if (func) { + try { + return func.apply(fsm, [name, from, to].concat(args)); + } + catch(e) { + return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, "an exception occurred in a caller-provided callback function", e); + } + } + }, + + beforeAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'], name, from, to, args); }, + afterAnyEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'], name, from, to, args); }, + leaveAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'], name, from, to, args); }, + enterAnyState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'], name, from, to, args); }, + changeState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'], name, from, to, args); }, + + beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name], name, from, to, args); }, + afterThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter' + name] || fsm['on' + name], name, from, to, args); }, + leaveThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave' + from], name, from, to, args); }, + enterThisState: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter' + to] || fsm['on' + to], name, from, to, args); }, + + beforeEvent: function(fsm, name, from, to, args) { + if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) || + (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args))) + return false; + }, + + afterEvent: function(fsm, name, from, to, args) { + StateMachine.afterThisEvent(fsm, name, from, to, args); + StateMachine.afterAnyEvent( fsm, name, from, to, args); + }, + + leaveState: function(fsm, name, from, to, args) { + var specific = StateMachine.leaveThisState(fsm, name, from, to, args), + general = StateMachine.leaveAnyState( fsm, name, from, to, args); + if ((false === specific) || (false === general)) + return false; + else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general)) + return StateMachine.ASYNC; + }, + + enterState: function(fsm, name, from, to, args) { + StateMachine.enterThisState(fsm, name, from, to, args); + StateMachine.enterAnyState( fsm, name, from, to, args); + }, + + //=========================================================================== + + buildEvent: function(name, map) { + return function() { + + var from = this.current; + var to = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from; + var args = Array.prototype.slice.call(arguments); // turn arguments into pure array + + if (this.transition) + return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, "event " + name + " inappropriate because previous transition did not complete"); + + if (this.cannot(name)) + return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, "event " + name + " inappropriate in current state " + this.current); + + if (false === StateMachine.beforeEvent(this, name, from, to, args)) + return StateMachine.Result.CANCELLED; + + if (from === to) { + StateMachine.afterEvent(this, name, from, to, args); + return StateMachine.Result.NOTRANSITION; + } + + // prepare a transition method for use EITHER lower down, or by caller if they want an async transition (indicated by an ASYNC return value from leaveState) + var fsm = this; + this.transition = function() { + fsm.transition = null; // this method should only ever be called once + fsm.current = to; + StateMachine.enterState( fsm, name, from, to, args); + StateMachine.changeState(fsm, name, from, to, args); + StateMachine.afterEvent( fsm, name, from, to, args); + return StateMachine.Result.SUCCEEDED; + }; + this.transition.cancel = function() { // provide a way for caller to cancel async transition if desired (issue #22) + fsm.transition = null; + StateMachine.afterEvent(fsm, name, from, to, args); + }; + + var leave = StateMachine.leaveState(this, name, from, to, args); + if (false === leave) { + this.transition = null; + return StateMachine.Result.CANCELLED; + } + else if (StateMachine.ASYNC === leave) { + return StateMachine.Result.PENDING; + } + else { + if (this.transition) // need to check in case user manually called transition() but forgot to return StateMachine.ASYNC + return this.transition(); + } + + }; + } + + }; // StateMachine + + //=========================================================================== + + //====== + // NODE + //====== + { + if ('object' !== 'undefined' && module.exports) { + exports = module.exports = StateMachine; + } + exports.StateMachine = StateMachine; + } + + }()); + }); + + var getWeak = _meta.getWeak; + + + + + + + + var arrayFind = _arrayMethods(5); + var arrayFindIndex = _arrayMethods(6); + var id$1 = 0; + + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function (that) { + return that._l || (that._l = new UncaughtFrozenStore()); + }; + var UncaughtFrozenStore = function () { + this.a = []; + }; + var findUncaughtFrozen = function (store, key) { + return arrayFind(store.a, function (it) { + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function (key) { + var index = arrayFindIndex(this.a, function (it) { + return it[0] === key; + }); + if (~index) this.a.splice(index, 1); + return !!~index; + } + }; + + var _collectionWeak = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + _anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = id$1++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); + }); + _redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + if (!_isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME))['delete'](key); + return data && _has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + if (!_isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME)).has(key); + return data && _has(data, this._i); + } + }); + return C; + }, + def: function (that, key, value) { + var data = getWeak(_anObject(key), true); + if (data === true) uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore + }; + + var es6_weakMap = createCommonjsModule(function (module) { + 'use strict'; + var each = _arrayMethods(0); + + + + + + + + var WEAK_MAP = 'WeakMap'; + var getWeak = _meta.getWeak; + var isExtensible = Object.isExtensible; + var uncaughtFrozenStore = _collectionWeak.ufstore; + var tmp = {}; + var InternalMap; + + var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; + }; + + var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + if (_isObject(key)) { + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(_validateCollection(this, WEAK_MAP)).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return _collectionWeak.def(_validateCollection(this, WEAK_MAP), key, value); + } + }; + + // 23.3 WeakMap Objects + var $WeakMap = module.exports = _collection(WEAK_MAP, wrapper, methods, _collectionWeak, true, true); + + // IE11 WeakMap frozen keys fix + if (_fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + InternalMap = _collectionWeak.getConstructor(wrapper, WEAK_MAP); + _objectAssign(InternalMap.prototype, methods); + _meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function (key) { + var proto = $WeakMap.prototype; + var method = proto[key]; + _redefine(proto, key, function (a, b) { + // store frozen objects on internal weakmap shim + if (_isObject(a) && !isExtensible(a)) { + if (!this._f) this._f = new InternalMap(); + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); + } + }); + + // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of + _setCollectionOf('WeakMap'); + + // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from + _setCollectionFrom('WeakMap'); + + var weakMap$1 = _core.WeakMap; + + var weakMap = createCommonjsModule(function (module) { + module.exports = { "default": weakMap$1, __esModule: true }; + }); + + var _WeakMap = unwrapExports(weakMap); + + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + _export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f }); + + var $Object$2 = _core.Object; + var defineProperty$3 = function defineProperty(it, key, desc) { + return $Object$2.defineProperty(it, key, desc); + }; + + var defineProperty$2 = createCommonjsModule(function (module) { + module.exports = { "default": defineProperty$3, __esModule: true }; + }); + + var _Object$defineProperty = unwrapExports(defineProperty$2); + + var defineProperty$1 = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _defineProperty2 = _interopRequireDefault(defineProperty$2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function (obj, key, value) { + if (key in obj) { + (0, _defineProperty2.default)(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + }; + }); + + var _defineProperty = unwrapExports(defineProperty$1); + + // 19.1.2.14 Object.keys(O) + + + + _objectSap('keys', function () { + return function keys(it) { + return _objectKeys(_toObject(it)); + }; + }); + + var keys$1 = _core.Object.keys; + + var keys = createCommonjsModule(function (module) { + module.exports = { "default": keys$1, __esModule: true }; + }); + + var _Object$keys = unwrapExports(keys); + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; + + var _freeGlobal = freeGlobal; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = _freeGlobal || freeSelf || Function('return this')(); + + var _root = root; + + /** Built-in value references. */ + var Symbol$1 = _root.Symbol; + + var _Symbol$1 = Symbol$1; + + /** Used for built-in method references. */ + var objectProto$1 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$2 = objectProto$1.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto$1.toString; + + /** Built-in value references. */ + var symToStringTag$1 = _Symbol$1 ? _Symbol$1.toStringTag : undefined; + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty$2.call(value, symToStringTag$1), + tag = value[symToStringTag$1]; + + try { + value[symToStringTag$1] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag$1] = tag; + } else { + delete value[symToStringTag$1]; + } + } + return result; + } + + var _getRawTag = getRawTag; + + /** Used for built-in method references. */ + var objectProto$2 = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString$1 = objectProto$2.toString; + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString$1.call(value); + } + + var _objectToString = objectToString; + + /** `Object#toString` result references. */ + var nullTag = '[object Null]'; + var undefinedTag = '[object Undefined]'; + + /** Built-in value references. */ + var symToStringTag = _Symbol$1 ? _Symbol$1.toStringTag : undefined; + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? _getRawTag(value) + : _objectToString(value); + } + + var _baseGetTag = baseGetTag; + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + var _overArg = overArg; + + /** Built-in value references. */ + var getPrototype = _overArg(Object.getPrototypeOf, Object); + + var _getPrototype = getPrototype; + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + var isObjectLike_1 = isObjectLike; + + /** `Object#toString` result references. */ + var objectTag = '[object Object]'; + + /** Used for built-in method references. */ + var funcProto = Function.prototype; + var objectProto = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty$1 = objectProto.hasOwnProperty; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) { + return false; + } + var proto = _getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty$1.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + var isPlainObject_1 = isPlainObject; + + /* eslint-disable */ + var global$2 = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {}; + + var createClass = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _defineProperty2 = _interopRequireDefault(defineProperty$2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + }); + + var _createClass = unwrapExports(createClass); + + var EXPIRED = _Symbol('expired'); + var debug$5 = browser$1('LC:Expirable'); + + var Expirable = function () { + function Expirable(value, ttl) { + _classCallCheck(this, Expirable); + + this._value = value; + if (typeof ttl === 'number') { + this.expiredAt = Date.now() + ttl; + } + } + + _createClass(Expirable, [{ + key: 'value', + get: function get() { + var expired = this.expiredAt && this.expiredAt < Date.now(); + if (expired) debug$5('expired: ' + this._value); + return expired ? EXPIRED : this._value; + } + }]); + + return Expirable; + }(); + + Expirable.EXPIRED = EXPIRED; + + var debug$6 = browser$1('LC:Cache'); + + var Cache = function () { + function Cache() { + var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'anonymous'; + + _classCallCheck(this, Cache); + + this.name = name; + this._map = {}; + } + + Cache.prototype.get = function get(key) { + var cache = this._map[key]; + if (cache) { + var value = cache.value; + if (value !== Expirable.EXPIRED) { + debug$6('[%s] hit: %s %O', this.name, key, value); + return value; + } + delete this._map[key]; + } + debug$6('[' + this.name + '] missed: ' + key); + return null; + }; + + Cache.prototype.set = function set(key, value, ttl) { + debug$6('[%s] set: %s %O %d', this.name, key, value, ttl); + this._map[key] = new Expirable(value, ttl); + }; + + return Cache; + }(); + + var tryAll = function tryAll(promiseConstructors) { + var promise$$1 = new _Promise(promiseConstructors[0]); + if (promiseConstructors.length === 1) { + return promise$$1; + } + return promise$$1.catch(function () { + return tryAll(promiseConstructors.slice(1)); + }); + }; + + var tap = function tap(interceptor) { + return function (value) { + return interceptor(value), value; + }; + }; + + var decodeDate = function decodeDate(date) { + if (!date) return date; + if (typeof date === 'string') { + return new Date(date); + } + if (date.__type === 'Date' && date.iso) { + return new Date(date.iso); + } + // Long + if (typeof date.toNumber === 'function') { + return new Date(date.toNumber()); + } + return date; + }; + + var keyRemap = function keyRemap(keymap, obj) { + return _Object$keys(obj).reduce(function (newObj, key) { + var newKey = keymap[key] || key; + return _Object$assign(newObj, _defineProperty({}, newKey, obj[key])); + }, {}); + }; + + var isIE10 = global$2.navigator && global$2.navigator.userAgent && global$2.navigator.userAgent.indexOf('MSIE 10.') !== -1; + + /* eslint-disable no-proto */ + var getStaticProperty = function getStaticProperty(klass, property) { + return klass[property] || (klass.__proto__ ? getStaticProperty(klass.__proto__, property) : undefined); + }; + /* eslint-enable no-proto */ + + var union = function union(a, b) { + return _Array$from(new _Set([].concat(_toConsumableArray(a), _toConsumableArray(b)))); + }; + var difference = function difference(a, b) { + return _Array$from(function (bSet) { + return new _Set(a.filter(function (x) { + return !bSet.has(x); + })); + }(new _Set(b))); + }; + + var map = new _WeakMap(); + + // protected property helper + var internal = function internal(object) { + if (!map.has(object)) { + map.set(object, {}); + } + return map.get(object); + }; + + // debug utility + var removeNull = function removeNull(obj) { + if (!isPlainObject_1(obj)) return obj; + var object = _Object$assign({}, obj); + // eslint-disable-next-line no-restricted-syntax + for (var prop in object) { + if ({}.hasOwnProperty.call(object, prop)) { + var value = object[prop]; + if (value === null) { + delete object[prop]; + } else { + object[prop] = removeNull(value); + } + } + } + return object; + }; + var trim$1 = function trim(message) { + return removeNull(JSON.parse(_JSON$stringify(message))); + }; + + var ensureArray = function ensureArray(target) { + if (Array.isArray(target)) { + return target; + } + if (target === undefined || target === null) { + return []; + } + return [target]; + }; + + var setValue = function setValue(target, key, value) { + // '.' is not allowed in Class keys, escaping is not in concern now. + var segs = key.split('.'); + var lastSeg = segs.pop(); + var currentTarget = target; + segs.forEach(function (seg) { + if (currentTarget[seg] === undefined) currentTarget[seg] = {}; + currentTarget = currentTarget[seg]; + }); + currentTarget[lastSeg] = value; + return target; + }; + + // eslint-disable-next-line no-undef + var isWeapp = (typeof wx === 'undefined' ? 'undefined' : _typeof(wx)) === 'object' && typeof wx.connectSocket === 'function'; + + // throttle decorator + var throttle = function throttle(wait) { + return function (target, property, descriptor) { + var callback = descriptor.value; + // very naive, internal use only + if (callback.length) { + throw new Error('throttled function should not accept any arguments'); + } + return _extends$1({}, descriptor, { + value: function value() { + var _this = this; + + var _internal = internal(this), + throttleMeta = _internal.throttleMeta; + + if (!throttleMeta) { + throttleMeta = {}; + internal(this).throttleMeta = throttleMeta; + } + var _throttleMeta = throttleMeta, + propertyMeta = _throttleMeta[property]; + + if (!propertyMeta) { + propertyMeta = {}; + throttleMeta[property] = propertyMeta; + } + var _propertyMeta = propertyMeta, + _propertyMeta$previou = _propertyMeta.previouseTimestamp, + previouseTimestamp = _propertyMeta$previou === undefined ? 0 : _propertyMeta$previou, + timeout = _propertyMeta.timeout; + + var now = Date.now(); + var remainingTime = wait - (now - previouseTimestamp); + if (remainingTime <= 0) { + throttleMeta[property].previouseTimestamp = now; + callback.apply(this); + } else if (!timeout) { + propertyMeta.timeout = setTimeout(function () { + propertyMeta.previouseTimestamp = Date.now(); + delete propertyMeta.timeout; + callback.apply(_this); + }, remainingTime); + } + } + }); + }; + }; + + var WebSocket = global$2.WebSocket || global$2.MozWebSocket; + + var _class; + + function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; + } + + // WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface. + + var debug$4 = browser$1('LC:WebSocketPlus'); + + var HEARTBEAT_TIME = 180000; + var TIMEOUT_TIME = 380000; + + var DEFAULT_RETRY_STRATEGY = function DEFAULT_RETRY_STRATEGY(attempt) { + return Math.min(1000 * Math.pow(2, attempt), 300000); + }; + + var requireConnected = function requireConnected(target, name, descriptor) { + return _Object$assign({}, descriptor, { + value: function requireConnectedWrapper() { + var _descriptor$value; + + if (!this.is('connected')) { + var currentState = this.current; + console.warn(name + ' should not be called when the connection is ' + currentState); + if (this.is('disconnected') || this.is('reconnecting')) { + console.warn('disconnect and reconnect event should be handled to avoid such calls.'); + } + throw new Error('Connection unavailable'); + } + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return (_descriptor$value = descriptor.value).call.apply(_descriptor$value, [this].concat(args)); + } + }); + }; + + var WebSocketPlus = (_class = function (_EventEmitter) { + _inherits(WebSocketPlus, _EventEmitter); + + function WebSocketPlus(getUrls, protocol) { + _classCallCheck(this, WebSocketPlus); + + if (typeof WebSocket === 'undefined') { + throw new Error('WebSocket is undefined. Polyfill is required in this runtime.'); + } + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof getUrls !== 'function') { + _this._getUrls = function () { + return _Promise.resolve(getUrls); + }; + } else { + _this._getUrls = getUrls; + } + _this._protocol = protocol; + _this.init(); + _this._createWs(_this._getUrls, _this._protocol).then(function () { + _this.__postponeTimeoutTimer = _this._postponeTimeoutTimer.bind(_this); + if (global$2.addEventListener) { + _this.__pause = function () { + return _this.pause(); + }; + _this.__resume = function () { + return _this.resume(); + }; + global$2.addEventListener('offline', _this.__pause); + global$2.addEventListener('online', _this.__resume); + } + _this.open(); + }).catch(_this.throw.bind(_this)); + return _this; + } + + WebSocketPlus.prototype._createWs = function _createWs(getUrls, protocol) { + var _this2 = this; + + return getUrls().then(function (wsUrls) { + var urls = wsUrls; + if (!(urls instanceof Array)) { + urls = [urls]; + } + return tryAll(urls.map(function (url) { + return function (resolve, reject) { + debug$4('connect [' + url + '] ' + protocol); + var ws = protocol ? new WebSocket(url, protocol) : new WebSocket(url); + ws.binaryType = _this2.binaryType || 'arraybuffer'; + ws.onopen = function () { + return resolve(ws); + }; + ws.onclose = function (error) { + if (error instanceof Error) { + return reject(error); + } + // in browser, error event is useless + return reject(new Error('Failed to connect [' + url + ']')); + }; + ws.onerror = ws.onclose; + }; + })).then(function (ws) { + _this2._ws = ws; + _this2._ws.onclose = _this2._handleClose.bind(_this2); + _this2._ws.onmessage = _this2._handleMessage.bind(_this2); + return ws; + }); + }); + }; + + WebSocketPlus.prototype._destroyWs = function _destroyWs() { + var ws = this._ws; + if (!ws) return; + ws.onopen = null; + ws.onclose = null; + ws.onerror = null; + ws.onmessage = null; + this._ws = null; + ws.close(); + }; + + // eslint-disable-next-line class-methods-use-this + + + WebSocketPlus.prototype.onbeforeevent = function onbeforeevent(event, from, to) { + for (var _len2 = arguments.length, payload = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) { + payload[_key2 - 3] = arguments[_key2]; + } + + debug$4.apply(undefined, [event + ': ' + from + ' -> ' + to].concat(payload)); + }; + + WebSocketPlus.prototype.onopen = function onopen() { + this.emit('open'); + }; + + WebSocketPlus.prototype.onconnected = function onconnected() { + this._startConnectionKeeper(); + }; + + WebSocketPlus.prototype.onleaveconnected = function onleaveconnected(event, from, to) { + this._stopConnectionKeeper(); + this._destroyWs(); + if (to === 'offline' || to === 'disconnected') { + this.emit('disconnect'); + } + }; + + WebSocketPlus.prototype.onpause = function onpause() { + this.emit('offline'); + }; + + WebSocketPlus.prototype.onbeforeresume = function onbeforeresume() { + this.emit('online'); + }; + + WebSocketPlus.prototype.onreconnect = function onreconnect() { + this.emit('reconnect'); + }; + + WebSocketPlus.prototype.ondisconnected = function ondisconnected(event, from, to) { + var _this3 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + var delay = DEFAULT_RETRY_STRATEGY.call(null, attempt); + debug$4('schedule attempt=' + attempt + ' delay=' + delay); + this.emit('schedule', attempt, delay); + if (this.__scheduledRetry) { + clearTimeout(this.__scheduledRetry); + } + this.__scheduledRetry = setTimeout(function () { + if (_this3.is('disconnected')) { + _this3.retry(attempt); + } + }, delay); + }; + + WebSocketPlus.prototype.onretry = function onretry(event, from, to) { + var _this4 = this; + + var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + this.emit('retry', attempt); + this._createWs(this._getUrls, this._protocol).then(function () { + return _this4.can('reconnect') ? _this4.reconnect() : _this4._destroyWs(); + }, function () { + return _this4.can('fail') && _this4.fail(attempt + 1); + }); + }; + + WebSocketPlus.prototype.onerror = function onerror(event, from, to, error) { + this.emit('error', error); + }; + + WebSocketPlus.prototype.onclose = function onclose() { + if (global$2.removeEventListener) { + if (this.__pause) global$2.removeEventListener('offline', this.__pause); + if (this.__resume) global$2.removeEventListener('online', this.__resume); + } + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype._ping = function _ping() { + debug$4('ping'); + try { + this.ping(); + } catch (error) { + console.warn('websocket ping error: ' + error.message); + } + }; + + WebSocketPlus.prototype.ping = function ping() { + if (this._ws.ping) { + this._ws.ping(); + } else { + console.warn('The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.'); + } + }; + + WebSocketPlus.prototype._postponeTimeoutTimer = function _postponeTimeoutTimer() { + var _this5 = this; + + debug$4('_postponeTimeoutTimer'); + this._clearTimeoutTimers(); + this._timeoutTimer = setTimeout(function () { + debug$4('timeout'); + _this5.disconnect(); + }, TIMEOUT_TIME); + }; + + WebSocketPlus.prototype._clearTimeoutTimers = function _clearTimeoutTimers() { + if (this._timeoutTimer) { + clearTimeout(this._timeoutTimer); + } + }; + + WebSocketPlus.prototype._startConnectionKeeper = function _startConnectionKeeper() { + debug$4('start connection keeper'); + this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME); + var addListener = this._ws.addListener || this._ws.addEventListener; + addListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._postponeTimeoutTimer(); + }; + + WebSocketPlus.prototype._stopConnectionKeeper = function _stopConnectionKeeper() { + debug$4('stop connection keeper'); + // websockets/ws#489 + var removeListener = this._ws.removeListener || this._ws.removeEventListener; + removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer); + removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer); + this._clearTimeoutTimers(); + if (this._heartbeatTimer) { + clearInterval(this._heartbeatTimer); + } + }; + + WebSocketPlus.prototype._handleClose = function _handleClose(event) { + debug$4('ws closed [' + event.code + '] ' + event.reason); + // socket closed manually, ignore close event. + if (this.isFinished()) return; + this.handleClose(event); + }; + + WebSocketPlus.prototype.handleClose = function handleClose() { + // reconnect + this.disconnect(); + }; + + // jsdoc-ignore-start + + + // jsdoc-ignore-end + WebSocketPlus.prototype.send = function send(data) { + debug$4('send', data); + this._ws.send(data); + }; + + WebSocketPlus.prototype._handleMessage = function _handleMessage(event) { + debug$4('message', event.data); + this.handleMessage(event.data); + }; + + WebSocketPlus.prototype.handleMessage = function handleMessage(message) { + this.emit('message', message); + }; + + return WebSocketPlus; + }(eventemitter3), (_applyDecoratedDescriptor(_class.prototype, '_ping', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, '_ping'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'send', [requireConnected], _Object$getOwnPropertyDescriptor(_class.prototype, 'send'), _class.prototype)), _class); + + + stateMachine.create({ + target: WebSocketPlus.prototype, + initial: { + state: 'initialized', + event: 'init', + defer: true + }, + terminal: 'closed', + events: [{ + name: 'open', + from: 'initialized', + to: 'connected' + }, { + name: 'disconnect', + from: 'connected', + to: 'disconnected' + }, { + name: 'retry', + from: 'disconnected', + to: 'reconnecting' + }, { + name: 'fail', + from: 'reconnecting', + to: 'disconnected' + }, { + name: 'reconnect', + from: 'reconnecting', + to: 'connected' + }, { + name: 'pause', + from: ['connected', 'disconnected', 'reconnecting'], + to: 'offline' + }, {}, { + name: 'resume', + from: 'offline', + to: 'disconnected' + }, { + name: 'close', + from: ['connected', 'disconnected', 'reconnecting', 'offline'], + to: 'closed' + }, { + name: 'throw', + from: '*', + to: 'error' + }] + }); + + // 19.1.2.5 Object.freeze(O) + + var meta = _meta.onFreeze; + + _objectSap('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && _isObject(it) ? $freeze(meta(it)) : it; + }; + }); + + var freeze$1 = _core.Object.freeze; + + var freeze = createCommonjsModule(function (module) { + module.exports = { "default": freeze$1, __esModule: true }; + }); + + var _Object$freeze = unwrapExports(freeze); + + var error = _Object$freeze({ + 1000: { + name: 'CLOSE_NORMAL' + }, + 1006: { + name: 'CLOSE_ABNORMAL' + }, + 4100: { + name: 'APP_NOT_AVAILABLE', + message: 'App not exists or realtime message service is disabled.' + }, + 4103: { + name: 'INVALID_LOGIN', + message: 'Malformed clientId.' + }, + 4105: { + name: 'SESSION_REQUIRED', + message: 'Message sent before session opened. ' + }, + 4107: { + name: 'READ_TIMEOUT' + }, + 4108: { + name: 'LOGIN_TIMEOUT' + }, + 4109: { + name: 'FRAME_TOO_LONG' + }, + 4110: { + name: 'INVALID_ORIGIN', + message: 'Access denied by domain whitelist.' + }, + 4111: { + name: 'SESSION_CONFLICT' + }, + 4112: { + name: 'SESSION_TOKEN_EXPIRED' + }, + 4200: { + name: 'INTERNAL_ERROR', + message: 'Internal error, please contact LeanCloud for support.' + }, + 4201: { + name: 'SEND_MESSAGE_TIMEOUT' + }, + 4302: { + name: 'CONVERSATION_SIGNATURE_FAILED' + }, + 4303: { + name: 'CONVERSATION_NOT_FOUND' + }, + 4304: { + name: 'CONVERSATION_FULL' + }, + 4305: { + name: 'CONVERSATION_REJECTED_BY_APP' + }, + 4306: { + name: 'CONVERSATION_UPDATE_FAILED' + }, + 4307: { + name: 'CONVERSATION_READ_ONLY' + }, + 4308: { + name: 'CONVERSATION_NOT_ALLOWED' + }, + 4401: { + name: 'INVALID_MESSAGING_TARGET' + }, + 4402: { + name: 'MESSAGE_REJECTED_BY_APP' + } + }); + + var ErrorCode = _Object$freeze(_Object$keys(error).reduce(function (result, code) { + return _Object$assign(result, _defineProperty({}, error[code].name, Number(code))); + }, {})); + + var createError$3 = function createError(errorMessage) { + var code = errorMessage.code, + reason = errorMessage.reason, + appCode = errorMessage.appCode, + detail = errorMessage.detail; + + var message = reason || detail; + if (!message && error[code]) { + message = error[code].message || error[code].name; + } + if (!message) { + message = 'Unknow Error: ' + code; + } + var err = new Error(message); + return _Object$assign(err, { + code: code, appCode: appCode, detail: detail + }); + }; + + var debug$3 = browser$1('LC:Connection'); + + var COMMAND_TIMEOUT = 20000; + + var Connection = function (_WebSocketPlus) { + _inherits(Connection, _WebSocketPlus); + + function Connection(getUrl, _ref) { + var format = _ref.format, + version = _ref.version; + + _classCallCheck(this, Connection); + + debug$3('initializing Connection'); + var protocolString = 'lc.' + format + '.' + version; + if (!isWeapp) { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl, protocolString)); + } else { + var _this = _possibleConstructorReturn(this, _WebSocketPlus.call(this, getUrl().then(function (urls) { + return urls.map(function (url) { + return '' + url + (url.indexOf('?') === -1 ? '?' : '&') + 'subprotocol=' + encodeURIComponent(protocolString); + }); + }))); + } + _this._protocalFormat = format; + _this._commands = {}; + _this._serialId = 0; + return _possibleConstructorReturn(_this); + } + + Connection.prototype.send = function send(command) { + var _this2 = this; + + var waitingForRespond = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + var serialId = void 0; + if (waitingForRespond) { + this._serialId += 1; + serialId = this._serialId; + command.i = serialId; // eslint-disable-line no-param-reassign + } + debug$3('↑ %O sent', trim$1(command)); + + var message = void 0; + if (this._protocalFormat === 'proto2base64') { + message = command.toBase64(); + } else if (command.toArrayBuffer) { + message = command.toArrayBuffer(); + } + if (!message) { + throw new TypeError(command + ' is not a GenericCommand'); + } + + _WebSocketPlus.prototype.send.call(this, message); + + if (!waitingForRespond) { + return _Promise.resolve(); + } + return new _Promise(function (resolve, reject) { + _this2._commands[serialId] = { + resolve: resolve, + reject: reject, + timeout: setTimeout(function () { + if (_this2._commands[serialId]) { + debug$3('✗ %O timeout', trim$1(command)); + reject(new Error('Command Timeout.')); + delete _this2._commands[serialId]; + } + }, COMMAND_TIMEOUT) + }; + }); + }; + + Connection.prototype.handleMessage = function handleMessage(msg) { + var message = void 0; + try { + message = GenericCommand.decode(msg); + debug$3('↓ %O received', trim$1(message)); + } catch (e) { + console.warn('Decode message failed', msg); + } + this.emit('allmessage', message); + var serialId = message.i; + if (serialId) { + if (this._commands[serialId]) { + clearTimeout(this._commands[serialId].timeout); + if (message.cmd === CommandType.error) { + this._commands[serialId].reject(createError$3(message.errorMessage)); + } else { + this._commands[serialId].resolve(message); + } + delete this._commands[serialId]; + } else { + console.warn('Unexpected command received with serialId [' + serialId + '],\n which have timed out or never been requested.'); + } + } else if (message.cmd === CommandType.error) { + this.emit('error', createError$3(message.errorMessage)); + } else { + this.emit('message', message); + } + }; + + Connection.prototype.ping = function ping() { + return this.send(new GenericCommand({ + cmd: CommandType.echo + })).catch(function (error$$1) { + return debug$3('ping failed:', error$$1); + }); + }; + + return Connection; + }(WebSocketPlus); + + /* eslint-disable max-len */ + + /** + * 插件接口 + * + *

+ * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类: + *

+ * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。 + * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。 + *

+ * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。 + * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。 + * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。 + *

+ * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。 + * + * @interface Plugin + * @since 3.1.0 + */ + + /* eslint-enable max-len */ + + /** + * 插件名称,用于在日志中显示异常的插件 + * + * @name Plugin.name + * @type string + */ + + /** + * 插件注册的消息类型 + * + * @name Plugin.messageClasses + * @type AVMessage[] + */ + + /** + * 在 Realtime 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Realtime 实例。 + * + * @name Plugin.onRealtimeCreate + * @type Function + */ + + /** + * 在 IMClient 实例化后对其进行修饰。 + *

+ * 接受一个参数为 IMClient 实例。 + * + * @name Plugin.onIMClientCreate + * @type Function + */ + + /** + * 在 Conversation 实例化后对其进行修饰。 + *

+ * 接受一个参数为 Conversation 实例。 + * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook, + * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。 + * + * @name Plugin.onConversationCreate + * @type Function + */ + + /** + * 在对消息进行 parse 之前,对原始消息进行修改。 + *

+ * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。 + * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。 + * + * @name Plugin.beforeMessageParse + * @type Function + */ + + /** + * 在对消息进行 parse 之后,对消息实例进行修改。 + *

+ * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。 + * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.afterMessageParse + * @type Function + */ + + /** + * 在收到消息之后,派发消息之前,控制是否派发这条消息。 + *

+ * 接受参数为 message 与 conversation。 + * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。 + * 如果这个结果是异步得到的,也可以返回一个 Promise。 + * + * @name Plugin.beforeMessageDispatch + * @type Function + * @since 3.4.0 + */ + + var checkType = function checkType(middleware) { + return function (param) { + var constructor = param.constructor; + + return _Promise.resolve(param).then(middleware).then(tap(function (result) { + if (result === undefined || result === null) { + // eslint-disable-next-line max-len + return console.warn('Middleware[' + (middleware._pluginName || 'anonymous plugin') + ':' + (middleware.name || 'anonymous middleware') + '] param/return types not match. It returns ' + result + ' while a ' + param.constructor.name + ' expected.'); + } + if (!(result instanceof constructor)) { + // eslint-disable-next-line max-len + return console.warn('Middleware[' + (middleware._pluginName || 'anonymous plugin') + ':' + (middleware.name || 'anonymous middleware') + '] param/return types not match. It returns a ' + result.constructor.name + ' while a ' + param.constructor.name + ' expected.'); + } + return 0; + })); + }; + }; + + var applyDecorators = function applyDecorators(decorators, target) { + if (decorators) { + decorators.forEach(function (decorator) { + try { + decorator(target); + } catch (error) { + if (decorator._pluginName) { + error.message += '[' + decorator._pluginName + ']'; + } + throw error; + } + }); + } + }; + + var applyMiddlewares = function applyMiddlewares(middlewares) { + return function (target) { + return ensureArray(middlewares).reduce(function (previousPromise, middleware) { + return previousPromise.then(checkType(middleware)).catch(function (error) { + if (middleware._pluginName) { + // eslint-disable-next-line no-param-reassign + error.message += '[' + middleware._pluginName + ']'; + } + throw error; + }); + }, _Promise.resolve(target)); + }; + }; + + var applyDispatcher = function applyDispatcher(dispatchers, payload) { + return ensureArray(dispatchers).reduce(function (resultPromise, dispatcher) { + return resultPromise.then(function (shouldDispatch) { + return shouldDispatch === false ? false : dispatcher.apply(undefined, _toConsumableArray(payload)); + }).catch(function (error) { + if (dispatcher._pluginName) { + // eslint-disable-next-line no-param-reassign + error.message += '[' + dispatcher._pluginName + ']'; + } + throw error; + }); + }, _Promise.resolve(true)); + }; + + var debug = browser$1('LC:Realtime'); + + var routerCache = new Cache('push-router'); + + var Realtime = function (_EventEmitter) { + _inherits(Realtime, _EventEmitter); + + /** + * @extends EventEmitter + * @param {Object} options + * @param {String} options.appId + * @param {String} options.appKey (since 4.0.0) + * @param {String} [options.region='cn'] 节点 id + * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式) + * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。 + * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序) + * @param {Boolean} [options.ssl=true] 使用 wss 进行连接 + * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0) + */ + function Realtime(options) { + _classCallCheck(this, Realtime); + + debug('initializing Realtime'); + + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); + + if (typeof options.appId !== 'string') { + throw new TypeError('appId [' + options.appId + '] is not a string'); + } + if (typeof options.appKey !== 'string') { + throw new TypeError('appKey [' + options.appKey + '] is not a string'); + } + _this._options = _Object$assign({ + appId: undefined, + appKey: undefined, + region: 'cn', + pushOfflineMessages: false, + noBinary: isWeapp, + ssl: true, + server: process.env.SERVER + }, options); + _this._cache = new Cache('endpoints'); + internal(_this).clients = new _Set(); + _this._plugins = [].concat(_toConsumableArray(ensureArray(Realtime.__preRegisteredPlugins)), _toConsumableArray(ensureArray(options.plugins))).reduce(function (result, plugin) { + // eslint-disable-next-line no-restricted-syntax + for (var hook in plugin) { + if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') { + if (plugin.name) { + ensureArray(plugin[hook]).forEach(function (value) { + // eslint-disable-next-line no-param-reassign + value._pluginName = plugin.name; + }); + } + // eslint-disable-next-line no-param-reassign + result[hook] = ensureArray(result[hook]).concat(plugin[hook]); + } + } + return result; + }, {}); + // onRealtimeCreate hook + applyDecorators(_this._plugins.onRealtimeCreate, _this); + return _this; + } + + Realtime.prototype._request = function () { + var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) { + var method = _ref.method, + _ref$version = _ref.version, + version = _ref$version === undefined ? '1.1' : _ref$version, + path = _ref.path, + query = _ref.query, + headers = _ref.headers, + _ref$data = _ref.data, + data = _ref$data === undefined ? {} : _ref$data; + + var _options, appId, region, _ref3, api, url; + + return regenerator.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _options = this._options, appId = _options.appId, region = _options.region; + _context.next = 3; + return this.constructor._fetchAppRouter({ appId: appId, region: region }); + + case 3: + _ref3 = _context.sent; + api = _ref3.api; + url = 'https://' + api + '/' + version + path; + return _context.abrupt('return', axios(url, { + method: method, + params: query, + headers: _extends$1({ + 'X-LC-Id': this._options.appId, + 'X-LC-Key': this._options.appKey + }, headers), + data: data + }).then(function (response) { + return response.data; + })); + + case 7: + case 'end': + return _context.stop(); + } + } + }, _callee, this); + })); + + function _request(_x) { + return _ref2.apply(this, arguments); + } + + return _request; + }(); + + Realtime.prototype._open = function _open() { + var _this2 = this; + + if (this._openPromise) return this._openPromise; + + var format = 'protobuf2'; + if (this._options.noBinary) { + // 不发送 binary data,fallback to base64 string + format = 'proto2base64'; + } + var version = 3; + if (this._options.pushOfflineMessages) { + // 不推送离线消息,而是发送对话的未读通知 + version = 1; + } + var protocol = { + format: format, + version: version + }; + this._openPromise = new _Promise(function (resolve, reject) { + debug('No connection established, create a new one.'); + var connection = new Connection(function () { + return _this2._getEndpoints(_this2._options); + }, protocol); + connection.on('open', function () { + return resolve(connection); + }); + connection.on('error', reject); + connection.on('message', _this2._dispatchCommand.bind(_this2)); + /** + * 连接断开。 + * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。 + * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。 + * @event Realtime#disconnect + */ + /** + * 计划在一段时间后尝试重新连接 + * @event Realtime#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + */ + /** + * 正在尝试重新连接 + * @event Realtime#retry + * @param {Number} attempt 尝试重连的次数 + */ + /** + * 连接恢复正常。 + * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素 + * @event Realtime#reconnect + */ + + /** + * 客户端连接断开 + * @event IMClient#disconnect + * @see Realtime#event:disconnect + * @since 3.2.0 + */ + /** + * 计划在一段时间后尝试重新连接 + * @event IMClient#schedule + * @param {Number} attempt 尝试重连的次数 + * @param {Number} delay 延迟的毫秒数 + * @since 3.2.0 + */ + /** + * 正在尝试重新连接 + * @event IMClient#retry + * @param {Number} attempt 尝试重连的次数 + * @since 3.2.0 + */ + + /** + * 客户端进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event Realtime#offline + * @since 3.4.0 + */ + /** + * 客户端恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event Realtime#online + * @since 3.4.0 + */ + /** + * 进入离线状态。 + * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用 + * @event IMClient#offline + * @since 3.4.0 + */ + /** + * 恢复在线状态 + * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用 + * @event IMClient#online + * @since 3.4.0 + */ + + // event proxy + ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(function (event) { + return connection.on(event, function () { + for (var _len = arguments.length, payload = Array(_len), _key = 0; _key < _len; _key++) { + payload[_key] = arguments[_key]; + } + + debug(event + ' event emitted. %O', payload); + _this2.emit.apply(_this2, [event].concat(payload)); + if (event !== 'reconnect') { + internal(_this2).clients.forEach(function (client) { + client.emit.apply(client, [event].concat(payload)); + }); + } + }); + }); + // override handleClose + connection.handleClose = function handleClose(event) { + var isFatal = [ErrorCode.APP_NOT_AVAILABLE, ErrorCode.INVALID_LOGIN, ErrorCode.INVALID_ORIGIN].some(function (errorCode) { + return errorCode === event.code; + }); + if (isFatal) { + // in these cases, SDK should throw. + this.throw(createError$3(event)); + } else { + // reconnect + this.disconnect(); + } + }; + internal(_this2).connection = connection; + }); + + return this._openPromise; + }; + + Realtime.prototype._getEndpoints = function _getEndpoints(options) { + var _this3 = this; + + return _Promise.resolve(this._cache.get('endpoints') || this.constructor._fetchEndpointsInfo(options).then(tap(function (info) { + return _this3._cache.set('endpoints', info, info.ttl * 1000); + }))).then(function (info) { + debug('endpoint info: %O', info); + return [info.server, info.secondary]; + }); + }; + + Realtime._fetchAppRouter = function _fetchAppRouter(_ref4) { + var appId = _ref4.appId, + region = _ref4.region; + + debug('fetch router'); + switch (region) { + case 'cn': + { + var cachedRouter = routerCache.get(appId); + if (cachedRouter) { + return _Promise.resolve(cachedRouter); + } + return axios.get('https://app-router.leancloud.cn/2/route', { + params: { + appId: appId + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)).then(function (_ref5) { + var rtmRouter = _ref5.rtm_router_server, + api = _ref5.api_server, + _ref5$ttl = _ref5.ttl, + ttl = _ref5$ttl === undefined ? 3600 : _ref5$ttl; + + if (!rtmRouter) { + throw new Error('rtm router not exists'); + } + var router = { + rtmRouter: rtmRouter, + api: api + }; + routerCache.set(appId, router, ttl * 1000); + return router; + }).catch(function () { + var id = appId.slice(0, 8).toLowerCase(); + return { + rtmRouter: id + '.rtm.lncld.net', + api: id + '.api.lncld.net' + }; + }); + } + case 'us': + return _Promise.resolve({ + rtmRouter: 'router-a0-push.leancloud.cn', + api: 'us-api.leancloud.cn' + }); + default: + throw new Error('Region [' + region + '] is not supported.'); + } + }; + + Realtime._fetchEndpointsInfo = function _fetchEndpointsInfo(_ref6) { + var appId = _ref6.appId, + region = _ref6.region, + ssl = _ref6.ssl, + server = _ref6.server; + + debug('fetch endpoint info'); + return this._fetchAppRouter({ appId: appId, region: region }).then(tap(debug)).then(function (_ref7) { + var rtmRouter = _ref7.rtmRouter; + return axios.get('https://' + rtmRouter + '/v1/route', { + params: { + appId: appId, + secure: ssl, + features: isWeapp ? 'wechat' : undefined, + server: server, + _t: Date.now() + }, + timeout: 20000 + }).then(function (res) { + return res.data; + }).then(tap(debug)); + }); + }; + + Realtime.prototype._close = function _close() { + if (this._openPromise) { + this._openPromise.then(function (connection) { + return connection.close(); + }); + } + delete this._openPromise; + }; + + /** + * 手动进行重连。 + * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。 + * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。 + */ + + + Realtime.prototype.retry = function retry() { + var connection = internal(this).connection; + if (!connection) { + throw new Error('no connection established'); + } + if (connection.cannot('retry')) { + throw new Error('retrying not allowed when not disconnected. the connection is now ' + connection.current); + } + return connection.retry(); + }; + /** + * 暂停,使 SDK 进入离线状态。 + * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。 + * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。 + * + * @since 3.4.0 + * @see Realtime#event:offline + */ + + + Realtime.prototype.pause = function pause() { + // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。 + // 因此不像 retry,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('pause')) connection.pause(); + }; + /** + * 恢复在线状态。 + * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。 + * + * @since 3.4.0 + * @see Realtime#event:online + */ + + + Realtime.prototype.resume = function resume() { + // 与 pause 一样,这个方法应该尽可能 loose + var connection = internal(this).connection; + if (!connection) return; + if (connection.can('resume')) connection.resume(); + }; + + Realtime.prototype._register = function _register(client) { + internal(this).clients.add(client); + }; + + Realtime.prototype._deregister = function _deregister(client) { + internal(this).clients.delete(client); + if (internal(this).clients.size === 0) { + this._close(); + } + }; + + Realtime.prototype._dispatchCommand = function _dispatchCommand(command) { + return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this]).then(function (shouldDispatch) { + // no plugin handled this command + if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim$1(command)); + return false; + }); + }; + + return Realtime; + }(eventemitter3); + + // Unique ID creation requires a high quality random # generator. In the + // browser this is a little complicated due to unknown quality of Math.random() + // and inconsistent support for the `crypto` API. We do the best we can via + // feature-detection + var rng; + + var crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto; // for IE 11 + if (crypto && crypto.getRandomValues) { + // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto + var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef + rng = function whatwgRNG() { + crypto.getRandomValues(rnds8); + return rnds8; + }; + } + + if (!rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var rnds = new Array(16); + rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return rnds; + }; + } + + var rngBrowser = rng; + + /** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + var byteToHex = []; + for (var i$1 = 0; i$1 < 256; ++i$1) { + byteToHex[i$1] = (i$1 + 0x100).toString(16).substr(1); + } + + function bytesToUuid(buf, offset) { + var i = offset || 0; + var bth = byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + var bytesToUuid_1 = bytesToUuid; + + function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options == 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || rngBrowser)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid_1(rnds); + } + + var v4_1 = v4; + + var objectWithoutProperties = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + exports.default = function (obj, keys) { + var target = {}; + + for (var i in obj) { + if (keys.indexOf(i) >= 0) continue; + if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; + target[i] = obj[i]; + } + + return target; + }; + }); + + var _objectWithoutProperties = unwrapExports(objectWithoutProperties); + + var ITERATOR$4 = _wks('iterator'); + + var core_isIterable = _core.isIterable = function (it) { + var O = Object(it); + return O[ITERATOR$4] !== undefined + || '@@iterator' in O + // eslint-disable-next-line no-prototype-builtins + || _iterators.hasOwnProperty(_classof(O)); + }; + + var isIterable$2 = core_isIterable; + + var isIterable = createCommonjsModule(function (module) { + module.exports = { "default": isIterable$2, __esModule: true }; + }); + + var core_getIterator = _core.getIterator = function (it) { + var iterFn = core_getIteratorMethod(it); + if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); + return _anObject(iterFn.call(it)); + }; + + var getIterator$1 = core_getIterator; + + var getIterator = createCommonjsModule(function (module) { + module.exports = { "default": getIterator$1, __esModule: true }; + }); + + var _getIterator = unwrapExports(getIterator); + + var slicedToArray = createCommonjsModule(function (module, exports) { + "use strict"; + + exports.__esModule = true; + + + + var _isIterable3 = _interopRequireDefault(isIterable); + + + + var _getIterator3 = _interopRequireDefault(getIterator); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if ((0, _isIterable3.default)(Object(arr))) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + }); + + var _slicedToArray = unwrapExports(slicedToArray); + + // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) + + var $find = _arrayMethods(5); + var KEY = 'find'; + var forced = true; + // Shouldn't skip holes + if (KEY in []) Array(1)[KEY](function () { forced = false; }); + _export(_export.P + _export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + _addToUnscopables(KEY); + + var find$1 = _core.Array.find; + + var find = createCommonjsModule(function (module) { + module.exports = { "default": find$1, __esModule: true }; + }); + + var _Array$find = unwrapExports(find); + + /** Used for built-in method references. */ + var objectProto$5 = Object.prototype; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5; + + return value === proto; + } + + var _isPrototype = isPrototype; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = _overArg(Object.keys, Object); + + var _nativeKeys = nativeKeys; + + /** Used for built-in method references. */ + var objectProto$4 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$4 = objectProto$4.hasOwnProperty; + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!_isPrototype(object)) { + return _nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty$4.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + var _baseKeys = baseKeys; + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject$2(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + var isObject_1 = isObject$2; + + /** `Object#toString` result references. */ + var asyncTag = '[object AsyncFunction]'; + var funcTag = '[object Function]'; + var genTag = '[object GeneratorFunction]'; + var proxyTag = '[object Proxy]'; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction$1(value) { + if (!isObject_1(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = _baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + var isFunction_1 = isFunction$1; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = _root['__core-js_shared__']; + + var _coreJsData = coreJsData; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + var _isMasked = isMasked; + + /** Used for built-in method references. */ + var funcProto$2 = Function.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString$2 = funcProto$2.toString; + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString$2.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + var _toSource = toSource; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used for built-in method references. */ + var funcProto$1 = Function.prototype; + var objectProto$6 = Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString$1 = funcProto$1.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty$5 = objectProto$6.hasOwnProperty; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString$1.call(hasOwnProperty$5).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject_1(value) || _isMasked(value)) { + return false; + } + var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor; + return pattern.test(_toSource(value)); + } + + var _baseIsNative = baseIsNative; + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + var _getValue = getValue; + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = _getValue(object, key); + return _baseIsNative(value) ? value : undefined; + } + + var _getNative = getNative; + + /* Built-in method references that are verified to be native. */ + var DataView = _getNative(_root, 'DataView'); + + var _DataView = DataView; + + /* Built-in method references that are verified to be native. */ + var Map = _getNative(_root, 'Map'); + + var _Map = Map; + + /* Built-in method references that are verified to be native. */ + var Promise$2 = _getNative(_root, 'Promise'); + + var _Promise$1 = Promise$2; + + /* Built-in method references that are verified to be native. */ + var Set = _getNative(_root, 'Set'); + + var _Set$1 = Set; + + /* Built-in method references that are verified to be native. */ + var WeakMap = _getNative(_root, 'WeakMap'); + + var _WeakMap$1 = WeakMap; + + /** `Object#toString` result references. */ + var mapTag$1 = '[object Map]'; + var objectTag$1 = '[object Object]'; + var promiseTag = '[object Promise]'; + var setTag$1 = '[object Set]'; + var weakMapTag = '[object WeakMap]'; + + var dataViewTag = '[object DataView]'; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = _toSource(_DataView); + var mapCtorString = _toSource(_Map); + var promiseCtorString = _toSource(_Promise$1); + var setCtorString = _toSource(_Set$1); + var weakMapCtorString = _toSource(_WeakMap$1); + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = _baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) || + (_Map && getTag(new _Map) != mapTag$1) || + (_Promise$1 && getTag(_Promise$1.resolve()) != promiseTag) || + (_Set$1 && getTag(new _Set$1) != setTag$1) || + (_WeakMap$1 && getTag(new _WeakMap$1) != weakMapTag)) { + getTag = function(value) { + var result = _baseGetTag(value), + Ctor = result == objectTag$1 ? value.constructor : undefined, + ctorString = Ctor ? _toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag$1; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag$1; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + var _getTag = getTag; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]'; + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike_1(value) && _baseGetTag(value) == argsTag; + } + + var _baseIsArguments = baseIsArguments; + + /** Used for built-in method references. */ + var objectProto$7 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$6 = objectProto$7.hasOwnProperty; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto$7.propertyIsEnumerable; + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) { + return isObjectLike_1(value) && hasOwnProperty$6.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + var isArguments_1 = isArguments; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray$2 = Array.isArray; + + var isArray_1 = isArray$2; + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + var isLength_1 = isLength; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength_1(value.length) && !isFunction_1(value); + } + + var isArrayLike_1 = isArrayLike; + + /** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ + function stubFalse() { + return false; + } + + var stubFalse_1 = stubFalse; + + var isBuffer_1$2 = createCommonjsModule(function (module, exports) { + /** Detect free variable `exports`. */ + var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Built-in value references. */ + var Buffer = moduleExports ? _root.Buffer : undefined; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse_1; + + module.exports = isBuffer; + }); + + /** `Object#toString` result references. */ + var argsTag$1 = '[object Arguments]'; + var arrayTag = '[object Array]'; + var boolTag = '[object Boolean]'; + var dateTag = '[object Date]'; + var errorTag = '[object Error]'; + var funcTag$1 = '[object Function]'; + var mapTag$2 = '[object Map]'; + var numberTag = '[object Number]'; + var objectTag$2 = '[object Object]'; + var regexpTag = '[object RegExp]'; + var setTag$2 = '[object Set]'; + var stringTag = '[object String]'; + var weakMapTag$1 = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]'; + var dataViewTag$1 = '[object DataView]'; + var float32Tag = '[object Float32Array]'; + var float64Tag = '[object Float64Array]'; + var int8Tag = '[object Int8Array]'; + var int16Tag = '[object Int16Array]'; + var int32Tag = '[object Int32Array]'; + var uint8Tag = '[object Uint8Array]'; + var uint8ClampedTag = '[object Uint8ClampedArray]'; + var uint16Tag = '[object Uint16Array]'; + var uint32Tag = '[object Uint32Array]'; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = + typedArrayTags[mapTag$2] = typedArrayTags[numberTag] = + typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] = + typedArrayTags[setTag$2] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag$1] = false; + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike_1(value) && + isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)]; + } + + var _baseIsTypedArray = baseIsTypedArray; + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + var _baseUnary = baseUnary; + + var _nodeUtil = createCommonjsModule(function (module, exports) { + /** Detect free variable `exports`. */ + var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && _freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + module.exports = nodeUtil; + }); + + /* Node.js helper references. */ + var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray; + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray; + + var isTypedArray_1 = isTypedArray; + + /** `Object#toString` result references. */ + var mapTag = '[object Map]'; + var setTag = '[object Set]'; + + /** Used for built-in method references. */ + var objectProto$3 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$3 = objectProto$3.hasOwnProperty; + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike_1(value) && + (isArray_1(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer_1$2(value) || isTypedArray_1(value) || isArguments_1(value))) { + return !value.length; + } + var tag = _getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (_isPrototype(value)) { + return !_baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty$3.call(value, key)) { + return false; + } + } + return true; + } + + var isEmpty_1 = isEmpty; + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + var _listCacheClear = listCacheClear; + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + var eq_1 = eq; + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq_1(array[length][0], key)) { + return length; + } + } + return -1; + } + + var _assocIndexOf = assocIndexOf; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype; + + /** Built-in value references. */ + var splice = arrayProto.splice; + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = _assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + var _listCacheDelete = listCacheDelete; + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = _assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + var _listCacheGet = listCacheGet; + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return _assocIndexOf(this.__data__, key) > -1; + } + + var _listCacheHas = listCacheHas; + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = _assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + var _listCacheSet = listCacheSet; + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = _listCacheClear; + ListCache.prototype['delete'] = _listCacheDelete; + ListCache.prototype.get = _listCacheGet; + ListCache.prototype.has = _listCacheHas; + ListCache.prototype.set = _listCacheSet; + + var _ListCache = ListCache; + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new _ListCache; + this.size = 0; + } + + var _stackClear = stackClear; + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + var _stackDelete = stackDelete; + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + var _stackGet = stackGet; + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + var _stackHas = stackHas; + + /* Built-in method references that are verified to be native. */ + var nativeCreate = _getNative(Object, 'create'); + + var _nativeCreate = nativeCreate; + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = _nativeCreate ? _nativeCreate(null) : {}; + this.size = 0; + } + + var _hashClear = hashClear; + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + var _hashDelete = hashDelete; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used for built-in method references. */ + var objectProto$8 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$7 = objectProto$8.hasOwnProperty; + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (_nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty$7.call(data, key) ? data[key] : undefined; + } + + var _hashGet = hashGet; + + /** Used for built-in method references. */ + var objectProto$9 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$8 = objectProto$9.hasOwnProperty; + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$8.call(data, key); + } + + var _hashHas = hashHas; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED$1 = '__lodash_hash_undefined__'; + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value; + return this; + } + + var _hashSet = hashSet; + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `Hash`. + Hash.prototype.clear = _hashClear; + Hash.prototype['delete'] = _hashDelete; + Hash.prototype.get = _hashGet; + Hash.prototype.has = _hashHas; + Hash.prototype.set = _hashSet; + + var _Hash = Hash; + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new _Hash, + 'map': new (_Map || _ListCache), + 'string': new _Hash + }; + } + + var _mapCacheClear = mapCacheClear; + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + var _isKeyable = isKeyable; + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return _isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + var _getMapData = getMapData; + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = _getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + var _mapCacheDelete = mapCacheDelete; + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return _getMapData(this, key).get(key); + } + + var _mapCacheGet = mapCacheGet; + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return _getMapData(this, key).has(key); + } + + var _mapCacheHas = mapCacheHas; + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = _getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + var _mapCacheSet = mapCacheSet; + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = _mapCacheClear; + MapCache.prototype['delete'] = _mapCacheDelete; + MapCache.prototype.get = _mapCacheGet; + MapCache.prototype.has = _mapCacheHas; + MapCache.prototype.set = _mapCacheSet; + + var _MapCache = MapCache; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof _ListCache) { + var pairs = data.__data__; + if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new _MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + var _stackSet = stackSet; + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new _ListCache(entries); + this.size = data.size; + } + + // Add methods to `Stack`. + Stack.prototype.clear = _stackClear; + Stack.prototype['delete'] = _stackDelete; + Stack.prototype.get = _stackGet; + Stack.prototype.has = _stackHas; + Stack.prototype.set = _stackSet; + + var _Stack = Stack; + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + var _arrayEach = arrayEach; + + var defineProperty$5 = (function() { + try { + var func = _getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + var _defineProperty$2 = defineProperty$5; + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && _defineProperty$2) { + _defineProperty$2(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + var _baseAssignValue = baseAssignValue; + + /** Used for built-in method references. */ + var objectProto$10 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$9 = objectProto$10.hasOwnProperty; + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty$9.call(object, key) && eq_1(objValue, value)) || + (value === undefined && !(key in object))) { + _baseAssignValue(object, key, value); + } + } + + var _assignValue = assignValue; + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + _baseAssignValue(object, key, newValue); + } else { + _assignValue(object, key, newValue); + } + } + return object; + } + + var _copyObject = copyObject; + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + var _baseTimes = baseTimes; + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER$1 = 9007199254740991; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER$1 : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); + } + + var _isIndex = isIndex; + + /** Used for built-in method references. */ + var objectProto$11 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$10 = objectProto$11.hasOwnProperty; + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray_1(value), + isArg = !isArr && isArguments_1(value), + isBuff = !isArr && !isArg && isBuffer_1$2(value), + isType = !isArr && !isArg && !isBuff && isTypedArray_1(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? _baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty$10.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + _isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + var _arrayLikeKeys = arrayLikeKeys; + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys$3(object) { + return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object); + } + + var keys_1 = keys$3; + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && _copyObject(source, keys_1(source), object); + } + + var _baseAssign = baseAssign; + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + var _nativeKeysIn = nativeKeysIn; + + /** Used for built-in method references. */ + var objectProto$12 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$11 = objectProto$12.hasOwnProperty; + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject_1(object)) { + return _nativeKeysIn(object); + } + var isProto = _isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty$11.call(object, key)))) { + result.push(key); + } + } + return result; + } + + var _baseKeysIn = baseKeysIn; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn$1(object) { + return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object); + } + + var keysIn_1 = keysIn$1; + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && _copyObject(source, keysIn_1(source), object); + } + + var _baseAssignIn = baseAssignIn; + + var _cloneBuffer = createCommonjsModule(function (module, exports) { + /** Detect free variable `exports`. */ + var freeExports = 'object' == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Built-in value references. */ + var Buffer = moduleExports ? _root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + module.exports = cloneBuffer; + }); + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + var _copyArray = copyArray; + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + var _arrayFilter = arrayFilter; + + /** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ + function stubArray() { + return []; + } + + var stubArray_1 = stubArray; + + /** Used for built-in method references. */ + var objectProto$13 = Object.prototype; + + /** Built-in value references. */ + var propertyIsEnumerable$1 = objectProto$13.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols = Object.getOwnPropertySymbols; + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return _arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable$1.call(object, symbol); + }); + }; + + var _getSymbols = getSymbols; + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return _copyObject(source, _getSymbols(source), object); + } + + var _copySymbols = copySymbols; + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + var _arrayPush = arrayPush; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeGetSymbols$1 = Object.getOwnPropertySymbols; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols$1 ? stubArray_1 : function(object) { + var result = []; + while (object) { + _arrayPush(result, _getSymbols(object)); + object = _getPrototype(object); + } + return result; + }; + + var _getSymbolsIn = getSymbolsIn; + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return _copyObject(source, _getSymbolsIn(source), object); + } + + var _copySymbolsIn = copySymbolsIn; + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object)); + } + + var _baseGetAllKeys = baseGetAllKeys; + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return _baseGetAllKeys(object, keys_1, _getSymbols); + } + + var _getAllKeys = getAllKeys; + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn); + } + + var _getAllKeysIn = getAllKeysIn; + + /** Used for built-in method references. */ + var objectProto$14 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$12 = objectProto$14.hasOwnProperty; + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty$12.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + var _initCloneArray = initCloneArray; + + /** Built-in value references. */ + var Uint8Array$1 = _root.Uint8Array; + + var _Uint8Array = Uint8Array$1; + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new _Uint8Array(result).set(new _Uint8Array(arrayBuffer)); + return result; + } + + var _cloneArrayBuffer = cloneArrayBuffer; + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + var _cloneDataView = cloneDataView; + + /** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ + function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; + } + + var _addMapEntry = addMapEntry; + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + var _arrayReduce = arrayReduce; + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + var _mapToArray = mapToArray; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG$2 = 1; + + /** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ + function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(_mapToArray(map), CLONE_DEEP_FLAG$2) : _mapToArray(map); + return _arrayReduce(array, _addMapEntry, new map.constructor); + } + + var _cloneMap = cloneMap; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + var _cloneRegExp = cloneRegExp; + + /** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ + function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; + } + + var _addSetEntry = addSetEntry; + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + var _setToArray = setToArray; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG$3 = 1; + + /** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ + function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(_setToArray(set), CLONE_DEEP_FLAG$3) : _setToArray(set); + return _arrayReduce(array, _addSetEntry, new set.constructor); + } + + var _cloneSet = cloneSet; + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = _Symbol$1 ? _Symbol$1.prototype : undefined; + var symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + var _cloneSymbol = cloneSymbol; + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + var _cloneTypedArray = cloneTypedArray; + + /** `Object#toString` result references. */ + var boolTag$2 = '[object Boolean]'; + var dateTag$2 = '[object Date]'; + var mapTag$4 = '[object Map]'; + var numberTag$2 = '[object Number]'; + var regexpTag$2 = '[object RegExp]'; + var setTag$4 = '[object Set]'; + var stringTag$2 = '[object String]'; + var symbolTag$1 = '[object Symbol]'; + + var arrayBufferTag$2 = '[object ArrayBuffer]'; + var dataViewTag$3 = '[object DataView]'; + var float32Tag$2 = '[object Float32Array]'; + var float64Tag$2 = '[object Float64Array]'; + var int8Tag$2 = '[object Int8Array]'; + var int16Tag$2 = '[object Int16Array]'; + var int32Tag$2 = '[object Int32Array]'; + var uint8Tag$2 = '[object Uint8Array]'; + var uint8ClampedTag$2 = '[object Uint8ClampedArray]'; + var uint16Tag$2 = '[object Uint16Array]'; + var uint32Tag$2 = '[object Uint32Array]'; + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag$2: + return _cloneArrayBuffer(object); + + case boolTag$2: + case dateTag$2: + return new Ctor(+object); + + case dataViewTag$3: + return _cloneDataView(object, isDeep); + + case float32Tag$2: case float64Tag$2: + case int8Tag$2: case int16Tag$2: case int32Tag$2: + case uint8Tag$2: case uint8ClampedTag$2: case uint16Tag$2: case uint32Tag$2: + return _cloneTypedArray(object, isDeep); + + case mapTag$4: + return _cloneMap(object, isDeep, cloneFunc); + + case numberTag$2: + case stringTag$2: + return new Ctor(object); + + case regexpTag$2: + return _cloneRegExp(object); + + case setTag$4: + return _cloneSet(object, isDeep, cloneFunc); + + case symbolTag$1: + return _cloneSymbol(object); + } + } + + var _initCloneByTag = initCloneByTag; + + /** Built-in value references. */ + var objectCreate = Object.create; + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject_1(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + var _baseCreate = baseCreate; + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !_isPrototype(object)) + ? _baseCreate(_getPrototype(object)) + : {}; + } + + var _initCloneObject = initCloneObject; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG$1 = 1; + var CLONE_FLAT_FLAG = 2; + var CLONE_SYMBOLS_FLAG$1 = 4; + + /** `Object#toString` result references. */ + var argsTag$2 = '[object Arguments]'; + var arrayTag$1 = '[object Array]'; + var boolTag$1 = '[object Boolean]'; + var dateTag$1 = '[object Date]'; + var errorTag$1 = '[object Error]'; + var funcTag$2 = '[object Function]'; + var genTag$1 = '[object GeneratorFunction]'; + var mapTag$3 = '[object Map]'; + var numberTag$1 = '[object Number]'; + var objectTag$3 = '[object Object]'; + var regexpTag$1 = '[object RegExp]'; + var setTag$3 = '[object Set]'; + var stringTag$1 = '[object String]'; + var symbolTag = '[object Symbol]'; + var weakMapTag$2 = '[object WeakMap]'; + + var arrayBufferTag$1 = '[object ArrayBuffer]'; + var dataViewTag$2 = '[object DataView]'; + var float32Tag$1 = '[object Float32Array]'; + var float64Tag$1 = '[object Float64Array]'; + var int8Tag$1 = '[object Int8Array]'; + var int16Tag$1 = '[object Int16Array]'; + var int32Tag$1 = '[object Int32Array]'; + var uint8Tag$1 = '[object Uint8Array]'; + var uint8ClampedTag$1 = '[object Uint8ClampedArray]'; + var uint16Tag$1 = '[object Uint16Array]'; + var uint32Tag$1 = '[object Uint32Array]'; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag$2] = cloneableTags[arrayTag$1] = + cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$2] = + cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = + cloneableTags[float32Tag$1] = cloneableTags[float64Tag$1] = + cloneableTags[int8Tag$1] = cloneableTags[int16Tag$1] = + cloneableTags[int32Tag$1] = cloneableTags[mapTag$3] = + cloneableTags[numberTag$1] = cloneableTags[objectTag$3] = + cloneableTags[regexpTag$1] = cloneableTags[setTag$3] = + cloneableTags[stringTag$1] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag$1] = cloneableTags[uint8ClampedTag$1] = + cloneableTags[uint16Tag$1] = cloneableTags[uint32Tag$1] = true; + cloneableTags[errorTag$1] = cloneableTags[funcTag$2] = + cloneableTags[weakMapTag$2] = false; + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG$1, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG$1; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject_1(value)) { + return value; + } + var isArr = isArray_1(value); + if (isArr) { + result = _initCloneArray(value); + if (!isDeep) { + return _copyArray(value, result); + } + } else { + var tag = _getTag(value), + isFunc = tag == funcTag$2 || tag == genTag$1; + + if (isBuffer_1$2(value)) { + return _cloneBuffer(value, isDeep); + } + if (tag == objectTag$3 || tag == argsTag$2 || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : _initCloneObject(value); + if (!isDeep) { + return isFlat + ? _copySymbolsIn(value, _baseAssignIn(result, value)) + : _copySymbols(value, _baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = _initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new _Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + var keysFunc = isFull + ? (isFlat ? _getAllKeysIn : _getAllKeys) + : (isFlat ? keysIn : keys_1); + + var props = isArr ? undefined : keysFunc(value); + _arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + var _baseClone = baseClone; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1; + var CLONE_SYMBOLS_FLAG = 4; + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return _baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + var cloneDeep_1 = cloneDeep; + + var base64Arraybuffer = createCommonjsModule(function (module, exports) { + /* + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ + (function(){ + "use strict"; + + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + // Use a lookup table to find the index. + var lookup = new Uint8Array(256); + for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; + } + + exports.encode = function(arraybuffer) { + var bytes = new Uint8Array(arraybuffer), + i, len = bytes.length, base64 = ""; + + for (i = 0; i < len; i+=3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + + if ((len % 3) === 2) { + base64 = base64.substring(0, base64.length - 1) + "="; + } else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + "=="; + } + + return base64; + }; + + exports.decode = function(base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, i, p = 0, + encoded1, encoded2, encoded3, encoded4; + + if (base64[base64.length - 1] === "=") { + bufferLength--; + if (base64[base64.length - 2] === "=") { + bufferLength--; + } + } + + var arraybuffer = new ArrayBuffer(bufferLength), + bytes = new Uint8Array(arraybuffer); + + for (i = 0; i < len; i+=4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i+1)]; + encoded3 = lookup[base64.charCodeAt(i+2)]; + encoded4 = lookup[base64.charCodeAt(i+3)]; + + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + + return arraybuffer; + }; + })(); + }); + + var base64Arraybuffer_2 = base64Arraybuffer.decode; + + var debug$10 = browser$1('LC:SignatureFactoryRunner'); + + function _validateSignature() { + var signatureResult = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var signature = signatureResult.signature, + timestamp = signatureResult.timestamp, + nonce = signatureResult.nonce; + + if (typeof signature !== 'string' || typeof timestamp !== 'number' || typeof nonce !== 'string') { + throw new Error('malformed signature'); + } + return { + signature: signature, + timestamp: timestamp, + nonce: nonce + }; + } + + var runSignatureFactory = (function (signatureFactory, params) { + return _Promise.resolve().then(function () { + debug$10('call signatureFactory with %O', params); + return signatureFactory.apply(undefined, _toConsumableArray(params)); + }).then(tap(function (signatureResult) { + return debug$10('sign result %O', signatureResult); + }), function (error) { + // eslint-disable-next-line no-param-reassign + error.message = 'sign error: ' + error.message; + debug$10(error); + throw error; + }).then(_validateSignature); + }); + + var _rMessageStatus; + + /** + * 消息状态枚举 + * @enum {Symbol} + * @since 3.2.0 + * @memberof module:leancloud-realtime + */ + var MessageStatus = { + /** 初始状态、未知状态 */ + NONE: _Symbol('none'), + /** 正在发送 */ + SENDING: _Symbol('sending'), + /** 已发送 */ + SENT: _Symbol('sent'), + /** 已送达 */ + DELIVERED: _Symbol('delivered'), + /** 发送失败 */ + FAILED: _Symbol('failed') + }; + _Object$freeze(MessageStatus); + + var rMessageStatus = (_rMessageStatus = {}, _defineProperty(_rMessageStatus, MessageStatus.NONE, true), _defineProperty(_rMessageStatus, MessageStatus.SENDING, true), _defineProperty(_rMessageStatus, MessageStatus.SENT, true), _defineProperty(_rMessageStatus, MessageStatus.DELIVERED, true), _defineProperty(_rMessageStatus, MessageStatus.READ, true), _defineProperty(_rMessageStatus, MessageStatus.FAILED, true), _rMessageStatus); + + var Message = function () { + /** + * @implements AVMessage + * @param {Object|String|ArrayBuffer} content 消息内容 + */ + function Message(content) { + _classCallCheck(this, Message); + + _Object$assign(this, { content: content }, { + /** + * @type {String} + * @memberof Message# + */ + id: v4_1(), + /** + * 消息所在的 conversation id + * @memberof Message# + * @type {String?} + */ + cid: null, + /** + * 消息发送时间 + * @memberof Message# + * @type {Date} + */ + timestamp: new Date(), + /** + * 消息发送者 + * @memberof Message# + * @type {String} + */ + from: undefined, + /** + * @var deliveredAt {?Date} 消息送达时间 + * @memberof Message# + */ + // deliveredAt, + /** + * 消息提及的用户 + * @since 4.0.0 + * @memberof Message# + * @type {String[]} + */ + mentionList: [], + /** + * 消息是否提及了所有人 + * @since 4.0.0 + * @memberof Message# + * @type {Boolean} + */ + mentionedAll: false, + _mentioned: false + }); + this._setStatus(MessageStatus.NONE); + } + + /** + * 将当前消息序列化为 JSON 对象 + * @protected + * @return {Object} + */ + + + Message.prototype.toJSON = function toJSON() { + return this.content; + }; + + /** + * 消息状态,值为 {@link module:leancloud-realtime.MessageStatus} 之一 + * @type {Symbol} + * @readonly + * @since 3.2.0 + */ + + + Message.prototype._setStatus = function _setStatus(status) { + if (!rMessageStatus[status]) { + throw new Error('Invalid message status'); + } + this._status = status; + }; + + /** + * 消息修改或撤回时间,可以通过比较其与消息的 timestamp 是否相等判断消息是否被修改过或撤回过。 + * @type {Date} + * @since 3.5.0 + */ + + + Message.prototype._updateMentioned = function _updateMentioned(client) { + this._mentioned = this.from !== client && (this.mentionedAll || this.mentionList.indexOf(client) > -1); + }; + /** + * 获取提及用户列表 + * @since 4.0.0 + * @return {String[]} 提及用户的 id 列表 + */ + + + Message.prototype.getMentionList = function getMentionList() { + return this.mentionList; + }; + /** + * 设置提及用户列表 + * @since 4.0.0 + * @param {String[]} clients 提及用户的 id 列表 + * @return {Message} self + */ + + + Message.prototype.setMentionList = function setMentionList(clients) { + this.mentionList = ensureArray(clients); + return this; + }; + /** + * 设置是否提及所有人 + * @since 4.0.0 + * @param {Boolean} [value=true] + * @return {Messaeg} self + */ + + + Message.prototype.mentionAll = function mentionAll() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.mentionedAll = Boolean(value); + return this; + }; + + /** + * 判断给定的内容是否是有效的 Message, + * 该方法始终返回 true + * @protected + * @returns {Boolean} + * @implements AVMessage.validate + */ + + + Message.validate = function validate() { + return true; + }; + + /** + * 解析处理消息内容 + *

+       * 如果子类提供了 message,返回该 message
+       * 如果没有提供,将 json 作为 content 实例化一个 Message
+       * @protected
+       * @param  {Object}  json    json 格式的消息内容
+       * @param  {Message} message 子类提供的 message
+       * @return {Message}
+       * @implements AVMessage.parse
+       */
+
+
+      Message.parse = function parse(json, message) {
+        return message || new this(json);
+      };
+
+      _createClass(Message, [{
+        key: 'status',
+        get: function get() {
+          return this._status;
+        }
+      }, {
+        key: 'updatedAt',
+        get: function get() {
+          return this._updatedAt || this.timestamp;
+        },
+        set: function set(value) {
+          this._updatedAt = value;
+        }
+
+        /**
+         * 当前用户是否在该消息中被提及
+         * @type {Boolean}
+         * @readonly
+         * @since 4.0.0
+         */
+
+      }, {
+        key: 'mentioned',
+        get: function get() {
+          return this._mentioned;
+        }
+      }]);
+
+      return Message;
+    }();
+
+    /* eslint-disable no-param-reassign */
+    // documented in ../index.js
+    var messageType = function messageType(type) {
+      if (typeof type !== 'number') {
+        throw new TypeError(type + ' is not a Number');
+      }
+      return function (target) {
+        target.TYPE = type;
+        target.validate = function (json) {
+          return json._lctype === type;
+        };
+        target.prototype._getType = function () {
+          return { _lctype: type };
+        };
+      };
+    };
+
+    // documented in ../index.js
+    var messageField = function messageField(fields) {
+      if (typeof fields !== 'string') {
+        if (!Array.isArray(fields)) {
+          throw new TypeError(fields + ' is not an Array');
+        } else if (fields.some(function (value) {
+          return typeof value !== 'string';
+        })) {
+          throw new TypeError('fields contains non-string typed member');
+        }
+      }
+      return function (target) {
+        // IE10 Hack:
+        // static properties in IE10 will not be inherited from super
+        // search for parse method and assign it manually
+        var originalCustomFields = isIE10 ? getStaticProperty(target, '_customFields') : target._customFields;
+        originalCustomFields = Array.isArray(originalCustomFields) ? originalCustomFields : [];
+        target._customFields = originalCustomFields.concat(fields);
+      };
+    };
+
+    // IE10 Hack:
+    // static properties in IE10 will not be inherited from super
+    // search for parse method and assign it manually
+
+    var IE10Compatible = function IE10Compatible(target) {
+      if (isIE10) {
+        target.parse = getStaticProperty(target, 'parse');
+      }
+    };
+
+    var _dec$2;
+    var _class$3;
+
+    // jsdoc-ignore-start
+
+    // jsdoc-ignore-end
+    var TypedMessage = (_dec$2 = messageField(['_lctext', '_lcattrs']), _dec$2(_class$3 = function (_Message) {
+      _inherits(TypedMessage, _Message);
+
+      /**
+       * 所有内置的富媒体消息均继承自本类
+       * @extends Message
+       */
+      function TypedMessage() {
+        _classCallCheck(this, TypedMessage);
+
+        var _this = _possibleConstructorReturn(this, _Message.call(this));
+
+        _this._ = {};
+        return _this;
+      }
+
+      /**
+       * @type {Number}
+       * @readonly
+       */
+
+
+      /**
+       * @param {String} text
+       * @return {TypedMessage} self
+       */
+      TypedMessage.prototype.setText = function setText(text) {
+        this._lctext = text;
+        return this;
+      };
+      /**
+       * @return {String}
+       */
+
+
+      TypedMessage.prototype.getText = function getText() {
+        return this._lctext;
+      };
+
+      /**
+       * @param {Object} attributes
+       * @return {TypedMessage} self
+       */
+
+
+      TypedMessage.prototype.setAttributes = function setAttributes(attributes) {
+        this._lcattrs = attributes;
+        return this;
+      };
+      /**
+       * @return {Object}
+       */
+
+
+      TypedMessage.prototype.getAttributes = function getAttributes() {
+        return this._lcattrs;
+      };
+
+      TypedMessage.prototype._getCustomFields = function _getCustomFields() {
+        var _this2 = this;
+
+        var fields = Array.isArray(this.constructor._customFields) ? this.constructor._customFields : [];
+        return fields.reduce(function (result, field) {
+          if (typeof field !== 'string') return result;
+          result[field] = _this2[field]; // eslint-disable-line no-param-reassign
+          return result;
+        }, {});
+      };
+
+      /* eslint-disable class-methods-use-this */
+
+
+      TypedMessage.prototype._getType = function _getType() {
+        throw new Error('not implemented');
+      };
+      /* eslint-enable class-methods-use-this */
+
+      TypedMessage.prototype.toJSON = function toJSON() {
+        return _Object$assign({
+          _lctext: this.getText(),
+          _lcattrs: this.getAttributes()
+        }, this._getCustomFields(), this._getType());
+      };
+
+      /**
+       * 解析处理消息内容
+       * 
+       * 为给定的 message 设置 text 与 attributes 属性,返回该 message
+       * 如果子类没有提供 message,new this()
+       * @protected
+       * @param  {Object}  json    json 格式的消息内容
+       * @param  {TypedMessage} message 子类提供的 message
+       * @return {TypedMessage}
+       * @implements AVMessage.parse
+       */
+
+
+      TypedMessage.parse = function parse(json) {
+        var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new this();
+
+        message.content = json; // eslint-disable-line no-param-reassign
+        var customFields = isIE10 ? getStaticProperty(message.constructor, '_customFields') : message.constructor._customFields;
+        var fields = Array.isArray(customFields) ? customFields : [];
+        fields = fields.reduce(function (result, field) {
+          if (typeof field !== 'string') return result;
+          result[field] = json[field]; // eslint-disable-line no-param-reassign
+          return result;
+        }, {});
+        _Object$assign(message, fields);
+        return _Message.parse.call(this, json, message);
+      };
+
+      _createClass(TypedMessage, [{
+        key: 'type',
+        get: function get() {
+          return this.constructor.TYPE;
+        }
+
+        /** @type {String} */
+
+      }, {
+        key: 'text',
+        set: function set(text) {
+          return this.setText(text);
+        },
+        get: function get() {
+          return this.getText();
+        }
+
+        /** @type {Object} */
+
+      }, {
+        key: 'attributes',
+        set: function set(attributes) {
+          return this.setAttributes(attributes);
+        },
+        get: function get() {
+          return this.getAttributes();
+        }
+
+        /**
+         * 在客户端需要以文本形式展示该消息时显示的文案,
+         * 如 [红包] 新春快乐。
+         * 默认值为消息的 text。
+         * @type {String}
+         * @readonly
+         */
+
+      }, {
+        key: 'summary',
+        get: function get() {
+          return this.text;
+        }
+      }]);
+
+      return TypedMessage;
+    }(Message)) || _class$3);
+
+    var _dec$1;
+    var _class$2;
+
+    // jsdoc-ignore-start
+
+    // jsdoc-ignore-end
+    /**
+     * 已撤回类型消息,当消息被撤回时,SDK 会使用该类型的消息替代原始消息
+     * @extends TypedMessage
+     */
+    var RecalledMessage = (_dec$1 = messageType(-127), _dec$1(_class$2 = function (_TypedMessage) {
+      _inherits(RecalledMessage, _TypedMessage);
+
+      function RecalledMessage() {
+        _classCallCheck(this, RecalledMessage);
+
+        return _possibleConstructorReturn(this, _TypedMessage.apply(this, arguments));
+      }
+
+      _createClass(RecalledMessage, [{
+        key: 'summary',
+
+        /**
+         * 在客户端需要以文本形式展示该消息时显示的文案,值为 [该消息已撤回]
+         * @type {String}
+         * @readonly
+         */
+        // eslint-disable-next-line class-methods-use-this
+        get: function get() {
+          return '[该消息已撤回]';
+        }
+      }]);
+
+      return RecalledMessage;
+    }(TypedMessage)) || _class$2);
+
+    var debug$9 = browser$1('LC:Conversation');
+
+    var serializeMessage = function serializeMessage(message) {
+      var content = message.toJSON();
+      var msg = void 0;
+      var binaryMsg = void 0;
+      if (content instanceof ArrayBuffer) {
+        binaryMsg = content;
+      } else if (typeof content !== 'string') {
+        msg = _JSON$stringify(content);
+      } else {
+        msg = content;
+      }
+      return { msg: msg, binaryMsg: binaryMsg };
+    };
+
+    var _LogsCommand$QueryDir = LogsCommand.QueryDirection;
+    var NEW = _LogsCommand$QueryDir.NEW;
+    var OLD = _LogsCommand$QueryDir.OLD;
+
+    /**
+     * 历史消息查询方向枚举
+     * @enum {Number}
+     * @since 4.0.0
+     * @memberof module:leancloud-realtime
+     */
+
+    var MessageQueryDirection = {
+      /** 从后向前 */
+      NEW_TO_OLD: OLD,
+      /** 从前向后 */
+      OLD_TO_NEW: NEW
+    };
+    _Object$freeze(MessageQueryDirection);
+
+    var Conversation = function (_EventEmitter) {
+      _inherits(Conversation, _EventEmitter);
+
+      /**
+       * 无法直接实例化,请使用 {@link IMClient#createConversation} 创建新的对话
+       * @extends EventEmitter
+       */
+      function Conversation(_ref, client) {
+        var id = _ref.id,
+            creator = _ref.creator,
+            createdAt = _ref.createdAt,
+            updatedAt = _ref.updatedAt,
+            lastMessageAt = _ref.lastMessageAt,
+            lastMessage = _ref.lastMessage,
+            _ref$mutedMembers = _ref.mutedMembers,
+            mutedMembers = _ref$mutedMembers === undefined ? [] : _ref$mutedMembers,
+            _ref$members = _ref.members,
+            members = _ref$members === undefined ? [] : _ref$members,
+            _ref$transient = _ref.transient,
+            transient = _ref$transient === undefined ? false : _ref$transient,
+            _ref$system = _ref.system,
+            system = _ref$system === undefined ? false : _ref$system,
+            _ref$muted = _ref.muted,
+            muted = _ref$muted === undefined ? false : _ref$muted,
+            _ref$mentioned = _ref.mentioned,
+            mentioned = _ref$mentioned === undefined ? false : _ref$mentioned,
+            attributes = _objectWithoutProperties(_ref, ['id', 'creator', 'createdAt', 'updatedAt', 'lastMessageAt', 'lastMessage', 'mutedMembers', 'members', 'transient', 'system', 'muted', 'mentioned']);
+
+        _classCallCheck(this, Conversation);
+
+        var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));
+
+        _Object$assign(_this, {
+          /**
+           * 对话 id,对应 _Conversation 表中的 objectId
+           * @memberof Conversation#
+           * @type {String}
+           */
+          id: id,
+          /**
+           * 对话创建者
+           * @memberof Conversation#
+           * @type {String}
+           */
+          creator: creator,
+          /**
+           * 对话创建时间
+           * @memberof Conversation#
+           * @type {Date}
+           */
+          createdAt: createdAt,
+          /**
+           * 对话更新时间
+           * @memberof Conversation#
+           * @type {Date}
+           */
+          updatedAt: updatedAt,
+          /**
+           * 最后一条消息时间
+           * @memberof Conversation#
+           * @type {?Date}
+           */
+          lastMessageAt: lastMessageAt,
+          /**
+           * 最后一条消息
+           * @memberof Conversation#
+           * @type {?Message}
+           */
+          lastMessage: lastMessage,
+          /**
+           * 对该对话设置了静音的用户列表
+           * @memberof Conversation#
+           * @type {?String[]}
+           */
+          mutedMembers: mutedMembers,
+          /**
+           * 参与该对话的用户列表
+           * @memberof Conversation#
+           * @type {String[]}
+           */
+          members: members,
+          /**
+           * 暂态对话标记
+           * @memberof Conversation#
+           * @type {Boolean}
+           */
+          transient: transient,
+          /**
+           * 系统对话标记
+           * @memberof Conversation#
+           * @type {Boolean}
+           * @since 3.3.0
+           */
+          system: system,
+          /**
+           * 当前用户静音该对话标记
+           * @memberof Conversation#
+           * @type {Boolean}
+           */
+          muted: muted
+        });
+        _this._attributes = attributes;
+        _this._reset();
+        _this.members = _Array$from(new _Set(_this.members));
+        _Object$assign(internal(_this), {
+          messagesWaitingForReceipt: {},
+          lastDeliveredAt: null,
+          lastReadAt: null,
+          unreadMessagesCount: 0,
+          mentioned: mentioned
+        });
+        if (client instanceof IMClient) {
+          _this._client = client;
+        } else {
+          throw new TypeError('Conversation must be initialized with a client');
+        }
+        ['kicked', 'membersjoined', 'membersleft', 'message', 'receipt', 'lastdeliveredatupdate', 'lastreadatupdate', 'messagerecall', 'messageupdate'].forEach(function (event) {
+          return _this.on(event, function () {
+            for (var _len = arguments.length, payload = Array(_len), _key = 0; _key < _len; _key++) {
+              payload[_key] = arguments[_key];
+            }
+
+            return _this._debug(event + ' event emitted. %O', payload);
+          });
+        });
+        // onConversationCreate hook
+        applyDecorators(_this._client._plugins.onConversationCreate, _this);
+        return _this;
+      }
+
+      /**
+       * 当前用户是否在该对话中被提及
+       * @type {Boolean}
+       * @since 4.0.0
+       */
+
+
+      Conversation.prototype._setMentioned = function _setMentioned(value) {
+        internal(this).mentioned = Boolean(value);
+      };
+
+      Conversation.prototype._setLastDeliveredAt = function _setLastDeliveredAt(value) {
+        var date = decodeDate(value);
+        if (!(date < internal(this).lastDeliveredAt)) {
+          internal(this).lastDeliveredAt = date;
+          /**
+           * 最后消息送达时间更新
+           * @event Conversation#lastdeliveredatupdate
+           * @since 3.4.0
+           */
+          this.emit('lastdeliveredatupdate');
+        }
+      };
+      /**
+       * 最后消息被阅读时间,常用来实现发送消息的「已读」标记,可通过 {@link Conversation#fetchReceiptTimestamps} 获取或更新该属性
+       * @type {?Date}
+       * @since 3.4.0
+       */
+
+
+      Conversation.prototype._setLastReadAt = function _setLastReadAt(value) {
+        var date = decodeDate(value);
+        if (!(date < internal(this).lastReadAt)) {
+          internal(this).lastReadAt = date;
+          /**
+           * 最后消息被阅读时间更新
+           * @event Conversation#lastreadatupdate
+           * @since 3.4.0
+           */
+          this.emit('lastreadatupdate');
+        }
+      };
+
+      /**
+       * 对话名字,对应 _Conversation 表中的 name
+       * @type {String}
+       */
+
+
+      /**
+       * 获取对话的自定义属性
+       * @since 3.2.0
+       * @param  {String} key key 属性的键名,'x' 对应 Conversation 表中的 x 列
+       * @return {Any} 属性的值
+       */
+      Conversation.prototype.get = function get(key) {
+        return internal(this).currentAttributes[key];
+      };
+
+      /**
+       * 设置对话的自定义属性
+       * @since 3.2.0
+       * @param {String} key 属性的键名,'x' 对应 Conversation 表中的 x 列,支持使用 'x.y.z' 来修改对象的部分字段。
+       * @param {Any} value 属性的值
+       * @return {Conversation} self
+       * @example
+       *
+       * // 设置对话的 color 属性
+       * conversation.set('color', {
+       *   text: '#000',
+       *   background: '#DDD',
+       * });
+       * // 设置对话的 color.text 属性
+       * conversation.set('color.text', '#333');
+       */
+
+
+      Conversation.prototype.set = function set$$1(key, value) {
+        this._debug('set [' + key + ']: ' + value);
+        var pendingAttributes = internal(this).pendingAttributes;
+        var pendingKeys = _Object$keys(pendingAttributes);
+        // suppose pendingAttributes = { 'a.b': {} }
+        // set 'a' or 'a.b': delete 'a.b'
+        var re = new RegExp('^' + key);
+        var childKeys = pendingKeys.filter(re.test.bind(re));
+        childKeys.forEach(function (k) {
+          delete pendingAttributes[k];
+        });
+        if (childKeys.length) {
+          pendingAttributes[key] = value;
+        } else {
+          // set 'a.c': nothing to do
+          // set 'a.b.c.d': assign c: { d: {} } to 'a.b'
+          // CAUTION: non-standard API, provided by core-js
+          var parentKey = _Array$find(pendingKeys, function (k) {
+            return key.indexOf(k) === 0;
+          }); // 'a.b'
+          if (parentKey) {
+            setValue(pendingAttributes[parentKey], key.slice(parentKey.length + 1), value);
+          } else {
+            pendingAttributes[key] = value;
+          }
+        }
+        // build currentAttributes
+        internal(this).currentAttributes = _Object$keys(pendingAttributes).reduce(function (target, k) {
+          return setValue(target, k, pendingAttributes[k]);
+        }, cloneDeep_1(this._attributes));
+        return this;
+      };
+
+      Conversation.prototype._reset = function _reset() {
+        internal(this).pendingAttributes = {};
+        internal(this).currentAttributes = this._attributes;
+      };
+
+      Conversation.prototype._debug = function _debug() {
+        for (var _len2 = arguments.length, params = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+          params[_key2] = arguments[_key2];
+        }
+
+        debug$9.apply(undefined, params.concat(['[' + this.id + ']']));
+      };
+
+      Conversation.prototype._send = function _send(command) {
+        var _client;
+
+        /* eslint-disable no-param-reassign */
+        if (command.cmd === null) {
+          command.cmd = 'conv';
+        }
+        if (command.cmd === 'conv' && command.convMessage === null) {
+          command.convMessage = new ConvCommand();
+        }
+        if (command.convMessage && command.convMessage.cid === null) {
+          command.convMessage.cid = this.id;
+        }
+        /* eslint-enable no-param-reassign */
+
+        for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
+          args[_key3 - 1] = arguments[_key3];
+        }
+
+        return (_client = this._client)._send.apply(_client, [command].concat(args));
+      };
+      /**
+       * 保存当前对话的属性至服务器
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.save = function () {
+        var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
+          var attr, convMessage, resCommand;
+          return regenerator.wrap(function _callee$(_context) {
+            while (1) {
+              switch (_context.prev = _context.next) {
+                case 0:
+                  this._debug('save');
+                  attr = internal(this).pendingAttributes;
+
+                  if (!isEmpty_1(attr)) {
+                    _context.next = 5;
+                    break;
+                  }
+
+                  this._debug('nothing touched, resolve with self');
+                  return _context.abrupt('return', this);
+
+                case 5:
+                  this._debug('attr: %O', attr);
+                  convMessage = new ConvCommand({
+                    attr: new JsonObjectMessage({
+                      data: _JSON$stringify(attr)
+                    })
+                  });
+                  _context.next = 9;
+                  return this._send(new GenericCommand({
+                    op: 'update',
+                    convMessage: convMessage
+                  }));
+
+                case 9:
+                  resCommand = _context.sent;
+
+                  this.updatedAt = resCommand.convMessage.udate;
+                  this._attributes = internal(this).currentAttributes;
+                  internal(this).pendingAttributes = {};
+                  return _context.abrupt('return', this);
+
+                case 14:
+                case 'end':
+                  return _context.stop();
+              }
+            }
+          }, _callee, this);
+        }));
+
+        function save() {
+          return _ref2.apply(this, arguments);
+        }
+
+        return save;
+      }();
+
+      /**
+       * 从服务器更新对话的属性
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.fetch = function () {
+        var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
+          var query;
+          return regenerator.wrap(function _callee2$(_context2) {
+            while (1) {
+              switch (_context2.prev = _context2.next) {
+                case 0:
+                  query = this._client.getQuery().equalTo('objectId', this.id);
+                  _context2.next = 3;
+                  return query.find();
+
+                case 3:
+                  return _context2.abrupt('return', this);
+
+                case 4:
+                case 'end':
+                  return _context2.stop();
+              }
+            }
+          }, _callee2, this);
+        }));
+
+        function fetch() {
+          return _ref3.apply(this, arguments);
+        }
+
+        return fetch;
+      }();
+
+      /**
+       * 静音,客户端拒绝收到服务器端的离线推送通知
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.mute = function () {
+        var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3() {
+          return regenerator.wrap(function _callee3$(_context3) {
+            while (1) {
+              switch (_context3.prev = _context3.next) {
+                case 0:
+                  this._debug('mute');
+                  _context3.next = 3;
+                  return this._send(new GenericCommand({
+                    op: 'mute'
+                  }));
+
+                case 3:
+                  if (!this.transient) {
+                    this.muted = true;
+                    this.mutedMembers = union(this.mutedMembers, [this._client.id]);
+                  }
+                  return _context3.abrupt('return', this);
+
+                case 5:
+                case 'end':
+                  return _context3.stop();
+              }
+            }
+          }, _callee3, this);
+        }));
+
+        function mute() {
+          return _ref4.apply(this, arguments);
+        }
+
+        return mute;
+      }();
+
+      /**
+       * 取消静音
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.unmute = function () {
+        var _ref5 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4() {
+          return regenerator.wrap(function _callee4$(_context4) {
+            while (1) {
+              switch (_context4.prev = _context4.next) {
+                case 0:
+                  this._debug('unmute');
+                  _context4.next = 3;
+                  return this._send(new GenericCommand({
+                    op: 'unmute'
+                  }));
+
+                case 3:
+                  if (!this.transient) {
+                    this.muted = false;
+                    this.mutedMembers = difference(this.mutedMembers, [this._client.id]);
+                  }
+                  return _context4.abrupt('return', this);
+
+                case 5:
+                case 'end':
+                  return _context4.stop();
+              }
+            }
+          }, _callee4, this);
+        }));
+
+        function unmute() {
+          return _ref5.apply(this, arguments);
+        }
+
+        return unmute;
+      }();
+
+      /**
+       * 获取对话人数,或暂态对话的在线人数
+       * @return {Promise.}
+       */
+
+
+      Conversation.prototype.count = function () {
+        var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee5() {
+          var resCommand;
+          return regenerator.wrap(function _callee5$(_context5) {
+            while (1) {
+              switch (_context5.prev = _context5.next) {
+                case 0:
+                  this._debug('unmute');
+                  _context5.next = 3;
+                  return this._send(new GenericCommand({
+                    op: 'count'
+                  }));
+
+                case 3:
+                  resCommand = _context5.sent;
+                  return _context5.abrupt('return', resCommand.convMessage.count);
+
+                case 5:
+                case 'end':
+                  return _context5.stop();
+              }
+            }
+          }, _callee5, this);
+        }));
+
+        function count() {
+          return _ref6.apply(this, arguments);
+        }
+
+        return count;
+      }();
+
+      /**
+       * 增加成员
+       * @param {String|String[]} clientIds 新增成员 client id
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.add = function () {
+        var _ref7 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(clientIds) {
+          var convMessage, command, _params, signatureResult;
+
+          return regenerator.wrap(function _callee6$(_context6) {
+            while (1) {
+              switch (_context6.prev = _context6.next) {
+                case 0:
+                  this._debug('add', clientIds);
+                  if (typeof clientIds === 'string') {
+                    clientIds = [clientIds]; // eslint-disable-line no-param-reassign
+                  }
+                  convMessage = new ConvCommand({
+                    m: clientIds
+                  });
+                  command = new GenericCommand({
+                    op: 'add',
+                    convMessage: convMessage
+                  });
+
+                  if (!this._client.options.conversationSignatureFactory) {
+                    _context6.next = 10;
+                    break;
+                  }
+
+                  _params = [this.id, this._client.id, clientIds.sort(), 'add'];
+                  _context6.next = 8;
+                  return runSignatureFactory(this._client.options.conversationSignatureFactory, _params);
+
+                case 8:
+                  signatureResult = _context6.sent;
+
+                  _Object$assign(command.convMessage, keyRemap({
+                    signature: 's',
+                    timestamp: 't',
+                    nonce: 'n'
+                  }, signatureResult));
+
+                case 10:
+                  _context6.next = 12;
+                  return this._send(command);
+
+                case 12:
+                  if (!this.transient && !this.system) {
+                    this.members = union(this.members, clientIds);
+                  }
+                  return _context6.abrupt('return', this);
+
+                case 14:
+                case 'end':
+                  return _context6.stop();
+              }
+            }
+          }, _callee6, this);
+        }));
+
+        function add(_x) {
+          return _ref7.apply(this, arguments);
+        }
+
+        return add;
+      }();
+
+      /**
+       * 剔除成员
+       * @param {String|String[]} clientIds 成员 client id
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.remove = function () {
+        var _ref8 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee7(clientIds) {
+          var convMessage, command, _params2, signatureResult;
+
+          return regenerator.wrap(function _callee7$(_context7) {
+            while (1) {
+              switch (_context7.prev = _context7.next) {
+                case 0:
+                  this._debug('remove', clientIds);
+                  if (typeof clientIds === 'string') {
+                    clientIds = [clientIds]; // eslint-disable-line no-param-reassign
+                  }
+                  convMessage = new ConvCommand({
+                    m: clientIds
+                  });
+                  command = new GenericCommand({
+                    op: 'remove',
+                    convMessage: convMessage
+                  });
+
+                  if (!this._client.options.conversationSignatureFactory) {
+                    _context7.next = 10;
+                    break;
+                  }
+
+                  _params2 = [this.id, this._client.id, clientIds.sort(), 'remove'];
+                  _context7.next = 8;
+                  return runSignatureFactory(this._client.options.conversationSignatureFactory, _params2);
+
+                case 8:
+                  signatureResult = _context7.sent;
+
+                  _Object$assign(command.convMessage, keyRemap({
+                    signature: 's',
+                    timestamp: 't',
+                    nonce: 'n'
+                  }, signatureResult));
+
+                case 10:
+                  _context7.next = 12;
+                  return this._send(command);
+
+                case 12:
+                  if (!this.transient && !this.system) {
+                    this.members = difference(this.members, clientIds);
+                  }
+                  return _context7.abrupt('return', this);
+
+                case 14:
+                case 'end':
+                  return _context7.stop();
+              }
+            }
+          }, _callee7, this);
+        }));
+
+        function remove(_x2) {
+          return _ref8.apply(this, arguments);
+        }
+
+        return remove;
+      }();
+
+      /**
+       * (当前用户)加入该对话
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.join = function () {
+        var _ref9 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee8() {
+          return regenerator.wrap(function _callee8$(_context8) {
+            while (1) {
+              switch (_context8.prev = _context8.next) {
+                case 0:
+                  this._debug('join');
+                  return _context8.abrupt('return', this.add(this._client.id));
+
+                case 2:
+                case 'end':
+                  return _context8.stop();
+              }
+            }
+          }, _callee8, this);
+        }));
+
+        function join() {
+          return _ref9.apply(this, arguments);
+        }
+
+        return join;
+      }();
+
+      /**
+       * (当前用户)退出该对话
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.quit = function () {
+        var _ref10 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee9() {
+          return regenerator.wrap(function _callee9$(_context9) {
+            while (1) {
+              switch (_context9.prev = _context9.next) {
+                case 0:
+                  this._debug('quit');
+                  return _context9.abrupt('return', this.remove(this._client.id));
+
+                case 2:
+                case 'end':
+                  return _context9.stop();
+              }
+            }
+          }, _callee9, this);
+        }));
+
+        function quit() {
+          return _ref10.apply(this, arguments);
+        }
+
+        return quit;
+      }();
+
+      /**
+       * 发送消息
+       * @param  {Message} message 消息,Message 及其子类的实例
+       * @param {Object} [options] since v3.3.0,发送选项
+       * @param {Boolean} [options.transient] since v3.3.1,是否作为暂态消息发送
+       * @param {Boolean} [options.receipt] 是否需要回执,仅在普通对话中有效
+       * @param {Boolean} [options.will] since v3.4.0,是否指定该消息作为「掉线消息」发送,
+       * 「掉线消息」会延迟到当前用户掉线后发送,常用来实现「下线通知」功能
+       * @param {MessagePriority} [options.priority] 消息优先级,仅在暂态对话中有效,
+       * see: {@link module:leancloud-realtime.MessagePriority MessagePriority}
+       * @param {Object} [options.pushData] 消息对应的离线推送内容,如果消息接收方不在线,会推送指定的内容。其结构说明参见: {@link https://url.leanapp.cn/pushData 推送消息内容}
+       * @return {Promise.} 发送的消息
+       */
+
+
+      Conversation.prototype.send = function () {
+        var _ref11 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee10(message, options) {
+          var _Object$assign2, transient, receipt, priority, pushData, will, _serializeMessage, msg, binaryMsg, command, resCommand, _resCommand$ackMessag, uid, t, code, reason, appCode;
+
+          return regenerator.wrap(function _callee10$(_context10) {
+            while (1) {
+              switch (_context10.prev = _context10.next) {
+                case 0:
+                  this._debug(message, 'send');
+
+                  if (message instanceof Message) {
+                    _context10.next = 3;
+                    break;
+                  }
+
+                  throw new TypeError(message + ' is not a Message');
+
+                case 3:
+                  _Object$assign2 = _Object$assign({},
+                  // support Message static property: sendOptions
+                  message.constructor.sendOptions,
+                  // support Message static property: getSendOptions
+                  typeof message.constructor.getSendOptions === 'function' ? message.constructor.getSendOptions(message) : {}, options), transient = _Object$assign2.transient, receipt = _Object$assign2.receipt, priority = _Object$assign2.priority, pushData = _Object$assign2.pushData, will = _Object$assign2.will;
+
+                  if (receipt) {
+                    if (this.transient) {
+                      console.warn('receipt option is ignored as the conversation is transient.');
+                    } else if (transient) {
+                      console.warn('receipt option is ignored as the message is sent transiently.');
+                    } else if (this.members.length > 2) {
+                      console.warn('receipt option is recommended to be used in one-on-one conversation.'); // eslint-disable-line max-len
+                    }
+                  }
+                  if (priority && !this.transient) {
+                    console.warn('priority option is ignored as the conversation is not transient.');
+                  }
+                  _Object$assign(message, {
+                    cid: this.id,
+                    from: this._client.id
+                  });
+                  message._setStatus(MessageStatus.SENDING);
+                  _serializeMessage = serializeMessage(message), msg = _serializeMessage.msg, binaryMsg = _serializeMessage.binaryMsg;
+                  command = new GenericCommand({
+                    cmd: 'direct',
+                    directMessage: new DirectCommand({
+                      msg: msg,
+                      binaryMsg: binaryMsg,
+                      cid: this.id,
+                      r: receipt,
+                      transient: transient,
+                      dt: message.id,
+                      pushData: _JSON$stringify(pushData),
+                      will: will,
+                      mentionPids: message.mentionList,
+                      mentionAll: message.mentionedAll
+                    }),
+                    priority: priority
+                  });
+                  _context10.prev = 10;
+                  _context10.next = 13;
+                  return this._send(command, !transient);
+
+                case 13:
+                  resCommand = _context10.sent;
+
+                  if (transient) {
+                    _context10.next = 21;
+                    break;
+                  }
+
+                  _resCommand$ackMessag = resCommand.ackMessage, uid = _resCommand$ackMessag.uid, t = _resCommand$ackMessag.t, code = _resCommand$ackMessag.code, reason = _resCommand$ackMessag.reason, appCode = _resCommand$ackMessag.appCode;
+
+                  if (!(code !== null)) {
+                    _context10.next = 18;
+                    break;
+                  }
+
+                  throw createError$3({
+                    code: code, reason: reason, appCode: appCode
+                  });
+
+                case 18:
+                  _Object$assign(message, {
+                    id: uid,
+                    timestamp: new Date(t.toNumber())
+                  });
+                  this.lastMessage = message;
+                  this.lastMessageAt = message.timestamp;
+
+                case 21:
+                  message._setStatus(MessageStatus.SENT);
+                  if (receipt) {
+                    internal(this).messagesWaitingForReceipt[message.id] = message;
+                  }
+                  return _context10.abrupt('return', message);
+
+                case 26:
+                  _context10.prev = 26;
+                  _context10.t0 = _context10['catch'](10);
+
+                  message._setStatus(MessageStatus.FAILED);
+                  throw _context10.t0;
+
+                case 30:
+                case 'end':
+                  return _context10.stop();
+              }
+            }
+          }, _callee10, this, [[10, 26]]);
+        }));
+
+        function send(_x3, _x4) {
+          return _ref11.apply(this, arguments);
+        }
+
+        return send;
+      }();
+
+      Conversation.prototype._update = function () {
+        var _ref12 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee11(message, newMessage, recall) {
+          var msg, binaryMsg, content, id, cid, timestamp, from$$1, _status;
+
+          return regenerator.wrap(function _callee11$(_context11) {
+            while (1) {
+              switch (_context11.prev = _context11.next) {
+                case 0:
+                  this._debug('patch %O %O %O', message, newMessage, recall);
+
+                  if (!(message instanceof Message)) {
+                    _context11.next = 8;
+                    break;
+                  }
+
+                  if (!(message.from !== this._client.id)) {
+                    _context11.next = 4;
+                    break;
+                  }
+
+                  throw new Error('Updating message from others is not allowed');
+
+                case 4:
+                  if (!(message.status !== MessageStatus.SENT && message.status !== MessageStatus.DELIVERED)) {
+                    _context11.next = 6;
+                    break;
+                  }
+
+                  throw new Error('Message is not sent');
+
+                case 6:
+                  _context11.next = 10;
+                  break;
+
+                case 8:
+                  if (message.id && message.timestamp) {
+                    _context11.next = 10;
+                    break;
+                  }
+
+                  throw new TypeError(message + ' is not a Message');
+
+                case 10:
+                  msg = void 0;
+                  binaryMsg = void 0;
+
+                  if (!recall) {
+                    content = serializeMessage(newMessage);
+
+                    msg = content.msg;
+                    binaryMsg = content.binaryMsg;
+                  }
+                  _context11.next = 15;
+                  return this._send(new GenericCommand({
+                    cmd: CommandType.patch,
+                    op: OpType.modify,
+                    patchMessage: new PatchCommand({
+                      patches: [new PatchItem({
+                        cid: this.id,
+                        mid: message.id,
+                        timestamp: Number(message.timestamp),
+                        recall: recall,
+                        data: msg,
+                        binaryMsg: binaryMsg,
+                        mentionPids: newMessage.mentionList,
+                        mentionAll: newMessage.mentionedAll
+                      })],
+                      lastPatchTime: this._client._lastPatchTime
+                    })
+                  }));
+
+                case 15:
+                  id = message.id, cid = message.cid, timestamp = message.timestamp, from$$1 = message.from, _status = message._status;
+
+                  _Object$assign(newMessage, {
+                    id: id, cid: cid, timestamp: timestamp, from: from$$1, _status: _status
+                  });
+                  if (this.lastMessage.id === newMessage.id) {
+                    this.lastMessage = newMessage;
+                  }
+                  return _context11.abrupt('return', newMessage);
+
+                case 19:
+                case 'end':
+                  return _context11.stop();
+              }
+            }
+          }, _callee11, this);
+        }));
+
+        function _update(_x5, _x6, _x7) {
+          return _ref12.apply(this, arguments);
+        }
+
+        return _update;
+      }();
+
+      /**
+       * 修改已发送的消息
+       * @param {AVMessage} message 要修改的消息,该消息必须是由当前用户发送的。也可以提供一个包含消息 {id, timestamp} 的对象
+       * @param {AVMessage} newMessage 新的消息
+       */
+
+
+      Conversation.prototype.update = function () {
+        var _ref13 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee12(message, newMessage) {
+          return regenerator.wrap(function _callee12$(_context12) {
+            while (1) {
+              switch (_context12.prev = _context12.next) {
+                case 0:
+                  if (newMessage instanceof Message) {
+                    _context12.next = 2;
+                    break;
+                  }
+
+                  throw new TypeError(newMessage + ' is not a Message');
+
+                case 2:
+                  return _context12.abrupt('return', this._update(message, newMessage, false));
+
+                case 3:
+                case 'end':
+                  return _context12.stop();
+              }
+            }
+          }, _callee12, this);
+        }));
+
+        function update(_x8, _x9) {
+          return _ref13.apply(this, arguments);
+        }
+
+        return update;
+      }();
+
+      /**
+       * 撤回已发送的消息
+       * @param {AVMessage} message 要撤回的消息,该消息必须是由当前用户发送的。也可以提供一个包含消息 {id, timestamp} 的对象
+       */
+
+
+      Conversation.prototype.recall = function () {
+        var _ref14 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee13(message) {
+          return regenerator.wrap(function _callee13$(_context13) {
+            while (1) {
+              switch (_context13.prev = _context13.next) {
+                case 0:
+                  return _context13.abrupt('return', this._update(message, new RecalledMessage(), true));
+
+                case 1:
+                case 'end':
+                  return _context13.stop();
+              }
+            }
+          }, _callee13, this);
+        }));
+
+        function recall(_x10) {
+          return _ref14.apply(this, arguments);
+        }
+
+        return recall;
+      }();
+
+      /**
+       * 查询消息记录
+       * 如果仅需实现消息向前记录翻页查询需求,建议使用 {@link Conversation#createMessagesIterator}。
+       * 不论何种方向,获得的消息都是按照时间升序排列的。
+       * startClosed 与 endClosed 用于指定查询区间的开闭。
+       * 
+       * @param  {Object} [options]
+       * @param  {Number} [options.limit] 限制查询结果的数量,目前服务端默认为 20
+       * @param  {MessageQueryDirection} [options.direction] 查询的方向。
+       * 在不指定的情况下如果 startTime 大于 endTime,则为从新到旧查询,可以实现加载聊天记录等场景。
+       * 如果 startTime 小于 endTime,则为从旧到新查询,可以实现弹幕等场景。
+       * @param  {Date}   [options.startTime] 从该时间开始查询,不传则从当前时间开始查询
+       * @param  {String} [options.startMessageId] 从该消息之前开始查询,需要与 startTime 同时使用,为防止某时刻有重复消息
+       * @param  {Boolean}[options.startClosed] 指定查询范围是否包括开始的时间点,默认不包括
+       * @param  {Date}   [options.endTime] 查询到该时间为止,不传则查询最早消息为止
+       * @param  {String} [options.endMessageId] 查询到该消息为止,需要与 endTime 同时使用,为防止某时刻有重复消息
+       * @param  {Boolean}[options.endClosed] 指定查询范围是否包括结束的时间点,默认不包括
+       * 
+       * @param  {Date}   [options.beforeTime] DEPRECATED: 使用 startTime 代替。限制查询结果为小于该时间之前的消息,不传则为当前时间
+       * @param  {String} [options.beforeMessageId] DEPRECATED: 使用 startMessageId 代替。
+       * 限制查询结果为该消息之前的消息,需要与 beforeTime 同时使用,为防止某时刻有重复消息
+       * @param  {Date}   [options.afterTime] DEPRECATED: 使用 endTime 代替。限制查询结果为大于该时间之前的消息
+       * @param  {String} [options.afterMessageId] DEPRECATED: 使用 endMessageId 代替。
+       * 限制查询结果为该消息之后的消息,需要与 afterTime 同时使用,为防止某时刻有重复消息
+       * @return {Promise.} 消息列表
+       */
+
+
+      Conversation.prototype.queryMessages = function () {
+        var _ref15 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee15() {
+          var _this2 = this;
+
+          var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+          var beforeTime, beforeMessageId, afterTime, afterMessageId, limit, direction, startTime, startMessageId, startClosed, endTime, endMessageId, endClosed, conditions, resCommand;
+          return regenerator.wrap(function _callee15$(_context15) {
+            while (1) {
+              switch (_context15.prev = _context15.next) {
+                case 0:
+                  this._debug('query messages %O', options);
+                  beforeTime = options.beforeTime, beforeMessageId = options.beforeMessageId, afterTime = options.afterTime, afterMessageId = options.afterMessageId, limit = options.limit, direction = options.direction, startTime = options.startTime, startMessageId = options.startMessageId, startClosed = options.startClosed, endTime = options.endTime, endMessageId = options.endMessageId, endClosed = options.endClosed;
+
+                  if (!(beforeMessageId || beforeTime || afterMessageId || afterTime)) {
+                    _context15.next = 5;
+                    break;
+                  }
+
+                  console.log('DEPRECATION: queryMessages options beforeTime, beforeMessageId, afterTime and afterMessageId are deprecated in favor of startTime, startMessageId, endTime and endMessageId.');
+                  return _context15.abrupt('return', this.queryMessages({
+                    startTime: beforeTime,
+                    startMessageId: beforeMessageId,
+                    endTime: afterTime,
+                    endMessageId: afterMessageId,
+                    limit: limit
+                  }));
+
+                case 5:
+                  if (!(startMessageId && !startTime)) {
+                    _context15.next = 7;
+                    break;
+                  }
+
+                  throw new Error('query option startMessageId must be used with option startTime');
+
+                case 7:
+                  if (!(endMessageId && !endTime)) {
+                    _context15.next = 9;
+                    break;
+                  }
+
+                  throw new Error('query option endMessageId must be used with option endTime');
+
+                case 9:
+                  conditions = {
+                    t: startTime,
+                    mid: startMessageId,
+                    tIncluded: startClosed,
+                    tt: endTime,
+                    tmid: endMessageId,
+                    ttIncluded: endClosed,
+                    l: limit
+                  };
+
+                  if (conditions.t instanceof Date) {
+                    conditions.t = conditions.t.getTime();
+                  }
+                  if (conditions.tt instanceof Date) {
+                    conditions.tt = conditions.tt.getTime();
+                  }
+                  if (direction !== undefined) {
+                    conditions.direction = direction;
+                  } else if (conditions.tt > conditions.t) {
+                    conditions.direction = MessageQueryDirection.OLD_TO_NEW;
+                  }
+                  _context15.next = 15;
+                  return this._send(new GenericCommand({
+                    cmd: 'logs',
+                    logsMessage: new LogsCommand(_Object$assign(conditions, {
+                      cid: this.id
+                    }))
+                  }));
+
+                case 15:
+                  resCommand = _context15.sent;
+                  return _context15.abrupt('return', _Promise.all(resCommand.logsMessage.logs.map(function () {
+                    var _ref17 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee14(_ref16) {
+                      var msgId = _ref16.msgId,
+                          timestamp = _ref16.timestamp,
+                          patchTimestamp = _ref16.patchTimestamp,
+                          from$$1 = _ref16.from,
+                          ackAt = _ref16.ackAt,
+                          readAt = _ref16.readAt,
+                          data = _ref16.data,
+                          mentionAll = _ref16.mentionAll,
+                          mentionPids = _ref16.mentionPids,
+                          bin = _ref16.bin;
+                      var content, message, messageProps, status;
+                      return regenerator.wrap(function _callee14$(_context14) {
+                        while (1) {
+                          switch (_context14.prev = _context14.next) {
+                            case 0:
+                              content = bin ? base64Arraybuffer_2(data) : data;
+                              _context14.next = 3;
+                              return _this2._client._messageParser.parse(content);
+
+                            case 3:
+                              message = _context14.sent;
+                              messageProps = {
+                                id: msgId,
+                                cid: _this2.id,
+                                timestamp: new Date(timestamp.toNumber()),
+                                from: from$$1,
+                                deliveredAt: ackAt,
+                                mentionList: mentionPids,
+                                mentionedAll: mentionAll
+                              };
+
+                              if (patchTimestamp) {
+                                messageProps.updatedAt = new Date(patchTimestamp.toNumber());
+                              }
+                              _Object$assign(message, messageProps);
+                              message._updateMentioned(_this2._client.id);
+                              status = MessageStatus.SENT;
+
+                              if (_this2.members.length === 2) {
+                                if (ackAt) status = MessageStatus.DELIVERED;
+                                if (ackAt) _this2._setLastDeliveredAt(ackAt);
+                                if (readAt) _this2._setLastReadAt(readAt);
+                              }
+                              message._setStatus(status);
+                              return _context14.abrupt('return', message);
+
+                            case 12:
+                            case 'end':
+                              return _context14.stop();
+                          }
+                        }
+                      }, _callee14, _this2);
+                    }));
+
+                    return function (_x12) {
+                      return _ref17.apply(this, arguments);
+                    };
+                  }())));
+
+                case 17:
+                case 'end':
+                  return _context15.stop();
+              }
+            }
+          }, _callee15, this);
+        }));
+
+        function queryMessages() {
+          return _ref15.apply(this, arguments);
+        }
+
+        return queryMessages;
+      }();
+
+      /**
+       * 获取消息翻页迭代器
+       * @param  {Object} [options]
+       * @param  {Date}   [options.beforeTime] 限制起始查询结果为小于该时间之前的消息,不传则为当前时间
+       * @param  {String} [options.beforeMessageId] 限制起始查询结果为该消息之前的消息,需要与 beforeTime 同时使用,为防止某时刻有重复消息
+       * @param  {Number} [options.limit] 限制每页查询结果的数量,目前服务端默认为 20
+       * @return {AsyncIterater.>>} [AsyncIterator]{@link https://github.com/tc39/proposal-async-iteration},调用其 next 方法返回获取下一页消息的 Promise
+       * @example
+       * var messageIterator = conversation.createMessagesIterator({ limit: 10 });
+       * messageIterator.next().then(function(result) {
+       *   // result: {
+       *   //   value: [message1, ..., message10],
+       *   //   done: false,
+       *   // }
+       * });
+       * messageIterator.next().then(function(result) {
+       *   // result: {
+       *   //   value: [message11, ..., message20],
+       *   //   done: false,
+       *   // }
+       * });
+       * messageIterator.next().then(function(result) {
+       *   // No more messages
+       *   // result: { value: [], done: true }
+       * });
+       */
+
+
+      Conversation.prototype.createMessagesIterator = function createMessagesIterator() {
+        var _this3 = this;
+
+        var _ref18 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
+            beforeTime = _ref18.beforeTime,
+            beforeMessageId = _ref18.beforeMessageId,
+            limit = _ref18.limit;
+
+        var promise$$1 = void 0;
+        return {
+          next: function next() {
+            if (promise$$1 === undefined) {
+              // first call
+              promise$$1 = _this3.queryMessages({
+                limit: limit,
+                startTime: beforeTime,
+                startMessageId: beforeMessageId
+              });
+            } else {
+              promise$$1 = promise$$1.then(function (prevMessages) {
+                if (prevMessages.length === 0 || prevMessages.length < limit) {
+                  // no more messages
+                  return [];
+                }
+                return _this3.queryMessages({
+                  startTime: prevMessages[0].timestamp,
+                  startMessageId: prevMessages[0].id,
+                  limit: limit
+                });
+              });
+            }
+            return promise$$1.then(function (value) {
+              return {
+                value: _Array$from(value),
+                done: value.length === 0 || value.length < limit
+              };
+            });
+          }
+        };
+      };
+
+      /**
+       * 将该会话标记为已读
+       * @return {Promise.} self
+       */
+
+
+      Conversation.prototype.read = function () {
+        var _ref19 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee16() {
+          var client;
+          return regenerator.wrap(function _callee16$(_context16) {
+            while (1) {
+              switch (_context16.prev = _context16.next) {
+                case 0:
+                  this.unreadMessagesCount = 0;
+                  this._setMentioned(false);
+                  // 跳过暂态会话
+
+                  if (!this.transient) {
+                    _context16.next = 4;
+                    break;
+                  }
+
+                  return _context16.abrupt('return', this);
+
+                case 4:
+                  client = this._client;
+
+                  if (!internal(client).readConversationsBuffer) {
+                    internal(client).readConversationsBuffer = new _Set();
+                  }
+                  internal(client).readConversationsBuffer.add(this);
+                  client._doSendRead();
+                  return _context16.abrupt('return', this);
+
+                case 9:
+                case 'end':
+                  return _context16.stop();
+              }
+            }
+          }, _callee16, this);
+        }));
+
+        function read() {
+          return _ref19.apply(this, arguments);
+        }
+
+        return read;
+      }();
+
+      Conversation.prototype._handleReceipt = function _handleReceipt(_ref20) {
+        var messageId = _ref20.messageId,
+            timestamp = _ref20.timestamp,
+            read = _ref20.read;
+
+        if (read) {
+          this._setLastReadAt(timestamp);
+        } else {
+          this._setLastDeliveredAt(timestamp);
+        }
+
+        var _internal = internal(this),
+            messagesWaitingForReceipt = _internal.messagesWaitingForReceipt;
+
+        var message = messagesWaitingForReceipt[messageId];
+        if (!message) return;
+        message._setStatus(MessageStatus.DELIVERED);
+        message.deliveredAt = timestamp;
+        delete messagesWaitingForReceipt[messageId];
+      };
+
+      /**
+       * 更新对话的最新回执时间戳(lastDeliveredAt、lastReadAt)
+       * @since 3.4.0
+       * @return {Promise.} this
+       */
+
+
+      Conversation.prototype.fetchReceiptTimestamps = function () {
+        var _ref21 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee17() {
+          var _ref22, _ref22$convMessage, maxReadTimestamp, maxAckTimestamp;
+
+          return regenerator.wrap(function _callee17$(_context17) {
+            while (1) {
+              switch (_context17.prev = _context17.next) {
+                case 0:
+                  _context17.next = 2;
+                  return this._send(new GenericCommand({
+                    op: 'max_read'
+                  }));
+
+                case 2:
+                  _ref22 = _context17.sent;
+                  _ref22$convMessage = _ref22.convMessage;
+                  maxReadTimestamp = _ref22$convMessage.maxReadTimestamp;
+                  maxAckTimestamp = _ref22$convMessage.maxAckTimestamp;
+
+                  this._setLastDeliveredAt(maxAckTimestamp);
+                  this._setLastReadAt(maxReadTimestamp);
+                  return _context17.abrupt('return', this);
+
+                case 9:
+                case 'end':
+                  return _context17.stop();
+              }
+            }
+          }, _callee17, this);
+        }));
+
+        function fetchReceiptTimestamps() {
+          return _ref21.apply(this, arguments);
+        }
+
+        return fetchReceiptTimestamps;
+      }();
+
+      Conversation.prototype._fetchAllReceiptTimestamps = function _fetchAllReceiptTimestamps() {
+        var convMessage = new ConvCommand({
+          queryAllMembers: true
+        });
+        return this._send(new GenericCommand({
+          op: 'max_read',
+          convMessage: convMessage
+        })).then(function (_ref23) {
+          var maxReadTuples = _ref23.convMessage.maxReadTuples;
+          return maxReadTuples.filter(function (maxReadTuple) {
+            return maxReadTuple.maxAckTimestamp || maxReadTuple.maxReadTimestamp;
+          }).map(function (_ref24) {
+            var pid = _ref24.pid,
+                maxAckTimestamp = _ref24.maxAckTimestamp,
+                maxReadTimestamp = _ref24.maxReadTimestamp;
+            return {
+              pid: pid,
+              lastDeliveredAt: decodeDate(maxAckTimestamp),
+              lastReadAt: decodeDate(maxReadTimestamp)
+            };
+          });
+        });
+      };
+
+      _createClass(Conversation, [{
+        key: 'mentioned',
+        get: function get() {
+          return internal(this).mentioned;
+        }
+      }, {
+        key: 'unreadMessagesCount',
+        set: function set$$1(value) {
+          if (value !== this.unreadMessagesCount) {
+            internal(this).unreadMessagesCount = value;
+            this._client.emit('unreadmessagescountupdate', [this]);
+          }
+        }
+        /**
+         * 当前用户在该对话的未读消息数
+         * @type {Number}
+         */
+        ,
+        get: function get() {
+          return internal(this).unreadMessagesCount;
+        }
+      }, {
+        key: 'createdAt',
+        set: function set$$1(value) {
+          this._createdAt = decodeDate(value);
+        },
+        get: function get() {
+          return this._createdAt;
+        }
+      }, {
+        key: 'updatedAt',
+        set: function set$$1(value) {
+          this._updatedAt = decodeDate(value);
+        },
+        get: function get() {
+          return this._updatedAt;
+        }
+      }, {
+        key: 'lastMessageAt',
+        set: function set$$1(value) {
+          var time = decodeDate(value);
+          if (time <= this._lastMessageAt) return;
+          this._lastMessageAt = time;
+        },
+        get: function get() {
+          return this._lastMessageAt;
+        }
+        /**
+         * 最后消息送达时间,常用来实现消息的「已送达」标记,可通过 {@link Conversation#fetchReceiptTimestamps} 获取或更新该属性
+         * @type {?Date}
+         * @since 3.4.0
+         */
+
+      }, {
+        key: 'lastDeliveredAt',
+        get: function get() {
+          if (this.members.length !== 2) return null;
+          return internal(this).lastDeliveredAt;
+        }
+      }, {
+        key: 'lastReadAt',
+        get: function get() {
+          if (this.members.length !== 2) return null;
+          return internal(this).lastReadAt;
+        }
+      }, {
+        key: 'name',
+        get: function get() {
+          return this.get('name');
+        },
+        set: function set$$1(value) {
+          this.set('name', value);
+        }
+      }]);
+
+      return Conversation;
+    }(eventemitter3);
+
+    var debug$11 = browser$1('LC:ConversationQuery');
+
+    var ConversationQuery = function () {
+      ConversationQuery._encode = function _encode(value) {
+        if (value instanceof Date) {
+          return { __type: 'Date', iso: value.toJSON() };
+        }
+        if (value instanceof RegExp) {
+          return value.source;
+        }
+        return value;
+      };
+
+      ConversationQuery._quote = function _quote(s) {
+        return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
+      };
+
+      ConversationQuery._calculateFlag = function _calculateFlag(options) {
+        return ['withLastMessagesRefreshed', 'compact'].reduce(
+        // eslint-disable-next-line no-bitwise
+        function (prev, key) {
+          return (prev << 1) + Boolean(options[key]);
+        }, 0);
+      };
+
+      /**
+       * Create a ConversationQuery
+       * @param  {IMClient} client
+       */
+
+
+      function ConversationQuery(client) {
+        _classCallCheck(this, ConversationQuery);
+
+        this._client = client;
+        this._where = {};
+        this._extraOptions = {};
+      }
+
+      ConversationQuery.prototype._addCondition = function _addCondition(key, condition, value) {
+        // Check if we already have a condition
+        if (!this._where[key]) {
+          this._where[key] = {};
+        }
+        this._where[key][condition] = this.constructor._encode(value);
+        return this;
+      };
+
+      ConversationQuery.prototype.toJSON = function toJSON() {
+        var json = {
+          where: this._where,
+          flag: this.constructor._calculateFlag(this._extraOptions)
+        };
+        if (typeof this._skip !== 'undefined') json.skip = this._skip;
+        if (typeof this._limit !== 'undefined') json.limit = this._limit;
+        if (typeof this._order !== 'undefined') json.sort = this._order;
+        debug$11(json);
+        return json;
+      };
+
+      /**
+       * 增加查询条件,指定聊天室的组员包含某些成员即可返回
+       * @param {string[]} peerIds - 成员 ID 列表
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.containsMembers = function containsMembers(peerIds) {
+        return this.containsAll('m', peerIds);
+      };
+
+      /**
+       * 增加查询条件,指定聊天室的组员条件满足条件的才返回
+       *
+       * @param {string[]} - 成员 ID 列表
+       * @param {Boolean} includeSelf - 是否包含自己
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.withMembers = function withMembers(peerIds, includeSelf) {
+        var peerIdsSet = new _Set(peerIds);
+        if (includeSelf) {
+          peerIdsSet.add(this._client.id);
+        }
+        this.sizeEqualTo('m', peerIdsSet.size);
+        return this.containsMembers(_Array$from(peerIdsSet));
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段满足等于条件时即可返回
+       *
+       * @param {string} key
+       * @param value
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.equalTo = function equalTo(key, value) {
+        this._where[key] = this.constructor._encode(value);
+        return this;
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段满足小于条件时即可返回
+       * @param {string} key
+       * @param value
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.lessThan = function lessThan(key, value) {
+        return this._addCondition(key, '$lt', value);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段满足小于等于条件时即可返回
+        * @param {string} key
+       * @param value
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.lessThanOrEqualTo = function lessThanOrEqualTo(key, value) {
+        return this._addCondition(key, '$lte', value);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段满足大于条件时即可返回
+       *
+       * @param {string} key
+       * @param value
+       * @return {ConversationQuery} self
+       */
+
+      ConversationQuery.prototype.greaterThan = function greaterThan(key, value) {
+        return this._addCondition(key, '$gt', value);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段满足大于等于条件时即可返回
+       *
+       * @param {string} key
+       * @param value
+       * @return {ConversationQuery} self
+       */
+
+      ConversationQuery.prototype.greaterThanOrEqualTo = function greaterThanOrEqualTo(key, value) {
+        return this._addCondition(key, '$gte', value);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段满足不等于条件时即可返回
+       *
+       * @param {string} key
+       * @param value
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.notEqualTo = function notEqualTo(key, value) {
+        return this._addCondition(key, '$ne', value);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 存在指定的字段时即可返回
+       *
+       * @since 3.5.0
+       * @param {string} key
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.exists = function exists(key) {
+        return this._addCondition(key, '$exists', true);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 不存在指定的字段时即可返回
+       *
+       * @since 3.5.0
+       * @param {string} key
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.doesNotExist = function doesNotExist(key) {
+        return this._addCondition(key, '$exists', false);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段对应的值包含在指定值中时即可返回
+       *
+       * @param {string} key
+       * @param values
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.containedIn = function containedIn(key, values) {
+        return this._addCondition(key, '$in', values);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段对应的值不包含在指定值中时即可返回
+       *
+       * @param {string} key
+       * @param values
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.notContainsIn = function notContainsIn(key, values) {
+        return this._addCondition(key, '$nin', values);
+      };
+      /**
+       * 增加查询条件,当conversation的属性中对应的字段中的元素包含所有的值才可返回
+       *
+       * @param {string} key
+       * @param values
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.containsAll = function containsAll(key, values) {
+        return this._addCondition(key, '$all', values);
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段对应的值包含此字符串即可返回
+       *
+       * @param {string} key
+       * @param {string} subString
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.contains = function contains(key, subString) {
+        return this._addCondition(key, '$regex', ConversationQuery._quote(subString));
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段对应的值以此字符串起始即可返回
+       *
+       * @param {string} key
+       * @param {string} prefix
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.startsWith = function startsWith(key, prefix) {
+        return this._addCondition(key, '$regex', '^' + ConversationQuery._quote(prefix));
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段对应的值以此字符串结束即可返回
+       *
+       * @param {string} key
+       * @param {string} suffix
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.endsWith = function endsWith(key, suffix) {
+        return this._addCondition(key, '$regex', ConversationQuery._quote(suffix) + '$');
+      };
+
+      /**
+       * 增加查询条件,当 conversation 的属性中对应的字段对应的值满足提供的正则表达式即可返回
+       *
+       * @param {string} key
+       * @param {RegExp} regex
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.matches = function matches(key, regex) {
+        this._addCondition(key, '$regex', regex);
+        // Javascript regex options support mig as inline options but store them
+        // as properties of the object. We support mi & should migrate them to
+        // modifiers
+        var _modifiers = '';
+        if (regex.ignoreCase) {
+          _modifiers += 'i';
+        }
+        if (regex.multiline) {
+          _modifiers += 'm';
+        }
+
+        if (_modifiers && _modifiers.length) {
+          this._addCondition(key, '$options', _modifiers);
+        }
+        return this;
+      };
+
+      /**
+       * 添加查询约束条件,查找 key 类型是数组,该数组的长度匹配提供的数值
+       *
+       * @param {string} key
+       * @param {Number} length
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.sizeEqualTo = function sizeEqualTo(key, length) {
+        return this._addCondition(key, '$size', length);
+      };
+
+      /**
+       * 设置返回集合的大小上限
+       *
+       * @param {Number} limit - 上限
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.limit = function limit(_limit) {
+        this._limit = _limit;
+        return this;
+      };
+
+      /**
+       * 设置返回集合的起始位置,一般用于分页
+       *
+       * @param {Number} skip - 起始位置跳过几个对象
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.skip = function skip(_skip) {
+        this._skip = _skip;
+        return this;
+      };
+
+      /**
+       * 设置返回集合按照指定key进行增序排列
+       *
+       * @param {string} key
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.ascending = function ascending(key) {
+        this._order = key;
+        return this;
+      };
+
+      /**
+       * 设置返回集合按照指定key进行增序排列,如果已设置其他排序,原排序的优先级较高
+       *
+       * @param {string} key
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.addAscending = function addAscending(key) {
+        if (this._order) {
+          this._order += ',' + key;
+        } else {
+          this._order = key;
+        }
+        return this;
+      };
+
+      /**
+       * 设置返回集合按照指定 key 进行降序排列
+       *
+       * @param {string} key
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.descending = function descending(key) {
+        this._order = '-' + key;
+        return this;
+      };
+
+      /**
+       * 设置返回集合按照指定 key 进行降序排列,如果已设置其他排序,原排序的优先级较高
+       *
+       * @param {string} key
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.addDescending = function addDescending(key) {
+        if (this._order) {
+          this._order += ',-' + key;
+        } else {
+          this._order = '-' + key;
+        }
+        return this;
+      };
+
+      /**
+       * 设置返回的 conversations 刷新最后一条消息
+       * @param  {Boolean} [enabled=true]
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.withLastMessagesRefreshed = function withLastMessagesRefreshed() {
+        var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
+
+        this._extraOptions.withLastMessagesRefreshed = enabled;
+        return this;
+      };
+
+      /**
+       * 设置返回的 conversations 为精简模式,即不含成员列表
+       * @param  {Boolean} [enabled=true]
+       * @return {ConversationQuery} self
+       */
+
+
+      ConversationQuery.prototype.compact = function compact() {
+        var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
+
+        this._extraOptions.compact = enabled;
+        return this;
+      };
+
+      /**
+       * 执行查询
+       * @return {Promise.}
+       */
+
+
+      ConversationQuery.prototype.find = function () {
+        var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
+          return regenerator.wrap(function _callee$(_context) {
+            while (1) {
+              switch (_context.prev = _context.next) {
+                case 0:
+                  return _context.abrupt('return', this._client._executeQuery(this));
+
+                case 1:
+                case 'end':
+                  return _context.stop();
+              }
+            }
+          }, _callee, this);
+        }));
+
+        function find() {
+          return _ref.apply(this, arguments);
+        }
+
+        return find;
+      }();
+
+      return ConversationQuery;
+    }();
+
+    var version = "4.0.0-alpha.1";
+
+    var _dec;
+    var _dec2;
+    var _class$1;
+
+    function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, context) {
+      var desc = {};
+      Object['ke' + 'ys'](descriptor).forEach(function (key) {
+        desc[key] = descriptor[key];
+      });
+      desc.enumerable = !!desc.enumerable;
+      desc.configurable = !!desc.configurable;
+
+      if ('value' in desc || desc.initializer) {
+        desc.writable = true;
+      }
+
+      desc = decorators.slice().reverse().reduce(function (desc, decorator) {
+        return decorator(target, property, desc) || desc;
+      }, desc);
+
+      if (context && desc.initializer !== void 0) {
+        desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
+        desc.initializer = undefined;
+      }
+
+      if (desc.initializer === void 0) {
+        Object['define' + 'Property'](target, property, desc);
+        desc = null;
+      }
+
+      return desc;
+    }
+
+    var debug$8 = browser$1('LC:IMClient');
+
+    var IMClient = (_dec = throttle(1000), _dec2 = throttle(1000), (_class$1 = function (_EventEmitter) {
+      _inherits(IMClient, _EventEmitter);
+
+      /**
+       * 无法直接实例化,请使用 {@link Realtime#createIMClient} 创建新的 IMClient。
+       *
+       * @extends EventEmitter
+       * @param  {String} [id] 客户端 id
+       * @param  {Object} [options]
+       * @param  {Function} [options.signatureFactory] open session 时的签名方法 // TODO need details
+       * @param  {Function} [options.conversationSignatureFactory] 对话创建、增减成员操作时的签名方法
+       */
+      function IMClient(id) {
+        var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+        var connection = arguments[2];
+        var props = arguments[3];
+
+        _classCallCheck(this, IMClient);
+
+        if (!(id === undefined || typeof id === 'string')) {
+          throw new TypeError('Client id [' + id + '] is not a String');
+        }
+
+        var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));
+
+        _Object$assign(_this, {
+          /**
+           * @var id {String} 客户端 id
+           * @memberof IMClient#
+           */
+          id: id,
+          _connection: connection,
+          options: options
+        }, props);
+
+        if (!_this._messageParser) {
+          throw new Error('IMClient must be initialized with a MessageParser');
+        }
+        _this._conversationCache = new Cache('client:' + _this.id);
+        _this._ackMessageBuffer = {};
+        internal(_this).lastPatchTime = Date.now();
+        internal(_this)._eventemitter = new eventemitter3();
+        ['invited', 'kicked', 'membersjoined', 'membersleft', 'message', 'unreadmessages', 'unreadmessagescountupdate', 'close', 'conflict', 'unhandledmessage', 'reconnect', 'reconnecterror'].forEach(function (event) {
+          return _this.on(event, function () {
+            for (var _len = arguments.length, payload = Array(_len), _key = 0; _key < _len; _key++) {
+              payload[_key] = arguments[_key];
+            }
+
+            return _this._debug(event + ' event emitted. %O', payload);
+          });
+        });
+        // onIMClientCreate hook
+        applyDecorators(_this._plugins.onIMClientCreate, _this);
+        return _this;
+      }
+
+      IMClient.prototype._debug = function _debug() {
+        for (var _len2 = arguments.length, params = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+          params[_key2] = arguments[_key2];
+        }
+
+        debug$8.apply(undefined, params.concat(['[' + this.id + ']']));
+      };
+
+      /**
+       * @override
+       * @private
+       */
+
+
+      IMClient.prototype._dispatchCommand = function () {
+        var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(command) {
+          return regenerator.wrap(function _callee$(_context) {
+            while (1) {
+              switch (_context.prev = _context.next) {
+                case 0:
+                  this._debug(trim$1(command), 'received');
+                  _context.t0 = command.cmd;
+                  _context.next = _context.t0 === CommandType.conv ? 4 : _context.t0 === CommandType.direct ? 5 : _context.t0 === CommandType.session ? 6 : _context.t0 === CommandType.unread ? 7 : _context.t0 === CommandType.rcp ? 8 : _context.t0 === CommandType.patch ? 9 : 10;
+                  break;
+
+                case 4:
+                  return _context.abrupt('return', this._dispatchConvMessage(command));
+
+                case 5:
+                  return _context.abrupt('return', this._dispatchDirectMessage(command));
+
+                case 6:
+                  return _context.abrupt('return', this._dispatchSessionMessage(command));
+
+                case 7:
+                  return _context.abrupt('return', this._dispatchUnreadMessage(command));
+
+                case 8:
+                  return _context.abrupt('return', this._dispatchRcpMessage(command));
+
+                case 9:
+                  return _context.abrupt('return', this._dispatchPatchMessage(command));
+
+                case 10:
+                  return _context.abrupt('return', this.emit('unhandledmessage', command));
+
+                case 11:
+                case 'end':
+                  return _context.stop();
+              }
+            }
+          }, _callee, this);
+        }));
+
+        function _dispatchCommand(_x2) {
+          return _ref.apply(this, arguments);
+        }
+
+        return _dispatchCommand;
+      }();
+
+      IMClient.prototype._dispatchSessionMessage = function () {
+        var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(message) {
+          var _message$sessionMessa, code, reason;
+
+          return regenerator.wrap(function _callee2$(_context2) {
+            while (1) {
+              switch (_context2.prev = _context2.next) {
+                case 0:
+                  _message$sessionMessa = message.sessionMessage, code = _message$sessionMessa.code, reason = _message$sessionMessa.reason;
+                  _context2.t0 = message.op;
+                  _context2.next = _context2.t0 === OpType.closed ? 4 : 8;
+                  break;
+
+                case 4:
+                  internal(this)._eventemitter.emit('close');
+
+                  if (!(code === ErrorCode.SESSION_CONFLICT)) {
+                    _context2.next = 7;
+                    break;
+                  }
+
+                  return _context2.abrupt('return', this.emit('conflict', {
+                    reason: reason
+                  }));
+
+                case 7:
+                  return _context2.abrupt('return', this.emit('close', {
+                    code: code, reason: reason
+                  }));
+
+                case 8:
+                  this.emit('unhandledmessage', message);
+                  throw new Error('Unrecognized session command');
+
+                case 10:
+                case 'end':
+                  return _context2.stop();
+              }
+            }
+          }, _callee2, this);
+        }));
+
+        function _dispatchSessionMessage(_x3) {
+          return _ref2.apply(this, arguments);
+        }
+
+        return _dispatchSessionMessage;
+      }();
+
+      IMClient.prototype._dispatchUnreadMessage = function _dispatchUnreadMessage(_ref3) {
+        var _this2 = this;
+
+        var _ref3$unreadMessage = _ref3.unreadMessage,
+            convs = _ref3$unreadMessage.convs,
+            notifTime = _ref3$unreadMessage.notifTime;
+
+        internal(this).lastUnreadNotifTime = notifTime;
+        // ensure all converstions are cached
+        return this.getConversations(convs.map(function (conv) {
+          return conv.cid;
+        })).then(function () {
+          return (
+            // update conversations data
+            _Promise.all(convs.map(function (_ref4) {
+              var cid = _ref4.cid,
+                  unread = _ref4.unread,
+                  mid = _ref4.mid,
+                  ts = _ref4.timestamp,
+                  from$$1 = _ref4.from,
+                  data = _ref4.data,
+                  binaryMsg = _ref4.binaryMsg,
+                  patchTimestamp = _ref4.patchTimestamp,
+                  mentioned = _ref4.mentioned;
+              return _this2.getConversation(cid).then(function (conversation) {
+                // deleted conversation
+                if (!conversation) return null;
+                var timestamp = void 0;
+                if (ts) {
+                  timestamp = new Date(ts.toNumber());
+                  conversation.lastMessageAt = timestamp; // eslint-disable-line no-param-reassign
+                }
+                return (mid ? _this2._messageParser.parse(binaryMsg || data).then(function (message) {
+                  var messageProps = {
+                    id: mid,
+                    cid: cid,
+                    timestamp: timestamp,
+                    from: from$$1
+                  };
+                  if (patchTimestamp) {
+                    messageProps.updatedAt = new Date(patchTimestamp.toNumber());
+                  }
+                  _Object$assign(message, messageProps);
+                  conversation.lastMessage = message; // eslint-disable-line no-param-reassign
+                }) : _Promise.resolve()).then(function () {
+                  conversation._setMentioned(mentioned);
+                  var countNotUpdated = unread === internal(conversation).unreadMessagesCount;
+                  if (countNotUpdated) return null; // to be filtered
+                  // manipulate internal property directly to skip unreadmessagescountupdate event
+                  internal(conversation).unreadMessagesCount = unread;
+                  return conversation;
+                });
+              });
+            }
+            // filter conversations without unread count update
+            )).then(function (conversations) {
+              return conversations.filter(function (conversation) {
+                return conversation;
+              });
+            })
+          );
+        }).then(function (conversations) {
+          if (conversations.length) {
+            /**
+             * 未读消息数目更新
+             * @event IMClient#unreadmessagescountupdate
+             * @since 3.4.0
+             * @param {Conversation[]} conversations 未读消息数目有更新的对话列表
+             */
+            _this2.emit('unreadmessagescountupdate', conversations);
+          }
+        });
+      };
+
+      IMClient.prototype._dispatchRcpMessage = function () {
+        var _ref5 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(message) {
+          var rcpMessage, read, conversationId, messageId, timestamp, conversation;
+          return regenerator.wrap(function _callee3$(_context3) {
+            while (1) {
+              switch (_context3.prev = _context3.next) {
+                case 0:
+                  rcpMessage = message.rcpMessage, read = message.rcpMessage.read;
+                  conversationId = rcpMessage.cid;
+                  messageId = rcpMessage.id;
+                  timestamp = new Date(rcpMessage.t.toNumber());
+                  conversation = this._conversationCache.get(conversationId);
+                  // conversation not cached means the client does not send the message
+                  // during this session
+
+                  if (conversation) {
+                    _context3.next = 7;
+                    break;
+                  }
+
+                  return _context3.abrupt('return');
+
+                case 7:
+                  conversation._handleReceipt({ messageId: messageId, timestamp: timestamp, read: read });
+
+                case 8:
+                case 'end':
+                  return _context3.stop();
+              }
+            }
+          }, _callee3, this);
+        }));
+
+        function _dispatchRcpMessage(_x4) {
+          return _ref5.apply(this, arguments);
+        }
+
+        return _dispatchRcpMessage;
+      }();
+
+      IMClient.prototype._dispatchPatchMessage = function _dispatchPatchMessage(_ref6) {
+        var _this3 = this;
+
+        var patches = _ref6.patchMessage.patches;
+
+        // ensure all converstions are cached
+        return this.getConversations(patches.map(function (patch) {
+          return patch.cid;
+        })).then(function () {
+          return _Promise.all(patches.map(function (_ref7) {
+            var cid = _ref7.cid,
+                mid = _ref7.mid,
+                timestamp = _ref7.timestamp,
+                recall = _ref7.recall,
+                data = _ref7.data,
+                patchTimestamp = _ref7.patchTimestamp,
+                from$$1 = _ref7.from,
+                binaryMsg = _ref7.binaryMsg,
+                mentionAll = _ref7.mentionAll,
+                mentionPids = _ref7.mentionPids;
+            return _this3.getConversation(cid).then(function (conversation) {
+              // deleted conversation
+              if (!conversation) return null;
+              return _this3._messageParser.parse(binaryMsg || data).then(function (message) {
+                var patchTime = patchTimestamp.toNumber();
+                var messageProps = {
+                  id: mid,
+                  cid: cid,
+                  timestamp: new Date(timestamp.toNumber()),
+                  updatedAt: new Date(patchTime),
+                  from: from$$1,
+                  mentionList: mentionPids,
+                  mentionedAll: mentionAll
+                };
+                _Object$assign(message, messageProps);
+                message._setStatus(MessageStatus.SENT);
+                message._updateMentioned(_this3.id);
+                if (internal(_this3).lastPatchTime < patchTime) {
+                  internal(_this3).lastPatchTime = patchTime;
+                }
+                // update conversation lastMessage
+                if (conversation.lastMessage && conversation.lastMessage.id === mid) {
+                  conversation.lastMessage = message; // eslint-disable-line no-param-reassign
+                }
+                if (recall) {
+                  /**
+                   * 消息被撤回
+                   * @event IMClient#messagerecall
+                   * @param {AVMessage} message 被撤回的消息
+                   * @param {Conversation} conversation 消息所在的会话
+                   */
+                  _this3.emit('messagerecall', message, conversation);
+                  /**
+                   * 消息被撤回
+                   * @event Conversation#messagerecall
+                   * @param {AVMessage} message 被撤回的消息
+                   */
+                  conversation.emit('messagerecall', message);
+                } else {
+                  /**
+                   * 消息被修改
+                   * @event IMClient#messageupdate
+                   * @param {AVMessage} message 被修改的消息
+                   * @param {Conversation} conversation 消息所在的会话
+                   */
+                  _this3.emit('messageupdate', message, conversation);
+                  /**
+                   * 消息被修改
+                   * @event Conversation#messageupdate
+                   * @param {AVMessage} message 被修改的消息
+                   */
+                  conversation.emit('messageupdate', message);
+                }
+              });
+            });
+          }));
+        });
+      };
+
+      IMClient.prototype._dispatchConvMessage = function () {
+        var _ref8 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4(message) {
+          var convMessage, _message$convMessage, initBy, m, conversation, payload, _payload, _payload2, _payload3;
+
+          return regenerator.wrap(function _callee4$(_context4) {
+            while (1) {
+              switch (_context4.prev = _context4.next) {
+                case 0:
+                  convMessage = message.convMessage, _message$convMessage = message.convMessage, initBy = _message$convMessage.initBy, m = _message$convMessage.m;
+                  _context4.next = 3;
+                  return this.getConversation(convMessage.cid);
+
+                case 3:
+                  conversation = _context4.sent;
+                  _context4.t0 = message.op;
+                  _context4.next = _context4.t0 === OpType.joined ? 7 : _context4.t0 === OpType.left ? 12 : _context4.t0 === OpType.members_joined ? 17 : _context4.t0 === OpType.members_left ? 22 : 27;
+                  break;
+
+                case 7:
+                  if (!conversation.transient) {
+                    // eslint-disable-next-line no-param-reassign
+                    conversation.members = union(conversation.members, [this.id]);
+                  }
+                  payload = {
+                    invitedBy: initBy
+                  };
+                  /**
+                   * 当前用户被添加至某个对话
+                   * @event IMClient#invited
+                   * @param {Object} payload
+                   * @param {String} payload.invitedBy 邀请者 id
+                   * @param {Conversation} conversation
+                   */
+
+                  this.emit('invited', payload, conversation);
+                  /**
+                   * 当前用户被添加至当前对话
+                   * @event Conversation#invited
+                   * @param {Object} payload
+                   * @param {String} payload.invitedBy 该移除操作的发起者 id
+                   */
+                  conversation.emit('invited', payload);
+                  return _context4.abrupt('return');
+
+                case 12:
+                  if (!conversation.transient) {
+                    // eslint-disable-next-line no-param-reassign
+                    conversation.members = difference(conversation.members, [this.id]);
+                  }
+                  _payload = {
+                    kickedBy: initBy
+                  };
+                  /**
+                   * 当前用户被从某个对话中移除
+                   * @event IMClient#kicked
+                   * @param {Object} payload
+                   * @param {String} payload.kickedBy 该移除操作的发起者 id
+                   * @param {Conversation} conversation
+                   */
+
+                  this.emit('kicked', _payload, conversation);
+                  /**
+                   * 当前用户被从当前对话中移除
+                   * @event Conversation#kicked
+                   * @param {Object} payload
+                   * @param {String} payload.kickedBy 该移除操作的发起者 id
+                   */
+                  conversation.emit('kicked', _payload);
+                  return _context4.abrupt('return');
+
+                case 17:
+                  if (!conversation.transient) {
+                    // eslint-disable-next-line no-param-reassign
+                    conversation.members = union(conversation.members, convMessage.m);
+                  }
+                  _payload2 = {
+                    invitedBy: initBy,
+                    members: m
+                  };
+                  /**
+                   * 有用户被添加至某个对话
+                   * @event IMClient#membersjoined
+                   * @param {Object} payload
+                   * @param {String[]} payload.members 被添加的用户 id 列表
+                   * @param {String} payload.invitedBy 邀请者 id
+                   * @param {Conversation} conversation
+                   */
+
+                  this.emit('membersjoined', _payload2, conversation);
+                  /**
+                   * 有成员被添加至当前对话
+                   * @event Conversation#membersjoined
+                   * @param {Object} payload
+                   * @param {String[]} payload.members 被添加的成员 id 列表
+                   * @param {String} payload.invitedBy 邀请者 id
+                   */
+                  conversation.emit('membersjoined', _payload2);
+                  return _context4.abrupt('return');
+
+                case 22:
+                  if (!conversation.transient) {
+                    // eslint-disable-next-line no-param-reassign
+                    conversation.members = difference(conversation.members, convMessage.m);
+                  }
+                  _payload3 = {
+                    kickedBy: initBy,
+                    members: m
+                  };
+                  /**
+                   * 有成员被从某个对话中移除
+                   * @event IMClient#membersleft
+                   * @param {Object} payload
+                   * @param {String[]} payload.members 被移除的成员 id 列表
+                   * @param {String} payload.kickedBy 该移除操作的发起者 id
+                   * @param {Conversation} conversation
+                   */
+
+                  this.emit('membersleft', _payload3, conversation);
+                  /**
+                   * 有成员被从当前对话中移除
+                   * @event Conversation#membersleft
+                   * @param {Object} payload
+                   * @param {String[]} payload.members 被移除的成员 id 列表
+                   * @param {String} payload.kickedBy 该移除操作的发起者 id
+                   */
+                  conversation.emit('membersleft', _payload3);
+                  return _context4.abrupt('return');
+
+                case 27:
+                  this.emit('unhandledmessage', message);
+                  throw new Error('Unrecognized conversation command');
+
+                case 29:
+                case 'end':
+                  return _context4.stop();
+              }
+            }
+          }, _callee4, this);
+        }));
+
+        function _dispatchConvMessage(_x5) {
+          return _ref8.apply(this, arguments);
+        }
+
+        return _dispatchConvMessage;
+      }();
+
+      IMClient.prototype._dispatchDirectMessage = function _dispatchDirectMessage(originalMessage) {
+        var _this4 = this;
+
+        var directMessage = originalMessage.directMessage,
+            _originalMessage$dire = originalMessage.directMessage,
+            id = _originalMessage$dire.id,
+            cid = _originalMessage$dire.cid,
+            fromPeerId = _originalMessage$dire.fromPeerId,
+            timestamp = _originalMessage$dire.timestamp,
+            transient = _originalMessage$dire.transient,
+            patchTimestamp = _originalMessage$dire.patchTimestamp,
+            mentionPids = _originalMessage$dire.mentionPids,
+            mentionAll = _originalMessage$dire.mentionAll,
+            binaryMsg = _originalMessage$dire.binaryMsg,
+            msg = _originalMessage$dire.msg;
+
+        var content = binaryMsg ? binaryMsg.toArrayBuffer() : msg;
+        return _Promise.all([this.getConversation(directMessage.cid), this._messageParser.parse(content)]).then(function (_ref9) {
+          var _ref10 = _slicedToArray(_ref9, 2),
+              conversation = _ref10[0],
+              message = _ref10[1];
+
+          // deleted conversation
+          if (!conversation) return undefined;
+          var messageProps = {
+            id: id,
+            cid: cid,
+            timestamp: new Date(timestamp.toNumber()),
+            from: fromPeerId,
+            mentionList: mentionPids,
+            mentionedAll: mentionAll
+          };
+          if (patchTimestamp) {
+            messageProps.updatedAt = new Date(patchTimestamp.toNumber());
+          }
+          _Object$assign(message, messageProps);
+          message._updateMentioned(_this4.id);
+          message._setStatus(MessageStatus.SENT);
+          // filter outgoing message sent from another device
+          if (message.from !== _this4.id) {
+            if (!(transient || conversation.transient)) {
+              _this4._sendAck(message);
+            }
+          }
+          return _this4._dispatchParsedMessage(message, conversation);
+        });
+      };
+
+      IMClient.prototype._dispatchParsedMessage = function _dispatchParsedMessage(message, conversation) {
+        var _this5 = this;
+
+        // beforeMessageDispatch hook
+        return applyDispatcher(this._plugins.beforeMessageDispatch, [message, conversation]).then(function (shouldDispatch) {
+          if (shouldDispatch === false) return;
+          conversation.lastMessage = message; // eslint-disable-line no-param-reassign
+          conversation.lastMessageAt = message.timestamp; // eslint-disable-line no-param-reassign
+          // filter outgoing message sent from another device
+          if (message.from !== _this5.id) {
+            conversation.unreadMessagesCount += 1; // eslint-disable-line no-param-reassign
+            if (message.mentioned) conversation._setMentioned(true);
+          }
+          /**
+           * 当前用户收到消息
+           * @event IMClient#message
+           * @param {Message} message
+           * @param {Conversation} conversation 收到消息的对话
+           */
+          _this5.emit('message', message, conversation);
+          /**
+           * 当前对话收到消息
+           * @event Conversation#message
+           * @param {Message} message
+           */
+          conversation.emit('message', message);
+        });
+      };
+
+      IMClient.prototype._sendAck = function _sendAck(message) {
+        this._debug('send ack for %O', message);
+        var cid = message.cid;
+
+        if (!cid) {
+          throw new Error('missing cid');
+        }
+        if (!this._ackMessageBuffer[cid]) {
+          this._ackMessageBuffer[cid] = [];
+        }
+        this._ackMessageBuffer[cid].push(message);
+        return this._doSendAck();
+      };
+
+      // jsdoc-ignore-start
+
+
+      // jsdoc-ignore-end
+      IMClient.prototype._doSendAck = function _doSendAck() {
+        var _this6 = this;
+
+        // if not connected, just skip everything
+        if (!this._connection.is('connected')) return;
+        this._debug('do send ack %O', this._ackMessageBuffer);
+        _Promise.all(_Object$keys(this._ackMessageBuffer).map(function (cid) {
+          var convAckMessages = _this6._ackMessageBuffer[cid];
+          var timestamps = convAckMessages.map(function (message) {
+            return message.timestamp;
+          });
+          var command = new GenericCommand({
+            cmd: 'ack',
+            ackMessage: new AckCommand({
+              cid: cid,
+              fromts: Math.min.apply(null, timestamps),
+              tots: Math.max.apply(null, timestamps)
+            })
+          });
+          delete _this6._ackMessageBuffer[cid];
+          return _this6._send(command, false).catch(function (error$$1) {
+            _this6._debug('send ack failed: %O', error$$1);
+            _this6._ackMessageBuffer[cid] = convAckMessages;
+          });
+        }));
+      };
+
+      IMClient.prototype._send = function _send(cmd) {
+        var _connection;
+
+        var command = cmd;
+        if (this.id) {
+          command.peerId = this.id;
+        }
+
+        for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
+          args[_key3 - 1] = arguments[_key3];
+        }
+
+        return (_connection = this._connection).send.apply(_connection, [command].concat(args));
+      };
+
+      IMClient.prototype._open = function _open(appId, tag, deviceId) {
+        var _this7 = this;
+
+        var isReconnect = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
+
+        this._debug('open session');
+
+        var _internal = internal(this),
+            lastUnreadNotifTime = _internal.lastUnreadNotifTime,
+            lastPatchTime = _internal.lastPatchTime;
+
+        return _Promise.resolve(new GenericCommand({
+          cmd: 'session',
+          op: 'open',
+          appId: appId,
+          sessionMessage: new SessionCommand({
+            ua: 'js/' + version,
+            r: isReconnect,
+            lastUnreadNotifTime: lastUnreadNotifTime,
+            lastPatchTime: lastPatchTime,
+            configBitmap: 1
+          })
+        })).then(function (command) {
+          if (isReconnect) {
+            // if sessionToken is not expired, skip signature/tag/deviceId
+            var sessionToken = internal(_this7).sessionToken;
+            if (sessionToken) {
+              var value = sessionToken.value;
+              if (value && value !== Expirable.EXPIRED) {
+                _Object$assign(command.sessionMessage, {
+                  st: value
+                });
+                return command;
+              }
+            }
+          }
+          _Object$assign(command.sessionMessage, trim$1({
+            tag: tag,
+            deviceId: deviceId
+          }));
+          if (_this7.options.signatureFactory) {
+            return runSignatureFactory(_this7.options.signatureFactory, [_this7._identity]).then(function (signatureResult) {
+              _Object$assign(command.sessionMessage, keyRemap({
+                signature: 's',
+                timestamp: 't',
+                nonce: 'n'
+              }, signatureResult));
+              return command;
+            });
+          }
+          return command;
+        }).then(this._send.bind(this)).then(function (resCommand) {
+          var peerId = resCommand.peerId,
+              sessionMessage = resCommand.sessionMessage,
+              _resCommand$sessionMe = resCommand.sessionMessage,
+              token = _resCommand$sessionMe.st,
+              tokenTTL = _resCommand$sessionMe.stTtl,
+              code = _resCommand$sessionMe.code;
+
+          if (code) {
+            throw createError$3(sessionMessage);
+          }
+          if (!peerId) {
+            console.warn('Unexpected session opened without peerId.');
+            return;
+          }
+          _this7.id = peerId;
+          if (!_this7._identity) _this7._identity = peerId;
+          if (token) {
+            internal(_this7).sessionToken = new Expirable(token, tokenTTL * 1000);
+          }
+        }).catch(function (error$$1) {
+          if (error$$1.code === ErrorCode.SESSION_TOKEN_EXPIRED) {
+            if (internal(_this7).sessionToken === undefined) {
+              // let it fail if sessoinToken not cached but command rejected as token expired
+              // to prevent session openning flood
+              throw new Error('Unexpected session expiration');
+            }
+            debug$8('Session token expired, reopening');
+            delete internal(_this7).sessionToken;
+            return _this7._open(appId, tag, deviceId, isReconnect);
+          }
+          throw error$$1;
+        });
+      };
+
+      /**
+       * 关闭客户端
+       * @return {Promise}
+       */
+
+
+      IMClient.prototype.close = function () {
+        var _ref11 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee5() {
+          var command;
+          return regenerator.wrap(function _callee5$(_context5) {
+            while (1) {
+              switch (_context5.prev = _context5.next) {
+                case 0:
+                  this._debug('close session');
+                  command = new GenericCommand({
+                    cmd: 'session',
+                    op: 'close'
+                  });
+                  _context5.next = 4;
+                  return this._send(command);
+
+                case 4:
+                  internal(this)._eventemitter.emit('close');
+                  this.emit('close', {
+                    code: 0
+                  });
+
+                case 6:
+                case 'end':
+                  return _context5.stop();
+              }
+            }
+          }, _callee5, this);
+        }));
+
+        function close() {
+          return _ref11.apply(this, arguments);
+        }
+
+        return close;
+      }();
+      /**
+       * 获取 client 列表中在线的 client,每次查询最多 20 个 clientId,超出部分会被忽略
+       * @param  {String[]} clientIds 要查询的 client ids
+       * @return {Primse.} 在线的 client ids
+       */
+
+
+      IMClient.prototype.ping = function () {
+        var _ref12 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(clientIds) {
+          var command, resCommand;
+          return regenerator.wrap(function _callee6$(_context6) {
+            while (1) {
+              switch (_context6.prev = _context6.next) {
+                case 0:
+                  this._debug('ping');
+
+                  if (clientIds instanceof Array) {
+                    _context6.next = 3;
+                    break;
+                  }
+
+                  throw new TypeError('clientIds ' + clientIds + ' is not an Array');
+
+                case 3:
+                  if (clientIds.length) {
+                    _context6.next = 5;
+                    break;
+                  }
+
+                  return _context6.abrupt('return', _Promise.resolve([]));
+
+                case 5:
+                  command = new GenericCommand({
+                    cmd: 'session',
+                    op: 'query',
+                    sessionMessage: new SessionCommand({
+                      sessionPeerIds: clientIds
+                    })
+                  });
+                  _context6.next = 8;
+                  return this._send(command);
+
+                case 8:
+                  resCommand = _context6.sent;
+                  return _context6.abrupt('return', resCommand.sessionMessage.onlineSessionPeerIds);
+
+                case 10:
+                case 'end':
+                  return _context6.stop();
+              }
+            }
+          }, _callee6, this);
+        }));
+
+        function ping(_x7) {
+          return _ref12.apply(this, arguments);
+        }
+
+        return ping;
+      }();
+
+      /**
+       * 获取某个特定的对话
+       * @param  {String} id 对话 id,对应 _Conversation 表中的 objectId
+       * @param  {Boolean} [noCache=false] 强制不从缓存中获取
+       * @return {Promise.} 如果 id 对应的对话不存在则返回 null
+       */
+
+
+      IMClient.prototype.getConversation = function () {
+        var _ref13 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee7(id) {
+          var noCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+          var cachedConversation;
+          return regenerator.wrap(function _callee7$(_context7) {
+            while (1) {
+              switch (_context7.prev = _context7.next) {
+                case 0:
+                  if (!(typeof id !== 'string')) {
+                    _context7.next = 2;
+                    break;
+                  }
+
+                  throw new TypeError(id + ' is not a String');
+
+                case 2:
+                  if (noCache) {
+                    _context7.next = 6;
+                    break;
+                  }
+
+                  cachedConversation = this._conversationCache.get(id);
+
+                  if (!cachedConversation) {
+                    _context7.next = 6;
+                    break;
+                  }
+
+                  return _context7.abrupt('return', _Promise.resolve(cachedConversation));
+
+                case 6:
+                  return _context7.abrupt('return', this.getQuery().equalTo('objectId', id).find().then(function (conversations) {
+                    return conversations[0] || null;
+                  }));
+
+                case 7:
+                case 'end':
+                  return _context7.stop();
+              }
+            }
+          }, _callee7, this);
+        }));
+
+        function getConversation(_x9) {
+          return _ref13.apply(this, arguments);
+        }
+
+        return getConversation;
+      }();
+
+      /**
+       * 通过 id 批量获取某个特定的对话
+       * @since 3.4.0
+       * @param  {String[]} ids 对话 id 列表,对应 _Conversation 表中的 objectId
+       * @param  {Boolean} [noCache=false] 强制不从缓存中获取
+       * @return {Promise.} 如果 id 对应的对话不存在则返回 null
+       */
+
+
+      IMClient.prototype.getConversations = function () {
+        var _ref14 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee8(ids) {
+          var _this8 = this;
+
+          var noCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+          var remoteConversationIds;
+          return regenerator.wrap(function _callee8$(_context8) {
+            while (1) {
+              switch (_context8.prev = _context8.next) {
+                case 0:
+                  remoteConversationIds = noCache ? ids : ids.filter(function (id) {
+                    return _this8._conversationCache.get(id) === null;
+                  });
+
+                  if (!remoteConversationIds.length) {
+                    _context8.next = 4;
+                    break;
+                  }
+
+                  _context8.next = 4;
+                  return this.getQuery().containedIn('objectId', remoteConversationIds).limit(999).find();
+
+                case 4:
+                  return _context8.abrupt('return', ids.map(function (id) {
+                    return _this8._conversationCache.get(id);
+                  }));
+
+                case 5:
+                case 'end':
+                  return _context8.stop();
+              }
+            }
+          }, _callee8, this);
+        }));
+
+        function getConversations(_x11) {
+          return _ref14.apply(this, arguments);
+        }
+
+        return getConversations;
+      }();
+
+      /**
+       * 构造一个 ConversationQuery 来查询对话
+       * @return {ConversationQuery}
+       */
+
+
+      IMClient.prototype.getQuery = function getQuery() {
+        return new ConversationQuery(this);
+      };
+
+      IMClient.prototype._executeQuery = function () {
+        var _ref15 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee9(query) {
+          var _this9 = this;
+
+          var queryJSON, command, resCommand, conversations, commandString;
+          return regenerator.wrap(function _callee9$(_context9) {
+            while (1) {
+              switch (_context9.prev = _context9.next) {
+                case 0:
+                  queryJSON = query.toJSON();
+
+                  queryJSON.where = new JsonObjectMessage({
+                    data: _JSON$stringify(queryJSON.where)
+                  });
+                  command = new GenericCommand({
+                    cmd: 'conv',
+                    op: 'query',
+                    convMessage: new ConvCommand(queryJSON)
+                  });
+                  _context9.next = 5;
+                  return this._send(command);
+
+                case 5:
+                  resCommand = _context9.sent;
+                  conversations = void 0;
+                  _context9.prev = 7;
+
+                  conversations = JSON.parse(resCommand.convMessage.results.data);
+                  _context9.next = 15;
+                  break;
+
+                case 11:
+                  _context9.prev = 11;
+                  _context9.t0 = _context9['catch'](7);
+                  commandString = _JSON$stringify(trim$1(resCommand));
+                  throw new Error('Parse query result failed: ' + _context9.t0.message + '. Command: ' + commandString);
+
+                case 15:
+                  _context9.next = 17;
+                  return _Promise.all(conversations.map(this._parseConversationFromRawData.bind(this)));
+
+                case 17:
+                  conversations = _context9.sent;
+                  return _context9.abrupt('return', conversations.map(function (fetchedConversation) {
+                    var conversation = _this9._conversationCache.get(fetchedConversation.id);
+                    if (!conversation) {
+                      conversation = fetchedConversation;
+                      _this9._debug('no match, set cache');
+                      _this9._conversationCache.set(fetchedConversation.id, fetchedConversation);
+                    } else {
+                      _this9._debug('update cached conversation');
+                      ['creator', 'createdAt', 'updatedAt', 'lastMessageAt', 'lastMessage', 'mutedMembers', 'members', '_attributes', 'transient', 'muted'].forEach(function (key) {
+                        var value = fetchedConversation[key];
+                        if (value !== undefined) conversation[key] = value;
+                      });
+                      conversation._reset();
+                    }
+                    return conversation;
+                  }));
+
+                case 19:
+                case 'end':
+                  return _context9.stop();
+              }
+            }
+          }, _callee9, this, [[7, 11]]);
+        }));
+
+        function _executeQuery(_x12) {
+          return _ref15.apply(this, arguments);
+        }
+
+        return _executeQuery;
+      }();
+
+      IMClient.prototype._parseConversationFromRawData = function () {
+        var _ref16 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee10(rawData) {
+          var data, message;
+          return regenerator.wrap(function _callee10$(_context10) {
+            while (1) {
+              switch (_context10.prev = _context10.next) {
+                case 0:
+                  data = keyRemap({
+                    objectId: 'id',
+                    lm: 'lastMessageAt',
+                    msg: 'lastMessage',
+                    msg_from: 'lastMessageFrom',
+                    msg_mid: 'lastMessageId',
+                    msg_timestamp: 'lastMessageTimestamp',
+                    patch_timestamp: 'lastMessagePatchTimestamp',
+                    m: 'members',
+                    tr: 'transient',
+                    sys: 'system',
+                    c: 'creator',
+                    mu: 'mutedMembers'
+                  }, rawData);
+
+                  if (!data.lastMessage) {
+                    _context10.next = 15;
+                    break;
+                  }
+
+                  _context10.next = 4;
+                  return this._messageParser.parse(data.lastMessage);
+
+                case 4:
+                  message = _context10.sent;
+
+                  data.lastMessage = message;
+                  message.from = data.lastMessageFrom;
+                  message.id = data.lastMessageId;
+                  message.timestamp = new Date(data.lastMessageTimestamp);
+                  if (data.lastMessagePatchTimestamp) {
+                    message.updatedAt = new Date(data.lastMessagePatchTimestamp);
+                  }
+                  message._setStatus(MessageStatus.SENT);
+                  delete data.lastMessageFrom;
+                  delete data.lastMessageId;
+                  delete data.lastMessageTimestamp;
+                  delete data.lastMessagePatchTimestamp;
+
+                case 15:
+                  return _context10.abrupt('return', new Conversation(data, this));
+
+                case 16:
+                case 'end':
+                  return _context10.stop();
+              }
+            }
+          }, _callee10, this);
+        }));
+
+        function _parseConversationFromRawData(_x13) {
+          return _ref16.apply(this, arguments);
+        }
+
+        return _parseConversationFromRawData;
+      }();
+
+      /**
+       * 创建一个 conversation
+       * @param {Object} options 除了下列字段外的其他字段将被视为对话的自定义属性
+       * @param {String[]} options.members 对话的初始成员列表,默认包含当前 client
+       * @param {String} [options.name] 对话的名字
+       * @param {Boolean} [options.transient=false] 暂态会话
+       * @param {Boolean} [options.unique=false] 唯一对话,当其为 true 时,如果当前已经有相同成员的对话存在则返回该对话,否则会创建新的对话
+       * @return {Promise.}
+       */
+
+
+      IMClient.prototype.createConversation = function () {
+        var _ref17 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee11() {
+          var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+          var m, name$$1, transient, unique, properties, members, attr, startCommandJson, command, _params, signatureResult, resCommand, conversation;
+
+          return regenerator.wrap(function _callee11$(_context11) {
+            while (1) {
+              switch (_context11.prev = _context11.next) {
+                case 0:
+                  m = options.members, name$$1 = options.name, transient = options.transient, unique = options.unique, properties = _objectWithoutProperties(options, ['members', 'name', 'transient', 'unique']);
+
+                  if (transient || Array.isArray(m)) {
+                    _context11.next = 3;
+                    break;
+                  }
+
+                  throw new TypeError('conversation members ' + m + ' is not an array');
+
+                case 3:
+                  members = new _Set(m);
+
+                  members.add(this.id);
+                  members = _Array$from(members).sort();
+                  attr = properties || {};
+
+                  if (!name$$1) {
+                    _context11.next = 11;
+                    break;
+                  }
+
+                  if (!(typeof name$$1 !== 'string')) {
+                    _context11.next = 10;
+                    break;
+                  }
+
+                  throw new TypeError('conversation name ' + name$$1 + ' is not a string');
+
+                case 10:
+                  attr.name = name$$1;
+
+                case 11:
+                  attr = new JsonObjectMessage({
+                    data: _JSON$stringify(attr)
+                  });
+
+                  startCommandJson = {
+                    m: members,
+                    attr: attr,
+                    transient: transient,
+                    unique: unique
+                  };
+                  command = new GenericCommand({
+                    cmd: 'conv',
+                    op: 'start',
+                    convMessage: new ConvCommand(startCommandJson)
+                  });
+
+                  if (!this.options.conversationSignatureFactory) {
+                    _context11.next = 20;
+                    break;
+                  }
+
+                  _params = [null, this._identity, members, 'create'];
+                  _context11.next = 18;
+                  return runSignatureFactory(this.options.conversationSignatureFactory, _params);
+
+                case 18:
+                  signatureResult = _context11.sent;
+
+                  _Object$assign(command.convMessage, keyRemap({
+                    signature: 's',
+                    timestamp: 't',
+                    nonce: 'n'
+                  }, signatureResult));
+
+                case 20:
+                  _context11.next = 22;
+                  return this._send(command);
+
+                case 22:
+                  resCommand = _context11.sent;
+                  conversation = new Conversation(_extends$1({
+                    name: name$$1,
+                    transient: transient,
+                    unique: unique,
+                    id: resCommand.convMessage.cid,
+                    createdAt: resCommand.convMessage.cdate,
+                    updatedAt: resCommand.convMessage.cdate,
+                    lastMessageAt: null,
+                    creator: this.id,
+                    members: transient ? [] : members
+                  }, properties), this);
+
+                  this._conversationCache.set(conversation.id, conversation);
+                  return _context11.abrupt('return', conversation);
+
+                case 26:
+                case 'end':
+                  return _context11.stop();
+              }
+            }
+          }, _callee11, this);
+        }));
+
+        function createConversation() {
+          return _ref17.apply(this, arguments);
+        }
+
+        return createConversation;
+      }();
+
+      // jsdoc-ignore-start
+
+
+      // jsdoc-ignore-end
+      IMClient.prototype._doSendRead = function _doSendRead() {
+        var _this10 = this;
+
+        // if not connected, just skip everything
+        if (!this._connection.is('connected')) return;
+        var buffer = internal(this).readConversationsBuffer;
+        var conversations = _Array$from(buffer);
+        if (!conversations.length) return;
+        var ids = conversations.map(function (conversation) {
+          if (!(conversation instanceof Conversation)) {
+            throw new TypeError(conversation + ' is not a Conversation');
+          }
+          return conversation.id;
+        });
+        this._debug('mark [' + ids + '] as read');
+        buffer.clear();
+        this._sendReadCommand(conversations).catch(function (error$$1) {
+          _this10._debug('send read failed: %O', error$$1);
+          conversations.forEach(buffer.add.bind(buffer));
+        });
+      };
+
+      IMClient.prototype._sendReadCommand = function _sendReadCommand(conversations) {
+        var _this11 = this;
+
+        return this._send(new GenericCommand({
+          cmd: 'read',
+          readMessage: new ReadCommand({
+            convs: conversations.map(function (conversation) {
+              return new ReadTuple({
+                cid: conversation.id,
+                mid: conversation.lastMessage && conversation.lastMessage.from !== _this11.id ? conversation.lastMessage.id : undefined,
+                timestamp: (conversation.lastMessageAt || new Date()).getTime()
+              });
+            })
+          })
+        }), false);
+      };
+
+      return IMClient;
+    }(eventemitter3), (_applyDecoratedDescriptor$1(_class$1.prototype, '_doSendAck', [_dec], _Object$getOwnPropertyDescriptor(_class$1.prototype, '_doSendAck'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, '_doSendRead', [_dec2], _Object$getOwnPropertyDescriptor(_class$1.prototype, '_doSendRead'), _class$1.prototype)), _class$1));
+
+    var BinaryMessage = function (_Message) {
+      _inherits(BinaryMessage, _Message);
+
+      /**
+       * 二进制消息
+       * @extends Message
+       * @param {ArrayBuffer} buffer
+       * @since 4.0.0
+       */
+      function BinaryMessage(buffer) {
+        _classCallCheck(this, BinaryMessage);
+
+        if (!(buffer instanceof ArrayBuffer)) {
+          throw new TypeError(buffer + ' is not an ArrayBuffer');
+        }
+        return _possibleConstructorReturn(this, _Message.call(this, buffer));
+      }
+
+      /**
+       * @type ArrayBuffer
+       */
+
+
+      BinaryMessage.validate = function validate(target) {
+        return target instanceof ArrayBuffer;
+      };
+
+      _createClass(BinaryMessage, [{
+        key: 'buffer',
+        get: function get() {
+          return this.content;
+        },
+        set: function set(buffer) {
+          this.content = buffer;
+        }
+      }]);
+
+      return BinaryMessage;
+    }(Message);
+
+    var _dec$3;
+    var _class$4;
+
+    // jsdoc-ignore-start
+
+    // jsdoc-ignore-end
+    var TextMessage = (_dec$3 = messageType(-1), _dec$3(_class$4 = IE10Compatible(_class$4 = function (_TypedMessage) {
+      _inherits(TextMessage, _TypedMessage);
+
+      /**
+       * 文类类型消息
+       * @extends TypedMessage
+       * @param  {String} [text='']
+       * @throws {TypeError} text 不是 String 类型
+       */
+      function TextMessage() {
+        var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
+
+        _classCallCheck(this, TextMessage);
+
+        if (typeof text !== 'string') {
+          throw new TypeError(text + ' is not a string');
+        }
+
+        var _this = _possibleConstructorReturn(this, _TypedMessage.call(this));
+
+        _this.setText(text);
+        return _this;
+      }
+
+      return TextMessage;
+    }(TypedMessage)) || _class$4) || _class$4);
+
+    var _class$5;
+
+    function _applyDecoratedDescriptor$2(target, property, decorators, descriptor, context) {
+      var desc = {};
+      Object['ke' + 'ys'](descriptor).forEach(function (key) {
+        desc[key] = descriptor[key];
+      });
+      desc.enumerable = !!desc.enumerable;
+      desc.configurable = !!desc.configurable;
+
+      if ('value' in desc || desc.initializer) {
+        desc.writable = true;
+      }
+
+      desc = decorators.slice().reverse().reduce(function (desc, decorator) {
+        return decorator(target, property, desc) || desc;
+      }, desc);
+
+      if (context && desc.initializer !== void 0) {
+        desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
+        desc.initializer = undefined;
+      }
+
+      if (desc.initializer === void 0) {
+        Object['define' + 'Property'](target, property, desc);
+        desc = null;
+      }
+
+      return desc;
+    }
+
+    var debug$12 = browser$1('LC:MessageParser');
+
+    var tryParseJson = function tryParseJson(target, key, descriptor) {
+      var fn = descriptor.value;
+      // eslint-disable-next-line no-param-reassign
+      descriptor.value = function wrapper(param) {
+        var content = void 0;
+        if (typeof param !== 'string') {
+          content = param;
+        } else {
+          try {
+            content = JSON.parse(param);
+          } catch (error) {
+            content = param;
+          }
+        }
+        return fn.call(this, content);
+      };
+    };
+
+    var applyPlugins = function applyPlugins(target, key, descriptor) {
+      var fn = descriptor.value;
+      // eslint-disable-next-line no-param-reassign
+      descriptor.value = function wrapper(json) {
+        var _this = this;
+
+        return _Promise.resolve(json).then(applyMiddlewares(this._plugins.beforeMessageParse)).then(function (decoratedJson) {
+          return fn.call(_this, decoratedJson);
+        }).then(applyMiddlewares(this._plugins.afterMessageParse));
+      };
+    };
+
+    var MessageParser = (_class$5 = function () {
+      function MessageParser() {
+        var plugins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+        _classCallCheck(this, MessageParser);
+
+        this._plugins = plugins;
+        this._messageClasses = [];
+      }
+
+      MessageParser.prototype.register = function register(messageClass) {
+        if (messageClass && messageClass.parse && messageClass.prototype && messageClass.prototype.toJSON) {
+          this._messageClasses.unshift(messageClass);
+        } else {
+          throw new TypeError('Invalid messageClass');
+        }
+      };
+
+      // jsdoc-ignore-start
+
+
+      // jsdoc-ignore-end
+      MessageParser.prototype.parse = function parse(content) {
+        debug$12('parsing message: %O', content);
+        // eslint-disable-next-line no-restricted-syntax
+        var _iteratorNormalCompletion = true;
+        var _didIteratorError = false;
+        var _iteratorError = undefined;
+
+        try {
+          for (var _iterator = _getIterator(this._messageClasses), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
+            var Klass = _step.value;
+
+            var contentCopy = isPlainObject_1(content) ? _Object$assign({}, content) : content;
+            var valid = void 0;
+            var result = void 0;
+            try {
+              valid = Klass.validate(contentCopy);
+            } catch (error) {
+              // eslint-disable-line no-empty
+            }
+            if (valid) {
+              try {
+                result = Klass.parse(contentCopy);
+              } catch (error) {
+                console.warn('parsing a valid message content error', {
+                  error: error,
+                  Klass: Klass,
+                  content: contentCopy
+                });
+              }
+              if (result !== undefined) {
+                debug$12('parse result: %O', result);
+                return result;
+              }
+            }
+          }
+        } catch (err) {
+          _didIteratorError = true;
+          _iteratorError = err;
+        } finally {
+          try {
+            if (!_iteratorNormalCompletion && _iterator.return) {
+              _iterator.return();
+            }
+          } finally {
+            if (_didIteratorError) {
+              throw _iteratorError;
+            }
+          }
+        }
+
+        throw new Error('No Message Class matched');
+      };
+
+      return MessageParser;
+    }(), (_applyDecoratedDescriptor$2(_class$5.prototype, 'parse', [tryParseJson, applyPlugins], _Object$getOwnPropertyDescriptor(_class$5.prototype, 'parse'), _class$5.prototype)), _class$5);
+
+    var _this = undefined;
+
+    /** @module leancloud-realtime */
+    var debug$7 = browser$1('LC:IMPlugin');
+
+    /**
+     * 消息优先级枚举
+     * @enum {Number}
+     * @since 3.3.0
+     */
+    var MessagePriority = {
+      /** 高 */
+      HIGH: 1,
+      /** 普通 */
+      NORMAL: 2,
+      /** 低 */
+      LOW: 3
+    };
+    _Object$freeze(MessagePriority);
+
+    /**
+     * 为 Conversation 定义一个新属性
+     * @param {String} prop 属性名
+     * @param {Object} [descriptor] 属性的描述符,参见 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor#Description getOwnPropertyDescriptor#Description - MDN},默认为该属性名对应的 Conversation 自定义属性的 getter/setter
+     * @returns void
+     * @example
+     *
+     * conversation.get('type');
+     * conversation.set('type', 1);
+     *
+     * // equals to
+     * defineConversationProperty('type');
+     * conversation.type;
+     * conversation.type = 1;
+     */
+    var defineConversationProperty = function defineConversationProperty(prop) {
+      var descriptor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
+        get: function get() {
+          return this.get(prop);
+        },
+        set: function set(value) {
+          this.set(prop, value);
+        }
+      };
+
+      _Object$defineProperty(Conversation.prototype, prop, descriptor);
+    };
+
+    var onRealtimeCreate = function onRealtimeCreate(realtime) {
+      /* eslint-disable no-param-reassign */
+      var deviceId = v4_1();
+      realtime._IMClients = {};
+      var messageParser = new MessageParser(realtime._plugins);
+      realtime._messageParser = messageParser;
+
+      var signAVUser = function () {
+        var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(user) {
+          return regenerator.wrap(function _callee$(_context) {
+            while (1) {
+              switch (_context.prev = _context.next) {
+                case 0:
+                  return _context.abrupt('return', realtime._request({
+                    method: 'POST',
+                    path: '/rtm/sign',
+                    data: {
+                      session_token: user.getSessionToken()
+                    }
+                  }));
+
+                case 1:
+                case 'end':
+                  return _context.stop();
+              }
+            }
+          }, _callee, _this);
+        }));
+
+        return function signAVUser(_x2) {
+          return _ref.apply(this, arguments);
+        };
+      }();
+
+      /**
+       * 注册消息类
+       *
+       * 在接收消息、查询消息时,会按照消息类注册顺序的逆序依次尝试解析消息内容
+       *
+       * @memberof Realtime
+       * @instance
+       * @param  {Function | Function[]} messageClass 消息类,需要实现 {@link AVMessage} 接口,
+       * 建议继承自 {@link TypedMessage}
+       * @throws {TypeError} 如果 messageClass 没有实现 {@link AVMessage} 接口则抛出异常
+       */
+      var register = function register(messageClass) {
+        return ensureArray(messageClass).map(messageParser.register.bind(messageParser));
+      };
+      register(ensureArray(realtime._plugins.messageClasses));
+      /**
+       * 创建一个即时通讯客户端,多次创建相同 id 的客户端会返回同一个实例
+       * @memberof Realtime
+       * @instance
+       * @param  {String|AV.User} [identity] 客户端 identity,如果不指定该参数,服务端会随机生成一个字符串作为 identity,
+       * 如果传入一个已登录的 AV.User,则会使用该用户的 id 作为客户端 identity 登录。
+       * @param  {Object} [clientOptions] 详细参数 @see {@link IMClient}
+       * @param  {String} [tag] 客户端类型标记,以支持单点登录功能
+       * @return {Promise.}
+       */
+      var createIMClient = function () {
+        var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(identity, clientOptions, tag) {
+          var id, buildinOptions, sessionToken, promise$$1;
+          return regenerator.wrap(function _callee2$(_context2) {
+            while (1) {
+              switch (_context2.prev = _context2.next) {
+                case 0:
+                  id = void 0;
+                  buildinOptions = {};
+
+                  if (!identity) {
+                    _context2.next = 18;
+                    break;
+                  }
+
+                  if (!(typeof identity === 'string')) {
+                    _context2.next = 7;
+                    break;
+                  }
+
+                  id = identity;
+                  _context2.next = 16;
+                  break;
+
+                case 7:
+                  if (!(identity.id && identity.getSessionToken)) {
+                    _context2.next = 15;
+                    break;
+                  }
+
+                  id = identity.id;
+                  sessionToken = identity.getSessionToken();
+
+                  if (sessionToken) {
+                    _context2.next = 12;
+                    break;
+                  }
+
+                  throw new Error('User must be authenticated');
+
+                case 12:
+                  buildinOptions.signatureFactory = signAVUser;
+                  _context2.next = 16;
+                  break;
+
+                case 15:
+                  throw new TypeError('Identity must be a String or an AV.User');
+
+                case 16:
+                  if (!(realtime._IMClients[id] !== undefined)) {
+                    _context2.next = 18;
+                    break;
+                  }
+
+                  return _context2.abrupt('return', realtime._IMClients[id]);
+
+                case 18:
+                  promise$$1 = realtime._open().then(function (connection) {
+                    var client = new IMClient(id, _extends$1({}, buildinOptions, clientOptions), connection, {
+                      _messageParser: messageParser,
+                      _plugins: realtime._plugins,
+                      _identity: identity
+                    });
+                    connection.on('reconnect', function () {
+                      return client._open(realtime._options.appId, tag, deviceId, true)
+                      /**
+                       * 客户端连接恢复正常,该事件通常在 {@link Realtime#event:reconnect} 之后发生
+                       * @event IMClient#reconnect
+                       * @see Realtime#event:reconnect
+                       * @since 3.2.0
+                       */
+                      /**
+                       * 客户端重新登录发生错误(网络连接已恢复,但重新登录错误)
+                       * @event IMClient#reconnecterror
+                       * @since 3.2.0
+                       */
+                      .then(function () {
+                        return client.emit('reconnect');
+                      }, function (error) {
+                        return client.emit('reconnecterror', error);
+                      });
+                    });
+                    internal(client)._eventemitter.on('close', function () {
+                      delete realtime._IMClients[client.id];
+                      realtime._deregister(client);
+                    }, realtime);
+                    return client._open(realtime._options.appId, tag, deviceId).then(function () {
+                      realtime._IMClients[client.id] = client;
+                      realtime._register(client);
+                      return client;
+                    }).catch(function (error) {
+                      delete realtime._IMClients[client.id];
+                      throw error;
+                    });
+                  });
+
+                  if (identity) {
+                    realtime._IMClients[id] = promise$$1;
+                  }
+                  return _context2.abrupt('return', promise$$1);
+
+                case 21:
+                case 'end':
+                  return _context2.stop();
+              }
+            }
+          }, _callee2, _this);
+        }));
+
+        return function createIMClient(_x3, _x4, _x5) {
+          return _ref2.apply(this, arguments);
+        };
+      }();
+      _Object$assign(realtime, {
+        register: register,
+        createIMClient: createIMClient
+      });
+      /* eslint-enable no-param-reassign */
+    };
+
+    var beforeCommandDispatch = function beforeCommandDispatch(command, realtime) {
+      if (command.peerId === null) return true;
+      var targetClient = realtime._IMClients[command.peerId];
+      if (targetClient) {
+        _Promise.resolve(targetClient).then(function (client) {
+          return client._dispatchCommand(command);
+        }).catch(debug$7);
+      } else {
+        debug$7('[WARN] Unexpected message received without any live client match: %O', trim$1(command));
+      }
+      return false;
+    };
+
+    var IMPlugin = {
+      name: 'leancloud-realtime-plugin-im',
+      onRealtimeCreate: onRealtimeCreate,
+      beforeCommandDispatch: beforeCommandDispatch,
+      messageClasses: [Message, BinaryMessage, RecalledMessage, TextMessage]
+    };
+
+    Realtime.defineConversationProperty = defineConversationProperty;
+    Realtime.__preRegisteredPlugins = [IMPlugin];
+
+    exports.Protocals = message;
+    exports.Promise = _Promise;
+    exports.EventEmitter = eventemitter3;
+    exports.Realtime = Realtime;
+    exports.ErrorCode = ErrorCode;
+    exports.Message = Message;
+    exports.BinaryMessage = BinaryMessage;
+    exports.TypedMessage = TypedMessage;
+    exports.TextMessage = TextMessage;
+    exports.RecalledMessage = RecalledMessage;
+    exports.MessagePriority = MessagePriority;
+    exports.MessageStatus = MessageStatus;
+    exports.MessageQueryDirection = MessageQueryDirection;
+    exports.defineConversationProperty = defineConversationProperty;
+    exports.IMPlugin = IMPlugin;
+    exports.messageType = messageType;
+    exports.messageField = messageField;
+    exports.IE10Compatible = IE10Compatible;
+
+    Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
+
+//# sourceMappingURL=realtime.browser.js.map
\ No newline at end of file
diff --git a/dist/realtime.browser.js.map b/dist/realtime.browser.js.map
new file mode 100644
index 000000000..1e0dc7ed6
--- /dev/null
+++ b/dist/realtime.browser.js.map
@@ -0,0 +1 @@
+{"version":3,"file":null,"sources":["/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-integer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_defined.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_string-at.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_library.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_global.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_core.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_a-function.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_ctx.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_an-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_fails.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_descriptors.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_dom-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_ie8-dom-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-primitive.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-dp.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_property-desc.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_hide.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_export.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_redefine.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_has.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iterators.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_cof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iobject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-iobject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-length.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-absolute-index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-includes.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_shared.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_uid.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_shared-key.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-keys-internal.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_enum-bug-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-dps.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_html.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-to-string-tag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_to-object.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gpo.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.string.iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_add-to-unscopables.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-step.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.array.iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/web.dom.iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_classof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_an-instance.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-call.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-array-iter.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/core.get-iterator-method.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_for-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_species-constructor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_invoke.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_task.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_microtask.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_new-promise-capability.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_perform.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_promise-resolve.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_redefine-all.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-species.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_iter-detect.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.promise.finally.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.promise.try.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/long/dist/long.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/bytebuffer/dist/bytebuffer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/@leeyeh/rollup-plugin-node-resolve/src/empty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/protobufjs/dist/protobuf-light.js","/home/travis/build/leancloud/js-realtime-sdk/proto/message-compiled.js","/home/travis/build/leancloud/js-realtime-sdk/proto/message.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/eventemitter3/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/regenerator-runtime/runtime.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/regenerator-runtime/runtime-module.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/regenerator/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gops.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-pie.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/assign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/extends.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/asyncToGenerator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_create-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.array.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/array/from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/array/from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/toConsumableArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_meta.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_validate-collection.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-strong.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_is-array.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-species-constructor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-species-create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-methods.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_array-from-iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-to-json.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.to-json.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-collection-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-collection-from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.set.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/classCallCheck.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks-ext.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/symbol/iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/symbol/iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_wks-define.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_enum-keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopn-ext.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-gopd.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.symbol.async-iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.symbol.observable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/symbol/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/typeof.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/possibleConstructorReturn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_set-proto.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/set-prototype-of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/create.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/inherits.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/ms/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/debug/src/debug.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/debug/src/browser.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/bind.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/is-buffer/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/utils.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/json/stringify.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/json/stringify.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/normalizeHeaderName.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/enhanceError.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/createError.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/settle.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/buildURL.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/parseHeaders.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/isURLSameOrigin.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/btoa.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/cookies.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/adapters/xhr.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/defaults.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/InterceptorManager.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/transformData.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/isCancel.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/dispatchRequest.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/isAbsoluteURL.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/combineURLs.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/core/Axios.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/Cancel.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/cancel/CancelToken.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/helpers/spread.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/lib/axios.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/axios/index.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_object-sap.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/javascript-state-machine/state-machine.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/_collection-weak.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.weak-map.of.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es7.weak-map.from.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/weak-map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/define-property.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/defineProperty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_freeGlobal.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_root.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Symbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getRawTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_objectToString.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseGetTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_overArg.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getPrototype.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isObjectLike.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isPlainObject.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/global.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/createClass.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/expirable.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/cache.js","/home/travis/build/leancloud/js-realtime-sdk/src/utils/index.js","/home/travis/build/leancloud/js-realtime-sdk/src/polyfills/ws-browser.js","/home/travis/build/leancloud/js-realtime-sdk/src/websocket-plus.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.object.freeze.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/object/freeze.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/object/freeze.js","/home/travis/build/leancloud/js-realtime-sdk/src/error.js","/home/travis/build/leancloud/js-realtime-sdk/src/connection.js","/home/travis/build/leancloud/js-realtime-sdk/src/plugin.js","/home/travis/build/leancloud/js-realtime-sdk/src/realtime.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/uuid/lib/rng-browser.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/uuid/lib/bytesToUuid.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/uuid/v4.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/objectWithoutProperties.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/core.is-iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/is-iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/is-iterable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/core.get-iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/get-iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/get-iterator.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/helpers/slicedToArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/modules/es6.array.find.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/core-js/library/fn/array/find.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/babel-runtime/core-js/array/find.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_isPrototype.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_nativeKeys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseKeys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isObject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isFunction.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_coreJsData.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_isMasked.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_toSource.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseIsNative.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getValue.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getNative.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_DataView.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Map.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Promise.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Set.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_WeakMap.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseIsArguments.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isArguments.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isLength.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isArrayLike.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/stubFalse.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isBuffer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseIsTypedArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseUnary.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_nodeUtil.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isTypedArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/isEmpty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_listCacheClear.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/eq.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_assocIndexOf.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_listCacheDelete.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_listCacheGet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_listCacheHas.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_listCacheSet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_ListCache.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_stackClear.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_stackDelete.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_stackGet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_stackHas.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_nativeCreate.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_hashClear.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_hashDelete.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_hashGet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_hashHas.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_hashSet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Hash.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_mapCacheClear.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_isKeyable.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getMapData.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_mapCacheDelete.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_mapCacheGet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_mapCacheHas.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_mapCacheSet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_MapCache.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_stackSet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Stack.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_arrayEach.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_defineProperty.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseAssignValue.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_assignValue.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_copyObject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseTimes.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_isIndex.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_arrayLikeKeys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/keys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseAssign.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_nativeKeysIn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseKeysIn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/keysIn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseAssignIn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneBuffer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_copyArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_arrayFilter.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/stubArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getSymbols.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_copySymbols.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_arrayPush.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getSymbolsIn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_copySymbolsIn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseGetAllKeys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getAllKeys.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_getAllKeysIn.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_initCloneArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_Uint8Array.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneArrayBuffer.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneDataView.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_addMapEntry.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_arrayReduce.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_mapToArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneMap.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneRegExp.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_addSetEntry.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_setToArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneSet.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneSymbol.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_cloneTypedArray.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_initCloneByTag.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseCreate.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_initCloneObject.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/_baseClone.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/lodash/cloneDeep.js","/home/travis/build/leancloud/js-realtime-sdk/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js","/home/travis/build/leancloud/js-realtime-sdk/src/signature-factory-runner.js","/home/travis/build/leancloud/js-realtime-sdk/src/messages/message.js","/home/travis/build/leancloud/js-realtime-sdk/src/messages/helpers.js","/home/travis/build/leancloud/js-realtime-sdk/src/messages/typed-message.js","/home/travis/build/leancloud/js-realtime-sdk/src/messages/recalled-message.js","/home/travis/build/leancloud/js-realtime-sdk/src/conversation.js","/home/travis/build/leancloud/js-realtime-sdk/src/conversation-query.js","/home/travis/build/leancloud/js-realtime-sdk/src/im-client.js","/home/travis/build/leancloud/js-realtime-sdk/src/messages/binary-message.js","/home/travis/build/leancloud/js-realtime-sdk/src/messages/text-message.js","/home/travis/build/leancloud/js-realtime-sdk/src/message-parser.js","/home/travis/build/leancloud/js-realtime-sdk/src/plugin-im.js","/home/travis/build/leancloud/js-realtime-sdk/src/index.js"],"sourcesContent":["// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n  if (it == undefined) throw TypeError(\"Can't call method on  \" + it);\n  return it;\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true  -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n  return function (that, pos) {\n    var s = String(defined(that));\n    var i = toInteger(pos);\n    var l = s.length;\n    var a, b;\n    if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n    a = s.charCodeAt(i);\n    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n      ? TO_STRING ? s.charAt(i) : a\n      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n  };\n};\n","module.exports = true;\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n  ? window : typeof self != 'undefined' && self.Math == Math ? self\n  // eslint-disable-next-line no-new-func\n  : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.5.1' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","module.exports = function (it) {\n  if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n  return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n  aFunction(fn);\n  if (that === undefined) return fn;\n  switch (length) {\n    case 1: return function (a) {\n      return fn.call(that, a);\n    };\n    case 2: return function (a, b) {\n      return fn.call(that, a, b);\n    };\n    case 3: return function (a, b, c) {\n      return fn.call(that, a, b, c);\n    };\n  }\n  return function (/* ...args */) {\n    return fn.apply(that, arguments);\n  };\n};\n","module.exports = function (it) {\n  return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n  if (!isObject(it)) throw TypeError(it + ' is not an object!');\n  return it;\n};\n","module.exports = function (exec) {\n  try {\n    return !!exec();\n  } catch (e) {\n    return true;\n  }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n  return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n  return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n  if (!isObject(it)) return it;\n  var fn, val;\n  if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n  if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n  if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n  throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n  anObject(O);\n  P = toPrimitive(P, true);\n  anObject(Attributes);\n  if (IE8_DOM_DEFINE) try {\n    return dP(O, P, Attributes);\n  } catch (e) { /* empty */ }\n  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n  if ('value' in Attributes) O[P] = Attributes.value;\n  return O;\n};\n","module.exports = function (bitmap, value) {\n  return {\n    enumerable: !(bitmap & 1),\n    configurable: !(bitmap & 2),\n    writable: !(bitmap & 4),\n    value: value\n  };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n  return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n  object[key] = value;\n  return object;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n  var IS_FORCED = type & $export.F;\n  var IS_GLOBAL = type & $export.G;\n  var IS_STATIC = type & $export.S;\n  var IS_PROTO = type & $export.P;\n  var IS_BIND = type & $export.B;\n  var IS_WRAP = type & $export.W;\n  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n  var expProto = exports[PROTOTYPE];\n  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n  var key, own, out;\n  if (IS_GLOBAL) source = name;\n  for (key in source) {\n    // contains in native\n    own = !IS_FORCED && target && target[key] !== undefined;\n    if (own && key in exports) continue;\n    // export native or passed\n    out = own ? target[key] : source[key];\n    // prevent global pollution for namespaces\n    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n    // bind timers to global for call from export context\n    : IS_BIND && own ? ctx(out, global)\n    // wrap global constructors for prevent change them in library\n    : IS_WRAP && target[key] == out ? (function (C) {\n      var F = function (a, b, c) {\n        if (this instanceof C) {\n          switch (arguments.length) {\n            case 0: return new C();\n            case 1: return new C(a);\n            case 2: return new C(a, b);\n          } return new C(a, b, c);\n        } return C.apply(this, arguments);\n      };\n      F[PROTOTYPE] = C[PROTOTYPE];\n      return F;\n    // make static versions for prototype methods\n    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n    if (IS_PROTO) {\n      (exports.virtual || (exports.virtual = {}))[key] = out;\n      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n      if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n    }\n  }\n};\n// type bitmap\n$export.F = 1;   // forced\n$export.G = 2;   // global\n$export.S = 4;   // static\n$export.P = 8;   // proto\n$export.B = 16;  // bind\n$export.W = 32;  // wrap\n$export.U = 64;  // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = require('./_hide');\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n  return hasOwnProperty.call(it, key);\n};\n","module.exports = {};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n  return toString.call(it).slice(8, -1);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n  return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n  return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n  index = toInteger(index);\n  return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true  -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n  return function ($this, el, fromIndex) {\n    var O = toIObject($this);\n    var length = toLength(O.length);\n    var index = toAbsoluteIndex(fromIndex, length);\n    var value;\n    // Array#includes uses SameValueZero equality algorithm\n    // eslint-disable-next-line no-self-compare\n    if (IS_INCLUDES && el != el) while (length > index) {\n      value = O[index++];\n      // eslint-disable-next-line no-self-compare\n      if (value != value) return true;\n    // Array#indexOf ignores holes, Array#includes - not\n    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n      if (O[index] === el) return IS_INCLUDES || index || 0;\n    } return !IS_INCLUDES && -1;\n  };\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n  return store[key] || (store[key] = {});\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n  return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n  var O = toIObject(object);\n  var i = 0;\n  var result = [];\n  var key;\n  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n  // Don't enum bug & hidden keys\n  while (names.length > i) if (has(O, key = names[i++])) {\n    ~arrayIndexOf(result, key) || result.push(key);\n  }\n  return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n  return $keys(O, enumBugKeys);\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n  anObject(O);\n  var keys = getKeys(Properties);\n  var length = keys.length;\n  var i = 0;\n  var P;\n  while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n  return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n  // Thrash, waste and sodomy: IE GC bug\n  var iframe = require('./_dom-create')('iframe');\n  var i = enumBugKeys.length;\n  var lt = '<';\n  var gt = '>';\n  var iframeDocument;\n  iframe.style.display = 'none';\n  require('./_html').appendChild(iframe);\n  iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n  // createDict = iframe.contentWindow.Object;\n  // html.removeChild(iframe);\n  iframeDocument = iframe.contentWindow.document;\n  iframeDocument.open();\n  iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n  iframeDocument.close();\n  createDict = iframeDocument.F;\n  while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n  return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n  var result;\n  if (O !== null) {\n    Empty[PROTOTYPE] = anObject(O);\n    result = new Empty();\n    Empty[PROTOTYPE] = null;\n    // add \"__proto__\" for Object.getPrototypeOf polyfill\n    result[IE_PROTO] = O;\n  } else result = createDict();\n  return Properties === undefined ? result : dPs(result, Properties);\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n  return store[name] || (store[name] =\n    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n  if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n  Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n  setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n  return Object(defined(it));\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n  O = toObject(O);\n  if (has(O, IE_PROTO)) return O[IE_PROTO];\n  if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n    return O.constructor.prototype;\n  } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n  $iterCreate(Constructor, NAME, next);\n  var getMethod = function (kind) {\n    if (!BUGGY && kind in proto) return proto[kind];\n    switch (kind) {\n      case KEYS: return function keys() { return new Constructor(this, kind); };\n      case VALUES: return function values() { return new Constructor(this, kind); };\n    } return function entries() { return new Constructor(this, kind); };\n  };\n  var TAG = NAME + ' Iterator';\n  var DEF_VALUES = DEFAULT == VALUES;\n  var VALUES_BUG = false;\n  var proto = Base.prototype;\n  var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n  var $default = $native || getMethod(DEFAULT);\n  var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n  var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n  var methods, key, IteratorPrototype;\n  // Fix native\n  if ($anyNative) {\n    IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n    if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n      // Set @@toStringTag to native iterators\n      setToStringTag(IteratorPrototype, TAG, true);\n      // fix for some old engines\n      if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n    }\n  }\n  // fix Array#{values, @@iterator}.name in V8 / FF\n  if (DEF_VALUES && $native && $native.name !== VALUES) {\n    VALUES_BUG = true;\n    $default = function values() { return $native.call(this); };\n  }\n  // Define iterator\n  if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n    hide(proto, ITERATOR, $default);\n  }\n  // Plug for library\n  Iterators[NAME] = $default;\n  Iterators[TAG] = returnThis;\n  if (DEFAULT) {\n    methods = {\n      values: DEF_VALUES ? $default : getMethod(VALUES),\n      keys: IS_SET ? $default : getMethod(KEYS),\n      entries: $entries\n    };\n    if (FORCED) for (key in methods) {\n      if (!(key in proto)) redefine(proto, key, methods[key]);\n    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n  }\n  return methods;\n};\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n  this._t = String(iterated); // target\n  this._i = 0;                // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n  var O = this._t;\n  var index = this._i;\n  var point;\n  if (index >= O.length) return { value: undefined, done: true };\n  point = $at(O, index);\n  this._i += point.length;\n  return { value: point, done: false };\n});\n","module.exports = function () { /* empty */ };\n","module.exports = function (done, value) {\n  return { value: value, done: !!done };\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n  this._t = toIObject(iterated); // target\n  this._i = 0;                   // next index\n  this._k = kind;                // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n  var O = this._t;\n  var kind = this._k;\n  var index = this._i++;\n  if (!O || index >= O.length) {\n    this._t = undefined;\n    return step(1);\n  }\n  if (kind == 'keys') return step(0, index);\n  if (kind == 'values') return step(0, O[index]);\n  return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","require('./es6.array.iterator');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar TO_STRING_TAG = require('./_wks')('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n  'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n  'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n  'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n  'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n  var NAME = DOMIterables[i];\n  var Collection = global[NAME];\n  var proto = Collection && Collection.prototype;\n  if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n  Iterators[NAME] = Iterators.Array;\n}\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n  try {\n    return it[key];\n  } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n  var O, T, B;\n  return it === undefined ? 'Undefined' : it === null ? 'Null'\n    // @@toStringTag case\n    : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n    // builtinTag case\n    : ARG ? cof(O)\n    // ES3 arguments fallback\n    : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n  if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n    throw TypeError(name + ': incorrect invocation!');\n  } return it;\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n  try {\n    return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n  // 7.4.6 IteratorClose(iterator, completion)\n  } catch (e) {\n    var ret = iterator['return'];\n    if (ret !== undefined) anObject(ret.call(iterator));\n    throw e;\n  }\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n  if (it != undefined) return it[ITERATOR]\n    || it['@@iterator']\n    || Iterators[classof(it)];\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n  var f = ctx(fn, that, entries ? 2 : 1);\n  var index = 0;\n  var length, step, iterator, result;\n  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n  // fast case for arrays with default iterator\n  if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n    if (result === BREAK || result === RETURN) return result;\n  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n    result = call(iterator, f, step.value, entries);\n    if (result === BREAK || result === RETURN) return result;\n  }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n  var C = anObject(O).constructor;\n  var S;\n  return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n  var un = that === undefined;\n  switch (args.length) {\n    case 0: return un ? fn()\n                      : fn.call(that);\n    case 1: return un ? fn(args[0])\n                      : fn.call(that, args[0]);\n    case 2: return un ? fn(args[0], args[1])\n                      : fn.call(that, args[0], args[1]);\n    case 3: return un ? fn(args[0], args[1], args[2])\n                      : fn.call(that, args[0], args[1], args[2]);\n    case 4: return un ? fn(args[0], args[1], args[2], args[3])\n                      : fn.call(that, args[0], args[1], args[2], args[3]);\n  } return fn.apply(that, args);\n};\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n  var id = +this;\n  // eslint-disable-next-line no-prototype-builtins\n  if (queue.hasOwnProperty(id)) {\n    var fn = queue[id];\n    delete queue[id];\n    fn();\n  }\n};\nvar listener = function (event) {\n  run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n  setTask = function setImmediate(fn) {\n    var args = [];\n    var i = 1;\n    while (arguments.length > i) args.push(arguments[i++]);\n    queue[++counter] = function () {\n      // eslint-disable-next-line no-new-func\n      invoke(typeof fn == 'function' ? fn : Function(fn), args);\n    };\n    defer(counter);\n    return counter;\n  };\n  clearTask = function clearImmediate(id) {\n    delete queue[id];\n  };\n  // Node.js 0.8-\n  if (require('./_cof')(process) == 'process') {\n    defer = function (id) {\n      process.nextTick(ctx(run, id, 1));\n    };\n  // Sphere (JS game engine) Dispatch API\n  } else if (Dispatch && Dispatch.now) {\n    defer = function (id) {\n      Dispatch.now(ctx(run, id, 1));\n    };\n  // Browsers with MessageChannel, includes WebWorkers\n  } else if (MessageChannel) {\n    channel = new MessageChannel();\n    port = channel.port2;\n    channel.port1.onmessage = listener;\n    defer = ctx(port.postMessage, port, 1);\n  // Browsers with postMessage, skip WebWorkers\n  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n  } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n    defer = function (id) {\n      global.postMessage(id + '', '*');\n    };\n    global.addEventListener('message', listener, false);\n  // IE8-\n  } else if (ONREADYSTATECHANGE in cel('script')) {\n    defer = function (id) {\n      html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n        html.removeChild(this);\n        run.call(id);\n      };\n    };\n  // Rest old browsers\n  } else {\n    defer = function (id) {\n      setTimeout(ctx(run, id, 1), 0);\n    };\n  }\n}\nmodule.exports = {\n  set: setTask,\n  clear: clearTask\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n  var head, last, notify;\n\n  var flush = function () {\n    var parent, fn;\n    if (isNode && (parent = process.domain)) parent.exit();\n    while (head) {\n      fn = head.fn;\n      head = head.next;\n      try {\n        fn();\n      } catch (e) {\n        if (head) notify();\n        else last = undefined;\n        throw e;\n      }\n    } last = undefined;\n    if (parent) parent.enter();\n  };\n\n  // Node.js\n  if (isNode) {\n    notify = function () {\n      process.nextTick(flush);\n    };\n  // browsers with MutationObserver\n  } else if (Observer) {\n    var toggle = true;\n    var node = document.createTextNode('');\n    new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n    notify = function () {\n      node.data = toggle = !toggle;\n    };\n  // environments with maybe non-completely correct, but existent Promise\n  } else if (Promise && Promise.resolve) {\n    var promise = Promise.resolve();\n    notify = function () {\n      promise.then(flush);\n    };\n  // for other environments - macrotask based on:\n  // - setImmediate\n  // - MessageChannel\n  // - window.postMessag\n  // - onreadystatechange\n  // - setTimeout\n  } else {\n    notify = function () {\n      // strange IE + webpack dev server bug - use .call(global)\n      macrotask.call(global, flush);\n    };\n  }\n\n  return function (fn) {\n    var task = { fn: fn, next: undefined };\n    if (last) last.next = task;\n    if (!head) {\n      head = task;\n      notify();\n    } last = task;\n  };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n  var resolve, reject;\n  this.promise = new C(function ($$resolve, $$reject) {\n    if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n    resolve = $$resolve;\n    reject = $$reject;\n  });\n  this.resolve = aFunction(resolve);\n  this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n  return new PromiseCapability(C);\n};\n","module.exports = function (exec) {\n  try {\n    return { e: false, v: exec() };\n  } catch (e) {\n    return { e: true, v: e };\n  }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n  anObject(C);\n  if (isObject(x) && x.constructor === C) return x;\n  var promiseCapability = newPromiseCapability.f(C);\n  var resolve = promiseCapability.resolve;\n  resolve(x);\n  return promiseCapability.promise;\n};\n","var hide = require('./_hide');\nmodule.exports = function (target, src, safe) {\n  for (var key in src) {\n    if (safe && target[key]) target[key] = src[key];\n    else hide(target, key, src[key]);\n  } return target;\n};\n","'use strict';\nvar global = require('./_global');\nvar core = require('./_core');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n  var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n  if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n    configurable: true,\n    get: function () { return this; }\n  });\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n  var riter = [7][ITERATOR]();\n  riter['return'] = function () { SAFE_CLOSING = true; };\n  // eslint-disable-next-line no-throw-literal\n  Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n  if (!skipClosing && !SAFE_CLOSING) return false;\n  var safe = false;\n  try {\n    var arr = [7];\n    var iter = arr[ITERATOR]();\n    iter.next = function () { return { done: safe = true }; };\n    arr[ITERATOR] = function () { return iter; };\n    exec(arr);\n  } catch (e) { /* empty */ }\n  return safe;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n  try {\n    // correct subclassing with @@species support\n    var promise = $Promise.resolve(1);\n    var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n      exec(empty, empty);\n    };\n    // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n    return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n  } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n  var then;\n  return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n  if (promise._n) return;\n  promise._n = true;\n  var chain = promise._c;\n  microtask(function () {\n    var value = promise._v;\n    var ok = promise._s == 1;\n    var i = 0;\n    var run = function (reaction) {\n      var handler = ok ? reaction.ok : reaction.fail;\n      var resolve = reaction.resolve;\n      var reject = reaction.reject;\n      var domain = reaction.domain;\n      var result, then;\n      try {\n        if (handler) {\n          if (!ok) {\n            if (promise._h == 2) onHandleUnhandled(promise);\n            promise._h = 1;\n          }\n          if (handler === true) result = value;\n          else {\n            if (domain) domain.enter();\n            result = handler(value);\n            if (domain) domain.exit();\n          }\n          if (result === reaction.promise) {\n            reject(TypeError('Promise-chain cycle'));\n          } else if (then = isThenable(result)) {\n            then.call(result, resolve, reject);\n          } else resolve(result);\n        } else reject(value);\n      } catch (e) {\n        reject(e);\n      }\n    };\n    while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n    promise._c = [];\n    promise._n = false;\n    if (isReject && !promise._h) onUnhandled(promise);\n  });\n};\nvar onUnhandled = function (promise) {\n  task.call(global, function () {\n    var value = promise._v;\n    var unhandled = isUnhandled(promise);\n    var result, handler, console;\n    if (unhandled) {\n      result = perform(function () {\n        if (isNode) {\n          process.emit('unhandledRejection', value, promise);\n        } else if (handler = global.onunhandledrejection) {\n          handler({ promise: promise, reason: value });\n        } else if ((console = global.console) && console.error) {\n          console.error('Unhandled promise rejection', value);\n        }\n      });\n      // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n      promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n    } promise._a = undefined;\n    if (unhandled && result.e) throw result.v;\n  });\n};\nvar isUnhandled = function (promise) {\n  if (promise._h == 1) return false;\n  var chain = promise._a || promise._c;\n  var i = 0;\n  var reaction;\n  while (chain.length > i) {\n    reaction = chain[i++];\n    if (reaction.fail || !isUnhandled(reaction.promise)) return false;\n  } return true;\n};\nvar onHandleUnhandled = function (promise) {\n  task.call(global, function () {\n    var handler;\n    if (isNode) {\n      process.emit('rejectionHandled', promise);\n    } else if (handler = global.onrejectionhandled) {\n      handler({ promise: promise, reason: promise._v });\n    }\n  });\n};\nvar $reject = function (value) {\n  var promise = this;\n  if (promise._d) return;\n  promise._d = true;\n  promise = promise._w || promise; // unwrap\n  promise._v = value;\n  promise._s = 2;\n  if (!promise._a) promise._a = promise._c.slice();\n  notify(promise, true);\n};\nvar $resolve = function (value) {\n  var promise = this;\n  var then;\n  if (promise._d) return;\n  promise._d = true;\n  promise = promise._w || promise; // unwrap\n  try {\n    if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n    if (then = isThenable(value)) {\n      microtask(function () {\n        var wrapper = { _w: promise, _d: false }; // wrap\n        try {\n          then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n        } catch (e) {\n          $reject.call(wrapper, e);\n        }\n      });\n    } else {\n      promise._v = value;\n      promise._s = 1;\n      notify(promise, false);\n    }\n  } catch (e) {\n    $reject.call({ _w: promise, _d: false }, e); // wrap\n  }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n  // 25.4.3.1 Promise(executor)\n  $Promise = function Promise(executor) {\n    anInstance(this, $Promise, PROMISE, '_h');\n    aFunction(executor);\n    Internal.call(this);\n    try {\n      executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n    } catch (err) {\n      $reject.call(this, err);\n    }\n  };\n  // eslint-disable-next-line no-unused-vars\n  Internal = function Promise(executor) {\n    this._c = [];             // <- awaiting reactions\n    this._a = undefined;      // <- checked in isUnhandled reactions\n    this._s = 0;              // <- state\n    this._d = false;          // <- done\n    this._v = undefined;      // <- value\n    this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n    this._n = false;          // <- notify\n  };\n  Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n    // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n    then: function then(onFulfilled, onRejected) {\n      var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n      reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n      reaction.fail = typeof onRejected == 'function' && onRejected;\n      reaction.domain = isNode ? process.domain : undefined;\n      this._c.push(reaction);\n      if (this._a) this._a.push(reaction);\n      if (this._s) notify(this, false);\n      return reaction.promise;\n    },\n    // 25.4.5.1 Promise.prototype.catch(onRejected)\n    'catch': function (onRejected) {\n      return this.then(undefined, onRejected);\n    }\n  });\n  OwnPromiseCapability = function () {\n    var promise = new Internal();\n    this.promise = promise;\n    this.resolve = ctx($resolve, promise, 1);\n    this.reject = ctx($reject, promise, 1);\n  };\n  newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n    return C === $Promise || C === Wrapper\n      ? new OwnPromiseCapability(C)\n      : newGenericPromiseCapability(C);\n  };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n  // 25.4.4.5 Promise.reject(r)\n  reject: function reject(r) {\n    var capability = newPromiseCapability(this);\n    var $$reject = capability.reject;\n    $$reject(r);\n    return capability.promise;\n  }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n  // 25.4.4.6 Promise.resolve(x)\n  resolve: function resolve(x) {\n    return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n  }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n  $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n  // 25.4.4.1 Promise.all(iterable)\n  all: function all(iterable) {\n    var C = this;\n    var capability = newPromiseCapability(C);\n    var resolve = capability.resolve;\n    var reject = capability.reject;\n    var result = perform(function () {\n      var values = [];\n      var index = 0;\n      var remaining = 1;\n      forOf(iterable, false, function (promise) {\n        var $index = index++;\n        var alreadyCalled = false;\n        values.push(undefined);\n        remaining++;\n        C.resolve(promise).then(function (value) {\n          if (alreadyCalled) return;\n          alreadyCalled = true;\n          values[$index] = value;\n          --remaining || resolve(values);\n        }, reject);\n      });\n      --remaining || resolve(values);\n    });\n    if (result.e) reject(result.v);\n    return capability.promise;\n  },\n  // 25.4.4.4 Promise.race(iterable)\n  race: function race(iterable) {\n    var C = this;\n    var capability = newPromiseCapability(C);\n    var reject = capability.reject;\n    var result = perform(function () {\n      forOf(iterable, false, function (promise) {\n        C.resolve(promise).then(capability.resolve, reject);\n      });\n    });\n    if (result.e) reject(result.v);\n    return capability.promise;\n  }\n});\n","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n  var C = speciesConstructor(this, core.Promise || global.Promise);\n  var isFunction = typeof onFinally == 'function';\n  return this.then(\n    isFunction ? function (x) {\n      return promiseResolve(C, onFinally()).then(function () { return x; });\n    } : onFinally,\n    isFunction ? function (e) {\n      return promiseResolve(C, onFinally()).then(function () { throw e; });\n    } : onFinally\n  );\n} });\n","'use strict';\n// https://github.com/tc39/proposal-promise-try\nvar $export = require('./_export');\nvar newPromiseCapability = require('./_new-promise-capability');\nvar perform = require('./_perform');\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n  var promiseCapability = newPromiseCapability.f(this);\n  var result = perform(callbackfn);\n  (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n  return promiseCapability.promise;\n} });\n","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.promise');\nrequire('../modules/es7.promise.finally');\nrequire('../modules/es7.promise.try');\nmodule.exports = require('../modules/_core').Promise;\n","module.exports = { \"default\": require(\"core-js/library/fn/promise\"), __esModule: true };","/*\r\n Copyright 2013 Daniel Wirtz \r\n Copyright 2009 The Closure Library Authors. All Rights Reserved.\r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS-IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license long.js (c) 2013 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/long.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n    /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n        define([], factory);\r\n    /* CommonJS */ else if (typeof require === 'function' && typeof module === \"object\" && module && module[\"exports\"])\r\n        module[\"exports\"] = factory();\r\n    /* Global */ else\r\n        (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"Long\"] = factory();\r\n\r\n})(this, function() {\r\n    \"use strict\";\r\n\r\n    /**\r\n     * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\r\n     *  See the from* functions below for more convenient ways of constructing Longs.\r\n     * @exports Long\r\n     * @class A Long class for representing a 64 bit two's-complement integer value.\r\n     * @param {number} low The low (signed) 32 bits of the long\r\n     * @param {number} high The high (signed) 32 bits of the long\r\n     * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n     * @constructor\r\n     */\r\n    function Long(low, high, unsigned) {\r\n\r\n        /**\r\n         * The low 32 bits as a signed value.\r\n         * @type {number}\r\n         */\r\n        this.low = low | 0;\r\n\r\n        /**\r\n         * The high 32 bits as a signed value.\r\n         * @type {number}\r\n         */\r\n        this.high = high | 0;\r\n\r\n        /**\r\n         * Whether unsigned or not.\r\n         * @type {boolean}\r\n         */\r\n        this.unsigned = !!unsigned;\r\n    }\r\n\r\n    // The internal representation of a long is the two given signed, 32-bit values.\r\n    // We use 32-bit pieces because these are the size of integers on which\r\n    // Javascript performs bit-operations.  For operations like addition and\r\n    // multiplication, we split each number into 16 bit pieces, which can easily be\r\n    // multiplied within Javascript's floating-point representation without overflow\r\n    // or change in sign.\r\n    //\r\n    // In the algorithms below, we frequently reduce the negative case to the\r\n    // positive case by negating the input(s) and then post-processing the result.\r\n    // Note that we must ALWAYS check specially whether those values are MIN_VALUE\r\n    // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\r\n    // a positive number, it overflows back into a negative).  Not handling this\r\n    // case would often result in infinite recursion.\r\n    //\r\n    // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\r\n    // methods on which they depend.\r\n\r\n    /**\r\n     * An indicator used to reliably determine if an object is a Long or not.\r\n     * @type {boolean}\r\n     * @const\r\n     * @private\r\n     */\r\n    Long.prototype.__isLong__;\r\n\r\n    Object.defineProperty(Long.prototype, \"__isLong__\", {\r\n        value: true,\r\n        enumerable: false,\r\n        configurable: false\r\n    });\r\n\r\n    /**\r\n     * @function\r\n     * @param {*} obj Object\r\n     * @returns {boolean}\r\n     * @inner\r\n     */\r\n    function isLong(obj) {\r\n        return (obj && obj[\"__isLong__\"]) === true;\r\n    }\r\n\r\n    /**\r\n     * Tests if the specified object is a Long.\r\n     * @function\r\n     * @param {*} obj Object\r\n     * @returns {boolean}\r\n     */\r\n    Long.isLong = isLong;\r\n\r\n    /**\r\n     * A cache of the Long representations of small integer values.\r\n     * @type {!Object}\r\n     * @inner\r\n     */\r\n    var INT_CACHE = {};\r\n\r\n    /**\r\n     * A cache of the Long representations of small unsigned integer values.\r\n     * @type {!Object}\r\n     * @inner\r\n     */\r\n    var UINT_CACHE = {};\r\n\r\n    /**\r\n     * @param {number} value\r\n     * @param {boolean=} unsigned\r\n     * @returns {!Long}\r\n     * @inner\r\n     */\r\n    function fromInt(value, unsigned) {\r\n        var obj, cachedObj, cache;\r\n        if (unsigned) {\r\n            value >>>= 0;\r\n            if (cache = (0 <= value && value < 256)) {\r\n                cachedObj = UINT_CACHE[value];\r\n                if (cachedObj)\r\n                    return cachedObj;\r\n            }\r\n            obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\r\n            if (cache)\r\n                UINT_CACHE[value] = obj;\r\n            return obj;\r\n        } else {\r\n            value |= 0;\r\n            if (cache = (-128 <= value && value < 128)) {\r\n                cachedObj = INT_CACHE[value];\r\n                if (cachedObj)\r\n                    return cachedObj;\r\n            }\r\n            obj = fromBits(value, value < 0 ? -1 : 0, false);\r\n            if (cache)\r\n                INT_CACHE[value] = obj;\r\n            return obj;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Returns a Long representing the given 32 bit integer value.\r\n     * @function\r\n     * @param {number} value The 32 bit integer in question\r\n     * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n     * @returns {!Long} The corresponding Long value\r\n     */\r\n    Long.fromInt = fromInt;\r\n\r\n    /**\r\n     * @param {number} value\r\n     * @param {boolean=} unsigned\r\n     * @returns {!Long}\r\n     * @inner\r\n     */\r\n    function fromNumber(value, unsigned) {\r\n        if (isNaN(value) || !isFinite(value))\r\n            return unsigned ? UZERO : ZERO;\r\n        if (unsigned) {\r\n            if (value < 0)\r\n                return UZERO;\r\n            if (value >= TWO_PWR_64_DBL)\r\n                return MAX_UNSIGNED_VALUE;\r\n        } else {\r\n            if (value <= -TWO_PWR_63_DBL)\r\n                return MIN_VALUE;\r\n            if (value + 1 >= TWO_PWR_63_DBL)\r\n                return MAX_VALUE;\r\n        }\r\n        if (value < 0)\r\n            return fromNumber(-value, unsigned).neg();\r\n        return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\r\n    }\r\n\r\n    /**\r\n     * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\r\n     * @function\r\n     * @param {number} value The number in question\r\n     * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n     * @returns {!Long} The corresponding Long value\r\n     */\r\n    Long.fromNumber = fromNumber;\r\n\r\n    /**\r\n     * @param {number} lowBits\r\n     * @param {number} highBits\r\n     * @param {boolean=} unsigned\r\n     * @returns {!Long}\r\n     * @inner\r\n     */\r\n    function fromBits(lowBits, highBits, unsigned) {\r\n        return new Long(lowBits, highBits, unsigned);\r\n    }\r\n\r\n    /**\r\n     * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\r\n     *  assumed to use 32 bits.\r\n     * @function\r\n     * @param {number} lowBits The low 32 bits\r\n     * @param {number} highBits The high 32 bits\r\n     * @param {boolean=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n     * @returns {!Long} The corresponding Long value\r\n     */\r\n    Long.fromBits = fromBits;\r\n\r\n    /**\r\n     * @function\r\n     * @param {number} base\r\n     * @param {number} exponent\r\n     * @returns {number}\r\n     * @inner\r\n     */\r\n    var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\r\n\r\n    /**\r\n     * @param {string} str\r\n     * @param {(boolean|number)=} unsigned\r\n     * @param {number=} radix\r\n     * @returns {!Long}\r\n     * @inner\r\n     */\r\n    function fromString(str, unsigned, radix) {\r\n        if (str.length === 0)\r\n            throw Error('empty string');\r\n        if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\r\n            return ZERO;\r\n        if (typeof unsigned === 'number') {\r\n            // For goog.math.long compatibility\r\n            radix = unsigned,\r\n            unsigned = false;\r\n        } else {\r\n            unsigned = !! unsigned;\r\n        }\r\n        radix = radix || 10;\r\n        if (radix < 2 || 36 < radix)\r\n            throw RangeError('radix');\r\n\r\n        var p;\r\n        if ((p = str.indexOf('-')) > 0)\r\n            throw Error('interior hyphen');\r\n        else if (p === 0) {\r\n            return fromString(str.substring(1), unsigned, radix).neg();\r\n        }\r\n\r\n        // Do several (8) digits each time through the loop, so as to\r\n        // minimize the calls to the very expensive emulated div.\r\n        var radixToPower = fromNumber(pow_dbl(radix, 8));\r\n\r\n        var result = ZERO;\r\n        for (var i = 0; i < str.length; i += 8) {\r\n            var size = Math.min(8, str.length - i),\r\n                value = parseInt(str.substring(i, i + size), radix);\r\n            if (size < 8) {\r\n                var power = fromNumber(pow_dbl(radix, size));\r\n                result = result.mul(power).add(fromNumber(value));\r\n            } else {\r\n                result = result.mul(radixToPower);\r\n                result = result.add(fromNumber(value));\r\n            }\r\n        }\r\n        result.unsigned = unsigned;\r\n        return result;\r\n    }\r\n\r\n    /**\r\n     * Returns a Long representation of the given string, written using the specified radix.\r\n     * @function\r\n     * @param {string} str The textual representation of the Long\r\n     * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to `false` for signed\r\n     * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\r\n     * @returns {!Long} The corresponding Long value\r\n     */\r\n    Long.fromString = fromString;\r\n\r\n    /**\r\n     * @function\r\n     * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\r\n     * @returns {!Long}\r\n     * @inner\r\n     */\r\n    function fromValue(val) {\r\n        if (val /* is compatible */ instanceof Long)\r\n            return val;\r\n        if (typeof val === 'number')\r\n            return fromNumber(val);\r\n        if (typeof val === 'string')\r\n            return fromString(val);\r\n        // Throws for non-objects, converts non-instanceof Long:\r\n        return fromBits(val.low, val.high, val.unsigned);\r\n    }\r\n\r\n    /**\r\n     * Converts the specified value to a Long.\r\n     * @function\r\n     * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\r\n     * @returns {!Long}\r\n     */\r\n    Long.fromValue = fromValue;\r\n\r\n    // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\r\n    // no runtime penalty for these.\r\n\r\n    /**\r\n     * @type {number}\r\n     * @const\r\n     * @inner\r\n     */\r\n    var TWO_PWR_16_DBL = 1 << 16;\r\n\r\n    /**\r\n     * @type {number}\r\n     * @const\r\n     * @inner\r\n     */\r\n    var TWO_PWR_24_DBL = 1 << 24;\r\n\r\n    /**\r\n     * @type {number}\r\n     * @const\r\n     * @inner\r\n     */\r\n    var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\r\n\r\n    /**\r\n     * @type {number}\r\n     * @const\r\n     * @inner\r\n     */\r\n    var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\r\n\r\n    /**\r\n     * @type {number}\r\n     * @const\r\n     * @inner\r\n     */\r\n    var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @const\r\n     * @inner\r\n     */\r\n    var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var ZERO = fromInt(0);\r\n\r\n    /**\r\n     * Signed zero.\r\n     * @type {!Long}\r\n     */\r\n    Long.ZERO = ZERO;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var UZERO = fromInt(0, true);\r\n\r\n    /**\r\n     * Unsigned zero.\r\n     * @type {!Long}\r\n     */\r\n    Long.UZERO = UZERO;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var ONE = fromInt(1);\r\n\r\n    /**\r\n     * Signed one.\r\n     * @type {!Long}\r\n     */\r\n    Long.ONE = ONE;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var UONE = fromInt(1, true);\r\n\r\n    /**\r\n     * Unsigned one.\r\n     * @type {!Long}\r\n     */\r\n    Long.UONE = UONE;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var NEG_ONE = fromInt(-1);\r\n\r\n    /**\r\n     * Signed negative one.\r\n     * @type {!Long}\r\n     */\r\n    Long.NEG_ONE = NEG_ONE;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var MAX_VALUE = fromBits(0xFFFFFFFF|0, 0x7FFFFFFF|0, false);\r\n\r\n    /**\r\n     * Maximum signed value.\r\n     * @type {!Long}\r\n     */\r\n    Long.MAX_VALUE = MAX_VALUE;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF|0, 0xFFFFFFFF|0, true);\r\n\r\n    /**\r\n     * Maximum unsigned value.\r\n     * @type {!Long}\r\n     */\r\n    Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\r\n\r\n    /**\r\n     * @type {!Long}\r\n     * @inner\r\n     */\r\n    var MIN_VALUE = fromBits(0, 0x80000000|0, false);\r\n\r\n    /**\r\n     * Minimum signed value.\r\n     * @type {!Long}\r\n     */\r\n    Long.MIN_VALUE = MIN_VALUE;\r\n\r\n    /**\r\n     * @alias Long.prototype\r\n     * @inner\r\n     */\r\n    var LongPrototype = Long.prototype;\r\n\r\n    /**\r\n     * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\r\n     * @returns {number}\r\n     */\r\n    LongPrototype.toInt = function toInt() {\r\n        return this.unsigned ? this.low >>> 0 : this.low;\r\n    };\r\n\r\n    /**\r\n     * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\r\n     * @returns {number}\r\n     */\r\n    LongPrototype.toNumber = function toNumber() {\r\n        if (this.unsigned)\r\n            return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\r\n        return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\r\n    };\r\n\r\n    /**\r\n     * Converts the Long to a string written in the specified radix.\r\n     * @param {number=} radix Radix (2-36), defaults to 10\r\n     * @returns {string}\r\n     * @override\r\n     * @throws {RangeError} If `radix` is out of range\r\n     */\r\n    LongPrototype.toString = function toString(radix) {\r\n        radix = radix || 10;\r\n        if (radix < 2 || 36 < radix)\r\n            throw RangeError('radix');\r\n        if (this.isZero())\r\n            return '0';\r\n        if (this.isNegative()) { // Unsigned Longs are never negative\r\n            if (this.eq(MIN_VALUE)) {\r\n                // We need to change the Long value before it can be negated, so we remove\r\n                // the bottom-most digit in this base and then recurse to do the rest.\r\n                var radixLong = fromNumber(radix),\r\n                    div = this.div(radixLong),\r\n                    rem1 = div.mul(radixLong).sub(this);\r\n                return div.toString(radix) + rem1.toInt().toString(radix);\r\n            } else\r\n                return '-' + this.neg().toString(radix);\r\n        }\r\n\r\n        // Do several (6) digits each time through the loop, so as to\r\n        // minimize the calls to the very expensive emulated div.\r\n        var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\r\n            rem = this;\r\n        var result = '';\r\n        while (true) {\r\n            var remDiv = rem.div(radixToPower),\r\n                intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\r\n                digits = intval.toString(radix);\r\n            rem = remDiv;\r\n            if (rem.isZero())\r\n                return digits + result;\r\n            else {\r\n                while (digits.length < 6)\r\n                    digits = '0' + digits;\r\n                result = '' + digits + result;\r\n            }\r\n        }\r\n    };\r\n\r\n    /**\r\n     * Gets the high 32 bits as a signed integer.\r\n     * @returns {number} Signed high bits\r\n     */\r\n    LongPrototype.getHighBits = function getHighBits() {\r\n        return this.high;\r\n    };\r\n\r\n    /**\r\n     * Gets the high 32 bits as an unsigned integer.\r\n     * @returns {number} Unsigned high bits\r\n     */\r\n    LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\r\n        return this.high >>> 0;\r\n    };\r\n\r\n    /**\r\n     * Gets the low 32 bits as a signed integer.\r\n     * @returns {number} Signed low bits\r\n     */\r\n    LongPrototype.getLowBits = function getLowBits() {\r\n        return this.low;\r\n    };\r\n\r\n    /**\r\n     * Gets the low 32 bits as an unsigned integer.\r\n     * @returns {number} Unsigned low bits\r\n     */\r\n    LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\r\n        return this.low >>> 0;\r\n    };\r\n\r\n    /**\r\n     * Gets the number of bits needed to represent the absolute value of this Long.\r\n     * @returns {number}\r\n     */\r\n    LongPrototype.getNumBitsAbs = function getNumBitsAbs() {\r\n        if (this.isNegative()) // Unsigned Longs are never negative\r\n            return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\r\n        var val = this.high != 0 ? this.high : this.low;\r\n        for (var bit = 31; bit > 0; bit--)\r\n            if ((val & (1 << bit)) != 0)\r\n                break;\r\n        return this.high != 0 ? bit + 33 : bit + 1;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value equals zero.\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.isZero = function isZero() {\r\n        return this.high === 0 && this.low === 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is negative.\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.isNegative = function isNegative() {\r\n        return !this.unsigned && this.high < 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is positive.\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.isPositive = function isPositive() {\r\n        return this.unsigned || this.high >= 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is odd.\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.isOdd = function isOdd() {\r\n        return (this.low & 1) === 1;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is even.\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.isEven = function isEven() {\r\n        return (this.low & 1) === 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value equals the specified's.\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.equals = function equals(other) {\r\n        if (!isLong(other))\r\n            other = fromValue(other);\r\n        if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\r\n            return false;\r\n        return this.high === other.high && this.low === other.low;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\r\n     * @function\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.eq = LongPrototype.equals;\r\n\r\n    /**\r\n     * Tests if this Long's value differs from the specified's.\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.notEquals = function notEquals(other) {\r\n        return !this.eq(/* validates */ other);\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\r\n     * @function\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.neq = LongPrototype.notEquals;\r\n\r\n    /**\r\n     * Tests if this Long's value is less than the specified's.\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.lessThan = function lessThan(other) {\r\n        return this.comp(/* validates */ other) < 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\r\n     * @function\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.lt = LongPrototype.lessThan;\r\n\r\n    /**\r\n     * Tests if this Long's value is less than or equal the specified's.\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\r\n        return this.comp(/* validates */ other) <= 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\r\n     * @function\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.lte = LongPrototype.lessThanOrEqual;\r\n\r\n    /**\r\n     * Tests if this Long's value is greater than the specified's.\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.greaterThan = function greaterThan(other) {\r\n        return this.comp(/* validates */ other) > 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\r\n     * @function\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.gt = LongPrototype.greaterThan;\r\n\r\n    /**\r\n     * Tests if this Long's value is greater than or equal the specified's.\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\r\n        return this.comp(/* validates */ other) >= 0;\r\n    };\r\n\r\n    /**\r\n     * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\r\n     * @function\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {boolean}\r\n     */\r\n    LongPrototype.gte = LongPrototype.greaterThanOrEqual;\r\n\r\n    /**\r\n     * Compares this Long's value with the specified's.\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n     *  if the given one is greater\r\n     */\r\n    LongPrototype.compare = function compare(other) {\r\n        if (!isLong(other))\r\n            other = fromValue(other);\r\n        if (this.eq(other))\r\n            return 0;\r\n        var thisNeg = this.isNegative(),\r\n            otherNeg = other.isNegative();\r\n        if (thisNeg && !otherNeg)\r\n            return -1;\r\n        if (!thisNeg && otherNeg)\r\n            return 1;\r\n        // At this point the sign bits are the same\r\n        if (!this.unsigned)\r\n            return this.sub(other).isNegative() ? -1 : 1;\r\n        // Both are positive if at least one is unsigned\r\n        return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\r\n    };\r\n\r\n    /**\r\n     * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\r\n     * @function\r\n     * @param {!Long|number|string} other Other value\r\n     * @returns {number} 0 if they are the same, 1 if the this is greater and -1\r\n     *  if the given one is greater\r\n     */\r\n    LongPrototype.comp = LongPrototype.compare;\r\n\r\n    /**\r\n     * Negates this Long's value.\r\n     * @returns {!Long} Negated Long\r\n     */\r\n    LongPrototype.negate = function negate() {\r\n        if (!this.unsigned && this.eq(MIN_VALUE))\r\n            return MIN_VALUE;\r\n        return this.not().add(ONE);\r\n    };\r\n\r\n    /**\r\n     * Negates this Long's value. This is an alias of {@link Long#negate}.\r\n     * @function\r\n     * @returns {!Long} Negated Long\r\n     */\r\n    LongPrototype.neg = LongPrototype.negate;\r\n\r\n    /**\r\n     * Returns the sum of this and the specified Long.\r\n     * @param {!Long|number|string} addend Addend\r\n     * @returns {!Long} Sum\r\n     */\r\n    LongPrototype.add = function add(addend) {\r\n        if (!isLong(addend))\r\n            addend = fromValue(addend);\r\n\r\n        // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\r\n\r\n        var a48 = this.high >>> 16;\r\n        var a32 = this.high & 0xFFFF;\r\n        var a16 = this.low >>> 16;\r\n        var a00 = this.low & 0xFFFF;\r\n\r\n        var b48 = addend.high >>> 16;\r\n        var b32 = addend.high & 0xFFFF;\r\n        var b16 = addend.low >>> 16;\r\n        var b00 = addend.low & 0xFFFF;\r\n\r\n        var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n        c00 += a00 + b00;\r\n        c16 += c00 >>> 16;\r\n        c00 &= 0xFFFF;\r\n        c16 += a16 + b16;\r\n        c32 += c16 >>> 16;\r\n        c16 &= 0xFFFF;\r\n        c32 += a32 + b32;\r\n        c48 += c32 >>> 16;\r\n        c32 &= 0xFFFF;\r\n        c48 += a48 + b48;\r\n        c48 &= 0xFFFF;\r\n        return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns the difference of this and the specified Long.\r\n     * @param {!Long|number|string} subtrahend Subtrahend\r\n     * @returns {!Long} Difference\r\n     */\r\n    LongPrototype.subtract = function subtract(subtrahend) {\r\n        if (!isLong(subtrahend))\r\n            subtrahend = fromValue(subtrahend);\r\n        return this.add(subtrahend.neg());\r\n    };\r\n\r\n    /**\r\n     * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\r\n     * @function\r\n     * @param {!Long|number|string} subtrahend Subtrahend\r\n     * @returns {!Long} Difference\r\n     */\r\n    LongPrototype.sub = LongPrototype.subtract;\r\n\r\n    /**\r\n     * Returns the product of this and the specified Long.\r\n     * @param {!Long|number|string} multiplier Multiplier\r\n     * @returns {!Long} Product\r\n     */\r\n    LongPrototype.multiply = function multiply(multiplier) {\r\n        if (this.isZero())\r\n            return ZERO;\r\n        if (!isLong(multiplier))\r\n            multiplier = fromValue(multiplier);\r\n        if (multiplier.isZero())\r\n            return ZERO;\r\n        if (this.eq(MIN_VALUE))\r\n            return multiplier.isOdd() ? MIN_VALUE : ZERO;\r\n        if (multiplier.eq(MIN_VALUE))\r\n            return this.isOdd() ? MIN_VALUE : ZERO;\r\n\r\n        if (this.isNegative()) {\r\n            if (multiplier.isNegative())\r\n                return this.neg().mul(multiplier.neg());\r\n            else\r\n                return this.neg().mul(multiplier).neg();\r\n        } else if (multiplier.isNegative())\r\n            return this.mul(multiplier.neg()).neg();\r\n\r\n        // If both longs are small, use float multiplication\r\n        if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\r\n            return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\r\n\r\n        // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\r\n        // We can skip products that would overflow.\r\n\r\n        var a48 = this.high >>> 16;\r\n        var a32 = this.high & 0xFFFF;\r\n        var a16 = this.low >>> 16;\r\n        var a00 = this.low & 0xFFFF;\r\n\r\n        var b48 = multiplier.high >>> 16;\r\n        var b32 = multiplier.high & 0xFFFF;\r\n        var b16 = multiplier.low >>> 16;\r\n        var b00 = multiplier.low & 0xFFFF;\r\n\r\n        var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\r\n        c00 += a00 * b00;\r\n        c16 += c00 >>> 16;\r\n        c00 &= 0xFFFF;\r\n        c16 += a16 * b00;\r\n        c32 += c16 >>> 16;\r\n        c16 &= 0xFFFF;\r\n        c16 += a00 * b16;\r\n        c32 += c16 >>> 16;\r\n        c16 &= 0xFFFF;\r\n        c32 += a32 * b00;\r\n        c48 += c32 >>> 16;\r\n        c32 &= 0xFFFF;\r\n        c32 += a16 * b16;\r\n        c48 += c32 >>> 16;\r\n        c32 &= 0xFFFF;\r\n        c32 += a00 * b32;\r\n        c48 += c32 >>> 16;\r\n        c32 &= 0xFFFF;\r\n        c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\r\n        c48 &= 0xFFFF;\r\n        return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\r\n     * @function\r\n     * @param {!Long|number|string} multiplier Multiplier\r\n     * @returns {!Long} Product\r\n     */\r\n    LongPrototype.mul = LongPrototype.multiply;\r\n\r\n    /**\r\n     * Returns this Long divided by the specified. The result is signed if this Long is signed or\r\n     *  unsigned if this Long is unsigned.\r\n     * @param {!Long|number|string} divisor Divisor\r\n     * @returns {!Long} Quotient\r\n     */\r\n    LongPrototype.divide = function divide(divisor) {\r\n        if (!isLong(divisor))\r\n            divisor = fromValue(divisor);\r\n        if (divisor.isZero())\r\n            throw Error('division by zero');\r\n        if (this.isZero())\r\n            return this.unsigned ? UZERO : ZERO;\r\n        var approx, rem, res;\r\n        if (!this.unsigned) {\r\n            // This section is only relevant for signed longs and is derived from the\r\n            // closure library as a whole.\r\n            if (this.eq(MIN_VALUE)) {\r\n                if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\r\n                    return MIN_VALUE;  // recall that -MIN_VALUE == MIN_VALUE\r\n                else if (divisor.eq(MIN_VALUE))\r\n                    return ONE;\r\n                else {\r\n                    // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\r\n                    var halfThis = this.shr(1);\r\n                    approx = halfThis.div(divisor).shl(1);\r\n                    if (approx.eq(ZERO)) {\r\n                        return divisor.isNegative() ? ONE : NEG_ONE;\r\n                    } else {\r\n                        rem = this.sub(divisor.mul(approx));\r\n                        res = approx.add(rem.div(divisor));\r\n                        return res;\r\n                    }\r\n                }\r\n            } else if (divisor.eq(MIN_VALUE))\r\n                return this.unsigned ? UZERO : ZERO;\r\n            if (this.isNegative()) {\r\n                if (divisor.isNegative())\r\n                    return this.neg().div(divisor.neg());\r\n                return this.neg().div(divisor).neg();\r\n            } else if (divisor.isNegative())\r\n                return this.div(divisor.neg()).neg();\r\n            res = ZERO;\r\n        } else {\r\n            // The algorithm below has not been made for unsigned longs. It's therefore\r\n            // required to take special care of the MSB prior to running it.\r\n            if (!divisor.unsigned)\r\n                divisor = divisor.toUnsigned();\r\n            if (divisor.gt(this))\r\n                return UZERO;\r\n            if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\r\n                return UONE;\r\n            res = UZERO;\r\n        }\r\n\r\n        // Repeat the following until the remainder is less than other:  find a\r\n        // floating-point that approximates remainder / other *from below*, add this\r\n        // into the result, and subtract it from the remainder.  It is critical that\r\n        // the approximate value is less than or equal to the real value so that the\r\n        // remainder never becomes negative.\r\n        rem = this;\r\n        while (rem.gte(divisor)) {\r\n            // Approximate the result of division. This may be a little greater or\r\n            // smaller than the actual value.\r\n            approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\r\n\r\n            // We will tweak the approximate result by changing it in the 48-th digit or\r\n            // the smallest non-fractional digit, whichever is larger.\r\n            var log2 = Math.ceil(Math.log(approx) / Math.LN2),\r\n                delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\r\n\r\n            // Decrease the approximation until it is smaller than the remainder.  Note\r\n            // that if it is too large, the product overflows and is negative.\r\n                approxRes = fromNumber(approx),\r\n                approxRem = approxRes.mul(divisor);\r\n            while (approxRem.isNegative() || approxRem.gt(rem)) {\r\n                approx -= delta;\r\n                approxRes = fromNumber(approx, this.unsigned);\r\n                approxRem = approxRes.mul(divisor);\r\n            }\r\n\r\n            // We know the answer can't be zero... and actually, zero would cause\r\n            // infinite recursion since we would make no progress.\r\n            if (approxRes.isZero())\r\n                approxRes = ONE;\r\n\r\n            res = res.add(approxRes);\r\n            rem = rem.sub(approxRem);\r\n        }\r\n        return res;\r\n    };\r\n\r\n    /**\r\n     * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\r\n     * @function\r\n     * @param {!Long|number|string} divisor Divisor\r\n     * @returns {!Long} Quotient\r\n     */\r\n    LongPrototype.div = LongPrototype.divide;\r\n\r\n    /**\r\n     * Returns this Long modulo the specified.\r\n     * @param {!Long|number|string} divisor Divisor\r\n     * @returns {!Long} Remainder\r\n     */\r\n    LongPrototype.modulo = function modulo(divisor) {\r\n        if (!isLong(divisor))\r\n            divisor = fromValue(divisor);\r\n        return this.sub(this.div(divisor).mul(divisor));\r\n    };\r\n\r\n    /**\r\n     * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\r\n     * @function\r\n     * @param {!Long|number|string} divisor Divisor\r\n     * @returns {!Long} Remainder\r\n     */\r\n    LongPrototype.mod = LongPrototype.modulo;\r\n\r\n    /**\r\n     * Returns the bitwise NOT of this Long.\r\n     * @returns {!Long}\r\n     */\r\n    LongPrototype.not = function not() {\r\n        return fromBits(~this.low, ~this.high, this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns the bitwise AND of this Long and the specified.\r\n     * @param {!Long|number|string} other Other Long\r\n     * @returns {!Long}\r\n     */\r\n    LongPrototype.and = function and(other) {\r\n        if (!isLong(other))\r\n            other = fromValue(other);\r\n        return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns the bitwise OR of this Long and the specified.\r\n     * @param {!Long|number|string} other Other Long\r\n     * @returns {!Long}\r\n     */\r\n    LongPrototype.or = function or(other) {\r\n        if (!isLong(other))\r\n            other = fromValue(other);\r\n        return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns the bitwise XOR of this Long and the given one.\r\n     * @param {!Long|number|string} other Other Long\r\n     * @returns {!Long}\r\n     */\r\n    LongPrototype.xor = function xor(other) {\r\n        if (!isLong(other))\r\n            other = fromValue(other);\r\n        return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns this Long with bits shifted to the left by the given amount.\r\n     * @param {number|!Long} numBits Number of bits\r\n     * @returns {!Long} Shifted Long\r\n     */\r\n    LongPrototype.shiftLeft = function shiftLeft(numBits) {\r\n        if (isLong(numBits))\r\n            numBits = numBits.toInt();\r\n        if ((numBits &= 63) === 0)\r\n            return this;\r\n        else if (numBits < 32)\r\n            return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\r\n        else\r\n            return fromBits(0, this.low << (numBits - 32), this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\r\n     * @function\r\n     * @param {number|!Long} numBits Number of bits\r\n     * @returns {!Long} Shifted Long\r\n     */\r\n    LongPrototype.shl = LongPrototype.shiftLeft;\r\n\r\n    /**\r\n     * Returns this Long with bits arithmetically shifted to the right by the given amount.\r\n     * @param {number|!Long} numBits Number of bits\r\n     * @returns {!Long} Shifted Long\r\n     */\r\n    LongPrototype.shiftRight = function shiftRight(numBits) {\r\n        if (isLong(numBits))\r\n            numBits = numBits.toInt();\r\n        if ((numBits &= 63) === 0)\r\n            return this;\r\n        else if (numBits < 32)\r\n            return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\r\n        else\r\n            return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\r\n    };\r\n\r\n    /**\r\n     * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\r\n     * @function\r\n     * @param {number|!Long} numBits Number of bits\r\n     * @returns {!Long} Shifted Long\r\n     */\r\n    LongPrototype.shr = LongPrototype.shiftRight;\r\n\r\n    /**\r\n     * Returns this Long with bits logically shifted to the right by the given amount.\r\n     * @param {number|!Long} numBits Number of bits\r\n     * @returns {!Long} Shifted Long\r\n     */\r\n    LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\r\n        if (isLong(numBits))\r\n            numBits = numBits.toInt();\r\n        numBits &= 63;\r\n        if (numBits === 0)\r\n            return this;\r\n        else {\r\n            var high = this.high;\r\n            if (numBits < 32) {\r\n                var low = this.low;\r\n                return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);\r\n            } else if (numBits === 32)\r\n                return fromBits(high, 0, this.unsigned);\r\n            else\r\n                return fromBits(high >>> (numBits - 32), 0, this.unsigned);\r\n        }\r\n    };\r\n\r\n    /**\r\n     * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\r\n     * @function\r\n     * @param {number|!Long} numBits Number of bits\r\n     * @returns {!Long} Shifted Long\r\n     */\r\n    LongPrototype.shru = LongPrototype.shiftRightUnsigned;\r\n\r\n    /**\r\n     * Converts this Long to signed.\r\n     * @returns {!Long} Signed long\r\n     */\r\n    LongPrototype.toSigned = function toSigned() {\r\n        if (!this.unsigned)\r\n            return this;\r\n        return fromBits(this.low, this.high, false);\r\n    };\r\n\r\n    /**\r\n     * Converts this Long to unsigned.\r\n     * @returns {!Long} Unsigned long\r\n     */\r\n    LongPrototype.toUnsigned = function toUnsigned() {\r\n        if (this.unsigned)\r\n            return this;\r\n        return fromBits(this.low, this.high, true);\r\n    };\r\n\r\n    /**\r\n     * Converts this Long to its byte representation.\r\n     * @param {boolean=} le Whether little or big endian, defaults to big endian\r\n     * @returns {!Array.} Byte representation\r\n     */\r\n    LongPrototype.toBytes = function(le) {\r\n        return le ? this.toBytesLE() : this.toBytesBE();\r\n    }\r\n\r\n    /**\r\n     * Converts this Long to its little endian byte representation.\r\n     * @returns {!Array.} Little endian byte representation\r\n     */\r\n    LongPrototype.toBytesLE = function() {\r\n        var hi = this.high,\r\n            lo = this.low;\r\n        return [\r\n             lo         & 0xff,\r\n            (lo >>>  8) & 0xff,\r\n            (lo >>> 16) & 0xff,\r\n            (lo >>> 24) & 0xff,\r\n             hi         & 0xff,\r\n            (hi >>>  8) & 0xff,\r\n            (hi >>> 16) & 0xff,\r\n            (hi >>> 24) & 0xff\r\n        ];\r\n    }\r\n\r\n    /**\r\n     * Converts this Long to its big endian byte representation.\r\n     * @returns {!Array.} Big endian byte representation\r\n     */\r\n    LongPrototype.toBytesBE = function() {\r\n        var hi = this.high,\r\n            lo = this.low;\r\n        return [\r\n            (hi >>> 24) & 0xff,\r\n            (hi >>> 16) & 0xff,\r\n            (hi >>>  8) & 0xff,\r\n             hi         & 0xff,\r\n            (lo >>> 24) & 0xff,\r\n            (lo >>> 16) & 0xff,\r\n            (lo >>>  8) & 0xff,\r\n             lo         & 0xff\r\n        ];\r\n    }\r\n\r\n    return Long;\r\n});\r\n","/*\r\n Copyright 2013-2014 Daniel Wirtz \r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license bytebuffer.js (c) 2015 Daniel Wirtz \r\n * Backing buffer: ArrayBuffer, Accessor: Uint8Array\r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/bytebuffer.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n    /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n        define([\"long\"], factory);\r\n    /* CommonJS */ else if (typeof require === 'function' && typeof module === \"object\" && module && module[\"exports\"])\r\n        module['exports'] = (function() {\r\n            var Long; try { Long = require(\"long\"); } catch (e) {}\r\n            return factory(Long);\r\n        })();\r\n    /* Global */ else\r\n        (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"ByteBuffer\"] = factory(global[\"dcodeIO\"][\"Long\"]);\r\n\r\n})(this, function(Long) {\r\n    \"use strict\";\r\n\r\n    /**\r\n     * Constructs a new ByteBuffer.\r\n     * @class The swiss army knife for binary data in JavaScript.\r\n     * @exports ByteBuffer\r\n     * @constructor\r\n     * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n     * @expose\r\n     */\r\n    var ByteBuffer = function(capacity, littleEndian, noAssert) {\r\n        if (typeof capacity === 'undefined')\r\n            capacity = ByteBuffer.DEFAULT_CAPACITY;\r\n        if (typeof littleEndian === 'undefined')\r\n            littleEndian = ByteBuffer.DEFAULT_ENDIAN;\r\n        if (typeof noAssert === 'undefined')\r\n            noAssert = ByteBuffer.DEFAULT_NOASSERT;\r\n        if (!noAssert) {\r\n            capacity = capacity | 0;\r\n            if (capacity < 0)\r\n                throw RangeError(\"Illegal capacity\");\r\n            littleEndian = !!littleEndian;\r\n            noAssert = !!noAssert;\r\n        }\r\n\r\n        /**\r\n         * Backing ArrayBuffer.\r\n         * @type {!ArrayBuffer}\r\n         * @expose\r\n         */\r\n        this.buffer = capacity === 0 ? EMPTY_BUFFER : new ArrayBuffer(capacity);\r\n\r\n        /**\r\n         * Uint8Array utilized to manipulate the backing buffer. Becomes `null` if the backing buffer has a capacity of `0`.\r\n         * @type {?Uint8Array}\r\n         * @expose\r\n         */\r\n        this.view = capacity === 0 ? null : new Uint8Array(this.buffer);\r\n\r\n        /**\r\n         * Absolute read/write offset.\r\n         * @type {number}\r\n         * @expose\r\n         * @see ByteBuffer#flip\r\n         * @see ByteBuffer#clear\r\n         */\r\n        this.offset = 0;\r\n\r\n        /**\r\n         * Marked offset.\r\n         * @type {number}\r\n         * @expose\r\n         * @see ByteBuffer#mark\r\n         * @see ByteBuffer#reset\r\n         */\r\n        this.markedOffset = -1;\r\n\r\n        /**\r\n         * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.\r\n         * @type {number}\r\n         * @expose\r\n         * @see ByteBuffer#flip\r\n         * @see ByteBuffer#clear\r\n         */\r\n        this.limit = capacity;\r\n\r\n        /**\r\n         * Whether to use little endian byte order, defaults to `false` for big endian.\r\n         * @type {boolean}\r\n         * @expose\r\n         */\r\n        this.littleEndian = littleEndian;\r\n\r\n        /**\r\n         * Whether to skip assertions of offsets and values, defaults to `false`.\r\n         * @type {boolean}\r\n         * @expose\r\n         */\r\n        this.noAssert = noAssert;\r\n    };\r\n\r\n    /**\r\n     * ByteBuffer version.\r\n     * @type {string}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ByteBuffer.VERSION = \"5.0.1\";\r\n\r\n    /**\r\n     * Little endian constant that can be used instead of its boolean value. Evaluates to `true`.\r\n     * @type {boolean}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ByteBuffer.LITTLE_ENDIAN = true;\r\n\r\n    /**\r\n     * Big endian constant that can be used instead of its boolean value. Evaluates to `false`.\r\n     * @type {boolean}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ByteBuffer.BIG_ENDIAN = false;\r\n\r\n    /**\r\n     * Default initial capacity of `16`.\r\n     * @type {number}\r\n     * @expose\r\n     */\r\n    ByteBuffer.DEFAULT_CAPACITY = 16;\r\n\r\n    /**\r\n     * Default endianess of `false` for big endian.\r\n     * @type {boolean}\r\n     * @expose\r\n     */\r\n    ByteBuffer.DEFAULT_ENDIAN = ByteBuffer.BIG_ENDIAN;\r\n\r\n    /**\r\n     * Default no assertions flag of `false`.\r\n     * @type {boolean}\r\n     * @expose\r\n     */\r\n    ByteBuffer.DEFAULT_NOASSERT = false;\r\n\r\n    /**\r\n     * A `Long` class for representing a 64-bit two's-complement integer value. May be `null` if Long.js has not been loaded\r\n     *  and int64 support is not available.\r\n     * @type {?Long}\r\n     * @const\r\n     * @see https://github.com/dcodeIO/long.js\r\n     * @expose\r\n     */\r\n    ByteBuffer.Long = Long || null;\r\n\r\n    /**\r\n     * @alias ByteBuffer.prototype\r\n     * @inner\r\n     */\r\n    var ByteBufferPrototype = ByteBuffer.prototype;\r\n\r\n    /**\r\n     * An indicator used to reliably determine if an object is a ByteBuffer or not.\r\n     * @type {boolean}\r\n     * @const\r\n     * @expose\r\n     * @private\r\n     */\r\n    ByteBufferPrototype.__isByteBuffer__;\r\n\r\n    Object.defineProperty(ByteBufferPrototype, \"__isByteBuffer__\", {\r\n        value: true,\r\n        enumerable: false,\r\n        configurable: false\r\n    });\r\n\r\n    // helpers\r\n\r\n    /**\r\n     * @type {!ArrayBuffer}\r\n     * @inner\r\n     */\r\n    var EMPTY_BUFFER = new ArrayBuffer(0);\r\n\r\n    /**\r\n     * String.fromCharCode reference for compile-time renaming.\r\n     * @type {function(...number):string}\r\n     * @inner\r\n     */\r\n    var stringFromCharCode = String.fromCharCode;\r\n\r\n    /**\r\n     * Creates a source function for a string.\r\n     * @param {string} s String to read from\r\n     * @returns {function():number|null} Source function returning the next char code respectively `null` if there are\r\n     *  no more characters left.\r\n     * @throws {TypeError} If the argument is invalid\r\n     * @inner\r\n     */\r\n    function stringSource(s) {\r\n        var i=0; return function() {\r\n            return i < s.length ? s.charCodeAt(i++) : null;\r\n        };\r\n    }\r\n\r\n    /**\r\n     * Creates a destination function for a string.\r\n     * @returns {function(number=):undefined|string} Destination function successively called with the next char code.\r\n     *  Returns the final string when called without arguments.\r\n     * @inner\r\n     */\r\n    function stringDestination() {\r\n        var cs = [], ps = []; return function() {\r\n            if (arguments.length === 0)\r\n                return ps.join('')+stringFromCharCode.apply(String, cs);\r\n            if (cs.length + arguments.length > 1024)\r\n                ps.push(stringFromCharCode.apply(String, cs)),\r\n                    cs.length = 0;\r\n            Array.prototype.push.apply(cs, arguments);\r\n        };\r\n    }\r\n\r\n    /**\r\n     * Gets the accessor type.\r\n     * @returns {Function} `Buffer` under node.js, `Uint8Array` respectively `DataView` in the browser (classes)\r\n     * @expose\r\n     */\r\n    ByteBuffer.accessor = function() {\r\n        return Uint8Array;\r\n    };\r\n    /**\r\n     * Allocates a new ByteBuffer backed by a buffer of the specified capacity.\r\n     * @param {number=} capacity Initial capacity. Defaults to {@link ByteBuffer.DEFAULT_CAPACITY}.\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n     * @returns {!ByteBuffer}\r\n     * @expose\r\n     */\r\n    ByteBuffer.allocate = function(capacity, littleEndian, noAssert) {\r\n        return new ByteBuffer(capacity, littleEndian, noAssert);\r\n    };\r\n\r\n    /**\r\n     * Concatenates multiple ByteBuffers into one.\r\n     * @param {!Array.} buffers Buffers to concatenate\r\n     * @param {(string|boolean)=} encoding String encoding if `buffers` contains a string (\"base64\", \"hex\", \"binary\",\r\n     *  defaults to \"utf8\")\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order for the resulting ByteBuffer. Defaults\r\n     *  to {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @param {boolean=} noAssert Whether to skip assertions of offsets and values for the resulting ByteBuffer. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n     * @returns {!ByteBuffer} Concatenated ByteBuffer\r\n     * @expose\r\n     */\r\n    ByteBuffer.concat = function(buffers, encoding, littleEndian, noAssert) {\r\n        if (typeof encoding === 'boolean' || typeof encoding !== 'string') {\r\n            noAssert = littleEndian;\r\n            littleEndian = encoding;\r\n            encoding = undefined;\r\n        }\r\n        var capacity = 0;\r\n        for (var i=0, k=buffers.length, length; i 0) capacity += length;\r\n        }\r\n        if (capacity === 0)\r\n            return new ByteBuffer(0, littleEndian, noAssert);\r\n        var bb = new ByteBuffer(capacity, littleEndian, noAssert),\r\n            bi;\r\n        i=0; while (i} buffer Anything that can be wrapped\r\n     * @param {(string|boolean)=} encoding String encoding if `buffer` is a string (\"base64\", \"hex\", \"binary\", defaults to\r\n     *  \"utf8\")\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n     * @returns {!ByteBuffer} A ByteBuffer wrapping `buffer`\r\n     * @expose\r\n     */\r\n    ByteBuffer.wrap = function(buffer, encoding, littleEndian, noAssert) {\r\n        if (typeof encoding !== 'string') {\r\n            noAssert = littleEndian;\r\n            littleEndian = encoding;\r\n            encoding = undefined;\r\n        }\r\n        if (typeof buffer === 'string') {\r\n            if (typeof encoding === 'undefined')\r\n                encoding = \"utf8\";\r\n            switch (encoding) {\r\n                case \"base64\":\r\n                    return ByteBuffer.fromBase64(buffer, littleEndian);\r\n                case \"hex\":\r\n                    return ByteBuffer.fromHex(buffer, littleEndian);\r\n                case \"binary\":\r\n                    return ByteBuffer.fromBinary(buffer, littleEndian);\r\n                case \"utf8\":\r\n                    return ByteBuffer.fromUTF8(buffer, littleEndian);\r\n                case \"debug\":\r\n                    return ByteBuffer.fromDebug(buffer, littleEndian);\r\n                default:\r\n                    throw Error(\"Unsupported encoding: \"+encoding);\r\n            }\r\n        }\r\n        if (buffer === null || typeof buffer !== 'object')\r\n            throw TypeError(\"Illegal buffer\");\r\n        var bb;\r\n        if (ByteBuffer.isByteBuffer(buffer)) {\r\n            bb = ByteBufferPrototype.clone.call(buffer);\r\n            bb.markedOffset = -1;\r\n            return bb;\r\n        }\r\n        if (buffer instanceof Uint8Array) { // Extract ArrayBuffer from Uint8Array\r\n            bb = new ByteBuffer(0, littleEndian, noAssert);\r\n            if (buffer.length > 0) { // Avoid references to more than one EMPTY_BUFFER\r\n                bb.buffer = buffer.buffer;\r\n                bb.offset = buffer.byteOffset;\r\n                bb.limit = buffer.byteOffset + buffer.byteLength;\r\n                bb.view = new Uint8Array(buffer.buffer);\r\n            }\r\n        } else if (buffer instanceof ArrayBuffer) { // Reuse ArrayBuffer\r\n            bb = new ByteBuffer(0, littleEndian, noAssert);\r\n            if (buffer.byteLength > 0) {\r\n                bb.buffer = buffer;\r\n                bb.offset = 0;\r\n                bb.limit = buffer.byteLength;\r\n                bb.view = buffer.byteLength > 0 ? new Uint8Array(buffer) : null;\r\n            }\r\n        } else if (Object.prototype.toString.call(buffer) === \"[object Array]\") { // Create from octets\r\n            bb = new ByteBuffer(buffer.length, littleEndian, noAssert);\r\n            bb.limit = buffer.length;\r\n            for (var i=0; i} value Array of booleans to write\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n     * @returns {!ByteBuffer}\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeBitSet = function(value, offset) {\r\n      var relative = typeof offset === 'undefined';\n      if (relative) offset = this.offset;\n      if (!this.noAssert) {\r\n        if (!(value instanceof Array))\r\n          throw TypeError(\"Illegal BitSet: Not an array\");\r\n        if (typeof offset !== 'number' || offset % 1 !== 0)\n            throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n        offset >>>= 0;\n        if (offset < 0 || offset + 0 > this.buffer.byteLength)\n            throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n      }\r\n\r\n      var start = offset,\r\n          bits = value.length,\r\n          bytes = (bits >> 3),\r\n          bit = 0,\r\n          k;\r\n\r\n      offset += this.writeVarint32(bits,offset);\r\n\r\n      while(bytes--) {\r\n        k = (!!value[bit++] & 1) |\r\n            ((!!value[bit++] & 1) << 1) |\r\n            ((!!value[bit++] & 1) << 2) |\r\n            ((!!value[bit++] & 1) << 3) |\r\n            ((!!value[bit++] & 1) << 4) |\r\n            ((!!value[bit++] & 1) << 5) |\r\n            ((!!value[bit++] & 1) << 6) |\r\n            ((!!value[bit++] & 1) << 7);\r\n        this.writeByte(k,offset++);\r\n      }\r\n\r\n      if(bit < bits) {\r\n        var m = 0; k = 0;\r\n        while(bit < bits) k = k | ((!!value[bit++] & 1) << (m++));\r\n        this.writeByte(k,offset++);\r\n      }\r\n\r\n      if (relative) {\r\n        this.offset = offset;\r\n        return this;\r\n      }\r\n      return offset - start;\r\n    }\r\n\r\n    /**\r\n     * Reads a BitSet as an array of booleans.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n     * @returns {Array\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readBitSet = function(offset) {\r\n      var relative = typeof offset === 'undefined';\n      if (relative) offset = this.offset;\n\r\n      var ret = this.readVarint32(offset),\r\n          bits = ret.value,\r\n          bytes = (bits >> 3),\r\n          bit = 0,\r\n          value = [],\r\n          k;\r\n\r\n      offset += ret.length;\r\n\r\n      while(bytes--) {\r\n        k = this.readByte(offset++);\r\n        value[bit++] = !!(k & 0x01);\r\n        value[bit++] = !!(k & 0x02);\r\n        value[bit++] = !!(k & 0x04);\r\n        value[bit++] = !!(k & 0x08);\r\n        value[bit++] = !!(k & 0x10);\r\n        value[bit++] = !!(k & 0x20);\r\n        value[bit++] = !!(k & 0x40);\r\n        value[bit++] = !!(k & 0x80);\r\n      }\r\n\r\n      if(bit < bits) {\r\n        var m = 0;\r\n        k = this.readByte(offset++);\r\n        while(bit < bits) value[bit++] = !!((k >> (m++)) & 1);\r\n      }\r\n\r\n      if (relative) {\r\n        this.offset = offset;\r\n      }\r\n      return value;\r\n    }\r\n    /**\r\n     * Reads the specified number of bytes.\r\n     * @param {number} length Number of bytes to read\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `length` if omitted.\r\n     * @returns {!ByteBuffer}\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readBytes = function(length, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + length > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+length+\") <= \"+this.buffer.byteLength);\n        }\r\n        var slice = this.slice(offset, offset + length);\r\n        if (relative) this.offset += length;\n        return slice;\r\n    };\r\n\r\n    /**\r\n     * Writes a payload of bytes. This is an alias of {@link ByteBuffer#append}.\r\n     * @function\r\n     * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to write. If `source` is a ByteBuffer, its offsets\r\n     *  will be modified according to the performed read operation.\r\n     * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeBytes = ByteBufferPrototype.append;\r\n\r\n    // types/ints/int8\r\n\r\n    /**\r\n     * Writes an 8bit signed integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeInt8 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value |= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 1;\n        var capacity0 = this.buffer.byteLength;\n        if (offset > capacity0)\n            this.resize((capacity0 *= 2) > offset ? capacity0 : offset);\n        offset -= 1;\n        this.view[offset] = value;\r\n        if (relative) this.offset += 1;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes an 8bit signed integer. This is an alias of {@link ByteBuffer#writeInt8}.\r\n     * @function\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeByte = ByteBufferPrototype.writeInt8;\r\n\r\n    /**\r\n     * Reads an 8bit signed integer.\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readInt8 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 1 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = this.view[offset];\r\n        if ((value & 0x80) === 0x80) value = -(0xFF - value + 1); // Cast to signed\r\n        if (relative) this.offset += 1;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads an 8bit signed integer. This is an alias of {@link ByteBuffer#readInt8}.\r\n     * @function\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readByte = ByteBufferPrototype.readInt8;\r\n\r\n    /**\r\n     * Writes an 8bit unsigned integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeUint8 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value >>>= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 1;\n        var capacity1 = this.buffer.byteLength;\n        if (offset > capacity1)\n            this.resize((capacity1 *= 2) > offset ? capacity1 : offset);\n        offset -= 1;\n        this.view[offset] = value;\r\n        if (relative) this.offset += 1;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes an 8bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint8}.\r\n     * @function\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeUInt8 = ByteBufferPrototype.writeUint8;\r\n\r\n    /**\r\n     * Reads an 8bit unsigned integer.\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readUint8 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 1 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = this.view[offset];\r\n        if (relative) this.offset += 1;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads an 8bit unsigned integer. This is an alias of {@link ByteBuffer#readUint8}.\r\n     * @function\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `1` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readUInt8 = ByteBufferPrototype.readUint8;\r\n\r\n    // types/ints/int16\r\n\r\n    /**\r\n     * Writes a 16bit signed integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @throws {TypeError} If `offset` or `value` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeInt16 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value |= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 2;\n        var capacity2 = this.buffer.byteLength;\n        if (offset > capacity2)\n            this.resize((capacity2 *= 2) > offset ? capacity2 : offset);\n        offset -= 2;\n        if (this.littleEndian) {\r\n            this.view[offset+1] = (value & 0xFF00) >>> 8;\r\n            this.view[offset  ] =  value & 0x00FF;\r\n        } else {\r\n            this.view[offset]   = (value & 0xFF00) >>> 8;\r\n            this.view[offset+1] =  value & 0x00FF;\r\n        }\r\n        if (relative) this.offset += 2;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes a 16bit signed integer. This is an alias of {@link ByteBuffer#writeInt16}.\r\n     * @function\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @throws {TypeError} If `offset` or `value` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeShort = ByteBufferPrototype.writeInt16;\r\n\r\n    /**\r\n     * Reads a 16bit signed integer.\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @returns {number} Value read\r\n     * @throws {TypeError} If `offset` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readInt16 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 2 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+2+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = 0;\r\n        if (this.littleEndian) {\r\n            value  = this.view[offset  ];\r\n            value |= this.view[offset+1] << 8;\r\n        } else {\r\n            value  = this.view[offset  ] << 8;\r\n            value |= this.view[offset+1];\r\n        }\r\n        if ((value & 0x8000) === 0x8000) value = -(0xFFFF - value + 1); // Cast to signed\r\n        if (relative) this.offset += 2;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads a 16bit signed integer. This is an alias of {@link ByteBuffer#readInt16}.\r\n     * @function\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @returns {number} Value read\r\n     * @throws {TypeError} If `offset` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readShort = ByteBufferPrototype.readInt16;\r\n\r\n    /**\r\n     * Writes a 16bit unsigned integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @throws {TypeError} If `offset` or `value` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeUint16 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value >>>= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 2;\n        var capacity3 = this.buffer.byteLength;\n        if (offset > capacity3)\n            this.resize((capacity3 *= 2) > offset ? capacity3 : offset);\n        offset -= 2;\n        if (this.littleEndian) {\r\n            this.view[offset+1] = (value & 0xFF00) >>> 8;\r\n            this.view[offset  ] =  value & 0x00FF;\r\n        } else {\r\n            this.view[offset]   = (value & 0xFF00) >>> 8;\r\n            this.view[offset+1] =  value & 0x00FF;\r\n        }\r\n        if (relative) this.offset += 2;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes a 16bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint16}.\r\n     * @function\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @throws {TypeError} If `offset` or `value` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeUInt16 = ByteBufferPrototype.writeUint16;\r\n\r\n    /**\r\n     * Reads a 16bit unsigned integer.\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @returns {number} Value read\r\n     * @throws {TypeError} If `offset` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readUint16 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 2 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+2+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = 0;\r\n        if (this.littleEndian) {\r\n            value  = this.view[offset  ];\r\n            value |= this.view[offset+1] << 8;\r\n        } else {\r\n            value  = this.view[offset  ] << 8;\r\n            value |= this.view[offset+1];\r\n        }\r\n        if (relative) this.offset += 2;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads a 16bit unsigned integer. This is an alias of {@link ByteBuffer#readUint16}.\r\n     * @function\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `2` if omitted.\r\n     * @returns {number} Value read\r\n     * @throws {TypeError} If `offset` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readUInt16 = ByteBufferPrototype.readUint16;\r\n\r\n    // types/ints/int32\r\n\r\n    /**\r\n     * Writes a 32bit signed integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeInt32 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value |= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 4;\n        var capacity4 = this.buffer.byteLength;\n        if (offset > capacity4)\n            this.resize((capacity4 *= 2) > offset ? capacity4 : offset);\n        offset -= 4;\n        if (this.littleEndian) {\n            this.view[offset+3] = (value >>> 24) & 0xFF;\n            this.view[offset+2] = (value >>> 16) & 0xFF;\n            this.view[offset+1] = (value >>>  8) & 0xFF;\n            this.view[offset  ] =  value         & 0xFF;\n        } else {\n            this.view[offset  ] = (value >>> 24) & 0xFF;\n            this.view[offset+1] = (value >>> 16) & 0xFF;\n            this.view[offset+2] = (value >>>  8) & 0xFF;\n            this.view[offset+3] =  value         & 0xFF;\n        }\n        if (relative) this.offset += 4;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes a 32bit signed integer. This is an alias of {@link ByteBuffer#writeInt32}.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeInt = ByteBufferPrototype.writeInt32;\r\n\r\n    /**\r\n     * Reads a 32bit signed integer.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readInt32 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 4 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = 0;\r\n        if (this.littleEndian) {\n            value  = this.view[offset+2] << 16;\n            value |= this.view[offset+1] <<  8;\n            value |= this.view[offset  ];\n            value += this.view[offset+3] << 24 >>> 0;\n        } else {\n            value  = this.view[offset+1] << 16;\n            value |= this.view[offset+2] <<  8;\n            value |= this.view[offset+3];\n            value += this.view[offset  ] << 24 >>> 0;\n        }\n        value |= 0; // Cast to signed\r\n        if (relative) this.offset += 4;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads a 32bit signed integer. This is an alias of {@link ByteBuffer#readInt32}.\r\n     * @param {number=} offset Offset to read from. Will use and advance {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readInt = ByteBufferPrototype.readInt32;\r\n\r\n    /**\r\n     * Writes a 32bit unsigned integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeUint32 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value >>>= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 4;\n        var capacity5 = this.buffer.byteLength;\n        if (offset > capacity5)\n            this.resize((capacity5 *= 2) > offset ? capacity5 : offset);\n        offset -= 4;\n        if (this.littleEndian) {\n            this.view[offset+3] = (value >>> 24) & 0xFF;\n            this.view[offset+2] = (value >>> 16) & 0xFF;\n            this.view[offset+1] = (value >>>  8) & 0xFF;\n            this.view[offset  ] =  value         & 0xFF;\n        } else {\n            this.view[offset  ] = (value >>> 24) & 0xFF;\n            this.view[offset+1] = (value >>> 16) & 0xFF;\n            this.view[offset+2] = (value >>>  8) & 0xFF;\n            this.view[offset+3] =  value         & 0xFF;\n        }\n        if (relative) this.offset += 4;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes a 32bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint32}.\r\n     * @function\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeUInt32 = ByteBufferPrototype.writeUint32;\r\n\r\n    /**\r\n     * Reads a 32bit unsigned integer.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readUint32 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 4 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = 0;\r\n        if (this.littleEndian) {\n            value  = this.view[offset+2] << 16;\n            value |= this.view[offset+1] <<  8;\n            value |= this.view[offset  ];\n            value += this.view[offset+3] << 24 >>> 0;\n        } else {\n            value  = this.view[offset+1] << 16;\n            value |= this.view[offset+2] <<  8;\n            value |= this.view[offset+3];\n            value += this.view[offset  ] << 24 >>> 0;\n        }\n        if (relative) this.offset += 4;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads a 32bit unsigned integer. This is an alias of {@link ByteBuffer#readUint32}.\r\n     * @function\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {number} Value read\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readUInt32 = ByteBufferPrototype.readUint32;\r\n\r\n    // types/ints/int64\r\n\r\n    if (Long) {\r\n\r\n        /**\r\n         * Writes a 64bit signed integer.\r\n         * @param {number|!Long} value Value to write\r\n         * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!ByteBuffer} this\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.writeInt64 = function(value, offset) {\r\n            var relative = typeof offset === 'undefined';\n            if (relative) offset = this.offset;\n            if (!this.noAssert) {\r\n                if (typeof value === 'number')\n                    value = Long.fromNumber(value);\n                else if (typeof value === 'string')\n                    value = Long.fromString(value);\n                else if (!(value && value instanceof Long))\n                    throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n                if (typeof offset !== 'number' || offset % 1 !== 0)\n                    throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n                offset >>>= 0;\n                if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                    throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n            }\r\n            if (typeof value === 'number')\n                value = Long.fromNumber(value);\n            else if (typeof value === 'string')\n                value = Long.fromString(value);\n            offset += 8;\n            var capacity6 = this.buffer.byteLength;\n            if (offset > capacity6)\n                this.resize((capacity6 *= 2) > offset ? capacity6 : offset);\n            offset -= 8;\n            var lo = value.low,\r\n                hi = value.high;\r\n            if (this.littleEndian) {\r\n                this.view[offset+3] = (lo >>> 24) & 0xFF;\n                this.view[offset+2] = (lo >>> 16) & 0xFF;\n                this.view[offset+1] = (lo >>>  8) & 0xFF;\n                this.view[offset  ] =  lo         & 0xFF;\n                offset += 4;\r\n                this.view[offset+3] = (hi >>> 24) & 0xFF;\n                this.view[offset+2] = (hi >>> 16) & 0xFF;\n                this.view[offset+1] = (hi >>>  8) & 0xFF;\n                this.view[offset  ] =  hi         & 0xFF;\n            } else {\r\n                this.view[offset  ] = (hi >>> 24) & 0xFF;\n                this.view[offset+1] = (hi >>> 16) & 0xFF;\n                this.view[offset+2] = (hi >>>  8) & 0xFF;\n                this.view[offset+3] =  hi         & 0xFF;\n                offset += 4;\r\n                this.view[offset  ] = (lo >>> 24) & 0xFF;\n                this.view[offset+1] = (lo >>> 16) & 0xFF;\n                this.view[offset+2] = (lo >>>  8) & 0xFF;\n                this.view[offset+3] =  lo         & 0xFF;\n            }\r\n            if (relative) this.offset += 8;\n            return this;\r\n        };\r\n\r\n        /**\r\n         * Writes a 64bit signed integer. This is an alias of {@link ByteBuffer#writeInt64}.\r\n         * @param {number|!Long} value Value to write\r\n         * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!ByteBuffer} this\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.writeLong = ByteBufferPrototype.writeInt64;\r\n\r\n        /**\r\n         * Reads a 64bit signed integer.\r\n         * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!Long}\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.readInt64 = function(offset) {\r\n            var relative = typeof offset === 'undefined';\n            if (relative) offset = this.offset;\n            if (!this.noAssert) {\r\n                if (typeof offset !== 'number' || offset % 1 !== 0)\n                    throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n                offset >>>= 0;\n                if (offset < 0 || offset + 8 > this.buffer.byteLength)\n                    throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n            }\r\n            var lo = 0,\r\n                hi = 0;\r\n            if (this.littleEndian) {\r\n                lo  = this.view[offset+2] << 16;\n                lo |= this.view[offset+1] <<  8;\n                lo |= this.view[offset  ];\n                lo += this.view[offset+3] << 24 >>> 0;\n                offset += 4;\r\n                hi  = this.view[offset+2] << 16;\n                hi |= this.view[offset+1] <<  8;\n                hi |= this.view[offset  ];\n                hi += this.view[offset+3] << 24 >>> 0;\n            } else {\r\n                hi  = this.view[offset+1] << 16;\n                hi |= this.view[offset+2] <<  8;\n                hi |= this.view[offset+3];\n                hi += this.view[offset  ] << 24 >>> 0;\n                offset += 4;\r\n                lo  = this.view[offset+1] << 16;\n                lo |= this.view[offset+2] <<  8;\n                lo |= this.view[offset+3];\n                lo += this.view[offset  ] << 24 >>> 0;\n            }\r\n            var value = new Long(lo, hi, false);\r\n            if (relative) this.offset += 8;\n            return value;\r\n        };\r\n\r\n        /**\r\n         * Reads a 64bit signed integer. This is an alias of {@link ByteBuffer#readInt64}.\r\n         * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!Long}\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.readLong = ByteBufferPrototype.readInt64;\r\n\r\n        /**\r\n         * Writes a 64bit unsigned integer.\r\n         * @param {number|!Long} value Value to write\r\n         * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!ByteBuffer} this\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.writeUint64 = function(value, offset) {\r\n            var relative = typeof offset === 'undefined';\n            if (relative) offset = this.offset;\n            if (!this.noAssert) {\r\n                if (typeof value === 'number')\n                    value = Long.fromNumber(value);\n                else if (typeof value === 'string')\n                    value = Long.fromString(value);\n                else if (!(value && value instanceof Long))\n                    throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n                if (typeof offset !== 'number' || offset % 1 !== 0)\n                    throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n                offset >>>= 0;\n                if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                    throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n            }\r\n            if (typeof value === 'number')\n                value = Long.fromNumber(value);\n            else if (typeof value === 'string')\n                value = Long.fromString(value);\n            offset += 8;\n            var capacity7 = this.buffer.byteLength;\n            if (offset > capacity7)\n                this.resize((capacity7 *= 2) > offset ? capacity7 : offset);\n            offset -= 8;\n            var lo = value.low,\r\n                hi = value.high;\r\n            if (this.littleEndian) {\r\n                this.view[offset+3] = (lo >>> 24) & 0xFF;\n                this.view[offset+2] = (lo >>> 16) & 0xFF;\n                this.view[offset+1] = (lo >>>  8) & 0xFF;\n                this.view[offset  ] =  lo         & 0xFF;\n                offset += 4;\r\n                this.view[offset+3] = (hi >>> 24) & 0xFF;\n                this.view[offset+2] = (hi >>> 16) & 0xFF;\n                this.view[offset+1] = (hi >>>  8) & 0xFF;\n                this.view[offset  ] =  hi         & 0xFF;\n            } else {\r\n                this.view[offset  ] = (hi >>> 24) & 0xFF;\n                this.view[offset+1] = (hi >>> 16) & 0xFF;\n                this.view[offset+2] = (hi >>>  8) & 0xFF;\n                this.view[offset+3] =  hi         & 0xFF;\n                offset += 4;\r\n                this.view[offset  ] = (lo >>> 24) & 0xFF;\n                this.view[offset+1] = (lo >>> 16) & 0xFF;\n                this.view[offset+2] = (lo >>>  8) & 0xFF;\n                this.view[offset+3] =  lo         & 0xFF;\n            }\r\n            if (relative) this.offset += 8;\n            return this;\r\n        };\r\n\r\n        /**\r\n         * Writes a 64bit unsigned integer. This is an alias of {@link ByteBuffer#writeUint64}.\r\n         * @function\r\n         * @param {number|!Long} value Value to write\r\n         * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!ByteBuffer} this\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.writeUInt64 = ByteBufferPrototype.writeUint64;\r\n\r\n        /**\r\n         * Reads a 64bit unsigned integer.\r\n         * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!Long}\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.readUint64 = function(offset) {\r\n            var relative = typeof offset === 'undefined';\n            if (relative) offset = this.offset;\n            if (!this.noAssert) {\r\n                if (typeof offset !== 'number' || offset % 1 !== 0)\n                    throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n                offset >>>= 0;\n                if (offset < 0 || offset + 8 > this.buffer.byteLength)\n                    throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n            }\r\n            var lo = 0,\r\n                hi = 0;\r\n            if (this.littleEndian) {\r\n                lo  = this.view[offset+2] << 16;\n                lo |= this.view[offset+1] <<  8;\n                lo |= this.view[offset  ];\n                lo += this.view[offset+3] << 24 >>> 0;\n                offset += 4;\r\n                hi  = this.view[offset+2] << 16;\n                hi |= this.view[offset+1] <<  8;\n                hi |= this.view[offset  ];\n                hi += this.view[offset+3] << 24 >>> 0;\n            } else {\r\n                hi  = this.view[offset+1] << 16;\n                hi |= this.view[offset+2] <<  8;\n                hi |= this.view[offset+3];\n                hi += this.view[offset  ] << 24 >>> 0;\n                offset += 4;\r\n                lo  = this.view[offset+1] << 16;\n                lo |= this.view[offset+2] <<  8;\n                lo |= this.view[offset+3];\n                lo += this.view[offset  ] << 24 >>> 0;\n            }\r\n            var value = new Long(lo, hi, true);\r\n            if (relative) this.offset += 8;\n            return value;\r\n        };\r\n\r\n        /**\r\n         * Reads a 64bit unsigned integer. This is an alias of {@link ByteBuffer#readUint64}.\r\n         * @function\r\n         * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n         * @returns {!Long}\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.readUInt64 = ByteBufferPrototype.readUint64;\r\n\r\n    } // Long\r\n\r\n\r\n    // types/floats/float32\r\n\r\n    /*\r\n     ieee754 - https://github.com/feross/ieee754\r\n\r\n     The MIT License (MIT)\r\n\r\n     Copyright (c) Feross Aboukhadijeh\r\n\r\n     Permission is hereby granted, free of charge, to any person obtaining a copy\r\n     of this software and associated documentation files (the \"Software\"), to deal\r\n     in the Software without restriction, including without limitation the rights\r\n     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n     copies of the Software, and to permit persons to whom the Software is\r\n     furnished to do so, subject to the following conditions:\r\n\r\n     The above copyright notice and this permission notice shall be included in\r\n     all copies or substantial portions of the Software.\r\n\r\n     THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n     THE SOFTWARE.\r\n    */\r\n\r\n    /**\r\n     * Reads an IEEE754 float from a byte array.\r\n     * @param {!Array} buffer\r\n     * @param {number} offset\r\n     * @param {boolean} isLE\r\n     * @param {number} mLen\r\n     * @param {number} nBytes\r\n     * @returns {number}\r\n     * @inner\r\n     */\r\n    function ieee754_read(buffer, offset, isLE, mLen, nBytes) {\r\n        var e, m,\r\n            eLen = nBytes * 8 - mLen - 1,\r\n            eMax = (1 << eLen) - 1,\r\n            eBias = eMax >> 1,\r\n            nBits = -7,\r\n            i = isLE ? (nBytes - 1) : 0,\r\n            d = isLE ? -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\n    /**\r\n     * Writes an IEEE754 float to a byte array.\r\n     * @param {!Array} buffer\r\n     * @param {number} value\r\n     * @param {number} offset\r\n     * @param {boolean} isLE\r\n     * @param {number} mLen\r\n     * @param {number} nBytes\r\n     * @inner\r\n     */\r\n    function ieee754_write(buffer, value, offset, isLE, 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 = isLE ? 0 : (nBytes - 1),\r\n            d = isLE ? 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\r\n    /**\r\n     * Writes a 32bit float.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeFloat32 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number')\r\n                throw TypeError(\"Illegal value: \"+value+\" (not a number)\");\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 4;\n        var capacity8 = this.buffer.byteLength;\n        if (offset > capacity8)\n            this.resize((capacity8 *= 2) > offset ? capacity8 : offset);\n        offset -= 4;\n        ieee754_write(this.view, value, offset, this.littleEndian, 23, 4);\r\n        if (relative) this.offset += 4;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes a 32bit float. This is an alias of {@link ByteBuffer#writeFloat32}.\r\n     * @function\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeFloat = ByteBufferPrototype.writeFloat32;\r\n\r\n    /**\r\n     * Reads a 32bit float.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {number}\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readFloat32 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 4 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = ieee754_read(this.view, offset, this.littleEndian, 23, 4);\r\n        if (relative) this.offset += 4;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads a 32bit float. This is an alias of {@link ByteBuffer#readFloat32}.\r\n     * @function\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `4` if omitted.\r\n     * @returns {number}\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readFloat = ByteBufferPrototype.readFloat32;\r\n\r\n    // types/floats/float64\r\n\r\n    /**\r\n     * Writes a 64bit float.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeFloat64 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number')\r\n                throw TypeError(\"Illegal value: \"+value+\" (not a number)\");\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        offset += 8;\n        var capacity9 = this.buffer.byteLength;\n        if (offset > capacity9)\n            this.resize((capacity9 *= 2) > offset ? capacity9 : offset);\n        offset -= 8;\n        ieee754_write(this.view, value, offset, this.littleEndian, 52, 8);\r\n        if (relative) this.offset += 8;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Writes a 64bit float. This is an alias of {@link ByteBuffer#writeFloat64}.\r\n     * @function\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeDouble = ByteBufferPrototype.writeFloat64;\r\n\r\n    /**\r\n     * Reads a 64bit float.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n     * @returns {number}\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readFloat64 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 8 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+8+\") <= \"+this.buffer.byteLength);\n        }\r\n        var value = ieee754_read(this.view, offset, this.littleEndian, 52, 8);\r\n        if (relative) this.offset += 8;\n        return value;\r\n    };\r\n\r\n    /**\r\n     * Reads a 64bit float. This is an alias of {@link ByteBuffer#readFloat64}.\r\n     * @function\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by `8` if omitted.\r\n     * @returns {number}\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readDouble = ByteBufferPrototype.readFloat64;\r\n\r\n\r\n    // types/varints/varint32\r\n\r\n    /**\r\n     * Maximum number of bytes required to store a 32bit base 128 variable-length integer.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ByteBuffer.MAX_VARINT32_BYTES = 5;\r\n\r\n    /**\r\n     * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.\r\n     * @param {number} value Value to encode\r\n     * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT32_BYTES}\r\n     * @expose\r\n     */\r\n    ByteBuffer.calculateVarint32 = function(value) {\r\n        // ref: src/google/protobuf/io/coded_stream.cc\r\n        value = value >>> 0;\r\n             if (value < 1 << 7 ) return 1;\r\n        else if (value < 1 << 14) return 2;\r\n        else if (value < 1 << 21) return 3;\r\n        else if (value < 1 << 28) return 4;\r\n        else                      return 5;\r\n    };\r\n\r\n    /**\r\n     * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding.\r\n     * @param {number} n Signed 32bit integer\r\n     * @returns {number} Unsigned zigzag encoded 32bit integer\r\n     * @expose\r\n     */\r\n    ByteBuffer.zigZagEncode32 = function(n) {\r\n        return (((n |= 0) << 1) ^ (n >> 31)) >>> 0; // ref: src/google/protobuf/wire_format_lite.h\r\n    };\r\n\r\n    /**\r\n     * Decodes a zigzag encoded signed 32bit integer.\r\n     * @param {number} n Unsigned zigzag encoded 32bit integer\r\n     * @returns {number} Signed 32bit integer\r\n     * @expose\r\n     */\r\n    ByteBuffer.zigZagDecode32 = function(n) {\r\n        return ((n >>> 1) ^ -(n & 1)) | 0; // // ref: src/google/protobuf/wire_format_lite.h\r\n    };\r\n\r\n    /**\r\n     * Writes a 32bit base 128 variable-length integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeVarint32 = function(value, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value |= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        var size = ByteBuffer.calculateVarint32(value),\r\n            b;\r\n        offset += size;\n        var capacity10 = this.buffer.byteLength;\n        if (offset > capacity10)\n            this.resize((capacity10 *= 2) > offset ? capacity10 : offset);\n        offset -= size;\n        value >>>= 0;\r\n        while (value >= 0x80) {\r\n            b = (value & 0x7f) | 0x80;\r\n            this.view[offset++] = b;\r\n            value >>>= 7;\r\n        }\r\n        this.view[offset++] = value;\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return this;\r\n        }\r\n        return size;\r\n    };\r\n\r\n    /**\r\n     * Writes a zig-zag encoded (signed) 32bit base 128 variable-length integer.\r\n     * @param {number} value Value to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {!ByteBuffer|number} this if `offset` is omitted, else the actual number of bytes written\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeVarint32ZigZag = function(value, offset) {\r\n        return this.writeVarint32(ByteBuffer.zigZagEncode32(value), offset);\r\n    };\r\n\r\n    /**\r\n     * Reads a 32bit base 128 variable-length integer.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read\r\n     *  and the actual number of bytes read.\r\n     * @throws {Error} If it's not a valid varint. Has a property `truncated = true` if there is not enough data available\r\n     *  to fully decode the varint.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readVarint32 = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 1 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n        }\r\n        var c = 0,\r\n            value = 0 >>> 0,\r\n            b;\r\n        do {\r\n            if (!this.noAssert && offset > this.limit) {\r\n                var err = Error(\"Truncated\");\r\n                err['truncated'] = true;\r\n                throw err;\r\n            }\r\n            b = this.view[offset++];\r\n            if (c < 5)\r\n                value |= (b & 0x7f) << (7*c);\r\n            ++c;\r\n        } while ((b & 0x80) !== 0);\r\n        value |= 0;\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return value;\r\n        }\r\n        return {\r\n            \"value\": value,\r\n            \"length\": c\r\n        };\r\n    };\r\n\r\n    /**\r\n     * Reads a zig-zag encoded (signed) 32bit base 128 variable-length integer.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {number|!{value: number, length: number}} The value read if offset is omitted, else the value read\r\n     *  and the actual number of bytes read.\r\n     * @throws {Error} If it's not a valid varint\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readVarint32ZigZag = function(offset) {\r\n        var val = this.readVarint32(offset);\r\n        if (typeof val === 'object')\r\n            val[\"value\"] = ByteBuffer.zigZagDecode32(val[\"value\"]);\r\n        else\r\n            val = ByteBuffer.zigZagDecode32(val);\r\n        return val;\r\n    };\r\n\r\n    // types/varints/varint64\r\n\r\n    if (Long) {\r\n\r\n        /**\r\n         * Maximum number of bytes required to store a 64bit base 128 variable-length integer.\r\n         * @type {number}\r\n         * @const\r\n         * @expose\r\n         */\r\n        ByteBuffer.MAX_VARINT64_BYTES = 10;\r\n\r\n        /**\r\n         * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.\r\n         * @param {number|!Long} value Value to encode\r\n         * @returns {number} Number of bytes required. Capped to {@link ByteBuffer.MAX_VARINT64_BYTES}\r\n         * @expose\r\n         */\r\n        ByteBuffer.calculateVarint64 = function(value) {\r\n            if (typeof value === 'number')\n                value = Long.fromNumber(value);\n            else if (typeof value === 'string')\n                value = Long.fromString(value);\n            // ref: src/google/protobuf/io/coded_stream.cc\r\n            var part0 = value.toInt() >>> 0,\r\n                part1 = value.shiftRightUnsigned(28).toInt() >>> 0,\r\n                part2 = value.shiftRightUnsigned(56).toInt() >>> 0;\r\n            if (part2 == 0) {\r\n                if (part1 == 0) {\r\n                    if (part0 < 1 << 14)\r\n                        return part0 < 1 << 7 ? 1 : 2;\r\n                    else\r\n                        return part0 < 1 << 21 ? 3 : 4;\r\n                } else {\r\n                    if (part1 < 1 << 14)\r\n                        return part1 < 1 << 7 ? 5 : 6;\r\n                    else\r\n                        return part1 < 1 << 21 ? 7 : 8;\r\n                }\r\n            } else\r\n                return part2 < 1 << 7 ? 9 : 10;\r\n        };\r\n\r\n        /**\r\n         * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding.\r\n         * @param {number|!Long} value Signed long\r\n         * @returns {!Long} Unsigned zigzag encoded long\r\n         * @expose\r\n         */\r\n        ByteBuffer.zigZagEncode64 = function(value) {\r\n            if (typeof value === 'number')\n                value = Long.fromNumber(value, false);\n            else if (typeof value === 'string')\n                value = Long.fromString(value, false);\n            else if (value.unsigned !== false) value = value.toSigned();\n            // ref: src/google/protobuf/wire_format_lite.h\r\n            return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();\r\n        };\r\n\r\n        /**\r\n         * Decodes a zigzag encoded signed 64bit integer.\r\n         * @param {!Long|number} value Unsigned zigzag encoded long or JavaScript number\r\n         * @returns {!Long} Signed long\r\n         * @expose\r\n         */\r\n        ByteBuffer.zigZagDecode64 = function(value) {\r\n            if (typeof value === 'number')\n                value = Long.fromNumber(value, false);\n            else if (typeof value === 'string')\n                value = Long.fromString(value, false);\n            else if (value.unsigned !== false) value = value.toSigned();\n            // ref: src/google/protobuf/wire_format_lite.h\r\n            return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();\r\n        };\r\n\r\n        /**\r\n         * Writes a 64bit base 128 variable-length integer.\r\n         * @param {number|Long} value Value to write\r\n         * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n         *  written if omitted.\r\n         * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.writeVarint64 = function(value, offset) {\r\n            var relative = typeof offset === 'undefined';\n            if (relative) offset = this.offset;\n            if (!this.noAssert) {\r\n                if (typeof value === 'number')\n                    value = Long.fromNumber(value);\n                else if (typeof value === 'string')\n                    value = Long.fromString(value);\n                else if (!(value && value instanceof Long))\n                    throw TypeError(\"Illegal value: \"+value+\" (not an integer or Long)\");\n                if (typeof offset !== 'number' || offset % 1 !== 0)\n                    throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n                offset >>>= 0;\n                if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                    throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n            }\r\n            if (typeof value === 'number')\n                value = Long.fromNumber(value, false);\n            else if (typeof value === 'string')\n                value = Long.fromString(value, false);\n            else if (value.unsigned !== false) value = value.toSigned();\n            var size = ByteBuffer.calculateVarint64(value),\r\n                part0 = value.toInt() >>> 0,\r\n                part1 = value.shiftRightUnsigned(28).toInt() >>> 0,\r\n                part2 = value.shiftRightUnsigned(56).toInt() >>> 0;\r\n            offset += size;\n            var capacity11 = this.buffer.byteLength;\n            if (offset > capacity11)\n                this.resize((capacity11 *= 2) > offset ? capacity11 : offset);\n            offset -= size;\n            switch (size) {\r\n                case 10: this.view[offset+9] = (part2 >>>  7) & 0x01;\r\n                case 9 : this.view[offset+8] = size !== 9 ? (part2       ) | 0x80 : (part2       ) & 0x7F;\r\n                case 8 : this.view[offset+7] = size !== 8 ? (part1 >>> 21) | 0x80 : (part1 >>> 21) & 0x7F;\r\n                case 7 : this.view[offset+6] = size !== 7 ? (part1 >>> 14) | 0x80 : (part1 >>> 14) & 0x7F;\r\n                case 6 : this.view[offset+5] = size !== 6 ? (part1 >>>  7) | 0x80 : (part1 >>>  7) & 0x7F;\r\n                case 5 : this.view[offset+4] = size !== 5 ? (part1       ) | 0x80 : (part1       ) & 0x7F;\r\n                case 4 : this.view[offset+3] = size !== 4 ? (part0 >>> 21) | 0x80 : (part0 >>> 21) & 0x7F;\r\n                case 3 : this.view[offset+2] = size !== 3 ? (part0 >>> 14) | 0x80 : (part0 >>> 14) & 0x7F;\r\n                case 2 : this.view[offset+1] = size !== 2 ? (part0 >>>  7) | 0x80 : (part0 >>>  7) & 0x7F;\r\n                case 1 : this.view[offset  ] = size !== 1 ? (part0       ) | 0x80 : (part0       ) & 0x7F;\r\n            }\r\n            if (relative) {\r\n                this.offset += size;\r\n                return this;\r\n            } else {\r\n                return size;\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Writes a zig-zag encoded 64bit base 128 variable-length integer.\r\n         * @param {number|Long} value Value to write\r\n         * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n         *  written if omitted.\r\n         * @returns {!ByteBuffer|number} `this` if offset is omitted, else the actual number of bytes written.\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.writeVarint64ZigZag = function(value, offset) {\r\n            return this.writeVarint64(ByteBuffer.zigZagEncode64(value), offset);\r\n        };\r\n\r\n        /**\r\n         * Reads a 64bit base 128 variable-length integer. Requires Long.js.\r\n         * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n         *  read if omitted.\r\n         * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and\r\n         *  the actual number of bytes read.\r\n         * @throws {Error} If it's not a valid varint\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.readVarint64 = function(offset) {\r\n            var relative = typeof offset === 'undefined';\n            if (relative) offset = this.offset;\n            if (!this.noAssert) {\r\n                if (typeof offset !== 'number' || offset % 1 !== 0)\n                    throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n                offset >>>= 0;\n                if (offset < 0 || offset + 1 > this.buffer.byteLength)\n                    throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n            }\r\n            // ref: src/google/protobuf/io/coded_stream.cc\r\n            var start = offset,\r\n                part0 = 0,\r\n                part1 = 0,\r\n                part2 = 0,\r\n                b  = 0;\r\n            b = this.view[offset++]; part0  = (b & 0x7F)      ; if ( b & 0x80                                                   ) {\r\n            b = this.view[offset++]; part0 |= (b & 0x7F) <<  7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part0 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part0 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part1  = (b & 0x7F)      ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part1 |= (b & 0x7F) <<  7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part1 |= (b & 0x7F) << 14; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part1 |= (b & 0x7F) << 21; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part2  = (b & 0x7F)      ; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            b = this.view[offset++]; part2 |= (b & 0x7F) <<  7; if ((b & 0x80) || (this.noAssert && typeof b === 'undefined')) {\r\n            throw Error(\"Buffer overrun\"); }}}}}}}}}}\r\n            var value = Long.fromBits(part0 | (part1 << 28), (part1 >>> 4) | (part2) << 24, false);\r\n            if (relative) {\r\n                this.offset = offset;\r\n                return value;\r\n            } else {\r\n                return {\r\n                    'value': value,\r\n                    'length': offset-start\r\n                };\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js.\r\n         * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n         *  read if omitted.\r\n         * @returns {!Long|!{value: Long, length: number}} The value read if offset is omitted, else the value read and\r\n         *  the actual number of bytes read.\r\n         * @throws {Error} If it's not a valid varint\r\n         * @expose\r\n         */\r\n        ByteBufferPrototype.readVarint64ZigZag = function(offset) {\r\n            var val = this.readVarint64(offset);\r\n            if (val && val['value'] instanceof Long)\r\n                val[\"value\"] = ByteBuffer.zigZagDecode64(val[\"value\"]);\r\n            else\r\n                val = ByteBuffer.zigZagDecode64(val);\r\n            return val;\r\n        };\r\n\r\n    } // Long\r\n\r\n\r\n    // types/strings/cstring\r\n\r\n    /**\r\n     * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL\r\n     *  characters itself.\r\n     * @param {string} str String to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  contained in `str` + 1 if omitted.\r\n     * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeCString = function(str, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        var i,\r\n            k = str.length;\r\n        if (!this.noAssert) {\r\n            if (typeof str !== 'string')\r\n                throw TypeError(\"Illegal str: Not a string\");\r\n            for (i=0; i>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        // UTF8 strings do not contain zero bytes in between except for the zero character, so:\r\n        k = utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n        offset += k+1;\n        var capacity12 = this.buffer.byteLength;\n        if (offset > capacity12)\n            this.resize((capacity12 *= 2) > offset ? capacity12 : offset);\n        offset -= k+1;\n        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n            this.view[offset++] = b;\r\n        }.bind(this));\r\n        this.view[offset++] = 0;\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return this;\r\n        }\r\n        return k;\r\n    };\r\n\r\n    /**\r\n     * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters\r\n     *  itself.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  read if omitted.\r\n     * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n     *  read and the actual number of bytes read.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readCString = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 1 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n        }\r\n        var start = offset,\r\n            temp;\r\n        // UTF8 strings do not contain zero bytes in between except for the zero character itself, so:\r\n        var sd, b = -1;\r\n        utfx.decodeUTF8toUTF16(function() {\r\n            if (b === 0) return null;\r\n            if (offset >= this.limit)\r\n                throw RangeError(\"Illegal range: Truncated data, \"+offset+\" < \"+this.limit);\r\n            b = this.view[offset++];\r\n            return b === 0 ? null : b;\r\n        }.bind(this), sd = stringDestination(), true);\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return sd();\r\n        } else {\r\n            return {\r\n                \"string\": sd(),\r\n                \"length\": offset - start\r\n            };\r\n        }\r\n    };\r\n\r\n    // types/strings/istring\r\n\r\n    /**\r\n     * Writes a length as uint32 prefixed UTF8 encoded string.\r\n     * @param {string} str String to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written\r\n     * @expose\r\n     * @see ByteBuffer#writeVarint32\r\n     */\r\n    ByteBufferPrototype.writeIString = function(str, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof str !== 'string')\r\n                throw TypeError(\"Illegal str: Not a string\");\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        var start = offset,\r\n            k;\r\n        k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];\r\n        offset += 4+k;\n        var capacity13 = this.buffer.byteLength;\n        if (offset > capacity13)\n            this.resize((capacity13 *= 2) > offset ? capacity13 : offset);\n        offset -= 4+k;\n        if (this.littleEndian) {\n            this.view[offset+3] = (k >>> 24) & 0xFF;\n            this.view[offset+2] = (k >>> 16) & 0xFF;\n            this.view[offset+1] = (k >>>  8) & 0xFF;\n            this.view[offset  ] =  k         & 0xFF;\n        } else {\n            this.view[offset  ] = (k >>> 24) & 0xFF;\n            this.view[offset+1] = (k >>> 16) & 0xFF;\n            this.view[offset+2] = (k >>>  8) & 0xFF;\n            this.view[offset+3] =  k         & 0xFF;\n        }\n        offset += 4;\r\n        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n            this.view[offset++] = b;\r\n        }.bind(this));\r\n        if (offset !== start + 4 + k)\r\n            throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+(offset+4+k));\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return this;\r\n        }\r\n        return offset - start;\r\n    };\r\n\r\n    /**\r\n     * Reads a length as uint32 prefixed UTF8 encoded string.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  read if omitted.\r\n     * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n     *  read and the actual number of bytes read.\r\n     * @expose\r\n     * @see ByteBuffer#readVarint32\r\n     */\r\n    ByteBufferPrototype.readIString = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 4 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+4+\") <= \"+this.buffer.byteLength);\n        }\r\n        var start = offset;\r\n        var len = this.readUint32(offset);\r\n        var str = this.readUTF8String(len, ByteBuffer.METRICS_BYTES, offset += 4);\r\n        offset += str['length'];\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return str['string'];\r\n        } else {\r\n            return {\r\n                'string': str['string'],\r\n                'length': offset - start\r\n            };\r\n        }\r\n    };\r\n\r\n    // types/strings/utf8string\r\n\r\n    /**\r\n     * Metrics representing number of UTF8 characters. Evaluates to `c`.\r\n     * @type {string}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ByteBuffer.METRICS_CHARS = 'c';\r\n\r\n    /**\r\n     * Metrics representing number of bytes. Evaluates to `b`.\r\n     * @type {string}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ByteBuffer.METRICS_BYTES = 'b';\r\n\r\n    /**\r\n     * Writes an UTF8 encoded string.\r\n     * @param {string} str String to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.\r\n     * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeUTF8String = function(str, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        var k;\r\n        var start = offset;\r\n        k = utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n        offset += k;\n        var capacity14 = this.buffer.byteLength;\n        if (offset > capacity14)\n            this.resize((capacity14 *= 2) > offset ? capacity14 : offset);\n        offset -= k;\n        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n            this.view[offset++] = b;\r\n        }.bind(this));\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return this;\r\n        }\r\n        return offset - start;\r\n    };\r\n\r\n    /**\r\n     * Writes an UTF8 encoded string. This is an alias of {@link ByteBuffer#writeUTF8String}.\r\n     * @function\r\n     * @param {string} str String to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} if omitted.\r\n     * @returns {!ByteBuffer|number} this if offset is omitted, else the actual number of bytes written.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.writeString = ByteBufferPrototype.writeUTF8String;\r\n\r\n    /**\r\n     * Calculates the number of UTF8 characters of a string. JavaScript itself uses UTF-16, so that a string's\r\n     *  `length` property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF.\r\n     * @param {string} str String to calculate\r\n     * @returns {number} Number of UTF8 characters\r\n     * @expose\r\n     */\r\n    ByteBuffer.calculateUTF8Chars = function(str) {\r\n        return utfx.calculateUTF16asUTF8(stringSource(str))[0];\r\n    };\r\n\r\n    /**\r\n     * Calculates the number of UTF8 bytes of a string.\r\n     * @param {string} str String to calculate\r\n     * @returns {number} Number of UTF8 bytes\r\n     * @expose\r\n     */\r\n    ByteBuffer.calculateUTF8Bytes = function(str) {\r\n        return utfx.calculateUTF16asUTF8(stringSource(str))[1];\r\n    };\r\n\r\n    /**\r\n     * Calculates the number of UTF8 bytes of a string. This is an alias of {@link ByteBuffer.calculateUTF8Bytes}.\r\n     * @function\r\n     * @param {string} str String to calculate\r\n     * @returns {number} Number of UTF8 bytes\r\n     * @expose\r\n     */\r\n    ByteBuffer.calculateString = ByteBuffer.calculateUTF8Bytes;\r\n\r\n    /**\r\n     * Reads an UTF8 encoded string.\r\n     * @param {number} length Number of characters or bytes to read.\r\n     * @param {string=} metrics Metrics specifying what `length` is meant to count. Defaults to\r\n     *  {@link ByteBuffer.METRICS_CHARS}.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  read if omitted.\r\n     * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n     *  read and the actual number of bytes read.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readUTF8String = function(length, metrics, offset) {\r\n        if (typeof metrics === 'number') {\r\n            offset = metrics;\r\n            metrics = undefined;\r\n        }\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (typeof metrics === 'undefined') metrics = ByteBuffer.METRICS_CHARS;\r\n        if (!this.noAssert) {\r\n            if (typeof length !== 'number' || length % 1 !== 0)\n                throw TypeError(\"Illegal length: \"+length+\" (not an integer)\");\n            length |= 0;\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        var i = 0,\r\n            start = offset,\r\n            sd;\r\n        if (metrics === ByteBuffer.METRICS_CHARS) { // The same for node and the browser\r\n            sd = stringDestination();\r\n            utfx.decodeUTF8(function() {\r\n                return i < length && offset < this.limit ? this.view[offset++] : null;\r\n            }.bind(this), function(cp) {\r\n                ++i; utfx.UTF8toUTF16(cp, sd);\r\n            });\r\n            if (i !== length)\r\n                throw RangeError(\"Illegal range: Truncated data, \"+i+\" == \"+length);\r\n            if (relative) {\r\n                this.offset = offset;\r\n                return sd();\r\n            } else {\r\n                return {\r\n                    \"string\": sd(),\r\n                    \"length\": offset - start\r\n                };\r\n            }\r\n        } else if (metrics === ByteBuffer.METRICS_BYTES) {\r\n            if (!this.noAssert) {\r\n                if (typeof offset !== 'number' || offset % 1 !== 0)\n                    throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n                offset >>>= 0;\n                if (offset < 0 || offset + length > this.buffer.byteLength)\n                    throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+length+\") <= \"+this.buffer.byteLength);\n            }\r\n            var k = offset + length;\r\n            utfx.decodeUTF8toUTF16(function() {\r\n                return offset < k ? this.view[offset++] : null;\r\n            }.bind(this), sd = stringDestination(), this.noAssert);\r\n            if (offset !== k)\r\n                throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+k);\r\n            if (relative) {\r\n                this.offset = offset;\r\n                return sd();\r\n            } else {\r\n                return {\r\n                    'string': sd(),\r\n                    'length': offset - start\r\n                };\r\n            }\r\n        } else\r\n            throw TypeError(\"Unsupported metrics: \"+metrics);\r\n    };\r\n\r\n    /**\r\n     * Reads an UTF8 encoded string. This is an alias of {@link ByteBuffer#readUTF8String}.\r\n     * @function\r\n     * @param {number} length Number of characters or bytes to read\r\n     * @param {number=} metrics Metrics specifying what `n` is meant to count. Defaults to\r\n     *  {@link ByteBuffer.METRICS_CHARS}.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  read if omitted.\r\n     * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n     *  read and the actual number of bytes read.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.readString = ByteBufferPrototype.readUTF8String;\r\n\r\n    // types/strings/vstring\r\n\r\n    /**\r\n     * Writes a length as varint32 prefixed UTF8 encoded string.\r\n     * @param {string} str String to write\r\n     * @param {number=} offset Offset to write to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {!ByteBuffer|number} `this` if `offset` is omitted, else the actual number of bytes written\r\n     * @expose\r\n     * @see ByteBuffer#writeVarint32\r\n     */\r\n    ByteBufferPrototype.writeVString = function(str, offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof str !== 'string')\r\n                throw TypeError(\"Illegal str: Not a string\");\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        var start = offset,\r\n            k, l;\r\n        k = utfx.calculateUTF16asUTF8(stringSource(str), this.noAssert)[1];\r\n        l = ByteBuffer.calculateVarint32(k);\r\n        offset += l+k;\n        var capacity15 = this.buffer.byteLength;\n        if (offset > capacity15)\n            this.resize((capacity15 *= 2) > offset ? capacity15 : offset);\n        offset -= l+k;\n        offset += this.writeVarint32(k, offset);\r\n        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n            this.view[offset++] = b;\r\n        }.bind(this));\r\n        if (offset !== start+k+l)\r\n            throw RangeError(\"Illegal range: Truncated data, \"+offset+\" == \"+(offset+k+l));\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return this;\r\n        }\r\n        return offset - start;\r\n    };\r\n\r\n    /**\r\n     * Reads a length as varint32 prefixed UTF8 encoded string.\r\n     * @param {number=} offset Offset to read from. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  read if omitted.\r\n     * @returns {string|!{string: string, length: number}} The string read if offset is omitted, else the string\r\n     *  read and the actual number of bytes read.\r\n     * @expose\r\n     * @see ByteBuffer#readVarint32\r\n     */\r\n    ByteBufferPrototype.readVString = function(offset) {\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 1 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+1+\") <= \"+this.buffer.byteLength);\n        }\r\n        var start = offset;\r\n        var len = this.readVarint32(offset);\r\n        var str = this.readUTF8String(len['value'], ByteBuffer.METRICS_BYTES, offset += len['length']);\r\n        offset += str['length'];\r\n        if (relative) {\r\n            this.offset = offset;\r\n            return str['string'];\r\n        } else {\r\n            return {\r\n                'string': str['string'],\r\n                'length': offset - start\r\n            };\r\n        }\r\n    };\r\n\r\n\r\n    /**\r\n     * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended\r\n     *  data's length.\r\n     * @param {!ByteBuffer|!ArrayBuffer|!Uint8Array|string} source Data to append. If `source` is a ByteBuffer, its offsets\r\n     *  will be modified according to the performed read operation.\r\n     * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n     * @param {number=} offset Offset to append at. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     * @example A relative `<01 02>03.append(<04 05>)` will result in `<01 02 04 05>, 04 05|`\r\n     * @example An absolute `<01 02>03.append(04 05>, 1)` will result in `<01 04>05, 04 05|`\r\n     */\r\n    ByteBufferPrototype.append = function(source, encoding, offset) {\r\n        if (typeof encoding === 'number' || typeof encoding !== 'string') {\r\n            offset = encoding;\r\n            encoding = undefined;\r\n        }\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        if (!(source instanceof ByteBuffer))\r\n            source = ByteBuffer.wrap(source, encoding);\r\n        var length = source.limit - source.offset;\r\n        if (length <= 0) return this; // Nothing to append\r\n        offset += length;\n        var capacity16 = this.buffer.byteLength;\n        if (offset > capacity16)\n            this.resize((capacity16 *= 2) > offset ? capacity16 : offset);\n        offset -= length;\n        this.view.set(source.view.subarray(source.offset, source.limit), offset);\r\n        source.offset += length;\r\n        if (relative) this.offset += length;\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the\r\n        specified offset up to the length of this ByteBuffer's data.\r\n     * @param {!ByteBuffer} target Target ByteBuffer\r\n     * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  read if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     * @see ByteBuffer#append\r\n     */\r\n    ByteBufferPrototype.appendTo = function(target, offset) {\r\n        target.append(this, offset);\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to\r\n     *  disable them if your code already makes sure that everything is valid.\r\n     * @param {boolean} assert `true` to enable assertions, otherwise `false`\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.assert = function(assert) {\r\n        this.noAssert = !assert;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Gets the capacity of this ByteBuffer's backing buffer.\r\n     * @returns {number} Capacity of the backing buffer\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.capacity = function() {\r\n        return this.buffer.byteLength;\r\n    };\r\n    /**\r\n     * Clears this ByteBuffer's offsets by setting {@link ByteBuffer#offset} to `0` and {@link ByteBuffer#limit} to the\r\n     *  backing buffer's capacity. Discards {@link ByteBuffer#markedOffset}.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.clear = function() {\r\n        this.offset = 0;\r\n        this.limit = this.buffer.byteLength;\r\n        this.markedOffset = -1;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for {@link ByteBuffer#offset},\r\n     *  {@link ByteBuffer#markedOffset} and {@link ByteBuffer#limit}.\r\n     * @param {boolean=} copy Whether to copy the backing buffer or to return another view on the same, defaults to `false`\r\n     * @returns {!ByteBuffer} Cloned instance\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.clone = function(copy) {\r\n        var bb = new ByteBuffer(0, this.littleEndian, this.noAssert);\r\n        if (copy) {\r\n            bb.buffer = new ArrayBuffer(this.buffer.byteLength);\r\n            bb.view = new Uint8Array(bb.buffer);\r\n        } else {\r\n            bb.buffer = this.buffer;\r\n            bb.view = this.view;\r\n        }\r\n        bb.offset = this.offset;\r\n        bb.markedOffset = this.markedOffset;\r\n        bb.limit = this.limit;\r\n        return bb;\r\n    };\r\n\r\n    /**\r\n     * Compacts this ByteBuffer to be backed by a {@link ByteBuffer#buffer} of its contents' length. Contents are the bytes\r\n     *  between {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. Will set `offset = 0` and `limit = capacity` and\r\n     *  adapt {@link ByteBuffer#markedOffset} to the same relative position if set.\r\n     * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}\r\n     * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.compact = function(begin, end) {\r\n        if (typeof begin === 'undefined') begin = this.offset;\r\n        if (typeof end === 'undefined') end = this.limit;\r\n        if (!this.noAssert) {\r\n            if (typeof begin !== 'number' || begin % 1 !== 0)\n                throw TypeError(\"Illegal begin: Not an integer\");\n            begin >>>= 0;\n            if (typeof end !== 'number' || end % 1 !== 0)\n                throw TypeError(\"Illegal end: Not an integer\");\n            end >>>= 0;\n            if (begin < 0 || begin > end || end > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n        }\r\n        if (begin === 0 && end === this.buffer.byteLength)\r\n            return this; // Already compacted\r\n        var len = end - begin;\r\n        if (len === 0) {\r\n            this.buffer = EMPTY_BUFFER;\r\n            this.view = null;\r\n            if (this.markedOffset >= 0) this.markedOffset -= begin;\r\n            this.offset = 0;\r\n            this.limit = 0;\r\n            return this;\r\n        }\r\n        var buffer = new ArrayBuffer(len);\r\n        var view = new Uint8Array(buffer);\r\n        view.set(this.view.subarray(begin, end));\r\n        this.buffer = buffer;\r\n        this.view = view;\r\n        if (this.markedOffset >= 0) this.markedOffset -= begin;\r\n        this.offset = 0;\r\n        this.limit = len;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Creates a copy of this ByteBuffer's contents. Contents are the bytes between {@link ByteBuffer#offset} and\r\n     *  {@link ByteBuffer#limit}.\r\n     * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.\r\n     * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n     * @returns {!ByteBuffer} Copy\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.copy = function(begin, end) {\r\n        if (typeof begin === 'undefined') begin = this.offset;\r\n        if (typeof end === 'undefined') end = this.limit;\r\n        if (!this.noAssert) {\r\n            if (typeof begin !== 'number' || begin % 1 !== 0)\n                throw TypeError(\"Illegal begin: Not an integer\");\n            begin >>>= 0;\n            if (typeof end !== 'number' || end % 1 !== 0)\n                throw TypeError(\"Illegal end: Not an integer\");\n            end >>>= 0;\n            if (begin < 0 || begin > end || end > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n        }\r\n        if (begin === end)\r\n            return new ByteBuffer(0, this.littleEndian, this.noAssert);\r\n        var capacity = end - begin,\r\n            bb = new ByteBuffer(capacity, this.littleEndian, this.noAssert);\r\n        bb.offset = 0;\r\n        bb.limit = capacity;\r\n        if (bb.markedOffset >= 0) bb.markedOffset -= begin;\r\n        this.copyTo(bb, 0, begin, end);\r\n        return bb;\r\n    };\r\n\r\n    /**\r\n     * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between {@link ByteBuffer#offset} and\r\n     *  {@link ByteBuffer#limit}.\r\n     * @param {!ByteBuffer} target Target ByteBuffer\r\n     * @param {number=} targetOffset Offset to copy to. Will use and increase the target's {@link ByteBuffer#offset}\r\n     *  by the number of bytes copied if omitted.\r\n     * @param {number=} sourceOffset Offset to start copying from. Will use and increase {@link ByteBuffer#offset} by the\r\n     *  number of bytes copied if omitted.\r\n     * @param {number=} sourceLimit Offset to end copying from, defaults to {@link ByteBuffer#limit}\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.copyTo = function(target, targetOffset, sourceOffset, sourceLimit) {\r\n        var relative,\r\n            targetRelative;\r\n        if (!this.noAssert) {\r\n            if (!ByteBuffer.isByteBuffer(target))\r\n                throw TypeError(\"Illegal target: Not a ByteBuffer\");\r\n        }\r\n        targetOffset = (targetRelative = typeof targetOffset === 'undefined') ? target.offset : targetOffset | 0;\r\n        sourceOffset = (relative = typeof sourceOffset === 'undefined') ? this.offset : sourceOffset | 0;\r\n        sourceLimit = typeof sourceLimit === 'undefined' ? this.limit : sourceLimit | 0;\r\n\r\n        if (targetOffset < 0 || targetOffset > target.buffer.byteLength)\r\n            throw RangeError(\"Illegal target range: 0 <= \"+targetOffset+\" <= \"+target.buffer.byteLength);\r\n        if (sourceOffset < 0 || sourceLimit > this.buffer.byteLength)\r\n            throw RangeError(\"Illegal source range: 0 <= \"+sourceOffset+\" <= \"+this.buffer.byteLength);\r\n\r\n        var len = sourceLimit - sourceOffset;\r\n        if (len === 0)\r\n            return target; // Nothing to copy\r\n\r\n        target.ensureCapacity(targetOffset + len);\r\n\r\n        target.view.set(this.view.subarray(sourceOffset, sourceLimit), targetOffset);\r\n\r\n        if (relative) this.offset += len;\r\n        if (targetRelative) target.offset += len;\r\n\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Makes sure that this ByteBuffer is backed by a {@link ByteBuffer#buffer} of at least the specified capacity. If the\r\n     *  current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity,\r\n     *  the required capacity will be used instead.\r\n     * @param {number} capacity Required capacity\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.ensureCapacity = function(capacity) {\r\n        var current = this.buffer.byteLength;\r\n        if (current < capacity)\r\n            return this.resize((current *= 2) > capacity ? current : capacity);\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between\r\n     *  {@link ByteBuffer#offset} and {@link ByteBuffer#limit}.\r\n     * @param {number|string} value Byte value to fill with. If given as a string, the first character is used.\r\n     * @param {number=} begin Begin offset. Will use and increase {@link ByteBuffer#offset} by the number of bytes\r\n     *  written if omitted. defaults to {@link ByteBuffer#offset}.\r\n     * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     * @example `someByteBuffer.clear().fill(0)` fills the entire backing buffer with zeroes\r\n     */\r\n    ByteBufferPrototype.fill = function(value, begin, end) {\r\n        var relative = typeof begin === 'undefined';\n        if (relative) begin = this.offset;\n        if (typeof value === 'string' && value.length > 0)\r\n            value = value.charCodeAt(0);\r\n        if (typeof begin === 'undefined') begin = this.offset;\r\n        if (typeof end === 'undefined') end = this.limit;\r\n        if (!this.noAssert) {\r\n            if (typeof value !== 'number' || value % 1 !== 0)\n                throw TypeError(\"Illegal value: \"+value+\" (not an integer)\");\n            value |= 0;\n            if (typeof begin !== 'number' || begin % 1 !== 0)\n                throw TypeError(\"Illegal begin: Not an integer\");\n            begin >>>= 0;\n            if (typeof end !== 'number' || end % 1 !== 0)\n                throw TypeError(\"Illegal end: Not an integer\");\n            end >>>= 0;\n            if (begin < 0 || begin > end || end > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n        }\r\n        if (begin >= end)\r\n            return this; // Nothing to fill\r\n        while (begin < end) this.view[begin++] = value;\r\n        if (relative) this.offset = begin;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets `limit = offset` and\r\n     *  `offset = 0`. Make sure always to flip a ByteBuffer when all relative read or write operations are complete.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.flip = function() {\r\n        this.limit = this.offset;\r\n        this.offset = 0;\r\n        return this;\r\n    };\r\n    /**\r\n     * Marks an offset on this ByteBuffer to be used later.\r\n     * @param {number=} offset Offset to mark. Defaults to {@link ByteBuffer#offset}.\r\n     * @returns {!ByteBuffer} this\r\n     * @throws {TypeError} If `offset` is not a valid number\r\n     * @throws {RangeError} If `offset` is out of bounds\r\n     * @see ByteBuffer#reset\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.mark = function(offset) {\r\n        offset = typeof offset === 'undefined' ? this.offset : offset;\r\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        this.markedOffset = offset;\r\n        return this;\r\n    };\r\n    /**\r\n     * Sets the byte order.\r\n     * @param {boolean} littleEndian `true` for little endian byte order, `false` for big endian\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.order = function(littleEndian) {\r\n        if (!this.noAssert) {\r\n            if (typeof littleEndian !== 'boolean')\r\n                throw TypeError(\"Illegal littleEndian: Not a boolean\");\r\n        }\r\n        this.littleEndian = !!littleEndian;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Switches (to) little endian byte order.\r\n     * @param {boolean=} littleEndian Defaults to `true`, otherwise uses big endian\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.LE = function(littleEndian) {\r\n        this.littleEndian = typeof littleEndian !== 'undefined' ? !!littleEndian : true;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Switches (to) big endian byte order.\r\n     * @param {boolean=} bigEndian Defaults to `true`, otherwise uses little endian\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.BE = function(bigEndian) {\r\n        this.littleEndian = typeof bigEndian !== 'undefined' ? !bigEndian : false;\r\n        return this;\r\n    };\r\n    /**\r\n     * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the\r\n     *  prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer\r\n     *  will be resized and its contents moved accordingly.\r\n     * @param {!ByteBuffer|string|!ArrayBuffer} source Data to prepend. If `source` is a ByteBuffer, its offset will be\r\n     *  modified according to the performed read operation.\r\n     * @param {(string|number)=} encoding Encoding if `data` is a string (\"base64\", \"hex\", \"binary\", defaults to \"utf8\")\r\n     * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes\r\n     *  prepended if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     * @example A relative `00<01 02 03>.prepend(<04 05>)` results in `<04 05 01 02 03>, 04 05|`\r\n     * @example An absolute `00<01 02 03>.prepend(<04 05>, 2)` results in `04<05 02 03>, 04 05|`\r\n     */\r\n    ByteBufferPrototype.prepend = function(source, encoding, offset) {\r\n        if (typeof encoding === 'number' || typeof encoding !== 'string') {\r\n            offset = encoding;\r\n            encoding = undefined;\r\n        }\r\n        var relative = typeof offset === 'undefined';\n        if (relative) offset = this.offset;\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: \"+offset+\" (not an integer)\");\n            offset >>>= 0;\n            if (offset < 0 || offset + 0 > this.buffer.byteLength)\n                throw RangeError(\"Illegal offset: 0 <= \"+offset+\" (+\"+0+\") <= \"+this.buffer.byteLength);\n        }\r\n        if (!(source instanceof ByteBuffer))\r\n            source = ByteBuffer.wrap(source, encoding);\r\n        var len = source.limit - source.offset;\r\n        if (len <= 0) return this; // Nothing to prepend\r\n        var diff = len - offset;\r\n        if (diff > 0) { // Not enough space before offset, so resize + move\r\n            var buffer = new ArrayBuffer(this.buffer.byteLength + diff);\r\n            var view = new Uint8Array(buffer);\r\n            view.set(this.view.subarray(offset, this.buffer.byteLength), len);\r\n            this.buffer = buffer;\r\n            this.view = view;\r\n            this.offset += diff;\r\n            if (this.markedOffset >= 0) this.markedOffset += diff;\r\n            this.limit += diff;\r\n            offset += diff;\r\n        } else {\r\n            var arrayView = new Uint8Array(this.buffer);\r\n        }\r\n        this.view.set(source.view.subarray(source.offset, source.limit), offset - len);\r\n\r\n        source.offset = source.limit;\r\n        if (relative)\r\n            this.offset -= len;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the\r\n     *  prepended data's length. If there is not enough space available before the specified `offset`, the backing buffer\r\n     *  will be resized and its contents moved accordingly.\r\n     * @param {!ByteBuffer} target Target ByteBuffer\r\n     * @param {number=} offset Offset to prepend at. Will use and decrease {@link ByteBuffer#offset} by the number of bytes\r\n     *  prepended if omitted.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     * @see ByteBuffer#prepend\r\n     */\r\n    ByteBufferPrototype.prependTo = function(target, offset) {\r\n        target.prepend(this, offset);\r\n        return this;\r\n    };\r\n    /**\r\n     * Prints debug information about this ByteBuffer's contents.\r\n     * @param {function(string)=} out Output function to call, defaults to console.log\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.printDebug = function(out) {\r\n        if (typeof out !== 'function') out = console.log.bind(console);\r\n        out(\r\n            this.toString()+\"\\n\"+\r\n            \"-------------------------------------------------------------------\\n\"+\r\n            this.toDebug(/* columns */ true)\r\n        );\r\n    };\r\n\r\n    /**\r\n     * Gets the number of remaining readable bytes. Contents are the bytes between {@link ByteBuffer#offset} and\r\n     *  {@link ByteBuffer#limit}, so this returns `limit - offset`.\r\n     * @returns {number} Remaining readable bytes. May be negative if `offset > limit`.\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.remaining = function() {\r\n        return this.limit - this.offset;\r\n    };\r\n    /**\r\n     * Resets this ByteBuffer's {@link ByteBuffer#offset}. If an offset has been marked through {@link ByteBuffer#mark}\r\n     *  before, `offset` will be set to {@link ByteBuffer#markedOffset}, which will then be discarded. If no offset has been\r\n     *  marked, sets `offset = 0`.\r\n     * @returns {!ByteBuffer} this\r\n     * @see ByteBuffer#mark\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.reset = function() {\r\n        if (this.markedOffset >= 0) {\r\n            this.offset = this.markedOffset;\r\n            this.markedOffset = -1;\r\n        } else {\r\n            this.offset = 0;\r\n        }\r\n        return this;\r\n    };\r\n    /**\r\n     * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that\r\n     *  large or larger.\r\n     * @param {number} capacity Capacity required\r\n     * @returns {!ByteBuffer} this\r\n     * @throws {TypeError} If `capacity` is not a number\r\n     * @throws {RangeError} If `capacity < 0`\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.resize = function(capacity) {\r\n        if (!this.noAssert) {\r\n            if (typeof capacity !== 'number' || capacity % 1 !== 0)\n                throw TypeError(\"Illegal capacity: \"+capacity+\" (not an integer)\");\n            capacity |= 0;\n            if (capacity < 0)\r\n                throw RangeError(\"Illegal capacity: 0 <= \"+capacity);\r\n        }\r\n        if (this.buffer.byteLength < capacity) {\r\n            var buffer = new ArrayBuffer(capacity);\r\n            var view = new Uint8Array(buffer);\r\n            view.set(this.view);\r\n            this.buffer = buffer;\r\n            this.view = view;\r\n        }\r\n        return this;\r\n    };\r\n    /**\r\n     * Reverses this ByteBuffer's contents.\r\n     * @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}\r\n     * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.reverse = function(begin, end) {\r\n        if (typeof begin === 'undefined') begin = this.offset;\r\n        if (typeof end === 'undefined') end = this.limit;\r\n        if (!this.noAssert) {\r\n            if (typeof begin !== 'number' || begin % 1 !== 0)\n                throw TypeError(\"Illegal begin: Not an integer\");\n            begin >>>= 0;\n            if (typeof end !== 'number' || end % 1 !== 0)\n                throw TypeError(\"Illegal end: Not an integer\");\n            end >>>= 0;\n            if (begin < 0 || begin > end || end > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n        }\r\n        if (begin === end)\r\n            return this; // Nothing to reverse\r\n        Array.prototype.reverse.call(this.view.subarray(begin, end));\r\n        return this;\r\n    };\r\n    /**\r\n     * Skips the next `length` bytes. This will just advance\r\n     * @param {number} length Number of bytes to skip. May also be negative to move the offset back.\r\n     * @returns {!ByteBuffer} this\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.skip = function(length) {\r\n        if (!this.noAssert) {\r\n            if (typeof length !== 'number' || length % 1 !== 0)\n                throw TypeError(\"Illegal length: \"+length+\" (not an integer)\");\n            length |= 0;\n        }\r\n        var offset = this.offset + length;\r\n        if (!this.noAssert) {\r\n            if (offset < 0 || offset > this.buffer.byteLength)\r\n                throw RangeError(\"Illegal length: 0 <= \"+this.offset+\" + \"+length+\" <= \"+this.buffer.byteLength);\r\n        }\r\n        this.offset = offset;\r\n        return this;\r\n    };\r\n\r\n    /**\r\n     * Slices this ByteBuffer by creating a cloned instance with `offset = begin` and `limit = end`.\r\n     * @param {number=} begin Begin offset, defaults to {@link ByteBuffer#offset}.\r\n     * @param {number=} end End offset, defaults to {@link ByteBuffer#limit}.\r\n     * @returns {!ByteBuffer} Clone of this ByteBuffer with slicing applied, backed by the same {@link ByteBuffer#buffer}\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.slice = function(begin, end) {\r\n        if (typeof begin === 'undefined') begin = this.offset;\r\n        if (typeof end === 'undefined') end = this.limit;\r\n        if (!this.noAssert) {\r\n            if (typeof begin !== 'number' || begin % 1 !== 0)\n                throw TypeError(\"Illegal begin: Not an integer\");\n            begin >>>= 0;\n            if (typeof end !== 'number' || end % 1 !== 0)\n                throw TypeError(\"Illegal end: Not an integer\");\n            end >>>= 0;\n            if (begin < 0 || begin > end || end > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n        }\r\n        var bb = this.clone();\r\n        bb.offset = begin;\r\n        bb.limit = end;\r\n        return bb;\r\n    };\r\n    /**\r\n     * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between\r\n     *  {@link ByteBuffer#offset} and {@link ByteBuffer#limit}.\r\n     * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory if\r\n     *  possible. Defaults to `false`\r\n     * @returns {!ArrayBuffer} Contents as an ArrayBuffer\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.toBuffer = function(forceCopy) {\r\n        var offset = this.offset,\r\n            limit = this.limit;\r\n        if (!this.noAssert) {\r\n            if (typeof offset !== 'number' || offset % 1 !== 0)\n                throw TypeError(\"Illegal offset: Not an integer\");\n            offset >>>= 0;\n            if (typeof limit !== 'number' || limit % 1 !== 0)\n                throw TypeError(\"Illegal limit: Not an integer\");\n            limit >>>= 0;\n            if (offset < 0 || offset > limit || limit > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+offset+\" <= \"+limit+\" <= \"+this.buffer.byteLength);\n        }\r\n        // NOTE: It's not possible to have another ArrayBuffer reference the same memory as the backing buffer. This is\r\n        // possible with Uint8Array#subarray only, but we have to return an ArrayBuffer by contract. So:\r\n        if (!forceCopy && offset === 0 && limit === this.buffer.byteLength)\r\n            return this.buffer;\r\n        if (offset === limit)\r\n            return EMPTY_BUFFER;\r\n        var buffer = new ArrayBuffer(limit - offset);\r\n        new Uint8Array(buffer).set(new Uint8Array(this.buffer).subarray(offset, limit), 0);\r\n        return buffer;\r\n    };\r\n\r\n    /**\r\n     * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between\r\n     *  {@link ByteBuffer#offset} and {@link ByteBuffer#limit}. This is an alias of {@link ByteBuffer#toBuffer}.\r\n     * @function\r\n     * @param {boolean=} forceCopy If `true` returns a copy, otherwise returns a view referencing the same memory.\r\n     *  Defaults to `false`\r\n     * @returns {!ArrayBuffer} Contents as an ArrayBuffer\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.toArrayBuffer = ByteBufferPrototype.toBuffer;\r\n\r\n    /**\r\n     * Converts the ByteBuffer's contents to a string.\r\n     * @param {string=} encoding Output encoding. Returns an informative string representation if omitted but also allows\r\n     *  direct conversion to \"utf8\", \"hex\", \"base64\" and \"binary\" encoding. \"debug\" returns a hex representation with\r\n     *  highlighted offsets.\r\n     * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}\r\n     * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}\r\n     * @returns {string} String representation\r\n     * @throws {Error} If `encoding` is invalid\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.toString = function(encoding, begin, end) {\r\n        if (typeof encoding === 'undefined')\r\n            return \"ByteBufferAB(offset=\"+this.offset+\",markedOffset=\"+this.markedOffset+\",limit=\"+this.limit+\",capacity=\"+this.capacity()+\")\";\r\n        if (typeof encoding === 'number')\r\n            encoding = \"utf8\",\r\n            begin = encoding,\r\n            end = begin;\r\n        switch (encoding) {\r\n            case \"utf8\":\r\n                return this.toUTF8(begin, end);\r\n            case \"base64\":\r\n                return this.toBase64(begin, end);\r\n            case \"hex\":\r\n                return this.toHex(begin, end);\r\n            case \"binary\":\r\n                return this.toBinary(begin, end);\r\n            case \"debug\":\r\n                return this.toDebug();\r\n            case \"columns\":\r\n                return this.toColumns();\r\n            default:\r\n                throw Error(\"Unsupported encoding: \"+encoding);\r\n        }\r\n    };\r\n\r\n    // lxiv-embeddable\r\n\r\n    /**\r\n     * lxiv-embeddable (c) 2014 Daniel Wirtz \r\n     * Released under the Apache License, Version 2.0\r\n     * see: https://github.com/dcodeIO/lxiv for details\r\n     */\r\n    var lxiv = function() {\r\n        \"use strict\";\r\n\r\n        /**\r\n         * lxiv namespace.\r\n         * @type {!Object.}\r\n         * @exports lxiv\r\n         */\r\n        var lxiv = {};\r\n\r\n        /**\r\n         * Character codes for output.\r\n         * @type {!Array.}\r\n         * @inner\r\n         */\r\n        var aout = [\r\n            65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\r\n            81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102,\r\n            103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\r\n            119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47\r\n        ];\r\n\r\n        /**\r\n         * Character codes for input.\r\n         * @type {!Array.}\r\n         * @inner\r\n         */\r\n        var ain = [];\r\n        for (var i=0, k=aout.length; i>2)&0x3f]);\r\n                t = (b&0x3)<<4;\r\n                if ((b = src()) !== null) {\r\n                    t |= (b>>4)&0xf;\r\n                    dst(aout[(t|((b>>4)&0xf))&0x3f]);\r\n                    t = (b&0xf)<<2;\r\n                    if ((b = src()) !== null)\r\n                        dst(aout[(t|((b>>6)&0x3))&0x3f]),\r\n                        dst(aout[b&0x3f]);\r\n                    else\r\n                        dst(aout[t&0x3f]),\r\n                        dst(61);\r\n                } else\r\n                    dst(aout[t&0x3f]),\r\n                    dst(61),\r\n                    dst(61);\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Decodes base64 char codes to bytes.\r\n         * @param {!function():number|null} src Characters source as a function returning the next char code respectively\r\n         *  `null` if there are no more characters left.\r\n         * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.\r\n         * @throws {Error} If a character code is invalid\r\n         */\r\n        lxiv.decode = function(src, dst) {\r\n            var c, t1, t2;\r\n            function fail(c) {\r\n                throw Error(\"Illegal character code: \"+c);\r\n            }\r\n            while ((c = src()) !== null) {\r\n                t1 = ain[c];\r\n                if (typeof t1 === 'undefined') fail(c);\r\n                if ((c = src()) !== null) {\r\n                    t2 = ain[c];\r\n                    if (typeof t2 === 'undefined') fail(c);\r\n                    dst((t1<<2)>>>0|(t2&0x30)>>4);\r\n                    if ((c = src()) !== null) {\r\n                        t1 = ain[c];\r\n                        if (typeof t1 === 'undefined')\r\n                            if (c === 61) break; else fail(c);\r\n                        dst(((t2&0xf)<<4)>>>0|(t1&0x3c)>>2);\r\n                        if ((c = src()) !== null) {\r\n                            t2 = ain[c];\r\n                            if (typeof t2 === 'undefined')\r\n                                if (c === 61) break; else fail(c);\r\n                            dst(((t1&0x3)<<6)>>>0|t2);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Tests if a string is valid base64.\r\n         * @param {string} str String to test\r\n         * @returns {boolean} `true` if valid, otherwise `false`\r\n         */\r\n        lxiv.test = function(str) {\r\n            return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(str);\r\n        };\r\n\r\n        return lxiv;\r\n    }();\r\n\r\n    // encodings/base64\r\n\r\n    /**\r\n     * Encodes this ByteBuffer's contents to a base64 encoded string.\r\n     * @param {number=} begin Offset to begin at, defaults to {@link ByteBuffer#offset}.\r\n     * @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}.\r\n     * @returns {string} Base64 encoded string\r\n     * @throws {RangeError} If `begin` or `end` is out of bounds\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.toBase64 = function(begin, end) {\r\n        if (typeof begin === 'undefined')\r\n            begin = this.offset;\r\n        if (typeof end === 'undefined')\r\n            end = this.limit;\r\n        begin = begin | 0; end = end | 0;\r\n        if (begin < 0 || end > this.capacity || begin > end)\r\n            throw RangeError(\"begin, end\");\r\n        var sd; lxiv.encode(function() {\r\n            return begin < end ? this.view[begin++] : null;\r\n        }.bind(this), sd = stringDestination());\r\n        return sd();\r\n    };\r\n\r\n    /**\r\n     * Decodes a base64 encoded string to a ByteBuffer.\r\n     * @param {string} str String to decode\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @returns {!ByteBuffer} ByteBuffer\r\n     * @expose\r\n     */\r\n    ByteBuffer.fromBase64 = function(str, littleEndian) {\r\n        if (typeof str !== 'string')\r\n            throw TypeError(\"str\");\r\n        var bb = new ByteBuffer(str.length/4*3, littleEndian),\r\n            i = 0;\r\n        lxiv.decode(stringSource(str), function(b) {\r\n            bb.view[i++] = b;\r\n        });\r\n        bb.limit = i;\r\n        return bb;\r\n    };\r\n\r\n    /**\r\n     * Encodes a binary string to base64 like `window.btoa` does.\r\n     * @param {string} str Binary string\r\n     * @returns {string} Base64 encoded string\r\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.btoa\r\n     * @expose\r\n     */\r\n    ByteBuffer.btoa = function(str) {\r\n        return ByteBuffer.fromBinary(str).toBase64();\r\n    };\r\n\r\n    /**\r\n     * Decodes a base64 encoded string to binary like `window.atob` does.\r\n     * @param {string} b64 Base64 encoded string\r\n     * @returns {string} Binary string\r\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/Window.atob\r\n     * @expose\r\n     */\r\n    ByteBuffer.atob = function(b64) {\r\n        return ByteBuffer.fromBase64(b64).toBinary();\r\n    };\r\n\r\n    // encodings/binary\r\n\r\n    /**\r\n     * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes.\r\n     * @param {number=} begin Offset to begin at. Defaults to {@link ByteBuffer#offset}.\r\n     * @param {number=} end Offset to end at. Defaults to {@link ByteBuffer#limit}.\r\n     * @returns {string} Binary encoded string\r\n     * @throws {RangeError} If `offset > limit`\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.toBinary = function(begin, end) {\r\n        if (typeof begin === 'undefined')\r\n            begin = this.offset;\r\n        if (typeof end === 'undefined')\r\n            end = this.limit;\r\n        begin |= 0; end |= 0;\r\n        if (begin < 0 || end > this.capacity() || begin > end)\r\n            throw RangeError(\"begin, end\");\r\n        if (begin === end)\r\n            return \"\";\r\n        var chars = [],\r\n            parts = [];\r\n        while (begin < end) {\r\n            chars.push(this.view[begin++]);\r\n            if (chars.length >= 1024)\r\n                parts.push(String.fromCharCode.apply(String, chars)),\r\n                chars = [];\r\n        }\r\n        return parts.join('') + String.fromCharCode.apply(String, chars);\r\n    };\r\n\r\n    /**\r\n     * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer.\r\n     * @param {string} str String to decode\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @returns {!ByteBuffer} ByteBuffer\r\n     * @expose\r\n     */\r\n    ByteBuffer.fromBinary = function(str, littleEndian) {\r\n        if (typeof str !== 'string')\r\n            throw TypeError(\"str\");\r\n        var i = 0,\r\n            k = str.length,\r\n            charCode,\r\n            bb = new ByteBuffer(k, littleEndian);\r\n        while (i 0xff)\r\n                throw RangeError(\"illegal char code: \"+charCode);\r\n            bb.view[i++] = charCode;\r\n        }\r\n        bb.limit = k;\r\n        return bb;\r\n    };\r\n\r\n    // encodings/debug\r\n\r\n    /**\r\n     * Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are:\r\n     * * `<` : offset,\r\n     * * `'` : markedOffset,\r\n     * * `>` : limit,\r\n     * * `|` : offset and limit,\r\n     * * `[` : offset and markedOffset,\r\n     * * `]` : markedOffset and limit,\r\n     * * `!` : offset, markedOffset and limit\r\n     * @param {boolean=} columns If `true` returns two columns hex + ascii, defaults to `false`\r\n     * @returns {string|!Array.} Debug string or array of lines if `asArray = true`\r\n     * @expose\r\n     * @example `>00'01 02<03` contains four bytes with `limit=0, markedOffset=1, offset=3`\r\n     * @example `00[01 02 03>` contains four bytes with `offset=markedOffset=1, limit=4`\r\n     * @example `00|01 02 03` contains four bytes with `offset=limit=1, markedOffset=-1`\r\n     * @example `|` contains zero bytes with `offset=limit=0, markedOffset=-1`\r\n     */\r\n    ByteBufferPrototype.toDebug = function(columns) {\r\n        var i = -1,\r\n            k = this.buffer.byteLength,\r\n            b,\r\n            hex = \"\",\r\n            asc = \"\",\r\n            out = \"\";\r\n        while (i 32 && b < 127 ? String.fromCharCode(b) : '.';\r\n            }\r\n            ++i;\r\n            if (columns) {\r\n                if (i > 0 && i % 16 === 0 && i !== k) {\r\n                    while (hex.length < 3*16+3) hex += \" \";\r\n                    out += hex+asc+\"\\n\";\r\n                    hex = asc = \"\";\r\n                }\r\n            }\r\n            if (i === this.offset && i === this.limit)\r\n                hex += i === this.markedOffset ? \"!\" : \"|\";\r\n            else if (i === this.offset)\r\n                hex += i === this.markedOffset ? \"[\" : \"<\";\r\n            else if (i === this.limit)\r\n                hex += i === this.markedOffset ? \"]\" : \">\";\r\n            else\r\n                hex += i === this.markedOffset ? \"'\" : (columns || (i !== 0 && i !== k) ? \" \" : \"\");\r\n        }\r\n        if (columns && hex !== \" \") {\r\n            while (hex.length < 3*16+3)\r\n                hex += \" \";\r\n            out += hex + asc + \"\\n\";\r\n        }\r\n        return columns ? out : hex;\r\n    };\r\n\r\n    /**\r\n     * Decodes a hex encoded string with marked offsets to a ByteBuffer.\r\n     * @param {string} str Debug string to decode (not be generated with `columns = true`)\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n     * @returns {!ByteBuffer} ByteBuffer\r\n     * @expose\r\n     * @see ByteBuffer#toDebug\r\n     */\r\n    ByteBuffer.fromDebug = function(str, littleEndian, noAssert) {\r\n        var k = str.length,\r\n            bb = new ByteBuffer(((k+1)/3)|0, littleEndian, noAssert);\r\n        var i = 0, j = 0, ch, b,\r\n            rs = false, // Require symbol next\r\n            ho = false, hm = false, hl = false, // Already has offset (ho), markedOffset (hm), limit (hl)?\r\n            fail = false;\r\n        while (i':\r\n                    if (!noAssert) {\r\n                        if (hl) {\r\n                            fail = true;\r\n                            break;\r\n                        }\r\n                        hl = true;\r\n                    }\r\n                    bb.limit = j;\r\n                    rs = false;\r\n                    break;\r\n                case \"'\":\r\n                    if (!noAssert) {\r\n                        if (hm) {\r\n                            fail = true;\r\n                            break;\r\n                        }\r\n                        hm = true;\r\n                    }\r\n                    bb.markedOffset = j;\r\n                    rs = false;\r\n                    break;\r\n                case ' ':\r\n                    rs = false;\r\n                    break;\r\n                default:\r\n                    if (!noAssert) {\r\n                        if (rs) {\r\n                            fail = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    b = parseInt(ch+str.charAt(i++), 16);\r\n                    if (!noAssert) {\r\n                        if (isNaN(b) || b < 0 || b > 255)\r\n                            throw TypeError(\"Illegal str: Not a debug encoded string\");\r\n                    }\r\n                    bb.view[j++] = b;\r\n                    rs = true;\r\n            }\r\n            if (fail)\r\n                throw TypeError(\"Illegal str: Invalid symbol at \"+i);\r\n        }\r\n        if (!noAssert) {\r\n            if (!ho || !hl)\r\n                throw TypeError(\"Illegal str: Missing offset or limit\");\r\n            if (j>>= 0;\n            if (typeof end !== 'number' || end % 1 !== 0)\n                throw TypeError(\"Illegal end: Not an integer\");\n            end >>>= 0;\n            if (begin < 0 || begin > end || end > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n        }\r\n        var out = new Array(end - begin),\r\n            b;\r\n        while (begin < end) {\r\n            b = this.view[begin++];\r\n            if (b < 0x10)\r\n                out.push(\"0\", b.toString(16));\r\n            else out.push(b.toString(16));\r\n        }\r\n        return out.join('');\r\n    };\r\n\r\n    /**\r\n     * Decodes a hex encoded string to a ByteBuffer.\r\n     * @param {string} str String to decode\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n     * @returns {!ByteBuffer} ByteBuffer\r\n     * @expose\r\n     */\r\n    ByteBuffer.fromHex = function(str, littleEndian, noAssert) {\r\n        if (!noAssert) {\r\n            if (typeof str !== 'string')\r\n                throw TypeError(\"Illegal str: Not a string\");\r\n            if (str.length % 2 !== 0)\r\n                throw TypeError(\"Illegal str: Length not a multiple of 2\");\r\n        }\r\n        var k = str.length,\r\n            bb = new ByteBuffer((k / 2) | 0, littleEndian),\r\n            b;\r\n        for (var i=0, j=0; i 255)\r\n                    throw TypeError(\"Illegal str: Contains non-hex characters\");\r\n            bb.view[j++] = b;\r\n        }\r\n        bb.limit = j;\r\n        return bb;\r\n    };\r\n\r\n    // utfx-embeddable\r\n\r\n    /**\r\n     * utfx-embeddable (c) 2014 Daniel Wirtz \r\n     * Released under the Apache License, Version 2.0\r\n     * see: https://github.com/dcodeIO/utfx for details\r\n     */\r\n    var utfx = function() {\r\n        \"use strict\";\r\n\r\n        /**\r\n         * utfx namespace.\r\n         * @inner\r\n         * @type {!Object.}\r\n         */\r\n        var utfx = {};\r\n\r\n        /**\r\n         * Maximum valid code point.\r\n         * @type {number}\r\n         * @const\r\n         */\r\n        utfx.MAX_CODEPOINT = 0x10FFFF;\r\n\r\n        /**\r\n         * Encodes UTF8 code points to UTF8 bytes.\r\n         * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point\r\n         *  respectively `null` if there are no more code points left or a single numeric code point.\r\n         * @param {!function(number)} dst Bytes destination as a function successively called with the next byte\r\n         */\r\n        utfx.encodeUTF8 = function(src, dst) {\r\n            var cp = null;\r\n            if (typeof src === 'number')\r\n                cp = src,\r\n                src = function() { return null; };\r\n            while (cp !== null || (cp = src()) !== null) {\r\n                if (cp < 0x80)\r\n                    dst(cp&0x7F);\r\n                else if (cp < 0x800)\r\n                    dst(((cp>>6)&0x1F)|0xC0),\r\n                    dst((cp&0x3F)|0x80);\r\n                else if (cp < 0x10000)\r\n                    dst(((cp>>12)&0x0F)|0xE0),\r\n                    dst(((cp>>6)&0x3F)|0x80),\r\n                    dst((cp&0x3F)|0x80);\r\n                else\r\n                    dst(((cp>>18)&0x07)|0xF0),\r\n                    dst(((cp>>12)&0x3F)|0x80),\r\n                    dst(((cp>>6)&0x3F)|0x80),\r\n                    dst((cp&0x3F)|0x80);\r\n                cp = null;\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Decodes UTF8 bytes to UTF8 code points.\r\n         * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there\r\n         *  are no more bytes left.\r\n         * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point.\r\n         * @throws {RangeError} If a starting byte is invalid in UTF8\r\n         * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the\r\n         *  remaining bytes.\r\n         */\r\n        utfx.decodeUTF8 = function(src, dst) {\r\n            var a, b, c, d, fail = function(b) {\r\n                b = b.slice(0, b.indexOf(null));\r\n                var err = Error(b.toString());\r\n                err.name = \"TruncatedError\";\r\n                err['bytes'] = b;\r\n                throw err;\r\n            };\r\n            while ((a = src()) !== null) {\r\n                if ((a&0x80) === 0)\r\n                    dst(a);\r\n                else if ((a&0xE0) === 0xC0)\r\n                    ((b = src()) === null) && fail([a, b]),\r\n                    dst(((a&0x1F)<<6) | (b&0x3F));\r\n                else if ((a&0xF0) === 0xE0)\r\n                    ((b=src()) === null || (c=src()) === null) && fail([a, b, c]),\r\n                    dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F));\r\n                else if ((a&0xF8) === 0xF0)\r\n                    ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]),\r\n                    dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F));\r\n                else throw RangeError(\"Illegal starting byte: \"+a);\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Converts UTF16 characters to UTF8 code points.\r\n         * @param {!function():number|null} src Characters source as a function returning the next char code respectively\r\n         *  `null` if there are no more characters left.\r\n         * @param {!function(number)} dst Code points destination as a function successively called with each converted code\r\n         *  point.\r\n         */\r\n        utfx.UTF16toUTF8 = function(src, dst) {\r\n            var c1, c2 = null;\r\n            while (true) {\r\n                if ((c1 = c2 !== null ? c2 : src()) === null)\r\n                    break;\r\n                if (c1 >= 0xD800 && c1 <= 0xDFFF) {\r\n                    if ((c2 = src()) !== null) {\r\n                        if (c2 >= 0xDC00 && c2 <= 0xDFFF) {\r\n                            dst((c1-0xD800)*0x400+c2-0xDC00+0x10000);\r\n                            c2 = null; continue;\r\n                        }\r\n                    }\r\n                }\r\n                dst(c1);\r\n            }\r\n            if (c2 !== null) dst(c2);\r\n        };\r\n\r\n        /**\r\n         * Converts UTF8 code points to UTF16 characters.\r\n         * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point\r\n         *  respectively `null` if there are no more code points left or a single numeric code point.\r\n         * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.\r\n         * @throws {RangeError} If a code point is out of range\r\n         */\r\n        utfx.UTF8toUTF16 = function(src, dst) {\r\n            var cp = null;\r\n            if (typeof src === 'number')\r\n                cp = src, src = function() { return null; };\r\n            while (cp !== null || (cp = src()) !== null) {\r\n                if (cp <= 0xFFFF)\r\n                    dst(cp);\r\n                else\r\n                    cp -= 0x10000,\r\n                    dst((cp>>10)+0xD800),\r\n                    dst((cp%0x400)+0xDC00);\r\n                cp = null;\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Converts and encodes UTF16 characters to UTF8 bytes.\r\n         * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`\r\n         *  if there are no more characters left.\r\n         * @param {!function(number)} dst Bytes destination as a function successively called with the next byte.\r\n         */\r\n        utfx.encodeUTF16toUTF8 = function(src, dst) {\r\n            utfx.UTF16toUTF8(src, function(cp) {\r\n                utfx.encodeUTF8(cp, dst);\r\n            });\r\n        };\r\n\r\n        /**\r\n         * Decodes and converts UTF8 bytes to UTF16 characters.\r\n         * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there\r\n         *  are no more bytes left.\r\n         * @param {!function(number)} dst Characters destination as a function successively called with each converted char code.\r\n         * @throws {RangeError} If a starting byte is invalid in UTF8\r\n         * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes.\r\n         */\r\n        utfx.decodeUTF8toUTF16 = function(src, dst) {\r\n            utfx.decodeUTF8(src, function(cp) {\r\n                utfx.UTF8toUTF16(cp, dst);\r\n            });\r\n        };\r\n\r\n        /**\r\n         * Calculates the byte length of an UTF8 code point.\r\n         * @param {number} cp UTF8 code point\r\n         * @returns {number} Byte length\r\n         */\r\n        utfx.calculateCodePoint = function(cp) {\r\n            return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n        };\r\n\r\n        /**\r\n         * Calculates the number of UTF8 bytes required to store UTF8 code points.\r\n         * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively\r\n         *  `null` if there are no more code points left.\r\n         * @returns {number} The number of UTF8 bytes required\r\n         */\r\n        utfx.calculateUTF8 = function(src) {\r\n            var cp, l=0;\r\n            while ((cp = src()) !== null)\r\n                l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n            return l;\r\n        };\r\n\r\n        /**\r\n         * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes.\r\n         * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively\r\n         *  `null` if there are no more characters left.\r\n         * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1.\r\n         */\r\n        utfx.calculateUTF16asUTF8 = function(src) {\r\n            var n=0, l=0;\r\n            utfx.UTF16toUTF8(src, function(cp) {\r\n                ++n; l += (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4;\r\n            });\r\n            return [n,l];\r\n        };\r\n\r\n        return utfx;\r\n    }();\r\n\r\n    // encodings/utf8\r\n\r\n    /**\r\n     * Encodes this ByteBuffer's contents between {@link ByteBuffer#offset} and {@link ByteBuffer#limit} to an UTF8 encoded\r\n     *  string.\r\n     * @returns {string} Hex encoded string\r\n     * @throws {RangeError} If `offset > limit`\r\n     * @expose\r\n     */\r\n    ByteBufferPrototype.toUTF8 = function(begin, end) {\r\n        if (typeof begin === 'undefined') begin = this.offset;\r\n        if (typeof end === 'undefined') end = this.limit;\r\n        if (!this.noAssert) {\r\n            if (typeof begin !== 'number' || begin % 1 !== 0)\n                throw TypeError(\"Illegal begin: Not an integer\");\n            begin >>>= 0;\n            if (typeof end !== 'number' || end % 1 !== 0)\n                throw TypeError(\"Illegal end: Not an integer\");\n            end >>>= 0;\n            if (begin < 0 || begin > end || end > this.buffer.byteLength)\n                throw RangeError(\"Illegal range: 0 <= \"+begin+\" <= \"+end+\" <= \"+this.buffer.byteLength);\n        }\r\n        var sd; try {\r\n            utfx.decodeUTF8toUTF16(function() {\r\n                return begin < end ? this.view[begin++] : null;\r\n            }.bind(this), sd = stringDestination());\r\n        } catch (e) {\r\n            if (begin !== end)\r\n                throw RangeError(\"Illegal range: Truncated data, \"+begin+\" != \"+end);\r\n        }\r\n        return sd();\r\n    };\r\n\r\n    /**\r\n     * Decodes an UTF8 encoded string to a ByteBuffer.\r\n     * @param {string} str String to decode\r\n     * @param {boolean=} littleEndian Whether to use little or big endian byte order. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_ENDIAN}.\r\n     * @param {boolean=} noAssert Whether to skip assertions of offsets and values. Defaults to\r\n     *  {@link ByteBuffer.DEFAULT_NOASSERT}.\r\n     * @returns {!ByteBuffer} ByteBuffer\r\n     * @expose\r\n     */\r\n    ByteBuffer.fromUTF8 = function(str, littleEndian, noAssert) {\r\n        if (!noAssert)\r\n            if (typeof str !== 'string')\r\n                throw TypeError(\"Illegal str: Not a string\");\r\n        var bb = new ByteBuffer(utfx.calculateUTF16asUTF8(stringSource(str), true)[1], littleEndian, noAssert),\r\n            i = 0;\r\n        utfx.encodeUTF16toUTF8(stringSource(str), function(b) {\r\n            bb.view[i++] = b;\r\n        });\r\n        bb.limit = i;\r\n        return bb;\r\n    };\r\n\r\n    return ByteBuffer;\r\n});\r\n","export default {};\n","/*\r\n Copyright 2013 Daniel Wirtz \r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n */\r\n\r\n/**\r\n * @license protobuf.js (c) 2013 Daniel Wirtz \r\n * Released under the Apache License, Version 2.0\r\n * see: https://github.com/dcodeIO/protobuf.js for details\r\n */\r\n(function(global, factory) {\r\n\r\n    /* AMD */ if (typeof define === 'function' && define[\"amd\"])\r\n        define([\"bytebuffer\"], factory);\r\n    /* CommonJS */ else if (typeof require === \"function\" && typeof module === \"object\" && module && module[\"exports\"])\r\n        module[\"exports\"] = factory(require(\"bytebuffer\"), true);\r\n    /* Global */ else\r\n        (global[\"dcodeIO\"] = global[\"dcodeIO\"] || {})[\"ProtoBuf\"] = factory(global[\"dcodeIO\"][\"ByteBuffer\"]);\r\n\r\n})(this, function(ByteBuffer, isCommonJS) {\r\n    \"use strict\";\r\n\r\n    /**\r\n     * The ProtoBuf namespace.\r\n     * @exports ProtoBuf\r\n     * @namespace\r\n     * @expose\r\n     */\r\n    var ProtoBuf = {};\r\n\r\n    /**\r\n     * @type {!function(new: ByteBuffer, ...[*])}\r\n     * @expose\r\n     */\r\n    ProtoBuf.ByteBuffer = ByteBuffer;\r\n\r\n    /**\r\n     * @type {?function(new: Long, ...[*])}\r\n     * @expose\r\n     */\r\n    ProtoBuf.Long = ByteBuffer.Long || null;\r\n\r\n    /**\r\n     * ProtoBuf.js version.\r\n     * @type {string}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.VERSION = \"5.0.2\";\r\n\r\n    /**\r\n     * Wire types.\r\n     * @type {Object.}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.WIRE_TYPES = {};\r\n\r\n    /**\r\n     * Varint wire type.\r\n     * @type {number}\r\n     * @expose\r\n     */\r\n    ProtoBuf.WIRE_TYPES.VARINT = 0;\r\n\r\n    /**\r\n     * Fixed 64 bits wire type.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.WIRE_TYPES.BITS64 = 1;\r\n\r\n    /**\r\n     * Length delimited wire type.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.WIRE_TYPES.LDELIM = 2;\r\n\r\n    /**\r\n     * Start group wire type.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.WIRE_TYPES.STARTGROUP = 3;\r\n\r\n    /**\r\n     * End group wire type.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.WIRE_TYPES.ENDGROUP = 4;\r\n\r\n    /**\r\n     * Fixed 32 bits wire type.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.WIRE_TYPES.BITS32 = 5;\r\n\r\n    /**\r\n     * Packable wire types.\r\n     * @type {!Array.}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.PACKABLE_WIRE_TYPES = [\r\n        ProtoBuf.WIRE_TYPES.VARINT,\r\n        ProtoBuf.WIRE_TYPES.BITS64,\r\n        ProtoBuf.WIRE_TYPES.BITS32\r\n    ];\r\n\r\n    /**\r\n     * Types.\r\n     * @dict\r\n     * @type {!Object.}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.TYPES = {\r\n        // According to the protobuf spec.\r\n        \"int32\": {\r\n            name: \"int32\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: 0\r\n        },\r\n        \"uint32\": {\r\n            name: \"uint32\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: 0\r\n        },\r\n        \"sint32\": {\r\n            name: \"sint32\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: 0\r\n        },\r\n        \"int64\": {\r\n            name: \"int64\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n        },\r\n        \"uint64\": {\r\n            name: \"uint64\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r\n        },\r\n        \"sint64\": {\r\n            name: \"sint64\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n        },\r\n        \"bool\": {\r\n            name: \"bool\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: false\r\n        },\r\n        \"double\": {\r\n            name: \"double\",\r\n            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n            defaultValue: 0\r\n        },\r\n        \"string\": {\r\n            name: \"string\",\r\n            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n            defaultValue: \"\"\r\n        },\r\n        \"bytes\": {\r\n            name: \"bytes\",\r\n            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n            defaultValue: null // overridden in the code, must be a unique instance\r\n        },\r\n        \"fixed32\": {\r\n            name: \"fixed32\",\r\n            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n            defaultValue: 0\r\n        },\r\n        \"sfixed32\": {\r\n            name: \"sfixed32\",\r\n            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n            defaultValue: 0\r\n        },\r\n        \"fixed64\": {\r\n            name: \"fixed64\",\r\n            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n            defaultValue:  ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r\n        },\r\n        \"sfixed64\": {\r\n            name: \"sfixed64\",\r\n            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r\n            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r\n        },\r\n        \"float\": {\r\n            name: \"float\",\r\n            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r\n            defaultValue: 0\r\n        },\r\n        \"enum\": {\r\n            name: \"enum\",\r\n            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r\n            defaultValue: 0\r\n        },\r\n        \"message\": {\r\n            name: \"message\",\r\n            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r\n            defaultValue: null\r\n        },\r\n        \"group\": {\r\n            name: \"group\",\r\n            wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,\r\n            defaultValue: null\r\n        }\r\n    };\r\n\r\n    /**\r\n     * Valid map key types.\r\n     * @type {!Array.>}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.MAP_KEY_TYPES = [\r\n        ProtoBuf.TYPES[\"int32\"],\r\n        ProtoBuf.TYPES[\"sint32\"],\r\n        ProtoBuf.TYPES[\"sfixed32\"],\r\n        ProtoBuf.TYPES[\"uint32\"],\r\n        ProtoBuf.TYPES[\"fixed32\"],\r\n        ProtoBuf.TYPES[\"int64\"],\r\n        ProtoBuf.TYPES[\"sint64\"],\r\n        ProtoBuf.TYPES[\"sfixed64\"],\r\n        ProtoBuf.TYPES[\"uint64\"],\r\n        ProtoBuf.TYPES[\"fixed64\"],\r\n        ProtoBuf.TYPES[\"bool\"],\r\n        ProtoBuf.TYPES[\"string\"],\r\n        ProtoBuf.TYPES[\"bytes\"]\r\n    ];\r\n\r\n    /**\r\n     * Minimum field id.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.ID_MIN = 1;\r\n\r\n    /**\r\n     * Maximum field id.\r\n     * @type {number}\r\n     * @const\r\n     * @expose\r\n     */\r\n    ProtoBuf.ID_MAX = 0x1FFFFFFF;\r\n\r\n    /**\r\n     * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.\r\n     *  Must be set prior to parsing.\r\n     * @type {boolean}\r\n     * @expose\r\n     */\r\n    ProtoBuf.convertFieldsToCamelCase = false;\r\n\r\n    /**\r\n     * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by\r\n     *  setting this to `false` prior to building messages.\r\n     * @type {boolean}\r\n     * @expose\r\n     */\r\n    ProtoBuf.populateAccessors = true;\r\n\r\n    /**\r\n     * By default, messages are populated with default values if a field is not present on the wire. To disable\r\n     *  this behavior, set this setting to `false`.\r\n     * @type {boolean}\r\n     * @expose\r\n     */\r\n    ProtoBuf.populateDefaults = true;\r\n\r\n    /**\r\n     * @alias ProtoBuf.Util\r\n     * @expose\r\n     */\r\n    ProtoBuf.Util = (function() {\r\n        \"use strict\";\r\n\r\n        /**\r\n         * ProtoBuf utilities.\r\n         * @exports ProtoBuf.Util\r\n         * @namespace\r\n         */\r\n        var Util = {};\r\n\r\n        /**\r\n         * Flag if running in node or not.\r\n         * @type {boolean}\r\n         * @const\r\n         * @expose\r\n         */\r\n        Util.IS_NODE = !!(\r\n            typeof process === 'object' && process+'' === '[object process]' && !process['browser']\r\n        );\r\n\r\n        /**\r\n         * Constructs a XMLHttpRequest object.\r\n         * @return {XMLHttpRequest}\r\n         * @throws {Error} If XMLHttpRequest is not supported\r\n         * @expose\r\n         */\r\n        Util.XHR = function() {\r\n            // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html\r\n            var XMLHttpFactories = [\r\n                function () {return new XMLHttpRequest()},\r\n                function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\r\n                function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\r\n                function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\r\n            ];\r\n            /** @type {?XMLHttpRequest} */\r\n            var xhr = null;\r\n            for (var i=0;i}\r\n     * @expose\r\n     */\r\n    ProtoBuf.Lang = {\r\n\r\n        // Characters always ending a statement\r\n        DELIM: /[\\s\\{\\}=;:\\[\\],'\"\\(\\)<>]/g,\r\n\r\n        // Field rules\r\n        RULE: /^(?:required|optional|repeated|map)$/,\r\n\r\n        // Field types\r\n        TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\r\n\r\n        // Names\r\n        NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r\n\r\n        // Type definitions\r\n        TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\r\n\r\n        // Type references\r\n        TYPEREF: /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r\n\r\n        // Fully qualified type references\r\n        FQTYPEREF: /^(?:\\.[a-zA-Z][a-zA-Z_0-9]*)+$/,\r\n\r\n        // All numbers\r\n        NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\r\n\r\n        // Decimal numbers\r\n        NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\r\n\r\n        // Hexadecimal numbers\r\n        NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\r\n\r\n        // Octal numbers\r\n        NUMBER_OCT: /^0[0-7]+$/,\r\n\r\n        // Floating point numbers\r\n        NUMBER_FLT: /^([0-9]*(\\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\r\n\r\n        // Booleans\r\n        BOOL: /^(?:true|false)$/i,\r\n\r\n        // Id numbers\r\n        ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r\n\r\n        // Negative id numbers (enum values)\r\n        NEGID: /^\\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r\n\r\n        // Whitespaces\r\n        WHITESPACE: /\\s/,\r\n\r\n        // All strings\r\n        STRING: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")|(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g,\r\n\r\n        // Double quoted strings\r\n        STRING_DQ: /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\r\n\r\n        // Single quoted strings\r\n        STRING_SQ: /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g\r\n    };\r\n\r\n\r\n    /**\r\n     * @alias ProtoBuf.Reflect\r\n     * @expose\r\n     */\r\n    ProtoBuf.Reflect = (function(ProtoBuf) {\r\n        \"use strict\";\r\n\r\n        /**\r\n         * Reflection types.\r\n         * @exports ProtoBuf.Reflect\r\n         * @namespace\r\n         */\r\n        var Reflect = {};\r\n\r\n        /**\r\n         * Constructs a Reflect base class.\r\n         * @exports ProtoBuf.Reflect.T\r\n         * @constructor\r\n         * @abstract\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {?ProtoBuf.Reflect.T} parent Parent object\r\n         * @param {string} name Object name\r\n         */\r\n        var T = function(builder, parent, name) {\r\n\r\n            /**\r\n             * Builder reference.\r\n             * @type {!ProtoBuf.Builder}\r\n             * @expose\r\n             */\r\n            this.builder = builder;\r\n\r\n            /**\r\n             * Parent object.\r\n             * @type {?ProtoBuf.Reflect.T}\r\n             * @expose\r\n             */\r\n            this.parent = parent;\r\n\r\n            /**\r\n             * Object name in namespace.\r\n             * @type {string}\r\n             * @expose\r\n             */\r\n            this.name = name;\r\n\r\n            /**\r\n             * Fully qualified class name\r\n             * @type {string}\r\n             * @expose\r\n             */\r\n            this.className;\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.T.prototype\r\n         * @inner\r\n         */\r\n        var TPrototype = T.prototype;\r\n\r\n        /**\r\n         * Returns the fully qualified name of this object.\r\n         * @returns {string} Fully qualified name as of \".PATH.TO.THIS\"\r\n         * @expose\r\n         */\r\n        TPrototype.fqn = function() {\r\n            var name = this.name,\r\n                ptr = this;\r\n            do {\r\n                ptr = ptr.parent;\r\n                if (ptr == null)\r\n                    break;\r\n                name = ptr.name+\".\"+name;\r\n            } while (true);\r\n            return name;\r\n        };\r\n\r\n        /**\r\n         * Returns a string representation of this Reflect object (its fully qualified name).\r\n         * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.\r\n         * @return String representation\r\n         * @expose\r\n         */\r\n        TPrototype.toString = function(includeClass) {\r\n            return (includeClass ? this.className + \" \" : \"\") + this.fqn();\r\n        };\r\n\r\n        /**\r\n         * Builds this type.\r\n         * @throws {Error} If this type cannot be built directly\r\n         * @expose\r\n         */\r\n        TPrototype.build = function() {\r\n            throw Error(this.toString(true)+\" cannot be built directly\");\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.T\r\n         * @expose\r\n         */\r\n        Reflect.T = T;\r\n\r\n        /**\r\n         * Constructs a new Namespace.\r\n         * @exports ProtoBuf.Reflect.Namespace\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent\r\n         * @param {string} name Namespace name\r\n         * @param {Object.=} options Namespace options\r\n         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.T\r\n         */\r\n        var Namespace = function(builder, parent, name, options, syntax) {\r\n            T.call(this, builder, parent, name);\r\n\r\n            /**\r\n             * @override\r\n             */\r\n            this.className = \"Namespace\";\r\n\r\n            /**\r\n             * Children inside the namespace.\r\n             * @type {!Array.}\r\n             */\r\n            this.children = [];\r\n\r\n            /**\r\n             * Options.\r\n             * @type {!Object.}\r\n             */\r\n            this.options = options || {};\r\n\r\n            /**\r\n             * Syntax level (e.g., proto2 or proto3).\r\n             * @type {!string}\r\n             */\r\n            this.syntax = syntax || \"proto2\";\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Namespace.prototype\r\n         * @inner\r\n         */\r\n        var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);\r\n\r\n        /**\r\n         * Returns an array of the namespace's children.\r\n         * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).\r\n         * @return {Array.}\r\n         * @expose\r\n         */\r\n        NamespacePrototype.getChildren = function(type) {\r\n            type = type || null;\r\n            if (type == null)\r\n                return this.children.slice();\r\n            var children = [];\r\n            for (var i=0, k=this.children.length; i} qn Qualified name to resolve\r\n         * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false`\r\n         * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found\r\n         * @expose\r\n         */\r\n        NamespacePrototype.resolve = function(qn, excludeNonNamespace) {\r\n            var part = typeof qn === 'string' ? qn.split(\".\") : qn,\r\n                ptr = this,\r\n                i = 0;\r\n            if (part[i] === \"\") { // Fully qualified name, e.g. \".My.Message'\r\n                while (ptr.parent !== null)\r\n                    ptr = ptr.parent;\r\n                i++;\r\n            }\r\n            var child;\r\n            do {\r\n                do {\r\n                    if (!(ptr instanceof Reflect.Namespace)) {\r\n                        ptr = null;\r\n                        break;\r\n                    }\r\n                    child = ptr.getChild(part[i]);\r\n                    if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {\r\n                        ptr = null;\r\n                        break;\r\n                    }\r\n                    ptr = child; i++;\r\n                } while (i < part.length);\r\n                if (ptr != null)\r\n                    break; // Found\r\n                // Else search the parent\r\n                if (this.parent !== null)\r\n                    return this.parent.resolve(qn, excludeNonNamespace);\r\n            } while (ptr != null);\r\n            return ptr;\r\n        };\r\n\r\n        /**\r\n         * Determines the shortest qualified name of the specified type, if any, relative to this namespace.\r\n         * @param {!ProtoBuf.Reflect.T} t Reflection type\r\n         * @returns {string} The shortest qualified name or, if there is none, the fqn\r\n         * @expose\r\n         */\r\n        NamespacePrototype.qn = function(t) {\r\n            var part = [], ptr = t;\r\n            do {\r\n                part.unshift(ptr.name);\r\n                ptr = ptr.parent;\r\n            } while (ptr !== null);\r\n            for (var len=1; len <= part.length; len++) {\r\n                var qn = part.slice(part.length-len);\r\n                if (t === this.resolve(qn, t instanceof Reflect.Namespace))\r\n                    return qn.join(\".\");\r\n            }\r\n            return t.fqn();\r\n        };\r\n\r\n        /**\r\n         * Builds the namespace and returns the runtime counterpart.\r\n         * @return {Object.} Runtime namespace\r\n         * @expose\r\n         */\r\n        NamespacePrototype.build = function() {\r\n            /** @dict */\r\n            var ns = {};\r\n            var children = this.children;\r\n            for (var i=0, k=children.length, child; i}\r\n         */\r\n        NamespacePrototype.buildOpt = function() {\r\n            var opt = {},\r\n                keys = Object.keys(this.options);\r\n            for (var i=0, k=keys.length; i}null} Option value or NULL if there is no such option\r\n         */\r\n        NamespacePrototype.getOption = function(name) {\r\n            if (typeof name === 'undefined')\r\n                return this.options;\r\n            return typeof this.options[name] !== 'undefined' ? this.options[name] : null;\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Namespace\r\n         * @expose\r\n         */\r\n        Reflect.Namespace = Namespace;\r\n\r\n        /**\r\n         * Constructs a new Element implementation that checks and converts values for a\r\n         * particular field type, as appropriate.\r\n         *\r\n         * An Element represents a single value: either the value of a singular field,\r\n         * or a value contained in one entry of a repeated field or map field. This\r\n         * class does not implement these higher-level concepts; it only encapsulates\r\n         * the low-level typechecking and conversion.\r\n         *\r\n         * @exports ProtoBuf.Reflect.Element\r\n         * @param {{name: string, wireType: number}} type Resolved data type\r\n         * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant\r\n         * (e.g. submessage field).\r\n         * @param {boolean} isMapKey Is this element a Map key? The value will be\r\n         * converted to string form if so.\r\n         * @param {string} syntax Syntax level of defining message type, e.g.,\r\n         * proto2 or proto3.\r\n         * @param {string} name Name of the field containing this element (for error\r\n         * messages)\r\n         * @constructor\r\n         */\r\n        var Element = function(type, resolvedType, isMapKey, syntax, name) {\r\n\r\n            /**\r\n             * Element type, as a string (e.g., int32).\r\n             * @type {{name: string, wireType: number}}\r\n             */\r\n            this.type = type;\r\n\r\n            /**\r\n             * Element type reference to submessage or enum definition, if needed.\r\n             * @type {ProtoBuf.Reflect.T|null}\r\n             */\r\n            this.resolvedType = resolvedType;\r\n\r\n            /**\r\n             * Element is a map key.\r\n             * @type {boolean}\r\n             */\r\n            this.isMapKey = isMapKey;\r\n\r\n            /**\r\n             * Syntax level of defining message type, e.g., proto2 or proto3.\r\n             * @type {string}\r\n             */\r\n            this.syntax = syntax;\r\n\r\n            /**\r\n             * Name of the field containing this element (for error messages)\r\n             * @type {string}\r\n             */\r\n            this.name = name;\r\n\r\n            if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)\r\n                throw Error(\"Invalid map key type: \" + type.name);\r\n        };\r\n\r\n        var ElementPrototype = Element.prototype;\r\n\r\n        /**\r\n         * Obtains a (new) default value for the specified type.\r\n         * @param type {string|{name: string, wireType: number}} Field type\r\n         * @returns {*} Default value\r\n         * @inner\r\n         */\r\n        function mkDefault(type) {\r\n            if (typeof type === 'string')\r\n                type = ProtoBuf.TYPES[type];\r\n            if (typeof type.defaultValue === 'undefined')\r\n                throw Error(\"default value for type \"+type.name+\" is not supported\");\r\n            if (type == ProtoBuf.TYPES[\"bytes\"])\r\n                return new ByteBuffer(0);\r\n            return type.defaultValue;\r\n        }\r\n\r\n        /**\r\n         * Returns the default value for this field in proto3.\r\n         * @function\r\n         * @param type {string|{name: string, wireType: number}} the field type\r\n         * @returns {*} Default value\r\n         */\r\n        Element.defaultFieldValue = mkDefault;\r\n\r\n        /**\r\n         * Makes a Long from a value.\r\n         * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value\r\n         * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for\r\n         *  strings and numbers\r\n         * @returns {!Long}\r\n         * @throws {Error} If the value cannot be converted to a Long\r\n         * @inner\r\n         */\r\n        function mkLong(value, unsigned) {\r\n            if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'\r\n                && value.low === value.low && value.high === value.high)\r\n                return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);\r\n            if (typeof value === 'string')\r\n                return ProtoBuf.Long.fromString(value, unsigned || false, 10);\r\n            if (typeof value === 'number')\r\n                return ProtoBuf.Long.fromNumber(value, unsigned || false);\r\n            throw Error(\"not convertible to Long\");\r\n        }\r\n\r\n        ElementPrototype.toString = function() {\r\n            return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';\r\n        }\r\n\r\n        /**\r\n         * Checks if the given value can be set for an element of this type (singular\r\n         * field or one element of a repeated field or map).\r\n         * @param {*} value Value to check\r\n         * @return {*} Verified, maybe adjusted, value\r\n         * @throws {Error} If the value cannot be verified for this element slot\r\n         * @expose\r\n         */\r\n        ElementPrototype.verifyValue = function(value) {\r\n            var self = this;\r\n            function fail(val, msg) {\r\n                throw Error(\"Illegal value for \"+self.toString(true)+\" of type \"+self.type.name+\": \"+val+\" (\"+msg+\")\");\r\n            }\r\n            switch (this.type) {\r\n                // Signed 32bit\r\n                case ProtoBuf.TYPES[\"int32\"]:\r\n                case ProtoBuf.TYPES[\"sint32\"]:\r\n                case ProtoBuf.TYPES[\"sfixed32\"]:\r\n                    // Account for !NaN: value === value\r\n                    if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r\n                        fail(typeof value, \"not an integer\");\r\n                    return value > 4294967295 ? value | 0 : value;\r\n\r\n                // Unsigned 32bit\r\n                case ProtoBuf.TYPES[\"uint32\"]:\r\n                case ProtoBuf.TYPES[\"fixed32\"]:\r\n                    if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r\n                        fail(typeof value, \"not an integer\");\r\n                    return value < 0 ? value >>> 0 : value;\r\n\r\n                // Signed 64bit\r\n                case ProtoBuf.TYPES[\"int64\"]:\r\n                case ProtoBuf.TYPES[\"sint64\"]:\r\n                case ProtoBuf.TYPES[\"sfixed64\"]: {\r\n                    if (ProtoBuf.Long)\r\n                        try {\r\n                            return mkLong(value, false);\r\n                        } catch (e) {\r\n                            fail(typeof value, e.message);\r\n                        }\r\n                    else\r\n                        fail(typeof value, \"requires Long.js\");\r\n                }\r\n\r\n                // Unsigned 64bit\r\n                case ProtoBuf.TYPES[\"uint64\"]:\r\n                case ProtoBuf.TYPES[\"fixed64\"]: {\r\n                    if (ProtoBuf.Long)\r\n                        try {\r\n                            return mkLong(value, true);\r\n                        } catch (e) {\r\n                            fail(typeof value, e.message);\r\n                        }\r\n                    else\r\n                        fail(typeof value, \"requires Long.js\");\r\n                }\r\n\r\n                // Bool\r\n                case ProtoBuf.TYPES[\"bool\"]:\r\n                    if (typeof value !== 'boolean')\r\n                        fail(typeof value, \"not a boolean\");\r\n                    return value;\r\n\r\n                // Float\r\n                case ProtoBuf.TYPES[\"float\"]:\r\n                case ProtoBuf.TYPES[\"double\"]:\r\n                    if (typeof value !== 'number')\r\n                        fail(typeof value, \"not a number\");\r\n                    return value;\r\n\r\n                // Length-delimited string\r\n                case ProtoBuf.TYPES[\"string\"]:\r\n                    if (typeof value !== 'string' && !(value && value instanceof String))\r\n                        fail(typeof value, \"not a string\");\r\n                    return \"\"+value; // Convert String object to string\r\n\r\n                // Length-delimited bytes\r\n                case ProtoBuf.TYPES[\"bytes\"]:\r\n                    if (ByteBuffer.isByteBuffer(value))\r\n                        return value;\r\n                    return ByteBuffer.wrap(value, \"base64\");\r\n\r\n                // Constant enum value\r\n                case ProtoBuf.TYPES[\"enum\"]: {\r\n                    var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);\r\n                    for (i=0; i 4294967295 || value < 0)\r\n                            fail(typeof value, \"not in range for uint32\")\r\n                        return value;\r\n                    } else {\r\n                        // proto2 requires enum values to be valid.\r\n                        fail(value, \"not a valid enum value\");\r\n                    }\r\n                }\r\n                // Embedded message\r\n                case ProtoBuf.TYPES[\"group\"]:\r\n                case ProtoBuf.TYPES[\"message\"]: {\r\n                    if (!value || typeof value !== 'object')\r\n                        fail(typeof value, \"object expected\");\r\n                    if (value instanceof this.resolvedType.clazz)\r\n                        return value;\r\n                    if (value instanceof ProtoBuf.Builder.Message) {\r\n                        // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)\r\n                        var obj = {};\r\n                        for (var i in value)\r\n                            if (value.hasOwnProperty(i))\r\n                                obj[i] = value[i];\r\n                        value = obj;\r\n                    }\r\n                    // Else let's try to construct one from a key-value object\r\n                    return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons\r\n                }\r\n            }\r\n\r\n            // We should never end here\r\n            throw Error(\"[INTERNAL] Illegal value for \"+this.toString(true)+\": \"+value+\" (undefined type \"+this.type+\")\");\r\n        };\r\n\r\n        /**\r\n         * Calculates the byte length of an element on the wire.\r\n         * @param {number} id Field number\r\n         * @param {*} value Field value\r\n         * @returns {number} Byte length\r\n         * @throws {Error} If the value cannot be calculated\r\n         * @expose\r\n         */\r\n        ElementPrototype.calculateLength = function(id, value) {\r\n            if (value === null) return 0; // Nothing to encode\r\n            // Tag has already been written\r\n            var n;\r\n            switch (this.type) {\r\n                case ProtoBuf.TYPES[\"int32\"]:\r\n                    return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);\r\n                case ProtoBuf.TYPES[\"uint32\"]:\r\n                    return ByteBuffer.calculateVarint32(value);\r\n                case ProtoBuf.TYPES[\"sint32\"]:\r\n                    return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));\r\n                case ProtoBuf.TYPES[\"fixed32\"]:\r\n                case ProtoBuf.TYPES[\"sfixed32\"]:\r\n                case ProtoBuf.TYPES[\"float\"]:\r\n                    return 4;\r\n                case ProtoBuf.TYPES[\"int64\"]:\r\n                case ProtoBuf.TYPES[\"uint64\"]:\r\n                    return ByteBuffer.calculateVarint64(value);\r\n                case ProtoBuf.TYPES[\"sint64\"]:\r\n                    return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));\r\n                case ProtoBuf.TYPES[\"fixed64\"]:\r\n                case ProtoBuf.TYPES[\"sfixed64\"]:\r\n                    return 8;\r\n                case ProtoBuf.TYPES[\"bool\"]:\r\n                    return 1;\r\n                case ProtoBuf.TYPES[\"enum\"]:\r\n                    return ByteBuffer.calculateVarint32(value);\r\n                case ProtoBuf.TYPES[\"double\"]:\r\n                    return 8;\r\n                case ProtoBuf.TYPES[\"string\"]:\r\n                    n = ByteBuffer.calculateUTF8Bytes(value);\r\n                    return ByteBuffer.calculateVarint32(n) + n;\r\n                case ProtoBuf.TYPES[\"bytes\"]:\r\n                    if (value.remaining() < 0)\r\n                        throw Error(\"Illegal value for \"+this.toString(true)+\": \"+value.remaining()+\" bytes remaining\");\r\n                    return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();\r\n                case ProtoBuf.TYPES[\"message\"]:\r\n                    n = this.resolvedType.calculate(value);\r\n                    return ByteBuffer.calculateVarint32(n) + n;\r\n                case ProtoBuf.TYPES[\"group\"]:\r\n                    n = this.resolvedType.calculate(value);\r\n                    return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r\n            }\r\n            // We should never end here\r\n            throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+value+\" (unknown type)\");\r\n        };\r\n\r\n        /**\r\n         * Encodes a value to the specified buffer. Does not encode the key.\r\n         * @param {number} id Field number\r\n         * @param {*} value Field value\r\n         * @param {ByteBuffer} buffer ByteBuffer to encode to\r\n         * @return {ByteBuffer} The ByteBuffer for chaining\r\n         * @throws {Error} If the value cannot be encoded\r\n         * @expose\r\n         */\r\n        ElementPrototype.encodeValue = function(id, value, buffer) {\r\n            if (value === null) return buffer; // Nothing to encode\r\n            // Tag has already been written\r\n\r\n            switch (this.type) {\r\n                // 32bit signed varint\r\n                case ProtoBuf.TYPES[\"int32\"]:\r\n                    // \"If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes\r\n                    // long – it is, effectively, treated like a very large unsigned integer.\" (see #122)\r\n                    if (value < 0)\r\n                        buffer.writeVarint64(value);\r\n                    else\r\n                        buffer.writeVarint32(value);\r\n                    break;\r\n\r\n                // 32bit unsigned varint\r\n                case ProtoBuf.TYPES[\"uint32\"]:\r\n                    buffer.writeVarint32(value);\r\n                    break;\r\n\r\n                // 32bit varint zig-zag\r\n                case ProtoBuf.TYPES[\"sint32\"]:\r\n                    buffer.writeVarint32ZigZag(value);\r\n                    break;\r\n\r\n                // Fixed unsigned 32bit\r\n                case ProtoBuf.TYPES[\"fixed32\"]:\r\n                    buffer.writeUint32(value);\r\n                    break;\r\n\r\n                // Fixed signed 32bit\r\n                case ProtoBuf.TYPES[\"sfixed32\"]:\r\n                    buffer.writeInt32(value);\r\n                    break;\r\n\r\n                // 64bit varint as-is\r\n                case ProtoBuf.TYPES[\"int64\"]:\r\n                case ProtoBuf.TYPES[\"uint64\"]:\r\n                    buffer.writeVarint64(value); // throws\r\n                    break;\r\n\r\n                // 64bit varint zig-zag\r\n                case ProtoBuf.TYPES[\"sint64\"]:\r\n                    buffer.writeVarint64ZigZag(value); // throws\r\n                    break;\r\n\r\n                // Fixed unsigned 64bit\r\n                case ProtoBuf.TYPES[\"fixed64\"]:\r\n                    buffer.writeUint64(value); // throws\r\n                    break;\r\n\r\n                // Fixed signed 64bit\r\n                case ProtoBuf.TYPES[\"sfixed64\"]:\r\n                    buffer.writeInt64(value); // throws\r\n                    break;\r\n\r\n                // Bool\r\n                case ProtoBuf.TYPES[\"bool\"]:\r\n                    if (typeof value === 'string')\r\n                        buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);\r\n                    else\r\n                        buffer.writeVarint32(value ? 1 : 0);\r\n                    break;\r\n\r\n                // Constant enum value\r\n                case ProtoBuf.TYPES[\"enum\"]:\r\n                    buffer.writeVarint32(value);\r\n                    break;\r\n\r\n                // 32bit float\r\n                case ProtoBuf.TYPES[\"float\"]:\r\n                    buffer.writeFloat32(value);\r\n                    break;\r\n\r\n                // 64bit float\r\n                case ProtoBuf.TYPES[\"double\"]:\r\n                    buffer.writeFloat64(value);\r\n                    break;\r\n\r\n                // Length-delimited string\r\n                case ProtoBuf.TYPES[\"string\"]:\r\n                    buffer.writeVString(value);\r\n                    break;\r\n\r\n                // Length-delimited bytes\r\n                case ProtoBuf.TYPES[\"bytes\"]:\r\n                    if (value.remaining() < 0)\r\n                        throw Error(\"Illegal value for \"+this.toString(true)+\": \"+value.remaining()+\" bytes remaining\");\r\n                    var prevOffset = value.offset;\r\n                    buffer.writeVarint32(value.remaining());\r\n                    buffer.append(value);\r\n                    value.offset = prevOffset;\r\n                    break;\r\n\r\n                // Embedded message\r\n                case ProtoBuf.TYPES[\"message\"]:\r\n                    var bb = new ByteBuffer().LE();\r\n                    this.resolvedType.encode(value, bb);\r\n                    buffer.writeVarint32(bb.offset);\r\n                    buffer.append(bb.flip());\r\n                    break;\r\n\r\n                // Legacy group\r\n                case ProtoBuf.TYPES[\"group\"]:\r\n                    this.resolvedType.encode(value, buffer);\r\n                    buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r\n                    break;\r\n\r\n                default:\r\n                    // We should never end here\r\n                    throw Error(\"[INTERNAL] Illegal value to encode in \"+this.toString(true)+\": \"+value+\" (unknown type)\");\r\n            }\r\n            return buffer;\r\n        };\r\n\r\n        /**\r\n         * Decode one element value from the specified buffer.\r\n         * @param {ByteBuffer} buffer ByteBuffer to decode from\r\n         * @param {number} wireType The field wire type\r\n         * @param {number} id The field number\r\n         * @return {*} Decoded value\r\n         * @throws {Error} If the field cannot be decoded\r\n         * @expose\r\n         */\r\n        ElementPrototype.decode = function(buffer, wireType, id) {\r\n            if (wireType != this.type.wireType)\r\n                throw Error(\"Unexpected wire type for element\");\r\n\r\n            var value, nBytes;\r\n            switch (this.type) {\r\n                // 32bit signed varint\r\n                case ProtoBuf.TYPES[\"int32\"]:\r\n                    return buffer.readVarint32() | 0;\r\n\r\n                // 32bit unsigned varint\r\n                case ProtoBuf.TYPES[\"uint32\"]:\r\n                    return buffer.readVarint32() >>> 0;\r\n\r\n                // 32bit signed varint zig-zag\r\n                case ProtoBuf.TYPES[\"sint32\"]:\r\n                    return buffer.readVarint32ZigZag() | 0;\r\n\r\n                // Fixed 32bit unsigned\r\n                case ProtoBuf.TYPES[\"fixed32\"]:\r\n                    return buffer.readUint32() >>> 0;\r\n\r\n                case ProtoBuf.TYPES[\"sfixed32\"]:\r\n                    return buffer.readInt32() | 0;\r\n\r\n                // 64bit signed varint\r\n                case ProtoBuf.TYPES[\"int64\"]:\r\n                    return buffer.readVarint64();\r\n\r\n                // 64bit unsigned varint\r\n                case ProtoBuf.TYPES[\"uint64\"]:\r\n                    return buffer.readVarint64().toUnsigned();\r\n\r\n                // 64bit signed varint zig-zag\r\n                case ProtoBuf.TYPES[\"sint64\"]:\r\n                    return buffer.readVarint64ZigZag();\r\n\r\n                // Fixed 64bit unsigned\r\n                case ProtoBuf.TYPES[\"fixed64\"]:\r\n                    return buffer.readUint64();\r\n\r\n                // Fixed 64bit signed\r\n                case ProtoBuf.TYPES[\"sfixed64\"]:\r\n                    return buffer.readInt64();\r\n\r\n                // Bool varint\r\n                case ProtoBuf.TYPES[\"bool\"]:\r\n                    return !!buffer.readVarint32();\r\n\r\n                // Constant enum value (varint)\r\n                case ProtoBuf.TYPES[\"enum\"]:\r\n                    // The following Builder.Message#set will already throw\r\n                    return buffer.readVarint32();\r\n\r\n                // 32bit float\r\n                case ProtoBuf.TYPES[\"float\"]:\r\n                    return buffer.readFloat();\r\n\r\n                // 64bit float\r\n                case ProtoBuf.TYPES[\"double\"]:\r\n                    return buffer.readDouble();\r\n\r\n                // Length-delimited string\r\n                case ProtoBuf.TYPES[\"string\"]:\r\n                    return buffer.readVString();\r\n\r\n                // Length-delimited bytes\r\n                case ProtoBuf.TYPES[\"bytes\"]: {\r\n                    nBytes = buffer.readVarint32();\r\n                    if (buffer.remaining() < nBytes)\r\n                        throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+nBytes+\" required but got only \"+buffer.remaining());\r\n                    value = buffer.clone(); // Offset already set\r\n                    value.limit = value.offset+nBytes;\r\n                    buffer.offset += nBytes;\r\n                    return value;\r\n                }\r\n\r\n                // Length-delimited embedded message\r\n                case ProtoBuf.TYPES[\"message\"]: {\r\n                    nBytes = buffer.readVarint32();\r\n                    return this.resolvedType.decode(buffer, nBytes);\r\n                }\r\n\r\n                // Legacy group\r\n                case ProtoBuf.TYPES[\"group\"]:\r\n                    return this.resolvedType.decode(buffer, -1, id);\r\n            }\r\n\r\n            // We should never end here\r\n            throw Error(\"[INTERNAL] Illegal decode type\");\r\n        };\r\n\r\n        /**\r\n         * Converts a value from a string to the canonical element type.\r\n         *\r\n         * Legal only when isMapKey is true.\r\n         *\r\n         * @param {string} str The string value\r\n         * @returns {*} The value\r\n         */\r\n        ElementPrototype.valueFromString = function(str) {\r\n            if (!this.isMapKey) {\r\n                throw Error(\"valueFromString() called on non-map-key element\");\r\n            }\r\n\r\n            switch (this.type) {\r\n                case ProtoBuf.TYPES[\"int32\"]:\r\n                case ProtoBuf.TYPES[\"sint32\"]:\r\n                case ProtoBuf.TYPES[\"sfixed32\"]:\r\n                case ProtoBuf.TYPES[\"uint32\"]:\r\n                case ProtoBuf.TYPES[\"fixed32\"]:\r\n                    return this.verifyValue(parseInt(str));\r\n\r\n                case ProtoBuf.TYPES[\"int64\"]:\r\n                case ProtoBuf.TYPES[\"sint64\"]:\r\n                case ProtoBuf.TYPES[\"sfixed64\"]:\r\n                case ProtoBuf.TYPES[\"uint64\"]:\r\n                case ProtoBuf.TYPES[\"fixed64\"]:\r\n                      // Long-based fields support conversions from string already.\r\n                      return this.verifyValue(str);\r\n\r\n                case ProtoBuf.TYPES[\"bool\"]:\r\n                      return str === \"true\";\r\n\r\n                case ProtoBuf.TYPES[\"string\"]:\r\n                      return this.verifyValue(str);\r\n\r\n                case ProtoBuf.TYPES[\"bytes\"]:\r\n                      return ByteBuffer.fromBinary(str);\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Converts a value from the canonical element type to a string.\r\n         *\r\n         * It should be the case that `valueFromString(valueToString(val))` returns\r\n         * a value equivalent to `verifyValue(val)` for every legal value of `val`\r\n         * according to this element type.\r\n         *\r\n         * This may be used when the element must be stored or used as a string,\r\n         * e.g., as a map key on an Object.\r\n         *\r\n         * Legal only when isMapKey is true.\r\n         *\r\n         * @param {*} val The value\r\n         * @returns {string} The string form of the value.\r\n         */\r\n        ElementPrototype.valueToString = function(value) {\r\n            if (!this.isMapKey) {\r\n                throw Error(\"valueToString() called on non-map-key element\");\r\n            }\r\n\r\n            if (this.type === ProtoBuf.TYPES[\"bytes\"]) {\r\n                return value.toString(\"binary\");\r\n            } else {\r\n                return value.toString();\r\n            }\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Element\r\n         * @expose\r\n         */\r\n        Reflect.Element = Element;\r\n\r\n        /**\r\n         * Constructs a new Message.\r\n         * @exports ProtoBuf.Reflect.Message\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace\r\n         * @param {string} name Message name\r\n         * @param {Object.=} options Message options\r\n         * @param {boolean=} isGroup `true` if this is a legacy group\r\n         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.Namespace\r\n         */\r\n        var Message = function(builder, parent, name, options, isGroup, syntax) {\r\n            Namespace.call(this, builder, parent, name, options, syntax);\r\n\r\n            /**\r\n             * @override\r\n             */\r\n            this.className = \"Message\";\r\n\r\n            /**\r\n             * Extensions range.\r\n             * @type {!Array.|undefined}\r\n             * @expose\r\n             */\r\n            this.extensions = undefined;\r\n\r\n            /**\r\n             * Runtime message class.\r\n             * @type {?function(new:ProtoBuf.Builder.Message)}\r\n             * @expose\r\n             */\r\n            this.clazz = null;\r\n\r\n            /**\r\n             * Whether this is a legacy group or not.\r\n             * @type {boolean}\r\n             * @expose\r\n             */\r\n            this.isGroup = !!isGroup;\r\n\r\n            // The following cached collections are used to efficiently iterate over or look up fields when decoding.\r\n\r\n            /**\r\n             * Cached fields.\r\n             * @type {?Array.}\r\n             * @private\r\n             */\r\n            this._fields = null;\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 by name.\r\n             * @type {?Object.}\r\n             * @private\r\n             */\r\n            this._fieldsByName = null;\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Message.prototype\r\n         * @inner\r\n         */\r\n        var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);\r\n\r\n        /**\r\n         * Builds the message and returns the runtime counterpart, which is a fully functional class.\r\n         * @see ProtoBuf.Builder.Message\r\n         * @param {boolean=} rebuild Whether to rebuild or not, defaults to false\r\n         * @return {ProtoBuf.Reflect.Message} Message class\r\n         * @throws {Error} If the message cannot be built\r\n         * @expose\r\n         */\r\n        MessagePrototype.build = function(rebuild) {\r\n            if (this.clazz && !rebuild)\r\n                return this.clazz;\r\n\r\n            // Create the runtime Message class in its own scope\r\n            var clazz = (function(ProtoBuf, T) {\r\n\r\n                var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),\r\n                    oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);\r\n\r\n                /**\r\n                 * Constructs a new runtime Message.\r\n                 * @name ProtoBuf.Builder.Message\r\n                 * @class Barebone of all runtime messages.\r\n                 * @param {!Object.|string} values Preset values\r\n                 * @param {...string} var_args\r\n                 * @constructor\r\n                 * @throws {Error} If the message cannot be created\r\n                 */\r\n                var Message = function(values, var_args) {\r\n                    ProtoBuf.Builder.Message.call(this);\r\n\r\n                    // Create virtual oneof properties\r\n                    for (var i=0, k=oneofs.length; i 0) {\r\n                        var value;\r\n                        // Set field values from a values object\r\n                        if (arguments.length === 1 && values !== null && typeof values === 'object' &&\r\n                            /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &&\r\n                            /* not a repeated field */ !Array.isArray(values) &&\r\n                            /* not a Map */ !(values instanceof ProtoBuf.Map) &&\r\n                            /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &&\r\n                            /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &&\r\n                            /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {\r\n                            this.$set(values);\r\n                        } else // Set field values from arguments, in declaration order\r\n                            for (i=0, k=arguments.length; i} keyOrObj String key or plain object holding multiple values\r\n                 * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r\n                 * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`\r\n                 * @returns {!ProtoBuf.Builder.Message} this\r\n                 * @throws {Error} If the value cannot be set\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.set = function(keyOrObj, value, noAssert) {\r\n                    if (keyOrObj && typeof keyOrObj === 'object') {\r\n                        noAssert = value;\r\n                        for (var ikey in keyOrObj) {\r\n                            // Check if virtual oneof field - don't set these\r\n                            if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)\r\n                                this.$set(ikey, value, noAssert);\r\n                        }\r\n                        return this;\r\n                    }\r\n                    var field = T._fieldsByName[keyOrObj];\r\n                    if (!noAssert) {\r\n                        if (!field)\r\n                            throw Error(this+\"#\"+keyOrObj+\" is not a field: undefined\");\r\n                        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r\n                            throw Error(this+\"#\"+keyOrObj+\" is not a field: \"+field.toString(true));\r\n                        this[field.name] = (value = field.verifyValue(value)); // May throw\r\n                    } else\r\n                        this[keyOrObj] = value;\r\n                    if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r\n                        var currentField = this[field.oneof.name]; // Virtual field references currently set field\r\n                        if (value !== null) {\r\n                            if (currentField !== null && currentField !== field.name)\r\n                                this[currentField] = null; // Clear currently set field\r\n                            this[field.oneof.name] = field.name; // Point virtual field at this field\r\n                        } else if (/* value === null && */currentField === keyOrObj)\r\n                            this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)\r\n                    }\r\n                    return this;\r\n                };\r\n\r\n                /**\r\n                 * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.\r\n                 * @name ProtoBuf.Builder.Message#$set\r\n                 * @function\r\n                 * @param {string|!Object.} keyOrObj String key or plain object holding multiple values\r\n                 * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r\n                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r\n                 * @throws {Error} If the value cannot be set\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.$set = MessagePrototype.set;\r\n\r\n                /**\r\n                 * Gets a field's value.\r\n                 * @name ProtoBuf.Builder.Message#get\r\n                 * @function\r\n                 * @param {string} key Key\r\n                 * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`\r\n                 * @return {*} Value\r\n                 * @throws {Error} If there is no such field\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.get = function(key, noAssert) {\r\n                    if (noAssert)\r\n                        return this[key];\r\n                    var field = T._fieldsByName[key];\r\n                    if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))\r\n                        throw Error(this+\"#\"+key+\" is not a field: undefined\");\r\n                    if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r\n                        throw Error(this+\"#\"+key+\" is not a field: \"+field.toString(true));\r\n                    return this[field.name];\r\n                };\r\n\r\n                /**\r\n                 * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.\r\n                 * @name ProtoBuf.Builder.Message#$get\r\n                 * @function\r\n                 * @param {string} key Key\r\n                 * @return {*} Value\r\n                 * @throws {Error} If there is no such field\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.$get = MessagePrototype.get;\r\n\r\n                // Getters and setters\r\n\r\n                for (var i=0; i} data Data payload\r\n                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r\n                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r\n                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r\n                 * @expose\r\n                 */\r\n                Message.encode = function(data, buffer, noVerify) {\r\n                    return new Message(data).encode(buffer, noVerify);\r\n                };\r\n\r\n                /**\r\n                 * Calculates the byte length of the message.\r\n                 * @name ProtoBuf.Builder.Message#calculate\r\n                 * @function\r\n                 * @returns {number} Byte length\r\n                 * @throws {Error} If the message cannot be calculated or if required fields are missing.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.calculate = function() {\r\n                    return T.calculate(this);\r\n                };\r\n\r\n                /**\r\n                 * Encodes the varint32 length-delimited message.\r\n                 * @name ProtoBuf.Builder.Message#encodeDelimited\r\n                 * @function\r\n                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r\n                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r\n                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r\n                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n                 *  returns the encoded ByteBuffer in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.encodeDelimited = function(buffer, noVerify) {\r\n                    var isNew = false;\r\n                    if (!buffer)\r\n                        buffer = new ByteBuffer(),\r\n                        isNew = true;\r\n                    var enc = new ByteBuffer().LE();\r\n                    T.encode(this, enc, noVerify).flip();\r\n                    buffer.writeVarint32(enc.remaining());\r\n                    buffer.append(enc);\r\n                    return isNew ? buffer.flip() : buffer;\r\n                };\r\n\r\n                /**\r\n                 * Directly encodes the message to an ArrayBuffer.\r\n                 * @name ProtoBuf.Builder.Message#encodeAB\r\n                 * @function\r\n                 * @return {ArrayBuffer} Encoded message as ArrayBuffer\r\n                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n                 *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.encodeAB = function() {\r\n                    try {\r\n                        return this.encode().toArrayBuffer();\r\n                    } catch (e) {\r\n                        if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toArrayBuffer();\r\n                        throw(e);\r\n                    }\r\n                };\r\n\r\n                /**\r\n                 * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.\r\n                 * @name ProtoBuf.Builder.Message#toArrayBuffer\r\n                 * @function\r\n                 * @return {ArrayBuffer} Encoded message as ArrayBuffer\r\n                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n                 *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;\r\n\r\n                /**\r\n                 * Directly encodes the message to a node Buffer.\r\n                 * @name ProtoBuf.Builder.Message#encodeNB\r\n                 * @function\r\n                 * @return {!Buffer}\r\n                 * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are\r\n                 *  missing. The later still returns the encoded node Buffer in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.encodeNB = function() {\r\n                    try {\r\n                        return this.encode().toBuffer();\r\n                    } catch (e) {\r\n                        if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toBuffer();\r\n                        throw(e);\r\n                    }\r\n                };\r\n\r\n                /**\r\n                 * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.\r\n                 * @name ProtoBuf.Builder.Message#toBuffer\r\n                 * @function\r\n                 * @return {!Buffer}\r\n                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n                 *  returns the encoded node Buffer in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.toBuffer = MessagePrototype.encodeNB;\r\n\r\n                /**\r\n                 * Directly encodes the message to a base64 encoded string.\r\n                 * @name ProtoBuf.Builder.Message#encode64\r\n                 * @function\r\n                 * @return {string} Base64 encoded string\r\n                 * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r\n                 *  still returns the encoded base64 string in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.encode64 = function() {\r\n                    try {\r\n                        return this.encode().toBase64();\r\n                    } catch (e) {\r\n                        if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toBase64();\r\n                        throw(e);\r\n                    }\r\n                };\r\n\r\n                /**\r\n                 * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.\r\n                 * @name ProtoBuf.Builder.Message#toBase64\r\n                 * @function\r\n                 * @return {string} Base64 encoded string\r\n                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n                 *  returns the encoded base64 string in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.toBase64 = MessagePrototype.encode64;\r\n\r\n                /**\r\n                 * Directly encodes the message to a hex encoded string.\r\n                 * @name ProtoBuf.Builder.Message#encodeHex\r\n                 * @function\r\n                 * @return {string} Hex encoded string\r\n                 * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r\n                 *  still returns the encoded hex string in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.encodeHex = function() {\r\n                    try {\r\n                        return this.encode().toHex();\r\n                    } catch (e) {\r\n                        if (e[\"encoded\"]) e[\"encoded\"] = e[\"encoded\"].toHex();\r\n                        throw(e);\r\n                    }\r\n                };\r\n\r\n                /**\r\n                 * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.\r\n                 * @name ProtoBuf.Builder.Message#toHex\r\n                 * @function\r\n                 * @return {string} Hex encoded string\r\n                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r\n                 *  returns the encoded hex string in the `encoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.toHex = MessagePrototype.encodeHex;\r\n\r\n                /**\r\n                 * Clones a message object or field value to a raw object.\r\n                 * @param {*} obj Object to clone\r\n                 * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise\r\n                 * @param {boolean} longsAsStrings Whether to encode longs as strings\r\n                 * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field\r\n                 * @returns {*} Cloned object\r\n                 * @inner\r\n                 */\r\n                function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {\r\n                    if (obj === null || typeof obj !== 'object') {\r\n                        // Convert enum values to their respective names\r\n                        if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {\r\n                            var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);\r\n                            if (name !== null)\r\n                                return name;\r\n                        }\r\n                        // Pass-through string, number, boolean, null...\r\n                        return obj;\r\n                    }\r\n                    // Convert ByteBuffers to raw buffer or strings\r\n                    if (ByteBuffer.isByteBuffer(obj))\r\n                        return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();\r\n                    // Convert Longs to proper objects or strings\r\n                    if (ProtoBuf.Long.isLong(obj))\r\n                        return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);\r\n                    var clone;\r\n                    // Clone arrays\r\n                    if (Array.isArray(obj)) {\r\n                        clone = [];\r\n                        obj.forEach(function(v, k) {\r\n                            clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);\r\n                        });\r\n                        return clone;\r\n                    }\r\n                    clone = {};\r\n                    // Convert maps to objects\r\n                    if (obj instanceof ProtoBuf.Map) {\r\n                        var it = obj.entries();\r\n                        for (var e = it.next(); !e.done; e = it.next())\r\n                            clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);\r\n                        return clone;\r\n                    }\r\n                    // Everything else is a non-null object\r\n                    var type = obj.$type,\r\n                        field = undefined;\r\n                    for (var i in obj)\r\n                        if (obj.hasOwnProperty(i)) {\r\n                            if (type && (field = type.getChild(i)))\r\n                                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);\r\n                            else\r\n                                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);\r\n                        }\r\n                    return clone;\r\n                }\r\n\r\n                /**\r\n                 * Returns the message's raw payload.\r\n                 * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`\r\n                 * @param {boolean} longsAsStrings Whether to encode longs as strings\r\n                 * @returns {Object.} Raw payload\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {\r\n                    return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);\r\n                };\r\n\r\n                /**\r\n                 * Encodes a message to JSON.\r\n                 * @returns {string} JSON string\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.encodeJSON = function() {\r\n                    return JSON.stringify(\r\n                        cloneRaw(this,\r\n                             /* binary-as-base64 */ true,\r\n                             /* longs-as-strings */ true,\r\n                             this.$type\r\n                        )\r\n                    );\r\n                };\r\n\r\n                /**\r\n                 * Decodes a message from the specified buffer or string.\r\n                 * @name ProtoBuf.Builder.Message.decode\r\n                 * @function\r\n                 * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r\n                 * @param {(number|string)=} length Message length. Defaults to decode all the remainig data.\r\n                 * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r\n                 * @return {!ProtoBuf.Builder.Message} Decoded message\r\n                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r\n                 * @expose\r\n                 * @see ProtoBuf.Builder.Message.decode64\r\n                 * @see ProtoBuf.Builder.Message.decodeHex\r\n                 */\r\n                Message.decode = function(buffer, length, enc) {\r\n                    if (typeof length === 'string')\r\n                        enc = length,\r\n                        length = -1;\r\n                    if (typeof buffer === 'string')\r\n                        buffer = ByteBuffer.wrap(buffer, enc ? enc : \"base64\");\r\n                    else if (!ByteBuffer.isByteBuffer(buffer))\r\n                        buffer = ByteBuffer.wrap(buffer); // May throw\r\n                    var le = buffer.littleEndian;\r\n                    try {\r\n                        var msg = T.decode(buffer.LE(), length);\r\n                        buffer.LE(le);\r\n                        return msg;\r\n                    } catch (e) {\r\n                        buffer.LE(le);\r\n                        throw(e);\r\n                    }\r\n                };\r\n\r\n                /**\r\n                 * Decodes a varint32 length-delimited message from the specified buffer or string.\r\n                 * @name ProtoBuf.Builder.Message.decodeDelimited\r\n                 * @function\r\n                 * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r\n                 * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r\n                 * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet\r\n                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                Message.decodeDelimited = function(buffer, enc) {\r\n                    if (typeof buffer === 'string')\r\n                        buffer = ByteBuffer.wrap(buffer, enc ? enc : \"base64\");\r\n                    else if (!ByteBuffer.isByteBuffer(buffer))\r\n                        buffer = ByteBuffer.wrap(buffer); // May throw\r\n                    if (buffer.remaining() < 1)\r\n                        return null;\r\n                    var off = buffer.offset,\r\n                        len = buffer.readVarint32();\r\n                    if (buffer.remaining() < len) {\r\n                        buffer.offset = off;\r\n                        return null;\r\n                    }\r\n                    try {\r\n                        var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());\r\n                        buffer.offset += len;\r\n                        return msg;\r\n                    } catch (err) {\r\n                        buffer.offset += len;\r\n                        throw err;\r\n                    }\r\n                };\r\n\r\n                /**\r\n                 * Decodes the message from the specified base64 encoded string.\r\n                 * @name ProtoBuf.Builder.Message.decode64\r\n                 * @function\r\n                 * @param {string} str String to decode from\r\n                 * @return {!ProtoBuf.Builder.Message} Decoded message\r\n                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                Message.decode64 = function(str) {\r\n                    return Message.decode(str, \"base64\");\r\n                };\r\n\r\n                /**\r\n                 * Decodes the message from the specified hex encoded string.\r\n                 * @name ProtoBuf.Builder.Message.decodeHex\r\n                 * @function\r\n                 * @param {string} str String to decode from\r\n                 * @return {!ProtoBuf.Builder.Message} Decoded message\r\n                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r\n                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r\n                 * @expose\r\n                 */\r\n                Message.decodeHex = function(str) {\r\n                    return Message.decode(str, \"hex\");\r\n                };\r\n\r\n                /**\r\n                 * Decodes the message from a JSON string.\r\n                 * @name ProtoBuf.Builder.Message.decodeJSON\r\n                 * @function\r\n                 * @param {string} str String to decode from\r\n                 * @return {!ProtoBuf.Builder.Message} Decoded message\r\n                 * @throws {Error} If the message cannot be decoded or if required fields are\r\n                 * missing.\r\n                 * @expose\r\n                 */\r\n                Message.decodeJSON = function(str) {\r\n                    return new Message(JSON.parse(str));\r\n                };\r\n\r\n                // Utility\r\n\r\n                /**\r\n                 * Returns a string representation of this Message.\r\n                 * @name ProtoBuf.Builder.Message#toString\r\n                 * @function\r\n                 * @return {string} String representation as of \".Fully.Qualified.MessageName\"\r\n                 * @expose\r\n                 */\r\n                MessagePrototype.toString = function() {\r\n                    return T.toString();\r\n                };\r\n\r\n                // Properties\r\n\r\n                /**\r\n                 * Message options.\r\n                 * @name ProtoBuf.Builder.Message.$options\r\n                 * @type {Object.}\r\n                 * @expose\r\n                 */\r\n                var $optionsS; // cc needs this\r\n\r\n                /**\r\n                 * Message options.\r\n                 * @name ProtoBuf.Builder.Message#$options\r\n                 * @type {Object.}\r\n                 * @expose\r\n                 */\r\n                var $options;\r\n\r\n                /**\r\n                 * Reflection type.\r\n                 * @name ProtoBuf.Builder.Message.$type\r\n                 * @type {!ProtoBuf.Reflect.Message}\r\n                 * @expose\r\n                 */\r\n                var $typeS;\r\n\r\n                /**\r\n                 * Reflection type.\r\n                 * @name ProtoBuf.Builder.Message#$type\r\n                 * @type {!ProtoBuf.Reflect.Message}\r\n                 * @expose\r\n                 */\r\n                var $type;\r\n\r\n                if (Object.defineProperty)\r\n                    Object.defineProperty(Message, '$options', { \"value\": T.buildOpt() }),\r\n                    Object.defineProperty(MessagePrototype, \"$options\", { \"value\": Message[\"$options\"] }),\r\n                    Object.defineProperty(Message, \"$type\", { \"value\": T }),\r\n                    Object.defineProperty(MessagePrototype, \"$type\", { \"value\": T });\r\n\r\n                return Message;\r\n\r\n            })(ProtoBuf, this);\r\n\r\n            // Static enums and prototyped sub-messages / cached collections\r\n            this._fields = [];\r\n            this._fieldsById = {};\r\n            this._fieldsByName = {};\r\n            this._oneofsByName = {};\r\n            for (var i=0, k=this.children.length, child; i>> 3;\r\n            switch (wireType) {\r\n                case ProtoBuf.WIRE_TYPES.VARINT:\r\n                    do tag = buf.readUint8();\r\n                    while ((tag & 0x80) === 0x80);\r\n                    break;\r\n                case ProtoBuf.WIRE_TYPES.BITS64:\r\n                    buf.offset += 8;\r\n                    break;\r\n                case ProtoBuf.WIRE_TYPES.LDELIM:\r\n                    tag = buf.readVarint32(); // reads the varint\r\n                    buf.offset += tag;        // skips n bytes\r\n                    break;\r\n                case ProtoBuf.WIRE_TYPES.STARTGROUP:\r\n                    skipTillGroupEnd(id, buf);\r\n                    break;\r\n                case ProtoBuf.WIRE_TYPES.ENDGROUP:\r\n                    if (id === expectedId)\r\n                        return false;\r\n                    else\r\n                        throw Error(\"Illegal GROUPEND after unknown group: \"+id+\" (\"+expectedId+\" expected)\");\r\n                case ProtoBuf.WIRE_TYPES.BITS32:\r\n                    buf.offset += 4;\r\n                    break;\r\n                default:\r\n                    throw Error(\"Illegal wire type in unknown group \"+expectedId+\": \"+wireType);\r\n            }\r\n            return true;\r\n        }\r\n\r\n        /**\r\n         * Decodes an encoded message and returns the decoded message.\r\n         * @param {ByteBuffer} buffer ByteBuffer to decode from\r\n         * @param {number=} length Message length. Defaults to decode all remaining data.\r\n         * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group\r\n         * @return {ProtoBuf.Builder.Message} Decoded message\r\n         * @throws {Error} If the message cannot be decoded\r\n         * @expose\r\n         */\r\n        MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {\r\n            if (typeof length !== 'number')\r\n                length = -1;\r\n            var start = buffer.offset,\r\n                msg = new (this.clazz)(),\r\n                tag, wireType, id, field;\r\n            while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {\r\n                tag = buffer.readVarint32();\r\n                wireType = tag & 0x07;\r\n                id = tag >>> 3;\r\n                if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {\r\n                    if (id !== expectedGroupEndId)\r\n                        throw Error(\"Illegal group end indicator for \"+this.toString(true)+\": \"+id+\" (\"+(expectedGroupEndId ? expectedGroupEndId+\" expected\" : \"not a group\")+\")\");\r\n                    break;\r\n                }\r\n                if (!(field = this._fieldsById[id])) {\r\n                    // \"messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing.\"\r\n                    switch (wireType) {\r\n                        case ProtoBuf.WIRE_TYPES.VARINT:\r\n                            buffer.readVarint32();\r\n                            break;\r\n                        case ProtoBuf.WIRE_TYPES.BITS32:\r\n                            buffer.offset += 4;\r\n                            break;\r\n                        case ProtoBuf.WIRE_TYPES.BITS64:\r\n                            buffer.offset += 8;\r\n                            break;\r\n                        case ProtoBuf.WIRE_TYPES.LDELIM:\r\n                            var len = buffer.readVarint32();\r\n                            buffer.offset += len;\r\n                            break;\r\n                        case ProtoBuf.WIRE_TYPES.STARTGROUP:\r\n                            while (skipTillGroupEnd(id, buffer)) {}\r\n                            break;\r\n                        default:\r\n                            throw Error(\"Illegal wire type for unknown field \"+id+\" in \"+this.toString(true)+\"#decode: \"+wireType);\r\n                    }\r\n                    continue;\r\n                }\r\n                if (field.repeated && !field.options[\"packed\"]) {\r\n                    msg[field.name].push(field.decode(wireType, buffer));\r\n                } else if (field.map) {\r\n                    var keyval = field.decode(wireType, buffer);\r\n                    msg[field.name].set(keyval[0], keyval[1]);\r\n                } else {\r\n                    msg[field.name] = field.decode(wireType, buffer);\r\n                    if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r\n                        var currentField = msg[field.oneof.name]; // Virtual field references currently set field\r\n                        if (currentField !== null && currentField !== field.name)\r\n                            msg[currentField] = null; // Clear currently set field\r\n                        msg[field.oneof.name] = field.name; // Point virtual field at this field\r\n                    }\r\n                }\r\n            }\r\n\r\n            // Check if all required fields are present and set default values for optional fields that are not\r\n            for (var i=0, k=this._fields.length; i=} options Options\r\n         * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf\r\n         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.T\r\n         */\r\n        var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {\r\n            T.call(this, builder, message, name);\r\n\r\n            /**\r\n             * @override\r\n             */\r\n            this.className = \"Message.Field\";\r\n\r\n            /**\r\n             * Message field required flag.\r\n             * @type {boolean}\r\n             * @expose\r\n             */\r\n            this.required = rule === \"required\";\r\n\r\n            /**\r\n             * Message field repeated flag.\r\n             * @type {boolean}\r\n             * @expose\r\n             */\r\n            this.repeated = rule === \"repeated\";\r\n\r\n            /**\r\n             * Message field map flag.\r\n             * @type {boolean}\r\n             * @expose\r\n             */\r\n            this.map = rule === \"map\";\r\n\r\n            /**\r\n             * Message field key type. Type reference string if unresolved, protobuf\r\n             * type if resolved. Valid only if this.map === true, null otherwise.\r\n             * @type {string|{name: string, wireType: number}|null}\r\n             * @expose\r\n             */\r\n            this.keyType = keytype || null;\r\n\r\n            /**\r\n             * Message field type. Type reference string if unresolved, protobuf type if\r\n             * resolved. In a map field, this is the value type.\r\n             * @type {string|{name: string, wireType: number}}\r\n             * @expose\r\n             */\r\n            this.type = type;\r\n\r\n            /**\r\n             * Resolved type reference inside the global namespace.\r\n             * @type {ProtoBuf.Reflect.T|null}\r\n             * @expose\r\n             */\r\n            this.resolvedType = null;\r\n\r\n            /**\r\n             * Unique message field id.\r\n             * @type {number}\r\n             * @expose\r\n             */\r\n            this.id = id;\r\n\r\n            /**\r\n             * Message field options.\r\n             * @type {!Object.}\r\n             * @dict\r\n             * @expose\r\n             */\r\n            this.options = options || {};\r\n\r\n            /**\r\n             * Default value.\r\n             * @type {*}\r\n             * @expose\r\n             */\r\n            this.defaultValue = null;\r\n\r\n            /**\r\n             * Enclosing OneOf.\r\n             * @type {?ProtoBuf.Reflect.Message.OneOf}\r\n             * @expose\r\n             */\r\n            this.oneof = oneof || null;\r\n\r\n            /**\r\n             * Syntax level of this definition (e.g., proto3).\r\n             * @type {string}\r\n             * @expose\r\n             */\r\n            this.syntax = syntax || 'proto2';\r\n\r\n            /**\r\n             * Original field name.\r\n             * @type {string}\r\n             * @expose\r\n             */\r\n            this.originalName = this.name; // Used to revert camelcase transformation on naming collisions\r\n\r\n            /**\r\n             * Element implementation. Created in build() after types are resolved.\r\n             * @type {ProtoBuf.Element}\r\n             * @expose\r\n             */\r\n            this.element = null;\r\n\r\n            /**\r\n             * Key element implementation, for map fields. Created in build() after\r\n             * types are resolved.\r\n             * @type {ProtoBuf.Element}\r\n             * @expose\r\n             */\r\n            this.keyElement = null;\r\n\r\n            // Convert field names to camel case notation if the override is set\r\n            if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))\r\n                this.name = ProtoBuf.Util.toCamelCase(this.name);\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Message.Field.prototype\r\n         * @inner\r\n         */\r\n        var FieldPrototype = Field.prototype = Object.create(T.prototype);\r\n\r\n        /**\r\n         * Builds the field.\r\n         * @override\r\n         * @expose\r\n         */\r\n        FieldPrototype.build = function() {\r\n            this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);\r\n            if (this.map)\r\n                this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);\r\n\r\n            // In proto3, fields do not have field presence, and every field is set to\r\n            // its type's default value (\"\", 0, 0.0, or false).\r\n            if (this.syntax === 'proto3' && !this.repeated && !this.map)\r\n                this.defaultValue = Element.defaultFieldValue(this.type);\r\n\r\n            // Otherwise, default values are present when explicitly specified\r\n            else if (typeof this.options['default'] !== 'undefined')\r\n                this.defaultValue = this.verifyValue(this.options['default']);\r\n        };\r\n\r\n        /**\r\n         * Checks if the given value can be set for this field.\r\n         * @param {*} value Value to check\r\n         * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.\r\n         * @return {*} Verified, maybe adjusted, value\r\n         * @throws {Error} If the value cannot be set for this field\r\n         * @expose\r\n         */\r\n        FieldPrototype.verifyValue = function(value, skipRepeated) {\r\n            skipRepeated = skipRepeated || false;\r\n            var self = this;\r\n            function fail(val, msg) {\r\n                throw Error(\"Illegal value for \"+self.toString(true)+\" of type \"+self.type.name+\": \"+val+\" (\"+msg+\")\");\r\n            }\r\n            if (value === null) { // NULL values for optional fields\r\n                if (this.required)\r\n                    fail(typeof value, \"required\");\r\n                if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES[\"message\"])\r\n                    fail(typeof value, \"proto3 field without field presence cannot be null\");\r\n                return null;\r\n            }\r\n            var i;\r\n            if (this.repeated && !skipRepeated) { // Repeated values as arrays\r\n                if (!Array.isArray(value))\r\n                    value = [value];\r\n                var res = [];\r\n                for (i=0; i 0;\r\n\r\n                case ProtoBuf.TYPES[\"bytes\"]:\r\n                    return value.remaining() > 0;\r\n\r\n                case ProtoBuf.TYPES[\"enum\"]:\r\n                    return value !== 0;\r\n\r\n                case ProtoBuf.TYPES[\"message\"]:\r\n                    return value !== null;\r\n                default:\r\n                    return true;\r\n            }\r\n        };\r\n\r\n        /**\r\n         * Encodes the specified field value to the specified buffer.\r\n         * @param {*} value Verified field value\r\n         * @param {ByteBuffer} buffer ByteBuffer to encode to\r\n         * @param {!ProtoBuf.Builder.Message} message Runtime message\r\n         * @return {ByteBuffer} The ByteBuffer for chaining\r\n         * @throws {Error} If the field cannot be encoded\r\n         * @expose\r\n         */\r\n        FieldPrototype.encode = function(value, buffer, message) {\r\n            if (this.type === null || typeof this.type !== 'object')\r\n                throw Error(\"[INTERNAL] Unresolved type in \"+this.toString(true)+\": \"+this.type);\r\n            if (value === null || (this.repeated && value.length == 0))\r\n                return buffer; // Optional omitted\r\n            try {\r\n                if (this.repeated) {\r\n                    var i;\r\n                    // \"Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire\r\n                    // types) can be declared 'packed'.\"\r\n                    if (this.options[\"packed\"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r\n                        // \"All of the elements of the field are packed into a single key-value pair with wire type 2\r\n                        // (length-delimited). Each element is encoded the same way it would be normally, except without a\r\n                        // tag preceding it.\"\r\n                        buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r\n                        buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1\r\n                        var start = buffer.offset; // Remember where the contents begin\r\n                        for (i=0; i 1) { // We need to move the contents\r\n                            var contents = buffer.slice(start, buffer.offset);\r\n                            start += varintLen-1;\r\n                            buffer.offset = start;\r\n                            buffer.append(contents);\r\n                        }\r\n                        buffer.writeVarint32(len, start-varintLen);\r\n                    } else {\r\n                        // \"If your message definition has repeated elements (without the [packed=true] option), the encoded\r\n                        // message has zero or more key-value pairs with the same tag number\"\r\n                        for (i=0; i= 0) {\r\n                        n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r\n                        ni = 0;\r\n                        for (i=0; i= 0) {\r\n                if (!skipRepeated) {\r\n                    nBytes = buffer.readVarint32();\r\n                    nBytes = buffer.offset + nBytes; // Limit\r\n                    var values = [];\r\n                    while (buffer.offset < nBytes)\r\n                        values.push(this.decode(this.type.wireType, buffer, true));\r\n                    return values;\r\n                }\r\n                // Read the next value otherwise...\r\n            }\r\n\r\n            // Handle maps.\r\n            if (this.map) {\r\n                // Read one (key, value) submessage, and return [key, value]\r\n                var key = Element.defaultFieldValue(this.keyType);\r\n                value = Element.defaultFieldValue(this.type);\r\n\r\n                // Read the length\r\n                nBytes = buffer.readVarint32();\r\n                if (buffer.remaining() < nBytes)\r\n                    throw Error(\"Illegal number of bytes for \"+this.toString(true)+\": \"+nBytes+\" required but got only \"+buffer.remaining());\r\n\r\n                // Get a sub-buffer of this key/value submessage\r\n                var msgbuf = buffer.clone();\r\n                msgbuf.limit = msgbuf.offset + nBytes;\r\n                buffer.offset += nBytes;\r\n\r\n                while (msgbuf.remaining() > 0) {\r\n                    var tag = msgbuf.readVarint32();\r\n                    wireType = tag & 0x07;\r\n                    var id = tag >>> 3;\r\n                    if (id === 1) {\r\n                        key = this.keyElement.decode(msgbuf, wireType, id);\r\n                    } else if (id === 2) {\r\n                        value = this.element.decode(msgbuf, wireType, id);\r\n                    } else {\r\n                        throw Error(\"Unexpected tag in map field key/value submessage\");\r\n                    }\r\n                }\r\n\r\n                return [key, value];\r\n            }\r\n\r\n            // Handle singular and non-packed repeated field values.\r\n            return this.element.decode(buffer, wireType, this.id);\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Message.Field\r\n         * @expose\r\n         */\r\n        Reflect.Message.Field = Field;\r\n\r\n        /**\r\n         * Constructs a new Message ExtensionField.\r\n         * @exports ProtoBuf.Reflect.Message.ExtensionField\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {!ProtoBuf.Reflect.Message} message Message reference\r\n         * @param {string} rule Rule, one of requried, optional, repeated\r\n         * @param {string} type Data type, e.g. int32\r\n         * @param {string} name Field name\r\n         * @param {number} id Unique field id\r\n         * @param {!Object.=} options Options\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.Message.Field\r\n         */\r\n        var ExtensionField = function(builder, message, rule, type, name, id, options) {\r\n            Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options);\r\n\r\n            /**\r\n             * Extension reference.\r\n             * @type {!ProtoBuf.Reflect.Extension}\r\n             * @expose\r\n             */\r\n            this.extension;\r\n        };\r\n\r\n        // Extends Field\r\n        ExtensionField.prototype = Object.create(Field.prototype);\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Message.ExtensionField\r\n         * @expose\r\n         */\r\n        Reflect.Message.ExtensionField = ExtensionField;\r\n\r\n        /**\r\n         * Constructs a new Message OneOf.\r\n         * @exports ProtoBuf.Reflect.Message.OneOf\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {!ProtoBuf.Reflect.Message} message Message reference\r\n         * @param {string} name OneOf name\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.T\r\n         */\r\n        var OneOf = function(builder, message, name) {\r\n            T.call(this, builder, message, name);\r\n\r\n            /**\r\n             * Enclosed fields.\r\n             * @type {!Array.}\r\n             * @expose\r\n             */\r\n            this.fields = [];\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Message.OneOf\r\n         * @expose\r\n         */\r\n        Reflect.Message.OneOf = OneOf;\r\n\r\n        /**\r\n         * Constructs a new Enum.\r\n         * @exports ProtoBuf.Reflect.Enum\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object\r\n         * @param {string} name Enum name\r\n         * @param {Object.=} options Enum options\r\n         * @param {string?} syntax The syntax level (e.g., proto3)\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.Namespace\r\n         */\r\n        var Enum = function(builder, parent, name, options, syntax) {\r\n            Namespace.call(this, builder, parent, name, options, syntax);\r\n\r\n            /**\r\n             * @override\r\n             */\r\n            this.className = \"Enum\";\r\n\r\n            /**\r\n             * Runtime enum object.\r\n             * @type {Object.|null}\r\n             * @expose\r\n             */\r\n            this.object = null;\r\n        };\r\n\r\n        /**\r\n         * Gets the string name of an enum value.\r\n         * @param {!ProtoBuf.Builder.Enum} enm Runtime enum\r\n         * @param {number} value Enum value\r\n         * @returns {?string} Name or `null` if not present\r\n         * @expose\r\n         */\r\n        Enum.getName = function(enm, value) {\r\n            var keys = Object.keys(enm);\r\n            for (var i=0, key; i}\r\n         * @expose\r\n         */\r\n        EnumPrototype.build = function(rebuild) {\r\n            if (this.object && !rebuild)\r\n                return this.object;\r\n            var enm = new ProtoBuf.Builder.Enum(),\r\n                values = this.getChildren(Enum.Value);\r\n            for (var i=0, k=values.length; i=} options Options\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.Namespace\r\n         */\r\n        var Service = function(builder, root, name, options) {\r\n            Namespace.call(this, builder, root, name, options);\r\n\r\n            /**\r\n             * @override\r\n             */\r\n            this.className = \"Service\";\r\n\r\n            /**\r\n             * Built runtime service class.\r\n             * @type {?function(new:ProtoBuf.Builder.Service)}\r\n             */\r\n            this.clazz = null;\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Service.prototype\r\n         * @inner\r\n         */\r\n        var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r\n\r\n        /**\r\n         * Builds the service and returns the runtime counterpart, which is a fully functional class.\r\n         * @see ProtoBuf.Builder.Service\r\n         * @param {boolean=} rebuild Whether to rebuild or not\r\n         * @return {Function} Service class\r\n         * @throws {Error} If the message cannot be built\r\n         * @expose\r\n         */\r\n        ServicePrototype.build = function(rebuild) {\r\n            if (this.clazz && !rebuild)\r\n                return this.clazz;\r\n\r\n            // Create the runtime Service class in its own scope\r\n            return this.clazz = (function(ProtoBuf, T) {\r\n\r\n                /**\r\n                 * Constructs a new runtime Service.\r\n                 * @name ProtoBuf.Builder.Service\r\n                 * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message\r\n                 * @class Barebone of all runtime services.\r\n                 * @constructor\r\n                 * @throws {Error} If the service cannot be created\r\n                 */\r\n                var Service = function(rpcImpl) {\r\n                    ProtoBuf.Builder.Service.call(this);\r\n\r\n                    /**\r\n                     * Service implementation.\r\n                     * @name ProtoBuf.Builder.Service#rpcImpl\r\n                     * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r\n                     * @expose\r\n                     */\r\n                    this.rpcImpl = rpcImpl || function(name, msg, callback) {\r\n                        // This is what a user has to implement: A function receiving the method name, the actual message to\r\n                        // send (type checked) and the callback that's either provided with the error as its first\r\n                        // argument or null and the actual response message.\r\n                        setTimeout(callback.bind(this, Error(\"Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services\")), 0); // Must be async!\r\n                    };\r\n                };\r\n\r\n                /**\r\n                 * @alias ProtoBuf.Builder.Service.prototype\r\n                 * @inner\r\n                 */\r\n                var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);\r\n\r\n                /**\r\n                 * Asynchronously performs an RPC call using the given RPC implementation.\r\n                 * @name ProtoBuf.Builder.Service.[Method]\r\n                 * @function\r\n                 * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation\r\n                 * @param {ProtoBuf.Builder.Message} req Request\r\n                 * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r\n                 *  the error if any and the response either as a pre-parsed message or as its raw bytes\r\n                 * @abstract\r\n                 */\r\n\r\n                /**\r\n                 * Asynchronously performs an RPC call using the instance's RPC implementation.\r\n                 * @name ProtoBuf.Builder.Service#[Method]\r\n                 * @function\r\n                 * @param {ProtoBuf.Builder.Message} req Request\r\n                 * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r\n                 *  the error if any and the response either as a pre-parsed message or as its raw bytes\r\n                 * @abstract\r\n                 */\r\n\r\n                var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);\r\n                for (var i=0; i}\r\n                 * @expose\r\n                 */\r\n                var $optionsS; // cc needs this\r\n\r\n                /**\r\n                 * Service options.\r\n                 * @name ProtoBuf.Builder.Service#$options\r\n                 * @type {Object.}\r\n                 * @expose\r\n                 */\r\n                var $options;\r\n\r\n                /**\r\n                 * Reflection type.\r\n                 * @name ProtoBuf.Builder.Service.$type\r\n                 * @type {!ProtoBuf.Reflect.Service}\r\n                 * @expose\r\n                 */\r\n                var $typeS;\r\n\r\n                /**\r\n                 * Reflection type.\r\n                 * @name ProtoBuf.Builder.Service#$type\r\n                 * @type {!ProtoBuf.Reflect.Service}\r\n                 * @expose\r\n                 */\r\n                var $type;\r\n\r\n                if (Object.defineProperty)\r\n                    Object.defineProperty(Service, \"$options\", { \"value\": T.buildOpt() }),\r\n                    Object.defineProperty(ServicePrototype, \"$options\", { \"value\": Service[\"$options\"] }),\r\n                    Object.defineProperty(Service, \"$type\", { \"value\": T }),\r\n                    Object.defineProperty(ServicePrototype, \"$type\", { \"value\": T });\r\n\r\n                return Service;\r\n\r\n            })(ProtoBuf, this);\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Service\r\n         * @expose\r\n         */\r\n        Reflect.Service = Service;\r\n\r\n        /**\r\n         * Abstract service method.\r\n         * @exports ProtoBuf.Reflect.Service.Method\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {!ProtoBuf.Reflect.Service} svc Service\r\n         * @param {string} name Method name\r\n         * @param {Object.=} options Options\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.T\r\n         */\r\n        var Method = function(builder, svc, name, options) {\r\n            T.call(this, builder, svc, name);\r\n\r\n            /**\r\n             * @override\r\n             */\r\n            this.className = \"Service.Method\";\r\n\r\n            /**\r\n             * Options.\r\n             * @type {Object.}\r\n             * @expose\r\n             */\r\n            this.options = options || {};\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Service.Method.prototype\r\n         * @inner\r\n         */\r\n        var MethodPrototype = Method.prototype = Object.create(T.prototype);\r\n\r\n        /**\r\n         * Builds the method's '$options' property.\r\n         * @name ProtoBuf.Reflect.Service.Method#buildOpt\r\n         * @function\r\n         * @return {Object.}\r\n         */\r\n        MethodPrototype.buildOpt = NamespacePrototype.buildOpt;\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Service.Method\r\n         * @expose\r\n         */\r\n        Reflect.Service.Method = Method;\r\n\r\n        /**\r\n         * RPC service method.\r\n         * @exports ProtoBuf.Reflect.Service.RPCMethod\r\n         * @param {!ProtoBuf.Builder} builder Builder reference\r\n         * @param {!ProtoBuf.Reflect.Service} svc Service\r\n         * @param {string} name Method name\r\n         * @param {string} request Request message name\r\n         * @param {string} response Response message name\r\n         * @param {boolean} request_stream Whether requests are streamed\r\n         * @param {boolean} response_stream Whether responses are streamed\r\n         * @param {Object.=} options Options\r\n         * @constructor\r\n         * @extends ProtoBuf.Reflect.Service.Method\r\n         */\r\n        var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {\r\n            Method.call(this, builder, svc, name, options);\r\n\r\n            /**\r\n             * @override\r\n             */\r\n            this.className = \"Service.RPCMethod\";\r\n\r\n            /**\r\n             * Request message name.\r\n             * @type {string}\r\n             * @expose\r\n             */\r\n            this.requestName = request;\r\n\r\n            /**\r\n             * Response message name.\r\n             * @type {string}\r\n             * @expose\r\n             */\r\n            this.responseName = response;\r\n\r\n            /**\r\n             * Whether requests are streamed\r\n             * @type {bool}\r\n             * @expose\r\n             */\r\n            this.requestStream = request_stream;\r\n\r\n            /**\r\n             * Whether responses are streamed\r\n             * @type {bool}\r\n             * @expose\r\n             */\r\n            this.responseStream = response_stream;\r\n\r\n            /**\r\n             * Resolved request message type.\r\n             * @type {ProtoBuf.Reflect.Message}\r\n             * @expose\r\n             */\r\n            this.resolvedRequestType = null;\r\n\r\n            /**\r\n             * Resolved response message type.\r\n             * @type {ProtoBuf.Reflect.Message}\r\n             * @expose\r\n             */\r\n            this.resolvedResponseType = null;\r\n        };\r\n\r\n        // Extends Method\r\n        RPCMethod.prototype = Object.create(Method.prototype);\r\n\r\n        /**\r\n         * @alias ProtoBuf.Reflect.Service.RPCMethod\r\n         * @expose\r\n         */\r\n        Reflect.Service.RPCMethod = RPCMethod;\r\n\r\n        return Reflect;\r\n\r\n    })(ProtoBuf);\r\n\r\n    /**\r\n     * @alias ProtoBuf.Builder\r\n     * @expose\r\n     */\r\n    ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {\r\n        \"use strict\";\r\n\r\n        /**\r\n         * Constructs a new Builder.\r\n         * @exports ProtoBuf.Builder\r\n         * @class Provides the functionality to build protocol messages.\r\n         * @param {Object.=} options Options\r\n         * @constructor\r\n         */\r\n        var Builder = function(options) {\r\n\r\n            /**\r\n             * Namespace.\r\n             * @type {ProtoBuf.Reflect.Namespace}\r\n             * @expose\r\n             */\r\n            this.ns = new Reflect.Namespace(this, null, \"\"); // Global namespace\r\n\r\n            /**\r\n             * Namespace pointer.\r\n             * @type {ProtoBuf.Reflect.T}\r\n             * @expose\r\n             */\r\n            this.ptr = this.ns;\r\n\r\n            /**\r\n             * Resolved flag.\r\n             * @type {boolean}\r\n             * @expose\r\n             */\r\n            this.resolved = false;\r\n\r\n            /**\r\n             * The current building result.\r\n             * @type {Object.|null}\r\n             * @expose\r\n             */\r\n            this.result = null;\r\n\r\n            /**\r\n             * Imported files.\r\n             * @type {Array.}\r\n             * @expose\r\n             */\r\n            this.files = {};\r\n\r\n            /**\r\n             * Import root override.\r\n             * @type {?string}\r\n             * @expose\r\n             */\r\n            this.importRoot = null;\r\n\r\n            /**\r\n             * Options.\r\n             * @type {!Object.}\r\n             * @expose\r\n             */\r\n            this.options = options || {};\r\n        };\r\n\r\n        /**\r\n         * @alias ProtoBuf.Builder.prototype\r\n         * @inner\r\n         */\r\n        var BuilderPrototype = Builder.prototype;\r\n\r\n        // ----- Definition tests -----\r\n\r\n        /**\r\n         * Tests if a definition most likely describes a message.\r\n         * @param {!Object} def\r\n         * @returns {boolean}\r\n         * @expose\r\n         */\r\n        Builder.isMessage = function(def) {\r\n            // Messages require a string name\r\n            if (typeof def[\"name\"] !== 'string')\r\n                return false;\r\n            // Messages do not contain values (enum) or rpc methods (service)\r\n            if (typeof def[\"values\"] !== 'undefined' || typeof def[\"rpc\"] !== 'undefined')\r\n                return false;\r\n            return true;\r\n        };\r\n\r\n        /**\r\n         * Tests if a definition most likely describes a message field.\r\n         * @param {!Object} def\r\n         * @returns {boolean}\r\n         * @expose\r\n         */\r\n        Builder.isMessageField = function(def) {\r\n            // Message fields require a string rule, name and type and an id\r\n            if (typeof def[\"rule\"] !== 'string' || typeof def[\"name\"] !== 'string' || typeof def[\"type\"] !== 'string' || typeof def[\"id\"] === 'undefined')\r\n                return false;\r\n            return true;\r\n        };\r\n\r\n        /**\r\n         * Tests if a definition most likely describes an enum.\r\n         * @param {!Object} def\r\n         * @returns {boolean}\r\n         * @expose\r\n         */\r\n        Builder.isEnum = function(def) {\r\n            // Enums require a string name\r\n            if (typeof def[\"name\"] !== 'string')\r\n                return false;\r\n            // Enums require at least one value\r\n            if (typeof def[\"values\"] === 'undefined' || !Array.isArray(def[\"values\"]) || def[\"values\"].length === 0)\r\n                return false;\r\n            return true;\r\n        };\r\n\r\n        /**\r\n         * Tests if a definition most likely describes a service.\r\n         * @param {!Object} def\r\n         * @returns {boolean}\r\n         * @expose\r\n         */\r\n        Builder.isService = function(def) {\r\n            // Services require a string name and an rpc object\r\n            if (typeof def[\"name\"] !== 'string' || typeof def[\"rpc\"] !== 'object' || !def[\"rpc\"])\r\n                return false;\r\n            return true;\r\n        };\r\n\r\n        /**\r\n         * Tests if a definition most likely describes an extended message\r\n         * @param {!Object} def\r\n         * @returns {boolean}\r\n         * @expose\r\n         */\r\n        Builder.isExtend = function(def) {\r\n            // Extends rquire a string ref\r\n            if (typeof def[\"ref\"] !== 'string')\r\n                return false;\r\n            return true;\r\n        };\r\n\r\n        // ----- Building -----\r\n\r\n        /**\r\n         * Resets the pointer to the root namespace.\r\n         * @returns {!ProtoBuf.Builder} this\r\n         * @expose\r\n         */\r\n        BuilderPrototype.reset = function() {\r\n            this.ptr = this.ns;\r\n            return this;\r\n        };\r\n\r\n        /**\r\n         * Defines a namespace on top of the current pointer position and places the pointer on it.\r\n         * @param {string} namespace\r\n         * @return {!ProtoBuf.Builder} this\r\n         * @expose\r\n         */\r\n        BuilderPrototype.define = function(namespace) {\r\n            if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))\r\n                throw Error(\"illegal namespace: \"+namespace);\r\n            namespace.split(\".\").forEach(function(part) {\r\n                var ns = this.ptr.getChild(part);\r\n                if (ns === null) // Keep existing\r\n                    this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));\r\n                this.ptr = ns;\r\n            }, this);\r\n            return this;\r\n        };\r\n\r\n        /**\r\n         * Creates the specified definitions at the current pointer position.\r\n         * @param {!Array.} defs Messages, enums or services to create\r\n         * @returns {!ProtoBuf.Builder} this\r\n         * @throws {Error} If a message definition is invalid\r\n         * @expose\r\n         */\r\n        BuilderPrototype.create = function(defs) {\r\n            if (!defs)\r\n                return this; // Nothing to create\r\n            if (!Array.isArray(defs))\r\n                defs = [defs];\r\n            else {\r\n                if (defs.length === 0)\r\n                    return this;\r\n                defs = defs.slice();\r\n            }\r\n\r\n            // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.\r\n            var stack = [defs];\r\n            while (stack.length > 0) {\r\n                defs = stack.pop();\r\n\r\n                if (!Array.isArray(defs)) // Stack always contains entire namespaces\r\n                    throw Error(\"not a valid namespace: \"+JSON.stringify(defs));\r\n\r\n                while (defs.length > 0) {\r\n                    var def = defs.shift(); // Namespaces always contain an array of messages, enums and services\r\n\r\n                    if (Builder.isMessage(def)) {\r\n                        var obj = new Reflect.Message(this, this.ptr, def[\"name\"], def[\"options\"], def[\"isGroup\"], def[\"syntax\"]);\r\n\r\n                        // Create OneOfs\r\n                        var oneofs = {};\r\n                        if (def[\"oneofs\"])\r\n                            Object.keys(def[\"oneofs\"]).forEach(function(name) {\r\n                                obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));\r\n                            }, this);\r\n\r\n                        // Create fields\r\n                        if (def[\"fields\"])\r\n                            def[\"fields\"].forEach(function(fld) {\r\n                                if (obj.getChild(fld[\"id\"]|0) !== null)\r\n                                    throw Error(\"duplicate or invalid field id in \"+obj.name+\": \"+fld['id']);\r\n                                if (fld[\"options\"] && typeof fld[\"options\"] !== 'object')\r\n                                    throw Error(\"illegal field options in \"+obj.name+\"#\"+fld[\"name\"]);\r\n                                var oneof = null;\r\n                                if (typeof fld[\"oneof\"] === 'string' && !(oneof = oneofs[fld[\"oneof\"]]))\r\n                                    throw Error(\"illegal oneof in \"+obj.name+\"#\"+fld[\"name\"]+\": \"+fld[\"oneof\"]);\r\n                                fld = new Reflect.Message.Field(this, obj, fld[\"rule\"], fld[\"keytype\"], fld[\"type\"], fld[\"name\"], fld[\"id\"], fld[\"options\"], oneof, def[\"syntax\"]);\r\n                                if (oneof)\r\n                                    oneof.fields.push(fld);\r\n                                obj.addChild(fld);\r\n                            }, this);\r\n\r\n                        // Push children to stack\r\n                        var subObj = [];\r\n                        if (def[\"enums\"])\r\n                            def[\"enums\"].forEach(function(enm) {\r\n                                subObj.push(enm);\r\n                            });\r\n                        if (def[\"messages\"])\r\n                            def[\"messages\"].forEach(function(msg) {\r\n                                subObj.push(msg);\r\n                            });\r\n                        if (def[\"services\"])\r\n                            def[\"services\"].forEach(function(svc) {\r\n                                subObj.push(svc);\r\n                            });\r\n\r\n                        // Set extension ranges\r\n                        if (def[\"extensions\"]) {\r\n                            if (typeof def[\"extensions\"][0] === 'number') // pre 5.0.1\r\n                                obj.extensions = [ def[\"extensions\"] ];\r\n                            else\r\n                                obj.extensions = def[\"extensions\"];\r\n                        }\r\n\r\n                        // Create on top of current namespace\r\n                        this.ptr.addChild(obj);\r\n                        if (subObj.length > 0) {\r\n                            stack.push(defs); // Push the current level back\r\n                            defs = subObj; // Continue processing sub level\r\n                            subObj = null;\r\n                            this.ptr = obj; // And move the pointer to this namespace\r\n                            obj = null;\r\n                            continue;\r\n                        }\r\n                        subObj = null;\r\n\r\n                    } else if (Builder.isEnum(def)) {\r\n\r\n                        obj = new Reflect.Enum(this, this.ptr, def[\"name\"], def[\"options\"], def[\"syntax\"]);\r\n                        def[\"values\"].forEach(function(val) {\r\n                            obj.addChild(new Reflect.Enum.Value(this, obj, val[\"name\"], val[\"id\"]));\r\n                        }, this);\r\n                        this.ptr.addChild(obj);\r\n\r\n                    } else if (Builder.isService(def)) {\r\n\r\n                        obj = new Reflect.Service(this, this.ptr, def[\"name\"], def[\"options\"]);\r\n                        Object.keys(def[\"rpc\"]).forEach(function(name) {\r\n                            var mtd = def[\"rpc\"][name];\r\n                            obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd[\"request\"], mtd[\"response\"], !!mtd[\"request_stream\"], !!mtd[\"response_stream\"], mtd[\"options\"]));\r\n                        }, this);\r\n                        this.ptr.addChild(obj);\r\n\r\n                    } else if (Builder.isExtend(def)) {\r\n\r\n                        obj = this.ptr.resolve(def[\"ref\"], true);\r\n                        if (obj) {\r\n                            def[\"fields\"].forEach(function(fld) {\r\n                                if (obj.getChild(fld['id']|0) !== null)\r\n                                    throw Error(\"duplicate extended field id in \"+obj.name+\": \"+fld['id']);\r\n                                // Check if field id is allowed to be extended\r\n                                if (obj.extensions) {\r\n                                    var valid = false;\r\n                                    obj.extensions.forEach(function(range) {\r\n                                        if (fld[\"id\"] >= range[0] && fld[\"id\"] <= range[1])\r\n                                            valid = true;\r\n                                    });\r\n                                    if (!valid)\r\n                                        throw Error(\"illegal extended field id in \"+obj.name+\": \"+fld['id']+\" (not within valid ranges)\");\r\n                                }\r\n                                // Convert extension field names to camel case notation if the override is set\r\n                                var name = fld[\"name\"];\r\n                                if (this.options['convertFieldsToCamelCase'])\r\n                                    name = ProtoBuf.Util.toCamelCase(name);\r\n                                // see #161: Extensions use their fully qualified name as their runtime key and...\r\n                                var field = new Reflect.Message.ExtensionField(this, obj, fld[\"rule\"], fld[\"type\"], this.ptr.fqn()+'.'+name, fld[\"id\"], fld[\"options\"]);\r\n                                // ...are added on top of the current namespace as an extension which is used for\r\n                                // resolving their type later on (the extension always keeps the original name to\r\n                                // prevent naming collisions)\r\n                                var ext = new Reflect.Extension(this, this.ptr, fld[\"name\"], field);\r\n                                field.extension = ext;\r\n                                this.ptr.addChild(ext);\r\n                                obj.addChild(field);\r\n                            }, this);\r\n\r\n                        } else if (!/\\.?google\\.protobuf\\./.test(def[\"ref\"])) // Silently skip internal extensions\r\n                            throw Error(\"extended message \"+def[\"ref\"]+\" is not defined\");\r\n\r\n                    } else\r\n                        throw Error(\"not a valid definition: \"+JSON.stringify(def));\r\n\r\n                    def = null;\r\n                    obj = null;\r\n                }\r\n                // Break goes here\r\n                defs = null;\r\n                this.ptr = this.ptr.parent; // Namespace done, continue at parent\r\n            }\r\n            this.resolved = false; // Require re-resolve\r\n            this.result = null; // Require re-build\r\n            return this;\r\n        };\r\n\r\n        /**\r\n         * Propagates syntax to all children.\r\n         * @param {!Object} parent\r\n         * @inner\r\n         */\r\n        function propagateSyntax(parent) {\r\n            if (parent['messages']) {\r\n                parent['messages'].forEach(function(child) {\r\n                    child[\"syntax\"] = parent[\"syntax\"];\r\n                    propagateSyntax(child);\r\n                });\r\n            }\r\n            if (parent['enums']) {\r\n                parent['enums'].forEach(function(child) {\r\n                    child[\"syntax\"] = parent[\"syntax\"];\r\n                });\r\n            }\r\n        }\r\n\r\n        /**\r\n         * Imports another definition into this builder.\r\n         * @param {Object.} json Parsed import\r\n         * @param {(string|{root: string, file: string})=} filename Imported file name\r\n         * @returns {!ProtoBuf.Builder} this\r\n         * @throws {Error} If the definition or file cannot be imported\r\n         * @expose\r\n         */\r\n        BuilderPrototype[\"import\"] = function(json, filename) {\r\n            var delim = '/';\r\n\r\n            // Make sure to skip duplicate imports\r\n\r\n            if (typeof filename === 'string') {\r\n\r\n                if (ProtoBuf.Util.IS_NODE)\r\n                    filename = require(\"path\")['resolve'](filename);\r\n                if (this.files[filename] === true)\r\n                    return this.reset();\r\n                this.files[filename] = true;\r\n\r\n            } else if (typeof filename === 'object') { // Object with root, file.\r\n\r\n                var root = filename.root;\r\n                if (ProtoBuf.Util.IS_NODE)\r\n                    root = require(\"path\")['resolve'](root);\r\n                if (root.indexOf(\"\\\\\") >= 0 || filename.file.indexOf(\"\\\\\") >= 0)\r\n                    delim = '\\\\';\r\n                var fname;\r\n                if (ProtoBuf.Util.IS_NODE)\r\n                    fname = require(\"path\")['join'](root, filename.file);\r\n                else\r\n                    fname = root + delim + filename.file;\r\n                if (this.files[fname] === true)\r\n                    return this.reset();\r\n                this.files[fname] = true;\r\n            }\r\n\r\n            // Import imports\r\n\r\n            if (json['imports'] && json['imports'].length > 0) {\r\n                var importRoot,\r\n                    resetRoot = false;\r\n\r\n                if (typeof filename === 'object') { // If an import root is specified, override\r\n\r\n                    this.importRoot = filename[\"root\"]; resetRoot = true; // ... and reset afterwards\r\n                    importRoot = this.importRoot;\r\n                    filename = filename[\"file\"];\r\n                    if (importRoot.indexOf(\"\\\\\") >= 0 || filename.indexOf(\"\\\\\") >= 0)\r\n                        delim = '\\\\';\r\n\r\n                } else if (typeof filename === 'string') {\r\n\r\n                    if (this.importRoot) // If import root is overridden, use it\r\n                        importRoot = this.importRoot;\r\n                    else { // Otherwise compute from filename\r\n                        if (filename.indexOf(\"/\") >= 0) { // Unix\r\n                            importRoot = filename.replace(/\\/[^\\/]*$/, \"\");\r\n                            if (/* /file.proto */ importRoot === \"\")\r\n                                importRoot = \"/\";\r\n                        } else if (filename.indexOf(\"\\\\\") >= 0) { // Windows\r\n                            importRoot = filename.replace(/\\\\[^\\\\]*$/, \"\");\r\n                            delim = '\\\\';\r\n                        } else\r\n                            importRoot = \".\";\r\n                    }\r\n\r\n                } else\r\n                    importRoot = null;\r\n\r\n                for (var i=0; i)=} path Specifies what to return. If omitted, the entire namespace will be returned.\r\n         * @returns {!ProtoBuf.Builder.Message|!Object.}\r\n         * @throws {Error} If a type could not be resolved\r\n         * @expose\r\n         */\r\n        BuilderPrototype.build = function(path) {\r\n            this.reset();\r\n            if (!this.resolved)\r\n                this.resolveAll(),\r\n                this.resolved = true,\r\n                this.result = null; // Require re-build\r\n            if (this.result === null) // (Re-)Build\r\n                this.result = this.ns.build();\r\n            if (!path)\r\n                return this.result;\r\n            var part = typeof path === 'string' ? path.split(\".\") : path,\r\n                ptr = this.result; // Build namespace pointer (no hasChild etc.)\r\n            for (var i=0; i=} contents Initial contents\r\n         * @constructor\r\n         */\r\n        var Map = function(field, contents) {\r\n            if (!field.map)\r\n                throw Error(\"field is not a map\");\r\n\r\n            /**\r\n             * The field corresponding to this map.\r\n             * @type {!ProtoBuf.Reflect.Field}\r\n             */\r\n            this.field = field;\r\n\r\n            /**\r\n             * Element instance corresponding to key type.\r\n             * @type {!ProtoBuf.Reflect.Element}\r\n             */\r\n            this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);\r\n\r\n            /**\r\n             * Element instance corresponding to value type.\r\n             * @type {!ProtoBuf.Reflect.Element}\r\n             */\r\n            this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);\r\n\r\n            /**\r\n             * Internal map: stores mapping of (string form of key) -> (key, value)\r\n             * pair.\r\n             *\r\n             * We provide map semantics for arbitrary key types, but we build on top\r\n             * of an Object, which has only string keys. In order to avoid the need\r\n             * to convert a string key back to its native type in many situations,\r\n             * we store the native key value alongside the value. Thus, we only need\r\n             * a one-way mapping from a key type to its string form that guarantees\r\n             * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1\r\n             * === K2).\r\n             *\r\n             * @type {!Object}\r\n             */\r\n            this.map = {};\r\n\r\n            /**\r\n             * Returns the number of elements in the map.\r\n             */\r\n            Object.defineProperty(this, \"size\", {\r\n                get: function() { return Object.keys(this.map).length; }\r\n            });\r\n\r\n            // Fill initial contents from a raw object.\r\n            if (contents) {\r\n                var keys = Object.keys(contents);\r\n                for (var i = 0; i < keys.length; i++) {\r\n                    var key = this.keyElem.valueFromString(keys[i]);\r\n                    var val = this.valueElem.verifyValue(contents[keys[i]]);\r\n                    this.map[this.keyElem.valueToString(key)] =\r\n                        { key: key, value: val };\r\n                }\r\n            }\r\n        };\r\n\r\n        var MapPrototype = Map.prototype;\r\n\r\n        /**\r\n         * Helper: return an iterator over an array.\r\n         * @param {!Array<*>} arr the array\r\n         * @returns {!Object} an iterator\r\n         * @inner\r\n         */\r\n        function arrayIterator(arr) {\r\n            var idx = 0;\r\n            return {\r\n                next: function() {\r\n                    if (idx < arr.length)\r\n                        return { done: false, value: arr[idx++] };\r\n                    return { done: true };\r\n                }\r\n            }\r\n        }\r\n\r\n        /**\r\n         * Clears the map.\r\n         */\r\n        MapPrototype.clear = function() {\r\n            this.map = {};\r\n        };\r\n\r\n        /**\r\n         * Deletes a particular key from the map.\r\n         * @returns {boolean} Whether any entry with this key was deleted.\r\n         */\r\n        MapPrototype[\"delete\"] = function(key) {\r\n            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n            var hadKey = keyValue in this.map;\r\n            delete this.map[keyValue];\r\n            return hadKey;\r\n        };\r\n\r\n        /**\r\n         * Returns an iterator over [key, value] pairs in the map.\r\n         * @returns {Object} The iterator\r\n         */\r\n        MapPrototype.entries = function() {\r\n            var entries = [];\r\n            var strKeys = Object.keys(this.map);\r\n            for (var i = 0, entry; i < strKeys.length; i++)\r\n                entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);\r\n            return arrayIterator(entries);\r\n        };\r\n\r\n        /**\r\n         * Returns an iterator over keys in the map.\r\n         * @returns {Object} The iterator\r\n         */\r\n        MapPrototype.keys = function() {\r\n            var keys = [];\r\n            var strKeys = Object.keys(this.map);\r\n            for (var i = 0; i < strKeys.length; i++)\r\n                keys.push(this.map[strKeys[i]].key);\r\n            return arrayIterator(keys);\r\n        };\r\n\r\n        /**\r\n         * Returns an iterator over values in the map.\r\n         * @returns {!Object} The iterator\r\n         */\r\n        MapPrototype.values = function() {\r\n            var values = [];\r\n            var strKeys = Object.keys(this.map);\r\n            for (var i = 0; i < strKeys.length; i++)\r\n                values.push(this.map[strKeys[i]].value);\r\n            return arrayIterator(values);\r\n        };\r\n\r\n        /**\r\n         * Iterates over entries in the map, calling a function on each.\r\n         * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments.\r\n         * @param {Object=} thisArg The `this` value for the callback\r\n         */\r\n        MapPrototype.forEach = function(cb, thisArg) {\r\n            var strKeys = Object.keys(this.map);\r\n            for (var i = 0, entry; i < strKeys.length; i++)\r\n                cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);\r\n        };\r\n\r\n        /**\r\n         * Sets a key in the map to the given value.\r\n         * @param {*} key The key\r\n         * @param {*} value The value\r\n         * @returns {!ProtoBuf.Map} The map instance\r\n         */\r\n        MapPrototype.set = function(key, value) {\r\n            var keyValue = this.keyElem.verifyValue(key);\r\n            var valValue = this.valueElem.verifyValue(value);\r\n            this.map[this.keyElem.valueToString(keyValue)] =\r\n                { key: keyValue, value: valValue };\r\n            return this;\r\n        };\r\n\r\n        /**\r\n         * Gets the value corresponding to a key in the map.\r\n         * @param {*} key The key\r\n         * @returns {*|undefined} The value, or `undefined` if key not present\r\n         */\r\n        MapPrototype.get = function(key) {\r\n            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n            if (!(keyValue in this.map))\r\n                return undefined;\r\n            return this.map[keyValue].value;\r\n        };\r\n\r\n        /**\r\n         * Determines whether the given key is present in the map.\r\n         * @param {*} key The key\r\n         * @returns {boolean} `true` if the key is present\r\n         */\r\n        MapPrototype.has = function(key) {\r\n            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r\n            return (keyValue in this.map);\r\n        };\r\n\r\n        return Map;\r\n    })(ProtoBuf, ProtoBuf.Reflect);\r\n\r\n\r\n    /**\r\n     * Constructs a new empty Builder.\r\n     * @param {Object.=} options Builder options, defaults to global options set on ProtoBuf\r\n     * @return {!ProtoBuf.Builder} Builder\r\n     * @expose\r\n     */\r\n    ProtoBuf.newBuilder = function(options) {\r\n        options = options || {};\r\n        if (typeof options['convertFieldsToCamelCase'] === 'undefined')\r\n            options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;\r\n        if (typeof options['populateAccessors'] === 'undefined')\r\n            options['populateAccessors'] = ProtoBuf.populateAccessors;\r\n        return new ProtoBuf.Builder(options);\r\n    };\r\n\r\n    /**\r\n     * Loads a .json definition and returns the Builder.\r\n     * @param {!*|string} json JSON definition\r\n     * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r\n     * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r\n     * @return {ProtoBuf.Builder} Builder to create new messages\r\n     * @throws {Error} If the definition cannot be parsed or built\r\n     * @expose\r\n     */\r\n    ProtoBuf.loadJson = function(json, builder, filename) {\r\n        if (typeof builder === 'string' || (builder && typeof builder[\"file\"] === 'string' && typeof builder[\"root\"] === 'string'))\r\n            filename = builder,\r\n            builder = null;\r\n        if (!builder || typeof builder !== 'object')\r\n            builder = ProtoBuf.newBuilder();\r\n        if (typeof json === 'string')\r\n            json = JSON.parse(json);\r\n        builder[\"import\"](json, filename);\r\n        builder.resolveAll();\r\n        return builder;\r\n    };\r\n\r\n    /**\r\n     * Loads a .json file and returns the Builder.\r\n     * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with\r\n     *  an overridden 'root' path for all imported files.\r\n     * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r\n     *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r\n     *  file will be read synchronously and this function will return the Builder.\r\n     * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r\n     * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r\n     *   request has failed), else undefined\r\n     * @expose\r\n     */\r\n    ProtoBuf.loadJsonFile = function(filename, callback, builder) {\r\n        if (callback && typeof callback === 'object')\r\n            builder = callback,\r\n            callback = null;\r\n        else if (!callback || typeof callback !== 'function')\r\n            callback = null;\r\n        if (callback)\r\n            return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename[\"root\"]+\"/\"+filename[\"file\"], function(contents) {\r\n                if (contents === null) {\r\n                    callback(Error(\"Failed to fetch file\"));\r\n                    return;\r\n                }\r\n                try {\r\n                    callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));\r\n                } catch (e) {\r\n                    callback(e);\r\n                }\r\n            });\r\n        var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename[\"root\"]+\"/\"+filename[\"file\"] : filename);\r\n        return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);\r\n    };\r\n\r\n    return ProtoBuf;\r\n});\r\n","module.exports = require(\"protobufjs/dist/protobuf-light\").newBuilder({})['import']({\n    \"package\": \"push_server.messages2\",\n    \"syntax\": \"proto2\",\n    \"options\": {\n        \"objc_class_prefix\": \"AVIM\"\n    },\n    \"messages\": [\n        {\n            \"name\": \"JsonObjectMessage\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"required\",\n                    \"type\": \"string\",\n                    \"name\": \"data\",\n                    \"id\": 1\n                }\n            ]\n        },\n        {\n            \"name\": \"UnreadTuple\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"required\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"required\",\n                    \"type\": \"int32\",\n                    \"name\": \"unread\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"mid\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"timestamp\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"from\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"data\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"patchTimestamp\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"mentioned\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bytes\",\n                    \"name\": \"binaryMsg\",\n                    \"id\": 9\n                }\n            ]\n        },\n        {\n            \"name\": \"LogItem\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"from\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"data\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"timestamp\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"msgId\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"ackAt\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"readAt\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"patchTimestamp\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"mentionAll\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"mentionPids\",\n                    \"id\": 9\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"bin\",\n                    \"id\": 10\n                }\n            ]\n        },\n        {\n            \"name\": \"DataCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"ids\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"JsonObjectMessage\",\n                    \"name\": \"msg\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"offline\",\n                    \"id\": 3\n                }\n            ]\n        },\n        {\n            \"name\": \"SessionCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"t\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"n\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"s\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"ua\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"r\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"tag\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"deviceId\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"sessionPeerIds\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"onlineSessionPeerIds\",\n                    \"id\": 9\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"st\",\n                    \"id\": 10\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"stTtl\",\n                    \"id\": 11\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"code\",\n                    \"id\": 12\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"reason\",\n                    \"id\": 13\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"deviceToken\",\n                    \"id\": 14\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"sp\",\n                    \"id\": 15\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"detail\",\n                    \"id\": 16\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"lastUnreadNotifTime\",\n                    \"id\": 17\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"lastPatchTime\",\n                    \"id\": 18\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"configBitmap\",\n                    \"id\": 19\n                }\n            ]\n        },\n        {\n            \"name\": \"ErrorCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"required\",\n                    \"type\": \"int32\",\n                    \"name\": \"code\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"required\",\n                    \"type\": \"string\",\n                    \"name\": \"reason\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"appCode\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"detail\",\n                    \"id\": 4\n                }\n            ]\n        },\n        {\n            \"name\": \"DirectCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"msg\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"uid\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"fromPeerId\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"timestamp\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"offline\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"hasMore\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"toPeerIds\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"r\",\n                    \"id\": 10\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 11\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"id\",\n                    \"id\": 12\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"transient\",\n                    \"id\": 13\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"dt\",\n                    \"id\": 14\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"roomId\",\n                    \"id\": 15\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"pushData\",\n                    \"id\": 16\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"will\",\n                    \"id\": 17\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"patchTimestamp\",\n                    \"id\": 18\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bytes\",\n                    \"name\": \"binaryMsg\",\n                    \"id\": 19\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"mentionPids\",\n                    \"id\": 20\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"mentionAll\",\n                    \"id\": 21\n                }\n            ]\n        },\n        {\n            \"name\": \"AckCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"code\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"reason\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"mid\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"t\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"uid\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"fromts\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"tots\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"type\",\n                    \"id\": 9\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"ids\",\n                    \"id\": 10\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"appCode\",\n                    \"id\": 11\n                }\n            ]\n        },\n        {\n            \"name\": \"UnreadCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"UnreadTuple\",\n                    \"name\": \"convs\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"notifTime\",\n                    \"id\": 2\n                }\n            ]\n        },\n        {\n            \"name\": \"ConvCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"m\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"transient\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"unique\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cdate\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"initBy\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"sort\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"limit\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"skip\",\n                    \"id\": 9\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"flag\",\n                    \"id\": 10\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"count\",\n                    \"id\": 11\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"udate\",\n                    \"id\": 12\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"t\",\n                    \"id\": 13\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"n\",\n                    \"id\": 14\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"s\",\n                    \"id\": 15\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"statusSub\",\n                    \"id\": 16\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"statusPub\",\n                    \"id\": 17\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"statusTTL\",\n                    \"id\": 18\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"uniqueId\",\n                    \"id\": 19\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"targetClientId\",\n                    \"id\": 20\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"maxReadTimestamp\",\n                    \"id\": 21\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"maxAckTimestamp\",\n                    \"id\": 22\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"queryAllMembers\",\n                    \"id\": 23\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"MaxReadTuple\",\n                    \"name\": \"maxReadTuples\",\n                    \"id\": 24\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"cids\",\n                    \"id\": 25\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"JsonObjectMessage\",\n                    \"name\": \"results\",\n                    \"id\": 100\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"JsonObjectMessage\",\n                    \"name\": \"where\",\n                    \"id\": 101\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"JsonObjectMessage\",\n                    \"name\": \"attr\",\n                    \"id\": 103\n                }\n            ]\n        },\n        {\n            \"name\": \"RoomCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"roomId\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"s\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"t\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"n\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"transient\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"roomPeerIds\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"byPeerId\",\n                    \"id\": 7\n                }\n            ]\n        },\n        {\n            \"name\": \"LogsCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"l\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"limit\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"t\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"tt\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"tmid\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"mid\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"checksum\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"stored\",\n                    \"id\": 9\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"QueryDirection\",\n                    \"name\": \"direction\",\n                    \"id\": 10,\n                    \"options\": {\n                        \"default\": \"OLD\"\n                    }\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"tIncluded\",\n                    \"id\": 11\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"ttIncluded\",\n                    \"id\": 12\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"LogItem\",\n                    \"name\": \"logs\",\n                    \"id\": 105\n                }\n            ],\n            \"enums\": [\n                {\n                    \"name\": \"QueryDirection\",\n                    \"syntax\": \"proto2\",\n                    \"values\": [\n                        {\n                            \"name\": \"OLD\",\n                            \"id\": 1\n                        },\n                        {\n                            \"name\": \"NEW\",\n                            \"id\": 2\n                        }\n                    ]\n                }\n            ]\n        },\n        {\n            \"name\": \"RcpCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"id\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"t\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"read\",\n                    \"id\": 4\n                }\n            ]\n        },\n        {\n            \"name\": \"ReadTuple\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"required\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"timestamp\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"mid\",\n                    \"id\": 3\n                }\n            ]\n        },\n        {\n            \"name\": \"MaxReadTuple\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"pid\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"maxAckTimestamp\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"maxReadTimestamp\",\n                    \"id\": 3\n                }\n            ]\n        },\n        {\n            \"name\": \"ReadCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"cids\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"ReadTuple\",\n                    \"name\": \"convs\",\n                    \"id\": 3\n                }\n            ]\n        },\n        {\n            \"name\": \"PresenceCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"StatusType\",\n                    \"name\": \"status\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"sessionPeerIds\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 3\n                }\n            ]\n        },\n        {\n            \"name\": \"ReportCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"initiative\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"type\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"data\",\n                    \"id\": 3\n                }\n            ]\n        },\n        {\n            \"name\": \"PatchItem\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"cid\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"mid\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"timestamp\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"recall\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"data\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"patchTimestamp\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"from\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bytes\",\n                    \"name\": \"binaryMsg\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"bool\",\n                    \"name\": \"mentionAll\",\n                    \"id\": 9\n                },\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"string\",\n                    \"name\": \"mentionPids\",\n                    \"id\": 10\n                }\n            ]\n        },\n        {\n            \"name\": \"PatchCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"repeated\",\n                    \"type\": \"PatchItem\",\n                    \"name\": \"patches\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int64\",\n                    \"name\": \"lastPatchTime\",\n                    \"id\": 2\n                }\n            ]\n        },\n        {\n            \"name\": \"GenericCommand\",\n            \"syntax\": \"proto2\",\n            \"fields\": [\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"CommandType\",\n                    \"name\": \"cmd\",\n                    \"id\": 1\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"OpType\",\n                    \"name\": \"op\",\n                    \"id\": 2\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"appId\",\n                    \"id\": 3\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"peerId\",\n                    \"id\": 4\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"i\",\n                    \"id\": 5\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"string\",\n                    \"name\": \"installationId\",\n                    \"id\": 6\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"priority\",\n                    \"id\": 7\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"int32\",\n                    \"name\": \"service\",\n                    \"id\": 8\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"DataCommand\",\n                    \"name\": \"dataMessage\",\n                    \"id\": 101\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"SessionCommand\",\n                    \"name\": \"sessionMessage\",\n                    \"id\": 102\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"ErrorCommand\",\n                    \"name\": \"errorMessage\",\n                    \"id\": 103\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"DirectCommand\",\n                    \"name\": \"directMessage\",\n                    \"id\": 104\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"AckCommand\",\n                    \"name\": \"ackMessage\",\n                    \"id\": 105\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"UnreadCommand\",\n                    \"name\": \"unreadMessage\",\n                    \"id\": 106\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"ReadCommand\",\n                    \"name\": \"readMessage\",\n                    \"id\": 107\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"RcpCommand\",\n                    \"name\": \"rcpMessage\",\n                    \"id\": 108\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"LogsCommand\",\n                    \"name\": \"logsMessage\",\n                    \"id\": 109\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"ConvCommand\",\n                    \"name\": \"convMessage\",\n                    \"id\": 110\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"RoomCommand\",\n                    \"name\": \"roomMessage\",\n                    \"id\": 111\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"PresenceCommand\",\n                    \"name\": \"presenceMessage\",\n                    \"id\": 112\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"ReportCommand\",\n                    \"name\": \"reportMessage\",\n                    \"id\": 113\n                },\n                {\n                    \"rule\": \"optional\",\n                    \"type\": \"PatchCommand\",\n                    \"name\": \"patchMessage\",\n                    \"id\": 114\n                }\n            ]\n        }\n    ],\n    \"enums\": [\n        {\n            \"name\": \"CommandType\",\n            \"syntax\": \"proto2\",\n            \"values\": [\n                {\n                    \"name\": \"session\",\n                    \"id\": 0\n                },\n                {\n                    \"name\": \"conv\",\n                    \"id\": 1\n                },\n                {\n                    \"name\": \"direct\",\n                    \"id\": 2\n                },\n                {\n                    \"name\": \"ack\",\n                    \"id\": 3\n                },\n                {\n                    \"name\": \"rcp\",\n                    \"id\": 4\n                },\n                {\n                    \"name\": \"unread\",\n                    \"id\": 5\n                },\n                {\n                    \"name\": \"logs\",\n                    \"id\": 6\n                },\n                {\n                    \"name\": \"error\",\n                    \"id\": 7\n                },\n                {\n                    \"name\": \"login\",\n                    \"id\": 8\n                },\n                {\n                    \"name\": \"data\",\n                    \"id\": 9\n                },\n                {\n                    \"name\": \"room\",\n                    \"id\": 10\n                },\n                {\n                    \"name\": \"read\",\n                    \"id\": 11\n                },\n                {\n                    \"name\": \"presence\",\n                    \"id\": 12\n                },\n                {\n                    \"name\": \"report\",\n                    \"id\": 13\n                },\n                {\n                    \"name\": \"echo\",\n                    \"id\": 14\n                },\n                {\n                    \"name\": \"loggedin\",\n                    \"id\": 15\n                },\n                {\n                    \"name\": \"logout\",\n                    \"id\": 16\n                },\n                {\n                    \"name\": \"loggedout\",\n                    \"id\": 17\n                },\n                {\n                    \"name\": \"patch\",\n                    \"id\": 18\n                }\n            ]\n        },\n        {\n            \"name\": \"OpType\",\n            \"syntax\": \"proto2\",\n            \"values\": [\n                {\n                    \"name\": \"open\",\n                    \"id\": 1\n                },\n                {\n                    \"name\": \"add\",\n                    \"id\": 2\n                },\n                {\n                    \"name\": \"remove\",\n                    \"id\": 3\n                },\n                {\n                    \"name\": \"close\",\n                    \"id\": 4\n                },\n                {\n                    \"name\": \"opened\",\n                    \"id\": 5\n                },\n                {\n                    \"name\": \"closed\",\n                    \"id\": 6\n                },\n                {\n                    \"name\": \"query\",\n                    \"id\": 7\n                },\n                {\n                    \"name\": \"query_result\",\n                    \"id\": 8\n                },\n                {\n                    \"name\": \"conflict\",\n                    \"id\": 9\n                },\n                {\n                    \"name\": \"added\",\n                    \"id\": 10\n                },\n                {\n                    \"name\": \"removed\",\n                    \"id\": 11\n                },\n                {\n                    \"name\": \"start\",\n                    \"id\": 30\n                },\n                {\n                    \"name\": \"started\",\n                    \"id\": 31\n                },\n                {\n                    \"name\": \"joined\",\n                    \"id\": 32\n                },\n                {\n                    \"name\": \"members_joined\",\n                    \"id\": 33\n                },\n                {\n                    \"name\": \"left\",\n                    \"id\": 39\n                },\n                {\n                    \"name\": \"members_left\",\n                    \"id\": 40\n                },\n                {\n                    \"name\": \"results\",\n                    \"id\": 42\n                },\n                {\n                    \"name\": \"count\",\n                    \"id\": 43\n                },\n                {\n                    \"name\": \"result\",\n                    \"id\": 44\n                },\n                {\n                    \"name\": \"update\",\n                    \"id\": 45\n                },\n                {\n                    \"name\": \"updated\",\n                    \"id\": 46\n                },\n                {\n                    \"name\": \"mute\",\n                    \"id\": 47\n                },\n                {\n                    \"name\": \"unmute\",\n                    \"id\": 48\n                },\n                {\n                    \"name\": \"status\",\n                    \"id\": 49\n                },\n                {\n                    \"name\": \"members\",\n                    \"id\": 50\n                },\n                {\n                    \"name\": \"max_read\",\n                    \"id\": 51\n                },\n                {\n                    \"name\": \"is_member\",\n                    \"id\": 52\n                },\n                {\n                    \"name\": \"join\",\n                    \"id\": 80\n                },\n                {\n                    \"name\": \"invite\",\n                    \"id\": 81\n                },\n                {\n                    \"name\": \"leave\",\n                    \"id\": 82\n                },\n                {\n                    \"name\": \"kick\",\n                    \"id\": 83\n                },\n                {\n                    \"name\": \"reject\",\n                    \"id\": 84\n                },\n                {\n                    \"name\": \"invited\",\n                    \"id\": 85\n                },\n                {\n                    \"name\": \"kicked\",\n                    \"id\": 86\n                },\n                {\n                    \"name\": \"upload\",\n                    \"id\": 100\n                },\n                {\n                    \"name\": \"uploaded\",\n                    \"id\": 101\n                },\n                {\n                    \"name\": \"modify\",\n                    \"id\": 150\n                },\n                {\n                    \"name\": \"modified\",\n                    \"id\": 151\n                }\n            ]\n        },\n        {\n            \"name\": \"StatusType\",\n            \"syntax\": \"proto2\",\n            \"values\": [\n                {\n                    \"name\": \"on\",\n                    \"id\": 1\n                },\n                {\n                    \"name\": \"off\",\n                    \"id\": 2\n                }\n            ]\n        }\n    ],\n    \"isNamespace\": true\n}).build();\n","import messages from './message-compiled';\n\nconst {\n  JsonObjectMessage,\n  UnreadTuple,\n  LogItem,\n  DataCommand,\n  SessionCommand,\n  ErrorCommand,\n  DirectCommand,\n  AckCommand,\n  UnreadCommand,\n  ConvCommand,\n  RoomCommand,\n  LogsCommand,\n  RcpCommand,\n  ReadTuple,\n  MaxReadTuple,\n  ReadCommand,\n  PresenceCommand,\n  ReportCommand,\n  GenericCommand,\n  PatchCommand,\n  PatchItem,\n  CommandType,\n  OpType,\n  StatusType,\n} = messages.push_server.messages2;\n\nexport {\n  JsonObjectMessage,\n  UnreadTuple,\n  LogItem,\n  DataCommand,\n  SessionCommand,\n  ErrorCommand,\n  DirectCommand,\n  AckCommand,\n  UnreadCommand,\n  ConvCommand,\n  RoomCommand,\n  LogsCommand,\n  RcpCommand,\n  ReadTuple,\n  MaxReadTuple,\n  ReadCommand,\n  PresenceCommand,\n  ReportCommand,\n  GenericCommand,\n  PatchCommand,\n  PatchItem,\n  CommandType,\n  OpType,\n  StatusType,\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n  , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n  Events.prototype = Object.create(null);\n\n  //\n  // This hack is needed because the `__proto__` property is still inherited in\n  // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n  //\n  if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n  this.fn = fn;\n  this.context = context;\n  this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n  this._events = new Events();\n  this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n  var names = []\n    , events\n    , name;\n\n  if (this._eventsCount === 0) return names;\n\n  for (name in (events = this._events)) {\n    if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n  }\n\n  if (Object.getOwnPropertySymbols) {\n    return names.concat(Object.getOwnPropertySymbols(events));\n  }\n\n  return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n  var evt = prefix ? prefix + event : event\n    , available = this._events[evt];\n\n  if (exists) return !!available;\n  if (!available) return [];\n  if (available.fn) return [available.fn];\n\n  for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n    ee[i] = available[i].fn;\n  }\n\n  return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) return false;\n\n  var listeners = this._events[evt]\n    , len = arguments.length\n    , args\n    , i;\n\n  if (listeners.fn) {\n    if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n    switch (len) {\n      case 1: return listeners.fn.call(listeners.context), true;\n      case 2: return listeners.fn.call(listeners.context, a1), true;\n      case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n      case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n      case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n      case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n    }\n\n    for (i = 1, args = new Array(len -1); i < len; i++) {\n      args[i - 1] = arguments[i];\n    }\n\n    listeners.fn.apply(listeners.context, args);\n  } else {\n    var length = listeners.length\n      , j;\n\n    for (i = 0; i < length; i++) {\n      if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n      switch (len) {\n        case 1: listeners[i].fn.call(listeners[i].context); break;\n        case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n        case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n        case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n        default:\n          if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n            args[j - 1] = arguments[j];\n          }\n\n          listeners[i].fn.apply(listeners[i].context, args);\n      }\n    }\n  }\n\n  return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n  var listener = new EE(fn, context || this)\n    , evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n  else if (!this._events[evt].fn) this._events[evt].push(listener);\n  else this._events[evt] = [this._events[evt], listener];\n\n  return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n  var listener = new EE(fn, context || this, true)\n    , evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n  else if (!this._events[evt].fn) this._events[evt].push(listener);\n  else this._events[evt] = [this._events[evt], listener];\n\n  return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events[evt]) return this;\n  if (!fn) {\n    if (--this._eventsCount === 0) this._events = new Events();\n    else delete this._events[evt];\n    return this;\n  }\n\n  var listeners = this._events[evt];\n\n  if (listeners.fn) {\n    if (\n         listeners.fn === fn\n      && (!once || listeners.once)\n      && (!context || listeners.context === context)\n    ) {\n      if (--this._eventsCount === 0) this._events = new Events();\n      else delete this._events[evt];\n    }\n  } else {\n    for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n      if (\n           listeners[i].fn !== fn\n        || (once && !listeners[i].once)\n        || (context && listeners[i].context !== context)\n      ) {\n        events.push(listeners[i]);\n      }\n    }\n\n    //\n    // Reset the array, or remove it completely if we have no more listeners.\n    //\n    if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n    else if (--this._eventsCount === 0) this._events = new Events();\n    else delete this._events[evt];\n  }\n\n  return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n  var evt;\n\n  if (event) {\n    evt = prefix ? prefix + event : event;\n    if (this._events[evt]) {\n      if (--this._eventsCount === 0) this._events = new Events();\n      else delete this._events[evt];\n    }\n  } else {\n    this._events = new Events();\n    this._eventsCount = 0;\n  }\n\n  return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n  return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n  module.exports = EventEmitter;\n}\n","/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n  \"use strict\";\n\n  var Op = Object.prototype;\n  var hasOwn = Op.hasOwnProperty;\n  var undefined; // More compressible than void 0.\n  var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n  var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n  var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n  var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n  var inModule = typeof module === \"object\";\n  var runtime = global.regeneratorRuntime;\n  if (runtime) {\n    if (inModule) {\n      // If regeneratorRuntime is defined globally and we're in a module,\n      // make the exports object identical to regeneratorRuntime.\n      module.exports = runtime;\n    }\n    // Don't bother evaluating the rest of this file if the runtime was\n    // already defined globally.\n    return;\n  }\n\n  // Define the runtime globally (as expected by generated code) as either\n  // module.exports (if we're in a module) or a new, empty object.\n  runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n  function wrap(innerFn, outerFn, self, tryLocsList) {\n    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n    var generator = Object.create(protoGenerator.prototype);\n    var context = new Context(tryLocsList || []);\n\n    // The ._invoke method unifies the implementations of the .next,\n    // .throw, and .return methods.\n    generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n    return generator;\n  }\n  runtime.wrap = wrap;\n\n  // Try/catch helper to minimize deoptimizations. Returns a completion\n  // record like context.tryEntries[i].completion. This interface could\n  // have been (and was previously) designed to take a closure to be\n  // invoked without arguments, but in all the cases we care about we\n  // already have an existing method we want to call, so there's no need\n  // to create a new function object. We can even get away with assuming\n  // the method takes exactly one argument, since that happens to be true\n  // in every case, so we don't have to touch the arguments object. The\n  // only additional allocation required is the completion record, which\n  // has a stable shape and so hopefully should be cheap to allocate.\n  function tryCatch(fn, obj, arg) {\n    try {\n      return { type: \"normal\", arg: fn.call(obj, arg) };\n    } catch (err) {\n      return { type: \"throw\", arg: err };\n    }\n  }\n\n  var GenStateSuspendedStart = \"suspendedStart\";\n  var GenStateSuspendedYield = \"suspendedYield\";\n  var GenStateExecuting = \"executing\";\n  var GenStateCompleted = \"completed\";\n\n  // Returning this object from the innerFn has the same effect as\n  // breaking out of the dispatch switch statement.\n  var ContinueSentinel = {};\n\n  // Dummy constructor functions that we use as the .constructor and\n  // .constructor.prototype properties for functions that return Generator\n  // objects. For full spec compliance, you may wish to configure your\n  // minifier not to mangle the names of these two functions.\n  function Generator() {}\n  function GeneratorFunction() {}\n  function GeneratorFunctionPrototype() {}\n\n  // This is a polyfill for %IteratorPrototype% for environments that\n  // don't natively support it.\n  var IteratorPrototype = {};\n  IteratorPrototype[iteratorSymbol] = function () {\n    return this;\n  };\n\n  var getProto = Object.getPrototypeOf;\n  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n  if (NativeIteratorPrototype &&\n      NativeIteratorPrototype !== Op &&\n      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n    // This environment has a native %IteratorPrototype%; use it instead\n    // of the polyfill.\n    IteratorPrototype = NativeIteratorPrototype;\n  }\n\n  var Gp = GeneratorFunctionPrototype.prototype =\n    Generator.prototype = Object.create(IteratorPrototype);\n  GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n  GeneratorFunctionPrototype.constructor = GeneratorFunction;\n  GeneratorFunctionPrototype[toStringTagSymbol] =\n    GeneratorFunction.displayName = \"GeneratorFunction\";\n\n  // Helper for defining the .next, .throw, and .return methods of the\n  // Iterator interface in terms of a single ._invoke method.\n  function defineIteratorMethods(prototype) {\n    [\"next\", \"throw\", \"return\"].forEach(function(method) {\n      prototype[method] = function(arg) {\n        return this._invoke(method, arg);\n      };\n    });\n  }\n\n  runtime.isGeneratorFunction = function(genFun) {\n    var ctor = typeof genFun === \"function\" && genFun.constructor;\n    return ctor\n      ? ctor === GeneratorFunction ||\n        // For the native GeneratorFunction constructor, the best we can\n        // do is to check its .name property.\n        (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n      : false;\n  };\n\n  runtime.mark = function(genFun) {\n    if (Object.setPrototypeOf) {\n      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n    } else {\n      genFun.__proto__ = GeneratorFunctionPrototype;\n      if (!(toStringTagSymbol in genFun)) {\n        genFun[toStringTagSymbol] = \"GeneratorFunction\";\n      }\n    }\n    genFun.prototype = Object.create(Gp);\n    return genFun;\n  };\n\n  // Within the body of any async function, `await x` is transformed to\n  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n  // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n  // meant to be awaited.\n  runtime.awrap = function(arg) {\n    return { __await: arg };\n  };\n\n  function AsyncIterator(generator) {\n    function invoke(method, arg, resolve, reject) {\n      var record = tryCatch(generator[method], generator, arg);\n      if (record.type === \"throw\") {\n        reject(record.arg);\n      } else {\n        var result = record.arg;\n        var value = result.value;\n        if (value &&\n            typeof value === \"object\" &&\n            hasOwn.call(value, \"__await\")) {\n          return Promise.resolve(value.__await).then(function(value) {\n            invoke(\"next\", value, resolve, reject);\n          }, function(err) {\n            invoke(\"throw\", err, resolve, reject);\n          });\n        }\n\n        return Promise.resolve(value).then(function(unwrapped) {\n          // When a yielded Promise is resolved, its final value becomes\n          // the .value of the Promise<{value,done}> result for the\n          // current iteration. If the Promise is rejected, however, the\n          // result for this iteration will be rejected with the same\n          // reason. Note that rejections of yielded Promises are not\n          // thrown back into the generator function, as is the case\n          // when an awaited Promise is rejected. This difference in\n          // behavior between yield and await is important, because it\n          // allows the consumer to decide what to do with the yielded\n          // rejection (swallow it and continue, manually .throw it back\n          // into the generator, abandon iteration, whatever). With\n          // await, by contrast, there is no opportunity to examine the\n          // rejection reason outside the generator function, so the\n          // only option is to throw it from the await expression, and\n          // let the generator function handle the exception.\n          result.value = unwrapped;\n          resolve(result);\n        }, reject);\n      }\n    }\n\n    var previousPromise;\n\n    function enqueue(method, arg) {\n      function callInvokeWithMethodAndArg() {\n        return new Promise(function(resolve, reject) {\n          invoke(method, arg, resolve, reject);\n        });\n      }\n\n      return previousPromise =\n        // If enqueue has been called before, then we want to wait until\n        // all previous Promises have been resolved before calling invoke,\n        // so that results are always delivered in the correct order. If\n        // enqueue has not been called before, then it is important to\n        // call invoke immediately, without waiting on a callback to fire,\n        // so that the async generator function has the opportunity to do\n        // any necessary setup in a predictable way. This predictability\n        // is why the Promise constructor synchronously invokes its\n        // executor callback, and why async functions synchronously\n        // execute code before the first await. Since we implement simple\n        // async functions in terms of async generators, it is especially\n        // important to get this right, even though it requires care.\n        previousPromise ? previousPromise.then(\n          callInvokeWithMethodAndArg,\n          // Avoid propagating failures to Promises returned by later\n          // invocations of the iterator.\n          callInvokeWithMethodAndArg\n        ) : callInvokeWithMethodAndArg();\n    }\n\n    // Define the unified helper method that is used to implement .next,\n    // .throw, and .return (see defineIteratorMethods).\n    this._invoke = enqueue;\n  }\n\n  defineIteratorMethods(AsyncIterator.prototype);\n  AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n    return this;\n  };\n  runtime.AsyncIterator = AsyncIterator;\n\n  // Note that simple async functions are implemented on top of\n  // AsyncIterator objects; they just return a Promise for the value of\n  // the final result produced by the iterator.\n  runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n    var iter = new AsyncIterator(\n      wrap(innerFn, outerFn, self, tryLocsList)\n    );\n\n    return runtime.isGeneratorFunction(outerFn)\n      ? iter // If outerFn is a generator, return the full iterator.\n      : iter.next().then(function(result) {\n          return result.done ? result.value : iter.next();\n        });\n  };\n\n  function makeInvokeMethod(innerFn, self, context) {\n    var state = GenStateSuspendedStart;\n\n    return function invoke(method, arg) {\n      if (state === GenStateExecuting) {\n        throw new Error(\"Generator is already running\");\n      }\n\n      if (state === GenStateCompleted) {\n        if (method === \"throw\") {\n          throw arg;\n        }\n\n        // Be forgiving, per 25.3.3.3.3 of the spec:\n        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n        return doneResult();\n      }\n\n      context.method = method;\n      context.arg = arg;\n\n      while (true) {\n        var delegate = context.delegate;\n        if (delegate) {\n          var delegateResult = maybeInvokeDelegate(delegate, context);\n          if (delegateResult) {\n            if (delegateResult === ContinueSentinel) continue;\n            return delegateResult;\n          }\n        }\n\n        if (context.method === \"next\") {\n          // Setting context._sent for legacy support of Babel's\n          // function.sent implementation.\n          context.sent = context._sent = context.arg;\n\n        } else if (context.method === \"throw\") {\n          if (state === GenStateSuspendedStart) {\n            state = GenStateCompleted;\n            throw context.arg;\n          }\n\n          context.dispatchException(context.arg);\n\n        } else if (context.method === \"return\") {\n          context.abrupt(\"return\", context.arg);\n        }\n\n        state = GenStateExecuting;\n\n        var record = tryCatch(innerFn, self, context);\n        if (record.type === \"normal\") {\n          // If an exception is thrown from innerFn, we leave state ===\n          // GenStateExecuting and loop back for another invocation.\n          state = context.done\n            ? GenStateCompleted\n            : GenStateSuspendedYield;\n\n          if (record.arg === ContinueSentinel) {\n            continue;\n          }\n\n          return {\n            value: record.arg,\n            done: context.done\n          };\n\n        } else if (record.type === \"throw\") {\n          state = GenStateCompleted;\n          // Dispatch the exception by looping back around to the\n          // context.dispatchException(context.arg) call above.\n          context.method = \"throw\";\n          context.arg = record.arg;\n        }\n      }\n    };\n  }\n\n  // Call delegate.iterator[context.method](context.arg) and handle the\n  // result, either by returning a { value, done } result from the\n  // delegate iterator, or by modifying context.method and context.arg,\n  // setting context.delegate to null, and returning the ContinueSentinel.\n  function maybeInvokeDelegate(delegate, context) {\n    var method = delegate.iterator[context.method];\n    if (method === undefined) {\n      // A .throw or .return when the delegate iterator has no .throw\n      // method always terminates the yield* loop.\n      context.delegate = null;\n\n      if (context.method === \"throw\") {\n        if (delegate.iterator.return) {\n          // If the delegate iterator has a return method, give it a\n          // chance to clean up.\n          context.method = \"return\";\n          context.arg = undefined;\n          maybeInvokeDelegate(delegate, context);\n\n          if (context.method === \"throw\") {\n            // If maybeInvokeDelegate(context) changed context.method from\n            // \"return\" to \"throw\", let that override the TypeError below.\n            return ContinueSentinel;\n          }\n        }\n\n        context.method = \"throw\";\n        context.arg = new TypeError(\n          \"The iterator does not provide a 'throw' method\");\n      }\n\n      return ContinueSentinel;\n    }\n\n    var record = tryCatch(method, delegate.iterator, context.arg);\n\n    if (record.type === \"throw\") {\n      context.method = \"throw\";\n      context.arg = record.arg;\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    var info = record.arg;\n\n    if (! info) {\n      context.method = \"throw\";\n      context.arg = new TypeError(\"iterator result is not an object\");\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    if (info.done) {\n      // Assign the result of the finished delegate to the temporary\n      // variable specified by delegate.resultName (see delegateYield).\n      context[delegate.resultName] = info.value;\n\n      // Resume execution at the desired location (see delegateYield).\n      context.next = delegate.nextLoc;\n\n      // If context.method was \"throw\" but the delegate handled the\n      // exception, let the outer generator proceed normally. If\n      // context.method was \"next\", forget context.arg since it has been\n      // \"consumed\" by the delegate iterator. If context.method was\n      // \"return\", allow the original .return call to continue in the\n      // outer generator.\n      if (context.method !== \"return\") {\n        context.method = \"next\";\n        context.arg = undefined;\n      }\n\n    } else {\n      // Re-yield the result returned by the delegate method.\n      return info;\n    }\n\n    // The delegate iterator is finished, so forget it and continue with\n    // the outer generator.\n    context.delegate = null;\n    return ContinueSentinel;\n  }\n\n  // Define Generator.prototype.{next,throw,return} in terms of the\n  // unified ._invoke helper method.\n  defineIteratorMethods(Gp);\n\n  Gp[toStringTagSymbol] = \"Generator\";\n\n  // A Generator should always return itself as the iterator object when the\n  // @@iterator function is called on it. Some browsers' implementations of the\n  // iterator prototype chain incorrectly implement this, causing the Generator\n  // object to not be returned from this call. This ensures that doesn't happen.\n  // See https://github.com/facebook/regenerator/issues/274 for more details.\n  Gp[iteratorSymbol] = function() {\n    return this;\n  };\n\n  Gp.toString = function() {\n    return \"[object Generator]\";\n  };\n\n  function pushTryEntry(locs) {\n    var entry = { tryLoc: locs[0] };\n\n    if (1 in locs) {\n      entry.catchLoc = locs[1];\n    }\n\n    if (2 in locs) {\n      entry.finallyLoc = locs[2];\n      entry.afterLoc = locs[3];\n    }\n\n    this.tryEntries.push(entry);\n  }\n\n  function resetTryEntry(entry) {\n    var record = entry.completion || {};\n    record.type = \"normal\";\n    delete record.arg;\n    entry.completion = record;\n  }\n\n  function Context(tryLocsList) {\n    // The root entry object (effectively a try statement without a catch\n    // or a finally block) gives us a place to store values thrown from\n    // locations where there is no enclosing try statement.\n    this.tryEntries = [{ tryLoc: \"root\" }];\n    tryLocsList.forEach(pushTryEntry, this);\n    this.reset(true);\n  }\n\n  runtime.keys = function(object) {\n    var keys = [];\n    for (var key in object) {\n      keys.push(key);\n    }\n    keys.reverse();\n\n    // Rather than returning an object with a next method, we keep\n    // things simple and return the next function itself.\n    return function next() {\n      while (keys.length) {\n        var key = keys.pop();\n        if (key in object) {\n          next.value = key;\n          next.done = false;\n          return next;\n        }\n      }\n\n      // To avoid creating an additional object, we just hang the .value\n      // and .done properties off the next function object itself. This\n      // also ensures that the minifier will not anonymize the function.\n      next.done = true;\n      return next;\n    };\n  };\n\n  function values(iterable) {\n    if (iterable) {\n      var iteratorMethod = iterable[iteratorSymbol];\n      if (iteratorMethod) {\n        return iteratorMethod.call(iterable);\n      }\n\n      if (typeof iterable.next === \"function\") {\n        return iterable;\n      }\n\n      if (!isNaN(iterable.length)) {\n        var i = -1, next = function next() {\n          while (++i < iterable.length) {\n            if (hasOwn.call(iterable, i)) {\n              next.value = iterable[i];\n              next.done = false;\n              return next;\n            }\n          }\n\n          next.value = undefined;\n          next.done = true;\n\n          return next;\n        };\n\n        return next.next = next;\n      }\n    }\n\n    // Return an iterator with no values.\n    return { next: doneResult };\n  }\n  runtime.values = values;\n\n  function doneResult() {\n    return { value: undefined, done: true };\n  }\n\n  Context.prototype = {\n    constructor: Context,\n\n    reset: function(skipTempReset) {\n      this.prev = 0;\n      this.next = 0;\n      // Resetting context._sent for legacy support of Babel's\n      // function.sent implementation.\n      this.sent = this._sent = undefined;\n      this.done = false;\n      this.delegate = null;\n\n      this.method = \"next\";\n      this.arg = undefined;\n\n      this.tryEntries.forEach(resetTryEntry);\n\n      if (!skipTempReset) {\n        for (var name in this) {\n          // Not sure about the optimal order of these conditions:\n          if (name.charAt(0) === \"t\" &&\n              hasOwn.call(this, name) &&\n              !isNaN(+name.slice(1))) {\n            this[name] = undefined;\n          }\n        }\n      }\n    },\n\n    stop: function() {\n      this.done = true;\n\n      var rootEntry = this.tryEntries[0];\n      var rootRecord = rootEntry.completion;\n      if (rootRecord.type === \"throw\") {\n        throw rootRecord.arg;\n      }\n\n      return this.rval;\n    },\n\n    dispatchException: function(exception) {\n      if (this.done) {\n        throw exception;\n      }\n\n      var context = this;\n      function handle(loc, caught) {\n        record.type = \"throw\";\n        record.arg = exception;\n        context.next = loc;\n\n        if (caught) {\n          // If the dispatched exception was caught by a catch block,\n          // then let that catch block handle the exception normally.\n          context.method = \"next\";\n          context.arg = undefined;\n        }\n\n        return !! caught;\n      }\n\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        var record = entry.completion;\n\n        if (entry.tryLoc === \"root\") {\n          // Exception thrown outside of any try block that could handle\n          // it, so set the completion value of the entire function to\n          // throw the exception.\n          return handle(\"end\");\n        }\n\n        if (entry.tryLoc <= this.prev) {\n          var hasCatch = hasOwn.call(entry, \"catchLoc\");\n          var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n          if (hasCatch && hasFinally) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            } else if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else if (hasCatch) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            }\n\n          } else if (hasFinally) {\n            if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else {\n            throw new Error(\"try statement without catch or finally\");\n          }\n        }\n      }\n    },\n\n    abrupt: function(type, arg) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc <= this.prev &&\n            hasOwn.call(entry, \"finallyLoc\") &&\n            this.prev < entry.finallyLoc) {\n          var finallyEntry = entry;\n          break;\n        }\n      }\n\n      if (finallyEntry &&\n          (type === \"break\" ||\n           type === \"continue\") &&\n          finallyEntry.tryLoc <= arg &&\n          arg <= finallyEntry.finallyLoc) {\n        // Ignore the finally entry if control is not jumping to a\n        // location outside the try/catch block.\n        finallyEntry = null;\n      }\n\n      var record = finallyEntry ? finallyEntry.completion : {};\n      record.type = type;\n      record.arg = arg;\n\n      if (finallyEntry) {\n        this.method = \"next\";\n        this.next = finallyEntry.finallyLoc;\n        return ContinueSentinel;\n      }\n\n      return this.complete(record);\n    },\n\n    complete: function(record, afterLoc) {\n      if (record.type === \"throw\") {\n        throw record.arg;\n      }\n\n      if (record.type === \"break\" ||\n          record.type === \"continue\") {\n        this.next = record.arg;\n      } else if (record.type === \"return\") {\n        this.rval = this.arg = record.arg;\n        this.method = \"return\";\n        this.next = \"end\";\n      } else if (record.type === \"normal\" && afterLoc) {\n        this.next = afterLoc;\n      }\n\n      return ContinueSentinel;\n    },\n\n    finish: function(finallyLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.finallyLoc === finallyLoc) {\n          this.complete(entry.completion, entry.afterLoc);\n          resetTryEntry(entry);\n          return ContinueSentinel;\n        }\n      }\n    },\n\n    \"catch\": function(tryLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc === tryLoc) {\n          var record = entry.completion;\n          if (record.type === \"throw\") {\n            var thrown = record.arg;\n            resetTryEntry(entry);\n          }\n          return thrown;\n        }\n      }\n\n      // The context.catch method must only be called with a location\n      // argument that corresponds to a known catch block.\n      throw new Error(\"illegal catch attempt\");\n    },\n\n    delegateYield: function(iterable, resultName, nextLoc) {\n      this.delegate = {\n        iterator: values(iterable),\n        resultName: resultName,\n        nextLoc: nextLoc\n      };\n\n      if (this.method === \"next\") {\n        // Deliberately forget the last sent value so that we don't\n        // accidentally pass it on to the delegate.\n        this.arg = undefined;\n      }\n\n      return ContinueSentinel;\n    }\n  };\n})(\n  // In sloppy mode, unbound `this` refers to the global object, fallback to\n  // Function constructor if we're in global strict mode. That is sadly a form\n  // of indirect eval which violates Content Security Policy.\n  (function() { return this })() || Function(\"return this\")()\n);\n","// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g = (function() { return this })() || Function(\"return this\")();\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n  Object.getOwnPropertyNames(g).indexOf(\"regeneratorRuntime\") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = require(\"./runtime\");\n\nif (hadRuntime) {\n  // Restore the original runtime.\n  g.regeneratorRuntime = oldRuntime;\n} else {\n  // Remove the global property added by runtime.js.\n  try {\n    delete g.regeneratorRuntime;\n  } catch(e) {\n    g.regeneratorRuntime = undefined;\n  }\n}\n","module.exports = require(\"regenerator-runtime\");\n","exports.f = Object.getOwnPropertySymbols;\n","exports.f = {}.propertyIsEnumerable;\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n  var A = {};\n  var B = {};\n  // eslint-disable-next-line no-undef\n  var S = Symbol();\n  var K = 'abcdefghijklmnopqrst';\n  A[S] = 7;\n  K.split('').forEach(function (k) { B[k] = k; });\n  return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n  var T = toObject(target);\n  var aLen = arguments.length;\n  var index = 1;\n  var getSymbols = gOPS.f;\n  var isEnum = pIE.f;\n  while (aLen > index) {\n    var S = IObject(arguments[index++]);\n    var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n    var length = keys.length;\n    var j = 0;\n    var key;\n    while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n  } return T;\n} : $assign;\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _assign = require(\"../core-js/object/assign\");\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _assign2.default || function (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n\n    for (var key in source) {\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n\n  return target;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _promise = require(\"../core-js/promise\");\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (fn) {\n  return function () {\n    var gen = fn.apply(this, arguments);\n    return new _promise2.default(function (resolve, reject) {\n      function step(key, arg) {\n        try {\n          var info = gen[key](arg);\n          var value = info.value;\n        } catch (error) {\n          reject(error);\n          return;\n        }\n\n        if (info.done) {\n          resolve(value);\n        } else {\n          return _promise2.default.resolve(value).then(function (value) {\n            step(\"next\", value);\n          }, function (err) {\n            step(\"throw\", err);\n          });\n        }\n      }\n\n      return step(\"next\");\n    });\n  };\n};","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n  if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n  else object[index] = value;\n};\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n  // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n  from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n    var O = toObject(arrayLike);\n    var C = typeof this == 'function' ? this : Array;\n    var aLen = arguments.length;\n    var mapfn = aLen > 1 ? arguments[1] : undefined;\n    var mapping = mapfn !== undefined;\n    var index = 0;\n    var iterFn = getIterFn(O);\n    var length, result, step, iterator;\n    if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n    // if object isn't iterable or it's array with default iterator - use simple case\n    if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n      for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n        createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n      }\n    } else {\n      length = toLength(O.length);\n      for (result = new C(length); length > index; index++) {\n        createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n      }\n    }\n    result.length = index;\n    return result;\n  }\n});\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/es6.array.from');\nmodule.exports = require('../../modules/_core').Array.from;\n","module.exports = { \"default\": require(\"core-js/library/fn/array/from\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _from = require(\"../core-js/array/from\");\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n  if (Array.isArray(arr)) {\n    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n      arr2[i] = arr[i];\n    }\n\n    return arr2;\n  } else {\n    return (0, _from2.default)(arr);\n  }\n};","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n  return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n  return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n  setDesc(it, META, { value: {\n    i: 'O' + ++id, // object ID\n    w: {}          // weak collections IDs\n  } });\n};\nvar fastKey = function (it, create) {\n  // return primitive with prefix\n  if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n  if (!has(it, META)) {\n    // can't set metadata to uncaught frozen object\n    if (!isExtensible(it)) return 'F';\n    // not necessary to add metadata\n    if (!create) return 'E';\n    // add missing metadata\n    setMeta(it);\n  // return object ID\n  } return it[META].i;\n};\nvar getWeak = function (it, create) {\n  if (!has(it, META)) {\n    // can't set metadata to uncaught frozen object\n    if (!isExtensible(it)) return true;\n    // not necessary to add metadata\n    if (!create) return false;\n    // add missing metadata\n    setMeta(it);\n  // return hash weak collections IDs\n  } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n  if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n  return it;\n};\nvar meta = module.exports = {\n  KEY: META,\n  NEED: false,\n  fastKey: fastKey,\n  getWeak: getWeak,\n  onFreeze: onFreeze\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n  if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n  return it;\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n  // fast case\n  var index = fastKey(key);\n  var entry;\n  if (index !== 'F') return that._i[index];\n  // frozen object case\n  for (entry = that._f; entry; entry = entry.n) {\n    if (entry.k == key) return entry;\n  }\n};\n\nmodule.exports = {\n  getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n    var C = wrapper(function (that, iterable) {\n      anInstance(that, C, NAME, '_i');\n      that._t = NAME;         // collection type\n      that._i = create(null); // index\n      that._f = undefined;    // first entry\n      that._l = undefined;    // last entry\n      that[SIZE] = 0;         // size\n      if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n    });\n    redefineAll(C.prototype, {\n      // 23.1.3.1 Map.prototype.clear()\n      // 23.2.3.2 Set.prototype.clear()\n      clear: function clear() {\n        for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n          entry.r = true;\n          if (entry.p) entry.p = entry.p.n = undefined;\n          delete data[entry.i];\n        }\n        that._f = that._l = undefined;\n        that[SIZE] = 0;\n      },\n      // 23.1.3.3 Map.prototype.delete(key)\n      // 23.2.3.4 Set.prototype.delete(value)\n      'delete': function (key) {\n        var that = validate(this, NAME);\n        var entry = getEntry(that, key);\n        if (entry) {\n          var next = entry.n;\n          var prev = entry.p;\n          delete that._i[entry.i];\n          entry.r = true;\n          if (prev) prev.n = next;\n          if (next) next.p = prev;\n          if (that._f == entry) that._f = next;\n          if (that._l == entry) that._l = prev;\n          that[SIZE]--;\n        } return !!entry;\n      },\n      // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n      // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n      forEach: function forEach(callbackfn /* , that = undefined */) {\n        validate(this, NAME);\n        var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n        var entry;\n        while (entry = entry ? entry.n : this._f) {\n          f(entry.v, entry.k, this);\n          // revert to the last existing entry\n          while (entry && entry.r) entry = entry.p;\n        }\n      },\n      // 23.1.3.7 Map.prototype.has(key)\n      // 23.2.3.7 Set.prototype.has(value)\n      has: function has(key) {\n        return !!getEntry(validate(this, NAME), key);\n      }\n    });\n    if (DESCRIPTORS) dP(C.prototype, 'size', {\n      get: function () {\n        return validate(this, NAME)[SIZE];\n      }\n    });\n    return C;\n  },\n  def: function (that, key, value) {\n    var entry = getEntry(that, key);\n    var prev, index;\n    // change existing entry\n    if (entry) {\n      entry.v = value;\n    // create new entry\n    } else {\n      that._l = entry = {\n        i: index = fastKey(key, true), // <- index\n        k: key,                        // <- key\n        v: value,                      // <- value\n        p: prev = that._l,             // <- previous entry\n        n: undefined,                  // <- next entry\n        r: false                       // <- removed\n      };\n      if (!that._f) that._f = entry;\n      if (prev) prev.n = entry;\n      that[SIZE]++;\n      // add to index\n      if (index !== 'F') that._i[index] = entry;\n    } return that;\n  },\n  getEntry: getEntry,\n  setStrong: function (C, NAME, IS_MAP) {\n    // add .keys, .values, .entries, [@@iterator]\n    // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n    $iterDefine(C, NAME, function (iterated, kind) {\n      this._t = validate(iterated, NAME); // target\n      this._k = kind;                     // kind\n      this._l = undefined;                // previous\n    }, function () {\n      var that = this;\n      var kind = that._k;\n      var entry = that._l;\n      // revert to the last existing entry\n      while (entry && entry.r) entry = entry.p;\n      // get next entry\n      if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n        // or finish the iteration\n        that._t = undefined;\n        return step(1);\n      }\n      // return step by kind\n      if (kind == 'keys') return step(0, entry.k);\n      if (kind == 'values') return step(0, entry.v);\n      return step(0, [entry.k, entry.v]);\n    }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n    // add [@@species], 23.1.2.2, 23.2.2.2\n    setSpecies(NAME);\n  }\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n  return cof(arg) == 'Array';\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n  var C;\n  if (isArray(original)) {\n    C = original.constructor;\n    // cross-realm fallback\n    if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n    if (isObject(C)) {\n      C = C[SPECIES];\n      if (C === null) C = undefined;\n    }\n  } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n  return new (speciesConstructor(original))(length);\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n  var IS_MAP = TYPE == 1;\n  var IS_FILTER = TYPE == 2;\n  var IS_SOME = TYPE == 3;\n  var IS_EVERY = TYPE == 4;\n  var IS_FIND_INDEX = TYPE == 6;\n  var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n  var create = $create || asc;\n  return function ($this, callbackfn, that) {\n    var O = toObject($this);\n    var self = IObject(O);\n    var f = ctx(callbackfn, that, 3);\n    var length = toLength(self.length);\n    var index = 0;\n    var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n    var val, res;\n    for (;length > index; index++) if (NO_HOLES || index in self) {\n      val = self[index];\n      res = f(val, index, O);\n      if (TYPE) {\n        if (IS_MAP) result[index] = res;   // map\n        else if (res) switch (TYPE) {\n          case 3: return true;             // some\n          case 5: return val;              // find\n          case 6: return index;            // findIndex\n          case 2: result.push(val);        // filter\n        } else if (IS_EVERY) return false; // every\n      }\n    }\n    return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n  };\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar meta = require('./_meta');\nvar fails = require('./_fails');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar setToStringTag = require('./_set-to-string-tag');\nvar dP = require('./_object-dp').f;\nvar each = require('./_array-methods')(0);\nvar DESCRIPTORS = require('./_descriptors');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n  var Base = global[NAME];\n  var C = Base;\n  var ADDER = IS_MAP ? 'set' : 'add';\n  var proto = C && C.prototype;\n  var O = {};\n  if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n    new C().entries().next();\n  }))) {\n    // create collection constructor\n    C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n    redefineAll(C.prototype, methods);\n    meta.NEED = true;\n  } else {\n    C = wrapper(function (target, iterable) {\n      anInstance(target, C, NAME, '_c');\n      target._c = new Base();\n      if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);\n    });\n    each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {\n      var IS_ADDER = KEY == 'add' || KEY == 'set';\n      if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {\n        anInstance(this, C, KEY);\n        if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n        var result = this._c[KEY](a === 0 ? 0 : a, b);\n        return IS_ADDER ? this : result;\n      });\n    });\n    IS_WEAK || dP(C.prototype, 'size', {\n      get: function () {\n        return this._c.size;\n      }\n    });\n  }\n\n  setToStringTag(C, NAME);\n\n  O[NAME] = C;\n  $export($export.G + $export.W + $export.F, O);\n\n  if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n  return C;\n};\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n  return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n  // 23.2.3.1 Set.prototype.add(value)\n  add: function add(value) {\n    return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n  }\n}, strong);\n","var forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n  var result = [];\n  forOf(iter, false, result.push, result, ITERATOR);\n  return result;\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n  return function toJSON() {\n    if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n    return from(this);\n  };\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') });\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n  $export($export.S, COLLECTION, { of: function of() {\n    var length = arguments.length;\n    var A = Array(length);\n    while (length--) A[length] = arguments[length];\n    return new this(A);\n  } });\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\nrequire('./_set-collection-of')('Set');\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n  $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n    var mapFn = arguments[1];\n    var mapping, A, n, cb;\n    aFunction(this);\n    mapping = mapFn !== undefined;\n    if (mapping) aFunction(mapFn);\n    if (source == undefined) return new this();\n    A = [];\n    if (mapping) {\n      n = 0;\n      cb = ctx(mapFn, arguments[2], 2);\n      forOf(source, false, function (nextItem) {\n        A.push(cb(nextItem, n++));\n      });\n    } else {\n      forOf(source, false, A.push, A);\n    }\n    return new this(A);\n  } });\n};\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\nrequire('./_set-collection-from')('Set');\n","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.set');\nrequire('../modules/es7.set.to-json');\nrequire('../modules/es7.set.of');\nrequire('../modules/es7.set.from');\nmodule.exports = require('../modules/_core').Set;\n","module.exports = { \"default\": require(\"core-js/library/fn/set\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};","exports.f = require('./_wks');\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n  var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n  if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n  var result = getKeys(it);\n  var getSymbols = gOPS.f;\n  if (getSymbols) {\n    var symbols = getSymbols(it);\n    var isEnum = pIE.f;\n    var i = 0;\n    var key;\n    while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n  } return result;\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n  return $keys(O, hiddenKeys);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n  ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n  try {\n    return gOPN(it);\n  } catch (e) {\n    return windowNames.slice();\n  }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n  return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n  O = toIObject(O);\n  P = toPrimitive(P, true);\n  if (IE8_DOM_DEFINE) try {\n    return gOPD(O, P);\n  } catch (e) { /* empty */ }\n  if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n  return _create(dP({}, 'a', {\n    get: function () { return dP(this, 'a', { value: 7 }).a; }\n  })).a != 7;\n}) ? function (it, key, D) {\n  var protoDesc = gOPD(ObjectProto, key);\n  if (protoDesc) delete ObjectProto[key];\n  dP(it, key, D);\n  if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n  var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n  sym._k = tag;\n  return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n  return typeof it == 'symbol';\n} : function (it) {\n  return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n  if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n  anObject(it);\n  key = toPrimitive(key, true);\n  anObject(D);\n  if (has(AllSymbols, key)) {\n    if (!D.enumerable) {\n      if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n      it[HIDDEN][key] = true;\n    } else {\n      if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n      D = _create(D, { enumerable: createDesc(0, false) });\n    } return setSymbolDesc(it, key, D);\n  } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n  anObject(it);\n  var keys = enumKeys(P = toIObject(P));\n  var i = 0;\n  var l = keys.length;\n  var key;\n  while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n  return it;\n};\nvar $create = function create(it, P) {\n  return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n  var E = isEnum.call(this, key = toPrimitive(key, true));\n  if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n  return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n  it = toIObject(it);\n  key = toPrimitive(key, true);\n  if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n  var D = gOPD(it, key);\n  if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n  return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n  var names = gOPN(toIObject(it));\n  var result = [];\n  var i = 0;\n  var key;\n  while (names.length > i) {\n    if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n  } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n  var IS_OP = it === ObjectProto;\n  var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n  var result = [];\n  var i = 0;\n  var key;\n  while (names.length > i) {\n    if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n  } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n  $Symbol = function Symbol() {\n    if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n    var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n    var $set = function (value) {\n      if (this === ObjectProto) $set.call(OPSymbols, value);\n      if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n      setSymbolDesc(this, tag, createDesc(1, value));\n    };\n    if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n    return wrap(tag);\n  };\n  redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n    return this._k;\n  });\n\n  $GOPD.f = $getOwnPropertyDescriptor;\n  $DP.f = $defineProperty;\n  require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n  require('./_object-pie').f = $propertyIsEnumerable;\n  require('./_object-gops').f = $getOwnPropertySymbols;\n\n  if (DESCRIPTORS && !require('./_library')) {\n    redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n  }\n\n  wksExt.f = function (name) {\n    return wrap(wks(name));\n  };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n  // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n  'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n  // 19.4.2.1 Symbol.for(key)\n  'for': function (key) {\n    return has(SymbolRegistry, key += '')\n      ? SymbolRegistry[key]\n      : SymbolRegistry[key] = $Symbol(key);\n  },\n  // 19.4.2.5 Symbol.keyFor(sym)\n  keyFor: function keyFor(sym) {\n    if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n    for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n  },\n  useSetter: function () { setter = true; },\n  useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n  // 19.1.2.2 Object.create(O [, Properties])\n  create: $create,\n  // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n  defineProperty: $defineProperty,\n  // 19.1.2.3 Object.defineProperties(O, Properties)\n  defineProperties: $defineProperties,\n  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n  getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n  // 19.1.2.7 Object.getOwnPropertyNames(O)\n  getOwnPropertyNames: $getOwnPropertyNames,\n  // 19.1.2.8 Object.getOwnPropertySymbols(O)\n  getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n  var S = $Symbol();\n  // MS Edge converts symbol values to JSON as {}\n  // WebKit converts symbol values to JSON as null\n  // V8 throws on boxed symbols\n  return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n  stringify: function stringify(it) {\n    if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n    var args = [it];\n    var i = 1;\n    var replacer, $replacer;\n    while (arguments.length > i) args.push(arguments[i++]);\n    replacer = args[1];\n    if (typeof replacer == 'function') $replacer = replacer;\n    if ($replacer || !isArray(replacer)) replacer = function (key, value) {\n      if ($replacer) value = $replacer.call(this, key, value);\n      if (!isSymbol(value)) return value;\n    };\n    args[1] = replacer;\n    return _stringify.apply($JSON, args);\n  }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _iterator = require(\"../core-js/symbol/iterator\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = require(\"../core-js/symbol\");\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n  return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n  return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n  if (!self) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n  anObject(O);\n  if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n  set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n    function (test, buggy, set) {\n      try {\n        set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n        set(test, []);\n        buggy = !(test instanceof Array);\n      } catch (e) { buggy = true; }\n      return function setPrototypeOf(O, proto) {\n        check(O, proto);\n        if (buggy) O.__proto__ = proto;\n        else set(O, proto);\n        return O;\n      };\n    }({}, false) : undefined),\n  check: check\n};\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","require('../../modules/es6.object.set-prototype-of');\nmodule.exports = require('../../modules/_core').Object.setPrototypeOf;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/set-prototype-of\"), __esModule: true };","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","require('../../modules/es6.object.create');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function create(P, D) {\n  return $Object.create(P, D);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/create\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = require(\"../core-js/object/create\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n  }\n\n  subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n *  - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n  options = options || {};\n  var type = typeof val;\n  if (type === 'string' && val.length > 0) {\n    return parse(val);\n  } else if (type === 'number' && isNaN(val) === false) {\n    return options.long ? fmtLong(val) : fmtShort(val);\n  }\n  throw new Error(\n    'val is not a non-empty string or a valid number. val=' +\n      JSON.stringify(val)\n  );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n  str = String(str);\n  if (str.length > 100) {\n    return;\n  }\n  var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n    str\n  );\n  if (!match) {\n    return;\n  }\n  var n = parseFloat(match[1]);\n  var type = (match[2] || 'ms').toLowerCase();\n  switch (type) {\n    case 'years':\n    case 'year':\n    case 'yrs':\n    case 'yr':\n    case 'y':\n      return n * y;\n    case 'days':\n    case 'day':\n    case 'd':\n      return n * d;\n    case 'hours':\n    case 'hour':\n    case 'hrs':\n    case 'hr':\n    case 'h':\n      return n * h;\n    case 'minutes':\n    case 'minute':\n    case 'mins':\n    case 'min':\n    case 'm':\n      return n * m;\n    case 'seconds':\n    case 'second':\n    case 'secs':\n    case 'sec':\n    case 's':\n      return n * s;\n    case 'milliseconds':\n    case 'millisecond':\n    case 'msecs':\n    case 'msec':\n    case 'ms':\n      return n;\n    default:\n      return undefined;\n  }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n  if (ms >= d) {\n    return Math.round(ms / d) + 'd';\n  }\n  if (ms >= h) {\n    return Math.round(ms / h) + 'h';\n  }\n  if (ms >= m) {\n    return Math.round(ms / m) + 'm';\n  }\n  if (ms >= s) {\n    return Math.round(ms / s) + 's';\n  }\n  return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n  return plural(ms, d, 'day') ||\n    plural(ms, h, 'hour') ||\n    plural(ms, m, 'minute') ||\n    plural(ms, s, 'second') ||\n    ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n  if (ms < n) {\n    return;\n  }\n  if (ms < n * 1.5) {\n    return Math.floor(ms / n) + ' ' + name;\n  }\n  return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n  var hash = 0, i;\n\n  for (i in namespace) {\n    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);\n    hash |= 0; // Convert to 32bit integer\n  }\n\n  return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n  function debug() {\n    // disabled?\n    if (!debug.enabled) return;\n\n    var self = debug;\n\n    // set `diff` timestamp\n    var curr = +new Date();\n    var ms = curr - (prevTime || curr);\n    self.diff = ms;\n    self.prev = prevTime;\n    self.curr = curr;\n    prevTime = curr;\n\n    // turn the `arguments` into a proper Array\n    var args = new Array(arguments.length);\n    for (var i = 0; i < args.length; i++) {\n      args[i] = arguments[i];\n    }\n\n    args[0] = exports.coerce(args[0]);\n\n    if ('string' !== typeof args[0]) {\n      // anything else let's inspect with %O\n      args.unshift('%O');\n    }\n\n    // apply any `formatters` transformations\n    var index = 0;\n    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n      // if we encounter an escaped % then don't increase the array index\n      if (match === '%%') return match;\n      index++;\n      var formatter = exports.formatters[format];\n      if ('function' === typeof formatter) {\n        var val = args[index];\n        match = formatter.call(self, val);\n\n        // now we need to remove `args[index]` since it's inlined in the `format`\n        args.splice(index, 1);\n        index--;\n      }\n      return match;\n    });\n\n    // apply env-specific formatting (colors, etc.)\n    exports.formatArgs.call(self, args);\n\n    var logFn = debug.log || exports.log || console.log.bind(console);\n    logFn.apply(self, args);\n  }\n\n  debug.namespace = namespace;\n  debug.enabled = exports.enabled(namespace);\n  debug.useColors = exports.useColors();\n  debug.color = selectColor(namespace);\n\n  // env-specific initialization logic for debug instances\n  if ('function' === typeof exports.init) {\n    exports.init(debug);\n  }\n\n  return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n  exports.save(namespaces);\n\n  exports.names = [];\n  exports.skips = [];\n\n  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n  var len = split.length;\n\n  for (var i = 0; i < len; i++) {\n    if (!split[i]) continue; // ignore empty strings\n    namespaces = split[i].replace(/\\*/g, '.*?');\n    if (namespaces[0] === '-') {\n      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n    } else {\n      exports.names.push(new RegExp('^' + namespaces + '$'));\n    }\n  }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n  exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n  var i, len;\n  for (i = 0, len = exports.skips.length; i < len; i++) {\n    if (exports.skips[i].test(name)) {\n      return false;\n    }\n  }\n  for (i = 0, len = exports.names.length; i < len; i++) {\n    if (exports.names[i].test(name)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n  if (val instanceof Error) return val.stack || val.message;\n  return val;\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n               && 'undefined' != typeof chrome.storage\n                  ? chrome.storage.local\n                  : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n  'lightseagreen',\n  'forestgreen',\n  'goldenrod',\n  'dodgerblue',\n  'darkorchid',\n  'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n  // NB: In an Electron preload script, document will be defined but not fully\n  // initialized. Since we know we're in Chrome, we'll just detect this case\n  // explicitly\n  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n    return true;\n  }\n\n  // is webkit? http://stackoverflow.com/a/16459606/376773\n  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n    // is firebug? http://stackoverflow.com/a/398120/376773\n    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n    // is firefox >= v31?\n    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n    // double check webkit in userAgent just in case we are in a worker\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n  try {\n    return JSON.stringify(v);\n  } catch (err) {\n    return '[UnexpectedJSONParseError]: ' + err.message;\n  }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n  var useColors = this.useColors;\n\n  args[0] = (useColors ? '%c' : '')\n    + this.namespace\n    + (useColors ? ' %c' : ' ')\n    + args[0]\n    + (useColors ? '%c ' : ' ')\n    + '+' + exports.humanize(this.diff);\n\n  if (!useColors) return;\n\n  var c = 'color: ' + this.color;\n  args.splice(1, 0, c, 'color: inherit')\n\n  // the final \"%c\" is somewhat tricky, because there could be other\n  // arguments passed either before or after the %c, so we need to\n  // figure out the correct index to insert the CSS into\n  var index = 0;\n  var lastC = 0;\n  args[0].replace(/%[a-zA-Z%]/g, function(match) {\n    if ('%%' === match) return;\n    index++;\n    if ('%c' === match) {\n      // we only are interested in the *last* %c\n      // (the user may have provided their own)\n      lastC = index;\n    }\n  });\n\n  args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n  // this hackery is required for IE8/9, where\n  // the `console.log` function doesn't have 'apply'\n  return 'object' === typeof console\n    && console.log\n    && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n  try {\n    if (null == namespaces) {\n      exports.storage.removeItem('debug');\n    } else {\n      exports.storage.debug = namespaces;\n    }\n  } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n  var r;\n  try {\n    r = exports.storage.debug;\n  } catch(e) {}\n\n  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n  if (!r && typeof process !== 'undefined' && 'env' in process) {\n    r = process.env.DEBUG;\n  }\n\n  return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n  try {\n    return window.localStorage;\n  } catch (e) {}\n}\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n  return function wrap() {\n    var args = new Array(arguments.length);\n    for (var i = 0; i < args.length; i++) {\n      args[i] = arguments[i];\n    }\n    return fn.apply(thisArg, args);\n  };\n};\n","/*!\n * Determine if an object is a Buffer\n *\n * @author   Feross Aboukhadijeh  \n * @license  MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n  return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n  return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n  return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n  return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n  return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n  return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n  var result;\n  if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n    result = ArrayBuffer.isView(val);\n  } else {\n    result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n  }\n  return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n  return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n  return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n  return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n  return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n  return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n  return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n  return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n  return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n  return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n  return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n  return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n *  typeof window -> undefined\n *  typeof document -> undefined\n *\n * react-native:\n *  navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n  if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n    return false;\n  }\n  return (\n    typeof window !== 'undefined' &&\n    typeof document !== 'undefined'\n  );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n  // Don't bother if no value provided\n  if (obj === null || typeof obj === 'undefined') {\n    return;\n  }\n\n  // Force an array if not already something iterable\n  if (typeof obj !== 'object' && !isArray(obj)) {\n    /*eslint no-param-reassign:0*/\n    obj = [obj];\n  }\n\n  if (isArray(obj)) {\n    // Iterate over array values\n    for (var i = 0, l = obj.length; i < l; i++) {\n      fn.call(null, obj[i], i, obj);\n    }\n  } else {\n    // Iterate over object keys\n    for (var key in obj) {\n      if (Object.prototype.hasOwnProperty.call(obj, key)) {\n        fn.call(null, obj[key], key, obj);\n      }\n    }\n  }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n  var result = {};\n  function assignValue(val, key) {\n    if (typeof result[key] === 'object' && typeof val === 'object') {\n      result[key] = merge(result[key], val);\n    } else {\n      result[key] = val;\n    }\n  }\n\n  for (var i = 0, l = arguments.length; i < l; i++) {\n    forEach(arguments[i], assignValue);\n  }\n  return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n  forEach(b, function assignValue(val, key) {\n    if (thisArg && typeof val === 'function') {\n      a[key] = bind(val, thisArg);\n    } else {\n      a[key] = val;\n    }\n  });\n  return a;\n}\n\nmodule.exports = {\n  isArray: isArray,\n  isArrayBuffer: isArrayBuffer,\n  isBuffer: isBuffer,\n  isFormData: isFormData,\n  isArrayBufferView: isArrayBufferView,\n  isString: isString,\n  isNumber: isNumber,\n  isObject: isObject,\n  isUndefined: isUndefined,\n  isDate: isDate,\n  isFile: isFile,\n  isBlob: isBlob,\n  isFunction: isFunction,\n  isStream: isStream,\n  isURLSearchParams: isURLSearchParams,\n  isStandardBrowserEnv: isStandardBrowserEnv,\n  forEach: forEach,\n  merge: merge,\n  extend: extend,\n  trim: trim\n};\n","var core = require('../../modules/_core');\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n  return $JSON.stringify.apply($JSON, arguments);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/json/stringify\"), __esModule: true };","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n  utils.forEach(headers, function processHeader(value, name) {\n    if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n      headers[normalizedName] = value;\n      delete headers[name];\n    }\n  });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n  error.config = config;\n  if (code) {\n    error.code = code;\n  }\n  error.request = request;\n  error.response = response;\n  return error;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n  var error = new Error(message);\n  return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n  var validateStatus = response.config.validateStatus;\n  // Note: status is not exposed by XDomainRequest\n  if (!response.status || !validateStatus || validateStatus(response.status)) {\n    resolve(response);\n  } else {\n    reject(createError(\n      'Request failed with status code ' + response.status,\n      response.config,\n      null,\n      response.request,\n      response\n    ));\n  }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n  return encodeURIComponent(val).\n    replace(/%40/gi, '@').\n    replace(/%3A/gi, ':').\n    replace(/%24/g, '$').\n    replace(/%2C/gi, ',').\n    replace(/%20/g, '+').\n    replace(/%5B/gi, '[').\n    replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n  /*eslint no-param-reassign:0*/\n  if (!params) {\n    return url;\n  }\n\n  var serializedParams;\n  if (paramsSerializer) {\n    serializedParams = paramsSerializer(params);\n  } else if (utils.isURLSearchParams(params)) {\n    serializedParams = params.toString();\n  } else {\n    var parts = [];\n\n    utils.forEach(params, function serialize(val, key) {\n      if (val === null || typeof val === 'undefined') {\n        return;\n      }\n\n      if (utils.isArray(val)) {\n        key = key + '[]';\n      }\n\n      if (!utils.isArray(val)) {\n        val = [val];\n      }\n\n      utils.forEach(val, function parseValue(v) {\n        if (utils.isDate(v)) {\n          v = v.toISOString();\n        } else if (utils.isObject(v)) {\n          v = JSON.stringify(v);\n        }\n        parts.push(encode(key) + '=' + encode(v));\n      });\n    });\n\n    serializedParams = parts.join('&');\n  }\n\n  if (serializedParams) {\n    url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n  }\n\n  return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n  var parsed = {};\n  var key;\n  var val;\n  var i;\n\n  if (!headers) { return parsed; }\n\n  utils.forEach(headers.split('\\n'), function parser(line) {\n    i = line.indexOf(':');\n    key = utils.trim(line.substr(0, i)).toLowerCase();\n    val = utils.trim(line.substr(i + 1));\n\n    if (key) {\n      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n    }\n  });\n\n  return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n  utils.isStandardBrowserEnv() ?\n\n  // Standard browser envs have full support of the APIs needed to test\n  // whether the request URL is of the same origin as current location.\n  (function standardBrowserEnv() {\n    var msie = /(msie|trident)/i.test(navigator.userAgent);\n    var urlParsingNode = document.createElement('a');\n    var originURL;\n\n    /**\n    * Parse a URL to discover it's components\n    *\n    * @param {String} url The URL to be parsed\n    * @returns {Object}\n    */\n    function resolveURL(url) {\n      var href = url;\n\n      if (msie) {\n        // IE needs attribute set twice to normalize properties\n        urlParsingNode.setAttribute('href', href);\n        href = urlParsingNode.href;\n      }\n\n      urlParsingNode.setAttribute('href', href);\n\n      // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n      return {\n        href: urlParsingNode.href,\n        protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n        host: urlParsingNode.host,\n        search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n        hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n        hostname: urlParsingNode.hostname,\n        port: urlParsingNode.port,\n        pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n                  urlParsingNode.pathname :\n                  '/' + urlParsingNode.pathname\n      };\n    }\n\n    originURL = resolveURL(window.location.href);\n\n    /**\n    * Determine if a URL shares the same origin as the current location\n    *\n    * @param {String} requestURL The URL to test\n    * @returns {boolean} True if URL shares the same origin, otherwise false\n    */\n    return function isURLSameOrigin(requestURL) {\n      var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n      return (parsed.protocol === originURL.protocol &&\n            parsed.host === originURL.host);\n    };\n  })() :\n\n  // Non standard browser envs (web workers, react-native) lack needed support.\n  (function nonStandardBrowserEnv() {\n    return function isURLSameOrigin() {\n      return true;\n    };\n  })()\n);\n","'use strict';\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n  this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n  var str = String(input);\n  var output = '';\n  for (\n    // initialize result and counter\n    var block, charCode, idx = 0, map = chars;\n    // if the next str index does not exist:\n    //   change the mapping table to \"=\"\n    //   check if d has no fractional digits\n    str.charAt(idx | 0) || (map = '=', idx % 1);\n    // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n    output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n  ) {\n    charCode = str.charCodeAt(idx += 3 / 4);\n    if (charCode > 0xFF) {\n      throw new E();\n    }\n    block = block << 8 | charCode;\n  }\n  return output;\n}\n\nmodule.exports = btoa;\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n  utils.isStandardBrowserEnv() ?\n\n  // Standard browser envs support document.cookie\n  (function standardBrowserEnv() {\n    return {\n      write: function write(name, value, expires, path, domain, secure) {\n        var cookie = [];\n        cookie.push(name + '=' + encodeURIComponent(value));\n\n        if (utils.isNumber(expires)) {\n          cookie.push('expires=' + new Date(expires).toGMTString());\n        }\n\n        if (utils.isString(path)) {\n          cookie.push('path=' + path);\n        }\n\n        if (utils.isString(domain)) {\n          cookie.push('domain=' + domain);\n        }\n\n        if (secure === true) {\n          cookie.push('secure');\n        }\n\n        document.cookie = cookie.join('; ');\n      },\n\n      read: function read(name) {\n        var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n        return (match ? decodeURIComponent(match[3]) : null);\n      },\n\n      remove: function remove(name) {\n        this.write(name, '', Date.now() - 86400000);\n      }\n    };\n  })() :\n\n  // Non standard browser env (web workers, react-native) lack needed support.\n  (function nonStandardBrowserEnv() {\n    return {\n      write: function write() {},\n      read: function read() { return null; },\n      remove: function remove() {}\n    };\n  })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');\n\nmodule.exports = function xhrAdapter(config) {\n  return new Promise(function dispatchXhrRequest(resolve, reject) {\n    var requestData = config.data;\n    var requestHeaders = config.headers;\n\n    if (utils.isFormData(requestData)) {\n      delete requestHeaders['Content-Type']; // Let the browser set it\n    }\n\n    var request = new XMLHttpRequest();\n    var loadEvent = 'onreadystatechange';\n    var xDomain = false;\n\n    // For IE 8/9 CORS support\n    // Only supports POST and GET calls and doesn't returns the response headers.\n    // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n    if (process.env.NODE_ENV !== 'test' &&\n        typeof window !== 'undefined' &&\n        window.XDomainRequest && !('withCredentials' in request) &&\n        !isURLSameOrigin(config.url)) {\n      request = new window.XDomainRequest();\n      loadEvent = 'onload';\n      xDomain = true;\n      request.onprogress = function handleProgress() {};\n      request.ontimeout = function handleTimeout() {};\n    }\n\n    // HTTP basic authentication\n    if (config.auth) {\n      var username = config.auth.username || '';\n      var password = config.auth.password || '';\n      requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n    }\n\n    request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n    // Set the request timeout in MS\n    request.timeout = config.timeout;\n\n    // Listen for ready state\n    request[loadEvent] = function handleLoad() {\n      if (!request || (request.readyState !== 4 && !xDomain)) {\n        return;\n      }\n\n      // The request errored out and we didn't get a response, this will be\n      // handled by onerror instead\n      // With one exception: request that using file: protocol, most browsers\n      // will return status as 0 even though it's a successful request\n      if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n        return;\n      }\n\n      // Prepare the response\n      var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n      var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n      var response = {\n        data: responseData,\n        // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)\n        status: request.status === 1223 ? 204 : request.status,\n        statusText: request.status === 1223 ? 'No Content' : request.statusText,\n        headers: responseHeaders,\n        config: config,\n        request: request\n      };\n\n      settle(resolve, reject, response);\n\n      // Clean up request\n      request = null;\n    };\n\n    // Handle low level network errors\n    request.onerror = function handleError() {\n      // Real errors are hidden from us by the browser\n      // onerror should only fire if it's a network error\n      reject(createError('Network Error', config, null, request));\n\n      // Clean up request\n      request = null;\n    };\n\n    // Handle timeout\n    request.ontimeout = function handleTimeout() {\n      reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n        request));\n\n      // Clean up request\n      request = null;\n    };\n\n    // Add xsrf header\n    // This is only done if running in a standard browser environment.\n    // Specifically not if we're in a web worker, or react-native.\n    if (utils.isStandardBrowserEnv()) {\n      var cookies = require('./../helpers/cookies');\n\n      // Add xsrf header\n      var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n          cookies.read(config.xsrfCookieName) :\n          undefined;\n\n      if (xsrfValue) {\n        requestHeaders[config.xsrfHeaderName] = xsrfValue;\n      }\n    }\n\n    // Add headers to the request\n    if ('setRequestHeader' in request) {\n      utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n        if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n          // Remove Content-Type if data is undefined\n          delete requestHeaders[key];\n        } else {\n          // Otherwise add header to the request\n          request.setRequestHeader(key, val);\n        }\n      });\n    }\n\n    // Add withCredentials to request if needed\n    if (config.withCredentials) {\n      request.withCredentials = true;\n    }\n\n    // Add responseType to request if needed\n    if (config.responseType) {\n      try {\n        request.responseType = config.responseType;\n      } catch (e) {\n        // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n        // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n        if (config.responseType !== 'json') {\n          throw e;\n        }\n      }\n    }\n\n    // Handle progress if needed\n    if (typeof config.onDownloadProgress === 'function') {\n      request.addEventListener('progress', config.onDownloadProgress);\n    }\n\n    // Not all browsers support upload events\n    if (typeof config.onUploadProgress === 'function' && request.upload) {\n      request.upload.addEventListener('progress', config.onUploadProgress);\n    }\n\n    if (config.cancelToken) {\n      // Handle cancellation\n      config.cancelToken.promise.then(function onCanceled(cancel) {\n        if (!request) {\n          return;\n        }\n\n        request.abort();\n        reject(cancel);\n        // Clean up request\n        request = null;\n      });\n    }\n\n    if (requestData === undefined) {\n      requestData = null;\n    }\n\n    // Send the request\n    request.send(requestData);\n  });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n  'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n  if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n    headers['Content-Type'] = value;\n  }\n}\n\nfunction getDefaultAdapter() {\n  var adapter;\n  if (typeof XMLHttpRequest !== 'undefined') {\n    // For browsers use XHR adapter\n    adapter = require('./adapters/xhr');\n  } else if (typeof process !== 'undefined') {\n    // For node use HTTP adapter\n    adapter = require('./adapters/http');\n  }\n  return adapter;\n}\n\nvar defaults = {\n  adapter: getDefaultAdapter(),\n\n  transformRequest: [function transformRequest(data, headers) {\n    normalizeHeaderName(headers, 'Content-Type');\n    if (utils.isFormData(data) ||\n      utils.isArrayBuffer(data) ||\n      utils.isBuffer(data) ||\n      utils.isStream(data) ||\n      utils.isFile(data) ||\n      utils.isBlob(data)\n    ) {\n      return data;\n    }\n    if (utils.isArrayBufferView(data)) {\n      return data.buffer;\n    }\n    if (utils.isURLSearchParams(data)) {\n      setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n      return data.toString();\n    }\n    if (utils.isObject(data)) {\n      setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n      return JSON.stringify(data);\n    }\n    return data;\n  }],\n\n  transformResponse: [function transformResponse(data) {\n    /*eslint no-param-reassign:0*/\n    if (typeof data === 'string') {\n      try {\n        data = JSON.parse(data);\n      } catch (e) { /* Ignore */ }\n    }\n    return data;\n  }],\n\n  timeout: 0,\n\n  xsrfCookieName: 'XSRF-TOKEN',\n  xsrfHeaderName: 'X-XSRF-TOKEN',\n\n  maxContentLength: -1,\n\n  validateStatus: function validateStatus(status) {\n    return status >= 200 && status < 300;\n  }\n};\n\ndefaults.headers = {\n  common: {\n    'Accept': 'application/json, text/plain, */*'\n  }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n  defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n  defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n  this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n  this.handlers.push({\n    fulfilled: fulfilled,\n    rejected: rejected\n  });\n  return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n  if (this.handlers[id]) {\n    this.handlers[id] = null;\n  }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n  utils.forEach(this.handlers, function forEachHandler(h) {\n    if (h !== null) {\n      fn(h);\n    }\n  });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n  /*eslint no-param-reassign:0*/\n  utils.forEach(fns, function transform(fn) {\n    data = fn(data, headers);\n  });\n\n  return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n  return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n  if (config.cancelToken) {\n    config.cancelToken.throwIfRequested();\n  }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n  throwIfCancellationRequested(config);\n\n  // Ensure headers exist\n  config.headers = config.headers || {};\n\n  // Transform request data\n  config.data = transformData(\n    config.data,\n    config.headers,\n    config.transformRequest\n  );\n\n  // Flatten headers\n  config.headers = utils.merge(\n    config.headers.common || {},\n    config.headers[config.method] || {},\n    config.headers || {}\n  );\n\n  utils.forEach(\n    ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n    function cleanHeaderConfig(method) {\n      delete config.headers[method];\n    }\n  );\n\n  var adapter = config.adapter || defaults.adapter;\n\n  return adapter(config).then(function onAdapterResolution(response) {\n    throwIfCancellationRequested(config);\n\n    // Transform response data\n    response.data = transformData(\n      response.data,\n      response.headers,\n      config.transformResponse\n    );\n\n    return response;\n  }, function onAdapterRejection(reason) {\n    if (!isCancel(reason)) {\n      throwIfCancellationRequested(config);\n\n      // Transform response data\n      if (reason && reason.response) {\n        reason.response.data = transformData(\n          reason.response.data,\n          reason.response.headers,\n          config.transformResponse\n        );\n      }\n    }\n\n    return Promise.reject(reason);\n  });\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n  // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n  // by any combination of letters, digits, plus, period, or hyphen.\n  return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n  return relativeURL\n    ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n    : baseURL;\n};\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n  this.defaults = instanceConfig;\n  this.interceptors = {\n    request: new InterceptorManager(),\n    response: new InterceptorManager()\n  };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n  /*eslint no-param-reassign:0*/\n  // Allow for axios('example/url'[, config]) a la fetch API\n  if (typeof config === 'string') {\n    config = utils.merge({\n      url: arguments[0]\n    }, arguments[1]);\n  }\n\n  config = utils.merge(defaults, this.defaults, { method: 'get' }, config);\n  config.method = config.method.toLowerCase();\n\n  // Support baseURL config\n  if (config.baseURL && !isAbsoluteURL(config.url)) {\n    config.url = combineURLs(config.baseURL, config.url);\n  }\n\n  // Hook up interceptors middleware\n  var chain = [dispatchRequest, undefined];\n  var promise = Promise.resolve(config);\n\n  this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n    chain.unshift(interceptor.fulfilled, interceptor.rejected);\n  });\n\n  this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n    chain.push(interceptor.fulfilled, interceptor.rejected);\n  });\n\n  while (chain.length) {\n    promise = promise.then(chain.shift(), chain.shift());\n  }\n\n  return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n  /*eslint func-names:0*/\n  Axios.prototype[method] = function(url, config) {\n    return this.request(utils.merge(config || {}, {\n      method: method,\n      url: url\n    }));\n  };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n  /*eslint func-names:0*/\n  Axios.prototype[method] = function(url, data, config) {\n    return this.request(utils.merge(config || {}, {\n      method: method,\n      url: url,\n      data: data\n    }));\n  };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n  this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n  return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n  if (typeof executor !== 'function') {\n    throw new TypeError('executor must be a function.');\n  }\n\n  var resolvePromise;\n  this.promise = new Promise(function promiseExecutor(resolve) {\n    resolvePromise = resolve;\n  });\n\n  var token = this;\n  executor(function cancel(message) {\n    if (token.reason) {\n      // Cancellation has already been requested\n      return;\n    }\n\n    token.reason = new Cancel(message);\n    resolvePromise(token.reason);\n  });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n  if (this.reason) {\n    throw this.reason;\n  }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n  var cancel;\n  var token = new CancelToken(function executor(c) {\n    cancel = c;\n  });\n  return {\n    token: token,\n    cancel: cancel\n  };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n *  ```js\n *  function f(x, y, z) {}\n *  var args = [1, 2, 3];\n *  f.apply(null, args);\n *  ```\n *\n * With `spread` this example can be re-written.\n *\n *  ```js\n *  spread(function(x, y, z) {})([1, 2, 3]);\n *  ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n  return function wrap(arr) {\n    return callback.apply(null, arr);\n  };\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n  var context = new Axios(defaultConfig);\n  var instance = bind(Axios.prototype.request, context);\n\n  // Copy axios.prototype to instance\n  utils.extend(instance, Axios.prototype, context);\n\n  // Copy context to instance\n  utils.extend(instance, context);\n\n  return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n  return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n  return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n  var fn = (core.Object || {})[KEY] || Object[KEY];\n  var exp = {};\n  exp[KEY] = exec(fn);\n  $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n  return function getOwnPropertyDescriptor(it, key) {\n    return $getOwnPropertyDescriptor(toIObject(it), key);\n  };\n});\n","require('../../modules/es6.object.get-own-property-descriptor');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function getOwnPropertyDescriptor(it, key) {\n  return $Object.getOwnPropertyDescriptor(it, key);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/get-own-property-descriptor\"), __esModule: true };","/*\n\n  Javascript State Machine Library - https://github.com/jakesgordon/javascript-state-machine\n\n  Copyright (c) 2012, 2013, 2014, 2015, Jake Gordon and contributors\n  Released under the MIT license - https://github.com/jakesgordon/javascript-state-machine/blob/master/LICENSE\n\n*/\n\n(function () {\n\n  var StateMachine = {\n\n    //---------------------------------------------------------------------------\n\n    VERSION: \"2.4.0\",\n\n    //---------------------------------------------------------------------------\n\n    Result: {\n      SUCCEEDED:    1, // the event transitioned successfully from one state to another\n      NOTRANSITION: 2, // the event was successfull but no state transition was necessary\n      CANCELLED:    3, // the event was cancelled by the caller in a beforeEvent callback\n      PENDING:      4  // the event is asynchronous and the caller is in control of when the transition occurs\n    },\n\n    Error: {\n      INVALID_TRANSITION: 100, // caller tried to fire an event that was innapropriate in the current state\n      PENDING_TRANSITION: 200, // caller tried to fire an event while an async transition was still pending\n      INVALID_CALLBACK:   300 // caller provided callback function threw an exception\n    },\n\n    WILDCARD: '*',\n    ASYNC: 'async',\n\n    //---------------------------------------------------------------------------\n\n    create: function(cfg, target) {\n\n      var initial      = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial; // allow for a simple string, or an object with { state: 'foo', event: 'setup', defer: true|false }\n      var terminal     = cfg.terminal || cfg['final'];\n      var fsm          = target || cfg.target  || {};\n      var events       = cfg.events || [];\n      var callbacks    = cfg.callbacks || {};\n      var map          = {}; // track state transitions allowed for an event { event: { from: [ to ] } }\n      var transitions  = {}; // track events allowed from a state            { state: [ event ] }\n\n      var add = function(e) {\n        var from = Array.isArray(e.from) ? e.from : (e.from ? [e.from] : [StateMachine.WILDCARD]); // allow 'wildcard' transition if 'from' is not specified\n        map[e.name] = map[e.name] || {};\n        for (var n = 0 ; n < from.length ; n++) {\n          transitions[from[n]] = transitions[from[n]] || [];\n          transitions[from[n]].push(e.name);\n\n          map[e.name][from[n]] = e.to || from[n]; // allow no-op transition if 'to' is not specified\n        }\n        if (e.to)\n          transitions[e.to] = transitions[e.to] || [];\n      };\n\n      if (initial) {\n        initial.event = initial.event || 'startup';\n        add({ name: initial.event, from: 'none', to: initial.state });\n      }\n\n      for(var n = 0 ; n < events.length ; n++)\n        add(events[n]);\n\n      for(var name in map) {\n        if (map.hasOwnProperty(name))\n          fsm[name] = StateMachine.buildEvent(name, map[name]);\n      }\n\n      for(var name in callbacks) {\n        if (callbacks.hasOwnProperty(name))\n          fsm[name] = callbacks[name]\n      }\n\n      fsm.current     = 'none';\n      fsm.is          = function(state) { return Array.isArray(state) ? (state.indexOf(this.current) >= 0) : (this.current === state); };\n      fsm.can         = function(event) { return !this.transition && (map[event] !== undefined) && (map[event].hasOwnProperty(this.current) || map[event].hasOwnProperty(StateMachine.WILDCARD)); }\n      fsm.cannot      = function(event) { return !this.can(event); };\n      fsm.transitions = function()      { return (transitions[this.current] || []).concat(transitions[StateMachine.WILDCARD] || []); };\n      fsm.isFinished  = function()      { return this.is(terminal); };\n      fsm.error       = cfg.error || function(name, from, to, args, error, msg, e) { throw e || msg; }; // default behavior when something unexpected happens is to throw an exception, but caller can override this behavior if desired (see github issue #3 and #17)\n      fsm.states      = function() { return Object.keys(transitions).sort() };\n\n      if (initial && !initial.defer)\n        fsm[initial.event]();\n\n      return fsm;\n\n    },\n\n    //===========================================================================\n\n    doCallback: function(fsm, func, name, from, to, args) {\n      if (func) {\n        try {\n          return func.apply(fsm, [name, from, to].concat(args));\n        }\n        catch(e) {\n          return fsm.error(name, from, to, args, StateMachine.Error.INVALID_CALLBACK, \"an exception occurred in a caller-provided callback function\", e);\n        }\n      }\n    },\n\n    beforeAnyEvent:  function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbeforeevent'],                       name, from, to, args); },\n    afterAnyEvent:   function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafterevent'] || fsm['onevent'],      name, from, to, args); },\n    leaveAnyState:   function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleavestate'],                        name, from, to, args); },\n    enterAnyState:   function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenterstate'] || fsm['onstate'],      name, from, to, args); },\n    changeState:     function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onchangestate'],                       name, from, to, args); },\n\n    beforeThisEvent: function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onbefore' + name],                     name, from, to, args); },\n    afterThisEvent:  function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onafter'  + name] || fsm['on' + name], name, from, to, args); },\n    leaveThisState:  function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onleave'  + from],                     name, from, to, args); },\n    enterThisState:  function(fsm, name, from, to, args) { return StateMachine.doCallback(fsm, fsm['onenter'  + to]   || fsm['on' + to],   name, from, to, args); },\n\n    beforeEvent: function(fsm, name, from, to, args) {\n      if ((false === StateMachine.beforeThisEvent(fsm, name, from, to, args)) ||\n          (false === StateMachine.beforeAnyEvent( fsm, name, from, to, args)))\n        return false;\n    },\n\n    afterEvent: function(fsm, name, from, to, args) {\n      StateMachine.afterThisEvent(fsm, name, from, to, args);\n      StateMachine.afterAnyEvent( fsm, name, from, to, args);\n    },\n\n    leaveState: function(fsm, name, from, to, args) {\n      var specific = StateMachine.leaveThisState(fsm, name, from, to, args),\n          general  = StateMachine.leaveAnyState( fsm, name, from, to, args);\n      if ((false === specific) || (false === general))\n        return false;\n      else if ((StateMachine.ASYNC === specific) || (StateMachine.ASYNC === general))\n        return StateMachine.ASYNC;\n    },\n\n    enterState: function(fsm, name, from, to, args) {\n      StateMachine.enterThisState(fsm, name, from, to, args);\n      StateMachine.enterAnyState( fsm, name, from, to, args);\n    },\n\n    //===========================================================================\n\n    buildEvent: function(name, map) {\n      return function() {\n\n        var from  = this.current;\n        var to    = map[from] || (map[StateMachine.WILDCARD] != StateMachine.WILDCARD ? map[StateMachine.WILDCARD] : from) || from;\n        var args  = Array.prototype.slice.call(arguments); // turn arguments into pure array\n\n        if (this.transition)\n          return this.error(name, from, to, args, StateMachine.Error.PENDING_TRANSITION, \"event \" + name + \" inappropriate because previous transition did not complete\");\n\n        if (this.cannot(name))\n          return this.error(name, from, to, args, StateMachine.Error.INVALID_TRANSITION, \"event \" + name + \" inappropriate in current state \" + this.current);\n\n        if (false === StateMachine.beforeEvent(this, name, from, to, args))\n          return StateMachine.Result.CANCELLED;\n\n        if (from === to) {\n          StateMachine.afterEvent(this, name, from, to, args);\n          return StateMachine.Result.NOTRANSITION;\n        }\n\n        // prepare a transition method for use EITHER lower down, or by caller if they want an async transition (indicated by an ASYNC return value from leaveState)\n        var fsm = this;\n        this.transition = function() {\n          fsm.transition = null; // this method should only ever be called once\n          fsm.current = to;\n          StateMachine.enterState( fsm, name, from, to, args);\n          StateMachine.changeState(fsm, name, from, to, args);\n          StateMachine.afterEvent( fsm, name, from, to, args);\n          return StateMachine.Result.SUCCEEDED;\n        };\n        this.transition.cancel = function() { // provide a way for caller to cancel async transition if desired (issue #22)\n          fsm.transition = null;\n          StateMachine.afterEvent(fsm, name, from, to, args);\n        }\n\n        var leave = StateMachine.leaveState(this, name, from, to, args);\n        if (false === leave) {\n          this.transition = null;\n          return StateMachine.Result.CANCELLED;\n        }\n        else if (StateMachine.ASYNC === leave) {\n          return StateMachine.Result.PENDING;\n        }\n        else {\n          if (this.transition) // need to check in case user manually called transition() but forgot to return StateMachine.ASYNC\n            return this.transition();\n        }\n\n      };\n    }\n\n  }; // StateMachine\n\n  //===========================================================================\n\n  //======\n  // NODE\n  //======\n  if (typeof exports !== 'undefined') {\n    if (typeof module !== 'undefined' && module.exports) {\n      exports = module.exports = StateMachine;\n    }\n    exports.StateMachine = StateMachine;\n  }\n  //============\n  // AMD/REQUIRE\n  //============\n  else if (typeof define === 'function' && define.amd) {\n    define(function(require) { return StateMachine; });\n  }\n  //========\n  // BROWSER\n  //========\n  else if (typeof window !== 'undefined') {\n    window.StateMachine = StateMachine;\n  }\n  //===========\n  // WEB WORKER\n  //===========\n  else if (typeof self !== 'undefined') {\n    self.StateMachine = StateMachine;\n  }\n\n}());\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n  return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n  this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n  return arrayFind(store.a, function (it) {\n    return it[0] === key;\n  });\n};\nUncaughtFrozenStore.prototype = {\n  get: function (key) {\n    var entry = findUncaughtFrozen(this, key);\n    if (entry) return entry[1];\n  },\n  has: function (key) {\n    return !!findUncaughtFrozen(this, key);\n  },\n  set: function (key, value) {\n    var entry = findUncaughtFrozen(this, key);\n    if (entry) entry[1] = value;\n    else this.a.push([key, value]);\n  },\n  'delete': function (key) {\n    var index = arrayFindIndex(this.a, function (it) {\n      return it[0] === key;\n    });\n    if (~index) this.a.splice(index, 1);\n    return !!~index;\n  }\n};\n\nmodule.exports = {\n  getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n    var C = wrapper(function (that, iterable) {\n      anInstance(that, C, NAME, '_i');\n      that._t = NAME;      // collection type\n      that._i = id++;      // collection id\n      that._l = undefined; // leak store for uncaught frozen objects\n      if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n    });\n    redefineAll(C.prototype, {\n      // 23.3.3.2 WeakMap.prototype.delete(key)\n      // 23.4.3.3 WeakSet.prototype.delete(value)\n      'delete': function (key) {\n        if (!isObject(key)) return false;\n        var data = getWeak(key);\n        if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n        return data && $has(data, this._i) && delete data[this._i];\n      },\n      // 23.3.3.4 WeakMap.prototype.has(key)\n      // 23.4.3.4 WeakSet.prototype.has(value)\n      has: function has(key) {\n        if (!isObject(key)) return false;\n        var data = getWeak(key);\n        if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n        return data && $has(data, this._i);\n      }\n    });\n    return C;\n  },\n  def: function (that, key, value) {\n    var data = getWeak(anObject(key), true);\n    if (data === true) uncaughtFrozenStore(that).set(key, value);\n    else data[that._i] = value;\n    return that;\n  },\n  ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n  return function WeakMap() {\n    return get(this, arguments.length > 0 ? arguments[0] : undefined);\n  };\n};\n\nvar methods = {\n  // 23.3.3.3 WeakMap.prototype.get(key)\n  get: function get(key) {\n    if (isObject(key)) {\n      var data = getWeak(key);\n      if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n      return data ? data[this._i] : undefined;\n    }\n  },\n  // 23.3.3.5 WeakMap.prototype.set(key, value)\n  set: function set(key, value) {\n    return weak.def(validate(this, WEAK_MAP), key, value);\n  }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n  InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n  assign(InternalMap.prototype, methods);\n  meta.NEED = true;\n  each(['delete', 'has', 'get', 'set'], function (key) {\n    var proto = $WeakMap.prototype;\n    var method = proto[key];\n    redefine(proto, key, function (a, b) {\n      // store frozen objects on internal weakmap shim\n      if (isObject(a) && !isExtensible(a)) {\n        if (!this._f) this._f = new InternalMap();\n        var result = this._f[key](a, b);\n        return key == 'set' ? this : result;\n      // store all the rest on native weakmap\n      } return method.call(this, a, b);\n    });\n  });\n}\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\nrequire('./_set-collection-of')('WeakMap');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\nrequire('./_set-collection-from')('WeakMap');\n","require('../modules/es6.object.to-string');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.weak-map');\nrequire('../modules/es7.weak-map.of');\nrequire('../modules/es7.weak-map.from');\nmodule.exports = require('../modules/_core').WeakMap;\n","module.exports = { \"default\": require(\"core-js/library/fn/weak-map\"), __esModule: true };","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n  return $Object.defineProperty(it, key, desc);\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n  if (key in obj) {\n    (0, _defineProperty2.default)(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n  return function keys(it) {\n    return $keys(toObject(it));\n  };\n});\n","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag),\n      tag = value[symToStringTag];\n\n  try {\n    value[symToStringTag] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag] = tag;\n    } else {\n      delete value[symToStringTag];\n    }\n  }\n  return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n    getRawTag = require('./_getRawTag'),\n    objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n    undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n    getPrototype = require('./_getPrototype'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n    return false;\n  }\n  var proto = getPrototype(value);\n  if (proto === null) {\n    return true;\n  }\n  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n  return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n    funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","/* eslint-disable */\nexport default typeof global !== 'undefined' ? global :\n  typeof window !== 'undefined' ? window : {};\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n  function defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n    }\n  }\n\n  return function (Constructor, protoProps, staticProps) {\n    if (protoProps) defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) defineProperties(Constructor, staticProps);\n    return Constructor;\n  };\n}();","import d from 'debug';\n\nconst EXPIRED = Symbol('expired');\nconst debug = d('LC:Expirable');\nexport default class Expirable {\n  constructor(value, ttl) {\n    this._value = value;\n    if (typeof ttl === 'number') {\n      this.expiredAt = Date.now() + ttl;\n    }\n  }\n\n  get value() {\n    const expired = this.expiredAt && this.expiredAt < Date.now();\n    if (expired) debug(`expired: ${this._value}`);\n    return expired ? EXPIRED : this._value;\n  }\n}\nExpirable.EXPIRED = EXPIRED;\n","import d from 'debug';\nimport Expirable from './expirable';\n\nconst debug = d('LC:Cache');\nexport default class Cache {\n  constructor(name = 'anonymous') {\n    this.name = name;\n    this._map = {};\n  }\n\n  get(key) {\n    const cache = this._map[key];\n    if (cache) {\n      const value = cache.value;\n      if (value !== Expirable.EXPIRED) {\n        debug('[%s] hit: %s %O', this.name, key, value);\n        return value;\n      }\n      delete this._map[key];\n    }\n    debug(`[${this.name}] missed: ${key}`);\n    return null;\n  }\n\n  set(key, value, ttl) {\n    debug('[%s] set: %s %O %d', this.name, key, value, ttl);\n    this._map[key] = new Expirable(value, ttl);\n  }\n}\n","import isPlainObject from 'lodash/isPlainObject';\nimport global from './global';\n\nexport { global };\n\nexport const tryAll = (promiseConstructors) => {\n  const promise = new Promise(promiseConstructors[0]);\n  if (promiseConstructors.length === 1) {\n    return promise;\n  }\n  return promise.catch(() => tryAll(promiseConstructors.slice(1)));\n};\n\nexport const tap = interceptor => value => ((interceptor(value), value));\n\nexport { default as Expirable } from './expirable';\nexport { default as Cache } from './cache';\n\nexport const decodeDate = (date) => {\n  if (!date) return date;\n  if (typeof date === 'string') {\n    return new Date(date);\n  }\n  if (date.__type === 'Date' && date.iso) {\n    return new Date(date.iso);\n  }\n  // Long\n  if (typeof date.toNumber === 'function') {\n    return new Date(date.toNumber());\n  }\n  return date;\n};\n\nexport const keyRemap = (keymap, obj) =>\n  Object.keys(obj).reduce((newObj, key) => {\n    const newKey = keymap[key] || key;\n    return Object.assign(newObj, {\n      [newKey]: obj[key],\n    });\n  }, {});\n\nexport const isIE10 = (\n  global.navigator &&\n  global.navigator.userAgent &&\n  global.navigator.userAgent.indexOf('MSIE 10.') !== -1\n);\n\n/* eslint-disable no-proto */\nexport const getStaticProperty = (klass, property) =>\n  (klass[property] || (klass.__proto__ ? getStaticProperty(klass.__proto__, property) : undefined));\n/* eslint-enable no-proto */\n\nexport const union = (a, b) => Array.from(new Set([...a, ...b]));\nexport const difference = (a, b) => Array.from(\n  (bSet => new Set(a.filter(x => !bSet.has(x))))(new Set(b)),\n);\n\nconst map = new WeakMap();\n\n// protected property helper\nexport const internal = (object) => {\n  if (!map.has(object)) {\n    map.set(object, {});\n  }\n  return map.get(object);\n};\n\n// debug utility\nconst removeNull = (obj) => {\n  if (!isPlainObject(obj)) return obj;\n  const object = Object.assign({}, obj);\n  // eslint-disable-next-line no-restricted-syntax\n  for (const prop in object) {\n    if ({}.hasOwnProperty.call(object, prop)) {\n      const value = object[prop];\n      if (value === null) {\n        delete object[prop];\n      } else {\n        object[prop] = removeNull(value);\n      }\n    }\n  }\n  return object;\n};\nexport const trim = message => removeNull(JSON.parse(JSON.stringify(message)));\n\nexport const ensureArray = (target) => {\n  if (Array.isArray(target)) {\n    return target;\n  }\n  if (target === undefined || target === null) {\n    return [];\n  }\n  return [target];\n};\n\nexport const setValue = (target, key, value) => {\n  // '.' is not allowed in Class keys, escaping is not in concern now.\n  const segs = key.split('.');\n  const lastSeg = segs.pop();\n  let currentTarget = target;\n  segs.forEach((seg) => {\n    if (currentTarget[seg] === undefined) currentTarget[seg] = {};\n    currentTarget = currentTarget[seg];\n  });\n  currentTarget[lastSeg] = value;\n  return target;\n};\n\n// eslint-disable-next-line no-undef\nexport const isWeapp = typeof wx === 'object' && typeof wx.connectSocket === 'function';\n\n// throttle decorator\nexport const throttle = wait => (target, property, descriptor) => {\n  const callback = descriptor.value;\n  // very naive, internal use only\n  if (callback.length) {\n    throw new Error('throttled function should not accept any arguments');\n  }\n  return {\n    ...descriptor,\n    value() {\n      let {\n        throttleMeta,\n      } = internal(this);\n      if (!throttleMeta) {\n        throttleMeta = {};\n        internal(this).throttleMeta = throttleMeta;\n      }\n      let {\n        [property]: propertyMeta,\n      } = throttleMeta;\n      if (!propertyMeta) {\n        propertyMeta = {};\n        throttleMeta[property] = propertyMeta;\n      }\n      const {\n        previouseTimestamp = 0,\n        timeout,\n      } = propertyMeta;\n      const now = Date.now();\n      const remainingTime = wait - (now - previouseTimestamp);\n      if (remainingTime <= 0) {\n        throttleMeta[property].previouseTimestamp = now;\n        callback.apply(this);\n      } else if (!timeout) {\n        propertyMeta.timeout = setTimeout(() => {\n          propertyMeta.previouseTimestamp = Date.now();\n          delete propertyMeta.timeout;\n          callback.apply(this);\n        }, remainingTime);\n      }\n    },\n  };\n};\n","import { global } from '../utils';\n\nconst WebSocket = global.WebSocket || global.MozWebSocket;\nexport default WebSocket;\n","// WebSocket with auto reconnecting feature, backup endpoint and EventEmitter interface.\n\nimport d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport StateMachine from 'javascript-state-machine';\n\nimport WebSocket from 'ws';\n\nimport { tryAll, global } from './utils';\n\nconst debug = d('LC:WebSocketPlus');\n\nconst HEARTBEAT_TIME = 180000;\nconst TIMEOUT_TIME = 380000;\n\nconst DEFAULT_RETRY_STRATEGY = attempt => Math.min(1000 * (2 ** attempt), 300000);\n\nconst requireConnected = (target, name, descriptor) =>\n  Object.assign({}, descriptor, {\n    value: function requireConnectedWrapper(...args) {\n      if (!this.is('connected')) {\n        const currentState = this.current;\n        console.warn(`${name} should not be called when the connection is ${currentState}`);\n        if (this.is('disconnected') || this.is('reconnecting')) {\n          console.warn('disconnect and reconnect event should be handled to avoid such calls.');\n        }\n        throw new Error('Connection unavailable');\n      }\n      return descriptor.value.call(this, ...args);\n    },\n  });\n\nclass WebSocketPlus extends EventEmitter {\n  constructor(getUrls, protocol) {\n    if (typeof WebSocket === 'undefined') {\n      throw new Error('WebSocket is undefined. Polyfill is required in this runtime.');\n    }\n    super();\n    if (typeof getUrls !== 'function') {\n      this._getUrls = () => Promise.resolve(getUrls);\n    } else {\n      this._getUrls = getUrls;\n    }\n    this._protocol = protocol;\n    this.init();\n    this._createWs(this._getUrls, this._protocol).then(\n      () => {\n        this.__postponeTimeoutTimer = this._postponeTimeoutTimer.bind(this);\n        if (global.addEventListener) {\n          this.__pause = () => this.pause();\n          this.__resume = () => this.resume();\n          global.addEventListener('offline', this.__pause);\n          global.addEventListener('online', this.__resume);\n        }\n        this.open();\n      },\n    ).catch(this.throw.bind(this));\n  }\n\n  _createWs(getUrls, protocol) {\n    return getUrls().then((wsUrls) => {\n      let urls = wsUrls;\n      if (!(urls instanceof Array)) {\n        urls = [urls];\n      }\n      return tryAll(\n        urls.map(url => (resolve, reject) => {\n          debug(`connect [${url}] ${protocol}`);\n          const ws = protocol ? new WebSocket(\n            url, protocol,\n          ) : new WebSocket(url);\n          ws.binaryType = this.binaryType || 'arraybuffer';\n          ws.onopen = () => resolve(ws);\n          ws.onclose = (error) => {\n            if (error instanceof Error) {\n              return reject(error);\n            }\n            // in browser, error event is useless\n            return reject(new Error(`Failed to connect [${url}]`));\n          };\n          ws.onerror = ws.onclose;\n        }),\n      ).then((ws) => {\n        this._ws = ws;\n        this._ws.onclose = this._handleClose.bind(this);\n        this._ws.onmessage = this._handleMessage.bind(this);\n        return ws;\n      });\n    });\n  }\n  _destroyWs() {\n    const ws = this._ws;\n    if (!ws) return;\n    ws.onopen = null;\n    ws.onclose = null;\n    ws.onerror = null;\n    ws.onmessage = null;\n    this._ws = null;\n    ws.close();\n  }\n\n  // eslint-disable-next-line class-methods-use-this\n  onbeforeevent(event, from, to, ...payload) {\n    debug(`${event}: ${from} -> ${to}`, ...payload);\n  }\n  onopen() {\n    this.emit('open');\n  }\n  onconnected() {\n    this._startConnectionKeeper();\n  }\n  onleaveconnected(event, from, to) {\n    this._stopConnectionKeeper();\n    this._destroyWs();\n    if (to === 'offline' || to === 'disconnected') {\n      this.emit('disconnect');\n    }\n  }\n  onpause() {\n    this.emit('offline');\n  }\n  onbeforeresume() {\n    this.emit('online');\n  }\n  onreconnect() {\n    this.emit('reconnect');\n  }\n  ondisconnected(event, from, to, attempt = 0) {\n    const delay = DEFAULT_RETRY_STRATEGY.call(null, attempt);\n    debug(`schedule attempt=${attempt} delay=${delay}`);\n    this.emit('schedule', attempt, delay);\n    if (this.__scheduledRetry) {\n      clearTimeout(this.__scheduledRetry);\n    }\n    this.__scheduledRetry = setTimeout(() => {\n      if (this.is('disconnected')) {\n        this.retry(attempt);\n      }\n    }, delay);\n  }\n  onretry(event, from, to, attempt = 0) {\n    this.emit('retry', attempt);\n    this._createWs(this._getUrls, this._protocol).then(\n      () => (this.can('reconnect') ? this.reconnect() : this._destroyWs()),\n      () => this.can('fail') && this.fail(attempt + 1),\n    );\n  }\n  onerror(event, from, to, error) {\n    this.emit('error', error);\n  }\n  onclose() {\n    if (global.removeEventListener) {\n      if (this.__pause) global.removeEventListener('offline', this.__pause);\n      if (this.__resume) global.removeEventListener('online', this.__resume);\n    }\n  }\n\n  // jsdoc-ignore-start\n  @requireConnected\n  // jsdoc-ignore-end\n  _ping() {\n    debug('ping');\n    try {\n      this.ping();\n    } catch (error) {\n      console.warn(`websocket ping error: ${error.message}`);\n    }\n  }\n  ping() {\n    if (this._ws.ping) {\n      this._ws.ping();\n    } else {\n      console.warn(`The WebSocket implement does not support sending ping frame.\n        Override ping method to use application defined ping/pong mechanism.`);\n    }\n  }\n\n  _postponeTimeoutTimer() {\n    debug('_postponeTimeoutTimer');\n    this._clearTimeoutTimers();\n    this._timeoutTimer = setTimeout(() => {\n      debug('timeout');\n      this.disconnect();\n    }, TIMEOUT_TIME);\n  }\n  _clearTimeoutTimers() {\n    if (this._timeoutTimer) {\n      clearTimeout(this._timeoutTimer);\n    }\n  }\n  _startConnectionKeeper() {\n    debug('start connection keeper');\n    this._heartbeatTimer = setInterval(this._ping.bind(this), HEARTBEAT_TIME);\n    const addListener = this._ws.addListener || this._ws.addEventListener;\n    addListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n    addListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n    this._postponeTimeoutTimer();\n  }\n  _stopConnectionKeeper() {\n    debug('stop connection keeper');\n    // websockets/ws#489\n    const removeListener = this._ws.removeListener || this._ws.removeEventListener;\n    removeListener.call(this._ws, 'message', this.__postponeTimeoutTimer);\n    removeListener.call(this._ws, 'pong', this.__postponeTimeoutTimer);\n    this._clearTimeoutTimers();\n    if (this._heartbeatTimer) {\n      clearInterval(this._heartbeatTimer);\n    }\n  }\n\n  _handleClose(event) {\n    debug(`ws closed [${event.code}] ${event.reason}`);\n    // socket closed manually, ignore close event.\n    if (this.isFinished()) return;\n    this.handleClose(event);\n  }\n  handleClose() {\n    // reconnect\n    this.disconnect();\n  }\n\n  // jsdoc-ignore-start\n  @requireConnected\n  // jsdoc-ignore-end\n  send(data) {\n    debug('send', data);\n    this._ws.send(data);\n  }\n\n  _handleMessage(event) {\n    debug('message', event.data);\n    this.handleMessage(event.data);\n  }\n  handleMessage(message) {\n    this.emit('message', message);\n  }\n}\n\nStateMachine.create({\n  target: WebSocketPlus.prototype,\n  initial: {\n    state: 'initialized',\n    event: 'init',\n    defer: true,\n  },\n  terminal: 'closed',\n  events: [{\n    name: 'open',\n    from: 'initialized',\n    to: 'connected',\n  }, {\n    name: 'disconnect',\n    from: 'connected',\n    to: 'disconnected',\n  }, {\n    name: 'retry',\n    from: 'disconnected',\n    to: 'reconnecting',\n  }, {\n    name: 'fail',\n    from: 'reconnecting',\n    to: 'disconnected',\n  }, {\n    name: 'reconnect',\n    from: 'reconnecting',\n    to: 'connected',\n  }, {\n    name: 'pause',\n    from: ['connected', 'disconnected', 'reconnecting'],\n    to: 'offline',\n  }, {\n  }, {\n    name: 'resume',\n    from: 'offline',\n    to: 'disconnected',\n  }, {\n    name: 'close',\n    from: ['connected', 'disconnected', 'reconnecting', 'offline'],\n    to: 'closed',\n  }, {\n    name: 'throw',\n    from: '*',\n    to: 'error',\n  }],\n});\n\nexport default WebSocketPlus;\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n  return function freeze(it) {\n    return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n  };\n});\n","require('../../modules/es6.object.freeze');\nmodule.exports = require('../../modules/_core').Object.freeze;\n","module.exports = { \"default\": require(\"core-js/library/fn/object/freeze\"), __esModule: true };","export const error = Object.freeze({\n  1000: {\n    name: 'CLOSE_NORMAL',\n  },\n  1006: {\n    name: 'CLOSE_ABNORMAL',\n  },\n  4100: {\n    name: 'APP_NOT_AVAILABLE',\n    message: 'App not exists or realtime message service is disabled.',\n  },\n  4103: {\n    name: 'INVALID_LOGIN',\n    message: 'Malformed clientId.',\n  },\n  4105: {\n    name: 'SESSION_REQUIRED',\n    message: 'Message sent before session opened. ',\n  },\n  4107: {\n    name: 'READ_TIMEOUT',\n  },\n  4108: {\n    name: 'LOGIN_TIMEOUT',\n  },\n  4109: {\n    name: 'FRAME_TOO_LONG',\n  },\n  4110: {\n    name: 'INVALID_ORIGIN',\n    message: 'Access denied by domain whitelist.',\n  },\n  4111: {\n    name: 'SESSION_CONFLICT',\n  },\n  4112: {\n    name: 'SESSION_TOKEN_EXPIRED',\n  },\n  4200: {\n    name: 'INTERNAL_ERROR',\n    message: 'Internal error, please contact LeanCloud for support.',\n  },\n  4201: {\n    name: 'SEND_MESSAGE_TIMEOUT',\n  },\n  4302: {\n    name: 'CONVERSATION_SIGNATURE_FAILED',\n  },\n  4303: {\n    name: 'CONVERSATION_NOT_FOUND',\n  },\n  4304: {\n    name: 'CONVERSATION_FULL',\n  },\n  4305: {\n    name: 'CONVERSATION_REJECTED_BY_APP',\n  },\n  4306: {\n    name: 'CONVERSATION_UPDATE_FAILED',\n  },\n  4307: {\n    name: 'CONVERSATION_READ_ONLY',\n  },\n  4308: {\n    name: 'CONVERSATION_NOT_ALLOWED',\n  },\n  4401: {\n    name: 'INVALID_MESSAGING_TARGET',\n  },\n  4402: {\n    name: 'MESSAGE_REJECTED_BY_APP',\n  },\n});\n\nexport const ErrorCode = Object.freeze(\n  Object.keys(error).reduce((result, code) => Object.assign(result, {\n    [error[code].name]: Number(code),\n  }), {}),\n);\n\nexport const createError = (errorMessage) => {\n  const {\n    code, reason, appCode, detail,\n  } = errorMessage;\n  let message = reason || detail;\n  if (!message && error[code]) {\n    message = error[code].message || error[code].name;\n  }\n  if (!message) {\n    message = `Unknow Error: ${code}`;\n  }\n  const err = new Error(message);\n  return Object.assign(err, {\n    code, appCode, detail,\n  });\n};\n","import d from 'debug';\nimport WebSocketPlus from './websocket-plus';\nimport { createError } from './error';\nimport { GenericCommand, CommandType } from '../proto/message';\nimport { trim, isWeapp } from './utils';\n\nconst debug = d('LC:Connection');\n\nconst COMMAND_TIMEOUT = 20000;\n\nexport default class Connection extends WebSocketPlus {\n  constructor(getUrl, { format, version }) {\n    debug('initializing Connection');\n    const protocolString = `lc.${format}.${version}`;\n    if (!isWeapp) {\n      super(getUrl, protocolString);\n    } else {\n      super(getUrl().then(urls => urls.map(url =>\n        `${url}${url.indexOf('?') === -1 ? '?' : '&'}subprotocol=${encodeURIComponent(protocolString)}`,\n      )));\n    }\n    this._protocalFormat = format;\n    this._commands = {};\n    this._serialId = 0;\n  }\n\n  send(command, waitingForRespond = true) {\n    let serialId;\n    if (waitingForRespond) {\n      this._serialId += 1;\n      serialId = this._serialId;\n      command.i = serialId; // eslint-disable-line no-param-reassign\n    }\n    debug('↑ %O sent', trim(command));\n\n    let message;\n    if (this._protocalFormat === 'proto2base64') {\n      message = command.toBase64();\n    } else if (command.toArrayBuffer) {\n      message = command.toArrayBuffer();\n    }\n    if (!message) {\n      throw new TypeError(`${command} is not a GenericCommand`);\n    }\n\n    super.send(message);\n\n    if (!waitingForRespond) {\n      return Promise.resolve();\n    }\n    return new Promise((resolve, reject) => {\n      this._commands[serialId] = {\n        resolve,\n        reject,\n        timeout: setTimeout(\n          () => {\n            if (this._commands[serialId]) {\n              debug('✗ %O timeout', trim(command));\n              reject(new Error('Command Timeout.'));\n              delete this._commands[serialId];\n            }\n          },\n          COMMAND_TIMEOUT,\n        ),\n      };\n    });\n  }\n\n  handleMessage(msg) {\n    let message;\n    try {\n      message = GenericCommand.decode(msg);\n      debug('↓ %O received', trim(message));\n    } catch (e) {\n      console.warn('Decode message failed', msg);\n    }\n    this.emit('allmessage', message);\n    const serialId = message.i;\n    if (serialId) {\n      if (this._commands[serialId]) {\n        clearTimeout(this._commands[serialId].timeout);\n        if (message.cmd === CommandType.error) {\n          this\n            ._commands[serialId]\n            .reject(createError(message.errorMessage));\n        } else {\n          this\n            ._commands[serialId]\n            .resolve(message);\n        }\n        delete this._commands[serialId];\n      } else {\n        console.warn(`Unexpected command received with serialId [${serialId}],\n         which have timed out or never been requested.`);\n      }\n    } else if (message.cmd === CommandType.error) {\n      this.emit('error', createError(message.errorMessage));\n    } else {\n      this.emit('message', message);\n    }\n  }\n\n  ping() {\n    return this.send(new GenericCommand({\n      cmd: CommandType.echo,\n    })).catch(error => debug('ping failed:', error));\n  }\n}\n","/* eslint-disable max-len */\n\n/**\n * 插件接口\n *\n * 

\n * 插件是由一个或多个扩展点组成的字典。SDK 的扩展点可以分为两类:\n *

\n * 第一类扩展点是类实例化之后的回调,包括 RealtimeIMClientConversation。这些扩展点可以通过一个同步的 Decorator 进行扩展。Decorator 接受一个对应的实例并对其进行一些操作。\n * 特别的,由于注册自定义消息类这个需求特别的常用,额外定义一个 messageClasses 扩展点来做这件事情。\n *

\n * 第二类扩展点是在某些事件处理前、后可以注入逻辑的点。\n * 其中 beforeMessageParseafterMessageParse 可以通过一个异步的 Middleware 进行扩展。Middleware 接受一个对象,返回一个同类型对象或同类型对象的 Promise。\n * beforeMessageDispatch 可以通过返回一个 boolean 类型的 shouldDispatch 值来控制是否要继续派发收到的消息。\n *

\n * 如果使用了多个插件,这些 hook 会按照插件数组的顺序依次执行。前一个 Middleware 的返回值会作为参数传给后一个 Middleware。\n *\n * @interface Plugin\n * @since 3.1.0\n */\n\n/* eslint-enable max-len */\n\n/**\n * 插件名称,用于在日志中显示异常的插件\n *\n * @name Plugin.name\n * @type string\n */\n\n/**\n * 插件注册的消息类型\n *\n * @name Plugin.messageClasses\n * @type AVMessage[]\n */\n\n/**\n * 在 Realtime 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Realtime 实例。\n *\n * @name Plugin.onRealtimeCreate\n * @type Function\n */\n\n/**\n * 在 IMClient 实例化后对其进行修饰。\n *

\n * 接受一个参数为 IMClient 实例。\n *\n * @name Plugin.onIMClientCreate\n * @type Function\n */\n\n/**\n * 在 Conversation 实例化后对其进行修饰。\n *

\n * 接受一个参数为 Conversation 实例。\n * 需要注意的是,该扩展点并不是在 {@link IMClient#createConversation} 方法创建成功后调用的 hook,\n * 而是所有的 Conversation 实例化的时候(包括但不限于 query 时)调用的 hook。\n *\n * @name Plugin.onConversationCreate\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之前,对原始消息进行修改。\n *

\n * 接受一个参数为原始消息,是某个消息 JSON 化(message.toJSON())的返回值,一般是一个 JSON 对象。\n * 该方法需要返回一个 JSON 对象。如果这个结果是异步得到的,也可以返回一个 Promise(fulfilled with a JSON)。\n *\n * @name Plugin.beforeMessageParse\n * @type Function\n */\n\n/**\n * 在对消息进行 parse 之后,对消息实例进行修改。\n *

\n * 接受一个参数为消息实例,一般是一个已注册的 Message 类或其子类的实例。\n * 该方法需要返回一个同类型的消息实例。如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.afterMessageParse\n * @type Function\n */\n\n/**\n * 在收到消息之后,派发消息之前,控制是否派发这条消息。\n *

\n * 接受参数为 message 与 conversation。\n * 该方法需要返回 boolean 类型的值,如果返回 false 则 SDK 不再派发这条消息,后续的 beforeMessageDispatch 也不会执行。\n * 如果这个结果是异步得到的,也可以返回一个 Promise。\n *\n * @name Plugin.beforeMessageDispatch\n * @type Function\n * @since 3.4.0\n */\n\nimport { ensureArray, tap } from './utils';\n\nconst checkType = middleware => (param) => {\n const { constructor } = param;\n return Promise.resolve(param).then(middleware).then(tap((result) => {\n if (result === undefined || result === null) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns ${result} while a ${param.constructor.name} expected.`);\n }\n if (!(result instanceof constructor)) {\n // eslint-disable-next-line max-len\n return console.warn(`Middleware[${middleware._pluginName || 'anonymous plugin'}:${middleware.name || 'anonymous middleware'}] param/return types not match. It returns a ${result.constructor.name} while a ${param.constructor.name} expected.`);\n }\n return 0;\n }));\n};\n\nexport const applyDecorators = (decorators, target) => {\n if (decorators) {\n decorators.forEach((decorator) => {\n try {\n decorator(target);\n } catch (error) {\n if (decorator._pluginName) {\n error.message += `[${decorator._pluginName}]`;\n }\n throw error;\n }\n });\n }\n};\n\nexport const applyMiddlewares = middlewares => target =>\n ensureArray(middlewares).reduce(\n (previousPromise, middleware) => previousPromise\n .then(checkType(middleware))\n .catch((error) => {\n if (middleware._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${middleware._pluginName}]`;\n }\n throw error;\n }),\n Promise.resolve(target),\n );\n\nexport const applyDispatcher = (dispatchers, payload) =>\n ensureArray(dispatchers).reduce(\n (resultPromise, dispatcher) => resultPromise.then(shouldDispatch =>\n (shouldDispatch === false ? false : dispatcher(...payload)),\n ).catch((error) => {\n if (dispatcher._pluginName) {\n // eslint-disable-next-line no-param-reassign\n error.message += `[${dispatcher._pluginName}]`;\n }\n throw error;\n }), Promise.resolve(true),\n );\n","import d from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport axios from 'axios';\nimport Connection from './connection';\nimport { ErrorCode, createError } from './error';\nimport { tap, Cache, trim, internal, ensureArray, isWeapp } from './utils';\nimport { applyDecorators, applyDispatcher } from './plugin';\n\nconst debug = d('LC:Realtime');\n\nconst routerCache = new Cache('push-router');\n\nexport default class Realtime extends EventEmitter {\n /**\n * @extends EventEmitter\n * @param {Object} options\n * @param {String} options.appId\n * @param {String} options.appKey (since 4.0.0)\n * @param {String} [options.region='cn'] 节点 id\n * @param {Boolean} [options.pushOfflineMessages=false] 启用推送离线消息模式(默认为发送未读消息通知模式)\n * @param {Boolean} [options.noBinary=false] 设置 WebSocket 使用字符串格式收发消息(默认为二进制格式)。\n * 适用于 WebSocket 实现不支持二进制数据格式的情况(如微信小程序)\n * @param {Boolean} [options.ssl=true] 使用 wss 进行连接\n * @param {Plugin[]} [options.plugins] 加载插件(since 3.1.0)\n */\n constructor(options) {\n debug('initializing Realtime');\n super();\n if (typeof options.appId !== 'string') {\n throw new TypeError(`appId [${options.appId}] is not a string`);\n }\n if (typeof options.appKey !== 'string') {\n throw new TypeError(`appKey [${options.appKey}] is not a string`);\n }\n this._options = Object.assign({\n appId: undefined,\n appKey: undefined,\n region: 'cn',\n pushOfflineMessages: false,\n noBinary: isWeapp,\n ssl: true,\n server: process.env.SERVER,\n }, options);\n this._cache = new Cache('endpoints');\n internal(this).clients = new Set();\n this._plugins = [\n ...ensureArray(Realtime.__preRegisteredPlugins),\n ...ensureArray(options.plugins),\n ].reduce(\n (result, plugin) => {\n // eslint-disable-next-line no-restricted-syntax\n for (const hook in plugin) {\n if ({}.hasOwnProperty.call(plugin, hook) && hook !== 'name') {\n if (plugin.name) {\n ensureArray(plugin[hook]).forEach((value) => {\n // eslint-disable-next-line no-param-reassign\n value._pluginName = plugin.name;\n });\n }\n // eslint-disable-next-line no-param-reassign\n result[hook] = ensureArray(result[hook]).concat(plugin[hook]);\n }\n }\n return result;\n },\n {},\n );\n // onRealtimeCreate hook\n applyDecorators(this._plugins.onRealtimeCreate, this);\n }\n\n async _request({\n method,\n version = '1.1',\n path,\n query,\n headers,\n data = {},\n }) {\n const { appId, region } = this._options;\n const { api } = await this.constructor._fetchAppRouter({ appId, region });\n const url = `https://${api}/${version}${path}`;\n return axios(url, {\n method,\n params: query,\n headers: {\n 'X-LC-Id': this._options.appId,\n 'X-LC-Key': this._options.appKey,\n ...headers,\n },\n data,\n }).then(response => response.data);\n }\n\n _open() {\n if (this._openPromise) return this._openPromise;\n\n let format = 'protobuf2';\n if (this._options.noBinary) {\n // 不发送 binary data,fallback to base64 string\n format = 'proto2base64';\n }\n let version = 3;\n if (this._options.pushOfflineMessages) {\n // 不推送离线消息,而是发送对话的未读通知\n version = 1;\n }\n const protocol = {\n format,\n version,\n };\n this._openPromise = new Promise((resolve, reject) => {\n debug('No connection established, create a new one.');\n const connection = new Connection(\n () => this._getEndpoints(this._options),\n protocol,\n );\n connection.on('open', () => resolve(connection));\n connection.on('error', reject);\n connection.on('message', this._dispatchCommand.bind(this));\n /**\n * 连接断开。\n * 连接断开可能是因为 SDK 进入了离线状态(see {@link Realtime#event:offline}),或长时间没有收到服务器心跳。\n * 连接断开后所有的网络操作都会失败,请在连接断开后禁用相关的 UI 元素。\n * @event Realtime#disconnect\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event Realtime#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n */\n /**\n * 正在尝试重新连接\n * @event Realtime#retry\n * @param {Number} attempt 尝试重连的次数\n */\n /**\n * 连接恢复正常。\n * 请重新启用在 {@link Realtime#event:disconnect} 事件中禁用的相关 UI 元素\n * @event Realtime#reconnect\n */\n\n /**\n * 客户端连接断开\n * @event IMClient#disconnect\n * @see Realtime#event:disconnect\n * @since 3.2.0\n */\n /**\n * 计划在一段时间后尝试重新连接\n * @event IMClient#schedule\n * @param {Number} attempt 尝试重连的次数\n * @param {Number} delay 延迟的毫秒数\n * @since 3.2.0\n */\n /**\n * 正在尝试重新连接\n * @event IMClient#retry\n * @param {Number} attempt 尝试重连的次数\n * @since 3.2.0\n */\n\n /**\n * 客户端进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event Realtime#offline\n * @since 3.4.0\n */\n /**\n * 客户端恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event Realtime#online\n * @since 3.4.0\n */\n /**\n * 进入离线状态。\n * 这通常意味着网络已断开,或者 {@link Realtime#pause} 被调用\n * @event IMClient#offline\n * @since 3.4.0\n */\n /**\n * 恢复在线状态\n * 这通常意味着网络已恢复,或者 {@link Realtime#resume} 被调用\n * @event IMClient#online\n * @since 3.4.0\n */\n\n // event proxy\n ['disconnect', 'reconnect', 'retry', 'schedule', 'offline', 'online'].forEach(\n event => connection.on(event, (...payload) => {\n debug(`${event} event emitted. %O`, payload);\n this.emit(event, ...payload);\n if (event !== 'reconnect') {\n internal(this).clients.forEach((client) => {\n client.emit(event, ...payload);\n });\n }\n }),\n );\n // override handleClose\n connection.handleClose = function handleClose(event) {\n const isFatal = [\n ErrorCode.APP_NOT_AVAILABLE,\n ErrorCode.INVALID_LOGIN,\n ErrorCode.INVALID_ORIGIN,\n ].some(errorCode => errorCode === event.code);\n if (isFatal) {\n // in these cases, SDK should throw.\n this.throw(createError(event));\n } else {\n // reconnect\n this.disconnect();\n }\n };\n internal(this).connection = connection;\n });\n\n return this._openPromise;\n }\n\n _getEndpoints(options) {\n return Promise.resolve(\n this._cache.get('endpoints') ||\n this\n .constructor\n ._fetchEndpointsInfo(options)\n .then(\n tap(info => this._cache.set('endpoints', info, info.ttl * 1000)),\n ),\n ).then((info) => {\n debug('endpoint info: %O', info);\n return [info.server, info.secondary];\n });\n }\n\n static _fetchAppRouter({ appId, region }) {\n debug('fetch router');\n switch (region) {\n case 'cn': {\n const cachedRouter = routerCache.get(appId);\n if (cachedRouter) {\n return Promise.resolve(cachedRouter);\n }\n return axios\n .get('https://app-router.leancloud.cn/2/route', {\n params: {\n appId,\n },\n timeout: 20000,\n })\n .then(\n res => res.data,\n )\n .then(tap(debug))\n .then(\n ({\n rtm_router_server: rtmRouter,\n api_server: api,\n ttl = 3600,\n }) => {\n if (!rtmRouter) {\n throw new Error('rtm router not exists');\n }\n const router = {\n rtmRouter,\n api,\n };\n routerCache.set(appId, router, ttl * 1000);\n return router;\n },\n )\n .catch(() => {\n const id = appId.slice(0, 8).toLowerCase();\n return {\n rtmRouter: `${id}.rtm.lncld.net`,\n api: `${id}.api.lncld.net`,\n };\n });\n }\n case 'us':\n return Promise.resolve({\n rtmRouter: 'router-a0-push.leancloud.cn',\n api: 'us-api.leancloud.cn',\n });\n default:\n throw new Error(`Region [${region}] is not supported.`);\n }\n }\n\n static _fetchEndpointsInfo({ appId, region, ssl, server }) {\n debug('fetch endpoint info');\n return this._fetchAppRouter({ appId, region })\n .then(tap(debug))\n .then(({ rtmRouter }) =>\n axios.get(`https://${rtmRouter}/v1/route`, {\n params: {\n appId,\n secure: ssl,\n features: isWeapp ? 'wechat' : undefined,\n server,\n _t: Date.now(),\n },\n timeout: 20000,\n }).then(\n res => res.data,\n ).then(tap(debug)),\n );\n }\n\n _close() {\n if (this._openPromise) {\n this._openPromise.then(connection => connection.close());\n }\n delete this._openPromise;\n }\n\n /**\n * 手动进行重连。\n * SDK 在网络出现异常时会自动按照一定的时间间隔尝试重连,调用该方法会立即尝试重连并重置重连尝试计数器。\n * 只能在 `schedule` 事件之后,`retry` 事件之前调用,如果当前网络正常或者正在进行重连,调用该方法会抛异常。\n */\n retry() {\n const connection = internal(this).connection;\n if (!connection) {\n throw new Error('no connection established');\n }\n if (connection.cannot('retry')) {\n throw new Error(\n `retrying not allowed when not disconnected. the connection is now ${connection.current}`,\n );\n }\n return connection.retry();\n }\n /**\n * 暂停,使 SDK 进入离线状态。\n * 你可以在网络断开、应用进入后台等时刻调用该方法让 SDK 进入离线状态,离线状态下不会尝试重连。\n * 在浏览器中 SDK 会自动监听网络变化,因此无需手动调用该方法。\n *\n * @since 3.4.0\n * @see Realtime#event:offline\n */\n pause() {\n // 这个方法常常在网络断开、进入后台时被调用,此时 connection 可能没有建立或者已经 close。\n // 因此不像 retry,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('pause')) connection.pause();\n }\n /**\n * 恢复在线状态。\n * 你可以在网络恢复、应用回到前台等时刻调用该方法让 SDK 恢复在线状态,恢复在线状态后 SDK 会开始尝试重连。\n *\n * @since 3.4.0\n * @see Realtime#event:online\n */\n resume() {\n // 与 pause 一样,这个方法应该尽可能 loose\n const connection = internal(this).connection;\n if (!connection) return;\n if (connection.can('resume')) connection.resume();\n }\n\n _register(client) {\n internal(this).clients.add(client);\n }\n\n _deregister(client) {\n internal(this).clients.delete(client);\n if (internal(this).clients.size === 0) {\n this._close();\n }\n }\n\n _dispatchCommand(command) {\n return applyDispatcher(this._plugins.beforeCommandDispatch, [command, this])\n .then((shouldDispatch) => {\n // no plugin handled this command\n if (shouldDispatch) return debug('[WARN] Unexpected message received: %O', trim(command));\n return false;\n });\n }\n}\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\nvar rng;\n\nvar crypto = global.crypto || global.msCrypto; // for IE 11\nif (crypto && crypto.getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n rng = function whatwgRNG() {\n crypto.getRandomValues(rnds8);\n return rnds8;\n };\n}\n\nif (!rng) {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n rng = function() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n\nmodule.exports = rng;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options == 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').isIterable = function (it) {\n var O = Object(it);\n return O[ITERATOR] !== undefined\n || '@@iterator' in O\n // eslint-disable-next-line no-prototype-builtins\n || Iterators.hasOwnProperty(classof(O));\n};\n","require('../modules/web.dom.iterable');\nrequire('../modules/es6.string.iterator');\nmodule.exports = require('../modules/core.is-iterable');\n","module.exports = { \"default\": require(\"core-js/library/fn/is-iterable\"), __esModule: true };","var anObject = require('./_an-object');\nvar get = require('./core.get-iterator-method');\nmodule.exports = require('./_core').getIterator = function (it) {\n var iterFn = get(it);\n if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');\n return anObject(iterFn.call(it));\n};\n","require('../modules/web.dom.iterable');\nrequire('../modules/es6.string.iterator');\nmodule.exports = require('../modules/core.get-iterator');\n","module.exports = { \"default\": require(\"core-js/library/fn/get-iterator\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _isIterable2 = require(\"../core-js/is-iterable\");\n\nvar _isIterable3 = _interopRequireDefault(_isIterable2);\n\nvar _getIterator2 = require(\"../core-js/get-iterator\");\n\nvar _getIterator3 = _interopRequireDefault(_getIterator2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if ((0, _isIterable3.default)(Object(arr))) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","require('../../modules/es6.array.find');\nmodule.exports = require('../../modules/_core').Array.find;\n","module.exports = { \"default\": require(\"core-js/library/fn/array/find\"), __esModule: true };","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\nmodule.exports = addMapEntry;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","var addMapEntry = require('./_addMapEntry'),\n arrayReduce = require('./_arrayReduce'),\n mapToArray = require('./_mapToArray');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\nmodule.exports = cloneMap;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\nmodule.exports = addSetEntry;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var addSetEntry = require('./_addSetEntry'),\n arrayReduce = require('./_arrayReduce'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\nmodule.exports = cloneSet;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneMap = require('./_cloneMap'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSet = require('./_cloneSet'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isObject = require('./isObject'),\n keys = require('./keys');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(){\n \"use strict\";\n\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n // Use a lookup table to find the index.\n var lookup = new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n\n exports.encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i, len = bytes.length, base64 = \"\";\n\n for (i = 0; i < len; i+=3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if ((len % 3) === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n\n return base64;\n };\n\n exports.decode = function(base64) {\n var bufferLength = base64.length * 0.75,\n len = base64.length, i, p = 0,\n encoded1, encoded2, encoded3, encoded4;\n\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n\n var arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i+=4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i+1)];\n encoded3 = lookup[base64.charCodeAt(i+2)];\n encoded4 = lookup[base64.charCodeAt(i+3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n };\n})();\n","import d from 'debug';\nimport { tap } from './utils';\n\nconst debug = d('LC:SignatureFactoryRunner');\n\nfunction _validateSignature(signatureResult = {}) {\n const {\n signature,\n timestamp,\n nonce,\n } = signatureResult;\n if (typeof signature !== 'string'\n || typeof timestamp !== 'number'\n || typeof nonce !== 'string') {\n throw new Error('malformed signature');\n }\n return {\n signature,\n timestamp,\n nonce,\n };\n}\n\nexport default (signatureFactory, params) =>\n Promise.resolve()\n .then(() => {\n debug('call signatureFactory with %O', params);\n return signatureFactory(...params);\n })\n .then(\n tap(signatureResult => debug('sign result %O', signatureResult)),\n (error) => {\n // eslint-disable-next-line no-param-reassign\n error.message = `sign error: ${error.message}`;\n debug(error);\n throw error;\n },\n )\n .then(_validateSignature);\n","import uuid from 'uuid/v4';\nimport { ensureArray } from '../utils';\n\n\n/**\n * 消息状态枚举\n * @enum {Symbol}\n * @since 3.2.0\n * @memberof module:leancloud-realtime\n */\nconst MessageStatus = {\n /** 初始状态、未知状态 */\n NONE: Symbol('none'),\n /** 正在发送 */\n SENDING: Symbol('sending'),\n /** 已发送 */\n SENT: Symbol('sent'),\n /** 已送达 */\n DELIVERED: Symbol('delivered'),\n /** 发送失败 */\n FAILED: Symbol('failed'),\n};\nObject.freeze(MessageStatus);\n\nconst rMessageStatus = {\n [MessageStatus.NONE]: true,\n [MessageStatus.SENDING]: true,\n [MessageStatus.SENT]: true,\n [MessageStatus.DELIVERED]: true,\n [MessageStatus.READ]: true,\n [MessageStatus.FAILED]: true,\n};\n\nexport { MessageStatus };\nexport default class Message {\n /**\n * @implements AVMessage\n * @param {Object|String|ArrayBuffer} content 消息内容\n */\n constructor(content) {\n Object.assign(this, { content }, {\n /**\n * @type {String}\n * @memberof Message#\n */\n id: uuid(),\n /**\n * 消息所在的 conversation id\n * @memberof Message#\n * @type {String?}\n */\n cid: null,\n /**\n * 消息发送时间\n * @memberof Message#\n * @type {Date}\n */\n timestamp: new Date(),\n /**\n * 消息发送者\n * @memberof Message#\n * @type {String}\n */\n from: undefined,\n /**\n * @var deliveredAt {?Date} 消息送达时间\n * @memberof Message#\n */\n // deliveredAt,\n /**\n * 消息提及的用户\n * @since 4.0.0\n * @memberof Message#\n * @type {String[]}\n */\n mentionList: [],\n /**\n * 消息是否提及了所有人\n * @since 4.0.0\n * @memberof Message#\n * @type {Boolean}\n */\n mentionedAll: false,\n _mentioned: false,\n });\n this._setStatus(MessageStatus.NONE);\n }\n\n /**\n * 将当前消息序列化为 JSON 对象\n * @protected\n * @return {Object}\n */\n toJSON() {\n return this.content;\n }\n\n /**\n * 消息状态,值为 {@link module:leancloud-realtime.MessageStatus} 之一\n * @type {Symbol}\n * @readonly\n * @since 3.2.0\n */\n get status() {\n return this._status;\n }\n\n _setStatus(status) {\n if (!rMessageStatus[status]) {\n throw new Error('Invalid message status');\n }\n this._status = status;\n }\n\n /**\n * 消息修改或撤回时间,可以通过比较其与消息的 timestamp 是否相等判断消息是否被修改过或撤回过。\n * @type {Date}\n * @since 3.5.0\n */\n get updatedAt() {\n return this._updatedAt || this.timestamp;\n }\n set updatedAt(value) {\n this._updatedAt = value;\n }\n\n /**\n * 当前用户是否在该消息中被提及\n * @type {Boolean}\n * @readonly\n * @since 4.0.0\n */\n get mentioned() {\n return this._mentioned;\n }\n _updateMentioned(client) {\n this._mentioned =\n this.from !== client &&\n (this.mentionedAll || this.mentionList.indexOf(client) > -1);\n }\n /**\n * 获取提及用户列表\n * @since 4.0.0\n * @return {String[]} 提及用户的 id 列表\n */\n getMentionList() {\n return this.mentionList;\n }\n /**\n * 设置提及用户列表\n * @since 4.0.0\n * @param {String[]} clients 提及用户的 id 列表\n * @return {Message} self\n */\n setMentionList(clients) {\n this.mentionList = ensureArray(clients);\n return this;\n }\n /**\n * 设置是否提及所有人\n * @since 4.0.0\n * @param {Boolean} [value=true]\n * @return {Messaeg} self\n */\n mentionAll(value = true) {\n this.mentionedAll = Boolean(value);\n return this;\n }\n\n /**\n * 判断给定的内容是否是有效的 Message,\n * 该方法始终返回 true\n * @protected\n * @returns {Boolean}\n * @implements AVMessage.validate\n */\n static validate() {\n return true;\n }\n\n /**\n * 解析处理消息内容\n *

\n   * 如果子类提供了 message,返回该 message\n   * 如果没有提供,将 json 作为 content 实例化一个 Message\n   * @protected\n   * @param  {Object}  json    json 格式的消息内容\n   * @param  {Message} message 子类提供的 message\n   * @return {Message}\n   * @implements AVMessage.parse\n   */\n  static parse(json, message) {\n    return message || new this(json);\n  }\n}\n","/* eslint-disable no-param-reassign */\nimport { getStaticProperty, isIE10 } from '../utils';\n\n// documented in ../index.js\nexport const messageType = (type) => {\n  if (typeof type !== 'number') {\n    throw new TypeError(`${type} is not a Number`);\n  }\n  return (target) => {\n    target.TYPE = type;\n    target.validate = json => (json._lctype === type);\n    target.prototype._getType = () => ({ _lctype: type });\n  };\n};\n\n// documented in ../index.js\nexport const messageField = (fields) => {\n  if (typeof fields !== 'string') {\n    if (!Array.isArray(fields)) {\n      throw new TypeError(`${fields} is not an Array`);\n    } else if (fields.some(value => typeof value !== 'string')) {\n      throw new TypeError('fields contains non-string typed member');\n    }\n  }\n  return (target) => {\n    // IE10 Hack:\n    // static properties in IE10 will not be inherited from super\n    // search for parse method and assign it manually\n    let originalCustomFields = isIE10\n      ? getStaticProperty(target, '_customFields')\n      : target._customFields;\n    originalCustomFields = Array.isArray(originalCustomFields)\n      ? originalCustomFields : [];\n    target._customFields = originalCustomFields.concat(fields);\n  };\n};\n\n// IE10 Hack:\n// static properties in IE10 will not be inherited from super\n// search for parse method and assign it manually\n\nexport const IE10Compatible = (target) => {\n  if (isIE10) {\n    target.parse = getStaticProperty(target, 'parse');\n  }\n};\n","import Message from './message';\nimport { messageField } from './helpers';\nimport { getStaticProperty, isIE10 } from '../utils';\n\n// jsdoc-ignore-start\n@messageField(['_lctext', '_lcattrs'])\n// jsdoc-ignore-end\nexport default class TypedMessage extends Message {\n  /**\n   * 所有内置的富媒体消息均继承自本类\n   * @extends Message\n   */\n  constructor() {\n    super();\n    this._ = {};\n  }\n\n  /**\n   * @type {Number}\n   * @readonly\n   */\n  get type() {\n    return this.constructor.TYPE;\n  }\n\n  /** @type {String} */\n  set text(text) {\n    return this.setText(text);\n  }\n  get text() {\n    return this.getText();\n  }\n\n  /** @type {Object} */\n  set attributes(attributes) {\n    return this.setAttributes(attributes);\n  }\n  get attributes() {\n    return this.getAttributes();\n  }\n\n  /**\n   * 在客户端需要以文本形式展示该消息时显示的文案,\n   * 如 [红包] 新春快乐。\n   * 默认值为消息的 text。\n   * @type {String}\n   * @readonly\n   */\n  get summary() {\n    return this.text;\n  }\n\n  /**\n   * @param {String} text\n   * @return {TypedMessage} self\n   */\n  setText(text) {\n    this._lctext = text;\n    return this;\n  }\n  /**\n   * @return {String}\n   */\n  getText() {\n    return this._lctext;\n  }\n\n  /**\n   * @param {Object} attributes\n   * @return {TypedMessage} self\n   */\n  setAttributes(attributes) {\n    this._lcattrs = attributes;\n    return this;\n  }\n  /**\n   * @return {Object}\n   */\n  getAttributes() {\n    return this._lcattrs;\n  }\n\n  _getCustomFields() {\n    const fields = Array.isArray(this.constructor._customFields)\n      ? this.constructor._customFields : [];\n    return fields.reduce((result, field) => {\n      if (typeof field !== 'string') return result;\n      result[field] = this[field]; // eslint-disable-line no-param-reassign\n      return result;\n    }, {});\n  }\n\n  /* eslint-disable class-methods-use-this */\n  _getType() {\n    throw new Error('not implemented');\n  }\n  /* eslint-enable class-methods-use-this */\n\n  toJSON() {\n    return Object.assign({\n      _lctext: this.getText(),\n      _lcattrs: this.getAttributes(),\n    }, this._getCustomFields(), this._getType());\n  }\n\n  /**\n   * 解析处理消息内容\n   * 
\n   * 为给定的 message 设置 text 与 attributes 属性,返回该 message\n   * 如果子类没有提供 message,new this()\n   * @protected\n   * @param  {Object}  json    json 格式的消息内容\n   * @param  {TypedMessage} message 子类提供的 message\n   * @return {TypedMessage}\n   * @implements AVMessage.parse\n   */\n  static parse(json, message = new this()) {\n    message.content = json; // eslint-disable-line no-param-reassign\n    const customFields = isIE10\n      ? getStaticProperty(message.constructor, '_customFields')\n      : message.constructor._customFields;\n    let fields = Array.isArray(customFields) ? customFields : [];\n    fields = fields.reduce((result, field) => {\n      if (typeof field !== 'string') return result;\n      result[field] = json[field]; // eslint-disable-line no-param-reassign\n      return result;\n    }, {});\n    Object.assign(message, fields);\n    return super.parse(json, message);\n  }\n}\n","import TypedMessage from './typed-message';\nimport { messageType } from './helpers';\n\n// jsdoc-ignore-start\n@messageType(-127)\n// jsdoc-ignore-end\n/**\n * 已撤回类型消息,当消息被撤回时,SDK 会使用该类型的消息替代原始消息\n * @extends TypedMessage\n */\nclass RecalledMessage extends TypedMessage {\n  /**\n   * 在客户端需要以文本形式展示该消息时显示的文案,值为 [该消息已撤回]\n   * @type {String}\n   * @readonly\n   */\n  // eslint-disable-next-line class-methods-use-this\n  get summary() {\n    return '[该消息已撤回]';\n  }\n}\nexport default RecalledMessage;\n","import EventEmitter from 'eventemitter3';\nimport isEmpty from 'lodash/isEmpty';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { decode as decodeBase64 } from 'base64-arraybuffer';\nimport d from 'debug';\nimport { decodeDate, keyRemap, union, difference, internal, setValue } from './utils';\nimport { applyDecorators } from './plugin';\nimport IMClient from './im-client';\nimport {\n  GenericCommand,\n  ConvCommand,\n  JsonObjectMessage,\n  DirectCommand,\n  LogsCommand,\n  PatchCommand,\n  PatchItem,\n  CommandType,\n  OpType,\n} from '../proto/message';\nimport runSignatureFactory from './signature-factory-runner';\nimport { createError } from './error';\nimport Message, { MessageStatus } from './messages/message';\nimport RecalledMessage from './messages/recalled-message';\n\nconst debug = d('LC:Conversation');\n\nconst serializeMessage = (message) => {\n  const content = message.toJSON();\n  let msg;\n  let binaryMsg;\n  if (content instanceof ArrayBuffer) {\n    binaryMsg = content;\n  } else if (typeof content !== 'string') {\n    msg = JSON.stringify(content);\n  } else {\n    msg = content;\n  }\n  return { msg, binaryMsg };\n};\n\nconst {\n  NEW,\n  OLD,\n} = LogsCommand.QueryDirection;\n\n/**\n * 历史消息查询方向枚举\n * @enum {Number}\n * @since 4.0.0\n * @memberof module:leancloud-realtime\n */\nconst MessageQueryDirection = {\n  /** 从后向前 */\n  NEW_TO_OLD: OLD,\n  /** 从前向后 */\n  OLD_TO_NEW: NEW,\n};\nObject.freeze(MessageQueryDirection);\n\nexport { MessageQueryDirection };\n\nexport default class Conversation extends EventEmitter {\n  /**\n   * 无法直接实例化,请使用 {@link IMClient#createConversation} 创建新的对话\n   * @extends EventEmitter\n   */\n  constructor({\n    id,\n    creator,\n    createdAt,\n    updatedAt,\n    lastMessageAt,\n    lastMessage,\n    mutedMembers = [],\n    members = [],\n    transient = false,\n    system = false,\n    muted = false,\n    mentioned = false,\n    // jsdoc-ignore-start\n    ...attributes\n    // jsdoc-ignore-end\n  }, client) {\n    super();\n    Object.assign(this, {\n      /**\n       * 对话 id,对应 _Conversation 表中的 objectId\n       * @memberof Conversation#\n       * @type {String}\n       */\n      id,\n      /**\n       * 对话创建者\n       * @memberof Conversation#\n       * @type {String}\n       */\n      creator,\n      /**\n       * 对话创建时间\n       * @memberof Conversation#\n       * @type {Date}\n       */\n      createdAt,\n      /**\n       * 对话更新时间\n       * @memberof Conversation#\n       * @type {Date}\n       */\n      updatedAt,\n      /**\n       * 最后一条消息时间\n       * @memberof Conversation#\n       * @type {?Date}\n       */\n      lastMessageAt,\n      /**\n       * 最后一条消息\n       * @memberof Conversation#\n       * @type {?Message}\n       */\n      lastMessage,\n      /**\n       * 对该对话设置了静音的用户列表\n       * @memberof Conversation#\n       * @type {?String[]}\n       */\n      mutedMembers,\n      /**\n       * 参与该对话的用户列表\n       * @memberof Conversation#\n       * @type {String[]}\n       */\n      members,\n      /**\n       * 暂态对话标记\n       * @memberof Conversation#\n       * @type {Boolean}\n       */\n      transient,\n      /**\n       * 系统对话标记\n       * @memberof Conversation#\n       * @type {Boolean}\n       * @since 3.3.0\n       */\n      system,\n      /**\n       * 当前用户静音该对话标记\n       * @memberof Conversation#\n       * @type {Boolean}\n       */\n      muted,\n    });\n    this._attributes = attributes;\n    this._reset();\n    this.members = Array.from(new Set(this.members));\n    Object.assign(internal(this), {\n      messagesWaitingForReceipt: {},\n      lastDeliveredAt: null,\n      lastReadAt: null,\n      unreadMessagesCount: 0,\n      mentioned,\n    });\n    if (client instanceof IMClient) {\n      this._client = client;\n    } else {\n      throw new TypeError('Conversation must be initialized with a client');\n    }\n    [\n      'kicked',\n      'membersjoined',\n      'membersleft',\n      'message',\n      'receipt',\n      'lastdeliveredatupdate',\n      'lastreadatupdate',\n      'messagerecall',\n      'messageupdate',\n    ].forEach(event => this.on(\n      event,\n      (...payload) => this._debug(`${event} event emitted. %O`, payload),\n    ));\n    // onConversationCreate hook\n    applyDecorators(this._client._plugins.onConversationCreate, this);\n  }\n\n  /**\n   * 当前用户是否在该对话中被提及\n   * @type {Boolean}\n   * @since 4.0.0\n   */\n  get mentioned() {\n    return internal(this).mentioned;\n  }\n  _setMentioned(value) {\n    internal(this).mentioned = Boolean(value);\n  }\n\n  set unreadMessagesCount(value) {\n    if (value !== this.unreadMessagesCount) {\n      internal(this).unreadMessagesCount = value;\n      this._client.emit('unreadmessagescountupdate', [this]);\n    }\n  }\n  /**\n   * 当前用户在该对话的未读消息数\n   * @type {Number}\n   */\n  get unreadMessagesCount() {\n    return internal(this).unreadMessagesCount;\n  }\n\n  set createdAt(value) {\n    this._createdAt = decodeDate(value);\n  }\n  get createdAt() {\n    return this._createdAt;\n  }\n  set updatedAt(value) {\n    this._updatedAt = decodeDate(value);\n  }\n  get updatedAt() {\n    return this._updatedAt;\n  }\n  set lastMessageAt(value) {\n    const time = decodeDate(value);\n    if (time <= this._lastMessageAt) return;\n    this._lastMessageAt = time;\n  }\n  get lastMessageAt() {\n    return this._lastMessageAt;\n  }\n  /**\n   * 最后消息送达时间,常用来实现消息的「已送达」标记,可通过 {@link Conversation#fetchReceiptTimestamps} 获取或更新该属性\n   * @type {?Date}\n   * @since 3.4.0\n   */\n  get lastDeliveredAt() {\n    if (this.members.length !== 2) return null;\n    return internal(this).lastDeliveredAt;\n  }\n  _setLastDeliveredAt(value) {\n    const date = decodeDate(value);\n    if (!(date < internal(this).lastDeliveredAt)) {\n      internal(this).lastDeliveredAt = date;\n      /**\n       * 最后消息送达时间更新\n       * @event Conversation#lastdeliveredatupdate\n       * @since 3.4.0\n       */\n      this.emit('lastdeliveredatupdate');\n    }\n  }\n  /**\n   * 最后消息被阅读时间,常用来实现发送消息的「已读」标记,可通过 {@link Conversation#fetchReceiptTimestamps} 获取或更新该属性\n   * @type {?Date}\n   * @since 3.4.0\n   */\n  get lastReadAt() {\n    if (this.members.length !== 2) return null;\n    return internal(this).lastReadAt;\n  }\n  _setLastReadAt(value) {\n    const date = decodeDate(value);\n    if (!(date < internal(this).lastReadAt)) {\n      internal(this).lastReadAt = date;\n      /**\n       * 最后消息被阅读时间更新\n       * @event Conversation#lastreadatupdate\n       * @since 3.4.0\n       */\n      this.emit('lastreadatupdate');\n    }\n  }\n\n  /**\n   * 对话名字,对应 _Conversation 表中的 name\n   * @type {String}\n   */\n  get name() {\n    return this.get('name');\n  }\n  set name(value) {\n    this.set('name', value);\n  }\n\n  /**\n   * 获取对话的自定义属性\n   * @since 3.2.0\n   * @param  {String} key key 属性的键名,'x' 对应 Conversation 表中的 x 列\n   * @return {Any} 属性的值\n   */\n  get(key) {\n    return internal(this).currentAttributes[key];\n  }\n\n  /**\n   * 设置对话的自定义属性\n   * @since 3.2.0\n   * @param {String} key 属性的键名,'x' 对应 Conversation 表中的 x 列,支持使用 'x.y.z' 来修改对象的部分字段。\n   * @param {Any} value 属性的值\n   * @return {Conversation} self\n   * @example\n   *\n   * // 设置对话的 color 属性\n   * conversation.set('color', {\n   *   text: '#000',\n   *   background: '#DDD',\n   * });\n   * // 设置对话的 color.text 属性\n   * conversation.set('color.text', '#333');\n   */\n  set(key, value) {\n    this._debug(`set [${key}]: ${value}`);\n    const pendingAttributes = internal(this).pendingAttributes;\n    const pendingKeys = Object.keys(pendingAttributes);\n    // suppose pendingAttributes = { 'a.b': {} }\n    // set 'a' or 'a.b': delete 'a.b'\n    const re = new RegExp(`^${key}`);\n    const childKeys = pendingKeys.filter(re.test.bind(re));\n    childKeys.forEach((k) => {\n      delete pendingAttributes[k];\n    });\n    if (childKeys.length) {\n      pendingAttributes[key] = value;\n    } else {\n      // set 'a.c': nothing to do\n      // set 'a.b.c.d': assign c: { d: {} } to 'a.b'\n      // CAUTION: non-standard API, provided by core-js\n      const parentKey = Array.find(pendingKeys, k => key.indexOf(k) === 0); // 'a.b'\n      if (parentKey) {\n        setValue(pendingAttributes[parentKey], key.slice(parentKey.length + 1), value);\n      } else {\n        pendingAttributes[key] = value;\n      }\n    }\n    // build currentAttributes\n    internal(this).currentAttributes = Object.keys(pendingAttributes)\n      .reduce(\n        (target, k) => setValue(target, k, pendingAttributes[k]),\n        cloneDeep(this._attributes),\n      );\n    return this;\n  }\n\n  _reset() {\n    internal(this).pendingAttributes = {};\n    internal(this).currentAttributes = this._attributes;\n  }\n\n  _debug(...params) {\n    debug(...params, `[${this.id}]`);\n  }\n\n  _send(command, ...args) {\n    /* eslint-disable no-param-reassign */\n    if (command.cmd === null) {\n      command.cmd = 'conv';\n    }\n    if (command.cmd === 'conv' && command.convMessage === null) {\n      command.convMessage = new ConvCommand();\n    }\n    if (command.convMessage && command.convMessage.cid === null) {\n      command.convMessage.cid = this.id;\n    }\n    /* eslint-enable no-param-reassign */\n    return this._client._send(command, ...args);\n  }\n  /**\n   * 保存当前对话的属性至服务器\n   * @return {Promise.} self\n   */\n  async save() {\n    this._debug('save');\n    const attr = internal(this).pendingAttributes;\n    if (isEmpty(attr)) {\n      this._debug('nothing touched, resolve with self');\n      return this;\n    }\n    this._debug('attr: %O', attr);\n    const convMessage = new ConvCommand({\n      attr: new JsonObjectMessage({\n        data: JSON.stringify(attr),\n      }),\n    });\n    const resCommand = await this._send(new GenericCommand({\n      op: 'update',\n      convMessage,\n    }));\n    this.updatedAt = resCommand.convMessage.udate;\n    this._attributes = internal(this).currentAttributes;\n    internal(this).pendingAttributes = {};\n    return this;\n  }\n\n  /**\n   * 从服务器更新对话的属性\n   * @return {Promise.} self\n   */\n  async fetch() {\n    const query = this._client.getQuery().equalTo('objectId', this.id);\n    await query.find();\n    return this;\n  }\n\n  /**\n   * 静音,客户端拒绝收到服务器端的离线推送通知\n   * @return {Promise.} self\n   */\n  async mute() {\n    this._debug('mute');\n    await this._send(new GenericCommand({\n      op: 'mute',\n    }));\n    if (!this.transient) {\n      this.muted = true;\n      this.mutedMembers = union(this.mutedMembers, [this._client.id]);\n    }\n    return this;\n  }\n\n  /**\n   * 取消静音\n   * @return {Promise.} self\n   */\n  async unmute() {\n    this._debug('unmute');\n    await this._send(new GenericCommand({\n      op: 'unmute',\n    }));\n    if (!this.transient) {\n      this.muted = false;\n      this.mutedMembers = difference(this.mutedMembers, [this._client.id]);\n    }\n    return this;\n  }\n\n  /**\n   * 获取对话人数,或暂态对话的在线人数\n   * @return {Promise.}\n   */\n  async count() {\n    this._debug('unmute');\n    const resCommand = await this._send(new GenericCommand({\n      op: 'count',\n    }));\n    return resCommand.convMessage.count;\n  }\n\n  /**\n   * 增加成员\n   * @param {String|String[]} clientIds 新增成员 client id\n   * @return {Promise.} self\n   */\n  async add(clientIds) {\n    this._debug('add', clientIds);\n    if (typeof clientIds === 'string') {\n      clientIds = [clientIds]; // eslint-disable-line no-param-reassign\n    }\n    const convMessage = new ConvCommand({\n      m: clientIds,\n    });\n    const command = new GenericCommand({\n      op: 'add',\n      convMessage,\n    });\n    if (this._client.options.conversationSignatureFactory) {\n      const params = [this.id, this._client.id, clientIds.sort(), 'add'];\n      const signatureResult = await runSignatureFactory(\n        this._client.options.conversationSignatureFactory, params,\n      );\n      Object.assign(command.convMessage, keyRemap({\n        signature: 's',\n        timestamp: 't',\n        nonce: 'n',\n      }, signatureResult));\n    }\n    await this._send(command);\n    if (!this.transient && !this.system) {\n      this.members = union(this.members, clientIds);\n    }\n    return this;\n  }\n\n  /**\n   * 剔除成员\n   * @param {String|String[]} clientIds 成员 client id\n   * @return {Promise.} self\n   */\n  async remove(clientIds) {\n    this._debug('remove', clientIds);\n    if (typeof clientIds === 'string') {\n      clientIds = [clientIds]; // eslint-disable-line no-param-reassign\n    }\n    const convMessage = new ConvCommand({\n      m: clientIds,\n    });\n    const command = new GenericCommand({\n      op: 'remove',\n      convMessage,\n    });\n    if (this._client.options.conversationSignatureFactory) {\n      const params = [this.id, this._client.id, clientIds.sort(), 'remove'];\n      const signatureResult = await runSignatureFactory(\n        this._client.options.conversationSignatureFactory, params,\n      );\n      Object.assign(command.convMessage, keyRemap({\n        signature: 's',\n        timestamp: 't',\n        nonce: 'n',\n      }, signatureResult));\n    }\n    await this._send(command);\n    if (!this.transient && !this.system) {\n      this.members = difference(this.members, clientIds);\n    }\n    return this;\n  }\n\n  /**\n   * (当前用户)加入该对话\n   * @return {Promise.} self\n   */\n  async join() {\n    this._debug('join');\n    return this.add(this._client.id);\n  }\n\n  /**\n   * (当前用户)退出该对话\n   * @return {Promise.} self\n   */\n  async quit() {\n    this._debug('quit');\n    return this.remove(this._client.id);\n  }\n\n  /**\n   * 发送消息\n   * @param  {Message} message 消息,Message 及其子类的实例\n   * @param {Object} [options] since v3.3.0,发送选项\n   * @param {Boolean} [options.transient] since v3.3.1,是否作为暂态消息发送\n   * @param {Boolean} [options.receipt] 是否需要回执,仅在普通对话中有效\n   * @param {Boolean} [options.will] since v3.4.0,是否指定该消息作为「掉线消息」发送,\n   * 「掉线消息」会延迟到当前用户掉线后发送,常用来实现「下线通知」功能\n   * @param {MessagePriority} [options.priority] 消息优先级,仅在暂态对话中有效,\n   * see: {@link module:leancloud-realtime.MessagePriority MessagePriority}\n   * @param {Object} [options.pushData] 消息对应的离线推送内容,如果消息接收方不在线,会推送指定的内容。其结构说明参见: {@link https://url.leanapp.cn/pushData 推送消息内容}\n   * @return {Promise.} 发送的消息\n   */\n  async send(message, options) {\n    this._debug(message, 'send');\n    if (!(message instanceof Message)) {\n      throw new TypeError(`${message} is not a Message`);\n    }\n    const {\n      transient,\n      receipt,\n      priority,\n      pushData,\n      will,\n    } = Object.assign(\n      {},\n      // support Message static property: sendOptions\n      message.constructor.sendOptions,\n      // support Message static property: getSendOptions\n      typeof message.constructor.getSendOptions === 'function' ? message.constructor.getSendOptions(message) : {},\n      options,\n    );\n    if (receipt) {\n      if (this.transient) {\n        console.warn('receipt option is ignored as the conversation is transient.');\n      } else if (transient) {\n        console.warn('receipt option is ignored as the message is sent transiently.');\n      } else if (this.members.length > 2) {\n        console.warn('receipt option is recommended to be used in one-on-one conversation.'); // eslint-disable-line max-len\n      }\n    }\n    if (priority && !this.transient) {\n      console.warn('priority option is ignored as the conversation is not transient.');\n    }\n    Object.assign(message, {\n      cid: this.id,\n      from: this._client.id,\n    });\n    message._setStatus(MessageStatus.SENDING);\n    const { msg, binaryMsg } = serializeMessage(message);\n    const command = new GenericCommand({\n      cmd: 'direct',\n      directMessage: new DirectCommand({\n        msg,\n        binaryMsg,\n        cid: this.id,\n        r: receipt,\n        transient,\n        dt: message.id,\n        pushData: JSON.stringify(pushData),\n        will,\n        mentionPids: message.mentionList,\n        mentionAll: message.mentionedAll,\n      }),\n      priority,\n    });\n    try {\n      const resCommand = await this._send(command, !transient);\n      if (!transient) {\n        const {\n          ackMessage: {\n            uid,\n            t,\n            code,\n            reason,\n            appCode,\n          },\n        } = resCommand;\n        if (code !== null) {\n          throw createError({\n            code, reason, appCode,\n          });\n        }\n        Object.assign(message, {\n          id: uid,\n          timestamp: new Date(t.toNumber()),\n        });\n        this.lastMessage = message;\n        this.lastMessageAt = message.timestamp;\n      }\n      message._setStatus(MessageStatus.SENT);\n      if (receipt) {\n        internal(this).messagesWaitingForReceipt[message.id] = message;\n      }\n      return message;\n    } catch (error) {\n      message._setStatus(MessageStatus.FAILED);\n      throw error;\n    }\n  }\n\n  async _update(message, newMessage, recall) {\n    this._debug('patch %O %O %O', message, newMessage, recall);\n    if (message instanceof Message) {\n      if (message.from !== this._client.id) {\n        throw new Error('Updating message from others is not allowed');\n      }\n      if (message.status !== MessageStatus.SENT && message.status !== MessageStatus.DELIVERED) {\n        throw new Error('Message is not sent');\n      }\n    } else if (!(message.id && message.timestamp)) {\n      throw new TypeError(`${message} is not a Message`);\n    }\n    let msg;\n    let binaryMsg;\n    if (!recall) {\n      const content = serializeMessage(newMessage);\n      msg = content.msg;\n      binaryMsg = content.binaryMsg;\n    }\n    await this._send(new GenericCommand({\n      cmd: CommandType.patch,\n      op: OpType.modify,\n      patchMessage: new PatchCommand({\n        patches: [new PatchItem({\n          cid: this.id,\n          mid: message.id,\n          timestamp: Number(message.timestamp),\n          recall,\n          data: msg,\n          binaryMsg,\n          mentionPids: newMessage.mentionList,\n          mentionAll: newMessage.mentionedAll,\n        })],\n        lastPatchTime: this._client._lastPatchTime,\n      }),\n    }));\n    const {\n      id, cid, timestamp, from, _status,\n    } = message;\n    Object.assign(newMessage, {\n      id, cid, timestamp, from, _status,\n    });\n    if (this.lastMessage.id === newMessage.id) {\n      this.lastMessage = newMessage;\n    }\n    return newMessage;\n  }\n\n  /**\n   * 修改已发送的消息\n   * @param {AVMessage} message 要修改的消息,该消息必须是由当前用户发送的。也可以提供一个包含消息 {id, timestamp} 的对象\n   * @param {AVMessage} newMessage 新的消息\n   */\n  async update(message, newMessage) {\n    if (!(newMessage instanceof Message)) {\n      throw new TypeError(`${newMessage} is not a Message`);\n    }\n    return this._update(message, newMessage, false);\n  }\n\n  /**\n   * 撤回已发送的消息\n   * @param {AVMessage} message 要撤回的消息,该消息必须是由当前用户发送的。也可以提供一个包含消息 {id, timestamp} 的对象\n   */\n  async recall(message) {\n    return this._update(message, new RecalledMessage(), true);\n  }\n\n  /**\n   * 查询消息记录\n   * 如果仅需实现消息向前记录翻页查询需求,建议使用 {@link Conversation#createMessagesIterator}。\n   * 不论何种方向,获得的消息都是按照时间升序排列的。\n   * startClosed 与 endClosed 用于指定查询区间的开闭。\n   * \n   * @param  {Object} [options]\n   * @param  {Number} [options.limit] 限制查询结果的数量,目前服务端默认为 20\n   * @param  {MessageQueryDirection} [options.direction] 查询的方向。\n   * 在不指定的情况下如果 startTime 大于 endTime,则为从新到旧查询,可以实现加载聊天记录等场景。\n   * 如果 startTime 小于 endTime,则为从旧到新查询,可以实现弹幕等场景。\n   * @param  {Date}   [options.startTime] 从该时间开始查询,不传则从当前时间开始查询\n   * @param  {String} [options.startMessageId] 从该消息之前开始查询,需要与 startTime 同时使用,为防止某时刻有重复消息\n   * @param  {Boolean}[options.startClosed] 指定查询范围是否包括开始的时间点,默认不包括\n   * @param  {Date}   [options.endTime] 查询到该时间为止,不传则查询最早消息为止\n   * @param  {String} [options.endMessageId] 查询到该消息为止,需要与 endTime 同时使用,为防止某时刻有重复消息\n   * @param  {Boolean}[options.endClosed] 指定查询范围是否包括结束的时间点,默认不包括\n   * \n   * @param  {Date}   [options.beforeTime] DEPRECATED: 使用 startTime 代替。限制查询结果为小于该时间之前的消息,不传则为当前时间\n   * @param  {String} [options.beforeMessageId] DEPRECATED: 使用 startMessageId 代替。\n   * 限制查询结果为该消息之前的消息,需要与 beforeTime 同时使用,为防止某时刻有重复消息\n   * @param  {Date}   [options.afterTime] DEPRECATED: 使用 endTime 代替。限制查询结果为大于该时间之前的消息\n   * @param  {String} [options.afterMessageId] DEPRECATED: 使用 endMessageId 代替。\n   * 限制查询结果为该消息之后的消息,需要与 afterTime 同时使用,为防止某时刻有重复消息\n   * @return {Promise.} 消息列表\n   */\n  async queryMessages(options = {}) {\n    this._debug('query messages %O', options);\n    const {\n      beforeTime,\n      beforeMessageId,\n      afterTime,\n      afterMessageId,\n      limit,\n      direction,\n      startTime,\n      startMessageId,\n      startClosed,\n      endTime,\n      endMessageId,\n      endClosed,\n    } = options;\n    if (beforeMessageId || beforeTime || afterMessageId || afterTime) {\n      console.log('DEPRECATION: queryMessages options beforeTime, beforeMessageId, afterTime and afterMessageId are deprecated in favor of startTime, startMessageId, endTime and endMessageId.');\n      return this.queryMessages({\n        startTime: beforeTime,\n        startMessageId: beforeMessageId,\n        endTime: afterTime,\n        endMessageId: afterMessageId,\n        limit,\n      });\n    }\n    if (startMessageId && !startTime) {\n      throw new Error('query option startMessageId must be used with option startTime');\n    }\n    if (endMessageId && !endTime) {\n      throw new Error('query option endMessageId must be used with option endTime');\n    }\n    const conditions = {\n      t: startTime,\n      mid: startMessageId,\n      tIncluded: startClosed,\n      tt: endTime,\n      tmid: endMessageId,\n      ttIncluded: endClosed,\n      l: limit,\n    };\n    if (conditions.t instanceof Date) {\n      conditions.t = conditions.t.getTime();\n    }\n    if (conditions.tt instanceof Date) {\n      conditions.tt = conditions.tt.getTime();\n    }\n    if (direction !== undefined) {\n      conditions.direction = direction;\n    } else if (conditions.tt > conditions.t) {\n      conditions.direction = MessageQueryDirection.OLD_TO_NEW;\n    }\n    const resCommand = await this._send(new GenericCommand({\n      cmd: 'logs',\n      logsMessage: new LogsCommand(\n        Object.assign(conditions, {\n          cid: this.id,\n        }),\n      ),\n    }));\n    return Promise.all(resCommand.logsMessage.logs.map(async ({\n      msgId,\n      timestamp,\n      patchTimestamp,\n      from,\n      ackAt,\n      readAt,\n      data,\n      mentionAll,\n      mentionPids,\n      bin,\n    }) => {\n      const content = bin ? decodeBase64(data) : data;\n      const message = await this._client._messageParser.parse(content);\n      const messageProps = {\n        id: msgId,\n        cid: this.id,\n        timestamp: new Date(timestamp.toNumber()),\n        from,\n        deliveredAt: ackAt,\n        mentionList: mentionPids,\n        mentionedAll: mentionAll,\n      };\n      if (patchTimestamp) {\n        messageProps.updatedAt = new Date(patchTimestamp.toNumber());\n      }\n      Object.assign(message, messageProps);\n      message._updateMentioned(this._client.id);\n      let status = MessageStatus.SENT;\n      if (this.members.length === 2) {\n        if (ackAt) status = MessageStatus.DELIVERED;\n        if (ackAt) this._setLastDeliveredAt(ackAt);\n        if (readAt) this._setLastReadAt(readAt);\n      }\n      message._setStatus(status);\n      return message;\n    }));\n  }\n\n  /**\n   * 获取消息翻页迭代器\n   * @param  {Object} [options]\n   * @param  {Date}   [options.beforeTime] 限制起始查询结果为小于该时间之前的消息,不传则为当前时间\n   * @param  {String} [options.beforeMessageId] 限制起始查询结果为该消息之前的消息,需要与 beforeTime 同时使用,为防止某时刻有重复消息\n   * @param  {Number} [options.limit] 限制每页查询结果的数量,目前服务端默认为 20\n   * @return {AsyncIterater.>>} [AsyncIterator]{@link https://github.com/tc39/proposal-async-iteration},调用其 next 方法返回获取下一页消息的 Promise\n   * @example\n   * var messageIterator = conversation.createMessagesIterator({ limit: 10 });\n   * messageIterator.next().then(function(result) {\n   *   // result: {\n   *   //   value: [message1, ..., message10],\n   *   //   done: false,\n   *   // }\n   * });\n   * messageIterator.next().then(function(result) {\n   *   // result: {\n   *   //   value: [message11, ..., message20],\n   *   //   done: false,\n   *   // }\n   * });\n   * messageIterator.next().then(function(result) {\n   *   // No more messages\n   *   // result: { value: [], done: true }\n   * });\n   */\n  createMessagesIterator({ beforeTime, beforeMessageId, limit } = {}) {\n    let promise;\n    return {\n      next: () => {\n        if (promise === undefined) {\n          // first call\n          promise = this.queryMessages({\n            limit,\n            startTime: beforeTime,\n            startMessageId: beforeMessageId,\n          });\n        } else {\n          promise = promise.then((prevMessages) => {\n            if (prevMessages.length === 0 || prevMessages.length < limit) {\n              // no more messages\n              return [];\n            }\n            return this.queryMessages({\n              startTime: prevMessages[0].timestamp,\n              startMessageId: prevMessages[0].id,\n              limit,\n            });\n          });\n        }\n        return promise.then(value => ({\n          value: Array.from(value),\n          done: value.length === 0 || value.length < limit,\n        }));\n      },\n    };\n  }\n\n  /**\n   * 将该会话标记为已读\n   * @return {Promise.} self\n   */\n  async read() {\n    this.unreadMessagesCount = 0;\n    this._setMentioned(false);\n    // 跳过暂态会话\n    if (this.transient) return this;\n    const client = this._client;\n    if (!internal(client).readConversationsBuffer) {\n      internal(client).readConversationsBuffer = new Set();\n    }\n    internal(client).readConversationsBuffer.add(this);\n    client._doSendRead();\n    return this;\n  }\n\n  _handleReceipt({ messageId, timestamp, read }) {\n    if (read) {\n      this._setLastReadAt(timestamp);\n    } else {\n      this._setLastDeliveredAt(timestamp);\n    }\n    const { messagesWaitingForReceipt } = internal(this);\n    const message = messagesWaitingForReceipt[messageId];\n    if (!message) return;\n    message._setStatus(MessageStatus.DELIVERED);\n    message.deliveredAt = timestamp;\n    delete messagesWaitingForReceipt[messageId];\n  }\n\n  /**\n   * 更新对话的最新回执时间戳(lastDeliveredAt、lastReadAt)\n   * @since 3.4.0\n   * @return {Promise.} this\n   */\n  async fetchReceiptTimestamps() {\n    const {\n      convMessage: {\n        maxReadTimestamp,\n        maxAckTimestamp,\n      },\n    } = await this._send(new GenericCommand({\n      op: 'max_read',\n    }));\n    this._setLastDeliveredAt(maxAckTimestamp);\n    this._setLastReadAt(maxReadTimestamp);\n    return this;\n  }\n\n  _fetchAllReceiptTimestamps() {\n    const convMessage = new ConvCommand({\n      queryAllMembers: true,\n    });\n    return this._send(new GenericCommand({\n      op: 'max_read',\n      convMessage,\n    })).then(({\n      convMessage: {\n        maxReadTuples,\n      },\n    }) => maxReadTuples\n      .filter(maxReadTuple => maxReadTuple.maxAckTimestamp || maxReadTuple.maxReadTimestamp)\n      .map(({ pid, maxAckTimestamp, maxReadTimestamp }) => ({\n        pid,\n        lastDeliveredAt: decodeDate(maxAckTimestamp),\n        lastReadAt: decodeDate(maxReadTimestamp),\n      })));\n  }\n}\n","import d from 'debug';\n\nconst debug = d('LC:ConversationQuery');\n\nexport default class ConversationQuery {\n  static _encode(value) {\n    if (value instanceof Date) {\n      return { __type: 'Date', iso: value.toJSON() };\n    }\n    if (value instanceof RegExp) {\n      return value.source;\n    }\n    return value;\n  }\n\n  static _quote(s) {\n    return `\\\\Q${s.replace('\\\\E', '\\\\E\\\\\\\\E\\\\Q')}\\\\E`;\n  }\n\n  static _calculateFlag(options) {\n    return [\n      'withLastMessagesRefreshed',\n      'compact',\n    ].reduce(\n      // eslint-disable-next-line no-bitwise\n      (prev, key) => (prev << 1) + (Boolean)(options[key]),\n      0,\n    );\n  }\n\n  /**\n   * Create a ConversationQuery\n   * @param  {IMClient} client\n   */\n  constructor(client) {\n    this._client = client;\n    this._where = {};\n    this._extraOptions = {};\n  }\n\n  _addCondition(key, condition, value) {\n    // Check if we already have a condition\n    if (!this._where[key]) {\n      this._where[key] = {};\n    }\n    this._where[key][condition] = this.constructor._encode(value);\n    return this;\n  }\n\n  toJSON() {\n    const json = {\n      where: this._where,\n      flag: this.constructor._calculateFlag(this._extraOptions),\n    };\n    if (typeof this._skip !== 'undefined') json.skip = this._skip;\n    if (typeof this._limit !== 'undefined') json.limit = this._limit;\n    if (typeof this._order !== 'undefined') json.sort = this._order;\n    debug(json);\n    return json;\n  }\n\n  /**\n   * 增加查询条件,指定聊天室的组员包含某些成员即可返回\n   * @param {string[]} peerIds - 成员 ID 列表\n   * @return {ConversationQuery} self\n   */\n  containsMembers(peerIds) {\n    return this.containsAll('m', peerIds);\n  }\n\n  /**\n   * 增加查询条件,指定聊天室的组员条件满足条件的才返回\n   *\n   * @param {string[]} - 成员 ID 列表\n   * @param {Boolean} includeSelf - 是否包含自己\n   * @return {ConversationQuery} self\n   */\n  withMembers(peerIds, includeSelf) {\n    const peerIdsSet = new Set(peerIds);\n    if (includeSelf) {\n      peerIdsSet.add(this._client.id);\n    }\n    this.sizeEqualTo('m', peerIdsSet.size);\n    return this.containsMembers(Array.from(peerIdsSet));\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段满足等于条件时即可返回\n   *\n   * @param {string} key\n   * @param value\n   * @return {ConversationQuery} self\n   */\n  equalTo(key, value) {\n    this._where[key] = this.constructor._encode(value);\n    return this;\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段满足小于条件时即可返回\n   * @param {string} key\n   * @param value\n   * @return {ConversationQuery} self\n   */\n  lessThan(key, value) {\n    return this._addCondition(key, '$lt', value);\n  }\n\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段满足小于等于条件时即可返回\n\n   * @param {string} key\n   * @param value\n   * @return {ConversationQuery} self\n   */\n  lessThanOrEqualTo(key, value) {\n    return this._addCondition(key, '$lte', value);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段满足大于条件时即可返回\n   *\n   * @param {string} key\n   * @param value\n   * @return {ConversationQuery} self\n   */\n\n  greaterThan(key, value) {\n    return this._addCondition(key, '$gt', value);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段满足大于等于条件时即可返回\n   *\n   * @param {string} key\n   * @param value\n   * @return {ConversationQuery} self\n   */\n\n  greaterThanOrEqualTo(key, value) {\n    return this._addCondition(key, '$gte', value);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段满足不等于条件时即可返回\n   *\n   * @param {string} key\n   * @param value\n   * @return {ConversationQuery} self\n   */\n  notEqualTo(key, value) {\n    return this._addCondition(key, '$ne', value);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 存在指定的字段时即可返回\n   *\n   * @since 3.5.0\n   * @param {string} key\n   * @return {ConversationQuery} self\n   */\n  exists(key) {\n    return this._addCondition(key, '$exists', true);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 不存在指定的字段时即可返回\n   *\n   * @since 3.5.0\n   * @param {string} key\n   * @return {ConversationQuery} self\n   */\n  doesNotExist(key) {\n    return this._addCondition(key, '$exists', false);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段对应的值包含在指定值中时即可返回\n   *\n   * @param {string} key\n   * @param values\n   * @return {ConversationQuery} self\n   */\n  containedIn(key, values) {\n    return this._addCondition(key, '$in', values);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段对应的值不包含在指定值中时即可返回\n   *\n   * @param {string} key\n   * @param values\n   * @return {ConversationQuery} self\n   */\n  notContainsIn(key, values) {\n    return this._addCondition(key, '$nin', values);\n  }\n  /**\n   * 增加查询条件,当conversation的属性中对应的字段中的元素包含所有的值才可返回\n   *\n   * @param {string} key\n   * @param values\n   * @return {ConversationQuery} self\n   */\n  containsAll(key, values) {\n    return this._addCondition(key, '$all', values);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段对应的值包含此字符串即可返回\n   *\n   * @param {string} key\n   * @param {string} subString\n   * @return {ConversationQuery} self\n   */\n  contains(key, subString) {\n    return this._addCondition(key, '$regex', ConversationQuery._quote(subString));\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段对应的值以此字符串起始即可返回\n   *\n   * @param {string} key\n   * @param {string} prefix\n   * @return {ConversationQuery} self\n   */\n  startsWith(key, prefix) {\n    return this._addCondition(key, '$regex', `^${ConversationQuery._quote(prefix)}`);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段对应的值以此字符串结束即可返回\n   *\n   * @param {string} key\n   * @param {string} suffix\n   * @return {ConversationQuery} self\n   */\n  endsWith(key, suffix) {\n    return this._addCondition(key, '$regex', `${ConversationQuery._quote(suffix)}$`);\n  }\n\n  /**\n   * 增加查询条件,当 conversation 的属性中对应的字段对应的值满足提供的正则表达式即可返回\n   *\n   * @param {string} key\n   * @param {RegExp} regex\n   * @return {ConversationQuery} self\n   */\n  matches(key, regex) {\n    this._addCondition(key, '$regex', regex);\n    // Javascript regex options support mig as inline options but store them\n    // as properties of the object. We support mi & should migrate them to\n    // modifiers\n    let _modifiers = '';\n    if (regex.ignoreCase) { _modifiers += 'i'; }\n    if (regex.multiline) { _modifiers += 'm'; }\n\n    if (_modifiers && _modifiers.length) {\n      this._addCondition(key, '$options', _modifiers);\n    }\n    return this;\n  }\n\n  /**\n   * 添加查询约束条件,查找 key 类型是数组,该数组的长度匹配提供的数值\n   *\n   * @param {string} key\n   * @param {Number} length\n   * @return {ConversationQuery} self\n   */\n  sizeEqualTo(key, length) {\n    return this._addCondition(key, '$size', length);\n  }\n\n  /**\n   * 设置返回集合的大小上限\n   *\n   * @param {Number} limit - 上限\n   * @return {ConversationQuery} self\n   */\n  limit(limit) {\n    this._limit = limit;\n    return this;\n  }\n\n  /**\n   * 设置返回集合的起始位置,一般用于分页\n   *\n   * @param {Number} skip - 起始位置跳过几个对象\n   * @return {ConversationQuery} self\n   */\n  skip(skip) {\n    this._skip = skip;\n    return this;\n  }\n\n  /**\n   * 设置返回集合按照指定key进行增序排列\n   *\n   * @param {string} key\n   * @return {ConversationQuery} self\n   */\n  ascending(key) {\n    this._order = key;\n    return this;\n  }\n\n  /**\n   * 设置返回集合按照指定key进行增序排列,如果已设置其他排序,原排序的优先级较高\n   *\n   * @param {string} key\n   * @return {ConversationQuery} self\n   */\n  addAscending(key) {\n    if (this._order) {\n      this._order += `,${key}`;\n    } else {\n      this._order = key;\n    }\n    return this;\n  }\n\n  /**\n   * 设置返回集合按照指定 key 进行降序排列\n   *\n   * @param {string} key\n   * @return {ConversationQuery} self\n   */\n  descending(key) {\n    this._order = `-${key}`;\n    return this;\n  }\n\n  /**\n   * 设置返回集合按照指定 key 进行降序排列,如果已设置其他排序,原排序的优先级较高\n   *\n   * @param {string} key\n   * @return {ConversationQuery} self\n   */\n  addDescending(key) {\n    if (this._order) {\n      this._order += `,-${key}`;\n    } else {\n      this._order = `-${key}`;\n    }\n    return this;\n  }\n\n  /**\n   * 设置返回的 conversations 刷新最后一条消息\n   * @param  {Boolean} [enabled=true]\n   * @return {ConversationQuery} self\n   */\n  withLastMessagesRefreshed(enabled = true) {\n    this._extraOptions.withLastMessagesRefreshed = enabled;\n    return this;\n  }\n\n  /**\n   * 设置返回的 conversations 为精简模式,即不含成员列表\n   * @param  {Boolean} [enabled=true]\n   * @return {ConversationQuery} self\n   */\n  compact(enabled = true) {\n    this._extraOptions.compact = enabled;\n    return this;\n  }\n\n  /**\n   * 执行查询\n   * @return {Promise.}\n   */\n  async find() {\n    return this._client._executeQuery(this);\n  }\n}\n","import EventEmitter from 'eventemitter3';\nimport d from 'debug';\nimport Conversation from './conversation';\nimport ConversationQuery from './conversation-query';\nimport {\n  GenericCommand,\n  SessionCommand,\n  ConvCommand,\n  AckCommand,\n  JsonObjectMessage,\n  ReadCommand,\n  ReadTuple,\n  CommandType,\n  OpType,\n} from '../proto/message';\nimport { ErrorCode, createError } from './error';\nimport { Expirable, Cache, keyRemap, union, difference, trim, internal, throttle } from './utils';\nimport { applyDecorators, applyDispatcher } from './plugin';\nimport runSignatureFactory from './signature-factory-runner';\nimport { MessageStatus } from './messages/message';\nimport { version as VERSION } from '../package.json';\n\nconst debug = d('LC:IMClient');\n\nexport default class IMClient extends EventEmitter {\n  /**\n   * 无法直接实例化,请使用 {@link Realtime#createIMClient} 创建新的 IMClient。\n   *\n   * @extends EventEmitter\n   * @param  {String} [id] 客户端 id\n   * @param  {Object} [options]\n   * @param  {Function} [options.signatureFactory] open session 时的签名方法 // TODO need details\n   * @param  {Function} [options.conversationSignatureFactory] 对话创建、增减成员操作时的签名方法\n   */\n  constructor(id, options = {}, connection, props) {\n    if (!(id === undefined || typeof id === 'string')) {\n      throw new TypeError(`Client id [${id}] is not a String`);\n    }\n    super();\n    Object.assign(this, {\n      /**\n       * @var id {String} 客户端 id\n       * @memberof IMClient#\n       */\n      id,\n      _connection: connection,\n      options,\n    }, props);\n\n    if (!this._messageParser) {\n      throw new Error('IMClient must be initialized with a MessageParser');\n    }\n    this._conversationCache = new Cache(`client:${this.id}`);\n    this._ackMessageBuffer = {};\n    internal(this).lastPatchTime = Date.now();\n    internal(this)._eventemitter = new EventEmitter();\n    [\n      'invited',\n      'kicked',\n      'membersjoined',\n      'membersleft',\n      'message',\n      'unreadmessages',\n      'unreadmessagescountupdate',\n      'close',\n      'conflict',\n      'unhandledmessage',\n      'reconnect',\n      'reconnecterror',\n    ].forEach(event => this.on(\n      event,\n      (...payload) => this._debug(`${event} event emitted. %O`, payload),\n    ));\n    // onIMClientCreate hook\n    applyDecorators(this._plugins.onIMClientCreate, this);\n  }\n\n  _debug(...params) {\n    debug(...params, `[${this.id}]`);\n  }\n\n  /**\n   * @override\n   * @private\n   */\n  async _dispatchCommand(command) {\n    this._debug(trim(command), 'received');\n    switch (command.cmd) {\n      case CommandType.conv:\n        return this._dispatchConvMessage(command);\n      case CommandType.direct:\n        return this._dispatchDirectMessage(command);\n      case CommandType.session:\n        return this._dispatchSessionMessage(command);\n      case CommandType.unread:\n        return this._dispatchUnreadMessage(command);\n      case CommandType.rcp:\n        return this._dispatchRcpMessage(command);\n      case CommandType.patch:\n        return this._dispatchPatchMessage(command);\n      default:\n        return this.emit('unhandledmessage', command);\n    }\n  }\n\n  async _dispatchSessionMessage(message) {\n    const {\n      sessionMessage: {\n        code, reason,\n      },\n    } = message;\n    switch (message.op) {\n      case OpType.closed: {\n        internal(this)._eventemitter.emit('close');\n        if (code === ErrorCode.SESSION_CONFLICT) {\n          /**\n           * 用户在其他客户端登录,当前客户端被服务端强行下线。详见文档「单点登录」章节。\n           * @event IMClient#conflict\n           */\n          return this.emit('conflict', {\n            reason,\n          });\n        }\n        /**\n         * 当前客户端被服务端强行下线\n         * @event IMClient#close\n         * @param {Object} payload\n         * @param {Number} payload.code 错误码\n         * @param {String} payload.reason 原因\n         */\n        return this.emit('close', {\n          code, reason,\n        });\n      }\n      default:\n        this.emit('unhandledmessage', message);\n        throw new Error('Unrecognized session command');\n    }\n  }\n\n  _dispatchUnreadMessage({\n    unreadMessage: {\n      convs,\n      notifTime,\n    },\n  }) {\n    internal(this).lastUnreadNotifTime = notifTime;\n    // ensure all converstions are cached\n    return this.getConversations(convs.map(conv => conv.cid)).then(() =>\n      // update conversations data\n      Promise.all(convs.map(({\n        cid,\n        unread,\n        mid,\n        timestamp: ts,\n        from,\n        data,\n        binaryMsg,\n        patchTimestamp,\n        mentioned,\n      }) => this.getConversation(cid).then((conversation) => {\n        // deleted conversation\n        if (!conversation) return null;\n        let timestamp;\n        if (ts) {\n          timestamp = new Date(ts.toNumber());\n          conversation.lastMessageAt = timestamp; // eslint-disable-line no-param-reassign\n        }\n        return (mid ? this._messageParser.parse(binaryMsg || data).then((message) => {\n          const messageProps = {\n            id: mid,\n            cid,\n            timestamp,\n            from,\n          };\n          if (patchTimestamp) {\n            messageProps.updatedAt = new Date(patchTimestamp.toNumber());\n          }\n          Object.assign(message, messageProps);\n          conversation.lastMessage = message; // eslint-disable-line no-param-reassign\n        }) : Promise.resolve()).then(() => {\n          conversation._setMentioned(mentioned);\n          const countNotUpdated = unread === internal(conversation).unreadMessagesCount;\n          if (countNotUpdated) return null; // to be filtered\n          // manipulate internal property directly to skip unreadmessagescountupdate event\n          internal(conversation).unreadMessagesCount = unread;\n          return conversation;\n        });\n      }),\n        // filter conversations without unread count update\n      )).then(conversations => conversations.filter(conversation => conversation)),\n    ).then((conversations) => {\n      if (conversations.length) {\n        /**\n         * 未读消息数目更新\n         * @event IMClient#unreadmessagescountupdate\n         * @since 3.4.0\n         * @param {Conversation[]} conversations 未读消息数目有更新的对话列表\n         */\n        this.emit('unreadmessagescountupdate', conversations);\n      }\n    });\n  }\n\n  async _dispatchRcpMessage(message) {\n    const {\n      rcpMessage,\n      rcpMessage: {\n        read,\n      },\n    } = message;\n    const conversationId = rcpMessage.cid;\n    const messageId = rcpMessage.id;\n    const timestamp = new Date(rcpMessage.t.toNumber());\n    const conversation = this._conversationCache.get(conversationId);\n    // conversation not cached means the client does not send the message\n    // during this session\n    if (!conversation) return;\n    conversation._handleReceipt({ messageId, timestamp, read });\n  }\n\n  _dispatchPatchMessage({\n    patchMessage: {\n      patches,\n    },\n  }) {\n    // ensure all converstions are cached\n    return this.getConversations(patches.map(patch => patch.cid)).then(() =>\n      Promise.all(patches.map(({\n        cid, mid, timestamp, recall, data, patchTimestamp, from, binaryMsg, mentionAll, mentionPids,\n      }) =>\n        this.getConversation(cid).then((conversation) => {\n          // deleted conversation\n          if (!conversation) return null;\n          return this._messageParser.parse(binaryMsg || data).then((message) => {\n            const patchTime = patchTimestamp.toNumber();\n            const messageProps = {\n              id: mid,\n              cid,\n              timestamp: new Date(timestamp.toNumber()),\n              updatedAt: new Date(patchTime),\n              from,\n              mentionList: mentionPids,\n              mentionedAll: mentionAll,\n            };\n            Object.assign(message, messageProps);\n            message._setStatus(MessageStatus.SENT);\n            message._updateMentioned(this.id);\n            if (internal(this).lastPatchTime < patchTime) {\n              internal(this).lastPatchTime = patchTime;\n            }\n            // update conversation lastMessage\n            if (conversation.lastMessage && conversation.lastMessage.id === mid) {\n              conversation.lastMessage = message; // eslint-disable-line no-param-reassign\n            }\n            if (recall) {\n              /**\n               * 消息被撤回\n               * @event IMClient#messagerecall\n               * @param {AVMessage} message 被撤回的消息\n               * @param {Conversation} conversation 消息所在的会话\n               */\n              this.emit('messagerecall', message, conversation);\n              /**\n               * 消息被撤回\n               * @event Conversation#messagerecall\n               * @param {AVMessage} message 被撤回的消息\n               */\n              conversation.emit('messagerecall', message);\n            } else {\n              /**\n               * 消息被修改\n               * @event IMClient#messageupdate\n               * @param {AVMessage} message 被修改的消息\n               * @param {Conversation} conversation 消息所在的会话\n               */\n              this.emit('messageupdate', message, conversation);\n              /**\n               * 消息被修改\n               * @event Conversation#messageupdate\n               * @param {AVMessage} message 被修改的消息\n               */\n              conversation.emit('messageupdate', message);\n            }\n          });\n        }),\n      )),\n    );\n  }\n\n  async _dispatchConvMessage(message) {\n    const {\n      convMessage,\n      convMessage: {\n        initBy, m,\n      },\n    } = message;\n    const conversation = await this.getConversation(convMessage.cid);\n    switch (message.op) {\n      case OpType.joined: {\n        if (!conversation.transient) {\n          // eslint-disable-next-line no-param-reassign\n          conversation.members = union(conversation.members, [this.id]);\n        }\n        const payload = {\n          invitedBy: initBy,\n        };\n        /**\n         * 当前用户被添加至某个对话\n         * @event IMClient#invited\n         * @param {Object} payload\n         * @param {String} payload.invitedBy 邀请者 id\n         * @param {Conversation} conversation\n         */\n        this.emit('invited', payload, conversation);\n        /**\n         * 当前用户被添加至当前对话\n         * @event Conversation#invited\n         * @param {Object} payload\n         * @param {String} payload.invitedBy 该移除操作的发起者 id\n         */\n        conversation.emit('invited', payload);\n        return;\n      }\n      case OpType.left: {\n        if (!conversation.transient) {\n          // eslint-disable-next-line no-param-reassign\n          conversation.members = difference(conversation.members, [this.id]);\n        }\n        const payload = {\n          kickedBy: initBy,\n        };\n        /**\n         * 当前用户被从某个对话中移除\n         * @event IMClient#kicked\n         * @param {Object} payload\n         * @param {String} payload.kickedBy 该移除操作的发起者 id\n         * @param {Conversation} conversation\n         */\n        this.emit('kicked', payload, conversation);\n        /**\n         * 当前用户被从当前对话中移除\n         * @event Conversation#kicked\n         * @param {Object} payload\n         * @param {String} payload.kickedBy 该移除操作的发起者 id\n         */\n        conversation.emit('kicked', payload);\n        return;\n      }\n      case OpType.members_joined: {\n        if (!conversation.transient) {\n          // eslint-disable-next-line no-param-reassign\n          conversation.members = union(conversation.members, convMessage.m);\n        }\n        const payload = {\n          invitedBy: initBy,\n          members: m,\n        };\n        /**\n         * 有用户被添加至某个对话\n         * @event IMClient#membersjoined\n         * @param {Object} payload\n         * @param {String[]} payload.members 被添加的用户 id 列表\n         * @param {String} payload.invitedBy 邀请者 id\n         * @param {Conversation} conversation\n         */\n        this.emit('membersjoined', payload, conversation);\n        /**\n         * 有成员被添加至当前对话\n         * @event Conversation#membersjoined\n         * @param {Object} payload\n         * @param {String[]} payload.members 被添加的成员 id 列表\n         * @param {String} payload.invitedBy 邀请者 id\n         */\n        conversation.emit('membersjoined', payload);\n        return;\n      }\n      case OpType.members_left: {\n        if (!conversation.transient) {\n          // eslint-disable-next-line no-param-reassign\n          conversation.members = difference(conversation.members, convMessage.m);\n        }\n        const payload = {\n          kickedBy: initBy,\n          members: m,\n        };\n        /**\n         * 有成员被从某个对话中移除\n         * @event IMClient#membersleft\n         * @param {Object} payload\n         * @param {String[]} payload.members 被移除的成员 id 列表\n         * @param {String} payload.kickedBy 该移除操作的发起者 id\n         * @param {Conversation} conversation\n         */\n        this.emit('membersleft', payload, conversation);\n        /**\n         * 有成员被从当前对话中移除\n         * @event Conversation#membersleft\n         * @param {Object} payload\n         * @param {String[]} payload.members 被移除的成员 id 列表\n         * @param {String} payload.kickedBy 该移除操作的发起者 id\n         */\n        conversation.emit('membersleft', payload);\n        return;\n      }\n      default:\n        this.emit('unhandledmessage', message);\n        throw new Error('Unrecognized conversation command');\n    }\n  }\n\n  _dispatchDirectMessage(originalMessage) {\n    const {\n      directMessage,\n      directMessage: {\n        id, cid, fromPeerId, timestamp, transient, patchTimestamp, mentionPids, mentionAll,\n        binaryMsg, msg,\n      },\n    } = originalMessage;\n    const content = binaryMsg ? binaryMsg.toArrayBuffer() : msg;\n    return Promise.all([\n      this.getConversation(directMessage.cid),\n      this._messageParser.parse(content),\n    ]).then(([conversation, message]) => {\n      // deleted conversation\n      if (!conversation) return undefined;\n      const messageProps = {\n        id,\n        cid,\n        timestamp: new Date(timestamp.toNumber()),\n        from: fromPeerId,\n        mentionList: mentionPids,\n        mentionedAll: mentionAll,\n      };\n      if (patchTimestamp) {\n        messageProps.updatedAt = new Date(patchTimestamp.toNumber());\n      }\n      Object.assign(message, messageProps);\n      message._updateMentioned(this.id);\n      message._setStatus(MessageStatus.SENT);\n      // filter outgoing message sent from another device\n      if (message.from !== this.id) {\n        if (!(transient || conversation.transient)) {\n          this._sendAck(message);\n        }\n      }\n      return this._dispatchParsedMessage(message, conversation);\n    });\n  }\n\n  _dispatchParsedMessage(message, conversation) {\n    // beforeMessageDispatch hook\n    return applyDispatcher(this._plugins.beforeMessageDispatch, [message, conversation])\n      .then((shouldDispatch) => {\n        if (shouldDispatch === false) return;\n        conversation.lastMessage = message; // eslint-disable-line no-param-reassign\n        conversation.lastMessageAt = message.timestamp; // eslint-disable-line no-param-reassign\n        // filter outgoing message sent from another device\n        if (message.from !== this.id) {\n          conversation.unreadMessagesCount += 1; // eslint-disable-line no-param-reassign\n          if (message.mentioned) conversation._setMentioned(true);\n        }\n        /**\n         * 当前用户收到消息\n         * @event IMClient#message\n         * @param {Message} message\n         * @param {Conversation} conversation 收到消息的对话\n         */\n        this.emit('message', message, conversation);\n        /**\n         * 当前对话收到消息\n         * @event Conversation#message\n         * @param {Message} message\n         */\n        conversation.emit('message', message);\n      });\n  }\n\n  _sendAck(message) {\n    this._debug('send ack for %O', message);\n    const { cid } = message;\n    if (!cid) {\n      throw new Error('missing cid');\n    }\n    if (!this._ackMessageBuffer[cid]) {\n      this._ackMessageBuffer[cid] = [];\n    }\n    this._ackMessageBuffer[cid].push(message);\n    return this._doSendAck();\n  }\n\n  // jsdoc-ignore-start\n  @throttle(1000)\n  // jsdoc-ignore-end\n  _doSendAck() {\n    // if not connected, just skip everything\n    if (!this._connection.is('connected')) return;\n    this._debug('do send ack %O', this._ackMessageBuffer);\n    Promise.all(Object.keys(this._ackMessageBuffer).map((cid) => {\n      const convAckMessages = this._ackMessageBuffer[cid];\n      const timestamps = convAckMessages.map(message => message.timestamp);\n      const command = new GenericCommand({\n        cmd: 'ack',\n        ackMessage: new AckCommand({\n          cid,\n          fromts: Math.min.apply(null, timestamps),\n          tots: Math.max.apply(null, timestamps),\n        }),\n      });\n      delete this._ackMessageBuffer[cid];\n      return this._send(command, false).catch((error) => {\n        this._debug('send ack failed: %O', error);\n        this._ackMessageBuffer[cid] = convAckMessages;\n      });\n    }));\n  }\n\n  _send(cmd, ...args) {\n    const command = cmd;\n    if (this.id) {\n      command.peerId = this.id;\n    }\n    return this._connection.send(command, ...args);\n  }\n\n  _open(appId, tag, deviceId, isReconnect = false) {\n    this._debug('open session');\n    const {\n      lastUnreadNotifTime,\n      lastPatchTime,\n    } = internal(this);\n    return Promise\n      .resolve(new GenericCommand({\n        cmd: 'session',\n        op: 'open',\n        appId,\n        sessionMessage: new SessionCommand({\n          ua: `js/${VERSION}`,\n          r: isReconnect,\n          lastUnreadNotifTime,\n          lastPatchTime,\n          configBitmap: 1,\n        }),\n      }))\n      .then((command) => {\n        if (isReconnect) {\n          // if sessionToken is not expired, skip signature/tag/deviceId\n          const sessionToken = internal(this).sessionToken;\n          if (sessionToken) {\n            const value = sessionToken.value;\n            if (value && value !== Expirable.EXPIRED) {\n              Object.assign(command.sessionMessage, {\n                st: value,\n              });\n              return command;\n            }\n          }\n        }\n        Object.assign(command.sessionMessage, trim({\n          tag,\n          deviceId,\n        }));\n        if (this.options.signatureFactory) {\n          return runSignatureFactory(this.options.signatureFactory, [this._identity])\n            .then((signatureResult) => {\n              Object.assign(command.sessionMessage, keyRemap({\n                signature: 's',\n                timestamp: 't',\n                nonce: 'n',\n              }, signatureResult));\n              return command;\n            });\n        }\n        return command;\n      })\n      .then(this._send.bind(this))\n      .then((resCommand) => {\n        const {\n          peerId,\n          sessionMessage,\n          sessionMessage: {\n            st: token,\n            stTtl: tokenTTL,\n            code,\n          },\n        } = resCommand;\n        if (code) {\n          throw createError(sessionMessage);\n        }\n        if (!peerId) {\n          console.warn('Unexpected session opened without peerId.');\n          return;\n        }\n        this.id = peerId;\n        if (!this._identity) this._identity = peerId;\n        if (token) {\n          internal(this).sessionToken = new Expirable(token, tokenTTL * 1000);\n        }\n      })\n      .catch((error) => {\n        if (error.code === ErrorCode.SESSION_TOKEN_EXPIRED) {\n          if (internal(this).sessionToken === undefined) {\n            // let it fail if sessoinToken not cached but command rejected as token expired\n            // to prevent session openning flood\n            throw new Error('Unexpected session expiration');\n          }\n          debug('Session token expired, reopening');\n          delete internal(this).sessionToken;\n          return this._open(appId, tag, deviceId, isReconnect);\n        }\n        throw error;\n      });\n  }\n\n  /**\n   * 关闭客户端\n   * @return {Promise}\n   */\n  async close() {\n    this._debug('close session');\n    const command = new GenericCommand({\n      cmd: 'session',\n      op: 'close',\n    });\n    await this._send(command);\n    internal(this)._eventemitter.emit('close');\n    this.emit('close', {\n      code: 0,\n    });\n  }\n  /**\n   * 获取 client 列表中在线的 client,每次查询最多 20 个 clientId,超出部分会被忽略\n   * @param  {String[]} clientIds 要查询的 client ids\n   * @return {Primse.} 在线的 client ids\n   */\n  async ping(clientIds) {\n    this._debug('ping');\n    if (!(clientIds instanceof Array)) {\n      throw new TypeError(`clientIds ${clientIds} is not an Array`);\n    }\n    if (!clientIds.length) {\n      return Promise.resolve([]);\n    }\n    const command = new GenericCommand({\n      cmd: 'session',\n      op: 'query',\n      sessionMessage: new SessionCommand({\n        sessionPeerIds: clientIds,\n      }),\n    });\n    const resCommand = await this._send(command);\n    return resCommand.sessionMessage.onlineSessionPeerIds;\n  }\n\n  /**\n   * 获取某个特定的对话\n   * @param  {String} id 对话 id,对应 _Conversation 表中的 objectId\n   * @param  {Boolean} [noCache=false] 强制不从缓存中获取\n   * @return {Promise.} 如果 id 对应的对话不存在则返回 null\n   */\n  async getConversation(id, noCache = false) {\n    if (typeof id !== 'string') {\n      throw new TypeError(`${id} is not a String`);\n    }\n    if (!noCache) {\n      const cachedConversation = this._conversationCache.get(id);\n      if (cachedConversation) {\n        return Promise.resolve(cachedConversation);\n      }\n    }\n    return this\n      .getQuery()\n      .equalTo('objectId', id)\n      .find()\n      .then(conversations => conversations[0] || null);\n  }\n\n  /**\n   * 通过 id 批量获取某个特定的对话\n   * @since 3.4.0\n   * @param  {String[]} ids 对话 id 列表,对应 _Conversation 表中的 objectId\n   * @param  {Boolean} [noCache=false] 强制不从缓存中获取\n   * @return {Promise.} 如果 id 对应的对话不存在则返回 null\n   */\n  async getConversations(ids, noCache = false) {\n    const remoteConversationIds =\n      noCache ? ids : ids.filter(id => this._conversationCache.get(id) === null);\n    if (remoteConversationIds.length) {\n      await (this.getQuery().containedIn('objectId', remoteConversationIds).limit(999)).find();\n    }\n    return ids.map(id => this._conversationCache.get(id));\n  }\n\n  /**\n   * 构造一个 ConversationQuery 来查询对话\n   * @return {ConversationQuery}\n   */\n  getQuery() {\n    return new ConversationQuery(this);\n  }\n\n  async _executeQuery(query) {\n    const queryJSON = query.toJSON();\n    queryJSON.where = new JsonObjectMessage({\n      data: JSON.stringify(queryJSON.where),\n    });\n    const command = new GenericCommand({\n      cmd: 'conv',\n      op: 'query',\n      convMessage: new ConvCommand(queryJSON),\n    });\n    const resCommand = await this._send(command);\n    let conversations;\n    try {\n      conversations = JSON.parse(resCommand.convMessage.results.data);\n    } catch (error) {\n      const commandString = JSON.stringify(trim(resCommand));\n      throw new Error(`Parse query result failed: ${error.message}. Command: ${commandString}`);\n    }\n    conversations = await Promise.all(conversations.map(\n      this._parseConversationFromRawData.bind(this),\n    ));\n    return conversations.map((fetchedConversation) => {\n      let conversation = this._conversationCache.get(fetchedConversation.id);\n      if (!conversation) {\n        conversation = fetchedConversation;\n        this._debug('no match, set cache');\n        this._conversationCache.set(fetchedConversation.id, fetchedConversation);\n      } else {\n        this._debug('update cached conversation');\n        [\n          'creator',\n          'createdAt',\n          'updatedAt',\n          'lastMessageAt',\n          'lastMessage',\n          'mutedMembers',\n          'members',\n          '_attributes',\n          'transient',\n          'muted',\n        ].forEach((key) => {\n          const value = fetchedConversation[key];\n          if (value !== undefined) conversation[key] = value;\n        });\n        conversation._reset();\n      }\n      return conversation;\n    });\n  }\n\n  async _parseConversationFromRawData(rawData) {\n    const data = keyRemap({\n      objectId: 'id',\n      lm: 'lastMessageAt',\n      msg: 'lastMessage',\n      msg_from: 'lastMessageFrom',\n      msg_mid: 'lastMessageId',\n      msg_timestamp: 'lastMessageTimestamp',\n      patch_timestamp: 'lastMessagePatchTimestamp',\n      m: 'members',\n      tr: 'transient',\n      sys: 'system',\n      c: 'creator',\n      mu: 'mutedMembers',\n    }, rawData);\n    if (data.lastMessage) {\n      const message = await this._messageParser.parse(data.lastMessage);\n      data.lastMessage = message;\n      message.from = data.lastMessageFrom;\n      message.id = data.lastMessageId;\n      message.timestamp = new Date(data.lastMessageTimestamp);\n      if (data.lastMessagePatchTimestamp) {\n        message.updatedAt = new Date(data.lastMessagePatchTimestamp);\n      }\n      message._setStatus(MessageStatus.SENT);\n      delete data.lastMessageFrom;\n      delete data.lastMessageId;\n      delete data.lastMessageTimestamp;\n      delete data.lastMessagePatchTimestamp;\n    }\n    return new Conversation(data, this);\n  }\n\n  /**\n   * 创建一个 conversation\n   * @param {Object} options 除了下列字段外的其他字段将被视为对话的自定义属性\n   * @param {String[]} options.members 对话的初始成员列表,默认包含当前 client\n   * @param {String} [options.name] 对话的名字\n   * @param {Boolean} [options.transient=false] 暂态会话\n   * @param {Boolean} [options.unique=false] 唯一对话,当其为 true 时,如果当前已经有相同成员的对话存在则返回该对话,否则会创建新的对话\n   * @return {Promise.}\n   */\n  async createConversation(options = {}) {\n    const {\n      members: m,\n      name,\n      transient,\n      unique,\n      ...properties\n    } = options;\n    if (!(transient || Array.isArray(m))) {\n      throw new TypeError(`conversation members ${m} is not an array`);\n    }\n    let members = new Set(m);\n    members.add(this.id);\n    members = Array.from(members).sort();\n    let attr = properties || {};\n    if (name) {\n      if (typeof name !== 'string') {\n        throw new TypeError(`conversation name ${name} is not a string`);\n      }\n      attr.name = name;\n    }\n    attr = new JsonObjectMessage({\n      data: JSON.stringify(attr),\n    });\n\n    const startCommandJson = {\n      m: members,\n      attr,\n      transient,\n      unique,\n    };\n\n    const command = new GenericCommand({\n      cmd: 'conv',\n      op: 'start',\n      convMessage: new ConvCommand(startCommandJson),\n    });\n\n    if (this.options.conversationSignatureFactory) {\n      const params = [null, this._identity, members, 'create'];\n      const signatureResult = await runSignatureFactory(\n        this.options.conversationSignatureFactory,\n        params,\n      );\n      Object.assign(command.convMessage, keyRemap({\n        signature: 's',\n        timestamp: 't',\n        nonce: 'n',\n      }, signatureResult));\n    }\n\n    const resCommand = await this._send(command);\n    const conversation = new Conversation({\n      name,\n      transient,\n      unique,\n      id: resCommand.convMessage.cid,\n      createdAt: resCommand.convMessage.cdate,\n      updatedAt: resCommand.convMessage.cdate,\n      lastMessageAt: null,\n      creator: this.id,\n      members: transient ? [] : members,\n      ...properties,\n    }, this);\n    this._conversationCache.set(conversation.id, conversation);\n    return conversation;\n  }\n\n  // jsdoc-ignore-start\n  @throttle(1000)\n  // jsdoc-ignore-end\n  _doSendRead() {\n    // if not connected, just skip everything\n    if (!this._connection.is('connected')) return;\n    const buffer = internal(this).readConversationsBuffer;\n    const conversations = Array.from(buffer);\n    if (!conversations.length) return;\n    const ids = conversations.map((conversation) => {\n      if (!(conversation instanceof Conversation)) {\n        throw new TypeError(`${conversation} is not a Conversation`);\n      }\n      return conversation.id;\n    });\n    this._debug(`mark [${ids}] as read`);\n    buffer.clear();\n    this._sendReadCommand(conversations).catch((error) => {\n      this._debug('send read failed: %O', error);\n      conversations.forEach(buffer.add.bind(buffer));\n    });\n  }\n  _sendReadCommand(conversations) {\n    return this._send(new GenericCommand({\n      cmd: 'read',\n      readMessage: new ReadCommand({\n        convs: conversations.map(conversation => new ReadTuple({\n          cid: conversation.id,\n          mid: (conversation.lastMessage && conversation.lastMessage.from !== this.id)\n            ? conversation.lastMessage.id : undefined,\n          timestamp: (conversation.lastMessageAt || new Date()).getTime(),\n        })),\n      }),\n    }), false);\n  }\n}\n","import Message from './message';\n\nexport default class BinaryMessage extends Message {\n  /**\n   * 二进制消息\n   * @extends Message\n   * @param {ArrayBuffer} buffer\n   * @since 4.0.0\n   */\n  constructor(buffer) {\n    if (!(buffer instanceof ArrayBuffer)) {\n      throw new TypeError(`${buffer} is not an ArrayBuffer`);\n    }\n    super(buffer);\n  }\n\n  /**\n   * @type ArrayBuffer\n   */\n  get buffer() {\n    return this.content;\n  }\n  set buffer(buffer) {\n    this.content = buffer;\n  }\n\n  static validate(target) {\n    return target instanceof ArrayBuffer;\n  }\n}\n","import TypedMessage from './typed-message';\nimport { messageType, IE10Compatible } from './helpers';\n\n// jsdoc-ignore-start\n@messageType(-1)\n@IE10Compatible\n// jsdoc-ignore-end\nexport default class TextMessage extends TypedMessage {\n  /**\n   * 文类类型消息\n   * @extends TypedMessage\n   * @param  {String} [text='']\n   * @throws {TypeError} text 不是 String 类型\n   */\n  constructor(text = '') {\n    if (typeof text !== 'string') {\n      throw new TypeError(`${text} is not a string`);\n    }\n    super();\n    this.setText(text);\n  }\n}\n\n/**\n * @name TYPE\n * @memberof TextMessage\n * @type Number\n * @static\n * @const\n */\n","import d from 'debug';\nimport isPlainObject from 'lodash/isPlainObject';\nimport { applyMiddlewares } from './plugin';\n\nconst debug = d('LC:MessageParser');\n\nconst tryParseJson = (target, key, descriptor) => {\n  const fn = descriptor.value;\n  // eslint-disable-next-line no-param-reassign\n  descriptor.value = function wrapper(param) {\n    let content;\n    if (typeof param !== 'string') {\n      content = param;\n    } else {\n      try {\n        content = JSON.parse(param);\n      } catch (error) {\n        content = param;\n      }\n    }\n    return fn.call(this, content);\n  };\n};\n\nconst applyPlugins = (target, key, descriptor) => {\n  const fn = descriptor.value;\n  // eslint-disable-next-line no-param-reassign\n  descriptor.value = function wrapper(json) {\n    return Promise.resolve(json)\n      .then(applyMiddlewares(this._plugins.beforeMessageParse))\n      .then(decoratedJson => fn.call(this, decoratedJson))\n      .then(applyMiddlewares(this._plugins.afterMessageParse));\n  };\n};\n\nexport default class MessageParser {\n  constructor(plugins = {}) {\n    this._plugins = plugins;\n    this._messageClasses = [];\n  }\n\n  register(messageClass) {\n    if (\n      messageClass &&\n      messageClass.parse &&\n      messageClass.prototype &&\n      messageClass.prototype.toJSON\n    ) {\n      this._messageClasses.unshift(messageClass);\n    } else {\n      throw new TypeError('Invalid messageClass');\n    }\n  }\n\n  // jsdoc-ignore-start\n  @tryParseJson\n  @applyPlugins\n  // jsdoc-ignore-end\n  parse(content) {\n    debug('parsing message: %O', content);\n    // eslint-disable-next-line no-restricted-syntax\n    for (const Klass of this._messageClasses) {\n      const contentCopy = isPlainObject(content) ? Object.assign({}, content) : content;\n      let valid;\n      let result;\n      try {\n        valid = Klass.validate(contentCopy);\n      } catch (error) {\n        // eslint-disable-line no-empty\n      }\n      if (valid) {\n        try {\n          result = Klass.parse(contentCopy);\n        } catch (error) {\n          console.warn('parsing a valid message content error', {\n            error,\n            Klass,\n            content: contentCopy,\n          });\n        }\n        if (result !== undefined) {\n          debug('parse result: %O', result);\n          return result;\n        }\n      }\n    }\n    throw new Error('No Message Class matched');\n  }\n}\n","/** @module leancloud-realtime */\nimport d from 'debug';\nimport uuid from 'uuid/v4';\nimport IMClient from './im-client';\nimport Conversation, { MessageQueryDirection } from './conversation';\nimport Message, { MessageStatus } from './messages/message';\nimport BinaryMessage from './messages/binary-message';\nimport TextMessage from './messages/text-message';\nimport TypedMessage from './messages/typed-message';\nimport RecalledMessage from './messages/recalled-message';\nimport MessageParser from './message-parser';\nimport { trim, internal, ensureArray } from './utils';\n\nconst debug = d('LC:IMPlugin');\n\n/**\n * 消息优先级枚举\n * @enum {Number}\n * @since 3.3.0\n */\nconst MessagePriority = {\n  /** 高 */\n  HIGH: 1,\n  /** 普通 */\n  NORMAL: 2,\n  /** 低 */\n  LOW: 3,\n};\nObject.freeze(MessagePriority);\n\n/**\n * 为 Conversation 定义一个新属性\n * @param {String} prop 属性名\n * @param {Object} [descriptor] 属性的描述符,参见 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor#Description getOwnPropertyDescriptor#Description - MDN},默认为该属性名对应的 Conversation 自定义属性的 getter/setter\n * @returns void\n * @example\n *\n * conversation.get('type');\n * conversation.set('type', 1);\n *\n * // equals to\n * defineConversationProperty('type');\n * conversation.type;\n * conversation.type = 1;\n */\nconst defineConversationProperty = (prop, descriptor = {\n  get() { return this.get(prop); },\n  set(value) { this.set(prop, value); },\n}) => {\n  Object.defineProperty(Conversation.prototype, prop, descriptor);\n};\n\nexport {\n  /**\n   * @see Message\n   */\n  Message,\n  /**\n   * @see BinaryMessage\n   */\n  BinaryMessage,\n  /**\n   * @see TypedMessage\n   */\n  TypedMessage,\n  /**\n   * @see TextMessage\n   */\n  TextMessage,\n  /**\n   * @see RecalledMessage\n   */\n  RecalledMessage,\n  MessagePriority,\n  MessageStatus,\n  MessageQueryDirection,\n  defineConversationProperty,\n};\n\nexport {\n  /**\n   * decorator,定义消息类的类型常量\n   * @function\n   * @param {Number} type 自定义类型请使用正整数\n   * @example @messageType(1)\n   * class CustomMessage extends TypedMessage {}\n   *\n   * // 不支持 decorator 的情况下可以这样使用\n   * class CustomMessage extends TypedMessage {\n   *   //...\n   * }\n   * messageType(1)(CustomMessage);\n   */\n  messageType,\n  /**\n   * decorator,定义消息类的自定义字段\n   * @function\n   * @param {String[]} fields 自定义字段\n   * @example @messageField(['foo'])\n   * class CustomMessage extends TypedMessage {\n   *   constructor(foo) {\n   *     super();\n   *     this.foo = foo;\n   *   }\n   * }\n   *\n   * // 不支持 decorator 的情况下可以这样使用\n   * class CustomMessage extends TypedMessage {\n   *   constructor(foo) {\n   *     super();\n   *     this.foo = foo;\n   *   }\n   *   //...\n   * }\n   * messageField(['foo'])(CustomMessage);\n   */\n  messageField,\n  IE10Compatible,\n} from './messages/helpers';\n\nconst onRealtimeCreate = (realtime) => {\n  /* eslint-disable no-param-reassign */\n  const deviceId = uuid();\n  realtime._IMClients = {};\n  const messageParser = new MessageParser(realtime._plugins);\n  realtime._messageParser = messageParser;\n\n  const signAVUser = async user => realtime._request({\n    method: 'POST',\n    path: '/rtm/sign',\n    data: {\n      session_token: user.getSessionToken(),\n    },\n  });\n\n  /**\n   * 注册消息类\n   *\n   * 在接收消息、查询消息时,会按照消息类注册顺序的逆序依次尝试解析消息内容\n   *\n   * @memberof Realtime\n   * @instance\n   * @param  {Function | Function[]} messageClass 消息类,需要实现 {@link AVMessage} 接口,\n   * 建议继承自 {@link TypedMessage}\n   * @throws {TypeError} 如果 messageClass 没有实现 {@link AVMessage} 接口则抛出异常\n   */\n  const register = messageClass =>\n    ensureArray(messageClass).map(messageParser.register.bind(messageParser));\n  register(ensureArray(realtime._plugins.messageClasses));\n  /**\n   * 创建一个即时通讯客户端,多次创建相同 id 的客户端会返回同一个实例\n   * @memberof Realtime\n   * @instance\n   * @param  {String|AV.User} [identity] 客户端 identity,如果不指定该参数,服务端会随机生成一个字符串作为 identity,\n   * 如果传入一个已登录的 AV.User,则会使用该用户的 id 作为客户端 identity 登录。\n   * @param  {Object} [clientOptions] 详细参数 @see {@link IMClient}\n   * @param  {String} [tag] 客户端类型标记,以支持单点登录功能\n   * @return {Promise.}\n   */\n  const createIMClient = async (identity, clientOptions, tag) => {\n    let id;\n    const buildinOptions = {};\n    if (identity) {\n      if (typeof identity === 'string') {\n        id = identity;\n      } else if (identity.id && identity.getSessionToken) {\n        id = identity.id;\n        const sessionToken = identity.getSessionToken();\n        if (!sessionToken) {\n          throw new Error('User must be authenticated');\n        }\n        buildinOptions.signatureFactory = signAVUser;\n      } else {\n        throw new TypeError('Identity must be a String or an AV.User');\n      }\n      if (realtime._IMClients[id] !== undefined) {\n        return realtime._IMClients[id];\n      }\n    }\n    const promise = realtime._open().then((connection) => {\n      const client = new IMClient(id, { ...buildinOptions, ...clientOptions }, connection, {\n        _messageParser: messageParser,\n        _plugins: realtime._plugins,\n        _identity: identity,\n      });\n      connection.on('reconnect', () =>\n        client._open(realtime._options.appId, tag, deviceId, true)\n          /**\n           * 客户端连接恢复正常,该事件通常在 {@link Realtime#event:reconnect} 之后发生\n           * @event IMClient#reconnect\n           * @see Realtime#event:reconnect\n           * @since 3.2.0\n           */\n          /**\n           * 客户端重新登录发生错误(网络连接已恢复,但重新登录错误)\n           * @event IMClient#reconnecterror\n           * @since 3.2.0\n           */\n          .then(\n            () => client.emit('reconnect'),\n            error => client.emit('reconnecterror', error),\n          ),\n      );\n      internal(client)._eventemitter.on('close', () => {\n        delete realtime._IMClients[client.id];\n        realtime._deregister(client);\n      }, realtime);\n      return client._open(realtime._options.appId, tag, deviceId)\n        .then(() => {\n          realtime._IMClients[client.id] = client;\n          realtime._register(client);\n          return client;\n        }).catch((error) => {\n          delete realtime._IMClients[client.id];\n          throw error;\n        });\n    });\n    if (identity) {\n      realtime._IMClients[id] = promise;\n    }\n    return promise;\n  };\n  Object.assign(realtime, {\n    register,\n    createIMClient,\n  });\n  /* eslint-enable no-param-reassign */\n};\n\nconst beforeCommandDispatch = (command, realtime) => {\n  if (command.peerId === null) return true;\n  const targetClient = realtime._IMClients[command.peerId];\n  if (targetClient) {\n    Promise.resolve(targetClient).then(client => client._dispatchCommand(command)).catch(debug);\n  } else {\n    debug(\n      '[WARN] Unexpected message received without any live client match: %O',\n      trim(command),\n    );\n  }\n  return false;\n};\n\nexport const IMPlugin = {\n  name: 'leancloud-realtime-plugin-im',\n  onRealtimeCreate,\n  beforeCommandDispatch,\n  messageClasses: [\n    Message,\n    BinaryMessage,\n    RecalledMessage,\n    TextMessage,\n  ],\n};\n","import { Realtime } from './core';\nimport { IMPlugin, defineConversationProperty } from './plugin-im';\n\nRealtime.defineConversationProperty = defineConversationProperty;\nRealtime.__preRegisteredPlugins = [IMPlugin];\n\nexport * from './core';\n\nexport * from './plugin-im';\n"],"names":["defined","toInteger","aFunction","isObject","require$$0","document","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","core","global","ctx","hide","cof","IObject","min","toIObject","toLength","toAbsoluteIndex","uid","IE_PROTO","has","$keys","enumBugKeys","getKeys","PROTOTYPE","dPs","create","descriptor","setToStringTag","toObject","$iterCreate","getPrototypeOf","LIBRARY","Iterators","redefine","$export","step","addToUnscopables","TAG","ITERATOR","classof","getIterFn","isArrayIter","call","process","invoke","cel","html","Promise","isNode","newPromiseCapability","SPECIES","DESCRIPTORS","TypeError","newPromiseCapabilityModule","perform","anInstance","require$$3","speciesConstructor","require$$4","require$$5","require$$6","promiseResolve","require$$7","forOf","define","require","this","newBuilder","build","messages","push_server","messages2","JsonObjectMessage","UnreadTuple","LogItem","DataCommand","SessionCommand","ErrorCommand","DirectCommand","AckCommand","UnreadCommand","ConvCommand","RoomCommand","LogsCommand","RcpCommand","ReadTuple","MaxReadTuple","ReadCommand","PresenceCommand","ReportCommand","GenericCommand","PatchCommand","PatchItem","CommandType","OpType","StatusType","gOPS","pIE","_assign","_promise","$defineProperty","createProperty","_from","redefineAll","validate","$iterDefine","setSpecies","isArray","asc","fails","meta","strong","from","wksExt","gOPN","toString","gOPD","$GOPD","$DP","gOPNExt","wks","shared","ObjectProto","USE_NATIVE","$fails","_create","enumKeys","wksDefine","_iterator","_symbol","_typeof2","_setPrototypeOf","d","ms","bind","fn","thisArg","wrap","args","Array","arguments","length","i","apply","Object","prototype","val","isArrayBuffer","isFormData","FormData","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isUndefined","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","str","replace","isStandardBrowserEnv","navigator","product","window","forEach","obj","l","key","hasOwnProperty","merge","assignValue","extend","a","b","isBuffer","$JSON","normalizeHeaderName","headers","normalizedName","utils","processHeader","value","name","toUpperCase","enhanceError","error","config","code","request","response","createError","message","Error","settle","resolve","reject","validateStatus","status","encode","encodeURIComponent","buildURL","url","params","paramsSerializer","serializedParams","parts","serialize","parseValue","v","toISOString","push","join","indexOf","parseHeaders","parsed","split","parser","line","substr","toLowerCase","standardBrowserEnv","msie","test","userAgent","urlParsingNode","createElement","originURL","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","isURLSameOrigin","requestURL","nonStandardBrowserEnv","chars","E","btoa","input","String","output","block","charCode","idx","map","charCodeAt","write","expires","path","domain","secure","cookie","Date","toGMTString","read","match","RegExp","decodeURIComponent","remove","now","xhrAdapter","dispatchXhrRequest","requestData","data","requestHeaders","XMLHttpRequest","loadEvent","xDomain","env","NODE_ENV","XDomainRequest","onprogress","handleProgress","ontimeout","handleTimeout","auth","username","password","Authorization","open","method","timeout","handleLoad","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseData","responseType","responseText","statusText","onerror","handleError","cookies","xsrfValue","withCredentials","xsrfCookieName","undefined","xsrfHeaderName","setRequestHeader","e","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","onCanceled","cancel","abort","send","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","getDefaultAdapter","adapter","defaults","transformRequest","transformResponse","JSON","parse","maxContentLength","common","forEachMethodNoData","forEachMethodWithData","InterceptorManager","handlers","use","fulfilled","rejected","eject","id","forEachHandler","h","transformData","fns","transform","isCancel","__CANCEL__","throwIfCancellationRequested","throwIfRequested","dispatchRequest","cleanHeaderConfig","onAdapterResolution","onAdapterRejection","reason","isAbsoluteURL","combineURLs","baseURL","relativeURL","Axios","instanceConfig","interceptors","chain","unshiftRequestInterceptors","interceptor","unshift","pushResponseInterceptors","shift","Cancel","CancelToken","executor","resolvePromise","promiseExecutor","token","source","c","spread","callback","arr","createInstance","defaultConfig","context","instance","axios","all","promises","$getOwnPropertyDescriptor","$Object","createArrayMethod","$has","weak","assign","_defineProperty","freeGlobal","Symbol","root","objectProto","symToStringTag","nativeObjectToString","getRawTag","objectToString","overArg","isObjectLike","baseGetTag","getPrototype","EXPIRED","debug","Expirable","ttl","_value","expiredAt","expired","Cache","_map","get","cache","set","tryAll","promiseConstructors","catch","slice","tap","decodeDate","date","__type","iso","toNumber","keyRemap","keymap","reduce","newObj","newKey","isIE10","getStaticProperty","klass","property","__proto__","union","difference","filter","bSet","x","internal","object","removeNull","isPlainObject","prop","ensureArray","target","setValue","segs","lastSeg","pop","currentTarget","seg","isWeapp","wx","connectSocket","throttle","throttleMeta","propertyMeta","previouseTimestamp","remainingTime","wait","setTimeout","WebSocket","MozWebSocket","HEARTBEAT_TIME","TIMEOUT_TIME","DEFAULT_RETRY_STRATEGY","Math","attempt","requireConnected","requireConnectedWrapper","is","currentState","current","console","warn","WebSocketPlus","getUrls","_getUrls","_protocol","init","_createWs","__postponeTimeoutTimer","_postponeTimeoutTimer","__pause","pause","__resume","resume","throw","wsUrls","urls","ws","binaryType","onopen","onclose","_ws","_handleClose","onmessage","_handleMessage","_destroyWs","close","onbeforeevent","event","to","payload","emit","onconnected","_startConnectionKeeper","onleaveconnected","_stopConnectionKeeper","onpause","onbeforeresume","onreconnect","ondisconnected","delay","__scheduledRetry","clearTimeout","retry","onretry","can","reconnect","fail","removeEventListener","_ping","ping","_clearTimeoutTimers","_timeoutTimer","disconnect","_heartbeatTimer","setInterval","addListener","removeListener","clearInterval","isFinished","handleClose","handleMessage","EventEmitter","StateMachine","initial","state","defer","terminal","events","ErrorCode","Number","errorMessage","appCode","detail","err","COMMAND_TIMEOUT","Connection","getUrl","format","version","protocolString","_protocalFormat","_commands","_serialId","command","waitingForRespond","serialId","toBase64","toArrayBuffer","msg","decode","cmd","echo","checkType","param","constructor","middleware","_pluginName","applyDecorators","decorators","decorator","applyMiddlewares","middlewares","previousPromise","applyDispatcher","dispatchers","resultPromise","dispatcher","shouldDispatch","routerCache","Realtime","options","appId","appKey","_options","region","pushOfflineMessages","noBinary","ssl","server","SERVER","_cache","clients","_plugins","__preRegisteredPlugins","plugins","plugin","hook","concat","onRealtimeCreate","_request","query","_fetchAppRouter","api","_open","_openPromise","connection","_getEndpoints","on","_dispatchCommand","client","isFatal","APP_NOT_AVAILABLE","INVALID_LOGIN","INVALID_ORIGIN","some","errorCode","_fetchEndpointsInfo","info","secondary","cachedRouter","res","rtmRouter","rtm_router_server","api_server","router","features","_t","_close","cannot","_register","add","_deregister","delete","size","beforeCommandDispatch","rng","bytesToUuid","_isIterable2","_getIterator2","isPrototype","nativeKeys","coreJsData","funcProto","funcToString","isMasked","toSource","getValue","baseIsNative","getNative","mapTag","objectTag","setTag","DataView","Map","Set","WeakMap","baseIsArguments","isLength","stubFalse","argsTag","funcTag","weakMapTag","dataViewTag","nodeUtil","baseUnary","baseIsTypedArray","isArrayLike","isTypedArray","isArguments","getTag","baseKeys","eq","assocIndexOf","listCacheClear","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","ListCache","nativeCreate","HASH_UNDEFINED","hashClear","hashDelete","hashGet","hashHas","hashSet","Hash","isKeyable","getMapData","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","MapCache","stackClear","stackDelete","stackGet","stackHas","stackSet","defineProperty","baseAssignValue","MAX_SAFE_INTEGER","baseTimes","isIndex","keys","arrayLikeKeys","copyObject","nativeKeysIn","keysIn","baseKeysIn","propertyIsEnumerable","stubArray","arrayFilter","getSymbols","nativeGetSymbols","arrayPush","getSymbolsIn","baseGetAllKeys","Uint8Array","cloneArrayBuffer","CLONE_DEEP_FLAG","mapToArray","arrayReduce","addMapEntry","setToArray","addSetEntry","boolTag","dateTag","numberTag","regexpTag","stringTag","symbolTag","arrayBufferTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","cloneDataView","cloneTypedArray","cloneMap","cloneRegExp","cloneSet","cloneSymbol","baseCreate","CLONE_SYMBOLS_FLAG","arrayTag","errorTag","genTag","initCloneArray","copyArray","cloneBuffer","initCloneObject","copySymbolsIn","baseAssignIn","copySymbols","baseAssign","initCloneByTag","Stack","getAllKeysIn","getAllKeys","arrayEach","baseClone","_validateSignature","signatureResult","signature","timestamp","nonce","signatureFactory","MessageStatus","NONE","SENDING","SENT","DELIVERED","FAILED","rMessageStatus","READ","Message","content","uuid","cid","mentionList","mentionedAll","_mentioned","_setStatus","toJSON","_status","_updateMentioned","getMentionList","setMentionList","mentionAll","Boolean","json","_updatedAt","messageType","type","TYPE","_lctype","_getType","messageField","fields","originalCustomFields","_customFields","IE10Compatible","TypedMessage","_","setText","text","_lctext","getText","setAttributes","attributes","_lcattrs","getAttributes","_getCustomFields","field","customFields","RecalledMessage","serializeMessage","binaryMsg","QueryDirection","NEW","OLD","MessageQueryDirection","NEW_TO_OLD","OLD_TO_NEW","Conversation","creator","createdAt","updatedAt","lastMessageAt","lastMessage","mutedMembers","members","transient","system","muted","mentioned","_attributes","_reset","messagesWaitingForReceipt","lastDeliveredAt","lastReadAt","unreadMessagesCount","IMClient","_client","_debug","onConversationCreate","_setMentioned","_setLastDeliveredAt","_setLastReadAt","currentAttributes","pendingAttributes","pendingKeys","re","childKeys","k","parentKey","cloneDeep","_send","convMessage","save","attr","isEmpty","op","resCommand","udate","fetch","getQuery","equalTo","find","mute","unmute","count","clientIds","m","conversationSignatureFactory","sort","runSignatureFactory","quit","sendOptions","getSendOptions","receipt","priority","pushData","will","directMessage","r","dt","mentionPids","ackMessage","t","_update","newMessage","recall","patch","modify","patchMessage","patches","mid","lastPatchTime","_lastPatchTime","update","queryMessages","beforeTime","beforeMessageId","afterTime","afterMessageId","limit","direction","startTime","startMessageId","startClosed","endTime","endMessageId","endClosed","log","conditions","tIncluded","tt","tmid","ttIncluded","getTime","logsMessage","logs","msgId","patchTimestamp","ackAt","readAt","bin","decodeBase64","_messageParser","messageProps","deliveredAt","createMessagesIterator","next","prevMessages","done","readConversationsBuffer","_doSendRead","_handleReceipt","messageId","fetchReceiptTimestamps","maxReadTimestamp","maxAckTimestamp","_fetchAllReceiptTimestamps","queryAllMembers","maxReadTuples","maxReadTuple","pid","_createdAt","time","_lastMessageAt","ConversationQuery","_encode","_quote","s","_calculateFlag","prev","_where","_extraOptions","_addCondition","condition","where","flag","_skip","skip","_limit","_order","containsMembers","peerIds","containsAll","withMembers","includeSelf","peerIdsSet","sizeEqualTo","lessThan","lessThanOrEqualTo","greaterThan","greaterThanOrEqualTo","notEqualTo","exists","doesNotExist","containedIn","values","notContainsIn","contains","subString","startsWith","prefix","endsWith","suffix","matches","regex","_modifiers","ignoreCase","multiline","ascending","addAscending","descending","addDescending","withLastMessagesRefreshed","enabled","compact","_executeQuery","props","_connection","_conversationCache","_ackMessageBuffer","_eventemitter","onIMClientCreate","conv","direct","session","unread","rcp","_dispatchConvMessage","_dispatchDirectMessage","_dispatchSessionMessage","_dispatchUnreadMessage","_dispatchRcpMessage","_dispatchPatchMessage","sessionMessage","closed","SESSION_CONFLICT","unreadMessage","convs","notifTime","lastUnreadNotifTime","getConversations","ts","getConversation","conversation","countNotUpdated","conversations","rcpMessage","conversationId","patchTime","initBy","joined","left","members_joined","members_left","invitedBy","kickedBy","originalMessage","fromPeerId","_sendAck","_dispatchParsedMessage","beforeMessageDispatch","_doSendAck","convAckMessages","timestamps","fromts","tots","max","peerId","tag","deviceId","isReconnect","ua","VERSION","configBitmap","sessionToken","st","_identity","tokenTTL","stTtl","SESSION_TOKEN_EXPIRED","sessionPeerIds","onlineSessionPeerIds","noCache","cachedConversation","ids","remoteConversationIds","queryJSON","results","commandString","_parseConversationFromRawData","fetchedConversation","rawData","objectId","lm","msg_from","msg_mid","msg_timestamp","patch_timestamp","tr","sys","mu","lastMessageFrom","lastMessageId","lastMessageTimestamp","lastMessagePatchTimestamp","createConversation","unique","properties","startCommandJson","cdate","clear","_sendReadCommand","readMessage","BinaryMessage","TextMessage","tryParseJson","wrapper","applyPlugins","beforeMessageParse","decoratedJson","afterMessageParse","MessageParser","_messageClasses","register","messageClass","Klass","contentCopy","valid","MessagePriority","HIGH","NORMAL","LOW","defineConversationProperty","realtime","_IMClients","messageParser","signAVUser","user","session_token","getSessionToken","messageClasses","createIMClient","identity","clientOptions","buildinOptions","targetClient","IMPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;AACA,QAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AACrB,QAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AACvB,kBAAc,GAAG,UAAU,EAAE,EAAE;MAC7B,OAAO,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;KAC1D;;ICLD;AACA,gBAAc,GAAG,UAAU,EAAE,EAAE;MAC7B,IAAI,EAAE,IAAI,SAAS,EAAE,MAAM,SAAS,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAC;MACpE,OAAO,EAAE,CAAC;KACX;;ICFD;;AAEA,iBAAc,GAAG,UAAU,SAAS,EAAE;MACpC,OAAO,UAAU,IAAI,EAAE,GAAG,EAAE;QAC1B,IAAI,CAAC,GAAG,MAAM,CAACA,QAAO,CAAC,IAAI,CAAC,C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J,EAAc;IACZT,yBAASC,UAAT,CAAoB5xB,EAApB,IAA0BzB,UAA1B;IACD;IA5DoB,gDA6DdA,UA7Dc;;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,KAAjB;;IAAA;IAAA;IAAA;IAAA,KAAN;IA+DA,iBAAcozB,QAAd,EAAwB;IACtBV,sBADsB;IAEtBkB;IAFsB,GAAxB;IAIA;IACD,CA3GD;;AA6GA,QAAMrf,wBAAwB,SAAxBA,qBAAwB,CAACjF,OAAD,EAAU8jB,QAAV,EAAuB;IACnD,MAAI9jB,QAAQ4f,MAAR,KAAmB,IAAvB,EAA6B,OAAO,IAAP;IAC7B,MAAM8E,eAAeZ,SAASC,UAAT,CAAoB/jB,QAAQ4f,MAA5B,CAArB;IACA,MAAI8E,YAAJ,EAAkB;IAChB,aAAQv7B,OAAR,CAAgBu7B,YAAhB,EAA8B/zB,IAA9B,CAAmC;IAAA,aAAU6S,OAAOD,gBAAP,CAAwBvD,OAAxB,CAAV;IAAA,KAAnC,EAA+E9I,KAA/E,CAAqFb,OAArF;IACD,GAFD,MAEO;IACLA,YACE,sEADF,EAEEvP,OAAKkZ,OAAL,CAFF;IAID;IACD,SAAO,KAAP;IACD,CAZD;;AAcA,AAAO,QAAM2kB,WAAW;IACtBp8B,QAAM,8BADgB;IAEtBsa,oCAFsB;IAGtBoC,8CAHsB;IAItBof,kBAAgB,CACdhW,OADc,EAEdqU,aAFc,EAGd7R,eAHc,EAId8R,WAJc;IAJM,CAAjB;;IChPPjhB,SAASmiB,0BAAT,GAAsCA,0BAAtC;IACAniB,SAASc,sBAAT,GAAkC,CAACmiB,QAAD,CAAlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/dist/realtime.browser.min.js b/dist/realtime.browser.min.js
new file mode 100644
index 000000000..263f840b7
--- /dev/null
+++ b/dist/realtime.browser.min.js
@@ -0,0 +1,9 @@
+!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports):"function"==typeof define&&define.amd?define("leancloud-realtime",["exports"],b):b(a.AV=a.AV||{})}(this,function(a){"use strict";function b(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function c(a){return a&&a.__esModule?a.default:a}function d(a,b){return b={exports:{}},a(b,b.exports),b.exports}function e(a){var b,c;this.promise=new a(function(a,d){if(void 0!==b||void 0!==c)throw TypeError("Bad Promise constructor");b=a,c=d}),this.resolve=Ib(b),this.reject=Ib(c)}function f(a){if(a=String(a),!(a.length>100)){var b=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(a);if(b){var c=parseFloat(b[1]);switch((b[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*ch;case"days":case"day":case"d":return c*bh;case"hours":case"hour":case"hrs":case"hr":case"h":return c*ah;case"minutes":case"minute":case"mins":case"min":case"m":return c*_g;case"seconds":case"second":case"secs":case"sec":case"s":return c*$g;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function g(a){return a>=bh?Math.round(a/bh)+"d":a>=ah?Math.round(a/ah)+"h":a>=_g?Math.round(a/_g)+"m":a>=$g?Math.round(a/$g)+"s":a+"ms"}function h(a){return i(a,bh,"day")||i(a,ah,"hour")||i(a,_g,"minute")||i(a,$g,"second")||a+" ms"}function i(a,b,c){if(!(a>8-f%1*8)){if((c=d.charCodeAt(f+=.75))>255)throw new F;b=b<<8|c}return e}function H(a,b){!jh.isUndefined(a)&&jh.isUndefined(a["Content-Type"])&&(a["Content-Type"]=b)}function I(){this.handlers=[]}function J(a){a.cancelToken&&a.cancelToken.throwIfRequested()}function K(a){this.defaults=a,this.interceptors={request:new Dh,response:new Dh}}function L(a){this.message=a}function M(a){if("function"!=typeof a)throw new TypeError("executor must be a function.");var b;this.promise=new ke(function(a){b=a});var c=this;a(function(a){c.reason||(c.reason=new Kh(a),b(c.reason))})}function N(a){var b=new Jh(a),c=gh(Jh.prototype.request,b);return jh.extend(c,Jh.prototype,b),jh.extend(c,b),c}function O(a){var b=yi.call(a,Ai),c=a[Ai];try{a[Ai]=void 0;var d=!0}catch(a){}var e=zi.call(a);return d&&(b?a[Ai]=c:delete a[Ai]),e}function P(a){return Di.call(a)}function Q(a){return null==a?void 0===a?Gi:Fi:Hi&&Hi in Object(a)?Bi(a):Ei(a)}function R(a,b){return function(c){return a(b(c))}}function S(a){return null!=a&&"object"==typeof a}function T(a){if(!Mi(a)||Ii(a)!=Ni)return!1;var b=Li(a);if(null===b)return!0;var c=Ri.call(b,"constructor")&&b.constructor;return"function"==typeof c&&c instanceof c&&Qi.call(c)==Si}function U(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}function V(a,b){var c=b||0,d=Rj;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function W(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"==a?new Array(16):null,a=null),a=a||{};var e=a.random||(a.rng||Qj)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,b)for(var f=0;f<16;++f)b[d+f]=e[f];return b||Tj(e)}function X(a){var b=a&&a.constructor;return a===("function"==typeof b&&b.prototype||kk)}function Y(a){if(!lk(a))return nk(a);var b=[];for(var c in Object(a))pk.call(a,c)&&"constructor"!=c&&b.push(c);return b}function Z(a){var b=typeof a;return null!=a&&("object"==b||"function"==b)}function $(a){if(!rk(a))return!1;var b=Ii(a);return b==tk||b==uk||b==sk||b==vk}function _(a){return!!zk&&zk in a}function aa(a){if(null!=a){try{return Ck.call(a)}catch(a){}try{return a+""}catch(a){}}return""}function ba(a){return!(!rk(a)||Ak(a))&&(wk(a)?Kk:Fk).test(Dk(a))}function ca(a,b){return null==a?void 0:a[b]}function da(a,b){var c=Mk(a,b);return Lk(c)?c:void 0}function ea(a){return Mi(a)&&Ii(a)==dl}function fa(a){return"number"==typeof a&&a>-1&&a%1==0&&a<=ml}function ga(a){return null!=a&&nl(a.length)&&!wk(a)}function ha(){return!1}function ia(a){return Mi(a)&&nl(a.length)&&!!rl[Ii(a)]}function ja(a){return function(b){return a(b)}}function ka(a){if(null==a)return!0;if(ol(a)&&(ll(a)||"string"==typeof a||"function"==typeof a.splice||ql(a)||xl(a)||jl(a)))return!a.length;var b=cl(a);if(b==yl||b==zl)return!a.size;if(lk(a))return!qk(a).length;for(var c in a)if(Bl.call(a,c))return!1;return!0}function la(){this.__data__=[],this.size=0}function ma(a,b){return a===b||a!==a&&b!==b}function na(a,b){for(var c=a.length;c--;)if(El(a[c][0],b))return c;return-1}function oa(a){var b=this.__data__,c=Fl(b,a);return!(c<0)&&(c==b.length-1?b.pop():Hl.call(b,c,1),--this.size,!0)}function pa(a){var b=this.__data__,c=Fl(b,a);return c<0?void 0:b[c][1]}function qa(a){return Fl(this.__data__,a)>-1}function ra(a,b){var c=this.__data__,d=Fl(c,a);return d<0?(++this.size,c.push([a,b])):c[d][1]=b,this}function sa(a){var b=-1,c=null==a?0:a.length;for(this.clear();++b-1&&a%1==0&&a0&&void 0!==arguments[0]?arguments[0]:{},b=a.signature,c=a.timestamp,d=a.nonce;if("string"!=typeof b||"number"!=typeof c||"string"!=typeof d)throw new Error("malformed signature");return{signature:b,timestamp:c,nonce:d}}function zb(a,b,c,d,e){var f={};return Object.keys(d).forEach(function(a){f[a]=d[a]}),f.enumerable=!!f.enumerable,f.configurable=!!f.configurable,("value"in f||f.initializer)&&(f.writable=!0),f=c.slice().reverse().reduce(function(c,d){return d(a,b,c)||c},f),e&&void 0!==f.initializer&&(f.value=f.initializer?f.initializer.call(e):void 0,f.initializer=void 0),void 0===f.initializer&&(Object.defineProperty(a,b,f),f=null),f}var Ab=window&&window.process||{};Ab.env=Ab.env||{};var Bb="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Cb=Math.ceil,Db=Math.floor,Eb=function(a){return isNaN(a=+a)?0:(a>0?Db:Cb)(a)},Fb=function(a){if(void 0==a)throw TypeError("Can't call method on  "+a);return a},Gb=d(function(a){var b=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=b)}),Hb=d(function(a){var b=a.exports={version:"2.5.1"};"number"==typeof __e&&(__e=b)}),Ib=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a},Jb=function(a,b,c){if(Ib(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},Kb=function(a){return"object"==typeof a?null!==a:"function"==typeof a},Lb=function(a){if(!Kb(a))throw TypeError(a+" is not an object!");return a},Mb=function(a){try{return!!a()}catch(a){return!0}},Nb=!Mb(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),Ob=Gb.document,Pb=Kb(Ob)&&Kb(Ob.createElement),Qb=function(a){return Pb?Ob.createElement(a):{}},Rb=!Nb&&!Mb(function(){return 7!=Object.defineProperty(Qb("div"),"a",{get:function(){return 7}}).a}),Sb=function(a,b){if(!Kb(a))return a;var c,d;if(b&&"function"==typeof(c=a.toString)&&!Kb(d=c.call(a)))return d;if("function"==typeof(c=a.valueOf)&&!Kb(d=c.call(a)))return d;if(!b&&"function"==typeof(c=a.toString)&&!Kb(d=c.call(a)))return d;throw TypeError("Can't convert object to primitive value")},Tb=Object.defineProperty,Ub=Nb?Object.defineProperty:function(a,b,c){if(Lb(a),b=Sb(b,!0),Lb(c),Rb)try{return Tb(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a},Vb={f:Ub},Wb=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}},Xb=Nb?function(a,b,c){return Vb.f(a,b,Wb(1,c))}:function(a,b,c){return a[b]=c,a},Yb=function(a,b,c){var d,e,f,g=a&Yb.F,h=a&Yb.G,i=a&Yb.S,j=a&Yb.P,k=a&Yb.B,l=a&Yb.W,m=h?Hb:Hb[b]||(Hb[b]={}),n=m.prototype,o=h?Gb:i?Gb[b]:(Gb[b]||{}).prototype;h&&(c=b);for(d in c)(e=!g&&o&&void 0!==o[d])&&d in m||(f=e?o[d]:c[d],m[d]=h&&"function"!=typeof o[d]?c[d]:k&&e?Jb(f,Gb):l&&o[d]==f?function(a){var b=function(b,c,d){if(this instanceof a){switch(arguments.length){case 0:return new a;case 1:return new a(b);case 2:return new a(b,c)}return new a(b,c,d)}return a.apply(this,arguments)};return b.prototype=a.prototype,b}(f):j&&"function"==typeof f?Jb(Function.call,f):f,j&&((m.virtual||(m.virtual={}))[d]=f,a&Yb.R&&n&&!n[d]&&Xb(n,d,f)))};Yb.F=1,Yb.G=2,Yb.S=4,Yb.P=8,Yb.B=16,Yb.W=32,Yb.U=64,Yb.R=128;var Zb=Yb,$b=Xb,_b={}.hasOwnProperty,ac=function(a,b){return _b.call(a,b)},bc={},cc={}.toString,dc=function(a){return cc.call(a).slice(8,-1)},ec=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==dc(a)?a.split(""):Object(a)},fc=function(a){return ec(Fb(a))},gc=Math.min,hc=function(a){return a>0?gc(Eb(a),9007199254740991):0},ic=Math.max,jc=Math.min,kc=function(a,b){return a=Eb(a),a<0?ic(a+b,0):jc(a,b)},lc=Gb["__core-js_shared__"]||(Gb["__core-js_shared__"]={}),mc=function(a){return lc[a]||(lc[a]={})},nc=0,oc=Math.random(),pc=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++nc+oc).toString(36))},qc=mc("keys"),rc=function(a){return qc[a]||(qc[a]=pc(a))},sc=function(a){return function(b,c,d){var e,f=fc(b),g=hc(f.length),h=kc(d,g);if(a&&c!=c){for(;g>h;)if((e=f[h++])!=e)return!0}else for(;g>h;h++)if((a||h in f)&&f[h]===c)return a||h||0;return!a&&-1}}(!1),tc=rc("IE_PROTO"),uc=function(a,b){var c,d=fc(a),e=0,f=[];for(c in d)c!=tc&&ac(d,c)&&f.push(c);for(;b.length>e;)ac(d,c=b[e++])&&(~sc(f,c)||f.push(c));return f},vc="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),wc=Object.keys||function(a){return uc(a,vc)},xc=Nb?Object.defineProperties:function(a,b){Lb(a);for(var c,d=wc(b),e=d.length,f=0;e>f;)Vb.f(a,c=d[f++],b[c]);return a},yc=Gb.document,zc=yc&&yc.documentElement,Ac=rc("IE_PROTO"),Bc=function(){},Cc=function(){var a,b=Qb("iframe"),c=vc.length;for(b.style.display="none",zc.appendChild(b),b.src="javascript:",a=b.contentWindow.document,a.open(),a.write("