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