@quintype/arrow 3.15.1-perf.3 → 3.15.1-perf.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atoms/Author/index.js +14 -2103
- package/atoms/Author/styles.arrow.css +1 -1
- package/atoms/AuthorWithTime/index.js +32 -2482
- package/atoms/AuthorWithTime/styles.arrow.css +1 -1
- package/atoms/CollectionName/index.js +12 -2101
- package/atoms/CollectionName/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/{index-b22f1843.js → index-0f809dd9.js} +10 -7
- package/atoms/ExtendedLoadMore/index-142f015c.js +476 -0
- package/atoms/ExtendedLoadMore/{index-bc129cb8.js → index-37a9ccff.js} +18 -10
- package/atoms/ExtendedLoadMore/{index-6e083738.js → index-446679c8.js} +20 -12
- package/atoms/ExtendedLoadMore/{index-9e0d32b7.js → index-44f97338.js} +19 -9
- package/atoms/ExtendedLoadMore/{index-b5936059.js → index-57dd4870.js} +15 -7
- package/atoms/ExtendedLoadMore/{index-fee73a14.js → index-66dd4dbd.js} +15 -7
- package/atoms/ExtendedLoadMore/{index-5c8eda4a.js → index-8462c597.js} +21 -16
- package/atoms/ExtendedLoadMore/{index-3c4ac692.js → index-93cb06d1.js} +42 -51
- package/atoms/ExtendedLoadMore/{index-4ddfe28d.js → index-afd44863.js} +6 -4
- package/atoms/ExtendedLoadMore/{index-3976fac4.js → index-b5754c5d.js} +20 -14
- package/atoms/ExtendedLoadMore/{index-a5c95f84.js → index-bbaf526e.js} +16 -8
- package/atoms/ExtendedLoadMore/{index-6ecceae4.js → index-cfb262ef.js} +18 -9
- package/atoms/ExtendedLoadMore/index.js +8 -1
- package/atoms/ExtendedLoadMore/styles.arrow.css +1 -1
- package/atoms/Headline/index.js +14 -2103
- package/atoms/Headline/styles.arrow.css +1 -1
- package/atoms/HeroImage/index.js +22 -2170
- package/atoms/HeroImage/styles.arrow.css +1 -1
- package/atoms/LoadmoreButton/index.js +12 -2114
- package/atoms/LoadmoreButton/styles.arrow.css +1 -1
- package/atoms/ScrollSnap/index.js +17 -2178
- package/atoms/ScrollSnap/styles.arrow.css +1 -1
- package/atoms/SectionTag/index.js +10 -2099
- package/atoms/SectionTag/styles.arrow.css +1 -1
- package/atoms/Subheadline/index.js +8 -2097
- package/atoms/Subheadline/styles.arrow.css +1 -1
- package/atoms/TimeStamp/index.js +13 -2463
- package/atoms/TimeStamp/styles.arrow.css +1 -1
- package/molecules/KeyEvents/index.js +23 -2545
- package/molecules/KeyEvents/styles.arrow.css +1 -1
- package/molecules/PageIntroductionCard/index.js +17 -2454
- package/molecules/PageIntroductionCard/styles.arrow.css +1 -1
- package/molecules/SocialShareTemplate/index.js +144 -2740
- package/molecules/SocialShareTemplate/styles.arrow.css +1 -1
- package/molecules/StoryCard/index.js +64 -2582
- package/molecules/StoryCard/styles.arrow.css +1 -1
- package/molecules/StoryElementCard/index.js +123 -2893
- package/molecules/StoryElementCard/styles.arrow.css +1 -1
- package/molecules/StorycardContent/index.js +45 -2495
- package/molecules/StorycardContent/styles.arrow.css +1 -1
- package/package.json +1 -1
- package/rows/AlternateCollectionFilter/index.js +92 -2659
- package/rows/AlternateCollectionFilter/styles.arrow.css +1 -1
- package/rows/AsideCollection/index.js +92 -2659
- package/rows/AsideCollection/styles.arrow.css +1 -1
- package/rows/AstrologyCollection/index.js +89 -2656
- package/rows/AstrologyCollection/styles.arrow.css +1 -1
- package/rows/AuthorIntroductionCard/index.js +27 -2743
- package/rows/AuthorIntroductionCard/styles.arrow.css +1 -1
- package/rows/AuthorsList/index.js +34 -2763
- package/rows/AuthorsList/styles.arrow.css +1 -1
- package/rows/CollectionFilter/index.js +91 -2658
- package/rows/CollectionFilter/styles.arrow.css +1 -1
- package/rows/ElevenStories/index.js +81 -2612
- package/rows/ElevenStories/styles.arrow.css +1 -1
- package/rows/FourColFiveStories/index.js +75 -2603
- package/rows/FourColFiveStories/styles.arrow.css +1 -1
- package/rows/FourColGrid/index.js +92 -2623
- package/rows/FourColGrid/styles.arrow.css +1 -1
- package/rows/FourColPortraitStories/index.js +91 -2622
- package/rows/FourColPortraitStories/styles.arrow.css +1 -1
- package/rows/FourColSixteenStories/index.js +80 -2617
- package/rows/FourColSixteenStories/styles.arrow.css +1 -1
- package/rows/FourColTwelveStories/index.js +72 -2596
- package/rows/FourColTwelveStories/styles.arrow.css +1 -1
- package/rows/FourStorySlider/index.js +84 -2615
- package/rows/FourStorySlider/styles.arrow.css +1 -1
- package/rows/FourStorySliderPortrait/index.js +84 -2615
- package/rows/FourStorySliderPortrait/styles.arrow.css +1 -1
- package/rows/FourTabbedBigStorySlider/index.js +80 -2611
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +1 -1
- package/rows/FullScreenSlider/index.js +85 -2616
- package/rows/FullScreenSlider/styles.arrow.css +1 -1
- package/rows/HalfScreenSlider/index.js +81 -2612
- package/rows/HalfScreenSlider/styles.arrow.css +1 -1
- package/rows/ListComponent/index.js +75 -2606
- package/rows/ListComponent/styles.arrow.css +1 -1
- package/rows/Listicles/index.js +38 -2235
- package/rows/Listicles/styles.arrow.css +1 -1
- package/rows/MagazineEditions/index.js +24 -2487
- package/rows/MagazineEditions/styles.arrow.css +1 -1
- package/rows/MagazineHeaderCard/index.js +26 -2489
- package/rows/MagazineHeaderCard/styles.arrow.css +1 -1
- package/rows/MagazineWidget/index.js +81 -2612
- package/rows/MagazineWidget/styles.arrow.css +1 -1
- package/rows/OneColStoryList/index.js +92 -2623
- package/rows/OneColStoryList/styles.arrow.css +1 -1
- package/rows/OpinionCollection/index.js +61 -2583
- package/rows/OpinionCollection/styles.arrow.css +1 -1
- package/rows/SixColSixStories/index.js +91 -2622
- package/rows/SixColSixStories/styles.arrow.css +1 -1
- package/rows/StoryCollection/index.js +92 -2659
- package/rows/StoryCollection/styles.arrow.css +1 -1
- package/rows/TagIntroductionCard/index.js +9 -1816
- package/rows/TagIntroductionCard/styles.arrow.css +1 -1
- package/rows/ThreeColFlexStories/index.js +91 -2622
- package/rows/ThreeColFlexStories/styles.arrow.css +1 -1
- package/rows/ThreeColFourteenStories/index.js +72 -2596
- package/rows/ThreeColFourteenStories/styles.arrow.css +1 -1
- package/rows/ThreeColGrid/index.js +94 -2625
- package/rows/ThreeColGrid/styles.arrow.css +1 -1
- package/rows/ThreeColSevenStory/index.js +84 -2615
- package/rows/ThreeColSevenStory/styles.arrow.css +1 -1
- package/rows/ThreeColSixStories/index.js +76 -2607
- package/rows/ThreeColSixStories/styles.arrow.css +1 -1
- package/rows/ThreeColTwelveStories/index.js +80 -2617
- package/rows/ThreeColTwelveStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStories/index.js +78 -2609
- package/rows/TwoColFourStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStoryHighlight/index.js +80 -2617
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +1 -1
- package/rows/TwoColSevenStories/index.js +77 -2608
- package/rows/TwoColSevenStories/styles.arrow.css +1 -1
- package/rows/TwoColSixStories/index.js +82 -2619
- package/rows/TwoColSixStories/styles.arrow.css +1 -1
- package/rows/TwoColTenStoriesSidebar/index.js +79 -2610
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +1 -1
- package/rows/TwoColThreeStories/index.js +75 -2606
- package/rows/TwoColThreeStories/styles.arrow.css +1 -1
- package/story-elements/AlsoRead/index.js +24 -2170
- package/story-elements/AlsoRead/styles.arrow.css +1 -1
- package/story-elements/Attachment/index.js +15 -1870
- package/story-elements/Attachment/styles.arrow.css +1 -1
- package/story-elements/BigFact/index.js +16 -1871
- package/story-elements/BigFact/styles.arrow.css +1 -1
- package/story-elements/BlockQuote/index.js +20 -2157
- package/story-elements/BlockQuote/styles.arrow.css +1 -1
- package/story-elements/Blurb/index.js +18 -1932
- package/story-elements/Blurb/styles.arrow.css +1 -1
- package/story-elements/Image/index.js +42 -2251
- package/story-elements/Image/styles.arrow.css +1 -1
- package/story-elements/ImageGallery/index.js +45 -2254
- package/story-elements/ImageGallery/styles.arrow.css +1 -1
- package/story-elements/ImageSlideshow/index.js +48 -2257
- package/story-elements/ImageSlideshow/styles.arrow.css +1 -1
- package/story-elements/QuestionAnswer/index.js +26 -2163
- package/story-elements/QuestionAnswer/styles.arrow.css +1 -1
- package/story-elements/Quote/index.js +17 -1872
- package/story-elements/Quote/styles.arrow.css +1 -1
- package/story-elements/Reference/index.js +15 -1870
- package/story-elements/Reference/styles.arrow.css +1 -1
- package/story-elements/StoryElement/index.js +12 -1725
- package/story-elements/Summary/index.js +18 -1873
- package/story-elements/Summary/styles.arrow.css +1 -1
- package/story-elements/Text/index.js +16 -2153
- package/story-elements/Text/styles.arrow.css +1 -1
- package/story-elements/Video/index.js +12 -1725
- package/story-elements/Video/styles.arrow.css +1 -1
- package/story-templates/ListicleStoryTemplate/index.js +282 -3167
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +504 -3389
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/PhotoStoryTemplate/index.js +287 -3172
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/TextStoryTemplate/index.js +416 -3301
- package/story-templates/TextStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/VideoStoryTemplate/index.js +382 -3267
- package/story-templates/VideoStoryTemplate/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/index-e7cde739.js +0 -3051
|
@@ -2,2554 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _toArray = require('@babel/runtime/helpers/toArray');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var PropTypes = require('prop-types');
|
|
8
|
+
var lodash = require('lodash');
|
|
7
9
|
var components = require('@quintype/components');
|
|
10
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
8
12
|
var reactRedux = require('react-redux');
|
|
13
|
+
require('@babel/runtime/helpers/asyncToGenerator');
|
|
14
|
+
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
15
|
+
require('@babel/runtime/regenerator');
|
|
9
16
|
var Timeago = require('react-timeago');
|
|
10
17
|
var dateFnsTz = require('date-fns-tz');
|
|
11
18
|
|
|
12
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
20
|
|
|
21
|
+
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
14
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
23
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
25
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
26
|
+
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
16
27
|
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
17
28
|
|
|
18
|
-
function _arrayWithHoles(arr) {
|
|
19
|
-
if (Array.isArray(arr)) return arr;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function _iterableToArray(iter) {
|
|
23
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function _arrayLikeToArray(arr, len) {
|
|
27
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
28
|
-
|
|
29
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
30
|
-
arr2[i] = arr[i];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return arr2;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
37
|
-
if (!o) return;
|
|
38
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
39
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
40
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
41
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
42
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function _nonIterableRest() {
|
|
46
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function _toArray(arr) {
|
|
50
|
-
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Checks if `value` is classified as an `Array` object.
|
|
55
|
-
*
|
|
56
|
-
* @static
|
|
57
|
-
* @memberOf _
|
|
58
|
-
* @since 0.1.0
|
|
59
|
-
* @category Lang
|
|
60
|
-
* @param {*} value The value to check.
|
|
61
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
62
|
-
* @example
|
|
63
|
-
*
|
|
64
|
-
* _.isArray([1, 2, 3]);
|
|
65
|
-
* // => true
|
|
66
|
-
*
|
|
67
|
-
* _.isArray(document.body.children);
|
|
68
|
-
* // => false
|
|
69
|
-
*
|
|
70
|
-
* _.isArray('abc');
|
|
71
|
-
* // => false
|
|
72
|
-
*
|
|
73
|
-
* _.isArray(_.noop);
|
|
74
|
-
* // => false
|
|
75
|
-
*/
|
|
76
|
-
var isArray = Array.isArray;
|
|
77
|
-
|
|
78
|
-
var isArray_1 = isArray;
|
|
79
|
-
|
|
80
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
81
|
-
|
|
82
|
-
function getDefaultExportFromCjs (x) {
|
|
83
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function createCommonjsModule(fn) {
|
|
87
|
-
var module = { exports: {} };
|
|
88
|
-
return fn(module, module.exports), module.exports;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** Detect free variable `global` from Node.js. */
|
|
92
|
-
|
|
93
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
94
|
-
|
|
95
|
-
var _freeGlobal = freeGlobal;
|
|
96
|
-
|
|
97
|
-
/** Detect free variable `self`. */
|
|
98
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
99
|
-
|
|
100
|
-
/** Used as a reference to the global object. */
|
|
101
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
102
|
-
|
|
103
|
-
var _root = root;
|
|
104
|
-
|
|
105
|
-
/** Built-in value references. */
|
|
106
|
-
var Symbol$1 = _root.Symbol;
|
|
107
|
-
|
|
108
|
-
var _Symbol = Symbol$1;
|
|
109
|
-
|
|
110
|
-
/** Used for built-in method references. */
|
|
111
|
-
var objectProto$4 = Object.prototype;
|
|
112
|
-
|
|
113
|
-
/** Used to check objects for own properties. */
|
|
114
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Used to resolve the
|
|
118
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
119
|
-
* of values.
|
|
120
|
-
*/
|
|
121
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
122
|
-
|
|
123
|
-
/** Built-in value references. */
|
|
124
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
128
|
-
*
|
|
129
|
-
* @private
|
|
130
|
-
* @param {*} value The value to query.
|
|
131
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
132
|
-
*/
|
|
133
|
-
function getRawTag(value) {
|
|
134
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
135
|
-
tag = value[symToStringTag$1];
|
|
136
|
-
|
|
137
|
-
try {
|
|
138
|
-
value[symToStringTag$1] = undefined;
|
|
139
|
-
var unmasked = true;
|
|
140
|
-
} catch (e) {}
|
|
141
|
-
|
|
142
|
-
var result = nativeObjectToString$1.call(value);
|
|
143
|
-
if (unmasked) {
|
|
144
|
-
if (isOwn) {
|
|
145
|
-
value[symToStringTag$1] = tag;
|
|
146
|
-
} else {
|
|
147
|
-
delete value[symToStringTag$1];
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return result;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
var _getRawTag = getRawTag;
|
|
154
|
-
|
|
155
|
-
/** Used for built-in method references. */
|
|
156
|
-
var objectProto$3 = Object.prototype;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Used to resolve the
|
|
160
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
161
|
-
* of values.
|
|
162
|
-
*/
|
|
163
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
167
|
-
*
|
|
168
|
-
* @private
|
|
169
|
-
* @param {*} value The value to convert.
|
|
170
|
-
* @returns {string} Returns the converted string.
|
|
171
|
-
*/
|
|
172
|
-
function objectToString(value) {
|
|
173
|
-
return nativeObjectToString.call(value);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
var _objectToString = objectToString;
|
|
177
|
-
|
|
178
|
-
/** `Object#toString` result references. */
|
|
179
|
-
var nullTag = '[object Null]',
|
|
180
|
-
undefinedTag = '[object Undefined]';
|
|
181
|
-
|
|
182
|
-
/** Built-in value references. */
|
|
183
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
187
|
-
*
|
|
188
|
-
* @private
|
|
189
|
-
* @param {*} value The value to query.
|
|
190
|
-
* @returns {string} Returns the `toStringTag`.
|
|
191
|
-
*/
|
|
192
|
-
function baseGetTag(value) {
|
|
193
|
-
if (value == null) {
|
|
194
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
195
|
-
}
|
|
196
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
197
|
-
? _getRawTag(value)
|
|
198
|
-
: _objectToString(value);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
var _baseGetTag = baseGetTag;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
205
|
-
* and has a `typeof` result of "object".
|
|
206
|
-
*
|
|
207
|
-
* @static
|
|
208
|
-
* @memberOf _
|
|
209
|
-
* @since 4.0.0
|
|
210
|
-
* @category Lang
|
|
211
|
-
* @param {*} value The value to check.
|
|
212
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
213
|
-
* @example
|
|
214
|
-
*
|
|
215
|
-
* _.isObjectLike({});
|
|
216
|
-
* // => true
|
|
217
|
-
*
|
|
218
|
-
* _.isObjectLike([1, 2, 3]);
|
|
219
|
-
* // => true
|
|
220
|
-
*
|
|
221
|
-
* _.isObjectLike(_.noop);
|
|
222
|
-
* // => false
|
|
223
|
-
*
|
|
224
|
-
* _.isObjectLike(null);
|
|
225
|
-
* // => false
|
|
226
|
-
*/
|
|
227
|
-
function isObjectLike(value) {
|
|
228
|
-
return value != null && typeof value == 'object';
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
var isObjectLike_1 = isObjectLike;
|
|
232
|
-
|
|
233
|
-
/** `Object#toString` result references. */
|
|
234
|
-
var symbolTag = '[object Symbol]';
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
238
|
-
*
|
|
239
|
-
* @static
|
|
240
|
-
* @memberOf _
|
|
241
|
-
* @since 4.0.0
|
|
242
|
-
* @category Lang
|
|
243
|
-
* @param {*} value The value to check.
|
|
244
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
245
|
-
* @example
|
|
246
|
-
*
|
|
247
|
-
* _.isSymbol(Symbol.iterator);
|
|
248
|
-
* // => true
|
|
249
|
-
*
|
|
250
|
-
* _.isSymbol('abc');
|
|
251
|
-
* // => false
|
|
252
|
-
*/
|
|
253
|
-
function isSymbol(value) {
|
|
254
|
-
return typeof value == 'symbol' ||
|
|
255
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
var isSymbol_1 = isSymbol;
|
|
259
|
-
|
|
260
|
-
/** Used to match property names within property paths. */
|
|
261
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
262
|
-
reIsPlainProp = /^\w*$/;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Checks if `value` is a property name and not a property path.
|
|
266
|
-
*
|
|
267
|
-
* @private
|
|
268
|
-
* @param {*} value The value to check.
|
|
269
|
-
* @param {Object} [object] The object to query keys on.
|
|
270
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
271
|
-
*/
|
|
272
|
-
function isKey(value, object) {
|
|
273
|
-
if (isArray_1(value)) {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
var type = typeof value;
|
|
277
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
278
|
-
value == null || isSymbol_1(value)) {
|
|
279
|
-
return true;
|
|
280
|
-
}
|
|
281
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
282
|
-
(object != null && value in Object(object));
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
var _isKey = isKey;
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Checks if `value` is the
|
|
289
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
290
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
291
|
-
*
|
|
292
|
-
* @static
|
|
293
|
-
* @memberOf _
|
|
294
|
-
* @since 0.1.0
|
|
295
|
-
* @category Lang
|
|
296
|
-
* @param {*} value The value to check.
|
|
297
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
298
|
-
* @example
|
|
299
|
-
*
|
|
300
|
-
* _.isObject({});
|
|
301
|
-
* // => true
|
|
302
|
-
*
|
|
303
|
-
* _.isObject([1, 2, 3]);
|
|
304
|
-
* // => true
|
|
305
|
-
*
|
|
306
|
-
* _.isObject(_.noop);
|
|
307
|
-
* // => true
|
|
308
|
-
*
|
|
309
|
-
* _.isObject(null);
|
|
310
|
-
* // => false
|
|
311
|
-
*/
|
|
312
|
-
function isObject(value) {
|
|
313
|
-
var type = typeof value;
|
|
314
|
-
return value != null && (type == 'object' || type == 'function');
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
var isObject_1 = isObject;
|
|
318
|
-
|
|
319
|
-
/** `Object#toString` result references. */
|
|
320
|
-
var asyncTag = '[object AsyncFunction]',
|
|
321
|
-
funcTag = '[object Function]',
|
|
322
|
-
genTag = '[object GeneratorFunction]',
|
|
323
|
-
proxyTag = '[object Proxy]';
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Checks if `value` is classified as a `Function` object.
|
|
327
|
-
*
|
|
328
|
-
* @static
|
|
329
|
-
* @memberOf _
|
|
330
|
-
* @since 0.1.0
|
|
331
|
-
* @category Lang
|
|
332
|
-
* @param {*} value The value to check.
|
|
333
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
334
|
-
* @example
|
|
335
|
-
*
|
|
336
|
-
* _.isFunction(_);
|
|
337
|
-
* // => true
|
|
338
|
-
*
|
|
339
|
-
* _.isFunction(/abc/);
|
|
340
|
-
* // => false
|
|
341
|
-
*/
|
|
342
|
-
function isFunction(value) {
|
|
343
|
-
if (!isObject_1(value)) {
|
|
344
|
-
return false;
|
|
345
|
-
}
|
|
346
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
347
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
348
|
-
var tag = _baseGetTag(value);
|
|
349
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
var isFunction_1 = isFunction;
|
|
353
|
-
|
|
354
|
-
/** Used to detect overreaching core-js shims. */
|
|
355
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
356
|
-
|
|
357
|
-
var _coreJsData = coreJsData;
|
|
358
|
-
|
|
359
|
-
/** Used to detect methods masquerading as native. */
|
|
360
|
-
var maskSrcKey = (function() {
|
|
361
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
362
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
363
|
-
}());
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Checks if `func` has its source masked.
|
|
367
|
-
*
|
|
368
|
-
* @private
|
|
369
|
-
* @param {Function} func The function to check.
|
|
370
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
371
|
-
*/
|
|
372
|
-
function isMasked(func) {
|
|
373
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
var _isMasked = isMasked;
|
|
377
|
-
|
|
378
|
-
/** Used for built-in method references. */
|
|
379
|
-
var funcProto$1 = Function.prototype;
|
|
380
|
-
|
|
381
|
-
/** Used to resolve the decompiled source of functions. */
|
|
382
|
-
var funcToString$1 = funcProto$1.toString;
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Converts `func` to its source code.
|
|
386
|
-
*
|
|
387
|
-
* @private
|
|
388
|
-
* @param {Function} func The function to convert.
|
|
389
|
-
* @returns {string} Returns the source code.
|
|
390
|
-
*/
|
|
391
|
-
function toSource(func) {
|
|
392
|
-
if (func != null) {
|
|
393
|
-
try {
|
|
394
|
-
return funcToString$1.call(func);
|
|
395
|
-
} catch (e) {}
|
|
396
|
-
try {
|
|
397
|
-
return (func + '');
|
|
398
|
-
} catch (e) {}
|
|
399
|
-
}
|
|
400
|
-
return '';
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
var _toSource = toSource;
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Used to match `RegExp`
|
|
407
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
408
|
-
*/
|
|
409
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
410
|
-
|
|
411
|
-
/** Used to detect host constructors (Safari). */
|
|
412
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
413
|
-
|
|
414
|
-
/** Used for built-in method references. */
|
|
415
|
-
var funcProto = Function.prototype,
|
|
416
|
-
objectProto$2 = Object.prototype;
|
|
417
|
-
|
|
418
|
-
/** Used to resolve the decompiled source of functions. */
|
|
419
|
-
var funcToString = funcProto.toString;
|
|
420
|
-
|
|
421
|
-
/** Used to check objects for own properties. */
|
|
422
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
423
|
-
|
|
424
|
-
/** Used to detect if a method is native. */
|
|
425
|
-
var reIsNative = RegExp('^' +
|
|
426
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
427
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
428
|
-
);
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
432
|
-
*
|
|
433
|
-
* @private
|
|
434
|
-
* @param {*} value The value to check.
|
|
435
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
436
|
-
* else `false`.
|
|
437
|
-
*/
|
|
438
|
-
function baseIsNative(value) {
|
|
439
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
440
|
-
return false;
|
|
441
|
-
}
|
|
442
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
443
|
-
return pattern.test(_toSource(value));
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
var _baseIsNative = baseIsNative;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Gets the value at `key` of `object`.
|
|
450
|
-
*
|
|
451
|
-
* @private
|
|
452
|
-
* @param {Object} [object] The object to query.
|
|
453
|
-
* @param {string} key The key of the property to get.
|
|
454
|
-
* @returns {*} Returns the property value.
|
|
455
|
-
*/
|
|
456
|
-
function getValue(object, key) {
|
|
457
|
-
return object == null ? undefined : object[key];
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
var _getValue = getValue;
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* Gets the native function at `key` of `object`.
|
|
464
|
-
*
|
|
465
|
-
* @private
|
|
466
|
-
* @param {Object} object The object to query.
|
|
467
|
-
* @param {string} key The key of the method to get.
|
|
468
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
469
|
-
*/
|
|
470
|
-
function getNative(object, key) {
|
|
471
|
-
var value = _getValue(object, key);
|
|
472
|
-
return _baseIsNative(value) ? value : undefined;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
var _getNative = getNative;
|
|
476
|
-
|
|
477
|
-
/* Built-in method references that are verified to be native. */
|
|
478
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
479
|
-
|
|
480
|
-
var _nativeCreate = nativeCreate;
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Removes all key-value entries from the hash.
|
|
484
|
-
*
|
|
485
|
-
* @private
|
|
486
|
-
* @name clear
|
|
487
|
-
* @memberOf Hash
|
|
488
|
-
*/
|
|
489
|
-
function hashClear() {
|
|
490
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
491
|
-
this.size = 0;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
var _hashClear = hashClear;
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Removes `key` and its value from the hash.
|
|
498
|
-
*
|
|
499
|
-
* @private
|
|
500
|
-
* @name delete
|
|
501
|
-
* @memberOf Hash
|
|
502
|
-
* @param {Object} hash The hash to modify.
|
|
503
|
-
* @param {string} key The key of the value to remove.
|
|
504
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
505
|
-
*/
|
|
506
|
-
function hashDelete(key) {
|
|
507
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
508
|
-
this.size -= result ? 1 : 0;
|
|
509
|
-
return result;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
var _hashDelete = hashDelete;
|
|
513
|
-
|
|
514
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
515
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
516
|
-
|
|
517
|
-
/** Used for built-in method references. */
|
|
518
|
-
var objectProto$1 = Object.prototype;
|
|
519
|
-
|
|
520
|
-
/** Used to check objects for own properties. */
|
|
521
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Gets the hash value for `key`.
|
|
525
|
-
*
|
|
526
|
-
* @private
|
|
527
|
-
* @name get
|
|
528
|
-
* @memberOf Hash
|
|
529
|
-
* @param {string} key The key of the value to get.
|
|
530
|
-
* @returns {*} Returns the entry value.
|
|
531
|
-
*/
|
|
532
|
-
function hashGet(key) {
|
|
533
|
-
var data = this.__data__;
|
|
534
|
-
if (_nativeCreate) {
|
|
535
|
-
var result = data[key];
|
|
536
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
537
|
-
}
|
|
538
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
var _hashGet = hashGet;
|
|
542
|
-
|
|
543
|
-
/** Used for built-in method references. */
|
|
544
|
-
var objectProto = Object.prototype;
|
|
545
|
-
|
|
546
|
-
/** Used to check objects for own properties. */
|
|
547
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* Checks if a hash value for `key` exists.
|
|
551
|
-
*
|
|
552
|
-
* @private
|
|
553
|
-
* @name has
|
|
554
|
-
* @memberOf Hash
|
|
555
|
-
* @param {string} key The key of the entry to check.
|
|
556
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
557
|
-
*/
|
|
558
|
-
function hashHas(key) {
|
|
559
|
-
var data = this.__data__;
|
|
560
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
var _hashHas = hashHas;
|
|
564
|
-
|
|
565
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
566
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Sets the hash `key` to `value`.
|
|
570
|
-
*
|
|
571
|
-
* @private
|
|
572
|
-
* @name set
|
|
573
|
-
* @memberOf Hash
|
|
574
|
-
* @param {string} key The key of the value to set.
|
|
575
|
-
* @param {*} value The value to set.
|
|
576
|
-
* @returns {Object} Returns the hash instance.
|
|
577
|
-
*/
|
|
578
|
-
function hashSet(key, value) {
|
|
579
|
-
var data = this.__data__;
|
|
580
|
-
this.size += this.has(key) ? 0 : 1;
|
|
581
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
582
|
-
return this;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
var _hashSet = hashSet;
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Creates a hash object.
|
|
589
|
-
*
|
|
590
|
-
* @private
|
|
591
|
-
* @constructor
|
|
592
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
593
|
-
*/
|
|
594
|
-
function Hash(entries) {
|
|
595
|
-
var index = -1,
|
|
596
|
-
length = entries == null ? 0 : entries.length;
|
|
597
|
-
|
|
598
|
-
this.clear();
|
|
599
|
-
while (++index < length) {
|
|
600
|
-
var entry = entries[index];
|
|
601
|
-
this.set(entry[0], entry[1]);
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// Add methods to `Hash`.
|
|
606
|
-
Hash.prototype.clear = _hashClear;
|
|
607
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
608
|
-
Hash.prototype.get = _hashGet;
|
|
609
|
-
Hash.prototype.has = _hashHas;
|
|
610
|
-
Hash.prototype.set = _hashSet;
|
|
611
|
-
|
|
612
|
-
var _Hash = Hash;
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Removes all key-value entries from the list cache.
|
|
616
|
-
*
|
|
617
|
-
* @private
|
|
618
|
-
* @name clear
|
|
619
|
-
* @memberOf ListCache
|
|
620
|
-
*/
|
|
621
|
-
function listCacheClear() {
|
|
622
|
-
this.__data__ = [];
|
|
623
|
-
this.size = 0;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
var _listCacheClear = listCacheClear;
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Performs a
|
|
630
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
631
|
-
* comparison between two values to determine if they are equivalent.
|
|
632
|
-
*
|
|
633
|
-
* @static
|
|
634
|
-
* @memberOf _
|
|
635
|
-
* @since 4.0.0
|
|
636
|
-
* @category Lang
|
|
637
|
-
* @param {*} value The value to compare.
|
|
638
|
-
* @param {*} other The other value to compare.
|
|
639
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
640
|
-
* @example
|
|
641
|
-
*
|
|
642
|
-
* var object = { 'a': 1 };
|
|
643
|
-
* var other = { 'a': 1 };
|
|
644
|
-
*
|
|
645
|
-
* _.eq(object, object);
|
|
646
|
-
* // => true
|
|
647
|
-
*
|
|
648
|
-
* _.eq(object, other);
|
|
649
|
-
* // => false
|
|
650
|
-
*
|
|
651
|
-
* _.eq('a', 'a');
|
|
652
|
-
* // => true
|
|
653
|
-
*
|
|
654
|
-
* _.eq('a', Object('a'));
|
|
655
|
-
* // => false
|
|
656
|
-
*
|
|
657
|
-
* _.eq(NaN, NaN);
|
|
658
|
-
* // => true
|
|
659
|
-
*/
|
|
660
|
-
function eq(value, other) {
|
|
661
|
-
return value === other || (value !== value && other !== other);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
var eq_1 = eq;
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
668
|
-
*
|
|
669
|
-
* @private
|
|
670
|
-
* @param {Array} array The array to inspect.
|
|
671
|
-
* @param {*} key The key to search for.
|
|
672
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
673
|
-
*/
|
|
674
|
-
function assocIndexOf(array, key) {
|
|
675
|
-
var length = array.length;
|
|
676
|
-
while (length--) {
|
|
677
|
-
if (eq_1(array[length][0], key)) {
|
|
678
|
-
return length;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
return -1;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
var _assocIndexOf = assocIndexOf;
|
|
685
|
-
|
|
686
|
-
/** Used for built-in method references. */
|
|
687
|
-
var arrayProto = Array.prototype;
|
|
688
|
-
|
|
689
|
-
/** Built-in value references. */
|
|
690
|
-
var splice = arrayProto.splice;
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* Removes `key` and its value from the list cache.
|
|
694
|
-
*
|
|
695
|
-
* @private
|
|
696
|
-
* @name delete
|
|
697
|
-
* @memberOf ListCache
|
|
698
|
-
* @param {string} key The key of the value to remove.
|
|
699
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
700
|
-
*/
|
|
701
|
-
function listCacheDelete(key) {
|
|
702
|
-
var data = this.__data__,
|
|
703
|
-
index = _assocIndexOf(data, key);
|
|
704
|
-
|
|
705
|
-
if (index < 0) {
|
|
706
|
-
return false;
|
|
707
|
-
}
|
|
708
|
-
var lastIndex = data.length - 1;
|
|
709
|
-
if (index == lastIndex) {
|
|
710
|
-
data.pop();
|
|
711
|
-
} else {
|
|
712
|
-
splice.call(data, index, 1);
|
|
713
|
-
}
|
|
714
|
-
--this.size;
|
|
715
|
-
return true;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
var _listCacheDelete = listCacheDelete;
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* Gets the list cache value for `key`.
|
|
722
|
-
*
|
|
723
|
-
* @private
|
|
724
|
-
* @name get
|
|
725
|
-
* @memberOf ListCache
|
|
726
|
-
* @param {string} key The key of the value to get.
|
|
727
|
-
* @returns {*} Returns the entry value.
|
|
728
|
-
*/
|
|
729
|
-
function listCacheGet(key) {
|
|
730
|
-
var data = this.__data__,
|
|
731
|
-
index = _assocIndexOf(data, key);
|
|
732
|
-
|
|
733
|
-
return index < 0 ? undefined : data[index][1];
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
var _listCacheGet = listCacheGet;
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* Checks if a list cache value for `key` exists.
|
|
740
|
-
*
|
|
741
|
-
* @private
|
|
742
|
-
* @name has
|
|
743
|
-
* @memberOf ListCache
|
|
744
|
-
* @param {string} key The key of the entry to check.
|
|
745
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
746
|
-
*/
|
|
747
|
-
function listCacheHas(key) {
|
|
748
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
var _listCacheHas = listCacheHas;
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* Sets the list cache `key` to `value`.
|
|
755
|
-
*
|
|
756
|
-
* @private
|
|
757
|
-
* @name set
|
|
758
|
-
* @memberOf ListCache
|
|
759
|
-
* @param {string} key The key of the value to set.
|
|
760
|
-
* @param {*} value The value to set.
|
|
761
|
-
* @returns {Object} Returns the list cache instance.
|
|
762
|
-
*/
|
|
763
|
-
function listCacheSet(key, value) {
|
|
764
|
-
var data = this.__data__,
|
|
765
|
-
index = _assocIndexOf(data, key);
|
|
766
|
-
|
|
767
|
-
if (index < 0) {
|
|
768
|
-
++this.size;
|
|
769
|
-
data.push([key, value]);
|
|
770
|
-
} else {
|
|
771
|
-
data[index][1] = value;
|
|
772
|
-
}
|
|
773
|
-
return this;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
var _listCacheSet = listCacheSet;
|
|
777
|
-
|
|
778
|
-
/**
|
|
779
|
-
* Creates an list cache object.
|
|
780
|
-
*
|
|
781
|
-
* @private
|
|
782
|
-
* @constructor
|
|
783
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
784
|
-
*/
|
|
785
|
-
function ListCache(entries) {
|
|
786
|
-
var index = -1,
|
|
787
|
-
length = entries == null ? 0 : entries.length;
|
|
788
|
-
|
|
789
|
-
this.clear();
|
|
790
|
-
while (++index < length) {
|
|
791
|
-
var entry = entries[index];
|
|
792
|
-
this.set(entry[0], entry[1]);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
// Add methods to `ListCache`.
|
|
797
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
798
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
799
|
-
ListCache.prototype.get = _listCacheGet;
|
|
800
|
-
ListCache.prototype.has = _listCacheHas;
|
|
801
|
-
ListCache.prototype.set = _listCacheSet;
|
|
802
|
-
|
|
803
|
-
var _ListCache = ListCache;
|
|
804
|
-
|
|
805
|
-
/* Built-in method references that are verified to be native. */
|
|
806
|
-
var Map = _getNative(_root, 'Map');
|
|
807
|
-
|
|
808
|
-
var _Map = Map;
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* Removes all key-value entries from the map.
|
|
812
|
-
*
|
|
813
|
-
* @private
|
|
814
|
-
* @name clear
|
|
815
|
-
* @memberOf MapCache
|
|
816
|
-
*/
|
|
817
|
-
function mapCacheClear() {
|
|
818
|
-
this.size = 0;
|
|
819
|
-
this.__data__ = {
|
|
820
|
-
'hash': new _Hash,
|
|
821
|
-
'map': new (_Map || _ListCache),
|
|
822
|
-
'string': new _Hash
|
|
823
|
-
};
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
var _mapCacheClear = mapCacheClear;
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
830
|
-
*
|
|
831
|
-
* @private
|
|
832
|
-
* @param {*} value The value to check.
|
|
833
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
834
|
-
*/
|
|
835
|
-
function isKeyable(value) {
|
|
836
|
-
var type = typeof value;
|
|
837
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
838
|
-
? (value !== '__proto__')
|
|
839
|
-
: (value === null);
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
var _isKeyable = isKeyable;
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* Gets the data for `map`.
|
|
846
|
-
*
|
|
847
|
-
* @private
|
|
848
|
-
* @param {Object} map The map to query.
|
|
849
|
-
* @param {string} key The reference key.
|
|
850
|
-
* @returns {*} Returns the map data.
|
|
851
|
-
*/
|
|
852
|
-
function getMapData(map, key) {
|
|
853
|
-
var data = map.__data__;
|
|
854
|
-
return _isKeyable(key)
|
|
855
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
856
|
-
: data.map;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
var _getMapData = getMapData;
|
|
860
|
-
|
|
861
|
-
/**
|
|
862
|
-
* Removes `key` and its value from the map.
|
|
863
|
-
*
|
|
864
|
-
* @private
|
|
865
|
-
* @name delete
|
|
866
|
-
* @memberOf MapCache
|
|
867
|
-
* @param {string} key The key of the value to remove.
|
|
868
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
869
|
-
*/
|
|
870
|
-
function mapCacheDelete(key) {
|
|
871
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
872
|
-
this.size -= result ? 1 : 0;
|
|
873
|
-
return result;
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* Gets the map value for `key`.
|
|
880
|
-
*
|
|
881
|
-
* @private
|
|
882
|
-
* @name get
|
|
883
|
-
* @memberOf MapCache
|
|
884
|
-
* @param {string} key The key of the value to get.
|
|
885
|
-
* @returns {*} Returns the entry value.
|
|
886
|
-
*/
|
|
887
|
-
function mapCacheGet(key) {
|
|
888
|
-
return _getMapData(this, key).get(key);
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
var _mapCacheGet = mapCacheGet;
|
|
892
|
-
|
|
893
|
-
/**
|
|
894
|
-
* Checks if a map value for `key` exists.
|
|
895
|
-
*
|
|
896
|
-
* @private
|
|
897
|
-
* @name has
|
|
898
|
-
* @memberOf MapCache
|
|
899
|
-
* @param {string} key The key of the entry to check.
|
|
900
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
901
|
-
*/
|
|
902
|
-
function mapCacheHas(key) {
|
|
903
|
-
return _getMapData(this, key).has(key);
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
var _mapCacheHas = mapCacheHas;
|
|
907
|
-
|
|
908
|
-
/**
|
|
909
|
-
* Sets the map `key` to `value`.
|
|
910
|
-
*
|
|
911
|
-
* @private
|
|
912
|
-
* @name set
|
|
913
|
-
* @memberOf MapCache
|
|
914
|
-
* @param {string} key The key of the value to set.
|
|
915
|
-
* @param {*} value The value to set.
|
|
916
|
-
* @returns {Object} Returns the map cache instance.
|
|
917
|
-
*/
|
|
918
|
-
function mapCacheSet(key, value) {
|
|
919
|
-
var data = _getMapData(this, key),
|
|
920
|
-
size = data.size;
|
|
921
|
-
|
|
922
|
-
data.set(key, value);
|
|
923
|
-
this.size += data.size == size ? 0 : 1;
|
|
924
|
-
return this;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
var _mapCacheSet = mapCacheSet;
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
* Creates a map cache object to store key-value pairs.
|
|
931
|
-
*
|
|
932
|
-
* @private
|
|
933
|
-
* @constructor
|
|
934
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
935
|
-
*/
|
|
936
|
-
function MapCache(entries) {
|
|
937
|
-
var index = -1,
|
|
938
|
-
length = entries == null ? 0 : entries.length;
|
|
939
|
-
|
|
940
|
-
this.clear();
|
|
941
|
-
while (++index < length) {
|
|
942
|
-
var entry = entries[index];
|
|
943
|
-
this.set(entry[0], entry[1]);
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
// Add methods to `MapCache`.
|
|
948
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
949
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
950
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
951
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
952
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
953
|
-
|
|
954
|
-
var _MapCache = MapCache;
|
|
955
|
-
|
|
956
|
-
/** Error message constants. */
|
|
957
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
958
|
-
|
|
959
|
-
/**
|
|
960
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
961
|
-
* provided, it determines the cache key for storing the result based on the
|
|
962
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
963
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
964
|
-
* is invoked with the `this` binding of the memoized function.
|
|
965
|
-
*
|
|
966
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
967
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
968
|
-
* constructor with one whose instances implement the
|
|
969
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
970
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
971
|
-
*
|
|
972
|
-
* @static
|
|
973
|
-
* @memberOf _
|
|
974
|
-
* @since 0.1.0
|
|
975
|
-
* @category Function
|
|
976
|
-
* @param {Function} func The function to have its output memoized.
|
|
977
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
978
|
-
* @returns {Function} Returns the new memoized function.
|
|
979
|
-
* @example
|
|
980
|
-
*
|
|
981
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
982
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
983
|
-
*
|
|
984
|
-
* var values = _.memoize(_.values);
|
|
985
|
-
* values(object);
|
|
986
|
-
* // => [1, 2]
|
|
987
|
-
*
|
|
988
|
-
* values(other);
|
|
989
|
-
* // => [3, 4]
|
|
990
|
-
*
|
|
991
|
-
* object.a = 2;
|
|
992
|
-
* values(object);
|
|
993
|
-
* // => [1, 2]
|
|
994
|
-
*
|
|
995
|
-
* // Modify the result cache.
|
|
996
|
-
* values.cache.set(object, ['a', 'b']);
|
|
997
|
-
* values(object);
|
|
998
|
-
* // => ['a', 'b']
|
|
999
|
-
*
|
|
1000
|
-
* // Replace `_.memoize.Cache`.
|
|
1001
|
-
* _.memoize.Cache = WeakMap;
|
|
1002
|
-
*/
|
|
1003
|
-
function memoize(func, resolver) {
|
|
1004
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
1005
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1006
|
-
}
|
|
1007
|
-
var memoized = function() {
|
|
1008
|
-
var args = arguments,
|
|
1009
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1010
|
-
cache = memoized.cache;
|
|
1011
|
-
|
|
1012
|
-
if (cache.has(key)) {
|
|
1013
|
-
return cache.get(key);
|
|
1014
|
-
}
|
|
1015
|
-
var result = func.apply(this, args);
|
|
1016
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1017
|
-
return result;
|
|
1018
|
-
};
|
|
1019
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1020
|
-
return memoized;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
// Expose `MapCache`.
|
|
1024
|
-
memoize.Cache = _MapCache;
|
|
1025
|
-
|
|
1026
|
-
var memoize_1 = memoize;
|
|
1027
|
-
|
|
1028
|
-
/** Used as the maximum memoize cache size. */
|
|
1029
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
1030
|
-
|
|
1031
|
-
/**
|
|
1032
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
1033
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
1034
|
-
*
|
|
1035
|
-
* @private
|
|
1036
|
-
* @param {Function} func The function to have its output memoized.
|
|
1037
|
-
* @returns {Function} Returns the new memoized function.
|
|
1038
|
-
*/
|
|
1039
|
-
function memoizeCapped(func) {
|
|
1040
|
-
var result = memoize_1(func, function(key) {
|
|
1041
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
1042
|
-
cache.clear();
|
|
1043
|
-
}
|
|
1044
|
-
return key;
|
|
1045
|
-
});
|
|
1046
|
-
|
|
1047
|
-
var cache = result.cache;
|
|
1048
|
-
return result;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
var _memoizeCapped = memoizeCapped;
|
|
1052
|
-
|
|
1053
|
-
/** Used to match property names within property paths. */
|
|
1054
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
1055
|
-
|
|
1056
|
-
/** Used to match backslashes in property paths. */
|
|
1057
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* Converts `string` to a property path array.
|
|
1061
|
-
*
|
|
1062
|
-
* @private
|
|
1063
|
-
* @param {string} string The string to convert.
|
|
1064
|
-
* @returns {Array} Returns the property path array.
|
|
1065
|
-
*/
|
|
1066
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
1067
|
-
var result = [];
|
|
1068
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
1069
|
-
result.push('');
|
|
1070
|
-
}
|
|
1071
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
1072
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
1073
|
-
});
|
|
1074
|
-
return result;
|
|
1075
|
-
});
|
|
1076
|
-
|
|
1077
|
-
var _stringToPath = stringToPath;
|
|
1078
|
-
|
|
1079
|
-
/**
|
|
1080
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
1081
|
-
* shorthands.
|
|
1082
|
-
*
|
|
1083
|
-
* @private
|
|
1084
|
-
* @param {Array} [array] The array to iterate over.
|
|
1085
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1086
|
-
* @returns {Array} Returns the new mapped array.
|
|
1087
|
-
*/
|
|
1088
|
-
function arrayMap(array, iteratee) {
|
|
1089
|
-
var index = -1,
|
|
1090
|
-
length = array == null ? 0 : array.length,
|
|
1091
|
-
result = Array(length);
|
|
1092
|
-
|
|
1093
|
-
while (++index < length) {
|
|
1094
|
-
result[index] = iteratee(array[index], index, array);
|
|
1095
|
-
}
|
|
1096
|
-
return result;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
var _arrayMap = arrayMap;
|
|
1100
|
-
|
|
1101
|
-
/** Used as references for various `Number` constants. */
|
|
1102
|
-
var INFINITY$1 = 1 / 0;
|
|
1103
|
-
|
|
1104
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1105
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
1106
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
1107
|
-
|
|
1108
|
-
/**
|
|
1109
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1110
|
-
* values to empty strings.
|
|
1111
|
-
*
|
|
1112
|
-
* @private
|
|
1113
|
-
* @param {*} value The value to process.
|
|
1114
|
-
* @returns {string} Returns the string.
|
|
1115
|
-
*/
|
|
1116
|
-
function baseToString(value) {
|
|
1117
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
1118
|
-
if (typeof value == 'string') {
|
|
1119
|
-
return value;
|
|
1120
|
-
}
|
|
1121
|
-
if (isArray_1(value)) {
|
|
1122
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
1123
|
-
return _arrayMap(value, baseToString) + '';
|
|
1124
|
-
}
|
|
1125
|
-
if (isSymbol_1(value)) {
|
|
1126
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
1127
|
-
}
|
|
1128
|
-
var result = (value + '');
|
|
1129
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
var _baseToString = baseToString;
|
|
1133
|
-
|
|
1134
|
-
/**
|
|
1135
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
1136
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
1137
|
-
*
|
|
1138
|
-
* @static
|
|
1139
|
-
* @memberOf _
|
|
1140
|
-
* @since 4.0.0
|
|
1141
|
-
* @category Lang
|
|
1142
|
-
* @param {*} value The value to convert.
|
|
1143
|
-
* @returns {string} Returns the converted string.
|
|
1144
|
-
* @example
|
|
1145
|
-
*
|
|
1146
|
-
* _.toString(null);
|
|
1147
|
-
* // => ''
|
|
1148
|
-
*
|
|
1149
|
-
* _.toString(-0);
|
|
1150
|
-
* // => '-0'
|
|
1151
|
-
*
|
|
1152
|
-
* _.toString([1, 2, 3]);
|
|
1153
|
-
* // => '1,2,3'
|
|
1154
|
-
*/
|
|
1155
|
-
function toString(value) {
|
|
1156
|
-
return value == null ? '' : _baseToString(value);
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
var toString_1 = toString;
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* Casts `value` to a path array if it's not one.
|
|
1163
|
-
*
|
|
1164
|
-
* @private
|
|
1165
|
-
* @param {*} value The value to inspect.
|
|
1166
|
-
* @param {Object} [object] The object to query keys on.
|
|
1167
|
-
* @returns {Array} Returns the cast property path array.
|
|
1168
|
-
*/
|
|
1169
|
-
function castPath(value, object) {
|
|
1170
|
-
if (isArray_1(value)) {
|
|
1171
|
-
return value;
|
|
1172
|
-
}
|
|
1173
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
var _castPath = castPath;
|
|
1177
|
-
|
|
1178
|
-
/** Used as references for various `Number` constants. */
|
|
1179
|
-
var INFINITY = 1 / 0;
|
|
1180
|
-
|
|
1181
|
-
/**
|
|
1182
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
1183
|
-
*
|
|
1184
|
-
* @private
|
|
1185
|
-
* @param {*} value The value to inspect.
|
|
1186
|
-
* @returns {string|symbol} Returns the key.
|
|
1187
|
-
*/
|
|
1188
|
-
function toKey(value) {
|
|
1189
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
1190
|
-
return value;
|
|
1191
|
-
}
|
|
1192
|
-
var result = (value + '');
|
|
1193
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
var _toKey = toKey;
|
|
1197
|
-
|
|
1198
|
-
/**
|
|
1199
|
-
* The base implementation of `_.get` without support for default values.
|
|
1200
|
-
*
|
|
1201
|
-
* @private
|
|
1202
|
-
* @param {Object} object The object to query.
|
|
1203
|
-
* @param {Array|string} path The path of the property to get.
|
|
1204
|
-
* @returns {*} Returns the resolved value.
|
|
1205
|
-
*/
|
|
1206
|
-
function baseGet(object, path) {
|
|
1207
|
-
path = _castPath(path, object);
|
|
1208
|
-
|
|
1209
|
-
var index = 0,
|
|
1210
|
-
length = path.length;
|
|
1211
|
-
|
|
1212
|
-
while (object != null && index < length) {
|
|
1213
|
-
object = object[_toKey(path[index++])];
|
|
1214
|
-
}
|
|
1215
|
-
return (index && index == length) ? object : undefined;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
var _baseGet = baseGet;
|
|
1219
|
-
|
|
1220
|
-
/**
|
|
1221
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
1222
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
1223
|
-
*
|
|
1224
|
-
* @static
|
|
1225
|
-
* @memberOf _
|
|
1226
|
-
* @since 3.7.0
|
|
1227
|
-
* @category Object
|
|
1228
|
-
* @param {Object} object The object to query.
|
|
1229
|
-
* @param {Array|string} path The path of the property to get.
|
|
1230
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
1231
|
-
* @returns {*} Returns the resolved value.
|
|
1232
|
-
* @example
|
|
1233
|
-
*
|
|
1234
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
1235
|
-
*
|
|
1236
|
-
* _.get(object, 'a[0].b.c');
|
|
1237
|
-
* // => 3
|
|
1238
|
-
*
|
|
1239
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
1240
|
-
* // => 3
|
|
1241
|
-
*
|
|
1242
|
-
* _.get(object, 'a.b.c', 'default');
|
|
1243
|
-
* // => 'default'
|
|
1244
|
-
*/
|
|
1245
|
-
function get(object, path, defaultValue) {
|
|
1246
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
1247
|
-
return result === undefined ? defaultValue : result;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
var get_1 = get;
|
|
1251
|
-
|
|
1252
|
-
function _iterableToArrayLimit(arr, i) {
|
|
1253
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1254
|
-
|
|
1255
|
-
if (_i == null) return;
|
|
1256
|
-
var _arr = [];
|
|
1257
|
-
var _n = true;
|
|
1258
|
-
var _d = false;
|
|
1259
|
-
|
|
1260
|
-
var _s, _e;
|
|
1261
|
-
|
|
1262
|
-
try {
|
|
1263
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
1264
|
-
_arr.push(_s.value);
|
|
1265
|
-
|
|
1266
|
-
if (i && _arr.length === i) break;
|
|
1267
|
-
}
|
|
1268
|
-
} catch (err) {
|
|
1269
|
-
_d = true;
|
|
1270
|
-
_e = err;
|
|
1271
|
-
} finally {
|
|
1272
|
-
try {
|
|
1273
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
1274
|
-
} finally {
|
|
1275
|
-
if (_d) throw _e;
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
return _arr;
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
function _slicedToArray(arr, i) {
|
|
1283
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
|
|
1287
|
-
|
|
1288
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1289
|
-
value: true
|
|
1290
|
-
});
|
|
1291
|
-
exports["default"] = void 0;
|
|
1292
|
-
var optionsDefaults = {
|
|
1293
|
-
attributeNames: {
|
|
1294
|
-
styleName: 'className'
|
|
1295
|
-
},
|
|
1296
|
-
generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
|
|
1297
|
-
handleMissingStyleName: 'throw'
|
|
1298
|
-
};
|
|
1299
|
-
var _default = optionsDefaults;
|
|
1300
|
-
exports["default"] = _default;
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
});
|
|
1304
|
-
|
|
1305
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
1306
|
-
|
|
1307
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1308
|
-
value: true
|
|
1309
|
-
});
|
|
1310
|
-
exports["default"] = void 0;
|
|
1311
|
-
|
|
1312
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
1313
|
-
|
|
1314
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1315
|
-
|
|
1316
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
1317
|
-
return styleName.indexOf('.') !== -1;
|
|
1318
|
-
};
|
|
1319
|
-
|
|
1320
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
1321
|
-
if (handleMissingStyleName === 'throw') {
|
|
1322
|
-
throw new Error(message);
|
|
1323
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
1324
|
-
// eslint-disable-next-line no-console
|
|
1325
|
-
console.warn(message);
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
return null;
|
|
1329
|
-
};
|
|
1330
|
-
|
|
1331
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1332
|
-
// Note:
|
|
1333
|
-
// Do not use the desctructing syntax with Babel.
|
|
1334
|
-
// Desctructing adds _slicedToArray helper.
|
|
1335
|
-
var styleNameParts = styleName.split('.');
|
|
1336
|
-
var importName = styleNameParts[0];
|
|
1337
|
-
var moduleName = styleNameParts[1];
|
|
1338
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1339
|
-
|
|
1340
|
-
if (!moduleName) {
|
|
1341
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
if (!styleModuleImportMap[importName]) {
|
|
1345
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
1349
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
return styleModuleImportMap[importName][moduleName];
|
|
1353
|
-
};
|
|
1354
|
-
|
|
1355
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1356
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1357
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
1358
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
1359
|
-
}).filter(function (importKey) {
|
|
1360
|
-
return importKey;
|
|
1361
|
-
});
|
|
1362
|
-
|
|
1363
|
-
if (importKeysWithMatches.length > 1) {
|
|
1364
|
-
throw new Error('Cannot resolve styleName "' + styleName + '" because it is present in multiple imports:' + '\n\n\t' + importKeysWithMatches.join('\n\t') + '\n\nYou can resolve this by using a named import, e.g:' + '\n\n\timport foo from "' + importKeysWithMatches[0] + '";' + '\n\t<div styleName="foo.' + styleName + '" />' + '\n\n');
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
if (importKeysWithMatches.length === 0) {
|
|
1368
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
1372
|
-
};
|
|
1373
|
-
|
|
1374
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
1375
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
1376
|
-
|
|
1377
|
-
var _ref = options || {},
|
|
1378
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
1379
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
1380
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
1381
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
1382
|
-
|
|
1383
|
-
if (!styleNameValue) {
|
|
1384
|
-
return '';
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
1388
|
-
return styleName;
|
|
1389
|
-
}).map(function (styleName) {
|
|
1390
|
-
if (isNamespacedStyleName(styleName)) {
|
|
1391
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
1395
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
1399
|
-
if (!autoResolveMultipleImports) {
|
|
1400
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
1407
|
-
|
|
1408
|
-
if (!styleModuleMap[styleName]) {
|
|
1409
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
return styleModuleMap[styleName];
|
|
1413
|
-
}).filter(function (className) {
|
|
1414
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
1415
|
-
return className;
|
|
1416
|
-
}).join(' ');
|
|
1417
|
-
};
|
|
1418
|
-
|
|
1419
|
-
exports["default"] = _default;
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
});
|
|
1423
|
-
|
|
1424
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
1425
|
-
|
|
1426
|
-
function _typeof(obj) {
|
|
1427
|
-
"@babel/helpers - typeof";
|
|
1428
|
-
|
|
1429
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
1430
|
-
return typeof obj;
|
|
1431
|
-
} : function (obj) {
|
|
1432
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
1433
|
-
}, _typeof(obj);
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
/**
|
|
1437
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
1438
|
-
*
|
|
1439
|
-
* This source code is licensed under the MIT license found in the
|
|
1440
|
-
* LICENSE file in the root directory of this source tree.
|
|
1441
|
-
*/
|
|
1442
|
-
|
|
1443
|
-
createCommonjsModule(function (module) {
|
|
1444
|
-
var runtime = (function (exports) {
|
|
1445
|
-
|
|
1446
|
-
var Op = Object.prototype;
|
|
1447
|
-
var hasOwn = Op.hasOwnProperty;
|
|
1448
|
-
var undefined$1; // More compressible than void 0.
|
|
1449
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
1450
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
1451
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
1452
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
1453
|
-
|
|
1454
|
-
function define(obj, key, value) {
|
|
1455
|
-
Object.defineProperty(obj, key, {
|
|
1456
|
-
value: value,
|
|
1457
|
-
enumerable: true,
|
|
1458
|
-
configurable: true,
|
|
1459
|
-
writable: true
|
|
1460
|
-
});
|
|
1461
|
-
return obj[key];
|
|
1462
|
-
}
|
|
1463
|
-
try {
|
|
1464
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
1465
|
-
define({}, "");
|
|
1466
|
-
} catch (err) {
|
|
1467
|
-
define = function(obj, key, value) {
|
|
1468
|
-
return obj[key] = value;
|
|
1469
|
-
};
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
1473
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
1474
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
1475
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
1476
|
-
var context = new Context(tryLocsList || []);
|
|
1477
|
-
|
|
1478
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
1479
|
-
// .throw, and .return methods.
|
|
1480
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
1481
|
-
|
|
1482
|
-
return generator;
|
|
1483
|
-
}
|
|
1484
|
-
exports.wrap = wrap;
|
|
1485
|
-
|
|
1486
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
1487
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
1488
|
-
// have been (and was previously) designed to take a closure to be
|
|
1489
|
-
// invoked without arguments, but in all the cases we care about we
|
|
1490
|
-
// already have an existing method we want to call, so there's no need
|
|
1491
|
-
// to create a new function object. We can even get away with assuming
|
|
1492
|
-
// the method takes exactly one argument, since that happens to be true
|
|
1493
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
1494
|
-
// only additional allocation required is the completion record, which
|
|
1495
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
1496
|
-
function tryCatch(fn, obj, arg) {
|
|
1497
|
-
try {
|
|
1498
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
1499
|
-
} catch (err) {
|
|
1500
|
-
return { type: "throw", arg: err };
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
1505
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
1506
|
-
var GenStateExecuting = "executing";
|
|
1507
|
-
var GenStateCompleted = "completed";
|
|
1508
|
-
|
|
1509
|
-
// Returning this object from the innerFn has the same effect as
|
|
1510
|
-
// breaking out of the dispatch switch statement.
|
|
1511
|
-
var ContinueSentinel = {};
|
|
1512
|
-
|
|
1513
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
1514
|
-
// .constructor.prototype properties for functions that return Generator
|
|
1515
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
1516
|
-
// minifier not to mangle the names of these two functions.
|
|
1517
|
-
function Generator() {}
|
|
1518
|
-
function GeneratorFunction() {}
|
|
1519
|
-
function GeneratorFunctionPrototype() {}
|
|
1520
|
-
|
|
1521
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
1522
|
-
// don't natively support it.
|
|
1523
|
-
var IteratorPrototype = {};
|
|
1524
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1525
|
-
return this;
|
|
1526
|
-
});
|
|
1527
|
-
|
|
1528
|
-
var getProto = Object.getPrototypeOf;
|
|
1529
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1530
|
-
if (NativeIteratorPrototype &&
|
|
1531
|
-
NativeIteratorPrototype !== Op &&
|
|
1532
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
1533
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
1534
|
-
// of the polyfill.
|
|
1535
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
1539
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
1540
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
1541
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
1542
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
1543
|
-
GeneratorFunction.displayName = define(
|
|
1544
|
-
GeneratorFunctionPrototype,
|
|
1545
|
-
toStringTagSymbol,
|
|
1546
|
-
"GeneratorFunction"
|
|
1547
|
-
);
|
|
1548
|
-
|
|
1549
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
1550
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
1551
|
-
function defineIteratorMethods(prototype) {
|
|
1552
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
1553
|
-
define(prototype, method, function(arg) {
|
|
1554
|
-
return this._invoke(method, arg);
|
|
1555
|
-
});
|
|
1556
|
-
});
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
1560
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
1561
|
-
return ctor
|
|
1562
|
-
? ctor === GeneratorFunction ||
|
|
1563
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
1564
|
-
// do is to check its .name property.
|
|
1565
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
1566
|
-
: false;
|
|
1567
|
-
};
|
|
1568
|
-
|
|
1569
|
-
exports.mark = function(genFun) {
|
|
1570
|
-
if (Object.setPrototypeOf) {
|
|
1571
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
1572
|
-
} else {
|
|
1573
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
1574
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
1575
|
-
}
|
|
1576
|
-
genFun.prototype = Object.create(Gp);
|
|
1577
|
-
return genFun;
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
|
-
// Within the body of any async function, `await x` is transformed to
|
|
1581
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
1582
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
1583
|
-
// meant to be awaited.
|
|
1584
|
-
exports.awrap = function(arg) {
|
|
1585
|
-
return { __await: arg };
|
|
1586
|
-
};
|
|
1587
|
-
|
|
1588
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
1589
|
-
function invoke(method, arg, resolve, reject) {
|
|
1590
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
1591
|
-
if (record.type === "throw") {
|
|
1592
|
-
reject(record.arg);
|
|
1593
|
-
} else {
|
|
1594
|
-
var result = record.arg;
|
|
1595
|
-
var value = result.value;
|
|
1596
|
-
if (value &&
|
|
1597
|
-
typeof value === "object" &&
|
|
1598
|
-
hasOwn.call(value, "__await")) {
|
|
1599
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
1600
|
-
invoke("next", value, resolve, reject);
|
|
1601
|
-
}, function(err) {
|
|
1602
|
-
invoke("throw", err, resolve, reject);
|
|
1603
|
-
});
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
1607
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
1608
|
-
// the .value of the Promise<{value,done}> result for the
|
|
1609
|
-
// current iteration.
|
|
1610
|
-
result.value = unwrapped;
|
|
1611
|
-
resolve(result);
|
|
1612
|
-
}, function(error) {
|
|
1613
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
1614
|
-
// into the async generator function so it can be handled there.
|
|
1615
|
-
return invoke("throw", error, resolve, reject);
|
|
1616
|
-
});
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
var previousPromise;
|
|
1621
|
-
|
|
1622
|
-
function enqueue(method, arg) {
|
|
1623
|
-
function callInvokeWithMethodAndArg() {
|
|
1624
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
1625
|
-
invoke(method, arg, resolve, reject);
|
|
1626
|
-
});
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
|
-
return previousPromise =
|
|
1630
|
-
// If enqueue has been called before, then we want to wait until
|
|
1631
|
-
// all previous Promises have been resolved before calling invoke,
|
|
1632
|
-
// so that results are always delivered in the correct order. If
|
|
1633
|
-
// enqueue has not been called before, then it is important to
|
|
1634
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
1635
|
-
// so that the async generator function has the opportunity to do
|
|
1636
|
-
// any necessary setup in a predictable way. This predictability
|
|
1637
|
-
// is why the Promise constructor synchronously invokes its
|
|
1638
|
-
// executor callback, and why async functions synchronously
|
|
1639
|
-
// execute code before the first await. Since we implement simple
|
|
1640
|
-
// async functions in terms of async generators, it is especially
|
|
1641
|
-
// important to get this right, even though it requires care.
|
|
1642
|
-
previousPromise ? previousPromise.then(
|
|
1643
|
-
callInvokeWithMethodAndArg,
|
|
1644
|
-
// Avoid propagating failures to Promises returned by later
|
|
1645
|
-
// invocations of the iterator.
|
|
1646
|
-
callInvokeWithMethodAndArg
|
|
1647
|
-
) : callInvokeWithMethodAndArg();
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
// Define the unified helper method that is used to implement .next,
|
|
1651
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
1652
|
-
this._invoke = enqueue;
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
1656
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1657
|
-
return this;
|
|
1658
|
-
});
|
|
1659
|
-
exports.AsyncIterator = AsyncIterator;
|
|
1660
|
-
|
|
1661
|
-
// Note that simple async functions are implemented on top of
|
|
1662
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
1663
|
-
// the final result produced by the iterator.
|
|
1664
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1665
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
1666
|
-
|
|
1667
|
-
var iter = new AsyncIterator(
|
|
1668
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
1669
|
-
PromiseImpl
|
|
1670
|
-
);
|
|
1671
|
-
|
|
1672
|
-
return exports.isGeneratorFunction(outerFn)
|
|
1673
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
1674
|
-
: iter.next().then(function(result) {
|
|
1675
|
-
return result.done ? result.value : iter.next();
|
|
1676
|
-
});
|
|
1677
|
-
};
|
|
1678
|
-
|
|
1679
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
1680
|
-
var state = GenStateSuspendedStart;
|
|
1681
|
-
|
|
1682
|
-
return function invoke(method, arg) {
|
|
1683
|
-
if (state === GenStateExecuting) {
|
|
1684
|
-
throw new Error("Generator is already running");
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
if (state === GenStateCompleted) {
|
|
1688
|
-
if (method === "throw") {
|
|
1689
|
-
throw arg;
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
1693
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
1694
|
-
return doneResult();
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
context.method = method;
|
|
1698
|
-
context.arg = arg;
|
|
1699
|
-
|
|
1700
|
-
while (true) {
|
|
1701
|
-
var delegate = context.delegate;
|
|
1702
|
-
if (delegate) {
|
|
1703
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
1704
|
-
if (delegateResult) {
|
|
1705
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
1706
|
-
return delegateResult;
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
if (context.method === "next") {
|
|
1711
|
-
// Setting context._sent for legacy support of Babel's
|
|
1712
|
-
// function.sent implementation.
|
|
1713
|
-
context.sent = context._sent = context.arg;
|
|
1714
|
-
|
|
1715
|
-
} else if (context.method === "throw") {
|
|
1716
|
-
if (state === GenStateSuspendedStart) {
|
|
1717
|
-
state = GenStateCompleted;
|
|
1718
|
-
throw context.arg;
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
context.dispatchException(context.arg);
|
|
1722
|
-
|
|
1723
|
-
} else if (context.method === "return") {
|
|
1724
|
-
context.abrupt("return", context.arg);
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
state = GenStateExecuting;
|
|
1728
|
-
|
|
1729
|
-
var record = tryCatch(innerFn, self, context);
|
|
1730
|
-
if (record.type === "normal") {
|
|
1731
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
1732
|
-
// GenStateExecuting and loop back for another invocation.
|
|
1733
|
-
state = context.done
|
|
1734
|
-
? GenStateCompleted
|
|
1735
|
-
: GenStateSuspendedYield;
|
|
1736
|
-
|
|
1737
|
-
if (record.arg === ContinueSentinel) {
|
|
1738
|
-
continue;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
return {
|
|
1742
|
-
value: record.arg,
|
|
1743
|
-
done: context.done
|
|
1744
|
-
};
|
|
1745
|
-
|
|
1746
|
-
} else if (record.type === "throw") {
|
|
1747
|
-
state = GenStateCompleted;
|
|
1748
|
-
// Dispatch the exception by looping back around to the
|
|
1749
|
-
// context.dispatchException(context.arg) call above.
|
|
1750
|
-
context.method = "throw";
|
|
1751
|
-
context.arg = record.arg;
|
|
1752
|
-
}
|
|
1753
|
-
}
|
|
1754
|
-
};
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
1758
|
-
// result, either by returning a { value, done } result from the
|
|
1759
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
1760
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
1761
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
1762
|
-
var method = delegate.iterator[context.method];
|
|
1763
|
-
if (method === undefined$1) {
|
|
1764
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
1765
|
-
// method always terminates the yield* loop.
|
|
1766
|
-
context.delegate = null;
|
|
1767
|
-
|
|
1768
|
-
if (context.method === "throw") {
|
|
1769
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
1770
|
-
if (delegate.iterator["return"]) {
|
|
1771
|
-
// If the delegate iterator has a return method, give it a
|
|
1772
|
-
// chance to clean up.
|
|
1773
|
-
context.method = "return";
|
|
1774
|
-
context.arg = undefined$1;
|
|
1775
|
-
maybeInvokeDelegate(delegate, context);
|
|
1776
|
-
|
|
1777
|
-
if (context.method === "throw") {
|
|
1778
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
1779
|
-
// "return" to "throw", let that override the TypeError below.
|
|
1780
|
-
return ContinueSentinel;
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
context.method = "throw";
|
|
1785
|
-
context.arg = new TypeError(
|
|
1786
|
-
"The iterator does not provide a 'throw' method");
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
return ContinueSentinel;
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1793
|
-
|
|
1794
|
-
if (record.type === "throw") {
|
|
1795
|
-
context.method = "throw";
|
|
1796
|
-
context.arg = record.arg;
|
|
1797
|
-
context.delegate = null;
|
|
1798
|
-
return ContinueSentinel;
|
|
1799
|
-
}
|
|
1800
|
-
|
|
1801
|
-
var info = record.arg;
|
|
1802
|
-
|
|
1803
|
-
if (! info) {
|
|
1804
|
-
context.method = "throw";
|
|
1805
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
1806
|
-
context.delegate = null;
|
|
1807
|
-
return ContinueSentinel;
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
if (info.done) {
|
|
1811
|
-
// Assign the result of the finished delegate to the temporary
|
|
1812
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
1813
|
-
context[delegate.resultName] = info.value;
|
|
1814
|
-
|
|
1815
|
-
// Resume execution at the desired location (see delegateYield).
|
|
1816
|
-
context.next = delegate.nextLoc;
|
|
1817
|
-
|
|
1818
|
-
// If context.method was "throw" but the delegate handled the
|
|
1819
|
-
// exception, let the outer generator proceed normally. If
|
|
1820
|
-
// context.method was "next", forget context.arg since it has been
|
|
1821
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
1822
|
-
// "return", allow the original .return call to continue in the
|
|
1823
|
-
// outer generator.
|
|
1824
|
-
if (context.method !== "return") {
|
|
1825
|
-
context.method = "next";
|
|
1826
|
-
context.arg = undefined$1;
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
} else {
|
|
1830
|
-
// Re-yield the result returned by the delegate method.
|
|
1831
|
-
return info;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
1835
|
-
// the outer generator.
|
|
1836
|
-
context.delegate = null;
|
|
1837
|
-
return ContinueSentinel;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
1841
|
-
// unified ._invoke helper method.
|
|
1842
|
-
defineIteratorMethods(Gp);
|
|
1843
|
-
|
|
1844
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
1845
|
-
|
|
1846
|
-
// A Generator should always return itself as the iterator object when the
|
|
1847
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
1848
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
1849
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1850
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1851
|
-
define(Gp, iteratorSymbol, function() {
|
|
1852
|
-
return this;
|
|
1853
|
-
});
|
|
1854
|
-
|
|
1855
|
-
define(Gp, "toString", function() {
|
|
1856
|
-
return "[object Generator]";
|
|
1857
|
-
});
|
|
1858
|
-
|
|
1859
|
-
function pushTryEntry(locs) {
|
|
1860
|
-
var entry = { tryLoc: locs[0] };
|
|
1861
|
-
|
|
1862
|
-
if (1 in locs) {
|
|
1863
|
-
entry.catchLoc = locs[1];
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
if (2 in locs) {
|
|
1867
|
-
entry.finallyLoc = locs[2];
|
|
1868
|
-
entry.afterLoc = locs[3];
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
this.tryEntries.push(entry);
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
|
-
function resetTryEntry(entry) {
|
|
1875
|
-
var record = entry.completion || {};
|
|
1876
|
-
record.type = "normal";
|
|
1877
|
-
delete record.arg;
|
|
1878
|
-
entry.completion = record;
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
function Context(tryLocsList) {
|
|
1882
|
-
// The root entry object (effectively a try statement without a catch
|
|
1883
|
-
// or a finally block) gives us a place to store values thrown from
|
|
1884
|
-
// locations where there is no enclosing try statement.
|
|
1885
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
1886
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
1887
|
-
this.reset(true);
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
|
-
exports.keys = function(object) {
|
|
1891
|
-
var keys = [];
|
|
1892
|
-
for (var key in object) {
|
|
1893
|
-
keys.push(key);
|
|
1894
|
-
}
|
|
1895
|
-
keys.reverse();
|
|
1896
|
-
|
|
1897
|
-
// Rather than returning an object with a next method, we keep
|
|
1898
|
-
// things simple and return the next function itself.
|
|
1899
|
-
return function next() {
|
|
1900
|
-
while (keys.length) {
|
|
1901
|
-
var key = keys.pop();
|
|
1902
|
-
if (key in object) {
|
|
1903
|
-
next.value = key;
|
|
1904
|
-
next.done = false;
|
|
1905
|
-
return next;
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
// To avoid creating an additional object, we just hang the .value
|
|
1910
|
-
// and .done properties off the next function object itself. This
|
|
1911
|
-
// also ensures that the minifier will not anonymize the function.
|
|
1912
|
-
next.done = true;
|
|
1913
|
-
return next;
|
|
1914
|
-
};
|
|
1915
|
-
};
|
|
1916
|
-
|
|
1917
|
-
function values(iterable) {
|
|
1918
|
-
if (iterable) {
|
|
1919
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
1920
|
-
if (iteratorMethod) {
|
|
1921
|
-
return iteratorMethod.call(iterable);
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
if (typeof iterable.next === "function") {
|
|
1925
|
-
return iterable;
|
|
1926
|
-
}
|
|
1927
|
-
|
|
1928
|
-
if (!isNaN(iterable.length)) {
|
|
1929
|
-
var i = -1, next = function next() {
|
|
1930
|
-
while (++i < iterable.length) {
|
|
1931
|
-
if (hasOwn.call(iterable, i)) {
|
|
1932
|
-
next.value = iterable[i];
|
|
1933
|
-
next.done = false;
|
|
1934
|
-
return next;
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
next.value = undefined$1;
|
|
1939
|
-
next.done = true;
|
|
1940
|
-
|
|
1941
|
-
return next;
|
|
1942
|
-
};
|
|
1943
|
-
|
|
1944
|
-
return next.next = next;
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
// Return an iterator with no values.
|
|
1949
|
-
return { next: doneResult };
|
|
1950
|
-
}
|
|
1951
|
-
exports.values = values;
|
|
1952
|
-
|
|
1953
|
-
function doneResult() {
|
|
1954
|
-
return { value: undefined$1, done: true };
|
|
1955
|
-
}
|
|
1956
|
-
|
|
1957
|
-
Context.prototype = {
|
|
1958
|
-
constructor: Context,
|
|
1959
|
-
|
|
1960
|
-
reset: function(skipTempReset) {
|
|
1961
|
-
this.prev = 0;
|
|
1962
|
-
this.next = 0;
|
|
1963
|
-
// Resetting context._sent for legacy support of Babel's
|
|
1964
|
-
// function.sent implementation.
|
|
1965
|
-
this.sent = this._sent = undefined$1;
|
|
1966
|
-
this.done = false;
|
|
1967
|
-
this.delegate = null;
|
|
1968
|
-
|
|
1969
|
-
this.method = "next";
|
|
1970
|
-
this.arg = undefined$1;
|
|
1971
|
-
|
|
1972
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
1973
|
-
|
|
1974
|
-
if (!skipTempReset) {
|
|
1975
|
-
for (var name in this) {
|
|
1976
|
-
// Not sure about the optimal order of these conditions:
|
|
1977
|
-
if (name.charAt(0) === "t" &&
|
|
1978
|
-
hasOwn.call(this, name) &&
|
|
1979
|
-
!isNaN(+name.slice(1))) {
|
|
1980
|
-
this[name] = undefined$1;
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
|
-
},
|
|
1985
|
-
|
|
1986
|
-
stop: function() {
|
|
1987
|
-
this.done = true;
|
|
1988
|
-
|
|
1989
|
-
var rootEntry = this.tryEntries[0];
|
|
1990
|
-
var rootRecord = rootEntry.completion;
|
|
1991
|
-
if (rootRecord.type === "throw") {
|
|
1992
|
-
throw rootRecord.arg;
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
|
-
return this.rval;
|
|
1996
|
-
},
|
|
1997
|
-
|
|
1998
|
-
dispatchException: function(exception) {
|
|
1999
|
-
if (this.done) {
|
|
2000
|
-
throw exception;
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
var context = this;
|
|
2004
|
-
function handle(loc, caught) {
|
|
2005
|
-
record.type = "throw";
|
|
2006
|
-
record.arg = exception;
|
|
2007
|
-
context.next = loc;
|
|
2008
|
-
|
|
2009
|
-
if (caught) {
|
|
2010
|
-
// If the dispatched exception was caught by a catch block,
|
|
2011
|
-
// then let that catch block handle the exception normally.
|
|
2012
|
-
context.method = "next";
|
|
2013
|
-
context.arg = undefined$1;
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
return !! caught;
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2020
|
-
var entry = this.tryEntries[i];
|
|
2021
|
-
var record = entry.completion;
|
|
2022
|
-
|
|
2023
|
-
if (entry.tryLoc === "root") {
|
|
2024
|
-
// Exception thrown outside of any try block that could handle
|
|
2025
|
-
// it, so set the completion value of the entire function to
|
|
2026
|
-
// throw the exception.
|
|
2027
|
-
return handle("end");
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
if (entry.tryLoc <= this.prev) {
|
|
2031
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
2032
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
2033
|
-
|
|
2034
|
-
if (hasCatch && hasFinally) {
|
|
2035
|
-
if (this.prev < entry.catchLoc) {
|
|
2036
|
-
return handle(entry.catchLoc, true);
|
|
2037
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
2038
|
-
return handle(entry.finallyLoc);
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
} else if (hasCatch) {
|
|
2042
|
-
if (this.prev < entry.catchLoc) {
|
|
2043
|
-
return handle(entry.catchLoc, true);
|
|
2044
|
-
}
|
|
2045
|
-
|
|
2046
|
-
} else if (hasFinally) {
|
|
2047
|
-
if (this.prev < entry.finallyLoc) {
|
|
2048
|
-
return handle(entry.finallyLoc);
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
} else {
|
|
2052
|
-
throw new Error("try statement without catch or finally");
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
|
-
},
|
|
2057
|
-
|
|
2058
|
-
abrupt: function(type, arg) {
|
|
2059
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2060
|
-
var entry = this.tryEntries[i];
|
|
2061
|
-
if (entry.tryLoc <= this.prev &&
|
|
2062
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
2063
|
-
this.prev < entry.finallyLoc) {
|
|
2064
|
-
var finallyEntry = entry;
|
|
2065
|
-
break;
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
|
|
2069
|
-
if (finallyEntry &&
|
|
2070
|
-
(type === "break" ||
|
|
2071
|
-
type === "continue") &&
|
|
2072
|
-
finallyEntry.tryLoc <= arg &&
|
|
2073
|
-
arg <= finallyEntry.finallyLoc) {
|
|
2074
|
-
// Ignore the finally entry if control is not jumping to a
|
|
2075
|
-
// location outside the try/catch block.
|
|
2076
|
-
finallyEntry = null;
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2079
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
2080
|
-
record.type = type;
|
|
2081
|
-
record.arg = arg;
|
|
2082
|
-
|
|
2083
|
-
if (finallyEntry) {
|
|
2084
|
-
this.method = "next";
|
|
2085
|
-
this.next = finallyEntry.finallyLoc;
|
|
2086
|
-
return ContinueSentinel;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
return this.complete(record);
|
|
2090
|
-
},
|
|
2091
|
-
|
|
2092
|
-
complete: function(record, afterLoc) {
|
|
2093
|
-
if (record.type === "throw") {
|
|
2094
|
-
throw record.arg;
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
if (record.type === "break" ||
|
|
2098
|
-
record.type === "continue") {
|
|
2099
|
-
this.next = record.arg;
|
|
2100
|
-
} else if (record.type === "return") {
|
|
2101
|
-
this.rval = this.arg = record.arg;
|
|
2102
|
-
this.method = "return";
|
|
2103
|
-
this.next = "end";
|
|
2104
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
2105
|
-
this.next = afterLoc;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
return ContinueSentinel;
|
|
2109
|
-
},
|
|
2110
|
-
|
|
2111
|
-
finish: function(finallyLoc) {
|
|
2112
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2113
|
-
var entry = this.tryEntries[i];
|
|
2114
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
2115
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
2116
|
-
resetTryEntry(entry);
|
|
2117
|
-
return ContinueSentinel;
|
|
2118
|
-
}
|
|
2119
|
-
}
|
|
2120
|
-
},
|
|
2121
|
-
|
|
2122
|
-
"catch": function(tryLoc) {
|
|
2123
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2124
|
-
var entry = this.tryEntries[i];
|
|
2125
|
-
if (entry.tryLoc === tryLoc) {
|
|
2126
|
-
var record = entry.completion;
|
|
2127
|
-
if (record.type === "throw") {
|
|
2128
|
-
var thrown = record.arg;
|
|
2129
|
-
resetTryEntry(entry);
|
|
2130
|
-
}
|
|
2131
|
-
return thrown;
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
// The context.catch method must only be called with a location
|
|
2136
|
-
// argument that corresponds to a known catch block.
|
|
2137
|
-
throw new Error("illegal catch attempt");
|
|
2138
|
-
},
|
|
2139
|
-
|
|
2140
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
2141
|
-
this.delegate = {
|
|
2142
|
-
iterator: values(iterable),
|
|
2143
|
-
resultName: resultName,
|
|
2144
|
-
nextLoc: nextLoc
|
|
2145
|
-
};
|
|
2146
|
-
|
|
2147
|
-
if (this.method === "next") {
|
|
2148
|
-
// Deliberately forget the last sent value so that we don't
|
|
2149
|
-
// accidentally pass it on to the delegate.
|
|
2150
|
-
this.arg = undefined$1;
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
return ContinueSentinel;
|
|
2154
|
-
}
|
|
2155
|
-
};
|
|
2156
|
-
|
|
2157
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
2158
|
-
// or not, return the runtime object so that we can declare the variable
|
|
2159
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
2160
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
2161
|
-
return exports;
|
|
2162
|
-
|
|
2163
|
-
}(
|
|
2164
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
2165
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
2166
|
-
// object. Either way, the resulting object will be used to initialize
|
|
2167
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
2168
|
-
module.exports
|
|
2169
|
-
));
|
|
2170
|
-
|
|
2171
|
-
try {
|
|
2172
|
-
regeneratorRuntime = runtime;
|
|
2173
|
-
} catch (accidentalStrictMode) {
|
|
2174
|
-
// This module should not be running in strict mode, so the above
|
|
2175
|
-
// assignment should always work unless something is misconfigured. Just
|
|
2176
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
2177
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
2178
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
2179
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
2180
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
2181
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
2182
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
2183
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
2184
|
-
if (typeof globalThis === "object") {
|
|
2185
|
-
globalThis.regeneratorRuntime = runtime;
|
|
2186
|
-
} else {
|
|
2187
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
|
-
});
|
|
2191
|
-
|
|
2192
|
-
/**
|
|
2193
|
-
* A specialized version of `_.reduce` for arrays without support for
|
|
2194
|
-
* iteratee shorthands.
|
|
2195
|
-
*
|
|
2196
|
-
* @private
|
|
2197
|
-
* @param {Array} [array] The array to iterate over.
|
|
2198
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2199
|
-
* @param {*} [accumulator] The initial value.
|
|
2200
|
-
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
2201
|
-
* the initial value.
|
|
2202
|
-
* @returns {*} Returns the accumulated value.
|
|
2203
|
-
*/
|
|
2204
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
2205
|
-
var index = -1,
|
|
2206
|
-
length = array == null ? 0 : array.length;
|
|
2207
|
-
|
|
2208
|
-
if (initAccum && length) {
|
|
2209
|
-
accumulator = array[++index];
|
|
2210
|
-
}
|
|
2211
|
-
while (++index < length) {
|
|
2212
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
2213
|
-
}
|
|
2214
|
-
return accumulator;
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
var _arrayReduce = arrayReduce;
|
|
2218
|
-
|
|
2219
|
-
/**
|
|
2220
|
-
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
2221
|
-
*
|
|
2222
|
-
* @private
|
|
2223
|
-
* @param {Object} object The object to query.
|
|
2224
|
-
* @returns {Function} Returns the new accessor function.
|
|
2225
|
-
*/
|
|
2226
|
-
function basePropertyOf(object) {
|
|
2227
|
-
return function(key) {
|
|
2228
|
-
return object == null ? undefined : object[key];
|
|
2229
|
-
};
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
var _basePropertyOf = basePropertyOf;
|
|
2233
|
-
|
|
2234
|
-
/** Used to map Latin Unicode letters to basic Latin letters. */
|
|
2235
|
-
var deburredLetters = {
|
|
2236
|
-
// Latin-1 Supplement block.
|
|
2237
|
-
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
|
2238
|
-
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
|
2239
|
-
'\xc7': 'C', '\xe7': 'c',
|
|
2240
|
-
'\xd0': 'D', '\xf0': 'd',
|
|
2241
|
-
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
|
2242
|
-
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
|
2243
|
-
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
|
2244
|
-
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
|
2245
|
-
'\xd1': 'N', '\xf1': 'n',
|
|
2246
|
-
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
|
2247
|
-
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
|
2248
|
-
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
|
|
2249
|
-
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
|
|
2250
|
-
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
|
2251
|
-
'\xc6': 'Ae', '\xe6': 'ae',
|
|
2252
|
-
'\xde': 'Th', '\xfe': 'th',
|
|
2253
|
-
'\xdf': 'ss',
|
|
2254
|
-
// Latin Extended-A block.
|
|
2255
|
-
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
|
|
2256
|
-
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
|
|
2257
|
-
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
|
|
2258
|
-
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
|
|
2259
|
-
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
|
|
2260
|
-
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
|
|
2261
|
-
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
|
|
2262
|
-
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
|
|
2263
|
-
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
|
|
2264
|
-
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
|
|
2265
|
-
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
|
|
2266
|
-
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
|
|
2267
|
-
'\u0134': 'J', '\u0135': 'j',
|
|
2268
|
-
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
|
|
2269
|
-
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
|
|
2270
|
-
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
|
|
2271
|
-
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
|
|
2272
|
-
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
|
|
2273
|
-
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
|
|
2274
|
-
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
|
|
2275
|
-
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
|
|
2276
|
-
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
|
|
2277
|
-
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
|
|
2278
|
-
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
|
|
2279
|
-
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
|
|
2280
|
-
'\u0163': 't', '\u0165': 't', '\u0167': 't',
|
|
2281
|
-
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
|
|
2282
|
-
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
|
|
2283
|
-
'\u0174': 'W', '\u0175': 'w',
|
|
2284
|
-
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
|
|
2285
|
-
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
|
|
2286
|
-
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
|
2287
|
-
'\u0132': 'IJ', '\u0133': 'ij',
|
|
2288
|
-
'\u0152': 'Oe', '\u0153': 'oe',
|
|
2289
|
-
'\u0149': "'n", '\u017f': 's'
|
|
2290
|
-
};
|
|
2291
|
-
|
|
2292
|
-
/**
|
|
2293
|
-
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
|
|
2294
|
-
* letters to basic Latin letters.
|
|
2295
|
-
*
|
|
2296
|
-
* @private
|
|
2297
|
-
* @param {string} letter The matched letter to deburr.
|
|
2298
|
-
* @returns {string} Returns the deburred letter.
|
|
2299
|
-
*/
|
|
2300
|
-
var deburrLetter = _basePropertyOf(deburredLetters);
|
|
2301
|
-
|
|
2302
|
-
var _deburrLetter = deburrLetter;
|
|
2303
|
-
|
|
2304
|
-
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
2305
|
-
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
2306
|
-
|
|
2307
|
-
/** Used to compose unicode character classes. */
|
|
2308
|
-
var rsComboMarksRange$1 = '\\u0300-\\u036f',
|
|
2309
|
-
reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
|
|
2310
|
-
rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
|
|
2311
|
-
rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
|
2312
|
-
|
|
2313
|
-
/** Used to compose unicode capture groups. */
|
|
2314
|
-
var rsCombo$1 = '[' + rsComboRange$1 + ']';
|
|
2315
|
-
|
|
2316
|
-
/**
|
|
2317
|
-
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
|
2318
|
-
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
2319
|
-
*/
|
|
2320
|
-
var reComboMark = RegExp(rsCombo$1, 'g');
|
|
2321
|
-
|
|
2322
|
-
/**
|
|
2323
|
-
* Deburrs `string` by converting
|
|
2324
|
-
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
|
2325
|
-
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
|
2326
|
-
* letters to basic Latin letters and removing
|
|
2327
|
-
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
|
2328
|
-
*
|
|
2329
|
-
* @static
|
|
2330
|
-
* @memberOf _
|
|
2331
|
-
* @since 3.0.0
|
|
2332
|
-
* @category String
|
|
2333
|
-
* @param {string} [string=''] The string to deburr.
|
|
2334
|
-
* @returns {string} Returns the deburred string.
|
|
2335
|
-
* @example
|
|
2336
|
-
*
|
|
2337
|
-
* _.deburr('déjà vu');
|
|
2338
|
-
* // => 'deja vu'
|
|
2339
|
-
*/
|
|
2340
|
-
function deburr(string) {
|
|
2341
|
-
string = toString_1(string);
|
|
2342
|
-
return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
|
-
var deburr_1 = deburr;
|
|
2346
|
-
|
|
2347
|
-
/** Used to match words composed of alphanumeric characters. */
|
|
2348
|
-
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
2349
|
-
|
|
2350
|
-
/**
|
|
2351
|
-
* Splits an ASCII `string` into an array of its words.
|
|
2352
|
-
*
|
|
2353
|
-
* @private
|
|
2354
|
-
* @param {string} The string to inspect.
|
|
2355
|
-
* @returns {Array} Returns the words of `string`.
|
|
2356
|
-
*/
|
|
2357
|
-
function asciiWords(string) {
|
|
2358
|
-
return string.match(reAsciiWord) || [];
|
|
2359
|
-
}
|
|
2360
|
-
|
|
2361
|
-
var _asciiWords = asciiWords;
|
|
2362
|
-
|
|
2363
|
-
/** Used to detect strings that need a more robust regexp to match words. */
|
|
2364
|
-
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 ]/;
|
|
2365
|
-
|
|
2366
|
-
/**
|
|
2367
|
-
* Checks if `string` contains a word composed of Unicode symbols.
|
|
2368
|
-
*
|
|
2369
|
-
* @private
|
|
2370
|
-
* @param {string} string The string to inspect.
|
|
2371
|
-
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
|
2372
|
-
*/
|
|
2373
|
-
function hasUnicodeWord(string) {
|
|
2374
|
-
return reHasUnicodeWord.test(string);
|
|
2375
|
-
}
|
|
2376
|
-
|
|
2377
|
-
var _hasUnicodeWord = hasUnicodeWord;
|
|
2378
|
-
|
|
2379
|
-
/** Used to compose unicode character classes. */
|
|
2380
|
-
var rsAstralRange = '\\ud800-\\udfff',
|
|
2381
|
-
rsComboMarksRange = '\\u0300-\\u036f',
|
|
2382
|
-
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
|
2383
|
-
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
|
2384
|
-
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
|
2385
|
-
rsDingbatRange = '\\u2700-\\u27bf',
|
|
2386
|
-
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
|
2387
|
-
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
|
2388
|
-
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
|
2389
|
-
rsPunctuationRange = '\\u2000-\\u206f',
|
|
2390
|
-
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',
|
|
2391
|
-
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
|
2392
|
-
rsVarRange = '\\ufe0e\\ufe0f',
|
|
2393
|
-
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
2394
|
-
|
|
2395
|
-
/** Used to compose unicode capture groups. */
|
|
2396
|
-
var rsApos$1 = "['\u2019]",
|
|
2397
|
-
rsBreak = '[' + rsBreakRange + ']',
|
|
2398
|
-
rsCombo = '[' + rsComboRange + ']',
|
|
2399
|
-
rsDigits = '\\d+',
|
|
2400
|
-
rsDingbat = '[' + rsDingbatRange + ']',
|
|
2401
|
-
rsLower = '[' + rsLowerRange + ']',
|
|
2402
|
-
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
|
2403
|
-
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
2404
|
-
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
2405
|
-
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
2406
|
-
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
2407
|
-
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
2408
|
-
rsUpper = '[' + rsUpperRange + ']',
|
|
2409
|
-
rsZWJ = '\\u200d';
|
|
2410
|
-
|
|
2411
|
-
/** Used to compose unicode regexes. */
|
|
2412
|
-
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
|
2413
|
-
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
|
2414
|
-
rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?',
|
|
2415
|
-
rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?',
|
|
2416
|
-
reOptMod = rsModifier + '?',
|
|
2417
|
-
rsOptVar = '[' + rsVarRange + ']?',
|
|
2418
|
-
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
2419
|
-
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
|
2420
|
-
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
|
2421
|
-
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
2422
|
-
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
|
|
2423
|
-
|
|
2424
|
-
/** Used to match complex or compound words. */
|
|
2425
|
-
var reUnicodeWord = RegExp([
|
|
2426
|
-
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
|
|
2427
|
-
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
|
|
2428
|
-
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
|
|
2429
|
-
rsUpper + '+' + rsOptContrUpper,
|
|
2430
|
-
rsOrdUpper,
|
|
2431
|
-
rsOrdLower,
|
|
2432
|
-
rsDigits,
|
|
2433
|
-
rsEmoji
|
|
2434
|
-
].join('|'), 'g');
|
|
2435
|
-
|
|
2436
|
-
/**
|
|
2437
|
-
* Splits a Unicode `string` into an array of its words.
|
|
2438
|
-
*
|
|
2439
|
-
* @private
|
|
2440
|
-
* @param {string} The string to inspect.
|
|
2441
|
-
* @returns {Array} Returns the words of `string`.
|
|
2442
|
-
*/
|
|
2443
|
-
function unicodeWords(string) {
|
|
2444
|
-
return string.match(reUnicodeWord) || [];
|
|
2445
|
-
}
|
|
2446
|
-
|
|
2447
|
-
var _unicodeWords = unicodeWords;
|
|
2448
|
-
|
|
2449
|
-
/**
|
|
2450
|
-
* Splits `string` into an array of its words.
|
|
2451
|
-
*
|
|
2452
|
-
* @static
|
|
2453
|
-
* @memberOf _
|
|
2454
|
-
* @since 3.0.0
|
|
2455
|
-
* @category String
|
|
2456
|
-
* @param {string} [string=''] The string to inspect.
|
|
2457
|
-
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
2458
|
-
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
2459
|
-
* @returns {Array} Returns the words of `string`.
|
|
2460
|
-
* @example
|
|
2461
|
-
*
|
|
2462
|
-
* _.words('fred, barney, & pebbles');
|
|
2463
|
-
* // => ['fred', 'barney', 'pebbles']
|
|
2464
|
-
*
|
|
2465
|
-
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
|
2466
|
-
* // => ['fred', 'barney', '&', 'pebbles']
|
|
2467
|
-
*/
|
|
2468
|
-
function words(string, pattern, guard) {
|
|
2469
|
-
string = toString_1(string);
|
|
2470
|
-
pattern = guard ? undefined : pattern;
|
|
2471
|
-
|
|
2472
|
-
if (pattern === undefined) {
|
|
2473
|
-
return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
|
|
2474
|
-
}
|
|
2475
|
-
return string.match(pattern) || [];
|
|
2476
|
-
}
|
|
2477
|
-
|
|
2478
|
-
var words_1 = words;
|
|
2479
|
-
|
|
2480
|
-
/** Used to compose unicode capture groups. */
|
|
2481
|
-
var rsApos = "['\u2019]";
|
|
2482
|
-
|
|
2483
|
-
/** Used to match apostrophes. */
|
|
2484
|
-
var reApos = RegExp(rsApos, 'g');
|
|
2485
|
-
|
|
2486
|
-
/**
|
|
2487
|
-
* Creates a function like `_.camelCase`.
|
|
2488
|
-
*
|
|
2489
|
-
* @private
|
|
2490
|
-
* @param {Function} callback The function to combine each word.
|
|
2491
|
-
* @returns {Function} Returns the new compounder function.
|
|
2492
|
-
*/
|
|
2493
|
-
function createCompounder(callback) {
|
|
2494
|
-
return function(string) {
|
|
2495
|
-
return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
|
|
2496
|
-
};
|
|
2497
|
-
}
|
|
2498
|
-
|
|
2499
|
-
var _createCompounder = createCompounder;
|
|
2500
|
-
|
|
2501
|
-
/**
|
|
2502
|
-
* Converts `string`, as space separated words, to upper case.
|
|
2503
|
-
*
|
|
2504
|
-
* @static
|
|
2505
|
-
* @memberOf _
|
|
2506
|
-
* @since 4.0.0
|
|
2507
|
-
* @category String
|
|
2508
|
-
* @param {string} [string=''] The string to convert.
|
|
2509
|
-
* @returns {string} Returns the upper cased string.
|
|
2510
|
-
* @example
|
|
2511
|
-
*
|
|
2512
|
-
* _.upperCase('--foo-bar');
|
|
2513
|
-
* // => 'FOO BAR'
|
|
2514
|
-
*
|
|
2515
|
-
* _.upperCase('fooBar');
|
|
2516
|
-
* // => 'FOO BAR'
|
|
2517
|
-
*
|
|
2518
|
-
* _.upperCase('__foo_bar__');
|
|
2519
|
-
* // => 'FOO BAR'
|
|
2520
|
-
*/
|
|
2521
|
-
var upperCase = _createCompounder(function(result, word, index) {
|
|
2522
|
-
return result + (index ? ' ' : '') + word.toUpperCase();
|
|
2523
|
-
});
|
|
2524
|
-
|
|
2525
|
-
var upperCase_1 = upperCase;
|
|
2526
|
-
|
|
2527
|
-
/**
|
|
2528
|
-
* Converts `string`, as space separated words, to lower case.
|
|
2529
|
-
*
|
|
2530
|
-
* @static
|
|
2531
|
-
* @memberOf _
|
|
2532
|
-
* @since 4.0.0
|
|
2533
|
-
* @category String
|
|
2534
|
-
* @param {string} [string=''] The string to convert.
|
|
2535
|
-
* @returns {string} Returns the lower cased string.
|
|
2536
|
-
* @example
|
|
2537
|
-
*
|
|
2538
|
-
* _.lowerCase('--Foo-Bar--');
|
|
2539
|
-
* // => 'foo bar'
|
|
2540
|
-
*
|
|
2541
|
-
* _.lowerCase('fooBar');
|
|
2542
|
-
* // => 'foo bar'
|
|
2543
|
-
*
|
|
2544
|
-
* _.lowerCase('__FOO_BAR__');
|
|
2545
|
-
* // => 'foo bar'
|
|
2546
|
-
*/
|
|
2547
|
-
var lowerCase = _createCompounder(function(result, word, index) {
|
|
2548
|
-
return result + (index ? ' ' : '') + word.toLowerCase();
|
|
2549
|
-
});
|
|
2550
|
-
|
|
2551
|
-
var lowerCase_1 = lowerCase;
|
|
2552
|
-
|
|
2553
29
|
function truncate() {
|
|
2554
30
|
var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2555
31
|
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
|
|
@@ -2576,7 +52,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2576
52
|
var localizedMonth = month;
|
|
2577
53
|
|
|
2578
54
|
if (isUpperCase) {
|
|
2579
|
-
localizedMonth =
|
|
55
|
+
localizedMonth = lodash.upperCase(month);
|
|
2580
56
|
}
|
|
2581
57
|
|
|
2582
58
|
var year = dateTime.getFullYear();
|
|
@@ -2589,7 +65,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2589
65
|
var timetoShow;
|
|
2590
66
|
|
|
2591
67
|
if (localizedMonths) {
|
|
2592
|
-
localizedMonth =
|
|
68
|
+
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
2593
69
|
}
|
|
2594
70
|
|
|
2595
71
|
if (localizedMeridiem) {
|
|
@@ -2619,17 +95,17 @@ function formatter(value, unit, suffix, date, config) {
|
|
|
2619
95
|
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
2620
96
|
// unit here refers to seconds, minute, minutes,...
|
|
2621
97
|
|
|
2622
|
-
var localizedSuffix =
|
|
98
|
+
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
2623
99
|
var localizedUnitOfTime;
|
|
2624
100
|
|
|
2625
101
|
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
2626
102
|
return timestampToFormat(value, unit, suffix, date, config);
|
|
2627
103
|
} else if (value > 1) {
|
|
2628
|
-
localizedUnitOfTime =
|
|
104
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
2629
105
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
2630
106
|
}
|
|
2631
107
|
|
|
2632
|
-
localizedUnitOfTime =
|
|
108
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
2633
109
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
2634
110
|
}
|
|
2635
111
|
|
|
@@ -2682,10 +158,10 @@ var clientWidths = {
|
|
|
2682
158
|
tablet: 1024
|
|
2683
159
|
};
|
|
2684
160
|
var clientWidth = function clientWidth(device) {
|
|
2685
|
-
var foundDeviceWidth =
|
|
161
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2686
162
|
|
|
2687
163
|
if (foundDeviceWidth) {
|
|
2688
|
-
return
|
|
164
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2689
165
|
}
|
|
2690
166
|
|
|
2691
167
|
return false;
|
|
@@ -2715,7 +191,7 @@ var getSlug = function getSlug(collection) {
|
|
|
2715
191
|
var isSection = collection.template === "section";
|
|
2716
192
|
|
|
2717
193
|
if (isSection) {
|
|
2718
|
-
var sectionId =
|
|
194
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
2719
195
|
var sections = config.sections;
|
|
2720
196
|
var section = sections && sections.find(function (section) {
|
|
2721
197
|
return section.id === sectionId;
|
|
@@ -2731,11 +207,11 @@ function isExternalStory() {
|
|
|
2731
207
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2732
208
|
_story$metadata = story.metadata,
|
|
2733
209
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2734
|
-
return storyTemplate === "news-elsewhere" ?
|
|
210
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2735
211
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2736
212
|
var isEmpty = function isEmpty(value) {
|
|
2737
213
|
return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
|
|
2738
|
-
|
|
214
|
+
_typeof__default["default"](value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
|
|
2739
215
|
};
|
|
2740
216
|
PropTypes__default["default"].shape({
|
|
2741
217
|
"sketches-host": PropTypes__default["default"].string,
|
|
@@ -2749,7 +225,7 @@ PropTypes__default["default"].shape({
|
|
|
2749
225
|
});
|
|
2750
226
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2751
227
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2752
|
-
return
|
|
228
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2753
229
|
};
|
|
2754
230
|
var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
2755
231
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -2932,7 +408,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2932
408
|
return null;
|
|
2933
409
|
} : _config$StoryTemplate;
|
|
2934
410
|
var showImagePlaceholder = reactRedux.useSelector(function (state) {
|
|
2935
|
-
return
|
|
411
|
+
return lodash.get(state, ["qt", "config", "showPlaceholder"]);
|
|
2936
412
|
});
|
|
2937
413
|
var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
|
|
2938
414
|
var fullBleed = FullBleed ? "" : "with-padding";
|
|
@@ -2941,7 +417,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2941
417
|
var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
|
|
2942
418
|
|
|
2943
419
|
var getPadding = function getPadding(aspectRatio) {
|
|
2944
|
-
var _aspectRatio =
|
|
420
|
+
var _aspectRatio = _slicedToArray__default["default"](aspectRatio, 2),
|
|
2945
421
|
height = _aspectRatio[0],
|
|
2946
422
|
width = _aspectRatio[1];
|
|
2947
423
|
|
|
@@ -2953,7 +429,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2953
429
|
return 0;
|
|
2954
430
|
};
|
|
2955
431
|
|
|
2956
|
-
var _aspectRatio2 =
|
|
432
|
+
var _aspectRatio2 = _slicedToArray__default["default"](aspectRatio, 2),
|
|
2957
433
|
mobileAspectRatio = _aspectRatio2[0],
|
|
2958
434
|
_aspectRatio2$ = _aspectRatio2[1],
|
|
2959
435
|
desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
|
|
@@ -2961,8 +437,8 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2961
437
|
var isMobile = clientWidth("mobile");
|
|
2962
438
|
var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
|
|
2963
439
|
var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
|
|
2964
|
-
var slug =
|
|
2965
|
-
var hyperLink =
|
|
440
|
+
var slug = lodash.get(story, ["hero-image-s3-key"]) || lodash.get(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
|
|
441
|
+
var hyperLink = lodash.get(story, ["hero-image-hyperlink"], "");
|
|
2966
442
|
|
|
2967
443
|
var fallbackImage = function fallbackImage() {
|
|
2968
444
|
if (!slug) {
|
|
@@ -2971,7 +447,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2971
447
|
style: {
|
|
2972
448
|
paddingTop: imagePadding + "%"
|
|
2973
449
|
},
|
|
2974
|
-
className: "arr--responsive-hero-image " +
|
|
450
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
2975
451
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
2976
452
|
className: "qt-image",
|
|
2977
453
|
"data-src": "".concat(fallbackImageUrl),
|
|
@@ -2984,7 +460,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2984
460
|
style: {
|
|
2985
461
|
paddingTop: imagePadding + "%"
|
|
2986
462
|
},
|
|
2987
|
-
className: "arr--fallback-hero-image " +
|
|
463
|
+
className: "arr--fallback-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
2988
464
|
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
2989
465
|
storyTemplate: story["story-template"]
|
|
2990
466
|
}), /*#__PURE__*/React__default["default"].createElement(FallbackImage, null)) : null);
|
|
@@ -2994,7 +470,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2994
470
|
style: {
|
|
2995
471
|
paddingTop: imagePadding + "%"
|
|
2996
472
|
},
|
|
2997
|
-
className: "arr--responsive-hero-image " +
|
|
473
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
2998
474
|
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
2999
475
|
storyTemplate: story["story-template"]
|
|
3000
476
|
}), /*#__PURE__*/React__default["default"].createElement(components.ResponsiveHeroImage, {
|
|
@@ -3013,13 +489,13 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3013
489
|
|
|
3014
490
|
return story && (isStoryPageImage ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3015
491
|
"data-test-id": "arr--hero-image",
|
|
3016
|
-
className: "arr--hero-image " +
|
|
492
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$b)
|
|
3017
493
|
}, fallbackImage()) : /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3018
494
|
"data-test-id": "arr--hero-image",
|
|
3019
495
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3020
496
|
externalLink: isExternalStory(story),
|
|
3021
497
|
"aria-label": "fallback-hero-image",
|
|
3022
|
-
className: "arr--hero-image " +
|
|
498
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$b)
|
|
3023
499
|
}, fallbackImage()));
|
|
3024
500
|
};
|
|
3025
501
|
HeroImage.propTypes = {
|
|
@@ -3082,9 +558,9 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3082
558
|
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
3083
559
|
isLightTheme = _ref.isLightTheme;
|
|
3084
560
|
var config = useStateValue() || {};
|
|
3085
|
-
var isSection =
|
|
3086
|
-
var templateFromRowContext =
|
|
3087
|
-
var section =
|
|
561
|
+
var isSection = lodash.get(config, ["showSection"], true);
|
|
562
|
+
var templateFromRowContext = lodash.get(config, ["sectionTagTemplate"]);
|
|
563
|
+
var section = lodash.get(story, ["sections", 0], "");
|
|
3088
564
|
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
3089
565
|
var getUrl = section ? section["section-url"] : "/";
|
|
3090
566
|
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
@@ -3106,7 +582,7 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3106
582
|
style: {
|
|
3107
583
|
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
3108
584
|
},
|
|
3109
|
-
className: "section-tag arrow-component " +
|
|
585
|
+
className: "section-tag arrow-component " + _getClassName__default["default"]("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$a)
|
|
3110
586
|
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3111
587
|
className: "section-m_border-left__2oUyp",
|
|
3112
588
|
style: {
|
|
@@ -3149,13 +625,13 @@ var TimeStamp = function TimeStamp(_ref) {
|
|
|
3149
625
|
_ref$config = _ref.config,
|
|
3150
626
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3151
627
|
var configState = useStateValue() || {};
|
|
3152
|
-
var isTime =
|
|
628
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
3153
629
|
var time = story["last-published-at"] || story["first-published-at"];
|
|
3154
630
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3155
631
|
var textColor = getTextColor(configState.theme);
|
|
3156
632
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isTime && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3157
633
|
"data-test-id": "publish-time",
|
|
3158
|
-
className: "time arr--publish-time " +
|
|
634
|
+
className: "time arr--publish-time " + _getClassName__default["default"]("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$9)
|
|
3159
635
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3160
636
|
className: "timestamp-m_time-wrapper__3O2lM"
|
|
3161
637
|
}, getTimeStamp(time, formatter, config))));
|
|
@@ -3190,9 +666,9 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3190
666
|
_ref$config = _ref.config,
|
|
3191
667
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3192
668
|
var configData = useStateValue() || {};
|
|
3193
|
-
var isAuthor =
|
|
669
|
+
var isAuthor = lodash.get(configData, ["showAuthor"], true);
|
|
3194
670
|
|
|
3195
|
-
var _get =
|
|
671
|
+
var _get = lodash.get(story, ["authors", "0"], ""),
|
|
3196
672
|
avatarUrl = _get["avatar-url"],
|
|
3197
673
|
avatarS3Key = _get["avatar-s3-key"],
|
|
3198
674
|
authorName = _get.name,
|
|
@@ -3200,7 +676,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3200
676
|
|
|
3201
677
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3202
678
|
var textColor = getTextColor(configData.theme);
|
|
3203
|
-
var mountAt =
|
|
679
|
+
var mountAt = lodash.get(config, ["mountAt"], "");
|
|
3204
680
|
|
|
3205
681
|
var authorImage = function authorImage(dir) {
|
|
3206
682
|
if (!avatarUrl && !avatarS3Key) {
|
|
@@ -3209,7 +685,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3209
685
|
|
|
3210
686
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3211
687
|
"data-test-id": "author-image",
|
|
3212
|
-
className:
|
|
688
|
+
className: _getClassName__default["default"]("author-image ".concat(dir, "-image"), _styleModuleImportMap$8)
|
|
3213
689
|
}, /*#__PURE__*/React__default["default"].createElement("figure", null, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
3214
690
|
slug: avatarS3Key,
|
|
3215
691
|
"aspect-ratio": [1, 1],
|
|
@@ -3226,7 +702,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3226
702
|
var isPrefix = function isPrefix(dir) {
|
|
3227
703
|
if (prefix) {
|
|
3228
704
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3229
|
-
className: "arr-author-prefix " +
|
|
705
|
+
className: "arr-author-prefix " + _getClassName__default["default"]("prefix ".concat(textColor), _styleModuleImportMap$8)
|
|
3230
706
|
}, prefix);
|
|
3231
707
|
}
|
|
3232
708
|
|
|
@@ -3236,16 +712,16 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3236
712
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3237
713
|
href: "".concat(mountAt, "/author/") + slug,
|
|
3238
714
|
"aria-label": "author-name",
|
|
3239
|
-
className: "author-name arr-author-name arrow-component " +
|
|
715
|
+
className: "author-name arr-author-name arrow-component " + _getClassName__default["default"]("author ".concat(isBottomClasses), _styleModuleImportMap$8)
|
|
3240
716
|
}, isPrefix("ltr"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3241
717
|
"data-test-id": "author-name",
|
|
3242
|
-
className: "author-name " +
|
|
718
|
+
className: "author-name " + _getClassName__default["default"]("author-name ".concat(textColor), _styleModuleImportMap$8)
|
|
3243
719
|
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
3244
720
|
};
|
|
3245
721
|
|
|
3246
722
|
function mapStateToProps$1(state) {
|
|
3247
723
|
return {
|
|
3248
|
-
config:
|
|
724
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3249
725
|
};
|
|
3250
726
|
}
|
|
3251
727
|
|
|
@@ -3282,7 +758,7 @@ var Dot = function Dot(_ref) {
|
|
|
3282
758
|
_ref$color = _ref.color,
|
|
3283
759
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3284
760
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3285
|
-
className:
|
|
761
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$7)
|
|
3286
762
|
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3287
763
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3288
764
|
width: width,
|
|
@@ -3318,7 +794,7 @@ var Divider = function Divider(_ref) {
|
|
|
3318
794
|
_ref$color = _ref.color,
|
|
3319
795
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3320
796
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3321
|
-
className:
|
|
797
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$6)
|
|
3322
798
|
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3323
799
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3324
800
|
width: width,
|
|
@@ -3350,14 +826,14 @@ var ReadTime = function ReadTime(_ref) {
|
|
|
3350
826
|
_ref$isLightTheme = _ref.isLightTheme,
|
|
3351
827
|
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
3352
828
|
var config = useStateValue() || {};
|
|
3353
|
-
var showReadTime =
|
|
3354
|
-
var readTime =
|
|
829
|
+
var showReadTime = lodash.get(config, ["showReadTime"]) || lodash.get(opts, ["showReadTime"], true);
|
|
830
|
+
var readTime = lodash.get(story, ["read-time"], 0);
|
|
3355
831
|
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
3356
832
|
if (!showReadTime || !readTime) return null;
|
|
3357
|
-
var timeToRead =
|
|
833
|
+
var timeToRead = lodash.get(opts, ["localizedTimeToRead"]) || "min read";
|
|
3358
834
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3359
835
|
"data-test-id": "read-time",
|
|
3360
|
-
className: "arrow-component arr--read-time " +
|
|
836
|
+
className: "arrow-component arr--read-time " + _getClassName__default["default"]("read-time-wrapper ".concat(textColor), _styleModuleImportMap$5)
|
|
3361
837
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3362
838
|
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
3363
839
|
}, /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
@@ -3393,9 +869,9 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3393
869
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
3394
870
|
isLightTheme = _ref.isLightTheme;
|
|
3395
871
|
var configState = useStateValue() || {};
|
|
3396
|
-
var isAuthor =
|
|
3397
|
-
var isTime =
|
|
3398
|
-
var isReadTime =
|
|
872
|
+
var isAuthor = lodash.get(config, ["showAuthor"], lodash.get(configState, ["showAuthor"], true));
|
|
873
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
874
|
+
var isReadTime = lodash.get(configState, ["showReadTime"], true);
|
|
3399
875
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3400
876
|
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
3401
877
|
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
@@ -3415,7 +891,7 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3415
891
|
var getTimeStamp = function getTimeStamp() {
|
|
3416
892
|
if (!isTime) return null;
|
|
3417
893
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3418
|
-
className: "arr-separator " +
|
|
894
|
+
className: "arr-separator " + _getClassName__default["default"]("".concat(seperatorStyle), _styleModuleImportMap$4)
|
|
3419
895
|
}, getSeparator()), /*#__PURE__*/React__default["default"].createElement(TimeStamp, {
|
|
3420
896
|
story: story,
|
|
3421
897
|
config: config
|
|
@@ -3427,7 +903,7 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3427
903
|
};
|
|
3428
904
|
|
|
3429
905
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3430
|
-
className: "arr--author-time " +
|
|
906
|
+
className: "arr--author-time " + _getClassName__default["default"]("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$4)
|
|
3431
907
|
}, isAuthor ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Author, {
|
|
3432
908
|
story: story,
|
|
3433
909
|
isBottom: true,
|
|
@@ -3483,7 +959,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
3483
959
|
_ref$navigate = _ref.navigate,
|
|
3484
960
|
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
3485
961
|
var collectionTitle = useStateValue() || {};
|
|
3486
|
-
var showRowTitle =
|
|
962
|
+
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
3487
963
|
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
3488
964
|
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
3489
965
|
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
@@ -3559,7 +1035,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
3559
1035
|
borderBottom: borderBottomFullStyle
|
|
3560
1036
|
},
|
|
3561
1037
|
"data-test-id": "collection-name",
|
|
3562
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") +
|
|
1038
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$3)
|
|
3563
1039
|
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3564
1040
|
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
3565
1041
|
style: {
|
|
@@ -3596,7 +1072,7 @@ CollectionNameBase.defaultProps = {
|
|
|
3596
1072
|
|
|
3597
1073
|
function mapStateToProps(state) {
|
|
3598
1074
|
return {
|
|
3599
|
-
config:
|
|
1075
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3600
1076
|
};
|
|
3601
1077
|
}
|
|
3602
1078
|
|
|
@@ -3836,8 +1312,8 @@ var Headline = function Headline(_ref) {
|
|
|
3836
1312
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
3837
1313
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
3838
1314
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
3839
|
-
var alternateHeadline =
|
|
3840
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
1315
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
1316
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
3841
1317
|
var headline = alternateHeadline || story.headline;
|
|
3842
1318
|
var HeaderTag = "h" + headerLevel;
|
|
3843
1319
|
|
|
@@ -3863,10 +1339,10 @@ var Headline = function Headline(_ref) {
|
|
|
3863
1339
|
var textColor = getTextColor(configData.theme);
|
|
3864
1340
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
3865
1341
|
var iconSize = "24px";
|
|
3866
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
1342
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
3867
1343
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3868
1344
|
"data-test-id": "headline",
|
|
3869
|
-
className: "arrow-component arr--headline " +
|
|
1345
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$2)
|
|
3870
1346
|
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
3871
1347
|
width: iconSize,
|
|
3872
1348
|
height: iconSize,
|
|
@@ -3878,9 +1354,9 @@ var Headline = function Headline(_ref) {
|
|
|
3878
1354
|
externalLink: isExternalStory(story),
|
|
3879
1355
|
"aria-label": "headline"
|
|
3880
1356
|
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
3881
|
-
className:
|
|
1357
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$2)
|
|
3882
1358
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
3883
|
-
className:
|
|
1359
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$2)
|
|
3884
1360
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
3885
1361
|
};
|
|
3886
1362
|
Headline.propTypes = {
|
|
@@ -3918,7 +1394,7 @@ var Subheadline = function Subheadline(_ref) {
|
|
|
3918
1394
|
forceShowAtom = _ref.forceShowAtom,
|
|
3919
1395
|
showFullContent = _ref.showFullContent;
|
|
3920
1396
|
var config = useStateValue() || {};
|
|
3921
|
-
var subheadline = forceShowAtom ||
|
|
1397
|
+
var subheadline = forceShowAtom || lodash.get(config, ["showSubheadline"], true);
|
|
3922
1398
|
if (!subheadline) return null;
|
|
3923
1399
|
var textColor = getTextColor(config.theme);
|
|
3924
1400
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -3926,7 +1402,7 @@ var Subheadline = function Subheadline(_ref) {
|
|
|
3926
1402
|
WebkitLineClamp: lineClamp
|
|
3927
1403
|
},
|
|
3928
1404
|
"data-test-id": "subheadline",
|
|
3929
|
-
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") +
|
|
1405
|
+
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") + _getClassName__default["default"]("subheadline ".concat(textColor), _styleModuleImportMap$1)
|
|
3930
1406
|
}, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
|
|
3931
1407
|
};
|
|
3932
1408
|
Subheadline.propTypes = {
|
|
@@ -4018,7 +1494,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
4018
1494
|
backgroundColor: theme,
|
|
4019
1495
|
color: textColor
|
|
4020
1496
|
},
|
|
4021
|
-
className: "arr--story-card " +
|
|
1497
|
+
className: "arr--story-card " + _getClassName__default["default"]("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap)
|
|
4022
1498
|
}, children || defaultStorycard);
|
|
4023
1499
|
};
|
|
4024
1500
|
|
|
@@ -4059,7 +1535,7 @@ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
|
|
|
4059
1535
|
isHorizontalMobile: isHorizontalMobile,
|
|
4060
1536
|
aspectRatio: aspectRatio
|
|
4061
1537
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4062
|
-
className: "arr--story-content " +
|
|
1538
|
+
className: "arr--story-content " + _getClassName__default["default"]("content ".concat(alignment), _styleModuleImportMap)
|
|
4063
1539
|
}, /*#__PURE__*/React__default["default"].createElement(SectionTag, {
|
|
4064
1540
|
story: story,
|
|
4065
1541
|
borderColor: SectionTagborderColor
|
|
@@ -4173,7 +1649,7 @@ var SingleCol3Story = function SingleCol3Story(_ref2) {
|
|
|
4173
1649
|
}
|
|
4174
1650
|
|
|
4175
1651
|
var _ref3 = items || [],
|
|
4176
|
-
_ref4 =
|
|
1652
|
+
_ref4 = _toArray__default["default"](_ref3),
|
|
4177
1653
|
firstStory = _ref4[0],
|
|
4178
1654
|
rest = _ref4.slice(1);
|
|
4179
1655
|
|
|
@@ -4272,7 +1748,7 @@ var FourColTwelveStoriesBase = function FourColTwelveStoriesBase(_ref5) {
|
|
|
4272
1748
|
collectionNameTemplate = _config$collectionNam === void 0 ? "" : _config$collectionNam;
|
|
4273
1749
|
var footerSlot = footerSlotConfig.footerSlot;
|
|
4274
1750
|
var footerSlotComp = footerSlot ? footerSlot() : null;
|
|
4275
|
-
var getFilteredCollection =
|
|
1751
|
+
var getFilteredCollection = lodash.get(collection, ["items"], []).filter(function (collections) {
|
|
4276
1752
|
return collections.type === "collection";
|
|
4277
1753
|
}); // if number of collection is less than 4 return null
|
|
4278
1754
|
|