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 |
|
7 | var name = 'audioCategory';
|
8 | var pluralName = 'audioCategories';
|
9 |
|
10 | var defaultProperties = ['id', 'name'];
|
11 |
|
12 | var audioCategory = Object.freeze({
|
13 | name: name,
|
14 | pluralName: pluralName,
|
15 | defaultProperties: defaultProperties
|
16 | });
|
17 |
|
18 | var name$1 = 'audioTrack';
|
19 | var pluralName$1 = 'audioTracks';
|
20 |
|
21 | var defaultProperties$1 = ['id', 'name', 'author', 'duration', 'src'];
|
22 |
|
23 | var audioTrack = Object.freeze({
|
24 | name: name$1,
|
25 | pluralName: pluralName$1,
|
26 | defaultProperties: defaultProperties$1
|
27 | });
|
28 |
|
29 | var name$2 = 'champion';
|
30 | var pluralName$2 = 'champions';
|
31 |
|
32 | var defaultProperties$2 = ['id'];
|
33 |
|
34 | var champion = Object.freeze({
|
35 | name: name$2,
|
36 | pluralName: pluralName$2,
|
37 | defaultProperties: defaultProperties$2
|
38 | });
|
39 |
|
40 | var name$3 = 'cohort';
|
41 | var pluralName$3 = 'cohorts';
|
42 |
|
43 | var defaultProperties$3 = ['id', 'name', 'description'];
|
44 |
|
45 | var cohort = Object.freeze({
|
46 | name: name$3,
|
47 | pluralName: pluralName$3,
|
48 | defaultProperties: defaultProperties$3
|
49 | });
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | function head(array) {
|
70 | return (array && array.length) ? array[0] : undefined;
|
71 | }
|
72 |
|
73 | var head_1 = head;
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | function 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 |
|
94 | var _baseTimes = baseTimes$1;
|
95 |
|
96 | var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | function createCommonjsModule(fn, module) {
|
103 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
104 | }
|
105 |
|
106 |
|
107 | var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
108 |
|
109 | var _freeGlobal = freeGlobal$1;
|
110 |
|
111 | var freeGlobal = _freeGlobal;
|
112 |
|
113 |
|
114 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
115 |
|
116 |
|
117 | var root$1 = freeGlobal || freeSelf || Function('return this')();
|
118 |
|
119 | var _root = root$1;
|
120 |
|
121 | var root = _root;
|
122 |
|
123 |
|
124 | var Symbol$1 = root.Symbol;
|
125 |
|
126 | var _Symbol = Symbol$1;
|
127 |
|
128 | var Symbol$2 = _Symbol;
|
129 |
|
130 |
|
131 | var objectProto$2 = Object.prototype;
|
132 |
|
133 |
|
134 | var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | var nativeObjectToString = objectProto$2.toString;
|
142 |
|
143 |
|
144 | var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 | function 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 |
|
173 | var _getRawTag = getRawTag$1;
|
174 |
|
175 |
|
176 | var objectProto$3 = Object.prototype;
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 | var nativeObjectToString$1 = objectProto$3.toString;
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 | function objectToString$1(value) {
|
193 | return nativeObjectToString$1.call(value);
|
194 | }
|
195 |
|
196 | var _objectToString = objectToString$1;
|
197 |
|
198 | var Symbol = _Symbol;
|
199 | var getRawTag = _getRawTag;
|
200 | var objectToString = _objectToString;
|
201 |
|
202 |
|
203 | var nullTag = '[object Null]';
|
204 | var undefinedTag = '[object Undefined]';
|
205 |
|
206 |
|
207 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | function 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 |
|
225 | var _baseGetTag = baseGetTag$1;
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 | function isObjectLike$2(value) {
|
252 | return value != null && typeof value == 'object';
|
253 | }
|
254 |
|
255 | var isObjectLike_1 = isObjectLike$2;
|
256 |
|
257 | var baseGetTag = _baseGetTag;
|
258 | var isObjectLike$1 = isObjectLike_1;
|
259 |
|
260 |
|
261 | var argsTag = '[object Arguments]';
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 | function baseIsArguments$1(value) {
|
271 | return isObjectLike$1(value) && baseGetTag(value) == argsTag;
|
272 | }
|
273 |
|
274 | var _baseIsArguments = baseIsArguments$1;
|
275 |
|
276 | var baseIsArguments = _baseIsArguments;
|
277 | var isObjectLike = isObjectLike_1;
|
278 |
|
279 |
|
280 | var objectProto$1 = Object.prototype;
|
281 |
|
282 |
|
283 | var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
284 |
|
285 |
|
286 | var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 | var 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 |
|
311 | var isArguments_1 = isArguments$1;
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 | var isArray$1 = Array.isArray;
|
337 |
|
338 | var isArray_1 = isArray$1;
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 | function stubFalse() {
|
354 | return false;
|
355 | }
|
356 |
|
357 | var stubFalse_1 = stubFalse;
|
358 |
|
359 | var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
360 | var root = _root,
|
361 | stubFalse = stubFalse_1;
|
362 |
|
363 |
|
364 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
365 |
|
366 |
|
367 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
368 |
|
369 |
|
370 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
371 |
|
372 |
|
373 | var Buffer = moduleExports ? root.Buffer : undefined;
|
374 |
|
375 |
|
376 | var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | var isBuffer = nativeIsBuffer || stubFalse;
|
396 |
|
397 | module.exports = isBuffer;
|
398 | });
|
399 |
|
400 |
|
401 | var MAX_SAFE_INTEGER = 9007199254740991;
|
402 |
|
403 |
|
404 | var reIsUint = /^(?:0|[1-9]\d*)$/;
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 | function 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 |
|
421 | var _isIndex = isIndex$1;
|
422 |
|
423 |
|
424 | var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 | function isLength$1(value) {
|
453 | return typeof value == 'number' &&
|
454 | value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
455 | }
|
456 |
|
457 | var isLength_1 = isLength$1;
|
458 |
|
459 | var baseGetTag$2 = _baseGetTag;
|
460 | var isLength = isLength_1;
|
461 | var isObjectLike$3 = isObjectLike_1;
|
462 |
|
463 |
|
464 | var argsTag$1 = '[object Arguments]';
|
465 | var arrayTag = '[object Array]';
|
466 | var boolTag = '[object Boolean]';
|
467 | var dateTag = '[object Date]';
|
468 | var errorTag = '[object Error]';
|
469 | var funcTag = '[object Function]';
|
470 | var mapTag = '[object Map]';
|
471 | var numberTag = '[object Number]';
|
472 | var objectTag = '[object Object]';
|
473 | var regexpTag = '[object RegExp]';
|
474 | var setTag = '[object Set]';
|
475 | var stringTag = '[object String]';
|
476 | var weakMapTag = '[object WeakMap]';
|
477 |
|
478 | var arrayBufferTag = '[object ArrayBuffer]';
|
479 | var dataViewTag = '[object DataView]';
|
480 | var float32Tag = '[object Float32Array]';
|
481 | var float64Tag = '[object Float64Array]';
|
482 | var int8Tag = '[object Int8Array]';
|
483 | var int16Tag = '[object Int16Array]';
|
484 | var int32Tag = '[object Int32Array]';
|
485 | var uint8Tag = '[object Uint8Array]';
|
486 | var uint8ClampedTag = '[object Uint8ClampedArray]';
|
487 | var uint16Tag = '[object Uint16Array]';
|
488 | var uint32Tag = '[object Uint32Array]';
|
489 |
|
490 |
|
491 | var typedArrayTags = {};
|
492 | typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
493 | typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
494 | typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
495 | typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
496 | typedArrayTags[uint32Tag] = true;
|
497 | typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
|
498 | typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
499 | typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
500 | typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
501 | typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
502 | typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
503 | typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
504 | typedArrayTags[weakMapTag] = false;
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 | function baseIsTypedArray$1(value) {
|
514 | return isObjectLike$3(value) &&
|
515 | isLength(value.length) && !!typedArrayTags[baseGetTag$2(value)];
|
516 | }
|
517 |
|
518 | var _baseIsTypedArray = baseIsTypedArray$1;
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 | function baseUnary$1(func) {
|
528 | return function(value) {
|
529 | return func(value);
|
530 | };
|
531 | }
|
532 |
|
533 | var _baseUnary = baseUnary$1;
|
534 |
|
535 | var _nodeUtil = createCommonjsModule(function (module, exports) {
|
536 | var freeGlobal = _freeGlobal;
|
537 |
|
538 |
|
539 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
540 |
|
541 |
|
542 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
543 |
|
544 |
|
545 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
546 |
|
547 |
|
548 | var freeProcess = moduleExports && freeGlobal.process;
|
549 |
|
550 |
|
551 | var nodeUtil = (function() {
|
552 | try {
|
553 | return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
554 | } catch (e) {}
|
555 | }());
|
556 |
|
557 | module.exports = nodeUtil;
|
558 | });
|
559 |
|
560 | var baseIsTypedArray = _baseIsTypedArray;
|
561 | var baseUnary = _baseUnary;
|
562 | var nodeUtil = _nodeUtil;
|
563 |
|
564 |
|
565 | var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 | var isTypedArray$1 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
585 |
|
586 | var isTypedArray_1 = isTypedArray$1;
|
587 |
|
588 | var baseTimes = _baseTimes;
|
589 | var isArguments = isArguments_1;
|
590 | var isArray = isArray_1;
|
591 | var isBuffer = isBuffer_1;
|
592 | var isIndex = _isIndex;
|
593 | var isTypedArray = isTypedArray_1;
|
594 |
|
595 |
|
596 | var objectProto = Object.prototype;
|
597 |
|
598 |
|
599 | var hasOwnProperty = objectProto.hasOwnProperty;
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 | function 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 |
|
622 | key == 'length' ||
|
623 |
|
624 | (isBuff && (key == 'offset' || key == 'parent')) ||
|
625 |
|
626 | (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
627 |
|
628 | isIndex(key, length)
|
629 | ))) {
|
630 | result.push(key);
|
631 | }
|
632 | }
|
633 | return result;
|
634 | }
|
635 |
|
636 | var _arrayLikeKeys = arrayLikeKeys$1;
|
637 |
|
638 |
|
639 | var objectProto$5 = Object.prototype;
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 | function 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 |
|
655 | var _isPrototype = isPrototype$1;
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 | function overArg$1(func, transform) {
|
666 | return function(arg) {
|
667 | return func(transform(arg));
|
668 | };
|
669 | }
|
670 |
|
671 | var _overArg = overArg$1;
|
672 |
|
673 | var overArg = _overArg;
|
674 |
|
675 |
|
676 | var nativeKeys$1 = overArg(Object.keys, Object);
|
677 |
|
678 | var _nativeKeys = nativeKeys$1;
|
679 |
|
680 | var isPrototype = _isPrototype;
|
681 | var nativeKeys = _nativeKeys;
|
682 |
|
683 |
|
684 | var objectProto$4 = Object.prototype;
|
685 |
|
686 |
|
687 | var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 | function 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 |
|
709 | var _baseKeys = baseKeys$1;
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 | function isObject$1(value) {
|
737 | var type = typeof value;
|
738 | return value != null && (type == 'object' || type == 'function');
|
739 | }
|
740 |
|
741 | var isObject_1 = isObject$1;
|
742 |
|
743 | var baseGetTag$3 = _baseGetTag;
|
744 | var isObject = isObject_1;
|
745 |
|
746 |
|
747 | var asyncTag = '[object AsyncFunction]';
|
748 | var funcTag$1 = '[object Function]';
|
749 | var genTag = '[object GeneratorFunction]';
|
750 | var proxyTag = '[object Proxy]';
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 | function isFunction$1(value) {
|
770 | if (!isObject(value)) {
|
771 | return false;
|
772 | }
|
773 |
|
774 |
|
775 | var tag = baseGetTag$3(value);
|
776 | return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
777 | }
|
778 |
|
779 | var isFunction_1 = isFunction$1;
|
780 |
|
781 | var isFunction = isFunction_1;
|
782 | var isLength$2 = isLength_1;
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 | function isArrayLike$1(value) {
|
810 | return value != null && isLength$2(value.length) && !isFunction(value);
|
811 | }
|
812 |
|
813 | var isArrayLike_1 = isArrayLike$1;
|
814 |
|
815 | var arrayLikeKeys = _arrayLikeKeys;
|
816 | var baseKeys = _baseKeys;
|
817 | var isArrayLike = isArrayLike_1;
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 |
|
833 |
|
834 |
|
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 |
|
841 |
|
842 |
|
843 |
|
844 |
|
845 |
|
846 |
|
847 | function keys(object) {
|
848 | return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
849 | }
|
850 |
|
851 | var keys_1 = keys;
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 | function 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 |
|
873 | var _arrayMap = arrayMap$1;
|
874 |
|
875 | var baseGetTag$4 = _baseGetTag;
|
876 | var isObjectLike$4 = isObjectLike_1;
|
877 |
|
878 |
|
879 | var symbolTag = '[object Symbol]';
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 | function isSymbol$1(value) {
|
899 | return typeof value == 'symbol' ||
|
900 | (isObjectLike$4(value) && baseGetTag$4(value) == symbolTag);
|
901 | }
|
902 |
|
903 | var isSymbol_1 = isSymbol$1;
|
904 |
|
905 | var Symbol$3 = _Symbol;
|
906 | var arrayMap = _arrayMap;
|
907 | var isArray$3 = isArray_1;
|
908 | var isSymbol = isSymbol_1;
|
909 |
|
910 |
|
911 | var INFINITY = 1 / 0;
|
912 |
|
913 |
|
914 | var symbolProto = Symbol$3 ? Symbol$3.prototype : undefined;
|
915 | var symbolToString = symbolProto ? symbolProto.toString : undefined;
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 | function baseToString$1(value) {
|
926 |
|
927 | if (typeof value == 'string') {
|
928 | return value;
|
929 | }
|
930 | if (isArray$3(value)) {
|
931 |
|
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 |
|
941 | var _baseToString = baseToString$1;
|
942 |
|
943 | var baseToString = _baseToString;
|
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 |
|
966 | function toString$1(value) {
|
967 | return value == null ? '' : baseToString(value);
|
968 | }
|
969 |
|
970 | var toString_1 = toString$1;
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 | function 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 |
|
1002 | var _baseSlice = baseSlice$1;
|
1003 |
|
1004 | var baseSlice = _baseSlice;
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 | function 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 |
|
1021 | var _castSlice = castSlice$1;
|
1022 |
|
1023 |
|
1024 | var rsAstralRange = '\\ud800-\\udfff';
|
1025 | var rsComboMarksRange = '\\u0300-\\u036f';
|
1026 | var reComboHalfMarksRange = '\\ufe20-\\ufe2f';
|
1027 | var rsComboSymbolsRange = '\\u20d0-\\u20ff';
|
1028 | var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
1029 | var rsVarRange = '\\ufe0e\\ufe0f';
|
1030 |
|
1031 |
|
1032 | var rsZWJ = '\\u200d';
|
1033 |
|
1034 |
|
1035 | var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 |
|
1044 | function hasUnicode$1(string) {
|
1045 | return reHasUnicode.test(string);
|
1046 | }
|
1047 |
|
1048 | var _hasUnicode = hasUnicode$1;
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 | function asciiToArray$1(string) {
|
1058 | return string.split('');
|
1059 | }
|
1060 |
|
1061 | var _asciiToArray = asciiToArray$1;
|
1062 |
|
1063 |
|
1064 | var rsAstralRange$1 = '\\ud800-\\udfff';
|
1065 | var rsComboMarksRange$1 = '\\u0300-\\u036f';
|
1066 | var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f';
|
1067 | var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff';
|
1068 | var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
1069 | var rsVarRange$1 = '\\ufe0e\\ufe0f';
|
1070 |
|
1071 |
|
1072 | var rsAstral = '[' + rsAstralRange$1 + ']';
|
1073 | var rsCombo = '[' + rsComboRange$1 + ']';
|
1074 | var rsFitz = '\\ud83c[\\udffb-\\udfff]';
|
1075 | var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';
|
1076 | var rsNonAstral = '[^' + rsAstralRange$1 + ']';
|
1077 | var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}';
|
1078 | var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]';
|
1079 | var rsZWJ$1 = '\\u200d';
|
1080 |
|
1081 |
|
1082 | var reOptMod = rsModifier + '?';
|
1083 | var rsOptVar = '[' + rsVarRange$1 + ']?';
|
1084 | var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';
|
1085 | var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
1086 | var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
1087 |
|
1088 |
|
1089 | var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 | function unicodeToArray$1(string) {
|
1099 | return string.match(reUnicode) || [];
|
1100 | }
|
1101 |
|
1102 | var _unicodeToArray = unicodeToArray$1;
|
1103 |
|
1104 | var asciiToArray = _asciiToArray;
|
1105 | var hasUnicode$2 = _hasUnicode;
|
1106 | var unicodeToArray = _unicodeToArray;
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 | function stringToArray$1(string) {
|
1116 | return hasUnicode$2(string)
|
1117 | ? unicodeToArray(string)
|
1118 | : asciiToArray(string);
|
1119 | }
|
1120 |
|
1121 | var _stringToArray = stringToArray$1;
|
1122 |
|
1123 | var castSlice = _castSlice;
|
1124 | var hasUnicode = _hasUnicode;
|
1125 | var stringToArray = _stringToArray;
|
1126 | var toString$2 = toString_1;
|
1127 |
|
1128 |
|
1129 |
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
1135 | function 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 |
|
1155 | var _createCaseFirst = createCaseFirst$1;
|
1156 |
|
1157 | var createCaseFirst = _createCaseFirst;
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 | var upperFirst$1 = createCaseFirst('toUpperCase');
|
1177 |
|
1178 | var upperFirst_1 = upperFirst$1;
|
1179 |
|
1180 | var toString = toString_1;
|
1181 | var upperFirst = upperFirst_1;
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 | function capitalize$1(string) {
|
1199 | return upperFirst(toString(string).toLowerCase());
|
1200 | }
|
1201 |
|
1202 | var capitalize_1 = capitalize$1;
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 | function 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 |
|
1229 | var _arrayReduce = arrayReduce$1;
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 | function basePropertyOf$1(object) {
|
1239 | return function(key) {
|
1240 | return object == null ? undefined : object[key];
|
1241 | };
|
1242 | }
|
1243 |
|
1244 | var _basePropertyOf = basePropertyOf$1;
|
1245 |
|
1246 | var basePropertyOf = _basePropertyOf;
|
1247 |
|
1248 |
|
1249 | var deburredLetters = {
|
1250 |
|
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 |
|
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 |
|
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 | var deburrLetter$1 = basePropertyOf(deburredLetters);
|
1315 |
|
1316 | var _deburrLetter = deburrLetter$1;
|
1317 |
|
1318 | var deburrLetter = _deburrLetter;
|
1319 | var toString$3 = toString_1;
|
1320 |
|
1321 |
|
1322 | var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
1323 |
|
1324 |
|
1325 | var rsComboMarksRange$2 = '\\u0300-\\u036f';
|
1326 | var reComboHalfMarksRange$2 = '\\ufe20-\\ufe2f';
|
1327 | var rsComboSymbolsRange$2 = '\\u20d0-\\u20ff';
|
1328 | var rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2;
|
1329 |
|
1330 |
|
1331 | var rsCombo$1 = '[' + rsComboRange$2 + ']';
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 | var reComboMark = RegExp(rsCombo$1, 'g');
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 |
|
1350 |
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 | function deburr$1(string) {
|
1358 | string = toString$3(string);
|
1359 | return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
|
1360 | }
|
1361 |
|
1362 | var deburr_1 = deburr$1;
|
1363 |
|
1364 |
|
1365 | var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 |
|
1373 |
|
1374 | function asciiWords$1(string) {
|
1375 | return string.match(reAsciiWord) || [];
|
1376 | }
|
1377 |
|
1378 | var _asciiWords = asciiWords$1;
|
1379 |
|
1380 |
|
1381 | var 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 |
|
1385 |
|
1386 |
|
1387 |
|
1388 |
|
1389 |
|
1390 | function hasUnicodeWord$1(string) {
|
1391 | return reHasUnicodeWord.test(string);
|
1392 | }
|
1393 |
|
1394 | var _hasUnicodeWord = hasUnicodeWord$1;
|
1395 |
|
1396 |
|
1397 | var rsAstralRange$2 = '\\ud800-\\udfff';
|
1398 | var rsComboMarksRange$3 = '\\u0300-\\u036f';
|
1399 | var reComboHalfMarksRange$3 = '\\ufe20-\\ufe2f';
|
1400 | var rsComboSymbolsRange$3 = '\\u20d0-\\u20ff';
|
1401 | var rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3;
|
1402 | var rsDingbatRange = '\\u2700-\\u27bf';
|
1403 | var rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff';
|
1404 | var rsMathOpRange = '\\xac\\xb1\\xd7\\xf7';
|
1405 | var rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf';
|
1406 | var rsPunctuationRange = '\\u2000-\\u206f';
|
1407 | var 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';
|
1408 | var rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde';
|
1409 | var rsVarRange$2 = '\\ufe0e\\ufe0f';
|
1410 | var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
1411 |
|
1412 |
|
1413 | var rsApos$1 = "['\u2019]";
|
1414 | var rsBreak = '[' + rsBreakRange + ']';
|
1415 | var rsCombo$2 = '[' + rsComboRange$3 + ']';
|
1416 | var rsDigits = '\\d+';
|
1417 | var rsDingbat = '[' + rsDingbatRange + ']';
|
1418 | var rsLower = '[' + rsLowerRange + ']';
|
1419 | var rsMisc = '[^' + rsAstralRange$2 + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']';
|
1420 | var rsFitz$1 = '\\ud83c[\\udffb-\\udfff]';
|
1421 | var rsModifier$1 = '(?:' + rsCombo$2 + '|' + rsFitz$1 + ')';
|
1422 | var rsNonAstral$1 = '[^' + rsAstralRange$2 + ']';
|
1423 | var rsRegional$1 = '(?:\\ud83c[\\udde6-\\uddff]){2}';
|
1424 | var rsSurrPair$1 = '[\\ud800-\\udbff][\\udc00-\\udfff]';
|
1425 | var rsUpper = '[' + rsUpperRange + ']';
|
1426 | var rsZWJ$2 = '\\u200d';
|
1427 |
|
1428 |
|
1429 | var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')';
|
1430 | var rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')';
|
1431 | var rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?';
|
1432 | var rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?';
|
1433 | var reOptMod$1 = rsModifier$1 + '?';
|
1434 | var rsOptVar$1 = '[' + rsVarRange$2 + ']?';
|
1435 | var rsOptJoin$1 = '(?:' + rsZWJ$2 + '(?:' + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join('|') + ')' + rsOptVar$1 + reOptMod$1 + ')*';
|
1436 | var rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)';
|
1437 | var rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)';
|
1438 | var rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1;
|
1439 | var rsEmoji = '(?:' + [rsDingbat, rsRegional$1, rsSurrPair$1].join('|') + ')' + rsSeq$1;
|
1440 |
|
1441 |
|
1442 | var 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 |
|
1455 |
|
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 | function unicodeWords$1(string) {
|
1461 | return string.match(reUnicodeWord) || [];
|
1462 | }
|
1463 |
|
1464 | var _unicodeWords = unicodeWords$1;
|
1465 |
|
1466 | var asciiWords = _asciiWords;
|
1467 | var hasUnicodeWord = _hasUnicodeWord;
|
1468 | var toString$4 = toString_1;
|
1469 | var unicodeWords = _unicodeWords;
|
1470 |
|
1471 |
|
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 |
|
1478 |
|
1479 |
|
1480 |
|
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 | function 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 |
|
1500 | var words_1 = words$1;
|
1501 |
|
1502 | var arrayReduce = _arrayReduce;
|
1503 | var deburr = deburr_1;
|
1504 | var words = words_1;
|
1505 |
|
1506 |
|
1507 | var rsApos = "['\u2019]";
|
1508 |
|
1509 |
|
1510 | var reApos = RegExp(rsApos, 'g');
|
1511 |
|
1512 |
|
1513 |
|
1514 |
|
1515 |
|
1516 |
|
1517 |
|
1518 |
|
1519 | function createCompounder$1(callback) {
|
1520 | return function(string) {
|
1521 | return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
|
1522 | };
|
1523 | }
|
1524 |
|
1525 | var _createCompounder = createCompounder$1;
|
1526 |
|
1527 | var capitalize = capitalize_1;
|
1528 | var createCompounder = _createCompounder;
|
1529 |
|
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 |
|
1535 |
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 | var camelCase = createCompounder(function(result, word, index) {
|
1551 | word = word.toLowerCase();
|
1552 | return result + (index ? capitalize(word) : word);
|
1553 | });
|
1554 |
|
1555 | var camelCase_1 = camelCase;
|
1556 |
|
1557 |
|
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 |
|
1565 | function 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 |
|
1576 | var _arrayPush = arrayPush$1;
|
1577 |
|
1578 | var Symbol$4 = _Symbol;
|
1579 | var isArguments$2 = isArguments_1;
|
1580 | var isArray$5 = isArray_1;
|
1581 |
|
1582 |
|
1583 | var spreadableSymbol = Symbol$4 ? Symbol$4.isConcatSpreadable : undefined;
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 | function isFlattenable$1(value) {
|
1593 | return isArray$5(value) || isArguments$2(value) ||
|
1594 | !!(spreadableSymbol && value && value[spreadableSymbol]);
|
1595 | }
|
1596 |
|
1597 | var _isFlattenable = isFlattenable$1;
|
1598 |
|
1599 | var arrayPush$2 = _arrayPush;
|
1600 | var isFlattenable = _isFlattenable;
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 | function 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 |
|
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 |
|
1636 | var _baseFlatten = baseFlatten$1;
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 | function 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 |
|
1657 | var _copyArray = copyArray$1;
|
1658 |
|
1659 | var arrayPush = _arrayPush;
|
1660 | var baseFlatten = _baseFlatten;
|
1661 | var copyArray = _copyArray;
|
1662 | var isArray$4 = isArray_1;
|
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 | function 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 |
|
1701 | var concat_1 = concat;
|
1702 |
|
1703 | var isArray$7 = isArray_1;
|
1704 | var isSymbol$2 = isSymbol_1;
|
1705 |
|
1706 |
|
1707 | var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
1708 | var reIsPlainProp = /^\w*$/;
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 | function 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 |
|
1731 | var _isKey = isKey$1;
|
1732 |
|
1733 | var root$2 = _root;
|
1734 |
|
1735 |
|
1736 | var coreJsData$1 = root$2['__core-js_shared__'];
|
1737 |
|
1738 | var _coreJsData = coreJsData$1;
|
1739 |
|
1740 | var coreJsData = _coreJsData;
|
1741 |
|
1742 |
|
1743 | var maskSrcKey = (function() {
|
1744 | var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
1745 | return uid ? ('Symbol(src)_1.' + uid) : '';
|
1746 | }());
|
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 |
|
1752 |
|
1753 |
|
1754 |
|
1755 | function isMasked$1(func) {
|
1756 | return !!maskSrcKey && (maskSrcKey in func);
|
1757 | }
|
1758 |
|
1759 | var _isMasked = isMasked$1;
|
1760 |
|
1761 |
|
1762 | var funcProto$1 = Function.prototype;
|
1763 |
|
1764 |
|
1765 | var funcToString$1 = funcProto$1.toString;
|
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 | function 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 |
|
1786 | var _toSource = toSource$1;
|
1787 |
|
1788 | var isFunction$3 = isFunction_1;
|
1789 | var isMasked = _isMasked;
|
1790 | var isObject$2 = isObject_1;
|
1791 | var toSource = _toSource;
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
1798 |
|
1799 |
|
1800 | var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
1801 |
|
1802 |
|
1803 | var funcProto = Function.prototype;
|
1804 | var objectProto$6 = Object.prototype;
|
1805 |
|
1806 |
|
1807 | var funcToString = funcProto.toString;
|
1808 |
|
1809 |
|
1810 | var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
1811 |
|
1812 |
|
1813 | var reIsNative = RegExp('^' +
|
1814 | funcToString.call(hasOwnProperty$4).replace(reRegExpChar, '\\$&')
|
1815 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
1816 | );
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 | function 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 |
|
1834 | var _baseIsNative = baseIsNative$1;
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
1843 |
|
1844 | function getValue$1(object, key) {
|
1845 | return object == null ? undefined : object[key];
|
1846 | }
|
1847 |
|
1848 | var _getValue = getValue$1;
|
1849 |
|
1850 | var baseIsNative = _baseIsNative;
|
1851 | var getValue = _getValue;
|
1852 |
|
1853 |
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 | function getNative$1(object, key) {
|
1862 | var value = getValue(object, key);
|
1863 | return baseIsNative(value) ? value : undefined;
|
1864 | }
|
1865 |
|
1866 | var _getNative = getNative$1;
|
1867 |
|
1868 | var getNative = _getNative;
|
1869 |
|
1870 |
|
1871 | var nativeCreate$1 = getNative(Object, 'create');
|
1872 |
|
1873 | var _nativeCreate = nativeCreate$1;
|
1874 |
|
1875 | var nativeCreate = _nativeCreate;
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 | function hashClear$1() {
|
1885 | this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
1886 | this.size = 0;
|
1887 | }
|
1888 |
|
1889 | var _hashClear = hashClear$1;
|
1890 |
|
1891 |
|
1892 |
|
1893 |
|
1894 |
|
1895 |
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 | function hashDelete$1(key) {
|
1902 | var result = this.has(key) && delete this.__data__[key];
|
1903 | this.size -= result ? 1 : 0;
|
1904 | return result;
|
1905 | }
|
1906 |
|
1907 | var _hashDelete = hashDelete$1;
|
1908 |
|
1909 | var nativeCreate$2 = _nativeCreate;
|
1910 |
|
1911 |
|
1912 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
1913 |
|
1914 |
|
1915 | var objectProto$7 = Object.prototype;
|
1916 |
|
1917 |
|
1918 | var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
1919 |
|
1920 |
|
1921 |
|
1922 |
|
1923 |
|
1924 |
|
1925 |
|
1926 |
|
1927 |
|
1928 |
|
1929 | function 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 |
|
1938 | var _hashGet = hashGet$1;
|
1939 |
|
1940 | var nativeCreate$3 = _nativeCreate;
|
1941 |
|
1942 |
|
1943 | var objectProto$8 = Object.prototype;
|
1944 |
|
1945 |
|
1946 | var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
1947 |
|
1948 |
|
1949 |
|
1950 |
|
1951 |
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 | function hashHas$1(key) {
|
1958 | var data = this.__data__;
|
1959 | return nativeCreate$3 ? (data[key] !== undefined) : hasOwnProperty$6.call(data, key);
|
1960 | }
|
1961 |
|
1962 | var _hashHas = hashHas$1;
|
1963 |
|
1964 | var nativeCreate$4 = _nativeCreate;
|
1965 |
|
1966 |
|
1967 | var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
1968 |
|
1969 |
|
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 | function 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 |
|
1986 | var _hashSet = hashSet$1;
|
1987 |
|
1988 | var hashClear = _hashClear;
|
1989 | var hashDelete = _hashDelete;
|
1990 | var hashGet = _hashGet;
|
1991 | var hashHas = _hashHas;
|
1992 | var hashSet = _hashSet;
|
1993 |
|
1994 |
|
1995 |
|
1996 |
|
1997 |
|
1998 |
|
1999 |
|
2000 |
|
2001 | function 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 |
|
2013 | Hash$1.prototype.clear = hashClear;
|
2014 | Hash$1.prototype['delete'] = hashDelete;
|
2015 | Hash$1.prototype.get = hashGet;
|
2016 | Hash$1.prototype.has = hashHas;
|
2017 | Hash$1.prototype.set = hashSet;
|
2018 |
|
2019 | var _Hash = Hash$1;
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 | function listCacheClear$1() {
|
2029 | this.__data__ = [];
|
2030 | this.size = 0;
|
2031 | }
|
2032 |
|
2033 | var _listCacheClear = listCacheClear$1;
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 |
|
2064 |
|
2065 |
|
2066 |
|
2067 | function eq$1(value, other) {
|
2068 | return value === other || (value !== value && other !== other);
|
2069 | }
|
2070 |
|
2071 | var eq_1 = eq$1;
|
2072 |
|
2073 | var eq = eq_1;
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 | function 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 |
|
2093 | var _assocIndexOf = assocIndexOf$1;
|
2094 |
|
2095 | var assocIndexOf = _assocIndexOf;
|
2096 |
|
2097 |
|
2098 | var arrayProto = Array.prototype;
|
2099 |
|
2100 |
|
2101 | var splice = arrayProto.splice;
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 |
|
2112 | function 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 |
|
2129 | var _listCacheDelete = listCacheDelete$1;
|
2130 |
|
2131 | var assocIndexOf$2 = _assocIndexOf;
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 | function 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 |
|
2149 | var _listCacheGet = listCacheGet$1;
|
2150 |
|
2151 | var assocIndexOf$3 = _assocIndexOf;
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 | function listCacheHas$1(key) {
|
2163 | return assocIndexOf$3(this.__data__, key) > -1;
|
2164 | }
|
2165 |
|
2166 | var _listCacheHas = listCacheHas$1;
|
2167 |
|
2168 | var assocIndexOf$4 = _assocIndexOf;
|
2169 |
|
2170 |
|
2171 |
|
2172 |
|
2173 |
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 |
|
2180 | function 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 |
|
2193 | var _listCacheSet = listCacheSet$1;
|
2194 |
|
2195 | var listCacheClear = _listCacheClear;
|
2196 | var listCacheDelete = _listCacheDelete;
|
2197 | var listCacheGet = _listCacheGet;
|
2198 | var listCacheHas = _listCacheHas;
|
2199 | var listCacheSet = _listCacheSet;
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 |
|
2208 | function 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 |
|
2220 | ListCache$1.prototype.clear = listCacheClear;
|
2221 | ListCache$1.prototype['delete'] = listCacheDelete;
|
2222 | ListCache$1.prototype.get = listCacheGet;
|
2223 | ListCache$1.prototype.has = listCacheHas;
|
2224 | ListCache$1.prototype.set = listCacheSet;
|
2225 |
|
2226 | var _ListCache = ListCache$1;
|
2227 |
|
2228 | var getNative$2 = _getNative;
|
2229 | var root$3 = _root;
|
2230 |
|
2231 |
|
2232 | var Map$1 = getNative$2(root$3, 'Map');
|
2233 |
|
2234 | var _Map = Map$1;
|
2235 |
|
2236 | var Hash = _Hash;
|
2237 | var ListCache = _ListCache;
|
2238 | var Map = _Map;
|
2239 |
|
2240 |
|
2241 |
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 | function 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 |
|
2256 | var _mapCacheClear = mapCacheClear$1;
|
2257 |
|
2258 |
|
2259 |
|
2260 |
|
2261 |
|
2262 |
|
2263 |
|
2264 |
|
2265 | function 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 |
|
2272 | var _isKeyable = isKeyable$1;
|
2273 |
|
2274 | var isKeyable = _isKeyable;
|
2275 |
|
2276 |
|
2277 |
|
2278 |
|
2279 |
|
2280 |
|
2281 |
|
2282 |
|
2283 |
|
2284 | function 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 |
|
2291 | var _getMapData = getMapData$1;
|
2292 |
|
2293 | var getMapData = _getMapData;
|
2294 |
|
2295 |
|
2296 |
|
2297 |
|
2298 |
|
2299 |
|
2300 |
|
2301 |
|
2302 |
|
2303 |
|
2304 | function mapCacheDelete$1(key) {
|
2305 | var result = getMapData(this, key)['delete'](key);
|
2306 | this.size -= result ? 1 : 0;
|
2307 | return result;
|
2308 | }
|
2309 |
|
2310 | var _mapCacheDelete = mapCacheDelete$1;
|
2311 |
|
2312 | var getMapData$2 = _getMapData;
|
2313 |
|
2314 |
|
2315 |
|
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 |
|
2323 | function mapCacheGet$1(key) {
|
2324 | return getMapData$2(this, key).get(key);
|
2325 | }
|
2326 |
|
2327 | var _mapCacheGet = mapCacheGet$1;
|
2328 |
|
2329 | var getMapData$3 = _getMapData;
|
2330 |
|
2331 |
|
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 |
|
2337 |
|
2338 |
|
2339 |
|
2340 | function mapCacheHas$1(key) {
|
2341 | return getMapData$3(this, key).has(key);
|
2342 | }
|
2343 |
|
2344 | var _mapCacheHas = mapCacheHas$1;
|
2345 |
|
2346 | var getMapData$4 = _getMapData;
|
2347 |
|
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 |
|
2358 | function 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 |
|
2367 | var _mapCacheSet = mapCacheSet$1;
|
2368 |
|
2369 | var mapCacheClear = _mapCacheClear;
|
2370 | var mapCacheDelete = _mapCacheDelete;
|
2371 | var mapCacheGet = _mapCacheGet;
|
2372 | var mapCacheHas = _mapCacheHas;
|
2373 | var mapCacheSet = _mapCacheSet;
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 | function 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 |
|
2394 | MapCache$1.prototype.clear = mapCacheClear;
|
2395 | MapCache$1.prototype['delete'] = mapCacheDelete;
|
2396 | MapCache$1.prototype.get = mapCacheGet;
|
2397 | MapCache$1.prototype.has = mapCacheHas;
|
2398 | MapCache$1.prototype.set = mapCacheSet;
|
2399 |
|
2400 | var _MapCache = MapCache$1;
|
2401 |
|
2402 | var MapCache = _MapCache;
|
2403 |
|
2404 |
|
2405 | var FUNC_ERROR_TEXT = 'Expected a function';
|
2406 |
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 |
|
2425 |
|
2426 |
|
2427 |
|
2428 |
|
2429 |
|
2430 |
|
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 |
|
2447 |
|
2448 |
|
2449 |
|
2450 |
|
2451 | function 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 |
|
2472 | memoize$1.Cache = MapCache;
|
2473 |
|
2474 | var memoize_1 = memoize$1;
|
2475 |
|
2476 | var memoize = memoize_1;
|
2477 |
|
2478 |
|
2479 | var MAX_MEMOIZE_SIZE = 500;
|
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 | function 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 |
|
2501 | var _memoizeCapped = memoizeCapped$1;
|
2502 |
|
2503 | var memoizeCapped = _memoizeCapped;
|
2504 |
|
2505 |
|
2506 | var reLeadingDot = /^\./;
|
2507 | var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
2508 |
|
2509 |
|
2510 | var reEscapeChar = /\\(\\)?/g;
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 | var 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 |
|
2530 | var _stringToPath = stringToPath$1;
|
2531 |
|
2532 | var isArray$6 = isArray_1;
|
2533 | var isKey = _isKey;
|
2534 | var stringToPath = _stringToPath;
|
2535 | var toString$5 = toString_1;
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 |
|
2543 |
|
2544 |
|
2545 | function 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 |
|
2552 | var _castPath = castPath$1;
|
2553 |
|
2554 | var isSymbol$3 = isSymbol_1;
|
2555 |
|
2556 |
|
2557 | var INFINITY$1 = 1 / 0;
|
2558 |
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 | function 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 |
|
2574 | var _toKey = toKey$1;
|
2575 |
|
2576 | var castPath = _castPath;
|
2577 | var toKey = _toKey;
|
2578 |
|
2579 |
|
2580 |
|
2581 |
|
2582 |
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 | function 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 |
|
2599 | var _baseGet = baseGet$1;
|
2600 |
|
2601 | var baseGet = _baseGet;
|
2602 |
|
2603 |
|
2604 |
|
2605 |
|
2606 |
|
2607 |
|
2608 |
|
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 |
|
2614 |
|
2615 |
|
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 |
|
2621 |
|
2622 |
|
2623 |
|
2624 |
|
2625 |
|
2626 |
|
2627 |
|
2628 | function get(object, path, defaultValue) {
|
2629 | var result = object == null ? undefined : baseGet(object, path);
|
2630 | return result === undefined ? defaultValue : result;
|
2631 | }
|
2632 |
|
2633 | var get_1 = get;
|
2634 |
|
2635 | var getNative$3 = _getNative;
|
2636 | var root$4 = _root;
|
2637 |
|
2638 | /* Built-in method references that are verified to be native. */
|
2639 | var DataView$1 = getNative$3(root$4, 'DataView');
|
2640 |
|
2641 | var _DataView = DataView$1;
|
2642 |
|
2643 | var getNative$4 = _getNative;
|
2644 | var root$5 = _root;
|
2645 |
|
2646 | /* Built-in method references that are verified to be native. */
|
2647 | var Promise$2 = getNative$4(root$5, 'Promise');
|
2648 |
|
2649 | var _Promise = Promise$2;
|
2650 |
|
2651 | var getNative$5 = _getNative;
|
2652 | var root$6 = _root;
|
2653 |
|
2654 | /* Built-in method references that are verified to be native. */
|
2655 | var Set$1 = getNative$5(root$6, 'Set');
|
2656 |
|
2657 | var _Set = Set$1;
|
2658 |
|
2659 | var getNative$6 = _getNative;
|
2660 | var root$7 = _root;
|
2661 |
|
2662 | /* Built-in method references that are verified to be native. */
|
2663 | var WeakMap$1 = getNative$6(root$7, 'WeakMap');
|
2664 |
|
2665 | var _WeakMap = WeakMap$1;
|
2666 |
|
2667 | var DataView = _DataView;
|
2668 | var Map$2 = _Map;
|
2669 | var Promise$1 = _Promise;
|
2670 | var Set = _Set;
|
2671 | var WeakMap = _WeakMap;
|
2672 | var baseGetTag$5 = _baseGetTag;
|
2673 | var toSource$2 = _toSource;
|
2674 |
|
2675 | /** `Object#toString` result references. */
|
2676 | var mapTag$2 = '[object Map]';
|
2677 | var objectTag$1 = '[object Object]';
|
2678 | var promiseTag = '[object Promise]';
|
2679 | var setTag$2 = '[object Set]';
|
2680 | var weakMapTag$1 = '[object WeakMap]';
|
2681 |
|
2682 | var dataViewTag$1 = '[object DataView]';
|
2683 |
|
2684 | /** Used to detect maps, sets, and weakmaps. */
|
2685 | var dataViewCtorString = toSource$2(DataView);
|
2686 | var mapCtorString = toSource$2(Map$2);
|
2687 | var promiseCtorString = toSource$2(Promise$1);
|
2688 | var setCtorString = toSource$2(Set);
|
2689 | var 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 | */
|
2698 | var getTag$1 = baseGetTag$5;
|
2699 |
|
2700 |
|
2701 | if ((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 |
|
2724 | var _getTag = getTag$1;
|
2725 |
|
2726 | var baseKeys$2 = _baseKeys;
|
2727 | var getTag = _getTag;
|
2728 | var isArguments$3 = isArguments_1;
|
2729 | var isArray$8 = isArray_1;
|
2730 | var isArrayLike$2 = isArrayLike_1;
|
2731 | var isBuffer$1 = isBuffer_1;
|
2732 | var isPrototype$2 = _isPrototype;
|
2733 | var isTypedArray$2 = isTypedArray_1;
|
2734 |
|
2735 |
|
2736 | var mapTag$1 = '[object Map]';
|
2737 | var setTag$1 = '[object Set]';
|
2738 |
|
2739 |
|
2740 | var objectProto$9 = Object.prototype;
|
2741 |
|
2742 |
|
2743 | var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 |
|
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 | function 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 |
|
2802 | var isEmpty_1 = isEmpty;
|
2803 |
|
2804 | var createCompounder$2 = _createCompounder;
|
2805 |
|
2806 |
|
2807 |
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 | var kebabCase = createCompounder$2(function(result, word, index) {
|
2828 | return result + (index ? '-' : '') + word.toLowerCase();
|
2829 | });
|
2830 |
|
2831 | var kebabCase_1 = kebabCase;
|
2832 |
|
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 |
|
2839 |
|
2840 |
|
2841 |
|
2842 |
|
2843 |
|
2844 | function 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 |
|
2856 | var _baseFindIndex = baseFindIndex$1;
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 |
|
2863 |
|
2864 |
|
2865 | function baseIsNaN$1(value) {
|
2866 | return value !== value;
|
2867 | }
|
2868 |
|
2869 | var _baseIsNaN = baseIsNaN$1;
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 |
|
2876 |
|
2877 |
|
2878 |
|
2879 |
|
2880 |
|
2881 | function 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 |
|
2893 | var _strictIndexOf = strictIndexOf$1;
|
2894 |
|
2895 | var baseFindIndex = _baseFindIndex;
|
2896 | var baseIsNaN = _baseIsNaN;
|
2897 | var strictIndexOf = _strictIndexOf;
|
2898 |
|
2899 |
|
2900 |
|
2901 |
|
2902 |
|
2903 |
|
2904 |
|
2905 |
|
2906 |
|
2907 |
|
2908 | function baseIndexOf$1(array, value, fromIndex) {
|
2909 | return value === value
|
2910 | ? strictIndexOf(array, value, fromIndex)
|
2911 | : baseFindIndex(array, baseIsNaN, fromIndex);
|
2912 | }
|
2913 |
|
2914 | var _baseIndexOf = baseIndexOf$1;
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 | function 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 |
|
2938 | var _baseIndexOfWith = baseIndexOfWith$1;
|
2939 |
|
2940 | var arrayMap$2 = _arrayMap;
|
2941 | var baseIndexOf = _baseIndexOf;
|
2942 | var baseIndexOfWith = _baseIndexOfWith;
|
2943 | var baseUnary$2 = _baseUnary;
|
2944 | var copyArray$2 = _copyArray;
|
2945 |
|
2946 |
|
2947 | var arrayProto$1 = Array.prototype;
|
2948 |
|
2949 |
|
2950 | var splice$1 = arrayProto$1.splice;
|
2951 |
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 |
|
2961 |
|
2962 |
|
2963 | function 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 |
|
2990 | var _basePullAll = basePullAll$1;
|
2991 |
|
2992 | var basePullAll = _basePullAll;
|
2993 |
|
2994 |
|
2995 |
|
2996 |
|
2997 |
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 |
|
3003 |
|
3004 |
|
3005 |
|
3006 |
|
3007 |
|
3008 |
|
3009 |
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 | function pullAll(array, values) {
|
3015 | return (array && array.length && values && values.length)
|
3016 | ? basePullAll(array, values)
|
3017 | : array;
|
3018 | }
|
3019 |
|
3020 | var pullAll_1 = pullAll;
|
3021 |
|
3022 | var createCompounder$3 = _createCompounder;
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 |
|
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 |
|
3042 |
|
3043 |
|
3044 |
|
3045 | var snakeCase = createCompounder$3(function(result, word, index) {
|
3046 | return result + (index ? '_' : '') + word.toLowerCase();
|
3047 | });
|
3048 |
|
3049 | var snakeCase_1 = snakeCase;
|
3050 |
|
3051 |
|
3052 | var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
3053 |
|
3054 |
|
3055 |
|
3056 |
|
3057 |
|
3058 |
|
3059 |
|
3060 |
|
3061 |
|
3062 |
|
3063 |
|
3064 | function setCacheAdd$1(value) {
|
3065 | this.__data__.set(value, HASH_UNDEFINED$2);
|
3066 | return this;
|
3067 | }
|
3068 |
|
3069 | var _setCacheAdd = setCacheAdd$1;
|
3070 |
|
3071 |
|
3072 |
|
3073 |
|
3074 |
|
3075 |
|
3076 |
|
3077 |
|
3078 |
|
3079 |
|
3080 | function setCacheHas$1(value) {
|
3081 | return this.__data__.has(value);
|
3082 | }
|
3083 |
|
3084 | var _setCacheHas = setCacheHas$1;
|
3085 |
|
3086 | var MapCache$2 = _MapCache;
|
3087 | var setCacheAdd = _setCacheAdd;
|
3088 | var setCacheHas = _setCacheHas;
|
3089 |
|
3090 |
|
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 |
|
3098 | function 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 |
|
3109 | SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
|
3110 | SetCache$1.prototype.has = setCacheHas;
|
3111 |
|
3112 | var _SetCache = SetCache$1;
|
3113 |
|
3114 | var baseIndexOf$2 = _baseIndexOf;
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 |
|
3120 |
|
3121 |
|
3122 |
|
3123 |
|
3124 |
|
3125 | function arrayIncludes$1(array, value) {
|
3126 | var length = array == null ? 0 : array.length;
|
3127 | return !!length && baseIndexOf$2(array, value, 0) > -1;
|
3128 | }
|
3129 |
|
3130 | var _arrayIncludes = arrayIncludes$1;
|
3131 |
|
3132 |
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 |
|
3140 |
|
3141 | function 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 |
|
3153 | var _arrayIncludesWith = arrayIncludesWith$1;
|
3154 |
|
3155 |
|
3156 |
|
3157 |
|
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 | function cacheHas$1(cache, key) {
|
3164 | return cache.has(key);
|
3165 | }
|
3166 |
|
3167 | var _cacheHas = cacheHas$1;
|
3168 |
|
3169 |
|
3170 |
|
3171 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 | function noop$1() {
|
3182 |
|
3183 | }
|
3184 |
|
3185 | var noop_1 = noop$1;
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 | function 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 |
|
3204 | var _setToArray = setToArray$2;
|
3205 |
|
3206 | var Set$2 = _Set;
|
3207 | var noop = noop_1;
|
3208 | var setToArray$1 = _setToArray;
|
3209 |
|
3210 |
|
3211 | var INFINITY$2 = 1 / 0;
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 | var 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 |
|
3224 | var _createSet = createSet$1;
|
3225 |
|
3226 | var SetCache = _SetCache;
|
3227 | var arrayIncludes = _arrayIncludes;
|
3228 | var arrayIncludesWith = _arrayIncludesWith;
|
3229 | var cacheHas = _cacheHas;
|
3230 | var createSet = _createSet;
|
3231 | var setToArray = _setToArray;
|
3232 |
|
3233 |
|
3234 | var LARGE_ARRAY_SIZE = 200;
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 |
|
3243 |
|
3244 |
|
3245 | function 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 |
|
3297 | var _baseUniq = baseUniq$1;
|
3298 |
|
3299 | var baseUniq = _baseUniq;
|
3300 |
|
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 |
|
3307 |
|
3308 |
|
3309 |
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 | function uniq(array) {
|
3320 | return (array && array.length) ? baseUniq(array) : [];
|
3321 | }
|
3322 |
|
3323 | var uniq_1 = uniq;
|
3324 |
|
3325 | var DEFAULT_FROM_INDEX = 0;
|
3326 | var DEFAULT_TO_INDEX = 19;
|
3327 | var MY_PATH_KEYWORD = 'self';
|
3328 |
|
3329 | function 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 |
|
3336 | function 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 |
|
3354 | function entityNameToFilename(name) {
|
3355 | return kebabCase_1(name) + '.js';
|
3356 | }
|
3357 |
|
3358 | function entityToAPIEnvelopeKey(entity) {
|
3359 | return snakeCase_1(entity.name);
|
3360 | }
|
3361 |
|
3362 | function entityToFalcorListLeaf(entity) {
|
3363 | return snakeCase_1(entity.name) + '_list';
|
3364 | }
|
3365 |
|
3366 | function entityToFalcorMembershipsListLeaf(entity) {
|
3367 | return 'membership_' + entityToFalcorListLeaf(entity);
|
3368 | }
|
3369 |
|
3370 | function entityToFalcorMyListLeaf(entity) {
|
3371 | return 'my_' + entityToFalcorListLeaf(entity);
|
3372 | }
|
3373 |
|
3374 | function entityToFalcorRootLeaf(entity) {
|
3375 | return snakeCase_1(entity.pluralName);
|
3376 | }
|
3377 |
|
3378 | function falcorListLeafToEntityName(listLeaf) {
|
3379 | return camelCase_1(listLeaf.replace(/_list$/, ''));
|
3380 | }
|
3381 |
|
3382 | function falcorRootLeafToEntityName(rootLeaf) {
|
3383 | return camelCase_1(rootLeaf);
|
3384 | }
|
3385 |
|
3386 | function optionsHasQuery(options) {
|
3387 | return keys_1(options.query).length > 0;
|
3388 | }
|
3389 |
|
3390 | function typedEntityToFalcorListPath(entity, options) {
|
3391 | return [snakeCase_1(options.type), snakeCase_1(entity.name) + '_list'];
|
3392 | }
|
3393 |
|
3394 | var name$4 = 'comment';
|
3395 | var pluralName$4 = 'comments';
|
3396 |
|
3397 | var defaultProperties$4 = ['id', 'body', 'markup_tokens', 'post', 'owner.id', 'owner.first_name', 'owner.last_name', 'owner.name', 'owner.avatar.src', 'created_at'];
|
3398 |
|
3399 | function 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 |
|
3414 |
|
3415 | function 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 |
|
3431 | var comment = Object.freeze({
|
3432 | name: name$4,
|
3433 | pluralName: pluralName$4,
|
3434 | defaultProperties: defaultProperties$4,
|
3435 | invalidateAfterCreate: invalidateAfterCreate,
|
3436 | invalidateAfterDestroy: invalidateAfterDestroy
|
3437 | });
|
3438 |
|
3439 | var name$5 = 'contentListItem';
|
3440 | var pluralName$5 = 'contentListItems';
|
3441 |
|
3442 | var defaultProperties$5 = ['id', 'content_id', 'content_type', 'new', 'position'];
|
3443 |
|
3444 | var contentListItem = Object.freeze({
|
3445 | name: name$5,
|
3446 | pluralName: pluralName$5,
|
3447 | defaultProperties: defaultProperties$5
|
3448 | });
|
3449 |
|
3450 | var name$6 = 'directMessage';
|
3451 | var pluralName$6 = 'directMessages';
|
3452 |
|
3453 | var defaultProperties$6 = ['id', 'name'];
|
3454 |
|
3455 | var directMessage = Object.freeze({
|
3456 | name: name$6,
|
3457 | pluralName: pluralName$6,
|
3458 | defaultProperties: defaultProperties$6
|
3459 | });
|
3460 |
|
3461 | var 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 |
|
3476 | var TokenTypes_1 = TokenTypes;
|
3477 |
|
3478 | var index$1 = createCommonjsModule(function (module) {
|
3479 | var TokenTypes = TokenTypes_1;
|
3480 | var DOT_SEPARATOR = '.';
|
3481 | var COMMA_SEPARATOR = ',';
|
3482 | var OPENING_BRACKET = '[';
|
3483 | var CLOSING_BRACKET = ']';
|
3484 | var OPENING_BRACE = '{';
|
3485 | var CLOSING_BRACE = '}';
|
3486 | var COLON = ':';
|
3487 | var ESCAPE = '\\';
|
3488 | var DOUBLE_OUOTES = '"';
|
3489 | var SINGE_OUOTES = "'";
|
3490 | var SPACE = " ";
|
3491 | var SPECIAL_CHARACTERS = '\\\'"[]., ';
|
3492 | var EXT_SPECIAL_CHARACTERS = '\\{}\'"[]., :';
|
3493 |
|
3494 | var Tokenizer = module.exports = function(string, ext) {
|
3495 | this._string = string;
|
3496 | this._idx = -1;
|
3497 | this._extended = ext;
|
3498 | this.parseString = '';
|
3499 | };
|
3500 |
|
3501 | Tokenizer.prototype = {
|
3502 | |
3503 |
|
3504 |
|
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 |
|
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 |
|
3529 | Tokenizer.toNumber = function toNumber(x) {
|
3530 | if (!isNaN(+x)) {
|
3531 | return +x;
|
3532 | }
|
3533 | return NaN;
|
3534 | };
|
3535 |
|
3536 | function toOutput(token, type, done) {
|
3537 | return {
|
3538 | token: token,
|
3539 | done: done,
|
3540 | type: type
|
3541 | };
|
3542 | }
|
3543 |
|
3544 | function 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 |
|
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 |
|
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 |
|
3631 | var 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 |
|
3663 | var Tokenizer$1 = index$1;
|
3664 | var TokenTypes$3 = TokenTypes_1;
|
3665 | var E$2 = index$3;
|
3666 |
|
3667 |
|
3668 |
|
3669 |
|
3670 |
|
3671 | var 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 |
|
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 |
|
3687 |
|
3688 | while (!done && !token.done) {
|
3689 |
|
3690 | switch (token.type) {
|
3691 |
|
3692 |
|
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 |
|
3706 | to = Tokenizer$1.toNumber(tokenizer.next().token);
|
3707 |
|
3708 |
|
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 |
|
3722 |
|
3723 |
|
3724 | if (!done) {
|
3725 | tokenizer.next();
|
3726 |
|
3727 |
|
3728 | token = tokenizer.peek();
|
3729 | }
|
3730 |
|
3731 |
|
3732 | else {
|
3733 | break;
|
3734 | }
|
3735 | }
|
3736 |
|
3737 | state.indexer[idx] = {from: from, to: inclusive ? to : to - 1};
|
3738 | };
|
3739 |
|
3740 | var TokenTypes$4 = TokenTypes_1;
|
3741 | var E$3 = index$3;
|
3742 | var quoteE = E$3.quote;
|
3743 |
|
3744 |
|
3745 |
|
3746 |
|
3747 |
|
3748 |
|
3749 |
|
3750 |
|
3751 | var 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 |
|
3781 | if (escaping) {
|
3782 | innerToken += token.token;
|
3783 | escaping = false;
|
3784 | }
|
3785 |
|
3786 |
|
3787 | else if (token.token !== openingQuote) {
|
3788 | innerToken += token.token;
|
3789 | }
|
3790 |
|
3791 |
|
3792 |
|
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 |
|
3807 | if (done) {
|
3808 | break;
|
3809 | }
|
3810 |
|
3811 |
|
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 |
|
3822 | var RoutedTokens$2 = {
|
3823 | integers: 'integers',
|
3824 | ranges: 'ranges',
|
3825 | keys: 'keys'
|
3826 | };
|
3827 |
|
3828 | var TokenTypes$5 = TokenTypes_1;
|
3829 | var RoutedTokens$1 = RoutedTokens$2;
|
3830 | var E$4 = index$3;
|
3831 | var routedE = E$4.routed;
|
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 | var routed$1 = function routed(tokenizer, openingToken, state, out) {
|
3840 | var routeToken = tokenizer.next();
|
3841 | var named = false;
|
3842 | var name = '';
|
3843 |
|
3844 |
|
3845 | switch (routeToken.token) {
|
3846 | case RoutedTokens$1.integers:
|
3847 | case RoutedTokens$1.ranges:
|
3848 | case RoutedTokens$1.keys:
|
3849 |
|
3850 | break;
|
3851 | default:
|
3852 | E$4.throwError(routedE.invalid, tokenizer);
|
3853 | break;
|
3854 | }
|
3855 |
|
3856 |
|
3857 | var next = tokenizer.next();
|
3858 |
|
3859 |
|
3860 | if (next.type === TokenTypes$5.colon) {
|
3861 | named = true;
|
3862 |
|
3863 |
|
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 |
|
3871 | next = tokenizer.next();
|
3872 | }
|
3873 |
|
3874 |
|
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 |
|
3886 | else {
|
3887 | E$4.throwError(routedE.invalid, tokenizer);
|
3888 | }
|
3889 |
|
3890 | };
|
3891 |
|
3892 | var TokenTypes$2 = TokenTypes_1;
|
3893 | var E$1 = index$3;
|
3894 | var idxE = E$1.indexer;
|
3895 | var range = range$1;
|
3896 | var quote = quote$1;
|
3897 | var routed = routed$1;
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 |
|
3903 | var 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 |
|
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 |
|
3919 | if (state.indexer.length === allowedMaxLength) {
|
3920 | E$1.throwError(idxE.requiresComma, tokenizer);
|
3921 | }
|
3922 | break;
|
3923 | }
|
3924 |
|
3925 | switch (token.type) {
|
3926 |
|
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 |
|
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 |
|
3950 | case TokenTypes$2.space:
|
3951 | break;
|
3952 |
|
3953 | case TokenTypes$2.closingBracket:
|
3954 | done = true;
|
3955 | break;
|
3956 |
|
3957 |
|
3958 |
|
3959 | case TokenTypes$2.quote:
|
3960 | quote(tokenizer, token, state, out);
|
3961 | break;
|
3962 |
|
3963 |
|
3964 |
|
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 |
|
3979 | if (done) {
|
3980 | break;
|
3981 | }
|
3982 |
|
3983 |
|
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 |
|
3996 | if (state.indexer.length === 1) {
|
3997 | state.indexer = state.indexer[0];
|
3998 | }
|
3999 |
|
4000 | out[out.length] = state.indexer;
|
4001 |
|
4002 |
|
4003 | state.indexer = undefined;
|
4004 | };
|
4005 |
|
4006 | var TokenTypes$1 = TokenTypes_1;
|
4007 | var E = index$3;
|
4008 | var indexer = indexer$1;
|
4009 |
|
4010 |
|
4011 |
|
4012 |
|
4013 |
|
4014 | var 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 |
|
4031 | case TokenTypes$1.dotSeparator:
|
4032 | if (out.length === 0) {
|
4033 | E.throwError(E.unexpectedToken, tokenizer);
|
4034 | }
|
4035 | break;
|
4036 |
|
4037 |
|
4038 | case TokenTypes$1.space:
|
4039 |
|
4040 |
|
4041 | break;
|
4042 |
|
4043 |
|
4044 |
|
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 |
|
4055 | token = tokenizer.next();
|
4056 | }
|
4057 |
|
4058 | if (out.length === 0) {
|
4059 | E.throwError(E.invalidPath, tokenizer);
|
4060 | }
|
4061 |
|
4062 | return out;
|
4063 | };
|
4064 |
|
4065 | var Tokenizer = index$1;
|
4066 | var head$2 = head$3;
|
4067 | var RoutedTokens = RoutedTokens$2;
|
4068 |
|
4069 | var parser = function parser(string, extendedRules) {
|
4070 | return head$2(new Tokenizer(string, extendedRules));
|
4071 | };
|
4072 |
|
4073 | var index = parser;
|
4074 |
|
4075 |
|
4076 |
|
4077 |
|
4078 | parser.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 |
|
4087 | if (typeof paths[i] === 'string') {
|
4088 | out[i] = parser(paths[i], ext);
|
4089 | }
|
4090 |
|
4091 |
|
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 |
|
4099 | else {
|
4100 | out[i] = paths[i];
|
4101 | }
|
4102 | }
|
4103 |
|
4104 | return out;
|
4105 | };
|
4106 |
|
4107 |
|
4108 |
|
4109 | parser.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 |
|
4122 | parser.RoutedTokens = RoutedTokens;
|
4123 |
|
4124 | var ListCache$3 = _ListCache;
|
4125 |
|
4126 |
|
4127 |
|
4128 |
|
4129 |
|
4130 |
|
4131 |
|
4132 |
|
4133 | function stackClear$1() {
|
4134 | this.__data__ = new ListCache$3;
|
4135 | this.size = 0;
|
4136 | }
|
4137 |
|
4138 | var _stackClear = stackClear$1;
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 |
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 | function stackDelete$1(key) {
|
4150 | var data = this.__data__,
|
4151 | result = data['delete'](key);
|
4152 |
|
4153 | this.size = data.size;
|
4154 | return result;
|
4155 | }
|
4156 |
|
4157 | var _stackDelete = stackDelete$1;
|
4158 |
|
4159 |
|
4160 |
|
4161 |
|
4162 |
|
4163 |
|
4164 |
|
4165 |
|
4166 |
|
4167 |
|
4168 | function stackGet$1(key) {
|
4169 | return this.__data__.get(key);
|
4170 | }
|
4171 |
|
4172 | var _stackGet = stackGet$1;
|
4173 |
|
4174 |
|
4175 |
|
4176 |
|
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 |
|
4182 |
|
4183 | function stackHas$1(key) {
|
4184 | return this.__data__.has(key);
|
4185 | }
|
4186 |
|
4187 | var _stackHas = stackHas$1;
|
4188 |
|
4189 | var ListCache$4 = _ListCache;
|
4190 | var Map$3 = _Map;
|
4191 | var MapCache$3 = _MapCache;
|
4192 |
|
4193 |
|
4194 | var LARGE_ARRAY_SIZE$1 = 200;
|
4195 |
|
4196 |
|
4197 |
|
4198 |
|
4199 |
|
4200 |
|
4201 |
|
4202 |
|
4203 |
|
4204 |
|
4205 |
|
4206 | function 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 |
|
4222 | var _stackSet = stackSet$1;
|
4223 |
|
4224 | var ListCache$2 = _ListCache;
|
4225 | var stackClear = _stackClear;
|
4226 | var stackDelete = _stackDelete;
|
4227 | var stackGet = _stackGet;
|
4228 | var stackHas = _stackHas;
|
4229 | var stackSet = _stackSet;
|
4230 |
|
4231 |
|
4232 |
|
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 | function Stack$1(entries) {
|
4239 | var data = this.__data__ = new ListCache$2(entries);
|
4240 | this.size = data.size;
|
4241 | }
|
4242 |
|
4243 |
|
4244 | Stack$1.prototype.clear = stackClear;
|
4245 | Stack$1.prototype['delete'] = stackDelete;
|
4246 | Stack$1.prototype.get = stackGet;
|
4247 | Stack$1.prototype.has = stackHas;
|
4248 | Stack$1.prototype.set = stackSet;
|
4249 |
|
4250 | var _Stack = Stack$1;
|
4251 |
|
4252 |
|
4253 |
|
4254 |
|
4255 |
|
4256 |
|
4257 |
|
4258 |
|
4259 |
|
4260 |
|
4261 |
|
4262 | function 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 |
|
4274 | var _arraySome = arraySome$1;
|
4275 |
|
4276 | var SetCache$2 = _SetCache;
|
4277 | var arraySome = _arraySome;
|
4278 | var cacheHas$2 = _cacheHas;
|
4279 |
|
4280 |
|
4281 | var COMPARE_PARTIAL_FLAG$2 = 1;
|
4282 | var COMPARE_UNORDERED_FLAG$1 = 2;
|
4283 |
|
4284 |
|
4285 |
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 |
|
4293 |
|
4294 |
|
4295 |
|
4296 |
|
4297 | function 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 |
|
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 |
|
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 |
|
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 |
|
4358 | var _equalArrays = equalArrays$1;
|
4359 |
|
4360 | var root$8 = _root;
|
4361 |
|
4362 |
|
4363 | var Uint8Array$1 = root$8.Uint8Array;
|
4364 |
|
4365 | var _Uint8Array = Uint8Array$1;
|
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 |
|
4371 |
|
4372 |
|
4373 |
|
4374 | function 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 |
|
4384 | var _mapToArray = mapToArray$1;
|
4385 |
|
4386 | var Symbol$5 = _Symbol;
|
4387 | var Uint8Array = _Uint8Array;
|
4388 | var eq$2 = eq_1;
|
4389 | var equalArrays$2 = _equalArrays;
|
4390 | var mapToArray = _mapToArray;
|
4391 | var setToArray$3 = _setToArray;
|
4392 |
|
4393 |
|
4394 | var COMPARE_PARTIAL_FLAG$3 = 1;
|
4395 | var COMPARE_UNORDERED_FLAG$2 = 2;
|
4396 |
|
4397 |
|
4398 | var boolTag$1 = '[object Boolean]';
|
4399 | var dateTag$1 = '[object Date]';
|
4400 | var errorTag$1 = '[object Error]';
|
4401 | var mapTag$3 = '[object Map]';
|
4402 | var numberTag$1 = '[object Number]';
|
4403 | var regexpTag$1 = '[object RegExp]';
|
4404 | var setTag$3 = '[object Set]';
|
4405 | var stringTag$1 = '[object String]';
|
4406 | var symbolTag$1 = '[object Symbol]';
|
4407 |
|
4408 | var arrayBufferTag$1 = '[object ArrayBuffer]';
|
4409 | var dataViewTag$2 = '[object DataView]';
|
4410 |
|
4411 |
|
4412 | var symbolProto$1 = Symbol$5 ? Symbol$5.prototype : undefined;
|
4413 | var symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
|
4414 |
|
4415 |
|
4416 |
|
4417 |
|
4418 |
|
4419 |
|
4420 |
|
4421 |
|
4422 |
|
4423 |
|
4424 |
|
4425 |
|
4426 |
|
4427 |
|
4428 |
|
4429 |
|
4430 |
|
4431 |
|
4432 | function 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 |
|
4453 |
|
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 |
|
4462 |
|
4463 |
|
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 |
|
4477 | var stacked = stack.get(object);
|
4478 | if (stacked) {
|
4479 | return stacked == other;
|
4480 | }
|
4481 | bitmask |= COMPARE_UNORDERED_FLAG$2;
|
4482 |
|
4483 |
|
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 |
|
4497 | var _equalByTag = equalByTag$1;
|
4498 |
|
4499 | var arrayPush$3 = _arrayPush;
|
4500 | var isArray$12 = isArray_1;
|
4501 |
|
4502 |
|
4503 |
|
4504 |
|
4505 |
|
4506 |
|
4507 |
|
4508 |
|
4509 |
|
4510 |
|
4511 |
|
4512 |
|
4513 | function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
|
4514 | var result = keysFunc(object);
|
4515 | return isArray$12(object) ? result : arrayPush$3(result, symbolsFunc(object));
|
4516 | }
|
4517 |
|
4518 | var _baseGetAllKeys = baseGetAllKeys$1;
|
4519 |
|
4520 |
|
4521 |
|
4522 |
|
4523 |
|
4524 |
|
4525 |
|
4526 |
|
4527 |
|
4528 |
|
4529 | function 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 |
|
4544 | var _arrayFilter = arrayFilter$1;
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 |
|
4553 |
|
4554 |
|
4555 |
|
4556 |
|
4557 |
|
4558 |
|
4559 |
|
4560 |
|
4561 |
|
4562 |
|
4563 |
|
4564 | function stubArray$1() {
|
4565 | return [];
|
4566 | }
|
4567 |
|
4568 | var stubArray_1 = stubArray$1;
|
4569 |
|
4570 | var arrayFilter = _arrayFilter;
|
4571 | var stubArray = stubArray_1;
|
4572 |
|
4573 |
|
4574 | var objectProto$12 = Object.prototype;
|
4575 |
|
4576 |
|
4577 | var propertyIsEnumerable$1 = objectProto$12.propertyIsEnumerable;
|
4578 |
|
4579 |
|
4580 | var nativeGetSymbols = Object.getOwnPropertySymbols;
|
4581 |
|
4582 |
|
4583 |
|
4584 |
|
4585 |
|
4586 |
|
4587 |
|
4588 |
|
4589 | var 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 |
|
4599 | var _getSymbols = getSymbols$1;
|
4600 |
|
4601 | var baseGetAllKeys = _baseGetAllKeys;
|
4602 | var getSymbols = _getSymbols;
|
4603 | var keys$2 = keys_1;
|
4604 |
|
4605 |
|
4606 |
|
4607 |
|
4608 |
|
4609 |
|
4610 |
|
4611 |
|
4612 | function getAllKeys$1(object) {
|
4613 | return baseGetAllKeys(object, keys$2, getSymbols);
|
4614 | }
|
4615 |
|
4616 | var _getAllKeys = getAllKeys$1;
|
4617 |
|
4618 | var getAllKeys = _getAllKeys;
|
4619 |
|
4620 |
|
4621 | var COMPARE_PARTIAL_FLAG$4 = 1;
|
4622 |
|
4623 |
|
4624 | var objectProto$11 = Object.prototype;
|
4625 |
|
4626 |
|
4627 | var hasOwnProperty$9 = objectProto$11.hasOwnProperty;
|
4628 |
|
4629 |
|
4630 |
|
4631 |
|
4632 |
|
4633 |
|
4634 |
|
4635 |
|
4636 |
|
4637 |
|
4638 |
|
4639 |
|
4640 |
|
4641 |
|
4642 | function 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 |
|
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 |
|
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 |
|
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 |
|
4706 | var _equalObjects = equalObjects$1;
|
4707 |
|
4708 | var Stack$2 = _Stack;
|
4709 | var equalArrays = _equalArrays;
|
4710 | var equalByTag = _equalByTag;
|
4711 | var equalObjects = _equalObjects;
|
4712 | var getTag$2 = _getTag;
|
4713 | var isArray$11 = isArray_1;
|
4714 | var isBuffer$2 = isBuffer_1;
|
4715 | var isTypedArray$3 = isTypedArray_1;
|
4716 |
|
4717 |
|
4718 | var COMPARE_PARTIAL_FLAG$1 = 1;
|
4719 |
|
4720 |
|
4721 | var argsTag$2 = '[object Arguments]';
|
4722 | var arrayTag$1 = '[object Array]';
|
4723 | var objectTag$2 = '[object Object]';
|
4724 |
|
4725 |
|
4726 | var objectProto$10 = Object.prototype;
|
4727 |
|
4728 |
|
4729 | var hasOwnProperty$8 = objectProto$10.hasOwnProperty;
|
4730 |
|
4731 |
|
4732 |
|
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 |
|
4739 |
|
4740 |
|
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 | function 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 |
|
4790 | var _baseIsEqualDeep = baseIsEqualDeep$1;
|
4791 |
|
4792 | var baseIsEqualDeep = _baseIsEqualDeep;
|
4793 | var isObjectLike$5 = isObjectLike_1;
|
4794 |
|
4795 |
|
4796 |
|
4797 |
|
4798 |
|
4799 |
|
4800 |
|
4801 |
|
4802 |
|
4803 |
|
4804 |
|
4805 |
|
4806 |
|
4807 |
|
4808 |
|
4809 | function 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 |
|
4819 | var _baseIsEqual = baseIsEqual$1;
|
4820 |
|
4821 | var Stack = _Stack;
|
4822 | var baseIsEqual = _baseIsEqual;
|
4823 |
|
4824 |
|
4825 | var COMPARE_PARTIAL_FLAG = 1;
|
4826 | var COMPARE_UNORDERED_FLAG = 2;
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 |
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 | function 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 |
|
4882 | var _baseIsMatch = baseIsMatch$1;
|
4883 |
|
4884 | var isObject$3 = isObject_1;
|
4885 |
|
4886 |
|
4887 |
|
4888 |
|
4889 |
|
4890 |
|
4891 |
|
4892 |
|
4893 |
|
4894 | function isStrictComparable$1(value) {
|
4895 | return value === value && !isObject$3(value);
|
4896 | }
|
4897 |
|
4898 | var _isStrictComparable = isStrictComparable$1;
|
4899 |
|
4900 | var isStrictComparable = _isStrictComparable;
|
4901 | var keys$3 = keys_1;
|
4902 |
|
4903 |
|
4904 |
|
4905 |
|
4906 |
|
4907 |
|
4908 |
|
4909 |
|
4910 | function 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 |
|
4923 | var _getMatchData = getMatchData$1;
|
4924 |
|
4925 |
|
4926 |
|
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 |
|
4932 |
|
4933 |
|
4934 | function 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 |
|
4944 | var _matchesStrictComparable = matchesStrictComparable$1;
|
4945 |
|
4946 | var baseIsMatch = _baseIsMatch;
|
4947 | var getMatchData = _getMatchData;
|
4948 | var matchesStrictComparable = _matchesStrictComparable;
|
4949 |
|
4950 |
|
4951 |
|
4952 |
|
4953 |
|
4954 |
|
4955 |
|
4956 |
|
4957 | function 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 |
|
4967 | var _baseMatches = baseMatches$1;
|
4968 |
|
4969 |
|
4970 |
|
4971 |
|
4972 |
|
4973 |
|
4974 |
|
4975 |
|
4976 |
|
4977 | function baseHasIn$1(object, key) {
|
4978 | return object != null && key in Object(object);
|
4979 | }
|
4980 |
|
4981 | var _baseHasIn = baseHasIn$1;
|
4982 |
|
4983 | var castPath$2 = _castPath;
|
4984 | var isArguments$4 = isArguments_1;
|
4985 | var isArray$13 = isArray_1;
|
4986 | var isIndex$2 = _isIndex;
|
4987 | var isLength$3 = isLength_1;
|
4988 | var toKey$3 = _toKey;
|
4989 |
|
4990 |
|
4991 |
|
4992 |
|
4993 |
|
4994 |
|
4995 |
|
4996 |
|
4997 |
|
4998 |
|
4999 | function 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 |
|
5021 | var _hasPath = hasPath$1;
|
5022 |
|
5023 | var baseHasIn = _baseHasIn;
|
5024 | var hasPath = _hasPath;
|
5025 |
|
5026 |
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 |
|
5032 |
|
5033 |
|
5034 |
|
5035 |
|
5036 |
|
5037 |
|
5038 |
|
5039 |
|
5040 |
|
5041 |
|
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 |
|
5047 |
|
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 | function hasIn$1(object, path) {
|
5053 | return object != null && hasPath(object, path, baseHasIn);
|
5054 | }
|
5055 |
|
5056 | var hasIn_1 = hasIn$1;
|
5057 |
|
5058 | var baseIsEqual$2 = _baseIsEqual;
|
5059 | var get$2 = get_1;
|
5060 | var hasIn = hasIn_1;
|
5061 | var isKey$2 = _isKey;
|
5062 | var isStrictComparable$2 = _isStrictComparable;
|
5063 | var matchesStrictComparable$2 = _matchesStrictComparable;
|
5064 | var toKey$2 = _toKey;
|
5065 |
|
5066 | /** Used to compose bitmasks for value comparisons. */
|
5067 | var COMPARE_PARTIAL_FLAG$5 = 1;
|
5068 | var 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 | */
|
5078 | function 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 |
|
5090 | var _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 | *
|
5107 | */
|
5108 | function identity$1(value) {
|
5109 | return value;
|
5110 | }
|
5111 |
|
5112 | var identity_1 = identity$1;
|
5113 |
|
5114 |
|
5115 |
|
5116 |
|
5117 |
|
5118 |
|
5119 |
|
5120 |
|
5121 | function baseProperty$1(key) {
|
5122 | return function(object) {
|
5123 | return object == null ? undefined : object[key];
|
5124 | };
|
5125 | }
|
5126 |
|
5127 | var _baseProperty = baseProperty$1;
|
5128 |
|
5129 | var baseGet$2 = _baseGet;
|
5130 |
|
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 |
|
5138 | function basePropertyDeep$1(path) {
|
5139 | return function(object) {
|
5140 | return baseGet$2(object, path);
|
5141 | };
|
5142 | }
|
5143 |
|
5144 | var _basePropertyDeep = basePropertyDeep$1;
|
5145 |
|
5146 | var baseProperty = _baseProperty;
|
5147 | var basePropertyDeep = _basePropertyDeep;
|
5148 | var isKey$3 = _isKey;
|
5149 | var toKey$4 = _toKey;
|
5150 |
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 |
|
5163 |
|
5164 |
|
5165 |
|
5166 |
|
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 | function property$1(path) {
|
5174 | return isKey$3(path) ? baseProperty(toKey$4(path)) : basePropertyDeep(path);
|
5175 | }
|
5176 |
|
5177 | var property_1 = property$1;
|
5178 |
|
5179 | var baseMatches = _baseMatches;
|
5180 | var baseMatchesProperty = _baseMatchesProperty;
|
5181 | var identity = identity_1;
|
5182 | var isArray$10 = isArray_1;
|
5183 | var property = property_1;
|
5184 |
|
5185 |
|
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 |
|
5191 |
|
5192 | function baseIteratee$1(value) {
|
5193 |
|
5194 |
|
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 |
|
5209 | var _baseIteratee = baseIteratee$1;
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 | function 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 |
|
5235 | var _createBaseFor = createBaseFor$1;
|
5236 |
|
5237 | var createBaseFor = _createBaseFor;
|
5238 |
|
5239 |
|
5240 |
|
5241 |
|
5242 |
|
5243 |
|
5244 |
|
5245 |
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 | var baseFor$1 = createBaseFor();
|
5251 |
|
5252 | var _baseFor = baseFor$1;
|
5253 |
|
5254 | var baseFor = _baseFor;
|
5255 | var keys$4 = keys_1;
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 | function baseForOwn$1(object, iteratee) {
|
5266 | return object && baseFor(object, iteratee, keys$4);
|
5267 | }
|
5268 |
|
5269 | var _baseForOwn = baseForOwn$1;
|
5270 |
|
5271 | var isArrayLike$4 = isArrayLike_1;
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 |
|
5277 |
|
5278 |
|
5279 |
|
5280 |
|
5281 | function 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 |
|
5302 | var _createBaseEach = createBaseEach$1;
|
5303 |
|
5304 | var baseForOwn = _baseForOwn;
|
5305 | var createBaseEach = _createBaseEach;
|
5306 |
|
5307 |
|
5308 |
|
5309 |
|
5310 |
|
5311 |
|
5312 |
|
5313 |
|
5314 |
|
5315 | var baseEach$1 = createBaseEach(baseForOwn);
|
5316 |
|
5317 | var _baseEach = baseEach$1;
|
5318 |
|
5319 | var baseEach = _baseEach;
|
5320 | var isArrayLike$3 = isArrayLike_1;
|
5321 |
|
5322 |
|
5323 |
|
5324 |
|
5325 |
|
5326 |
|
5327 |
|
5328 |
|
5329 |
|
5330 | function 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 |
|
5340 | var _baseMap = baseMap$1;
|
5341 |
|
5342 | var arrayMap$3 = _arrayMap;
|
5343 | var baseIteratee = _baseIteratee;
|
5344 | var baseMap = _baseMap;
|
5345 | var isArray$9 = isArray_1;
|
5346 |
|
5347 |
|
5348 |
|
5349 |
|
5350 |
|
5351 |
|
5352 |
|
5353 |
|
5354 |
|
5355 |
|
5356 |
|
5357 |
|
5358 |
|
5359 |
|
5360 |
|
5361 |
|
5362 |
|
5363 |
|
5364 |
|
5365 |
|
5366 |
|
5367 |
|
5368 |
|
5369 |
|
5370 |
|
5371 |
|
5372 |
|
5373 |
|
5374 |
|
5375 |
|
5376 |
|
5377 |
|
5378 |
|
5379 |
|
5380 |
|
5381 |
|
5382 |
|
5383 |
|
5384 |
|
5385 |
|
5386 |
|
5387 |
|
5388 |
|
5389 | function map(collection, iteratee) {
|
5390 | var func = isArray$9(collection) ? arrayMap$3 : baseMap;
|
5391 | return func(collection, baseIteratee(iteratee, 3));
|
5392 | }
|
5393 |
|
5394 | var map_1 = map;
|
5395 |
|
5396 | var name$8 = 'post';
|
5397 | var pluralName$8 = 'posts';
|
5398 |
|
5399 | var defaultProperties$7 = ['id', 'body', 'artifact_id'];
|
5400 |
|
5401 | var post = Object.freeze({
|
5402 | name: name$8,
|
5403 | pluralName: pluralName$8,
|
5404 | defaultProperties: defaultProperties$7
|
5405 | });
|
5406 |
|
5407 | var name$7 = 'feedPost';
|
5408 | var pluralName$7 = 'feedPosts';
|
5409 | function 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 |
|
5429 | function 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 |
|
5443 | var feedPost = Object.freeze({
|
5444 | name: name$7,
|
5445 | pluralName: pluralName$7,
|
5446 | defaultProperties: defaultProperties$7,
|
5447 | getMany: getMany,
|
5448 | extractMany: extractMany
|
5449 | });
|
5450 |
|
5451 | var name$9 = 'growthAction';
|
5452 | var pluralName$9 = 'growthActions';
|
5453 |
|
5454 | var 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 |
|
5456 | var growthAction = Object.freeze({
|
5457 | name: name$9,
|
5458 | pluralName: pluralName$9,
|
5459 | defaultProperties: defaultProperties$8
|
5460 | });
|
5461 |
|
5462 | var name$10 = 'growthRelationship';
|
5463 | var pluralName$10 = 'growthRelationships';
|
5464 |
|
5465 | var defaultProperties$9 = ['id', 'owner_type', 'owner.id', 'owner.name', 'growee.id', 'growee.name', 'agent.id', 'agent.name'];
|
5466 |
|
5467 | var growthRelationship = Object.freeze({
|
5468 | name: name$10,
|
5469 | pluralName: pluralName$10,
|
5470 | defaultProperties: defaultProperties$9
|
5471 | });
|
5472 |
|
5473 | var name$11 = 'growthAgentPrompt';
|
5474 | var pluralName$11 = 'growthAgentPrompts';
|
5475 |
|
5476 | var 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 |
|
5478 | var growthAgentPrompt = Object.freeze({
|
5479 | name: name$11,
|
5480 | pluralName: pluralName$11,
|
5481 | defaultProperties: defaultProperties$10
|
5482 | });
|
5483 |
|
5484 | var name$12 = 'growthAgentResponse';
|
5485 | var pluralName$12 = 'growthAgentResponses';
|
5486 |
|
5487 | var defaultProperties$11 = ['id', 'message'];
|
5488 |
|
5489 | var growthAgentResponse = Object.freeze({
|
5490 | name: name$12,
|
5491 | pluralName: pluralName$12,
|
5492 | defaultProperties: defaultProperties$11
|
5493 | });
|
5494 |
|
5495 | var name$13 = 'license';
|
5496 | var pluralName$13 = 'licenses';
|
5497 |
|
5498 | var defaultProperties$12 = ['id', 'updated_at'];
|
5499 |
|
5500 | var license = Object.freeze({
|
5501 | name: name$13,
|
5502 | pluralName: pluralName$13,
|
5503 | defaultProperties: defaultProperties$12
|
5504 | });
|
5505 |
|
5506 | var name$14 = 'licensedCohort';
|
5507 | var pluralName$14 = 'licensedCohorts';
|
5508 |
|
5509 | var defaultProperties$13 = ['id', 'updated_at'];
|
5510 |
|
5511 | var licensedCohort = Object.freeze({
|
5512 | name: name$14,
|
5513 | pluralName: pluralName$14,
|
5514 | defaultProperties: defaultProperties$13
|
5515 | });
|
5516 |
|
5517 | var name$15 = 'licensedContentItem';
|
5518 | var pluralName$15 = 'licensedContentItems';
|
5519 |
|
5520 | var defaultProperties$14 = ['id', 'updated_at'];
|
5521 |
|
5522 | var licensedContentItem = Object.freeze({
|
5523 | name: name$15,
|
5524 | pluralName: pluralName$15,
|
5525 | defaultProperties: defaultProperties$14
|
5526 | });
|
5527 |
|
5528 | var name$16 = 'moment';
|
5529 | var pluralName$16 = 'moments';
|
5530 |
|
5531 | var 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 |
|
5533 | var moment = Object.freeze({
|
5534 | name: name$16,
|
5535 | pluralName: pluralName$16,
|
5536 | defaultProperties: defaultProperties$15
|
5537 | });
|
5538 |
|
5539 | var name$17 = 'myGrowthAgentPrompt';
|
5540 | var pluralName$17 = 'myGrowthAgentPrompts';
|
5541 |
|
5542 | var 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 |
|
5544 | function 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 |
|
5564 | function 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 |
|
5578 | var 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 |
|
5588 |
|
5589 |
|
5590 |
|
5591 |
|
5592 |
|
5593 |
|
5594 |
|
5595 |
|
5596 |
|
5597 |
|
5598 |
|
5599 |
|
5600 |
|
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 |
|
5606 | function isNil(value) {
|
5607 | return value == null;
|
5608 | }
|
5609 |
|
5610 | var isNil_1 = isNil;
|
5611 |
|
5612 | var name$19 = 'review';
|
5613 | var pluralName$19 = 'reviews';
|
5614 |
|
5615 | var defaultProperties$17 = ['id', 'rating'];
|
5616 |
|
5617 | var review = Object.freeze({
|
5618 | name: name$19,
|
5619 | pluralName: pluralName$19,
|
5620 | defaultProperties: defaultProperties$17
|
5621 | });
|
5622 |
|
5623 | var name$20 = 'tree';
|
5624 | var pluralName$20 = 'trees';
|
5625 |
|
5626 | var treeEntity = Object.freeze({
|
5627 | name: name$20,
|
5628 | pluralName: pluralName$20
|
5629 | });
|
5630 |
|
5631 |
|
5632 |
|
5633 |
|
5634 |
|
5635 |
|
5636 |
|
5637 | var name$18 = 'myTreeReview';
|
5638 | var pluralName$18 = 'myTreeReviews';
|
5639 | function 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 |
|
5660 | function 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 |
|
5675 | var myTreeReview = Object.freeze({
|
5676 | name: name$18,
|
5677 | pluralName: pluralName$18,
|
5678 | defaultProperties: defaultProperties$17,
|
5679 | getOne: getOne,
|
5680 | extractOne: extractOne
|
5681 | });
|
5682 |
|
5683 | var name$21 = 'note';
|
5684 | var pluralName$21 = 'notes';
|
5685 |
|
5686 | var defaultProperties$18 = ['id', 'body'];
|
5687 |
|
5688 | var note = Object.freeze({
|
5689 | name: name$21,
|
5690 | pluralName: pluralName$21,
|
5691 | defaultProperties: defaultProperties$18
|
5692 | });
|
5693 |
|
5694 | var name$22 = 'progressItem';
|
5695 | var pluralName$22 = 'progressItems';
|
5696 |
|
5697 | var defaultProperties$19 = ['id', 'action', 'title', 'description', 'completed', 'hidden', 'assigner_type', 'linkable_type', 'updated_at', 'date_due'];
|
5698 |
|
5699 | var progressItem = Object.freeze({
|
5700 | name: name$22,
|
5701 | pluralName: pluralName$22,
|
5702 | defaultProperties: defaultProperties$19
|
5703 | });
|
5704 |
|
5705 | var name$23 = 'space';
|
5706 | var pluralName$23 = 'spaces';
|
5707 |
|
5708 | var defaultProperties$20 = ['id', 'name', 'topic', 'champion_id'];
|
5709 |
|
5710 | var space = Object.freeze({
|
5711 | name: name$23,
|
5712 | pluralName: pluralName$23,
|
5713 | defaultProperties: defaultProperties$20
|
5714 | });
|
5715 |
|
5716 | var name$24 = 'timeline';
|
5717 | var pluralName$24 = 'timelines';
|
5718 |
|
5719 | var timeline = Object.freeze({
|
5720 | name: name$24,
|
5721 | pluralName: pluralName$24
|
5722 | });
|
5723 |
|
5724 | var name$25 = 'toDoItem';
|
5725 | var pluralName$25 = 'toDoItems';
|
5726 |
|
5727 | var defaultProperties$21 = ['id', 'title', 'description', 'action', 'date_due'];
|
5728 |
|
5729 | var toDoItem = Object.freeze({
|
5730 | name: name$25,
|
5731 | pluralName: pluralName$25,
|
5732 | defaultProperties: defaultProperties$21
|
5733 | });
|
5734 |
|
5735 | var name$26 = 'toDoList';
|
5736 | var pluralName$26 = 'toDoLists';
|
5737 |
|
5738 | var defaultProperties$22 = ['id', 'name', 'created_at', 'updated_at'];
|
5739 |
|
5740 | var toDoList = Object.freeze({
|
5741 | name: name$26,
|
5742 | pluralName: pluralName$26,
|
5743 | defaultProperties: defaultProperties$22
|
5744 | });
|
5745 |
|
5746 | var name$27 = 'topic';
|
5747 | var pluralName$27 = 'topics';
|
5748 |
|
5749 | var defaultProperties$23 = ['id', 'name'];
|
5750 |
|
5751 | var topic = Object.freeze({
|
5752 | name: name$27,
|
5753 | pluralName: pluralName$27,
|
5754 | defaultProperties: defaultProperties$23
|
5755 | });
|
5756 |
|
5757 | var name$28 = 'tourTipView';
|
5758 | var pluralName$28 = 'tourTipViews';
|
5759 |
|
5760 | var defaultProperties$24 = ['id', 'state'];
|
5761 |
|
5762 | function 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 |
|
5782 | function 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 |
|
5796 | var 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 |
|
5804 | var name$29 = 'user';
|
5805 | var pluralName$29 = 'users';
|
5806 |
|
5807 | var defaultProperties$25 = ['id', 'username', 'name'];
|
5808 |
|
5809 | var user = Object.freeze({
|
5810 | name: name$29,
|
5811 | pluralName: pluralName$29,
|
5812 | defaultProperties: defaultProperties$25
|
5813 | });
|
5814 |
|
5815 | var name$30 = 'userToDoList';
|
5816 | var pluralName$30 = 'userToDoLists';
|
5817 |
|
5818 | var defaultProperties$26 = ['id', 'name'];
|
5819 |
|
5820 | var userToDoList = Object.freeze({
|
5821 | name: name$30,
|
5822 | pluralName: pluralName$30,
|
5823 | defaultProperties: defaultProperties$26
|
5824 | });
|
5825 |
|
5826 | var name$31 = 'view';
|
5827 | var pluralName$31 = 'views';
|
5828 |
|
5829 | var defaultProperties$27 = ['id', 'viewable_id', 'viewable_type'];
|
5830 |
|
5831 | var view = Object.freeze({
|
5832 | name: name$31,
|
5833 | pluralName: pluralName$31,
|
5834 | defaultProperties: defaultProperties$27
|
5835 | });
|
5836 |
|
5837 |
|
5838 |
|
5839 | var 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 |
|
5907 |
|
5908 |
|
5909 |
|
5910 |
|
5911 |
|
5912 |
|
5913 |
|
5914 |
|
5915 |
|
5916 |
|
5917 |
|
5918 |
|
5919 |
|
5920 |
|
5921 |
|
5922 |
|
5923 |
|
5924 |
|
5925 |
|
5926 |
|
5927 |
|
5928 |
|
5929 |
|
5930 |
|
5931 | var isArray$14 = Array.isArray || function (xs) {
|
5932 | return Object.prototype.toString.call(xs) === '[object Array]';
|
5933 | };
|
5934 | function 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 |
|
5950 | function 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 |
|
5976 | function 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 |
|
5985 | var 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 |
|
5993 | var baseEach$2 = _baseEach;
|
5994 |
|
5995 |
|
5996 |
|
5997 |
|
5998 |
|
5999 |
|
6000 |
|
6001 |
|
6002 |
|
6003 | function 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 |
|
6013 | var _baseFilter = baseFilter$1;
|
6014 |
|
6015 | var arrayFilter$2 = _arrayFilter;
|
6016 | var baseFilter = _baseFilter;
|
6017 | var baseIteratee$2 = _baseIteratee;
|
6018 | var isArray$15 = isArray_1;
|
6019 |
|
6020 |
|
6021 |
|
6022 |
|
6023 |
|
6024 |
|
6025 |
|
6026 |
|
6027 |
|
6028 |
|
6029 |
|
6030 |
|
6031 |
|
6032 |
|
6033 |
|
6034 |
|
6035 |
|
6036 |
|
6037 |
|
6038 |
|
6039 |
|
6040 |
|
6041 |
|
6042 |
|
6043 |
|
6044 |
|
6045 |
|
6046 |
|
6047 |
|
6048 |
|
6049 |
|
6050 |
|
6051 |
|
6052 |
|
6053 |
|
6054 |
|
6055 |
|
6056 |
|
6057 | function filter(collection, predicate) {
|
6058 | var func = isArray$15(collection) ? arrayFilter$2 : baseFilter;
|
6059 | return func(collection, baseIteratee$2(predicate, 3));
|
6060 | }
|
6061 |
|
6062 | var filter_1 = filter;
|
6063 |
|
6064 | var entitySrc = 'entities';
|
6065 |
|
6066 | function 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 |
|
6071 | function entityMustExportError(entityName, property) {
|
6072 | var filename = entityNameToFilename(entityName);
|
6073 | return new Error(entitySrc + '/' + filename + ' must export ' + property);
|
6074 | }
|
6075 |
|
6076 | function optionsMustHaveError(property) {
|
6077 | return new Error('options.' + property + ' is required');
|
6078 | }
|
6079 |
|
6080 | function entityExports(entity, property) {
|
6081 | return !isNil_1(entity[property]);
|
6082 | }
|
6083 |
|
6084 |
|
6085 |
|
6086 | function optionsHas(options, property) {
|
6087 | return !isNil_1(get_1(options, property));
|
6088 | }
|
6089 |
|
6090 | function _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 |
|
6092 | function 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 |
|
6120 | function 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 |
|
6130 | function 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 |
|
6187 | function 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 |
|
6222 | function 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 |
|
6258 | function 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 |
|
6277 | function 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 |
|
6313 | function 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 |
|
6332 | function 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 |
|
6385 | function 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 |
|
6397 | function 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 |
|
6414 | function 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 |
|
6446 | function 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 |
|
6456 | function 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 |
|
6473 | function 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 |
|
6497 |
|
6498 |
|
6499 |
|
6500 |
|
6501 |
|
6502 |
|
6503 |
|
6504 | function 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 |
|
6516 | var _arrayEach = arrayEach$1;
|
6517 |
|
6518 | var identity$2 = identity_1;
|
6519 |
|
6520 |
|
6521 |
|
6522 |
|
6523 |
|
6524 |
|
6525 |
|
6526 |
|
6527 | function castFunction$1(value) {
|
6528 | return typeof value == 'function' ? value : identity$2;
|
6529 | }
|
6530 |
|
6531 | var _castFunction = castFunction$1;
|
6532 |
|
6533 | var arrayEach = _arrayEach;
|
6534 | var baseEach$3 = _baseEach;
|
6535 | var castFunction = _castFunction;
|
6536 | var isArray$16 = isArray_1;
|
6537 |
|
6538 |
|
6539 |
|
6540 |
|
6541 |
|
6542 |
|
6543 |
|
6544 |
|
6545 |
|
6546 |
|
6547 |
|
6548 |
|
6549 |
|
6550 |
|
6551 |
|
6552 |
|
6553 |
|
6554 |
|
6555 |
|
6556 |
|
6557 |
|
6558 |
|
6559 |
|
6560 |
|
6561 |
|
6562 |
|
6563 |
|
6564 |
|
6565 |
|
6566 |
|
6567 |
|
6568 | function forEach(collection, iteratee) {
|
6569 | var func = isArray$16(collection) ? arrayEach : baseEach$3;
|
6570 | return func(collection, castFunction(iteratee));
|
6571 | }
|
6572 |
|
6573 | var forEach_1 = forEach;
|
6574 |
|
6575 | var overArg$2 = _overArg;
|
6576 |
|
6577 |
|
6578 | var getPrototype$1 = overArg$2(Object.getPrototypeOf, Object);
|
6579 |
|
6580 | var _getPrototype = getPrototype$1;
|
6581 |
|
6582 | var baseGetTag$7 = _baseGetTag;
|
6583 | var getPrototype = _getPrototype;
|
6584 | var isObjectLike$7 = isObjectLike_1;
|
6585 |
|
6586 |
|
6587 | var objectTag$3 = '[object Object]';
|
6588 |
|
6589 |
|
6590 | var funcProto$2 = Function.prototype;
|
6591 | var objectProto$13 = Object.prototype;
|
6592 |
|
6593 |
|
6594 | var funcToString$2 = funcProto$2.toString;
|
6595 |
|
6596 |
|
6597 | var hasOwnProperty$11 = objectProto$13.hasOwnProperty;
|
6598 |
|
6599 |
|
6600 | var objectCtorString = funcToString$2.call(Object);
|
6601 |
|
6602 |
|
6603 |
|
6604 |
|
6605 |
|
6606 |
|
6607 |
|
6608 |
|
6609 |
|
6610 |
|
6611 |
|
6612 |
|
6613 |
|
6614 |
|
6615 |
|
6616 |
|
6617 |
|
6618 |
|
6619 |
|
6620 |
|
6621 |
|
6622 |
|
6623 |
|
6624 |
|
6625 |
|
6626 |
|
6627 |
|
6628 |
|
6629 |
|
6630 | function 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 |
|
6643 | var isPlainObject_1 = isPlainObject$1;
|
6644 |
|
6645 | var baseGetTag$6 = _baseGetTag;
|
6646 | var isObjectLike$6 = isObjectLike_1;
|
6647 | var isPlainObject = isPlainObject_1;
|
6648 |
|
6649 |
|
6650 | var domExcTag = '[object DOMException]';
|
6651 | var errorTag$2 = '[object Error]';
|
6652 |
|
6653 |
|
6654 |
|
6655 |
|
6656 |
|
6657 |
|
6658 |
|
6659 |
|
6660 |
|
6661 |
|
6662 |
|
6663 |
|
6664 |
|
6665 |
|
6666 |
|
6667 |
|
6668 |
|
6669 |
|
6670 |
|
6671 | function 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 |
|
6680 | var isError_1 = isError;
|
6681 |
|
6682 |
|
6683 |
|
6684 |
|
6685 |
|
6686 |
|
6687 |
|
6688 |
|
6689 |
|
6690 |
|
6691 |
|
6692 |
|
6693 |
|
6694 |
|
6695 |
|
6696 | function last(array) {
|
6697 | var length = array == null ? 0 : array.length;
|
6698 | return length ? array[length - 1] : undefined;
|
6699 | }
|
6700 |
|
6701 | var last_1 = last;
|
6702 |
|
6703 | var isIndex$3 = _isIndex;
|
6704 |
|
6705 |
|
6706 |
|
6707 |
|
6708 |
|
6709 |
|
6710 |
|
6711 |
|
6712 |
|
6713 | function 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 |
|
6722 | var _baseNth = baseNth$1;
|
6723 |
|
6724 | var isObject$4 = isObject_1;
|
6725 | var isSymbol$4 = isSymbol_1;
|
6726 |
|
6727 |
|
6728 | var NAN = 0 / 0;
|
6729 |
|
6730 |
|
6731 | var reTrim = /^\s+|\s+$/g;
|
6732 |
|
6733 |
|
6734 | var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
6735 |
|
6736 |
|
6737 | var reIsBinary = /^0b[01]+$/i;
|
6738 |
|
6739 |
|
6740 | var reIsOctal = /^0o[0-7]+$/i;
|
6741 |
|
6742 |
|
6743 | var freeParseInt = parseInt;
|
6744 |
|
6745 |
|
6746 |
|
6747 |
|
6748 |
|
6749 |
|
6750 |
|
6751 |
|
6752 |
|
6753 |
|
6754 |
|
6755 |
|
6756 |
|
6757 |
|
6758 |
|
6759 |
|
6760 |
|
6761 |
|
6762 |
|
6763 |
|
6764 |
|
6765 |
|
6766 |
|
6767 |
|
6768 | function 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 |
|
6789 | var toNumber_1 = toNumber$1;
|
6790 |
|
6791 | var toNumber = toNumber_1;
|
6792 |
|
6793 |
|
6794 | var INFINITY$3 = 1 / 0;
|
6795 | var MAX_INTEGER = 1.7976931348623157e+308;
|
6796 |
|
6797 |
|
6798 |
|
6799 |
|
6800 |
|
6801 |
|
6802 |
|
6803 |
|
6804 |
|
6805 |
|
6806 |
|
6807 |
|
6808 |
|
6809 |
|
6810 |
|
6811 |
|
6812 |
|
6813 |
|
6814 |
|
6815 |
|
6816 |
|
6817 |
|
6818 |
|
6819 |
|
6820 | function 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 |
|
6832 | var toFinite_1 = toFinite$1;
|
6833 |
|
6834 | var toFinite = toFinite_1;
|
6835 |
|
6836 |
|
6837 |
|
6838 |
|
6839 |
|
6840 |
|
6841 |
|
6842 |
|
6843 |
|
6844 |
|
6845 |
|
6846 |
|
6847 |
|
6848 |
|
6849 |
|
6850 |
|
6851 |
|
6852 |
|
6853 |
|
6854 |
|
6855 |
|
6856 |
|
6857 |
|
6858 |
|
6859 |
|
6860 |
|
6861 |
|
6862 | function toInteger$1(value) {
|
6863 | var result = toFinite(value),
|
6864 | remainder = result % 1;
|
6865 |
|
6866 | return result === result ? (remainder ? result - remainder : result) : 0;
|
6867 | }
|
6868 |
|
6869 | var toInteger_1 = toInteger$1;
|
6870 |
|
6871 | var baseNth = _baseNth;
|
6872 | var toInteger = toInteger_1;
|
6873 |
|
6874 |
|
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 |
|
6881 |
|
6882 |
|
6883 |
|
6884 |
|
6885 |
|
6886 |
|
6887 |
|
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 |
|
6893 |
|
6894 |
|
6895 | function nth(array, n) {
|
6896 | return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
|
6897 | }
|
6898 |
|
6899 | var nth_1 = nth;
|
6900 |
|
6901 | var baseEach$4 = _baseEach;
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 |
|
6910 |
|
6911 |
|
6912 | function 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 |
|
6922 | var _baseSome = baseSome$1;
|
6923 |
|
6924 | var eq$3 = eq_1;
|
6925 | var isArrayLike$5 = isArrayLike_1;
|
6926 | var isIndex$4 = _isIndex;
|
6927 | var isObject$5 = isObject_1;
|
6928 |
|
6929 |
|
6930 |
|
6931 |
|
6932 |
|
6933 |
|
6934 |
|
6935 |
|
6936 |
|
6937 |
|
6938 |
|
6939 | function 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 |
|
6953 | var _isIterateeCall = isIterateeCall$1;
|
6954 |
|
6955 | var arraySome$2 = _arraySome;
|
6956 | var baseIteratee$3 = _baseIteratee;
|
6957 | var baseSome = _baseSome;
|
6958 | var isArray$17 = isArray_1;
|
6959 | var isIterateeCall = _isIterateeCall;
|
6960 |
|
6961 |
|
6962 |
|
6963 |
|
6964 |
|
6965 |
|
6966 |
|
6967 |
|
6968 |
|
6969 |
|
6970 |
|
6971 |
|
6972 |
|
6973 |
|
6974 |
|
6975 |
|
6976 |
|
6977 |
|
6978 |
|
6979 |
|
6980 |
|
6981 |
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 |
|
6987 |
|
6988 |
|
6989 |
|
6990 |
|
6991 |
|
6992 |
|
6993 |
|
6994 |
|
6995 |
|
6996 |
|
6997 | function 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 |
|
7005 | var some_1 = some;
|
7006 |
|
7007 | var _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 |
|
7009 | function _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 |
|
7011 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
7012 |
|
7013 | var 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 |
|
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 |
|
7292 | var 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 |
|
7301 | function 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 |
|
7319 | function 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 |
|
7336 | function 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 |
|
7353 | function 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 |
|
7370 | function 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 |
|
7396 | function 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 |
|
7414 | function 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 |
|
7432 | return SuperGloo;
|
7433 |
|
7434 | })));
|