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