UNPKG

201 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 typeof define === 'function' && define.amd ? define(factory) :
4 (global.supergloo = factory());
5}(this, (function () { 'use strict';
6
7var name = 'audioCategory';
8var pluralName = 'audioCategories';
9
10var defaultProperties = ['id', 'name'];
11
12var audioCategory = Object.freeze({
13 name: name,
14 pluralName: pluralName,
15 defaultProperties: defaultProperties
16});
17
18var name$1 = 'audioTrack';
19var pluralName$1 = 'audioTracks';
20
21var defaultProperties$1 = ['id', 'name', 'author', 'duration', 'src'];
22
23var audioTrack = Object.freeze({
24 name: name$1,
25 pluralName: pluralName$1,
26 defaultProperties: defaultProperties$1
27});
28
29var name$2 = 'champion';
30var pluralName$2 = 'champions';
31
32var defaultProperties$2 = ['id'];
33
34var champion = Object.freeze({
35 name: name$2,
36 pluralName: pluralName$2,
37 defaultProperties: defaultProperties$2
38});
39
40var name$3 = 'cohort';
41var pluralName$3 = 'cohorts';
42
43var defaultProperties$3 = ['id', 'name', 'description'];
44
45var cohort = Object.freeze({
46 name: name$3,
47 pluralName: pluralName$3,
48 defaultProperties: defaultProperties$3
49});
50
51/**
52 * Gets the first element of `array`.
53 *
54 * @static
55 * @memberOf _
56 * @since 0.1.0
57 * @alias first
58 * @category Array
59 * @param {Array} array The array to query.
60 * @returns {*} Returns the first element of `array`.
61 * @example
62 *
63 * _.head([1, 2, 3]);
64 * // => 1
65 *
66 * _.head([]);
67 * // => undefined
68 */
69function head(array) {
70 return (array && array.length) ? array[0] : undefined;
71}
72
73var head_1 = head;
74
75/**
76 * The base implementation of `_.times` without support for iteratee shorthands
77 * or max array length checks.
78 *
79 * @private
80 * @param {number} n The number of times to invoke `iteratee`.
81 * @param {Function} iteratee The function invoked per iteration.
82 * @returns {Array} Returns the array of results.
83 */
84function baseTimes$1(n, iteratee) {
85 var index = -1,
86 result = Array(n);
87
88 while (++index < n) {
89 result[index] = iteratee(index);
90 }
91 return result;
92}
93
94var _baseTimes = baseTimes$1;
95
96var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
97
98
99
100
101
102function createCommonjsModule(fn, module) {
103 return module = { exports: {} }, fn(module, module.exports), module.exports;
104}
105
106/** Detect free variable `global` from Node.js. */
107var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
108
109var _freeGlobal = freeGlobal$1;
110
111var freeGlobal = _freeGlobal;
112
113/** Detect free variable `self`. */
114var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
115
116/** Used as a reference to the global object. */
117var root$1 = freeGlobal || freeSelf || Function('return this')();
118
119var _root = root$1;
120
121var root = _root;
122
123/** Built-in value references. */
124var Symbol$1 = root.Symbol;
125
126var _Symbol = Symbol$1;
127
128var Symbol$2 = _Symbol;
129
130/** Used for built-in method references. */
131var objectProto$2 = Object.prototype;
132
133/** Used to check objects for own properties. */
134var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
135
136/**
137 * Used to resolve the
138 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
139 * of values.
140 */
141var nativeObjectToString = objectProto$2.toString;
142
143/** Built-in value references. */
144var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
145
146/**
147 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
148 *
149 * @private
150 * @param {*} value The value to query.
151 * @returns {string} Returns the raw `toStringTag`.
152 */
153function getRawTag$1(value) {
154 var isOwn = hasOwnProperty$2.call(value, symToStringTag$1),
155 tag = value[symToStringTag$1];
156
157 try {
158 value[symToStringTag$1] = undefined;
159 var unmasked = true;
160 } catch (e) {}
161
162 var result = nativeObjectToString.call(value);
163 if (unmasked) {
164 if (isOwn) {
165 value[symToStringTag$1] = tag;
166 } else {
167 delete value[symToStringTag$1];
168 }
169 }
170 return result;
171}
172
173var _getRawTag = getRawTag$1;
174
175/** Used for built-in method references. */
176var objectProto$3 = Object.prototype;
177
178/**
179 * Used to resolve the
180 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
181 * of values.
182 */
183var nativeObjectToString$1 = objectProto$3.toString;
184
185/**
186 * Converts `value` to a string using `Object.prototype.toString`.
187 *
188 * @private
189 * @param {*} value The value to convert.
190 * @returns {string} Returns the converted string.
191 */
192function objectToString$1(value) {
193 return nativeObjectToString$1.call(value);
194}
195
196var _objectToString = objectToString$1;
197
198var Symbol = _Symbol;
199var getRawTag = _getRawTag;
200var objectToString = _objectToString;
201
202/** `Object#toString` result references. */
203var nullTag = '[object Null]';
204var undefinedTag = '[object Undefined]';
205
206/** Built-in value references. */
207var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
208
209/**
210 * The base implementation of `getTag` without fallbacks for buggy environments.
211 *
212 * @private
213 * @param {*} value The value to query.
214 * @returns {string} Returns the `toStringTag`.
215 */
216function baseGetTag$1(value) {
217 if (value == null) {
218 return value === undefined ? undefinedTag : nullTag;
219 }
220 return (symToStringTag && symToStringTag in Object(value))
221 ? getRawTag(value)
222 : objectToString(value);
223}
224
225var _baseGetTag = baseGetTag$1;
226
227/**
228 * Checks if `value` is object-like. A value is object-like if it's not `null`
229 * and has a `typeof` result of "object".
230 *
231 * @static
232 * @memberOf _
233 * @since 4.0.0
234 * @category Lang
235 * @param {*} value The value to check.
236 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
237 * @example
238 *
239 * _.isObjectLike({});
240 * // => true
241 *
242 * _.isObjectLike([1, 2, 3]);
243 * // => true
244 *
245 * _.isObjectLike(_.noop);
246 * // => false
247 *
248 * _.isObjectLike(null);
249 * // => false
250 */
251function isObjectLike$2(value) {
252 return value != null && typeof value == 'object';
253}
254
255var isObjectLike_1 = isObjectLike$2;
256
257var baseGetTag = _baseGetTag;
258var isObjectLike$1 = isObjectLike_1;
259
260/** `Object#toString` result references. */
261var argsTag = '[object Arguments]';
262
263/**
264 * The base implementation of `_.isArguments`.
265 *
266 * @private
267 * @param {*} value The value to check.
268 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
269 */
270function baseIsArguments$1(value) {
271 return isObjectLike$1(value) && baseGetTag(value) == argsTag;
272}
273
274var _baseIsArguments = baseIsArguments$1;
275
276var baseIsArguments = _baseIsArguments;
277var isObjectLike = isObjectLike_1;
278
279/** Used for built-in method references. */
280var objectProto$1 = Object.prototype;
281
282/** Used to check objects for own properties. */
283var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
284
285/** Built-in value references. */
286var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
287
288/**
289 * Checks if `value` is likely an `arguments` object.
290 *
291 * @static
292 * @memberOf _
293 * @since 0.1.0
294 * @category Lang
295 * @param {*} value The value to check.
296 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
297 * else `false`.
298 * @example
299 *
300 * _.isArguments(function() { return arguments; }());
301 * // => true
302 *
303 * _.isArguments([1, 2, 3]);
304 * // => false
305 */
306var isArguments$1 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
307 return isObjectLike(value) && hasOwnProperty$1.call(value, 'callee') &&
308 !propertyIsEnumerable.call(value, 'callee');
309};
310
311var isArguments_1 = isArguments$1;
312
313/**
314 * Checks if `value` is classified as an `Array` object.
315 *
316 * @static
317 * @memberOf _
318 * @since 0.1.0
319 * @category Lang
320 * @param {*} value The value to check.
321 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
322 * @example
323 *
324 * _.isArray([1, 2, 3]);
325 * // => true
326 *
327 * _.isArray(document.body.children);
328 * // => false
329 *
330 * _.isArray('abc');
331 * // => false
332 *
333 * _.isArray(_.noop);
334 * // => false
335 */
336var isArray$1 = Array.isArray;
337
338var isArray_1 = isArray$1;
339
340/**
341 * This method returns `false`.
342 *
343 * @static
344 * @memberOf _
345 * @since 4.13.0
346 * @category Util
347 * @returns {boolean} Returns `false`.
348 * @example
349 *
350 * _.times(2, _.stubFalse);
351 * // => [false, false]
352 */
353function stubFalse() {
354 return false;
355}
356
357var stubFalse_1 = stubFalse;
358
359var isBuffer_1 = createCommonjsModule(function (module, exports) {
360var root = _root,
361 stubFalse = stubFalse_1;
362
363/** Detect free variable `exports`. */
364var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
365
366/** Detect free variable `module`. */
367var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
368
369/** Detect the popular CommonJS extension `module.exports`. */
370var moduleExports = freeModule && freeModule.exports === freeExports;
371
372/** Built-in value references. */
373var Buffer = moduleExports ? root.Buffer : undefined;
374
375/* Built-in method references for those with the same name as other `lodash` methods. */
376var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
377
378/**
379 * Checks if `value` is a buffer.
380 *
381 * @static
382 * @memberOf _
383 * @since 4.3.0
384 * @category Lang
385 * @param {*} value The value to check.
386 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
387 * @example
388 *
389 * _.isBuffer(new Buffer(2));
390 * // => true
391 *
392 * _.isBuffer(new Uint8Array(2));
393 * // => false
394 */
395var isBuffer = nativeIsBuffer || stubFalse;
396
397module.exports = isBuffer;
398});
399
400/** Used as references for various `Number` constants. */
401var MAX_SAFE_INTEGER = 9007199254740991;
402
403/** Used to detect unsigned integer values. */
404var reIsUint = /^(?:0|[1-9]\d*)$/;
405
406/**
407 * Checks if `value` is a valid array-like index.
408 *
409 * @private
410 * @param {*} value The value to check.
411 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
412 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
413 */
414function isIndex$1(value, length) {
415 length = length == null ? MAX_SAFE_INTEGER : length;
416 return !!length &&
417 (typeof value == 'number' || reIsUint.test(value)) &&
418 (value > -1 && value % 1 == 0 && value < length);
419}
420
421var _isIndex = isIndex$1;
422
423/** Used as references for various `Number` constants. */
424var MAX_SAFE_INTEGER$1 = 9007199254740991;
425
426/**
427 * Checks if `value` is a valid array-like length.
428 *
429 * **Note:** This method is loosely based on
430 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
431 *
432 * @static
433 * @memberOf _
434 * @since 4.0.0
435 * @category Lang
436 * @param {*} value The value to check.
437 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
438 * @example
439 *
440 * _.isLength(3);
441 * // => true
442 *
443 * _.isLength(Number.MIN_VALUE);
444 * // => false
445 *
446 * _.isLength(Infinity);
447 * // => false
448 *
449 * _.isLength('3');
450 * // => false
451 */
452function isLength$1(value) {
453 return typeof value == 'number' &&
454 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
455}
456
457var isLength_1 = isLength$1;
458
459var baseGetTag$2 = _baseGetTag;
460var isLength = isLength_1;
461var isObjectLike$3 = isObjectLike_1;
462
463/** `Object#toString` result references. */
464var argsTag$1 = '[object Arguments]';
465var arrayTag = '[object Array]';
466var boolTag = '[object Boolean]';
467var dateTag = '[object Date]';
468var errorTag = '[object Error]';
469var funcTag = '[object Function]';
470var mapTag = '[object Map]';
471var numberTag = '[object Number]';
472var objectTag = '[object Object]';
473var regexpTag = '[object RegExp]';
474var setTag = '[object Set]';
475var stringTag = '[object String]';
476var weakMapTag = '[object WeakMap]';
477
478var arrayBufferTag = '[object ArrayBuffer]';
479var dataViewTag = '[object DataView]';
480var float32Tag = '[object Float32Array]';
481var float64Tag = '[object Float64Array]';
482var int8Tag = '[object Int8Array]';
483var int16Tag = '[object Int16Array]';
484var int32Tag = '[object Int32Array]';
485var uint8Tag = '[object Uint8Array]';
486var uint8ClampedTag = '[object Uint8ClampedArray]';
487var uint16Tag = '[object Uint16Array]';
488var uint32Tag = '[object Uint32Array]';
489
490/** Used to identify `toStringTag` values of typed arrays. */
491var typedArrayTags = {};
492typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
493typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
494typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
495typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
496typedArrayTags[uint32Tag] = true;
497typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
498typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
499typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
500typedArrayTags[errorTag] = typedArrayTags[funcTag] =
501typedArrayTags[mapTag] = typedArrayTags[numberTag] =
502typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
503typedArrayTags[setTag] = typedArrayTags[stringTag] =
504typedArrayTags[weakMapTag] = false;
505
506/**
507 * The base implementation of `_.isTypedArray` without Node.js optimizations.
508 *
509 * @private
510 * @param {*} value The value to check.
511 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
512 */
513function baseIsTypedArray$1(value) {
514 return isObjectLike$3(value) &&
515 isLength(value.length) && !!typedArrayTags[baseGetTag$2(value)];
516}
517
518var _baseIsTypedArray = baseIsTypedArray$1;
519
520/**
521 * The base implementation of `_.unary` without support for storing metadata.
522 *
523 * @private
524 * @param {Function} func The function to cap arguments for.
525 * @returns {Function} Returns the new capped function.
526 */
527function baseUnary$1(func) {
528 return function(value) {
529 return func(value);
530 };
531}
532
533var _baseUnary = baseUnary$1;
534
535var _nodeUtil = createCommonjsModule(function (module, exports) {
536var freeGlobal = _freeGlobal;
537
538/** Detect free variable `exports`. */
539var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
540
541/** Detect free variable `module`. */
542var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
543
544/** Detect the popular CommonJS extension `module.exports`. */
545var moduleExports = freeModule && freeModule.exports === freeExports;
546
547/** Detect free variable `process` from Node.js. */
548var freeProcess = moduleExports && freeGlobal.process;
549
550/** Used to access faster Node.js helpers. */
551var nodeUtil = (function() {
552 try {
553 return freeProcess && freeProcess.binding && freeProcess.binding('util');
554 } catch (e) {}
555}());
556
557module.exports = nodeUtil;
558});
559
560var baseIsTypedArray = _baseIsTypedArray;
561var baseUnary = _baseUnary;
562var nodeUtil = _nodeUtil;
563
564/* Node.js helper references. */
565var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
566
567/**
568 * Checks if `value` is classified as a typed array.
569 *
570 * @static
571 * @memberOf _
572 * @since 3.0.0
573 * @category Lang
574 * @param {*} value The value to check.
575 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
576 * @example
577 *
578 * _.isTypedArray(new Uint8Array);
579 * // => true
580 *
581 * _.isTypedArray([]);
582 * // => false
583 */
584var isTypedArray$1 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
585
586var isTypedArray_1 = isTypedArray$1;
587
588var baseTimes = _baseTimes;
589var isArguments = isArguments_1;
590var isArray = isArray_1;
591var isBuffer = isBuffer_1;
592var isIndex = _isIndex;
593var isTypedArray = isTypedArray_1;
594
595/** Used for built-in method references. */
596var objectProto = Object.prototype;
597
598/** Used to check objects for own properties. */
599var hasOwnProperty = objectProto.hasOwnProperty;
600
601/**
602 * Creates an array of the enumerable property names of the array-like `value`.
603 *
604 * @private
605 * @param {*} value The value to query.
606 * @param {boolean} inherited Specify returning inherited property names.
607 * @returns {Array} Returns the array of property names.
608 */
609function arrayLikeKeys$1(value, inherited) {
610 var isArr = isArray(value),
611 isArg = !isArr && isArguments(value),
612 isBuff = !isArr && !isArg && isBuffer(value),
613 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
614 skipIndexes = isArr || isArg || isBuff || isType,
615 result = skipIndexes ? baseTimes(value.length, String) : [],
616 length = result.length;
617
618 for (var key in value) {
619 if ((inherited || hasOwnProperty.call(value, key)) &&
620 !(skipIndexes && (
621 // Safari 9 has enumerable `arguments.length` in strict mode.
622 key == 'length' ||
623 // Node.js 0.10 has enumerable non-index properties on buffers.
624 (isBuff && (key == 'offset' || key == 'parent')) ||
625 // PhantomJS 2 has enumerable non-index properties on typed arrays.
626 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
627 // Skip index properties.
628 isIndex(key, length)
629 ))) {
630 result.push(key);
631 }
632 }
633 return result;
634}
635
636var _arrayLikeKeys = arrayLikeKeys$1;
637
638/** Used for built-in method references. */
639var objectProto$5 = Object.prototype;
640
641/**
642 * Checks if `value` is likely a prototype object.
643 *
644 * @private
645 * @param {*} value The value to check.
646 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
647 */
648function isPrototype$1(value) {
649 var Ctor = value && value.constructor,
650 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;
651
652 return value === proto;
653}
654
655var _isPrototype = isPrototype$1;
656
657/**
658 * Creates a unary function that invokes `func` with its argument transformed.
659 *
660 * @private
661 * @param {Function} func The function to wrap.
662 * @param {Function} transform The argument transform.
663 * @returns {Function} Returns the new function.
664 */
665function overArg$1(func, transform) {
666 return function(arg) {
667 return func(transform(arg));
668 };
669}
670
671var _overArg = overArg$1;
672
673var overArg = _overArg;
674
675/* Built-in method references for those with the same name as other `lodash` methods. */
676var nativeKeys$1 = overArg(Object.keys, Object);
677
678var _nativeKeys = nativeKeys$1;
679
680var isPrototype = _isPrototype;
681var nativeKeys = _nativeKeys;
682
683/** Used for built-in method references. */
684var objectProto$4 = Object.prototype;
685
686/** Used to check objects for own properties. */
687var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
688
689/**
690 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
691 *
692 * @private
693 * @param {Object} object The object to query.
694 * @returns {Array} Returns the array of property names.
695 */
696function baseKeys$1(object) {
697 if (!isPrototype(object)) {
698 return nativeKeys(object);
699 }
700 var result = [];
701 for (var key in Object(object)) {
702 if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
703 result.push(key);
704 }
705 }
706 return result;
707}
708
709var _baseKeys = baseKeys$1;
710
711/**
712 * Checks if `value` is the
713 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
714 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
715 *
716 * @static
717 * @memberOf _
718 * @since 0.1.0
719 * @category Lang
720 * @param {*} value The value to check.
721 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
722 * @example
723 *
724 * _.isObject({});
725 * // => true
726 *
727 * _.isObject([1, 2, 3]);
728 * // => true
729 *
730 * _.isObject(_.noop);
731 * // => true
732 *
733 * _.isObject(null);
734 * // => false
735 */
736function isObject$1(value) {
737 var type = typeof value;
738 return value != null && (type == 'object' || type == 'function');
739}
740
741var isObject_1 = isObject$1;
742
743var baseGetTag$3 = _baseGetTag;
744var isObject = isObject_1;
745
746/** `Object#toString` result references. */
747var asyncTag = '[object AsyncFunction]';
748var funcTag$1 = '[object Function]';
749var genTag = '[object GeneratorFunction]';
750var proxyTag = '[object Proxy]';
751
752/**
753 * Checks if `value` is classified as a `Function` object.
754 *
755 * @static
756 * @memberOf _
757 * @since 0.1.0
758 * @category Lang
759 * @param {*} value The value to check.
760 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
761 * @example
762 *
763 * _.isFunction(_);
764 * // => true
765 *
766 * _.isFunction(/abc/);
767 * // => false
768 */
769function isFunction$1(value) {
770 if (!isObject(value)) {
771 return false;
772 }
773 // The use of `Object#toString` avoids issues with the `typeof` operator
774 // in Safari 9 which returns 'object' for typed arrays and other constructors.
775 var tag = baseGetTag$3(value);
776 return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
777}
778
779var isFunction_1 = isFunction$1;
780
781var isFunction = isFunction_1;
782var isLength$2 = isLength_1;
783
784/**
785 * Checks if `value` is array-like. A value is considered array-like if it's
786 * not a function and has a `value.length` that's an integer greater than or
787 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
788 *
789 * @static
790 * @memberOf _
791 * @since 4.0.0
792 * @category Lang
793 * @param {*} value The value to check.
794 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
795 * @example
796 *
797 * _.isArrayLike([1, 2, 3]);
798 * // => true
799 *
800 * _.isArrayLike(document.body.children);
801 * // => true
802 *
803 * _.isArrayLike('abc');
804 * // => true
805 *
806 * _.isArrayLike(_.noop);
807 * // => false
808 */
809function isArrayLike$1(value) {
810 return value != null && isLength$2(value.length) && !isFunction(value);
811}
812
813var isArrayLike_1 = isArrayLike$1;
814
815var arrayLikeKeys = _arrayLikeKeys;
816var baseKeys = _baseKeys;
817var isArrayLike = isArrayLike_1;
818
819/**
820 * Creates an array of the own enumerable property names of `object`.
821 *
822 * **Note:** Non-object values are coerced to objects. See the
823 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
824 * for more details.
825 *
826 * @static
827 * @since 0.1.0
828 * @memberOf _
829 * @category Object
830 * @param {Object} object The object to query.
831 * @returns {Array} Returns the array of property names.
832 * @example
833 *
834 * function Foo() {
835 * this.a = 1;
836 * this.b = 2;
837 * }
838 *
839 * Foo.prototype.c = 3;
840 *
841 * _.keys(new Foo);
842 * // => ['a', 'b'] (iteration order is not guaranteed)
843 *
844 * _.keys('hi');
845 * // => ['0', '1']
846 */
847function keys(object) {
848 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
849}
850
851var keys_1 = keys;
852
853/**
854 * A specialized version of `_.map` for arrays without support for iteratee
855 * shorthands.
856 *
857 * @private
858 * @param {Array} [array] The array to iterate over.
859 * @param {Function} iteratee The function invoked per iteration.
860 * @returns {Array} Returns the new mapped array.
861 */
862function arrayMap$1(array, iteratee) {
863 var index = -1,
864 length = array == null ? 0 : array.length,
865 result = Array(length);
866
867 while (++index < length) {
868 result[index] = iteratee(array[index], index, array);
869 }
870 return result;
871}
872
873var _arrayMap = arrayMap$1;
874
875var baseGetTag$4 = _baseGetTag;
876var isObjectLike$4 = isObjectLike_1;
877
878/** `Object#toString` result references. */
879var symbolTag = '[object Symbol]';
880
881/**
882 * Checks if `value` is classified as a `Symbol` primitive or object.
883 *
884 * @static
885 * @memberOf _
886 * @since 4.0.0
887 * @category Lang
888 * @param {*} value The value to check.
889 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
890 * @example
891 *
892 * _.isSymbol(Symbol.iterator);
893 * // => true
894 *
895 * _.isSymbol('abc');
896 * // => false
897 */
898function isSymbol$1(value) {
899 return typeof value == 'symbol' ||
900 (isObjectLike$4(value) && baseGetTag$4(value) == symbolTag);
901}
902
903var isSymbol_1 = isSymbol$1;
904
905var Symbol$3 = _Symbol;
906var arrayMap = _arrayMap;
907var isArray$3 = isArray_1;
908var isSymbol = isSymbol_1;
909
910/** Used as references for various `Number` constants. */
911var INFINITY = 1 / 0;
912
913/** Used to convert symbols to primitives and strings. */
914var symbolProto = Symbol$3 ? Symbol$3.prototype : undefined;
915var symbolToString = symbolProto ? symbolProto.toString : undefined;
916
917/**
918 * The base implementation of `_.toString` which doesn't convert nullish
919 * values to empty strings.
920 *
921 * @private
922 * @param {*} value The value to process.
923 * @returns {string} Returns the string.
924 */
925function baseToString$1(value) {
926 // Exit early for strings to avoid a performance hit in some environments.
927 if (typeof value == 'string') {
928 return value;
929 }
930 if (isArray$3(value)) {
931 // Recursively convert values (susceptible to call stack limits).
932 return arrayMap(value, baseToString$1) + '';
933 }
934 if (isSymbol(value)) {
935 return symbolToString ? symbolToString.call(value) : '';
936 }
937 var result = (value + '');
938 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
939}
940
941var _baseToString = baseToString$1;
942
943var baseToString = _baseToString;
944
945/**
946 * Converts `value` to a string. An empty string is returned for `null`
947 * and `undefined` values. The sign of `-0` is preserved.
948 *
949 * @static
950 * @memberOf _
951 * @since 4.0.0
952 * @category Lang
953 * @param {*} value The value to convert.
954 * @returns {string} Returns the converted string.
955 * @example
956 *
957 * _.toString(null);
958 * // => ''
959 *
960 * _.toString(-0);
961 * // => '-0'
962 *
963 * _.toString([1, 2, 3]);
964 * // => '1,2,3'
965 */
966function toString$1(value) {
967 return value == null ? '' : baseToString(value);
968}
969
970var toString_1 = toString$1;
971
972/**
973 * The base implementation of `_.slice` without an iteratee call guard.
974 *
975 * @private
976 * @param {Array} array The array to slice.
977 * @param {number} [start=0] The start position.
978 * @param {number} [end=array.length] The end position.
979 * @returns {Array} Returns the slice of `array`.
980 */
981function baseSlice$1(array, start, end) {
982 var index = -1,
983 length = array.length;
984
985 if (start < 0) {
986 start = -start > length ? 0 : (length + start);
987 }
988 end = end > length ? length : end;
989 if (end < 0) {
990 end += length;
991 }
992 length = start > end ? 0 : ((end - start) >>> 0);
993 start >>>= 0;
994
995 var result = Array(length);
996 while (++index < length) {
997 result[index] = array[index + start];
998 }
999 return result;
1000}
1001
1002var _baseSlice = baseSlice$1;
1003
1004var baseSlice = _baseSlice;
1005
1006/**
1007 * Casts `array` to a slice if it's needed.
1008 *
1009 * @private
1010 * @param {Array} array The array to inspect.
1011 * @param {number} start The start position.
1012 * @param {number} [end=array.length] The end position.
1013 * @returns {Array} Returns the cast slice.
1014 */
1015function castSlice$1(array, start, end) {
1016 var length = array.length;
1017 end = end === undefined ? length : end;
1018 return (!start && end >= length) ? array : baseSlice(array, start, end);
1019}
1020
1021var _castSlice = castSlice$1;
1022
1023/** Used to compose unicode character classes. */
1024var rsAstralRange = '\\ud800-\\udfff';
1025var rsComboMarksRange = '\\u0300-\\u036f';
1026var reComboHalfMarksRange = '\\ufe20-\\ufe2f';
1027var rsComboSymbolsRange = '\\u20d0-\\u20ff';
1028var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
1029var rsVarRange = '\\ufe0e\\ufe0f';
1030
1031/** Used to compose unicode capture groups. */
1032var rsZWJ = '\\u200d';
1033
1034/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
1035var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
1036
1037/**
1038 * Checks if `string` contains Unicode symbols.
1039 *
1040 * @private
1041 * @param {string} string The string to inspect.
1042 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
1043 */
1044function hasUnicode$1(string) {
1045 return reHasUnicode.test(string);
1046}
1047
1048var _hasUnicode = hasUnicode$1;
1049
1050/**
1051 * Converts an ASCII `string` to an array.
1052 *
1053 * @private
1054 * @param {string} string The string to convert.
1055 * @returns {Array} Returns the converted array.
1056 */
1057function asciiToArray$1(string) {
1058 return string.split('');
1059}
1060
1061var _asciiToArray = asciiToArray$1;
1062
1063/** Used to compose unicode character classes. */
1064var rsAstralRange$1 = '\\ud800-\\udfff';
1065var rsComboMarksRange$1 = '\\u0300-\\u036f';
1066var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f';
1067var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff';
1068var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
1069var rsVarRange$1 = '\\ufe0e\\ufe0f';
1070
1071/** Used to compose unicode capture groups. */
1072var rsAstral = '[' + rsAstralRange$1 + ']';
1073var rsCombo = '[' + rsComboRange$1 + ']';
1074var rsFitz = '\\ud83c[\\udffb-\\udfff]';
1075var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';
1076var rsNonAstral = '[^' + rsAstralRange$1 + ']';
1077var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}';
1078var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]';
1079var rsZWJ$1 = '\\u200d';
1080
1081/** Used to compose unicode regexes. */
1082var reOptMod = rsModifier + '?';
1083var rsOptVar = '[' + rsVarRange$1 + ']?';
1084var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';
1085var rsSeq = rsOptVar + reOptMod + rsOptJoin;
1086var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
1087
1088/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
1089var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
1090
1091/**
1092 * Converts a Unicode `string` to an array.
1093 *
1094 * @private
1095 * @param {string} string The string to convert.
1096 * @returns {Array} Returns the converted array.
1097 */
1098function unicodeToArray$1(string) {
1099 return string.match(reUnicode) || [];
1100}
1101
1102var _unicodeToArray = unicodeToArray$1;
1103
1104var asciiToArray = _asciiToArray;
1105var hasUnicode$2 = _hasUnicode;
1106var unicodeToArray = _unicodeToArray;
1107
1108/**
1109 * Converts `string` to an array.
1110 *
1111 * @private
1112 * @param {string} string The string to convert.
1113 * @returns {Array} Returns the converted array.
1114 */
1115function stringToArray$1(string) {
1116 return hasUnicode$2(string)
1117 ? unicodeToArray(string)
1118 : asciiToArray(string);
1119}
1120
1121var _stringToArray = stringToArray$1;
1122
1123var castSlice = _castSlice;
1124var hasUnicode = _hasUnicode;
1125var stringToArray = _stringToArray;
1126var toString$2 = toString_1;
1127
1128/**
1129 * Creates a function like `_.lowerFirst`.
1130 *
1131 * @private
1132 * @param {string} methodName The name of the `String` case method to use.
1133 * @returns {Function} Returns the new case function.
1134 */
1135function createCaseFirst$1(methodName) {
1136 return function(string) {
1137 string = toString$2(string);
1138
1139 var strSymbols = hasUnicode(string)
1140 ? stringToArray(string)
1141 : undefined;
1142
1143 var chr = strSymbols
1144 ? strSymbols[0]
1145 : string.charAt(0);
1146
1147 var trailing = strSymbols
1148 ? castSlice(strSymbols, 1).join('')
1149 : string.slice(1);
1150
1151 return chr[methodName]() + trailing;
1152 };
1153}
1154
1155var _createCaseFirst = createCaseFirst$1;
1156
1157var createCaseFirst = _createCaseFirst;
1158
1159/**
1160 * Converts the first character of `string` to upper case.
1161 *
1162 * @static
1163 * @memberOf _
1164 * @since 4.0.0
1165 * @category String
1166 * @param {string} [string=''] The string to convert.
1167 * @returns {string} Returns the converted string.
1168 * @example
1169 *
1170 * _.upperFirst('fred');
1171 * // => 'Fred'
1172 *
1173 * _.upperFirst('FRED');
1174 * // => 'FRED'
1175 */
1176var upperFirst$1 = createCaseFirst('toUpperCase');
1177
1178var upperFirst_1 = upperFirst$1;
1179
1180var toString = toString_1;
1181var upperFirst = upperFirst_1;
1182
1183/**
1184 * Converts the first character of `string` to upper case and the remaining
1185 * to lower case.
1186 *
1187 * @static
1188 * @memberOf _
1189 * @since 3.0.0
1190 * @category String
1191 * @param {string} [string=''] The string to capitalize.
1192 * @returns {string} Returns the capitalized string.
1193 * @example
1194 *
1195 * _.capitalize('FRED');
1196 * // => 'Fred'
1197 */
1198function capitalize$1(string) {
1199 return upperFirst(toString(string).toLowerCase());
1200}
1201
1202var capitalize_1 = capitalize$1;
1203
1204/**
1205 * A specialized version of `_.reduce` for arrays without support for
1206 * iteratee shorthands.
1207 *
1208 * @private
1209 * @param {Array} [array] The array to iterate over.
1210 * @param {Function} iteratee The function invoked per iteration.
1211 * @param {*} [accumulator] The initial value.
1212 * @param {boolean} [initAccum] Specify using the first element of `array` as
1213 * the initial value.
1214 * @returns {*} Returns the accumulated value.
1215 */
1216function arrayReduce$1(array, iteratee, accumulator, initAccum) {
1217 var index = -1,
1218 length = array == null ? 0 : array.length;
1219
1220 if (initAccum && length) {
1221 accumulator = array[++index];
1222 }
1223 while (++index < length) {
1224 accumulator = iteratee(accumulator, array[index], index, array);
1225 }
1226 return accumulator;
1227}
1228
1229var _arrayReduce = arrayReduce$1;
1230
1231/**
1232 * The base implementation of `_.propertyOf` without support for deep paths.
1233 *
1234 * @private
1235 * @param {Object} object The object to query.
1236 * @returns {Function} Returns the new accessor function.
1237 */
1238function basePropertyOf$1(object) {
1239 return function(key) {
1240 return object == null ? undefined : object[key];
1241 };
1242}
1243
1244var _basePropertyOf = basePropertyOf$1;
1245
1246var basePropertyOf = _basePropertyOf;
1247
1248/** Used to map Latin Unicode letters to basic Latin letters. */
1249var deburredLetters = {
1250 // Latin-1 Supplement block.
1251 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
1252 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
1253 '\xc7': 'C', '\xe7': 'c',
1254 '\xd0': 'D', '\xf0': 'd',
1255 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
1256 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
1257 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
1258 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
1259 '\xd1': 'N', '\xf1': 'n',
1260 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
1261 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
1262 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
1263 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
1264 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
1265 '\xc6': 'Ae', '\xe6': 'ae',
1266 '\xde': 'Th', '\xfe': 'th',
1267 '\xdf': 'ss',
1268 // Latin Extended-A block.
1269 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
1270 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
1271 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
1272 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
1273 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
1274 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
1275 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
1276 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
1277 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
1278 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
1279 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
1280 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
1281 '\u0134': 'J', '\u0135': 'j',
1282 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
1283 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
1284 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
1285 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
1286 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
1287 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
1288 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
1289 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
1290 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
1291 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
1292 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
1293 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
1294 '\u0163': 't', '\u0165': 't', '\u0167': 't',
1295 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
1296 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
1297 '\u0174': 'W', '\u0175': 'w',
1298 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
1299 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
1300 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
1301 '\u0132': 'IJ', '\u0133': 'ij',
1302 '\u0152': 'Oe', '\u0153': 'oe',
1303 '\u0149': "'n", '\u017f': 's'
1304};
1305
1306/**
1307 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
1308 * letters to basic Latin letters.
1309 *
1310 * @private
1311 * @param {string} letter The matched letter to deburr.
1312 * @returns {string} Returns the deburred letter.
1313 */
1314var deburrLetter$1 = basePropertyOf(deburredLetters);
1315
1316var _deburrLetter = deburrLetter$1;
1317
1318var deburrLetter = _deburrLetter;
1319var toString$3 = toString_1;
1320
1321/** Used to match Latin Unicode letters (excluding mathematical operators). */
1322var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
1323
1324/** Used to compose unicode character classes. */
1325var rsComboMarksRange$2 = '\\u0300-\\u036f';
1326var reComboHalfMarksRange$2 = '\\ufe20-\\ufe2f';
1327var rsComboSymbolsRange$2 = '\\u20d0-\\u20ff';
1328var rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2;
1329
1330/** Used to compose unicode capture groups. */
1331var rsCombo$1 = '[' + rsComboRange$2 + ']';
1332
1333/**
1334 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
1335 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
1336 */
1337var reComboMark = RegExp(rsCombo$1, 'g');
1338
1339/**
1340 * Deburrs `string` by converting
1341 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
1342 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
1343 * letters to basic Latin letters and removing
1344 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
1345 *
1346 * @static
1347 * @memberOf _
1348 * @since 3.0.0
1349 * @category String
1350 * @param {string} [string=''] The string to deburr.
1351 * @returns {string} Returns the deburred string.
1352 * @example
1353 *
1354 * _.deburr('déjà vu');
1355 * // => 'deja vu'
1356 */
1357function deburr$1(string) {
1358 string = toString$3(string);
1359 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
1360}
1361
1362var deburr_1 = deburr$1;
1363
1364/** Used to match words composed of alphanumeric characters. */
1365var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
1366
1367/**
1368 * Splits an ASCII `string` into an array of its words.
1369 *
1370 * @private
1371 * @param {string} The string to inspect.
1372 * @returns {Array} Returns the words of `string`.
1373 */
1374function asciiWords$1(string) {
1375 return string.match(reAsciiWord) || [];
1376}
1377
1378var _asciiWords = asciiWords$1;
1379
1380/** Used to detect strings that need a more robust regexp to match words. */
1381var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
1382
1383/**
1384 * Checks if `string` contains a word composed of Unicode symbols.
1385 *
1386 * @private
1387 * @param {string} string The string to inspect.
1388 * @returns {boolean} Returns `true` if a word is found, else `false`.
1389 */
1390function hasUnicodeWord$1(string) {
1391 return reHasUnicodeWord.test(string);
1392}
1393
1394var _hasUnicodeWord = hasUnicodeWord$1;
1395
1396/** Used to compose unicode character classes. */
1397var rsAstralRange$2 = '\\ud800-\\udfff';
1398var rsComboMarksRange$3 = '\\u0300-\\u036f';
1399var reComboHalfMarksRange$3 = '\\ufe20-\\ufe2f';
1400var rsComboSymbolsRange$3 = '\\u20d0-\\u20ff';
1401var rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3;
1402var rsDingbatRange = '\\u2700-\\u27bf';
1403var rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff';
1404var rsMathOpRange = '\\xac\\xb1\\xd7\\xf7';
1405var rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf';
1406var rsPunctuationRange = '\\u2000-\\u206f';
1407var rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000';
1408var rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde';
1409var rsVarRange$2 = '\\ufe0e\\ufe0f';
1410var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
1411
1412/** Used to compose unicode capture groups. */
1413var rsApos$1 = "['\u2019]";
1414var rsBreak = '[' + rsBreakRange + ']';
1415var rsCombo$2 = '[' + rsComboRange$3 + ']';
1416var rsDigits = '\\d+';
1417var rsDingbat = '[' + rsDingbatRange + ']';
1418var rsLower = '[' + rsLowerRange + ']';
1419var rsMisc = '[^' + rsAstralRange$2 + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']';
1420var rsFitz$1 = '\\ud83c[\\udffb-\\udfff]';
1421var rsModifier$1 = '(?:' + rsCombo$2 + '|' + rsFitz$1 + ')';
1422var rsNonAstral$1 = '[^' + rsAstralRange$2 + ']';
1423var rsRegional$1 = '(?:\\ud83c[\\udde6-\\uddff]){2}';
1424var rsSurrPair$1 = '[\\ud800-\\udbff][\\udc00-\\udfff]';
1425var rsUpper = '[' + rsUpperRange + ']';
1426var rsZWJ$2 = '\\u200d';
1427
1428/** Used to compose unicode regexes. */
1429var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')';
1430var rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')';
1431var rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?';
1432var rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?';
1433var reOptMod$1 = rsModifier$1 + '?';
1434var rsOptVar$1 = '[' + rsVarRange$2 + ']?';
1435var rsOptJoin$1 = '(?:' + rsZWJ$2 + '(?:' + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join('|') + ')' + rsOptVar$1 + reOptMod$1 + ')*';
1436var rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)';
1437var rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)';
1438var rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1;
1439var rsEmoji = '(?:' + [rsDingbat, rsRegional$1, rsSurrPair$1].join('|') + ')' + rsSeq$1;
1440
1441/** Used to match complex or compound words. */
1442var reUnicodeWord = RegExp([
1443 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
1444 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
1445 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
1446 rsUpper + '+' + rsOptContrUpper,
1447 rsOrdUpper,
1448 rsOrdLower,
1449 rsDigits,
1450 rsEmoji
1451].join('|'), 'g');
1452
1453/**
1454 * Splits a Unicode `string` into an array of its words.
1455 *
1456 * @private
1457 * @param {string} The string to inspect.
1458 * @returns {Array} Returns the words of `string`.
1459 */
1460function unicodeWords$1(string) {
1461 return string.match(reUnicodeWord) || [];
1462}
1463
1464var _unicodeWords = unicodeWords$1;
1465
1466var asciiWords = _asciiWords;
1467var hasUnicodeWord = _hasUnicodeWord;
1468var toString$4 = toString_1;
1469var unicodeWords = _unicodeWords;
1470
1471/**
1472 * Splits `string` into an array of its words.
1473 *
1474 * @static
1475 * @memberOf _
1476 * @since 3.0.0
1477 * @category String
1478 * @param {string} [string=''] The string to inspect.
1479 * @param {RegExp|string} [pattern] The pattern to match words.
1480 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
1481 * @returns {Array} Returns the words of `string`.
1482 * @example
1483 *
1484 * _.words('fred, barney, & pebbles');
1485 * // => ['fred', 'barney', 'pebbles']
1486 *
1487 * _.words('fred, barney, & pebbles', /[^, ]+/g);
1488 * // => ['fred', 'barney', '&', 'pebbles']
1489 */
1490function words$1(string, pattern, guard) {
1491 string = toString$4(string);
1492 pattern = guard ? undefined : pattern;
1493
1494 if (pattern === undefined) {
1495 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
1496 }
1497 return string.match(pattern) || [];
1498}
1499
1500var words_1 = words$1;
1501
1502var arrayReduce = _arrayReduce;
1503var deburr = deburr_1;
1504var words = words_1;
1505
1506/** Used to compose unicode capture groups. */
1507var rsApos = "['\u2019]";
1508
1509/** Used to match apostrophes. */
1510var reApos = RegExp(rsApos, 'g');
1511
1512/**
1513 * Creates a function like `_.camelCase`.
1514 *
1515 * @private
1516 * @param {Function} callback The function to combine each word.
1517 * @returns {Function} Returns the new compounder function.
1518 */
1519function createCompounder$1(callback) {
1520 return function(string) {
1521 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
1522 };
1523}
1524
1525var _createCompounder = createCompounder$1;
1526
1527var capitalize = capitalize_1;
1528var createCompounder = _createCompounder;
1529
1530/**
1531 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
1532 *
1533 * @static
1534 * @memberOf _
1535 * @since 3.0.0
1536 * @category String
1537 * @param {string} [string=''] The string to convert.
1538 * @returns {string} Returns the camel cased string.
1539 * @example
1540 *
1541 * _.camelCase('Foo Bar');
1542 * // => 'fooBar'
1543 *
1544 * _.camelCase('--foo-bar--');
1545 * // => 'fooBar'
1546 *
1547 * _.camelCase('__FOO_BAR__');
1548 * // => 'fooBar'
1549 */
1550var camelCase = createCompounder(function(result, word, index) {
1551 word = word.toLowerCase();
1552 return result + (index ? capitalize(word) : word);
1553});
1554
1555var camelCase_1 = camelCase;
1556
1557/**
1558 * Appends the elements of `values` to `array`.
1559 *
1560 * @private
1561 * @param {Array} array The array to modify.
1562 * @param {Array} values The values to append.
1563 * @returns {Array} Returns `array`.
1564 */
1565function arrayPush$1(array, values) {
1566 var index = -1,
1567 length = values.length,
1568 offset = array.length;
1569
1570 while (++index < length) {
1571 array[offset + index] = values[index];
1572 }
1573 return array;
1574}
1575
1576var _arrayPush = arrayPush$1;
1577
1578var Symbol$4 = _Symbol;
1579var isArguments$2 = isArguments_1;
1580var isArray$5 = isArray_1;
1581
1582/** Built-in value references. */
1583var spreadableSymbol = Symbol$4 ? Symbol$4.isConcatSpreadable : undefined;
1584
1585/**
1586 * Checks if `value` is a flattenable `arguments` object or array.
1587 *
1588 * @private
1589 * @param {*} value The value to check.
1590 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
1591 */
1592function isFlattenable$1(value) {
1593 return isArray$5(value) || isArguments$2(value) ||
1594 !!(spreadableSymbol && value && value[spreadableSymbol]);
1595}
1596
1597var _isFlattenable = isFlattenable$1;
1598
1599var arrayPush$2 = _arrayPush;
1600var isFlattenable = _isFlattenable;
1601
1602/**
1603 * The base implementation of `_.flatten` with support for restricting flattening.
1604 *
1605 * @private
1606 * @param {Array} array The array to flatten.
1607 * @param {number} depth The maximum recursion depth.
1608 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
1609 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
1610 * @param {Array} [result=[]] The initial result value.
1611 * @returns {Array} Returns the new flattened array.
1612 */
1613function baseFlatten$1(array, depth, predicate, isStrict, result) {
1614 var index = -1,
1615 length = array.length;
1616
1617 predicate || (predicate = isFlattenable);
1618 result || (result = []);
1619
1620 while (++index < length) {
1621 var value = array[index];
1622 if (depth > 0 && predicate(value)) {
1623 if (depth > 1) {
1624 // Recursively flatten arrays (susceptible to call stack limits).
1625 baseFlatten$1(value, depth - 1, predicate, isStrict, result);
1626 } else {
1627 arrayPush$2(result, value);
1628 }
1629 } else if (!isStrict) {
1630 result[result.length] = value;
1631 }
1632 }
1633 return result;
1634}
1635
1636var _baseFlatten = baseFlatten$1;
1637
1638/**
1639 * Copies the values of `source` to `array`.
1640 *
1641 * @private
1642 * @param {Array} source The array to copy values from.
1643 * @param {Array} [array=[]] The array to copy values to.
1644 * @returns {Array} Returns `array`.
1645 */
1646function copyArray$1(source, array) {
1647 var index = -1,
1648 length = source.length;
1649
1650 array || (array = Array(length));
1651 while (++index < length) {
1652 array[index] = source[index];
1653 }
1654 return array;
1655}
1656
1657var _copyArray = copyArray$1;
1658
1659var arrayPush = _arrayPush;
1660var baseFlatten = _baseFlatten;
1661var copyArray = _copyArray;
1662var isArray$4 = isArray_1;
1663
1664/**
1665 * Creates a new array concatenating `array` with any additional arrays
1666 * and/or values.
1667 *
1668 * @static
1669 * @memberOf _
1670 * @since 4.0.0
1671 * @category Array
1672 * @param {Array} array The array to concatenate.
1673 * @param {...*} [values] The values to concatenate.
1674 * @returns {Array} Returns the new concatenated array.
1675 * @example
1676 *
1677 * var array = [1];
1678 * var other = _.concat(array, 2, [3], [[4]]);
1679 *
1680 * console.log(other);
1681 * // => [1, 2, 3, [4]]
1682 *
1683 * console.log(array);
1684 * // => [1]
1685 */
1686function concat() {
1687 var length = arguments.length;
1688 if (!length) {
1689 return [];
1690 }
1691 var args = Array(length - 1),
1692 array = arguments[0],
1693 index = length;
1694
1695 while (index--) {
1696 args[index - 1] = arguments[index];
1697 }
1698 return arrayPush(isArray$4(array) ? copyArray(array) : [array], baseFlatten(args, 1));
1699}
1700
1701var concat_1 = concat;
1702
1703var isArray$7 = isArray_1;
1704var isSymbol$2 = isSymbol_1;
1705
1706/** Used to match property names within property paths. */
1707var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
1708var reIsPlainProp = /^\w*$/;
1709
1710/**
1711 * Checks if `value` is a property name and not a property path.
1712 *
1713 * @private
1714 * @param {*} value The value to check.
1715 * @param {Object} [object] The object to query keys on.
1716 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
1717 */
1718function isKey$1(value, object) {
1719 if (isArray$7(value)) {
1720 return false;
1721 }
1722 var type = typeof value;
1723 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
1724 value == null || isSymbol$2(value)) {
1725 return true;
1726 }
1727 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
1728 (object != null && value in Object(object));
1729}
1730
1731var _isKey = isKey$1;
1732
1733var root$2 = _root;
1734
1735/** Used to detect overreaching core-js shims. */
1736var coreJsData$1 = root$2['__core-js_shared__'];
1737
1738var _coreJsData = coreJsData$1;
1739
1740var coreJsData = _coreJsData;
1741
1742/** Used to detect methods masquerading as native. */
1743var maskSrcKey = (function() {
1744 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1745 return uid ? ('Symbol(src)_1.' + uid) : '';
1746}());
1747
1748/**
1749 * Checks if `func` has its source masked.
1750 *
1751 * @private
1752 * @param {Function} func The function to check.
1753 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1754 */
1755function isMasked$1(func) {
1756 return !!maskSrcKey && (maskSrcKey in func);
1757}
1758
1759var _isMasked = isMasked$1;
1760
1761/** Used for built-in method references. */
1762var funcProto$1 = Function.prototype;
1763
1764/** Used to resolve the decompiled source of functions. */
1765var funcToString$1 = funcProto$1.toString;
1766
1767/**
1768 * Converts `func` to its source code.
1769 *
1770 * @private
1771 * @param {Function} func The function to convert.
1772 * @returns {string} Returns the source code.
1773 */
1774function toSource$1(func) {
1775 if (func != null) {
1776 try {
1777 return funcToString$1.call(func);
1778 } catch (e) {}
1779 try {
1780 return (func + '');
1781 } catch (e) {}
1782 }
1783 return '';
1784}
1785
1786var _toSource = toSource$1;
1787
1788var isFunction$3 = isFunction_1;
1789var isMasked = _isMasked;
1790var isObject$2 = isObject_1;
1791var toSource = _toSource;
1792
1793/**
1794 * Used to match `RegExp`
1795 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1796 */
1797var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1798
1799/** Used to detect host constructors (Safari). */
1800var reIsHostCtor = /^\[object .+?Constructor\]$/;
1801
1802/** Used for built-in method references. */
1803var funcProto = Function.prototype;
1804var objectProto$6 = Object.prototype;
1805
1806/** Used to resolve the decompiled source of functions. */
1807var funcToString = funcProto.toString;
1808
1809/** Used to check objects for own properties. */
1810var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
1811
1812/** Used to detect if a method is native. */
1813var reIsNative = RegExp('^' +
1814 funcToString.call(hasOwnProperty$4).replace(reRegExpChar, '\\$&')
1815 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1816);
1817
1818/**
1819 * The base implementation of `_.isNative` without bad shim checks.
1820 *
1821 * @private
1822 * @param {*} value The value to check.
1823 * @returns {boolean} Returns `true` if `value` is a native function,
1824 * else `false`.
1825 */
1826function baseIsNative$1(value) {
1827 if (!isObject$2(value) || isMasked(value)) {
1828 return false;
1829 }
1830 var pattern = isFunction$3(value) ? reIsNative : reIsHostCtor;
1831 return pattern.test(toSource(value));
1832}
1833
1834var _baseIsNative = baseIsNative$1;
1835
1836/**
1837 * Gets the value at `key` of `object`.
1838 *
1839 * @private
1840 * @param {Object} [object] The object to query.
1841 * @param {string} key The key of the property to get.
1842 * @returns {*} Returns the property value.
1843 */
1844function getValue$1(object, key) {
1845 return object == null ? undefined : object[key];
1846}
1847
1848var _getValue = getValue$1;
1849
1850var baseIsNative = _baseIsNative;
1851var getValue = _getValue;
1852
1853/**
1854 * Gets the native function at `key` of `object`.
1855 *
1856 * @private
1857 * @param {Object} object The object to query.
1858 * @param {string} key The key of the method to get.
1859 * @returns {*} Returns the function if it's native, else `undefined`.
1860 */
1861function getNative$1(object, key) {
1862 var value = getValue(object, key);
1863 return baseIsNative(value) ? value : undefined;
1864}
1865
1866var _getNative = getNative$1;
1867
1868var getNative = _getNative;
1869
1870/* Built-in method references that are verified to be native. */
1871var nativeCreate$1 = getNative(Object, 'create');
1872
1873var _nativeCreate = nativeCreate$1;
1874
1875var nativeCreate = _nativeCreate;
1876
1877/**
1878 * Removes all key-value entries from the hash.
1879 *
1880 * @private
1881 * @name clear
1882 * @memberOf Hash
1883 */
1884function hashClear$1() {
1885 this.__data__ = nativeCreate ? nativeCreate(null) : {};
1886 this.size = 0;
1887}
1888
1889var _hashClear = hashClear$1;
1890
1891/**
1892 * Removes `key` and its value from the hash.
1893 *
1894 * @private
1895 * @name delete
1896 * @memberOf Hash
1897 * @param {Object} hash The hash to modify.
1898 * @param {string} key The key of the value to remove.
1899 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1900 */
1901function hashDelete$1(key) {
1902 var result = this.has(key) && delete this.__data__[key];
1903 this.size -= result ? 1 : 0;
1904 return result;
1905}
1906
1907var _hashDelete = hashDelete$1;
1908
1909var nativeCreate$2 = _nativeCreate;
1910
1911/** Used to stand-in for `undefined` hash values. */
1912var HASH_UNDEFINED = '__lodash_hash_undefined__';
1913
1914/** Used for built-in method references. */
1915var objectProto$7 = Object.prototype;
1916
1917/** Used to check objects for own properties. */
1918var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
1919
1920/**
1921 * Gets the hash value for `key`.
1922 *
1923 * @private
1924 * @name get
1925 * @memberOf Hash
1926 * @param {string} key The key of the value to get.
1927 * @returns {*} Returns the entry value.
1928 */
1929function hashGet$1(key) {
1930 var data = this.__data__;
1931 if (nativeCreate$2) {
1932 var result = data[key];
1933 return result === HASH_UNDEFINED ? undefined : result;
1934 }
1935 return hasOwnProperty$5.call(data, key) ? data[key] : undefined;
1936}
1937
1938var _hashGet = hashGet$1;
1939
1940var nativeCreate$3 = _nativeCreate;
1941
1942/** Used for built-in method references. */
1943var objectProto$8 = Object.prototype;
1944
1945/** Used to check objects for own properties. */
1946var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
1947
1948/**
1949 * Checks if a hash value for `key` exists.
1950 *
1951 * @private
1952 * @name has
1953 * @memberOf Hash
1954 * @param {string} key The key of the entry to check.
1955 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1956 */
1957function hashHas$1(key) {
1958 var data = this.__data__;
1959 return nativeCreate$3 ? (data[key] !== undefined) : hasOwnProperty$6.call(data, key);
1960}
1961
1962var _hashHas = hashHas$1;
1963
1964var nativeCreate$4 = _nativeCreate;
1965
1966/** Used to stand-in for `undefined` hash values. */
1967var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1968
1969/**
1970 * Sets the hash `key` to `value`.
1971 *
1972 * @private
1973 * @name set
1974 * @memberOf Hash
1975 * @param {string} key The key of the value to set.
1976 * @param {*} value The value to set.
1977 * @returns {Object} Returns the hash instance.
1978 */
1979function hashSet$1(key, value) {
1980 var data = this.__data__;
1981 this.size += this.has(key) ? 0 : 1;
1982 data[key] = (nativeCreate$4 && value === undefined) ? HASH_UNDEFINED$1 : value;
1983 return this;
1984}
1985
1986var _hashSet = hashSet$1;
1987
1988var hashClear = _hashClear;
1989var hashDelete = _hashDelete;
1990var hashGet = _hashGet;
1991var hashHas = _hashHas;
1992var hashSet = _hashSet;
1993
1994/**
1995 * Creates a hash object.
1996 *
1997 * @private
1998 * @constructor
1999 * @param {Array} [entries] The key-value pairs to cache.
2000 */
2001function Hash$1(entries) {
2002 var index = -1,
2003 length = entries == null ? 0 : entries.length;
2004
2005 this.clear();
2006 while (++index < length) {
2007 var entry = entries[index];
2008 this.set(entry[0], entry[1]);
2009 }
2010}
2011
2012// Add methods to `Hash`.
2013Hash$1.prototype.clear = hashClear;
2014Hash$1.prototype['delete'] = hashDelete;
2015Hash$1.prototype.get = hashGet;
2016Hash$1.prototype.has = hashHas;
2017Hash$1.prototype.set = hashSet;
2018
2019var _Hash = Hash$1;
2020
2021/**
2022 * Removes all key-value entries from the list cache.
2023 *
2024 * @private
2025 * @name clear
2026 * @memberOf ListCache
2027 */
2028function listCacheClear$1() {
2029 this.__data__ = [];
2030 this.size = 0;
2031}
2032
2033var _listCacheClear = listCacheClear$1;
2034
2035/**
2036 * Performs a
2037 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2038 * comparison between two values to determine if they are equivalent.
2039 *
2040 * @static
2041 * @memberOf _
2042 * @since 4.0.0
2043 * @category Lang
2044 * @param {*} value The value to compare.
2045 * @param {*} other The other value to compare.
2046 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2047 * @example
2048 *
2049 * var object = { 'a': 1 };
2050 * var other = { 'a': 1 };
2051 *
2052 * _.eq(object, object);
2053 * // => true
2054 *
2055 * _.eq(object, other);
2056 * // => false
2057 *
2058 * _.eq('a', 'a');
2059 * // => true
2060 *
2061 * _.eq('a', Object('a'));
2062 * // => false
2063 *
2064 * _.eq(NaN, NaN);
2065 * // => true
2066 */
2067function eq$1(value, other) {
2068 return value === other || (value !== value && other !== other);
2069}
2070
2071var eq_1 = eq$1;
2072
2073var eq = eq_1;
2074
2075/**
2076 * Gets the index at which the `key` is found in `array` of key-value pairs.
2077 *
2078 * @private
2079 * @param {Array} array The array to inspect.
2080 * @param {*} key The key to search for.
2081 * @returns {number} Returns the index of the matched value, else `-1`.
2082 */
2083function assocIndexOf$1(array, key) {
2084 var length = array.length;
2085 while (length--) {
2086 if (eq(array[length][0], key)) {
2087 return length;
2088 }
2089 }
2090 return -1;
2091}
2092
2093var _assocIndexOf = assocIndexOf$1;
2094
2095var assocIndexOf = _assocIndexOf;
2096
2097/** Used for built-in method references. */
2098var arrayProto = Array.prototype;
2099
2100/** Built-in value references. */
2101var splice = arrayProto.splice;
2102
2103/**
2104 * Removes `key` and its value from the list cache.
2105 *
2106 * @private
2107 * @name delete
2108 * @memberOf ListCache
2109 * @param {string} key The key of the value to remove.
2110 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2111 */
2112function listCacheDelete$1(key) {
2113 var data = this.__data__,
2114 index = assocIndexOf(data, key);
2115
2116 if (index < 0) {
2117 return false;
2118 }
2119 var lastIndex = data.length - 1;
2120 if (index == lastIndex) {
2121 data.pop();
2122 } else {
2123 splice.call(data, index, 1);
2124 }
2125 --this.size;
2126 return true;
2127}
2128
2129var _listCacheDelete = listCacheDelete$1;
2130
2131var assocIndexOf$2 = _assocIndexOf;
2132
2133/**
2134 * Gets the list cache value for `key`.
2135 *
2136 * @private
2137 * @name get
2138 * @memberOf ListCache
2139 * @param {string} key The key of the value to get.
2140 * @returns {*} Returns the entry value.
2141 */
2142function listCacheGet$1(key) {
2143 var data = this.__data__,
2144 index = assocIndexOf$2(data, key);
2145
2146 return index < 0 ? undefined : data[index][1];
2147}
2148
2149var _listCacheGet = listCacheGet$1;
2150
2151var assocIndexOf$3 = _assocIndexOf;
2152
2153/**
2154 * Checks if a list cache value for `key` exists.
2155 *
2156 * @private
2157 * @name has
2158 * @memberOf ListCache
2159 * @param {string} key The key of the entry to check.
2160 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2161 */
2162function listCacheHas$1(key) {
2163 return assocIndexOf$3(this.__data__, key) > -1;
2164}
2165
2166var _listCacheHas = listCacheHas$1;
2167
2168var assocIndexOf$4 = _assocIndexOf;
2169
2170/**
2171 * Sets the list cache `key` to `value`.
2172 *
2173 * @private
2174 * @name set
2175 * @memberOf ListCache
2176 * @param {string} key The key of the value to set.
2177 * @param {*} value The value to set.
2178 * @returns {Object} Returns the list cache instance.
2179 */
2180function listCacheSet$1(key, value) {
2181 var data = this.__data__,
2182 index = assocIndexOf$4(data, key);
2183
2184 if (index < 0) {
2185 ++this.size;
2186 data.push([key, value]);
2187 } else {
2188 data[index][1] = value;
2189 }
2190 return this;
2191}
2192
2193var _listCacheSet = listCacheSet$1;
2194
2195var listCacheClear = _listCacheClear;
2196var listCacheDelete = _listCacheDelete;
2197var listCacheGet = _listCacheGet;
2198var listCacheHas = _listCacheHas;
2199var listCacheSet = _listCacheSet;
2200
2201/**
2202 * Creates an list cache object.
2203 *
2204 * @private
2205 * @constructor
2206 * @param {Array} [entries] The key-value pairs to cache.
2207 */
2208function ListCache$1(entries) {
2209 var index = -1,
2210 length = entries == null ? 0 : entries.length;
2211
2212 this.clear();
2213 while (++index < length) {
2214 var entry = entries[index];
2215 this.set(entry[0], entry[1]);
2216 }
2217}
2218
2219// Add methods to `ListCache`.
2220ListCache$1.prototype.clear = listCacheClear;
2221ListCache$1.prototype['delete'] = listCacheDelete;
2222ListCache$1.prototype.get = listCacheGet;
2223ListCache$1.prototype.has = listCacheHas;
2224ListCache$1.prototype.set = listCacheSet;
2225
2226var _ListCache = ListCache$1;
2227
2228var getNative$2 = _getNative;
2229var root$3 = _root;
2230
2231/* Built-in method references that are verified to be native. */
2232var Map$1 = getNative$2(root$3, 'Map');
2233
2234var _Map = Map$1;
2235
2236var Hash = _Hash;
2237var ListCache = _ListCache;
2238var Map = _Map;
2239
2240/**
2241 * Removes all key-value entries from the map.
2242 *
2243 * @private
2244 * @name clear
2245 * @memberOf MapCache
2246 */
2247function mapCacheClear$1() {
2248 this.size = 0;
2249 this.__data__ = {
2250 'hash': new Hash,
2251 'map': new (Map || ListCache),
2252 'string': new Hash
2253 };
2254}
2255
2256var _mapCacheClear = mapCacheClear$1;
2257
2258/**
2259 * Checks if `value` is suitable for use as unique object key.
2260 *
2261 * @private
2262 * @param {*} value The value to check.
2263 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
2264 */
2265function isKeyable$1(value) {
2266 var type = typeof value;
2267 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
2268 ? (value !== '__proto__')
2269 : (value === null);
2270}
2271
2272var _isKeyable = isKeyable$1;
2273
2274var isKeyable = _isKeyable;
2275
2276/**
2277 * Gets the data for `map`.
2278 *
2279 * @private
2280 * @param {Object} map The map to query.
2281 * @param {string} key The reference key.
2282 * @returns {*} Returns the map data.
2283 */
2284function getMapData$1(map, key) {
2285 var data = map.__data__;
2286 return isKeyable(key)
2287 ? data[typeof key == 'string' ? 'string' : 'hash']
2288 : data.map;
2289}
2290
2291var _getMapData = getMapData$1;
2292
2293var getMapData = _getMapData;
2294
2295/**
2296 * Removes `key` and its value from the map.
2297 *
2298 * @private
2299 * @name delete
2300 * @memberOf MapCache
2301 * @param {string} key The key of the value to remove.
2302 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
2303 */
2304function mapCacheDelete$1(key) {
2305 var result = getMapData(this, key)['delete'](key);
2306 this.size -= result ? 1 : 0;
2307 return result;
2308}
2309
2310var _mapCacheDelete = mapCacheDelete$1;
2311
2312var getMapData$2 = _getMapData;
2313
2314/**
2315 * Gets the map value for `key`.
2316 *
2317 * @private
2318 * @name get
2319 * @memberOf MapCache
2320 * @param {string} key The key of the value to get.
2321 * @returns {*} Returns the entry value.
2322 */
2323function mapCacheGet$1(key) {
2324 return getMapData$2(this, key).get(key);
2325}
2326
2327var _mapCacheGet = mapCacheGet$1;
2328
2329var getMapData$3 = _getMapData;
2330
2331/**
2332 * Checks if a map value for `key` exists.
2333 *
2334 * @private
2335 * @name has
2336 * @memberOf MapCache
2337 * @param {string} key The key of the entry to check.
2338 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2339 */
2340function mapCacheHas$1(key) {
2341 return getMapData$3(this, key).has(key);
2342}
2343
2344var _mapCacheHas = mapCacheHas$1;
2345
2346var getMapData$4 = _getMapData;
2347
2348/**
2349 * Sets the map `key` to `value`.
2350 *
2351 * @private
2352 * @name set
2353 * @memberOf MapCache
2354 * @param {string} key The key of the value to set.
2355 * @param {*} value The value to set.
2356 * @returns {Object} Returns the map cache instance.
2357 */
2358function mapCacheSet$1(key, value) {
2359 var data = getMapData$4(this, key),
2360 size = data.size;
2361
2362 data.set(key, value);
2363 this.size += data.size == size ? 0 : 1;
2364 return this;
2365}
2366
2367var _mapCacheSet = mapCacheSet$1;
2368
2369var mapCacheClear = _mapCacheClear;
2370var mapCacheDelete = _mapCacheDelete;
2371var mapCacheGet = _mapCacheGet;
2372var mapCacheHas = _mapCacheHas;
2373var mapCacheSet = _mapCacheSet;
2374
2375/**
2376 * Creates a map cache object to store key-value pairs.
2377 *
2378 * @private
2379 * @constructor
2380 * @param {Array} [entries] The key-value pairs to cache.
2381 */
2382function MapCache$1(entries) {
2383 var index = -1,
2384 length = entries == null ? 0 : entries.length;
2385
2386 this.clear();
2387 while (++index < length) {
2388 var entry = entries[index];
2389 this.set(entry[0], entry[1]);
2390 }
2391}
2392
2393// Add methods to `MapCache`.
2394MapCache$1.prototype.clear = mapCacheClear;
2395MapCache$1.prototype['delete'] = mapCacheDelete;
2396MapCache$1.prototype.get = mapCacheGet;
2397MapCache$1.prototype.has = mapCacheHas;
2398MapCache$1.prototype.set = mapCacheSet;
2399
2400var _MapCache = MapCache$1;
2401
2402var MapCache = _MapCache;
2403
2404/** Error message constants. */
2405var FUNC_ERROR_TEXT = 'Expected a function';
2406
2407/**
2408 * Creates a function that memoizes the result of `func`. If `resolver` is
2409 * provided, it determines the cache key for storing the result based on the
2410 * arguments provided to the memoized function. By default, the first argument
2411 * provided to the memoized function is used as the map cache key. The `func`
2412 * is invoked with the `this` binding of the memoized function.
2413 *
2414 * **Note:** The cache is exposed as the `cache` property on the memoized
2415 * function. Its creation may be customized by replacing the `_.memoize.Cache`
2416 * constructor with one whose instances implement the
2417 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
2418 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
2419 *
2420 * @static
2421 * @memberOf _
2422 * @since 0.1.0
2423 * @category Function
2424 * @param {Function} func The function to have its output memoized.
2425 * @param {Function} [resolver] The function to resolve the cache key.
2426 * @returns {Function} Returns the new memoized function.
2427 * @example
2428 *
2429 * var object = { 'a': 1, 'b': 2 };
2430 * var other = { 'c': 3, 'd': 4 };
2431 *
2432 * var values = _.memoize(_.values);
2433 * values(object);
2434 * // => [1, 2]
2435 *
2436 * values(other);
2437 * // => [3, 4]
2438 *
2439 * object.a = 2;
2440 * values(object);
2441 * // => [1, 2]
2442 *
2443 * // Modify the result cache.
2444 * values.cache.set(object, ['a', 'b']);
2445 * values(object);
2446 * // => ['a', 'b']
2447 *
2448 * // Replace `_.memoize.Cache`.
2449 * _.memoize.Cache = WeakMap;
2450 */
2451function memoize$1(func, resolver) {
2452 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
2453 throw new TypeError(FUNC_ERROR_TEXT);
2454 }
2455 var memoized = function() {
2456 var args = arguments,
2457 key = resolver ? resolver.apply(this, args) : args[0],
2458 cache = memoized.cache;
2459
2460 if (cache.has(key)) {
2461 return cache.get(key);
2462 }
2463 var result = func.apply(this, args);
2464 memoized.cache = cache.set(key, result) || cache;
2465 return result;
2466 };
2467 memoized.cache = new (memoize$1.Cache || MapCache);
2468 return memoized;
2469}
2470
2471// Expose `MapCache`.
2472memoize$1.Cache = MapCache;
2473
2474var memoize_1 = memoize$1;
2475
2476var memoize = memoize_1;
2477
2478/** Used as the maximum memoize cache size. */
2479var MAX_MEMOIZE_SIZE = 500;
2480
2481/**
2482 * A specialized version of `_.memoize` which clears the memoized function's
2483 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
2484 *
2485 * @private
2486 * @param {Function} func The function to have its output memoized.
2487 * @returns {Function} Returns the new memoized function.
2488 */
2489function memoizeCapped$1(func) {
2490 var result = memoize(func, function(key) {
2491 if (cache.size === MAX_MEMOIZE_SIZE) {
2492 cache.clear();
2493 }
2494 return key;
2495 });
2496
2497 var cache = result.cache;
2498 return result;
2499}
2500
2501var _memoizeCapped = memoizeCapped$1;
2502
2503var memoizeCapped = _memoizeCapped;
2504
2505/** Used to match property names within property paths. */
2506var reLeadingDot = /^\./;
2507var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
2508
2509/** Used to match backslashes in property paths. */
2510var reEscapeChar = /\\(\\)?/g;
2511
2512/**
2513 * Converts `string` to a property path array.
2514 *
2515 * @private
2516 * @param {string} string The string to convert.
2517 * @returns {Array} Returns the property path array.
2518 */
2519var stringToPath$1 = memoizeCapped(function(string) {
2520 var result = [];
2521 if (reLeadingDot.test(string)) {
2522 result.push('');
2523 }
2524 string.replace(rePropName, function(match, number, quote, string) {
2525 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
2526 });
2527 return result;
2528});
2529
2530var _stringToPath = stringToPath$1;
2531
2532var isArray$6 = isArray_1;
2533var isKey = _isKey;
2534var stringToPath = _stringToPath;
2535var toString$5 = toString_1;
2536
2537/**
2538 * Casts `value` to a path array if it's not one.
2539 *
2540 * @private
2541 * @param {*} value The value to inspect.
2542 * @param {Object} [object] The object to query keys on.
2543 * @returns {Array} Returns the cast property path array.
2544 */
2545function castPath$1(value, object) {
2546 if (isArray$6(value)) {
2547 return value;
2548 }
2549 return isKey(value, object) ? [value] : stringToPath(toString$5(value));
2550}
2551
2552var _castPath = castPath$1;
2553
2554var isSymbol$3 = isSymbol_1;
2555
2556/** Used as references for various `Number` constants. */
2557var INFINITY$1 = 1 / 0;
2558
2559/**
2560 * Converts `value` to a string key if it's not a string or symbol.
2561 *
2562 * @private
2563 * @param {*} value The value to inspect.
2564 * @returns {string|symbol} Returns the key.
2565 */
2566function toKey$1(value) {
2567 if (typeof value == 'string' || isSymbol$3(value)) {
2568 return value;
2569 }
2570 var result = (value + '');
2571 return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
2572}
2573
2574var _toKey = toKey$1;
2575
2576var castPath = _castPath;
2577var toKey = _toKey;
2578
2579/**
2580 * The base implementation of `_.get` without support for default values.
2581 *
2582 * @private
2583 * @param {Object} object The object to query.
2584 * @param {Array|string} path The path of the property to get.
2585 * @returns {*} Returns the resolved value.
2586 */
2587function baseGet$1(object, path) {
2588 path = castPath(path, object);
2589
2590 var index = 0,
2591 length = path.length;
2592
2593 while (object != null && index < length) {
2594 object = object[toKey(path[index++])];
2595 }
2596 return (index && index == length) ? object : undefined;
2597}
2598
2599var _baseGet = baseGet$1;
2600
2601var baseGet = _baseGet;
2602
2603/**
2604 * Gets the value at `path` of `object`. If the resolved value is
2605 * `undefined`, the `defaultValue` is returned in its place.
2606 *
2607 * @static
2608 * @memberOf _
2609 * @since 3.7.0
2610 * @category Object
2611 * @param {Object} object The object to query.
2612 * @param {Array|string} path The path of the property to get.
2613 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
2614 * @returns {*} Returns the resolved value.
2615 * @example
2616 *
2617 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2618 *
2619 * _.get(object, 'a[0].b.c');
2620 * // => 3
2621 *
2622 * _.get(object, ['a', '0', 'b', 'c']);
2623 * // => 3
2624 *
2625 * _.get(object, 'a.b.c', 'default');
2626 * // => 'default'
2627 */
2628function get(object, path, defaultValue) {
2629 var result = object == null ? undefined : baseGet(object, path);
2630 return result === undefined ? defaultValue : result;
2631}
2632
2633var get_1 = get;
2634
2635var getNative$3 = _getNative;
2636var root$4 = _root;
2637
2638/* Built-in method references that are verified to be native. */
2639var DataView$1 = getNative$3(root$4, 'DataView');
2640
2641var _DataView = DataView$1;
2642
2643var getNative$4 = _getNative;
2644var root$5 = _root;
2645
2646/* Built-in method references that are verified to be native. */
2647var Promise$2 = getNative$4(root$5, 'Promise');
2648
2649var _Promise = Promise$2;
2650
2651var getNative$5 = _getNative;
2652var root$6 = _root;
2653
2654/* Built-in method references that are verified to be native. */
2655var Set$1 = getNative$5(root$6, 'Set');
2656
2657var _Set = Set$1;
2658
2659var getNative$6 = _getNative;
2660var root$7 = _root;
2661
2662/* Built-in method references that are verified to be native. */
2663var WeakMap$1 = getNative$6(root$7, 'WeakMap');
2664
2665var _WeakMap = WeakMap$1;
2666
2667var DataView = _DataView;
2668var Map$2 = _Map;
2669var Promise$1 = _Promise;
2670var Set = _Set;
2671var WeakMap = _WeakMap;
2672var baseGetTag$5 = _baseGetTag;
2673var toSource$2 = _toSource;
2674
2675/** `Object#toString` result references. */
2676var mapTag$2 = '[object Map]';
2677var objectTag$1 = '[object Object]';
2678var promiseTag = '[object Promise]';
2679var setTag$2 = '[object Set]';
2680var weakMapTag$1 = '[object WeakMap]';
2681
2682var dataViewTag$1 = '[object DataView]';
2683
2684/** Used to detect maps, sets, and weakmaps. */
2685var dataViewCtorString = toSource$2(DataView);
2686var mapCtorString = toSource$2(Map$2);
2687var promiseCtorString = toSource$2(Promise$1);
2688var setCtorString = toSource$2(Set);
2689var weakMapCtorString = toSource$2(WeakMap);
2690
2691/**
2692 * Gets the `toStringTag` of `value`.
2693 *
2694 * @private
2695 * @param {*} value The value to query.
2696 * @returns {string} Returns the `toStringTag`.
2697 */
2698var getTag$1 = baseGetTag$5;
2699
2700// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2701if ((DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag$1) ||
2702 (Map$2 && getTag$1(new Map$2) != mapTag$2) ||
2703 (Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag) ||
2704 (Set && getTag$1(new Set) != setTag$2) ||
2705 (WeakMap && getTag$1(new WeakMap) != weakMapTag$1)) {
2706 getTag$1 = function(value) {
2707 var result = baseGetTag$5(value),
2708 Ctor = result == objectTag$1 ? value.constructor : undefined,
2709 ctorString = Ctor ? toSource$2(Ctor) : '';
2710
2711 if (ctorString) {
2712 switch (ctorString) {
2713 case dataViewCtorString: return dataViewTag$1;
2714 case mapCtorString: return mapTag$2;
2715 case promiseCtorString: return promiseTag;
2716 case setCtorString: return setTag$2;
2717 case weakMapCtorString: return weakMapTag$1;
2718 }
2719 }
2720 return result;
2721 };
2722}
2723
2724var _getTag = getTag$1;
2725
2726var baseKeys$2 = _baseKeys;
2727var getTag = _getTag;
2728var isArguments$3 = isArguments_1;
2729var isArray$8 = isArray_1;
2730var isArrayLike$2 = isArrayLike_1;
2731var isBuffer$1 = isBuffer_1;
2732var isPrototype$2 = _isPrototype;
2733var isTypedArray$2 = isTypedArray_1;
2734
2735/** `Object#toString` result references. */
2736var mapTag$1 = '[object Map]';
2737var setTag$1 = '[object Set]';
2738
2739/** Used for built-in method references. */
2740var objectProto$9 = Object.prototype;
2741
2742/** Used to check objects for own properties. */
2743var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
2744
2745/**
2746 * Checks if `value` is an empty object, collection, map, or set.
2747 *
2748 * Objects are considered empty if they have no own enumerable string keyed
2749 * properties.
2750 *
2751 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
2752 * jQuery-like collections are considered empty if they have a `length` of `0`.
2753 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
2754 *
2755 * @static
2756 * @memberOf _
2757 * @since 0.1.0
2758 * @category Lang
2759 * @param {*} value The value to check.
2760 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
2761 * @example
2762 *
2763 * _.isEmpty(null);
2764 * // => true
2765 *
2766 * _.isEmpty(true);
2767 * // => true
2768 *
2769 * _.isEmpty(1);
2770 * // => true
2771 *
2772 * _.isEmpty([1, 2, 3]);
2773 * // => false
2774 *
2775 * _.isEmpty({ 'a': 1 });
2776 * // => false
2777 */
2778function isEmpty(value) {
2779 if (value == null) {
2780 return true;
2781 }
2782 if (isArrayLike$2(value) &&
2783 (isArray$8(value) || typeof value == 'string' || typeof value.splice == 'function' ||
2784 isBuffer$1(value) || isTypedArray$2(value) || isArguments$3(value))) {
2785 return !value.length;
2786 }
2787 var tag = getTag(value);
2788 if (tag == mapTag$1 || tag == setTag$1) {
2789 return !value.size;
2790 }
2791 if (isPrototype$2(value)) {
2792 return !baseKeys$2(value).length;
2793 }
2794 for (var key in value) {
2795 if (hasOwnProperty$7.call(value, key)) {
2796 return false;
2797 }
2798 }
2799 return true;
2800}
2801
2802var isEmpty_1 = isEmpty;
2803
2804var createCompounder$2 = _createCompounder;
2805
2806/**
2807 * Converts `string` to
2808 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
2809 *
2810 * @static
2811 * @memberOf _
2812 * @since 3.0.0
2813 * @category String
2814 * @param {string} [string=''] The string to convert.
2815 * @returns {string} Returns the kebab cased string.
2816 * @example
2817 *
2818 * _.kebabCase('Foo Bar');
2819 * // => 'foo-bar'
2820 *
2821 * _.kebabCase('fooBar');
2822 * // => 'foo-bar'
2823 *
2824 * _.kebabCase('__FOO_BAR__');
2825 * // => 'foo-bar'
2826 */
2827var kebabCase = createCompounder$2(function(result, word, index) {
2828 return result + (index ? '-' : '') + word.toLowerCase();
2829});
2830
2831var kebabCase_1 = kebabCase;
2832
2833/**
2834 * The base implementation of `_.findIndex` and `_.findLastIndex` without
2835 * support for iteratee shorthands.
2836 *
2837 * @private
2838 * @param {Array} array The array to inspect.
2839 * @param {Function} predicate The function invoked per iteration.
2840 * @param {number} fromIndex The index to search from.
2841 * @param {boolean} [fromRight] Specify iterating from right to left.
2842 * @returns {number} Returns the index of the matched value, else `-1`.
2843 */
2844function baseFindIndex$1(array, predicate, fromIndex, fromRight) {
2845 var length = array.length,
2846 index = fromIndex + (fromRight ? 1 : -1);
2847
2848 while ((fromRight ? index-- : ++index < length)) {
2849 if (predicate(array[index], index, array)) {
2850 return index;
2851 }
2852 }
2853 return -1;
2854}
2855
2856var _baseFindIndex = baseFindIndex$1;
2857
2858/**
2859 * The base implementation of `_.isNaN` without support for number objects.
2860 *
2861 * @private
2862 * @param {*} value The value to check.
2863 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
2864 */
2865function baseIsNaN$1(value) {
2866 return value !== value;
2867}
2868
2869var _baseIsNaN = baseIsNaN$1;
2870
2871/**
2872 * A specialized version of `_.indexOf` which performs strict equality
2873 * comparisons of values, i.e. `===`.
2874 *
2875 * @private
2876 * @param {Array} array The array to inspect.
2877 * @param {*} value The value to search for.
2878 * @param {number} fromIndex The index to search from.
2879 * @returns {number} Returns the index of the matched value, else `-1`.
2880 */
2881function strictIndexOf$1(array, value, fromIndex) {
2882 var index = fromIndex - 1,
2883 length = array.length;
2884
2885 while (++index < length) {
2886 if (array[index] === value) {
2887 return index;
2888 }
2889 }
2890 return -1;
2891}
2892
2893var _strictIndexOf = strictIndexOf$1;
2894
2895var baseFindIndex = _baseFindIndex;
2896var baseIsNaN = _baseIsNaN;
2897var strictIndexOf = _strictIndexOf;
2898
2899/**
2900 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
2901 *
2902 * @private
2903 * @param {Array} array The array to inspect.
2904 * @param {*} value The value to search for.
2905 * @param {number} fromIndex The index to search from.
2906 * @returns {number} Returns the index of the matched value, else `-1`.
2907 */
2908function baseIndexOf$1(array, value, fromIndex) {
2909 return value === value
2910 ? strictIndexOf(array, value, fromIndex)
2911 : baseFindIndex(array, baseIsNaN, fromIndex);
2912}
2913
2914var _baseIndexOf = baseIndexOf$1;
2915
2916/**
2917 * This function is like `baseIndexOf` except that it accepts a comparator.
2918 *
2919 * @private
2920 * @param {Array} array The array to inspect.
2921 * @param {*} value The value to search for.
2922 * @param {number} fromIndex The index to search from.
2923 * @param {Function} comparator The comparator invoked per element.
2924 * @returns {number} Returns the index of the matched value, else `-1`.
2925 */
2926function baseIndexOfWith$1(array, value, fromIndex, comparator) {
2927 var index = fromIndex - 1,
2928 length = array.length;
2929
2930 while (++index < length) {
2931 if (comparator(array[index], value)) {
2932 return index;
2933 }
2934 }
2935 return -1;
2936}
2937
2938var _baseIndexOfWith = baseIndexOfWith$1;
2939
2940var arrayMap$2 = _arrayMap;
2941var baseIndexOf = _baseIndexOf;
2942var baseIndexOfWith = _baseIndexOfWith;
2943var baseUnary$2 = _baseUnary;
2944var copyArray$2 = _copyArray;
2945
2946/** Used for built-in method references. */
2947var arrayProto$1 = Array.prototype;
2948
2949/** Built-in value references. */
2950var splice$1 = arrayProto$1.splice;
2951
2952/**
2953 * The base implementation of `_.pullAllBy` without support for iteratee
2954 * shorthands.
2955 *
2956 * @private
2957 * @param {Array} array The array to modify.
2958 * @param {Array} values The values to remove.
2959 * @param {Function} [iteratee] The iteratee invoked per element.
2960 * @param {Function} [comparator] The comparator invoked per element.
2961 * @returns {Array} Returns `array`.
2962 */
2963function basePullAll$1(array, values, iteratee, comparator) {
2964 var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
2965 index = -1,
2966 length = values.length,
2967 seen = array;
2968
2969 if (array === values) {
2970 values = copyArray$2(values);
2971 }
2972 if (iteratee) {
2973 seen = arrayMap$2(array, baseUnary$2(iteratee));
2974 }
2975 while (++index < length) {
2976 var fromIndex = 0,
2977 value = values[index],
2978 computed = iteratee ? iteratee(value) : value;
2979
2980 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
2981 if (seen !== array) {
2982 splice$1.call(seen, fromIndex, 1);
2983 }
2984 splice$1.call(array, fromIndex, 1);
2985 }
2986 }
2987 return array;
2988}
2989
2990var _basePullAll = basePullAll$1;
2991
2992var basePullAll = _basePullAll;
2993
2994/**
2995 * This method is like `_.pull` except that it accepts an array of values to remove.
2996 *
2997 * **Note:** Unlike `_.difference`, this method mutates `array`.
2998 *
2999 * @static
3000 * @memberOf _
3001 * @since 4.0.0
3002 * @category Array
3003 * @param {Array} array The array to modify.
3004 * @param {Array} values The values to remove.
3005 * @returns {Array} Returns `array`.
3006 * @example
3007 *
3008 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
3009 *
3010 * _.pullAll(array, ['a', 'c']);
3011 * console.log(array);
3012 * // => ['b', 'b']
3013 */
3014function pullAll(array, values) {
3015 return (array && array.length && values && values.length)
3016 ? basePullAll(array, values)
3017 : array;
3018}
3019
3020var pullAll_1 = pullAll;
3021
3022var createCompounder$3 = _createCompounder;
3023
3024/**
3025 * Converts `string` to
3026 * [snake case](https://en.wikipedia.org/wiki/Snake_case).
3027 *
3028 * @static
3029 * @memberOf _
3030 * @since 3.0.0
3031 * @category String
3032 * @param {string} [string=''] The string to convert.
3033 * @returns {string} Returns the snake cased string.
3034 * @example
3035 *
3036 * _.snakeCase('Foo Bar');
3037 * // => 'foo_bar'
3038 *
3039 * _.snakeCase('fooBar');
3040 * // => 'foo_bar'
3041 *
3042 * _.snakeCase('--FOO-BAR--');
3043 * // => 'foo_bar'
3044 */
3045var snakeCase = createCompounder$3(function(result, word, index) {
3046 return result + (index ? '_' : '') + word.toLowerCase();
3047});
3048
3049var snakeCase_1 = snakeCase;
3050
3051/** Used to stand-in for `undefined` hash values. */
3052var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
3053
3054/**
3055 * Adds `value` to the array cache.
3056 *
3057 * @private
3058 * @name add
3059 * @memberOf SetCache
3060 * @alias push
3061 * @param {*} value The value to cache.
3062 * @returns {Object} Returns the cache instance.
3063 */
3064function setCacheAdd$1(value) {
3065 this.__data__.set(value, HASH_UNDEFINED$2);
3066 return this;
3067}
3068
3069var _setCacheAdd = setCacheAdd$1;
3070
3071/**
3072 * Checks if `value` is in the array cache.
3073 *
3074 * @private
3075 * @name has
3076 * @memberOf SetCache
3077 * @param {*} value The value to search for.
3078 * @returns {number} Returns `true` if `value` is found, else `false`.
3079 */
3080function setCacheHas$1(value) {
3081 return this.__data__.has(value);
3082}
3083
3084var _setCacheHas = setCacheHas$1;
3085
3086var MapCache$2 = _MapCache;
3087var setCacheAdd = _setCacheAdd;
3088var setCacheHas = _setCacheHas;
3089
3090/**
3091 *
3092 * Creates an array cache object to store unique values.
3093 *
3094 * @private
3095 * @constructor
3096 * @param {Array} [values] The values to cache.
3097 */
3098function SetCache$1(values) {
3099 var index = -1,
3100 length = values == null ? 0 : values.length;
3101
3102 this.__data__ = new MapCache$2;
3103 while (++index < length) {
3104 this.add(values[index]);
3105 }
3106}
3107
3108// Add methods to `SetCache`.
3109SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
3110SetCache$1.prototype.has = setCacheHas;
3111
3112var _SetCache = SetCache$1;
3113
3114var baseIndexOf$2 = _baseIndexOf;
3115
3116/**
3117 * A specialized version of `_.includes` for arrays without support for
3118 * specifying an index to search from.
3119 *
3120 * @private
3121 * @param {Array} [array] The array to inspect.
3122 * @param {*} target The value to search for.
3123 * @returns {boolean} Returns `true` if `target` is found, else `false`.
3124 */
3125function arrayIncludes$1(array, value) {
3126 var length = array == null ? 0 : array.length;
3127 return !!length && baseIndexOf$2(array, value, 0) > -1;
3128}
3129
3130var _arrayIncludes = arrayIncludes$1;
3131
3132/**
3133 * This function is like `arrayIncludes` except that it accepts a comparator.
3134 *
3135 * @private
3136 * @param {Array} [array] The array to inspect.
3137 * @param {*} target The value to search for.
3138 * @param {Function} comparator The comparator invoked per element.
3139 * @returns {boolean} Returns `true` if `target` is found, else `false`.
3140 */
3141function arrayIncludesWith$1(array, value, comparator) {
3142 var index = -1,
3143 length = array == null ? 0 : array.length;
3144
3145 while (++index < length) {
3146 if (comparator(value, array[index])) {
3147 return true;
3148 }
3149 }
3150 return false;
3151}
3152
3153var _arrayIncludesWith = arrayIncludesWith$1;
3154
3155/**
3156 * Checks if a `cache` value for `key` exists.
3157 *
3158 * @private
3159 * @param {Object} cache The cache to query.
3160 * @param {string} key The key of the entry to check.
3161 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3162 */
3163function cacheHas$1(cache, key) {
3164 return cache.has(key);
3165}
3166
3167var _cacheHas = cacheHas$1;
3168
3169/**
3170 * This method returns `undefined`.
3171 *
3172 * @static
3173 * @memberOf _
3174 * @since 2.3.0
3175 * @category Util
3176 * @example
3177 *
3178 * _.times(2, _.noop);
3179 * // => [undefined, undefined]
3180 */
3181function noop$1() {
3182 // No operation performed.
3183}
3184
3185var noop_1 = noop$1;
3186
3187/**
3188 * Converts `set` to an array of its values.
3189 *
3190 * @private
3191 * @param {Object} set The set to convert.
3192 * @returns {Array} Returns the values.
3193 */
3194function setToArray$2(set) {
3195 var index = -1,
3196 result = Array(set.size);
3197
3198 set.forEach(function(value) {
3199 result[++index] = value;
3200 });
3201 return result;
3202}
3203
3204var _setToArray = setToArray$2;
3205
3206var Set$2 = _Set;
3207var noop = noop_1;
3208var setToArray$1 = _setToArray;
3209
3210/** Used as references for various `Number` constants. */
3211var INFINITY$2 = 1 / 0;
3212
3213/**
3214 * Creates a set object of `values`.
3215 *
3216 * @private
3217 * @param {Array} values The values to add to the set.
3218 * @returns {Object} Returns the new set.
3219 */
3220var createSet$1 = !(Set$2 && (1 / setToArray$1(new Set$2([,-0]))[1]) == INFINITY$2) ? noop : function(values) {
3221 return new Set$2(values);
3222};
3223
3224var _createSet = createSet$1;
3225
3226var SetCache = _SetCache;
3227var arrayIncludes = _arrayIncludes;
3228var arrayIncludesWith = _arrayIncludesWith;
3229var cacheHas = _cacheHas;
3230var createSet = _createSet;
3231var setToArray = _setToArray;
3232
3233/** Used as the size to enable large array optimizations. */
3234var LARGE_ARRAY_SIZE = 200;
3235
3236/**
3237 * The base implementation of `_.uniqBy` without support for iteratee shorthands.
3238 *
3239 * @private
3240 * @param {Array} array The array to inspect.
3241 * @param {Function} [iteratee] The iteratee invoked per element.
3242 * @param {Function} [comparator] The comparator invoked per element.
3243 * @returns {Array} Returns the new duplicate free array.
3244 */
3245function baseUniq$1(array, iteratee, comparator) {
3246 var index = -1,
3247 includes = arrayIncludes,
3248 length = array.length,
3249 isCommon = true,
3250 result = [],
3251 seen = result;
3252
3253 if (comparator) {
3254 isCommon = false;
3255 includes = arrayIncludesWith;
3256 }
3257 else if (length >= LARGE_ARRAY_SIZE) {
3258 var set = iteratee ? null : createSet(array);
3259 if (set) {
3260 return setToArray(set);
3261 }
3262 isCommon = false;
3263 includes = cacheHas;
3264 seen = new SetCache;
3265 }
3266 else {
3267 seen = iteratee ? [] : result;
3268 }
3269 outer:
3270 while (++index < length) {
3271 var value = array[index],
3272 computed = iteratee ? iteratee(value) : value;
3273
3274 value = (comparator || value !== 0) ? value : 0;
3275 if (isCommon && computed === computed) {
3276 var seenIndex = seen.length;
3277 while (seenIndex--) {
3278 if (seen[seenIndex] === computed) {
3279 continue outer;
3280 }
3281 }
3282 if (iteratee) {
3283 seen.push(computed);
3284 }
3285 result.push(value);
3286 }
3287 else if (!includes(seen, computed, comparator)) {
3288 if (seen !== result) {
3289 seen.push(computed);
3290 }
3291 result.push(value);
3292 }
3293 }
3294 return result;
3295}
3296
3297var _baseUniq = baseUniq$1;
3298
3299var baseUniq = _baseUniq;
3300
3301/**
3302 * Creates a duplicate-free version of an array, using
3303 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
3304 * for equality comparisons, in which only the first occurrence of each element
3305 * is kept. The order of result values is determined by the order they occur
3306 * in the array.
3307 *
3308 * @static
3309 * @memberOf _
3310 * @since 0.1.0
3311 * @category Array
3312 * @param {Array} array The array to inspect.
3313 * @returns {Array} Returns the new duplicate free array.
3314 * @example
3315 *
3316 * _.uniq([2, 1, 2]);
3317 * // => [2, 1]
3318 */
3319function uniq(array) {
3320 return (array && array.length) ? baseUniq(array) : [];
3321}
3322
3323var uniq_1 = uniq;
3324
3325var DEFAULT_FROM_INDEX = 0;
3326var DEFAULT_TO_INDEX = 19;
3327var MY_PATH_KEYWORD = 'self';
3328
3329function buildPaging(options) {
3330 return {
3331 from: get_1(options, 'paging.from') || DEFAULT_FROM_INDEX,
3332 to: get_1(options, 'paging.to') || DEFAULT_TO_INDEX
3333 };
3334}
3335
3336function buildProperties(defaults, options) {
3337 var properties = concat_1([], options.properties || defaults);
3338
3339 var toAnd = options.andProperties;
3340 if (isArray_1(toAnd) && !isEmpty_1(toAnd)) {
3341 properties = concat_1(properties, toAnd);
3342 }
3343
3344 var toNot = options.notProperties;
3345 if (isArray_1(toNot) && !isEmpty_1(toNot)) {
3346 properties = pullAll_1(properties, toNot);
3347 }
3348
3349 properties = uniq_1(properties);
3350
3351 return properties;
3352}
3353
3354function entityNameToFilename(name) {
3355 return kebabCase_1(name) + '.js';
3356}
3357
3358function entityToAPIEnvelopeKey(entity) {
3359 return snakeCase_1(entity.name);
3360}
3361
3362function entityToFalcorListLeaf(entity) {
3363 return snakeCase_1(entity.name) + '_list';
3364}
3365
3366function entityToFalcorMembershipsListLeaf(entity) {
3367 return 'membership_' + entityToFalcorListLeaf(entity);
3368}
3369
3370function entityToFalcorMyListLeaf(entity) {
3371 return 'my_' + entityToFalcorListLeaf(entity);
3372}
3373
3374function entityToFalcorRootLeaf(entity) {
3375 return snakeCase_1(entity.pluralName);
3376}
3377
3378function falcorListLeafToEntityName(listLeaf) {
3379 return camelCase_1(listLeaf.replace(/_list$/, ''));
3380}
3381
3382function falcorRootLeafToEntityName(rootLeaf) {
3383 return camelCase_1(rootLeaf);
3384}
3385
3386function optionsHasQuery(options) {
3387 return keys_1(options.query).length > 0;
3388}
3389
3390function typedEntityToFalcorListPath(entity, options) {
3391 return [snakeCase_1(options.type), snakeCase_1(entity.name) + '_list'];
3392}
3393
3394var name$4 = 'comment';
3395var pluralName$4 = 'comments';
3396
3397var defaultProperties$4 = ['id', 'body', 'markup_tokens', 'post', 'owner.id', 'owner.first_name', 'owner.last_name', 'owner.name', 'owner.avatar.src', 'created_at'];
3398
3399function invalidateAfterCreate() {
3400 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3401
3402 var parentEntityName = head_1(keys_1(options.parent));
3403 var parentEntity = entities[parentEntityName];
3404 var parentId = options.parent[parentEntityName].id;
3405
3406 var rootLeaf = entityToFalcorRootLeaf(parentEntity);
3407
3408 var paths = [[rootLeaf, parentId, 'comment_list'], [rootLeaf, parentId, 'comment_count']];
3409
3410 return paths;
3411}
3412
3413// TODO: Update Falcor comment routes to follow standard entity
3414// *_list and length conventions and then remove this override
3415function invalidateAfterDestroy() {
3416 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3417
3418 var rootEntityLeaf = entityToFalcorRootLeaf({ pluralName: pluralName$4 });
3419 var entityId = options.id;
3420
3421 var parentEntityName = head_1(keys_1(options.parent));
3422 var parentEntity = entities[parentEntityName];
3423 var rootParentLeaf = entityToFalcorRootLeaf(parentEntity);
3424 var parentId = options.parent[parentEntityName].id;
3425
3426 var paths = [[rootEntityLeaf, entityId], [rootParentLeaf, parentId, 'comment_list'], [rootParentLeaf, parentId, 'comment_count']];
3427
3428 return paths;
3429}
3430
3431var comment = Object.freeze({
3432 name: name$4,
3433 pluralName: pluralName$4,
3434 defaultProperties: defaultProperties$4,
3435 invalidateAfterCreate: invalidateAfterCreate,
3436 invalidateAfterDestroy: invalidateAfterDestroy
3437});
3438
3439var name$5 = 'contentListItem';
3440var pluralName$5 = 'contentListItems';
3441
3442var defaultProperties$5 = ['id', 'content_id', 'content_type', 'new', 'position'];
3443
3444var contentListItem = Object.freeze({
3445 name: name$5,
3446 pluralName: pluralName$5,
3447 defaultProperties: defaultProperties$5
3448});
3449
3450var name$6 = 'directMessage';
3451var pluralName$6 = 'directMessages';
3452
3453var defaultProperties$6 = ['id', 'name'];
3454
3455var directMessage = Object.freeze({
3456 name: name$6,
3457 pluralName: pluralName$6,
3458 defaultProperties: defaultProperties$6
3459});
3460
3461var TokenTypes = {
3462 token: 'token',
3463 dotSeparator: '.',
3464 commaSeparator: ',',
3465 openingBracket: '[',
3466 closingBracket: ']',
3467 openingBrace: '{',
3468 closingBrace: '}',
3469 escape: '\\',
3470 space: ' ',
3471 colon: ':',
3472 quote: 'quote',
3473 unknown: 'unknown'
3474};
3475
3476var TokenTypes_1 = TokenTypes;
3477
3478var index$1 = createCommonjsModule(function (module) {
3479var TokenTypes = TokenTypes_1;
3480var DOT_SEPARATOR = '.';
3481var COMMA_SEPARATOR = ',';
3482var OPENING_BRACKET = '[';
3483var CLOSING_BRACKET = ']';
3484var OPENING_BRACE = '{';
3485var CLOSING_BRACE = '}';
3486var COLON = ':';
3487var ESCAPE = '\\';
3488var DOUBLE_OUOTES = '"';
3489var SINGE_OUOTES = "'";
3490var SPACE = " ";
3491var SPECIAL_CHARACTERS = '\\\'"[]., ';
3492var EXT_SPECIAL_CHARACTERS = '\\{}\'"[]., :';
3493
3494var Tokenizer = module.exports = function(string, ext) {
3495 this._string = string;
3496 this._idx = -1;
3497 this._extended = ext;
3498 this.parseString = '';
3499};
3500
3501Tokenizer.prototype = {
3502 /**
3503 * grabs the next token either from the peek operation or generates the
3504 * next token.
3505 */
3506 next: function() {
3507 var nextToken = this._nextToken ?
3508 this._nextToken : getNext(this._string, this._idx, this._extended);
3509
3510 this._idx = nextToken.idx;
3511 this._nextToken = false;
3512 this.parseString += nextToken.token.token;
3513
3514 return nextToken.token;
3515 },
3516
3517 /**
3518 * will peak but not increment the tokenizer
3519 */
3520 peek: function() {
3521 var nextToken = this._nextToken ?
3522 this._nextToken : getNext(this._string, this._idx, this._extended);
3523 this._nextToken = nextToken;
3524
3525 return nextToken.token;
3526 }
3527};
3528
3529Tokenizer.toNumber = function toNumber(x) {
3530 if (!isNaN(+x)) {
3531 return +x;
3532 }
3533 return NaN;
3534};
3535
3536function toOutput(token, type, done) {
3537 return {
3538 token: token,
3539 done: done,
3540 type: type
3541 };
3542}
3543
3544function getNext(string, idx, ext) {
3545 var output = false;
3546 var token = '';
3547 var specialChars = ext ?
3548 EXT_SPECIAL_CHARACTERS : SPECIAL_CHARACTERS;
3549 var done;
3550
3551 do {
3552
3553 done = idx + 1 >= string.length;
3554 if (done) {
3555 break;
3556 }
3557
3558 // we have to peek at the next token
3559 var character = string[idx + 1];
3560
3561 if (character !== undefined &&
3562 specialChars.indexOf(character) === -1) {
3563
3564 token += character;
3565 ++idx;
3566 continue;
3567 }
3568
3569 // The token to delimiting character transition.
3570 else if (token.length) {
3571 break;
3572 }
3573
3574 ++idx;
3575 var type;
3576 switch (character) {
3577 case DOT_SEPARATOR:
3578 type = TokenTypes.dotSeparator;
3579 break;
3580 case COMMA_SEPARATOR:
3581 type = TokenTypes.commaSeparator;
3582 break;
3583 case OPENING_BRACKET:
3584 type = TokenTypes.openingBracket;
3585 break;
3586 case CLOSING_BRACKET:
3587 type = TokenTypes.closingBracket;
3588 break;
3589 case OPENING_BRACE:
3590 type = TokenTypes.openingBrace;
3591 break;
3592 case CLOSING_BRACE:
3593 type = TokenTypes.closingBrace;
3594 break;
3595 case SPACE:
3596 type = TokenTypes.space;
3597 break;
3598 case DOUBLE_OUOTES:
3599 case SINGE_OUOTES:
3600 type = TokenTypes.quote;
3601 break;
3602 case ESCAPE:
3603 type = TokenTypes.escape;
3604 break;
3605 case COLON:
3606 type = TokenTypes.colon;
3607 break;
3608 default:
3609 type = TokenTypes.unknown;
3610 break;
3611 }
3612 output = toOutput(character, type, false);
3613 break;
3614 } while (!done);
3615
3616 if (!output && token.length) {
3617 output = toOutput(token, TokenTypes.token, false);
3618 }
3619
3620 if (!output) {
3621 output = {done: true};
3622 }
3623
3624 return {
3625 token: output,
3626 idx: idx
3627 };
3628}
3629});
3630
3631var index$3 = {
3632 indexer: {
3633 nested: 'Indexers cannot be nested.',
3634 needQuotes: 'unquoted indexers must be numeric.',
3635 empty: 'cannot have empty indexers.',
3636 leadingDot: 'Indexers cannot have leading dots.',
3637 leadingComma: 'Indexers cannot have leading comma.',
3638 requiresComma: 'Indexers require commas between indexer args.',
3639 routedTokens: 'Only one token can be used per indexer when specifying routed tokens.'
3640 },
3641 range: {
3642 precedingNaN: 'ranges must be preceded by numbers.',
3643 suceedingNaN: 'ranges must be suceeded by numbers.'
3644 },
3645 routed: {
3646 invalid: 'Invalid routed token. only integers|ranges|keys are supported.'
3647 },
3648 quote: {
3649 empty: 'cannot have empty quoted keys.',
3650 illegalEscape: 'Invalid escape character. Only quotes are escapable.'
3651 },
3652 unexpectedToken: 'Unexpected token.',
3653 invalidIdentifier: 'Invalid Identifier.',
3654 invalidPath: 'Please provide a valid path.',
3655 throwError: function(err, tokenizer, token) {
3656 if (token) {
3657 throw err + ' -- ' + tokenizer.parseString + ' with next token: ' + token;
3658 }
3659 throw err + ' -- ' + tokenizer.parseString;
3660 }
3661};
3662
3663var Tokenizer$1 = index$1;
3664var TokenTypes$3 = TokenTypes_1;
3665var E$2 = index$3;
3666
3667/**
3668 * The indexer is all the logic that happens in between
3669 * the '[', opening bracket, and ']' closing bracket.
3670 */
3671var range$1 = function range(tokenizer, openingToken, state, out) {
3672 var token = tokenizer.peek();
3673 var dotCount = 1;
3674 var done = false;
3675 var inclusive = true;
3676
3677 // Grab the last token off the stack. Must be an integer.
3678 var idx = state.indexer.length - 1;
3679 var from = Tokenizer$1.toNumber(state.indexer[idx]);
3680 var to;
3681
3682 if (isNaN(from)) {
3683 E$2.throwError(E$2.range.precedingNaN, tokenizer);
3684 }
3685
3686 // Why is number checking so difficult in javascript.
3687
3688 while (!done && !token.done) {
3689
3690 switch (token.type) {
3691
3692 // dotSeparators at the top level have no meaning
3693 case TokenTypes$3.dotSeparator:
3694 if (dotCount === 3) {
3695 E$2.throwError(E$2.unexpectedToken, tokenizer);
3696 }
3697 ++dotCount;
3698
3699 if (dotCount === 3) {
3700 inclusive = false;
3701 }
3702 break;
3703
3704 case TokenTypes$3.token:
3705 // move the tokenizer forward and save to.
3706 to = Tokenizer$1.toNumber(tokenizer.next().token);
3707
3708 // throw potential error.
3709 if (isNaN(to)) {
3710 E$2.throwError(E$2.range.suceedingNaN, tokenizer);
3711 }
3712
3713 done = true;
3714 break;
3715
3716 default:
3717 done = true;
3718 break;
3719 }
3720
3721 // Keep cycling through the tokenizer. But ranges have to peek
3722 // before they go to the next token since there is no 'terminating'
3723 // character.
3724 if (!done) {
3725 tokenizer.next();
3726
3727 // go to the next token without consuming.
3728 token = tokenizer.peek();
3729 }
3730
3731 // break and remove state information.
3732 else {
3733 break;
3734 }
3735 }
3736
3737 state.indexer[idx] = {from: from, to: inclusive ? to : to - 1};
3738};
3739
3740var TokenTypes$4 = TokenTypes_1;
3741var E$3 = index$3;
3742var quoteE = E$3.quote;
3743
3744/**
3745 * quote is all the parse tree in between quotes. This includes the only
3746 * escaping logic.
3747 *
3748 * parse-tree:
3749 * <opening-quote>(.|(<escape><opening-quote>))*<opening-quote>
3750 */
3751var quote$1 = function quote(tokenizer, openingToken, state, out) {
3752 var token = tokenizer.next();
3753 var innerToken = '';
3754 var openingQuote = openingToken.token;
3755 var escaping = false;
3756 var done = false;
3757
3758 while (!token.done) {
3759
3760 switch (token.type) {
3761 case TokenTypes$4.token:
3762 case TokenTypes$4.space:
3763
3764 case TokenTypes$4.dotSeparator:
3765 case TokenTypes$4.commaSeparator:
3766
3767 case TokenTypes$4.openingBracket:
3768 case TokenTypes$4.closingBracket:
3769 case TokenTypes$4.openingBrace:
3770 case TokenTypes$4.closingBrace:
3771 if (escaping) {
3772 E$3.throwError(quoteE.illegalEscape, tokenizer);
3773 }
3774
3775 innerToken += token.token;
3776 break;
3777
3778
3779 case TokenTypes$4.quote:
3780 // the simple case. We are escaping
3781 if (escaping) {
3782 innerToken += token.token;
3783 escaping = false;
3784 }
3785
3786 // its not a quote that is the opening quote
3787 else if (token.token !== openingQuote) {
3788 innerToken += token.token;
3789 }
3790
3791 // last thing left. Its a quote that is the opening quote
3792 // therefore we must produce the inner token of the indexer.
3793 else {
3794 done = true;
3795 }
3796
3797 break;
3798 case TokenTypes$4.escape:
3799 escaping = true;
3800 break;
3801
3802 default:
3803 E$3.throwError(E$3.unexpectedToken, tokenizer);
3804 }
3805
3806 // If done, leave loop
3807 if (done) {
3808 break;
3809 }
3810
3811 // Keep cycling through the tokenizer.
3812 token = tokenizer.next();
3813 }
3814
3815 if (innerToken.length === 0) {
3816 E$3.throwError(quoteE.empty, tokenizer);
3817 }
3818
3819 state.indexer[state.indexer.length] = innerToken;
3820};
3821
3822var RoutedTokens$2 = {
3823 integers: 'integers',
3824 ranges: 'ranges',
3825 keys: 'keys'
3826};
3827
3828var TokenTypes$5 = TokenTypes_1;
3829var RoutedTokens$1 = RoutedTokens$2;
3830var E$4 = index$3;
3831var routedE = E$4.routed;
3832
3833/**
3834 * The routing logic.
3835 *
3836 * parse-tree:
3837 * <opening-brace><routed-token>(:<token>)<closing-brace>
3838 */
3839var routed$1 = function routed(tokenizer, openingToken, state, out) {
3840 var routeToken = tokenizer.next();
3841 var named = false;
3842 var name = '';
3843
3844 // ensure the routed token is a valid ident.
3845 switch (routeToken.token) {
3846 case RoutedTokens$1.integers:
3847 case RoutedTokens$1.ranges:
3848 case RoutedTokens$1.keys:
3849 //valid
3850 break;
3851 default:
3852 E$4.throwError(routedE.invalid, tokenizer);
3853 break;
3854 }
3855
3856 // Now its time for colon or ending brace.
3857 var next = tokenizer.next();
3858
3859 // we are parsing a named identifier.
3860 if (next.type === TokenTypes$5.colon) {
3861 named = true;
3862
3863 // Get the token name.
3864 next = tokenizer.next();
3865 if (next.type !== TokenTypes$5.token) {
3866 E$4.throwError(routedE.invalid, tokenizer);
3867 }
3868 name = next.token;
3869
3870 // move to the closing brace.
3871 next = tokenizer.next();
3872 }
3873
3874 // must close with a brace.
3875
3876 if (next.type === TokenTypes$5.closingBrace) {
3877 var outputToken = {
3878 type: routeToken.token,
3879 named: named,
3880 name: name
3881 };
3882 state.indexer[state.indexer.length] = outputToken;
3883 }
3884
3885 // closing brace expected
3886 else {
3887 E$4.throwError(routedE.invalid, tokenizer);
3888 }
3889
3890};
3891
3892var TokenTypes$2 = TokenTypes_1;
3893var E$1 = index$3;
3894var idxE = E$1.indexer;
3895var range = range$1;
3896var quote = quote$1;
3897var routed = routed$1;
3898
3899/**
3900 * The indexer is all the logic that happens in between
3901 * the '[', opening bracket, and ']' closing bracket.
3902 */
3903var indexer$1 = function indexer(tokenizer, openingToken, state, out) {
3904 var token = tokenizer.next();
3905 var done = false;
3906 var allowedMaxLength = 1;
3907 var routedIndexer = false;
3908
3909 // State variables
3910 state.indexer = [];
3911
3912 while (!token.done) {
3913
3914 switch (token.type) {
3915 case TokenTypes$2.token:
3916 case TokenTypes$2.quote:
3917
3918 // ensures that token adders are properly delimited.
3919 if (state.indexer.length === allowedMaxLength) {
3920 E$1.throwError(idxE.requiresComma, tokenizer);
3921 }
3922 break;
3923 }
3924
3925 switch (token.type) {
3926 // Extended syntax case
3927 case TokenTypes$2.openingBrace:
3928 routedIndexer = true;
3929 routed(tokenizer, token, state, out);
3930 break;
3931
3932
3933 case TokenTypes$2.token:
3934 var t = +token.token;
3935 if (isNaN(t)) {
3936 E$1.throwError(idxE.needQuotes, tokenizer);
3937 }
3938 state.indexer[state.indexer.length] = t;
3939 break;
3940
3941 // dotSeparators at the top level have no meaning
3942 case TokenTypes$2.dotSeparator:
3943 if (!state.indexer.length) {
3944 E$1.throwError(idxE.leadingDot, tokenizer);
3945 }
3946 range(tokenizer, token, state, out);
3947 break;
3948
3949 // Spaces do nothing.
3950 case TokenTypes$2.space:
3951 break;
3952
3953 case TokenTypes$2.closingBracket:
3954 done = true;
3955 break;
3956
3957
3958 // The quotes require their own tree due to what can be in it.
3959 case TokenTypes$2.quote:
3960 quote(tokenizer, token, state, out);
3961 break;
3962
3963
3964 // Its time to decend the parse tree.
3965 case TokenTypes$2.openingBracket:
3966 E$1.throwError(idxE.nested, tokenizer);
3967 break;
3968
3969 case TokenTypes$2.commaSeparator:
3970 ++allowedMaxLength;
3971 break;
3972
3973 default:
3974 E$1.throwError(E$1.unexpectedToken, tokenizer);
3975 break;
3976 }
3977
3978 // If done, leave loop
3979 if (done) {
3980 break;
3981 }
3982
3983 // Keep cycling through the tokenizer.
3984 token = tokenizer.next();
3985 }
3986
3987 if (state.indexer.length === 0) {
3988 E$1.throwError(idxE.empty, tokenizer);
3989 }
3990
3991 if (state.indexer.length > 1 && routedIndexer) {
3992 E$1.throwError(idxE.routedTokens, tokenizer);
3993 }
3994
3995 // Remember, if an array of 1, keySets will be generated.
3996 if (state.indexer.length === 1) {
3997 state.indexer = state.indexer[0];
3998 }
3999
4000 out[out.length] = state.indexer;
4001
4002 // Clean state.
4003 state.indexer = undefined;
4004};
4005
4006var TokenTypes$1 = TokenTypes_1;
4007var E = index$3;
4008var indexer = indexer$1;
4009
4010/**
4011 * The top level of the parse tree. This returns the generated path
4012 * from the tokenizer.
4013 */
4014var head$3 = function head(tokenizer) {
4015 var token = tokenizer.next();
4016 var state = {};
4017 var out = [];
4018
4019 while (!token.done) {
4020
4021 switch (token.type) {
4022 case TokenTypes$1.token:
4023 var first = +token.token[0];
4024 if (!isNaN(first)) {
4025 E.throwError(E.invalidIdentifier, tokenizer);
4026 }
4027 out[out.length] = token.token;
4028 break;
4029
4030 // dotSeparators at the top level have no meaning
4031 case TokenTypes$1.dotSeparator:
4032 if (out.length === 0) {
4033 E.throwError(E.unexpectedToken, tokenizer);
4034 }
4035 break;
4036
4037 // Spaces do nothing.
4038 case TokenTypes$1.space:
4039 // NOTE: Spaces at the top level are allowed.
4040 // titlesById .summary is a valid path.
4041 break;
4042
4043
4044 // Its time to decend the parse tree.
4045 case TokenTypes$1.openingBracket:
4046 indexer(tokenizer, token, state, out);
4047 break;
4048
4049 default:
4050 E.throwError(E.unexpectedToken, tokenizer);
4051 break;
4052 }
4053
4054 // Keep cycling through the tokenizer.
4055 token = tokenizer.next();
4056 }
4057
4058 if (out.length === 0) {
4059 E.throwError(E.invalidPath, tokenizer);
4060 }
4061
4062 return out;
4063};
4064
4065var Tokenizer = index$1;
4066var head$2 = head$3;
4067var RoutedTokens = RoutedTokens$2;
4068
4069var parser = function parser(string, extendedRules) {
4070 return head$2(new Tokenizer(string, extendedRules));
4071};
4072
4073var index = parser;
4074
4075// Constructs the paths from paths / pathValues that have strings.
4076// If it does not have a string, just moves the value into the return
4077// results.
4078parser.fromPathsOrPathValues = function(paths, ext) {
4079 if (!paths) {
4080 return [];
4081 }
4082
4083 var out = [];
4084 for (var i = 0, len = paths.length; i < len; i++) {
4085
4086 // Is the path a string
4087 if (typeof paths[i] === 'string') {
4088 out[i] = parser(paths[i], ext);
4089 }
4090
4091 // is the path a path value with a string value.
4092 else if (typeof paths[i].path === 'string') {
4093 out[i] = {
4094 path: parser(paths[i].path, ext), value: paths[i].value
4095 };
4096 }
4097
4098 // just copy it over.
4099 else {
4100 out[i] = paths[i];
4101 }
4102 }
4103
4104 return out;
4105};
4106
4107// If the argument is a string, this with convert, else just return
4108// the path provided.
4109parser.fromPath = function(path, ext) {
4110 if (!path) {
4111 return [];
4112 }
4113
4114 if (typeof path === 'string') {
4115 return parser(path, ext);
4116 }
4117
4118 return path;
4119};
4120
4121// Potential routed tokens.
4122parser.RoutedTokens = RoutedTokens;
4123
4124var ListCache$3 = _ListCache;
4125
4126/**
4127 * Removes all key-value entries from the stack.
4128 *
4129 * @private
4130 * @name clear
4131 * @memberOf Stack
4132 */
4133function stackClear$1() {
4134 this.__data__ = new ListCache$3;
4135 this.size = 0;
4136}
4137
4138var _stackClear = stackClear$1;
4139
4140/**
4141 * Removes `key` and its value from the stack.
4142 *
4143 * @private
4144 * @name delete
4145 * @memberOf Stack
4146 * @param {string} key The key of the value to remove.
4147 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
4148 */
4149function stackDelete$1(key) {
4150 var data = this.__data__,
4151 result = data['delete'](key);
4152
4153 this.size = data.size;
4154 return result;
4155}
4156
4157var _stackDelete = stackDelete$1;
4158
4159/**
4160 * Gets the stack value for `key`.
4161 *
4162 * @private
4163 * @name get
4164 * @memberOf Stack
4165 * @param {string} key The key of the value to get.
4166 * @returns {*} Returns the entry value.
4167 */
4168function stackGet$1(key) {
4169 return this.__data__.get(key);
4170}
4171
4172var _stackGet = stackGet$1;
4173
4174/**
4175 * Checks if a stack value for `key` exists.
4176 *
4177 * @private
4178 * @name has
4179 * @memberOf Stack
4180 * @param {string} key The key of the entry to check.
4181 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
4182 */
4183function stackHas$1(key) {
4184 return this.__data__.has(key);
4185}
4186
4187var _stackHas = stackHas$1;
4188
4189var ListCache$4 = _ListCache;
4190var Map$3 = _Map;
4191var MapCache$3 = _MapCache;
4192
4193/** Used as the size to enable large array optimizations. */
4194var LARGE_ARRAY_SIZE$1 = 200;
4195
4196/**
4197 * Sets the stack `key` to `value`.
4198 *
4199 * @private
4200 * @name set
4201 * @memberOf Stack
4202 * @param {string} key The key of the value to set.
4203 * @param {*} value The value to set.
4204 * @returns {Object} Returns the stack cache instance.
4205 */
4206function stackSet$1(key, value) {
4207 var data = this.__data__;
4208 if (data instanceof ListCache$4) {
4209 var pairs = data.__data__;
4210 if (!Map$3 || (pairs.length < LARGE_ARRAY_SIZE$1 - 1)) {
4211 pairs.push([key, value]);
4212 this.size = ++data.size;
4213 return this;
4214 }
4215 data = this.__data__ = new MapCache$3(pairs);
4216 }
4217 data.set(key, value);
4218 this.size = data.size;
4219 return this;
4220}
4221
4222var _stackSet = stackSet$1;
4223
4224var ListCache$2 = _ListCache;
4225var stackClear = _stackClear;
4226var stackDelete = _stackDelete;
4227var stackGet = _stackGet;
4228var stackHas = _stackHas;
4229var stackSet = _stackSet;
4230
4231/**
4232 * Creates a stack cache object to store key-value pairs.
4233 *
4234 * @private
4235 * @constructor
4236 * @param {Array} [entries] The key-value pairs to cache.
4237 */
4238function Stack$1(entries) {
4239 var data = this.__data__ = new ListCache$2(entries);
4240 this.size = data.size;
4241}
4242
4243// Add methods to `Stack`.
4244Stack$1.prototype.clear = stackClear;
4245Stack$1.prototype['delete'] = stackDelete;
4246Stack$1.prototype.get = stackGet;
4247Stack$1.prototype.has = stackHas;
4248Stack$1.prototype.set = stackSet;
4249
4250var _Stack = Stack$1;
4251
4252/**
4253 * A specialized version of `_.some` for arrays without support for iteratee
4254 * shorthands.
4255 *
4256 * @private
4257 * @param {Array} [array] The array to iterate over.
4258 * @param {Function} predicate The function invoked per iteration.
4259 * @returns {boolean} Returns `true` if any element passes the predicate check,
4260 * else `false`.
4261 */
4262function arraySome$1(array, predicate) {
4263 var index = -1,
4264 length = array == null ? 0 : array.length;
4265
4266 while (++index < length) {
4267 if (predicate(array[index], index, array)) {
4268 return true;
4269 }
4270 }
4271 return false;
4272}
4273
4274var _arraySome = arraySome$1;
4275
4276var SetCache$2 = _SetCache;
4277var arraySome = _arraySome;
4278var cacheHas$2 = _cacheHas;
4279
4280/** Used to compose bitmasks for value comparisons. */
4281var COMPARE_PARTIAL_FLAG$2 = 1;
4282var COMPARE_UNORDERED_FLAG$1 = 2;
4283
4284/**
4285 * A specialized version of `baseIsEqualDeep` for arrays with support for
4286 * partial deep comparisons.
4287 *
4288 * @private
4289 * @param {Array} array The array to compare.
4290 * @param {Array} other The other array to compare.
4291 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
4292 * @param {Function} customizer The function to customize comparisons.
4293 * @param {Function} equalFunc The function to determine equivalents of values.
4294 * @param {Object} stack Tracks traversed `array` and `other` objects.
4295 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
4296 */
4297function equalArrays$1(array, other, bitmask, customizer, equalFunc, stack) {
4298 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2,
4299 arrLength = array.length,
4300 othLength = other.length;
4301
4302 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
4303 return false;
4304 }
4305 // Assume cyclic values are equal.
4306 var stacked = stack.get(array);
4307 if (stacked && stack.get(other)) {
4308 return stacked == other;
4309 }
4310 var index = -1,
4311 result = true,
4312 seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new SetCache$2 : undefined;
4313
4314 stack.set(array, other);
4315 stack.set(other, array);
4316
4317 // Ignore non-index properties.
4318 while (++index < arrLength) {
4319 var arrValue = array[index],
4320 othValue = other[index];
4321
4322 if (customizer) {
4323 var compared = isPartial
4324 ? customizer(othValue, arrValue, index, other, array, stack)
4325 : customizer(arrValue, othValue, index, array, other, stack);
4326 }
4327 if (compared !== undefined) {
4328 if (compared) {
4329 continue;
4330 }
4331 result = false;
4332 break;
4333 }
4334 // Recursively compare arrays (susceptible to call stack limits).
4335 if (seen) {
4336 if (!arraySome(other, function(othValue, othIndex) {
4337 if (!cacheHas$2(seen, othIndex) &&
4338 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
4339 return seen.push(othIndex);
4340 }
4341 })) {
4342 result = false;
4343 break;
4344 }
4345 } else if (!(
4346 arrValue === othValue ||
4347 equalFunc(arrValue, othValue, bitmask, customizer, stack)
4348 )) {
4349 result = false;
4350 break;
4351 }
4352 }
4353 stack['delete'](array);
4354 stack['delete'](other);
4355 return result;
4356}
4357
4358var _equalArrays = equalArrays$1;
4359
4360var root$8 = _root;
4361
4362/** Built-in value references. */
4363var Uint8Array$1 = root$8.Uint8Array;
4364
4365var _Uint8Array = Uint8Array$1;
4366
4367/**
4368 * Converts `map` to its key-value pairs.
4369 *
4370 * @private
4371 * @param {Object} map The map to convert.
4372 * @returns {Array} Returns the key-value pairs.
4373 */
4374function mapToArray$1(map) {
4375 var index = -1,
4376 result = Array(map.size);
4377
4378 map.forEach(function(value, key) {
4379 result[++index] = [key, value];
4380 });
4381 return result;
4382}
4383
4384var _mapToArray = mapToArray$1;
4385
4386var Symbol$5 = _Symbol;
4387var Uint8Array = _Uint8Array;
4388var eq$2 = eq_1;
4389var equalArrays$2 = _equalArrays;
4390var mapToArray = _mapToArray;
4391var setToArray$3 = _setToArray;
4392
4393/** Used to compose bitmasks for value comparisons. */
4394var COMPARE_PARTIAL_FLAG$3 = 1;
4395var COMPARE_UNORDERED_FLAG$2 = 2;
4396
4397/** `Object#toString` result references. */
4398var boolTag$1 = '[object Boolean]';
4399var dateTag$1 = '[object Date]';
4400var errorTag$1 = '[object Error]';
4401var mapTag$3 = '[object Map]';
4402var numberTag$1 = '[object Number]';
4403var regexpTag$1 = '[object RegExp]';
4404var setTag$3 = '[object Set]';
4405var stringTag$1 = '[object String]';
4406var symbolTag$1 = '[object Symbol]';
4407
4408var arrayBufferTag$1 = '[object ArrayBuffer]';
4409var dataViewTag$2 = '[object DataView]';
4410
4411/** Used to convert symbols to primitives and strings. */
4412var symbolProto$1 = Symbol$5 ? Symbol$5.prototype : undefined;
4413var symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
4414
4415/**
4416 * A specialized version of `baseIsEqualDeep` for comparing objects of
4417 * the same `toStringTag`.
4418 *
4419 * **Note:** This function only supports comparing values with tags of
4420 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
4421 *
4422 * @private
4423 * @param {Object} object The object to compare.
4424 * @param {Object} other The other object to compare.
4425 * @param {string} tag The `toStringTag` of the objects to compare.
4426 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
4427 * @param {Function} customizer The function to customize comparisons.
4428 * @param {Function} equalFunc The function to determine equivalents of values.
4429 * @param {Object} stack Tracks traversed `object` and `other` objects.
4430 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
4431 */
4432function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
4433 switch (tag) {
4434 case dataViewTag$2:
4435 if ((object.byteLength != other.byteLength) ||
4436 (object.byteOffset != other.byteOffset)) {
4437 return false;
4438 }
4439 object = object.buffer;
4440 other = other.buffer;
4441
4442 case arrayBufferTag$1:
4443 if ((object.byteLength != other.byteLength) ||
4444 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
4445 return false;
4446 }
4447 return true;
4448
4449 case boolTag$1:
4450 case dateTag$1:
4451 case numberTag$1:
4452 // Coerce booleans to `1` or `0` and dates to milliseconds.
4453 // Invalid dates are coerced to `NaN`.
4454 return eq$2(+object, +other);
4455
4456 case errorTag$1:
4457 return object.name == other.name && object.message == other.message;
4458
4459 case regexpTag$1:
4460 case stringTag$1:
4461 // Coerce regexes to strings and treat strings, primitives and objects,
4462 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
4463 // for more details.
4464 return object == (other + '');
4465
4466 case mapTag$3:
4467 var convert = mapToArray;
4468
4469 case setTag$3:
4470 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3;
4471 convert || (convert = setToArray$3);
4472
4473 if (object.size != other.size && !isPartial) {
4474 return false;
4475 }
4476 // Assume cyclic values are equal.
4477 var stacked = stack.get(object);
4478 if (stacked) {
4479 return stacked == other;
4480 }
4481 bitmask |= COMPARE_UNORDERED_FLAG$2;
4482
4483 // Recursively compare objects (susceptible to call stack limits).
4484 stack.set(object, other);
4485 var result = equalArrays$2(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
4486 stack['delete'](object);
4487 return result;
4488
4489 case symbolTag$1:
4490 if (symbolValueOf) {
4491 return symbolValueOf.call(object) == symbolValueOf.call(other);
4492 }
4493 }
4494 return false;
4495}
4496
4497var _equalByTag = equalByTag$1;
4498
4499var arrayPush$3 = _arrayPush;
4500var isArray$12 = isArray_1;
4501
4502/**
4503 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
4504 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
4505 * symbols of `object`.
4506 *
4507 * @private
4508 * @param {Object} object The object to query.
4509 * @param {Function} keysFunc The function to get the keys of `object`.
4510 * @param {Function} symbolsFunc The function to get the symbols of `object`.
4511 * @returns {Array} Returns the array of property names and symbols.
4512 */
4513function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
4514 var result = keysFunc(object);
4515 return isArray$12(object) ? result : arrayPush$3(result, symbolsFunc(object));
4516}
4517
4518var _baseGetAllKeys = baseGetAllKeys$1;
4519
4520/**
4521 * A specialized version of `_.filter` for arrays without support for
4522 * iteratee shorthands.
4523 *
4524 * @private
4525 * @param {Array} [array] The array to iterate over.
4526 * @param {Function} predicate The function invoked per iteration.
4527 * @returns {Array} Returns the new filtered array.
4528 */
4529function arrayFilter$1(array, predicate) {
4530 var index = -1,
4531 length = array == null ? 0 : array.length,
4532 resIndex = 0,
4533 result = [];
4534
4535 while (++index < length) {
4536 var value = array[index];
4537 if (predicate(value, index, array)) {
4538 result[resIndex++] = value;
4539 }
4540 }
4541 return result;
4542}
4543
4544var _arrayFilter = arrayFilter$1;
4545
4546/**
4547 * This method returns a new empty array.
4548 *
4549 * @static
4550 * @memberOf _
4551 * @since 4.13.0
4552 * @category Util
4553 * @returns {Array} Returns the new empty array.
4554 * @example
4555 *
4556 * var arrays = _.times(2, _.stubArray);
4557 *
4558 * console.log(arrays);
4559 * // => [[], []]
4560 *
4561 * console.log(arrays[0] === arrays[1]);
4562 * // => false
4563 */
4564function stubArray$1() {
4565 return [];
4566}
4567
4568var stubArray_1 = stubArray$1;
4569
4570var arrayFilter = _arrayFilter;
4571var stubArray = stubArray_1;
4572
4573/** Used for built-in method references. */
4574var objectProto$12 = Object.prototype;
4575
4576/** Built-in value references. */
4577var propertyIsEnumerable$1 = objectProto$12.propertyIsEnumerable;
4578
4579/* Built-in method references for those with the same name as other `lodash` methods. */
4580var nativeGetSymbols = Object.getOwnPropertySymbols;
4581
4582/**
4583 * Creates an array of the own enumerable symbols of `object`.
4584 *
4585 * @private
4586 * @param {Object} object The object to query.
4587 * @returns {Array} Returns the array of symbols.
4588 */
4589var getSymbols$1 = !nativeGetSymbols ? stubArray : function(object) {
4590 if (object == null) {
4591 return [];
4592 }
4593 object = Object(object);
4594 return arrayFilter(nativeGetSymbols(object), function(symbol) {
4595 return propertyIsEnumerable$1.call(object, symbol);
4596 });
4597};
4598
4599var _getSymbols = getSymbols$1;
4600
4601var baseGetAllKeys = _baseGetAllKeys;
4602var getSymbols = _getSymbols;
4603var keys$2 = keys_1;
4604
4605/**
4606 * Creates an array of own enumerable property names and symbols of `object`.
4607 *
4608 * @private
4609 * @param {Object} object The object to query.
4610 * @returns {Array} Returns the array of property names and symbols.
4611 */
4612function getAllKeys$1(object) {
4613 return baseGetAllKeys(object, keys$2, getSymbols);
4614}
4615
4616var _getAllKeys = getAllKeys$1;
4617
4618var getAllKeys = _getAllKeys;
4619
4620/** Used to compose bitmasks for value comparisons. */
4621var COMPARE_PARTIAL_FLAG$4 = 1;
4622
4623/** Used for built-in method references. */
4624var objectProto$11 = Object.prototype;
4625
4626/** Used to check objects for own properties. */
4627var hasOwnProperty$9 = objectProto$11.hasOwnProperty;
4628
4629/**
4630 * A specialized version of `baseIsEqualDeep` for objects with support for
4631 * partial deep comparisons.
4632 *
4633 * @private
4634 * @param {Object} object The object to compare.
4635 * @param {Object} other The other object to compare.
4636 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
4637 * @param {Function} customizer The function to customize comparisons.
4638 * @param {Function} equalFunc The function to determine equivalents of values.
4639 * @param {Object} stack Tracks traversed `object` and `other` objects.
4640 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
4641 */
4642function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
4643 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4,
4644 objProps = getAllKeys(object),
4645 objLength = objProps.length,
4646 othProps = getAllKeys(other),
4647 othLength = othProps.length;
4648
4649 if (objLength != othLength && !isPartial) {
4650 return false;
4651 }
4652 var index = objLength;
4653 while (index--) {
4654 var key = objProps[index];
4655 if (!(isPartial ? key in other : hasOwnProperty$9.call(other, key))) {
4656 return false;
4657 }
4658 }
4659 // Assume cyclic values are equal.
4660 var stacked = stack.get(object);
4661 if (stacked && stack.get(other)) {
4662 return stacked == other;
4663 }
4664 var result = true;
4665 stack.set(object, other);
4666 stack.set(other, object);
4667
4668 var skipCtor = isPartial;
4669 while (++index < objLength) {
4670 key = objProps[index];
4671 var objValue = object[key],
4672 othValue = other[key];
4673
4674 if (customizer) {
4675 var compared = isPartial
4676 ? customizer(othValue, objValue, key, other, object, stack)
4677 : customizer(objValue, othValue, key, object, other, stack);
4678 }
4679 // Recursively compare objects (susceptible to call stack limits).
4680 if (!(compared === undefined
4681 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
4682 : compared
4683 )) {
4684 result = false;
4685 break;
4686 }
4687 skipCtor || (skipCtor = key == 'constructor');
4688 }
4689 if (result && !skipCtor) {
4690 var objCtor = object.constructor,
4691 othCtor = other.constructor;
4692
4693 // Non `Object` object instances with different constructors are not equal.
4694 if (objCtor != othCtor &&
4695 ('constructor' in object && 'constructor' in other) &&
4696 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
4697 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
4698 result = false;
4699 }
4700 }
4701 stack['delete'](object);
4702 stack['delete'](other);
4703 return result;
4704}
4705
4706var _equalObjects = equalObjects$1;
4707
4708var Stack$2 = _Stack;
4709var equalArrays = _equalArrays;
4710var equalByTag = _equalByTag;
4711var equalObjects = _equalObjects;
4712var getTag$2 = _getTag;
4713var isArray$11 = isArray_1;
4714var isBuffer$2 = isBuffer_1;
4715var isTypedArray$3 = isTypedArray_1;
4716
4717/** Used to compose bitmasks for value comparisons. */
4718var COMPARE_PARTIAL_FLAG$1 = 1;
4719
4720/** `Object#toString` result references. */
4721var argsTag$2 = '[object Arguments]';
4722var arrayTag$1 = '[object Array]';
4723var objectTag$2 = '[object Object]';
4724
4725/** Used for built-in method references. */
4726var objectProto$10 = Object.prototype;
4727
4728/** Used to check objects for own properties. */
4729var hasOwnProperty$8 = objectProto$10.hasOwnProperty;
4730
4731/**
4732 * A specialized version of `baseIsEqual` for arrays and objects which performs
4733 * deep comparisons and tracks traversed objects enabling objects with circular
4734 * references to be compared.
4735 *
4736 * @private
4737 * @param {Object} object The object to compare.
4738 * @param {Object} other The other object to compare.
4739 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
4740 * @param {Function} customizer The function to customize comparisons.
4741 * @param {Function} equalFunc The function to determine equivalents of values.
4742 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
4743 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
4744 */
4745function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
4746 var objIsArr = isArray$11(object),
4747 othIsArr = isArray$11(other),
4748 objTag = objIsArr ? arrayTag$1 : getTag$2(object),
4749 othTag = othIsArr ? arrayTag$1 : getTag$2(other);
4750
4751 objTag = objTag == argsTag$2 ? objectTag$2 : objTag;
4752 othTag = othTag == argsTag$2 ? objectTag$2 : othTag;
4753
4754 var objIsObj = objTag == objectTag$2,
4755 othIsObj = othTag == objectTag$2,
4756 isSameTag = objTag == othTag;
4757
4758 if (isSameTag && isBuffer$2(object)) {
4759 if (!isBuffer$2(other)) {
4760 return false;
4761 }
4762 objIsArr = true;
4763 objIsObj = false;
4764 }
4765 if (isSameTag && !objIsObj) {
4766 stack || (stack = new Stack$2);
4767 return (objIsArr || isTypedArray$3(object))
4768 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
4769 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
4770 }
4771 if (!(bitmask & COMPARE_PARTIAL_FLAG$1)) {
4772 var objIsWrapped = objIsObj && hasOwnProperty$8.call(object, '__wrapped__'),
4773 othIsWrapped = othIsObj && hasOwnProperty$8.call(other, '__wrapped__');
4774
4775 if (objIsWrapped || othIsWrapped) {
4776 var objUnwrapped = objIsWrapped ? object.value() : object,
4777 othUnwrapped = othIsWrapped ? other.value() : other;
4778
4779 stack || (stack = new Stack$2);
4780 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
4781 }
4782 }
4783 if (!isSameTag) {
4784 return false;
4785 }
4786 stack || (stack = new Stack$2);
4787 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
4788}
4789
4790var _baseIsEqualDeep = baseIsEqualDeep$1;
4791
4792var baseIsEqualDeep = _baseIsEqualDeep;
4793var isObjectLike$5 = isObjectLike_1;
4794
4795/**
4796 * The base implementation of `_.isEqual` which supports partial comparisons
4797 * and tracks traversed objects.
4798 *
4799 * @private
4800 * @param {*} value The value to compare.
4801 * @param {*} other The other value to compare.
4802 * @param {boolean} bitmask The bitmask flags.
4803 * 1 - Unordered comparison
4804 * 2 - Partial comparison
4805 * @param {Function} [customizer] The function to customize comparisons.
4806 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
4807 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
4808 */
4809function baseIsEqual$1(value, other, bitmask, customizer, stack) {
4810 if (value === other) {
4811 return true;
4812 }
4813 if (value == null || other == null || (!isObjectLike$5(value) && !isObjectLike$5(other))) {
4814 return value !== value && other !== other;
4815 }
4816 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$1, stack);
4817}
4818
4819var _baseIsEqual = baseIsEqual$1;
4820
4821var Stack = _Stack;
4822var baseIsEqual = _baseIsEqual;
4823
4824/** Used to compose bitmasks for value comparisons. */
4825var COMPARE_PARTIAL_FLAG = 1;
4826var COMPARE_UNORDERED_FLAG = 2;
4827
4828/**
4829 * The base implementation of `_.isMatch` without support for iteratee shorthands.
4830 *
4831 * @private
4832 * @param {Object} object The object to inspect.
4833 * @param {Object} source The object of property values to match.
4834 * @param {Array} matchData The property names, values, and compare flags to match.
4835 * @param {Function} [customizer] The function to customize comparisons.
4836 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
4837 */
4838function baseIsMatch$1(object, source, matchData, customizer) {
4839 var index = matchData.length,
4840 length = index,
4841 noCustomizer = !customizer;
4842
4843 if (object == null) {
4844 return !length;
4845 }
4846 object = Object(object);
4847 while (index--) {
4848 var data = matchData[index];
4849 if ((noCustomizer && data[2])
4850 ? data[1] !== object[data[0]]
4851 : !(data[0] in object)
4852 ) {
4853 return false;
4854 }
4855 }
4856 while (++index < length) {
4857 data = matchData[index];
4858 var key = data[0],
4859 objValue = object[key],
4860 srcValue = data[1];
4861
4862 if (noCustomizer && data[2]) {
4863 if (objValue === undefined && !(key in object)) {
4864 return false;
4865 }
4866 } else {
4867 var stack = new Stack;
4868 if (customizer) {
4869 var result = customizer(objValue, srcValue, key, object, source, stack);
4870 }
4871 if (!(result === undefined
4872 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
4873 : result
4874 )) {
4875 return false;
4876 }
4877 }
4878 }
4879 return true;
4880}
4881
4882var _baseIsMatch = baseIsMatch$1;
4883
4884var isObject$3 = isObject_1;
4885
4886/**
4887 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
4888 *
4889 * @private
4890 * @param {*} value The value to check.
4891 * @returns {boolean} Returns `true` if `value` if suitable for strict
4892 * equality comparisons, else `false`.
4893 */
4894function isStrictComparable$1(value) {
4895 return value === value && !isObject$3(value);
4896}
4897
4898var _isStrictComparable = isStrictComparable$1;
4899
4900var isStrictComparable = _isStrictComparable;
4901var keys$3 = keys_1;
4902
4903/**
4904 * Gets the property names, values, and compare flags of `object`.
4905 *
4906 * @private
4907 * @param {Object} object The object to query.
4908 * @returns {Array} Returns the match data of `object`.
4909 */
4910function getMatchData$1(object) {
4911 var result = keys$3(object),
4912 length = result.length;
4913
4914 while (length--) {
4915 var key = result[length],
4916 value = object[key];
4917
4918 result[length] = [key, value, isStrictComparable(value)];
4919 }
4920 return result;
4921}
4922
4923var _getMatchData = getMatchData$1;
4924
4925/**
4926 * A specialized version of `matchesProperty` for source values suitable
4927 * for strict equality comparisons, i.e. `===`.
4928 *
4929 * @private
4930 * @param {string} key The key of the property to get.
4931 * @param {*} srcValue The value to match.
4932 * @returns {Function} Returns the new spec function.
4933 */
4934function matchesStrictComparable$1(key, srcValue) {
4935 return function(object) {
4936 if (object == null) {
4937 return false;
4938 }
4939 return object[key] === srcValue &&
4940 (srcValue !== undefined || (key in Object(object)));
4941 };
4942}
4943
4944var _matchesStrictComparable = matchesStrictComparable$1;
4945
4946var baseIsMatch = _baseIsMatch;
4947var getMatchData = _getMatchData;
4948var matchesStrictComparable = _matchesStrictComparable;
4949
4950/**
4951 * The base implementation of `_.matches` which doesn't clone `source`.
4952 *
4953 * @private
4954 * @param {Object} source The object of property values to match.
4955 * @returns {Function} Returns the new spec function.
4956 */
4957function baseMatches$1(source) {
4958 var matchData = getMatchData(source);
4959 if (matchData.length == 1 && matchData[0][2]) {
4960 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
4961 }
4962 return function(object) {
4963 return object === source || baseIsMatch(object, source, matchData);
4964 };
4965}
4966
4967var _baseMatches = baseMatches$1;
4968
4969/**
4970 * The base implementation of `_.hasIn` without support for deep paths.
4971 *
4972 * @private
4973 * @param {Object} [object] The object to query.
4974 * @param {Array|string} key The key to check.
4975 * @returns {boolean} Returns `true` if `key` exists, else `false`.
4976 */
4977function baseHasIn$1(object, key) {
4978 return object != null && key in Object(object);
4979}
4980
4981var _baseHasIn = baseHasIn$1;
4982
4983var castPath$2 = _castPath;
4984var isArguments$4 = isArguments_1;
4985var isArray$13 = isArray_1;
4986var isIndex$2 = _isIndex;
4987var isLength$3 = isLength_1;
4988var toKey$3 = _toKey;
4989
4990/**
4991 * Checks if `path` exists on `object`.
4992 *
4993 * @private
4994 * @param {Object} object The object to query.
4995 * @param {Array|string} path The path to check.
4996 * @param {Function} hasFunc The function to check properties.
4997 * @returns {boolean} Returns `true` if `path` exists, else `false`.
4998 */
4999function hasPath$1(object, path, hasFunc) {
5000 path = castPath$2(path, object);
5001
5002 var index = -1,
5003 length = path.length,
5004 result = false;
5005
5006 while (++index < length) {
5007 var key = toKey$3(path[index]);
5008 if (!(result = object != null && hasFunc(object, key))) {
5009 break;
5010 }
5011 object = object[key];
5012 }
5013 if (result || ++index != length) {
5014 return result;
5015 }
5016 length = object == null ? 0 : object.length;
5017 return !!length && isLength$3(length) && isIndex$2(key, length) &&
5018 (isArray$13(object) || isArguments$4(object));
5019}
5020
5021var _hasPath = hasPath$1;
5022
5023var baseHasIn = _baseHasIn;
5024var hasPath = _hasPath;
5025
5026/**
5027 * Checks if `path` is a direct or inherited property of `object`.
5028 *
5029 * @static
5030 * @memberOf _
5031 * @since 4.0.0
5032 * @category Object
5033 * @param {Object} object The object to query.
5034 * @param {Array|string} path The path to check.
5035 * @returns {boolean} Returns `true` if `path` exists, else `false`.
5036 * @example
5037 *
5038 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
5039 *
5040 * _.hasIn(object, 'a');
5041 * // => true
5042 *
5043 * _.hasIn(object, 'a.b');
5044 * // => true
5045 *
5046 * _.hasIn(object, ['a', 'b']);
5047 * // => true
5048 *
5049 * _.hasIn(object, 'b');
5050 * // => false
5051 */
5052function hasIn$1(object, path) {
5053 return object != null && hasPath(object, path, baseHasIn);
5054}
5055
5056var hasIn_1 = hasIn$1;
5057
5058var baseIsEqual$2 = _baseIsEqual;
5059var get$2 = get_1;
5060var hasIn = hasIn_1;
5061var isKey$2 = _isKey;
5062var isStrictComparable$2 = _isStrictComparable;
5063var matchesStrictComparable$2 = _matchesStrictComparable;
5064var toKey$2 = _toKey;
5065
5066/** Used to compose bitmasks for value comparisons. */
5067var COMPARE_PARTIAL_FLAG$5 = 1;
5068var COMPARE_UNORDERED_FLAG$3 = 2;
5069
5070/**
5071 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
5072 *
5073 * @private
5074 * @param {string} path The path of the property to get.
5075 * @param {*} srcValue The value to match.
5076 * @returns {Function} Returns the new spec function.
5077 */
5078function baseMatchesProperty$1(path, srcValue) {
5079 if (isKey$2(path) && isStrictComparable$2(srcValue)) {
5080 return matchesStrictComparable$2(toKey$2(path), srcValue);
5081 }
5082 return function(object) {
5083 var objValue = get$2(object, path);
5084 return (objValue === undefined && objValue === srcValue)
5085 ? hasIn(object, path)
5086 : baseIsEqual$2(srcValue, objValue, COMPARE_PARTIAL_FLAG$5 | COMPARE_UNORDERED_FLAG$3);
5087 };
5088}
5089
5090var _baseMatchesProperty = baseMatchesProperty$1;
5091
5092/**
5093 * This method returns the first argument it receives.
5094 *
5095 * @static
5096 * @since 0.1.0
5097 * @memberOf _
5098 * @category Util
5099 * @param {*} value Any value.
5100 * @returns {*} Returns `value`.
5101 * @example
5102 *
5103 * var object = { 'a': 1 };
5104 *
5105 * console.log(_.identity(object) === object);
5106 * // => true
5107 */
5108function identity$1(value) {
5109 return value;
5110}
5111
5112var identity_1 = identity$1;
5113
5114/**
5115 * The base implementation of `_.property` without support for deep paths.
5116 *
5117 * @private
5118 * @param {string} key The key of the property to get.
5119 * @returns {Function} Returns the new accessor function.
5120 */
5121function baseProperty$1(key) {
5122 return function(object) {
5123 return object == null ? undefined : object[key];
5124 };
5125}
5126
5127var _baseProperty = baseProperty$1;
5128
5129var baseGet$2 = _baseGet;
5130
5131/**
5132 * A specialized version of `baseProperty` which supports deep paths.
5133 *
5134 * @private
5135 * @param {Array|string} path The path of the property to get.
5136 * @returns {Function} Returns the new accessor function.
5137 */
5138function basePropertyDeep$1(path) {
5139 return function(object) {
5140 return baseGet$2(object, path);
5141 };
5142}
5143
5144var _basePropertyDeep = basePropertyDeep$1;
5145
5146var baseProperty = _baseProperty;
5147var basePropertyDeep = _basePropertyDeep;
5148var isKey$3 = _isKey;
5149var toKey$4 = _toKey;
5150
5151/**
5152 * Creates a function that returns the value at `path` of a given object.
5153 *
5154 * @static
5155 * @memberOf _
5156 * @since 2.4.0
5157 * @category Util
5158 * @param {Array|string} path The path of the property to get.
5159 * @returns {Function} Returns the new accessor function.
5160 * @example
5161 *
5162 * var objects = [
5163 * { 'a': { 'b': 2 } },
5164 * { 'a': { 'b': 1 } }
5165 * ];
5166 *
5167 * _.map(objects, _.property('a.b'));
5168 * // => [2, 1]
5169 *
5170 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
5171 * // => [1, 2]
5172 */
5173function property$1(path) {
5174 return isKey$3(path) ? baseProperty(toKey$4(path)) : basePropertyDeep(path);
5175}
5176
5177var property_1 = property$1;
5178
5179var baseMatches = _baseMatches;
5180var baseMatchesProperty = _baseMatchesProperty;
5181var identity = identity_1;
5182var isArray$10 = isArray_1;
5183var property = property_1;
5184
5185/**
5186 * The base implementation of `_.iteratee`.
5187 *
5188 * @private
5189 * @param {*} [value=_.identity] The value to convert to an iteratee.
5190 * @returns {Function} Returns the iteratee.
5191 */
5192function baseIteratee$1(value) {
5193 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
5194 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
5195 if (typeof value == 'function') {
5196 return value;
5197 }
5198 if (value == null) {
5199 return identity;
5200 }
5201 if (typeof value == 'object') {
5202 return isArray$10(value)
5203 ? baseMatchesProperty(value[0], value[1])
5204 : baseMatches(value);
5205 }
5206 return property(value);
5207}
5208
5209var _baseIteratee = baseIteratee$1;
5210
5211/**
5212 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
5213 *
5214 * @private
5215 * @param {boolean} [fromRight] Specify iterating from right to left.
5216 * @returns {Function} Returns the new base function.
5217 */
5218function createBaseFor$1(fromRight) {
5219 return function(object, iteratee, keysFunc) {
5220 var index = -1,
5221 iterable = Object(object),
5222 props = keysFunc(object),
5223 length = props.length;
5224
5225 while (length--) {
5226 var key = props[fromRight ? length : ++index];
5227 if (iteratee(iterable[key], key, iterable) === false) {
5228 break;
5229 }
5230 }
5231 return object;
5232 };
5233}
5234
5235var _createBaseFor = createBaseFor$1;
5236
5237var createBaseFor = _createBaseFor;
5238
5239/**
5240 * The base implementation of `baseForOwn` which iterates over `object`
5241 * properties returned by `keysFunc` and invokes `iteratee` for each property.
5242 * Iteratee functions may exit iteration early by explicitly returning `false`.
5243 *
5244 * @private
5245 * @param {Object} object The object to iterate over.
5246 * @param {Function} iteratee The function invoked per iteration.
5247 * @param {Function} keysFunc The function to get the keys of `object`.
5248 * @returns {Object} Returns `object`.
5249 */
5250var baseFor$1 = createBaseFor();
5251
5252var _baseFor = baseFor$1;
5253
5254var baseFor = _baseFor;
5255var keys$4 = keys_1;
5256
5257/**
5258 * The base implementation of `_.forOwn` without support for iteratee shorthands.
5259 *
5260 * @private
5261 * @param {Object} object The object to iterate over.
5262 * @param {Function} iteratee The function invoked per iteration.
5263 * @returns {Object} Returns `object`.
5264 */
5265function baseForOwn$1(object, iteratee) {
5266 return object && baseFor(object, iteratee, keys$4);
5267}
5268
5269var _baseForOwn = baseForOwn$1;
5270
5271var isArrayLike$4 = isArrayLike_1;
5272
5273/**
5274 * Creates a `baseEach` or `baseEachRight` function.
5275 *
5276 * @private
5277 * @param {Function} eachFunc The function to iterate over a collection.
5278 * @param {boolean} [fromRight] Specify iterating from right to left.
5279 * @returns {Function} Returns the new base function.
5280 */
5281function createBaseEach$1(eachFunc, fromRight) {
5282 return function(collection, iteratee) {
5283 if (collection == null) {
5284 return collection;
5285 }
5286 if (!isArrayLike$4(collection)) {
5287 return eachFunc(collection, iteratee);
5288 }
5289 var length = collection.length,
5290 index = fromRight ? length : -1,
5291 iterable = Object(collection);
5292
5293 while ((fromRight ? index-- : ++index < length)) {
5294 if (iteratee(iterable[index], index, iterable) === false) {
5295 break;
5296 }
5297 }
5298 return collection;
5299 };
5300}
5301
5302var _createBaseEach = createBaseEach$1;
5303
5304var baseForOwn = _baseForOwn;
5305var createBaseEach = _createBaseEach;
5306
5307/**
5308 * The base implementation of `_.forEach` without support for iteratee shorthands.
5309 *
5310 * @private
5311 * @param {Array|Object} collection The collection to iterate over.
5312 * @param {Function} iteratee The function invoked per iteration.
5313 * @returns {Array|Object} Returns `collection`.
5314 */
5315var baseEach$1 = createBaseEach(baseForOwn);
5316
5317var _baseEach = baseEach$1;
5318
5319var baseEach = _baseEach;
5320var isArrayLike$3 = isArrayLike_1;
5321
5322/**
5323 * The base implementation of `_.map` without support for iteratee shorthands.
5324 *
5325 * @private
5326 * @param {Array|Object} collection The collection to iterate over.
5327 * @param {Function} iteratee The function invoked per iteration.
5328 * @returns {Array} Returns the new mapped array.
5329 */
5330function baseMap$1(collection, iteratee) {
5331 var index = -1,
5332 result = isArrayLike$3(collection) ? Array(collection.length) : [];
5333
5334 baseEach(collection, function(value, key, collection) {
5335 result[++index] = iteratee(value, key, collection);
5336 });
5337 return result;
5338}
5339
5340var _baseMap = baseMap$1;
5341
5342var arrayMap$3 = _arrayMap;
5343var baseIteratee = _baseIteratee;
5344var baseMap = _baseMap;
5345var isArray$9 = isArray_1;
5346
5347/**
5348 * Creates an array of values by running each element in `collection` thru
5349 * `iteratee`. The iteratee is invoked with three arguments:
5350 * (value, index|key, collection).
5351 *
5352 * Many lodash methods are guarded to work as iteratees for methods like
5353 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
5354 *
5355 * The guarded methods are:
5356 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
5357 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
5358 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
5359 * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
5360 *
5361 * @static
5362 * @memberOf _
5363 * @since 0.1.0
5364 * @category Collection
5365 * @param {Array|Object} collection The collection to iterate over.
5366 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
5367 * @returns {Array} Returns the new mapped array.
5368 * @example
5369 *
5370 * function square(n) {
5371 * return n * n;
5372 * }
5373 *
5374 * _.map([4, 8], square);
5375 * // => [16, 64]
5376 *
5377 * _.map({ 'a': 4, 'b': 8 }, square);
5378 * // => [16, 64] (iteration order is not guaranteed)
5379 *
5380 * var users = [
5381 * { 'user': 'barney' },
5382 * { 'user': 'fred' }
5383 * ];
5384 *
5385 * // The `_.property` iteratee shorthand.
5386 * _.map(users, 'user');
5387 * // => ['barney', 'fred']
5388 */
5389function map(collection, iteratee) {
5390 var func = isArray$9(collection) ? arrayMap$3 : baseMap;
5391 return func(collection, baseIteratee(iteratee, 3));
5392}
5393
5394var map_1 = map;
5395
5396var name$8 = 'post';
5397var pluralName$8 = 'posts';
5398
5399var defaultProperties$7 = ['id', 'body', 'artifact_id'];
5400
5401var post = Object.freeze({
5402 name: name$8,
5403 pluralName: pluralName$8,
5404 defaultProperties: defaultProperties$7
5405});
5406
5407var name$7 = 'feedPost';
5408var pluralName$7 = 'feedPosts';
5409function getMany() {
5410 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5411
5412 var _buildPaging = buildPaging(options),
5413 from = _buildPaging.from,
5414 to = _buildPaging.to;
5415
5416 var properties = buildProperties(defaultProperties$7, options);
5417 var listLeaf = entityToFalcorListLeaf({ name: name$7 });
5418
5419 var paths = map_1(properties, function (property) {
5420 var propertyPath = index(property);
5421 var path = concat_1(['self', listLeaf, { from: from, to: to }], propertyPath);
5422
5423 return path;
5424 });
5425
5426 return paths;
5427}
5428
5429function extractMany() {
5430 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5431 var jsonGraph = arguments[1];
5432
5433 var listLeaf = entityToFalcorListLeaf({ name: name$7 });
5434 var postList = jsonGraph.json.self[listLeaf];
5435
5436 var posts = map_1(postList, function (post) {
5437 return post;
5438 });
5439
5440 return posts;
5441}
5442
5443var feedPost = Object.freeze({
5444 name: name$7,
5445 pluralName: pluralName$7,
5446 defaultProperties: defaultProperties$7,
5447 getMany: getMany,
5448 extractMany: extractMany
5449});
5450
5451var name$9 = 'growthAction';
5452var pluralName$9 = 'growthActions';
5453
5454var defaultProperties$8 = ['id', 'agent.id', 'agent.name', 'growee.id', 'growee.name', 'relationship.id', 'relationship.owner.id', 'growth_relationship_id', 'state', 'title', 'due_at', 'trigger_prompt_at', 'completed_at', 'progress_current', 'progress_total'];
5455
5456var growthAction = Object.freeze({
5457 name: name$9,
5458 pluralName: pluralName$9,
5459 defaultProperties: defaultProperties$8
5460});
5461
5462var name$10 = 'growthRelationship';
5463var pluralName$10 = 'growthRelationships';
5464
5465var defaultProperties$9 = ['id', 'owner_type', 'owner.id', 'owner.name', 'growee.id', 'growee.name', 'agent.id', 'agent.name'];
5466
5467var growthRelationship = Object.freeze({
5468 name: name$10,
5469 pluralName: pluralName$10,
5470 defaultProperties: defaultProperties$9
5471});
5472
5473var name$11 = 'growthAgentPrompt';
5474var pluralName$11 = 'growthAgentPrompts';
5475
5476var defaultProperties$10 = ['id', 'title', 'state', 'type', 'display_type', 'status', 'action.id', 'action.due_at', 'action.state', 'action.trigger_prompt_at', 'action.progress_total', 'action.progress_current', 'action.growee.id', 'action.growee.name', 'action.growee.email', 'action.growee.avatar.id', 'action.growee.avatar.src', 'action.agent.id', 'action.agent.name', 'action.relationship.id', 'action.relationship.owner.id'];
5477
5478var growthAgentPrompt = Object.freeze({
5479 name: name$11,
5480 pluralName: pluralName$11,
5481 defaultProperties: defaultProperties$10
5482});
5483
5484var name$12 = 'growthAgentResponse';
5485var pluralName$12 = 'growthAgentResponses';
5486
5487var defaultProperties$11 = ['id', 'message'];
5488
5489var growthAgentResponse = Object.freeze({
5490 name: name$12,
5491 pluralName: pluralName$12,
5492 defaultProperties: defaultProperties$11
5493});
5494
5495var name$13 = 'license';
5496var pluralName$13 = 'licenses';
5497
5498var defaultProperties$12 = ['id', 'updated_at'];
5499
5500var license = Object.freeze({
5501 name: name$13,
5502 pluralName: pluralName$13,
5503 defaultProperties: defaultProperties$12
5504});
5505
5506var name$14 = 'licensedCohort';
5507var pluralName$14 = 'licensedCohorts';
5508
5509var defaultProperties$13 = ['id', 'updated_at'];
5510
5511var licensedCohort = Object.freeze({
5512 name: name$14,
5513 pluralName: pluralName$14,
5514 defaultProperties: defaultProperties$13
5515});
5516
5517var name$15 = 'licensedContentItem';
5518var pluralName$15 = 'licensedContentItems';
5519
5520var defaultProperties$14 = ['id', 'updated_at'];
5521
5522var licensedContentItem = Object.freeze({
5523 name: name$15,
5524 pluralName: pluralName$15,
5525 defaultProperties: defaultProperties$14
5526});
5527
5528var name$16 = 'moment';
5529var pluralName$16 = 'moments';
5530
5531var defaultProperties$15 = ['id', 'description', 'title', 'owner_type', 'owner.name', 'owner.avatar.src', 'owner.icon.src', 'cover_image_media.id', 'cover_image_media.src', 'background_music.src', 'background_music.duration', 'background_music.author'];
5532
5533var moment = Object.freeze({
5534 name: name$16,
5535 pluralName: pluralName$16,
5536 defaultProperties: defaultProperties$15
5537});
5538
5539var name$17 = 'myGrowthAgentPrompt';
5540var pluralName$17 = 'myGrowthAgentPrompts';
5541
5542var defaultProperties$16 = ['id', 'title', 'state', 'type', 'display_type', 'status', 'action.id', 'action.due_at', 'action.state', 'action.trigger_prompt_at', 'action.progress_total', 'action.progress_current', 'action.growee.id', 'action.growee.name', 'action.growee.email', 'action.growee.avatar.id', 'action.growee.avatar.src', 'action.agent.id', 'action.agent.name', 'action.relationship.id', 'action.relationship.owner.id'];
5543
5544function getMany$1() {
5545 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5546
5547 var _buildPaging = buildPaging(options),
5548 from = _buildPaging.from,
5549 to = _buildPaging.to;
5550
5551 var properties = buildProperties(defaultProperties$16, options);
5552 var listLeaf = entityToFalcorListLeaf({ name: name$17 });
5553
5554 var paths = map_1(properties, function (property) {
5555 var propertyPath = index(property);
5556 var path = concat_1(['self', listLeaf, { from: from, to: to }], propertyPath);
5557
5558 return path;
5559 });
5560
5561 return paths;
5562}
5563
5564function extractMany$1() {
5565 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5566 var jsonGraph = arguments[1];
5567
5568 var listLeaf = entityToFalcorListLeaf({ name: name$17 });
5569 var viewList = jsonGraph.json.self[listLeaf];
5570
5571 var views = map_1(viewList, function (view) {
5572 return view;
5573 });
5574
5575 return views;
5576}
5577
5578var myGrowthAgentPrompt = Object.freeze({
5579 name: name$17,
5580 pluralName: pluralName$17,
5581 defaultProperties: defaultProperties$16,
5582 getMany: getMany$1,
5583 extractMany: extractMany$1
5584});
5585
5586/**
5587 * Checks if `value` is `null` or `undefined`.
5588 *
5589 * @static
5590 * @memberOf _
5591 * @since 4.0.0
5592 * @category Lang
5593 * @param {*} value The value to check.
5594 * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
5595 * @example
5596 *
5597 * _.isNil(null);
5598 * // => true
5599 *
5600 * _.isNil(void 0);
5601 * // => true
5602 *
5603 * _.isNil(NaN);
5604 * // => false
5605 */
5606function isNil(value) {
5607 return value == null;
5608}
5609
5610var isNil_1 = isNil;
5611
5612var name$19 = 'review';
5613var pluralName$19 = 'reviews';
5614
5615var defaultProperties$17 = ['id', 'rating'];
5616
5617var review = Object.freeze({
5618 name: name$19,
5619 pluralName: pluralName$19,
5620 defaultProperties: defaultProperties$17
5621});
5622
5623var name$20 = 'tree';
5624var pluralName$20 = 'trees';
5625
5626var treeEntity = Object.freeze({
5627 name: name$20,
5628 pluralName: pluralName$20
5629});
5630
5631/*
5632 * This entity is temporary while we figure out how to handle "my" entities
5633 * in a standard entity way. We expect to delete it once we have settled on a
5634 * standard "my" approach.
5635 */
5636
5637var name$18 = 'myTreeReview';
5638var pluralName$18 = 'myTreeReviews';
5639function getOne() {
5640 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5641 var tree = options.tree;
5642
5643
5644 if (isNil_1(tree) || isNil_1(tree.id)) {
5645 return new Error("options.tree.id is required when getting the current user's tree review");
5646 }
5647
5648 var properties = buildProperties(defaultProperties$17, options);
5649
5650 var paths = properties.map(function (property) {
5651 var rootLeaf = entityToFalcorRootLeaf(treeEntity);
5652 var path = index(property);
5653
5654 return concat_1([rootLeaf, tree.id, 'my_review'], path);
5655 });
5656
5657 return paths;
5658}
5659
5660function extractOne() {
5661 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5662 var jsonGraph = arguments[1];
5663 var tree = options.tree;
5664
5665
5666 if (isNil_1(tree) || isNil_1(tree.id)) {
5667 return new Error("options.tree.id is required when getting the current user's tree review");
5668 }
5669
5670 var rootLeaf = entityToFalcorRootLeaf(treeEntity);
5671
5672 return jsonGraph.json[rootLeaf][tree.id].my_review;
5673}
5674
5675var myTreeReview = Object.freeze({
5676 name: name$18,
5677 pluralName: pluralName$18,
5678 defaultProperties: defaultProperties$17,
5679 getOne: getOne,
5680 extractOne: extractOne
5681});
5682
5683var name$21 = 'note';
5684var pluralName$21 = 'notes';
5685
5686var defaultProperties$18 = ['id', 'body'];
5687
5688var note = Object.freeze({
5689 name: name$21,
5690 pluralName: pluralName$21,
5691 defaultProperties: defaultProperties$18
5692});
5693
5694var name$22 = 'progressItem';
5695var pluralName$22 = 'progressItems';
5696
5697var defaultProperties$19 = ['id', 'action', 'title', 'description', 'completed', 'hidden', 'assigner_type', 'linkable_type', 'updated_at', 'date_due'];
5698
5699var progressItem = Object.freeze({
5700 name: name$22,
5701 pluralName: pluralName$22,
5702 defaultProperties: defaultProperties$19
5703});
5704
5705var name$23 = 'space';
5706var pluralName$23 = 'spaces';
5707
5708var defaultProperties$20 = ['id', 'name', 'topic', 'champion_id'];
5709
5710var space = Object.freeze({
5711 name: name$23,
5712 pluralName: pluralName$23,
5713 defaultProperties: defaultProperties$20
5714});
5715
5716var name$24 = 'timeline';
5717var pluralName$24 = 'timelines';
5718
5719var timeline = Object.freeze({
5720 name: name$24,
5721 pluralName: pluralName$24
5722});
5723
5724var name$25 = 'toDoItem';
5725var pluralName$25 = 'toDoItems';
5726
5727var defaultProperties$21 = ['id', 'title', 'description', 'action', 'date_due'];
5728
5729var toDoItem = Object.freeze({
5730 name: name$25,
5731 pluralName: pluralName$25,
5732 defaultProperties: defaultProperties$21
5733});
5734
5735var name$26 = 'toDoList';
5736var pluralName$26 = 'toDoLists';
5737
5738var defaultProperties$22 = ['id', 'name', 'created_at', 'updated_at'];
5739
5740var toDoList = Object.freeze({
5741 name: name$26,
5742 pluralName: pluralName$26,
5743 defaultProperties: defaultProperties$22
5744});
5745
5746var name$27 = 'topic';
5747var pluralName$27 = 'topics';
5748
5749var defaultProperties$23 = ['id', 'name'];
5750
5751var topic = Object.freeze({
5752 name: name$27,
5753 pluralName: pluralName$27,
5754 defaultProperties: defaultProperties$23
5755});
5756
5757var name$28 = 'tourTipView';
5758var pluralName$28 = 'tourTipViews';
5759
5760var defaultProperties$24 = ['id', 'state'];
5761
5762function getMany$2() {
5763 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5764
5765 var _buildPaging = buildPaging(options),
5766 from = _buildPaging.from,
5767 to = _buildPaging.to;
5768
5769 var properties = buildProperties(defaultProperties$24, options);
5770 var listLeaf = entityToFalcorListLeaf({ name: name$28 });
5771
5772 var paths = map_1(properties, function (property) {
5773 var propertyPath = index(property);
5774 var path = concat_1(['self', listLeaf, { from: from, to: to }], propertyPath);
5775
5776 return path;
5777 });
5778
5779 return paths;
5780}
5781
5782function extractMany$2() {
5783 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5784 var jsonGraph = arguments[1];
5785
5786 var listLeaf = entityToFalcorListLeaf({ name: name$28 });
5787 var viewList = jsonGraph.json.self[listLeaf];
5788
5789 var views = map_1(viewList, function (view) {
5790 return view;
5791 });
5792
5793 return views;
5794}
5795
5796var tourTipView = Object.freeze({
5797 name: name$28,
5798 pluralName: pluralName$28,
5799 defaultProperties: defaultProperties$24,
5800 getMany: getMany$2,
5801 extractMany: extractMany$2
5802});
5803
5804var name$29 = 'user';
5805var pluralName$29 = 'users';
5806
5807var defaultProperties$25 = ['id', 'username', 'name'];
5808
5809var user = Object.freeze({
5810 name: name$29,
5811 pluralName: pluralName$29,
5812 defaultProperties: defaultProperties$25
5813});
5814
5815var name$30 = 'userToDoList';
5816var pluralName$30 = 'userToDoLists';
5817
5818var defaultProperties$26 = ['id', 'name'];
5819
5820var userToDoList = Object.freeze({
5821 name: name$30,
5822 pluralName: pluralName$30,
5823 defaultProperties: defaultProperties$26
5824});
5825
5826var name$31 = 'view';
5827var pluralName$31 = 'views';
5828
5829var defaultProperties$27 = ['id', 'viewable_id', 'viewable_type'];
5830
5831var view = Object.freeze({
5832 name: name$31,
5833 pluralName: pluralName$31,
5834 defaultProperties: defaultProperties$27
5835});
5836
5837
5838
5839var entities = Object.freeze({
5840 audioCategory: audioCategory,
5841 audioCategories: audioCategory,
5842 audioTrack: audioTrack,
5843 audioTracks: audioTrack,
5844 champion: champion,
5845 champions: champion,
5846 cohort: cohort,
5847 cohorts: cohort,
5848 comment: comment,
5849 comments: comment,
5850 contentListItem: contentListItem,
5851 contentListItems: contentListItem,
5852 directMessage: directMessage,
5853 directMessages: directMessage,
5854 feedPost: feedPost,
5855 feedPosts: feedPost,
5856 growthAction: growthAction,
5857 growthActions: growthAction,
5858 growthRelationship: growthRelationship,
5859 growthRelationships: growthRelationship,
5860 growthAgentPrompt: growthAgentPrompt,
5861 growthAgentPrompts: growthAgentPrompt,
5862 growthAgentResponse: growthAgentResponse,
5863 growthAgentResponses: growthAgentResponse,
5864 license: license,
5865 licenses: license,
5866 licensedCohort: licensedCohort,
5867 licensedCohorts: licensedCohort,
5868 licensedContentItem: licensedContentItem,
5869 licensedContentItems: licensedContentItem,
5870 moment: moment,
5871 moments: moment,
5872 myGrowthAgentPrompt: myGrowthAgentPrompt,
5873 myGrowthAgentPrompts: myGrowthAgentPrompt,
5874 myTreeReview: myTreeReview,
5875 myTreeReviews: myTreeReview,
5876 note: note,
5877 notes: note,
5878 post: post,
5879 posts: post,
5880 progressItem: progressItem,
5881 progressItems: progressItem,
5882 review: review,
5883 reviews: review,
5884 space: space,
5885 spaces: space,
5886 timeline: timeline,
5887 timelines: timeline,
5888 toDoItem: toDoItem,
5889 toDoItems: toDoItem,
5890 toDoList: toDoList,
5891 toDoLists: toDoList,
5892 topic: topic,
5893 topics: topic,
5894 tourTipView: tourTipView,
5895 tourTipViews: tourTipView,
5896 tree: treeEntity,
5897 trees: treeEntity,
5898 user: user,
5899 users: user,
5900 userToDoList: userToDoList,
5901 userToDoLists: userToDoList,
5902 view: view,
5903 views: view
5904});
5905
5906// Copyright Joyent, Inc. and other Node contributors.
5907//
5908// Permission is hereby granted, free of charge, to any person obtaining a
5909// copy of this software and associated documentation files (the
5910// "Software"), to deal in the Software without restriction, including
5911// without limitation the rights to use, copy, modify, merge, publish,
5912// distribute, sublicense, and/or sell copies of the Software, and to permit
5913// persons to whom the Software is furnished to do so, subject to the
5914// following conditions:
5915//
5916// The above copyright notice and this permission notice shall be included
5917// in all copies or substantial portions of the Software.
5918//
5919// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
5920// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5921// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
5922// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
5923// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
5924// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
5925// USE OR OTHER DEALINGS IN THE SOFTWARE.
5926
5927
5928// If obj.hasOwnProperty has been overridden, then calling
5929// obj.hasOwnProperty(prop) will break.
5930// See: https://github.com/joyent/node/issues/1707
5931var isArray$14 = Array.isArray || function (xs) {
5932 return Object.prototype.toString.call(xs) === '[object Array]';
5933};
5934function stringifyPrimitive(v) {
5935 switch (typeof v) {
5936 case 'string':
5937 return v;
5938
5939 case 'boolean':
5940 return v ? 'true' : 'false';
5941
5942 case 'number':
5943 return isFinite(v) ? v : '';
5944
5945 default:
5946 return '';
5947 }
5948}
5949
5950function stringify (obj, sep, eq, name) {
5951 sep = sep || '&';
5952 eq = eq || '=';
5953 if (obj === null) {
5954 obj = undefined;
5955 }
5956
5957 if (typeof obj === 'object') {
5958 return map$2(objectKeys(obj), function(k) {
5959 var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
5960 if (isArray$14(obj[k])) {
5961 return map$2(obj[k], function(v) {
5962 return ks + encodeURIComponent(stringifyPrimitive(v));
5963 }).join(sep);
5964 } else {
5965 return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
5966 }
5967 }).join(sep);
5968
5969 }
5970
5971 if (!name) return '';
5972 return encodeURIComponent(stringifyPrimitive(name)) + eq +
5973 encodeURIComponent(stringifyPrimitive(obj));
5974}
5975
5976function map$2 (xs, f) {
5977 if (xs.map) return xs.map(f);
5978 var res = [];
5979 for (var i = 0; i < xs.length; i++) {
5980 res.push(f(xs[i], i));
5981 }
5982 return res;
5983}
5984
5985var objectKeys = Object.keys || function (obj) {
5986 var res = [];
5987 for (var key in obj) {
5988 if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
5989 }
5990 return res;
5991};
5992
5993var baseEach$2 = _baseEach;
5994
5995/**
5996 * The base implementation of `_.filter` without support for iteratee shorthands.
5997 *
5998 * @private
5999 * @param {Array|Object} collection The collection to iterate over.
6000 * @param {Function} predicate The function invoked per iteration.
6001 * @returns {Array} Returns the new filtered array.
6002 */
6003function baseFilter$1(collection, predicate) {
6004 var result = [];
6005 baseEach$2(collection, function(value, index, collection) {
6006 if (predicate(value, index, collection)) {
6007 result.push(value);
6008 }
6009 });
6010 return result;
6011}
6012
6013var _baseFilter = baseFilter$1;
6014
6015var arrayFilter$2 = _arrayFilter;
6016var baseFilter = _baseFilter;
6017var baseIteratee$2 = _baseIteratee;
6018var isArray$15 = isArray_1;
6019
6020/**
6021 * Iterates over elements of `collection`, returning an array of all elements
6022 * `predicate` returns truthy for. The predicate is invoked with three
6023 * arguments: (value, index|key, collection).
6024 *
6025 * **Note:** Unlike `_.remove`, this method returns a new array.
6026 *
6027 * @static
6028 * @memberOf _
6029 * @since 0.1.0
6030 * @category Collection
6031 * @param {Array|Object} collection The collection to iterate over.
6032 * @param {Function} [predicate=_.identity] The function invoked per iteration.
6033 * @returns {Array} Returns the new filtered array.
6034 * @see _.reject
6035 * @example
6036 *
6037 * var users = [
6038 * { 'user': 'barney', 'age': 36, 'active': true },
6039 * { 'user': 'fred', 'age': 40, 'active': false }
6040 * ];
6041 *
6042 * _.filter(users, function(o) { return !o.active; });
6043 * // => objects for ['fred']
6044 *
6045 * // The `_.matches` iteratee shorthand.
6046 * _.filter(users, { 'age': 36, 'active': true });
6047 * // => objects for ['barney']
6048 *
6049 * // The `_.matchesProperty` iteratee shorthand.
6050 * _.filter(users, ['active', false]);
6051 * // => objects for ['fred']
6052 *
6053 * // The `_.property` iteratee shorthand.
6054 * _.filter(users, 'active');
6055 * // => objects for ['barney']
6056 */
6057function filter(collection, predicate) {
6058 var func = isArray$15(collection) ? arrayFilter$2 : baseFilter;
6059 return func(collection, baseIteratee$2(predicate, 3));
6060}
6061
6062var filter_1 = filter;
6063
6064var entitySrc = 'entities';
6065
6066function entityIsUndefinedError(entityName) {
6067 var filename = entityNameToFilename(entityName);
6068 return new Error('The ' + entityName + ' entity is undefined. Ensure ' + entitySrc + '/' + filename + ' exists and is exported by ' + entitySrc + '/_catalog.js');
6069}
6070
6071function entityMustExportError(entityName, property) {
6072 var filename = entityNameToFilename(entityName);
6073 return new Error(entitySrc + '/' + filename + ' must export ' + property);
6074}
6075
6076function optionsMustHaveError(property) {
6077 return new Error('options.' + property + ' is required');
6078}
6079
6080function entityExports(entity, property) {
6081 return !isNil_1(entity[property]);
6082}
6083
6084
6085
6086function optionsHas(options, property) {
6087 return !isNil_1(get_1(options, property));
6088}
6089
6090function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6091
6092function getOne$1(entityName, entity) {
6093 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6094
6095 if (!entityExports(entity, 'pluralName')) {
6096 return entityMustExportError(entityName, 'pluralName');
6097 }
6098
6099 if (!entityExports(entity, 'defaultProperties')) {
6100 return entityMustExportError(entityName, 'defaultProperties');
6101 }
6102
6103 if (!optionsHas(options, 'id')) {
6104 return optionsMustHaveError('id');
6105 }
6106
6107 var properties = buildProperties(entity.defaultProperties, options);
6108 var rootLeaf = entityToFalcorRootLeaf(entity);
6109
6110 var paths = map_1(properties, function (property) {
6111 var propertyPath = index(property);
6112 var path = concat_1([rootLeaf, options.id], propertyPath);
6113
6114 return path;
6115 });
6116
6117 return paths;
6118}
6119
6120function extractOne$1(entity) {
6121 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6122 var jsonGraph = arguments[2];
6123
6124 var rootLeaf = entityToFalcorRootLeaf(entity);
6125 var extractedEntity = jsonGraph.json[rootLeaf][options.id];
6126
6127 return extractedEntity;
6128}
6129
6130function getMany$3(entityName, entity) {
6131 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6132
6133 if (!entityExports(entity, 'name')) {
6134 return entityMustExportError(entityName, 'name');
6135 }
6136
6137 if (!entityExports(entity, 'pluralName')) {
6138 return entityMustExportError(entityName, 'pluralName');
6139 }
6140
6141 if (!entityExports(entity, 'defaultProperties')) {
6142 return entityMustExportError(entityName, 'defaultProperties');
6143 }
6144
6145 var _buildPaging = buildPaging(options),
6146 from = _buildPaging.from,
6147 to = _buildPaging.to;
6148
6149 var properties = buildProperties(entity.defaultProperties, options);
6150
6151 var parentEntity = void 0,
6152 parentOptions = void 0;
6153 if (!isNil_1(options.parent)) {
6154 var parentEntityName = head_1(keys_1(options.parent));
6155 parentEntity = entities[parentEntityName];
6156 parentOptions = options.parent[parentEntityName];
6157 }
6158
6159 var basePath = [];
6160
6161 if (parentEntity) {
6162 var rootLeaf = entityToFalcorRootLeaf(parentEntity);
6163 basePath = concat_1(basePath, [rootLeaf, parentOptions.id]);
6164 }
6165
6166 var listLeaf = !isNil_1(options.type) ? typedEntityToFalcorListPath(entity, options) : entityToFalcorListLeaf(entity);
6167
6168 basePath = concat_1(basePath, listLeaf);
6169
6170 if (optionsHasQuery(options)) {
6171 var qs = stringify(options.query);
6172 basePath = concat_1(basePath, qs);
6173 }
6174
6175 basePath = concat_1(basePath, { from: from, to: to });
6176
6177 var paths = map_1(properties, function (property) {
6178 var propertyPath = index(property);
6179 var path = concat_1(basePath, propertyPath);
6180
6181 return path;
6182 });
6183
6184 return paths;
6185}
6186
6187function extractMany$3(entity) {
6188 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6189 var jsonGraph = arguments[2];
6190
6191 var parentEntity = void 0,
6192 parentOptions = void 0;
6193 if (!isNil_1(options.parent)) {
6194 var parentEntityName = head_1(keys_1(options.parent));
6195 parentEntity = entities[parentEntityName];
6196 parentOptions = options.parent[parentEntityName];
6197 }
6198
6199 var leafPath = !isNil_1(options.type) ? typedEntityToFalcorListPath(entity, options) : entityToFalcorListLeaf(entity);
6200
6201 var listPath = [];
6202 if (parentEntity) {
6203 var parentRootLeaf = entityToFalcorRootLeaf(parentEntity);
6204 listPath = concat_1(listPath, 'json', parentRootLeaf, parentOptions.id, leafPath);
6205 } else {
6206 listPath = concat_1(listPath, 'json', leafPath);
6207 }
6208
6209 if (optionsHasQuery(options)) {
6210 var qs = stringify(options.query);
6211 listPath = concat_1(listPath, qs);
6212 }
6213
6214 var entityList = get_1(jsonGraph, listPath);
6215 var extractedEntities = map_1(entityList, function (entity) {
6216 return entity;
6217 });
6218
6219 return extractedEntities;
6220}
6221
6222function getMy(entityName, entity) {
6223 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6224
6225 if (!entityExports(entity, 'name')) {
6226 return entityMustExportError(entityName, 'name');
6227 }
6228
6229 if (!entityExports(entity, 'defaultProperties')) {
6230 return entityMustExportError(entityName, 'defaultProperties');
6231 }
6232
6233 var _buildPaging2 = buildPaging(options),
6234 from = _buildPaging2.from,
6235 to = _buildPaging2.to;
6236
6237 var properties = buildProperties(entity.defaultProperties, options);
6238 var listLeaf = entityToFalcorMyListLeaf(entity);
6239 var basePath = [MY_PATH_KEYWORD, listLeaf];
6240
6241 if (optionsHasQuery(options)) {
6242 var qs = stringify(options.query);
6243 basePath = concat_1(basePath, qs);
6244 }
6245
6246 basePath = concat_1(basePath, { from: from, to: to });
6247
6248 var paths = map_1(properties, function (property) {
6249 var propertyPath = index(property);
6250 var path = concat_1(basePath, propertyPath);
6251
6252 return path;
6253 });
6254
6255 return paths;
6256}
6257
6258function extractMy(entity) {
6259 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6260 var jsonGraph = arguments[2];
6261
6262 var listLeaf = entityToFalcorMyListLeaf(entity);
6263 var entityList = jsonGraph.json[MY_PATH_KEYWORD][listLeaf];
6264
6265 if (optionsHasQuery(options)) {
6266 var qs = stringify(options.query);
6267 entityList = entityList[qs];
6268 }
6269
6270 var extractedEntities = map_1(entityList, function (entity) {
6271 return entity;
6272 });
6273
6274 return extractedEntities;
6275}
6276
6277function getMembership(entityName, entity) {
6278 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6279
6280 if (!entityExports(entity, 'name')) {
6281 return entityMustExportError(entityName, 'name');
6282 }
6283
6284 if (!entityExports(entity, 'defaultProperties')) {
6285 return entityMustExportError(entityName, 'defaultProperties');
6286 }
6287
6288 var _buildPaging3 = buildPaging(options),
6289 from = _buildPaging3.from,
6290 to = _buildPaging3.to;
6291
6292 var properties = buildProperties(entity.defaultProperties, options);
6293 var listLeaf = entityToFalcorMembershipsListLeaf(entity);
6294 var basePath = [MY_PATH_KEYWORD, listLeaf];
6295
6296 if (optionsHasQuery(options)) {
6297 var qs = stringify(options.query);
6298 basePath = concat_1(basePath, qs);
6299 }
6300
6301 basePath = concat_1(basePath, { from: from, to: to });
6302
6303 var paths = map_1(properties, function (property) {
6304 var propertyPath = index(property);
6305 var path = concat_1(basePath, propertyPath);
6306
6307 return path;
6308 });
6309
6310 return paths;
6311}
6312
6313function extractMemberships(entity) {
6314 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6315 var jsonGraph = arguments[2];
6316
6317 var listLeaf = entityToFalcorMembershipsListLeaf(entity);
6318 var entityList = jsonGraph.json[MY_PATH_KEYWORD][listLeaf];
6319
6320 if (optionsHasQuery(options)) {
6321 var qs = stringify(options.query);
6322 entityList = entityList[qs];
6323 }
6324
6325 var extractedEntities = map_1(entityList, function (entity) {
6326 return entity;
6327 });
6328
6329 return extractedEntities;
6330}
6331
6332function create(entityName, entity) {
6333 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6334
6335 if (!entityExports(entity, 'name')) {
6336 return entityMustExportError(entityName, 'name');
6337 }
6338
6339 if (!entityExports(entity, 'pluralName')) {
6340 return entityMustExportError(entityName, 'pluralName');
6341 }
6342
6343 if (!optionsHas(options, entityName)) {
6344 return optionsMustHaveError(entityName);
6345 }
6346
6347 var parentEntity = void 0,
6348 parentOptions = void 0;
6349 if (!isNil_1(options.parent)) {
6350 var parentEntityName = head_1(keys_1(options.parent));
6351 parentEntity = entities[parentEntityName];
6352 parentOptions = options.parent[parentEntityName];
6353
6354 if (isNil_1(parentEntity)) {
6355 return entityIsUndefinedError(parentEntityName);
6356 }
6357
6358 if (!entityExports(parentEntity, 'pluralName')) {
6359 return entityMustExportError(parentEntityName, 'pluralName');
6360 }
6361
6362 if (!optionsHas(parentOptions, 'id')) {
6363 return optionsMustHaveError('parent.' + parentEntityName + '.id');
6364 }
6365 }
6366
6367 var path = void 0;
6368 if (parentEntity) {
6369 var rootLeaf = entityToFalcorRootLeaf(parentEntity);
6370 var listLeaf = entityToFalcorListLeaf(entity);
6371
6372 path = [rootLeaf, parentOptions.id, listLeaf, 'add'];
6373 } else {
6374 var _rootLeaf = entityToFalcorRootLeaf(entity);
6375
6376 path = [_rootLeaf, 'create'];
6377 }
6378
6379 var envelopeKey = entityToAPIEnvelopeKey(entity);
6380 var args = [_defineProperty({}, envelopeKey, options[entity.name])];
6381
6382 return { path: path, args: args };
6383}
6384
6385function extractCreated(entity) {
6386 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6387 var jsonGraph = arguments[2];
6388
6389 var rootLeaf = entityToFalcorRootLeaf(entity);
6390 var entities = jsonGraph.json[rootLeaf];
6391 var first = head_1(keys_1(entities));
6392 var extractedEntity = entities[first];
6393
6394 return extractedEntity;
6395}
6396
6397function invalidateAfterCreate$1(entity) {
6398 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6399
6400 if (!isNil_1(options.parent)) {
6401 var parentEntityName = head_1(keys_1(options.parent));
6402 var parentEntity = entities[parentEntityName];
6403 var parentId = options.parent[parentEntityName].id;
6404
6405 var rootLeaf = entityToFalcorRootLeaf(parentEntity);
6406 var listLeaf = entityToFalcorListLeaf(entity);
6407
6408 var paths = [[rootLeaf, parentId, listLeaf], [rootLeaf, parentId, listLeaf, 'length']];
6409
6410 return paths;
6411 }
6412}
6413
6414function update(entityName, entity) {
6415 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6416
6417 if (!entityExports(entity, 'pluralName')) {
6418 return entityMustExportError(entityName, 'pluralName');
6419 }
6420
6421 if (!optionsHas(options, 'id')) {
6422 return optionsMustHaveError('id');
6423 }
6424
6425 if (keys_1(options).length === 1) {
6426 return new Error('options must include at least one property to update');
6427 }
6428
6429 var properties = filter_1(keys_1(options), function (key) {
6430 return key !== 'id';
6431 });
6432 var rootLeaf = entityToFalcorRootLeaf(entity);
6433
6434 var paths = map_1(properties, function (property) {
6435 var path = {
6436 path: [rootLeaf, options.id, property],
6437 value: options[property]
6438 };
6439
6440 return path;
6441 });
6442
6443 return paths;
6444}
6445
6446function extractUpdated(entity) {
6447 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6448 var jsonGraph = arguments[2];
6449
6450 var rootLeaf = entityToFalcorRootLeaf(entity);
6451 var updatedProperties = jsonGraph.json[rootLeaf][options.id];
6452
6453 return updatedProperties;
6454}
6455
6456function destroy(entityName, entity) {
6457 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6458
6459 if (!entityExports(entity, 'pluralName')) {
6460 return entityMustExportError(entityName, 'pluralName');
6461 }
6462
6463 if (!optionsHas(options, 'id')) {
6464 return optionsMustHaveError('id');
6465 }
6466
6467 var rootLeaf = entityToFalcorRootLeaf(entity);
6468 var destroyPath = [rootLeaf, options.id, 'delete'];
6469
6470 return destroyPath;
6471}
6472
6473function invalidateAfterDestroy$1(entity) {
6474 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6475
6476 var rootEntityLeaf = entityToFalcorRootLeaf(entity);
6477 var entityId = options.id;
6478
6479 var paths = [[rootEntityLeaf, entityId]];
6480
6481 if (!isNil_1(options.parent)) {
6482 var parentEntityName = head_1(keys_1(options.parent));
6483 var parentEntity = entities[parentEntityName];
6484 var parentId = options.parent[parentEntityName].id;
6485
6486 var rootParentLeaf = entityToFalcorRootLeaf(parentEntity);
6487 var listLeaf = entityToFalcorListLeaf(entity);
6488
6489 paths.push([rootParentLeaf, parentId, listLeaf], [rootParentLeaf, parentId, listLeaf, 'length']);
6490 }
6491
6492 return paths;
6493}
6494
6495/**
6496 * A specialized version of `_.forEach` for arrays without support for
6497 * iteratee shorthands.
6498 *
6499 * @private
6500 * @param {Array} [array] The array to iterate over.
6501 * @param {Function} iteratee The function invoked per iteration.
6502 * @returns {Array} Returns `array`.
6503 */
6504function arrayEach$1(array, iteratee) {
6505 var index = -1,
6506 length = array == null ? 0 : array.length;
6507
6508 while (++index < length) {
6509 if (iteratee(array[index], index, array) === false) {
6510 break;
6511 }
6512 }
6513 return array;
6514}
6515
6516var _arrayEach = arrayEach$1;
6517
6518var identity$2 = identity_1;
6519
6520/**
6521 * Casts `value` to `identity` if it's not a function.
6522 *
6523 * @private
6524 * @param {*} value The value to inspect.
6525 * @returns {Function} Returns cast function.
6526 */
6527function castFunction$1(value) {
6528 return typeof value == 'function' ? value : identity$2;
6529}
6530
6531var _castFunction = castFunction$1;
6532
6533var arrayEach = _arrayEach;
6534var baseEach$3 = _baseEach;
6535var castFunction = _castFunction;
6536var isArray$16 = isArray_1;
6537
6538/**
6539 * Iterates over elements of `collection` and invokes `iteratee` for each element.
6540 * The iteratee is invoked with three arguments: (value, index|key, collection).
6541 * Iteratee functions may exit iteration early by explicitly returning `false`.
6542 *
6543 * **Note:** As with other "Collections" methods, objects with a "length"
6544 * property are iterated like arrays. To avoid this behavior use `_.forIn`
6545 * or `_.forOwn` for object iteration.
6546 *
6547 * @static
6548 * @memberOf _
6549 * @since 0.1.0
6550 * @alias each
6551 * @category Collection
6552 * @param {Array|Object} collection The collection to iterate over.
6553 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
6554 * @returns {Array|Object} Returns `collection`.
6555 * @see _.forEachRight
6556 * @example
6557 *
6558 * _.forEach([1, 2], function(value) {
6559 * console.log(value);
6560 * });
6561 * // => Logs `1` then `2`.
6562 *
6563 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
6564 * console.log(key);
6565 * });
6566 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
6567 */
6568function forEach(collection, iteratee) {
6569 var func = isArray$16(collection) ? arrayEach : baseEach$3;
6570 return func(collection, castFunction(iteratee));
6571}
6572
6573var forEach_1 = forEach;
6574
6575var overArg$2 = _overArg;
6576
6577/** Built-in value references. */
6578var getPrototype$1 = overArg$2(Object.getPrototypeOf, Object);
6579
6580var _getPrototype = getPrototype$1;
6581
6582var baseGetTag$7 = _baseGetTag;
6583var getPrototype = _getPrototype;
6584var isObjectLike$7 = isObjectLike_1;
6585
6586/** `Object#toString` result references. */
6587var objectTag$3 = '[object Object]';
6588
6589/** Used for built-in method references. */
6590var funcProto$2 = Function.prototype;
6591var objectProto$13 = Object.prototype;
6592
6593/** Used to resolve the decompiled source of functions. */
6594var funcToString$2 = funcProto$2.toString;
6595
6596/** Used to check objects for own properties. */
6597var hasOwnProperty$11 = objectProto$13.hasOwnProperty;
6598
6599/** Used to infer the `Object` constructor. */
6600var objectCtorString = funcToString$2.call(Object);
6601
6602/**
6603 * Checks if `value` is a plain object, that is, an object created by the
6604 * `Object` constructor or one with a `[[Prototype]]` of `null`.
6605 *
6606 * @static
6607 * @memberOf _
6608 * @since 0.8.0
6609 * @category Lang
6610 * @param {*} value The value to check.
6611 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
6612 * @example
6613 *
6614 * function Foo() {
6615 * this.a = 1;
6616 * }
6617 *
6618 * _.isPlainObject(new Foo);
6619 * // => false
6620 *
6621 * _.isPlainObject([1, 2, 3]);
6622 * // => false
6623 *
6624 * _.isPlainObject({ 'x': 0, 'y': 0 });
6625 * // => true
6626 *
6627 * _.isPlainObject(Object.create(null));
6628 * // => true
6629 */
6630function isPlainObject$1(value) {
6631 if (!isObjectLike$7(value) || baseGetTag$7(value) != objectTag$3) {
6632 return false;
6633 }
6634 var proto = getPrototype(value);
6635 if (proto === null) {
6636 return true;
6637 }
6638 var Ctor = hasOwnProperty$11.call(proto, 'constructor') && proto.constructor;
6639 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
6640 funcToString$2.call(Ctor) == objectCtorString;
6641}
6642
6643var isPlainObject_1 = isPlainObject$1;
6644
6645var baseGetTag$6 = _baseGetTag;
6646var isObjectLike$6 = isObjectLike_1;
6647var isPlainObject = isPlainObject_1;
6648
6649/** `Object#toString` result references. */
6650var domExcTag = '[object DOMException]';
6651var errorTag$2 = '[object Error]';
6652
6653/**
6654 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
6655 * `SyntaxError`, `TypeError`, or `URIError` object.
6656 *
6657 * @static
6658 * @memberOf _
6659 * @since 3.0.0
6660 * @category Lang
6661 * @param {*} value The value to check.
6662 * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
6663 * @example
6664 *
6665 * _.isError(new Error);
6666 * // => true
6667 *
6668 * _.isError(Error);
6669 * // => false
6670 */
6671function isError(value) {
6672 if (!isObjectLike$6(value)) {
6673 return false;
6674 }
6675 var tag = baseGetTag$6(value);
6676 return tag == errorTag$2 || tag == domExcTag ||
6677 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
6678}
6679
6680var isError_1 = isError;
6681
6682/**
6683 * Gets the last element of `array`.
6684 *
6685 * @static
6686 * @memberOf _
6687 * @since 0.1.0
6688 * @category Array
6689 * @param {Array} array The array to query.
6690 * @returns {*} Returns the last element of `array`.
6691 * @example
6692 *
6693 * _.last([1, 2, 3]);
6694 * // => 3
6695 */
6696function last(array) {
6697 var length = array == null ? 0 : array.length;
6698 return length ? array[length - 1] : undefined;
6699}
6700
6701var last_1 = last;
6702
6703var isIndex$3 = _isIndex;
6704
6705/**
6706 * The base implementation of `_.nth` which doesn't coerce arguments.
6707 *
6708 * @private
6709 * @param {Array} array The array to query.
6710 * @param {number} n The index of the element to return.
6711 * @returns {*} Returns the nth element of `array`.
6712 */
6713function baseNth$1(array, n) {
6714 var length = array.length;
6715 if (!length) {
6716 return;
6717 }
6718 n += n < 0 ? length : 0;
6719 return isIndex$3(n, length) ? array[n] : undefined;
6720}
6721
6722var _baseNth = baseNth$1;
6723
6724var isObject$4 = isObject_1;
6725var isSymbol$4 = isSymbol_1;
6726
6727/** Used as references for various `Number` constants. */
6728var NAN = 0 / 0;
6729
6730/** Used to match leading and trailing whitespace. */
6731var reTrim = /^\s+|\s+$/g;
6732
6733/** Used to detect bad signed hexadecimal string values. */
6734var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
6735
6736/** Used to detect binary string values. */
6737var reIsBinary = /^0b[01]+$/i;
6738
6739/** Used to detect octal string values. */
6740var reIsOctal = /^0o[0-7]+$/i;
6741
6742/** Built-in method references without a dependency on `root`. */
6743var freeParseInt = parseInt;
6744
6745/**
6746 * Converts `value` to a number.
6747 *
6748 * @static
6749 * @memberOf _
6750 * @since 4.0.0
6751 * @category Lang
6752 * @param {*} value The value to process.
6753 * @returns {number} Returns the number.
6754 * @example
6755 *
6756 * _.toNumber(3.2);
6757 * // => 3.2
6758 *
6759 * _.toNumber(Number.MIN_VALUE);
6760 * // => 5e-324
6761 *
6762 * _.toNumber(Infinity);
6763 * // => Infinity
6764 *
6765 * _.toNumber('3.2');
6766 * // => 3.2
6767 */
6768function toNumber$1(value) {
6769 if (typeof value == 'number') {
6770 return value;
6771 }
6772 if (isSymbol$4(value)) {
6773 return NAN;
6774 }
6775 if (isObject$4(value)) {
6776 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
6777 value = isObject$4(other) ? (other + '') : other;
6778 }
6779 if (typeof value != 'string') {
6780 return value === 0 ? value : +value;
6781 }
6782 value = value.replace(reTrim, '');
6783 var isBinary = reIsBinary.test(value);
6784 return (isBinary || reIsOctal.test(value))
6785 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
6786 : (reIsBadHex.test(value) ? NAN : +value);
6787}
6788
6789var toNumber_1 = toNumber$1;
6790
6791var toNumber = toNumber_1;
6792
6793/** Used as references for various `Number` constants. */
6794var INFINITY$3 = 1 / 0;
6795var MAX_INTEGER = 1.7976931348623157e+308;
6796
6797/**
6798 * Converts `value` to a finite number.
6799 *
6800 * @static
6801 * @memberOf _
6802 * @since 4.12.0
6803 * @category Lang
6804 * @param {*} value The value to convert.
6805 * @returns {number} Returns the converted number.
6806 * @example
6807 *
6808 * _.toFinite(3.2);
6809 * // => 3.2
6810 *
6811 * _.toFinite(Number.MIN_VALUE);
6812 * // => 5e-324
6813 *
6814 * _.toFinite(Infinity);
6815 * // => 1.7976931348623157e+308
6816 *
6817 * _.toFinite('3.2');
6818 * // => 3.2
6819 */
6820function toFinite$1(value) {
6821 if (!value) {
6822 return value === 0 ? value : 0;
6823 }
6824 value = toNumber(value);
6825 if (value === INFINITY$3 || value === -INFINITY$3) {
6826 var sign = (value < 0 ? -1 : 1);
6827 return sign * MAX_INTEGER;
6828 }
6829 return value === value ? value : 0;
6830}
6831
6832var toFinite_1 = toFinite$1;
6833
6834var toFinite = toFinite_1;
6835
6836/**
6837 * Converts `value` to an integer.
6838 *
6839 * **Note:** This method is loosely based on
6840 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
6841 *
6842 * @static
6843 * @memberOf _
6844 * @since 4.0.0
6845 * @category Lang
6846 * @param {*} value The value to convert.
6847 * @returns {number} Returns the converted integer.
6848 * @example
6849 *
6850 * _.toInteger(3.2);
6851 * // => 3
6852 *
6853 * _.toInteger(Number.MIN_VALUE);
6854 * // => 0
6855 *
6856 * _.toInteger(Infinity);
6857 * // => 1.7976931348623157e+308
6858 *
6859 * _.toInteger('3.2');
6860 * // => 3
6861 */
6862function toInteger$1(value) {
6863 var result = toFinite(value),
6864 remainder = result % 1;
6865
6866 return result === result ? (remainder ? result - remainder : result) : 0;
6867}
6868
6869var toInteger_1 = toInteger$1;
6870
6871var baseNth = _baseNth;
6872var toInteger = toInteger_1;
6873
6874/**
6875 * Gets the element at index `n` of `array`. If `n` is negative, the nth
6876 * element from the end is returned.
6877 *
6878 * @static
6879 * @memberOf _
6880 * @since 4.11.0
6881 * @category Array
6882 * @param {Array} array The array to query.
6883 * @param {number} [n=0] The index of the element to return.
6884 * @returns {*} Returns the nth element of `array`.
6885 * @example
6886 *
6887 * var array = ['a', 'b', 'c', 'd'];
6888 *
6889 * _.nth(array, 1);
6890 * // => 'b'
6891 *
6892 * _.nth(array, -2);
6893 * // => 'c';
6894 */
6895function nth(array, n) {
6896 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
6897}
6898
6899var nth_1 = nth;
6900
6901var baseEach$4 = _baseEach;
6902
6903/**
6904 * The base implementation of `_.some` without support for iteratee shorthands.
6905 *
6906 * @private
6907 * @param {Array|Object} collection The collection to iterate over.
6908 * @param {Function} predicate The function invoked per iteration.
6909 * @returns {boolean} Returns `true` if any element passes the predicate check,
6910 * else `false`.
6911 */
6912function baseSome$1(collection, predicate) {
6913 var result;
6914
6915 baseEach$4(collection, function(value, index, collection) {
6916 result = predicate(value, index, collection);
6917 return !result;
6918 });
6919 return !!result;
6920}
6921
6922var _baseSome = baseSome$1;
6923
6924var eq$3 = eq_1;
6925var isArrayLike$5 = isArrayLike_1;
6926var isIndex$4 = _isIndex;
6927var isObject$5 = isObject_1;
6928
6929/**
6930 * Checks if the given arguments are from an iteratee call.
6931 *
6932 * @private
6933 * @param {*} value The potential iteratee value argument.
6934 * @param {*} index The potential iteratee index or key argument.
6935 * @param {*} object The potential iteratee object argument.
6936 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
6937 * else `false`.
6938 */
6939function isIterateeCall$1(value, index, object) {
6940 if (!isObject$5(object)) {
6941 return false;
6942 }
6943 var type = typeof index;
6944 if (type == 'number'
6945 ? (isArrayLike$5(object) && isIndex$4(index, object.length))
6946 : (type == 'string' && index in object)
6947 ) {
6948 return eq$3(object[index], value);
6949 }
6950 return false;
6951}
6952
6953var _isIterateeCall = isIterateeCall$1;
6954
6955var arraySome$2 = _arraySome;
6956var baseIteratee$3 = _baseIteratee;
6957var baseSome = _baseSome;
6958var isArray$17 = isArray_1;
6959var isIterateeCall = _isIterateeCall;
6960
6961/**
6962 * Checks if `predicate` returns truthy for **any** element of `collection`.
6963 * Iteration is stopped once `predicate` returns truthy. The predicate is
6964 * invoked with three arguments: (value, index|key, collection).
6965 *
6966 * @static
6967 * @memberOf _
6968 * @since 0.1.0
6969 * @category Collection
6970 * @param {Array|Object} collection The collection to iterate over.
6971 * @param {Function} [predicate=_.identity] The function invoked per iteration.
6972 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
6973 * @returns {boolean} Returns `true` if any element passes the predicate check,
6974 * else `false`.
6975 * @example
6976 *
6977 * _.some([null, 0, 'yes', false], Boolean);
6978 * // => true
6979 *
6980 * var users = [
6981 * { 'user': 'barney', 'active': true },
6982 * { 'user': 'fred', 'active': false }
6983 * ];
6984 *
6985 * // The `_.matches` iteratee shorthand.
6986 * _.some(users, { 'user': 'barney', 'active': false });
6987 * // => false
6988 *
6989 * // The `_.matchesProperty` iteratee shorthand.
6990 * _.some(users, ['active', false]);
6991 * // => true
6992 *
6993 * // The `_.property` iteratee shorthand.
6994 * _.some(users, 'active');
6995 * // => true
6996 */
6997function some(collection, predicate, guard) {
6998 var func = isArray$17(collection) ? arraySome$2 : baseSome;
6999 if (guard && isIterateeCall(collection, predicate, guard)) {
7000 predicate = undefined;
7001 }
7002 return func(collection, baseIteratee$3(predicate, 3));
7003}
7004
7005var some_1 = some;
7006
7007var _createClass = 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; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
7008
7009function _toConsumableArray(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 Array.from(arr); } }
7010
7011function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7012
7013var SuperGloo = function () {
7014 function SuperGloo() {
7015 var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7016
7017 _classCallCheck(this, SuperGloo);
7018
7019 var requiredProperties = ['falcorModel'];
7020
7021 if (some_1(requiredProperties, function (_) {
7022 return isNil_1(get_1(config, _));
7023 })) {
7024 throw new Error('One of the following required config parameters is undefined: ' + requiredProperties.join(', '));
7025 }
7026
7027 this.falcor = config.falcorModel;
7028 }
7029
7030 /*
7031 * Standard interfaces
7032 */
7033
7034 _createClass(SuperGloo, [{
7035 key: 'setModel',
7036 value: function setModel(model) {
7037 if (isNil_1(model)) {
7038 throw new Error('When setting the model, the model cannot be null or undefined');
7039 }
7040
7041 this.falcor = model;
7042 }
7043 }, {
7044 key: 'getOne',
7045 value: function getOne$$1(entityName) {
7046 var _falcor;
7047
7048 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7049
7050 var entity = entities[entityName];
7051
7052 if (isNil_1(entity)) {
7053 return Promise.reject(entityIsUndefinedError(entityName));
7054 }
7055
7056 var paths = isFunction_1(entity.getOne) ? entity.getOne(options) : getOne$1(entityName, entity, options);
7057
7058 if (isError_1(paths)) {
7059 return Promise.reject(paths);
7060 }
7061
7062 return (_falcor = this.falcor).get.apply(_falcor, _toConsumableArray(paths)).then(function (jsonGraph) {
7063 var extractedEntity = void 0;
7064 if (isNil_1(get_1(jsonGraph, 'json'))) {
7065 extractedEntity = null;
7066 } else {
7067 extractedEntity = isFunction_1(entity.extractOne) ? entity.extractOne(options, jsonGraph) : extractOne$1(entity, options, jsonGraph);
7068 }
7069
7070 return extractedEntity;
7071 }).catch(function (response) {
7072 var message = buildGetOneErrorMessage(response);
7073 return Promise.reject(new Error(message));
7074 });
7075 }
7076 }, {
7077 key: 'getMany',
7078 value: function getMany$$1(entityName) {
7079 var _falcor2;
7080
7081 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7082
7083 var entity = entities[entityName];
7084
7085 if (isNil_1(entity)) {
7086 return Promise.reject(entityIsUndefinedError(entityName));
7087 }
7088
7089 var paths = isFunction_1(entity.getMany) ? entity.getMany(options) : getMany$3(entityName, entity, options);
7090
7091 if (isError_1(paths)) {
7092 return Promise.reject(paths);
7093 }
7094
7095 return (_falcor2 = this.falcor).get.apply(_falcor2, _toConsumableArray(paths)).then(function (jsonGraph) {
7096 var extractedEntities = void 0;
7097 if (isNil_1(get_1(jsonGraph, 'json'))) {
7098 extractedEntities = null;
7099 } else {
7100 extractedEntities = isFunction_1(entity.extractMany) ? entity.extractMany(options, jsonGraph) : extractMany$3(entity, options, jsonGraph);
7101 }
7102
7103 return extractedEntities;
7104 }).catch(function (response) {
7105 var message = buildGetManyErrorMessage(response);
7106 return Promise.reject(new Error(message));
7107 });
7108 }
7109 }, {
7110 key: 'getMy',
7111 value: function getMy$$1(entityName) {
7112 var _falcor3;
7113
7114 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7115
7116 var entity = entities[entityName];
7117
7118 if (isNil_1(entity)) {
7119 return Promise.reject(entityIsUndefinedError(entityName));
7120 }
7121
7122 var paths = isFunction_1(entity.getMy) ? entity.getMy(options) : getMy(entityName, entity, options);
7123
7124 if (isError_1(paths)) {
7125 return Promise.reject(paths);
7126 }
7127
7128 return (_falcor3 = this.falcor).get.apply(_falcor3, _toConsumableArray(paths)).then(function (jsonGraph) {
7129 var extractedEntities = void 0;
7130 if (isNil_1(get_1(jsonGraph, 'json'))) {
7131 extractedEntities = null;
7132 } else {
7133 extractedEntities = isFunction_1(entity.extractMy) ? entity.extractMy(options, jsonGraph) : extractMy(entity, options, jsonGraph);
7134 }
7135
7136 return extractedEntities;
7137 }).catch(function (response) {
7138 var message = buildGetMyErrorMessage(response);
7139 return Promise.reject(new Error(message));
7140 });
7141 }
7142 }, {
7143 key: 'getMembership',
7144 value: function getMembership$$1(entityName) {
7145 var _falcor4;
7146
7147 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7148
7149 var entity = entities[entityName];
7150
7151 if (isNil_1(entity)) {
7152 return Promise.reject(entityIsUndefinedError(entityName));
7153 }
7154
7155 var paths = isFunction_1(entity.getMembership) ? entity.getMembership(options) : getMembership(entityName, entity, options);
7156
7157 if (isError_1(paths)) {
7158 return Promise.reject(paths);
7159 }
7160
7161 return (_falcor4 = this.falcor).get.apply(_falcor4, _toConsumableArray(paths)).then(function (jsonGraph) {
7162 var extractedEntities = void 0;
7163 if (isNil_1(get_1(jsonGraph, 'json'))) {
7164 extractedEntities = null;
7165 } else {
7166 extractedEntities = isFunction_1(entity.extractMemberships) ? entity.extractMemberships(options, jsonGraph) : extractMemberships(entity, options, jsonGraph);
7167 }
7168
7169 return extractedEntities;
7170 }).catch(function (response) {
7171 var message = buildGetMembershipsErrorMessage(response);
7172 return Promise.reject(new Error(message));
7173 });
7174 }
7175 }, {
7176 key: 'create',
7177 value: function create$$1(entityName) {
7178 var _this = this;
7179
7180 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7181
7182 var entity = entities[entityName];
7183
7184 if (isNil_1(entity)) {
7185 return Promise.reject(entityIsUndefinedError(entityName));
7186 }
7187
7188 var callOptions = isFunction_1(entity.create) ? entity.create(options) : create(entityName, entity, options);
7189
7190 if (isError_1(callOptions)) {
7191 return Promise.reject(callOptions);
7192 }
7193
7194 var path = callOptions.path,
7195 args = callOptions.args;
7196
7197
7198 return this.falcor.call(path, args).then(function (jsonGraph) {
7199 var extractedEntity = void 0;
7200 if (isNil_1(get_1(jsonGraph, 'json'))) {
7201 extractedEntity = null;
7202 } else {
7203 extractedEntity = isFunction_1(entity.extractCreated) ? entity.extractCreated(options, jsonGraph) : extractCreated(entity, options, jsonGraph);
7204 }
7205
7206 var pathsToInvalidate = isFunction_1(entity.invalidateAfterCreate) ? entity.invalidateAfterCreate(options) : invalidateAfterCreate$1(entity, options);
7207
7208 if (!isEmpty_1(pathsToInvalidate)) {
7209 forEach_1(pathsToInvalidate, function (path) {
7210 _this.falcor.invalidate(path);
7211 });
7212 }
7213
7214 return extractedEntity;
7215 }).catch(function (response) {
7216 var message = buildCreateErrorMessage(response);
7217 return Promise.reject(new Error(message));
7218 });
7219 }
7220 }, {
7221 key: 'update',
7222 value: function update$$1(entityName) {
7223 var _falcor5;
7224
7225 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7226
7227 var entity = entities[entityName];
7228
7229 if (isNil_1(entity)) {
7230 return Promise.reject(entityIsUndefinedError(entityName));
7231 }
7232
7233 var paths = isFunction_1(entity.update) ? entity.update(options) : update(entityName, entity, options);
7234
7235 if (isError_1(paths)) {
7236 return Promise.reject(paths);
7237 }
7238
7239 return (_falcor5 = this.falcor).set.apply(_falcor5, _toConsumableArray(paths)).then(function (jsonGraph) {
7240 var updatedProperties = void 0;
7241 if (isNil_1(get_1(jsonGraph, 'json'))) {
7242 updatedProperties = null;
7243 } else {
7244 updatedProperties = isFunction_1(entity.extractUpdated) ? entity.extractUpdated(options, jsonGraph) : extractUpdated(entity, options, jsonGraph);
7245 }
7246
7247 return updatedProperties;
7248 }).catch(function (response) {
7249 var message = buildUpdateErrorMessage(response);
7250 return Promise.reject(new Error(message));
7251 });
7252 }
7253 }, {
7254 key: 'destroy',
7255 value: function destroy$$1(entityName) {
7256 var _this2 = this;
7257
7258 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7259
7260 var entity = entities[entityName];
7261
7262 if (isNil_1(entity)) {
7263 return Promise.reject(entityIsUndefinedError(entityName));
7264 }
7265
7266 var destroyPath = isFunction_1(entity.destroy) ? entity.destroy(options) : destroy(entityName, entity, options);
7267
7268 if (isError_1(destroyPath)) {
7269 return Promise.reject(destroyPath);
7270 }
7271
7272 return this.falcor.call(destroyPath).then(function () {
7273 var pathsToInvalidate = isFunction_1(entity.invalidateAfterDestroy) ? entity.invalidateAfterDestroy(options) : invalidateAfterDestroy$1(entity, options);
7274
7275 if (!isEmpty_1(pathsToInvalidate)) {
7276 forEach_1(pathsToInvalidate, function (path) {
7277 _this2.falcor.invalidate(path);
7278 });
7279 }
7280
7281 return 'Entity destroyed';
7282 }).catch(function (response) {
7283 var message = buildDestroyErrorMessage(response);
7284 return Promise.reject(new Error(message));
7285 });
7286 }
7287 }]);
7288
7289 return SuperGloo;
7290}();
7291
7292var codeToMessageMap = {
7293 400: 'request is malformed',
7294 401: 'user is not authorized',
7295 403: 'user is forbidden',
7296 404: 'entity does not exist',
7297 422: 'entity is not valid',
7298 default: 'unspecified error encountered'
7299};
7300
7301function buildGetOneErrorMessage(response) {
7302 if (response instanceof Error) {
7303 return response.message;
7304 }
7305
7306 var firstPath = response[0];
7307 var entity = camelCase_1(firstPath.path[0]);
7308 var entityId = firstPath.path[1];
7309 var originalMessage = firstPath.value.message || firstPath.value;
7310
7311 var match = originalMessage.match(/\b[4,5][0-9][0-9]\b/);
7312 var code = !isNil_1(match) && !isNil_1(codeToMessageMap[match[0]]) ? match[0] : 'default';
7313
7314 var improvedMessage = codeToMessageMap[code];
7315
7316 return 'Could not get ' + entity + ' ' + entityId + ': ' + improvedMessage + ' (' + originalMessage + ')';
7317}
7318
7319function buildGetManyErrorMessage(response) {
7320 if (response instanceof Error) {
7321 return response.message;
7322 }
7323
7324 var firstPath = response[0];
7325 var entity = camelCase_1(firstPath.path[0]);
7326 var originalMessage = firstPath.value.message || firstPath.value;
7327
7328 var match = originalMessage.match(/\b[4,5][0-9][0-9]\b/);
7329 var code = !isNil_1(match) && !isNil_1(codeToMessageMap[match[0]]) ? match[0] : 'default';
7330
7331 var improvedMessage = codeToMessageMap[code];
7332
7333 return 'Could not get many ' + entity + ': ' + improvedMessage + ' (' + originalMessage + ')';
7334}
7335
7336function buildGetMyErrorMessage(response) {
7337 if (response instanceof Error) {
7338 return response.message;
7339 }
7340
7341 var firstPath = response[0];
7342 var entity = camelCase_1(firstPath.path[0]);
7343 var originalMessage = firstPath.value.message || firstPath.value;
7344
7345 var match = originalMessage.match(/\b[4,5][0-9][0-9]\b/);
7346 var code = !isNil_1(match) && !isNil_1(codeToMessageMap[match[0]]) ? match[0] : 'default';
7347
7348 var improvedMessage = codeToMessageMap[code];
7349
7350 return 'Could not get my ' + entity + ': ' + improvedMessage + ' (' + originalMessage + ')';
7351}
7352
7353function buildGetMembershipsErrorMessage(response) {
7354 if (response instanceof Error) {
7355 return response.message;
7356 }
7357
7358 var firstPath = response[0];
7359 var entity = camelCase_1(firstPath.path[0]);
7360 var originalMessage = firstPath.value.message || firstPath.value;
7361
7362 var match = originalMessage.match(/\b[4,5][0-9][0-9]\b/);
7363 var code = !isNil_1(match) && !isNil_1(codeToMessageMap[match[0]]) ? match[0] : 'default';
7364
7365 var improvedMessage = codeToMessageMap[code];
7366
7367 return 'Could not get ' + entity + ' memberships: ' + improvedMessage + ' (' + originalMessage + ')';
7368}
7369
7370function buildCreateErrorMessage(response) {
7371 if (response instanceof Error) {
7372 return response.message;
7373 }
7374
7375 var firstError = head_1(response);
7376
7377 var entityName = void 0;
7378 if (last_1(firstError.path) === 'add') {
7379 var listLeaf = nth_1(firstError.path, -2);
7380 entityName = falcorListLeafToEntityName(listLeaf);
7381 } else {
7382 var rootLeaf = head_1(firstError.path);
7383 entityName = falcorRootLeafToEntityName(rootLeaf);
7384 }
7385
7386 var originalMessage = firstError.value.message || firstError.value;
7387
7388 var match = originalMessage.match(/\b[4,5][0-9][0-9]\b/);
7389 var code = !isNil_1(match) && !isNil_1(codeToMessageMap[match[0]]) ? match[0] : 'default';
7390
7391 var improvedMessage = codeToMessageMap[code];
7392
7393 return 'Could not create a new ' + entityName + ': ' + improvedMessage + ' (' + originalMessage + ')';
7394}
7395
7396function buildUpdateErrorMessage(response) {
7397 if (response instanceof Error) {
7398 return response.message;
7399 }
7400
7401 var firstPath = response[0];
7402 var entity = camelCase_1(firstPath.path[0]);
7403 var entityId = firstPath.path[1];
7404 var originalMessage = firstPath.value.message || firstPath.value;
7405
7406 var match = originalMessage.match(/\b[4,5][0-9][0-9]\b/);
7407 var code = !isNil_1(match) && !isNil_1(codeToMessageMap[match[0]]) ? match[0] : 'default';
7408
7409 var improvedMessage = codeToMessageMap[code];
7410
7411 return 'Could not update ' + entity + ' ' + entityId + ': ' + improvedMessage + ' (' + originalMessage + ')';
7412}
7413
7414function buildDestroyErrorMessage(response) {
7415 if (response instanceof Error) {
7416 return response.message;
7417 }
7418
7419 var firstPath = response[0];
7420 var entity = camelCase_1(firstPath.path[0]);
7421 var entityId = firstPath.path[1];
7422 var originalMessage = firstPath.value.message || firstPath.value;
7423
7424 var match = originalMessage.match(/\b[4,5][0-9][0-9]\b/);
7425 var code = !isNil_1(match) && !isNil_1(codeToMessageMap[match[0]]) ? match[0] : 'default';
7426
7427 var improvedMessage = codeToMessageMap[code];
7428
7429 return 'Could not destroy ' + entity + ' ' + entityId + ': ' + improvedMessage + ' (' + originalMessage + ')';
7430}
7431
7432return SuperGloo;
7433
7434})));