3 * https://www.inboxsdk.com/
5 * The use of InboxSDK is governed by the Terms of Services located at
6 * https://www.inboxsdk.com/terms
9 * __ __ _ _ _ _ ___ _ _ ___
10 * / / /\ \ \__ _ _ __ | |_ | |_ ___ | |__ __ _ ___| | __ ___ _ __ / _ \_ __ ___ __ _(_) / _ \
11 * \ \/ \/ / _` | '_ \| __| | __/ _ \ | '_ \ / _` |/ __| |/ / / _ \| '_ \ / /_\/ '_ ` _ \ / _` | | \// /
12 * \ /\ / (_| | | | | |_ | || (_) | | | | | (_| | (__| < | (_) | | | | / /_\\| | | | | | (_| | | | \/
13 * \/ \/ \__,_|_| |_|\__| \__\___/ |_| |_|\__,_|\___|_|\_\ \___/|_| |_| \____/|_| |_| |_|\__,_|_|_| ()
15 * Like complex reverse engineering? Want to make Gmail and Inbox a hackable platform?
17 * Join us at: www.streak.com/careers?source=sdk
20 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
21 module.exports = { "default": require("core-js/library/fn/json/stringify"), __esModule: true };
22 },{"core-js/library/fn/json/stringify":3}],2:[function(require,module,exports){
23 module.exports = { "default": require("core-js/library/fn/object/assign"), __esModule: true };
24 },{"core-js/library/fn/object/assign":4}],3:[function(require,module,exports){
25 var core = require('../../modules/_core')
26 , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify});
27 module.exports = function stringify(it){ // eslint-disable-line no-unused-vars
28 return $JSON.stringify.apply($JSON, arguments);
30 },{"../../modules/_core":9}],4:[function(require,module,exports){
31 require('../../modules/es6.object.assign');
32 module.exports = require('../../modules/_core').Object.assign;
33 },{"../../modules/_core":9,"../../modules/es6.object.assign":39}],5:[function(require,module,exports){
34 module.exports = function(it){
35 if(typeof it != 'function')throw TypeError(it + ' is not a function!');
38 },{}],6:[function(require,module,exports){
39 var isObject = require('./_is-object');
40 module.exports = function(it){
41 if(!isObject(it))throw TypeError(it + ' is not an object!');
44 },{"./_is-object":22}],7:[function(require,module,exports){
45 // false -> Array#indexOf
46 // true -> Array#includes
47 var toIObject = require('./_to-iobject')
48 , toLength = require('./_to-length')
49 , toIndex = require('./_to-index');
50 module.exports = function(IS_INCLUDES){
51 return function($this, el, fromIndex){
52 var O = toIObject($this)
53 , length = toLength(O.length)
54 , index = toIndex(fromIndex, length)
56 // Array#includes uses SameValueZero equality algorithm
57 if(IS_INCLUDES && el != el)while(length > index){
59 if(value != value)return true;
60 // Array#toIndex ignores holes, Array#includes - not
61 } else for(;length > index; index++)if(IS_INCLUDES || index in O){
62 if(O[index] === el)return IS_INCLUDES || index || 0;
63 } return !IS_INCLUDES && -1;
66 },{"./_to-index":32,"./_to-iobject":34,"./_to-length":35}],8:[function(require,module,exports){
67 var toString = {}.toString;
69 module.exports = function(it){
70 return toString.call(it).slice(8, -1);
72 },{}],9:[function(require,module,exports){
73 var core = module.exports = {version: '2.4.0'};
74 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
75 },{}],10:[function(require,module,exports){
76 // optional / simple context binding
77 var aFunction = require('./_a-function');
78 module.exports = function(fn, that, length){
80 if(that === undefined)return fn;
82 case 1: return function(a){
83 return fn.call(that, a);
85 case 2: return function(a, b){
86 return fn.call(that, a, b);
88 case 3: return function(a, b, c){
89 return fn.call(that, a, b, c);
92 return function(/* ...args */){
93 return fn.apply(that, arguments);
96 },{"./_a-function":5}],11:[function(require,module,exports){
97 // 7.2.1 RequireObjectCoercible(argument)
98 module.exports = function(it){
99 if(it == undefined)throw TypeError("Can't call method on " + it);
102 },{}],12:[function(require,module,exports){
103 // Thank's IE8 for his funny defineProperty
104 module.exports = !require('./_fails')(function(){
105 return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
107 },{"./_fails":16}],13:[function(require,module,exports){
108 var isObject = require('./_is-object')
109 , document = require('./_global').document
110 // in old IE typeof document.createElement is 'object'
111 , is = isObject(document) && isObject(document.createElement);
112 module.exports = function(it){
113 return is ? document.createElement(it) : {};
115 },{"./_global":17,"./_is-object":22}],14:[function(require,module,exports){
116 // IE 8- don't enum bug keys
\r
118 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
\r
120 },{}],15:[function(require,module,exports){
121 var global = require('./_global')
122 , core = require('./_core')
123 , ctx = require('./_ctx')
124 , hide = require('./_hide')
125 , PROTOTYPE = 'prototype';
127 var $export = function(type, name, source){
128 var IS_FORCED = type & $export.F
129 , IS_GLOBAL = type & $export.G
130 , IS_STATIC = type & $export.S
131 , IS_PROTO = type & $export.P
132 , IS_BIND = type & $export.B
133 , IS_WRAP = type & $export.W
134 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
135 , expProto = exports[PROTOTYPE]
136 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
138 if(IS_GLOBAL)source = name;
140 // contains in native
141 own = !IS_FORCED && target && target[key] !== undefined;
142 if(own && key in exports)continue;
143 // export native or passed
144 out = own ? target[key] : source[key];
145 // prevent global pollution for namespaces
146 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
147 // bind timers to global for call from export context
148 : IS_BIND && own ? ctx(out, global)
149 // wrap global constructors for prevent change them in library
150 : IS_WRAP && target[key] == out ? (function(C){
151 var F = function(a, b, c){
152 if(this instanceof C){
153 switch(arguments.length){
154 case 0: return new C;
155 case 1: return new C(a);
156 case 2: return new C(a, b);
157 } return new C(a, b, c);
158 } return C.apply(this, arguments);
160 F[PROTOTYPE] = C[PROTOTYPE];
162 // make static versions for prototype methods
163 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
164 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
166 (exports.virtual || (exports.virtual = {}))[key] = out;
167 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
168 if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
173 $export.F = 1; // forced
174 $export.G = 2; // global
175 $export.S = 4; // static
176 $export.P = 8; // proto
177 $export.B = 16; // bind
178 $export.W = 32; // wrap
179 $export.U = 64; // safe
180 $export.R = 128; // real proto method for `library`
181 module.exports = $export;
182 },{"./_core":9,"./_ctx":10,"./_global":17,"./_hide":19}],16:[function(require,module,exports){
183 module.exports = function(exec){
190 },{}],17:[function(require,module,exports){
191 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
192 var global = module.exports = typeof window != 'undefined' && window.Math == Math
193 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
194 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
195 },{}],18:[function(require,module,exports){
196 var hasOwnProperty = {}.hasOwnProperty;
197 module.exports = function(it, key){
198 return hasOwnProperty.call(it, key);
200 },{}],19:[function(require,module,exports){
201 var dP = require('./_object-dp')
202 , createDesc = require('./_property-desc');
203 module.exports = require('./_descriptors') ? function(object, key, value){
204 return dP.f(object, key, createDesc(1, value));
205 } : function(object, key, value){
209 },{"./_descriptors":12,"./_object-dp":24,"./_property-desc":29}],20:[function(require,module,exports){
210 module.exports = !require('./_descriptors') && !require('./_fails')(function(){
\r
211 return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;
\r
213 },{"./_descriptors":12,"./_dom-create":13,"./_fails":16}],21:[function(require,module,exports){
214 // fallback for non-array-like ES3 and non-enumerable old V8 strings
215 var cof = require('./_cof');
216 module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
217 return cof(it) == 'String' ? it.split('') : Object(it);
219 },{"./_cof":8}],22:[function(require,module,exports){
220 module.exports = function(it){
221 return typeof it === 'object' ? it !== null : typeof it === 'function';
223 },{}],23:[function(require,module,exports){
225 // 19.1.2.1 Object.assign(target, source, ...)
226 var getKeys = require('./_object-keys')
227 , gOPS = require('./_object-gops')
228 , pIE = require('./_object-pie')
229 , toObject = require('./_to-object')
230 , IObject = require('./_iobject')
231 , $assign = Object.assign;
233 // should work with symbols and should have deterministic property order (V8 bug)
234 module.exports = !$assign || require('./_fails')(function(){
238 , K = 'abcdefghijklmnopqrst';
240 K.split('').forEach(function(k){ B[k] = k; });
241 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
242 }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
243 var T = toObject(target)
244 , aLen = arguments.length
246 , getSymbols = gOPS.f
249 var S = IObject(arguments[index++])
250 , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
251 , length = keys.length
254 while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
257 },{"./_fails":16,"./_iobject":21,"./_object-gops":25,"./_object-keys":27,"./_object-pie":28,"./_to-object":36}],24:[function(require,module,exports){
258 var anObject = require('./_an-object')
259 , IE8_DOM_DEFINE = require('./_ie8-dom-define')
260 , toPrimitive = require('./_to-primitive')
261 , dP = Object.defineProperty;
263 exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){
265 P = toPrimitive(P, true);
266 anObject(Attributes);
267 if(IE8_DOM_DEFINE)try {
268 return dP(O, P, Attributes);
269 } catch(e){ /* empty */ }
270 if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
271 if('value' in Attributes)O[P] = Attributes.value;
274 },{"./_an-object":6,"./_descriptors":12,"./_ie8-dom-define":20,"./_to-primitive":37}],25:[function(require,module,exports){
275 exports.f = Object.getOwnPropertySymbols;
276 },{}],26:[function(require,module,exports){
277 var has = require('./_has')
\r
278 , toIObject = require('./_to-iobject')
\r
279 , arrayIndexOf = require('./_array-includes')(false)
\r
280 , IE_PROTO = require('./_shared-key')('IE_PROTO');
\r
282 module.exports = function(object, names){
\r
283 var O = toIObject(object)
\r
287 for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
\r
288 // Don't enum bug & hidden keys
\r
289 while(names.length > i)if(has(O, key = names[i++])){
\r
290 ~arrayIndexOf(result, key) || result.push(key);
\r
294 },{"./_array-includes":7,"./_has":18,"./_shared-key":30,"./_to-iobject":34}],27:[function(require,module,exports){
295 // 19.1.2.14 / 15.2.3.14 Object.keys(O)
\r
296 var $keys = require('./_object-keys-internal')
\r
297 , enumBugKeys = require('./_enum-bug-keys');
\r
299 module.exports = Object.keys || function keys(O){
\r
300 return $keys(O, enumBugKeys);
\r
302 },{"./_enum-bug-keys":14,"./_object-keys-internal":26}],28:[function(require,module,exports){
303 exports.f = {}.propertyIsEnumerable;
304 },{}],29:[function(require,module,exports){
305 module.exports = function(bitmap, value){
307 enumerable : !(bitmap & 1),
308 configurable: !(bitmap & 2),
309 writable : !(bitmap & 4),
313 },{}],30:[function(require,module,exports){
314 var shared = require('./_shared')('keys')
\r
315 , uid = require('./_uid');
\r
316 module.exports = function(key){
\r
317 return shared[key] || (shared[key] = uid(key));
\r
319 },{"./_shared":31,"./_uid":38}],31:[function(require,module,exports){
320 var global = require('./_global')
321 , SHARED = '__core-js_shared__'
322 , store = global[SHARED] || (global[SHARED] = {});
323 module.exports = function(key){
324 return store[key] || (store[key] = {});
326 },{"./_global":17}],32:[function(require,module,exports){
327 var toInteger = require('./_to-integer')
330 module.exports = function(index, length){
331 index = toInteger(index);
332 return index < 0 ? max(index + length, 0) : min(index, length);
334 },{"./_to-integer":33}],33:[function(require,module,exports){
337 , floor = Math.floor;
338 module.exports = function(it){
339 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
341 },{}],34:[function(require,module,exports){
342 // to indexed object, toObject with fallback for non-array-like ES3 strings
343 var IObject = require('./_iobject')
344 , defined = require('./_defined');
345 module.exports = function(it){
346 return IObject(defined(it));
348 },{"./_defined":11,"./_iobject":21}],35:[function(require,module,exports){
350 var toInteger = require('./_to-integer')
352 module.exports = function(it){
353 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
355 },{"./_to-integer":33}],36:[function(require,module,exports){
356 // 7.1.13 ToObject(argument)
357 var defined = require('./_defined');
358 module.exports = function(it){
359 return Object(defined(it));
361 },{"./_defined":11}],37:[function(require,module,exports){
362 // 7.1.1 ToPrimitive(input [, PreferredType])
363 var isObject = require('./_is-object');
364 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
365 // and the second argument - flag - preferred type is a string
366 module.exports = function(it, S){
367 if(!isObject(it))return it;
369 if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
370 if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
371 if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
372 throw TypeError("Can't convert object to primitive value");
374 },{"./_is-object":22}],38:[function(require,module,exports){
376 , px = Math.random();
377 module.exports = function(key){
378 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
380 },{}],39:[function(require,module,exports){
381 // 19.1.3.1 Object.assign(target, source)
382 var $export = require('./_export');
384 $export($export.S + $export.F, 'Object', {assign: require('./_object-assign')});
385 },{"./_export":15,"./_object-assign":23}],40:[function(require,module,exports){
386 var isArray = require('../lang/isArray');
389 * The inverse of `_.pairs`; this method returns an object composed from arrays
390 * of property names and values. Provide either a single two dimensional array,
391 * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
392 * and one of corresponding values.
398 * @param {Array} props The property names.
399 * @param {Array} [values=[]] The property values.
400 * @returns {Object} Returns the new object.
403 * _.zipObject([['fred', 30], ['barney', 40]]);
404 * // => { 'fred': 30, 'barney': 40 }
406 * _.zipObject(['fred', 'barney'], [30, 40]);
407 * // => { 'fred': 30, 'barney': 40 }
409 function zipObject(props, values) {
411 length = props ? props.length : 0,
414 if (length && !values && !isArray(props[0])) {
417 while (++index < length) {
418 var key = props[index];
420 result[key] = values[index];
422 result[key[0]] = key[1];
428 module.exports = zipObject;
430 },{"../lang/isArray":61}],41:[function(require,module,exports){
431 /** Used as the `TypeError` message for "Functions" methods. */
432 var FUNC_ERROR_TEXT = 'Expected a function';
435 * Creates a function that invokes `func`, with the `this` binding and arguments
436 * of the created function, while it's called less than `n` times. Subsequent
437 * calls to the created function return the result of the last `func` invocation.
442 * @param {number} n The number of calls at which `func` is no longer invoked.
443 * @param {Function} func The function to restrict.
444 * @returns {Function} Returns the new restricted function.
447 * jQuery('#add').on('click', _.before(5, addContactToList));
448 * // => allows adding up to 4 contacts to the list
450 function before(n, func) {
452 if (typeof func != 'function') {
453 if (typeof n == 'function') {
458 throw new TypeError(FUNC_ERROR_TEXT);
463 result = func.apply(this, arguments);
472 module.exports = before;
474 },{}],42:[function(require,module,exports){
475 var baseDelay = require('../internal/baseDelay'),
476 restParam = require('./restParam');
479 * Defers invoking the `func` until the current call stack has cleared. Any
480 * additional arguments are provided to `func` when it's invoked.
485 * @param {Function} func The function to defer.
486 * @param {...*} [args] The arguments to invoke the function with.
487 * @returns {number} Returns the timer id.
490 * _.defer(function(text) {
493 * // logs 'deferred' after one or more milliseconds
495 var defer = restParam(function(func, args) {
496 return baseDelay(func, 1, args);
499 module.exports = defer;
501 },{"../internal/baseDelay":45,"./restParam":44}],43:[function(require,module,exports){
502 var before = require('./before');
505 * Creates a function that is restricted to invoking `func` once. Repeat calls
506 * to the function return the value of the first call. The `func` is invoked
507 * with the `this` binding and arguments of the created function.
512 * @param {Function} func The function to restrict.
513 * @returns {Function} Returns the new restricted function.
516 * var initialize = _.once(createApplication);
519 * // `initialize` invokes `createApplication` once
521 function once(func) {
522 return before(2, func);
525 module.exports = once;
527 },{"./before":41}],44:[function(require,module,exports){
528 /** Used as the `TypeError` message for "Functions" methods. */
529 var FUNC_ERROR_TEXT = 'Expected a function';
531 /* Native method references for those with the same name as other `lodash` methods. */
532 var nativeMax = Math.max;
535 * Creates a function that invokes `func` with the `this` binding of the
536 * created function and arguments from `start` and beyond provided as an array.
538 * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
543 * @param {Function} func The function to apply a rest parameter to.
544 * @param {number} [start=func.length-1] The start position of the rest parameter.
545 * @returns {Function} Returns the new function.
548 * var say = _.restParam(function(what, names) {
549 * return what + ' ' + _.initial(names).join(', ') +
550 * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
553 * say('hello', 'fred', 'barney', 'pebbles');
554 * // => 'hello fred, barney, & pebbles'
556 function restParam(func, start) {
557 if (typeof func != 'function') {
558 throw new TypeError(FUNC_ERROR_TEXT);
560 start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
562 var args = arguments,
564 length = nativeMax(args.length - start, 0),
565 rest = Array(length);
567 while (++index < length) {
568 rest[index] = args[start + index];
571 case 0: return func.call(this, rest);
572 case 1: return func.call(this, args[0], rest);
573 case 2: return func.call(this, args[0], args[1], rest);
575 var otherArgs = Array(start + 1);
577 while (++index < start) {
578 otherArgs[index] = args[index];
580 otherArgs[start] = rest;
581 return func.apply(this, otherArgs);
585 module.exports = restParam;
587 },{}],45:[function(require,module,exports){
588 /** Used as the `TypeError` message for "Functions" methods. */
589 var FUNC_ERROR_TEXT = 'Expected a function';
592 * The base implementation of `_.delay` and `_.defer` which accepts an index
593 * of where to slice the arguments to provide to `func`.
596 * @param {Function} func The function to delay.
597 * @param {number} wait The number of milliseconds to delay invocation.
598 * @param {Object} args The arguments provide to `func`.
599 * @returns {number} Returns the timer id.
601 function baseDelay(func, wait, args) {
602 if (typeof func != 'function') {
603 throw new TypeError(FUNC_ERROR_TEXT);
605 return setTimeout(function() { func.apply(undefined, args); }, wait);
608 module.exports = baseDelay;
610 },{}],46:[function(require,module,exports){
611 var createBaseFor = require('./createBaseFor');
614 * The base implementation of `baseForIn` and `baseForOwn` which iterates
615 * over `object` properties returned by `keysFunc` invoking `iteratee` for
616 * each property. Iteratee functions may exit iteration early by explicitly
620 * @param {Object} object The object to iterate over.
621 * @param {Function} iteratee The function invoked per iteration.
622 * @param {Function} keysFunc The function to get the keys of `object`.
623 * @returns {Object} Returns `object`.
625 var baseFor = createBaseFor();
627 module.exports = baseFor;
629 },{"./createBaseFor":50}],47:[function(require,module,exports){
630 var baseFor = require('./baseFor'),
631 keys = require('../object/keys');
634 * The base implementation of `_.forOwn` without support for callback
635 * shorthands and `this` binding.
638 * @param {Object} object The object to iterate over.
639 * @param {Function} iteratee The function invoked per iteration.
640 * @returns {Object} Returns `object`.
642 function baseForOwn(object, iteratee) {
643 return baseFor(object, iteratee, keys);
646 module.exports = baseForOwn;
648 },{"../object/keys":66,"./baseFor":46}],48:[function(require,module,exports){
650 * The base implementation of `_.property` without support for deep paths.
653 * @param {string} key The key of the property to get.
654 * @returns {Function} Returns the new function.
656 function baseProperty(key) {
657 return function(object) {
658 return object == null ? undefined : object[key];
662 module.exports = baseProperty;
664 },{}],49:[function(require,module,exports){
665 var identity = require('../utility/identity');
668 * A specialized version of `baseCallback` which only supports `this` binding
669 * and specifying the number of arguments to provide to `func`.
672 * @param {Function} func The function to bind.
673 * @param {*} thisArg The `this` binding of `func`.
674 * @param {number} [argCount] The number of arguments to provide to `func`.
675 * @returns {Function} Returns the callback.
677 function bindCallback(func, thisArg, argCount) {
678 if (typeof func != 'function') {
681 if (thisArg === undefined) {
685 case 1: return function(value) {
686 return func.call(thisArg, value);
688 case 3: return function(value, index, collection) {
689 return func.call(thisArg, value, index, collection);
691 case 4: return function(accumulator, value, index, collection) {
692 return func.call(thisArg, accumulator, value, index, collection);
694 case 5: return function(value, other, key, object, source) {
695 return func.call(thisArg, value, other, key, object, source);
699 return func.apply(thisArg, arguments);
703 module.exports = bindCallback;
705 },{"../utility/identity":68}],50:[function(require,module,exports){
706 var toObject = require('./toObject');
709 * Creates a base function for `_.forIn` or `_.forInRight`.
712 * @param {boolean} [fromRight] Specify iterating from right to left.
713 * @returns {Function} Returns the new base function.
715 function createBaseFor(fromRight) {
716 return function(object, iteratee, keysFunc) {
717 var iterable = toObject(object),
718 props = keysFunc(object),
719 length = props.length,
720 index = fromRight ? length : -1;
722 while ((fromRight ? index-- : ++index < length)) {
723 var key = props[index];
724 if (iteratee(iterable[key], key, iterable) === false) {
732 module.exports = createBaseFor;
734 },{"./toObject":59}],51:[function(require,module,exports){
735 var bindCallback = require('./bindCallback');
738 * Creates a function for `_.forOwn` or `_.forOwnRight`.
741 * @param {Function} objectFunc The function to iterate over an object.
742 * @returns {Function} Returns the new each function.
744 function createForOwn(objectFunc) {
745 return function(object, iteratee, thisArg) {
746 if (typeof iteratee != 'function' || thisArg !== undefined) {
747 iteratee = bindCallback(iteratee, thisArg, 3);
749 return objectFunc(object, iteratee);
753 module.exports = createForOwn;
755 },{"./bindCallback":49}],52:[function(require,module,exports){
756 var baseProperty = require('./baseProperty');
759 * Gets the "length" property value of `object`.
761 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
762 * that affects Safari on at least iOS 8.1-8.3 ARM64.
765 * @param {Object} object The object to query.
766 * @returns {*} Returns the "length" value.
768 var getLength = baseProperty('length');
770 module.exports = getLength;
772 },{"./baseProperty":48}],53:[function(require,module,exports){
773 var isNative = require('../lang/isNative');
776 * Gets the native function at `key` of `object`.
779 * @param {Object} object The object to query.
780 * @param {string} key The key of the method to get.
781 * @returns {*} Returns the function if it's native, else `undefined`.
783 function getNative(object, key) {
784 var value = object == null ? undefined : object[key];
785 return isNative(value) ? value : undefined;
788 module.exports = getNative;
790 },{"../lang/isNative":63}],54:[function(require,module,exports){
791 var getLength = require('./getLength'),
792 isLength = require('./isLength');
795 * Checks if `value` is array-like.
798 * @param {*} value The value to check.
799 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
801 function isArrayLike(value) {
802 return value != null && isLength(getLength(value));
805 module.exports = isArrayLike;
807 },{"./getLength":52,"./isLength":56}],55:[function(require,module,exports){
808 /** Used to detect unsigned integer values. */
809 var reIsUint = /^\d+$/;
812 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
813 * of an array-like value.
815 var MAX_SAFE_INTEGER = 9007199254740991;
818 * Checks if `value` is a valid array-like index.
821 * @param {*} value The value to check.
822 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
823 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
825 function isIndex(value, length) {
826 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
827 length = length == null ? MAX_SAFE_INTEGER : length;
828 return value > -1 && value % 1 == 0 && value < length;
831 module.exports = isIndex;
833 },{}],56:[function(require,module,exports){
835 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
836 * of an array-like value.
838 var MAX_SAFE_INTEGER = 9007199254740991;
841 * Checks if `value` is a valid array-like length.
843 * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
846 * @param {*} value The value to check.
847 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
849 function isLength(value) {
850 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
853 module.exports = isLength;
855 },{}],57:[function(require,module,exports){
857 * Checks if `value` is object-like.
860 * @param {*} value The value to check.
861 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
863 function isObjectLike(value) {
864 return !!value && typeof value == 'object';
867 module.exports = isObjectLike;
869 },{}],58:[function(require,module,exports){
870 var isArguments = require('../lang/isArguments'),
871 isArray = require('../lang/isArray'),
872 isIndex = require('./isIndex'),
873 isLength = require('./isLength'),
874 keysIn = require('../object/keysIn');
876 /** Used for native method references. */
877 var objectProto = Object.prototype;
879 /** Used to check objects for own properties. */
880 var hasOwnProperty = objectProto.hasOwnProperty;
883 * A fallback implementation of `Object.keys` which creates an array of the
884 * own enumerable property names of `object`.
887 * @param {Object} object The object to query.
888 * @returns {Array} Returns the array of property names.
890 function shimKeys(object) {
891 var props = keysIn(object),
892 propsLength = props.length,
893 length = propsLength && object.length;
895 var allowIndexes = !!length && isLength(length) &&
896 (isArray(object) || isArguments(object));
901 while (++index < propsLength) {
902 var key = props[index];
903 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
910 module.exports = shimKeys;
912 },{"../lang/isArguments":60,"../lang/isArray":61,"../object/keysIn":67,"./isIndex":55,"./isLength":56}],59:[function(require,module,exports){
913 var isObject = require('../lang/isObject');
916 * Converts `value` to an object if it's not one.
919 * @param {*} value The value to process.
920 * @returns {Object} Returns the object.
922 function toObject(value) {
923 return isObject(value) ? value : Object(value);
926 module.exports = toObject;
928 },{"../lang/isObject":64}],60:[function(require,module,exports){
929 var isArrayLike = require('../internal/isArrayLike'),
930 isObjectLike = require('../internal/isObjectLike');
932 /** Used for native method references. */
933 var objectProto = Object.prototype;
935 /** Used to check objects for own properties. */
936 var hasOwnProperty = objectProto.hasOwnProperty;
938 /** Native method references. */
939 var propertyIsEnumerable = objectProto.propertyIsEnumerable;
942 * Checks if `value` is classified as an `arguments` object.
947 * @param {*} value The value to check.
948 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
951 * _.isArguments(function() { return arguments; }());
954 * _.isArguments([1, 2, 3]);
957 function isArguments(value) {
958 return isObjectLike(value) && isArrayLike(value) &&
959 hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
962 module.exports = isArguments;
964 },{"../internal/isArrayLike":54,"../internal/isObjectLike":57}],61:[function(require,module,exports){
965 var getNative = require('../internal/getNative'),
966 isLength = require('../internal/isLength'),
967 isObjectLike = require('../internal/isObjectLike');
969 /** `Object#toString` result references. */
970 var arrayTag = '[object Array]';
972 /** Used for native method references. */
973 var objectProto = Object.prototype;
976 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
979 var objToString = objectProto.toString;
981 /* Native method references for those with the same name as other `lodash` methods. */
982 var nativeIsArray = getNative(Array, 'isArray');
985 * Checks if `value` is classified as an `Array` object.
990 * @param {*} value The value to check.
991 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
994 * _.isArray([1, 2, 3]);
997 * _.isArray(function() { return arguments; }());
1000 var isArray = nativeIsArray || function(value) {
1001 return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
1004 module.exports = isArray;
1006 },{"../internal/getNative":53,"../internal/isLength":56,"../internal/isObjectLike":57}],62:[function(require,module,exports){
1007 var isObject = require('./isObject');
1009 /** `Object#toString` result references. */
1010 var funcTag = '[object Function]';
1012 /** Used for native method references. */
1013 var objectProto = Object.prototype;
1016 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
1019 var objToString = objectProto.toString;
1022 * Checks if `value` is classified as a `Function` object.
1027 * @param {*} value The value to check.
1028 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
1034 * _.isFunction(/abc/);
1037 function isFunction(value) {
1038 // The use of `Object#toString` avoids issues with the `typeof` operator
1039 // in older versions of Chrome and Safari which return 'function' for regexes
1040 // and Safari 8 which returns 'object' for typed array constructors.
1041 return isObject(value) && objToString.call(value) == funcTag;
1044 module.exports = isFunction;
1046 },{"./isObject":64}],63:[function(require,module,exports){
1047 var isFunction = require('./isFunction'),
1048 isObjectLike = require('../internal/isObjectLike');
1050 /** Used to detect host constructors (Safari > 5). */
1051 var reIsHostCtor = /^\[object .+?Constructor\]$/;
1053 /** Used for native method references. */
1054 var objectProto = Object.prototype;
1056 /** Used to resolve the decompiled source of functions. */
1057 var fnToString = Function.prototype.toString;
1059 /** Used to check objects for own properties. */
1060 var hasOwnProperty = objectProto.hasOwnProperty;
1062 /** Used to detect if a method is native. */
1063 var reIsNative = RegExp('^' +
1064 fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1065 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1069 * Checks if `value` is a native function.
1074 * @param {*} value The value to check.
1075 * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
1078 * _.isNative(Array.prototype.push);
1084 function isNative(value) {
1085 if (value == null) {
1088 if (isFunction(value)) {
1089 return reIsNative.test(fnToString.call(value));
1091 return isObjectLike(value) && reIsHostCtor.test(value);
1094 module.exports = isNative;
1096 },{"../internal/isObjectLike":57,"./isFunction":62}],64:[function(require,module,exports){
1098 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
1099 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1104 * @param {*} value The value to check.
1105 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1111 * _.isObject([1, 2, 3]);
1117 function isObject(value) {
1118 // Avoid a V8 JIT bug in Chrome 19-20.
1119 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
1120 var type = typeof value;
1121 return !!value && (type == 'object' || type == 'function');
1124 module.exports = isObject;
1126 },{}],65:[function(require,module,exports){
1127 var baseForOwn = require('../internal/baseForOwn'),
1128 createForOwn = require('../internal/createForOwn');
1131 * Iterates over own enumerable properties of an object invoking `iteratee`
1132 * for each property. The `iteratee` is bound to `thisArg` and invoked with
1133 * three arguments: (value, key, object). Iteratee functions may exit iteration
1134 * early by explicitly returning `false`.
1139 * @param {Object} object The object to iterate over.
1140 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
1141 * @param {*} [thisArg] The `this` binding of `iteratee`.
1142 * @returns {Object} Returns `object`.
1150 * Foo.prototype.c = 3;
1152 * _.forOwn(new Foo, function(value, key) {
1155 * // => logs 'a' and 'b' (iteration order is not guaranteed)
1157 var forOwn = createForOwn(baseForOwn);
1159 module.exports = forOwn;
1161 },{"../internal/baseForOwn":47,"../internal/createForOwn":51}],66:[function(require,module,exports){
1162 var getNative = require('../internal/getNative'),
1163 isArrayLike = require('../internal/isArrayLike'),
1164 isObject = require('../lang/isObject'),
1165 shimKeys = require('../internal/shimKeys');
1167 /* Native method references for those with the same name as other `lodash` methods. */
1168 var nativeKeys = getNative(Object, 'keys');
1171 * Creates an array of the own enumerable property names of `object`.
1173 * **Note:** Non-object values are coerced to objects. See the
1174 * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
1180 * @param {Object} object The object to query.
1181 * @returns {Array} Returns the array of property names.
1189 * Foo.prototype.c = 3;
1192 * // => ['a', 'b'] (iteration order is not guaranteed)
1197 var keys = !nativeKeys ? shimKeys : function(object) {
1198 var Ctor = object == null ? undefined : object.constructor;
1199 if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
1200 (typeof object != 'function' && isArrayLike(object))) {
1201 return shimKeys(object);
1203 return isObject(object) ? nativeKeys(object) : [];
1206 module.exports = keys;
1208 },{"../internal/getNative":53,"../internal/isArrayLike":54,"../internal/shimKeys":58,"../lang/isObject":64}],67:[function(require,module,exports){
1209 var isArguments = require('../lang/isArguments'),
1210 isArray = require('../lang/isArray'),
1211 isIndex = require('../internal/isIndex'),
1212 isLength = require('../internal/isLength'),
1213 isObject = require('../lang/isObject');
1215 /** Used for native method references. */
1216 var objectProto = Object.prototype;
1218 /** Used to check objects for own properties. */
1219 var hasOwnProperty = objectProto.hasOwnProperty;
1222 * Creates an array of the own and inherited enumerable property names of `object`.
1224 * **Note:** Non-object values are coerced to objects.
1229 * @param {Object} object The object to query.
1230 * @returns {Array} Returns the array of property names.
1238 * Foo.prototype.c = 3;
1240 * _.keysIn(new Foo);
1241 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1243 function keysIn(object) {
1244 if (object == null) {
1247 if (!isObject(object)) {
1248 object = Object(object);
1250 var length = object.length;
1251 length = (length && isLength(length) &&
1252 (isArray(object) || isArguments(object)) && length) || 0;
1254 var Ctor = object.constructor,
1256 isProto = typeof Ctor == 'function' && Ctor.prototype === object,
1257 result = Array(length),
1258 skipIndexes = length > 0;
1260 while (++index < length) {
1261 result[index] = (index + '');
1263 for (var key in object) {
1264 if (!(skipIndexes && isIndex(key, length)) &&
1265 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
1272 module.exports = keysIn;
1274 },{"../internal/isIndex":55,"../internal/isLength":56,"../lang/isArguments":60,"../lang/isArray":61,"../lang/isObject":64}],68:[function(require,module,exports){
1276 * This method returns the first argument provided to it.
1281 * @param {*} value Any value.
1282 * @returns {*} Returns `value`.
1285 * var object = { 'user': 'fred' };
1287 * _.identity(object) === object;
1290 function identity(value) {
1294 module.exports = identity;
1296 },{}],69:[function(require,module,exports){
1297 // Copyright Joyent, Inc. and other Node contributors.
1299 // Permission is hereby granted, free of charge, to any person obtaining a
1300 // copy of this software and associated documentation files (the
1301 // "Software"), to deal in the Software without restriction, including
1302 // without limitation the rights to use, copy, modify, merge, publish,
1303 // distribute, sublicense, and/or sell copies of the Software, and to permit
1304 // persons to whom the Software is furnished to do so, subject to the
1305 // following conditions:
1307 // The above copyright notice and this permission notice shall be included
1308 // in all copies or substantial portions of the Software.
1310 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1311 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1312 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1313 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1314 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1315 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1316 // USE OR OTHER DEALINGS IN THE SOFTWARE.
1320 // If obj.hasOwnProperty has been overridden, then calling
1321 // obj.hasOwnProperty(prop) will break.
1322 // See: https://github.com/joyent/node/issues/1707
1323 function hasOwnProperty(obj, prop) {
1324 return Object.prototype.hasOwnProperty.call(obj, prop);
1327 module.exports = function(qs, sep, eq, options) {
1332 if (typeof qs !== 'string' || qs.length === 0) {
1340 if (options && typeof options.maxKeys === 'number') {
1341 maxKeys = options.maxKeys;
1344 var len = qs.length;
1345 // maxKeys <= 0 means that we should not limit keys count
1346 if (maxKeys > 0 && len > maxKeys) {
1350 for (var i = 0; i < len; ++i) {
1351 var x = qs[i].replace(regexp, '%20'),
1352 idx = x.indexOf(eq),
1356 kstr = x.substr(0, idx);
1357 vstr = x.substr(idx + 1);
1363 k = decodeURIComponent(kstr);
1364 v = decodeURIComponent(vstr);
1366 if (!hasOwnProperty(obj, k)) {
1368 } else if (isArray(obj[k])) {
1371 obj[k] = [obj[k], v];
1378 var isArray = Array.isArray || function (xs) {
1379 return Object.prototype.toString.call(xs) === '[object Array]';
1382 },{}],70:[function(require,module,exports){
1383 // Copyright Joyent, Inc. and other Node contributors.
1385 // Permission is hereby granted, free of charge, to any person obtaining a
1386 // copy of this software and associated documentation files (the
1387 // "Software"), to deal in the Software without restriction, including
1388 // without limitation the rights to use, copy, modify, merge, publish,
1389 // distribute, sublicense, and/or sell copies of the Software, and to permit
1390 // persons to whom the Software is furnished to do so, subject to the
1391 // following conditions:
1393 // The above copyright notice and this permission notice shall be included
1394 // in all copies or substantial portions of the Software.
1396 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1397 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1398 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1399 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1400 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1401 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1402 // USE OR OTHER DEALINGS IN THE SOFTWARE.
1406 var stringifyPrimitive = function(v) {
1412 return v ? 'true' : 'false';
1415 return isFinite(v) ? v : '';
1422 module.exports = function(obj, sep, eq, name) {
1429 if (typeof obj === 'object') {
1430 return map(objectKeys(obj), function(k) {
1431 var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
1432 if (isArray(obj[k])) {
1433 return map(obj[k], function(v) {
1434 return ks + encodeURIComponent(stringifyPrimitive(v));
1437 return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
1443 if (!name) return '';
1444 return encodeURIComponent(stringifyPrimitive(name)) + eq +
1445 encodeURIComponent(stringifyPrimitive(obj));
1448 var isArray = Array.isArray || function (xs) {
1449 return Object.prototype.toString.call(xs) === '[object Array]';
1452 function map (xs, f) {
1453 if (xs.map) return xs.map(f);
1455 for (var i = 0; i < xs.length; i++) {
1456 res.push(f(xs[i], i));
1461 var objectKeys = Object.keys || function (obj) {
1463 for (var key in obj) {
1464 if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
1469 },{}],71:[function(require,module,exports){
1472 exports.decode = exports.parse = require('./decode');
1473 exports.encode = exports.stringify = require('./encode');
1475 },{"./decode":69,"./encode":70}],72:[function(require,module,exports){
1479 // We only target browsers that natively support Promises, so we replace
1480 // Babel's Promise helper with a reference to the native promise.
1483 default: global.Promise
1486 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1488 },{}],73:[function(require,module,exports){
1491 Object.defineProperty(exports, "__esModule", {
1495 var _assign = require('babel-runtime/core-js/object/assign');
1497 var _assign2 = _interopRequireDefault(_assign);
1499 var _promise = require('babel-runtime/core-js/promise');
1501 var _promise2 = _interopRequireDefault(_promise);
1503 exports.default = ajax;
1505 var _querystring = require('querystring');
1507 var _querystring2 = _interopRequireDefault(_querystring);
1509 var _delay = require('./delay');
1511 var _delay2 = _interopRequireDefault(_delay);
1513 var _cachebustUrl = require('./cachebust-url');
1515 var _cachebustUrl2 = _interopRequireDefault(_cachebustUrl);
1517 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1519 //jshint ignore:start
1521 var forOwn = require('lodash/object/forOwn');
1524 var MAX_TIMEOUT = 64 * 1000; //64 seconds
1525 var MAX_RETRIES = 5;
1526 var serversToIgnore = {};
1528 // Simple ajax helper.
1532 // * [cachebust] - boolean
1533 // * [headers] - object
1534 // * [xhrFields] - object
1536 function ajax(opts) {
1537 if (!opts || typeof opts.url !== 'string') {
1538 throw new Error('URL must be given');
1540 return new _promise2.default(function (resolve, reject) {
1541 var method = opts.method ? opts.method : "GET";
1543 var stringData = undefined;
1545 stringData = typeof opts.data === "string" ? opts.data : _querystring2.default.stringify(opts.data);
1546 if (method === "GET" || method === "HEAD") {
1547 url += (/\?/.test(url) ? "&" : "?") + stringData;
1552 var match = url.match(/(?:(?:[a-z]+:)?\/\/)?([^/]*)\//);
1554 throw new Error("Failed to match url");
1556 var server = match[1];
1557 if (Object.prototype.hasOwnProperty.call(serversToIgnore, server)) {
1558 reject(new Error('Server at ' + url + ' has told us to stop connecting'));
1562 if (opts.cachebust) {
1563 url = (0, _cachebustUrl2.default)(url);
1566 var xhr = new XMLHttpRequest();
1567 (0, _assign2.default)(xhr, opts.xhrFields);
1568 xhr.onerror = function (event) {
1569 if ((opts.retryNum || 0) < MAX_RETRIES) {
1570 if (xhr.status === 502 || (xhr.status === 0 || xhr.status >= 500) && (method === "GET" || method === "HEAD" || opts.canRetry === true)) {
1571 resolve(_retry(opts));
1576 var err = (0, _assign2.default)(new Error('Failed to load ' + url), {
1577 event: event, xhr: xhr, status: xhr.status
1580 // give a way for a server to tell us to go away for now. Good fallback
1581 // in case a bug ever causes clients to spam a server with requests.
1582 if (xhr.status == 490) {
1583 serversToIgnore[server] = true;
1587 xhr.onload = function (event) {
1588 if (xhr.status === 200) {
1591 text: xhr.responseText
1597 xhr.open(method, url, true);
1598 forOwn(opts.headers, function (value, name) {
1599 xhr.setRequestHeader(name, value);
1601 xhr.send(stringData);
1605 function _retry(opts) {
1606 var retryNum = (opts.retryNum || 0) + 1;
1608 // 2000 4000 8000...
1609 var retryTimeout = Math.min(Math.pow(2, retryNum) * 1000, MAX_TIMEOUT);
1611 return (0, _delay2.default)(retryTimeout).then(function () {
1612 return ajax((0, _assign2.default)({}, opts, { retryNum: retryNum }));
1615 module.exports = exports['default'];
1617 },{"./cachebust-url":74,"./delay":76,"babel-runtime/core-js/object/assign":2,"babel-runtime/core-js/promise":72,"lodash/object/forOwn":65,"querystring":71}],74:[function(require,module,exports){
1620 Object.defineProperty(exports, "__esModule", {
1623 exports.default = cachebustUrl;
1625 //jshint ignore:start
1627 var r = /([?&])_=[^&]*/;
1628 var nonce = Date.now() + Math.floor(Math.random() * Math.pow(2, 32));
1630 function cachebustUrl(url) {
1632 return url.replace(r, "$1_=" + nonce++);
1634 return url + (/\?/.test(url) ? "&" : "?") + "_=" + nonce++;
1637 module.exports = exports["default"];
1639 },{}],75:[function(require,module,exports){
1642 Object.defineProperty(exports, "__esModule", {
1646 var _promise = require('babel-runtime/core-js/promise');
1648 var _promise2 = _interopRequireDefault(_promise);
1650 exports.default = connectivityTest;
1652 var _cachebustUrl = require('./cachebust-url');
1654 var _cachebustUrl2 = _interopRequireDefault(_cachebustUrl);
1656 var _zipObject = require('lodash/array/zipObject');
1658 var _zipObject2 = _interopRequireDefault(_zipObject);
1660 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1662 //jshint ignore:start
1664 var URLS = ['https://mailfoogae.appspot.com/build/images/composeOverflowToggle.png', 'https://www.streak.com/build/images/composeOverflowToggle.png', 'https://www.inboxsdk.com/images/logo-red.png'];
1666 function imageTest(url) {
1667 return new _promise2.default(function (resolve, reject) {
1668 var img = document.createElement('img');
1669 img.onload = function () {
1672 img.onloadend = img.onerror = function () {
1675 img.src = (0, _cachebustUrl2.default)(url);
1679 function connectivityTest() {
1680 return _promise2.default.all(URLS.map(function (url) {
1681 return imageTest(url).then(function (success) {
1682 return [url, success];
1684 })).then(function (results) {
1685 return (0, _zipObject2.default)(results);
1688 module.exports = exports['default'];
1690 },{"./cachebust-url":74,"babel-runtime/core-js/promise":72,"lodash/array/zipObject":40}],76:[function(require,module,exports){
1693 Object.defineProperty(exports, "__esModule", {
1697 var _promise = require("babel-runtime/core-js/promise");
1699 var _promise2 = _interopRequireDefault(_promise);
1701 exports.default = delay;
1703 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1705 //jshint ignore:start
1707 function delay(time, value) {
1708 return new _promise2.default(function (resolve, reject) {
1709 setTimeout(function () {
1710 return resolve(value);
1714 module.exports = exports["default"];
1716 },{"babel-runtime/core-js/promise":72}],77:[function(require,module,exports){
1720 Object.defineProperty(exports, "__esModule", {
1723 exports.default = getExtensionId;
1725 //jshint ignore:start
1727 function getExtensionId() {
1728 if (global.chrome && global.chrome.extension && global.chrome.extension.getURL) {
1729 return global.chrome.extension.getURL('');
1733 module.exports = exports['default'];
1735 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1737 },{}],78:[function(require,module,exports){
1741 Object.defineProperty(exports, "__esModule", {
1744 exports.default = getSessionId;
1746 //jshint ignore:start
1748 function getSessionId() {
1749 if (global.document && document.documentElement.hasAttribute('data-inboxsdk-session-id')) {
1750 return document.documentElement.getAttribute('data-inboxsdk-session-id');
1752 var sessionId = Date.now() + '-' + Math.random();
1753 if (global.document) {
1754 document.documentElement.setAttribute('data-inboxsdk-session-id', sessionId);
1759 module.exports = exports['default'];
1761 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1763 },{}],79:[function(require,module,exports){
1766 Object.defineProperty(exports, "__esModule", {
1769 exports.default = getStackTrace;
1771 //jshint ignore:start
1773 function getStackTrace() {
1774 var err = new Error("Stack saver");
1775 // Cut the first two lines off. The first line has the error name, and the
1776 // second line is inside this function.
1777 return ("" + err.stack).replace(/^([^\n]*\n){2}/, '');
1779 module.exports = exports["default"];
1781 },{}],80:[function(require,module,exports){
1785 Object.defineProperty(exports, "__esModule", {
1789 var _promise = require('babel-runtime/core-js/promise');
1791 var _promise2 = _interopRequireDefault(_promise);
1793 exports.default = loadScript;
1795 var _connectivityTest = require('./connectivity-test');
1797 var _connectivityTest2 = _interopRequireDefault(_connectivityTest);
1799 var _logError = require('./log-error');
1801 var _logError2 = _interopRequireDefault(_logError);
1803 var _ajax = require('./ajax');
1805 var _ajax2 = _interopRequireDefault(_ajax);
1807 var _delay = require('./delay');
1809 var _delay2 = _interopRequireDefault(_delay);
1811 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1813 //jshint ignore:start
1815 var once = require('lodash/function/once');
1816 var defer = require('lodash/function/defer');
1819 var isContentScript = once(function () {
1820 if (global.chrome && global.chrome.extension) return true;
1821 if (global.safari && global.safari.extension) return true;
1825 function addScriptToPage(url, cors) {
1826 var script = document.createElement('script');
1827 script.type = 'text/javascript';
1829 script.crossOrigin = 'anonymous';
1832 var promise = new _promise2.default(function (resolve, reject) {
1833 script.addEventListener('error', function (event) {
1834 reject(event.error || new Error(event.message || "Load failure: " + url, event.filename, event.lineno, event.column));
1836 script.addEventListener('load', function () {
1837 // Make sure the script has a moment to execute before this promise
1844 document.head.appendChild(script);
1848 function loadScript(url, opts) {
1850 if (isContentScript()) {
1852 var attempt = function attempt(retryNum, lastErr) {
1854 throw lastErr || new Error("Ran out of loadScript attempts for unknown reason");
1857 return (0, _ajax2.default)({
1858 url: url, cachebust: retryNum > 0
1859 }).then(function (response) {
1862 // Q: Why put the code into a function before executing it instead of
1863 // evaling it immediately?
1864 // A: Chrome would execute it before applying any remembered
1866 // Q: Why not just use `... = new Function(...)`?
1867 // A: The sourcemaps would be off by one line in Chrome because of
1868 // https://code.google.com/p/chromium/issues/detail?id=109362
1870 // A: Using the eval value rather than the eval keyword causes the
1871 // code passed to it to be run in the global scope instead of the
1872 // current scope. (Seriously, it's a javascript thing.)
1873 var originalCode = response.text;
1874 var indirectEval = eval;
1877 if (opts && opts.disableSourceMappingURL) {
1878 // Don't remove a data: URI sourcemap (used in dev)
1879 codeParts.push(originalCode.replace(/\/\/# sourceMappingURL=(?!data:)[^\n]*\n?$/, ''));
1881 codeParts.push(originalCode);
1884 if (!opts || !opts.nowrap) {
1885 codeParts.unshift("(function(){");
1886 codeParts.push("\n});");
1889 codeParts.push("\n//# sourceURL=" + url + "\n");
1891 var codeToRun = codeParts.join('');
1892 var program = void 0;
1894 program = indirectEval(codeToRun);
1896 if (err && err.name === 'SyntaxError') {
1897 (0, _logError2.default)(err, {
1899 caughtSyntaxError: true,
1901 message: 'SyntaxError in loading ' + url + '. Did we not load it fully? Trying again...'
1903 return (0, _delay2.default)(5000).then(function () {
1904 return attempt(retryNum + 1, err);
1907 // SyntaxErrors are the only errors that can happen during eval that we
1908 // retry because sometimes AppEngine doesn't serve the full javascript.
1909 // No other error is retried because other errors aren't likely to be
1913 if (!opts || !opts.nowrap) {
1919 pr = attempt(0, null);
1922 // Try to add script as CORS first so we can get error stack data from it.
1923 pr = addScriptToPage(url, true).catch(function () {
1924 // Only show the warning if we successfully load the script on retry.
1925 return addScriptToPage(url, false).then(function () {
1926 console.warn("Script " + url + " included without CORS headers. Error logs might be censored by the browser.");
1930 pr.catch(function (err) {
1931 return (0, _connectivityTest2.default)().then(function (connectivityTestResults) {
1932 (0, _logError2.default)(err, {
1934 connectivityTestResults: connectivityTestResults,
1935 status: err && err.status,
1936 response: err && err.xhr ? err.xhr.responseText : null,
1937 message: 'Failed to load script'
1943 module.exports = exports['default'];
1945 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1947 },{"./ajax":73,"./connectivity-test":75,"./delay":76,"./log-error":81,"babel-runtime/core-js/promise":72,"lodash/function/defer":42,"lodash/function/once":43}],81:[function(require,module,exports){
1951 Object.defineProperty(exports, "__esModule", {
1955 var _stringify = require('babel-runtime/core-js/json/stringify');
1957 var _stringify2 = _interopRequireDefault(_stringify);
1959 exports.default = logError;
1961 var _ajax = require('./ajax');
1963 var _ajax2 = _interopRequireDefault(_ajax);
1965 var _rateLimit = require('./rate-limit');
1967 var _rateLimit2 = _interopRequireDefault(_rateLimit);
1969 var _getStackTrace = require('./get-stack-trace');
1971 var _getStackTrace2 = _interopRequireDefault(_getStackTrace);
1973 var _getExtensionId = require('./get-extension-id');
1975 var _getExtensionId2 = _interopRequireDefault(_getExtensionId);
1977 var _getSessionId = require('./get-session-id');
1979 var _getSessionId2 = _interopRequireDefault(_getSessionId);
1981 var _version = require('./version');
1983 var _isObject = require('lodash/lang/isObject');
1985 var _isObject2 = _interopRequireDefault(_isObject);
1987 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1989 var sessionId = (0, _getSessionId2.default)();
1991 // code inside the platform-implementation should use logger.js instead of
1992 // interacting with this directly!
1994 //jshint ignore:start
1996 function logError(err, details, context) {
1997 if (!global.document) {
1998 // In tests, just throw the error.
2002 var args = arguments;
2004 // It's important that we can't throw an error or leave a rejected promise
2005 // unheard while logging an error in order to make sure to avoid ever
2006 // getting into an infinite loop of reporting uncaught errors.
2008 if (haveWeSeenThisErrorAlready(err)) {
2011 markErrorAsSeen(err);
2014 if (!(err instanceof Error)) {
2015 console.warn('First parameter to Logger.error was not an error object:', err);
2016 err = new Error("Logger.error called with non-error: " + err);
2017 markErrorAsSeen(err);
2019 var appId = context.appId;
2020 var appIds = context.appIds;
2021 var implVersion = context.implVersion;
2022 var userEmailHash = context.userEmailHash;
2024 var _loaderVersion = context.loaderVersion || _version.BUILD_VERSION;
2025 var _sentByApp = !!context.sentByApp;
2027 // Might not have been passed a useful error object with a stack, so get
2028 // our own current stack just in case.
2029 var nowStack = (0, _getStackTrace2.default)();
2031 var stuffToLog = ["Error logged:", err];
2032 if (err && err.stack) {
2033 stuffToLog = stuffToLog.concat(["\n\nOriginal error stack:\n" + err.stack]);
2035 stuffToLog = stuffToLog.concat(["\n\nError logged from:\n" + nowStack]);
2037 stuffToLog = stuffToLog.concat(["\n\nError details:", details]);
2039 stuffToLog = stuffToLog.concat(["\n\nExtension App Ids:", (0, _stringify2.default)(appIds, null, 2)]);
2040 stuffToLog = stuffToLog.concat(["\nSent by App:", _sentByApp]);
2041 stuffToLog = stuffToLog.concat(["\nSession Id:", sessionId]);
2042 stuffToLog = stuffToLog.concat(["\nExtension Id:", (0, _getExtensionId2.default)()]);
2043 stuffToLog = stuffToLog.concat(["\nInboxSDK Loader Version:", _loaderVersion]);
2044 stuffToLog = stuffToLog.concat(["\nInboxSDK Implementation Version:", implVersion]);
2046 console.error.apply(console, stuffToLog);
2049 message: err && err.message || err,
2050 stack: err && err.stack,
2051 loggedFrom: nowStack,
2054 sentByApp: _sentByApp,
2055 sessionId: sessionId,
2056 emailHash: userEmailHash,
2057 extensionId: (0, _getExtensionId2.default)(),
2058 loaderVersion: _loaderVersion,
2059 implementationVersion: implVersion,
2060 origin: document.location.origin,
2061 timestamp: Date.now() * 1000
2066 tooManyErrors(err2, args);
2070 var _extensionSeenErrors = function () {
2071 // Safari <9 doesn't have WeakSet and we don't want to pull in the polyfill,
2072 // so we make one out of a WeakMap.
2073 if (!global.__inboxsdk_extensionSeenErrors && global.WeakMap) {
2074 Object.defineProperty(global, '__inboxsdk_extensionSeenErrors', {
2075 value: new global.WeakMap()
2079 has: function has(e) {
2080 if (global.__inboxsdk_extensionSeenErrors) {
2081 return global.__inboxsdk_extensionSeenErrors.has(e);
2084 return !!e.__inboxsdk_extensionHasSeenError;
2091 add: function add(e) {
2092 if (global.__inboxsdk_extensionSeenErrors && global.__inboxsdk_extensionSeenErrors.set) {
2094 global.__inboxsdk_extensionSeenErrors.set(e, true);
2095 } else if (global.__inboxsdk_extensionSeenErrors && global.__inboxsdk_extensionSeenErrors.add) {
2096 // Older versions of inboxsdk.js initialized it as a WeakSet instead,
2097 // so handle that too.
2098 global.__inboxsdk_extensionSeenErrors.add(e);
2101 Object.defineProperty(e, '__inboxsdk_extensionHasSeenError', {
2112 function haveWeSeenThisErrorAlready(error) {
2113 if ((0, _isObject2.default)(error)) {
2114 return _extensionSeenErrors.has(error);
2119 function markErrorAsSeen(error) {
2120 if ((0, _isObject2.default)(error)) {
2121 _extensionSeenErrors.add(error);
2125 // Only let 10 errors be sent per minute.
2126 var sendError = (0, _rateLimit2.default)(function (report) {
2127 var args = arguments;
2130 (0, _ajax2.default)({
2131 url: 'https://www.inboxsdk.com/api/v2/errors',
2134 'Content-Type': 'application/json'
2136 data: (0, _stringify2.default)(report)
2137 }).catch(function (err2) {
2138 tooManyErrors(err2, args);
2141 tooManyErrors(err2, args);
2145 function tooManyErrors(err2, originalArgs) {
2146 console.error("ERROR REPORTING ERROR", err2);
2147 console.error("ORIGINAL ERROR", originalArgs);
2149 module.exports = exports['default'];
2151 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2153 },{"./ajax":73,"./get-extension-id":77,"./get-session-id":78,"./get-stack-trace":79,"./rate-limit":82,"./version":83,"babel-runtime/core-js/json/stringify":1,"lodash/lang/isObject":64}],82:[function(require,module,exports){
2156 Object.defineProperty(exports, "__esModule", {
2159 exports.default = rateLimit;
2161 //jshint ignore:start
2163 // Returns a wrapped version of the function which throws an exception if it's
2164 // called more than count times within period amount of time.
2165 function rateLimit(fn, period, count) {
2167 return function () {
2168 var now = Date.now();
2169 calls = calls.filter(function (time) {
2170 return time > now - period;
2172 if (calls.length >= count) {
2173 throw new Error("Function rate limit exceeded");
2176 return fn.apply(this, arguments);
2179 module.exports = exports["default"];
2181 },{}],83:[function(require,module,exports){
2184 //jshint ignore:start
2186 // This is in its own file so that updates to the version value don't cause a
2187 // reload of everything.
2189 exports.BUILD_VERSION = "0.7.21-1466467956470-7c17f4be535fde9c";
2192 module.hot.accept();
2195 },{}],84:[function(require,module,exports){
2199 function checkRequirements(opts) {
2200 if (!opts.TEMPORARY_INTERNAL_skipWeakMapRequirement && !global.WeakMap) {
2201 throw new Error("Browser does not support WeakMap");
2205 module.exports = checkRequirements;
2207 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2209 },{}],85:[function(require,module,exports){
2212 Object.defineProperty(exports, "__esModule", {
2216 var _assign = require('babel-runtime/core-js/object/assign');
2218 var _assign2 = _interopRequireDefault(_assign);
2220 var _logError = require('../common/log-error');
2222 var _logError2 = _interopRequireDefault(_logError);
2224 var _platformImplementationLoader = require('./loading/platform-implementation-loader');
2226 var _platformImplementationLoader2 = _interopRequireDefault(_platformImplementationLoader);
2228 var _checkRequirements = require('./check-requirements');
2230 var _checkRequirements2 = _interopRequireDefault(_checkRequirements);
2232 var _version = require('../common/version');
2234 var _loadScript = require('../common/load-script');
2236 var _loadScript2 = _interopRequireDefault(_loadScript);
2238 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2241 LOADER_VERSION: _version.BUILD_VERSION,
2242 loadScript: _loadScript2.default,
2243 load: function load(version, appId, opts) {
2244 opts = (0, _assign2.default)({
2246 globalErrorLogging: true
2248 // stuff that can't be overridden, such as extra stuff this file passes to
2249 // the implementation script.
2250 VERSION: InboxSDK.LOADER_VERSION,
2251 REQUESTED_API_VERSION: version
2254 (0, _checkRequirements2.default)(opts);
2256 return _platformImplementationLoader2.default.load(appId, opts);
2260 if (['https://mail.google.com', 'https://inbox.google.com'].indexOf(document.location.origin) != -1) {
2261 _platformImplementationLoader2.default.preload();
2264 exports.default = InboxSDK;
2265 module.exports = exports['default'];
2267 },{"../common/load-script":80,"../common/log-error":81,"../common/version":83,"./check-requirements":84,"./loading/platform-implementation-loader":86,"babel-runtime/core-js/object/assign":2}],86:[function(require,module,exports){
2271 Object.defineProperty(exports, "__esModule", {
2275 var _promise = require('babel-runtime/core-js/promise');
2277 var _promise2 = _interopRequireDefault(_promise);
2279 var _loadScript = require('../../common/load-script');
2281 var _loadScript2 = _interopRequireDefault(_loadScript);
2283 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2285 //jshint ignore:start
2287 var once = require('lodash/function/once');
2290 var PlatformImplementationLoader = {
2291 load: function load(appId, opts) {
2292 return _promise2.default.resolve().then(function () {
2293 if (!global.__InboxSDKImpLoader) {
2294 return PlatformImplementationLoader._loadScript().then(function () {
2295 if (!global.__InboxSDKImpLoader) {
2296 throw new Error("Implementation file did not load correctly");
2300 }).then(function () {
2301 return global.__InboxSDKImpLoader.load("0.1", appId, opts);
2306 _loadScript: once(function () {
2307 var disableSourceMappingURL = true;
2308 if (window.localStorage) {
2310 disableSourceMappingURL = localStorage.getItem('inboxsdk__enable_sourcemap') !== 'true';
2316 return (0, _loadScript2.default)("https://www.inboxsdk.com/build/platform-implementation.js", {
2317 nowrap: true, // platform-implementation has no top-level vars so no need for function wrapping
2318 disableSourceMappingURL: disableSourceMappingURL
2322 preload: function preload() {
2323 // Prime the load by calling it and letting the promise be memoized.
2328 exports.default = PlatformImplementationLoader;
2329 module.exports = exports['default'];
2331 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2333 },{"../../common/load-script":80,"babel-runtime/core-js/promise":72,"lodash/function/once":43}],87:[function(require,module,exports){
2338 if (typeof define !== "undefined" && define && define.amd) {
2339 // work around amd compatibility issue
2340 // https://groups.google.com/forum/#!msg/inboxsdk/U_bq82Exmwc/I3iIinxxCAAJ
2344 // exposes main as a global for browsers
2345 window.InboxSDK = require('./inboxsdk');
2352 },{"./inboxsdk":85}]},{},[87])