@quintype/arrow 3.15.1-fallback-support.1 → 3.15.1-perf.1

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.
Files changed (167) hide show
  1. package/atoms/Author/index.js +2250 -0
  2. package/{Author → atoms/Author}/styles.arrow.css +0 -0
  3. package/atoms/AuthorWithTime/index.js +2954 -0
  4. package/{AuthorWithTime → atoms/AuthorWithTime}/styles.arrow.css +0 -0
  5. package/atoms/CollectionName/index.js +2334 -0
  6. package/{CollectionName → atoms/CollectionName}/styles.arrow.css +0 -0
  7. package/atoms/ExtendedLoadMore/index-2d713010.js +166 -0
  8. package/atoms/ExtendedLoadMore/index-4191a84c.js +240 -0
  9. package/atoms/ExtendedLoadMore/index-5a7900ba.js +181 -0
  10. package/atoms/ExtendedLoadMore/index-6cb56d1a.js +350 -0
  11. package/atoms/ExtendedLoadMore/index-6daa674c.js +282 -0
  12. package/atoms/ExtendedLoadMore/index-6f8c780e.js +243 -0
  13. package/atoms/ExtendedLoadMore/index-7eb05b3d.js +199 -0
  14. package/atoms/ExtendedLoadMore/index-8345922c.js +175 -0
  15. package/atoms/ExtendedLoadMore/index-99af722e.js +175 -0
  16. package/atoms/ExtendedLoadMore/index-aa8b8ab8.js +990 -0
  17. package/atoms/ExtendedLoadMore/index-c8f346d0.js +223 -0
  18. package/atoms/ExtendedLoadMore/index-e39b3ca8.js +3023 -0
  19. package/atoms/ExtendedLoadMore/index-f6e578e3.js +86 -0
  20. package/atoms/ExtendedLoadMore/index.js +5 -0
  21. package/atoms/ExtendedLoadMore/styles.arrow.css +1 -0
  22. package/atoms/Headline/index.js +2459 -0
  23. package/{Headline → atoms/Headline}/styles.arrow.css +0 -0
  24. package/atoms/HeroImage/index.js +2475 -0
  25. package/{HeroImage → atoms/HeroImage}/styles.arrow.css +0 -0
  26. package/atoms/LoadmoreButton/index.js +2268 -0
  27. package/{LoadmoreButton → atoms/LoadmoreButton}/styles.arrow.css +0 -0
  28. package/atoms/ScrollSnap/index.js +2531 -0
  29. package/{ScrollSnap → atoms/ScrollSnap}/styles.arrow.css +0 -0
  30. package/atoms/SectionTag/index.js +2220 -0
  31. package/{SectionTag → atoms/SectionTag}/styles.arrow.css +0 -0
  32. package/atoms/Subheadline/index.js +2200 -0
  33. package/{Subheadline → atoms/Subheadline}/styles.arrow.css +0 -0
  34. package/atoms/TimeStamp/index.js +2661 -0
  35. package/{TimeStamp → atoms/TimeStamp}/styles.arrow.css +0 -0
  36. package/molecules/KeyEvents/index.js +2968 -0
  37. package/{KeyEvents → molecules/KeyEvents}/styles.arrow.css +0 -0
  38. package/molecules/PageIntroductionCard/index.js +2676 -0
  39. package/{PageIntroductionCard → molecules/PageIntroductionCard}/styles.arrow.css +0 -0
  40. package/molecules/SocialShareTemplate/index.js +3093 -0
  41. package/{SocialShareTemplate → molecules/SocialShareTemplate}/styles.arrow.css +0 -0
  42. package/molecules/StoryCard/index.js +3938 -0
  43. package/{StoryCard → molecules/StoryCard}/styles.arrow.css +0 -0
  44. package/molecules/StoryElementCard/index.js +5832 -0
  45. package/{StoryElementCard → molecules/StoryElementCard}/styles.arrow.css +0 -0
  46. package/molecules/StorycardContent/index.js +3416 -0
  47. package/{StorycardContent → molecules/StorycardContent}/styles.arrow.css +0 -0
  48. package/package.json +1 -1
  49. package/rows/AlternateCollectionFilter/index.js +4744 -0
  50. package/{AlternateCollectionFilter → rows/AlternateCollectionFilter}/styles.arrow.css +0 -0
  51. package/rows/AsideCollection/index.js +4690 -0
  52. package/{AsideCollection → rows/AsideCollection}/styles.arrow.css +0 -0
  53. package/rows/AstrologyCollection/index.js +4661 -0
  54. package/{AstrologyCollection → rows/AstrologyCollection}/styles.arrow.css +0 -0
  55. package/rows/AuthorIntroductionCard/index.js +3520 -0
  56. package/{AuthorIntroductionCard → rows/AuthorIntroductionCard}/styles.arrow.css +0 -0
  57. package/rows/AuthorsList/index.js +3715 -0
  58. package/{AuthorsList → rows/AuthorsList}/styles.arrow.css +0 -0
  59. package/rows/CollectionFilter/index.js +4834 -0
  60. package/{CollectionFilter → rows/CollectionFilter}/styles.arrow.css +0 -0
  61. package/rows/ElevenStories/index.js +4638 -0
  62. package/{ElevenStories → rows/ElevenStories}/styles.arrow.css +0 -0
  63. package/rows/FourColFiveStories/index.js +4359 -0
  64. package/{FourColFiveStories → rows/FourColFiveStories}/styles.arrow.css +0 -0
  65. package/rows/FourColGrid/index.js +4584 -0
  66. package/{FourColGrid → rows/FourColGrid}/styles.arrow.css +0 -0
  67. package/rows/FourColPortraitStories/index.js +4617 -0
  68. package/{FourColPortraitStories → rows/FourColPortraitStories}/styles.arrow.css +0 -0
  69. package/rows/FourColSixteenStories/index.js +4375 -0
  70. package/{FourColSixteenStories → rows/FourColSixteenStories}/styles.arrow.css +0 -0
  71. package/rows/FourColTwelveStories/index.js +4335 -0
  72. package/{FourColTwelveStories → rows/FourColTwelveStories}/styles.arrow.css +0 -0
  73. package/rows/FourStorySlider/index.js +4743 -0
  74. package/{FourStorySlider → rows/FourStorySlider}/styles.arrow.css +0 -0
  75. package/rows/FourStorySliderPortrait/index.js +4746 -0
  76. package/{FourStorySliderPortrait → rows/FourStorySliderPortrait}/styles.arrow.css +1 -1
  77. package/rows/FourTabbedBigStorySlider/index.js +4505 -0
  78. package/{FourTabbedBigStorySlider → rows/FourTabbedBigStorySlider}/styles.arrow.css +0 -0
  79. package/rows/FullScreenSlider/index.js +4661 -0
  80. package/{FullScreenSlider → rows/FullScreenSlider}/styles.arrow.css +0 -0
  81. package/rows/HalfScreenSlider/index.js +4514 -0
  82. package/{HalfScreenSlider → rows/HalfScreenSlider}/styles.arrow.css +0 -0
  83. package/rows/ListComponent/index.js +4462 -0
  84. package/{ListComponent → rows/ListComponent}/styles.arrow.css +0 -0
  85. package/rows/Listicles/index.js +3131 -0
  86. package/{Listicles → rows/Listicles}/styles.arrow.css +0 -0
  87. package/rows/MagazineEditions/index.js +3142 -0
  88. package/{MagazineEditions → rows/MagazineEditions}/styles.arrow.css +0 -0
  89. package/rows/MagazineHeaderCard/index.js +3136 -0
  90. package/{MagazineHeaderCard → rows/MagazineHeaderCard}/styles.arrow.css +0 -0
  91. package/rows/MagazineWidget/index.js +4514 -0
  92. package/{MagazineWidget → rows/MagazineWidget}/styles.arrow.css +0 -0
  93. package/rows/OneColStoryList/index.js +4670 -0
  94. package/{OneColStoryList → rows/OneColStoryList}/styles.arrow.css +0 -0
  95. package/rows/OpinionCollection/index.js +4037 -0
  96. package/{OpinionCollection → rows/OpinionCollection}/styles.arrow.css +0 -0
  97. package/rows/SixColSixStories/index.js +4515 -0
  98. package/{SixColSixStories → rows/SixColSixStories}/styles.arrow.css +0 -0
  99. package/rows/StoryCollection/index.js +4690 -0
  100. package/{StoryCollection → rows/StoryCollection}/styles.arrow.css +0 -0
  101. package/rows/TagIntroductionCard/index.js +1901 -0
  102. package/{TagIntroductionCard → rows/TagIntroductionCard}/styles.arrow.css +0 -0
  103. package/rows/ThreeColFlexStories/index.js +4575 -0
  104. package/{ThreeColFlexStories → rows/ThreeColFlexStories}/styles.arrow.css +0 -0
  105. package/rows/ThreeColFourteenStories/index.js +4283 -0
  106. package/{ThreeColFourteenStories → rows/ThreeColFourteenStories}/styles.arrow.css +0 -0
  107. package/rows/ThreeColGrid/index.js +4605 -0
  108. package/{ThreeColGrid → rows/ThreeColGrid}/styles.arrow.css +0 -0
  109. package/rows/ThreeColSevenStory/index.js +4502 -0
  110. package/{ThreeColSevenStory → rows/ThreeColSevenStory}/styles.arrow.css +0 -0
  111. package/rows/ThreeColSixStories/index.js +4485 -0
  112. package/{ThreeColSixStories → rows/ThreeColSixStories}/styles.arrow.css +0 -0
  113. package/rows/ThreeColTwelveStories/index.js +4380 -0
  114. package/{ThreeColTwelveStories → rows/ThreeColTwelveStories}/styles.arrow.css +0 -0
  115. package/rows/TwoColFourStories/index.js +4463 -0
  116. package/{TwoColFourStories → rows/TwoColFourStories}/styles.arrow.css +0 -0
  117. package/rows/TwoColFourStoryHighlight/index.js +4456 -0
  118. package/{TwoColFourStoryHighlight → rows/TwoColFourStoryHighlight}/styles.arrow.css +0 -0
  119. package/rows/TwoColSevenStories/index.js +4490 -0
  120. package/{TwoColSevenStories → rows/TwoColSevenStories}/styles.arrow.css +0 -0
  121. package/rows/TwoColSixStories/index.js +4489 -0
  122. package/{TwoColSixStories → rows/TwoColSixStories}/styles.arrow.css +0 -0
  123. package/rows/TwoColTenStoriesSidebar/index.js +4549 -0
  124. package/{TwoColTenStoriesSidebar → rows/TwoColTenStoriesSidebar}/styles.arrow.css +0 -0
  125. package/rows/TwoColThreeStories/index.js +4436 -0
  126. package/{TwoColThreeStories → rows/TwoColThreeStories}/styles.arrow.css +0 -0
  127. package/story-elements/AlsoRead/index.js +2457 -0
  128. package/{AlsoRead → story-elements/AlsoRead}/styles.arrow.css +0 -0
  129. package/story-elements/Attachment/index.js +2013 -0
  130. package/{Attachment → story-elements/Attachment}/styles.arrow.css +0 -0
  131. package/story-elements/BigFact/index.js +1983 -0
  132. package/{BigFact → story-elements/BigFact}/styles.arrow.css +0 -0
  133. package/story-elements/BlockQuote/index.js +2431 -0
  134. package/{BlockQuote → story-elements/BlockQuote}/styles.arrow.css +0 -0
  135. package/story-elements/Blurb/index.js +2094 -0
  136. package/{Blurb → story-elements/Blurb}/styles.arrow.css +0 -0
  137. package/story-elements/Image/index.js +2711 -0
  138. package/{Image → story-elements/Image}/styles.arrow.css +0 -0
  139. package/story-elements/ImageGallery/index.js +2644 -0
  140. package/{ImageGallery → story-elements/ImageGallery}/styles.arrow.css +0 -0
  141. package/story-elements/ImageSlideshow/index.js +2955 -0
  142. package/{ImageSlideshow → story-elements/ImageSlideshow}/styles.arrow.css +0 -0
  143. package/story-elements/QuestionAnswer/index.js +2395 -0
  144. package/{QuestionAnswer → story-elements/QuestionAnswer}/styles.arrow.css +0 -0
  145. package/story-elements/Quote/index.js +2012 -0
  146. package/{Quote → story-elements/Quote}/styles.arrow.css +0 -0
  147. package/story-elements/Reference/index.js +2006 -0
  148. package/{Reference → story-elements/Reference}/styles.arrow.css +0 -0
  149. package/story-elements/StoryElement/index.js +1779 -0
  150. package/story-elements/Summary/index.js +2036 -0
  151. package/{Summary → story-elements/Summary}/styles.arrow.css +0 -0
  152. package/story-elements/Text/index.js +2293 -0
  153. package/{Text → story-elements/Text}/styles.arrow.css +0 -0
  154. package/story-elements/Video/index.js +1785 -0
  155. package/{Video → story-elements/Video}/styles.arrow.css +0 -0
  156. package/story-templates/ListicleStoryTemplate/index.js +8442 -0
  157. package/{ListicleStoryTemplate → story-templates/ListicleStoryTemplate}/styles.arrow.css +0 -0
  158. package/story-templates/LiveBlogStoryTemplate/index.js +8618 -0
  159. package/{LiveBlogStoryTemplate → story-templates/LiveBlogStoryTemplate}/styles.arrow.css +0 -0
  160. package/story-templates/PhotoStoryTemplate/index.js +8420 -0
  161. package/{PhotoStoryTemplate → story-templates/PhotoStoryTemplate}/styles.arrow.css +0 -0
  162. package/story-templates/TextStoryTemplate/index.js +8493 -0
  163. package/{TextStoryTemplate → story-templates/TextStoryTemplate}/styles.arrow.css +0 -0
  164. package/story-templates/VideoStoryTemplate/index.js +8352 -0
  165. package/{VideoStoryTemplate → story-templates/VideoStoryTemplate}/styles.arrow.css +0 -0
  166. package/cjs/index.js +0 -1
  167. package/esm/index.js +0 -1
@@ -0,0 +1,2457 @@
1
+ import React, { useContext, createContext } from 'react';
2
+ import { Link, LazyLoadImages, ResponsiveImage } from '@quintype/components';
3
+ import PropTypes from 'prop-types';
4
+ import 'react-timeago';
5
+ import 'date-fns-tz';
6
+
7
+ function _extends() {
8
+ _extends = Object.assign || function (target) {
9
+ for (var i = 1; i < arguments.length; i++) {
10
+ var source = arguments[i];
11
+
12
+ for (var key in source) {
13
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
14
+ target[key] = source[key];
15
+ }
16
+ }
17
+ }
18
+
19
+ return target;
20
+ };
21
+
22
+ return _extends.apply(this, arguments);
23
+ }
24
+
25
+ function _objectWithoutPropertiesLoose(source, excluded) {
26
+ if (source == null) return {};
27
+ var target = {};
28
+ var sourceKeys = Object.keys(source);
29
+ var key, i;
30
+
31
+ for (i = 0; i < sourceKeys.length; i++) {
32
+ key = sourceKeys[i];
33
+ if (excluded.indexOf(key) >= 0) continue;
34
+ target[key] = source[key];
35
+ }
36
+
37
+ return target;
38
+ }
39
+
40
+ function _objectWithoutProperties(source, excluded) {
41
+ if (source == null) return {};
42
+ var target = _objectWithoutPropertiesLoose(source, excluded);
43
+ var key, i;
44
+
45
+ if (Object.getOwnPropertySymbols) {
46
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
47
+
48
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
49
+ key = sourceSymbolKeys[i];
50
+ if (excluded.indexOf(key) >= 0) continue;
51
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
52
+ target[key] = source[key];
53
+ }
54
+ }
55
+
56
+ return target;
57
+ }
58
+
59
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
60
+
61
+ function getDefaultExportFromCjs (x) {
62
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
63
+ }
64
+
65
+ function createCommonjsModule(fn) {
66
+ var module = { exports: {} };
67
+ return fn(module, module.exports), module.exports;
68
+ }
69
+
70
+ var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
71
+
72
+ Object.defineProperty(exports, "__esModule", {
73
+ value: true
74
+ });
75
+ exports["default"] = void 0;
76
+ var optionsDefaults = {
77
+ attributeNames: {
78
+ styleName: 'className'
79
+ },
80
+ generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
81
+ handleMissingStyleName: 'throw'
82
+ };
83
+ var _default = optionsDefaults;
84
+ exports["default"] = _default;
85
+
86
+
87
+ });
88
+
89
+ var getClassName = createCommonjsModule(function (module, exports) {
90
+
91
+ Object.defineProperty(exports, "__esModule", {
92
+ value: true
93
+ });
94
+ exports["default"] = void 0;
95
+
96
+ var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
97
+
98
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
99
+
100
+ var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
101
+ return styleName.indexOf('.') !== -1;
102
+ };
103
+
104
+ var handleError = function handleError(message, handleMissingStyleName) {
105
+ if (handleMissingStyleName === 'throw') {
106
+ throw new Error(message);
107
+ } else if (handleMissingStyleName === 'warn') {
108
+ // eslint-disable-next-line no-console
109
+ console.warn(message);
110
+ }
111
+
112
+ return null;
113
+ };
114
+
115
+ var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
116
+ // Note:
117
+ // Do not use the desctructing syntax with Babel.
118
+ // Desctructing adds _slicedToArray helper.
119
+ var styleNameParts = styleName.split('.');
120
+ var importName = styleNameParts[0];
121
+ var moduleName = styleNameParts[1];
122
+ var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
123
+
124
+ if (!moduleName) {
125
+ return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
126
+ }
127
+
128
+ if (!styleModuleImportMap[importName]) {
129
+ return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
130
+ }
131
+
132
+ if (!styleModuleImportMap[importName][moduleName]) {
133
+ return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
134
+ }
135
+
136
+ return styleModuleImportMap[importName][moduleName];
137
+ };
138
+
139
+ var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
140
+ var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
141
+ var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
142
+ return styleModuleImportMap[importKey][styleName] && importKey;
143
+ }).filter(function (importKey) {
144
+ return importKey;
145
+ });
146
+
147
+ if (importKeysWithMatches.length > 1) {
148
+ 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');
149
+ }
150
+
151
+ if (importKeysWithMatches.length === 0) {
152
+ return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
153
+ }
154
+
155
+ return styleModuleImportMap[importKeysWithMatches[0]][styleName];
156
+ };
157
+
158
+ var _default = function _default(styleNameValue, styleModuleImportMap, options) {
159
+ var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
160
+
161
+ var _ref = options || {},
162
+ _ref$handleMissingSty = _ref.handleMissingStyleName,
163
+ handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
164
+ _ref$autoResolveMulti = _ref.autoResolveMultipleImports,
165
+ autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
166
+
167
+ if (!styleNameValue) {
168
+ return '';
169
+ }
170
+
171
+ return styleNameValue.split(' ').filter(function (styleName) {
172
+ return styleName;
173
+ }).map(function (styleName) {
174
+ if (isNamespacedStyleName(styleName)) {
175
+ return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
176
+ }
177
+
178
+ if (styleModuleImportMapKeys.length === 0) {
179
+ throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
180
+ }
181
+
182
+ if (styleModuleImportMapKeys.length > 1) {
183
+ if (!autoResolveMultipleImports) {
184
+ throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
185
+ }
186
+
187
+ return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
188
+ }
189
+
190
+ var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
191
+
192
+ if (!styleModuleMap[styleName]) {
193
+ return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
194
+ }
195
+
196
+ return styleModuleMap[styleName];
197
+ }).filter(function (className) {
198
+ // Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
199
+ return className;
200
+ }).join(' ');
201
+ };
202
+
203
+ exports["default"] = _default;
204
+
205
+
206
+ });
207
+
208
+ var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
209
+
210
+ /**
211
+ * Checks if `value` is classified as an `Array` object.
212
+ *
213
+ * @static
214
+ * @memberOf _
215
+ * @since 0.1.0
216
+ * @category Lang
217
+ * @param {*} value The value to check.
218
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
219
+ * @example
220
+ *
221
+ * _.isArray([1, 2, 3]);
222
+ * // => true
223
+ *
224
+ * _.isArray(document.body.children);
225
+ * // => false
226
+ *
227
+ * _.isArray('abc');
228
+ * // => false
229
+ *
230
+ * _.isArray(_.noop);
231
+ * // => false
232
+ */
233
+ var isArray = Array.isArray;
234
+
235
+ var isArray_1 = isArray;
236
+
237
+ /** Detect free variable `global` from Node.js. */
238
+
239
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
240
+
241
+ var _freeGlobal = freeGlobal;
242
+
243
+ /** Detect free variable `self`. */
244
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
245
+
246
+ /** Used as a reference to the global object. */
247
+ var root = _freeGlobal || freeSelf || Function('return this')();
248
+
249
+ var _root = root;
250
+
251
+ /** Built-in value references. */
252
+ var Symbol$1 = _root.Symbol;
253
+
254
+ var _Symbol = Symbol$1;
255
+
256
+ /** Used for built-in method references. */
257
+ var objectProto$4 = Object.prototype;
258
+
259
+ /** Used to check objects for own properties. */
260
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
261
+
262
+ /**
263
+ * Used to resolve the
264
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
265
+ * of values.
266
+ */
267
+ var nativeObjectToString$1 = objectProto$4.toString;
268
+
269
+ /** Built-in value references. */
270
+ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
271
+
272
+ /**
273
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
274
+ *
275
+ * @private
276
+ * @param {*} value The value to query.
277
+ * @returns {string} Returns the raw `toStringTag`.
278
+ */
279
+ function getRawTag(value) {
280
+ var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
281
+ tag = value[symToStringTag$1];
282
+
283
+ try {
284
+ value[symToStringTag$1] = undefined;
285
+ var unmasked = true;
286
+ } catch (e) {}
287
+
288
+ var result = nativeObjectToString$1.call(value);
289
+ if (unmasked) {
290
+ if (isOwn) {
291
+ value[symToStringTag$1] = tag;
292
+ } else {
293
+ delete value[symToStringTag$1];
294
+ }
295
+ }
296
+ return result;
297
+ }
298
+
299
+ var _getRawTag = getRawTag;
300
+
301
+ /** Used for built-in method references. */
302
+ var objectProto$3 = Object.prototype;
303
+
304
+ /**
305
+ * Used to resolve the
306
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
307
+ * of values.
308
+ */
309
+ var nativeObjectToString = objectProto$3.toString;
310
+
311
+ /**
312
+ * Converts `value` to a string using `Object.prototype.toString`.
313
+ *
314
+ * @private
315
+ * @param {*} value The value to convert.
316
+ * @returns {string} Returns the converted string.
317
+ */
318
+ function objectToString(value) {
319
+ return nativeObjectToString.call(value);
320
+ }
321
+
322
+ var _objectToString = objectToString;
323
+
324
+ /** `Object#toString` result references. */
325
+ var nullTag = '[object Null]',
326
+ undefinedTag = '[object Undefined]';
327
+
328
+ /** Built-in value references. */
329
+ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
330
+
331
+ /**
332
+ * The base implementation of `getTag` without fallbacks for buggy environments.
333
+ *
334
+ * @private
335
+ * @param {*} value The value to query.
336
+ * @returns {string} Returns the `toStringTag`.
337
+ */
338
+ function baseGetTag(value) {
339
+ if (value == null) {
340
+ return value === undefined ? undefinedTag : nullTag;
341
+ }
342
+ return (symToStringTag && symToStringTag in Object(value))
343
+ ? _getRawTag(value)
344
+ : _objectToString(value);
345
+ }
346
+
347
+ var _baseGetTag = baseGetTag;
348
+
349
+ /**
350
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
351
+ * and has a `typeof` result of "object".
352
+ *
353
+ * @static
354
+ * @memberOf _
355
+ * @since 4.0.0
356
+ * @category Lang
357
+ * @param {*} value The value to check.
358
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
359
+ * @example
360
+ *
361
+ * _.isObjectLike({});
362
+ * // => true
363
+ *
364
+ * _.isObjectLike([1, 2, 3]);
365
+ * // => true
366
+ *
367
+ * _.isObjectLike(_.noop);
368
+ * // => false
369
+ *
370
+ * _.isObjectLike(null);
371
+ * // => false
372
+ */
373
+ function isObjectLike(value) {
374
+ return value != null && typeof value == 'object';
375
+ }
376
+
377
+ var isObjectLike_1 = isObjectLike;
378
+
379
+ /** `Object#toString` result references. */
380
+ var symbolTag = '[object Symbol]';
381
+
382
+ /**
383
+ * Checks if `value` is classified as a `Symbol` primitive or object.
384
+ *
385
+ * @static
386
+ * @memberOf _
387
+ * @since 4.0.0
388
+ * @category Lang
389
+ * @param {*} value The value to check.
390
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
391
+ * @example
392
+ *
393
+ * _.isSymbol(Symbol.iterator);
394
+ * // => true
395
+ *
396
+ * _.isSymbol('abc');
397
+ * // => false
398
+ */
399
+ function isSymbol(value) {
400
+ return typeof value == 'symbol' ||
401
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
402
+ }
403
+
404
+ var isSymbol_1 = isSymbol;
405
+
406
+ /** Used to match property names within property paths. */
407
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
408
+ reIsPlainProp = /^\w*$/;
409
+
410
+ /**
411
+ * Checks if `value` is a property name and not a property path.
412
+ *
413
+ * @private
414
+ * @param {*} value The value to check.
415
+ * @param {Object} [object] The object to query keys on.
416
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
417
+ */
418
+ function isKey(value, object) {
419
+ if (isArray_1(value)) {
420
+ return false;
421
+ }
422
+ var type = typeof value;
423
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
424
+ value == null || isSymbol_1(value)) {
425
+ return true;
426
+ }
427
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
428
+ (object != null && value in Object(object));
429
+ }
430
+
431
+ var _isKey = isKey;
432
+
433
+ /**
434
+ * Checks if `value` is the
435
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
436
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
437
+ *
438
+ * @static
439
+ * @memberOf _
440
+ * @since 0.1.0
441
+ * @category Lang
442
+ * @param {*} value The value to check.
443
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
444
+ * @example
445
+ *
446
+ * _.isObject({});
447
+ * // => true
448
+ *
449
+ * _.isObject([1, 2, 3]);
450
+ * // => true
451
+ *
452
+ * _.isObject(_.noop);
453
+ * // => true
454
+ *
455
+ * _.isObject(null);
456
+ * // => false
457
+ */
458
+ function isObject(value) {
459
+ var type = typeof value;
460
+ return value != null && (type == 'object' || type == 'function');
461
+ }
462
+
463
+ var isObject_1 = isObject;
464
+
465
+ /** `Object#toString` result references. */
466
+ var asyncTag = '[object AsyncFunction]',
467
+ funcTag = '[object Function]',
468
+ genTag = '[object GeneratorFunction]',
469
+ proxyTag = '[object Proxy]';
470
+
471
+ /**
472
+ * Checks if `value` is classified as a `Function` object.
473
+ *
474
+ * @static
475
+ * @memberOf _
476
+ * @since 0.1.0
477
+ * @category Lang
478
+ * @param {*} value The value to check.
479
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
480
+ * @example
481
+ *
482
+ * _.isFunction(_);
483
+ * // => true
484
+ *
485
+ * _.isFunction(/abc/);
486
+ * // => false
487
+ */
488
+ function isFunction(value) {
489
+ if (!isObject_1(value)) {
490
+ return false;
491
+ }
492
+ // The use of `Object#toString` avoids issues with the `typeof` operator
493
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
494
+ var tag = _baseGetTag(value);
495
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
496
+ }
497
+
498
+ var isFunction_1 = isFunction;
499
+
500
+ /** Used to detect overreaching core-js shims. */
501
+ var coreJsData = _root['__core-js_shared__'];
502
+
503
+ var _coreJsData = coreJsData;
504
+
505
+ /** Used to detect methods masquerading as native. */
506
+ var maskSrcKey = (function() {
507
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
508
+ return uid ? ('Symbol(src)_1.' + uid) : '';
509
+ }());
510
+
511
+ /**
512
+ * Checks if `func` has its source masked.
513
+ *
514
+ * @private
515
+ * @param {Function} func The function to check.
516
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
517
+ */
518
+ function isMasked(func) {
519
+ return !!maskSrcKey && (maskSrcKey in func);
520
+ }
521
+
522
+ var _isMasked = isMasked;
523
+
524
+ /** Used for built-in method references. */
525
+ var funcProto$1 = Function.prototype;
526
+
527
+ /** Used to resolve the decompiled source of functions. */
528
+ var funcToString$1 = funcProto$1.toString;
529
+
530
+ /**
531
+ * Converts `func` to its source code.
532
+ *
533
+ * @private
534
+ * @param {Function} func The function to convert.
535
+ * @returns {string} Returns the source code.
536
+ */
537
+ function toSource(func) {
538
+ if (func != null) {
539
+ try {
540
+ return funcToString$1.call(func);
541
+ } catch (e) {}
542
+ try {
543
+ return (func + '');
544
+ } catch (e) {}
545
+ }
546
+ return '';
547
+ }
548
+
549
+ var _toSource = toSource;
550
+
551
+ /**
552
+ * Used to match `RegExp`
553
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
554
+ */
555
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
556
+
557
+ /** Used to detect host constructors (Safari). */
558
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
559
+
560
+ /** Used for built-in method references. */
561
+ var funcProto = Function.prototype,
562
+ objectProto$2 = Object.prototype;
563
+
564
+ /** Used to resolve the decompiled source of functions. */
565
+ var funcToString = funcProto.toString;
566
+
567
+ /** Used to check objects for own properties. */
568
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
569
+
570
+ /** Used to detect if a method is native. */
571
+ var reIsNative = RegExp('^' +
572
+ funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
573
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
574
+ );
575
+
576
+ /**
577
+ * The base implementation of `_.isNative` without bad shim checks.
578
+ *
579
+ * @private
580
+ * @param {*} value The value to check.
581
+ * @returns {boolean} Returns `true` if `value` is a native function,
582
+ * else `false`.
583
+ */
584
+ function baseIsNative(value) {
585
+ if (!isObject_1(value) || _isMasked(value)) {
586
+ return false;
587
+ }
588
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
589
+ return pattern.test(_toSource(value));
590
+ }
591
+
592
+ var _baseIsNative = baseIsNative;
593
+
594
+ /**
595
+ * Gets the value at `key` of `object`.
596
+ *
597
+ * @private
598
+ * @param {Object} [object] The object to query.
599
+ * @param {string} key The key of the property to get.
600
+ * @returns {*} Returns the property value.
601
+ */
602
+ function getValue(object, key) {
603
+ return object == null ? undefined : object[key];
604
+ }
605
+
606
+ var _getValue = getValue;
607
+
608
+ /**
609
+ * Gets the native function at `key` of `object`.
610
+ *
611
+ * @private
612
+ * @param {Object} object The object to query.
613
+ * @param {string} key The key of the method to get.
614
+ * @returns {*} Returns the function if it's native, else `undefined`.
615
+ */
616
+ function getNative(object, key) {
617
+ var value = _getValue(object, key);
618
+ return _baseIsNative(value) ? value : undefined;
619
+ }
620
+
621
+ var _getNative = getNative;
622
+
623
+ /* Built-in method references that are verified to be native. */
624
+ var nativeCreate = _getNative(Object, 'create');
625
+
626
+ var _nativeCreate = nativeCreate;
627
+
628
+ /**
629
+ * Removes all key-value entries from the hash.
630
+ *
631
+ * @private
632
+ * @name clear
633
+ * @memberOf Hash
634
+ */
635
+ function hashClear() {
636
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
637
+ this.size = 0;
638
+ }
639
+
640
+ var _hashClear = hashClear;
641
+
642
+ /**
643
+ * Removes `key` and its value from the hash.
644
+ *
645
+ * @private
646
+ * @name delete
647
+ * @memberOf Hash
648
+ * @param {Object} hash The hash to modify.
649
+ * @param {string} key The key of the value to remove.
650
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
651
+ */
652
+ function hashDelete(key) {
653
+ var result = this.has(key) && delete this.__data__[key];
654
+ this.size -= result ? 1 : 0;
655
+ return result;
656
+ }
657
+
658
+ var _hashDelete = hashDelete;
659
+
660
+ /** Used to stand-in for `undefined` hash values. */
661
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
662
+
663
+ /** Used for built-in method references. */
664
+ var objectProto$1 = Object.prototype;
665
+
666
+ /** Used to check objects for own properties. */
667
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
668
+
669
+ /**
670
+ * Gets the hash value for `key`.
671
+ *
672
+ * @private
673
+ * @name get
674
+ * @memberOf Hash
675
+ * @param {string} key The key of the value to get.
676
+ * @returns {*} Returns the entry value.
677
+ */
678
+ function hashGet(key) {
679
+ var data = this.__data__;
680
+ if (_nativeCreate) {
681
+ var result = data[key];
682
+ return result === HASH_UNDEFINED$1 ? undefined : result;
683
+ }
684
+ return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
685
+ }
686
+
687
+ var _hashGet = hashGet;
688
+
689
+ /** Used for built-in method references. */
690
+ var objectProto = Object.prototype;
691
+
692
+ /** Used to check objects for own properties. */
693
+ var hasOwnProperty = objectProto.hasOwnProperty;
694
+
695
+ /**
696
+ * Checks if a hash value for `key` exists.
697
+ *
698
+ * @private
699
+ * @name has
700
+ * @memberOf Hash
701
+ * @param {string} key The key of the entry to check.
702
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
703
+ */
704
+ function hashHas(key) {
705
+ var data = this.__data__;
706
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
707
+ }
708
+
709
+ var _hashHas = hashHas;
710
+
711
+ /** Used to stand-in for `undefined` hash values. */
712
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
713
+
714
+ /**
715
+ * Sets the hash `key` to `value`.
716
+ *
717
+ * @private
718
+ * @name set
719
+ * @memberOf Hash
720
+ * @param {string} key The key of the value to set.
721
+ * @param {*} value The value to set.
722
+ * @returns {Object} Returns the hash instance.
723
+ */
724
+ function hashSet(key, value) {
725
+ var data = this.__data__;
726
+ this.size += this.has(key) ? 0 : 1;
727
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
728
+ return this;
729
+ }
730
+
731
+ var _hashSet = hashSet;
732
+
733
+ /**
734
+ * Creates a hash object.
735
+ *
736
+ * @private
737
+ * @constructor
738
+ * @param {Array} [entries] The key-value pairs to cache.
739
+ */
740
+ function Hash(entries) {
741
+ var index = -1,
742
+ length = entries == null ? 0 : entries.length;
743
+
744
+ this.clear();
745
+ while (++index < length) {
746
+ var entry = entries[index];
747
+ this.set(entry[0], entry[1]);
748
+ }
749
+ }
750
+
751
+ // Add methods to `Hash`.
752
+ Hash.prototype.clear = _hashClear;
753
+ Hash.prototype['delete'] = _hashDelete;
754
+ Hash.prototype.get = _hashGet;
755
+ Hash.prototype.has = _hashHas;
756
+ Hash.prototype.set = _hashSet;
757
+
758
+ var _Hash = Hash;
759
+
760
+ /**
761
+ * Removes all key-value entries from the list cache.
762
+ *
763
+ * @private
764
+ * @name clear
765
+ * @memberOf ListCache
766
+ */
767
+ function listCacheClear() {
768
+ this.__data__ = [];
769
+ this.size = 0;
770
+ }
771
+
772
+ var _listCacheClear = listCacheClear;
773
+
774
+ /**
775
+ * Performs a
776
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
777
+ * comparison between two values to determine if they are equivalent.
778
+ *
779
+ * @static
780
+ * @memberOf _
781
+ * @since 4.0.0
782
+ * @category Lang
783
+ * @param {*} value The value to compare.
784
+ * @param {*} other The other value to compare.
785
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
786
+ * @example
787
+ *
788
+ * var object = { 'a': 1 };
789
+ * var other = { 'a': 1 };
790
+ *
791
+ * _.eq(object, object);
792
+ * // => true
793
+ *
794
+ * _.eq(object, other);
795
+ * // => false
796
+ *
797
+ * _.eq('a', 'a');
798
+ * // => true
799
+ *
800
+ * _.eq('a', Object('a'));
801
+ * // => false
802
+ *
803
+ * _.eq(NaN, NaN);
804
+ * // => true
805
+ */
806
+ function eq(value, other) {
807
+ return value === other || (value !== value && other !== other);
808
+ }
809
+
810
+ var eq_1 = eq;
811
+
812
+ /**
813
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
814
+ *
815
+ * @private
816
+ * @param {Array} array The array to inspect.
817
+ * @param {*} key The key to search for.
818
+ * @returns {number} Returns the index of the matched value, else `-1`.
819
+ */
820
+ function assocIndexOf(array, key) {
821
+ var length = array.length;
822
+ while (length--) {
823
+ if (eq_1(array[length][0], key)) {
824
+ return length;
825
+ }
826
+ }
827
+ return -1;
828
+ }
829
+
830
+ var _assocIndexOf = assocIndexOf;
831
+
832
+ /** Used for built-in method references. */
833
+ var arrayProto = Array.prototype;
834
+
835
+ /** Built-in value references. */
836
+ var splice = arrayProto.splice;
837
+
838
+ /**
839
+ * Removes `key` and its value from the list cache.
840
+ *
841
+ * @private
842
+ * @name delete
843
+ * @memberOf ListCache
844
+ * @param {string} key The key of the value to remove.
845
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
846
+ */
847
+ function listCacheDelete(key) {
848
+ var data = this.__data__,
849
+ index = _assocIndexOf(data, key);
850
+
851
+ if (index < 0) {
852
+ return false;
853
+ }
854
+ var lastIndex = data.length - 1;
855
+ if (index == lastIndex) {
856
+ data.pop();
857
+ } else {
858
+ splice.call(data, index, 1);
859
+ }
860
+ --this.size;
861
+ return true;
862
+ }
863
+
864
+ var _listCacheDelete = listCacheDelete;
865
+
866
+ /**
867
+ * Gets the list cache value for `key`.
868
+ *
869
+ * @private
870
+ * @name get
871
+ * @memberOf ListCache
872
+ * @param {string} key The key of the value to get.
873
+ * @returns {*} Returns the entry value.
874
+ */
875
+ function listCacheGet(key) {
876
+ var data = this.__data__,
877
+ index = _assocIndexOf(data, key);
878
+
879
+ return index < 0 ? undefined : data[index][1];
880
+ }
881
+
882
+ var _listCacheGet = listCacheGet;
883
+
884
+ /**
885
+ * Checks if a list cache value for `key` exists.
886
+ *
887
+ * @private
888
+ * @name has
889
+ * @memberOf ListCache
890
+ * @param {string} key The key of the entry to check.
891
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
892
+ */
893
+ function listCacheHas(key) {
894
+ return _assocIndexOf(this.__data__, key) > -1;
895
+ }
896
+
897
+ var _listCacheHas = listCacheHas;
898
+
899
+ /**
900
+ * Sets the list cache `key` to `value`.
901
+ *
902
+ * @private
903
+ * @name set
904
+ * @memberOf ListCache
905
+ * @param {string} key The key of the value to set.
906
+ * @param {*} value The value to set.
907
+ * @returns {Object} Returns the list cache instance.
908
+ */
909
+ function listCacheSet(key, value) {
910
+ var data = this.__data__,
911
+ index = _assocIndexOf(data, key);
912
+
913
+ if (index < 0) {
914
+ ++this.size;
915
+ data.push([key, value]);
916
+ } else {
917
+ data[index][1] = value;
918
+ }
919
+ return this;
920
+ }
921
+
922
+ var _listCacheSet = listCacheSet;
923
+
924
+ /**
925
+ * Creates an list cache object.
926
+ *
927
+ * @private
928
+ * @constructor
929
+ * @param {Array} [entries] The key-value pairs to cache.
930
+ */
931
+ function ListCache(entries) {
932
+ var index = -1,
933
+ length = entries == null ? 0 : entries.length;
934
+
935
+ this.clear();
936
+ while (++index < length) {
937
+ var entry = entries[index];
938
+ this.set(entry[0], entry[1]);
939
+ }
940
+ }
941
+
942
+ // Add methods to `ListCache`.
943
+ ListCache.prototype.clear = _listCacheClear;
944
+ ListCache.prototype['delete'] = _listCacheDelete;
945
+ ListCache.prototype.get = _listCacheGet;
946
+ ListCache.prototype.has = _listCacheHas;
947
+ ListCache.prototype.set = _listCacheSet;
948
+
949
+ var _ListCache = ListCache;
950
+
951
+ /* Built-in method references that are verified to be native. */
952
+ var Map = _getNative(_root, 'Map');
953
+
954
+ var _Map = Map;
955
+
956
+ /**
957
+ * Removes all key-value entries from the map.
958
+ *
959
+ * @private
960
+ * @name clear
961
+ * @memberOf MapCache
962
+ */
963
+ function mapCacheClear() {
964
+ this.size = 0;
965
+ this.__data__ = {
966
+ 'hash': new _Hash,
967
+ 'map': new (_Map || _ListCache),
968
+ 'string': new _Hash
969
+ };
970
+ }
971
+
972
+ var _mapCacheClear = mapCacheClear;
973
+
974
+ /**
975
+ * Checks if `value` is suitable for use as unique object key.
976
+ *
977
+ * @private
978
+ * @param {*} value The value to check.
979
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
980
+ */
981
+ function isKeyable(value) {
982
+ var type = typeof value;
983
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
984
+ ? (value !== '__proto__')
985
+ : (value === null);
986
+ }
987
+
988
+ var _isKeyable = isKeyable;
989
+
990
+ /**
991
+ * Gets the data for `map`.
992
+ *
993
+ * @private
994
+ * @param {Object} map The map to query.
995
+ * @param {string} key The reference key.
996
+ * @returns {*} Returns the map data.
997
+ */
998
+ function getMapData(map, key) {
999
+ var data = map.__data__;
1000
+ return _isKeyable(key)
1001
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1002
+ : data.map;
1003
+ }
1004
+
1005
+ var _getMapData = getMapData;
1006
+
1007
+ /**
1008
+ * Removes `key` and its value from the map.
1009
+ *
1010
+ * @private
1011
+ * @name delete
1012
+ * @memberOf MapCache
1013
+ * @param {string} key The key of the value to remove.
1014
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1015
+ */
1016
+ function mapCacheDelete(key) {
1017
+ var result = _getMapData(this, key)['delete'](key);
1018
+ this.size -= result ? 1 : 0;
1019
+ return result;
1020
+ }
1021
+
1022
+ var _mapCacheDelete = mapCacheDelete;
1023
+
1024
+ /**
1025
+ * Gets the map value for `key`.
1026
+ *
1027
+ * @private
1028
+ * @name get
1029
+ * @memberOf MapCache
1030
+ * @param {string} key The key of the value to get.
1031
+ * @returns {*} Returns the entry value.
1032
+ */
1033
+ function mapCacheGet(key) {
1034
+ return _getMapData(this, key).get(key);
1035
+ }
1036
+
1037
+ var _mapCacheGet = mapCacheGet;
1038
+
1039
+ /**
1040
+ * Checks if a map value for `key` exists.
1041
+ *
1042
+ * @private
1043
+ * @name has
1044
+ * @memberOf MapCache
1045
+ * @param {string} key The key of the entry to check.
1046
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1047
+ */
1048
+ function mapCacheHas(key) {
1049
+ return _getMapData(this, key).has(key);
1050
+ }
1051
+
1052
+ var _mapCacheHas = mapCacheHas;
1053
+
1054
+ /**
1055
+ * Sets the map `key` to `value`.
1056
+ *
1057
+ * @private
1058
+ * @name set
1059
+ * @memberOf MapCache
1060
+ * @param {string} key The key of the value to set.
1061
+ * @param {*} value The value to set.
1062
+ * @returns {Object} Returns the map cache instance.
1063
+ */
1064
+ function mapCacheSet(key, value) {
1065
+ var data = _getMapData(this, key),
1066
+ size = data.size;
1067
+
1068
+ data.set(key, value);
1069
+ this.size += data.size == size ? 0 : 1;
1070
+ return this;
1071
+ }
1072
+
1073
+ var _mapCacheSet = mapCacheSet;
1074
+
1075
+ /**
1076
+ * Creates a map cache object to store key-value pairs.
1077
+ *
1078
+ * @private
1079
+ * @constructor
1080
+ * @param {Array} [entries] The key-value pairs to cache.
1081
+ */
1082
+ function MapCache(entries) {
1083
+ var index = -1,
1084
+ length = entries == null ? 0 : entries.length;
1085
+
1086
+ this.clear();
1087
+ while (++index < length) {
1088
+ var entry = entries[index];
1089
+ this.set(entry[0], entry[1]);
1090
+ }
1091
+ }
1092
+
1093
+ // Add methods to `MapCache`.
1094
+ MapCache.prototype.clear = _mapCacheClear;
1095
+ MapCache.prototype['delete'] = _mapCacheDelete;
1096
+ MapCache.prototype.get = _mapCacheGet;
1097
+ MapCache.prototype.has = _mapCacheHas;
1098
+ MapCache.prototype.set = _mapCacheSet;
1099
+
1100
+ var _MapCache = MapCache;
1101
+
1102
+ /** Error message constants. */
1103
+ var FUNC_ERROR_TEXT = 'Expected a function';
1104
+
1105
+ /**
1106
+ * Creates a function that memoizes the result of `func`. If `resolver` is
1107
+ * provided, it determines the cache key for storing the result based on the
1108
+ * arguments provided to the memoized function. By default, the first argument
1109
+ * provided to the memoized function is used as the map cache key. The `func`
1110
+ * is invoked with the `this` binding of the memoized function.
1111
+ *
1112
+ * **Note:** The cache is exposed as the `cache` property on the memoized
1113
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
1114
+ * constructor with one whose instances implement the
1115
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1116
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1117
+ *
1118
+ * @static
1119
+ * @memberOf _
1120
+ * @since 0.1.0
1121
+ * @category Function
1122
+ * @param {Function} func The function to have its output memoized.
1123
+ * @param {Function} [resolver] The function to resolve the cache key.
1124
+ * @returns {Function} Returns the new memoized function.
1125
+ * @example
1126
+ *
1127
+ * var object = { 'a': 1, 'b': 2 };
1128
+ * var other = { 'c': 3, 'd': 4 };
1129
+ *
1130
+ * var values = _.memoize(_.values);
1131
+ * values(object);
1132
+ * // => [1, 2]
1133
+ *
1134
+ * values(other);
1135
+ * // => [3, 4]
1136
+ *
1137
+ * object.a = 2;
1138
+ * values(object);
1139
+ * // => [1, 2]
1140
+ *
1141
+ * // Modify the result cache.
1142
+ * values.cache.set(object, ['a', 'b']);
1143
+ * values(object);
1144
+ * // => ['a', 'b']
1145
+ *
1146
+ * // Replace `_.memoize.Cache`.
1147
+ * _.memoize.Cache = WeakMap;
1148
+ */
1149
+ function memoize(func, resolver) {
1150
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1151
+ throw new TypeError(FUNC_ERROR_TEXT);
1152
+ }
1153
+ var memoized = function() {
1154
+ var args = arguments,
1155
+ key = resolver ? resolver.apply(this, args) : args[0],
1156
+ cache = memoized.cache;
1157
+
1158
+ if (cache.has(key)) {
1159
+ return cache.get(key);
1160
+ }
1161
+ var result = func.apply(this, args);
1162
+ memoized.cache = cache.set(key, result) || cache;
1163
+ return result;
1164
+ };
1165
+ memoized.cache = new (memoize.Cache || _MapCache);
1166
+ return memoized;
1167
+ }
1168
+
1169
+ // Expose `MapCache`.
1170
+ memoize.Cache = _MapCache;
1171
+
1172
+ var memoize_1 = memoize;
1173
+
1174
+ /** Used as the maximum memoize cache size. */
1175
+ var MAX_MEMOIZE_SIZE = 500;
1176
+
1177
+ /**
1178
+ * A specialized version of `_.memoize` which clears the memoized function's
1179
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1180
+ *
1181
+ * @private
1182
+ * @param {Function} func The function to have its output memoized.
1183
+ * @returns {Function} Returns the new memoized function.
1184
+ */
1185
+ function memoizeCapped(func) {
1186
+ var result = memoize_1(func, function(key) {
1187
+ if (cache.size === MAX_MEMOIZE_SIZE) {
1188
+ cache.clear();
1189
+ }
1190
+ return key;
1191
+ });
1192
+
1193
+ var cache = result.cache;
1194
+ return result;
1195
+ }
1196
+
1197
+ var _memoizeCapped = memoizeCapped;
1198
+
1199
+ /** Used to match property names within property paths. */
1200
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1201
+
1202
+ /** Used to match backslashes in property paths. */
1203
+ var reEscapeChar = /\\(\\)?/g;
1204
+
1205
+ /**
1206
+ * Converts `string` to a property path array.
1207
+ *
1208
+ * @private
1209
+ * @param {string} string The string to convert.
1210
+ * @returns {Array} Returns the property path array.
1211
+ */
1212
+ var stringToPath = _memoizeCapped(function(string) {
1213
+ var result = [];
1214
+ if (string.charCodeAt(0) === 46 /* . */) {
1215
+ result.push('');
1216
+ }
1217
+ string.replace(rePropName, function(match, number, quote, subString) {
1218
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1219
+ });
1220
+ return result;
1221
+ });
1222
+
1223
+ var _stringToPath = stringToPath;
1224
+
1225
+ /**
1226
+ * A specialized version of `_.map` for arrays without support for iteratee
1227
+ * shorthands.
1228
+ *
1229
+ * @private
1230
+ * @param {Array} [array] The array to iterate over.
1231
+ * @param {Function} iteratee The function invoked per iteration.
1232
+ * @returns {Array} Returns the new mapped array.
1233
+ */
1234
+ function arrayMap(array, iteratee) {
1235
+ var index = -1,
1236
+ length = array == null ? 0 : array.length,
1237
+ result = Array(length);
1238
+
1239
+ while (++index < length) {
1240
+ result[index] = iteratee(array[index], index, array);
1241
+ }
1242
+ return result;
1243
+ }
1244
+
1245
+ var _arrayMap = arrayMap;
1246
+
1247
+ /** Used as references for various `Number` constants. */
1248
+ var INFINITY$1 = 1 / 0;
1249
+
1250
+ /** Used to convert symbols to primitives and strings. */
1251
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1252
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
1253
+
1254
+ /**
1255
+ * The base implementation of `_.toString` which doesn't convert nullish
1256
+ * values to empty strings.
1257
+ *
1258
+ * @private
1259
+ * @param {*} value The value to process.
1260
+ * @returns {string} Returns the string.
1261
+ */
1262
+ function baseToString(value) {
1263
+ // Exit early for strings to avoid a performance hit in some environments.
1264
+ if (typeof value == 'string') {
1265
+ return value;
1266
+ }
1267
+ if (isArray_1(value)) {
1268
+ // Recursively convert values (susceptible to call stack limits).
1269
+ return _arrayMap(value, baseToString) + '';
1270
+ }
1271
+ if (isSymbol_1(value)) {
1272
+ return symbolToString ? symbolToString.call(value) : '';
1273
+ }
1274
+ var result = (value + '');
1275
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
1276
+ }
1277
+
1278
+ var _baseToString = baseToString;
1279
+
1280
+ /**
1281
+ * Converts `value` to a string. An empty string is returned for `null`
1282
+ * and `undefined` values. The sign of `-0` is preserved.
1283
+ *
1284
+ * @static
1285
+ * @memberOf _
1286
+ * @since 4.0.0
1287
+ * @category Lang
1288
+ * @param {*} value The value to convert.
1289
+ * @returns {string} Returns the converted string.
1290
+ * @example
1291
+ *
1292
+ * _.toString(null);
1293
+ * // => ''
1294
+ *
1295
+ * _.toString(-0);
1296
+ * // => '-0'
1297
+ *
1298
+ * _.toString([1, 2, 3]);
1299
+ * // => '1,2,3'
1300
+ */
1301
+ function toString(value) {
1302
+ return value == null ? '' : _baseToString(value);
1303
+ }
1304
+
1305
+ var toString_1 = toString;
1306
+
1307
+ /**
1308
+ * Casts `value` to a path array if it's not one.
1309
+ *
1310
+ * @private
1311
+ * @param {*} value The value to inspect.
1312
+ * @param {Object} [object] The object to query keys on.
1313
+ * @returns {Array} Returns the cast property path array.
1314
+ */
1315
+ function castPath(value, object) {
1316
+ if (isArray_1(value)) {
1317
+ return value;
1318
+ }
1319
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
1320
+ }
1321
+
1322
+ var _castPath = castPath;
1323
+
1324
+ /** Used as references for various `Number` constants. */
1325
+ var INFINITY = 1 / 0;
1326
+
1327
+ /**
1328
+ * Converts `value` to a string key if it's not a string or symbol.
1329
+ *
1330
+ * @private
1331
+ * @param {*} value The value to inspect.
1332
+ * @returns {string|symbol} Returns the key.
1333
+ */
1334
+ function toKey(value) {
1335
+ if (typeof value == 'string' || isSymbol_1(value)) {
1336
+ return value;
1337
+ }
1338
+ var result = (value + '');
1339
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1340
+ }
1341
+
1342
+ var _toKey = toKey;
1343
+
1344
+ /**
1345
+ * The base implementation of `_.get` without support for default values.
1346
+ *
1347
+ * @private
1348
+ * @param {Object} object The object to query.
1349
+ * @param {Array|string} path The path of the property to get.
1350
+ * @returns {*} Returns the resolved value.
1351
+ */
1352
+ function baseGet(object, path) {
1353
+ path = _castPath(path, object);
1354
+
1355
+ var index = 0,
1356
+ length = path.length;
1357
+
1358
+ while (object != null && index < length) {
1359
+ object = object[_toKey(path[index++])];
1360
+ }
1361
+ return (index && index == length) ? object : undefined;
1362
+ }
1363
+
1364
+ var _baseGet = baseGet;
1365
+
1366
+ /**
1367
+ * Gets the value at `path` of `object`. If the resolved value is
1368
+ * `undefined`, the `defaultValue` is returned in its place.
1369
+ *
1370
+ * @static
1371
+ * @memberOf _
1372
+ * @since 3.7.0
1373
+ * @category Object
1374
+ * @param {Object} object The object to query.
1375
+ * @param {Array|string} path The path of the property to get.
1376
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1377
+ * @returns {*} Returns the resolved value.
1378
+ * @example
1379
+ *
1380
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1381
+ *
1382
+ * _.get(object, 'a[0].b.c');
1383
+ * // => 3
1384
+ *
1385
+ * _.get(object, ['a', '0', 'b', 'c']);
1386
+ * // => 3
1387
+ *
1388
+ * _.get(object, 'a.b.c', 'default');
1389
+ * // => 'default'
1390
+ */
1391
+ function get(object, path, defaultValue) {
1392
+ var result = object == null ? undefined : _baseGet(object, path);
1393
+ return result === undefined ? defaultValue : result;
1394
+ }
1395
+
1396
+ var get_1 = get;
1397
+
1398
+ var _excluded$1 = ["element", "render"];
1399
+ var withElementWrapper = function withElementWrapper(StoryElement) {
1400
+ return function (props) {
1401
+ var element = props.element,
1402
+ render = props.render,
1403
+ restProps = _objectWithoutProperties(props, _excluded$1);
1404
+
1405
+ if (!element) return null;
1406
+ if (render && typeof render === "function") return render(props);
1407
+ return /*#__PURE__*/React.createElement(StoryElement, _extends({}, restProps, {
1408
+ element: element
1409
+ }));
1410
+ };
1411
+ };
1412
+ withElementWrapper.propTypes = {
1413
+ StoryElement: PropTypes.element
1414
+ };
1415
+
1416
+ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
1417
+ var _ref$width = _ref.width,
1418
+ width = _ref$width === void 0 ? 40 : _ref$width,
1419
+ _ref$height = _ref.height,
1420
+ height = _ref$height === void 0 ? 30 : _ref$height,
1421
+ _ref$iconColor = _ref.iconColor,
1422
+ iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
1423
+ return /*#__PURE__*/React.createElement("svg", {
1424
+ width: width,
1425
+ height: height,
1426
+ viewBox: "0 0 102 76",
1427
+ version: "1.1"
1428
+ }, /*#__PURE__*/React.createElement("g", {
1429
+ id: "demo-home-copy",
1430
+ stroke: "none",
1431
+ strokeWidth: "1",
1432
+ fill: "none",
1433
+ fillRule: "evenodd",
1434
+ transform: "translate(-377.000000, -314.000000)"
1435
+ }, /*#__PURE__*/React.createElement("g", {
1436
+ id: "Group-13",
1437
+ transform: "translate(377.000000, 314.000000)"
1438
+ }, /*#__PURE__*/React.createElement("path", {
1439
+ d: "M43.2,49.7 L62.2,19.2 L87.2,59.4 L17,59.4 L32.8,39.4 L43.2,49.7 Z M29.9,28.6 C25.8683213,28.6 22.6,25.3316787 22.6,21.3 C22.6,17.2683213 25.8683213,14 29.9,14 C33.9316787,14 37.2,17.2683213 37.2,21.3 C37.2,25.3316787 33.9316787,28.6 29.9,28.6 Z",
1440
+ id: "Combined-Shape",
1441
+ fill: iconColor,
1442
+ fillRule: "nonzero"
1443
+ }), /*#__PURE__*/React.createElement("rect", {
1444
+ id: "Rectangle-19",
1445
+ stroke: iconColor,
1446
+ strokeWidth: "3",
1447
+ x: "1.5",
1448
+ y: "1.5",
1449
+ width: "99",
1450
+ height: "73",
1451
+ rx: "3"
1452
+ }))));
1453
+ };
1454
+ ImageFallbackIcon.propTypes = {
1455
+ width: PropTypes.object,
1456
+ height: PropTypes.object,
1457
+ iconColor: PropTypes.object
1458
+ };
1459
+
1460
+ var imageFallback = function imageFallback() {
1461
+ return /*#__PURE__*/React.createElement("div", {
1462
+ className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
1463
+ }, /*#__PURE__*/React.createElement("figure", {
1464
+ className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
1465
+ }, /*#__PURE__*/React.createElement(ImageFallbackIcon, null)));
1466
+ };
1467
+
1468
+ var FallbackImage = function FallbackImage(_ref) {
1469
+ var slug = _ref.slug;
1470
+
1471
+ if (slug) {
1472
+ return /*#__PURE__*/React.createElement(Link, {
1473
+ href: slug,
1474
+ "aria-label": "image-fallback"
1475
+ }, imageFallback());
1476
+ } else {
1477
+ return imageFallback();
1478
+ }
1479
+ };
1480
+ FallbackImage.propTypes = {
1481
+ slug: PropTypes.string
1482
+ };
1483
+
1484
+ function _typeof(obj) {
1485
+ "@babel/helpers - typeof";
1486
+
1487
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1488
+ return typeof obj;
1489
+ } : function (obj) {
1490
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1491
+ }, _typeof(obj);
1492
+ }
1493
+
1494
+ /**
1495
+ * Copyright (c) 2014-present, Facebook, Inc.
1496
+ *
1497
+ * This source code is licensed under the MIT license found in the
1498
+ * LICENSE file in the root directory of this source tree.
1499
+ */
1500
+
1501
+ createCommonjsModule(function (module) {
1502
+ var runtime = (function (exports) {
1503
+
1504
+ var Op = Object.prototype;
1505
+ var hasOwn = Op.hasOwnProperty;
1506
+ var undefined$1; // More compressible than void 0.
1507
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
1508
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
1509
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1510
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1511
+
1512
+ function define(obj, key, value) {
1513
+ Object.defineProperty(obj, key, {
1514
+ value: value,
1515
+ enumerable: true,
1516
+ configurable: true,
1517
+ writable: true
1518
+ });
1519
+ return obj[key];
1520
+ }
1521
+ try {
1522
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
1523
+ define({}, "");
1524
+ } catch (err) {
1525
+ define = function(obj, key, value) {
1526
+ return obj[key] = value;
1527
+ };
1528
+ }
1529
+
1530
+ function wrap(innerFn, outerFn, self, tryLocsList) {
1531
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1532
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1533
+ var generator = Object.create(protoGenerator.prototype);
1534
+ var context = new Context(tryLocsList || []);
1535
+
1536
+ // The ._invoke method unifies the implementations of the .next,
1537
+ // .throw, and .return methods.
1538
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
1539
+
1540
+ return generator;
1541
+ }
1542
+ exports.wrap = wrap;
1543
+
1544
+ // Try/catch helper to minimize deoptimizations. Returns a completion
1545
+ // record like context.tryEntries[i].completion. This interface could
1546
+ // have been (and was previously) designed to take a closure to be
1547
+ // invoked without arguments, but in all the cases we care about we
1548
+ // already have an existing method we want to call, so there's no need
1549
+ // to create a new function object. We can even get away with assuming
1550
+ // the method takes exactly one argument, since that happens to be true
1551
+ // in every case, so we don't have to touch the arguments object. The
1552
+ // only additional allocation required is the completion record, which
1553
+ // has a stable shape and so hopefully should be cheap to allocate.
1554
+ function tryCatch(fn, obj, arg) {
1555
+ try {
1556
+ return { type: "normal", arg: fn.call(obj, arg) };
1557
+ } catch (err) {
1558
+ return { type: "throw", arg: err };
1559
+ }
1560
+ }
1561
+
1562
+ var GenStateSuspendedStart = "suspendedStart";
1563
+ var GenStateSuspendedYield = "suspendedYield";
1564
+ var GenStateExecuting = "executing";
1565
+ var GenStateCompleted = "completed";
1566
+
1567
+ // Returning this object from the innerFn has the same effect as
1568
+ // breaking out of the dispatch switch statement.
1569
+ var ContinueSentinel = {};
1570
+
1571
+ // Dummy constructor functions that we use as the .constructor and
1572
+ // .constructor.prototype properties for functions that return Generator
1573
+ // objects. For full spec compliance, you may wish to configure your
1574
+ // minifier not to mangle the names of these two functions.
1575
+ function Generator() {}
1576
+ function GeneratorFunction() {}
1577
+ function GeneratorFunctionPrototype() {}
1578
+
1579
+ // This is a polyfill for %IteratorPrototype% for environments that
1580
+ // don't natively support it.
1581
+ var IteratorPrototype = {};
1582
+ define(IteratorPrototype, iteratorSymbol, function () {
1583
+ return this;
1584
+ });
1585
+
1586
+ var getProto = Object.getPrototypeOf;
1587
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1588
+ if (NativeIteratorPrototype &&
1589
+ NativeIteratorPrototype !== Op &&
1590
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1591
+ // This environment has a native %IteratorPrototype%; use it instead
1592
+ // of the polyfill.
1593
+ IteratorPrototype = NativeIteratorPrototype;
1594
+ }
1595
+
1596
+ var Gp = GeneratorFunctionPrototype.prototype =
1597
+ Generator.prototype = Object.create(IteratorPrototype);
1598
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
1599
+ define(Gp, "constructor", GeneratorFunctionPrototype);
1600
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
1601
+ GeneratorFunction.displayName = define(
1602
+ GeneratorFunctionPrototype,
1603
+ toStringTagSymbol,
1604
+ "GeneratorFunction"
1605
+ );
1606
+
1607
+ // Helper for defining the .next, .throw, and .return methods of the
1608
+ // Iterator interface in terms of a single ._invoke method.
1609
+ function defineIteratorMethods(prototype) {
1610
+ ["next", "throw", "return"].forEach(function(method) {
1611
+ define(prototype, method, function(arg) {
1612
+ return this._invoke(method, arg);
1613
+ });
1614
+ });
1615
+ }
1616
+
1617
+ exports.isGeneratorFunction = function(genFun) {
1618
+ var ctor = typeof genFun === "function" && genFun.constructor;
1619
+ return ctor
1620
+ ? ctor === GeneratorFunction ||
1621
+ // For the native GeneratorFunction constructor, the best we can
1622
+ // do is to check its .name property.
1623
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
1624
+ : false;
1625
+ };
1626
+
1627
+ exports.mark = function(genFun) {
1628
+ if (Object.setPrototypeOf) {
1629
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1630
+ } else {
1631
+ genFun.__proto__ = GeneratorFunctionPrototype;
1632
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
1633
+ }
1634
+ genFun.prototype = Object.create(Gp);
1635
+ return genFun;
1636
+ };
1637
+
1638
+ // Within the body of any async function, `await x` is transformed to
1639
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1640
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
1641
+ // meant to be awaited.
1642
+ exports.awrap = function(arg) {
1643
+ return { __await: arg };
1644
+ };
1645
+
1646
+ function AsyncIterator(generator, PromiseImpl) {
1647
+ function invoke(method, arg, resolve, reject) {
1648
+ var record = tryCatch(generator[method], generator, arg);
1649
+ if (record.type === "throw") {
1650
+ reject(record.arg);
1651
+ } else {
1652
+ var result = record.arg;
1653
+ var value = result.value;
1654
+ if (value &&
1655
+ typeof value === "object" &&
1656
+ hasOwn.call(value, "__await")) {
1657
+ return PromiseImpl.resolve(value.__await).then(function(value) {
1658
+ invoke("next", value, resolve, reject);
1659
+ }, function(err) {
1660
+ invoke("throw", err, resolve, reject);
1661
+ });
1662
+ }
1663
+
1664
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
1665
+ // When a yielded Promise is resolved, its final value becomes
1666
+ // the .value of the Promise<{value,done}> result for the
1667
+ // current iteration.
1668
+ result.value = unwrapped;
1669
+ resolve(result);
1670
+ }, function(error) {
1671
+ // If a rejected Promise was yielded, throw the rejection back
1672
+ // into the async generator function so it can be handled there.
1673
+ return invoke("throw", error, resolve, reject);
1674
+ });
1675
+ }
1676
+ }
1677
+
1678
+ var previousPromise;
1679
+
1680
+ function enqueue(method, arg) {
1681
+ function callInvokeWithMethodAndArg() {
1682
+ return new PromiseImpl(function(resolve, reject) {
1683
+ invoke(method, arg, resolve, reject);
1684
+ });
1685
+ }
1686
+
1687
+ return previousPromise =
1688
+ // If enqueue has been called before, then we want to wait until
1689
+ // all previous Promises have been resolved before calling invoke,
1690
+ // so that results are always delivered in the correct order. If
1691
+ // enqueue has not been called before, then it is important to
1692
+ // call invoke immediately, without waiting on a callback to fire,
1693
+ // so that the async generator function has the opportunity to do
1694
+ // any necessary setup in a predictable way. This predictability
1695
+ // is why the Promise constructor synchronously invokes its
1696
+ // executor callback, and why async functions synchronously
1697
+ // execute code before the first await. Since we implement simple
1698
+ // async functions in terms of async generators, it is especially
1699
+ // important to get this right, even though it requires care.
1700
+ previousPromise ? previousPromise.then(
1701
+ callInvokeWithMethodAndArg,
1702
+ // Avoid propagating failures to Promises returned by later
1703
+ // invocations of the iterator.
1704
+ callInvokeWithMethodAndArg
1705
+ ) : callInvokeWithMethodAndArg();
1706
+ }
1707
+
1708
+ // Define the unified helper method that is used to implement .next,
1709
+ // .throw, and .return (see defineIteratorMethods).
1710
+ this._invoke = enqueue;
1711
+ }
1712
+
1713
+ defineIteratorMethods(AsyncIterator.prototype);
1714
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1715
+ return this;
1716
+ });
1717
+ exports.AsyncIterator = AsyncIterator;
1718
+
1719
+ // Note that simple async functions are implemented on top of
1720
+ // AsyncIterator objects; they just return a Promise for the value of
1721
+ // the final result produced by the iterator.
1722
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1723
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
1724
+
1725
+ var iter = new AsyncIterator(
1726
+ wrap(innerFn, outerFn, self, tryLocsList),
1727
+ PromiseImpl
1728
+ );
1729
+
1730
+ return exports.isGeneratorFunction(outerFn)
1731
+ ? iter // If outerFn is a generator, return the full iterator.
1732
+ : iter.next().then(function(result) {
1733
+ return result.done ? result.value : iter.next();
1734
+ });
1735
+ };
1736
+
1737
+ function makeInvokeMethod(innerFn, self, context) {
1738
+ var state = GenStateSuspendedStart;
1739
+
1740
+ return function invoke(method, arg) {
1741
+ if (state === GenStateExecuting) {
1742
+ throw new Error("Generator is already running");
1743
+ }
1744
+
1745
+ if (state === GenStateCompleted) {
1746
+ if (method === "throw") {
1747
+ throw arg;
1748
+ }
1749
+
1750
+ // Be forgiving, per 25.3.3.3.3 of the spec:
1751
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1752
+ return doneResult();
1753
+ }
1754
+
1755
+ context.method = method;
1756
+ context.arg = arg;
1757
+
1758
+ while (true) {
1759
+ var delegate = context.delegate;
1760
+ if (delegate) {
1761
+ var delegateResult = maybeInvokeDelegate(delegate, context);
1762
+ if (delegateResult) {
1763
+ if (delegateResult === ContinueSentinel) continue;
1764
+ return delegateResult;
1765
+ }
1766
+ }
1767
+
1768
+ if (context.method === "next") {
1769
+ // Setting context._sent for legacy support of Babel's
1770
+ // function.sent implementation.
1771
+ context.sent = context._sent = context.arg;
1772
+
1773
+ } else if (context.method === "throw") {
1774
+ if (state === GenStateSuspendedStart) {
1775
+ state = GenStateCompleted;
1776
+ throw context.arg;
1777
+ }
1778
+
1779
+ context.dispatchException(context.arg);
1780
+
1781
+ } else if (context.method === "return") {
1782
+ context.abrupt("return", context.arg);
1783
+ }
1784
+
1785
+ state = GenStateExecuting;
1786
+
1787
+ var record = tryCatch(innerFn, self, context);
1788
+ if (record.type === "normal") {
1789
+ // If an exception is thrown from innerFn, we leave state ===
1790
+ // GenStateExecuting and loop back for another invocation.
1791
+ state = context.done
1792
+ ? GenStateCompleted
1793
+ : GenStateSuspendedYield;
1794
+
1795
+ if (record.arg === ContinueSentinel) {
1796
+ continue;
1797
+ }
1798
+
1799
+ return {
1800
+ value: record.arg,
1801
+ done: context.done
1802
+ };
1803
+
1804
+ } else if (record.type === "throw") {
1805
+ state = GenStateCompleted;
1806
+ // Dispatch the exception by looping back around to the
1807
+ // context.dispatchException(context.arg) call above.
1808
+ context.method = "throw";
1809
+ context.arg = record.arg;
1810
+ }
1811
+ }
1812
+ };
1813
+ }
1814
+
1815
+ // Call delegate.iterator[context.method](context.arg) and handle the
1816
+ // result, either by returning a { value, done } result from the
1817
+ // delegate iterator, or by modifying context.method and context.arg,
1818
+ // setting context.delegate to null, and returning the ContinueSentinel.
1819
+ function maybeInvokeDelegate(delegate, context) {
1820
+ var method = delegate.iterator[context.method];
1821
+ if (method === undefined$1) {
1822
+ // A .throw or .return when the delegate iterator has no .throw
1823
+ // method always terminates the yield* loop.
1824
+ context.delegate = null;
1825
+
1826
+ if (context.method === "throw") {
1827
+ // Note: ["return"] must be used for ES3 parsing compatibility.
1828
+ if (delegate.iterator["return"]) {
1829
+ // If the delegate iterator has a return method, give it a
1830
+ // chance to clean up.
1831
+ context.method = "return";
1832
+ context.arg = undefined$1;
1833
+ maybeInvokeDelegate(delegate, context);
1834
+
1835
+ if (context.method === "throw") {
1836
+ // If maybeInvokeDelegate(context) changed context.method from
1837
+ // "return" to "throw", let that override the TypeError below.
1838
+ return ContinueSentinel;
1839
+ }
1840
+ }
1841
+
1842
+ context.method = "throw";
1843
+ context.arg = new TypeError(
1844
+ "The iterator does not provide a 'throw' method");
1845
+ }
1846
+
1847
+ return ContinueSentinel;
1848
+ }
1849
+
1850
+ var record = tryCatch(method, delegate.iterator, context.arg);
1851
+
1852
+ if (record.type === "throw") {
1853
+ context.method = "throw";
1854
+ context.arg = record.arg;
1855
+ context.delegate = null;
1856
+ return ContinueSentinel;
1857
+ }
1858
+
1859
+ var info = record.arg;
1860
+
1861
+ if (! info) {
1862
+ context.method = "throw";
1863
+ context.arg = new TypeError("iterator result is not an object");
1864
+ context.delegate = null;
1865
+ return ContinueSentinel;
1866
+ }
1867
+
1868
+ if (info.done) {
1869
+ // Assign the result of the finished delegate to the temporary
1870
+ // variable specified by delegate.resultName (see delegateYield).
1871
+ context[delegate.resultName] = info.value;
1872
+
1873
+ // Resume execution at the desired location (see delegateYield).
1874
+ context.next = delegate.nextLoc;
1875
+
1876
+ // If context.method was "throw" but the delegate handled the
1877
+ // exception, let the outer generator proceed normally. If
1878
+ // context.method was "next", forget context.arg since it has been
1879
+ // "consumed" by the delegate iterator. If context.method was
1880
+ // "return", allow the original .return call to continue in the
1881
+ // outer generator.
1882
+ if (context.method !== "return") {
1883
+ context.method = "next";
1884
+ context.arg = undefined$1;
1885
+ }
1886
+
1887
+ } else {
1888
+ // Re-yield the result returned by the delegate method.
1889
+ return info;
1890
+ }
1891
+
1892
+ // The delegate iterator is finished, so forget it and continue with
1893
+ // the outer generator.
1894
+ context.delegate = null;
1895
+ return ContinueSentinel;
1896
+ }
1897
+
1898
+ // Define Generator.prototype.{next,throw,return} in terms of the
1899
+ // unified ._invoke helper method.
1900
+ defineIteratorMethods(Gp);
1901
+
1902
+ define(Gp, toStringTagSymbol, "Generator");
1903
+
1904
+ // A Generator should always return itself as the iterator object when the
1905
+ // @@iterator function is called on it. Some browsers' implementations of the
1906
+ // iterator prototype chain incorrectly implement this, causing the Generator
1907
+ // object to not be returned from this call. This ensures that doesn't happen.
1908
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
1909
+ define(Gp, iteratorSymbol, function() {
1910
+ return this;
1911
+ });
1912
+
1913
+ define(Gp, "toString", function() {
1914
+ return "[object Generator]";
1915
+ });
1916
+
1917
+ function pushTryEntry(locs) {
1918
+ var entry = { tryLoc: locs[0] };
1919
+
1920
+ if (1 in locs) {
1921
+ entry.catchLoc = locs[1];
1922
+ }
1923
+
1924
+ if (2 in locs) {
1925
+ entry.finallyLoc = locs[2];
1926
+ entry.afterLoc = locs[3];
1927
+ }
1928
+
1929
+ this.tryEntries.push(entry);
1930
+ }
1931
+
1932
+ function resetTryEntry(entry) {
1933
+ var record = entry.completion || {};
1934
+ record.type = "normal";
1935
+ delete record.arg;
1936
+ entry.completion = record;
1937
+ }
1938
+
1939
+ function Context(tryLocsList) {
1940
+ // The root entry object (effectively a try statement without a catch
1941
+ // or a finally block) gives us a place to store values thrown from
1942
+ // locations where there is no enclosing try statement.
1943
+ this.tryEntries = [{ tryLoc: "root" }];
1944
+ tryLocsList.forEach(pushTryEntry, this);
1945
+ this.reset(true);
1946
+ }
1947
+
1948
+ exports.keys = function(object) {
1949
+ var keys = [];
1950
+ for (var key in object) {
1951
+ keys.push(key);
1952
+ }
1953
+ keys.reverse();
1954
+
1955
+ // Rather than returning an object with a next method, we keep
1956
+ // things simple and return the next function itself.
1957
+ return function next() {
1958
+ while (keys.length) {
1959
+ var key = keys.pop();
1960
+ if (key in object) {
1961
+ next.value = key;
1962
+ next.done = false;
1963
+ return next;
1964
+ }
1965
+ }
1966
+
1967
+ // To avoid creating an additional object, we just hang the .value
1968
+ // and .done properties off the next function object itself. This
1969
+ // also ensures that the minifier will not anonymize the function.
1970
+ next.done = true;
1971
+ return next;
1972
+ };
1973
+ };
1974
+
1975
+ function values(iterable) {
1976
+ if (iterable) {
1977
+ var iteratorMethod = iterable[iteratorSymbol];
1978
+ if (iteratorMethod) {
1979
+ return iteratorMethod.call(iterable);
1980
+ }
1981
+
1982
+ if (typeof iterable.next === "function") {
1983
+ return iterable;
1984
+ }
1985
+
1986
+ if (!isNaN(iterable.length)) {
1987
+ var i = -1, next = function next() {
1988
+ while (++i < iterable.length) {
1989
+ if (hasOwn.call(iterable, i)) {
1990
+ next.value = iterable[i];
1991
+ next.done = false;
1992
+ return next;
1993
+ }
1994
+ }
1995
+
1996
+ next.value = undefined$1;
1997
+ next.done = true;
1998
+
1999
+ return next;
2000
+ };
2001
+
2002
+ return next.next = next;
2003
+ }
2004
+ }
2005
+
2006
+ // Return an iterator with no values.
2007
+ return { next: doneResult };
2008
+ }
2009
+ exports.values = values;
2010
+
2011
+ function doneResult() {
2012
+ return { value: undefined$1, done: true };
2013
+ }
2014
+
2015
+ Context.prototype = {
2016
+ constructor: Context,
2017
+
2018
+ reset: function(skipTempReset) {
2019
+ this.prev = 0;
2020
+ this.next = 0;
2021
+ // Resetting context._sent for legacy support of Babel's
2022
+ // function.sent implementation.
2023
+ this.sent = this._sent = undefined$1;
2024
+ this.done = false;
2025
+ this.delegate = null;
2026
+
2027
+ this.method = "next";
2028
+ this.arg = undefined$1;
2029
+
2030
+ this.tryEntries.forEach(resetTryEntry);
2031
+
2032
+ if (!skipTempReset) {
2033
+ for (var name in this) {
2034
+ // Not sure about the optimal order of these conditions:
2035
+ if (name.charAt(0) === "t" &&
2036
+ hasOwn.call(this, name) &&
2037
+ !isNaN(+name.slice(1))) {
2038
+ this[name] = undefined$1;
2039
+ }
2040
+ }
2041
+ }
2042
+ },
2043
+
2044
+ stop: function() {
2045
+ this.done = true;
2046
+
2047
+ var rootEntry = this.tryEntries[0];
2048
+ var rootRecord = rootEntry.completion;
2049
+ if (rootRecord.type === "throw") {
2050
+ throw rootRecord.arg;
2051
+ }
2052
+
2053
+ return this.rval;
2054
+ },
2055
+
2056
+ dispatchException: function(exception) {
2057
+ if (this.done) {
2058
+ throw exception;
2059
+ }
2060
+
2061
+ var context = this;
2062
+ function handle(loc, caught) {
2063
+ record.type = "throw";
2064
+ record.arg = exception;
2065
+ context.next = loc;
2066
+
2067
+ if (caught) {
2068
+ // If the dispatched exception was caught by a catch block,
2069
+ // then let that catch block handle the exception normally.
2070
+ context.method = "next";
2071
+ context.arg = undefined$1;
2072
+ }
2073
+
2074
+ return !! caught;
2075
+ }
2076
+
2077
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2078
+ var entry = this.tryEntries[i];
2079
+ var record = entry.completion;
2080
+
2081
+ if (entry.tryLoc === "root") {
2082
+ // Exception thrown outside of any try block that could handle
2083
+ // it, so set the completion value of the entire function to
2084
+ // throw the exception.
2085
+ return handle("end");
2086
+ }
2087
+
2088
+ if (entry.tryLoc <= this.prev) {
2089
+ var hasCatch = hasOwn.call(entry, "catchLoc");
2090
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
2091
+
2092
+ if (hasCatch && hasFinally) {
2093
+ if (this.prev < entry.catchLoc) {
2094
+ return handle(entry.catchLoc, true);
2095
+ } else if (this.prev < entry.finallyLoc) {
2096
+ return handle(entry.finallyLoc);
2097
+ }
2098
+
2099
+ } else if (hasCatch) {
2100
+ if (this.prev < entry.catchLoc) {
2101
+ return handle(entry.catchLoc, true);
2102
+ }
2103
+
2104
+ } else if (hasFinally) {
2105
+ if (this.prev < entry.finallyLoc) {
2106
+ return handle(entry.finallyLoc);
2107
+ }
2108
+
2109
+ } else {
2110
+ throw new Error("try statement without catch or finally");
2111
+ }
2112
+ }
2113
+ }
2114
+ },
2115
+
2116
+ abrupt: function(type, arg) {
2117
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2118
+ var entry = this.tryEntries[i];
2119
+ if (entry.tryLoc <= this.prev &&
2120
+ hasOwn.call(entry, "finallyLoc") &&
2121
+ this.prev < entry.finallyLoc) {
2122
+ var finallyEntry = entry;
2123
+ break;
2124
+ }
2125
+ }
2126
+
2127
+ if (finallyEntry &&
2128
+ (type === "break" ||
2129
+ type === "continue") &&
2130
+ finallyEntry.tryLoc <= arg &&
2131
+ arg <= finallyEntry.finallyLoc) {
2132
+ // Ignore the finally entry if control is not jumping to a
2133
+ // location outside the try/catch block.
2134
+ finallyEntry = null;
2135
+ }
2136
+
2137
+ var record = finallyEntry ? finallyEntry.completion : {};
2138
+ record.type = type;
2139
+ record.arg = arg;
2140
+
2141
+ if (finallyEntry) {
2142
+ this.method = "next";
2143
+ this.next = finallyEntry.finallyLoc;
2144
+ return ContinueSentinel;
2145
+ }
2146
+
2147
+ return this.complete(record);
2148
+ },
2149
+
2150
+ complete: function(record, afterLoc) {
2151
+ if (record.type === "throw") {
2152
+ throw record.arg;
2153
+ }
2154
+
2155
+ if (record.type === "break" ||
2156
+ record.type === "continue") {
2157
+ this.next = record.arg;
2158
+ } else if (record.type === "return") {
2159
+ this.rval = this.arg = record.arg;
2160
+ this.method = "return";
2161
+ this.next = "end";
2162
+ } else if (record.type === "normal" && afterLoc) {
2163
+ this.next = afterLoc;
2164
+ }
2165
+
2166
+ return ContinueSentinel;
2167
+ },
2168
+
2169
+ finish: function(finallyLoc) {
2170
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2171
+ var entry = this.tryEntries[i];
2172
+ if (entry.finallyLoc === finallyLoc) {
2173
+ this.complete(entry.completion, entry.afterLoc);
2174
+ resetTryEntry(entry);
2175
+ return ContinueSentinel;
2176
+ }
2177
+ }
2178
+ },
2179
+
2180
+ "catch": function(tryLoc) {
2181
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2182
+ var entry = this.tryEntries[i];
2183
+ if (entry.tryLoc === tryLoc) {
2184
+ var record = entry.completion;
2185
+ if (record.type === "throw") {
2186
+ var thrown = record.arg;
2187
+ resetTryEntry(entry);
2188
+ }
2189
+ return thrown;
2190
+ }
2191
+ }
2192
+
2193
+ // The context.catch method must only be called with a location
2194
+ // argument that corresponds to a known catch block.
2195
+ throw new Error("illegal catch attempt");
2196
+ },
2197
+
2198
+ delegateYield: function(iterable, resultName, nextLoc) {
2199
+ this.delegate = {
2200
+ iterator: values(iterable),
2201
+ resultName: resultName,
2202
+ nextLoc: nextLoc
2203
+ };
2204
+
2205
+ if (this.method === "next") {
2206
+ // Deliberately forget the last sent value so that we don't
2207
+ // accidentally pass it on to the delegate.
2208
+ this.arg = undefined$1;
2209
+ }
2210
+
2211
+ return ContinueSentinel;
2212
+ }
2213
+ };
2214
+
2215
+ // Regardless of whether this script is executing as a CommonJS module
2216
+ // or not, return the runtime object so that we can declare the variable
2217
+ // regeneratorRuntime in the outer scope, which allows this module to be
2218
+ // injected easily by `bin/regenerator --include-runtime script.js`.
2219
+ return exports;
2220
+
2221
+ }(
2222
+ // If this script is executing as a CommonJS module, use module.exports
2223
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
2224
+ // object. Either way, the resulting object will be used to initialize
2225
+ // the regeneratorRuntime variable at the top of this file.
2226
+ module.exports
2227
+ ));
2228
+
2229
+ try {
2230
+ regeneratorRuntime = runtime;
2231
+ } catch (accidentalStrictMode) {
2232
+ // This module should not be running in strict mode, so the above
2233
+ // assignment should always work unless something is misconfigured. Just
2234
+ // in case runtime.js accidentally runs in strict mode, in modern engines
2235
+ // we can explicitly access globalThis. In older engines we can escape
2236
+ // strict mode using a global Function call. This could conceivably fail
2237
+ // if a Content Security Policy forbids using Function, but in that case
2238
+ // the proper solution is to fix the accidental strict mode problem. If
2239
+ // you've misconfigured your bundler to force strict mode and applied a
2240
+ // CSP to forbid Function, and you're not willing to fix either of those
2241
+ // problems, please detail your unique predicament in a GitHub issue.
2242
+ if (typeof globalThis === "object") {
2243
+ globalThis.regeneratorRuntime = runtime;
2244
+ } else {
2245
+ Function("r", "regeneratorRuntime = r")(runtime);
2246
+ }
2247
+ }
2248
+ });
2249
+
2250
+ var hexToRGB = function hexToRGB(hex) {
2251
+ var r = parseInt(hex.slice(1, 3), 16);
2252
+ var g = parseInt(hex.slice(3, 5), 16);
2253
+ var b = parseInt(hex.slice(5, 7), 16);
2254
+ return {
2255
+ r: r,
2256
+ g: g,
2257
+ b: b
2258
+ };
2259
+ };
2260
+ var getLuminanceOfColor = function getLuminanceOfColor(hex) {
2261
+ var _hexToRGB = hexToRGB(hex),
2262
+ r = _hexToRGB.r,
2263
+ g = _hexToRGB.g,
2264
+ b = _hexToRGB.b;
2265
+
2266
+ return r * 0.299 + g * 0.587 + b * 0.114;
2267
+ };
2268
+ var rgbToHex = function rgbToHex() {
2269
+ var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgba(255, 255, 255, 0)";
2270
+ var rgba = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
2271
+ return rgba && rgba.length === 4 ? "#" + ("0" + parseInt(rgba[1], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[2], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[3], 10).toString(16)).slice(-2) : color;
2272
+ };
2273
+ var clientWidths = {
2274
+ mobile: 767,
2275
+ tablet: 1024
2276
+ };
2277
+ var clientWidth = function clientWidth(device) {
2278
+ var foundDeviceWidth = get_1(clientWidths, device);
2279
+
2280
+ if (foundDeviceWidth) {
2281
+ return get_1(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
2282
+ }
2283
+
2284
+ return false;
2285
+ };
2286
+ var getTextColor = function getTextColor() {
2287
+ var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(255,255,255)";
2288
+ var isRegexCheck = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(theme);
2289
+ var getHexValue = !isRegexCheck ? rgbToHex(theme) : theme;
2290
+ var textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
2291
+ return textColor;
2292
+ };
2293
+ var isEmpty = function isEmpty(value) {
2294
+ return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
2295
+ _typeof(value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
2296
+ };
2297
+ var shapeConfig = PropTypes.shape({
2298
+ "sketches-host": PropTypes.string,
2299
+ "cdn-name": PropTypes.string,
2300
+ "cdn-image": PropTypes.string
2301
+ });
2302
+ PropTypes.shape({
2303
+ headline: PropTypes.string,
2304
+ "last-published-at": PropTypes.number,
2305
+ subheadline: PropTypes.string
2306
+ });
2307
+
2308
+ var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
2309
+ var useStateValue = function useStateValue() {
2310
+ return useContext(StateContext);
2311
+ };
2312
+
2313
+ var _excluded = ["story", "element", "template", "opts", "css", "config", "render"];
2314
+ var _styleModuleImportMap = {
2315
+ "./also-read.m.css": {
2316
+ "viewports": "\"../../../../../assets/stylesheets/viewports.m.css\"",
2317
+ "mobile": "768px",
2318
+ "card-image": "also-read-m_card-image__3CwAv",
2319
+ "default-text": "also-read-m_default-text__hp2dp",
2320
+ "alsoread-textLeftAlign": "also-read-m_alsoread-textLeftAlign__S0Dxe",
2321
+ "alsoread-imageRightAlign": "also-read-m_alsoread-imageRightAlign__1bsF3",
2322
+ "headline": "also-read-m_headline__VzF-c",
2323
+ "alsoread-default": "also-read-m_alsoread-default__3cYER",
2324
+ "card-image-wrapper": "also-read-m_card-image-wrapper__3GFzu",
2325
+ "image": "also-read-m_image__2jdRP",
2326
+ "content-wrapper": "also-read-m_content-wrapper__26AZX",
2327
+ "alsoread": "also-read-m_alsoread__1crOV",
2328
+ "dark": "also-read-m_dark__1pUib",
2329
+ "light": "also-read-m_light__bTCze"
2330
+ }
2331
+ };
2332
+
2333
+ var DisplayImage = function DisplayImage(_ref) {
2334
+ var story = _ref.story,
2335
+ linkedImage = _ref.linkedImage,
2336
+ template = _ref.template,
2337
+ isRightAlign = _ref.isRightAlign;
2338
+ var isLeftAlign = template === "textLeftAlign";
2339
+ var isMobile = clientWidth("mobile");
2340
+ var rightAlignAspectRatio = isRightAlign && isMobile ? [4, 3] : [16, 9];
2341
+ var imageAspectRatio = isLeftAlign ? [16, 9] : rightAlignAspectRatio;
2342
+ var alternateText = story["hero-image-caption"] || story["headline"];
2343
+ return /*#__PURE__*/React.createElement("div", {
2344
+ className: "also-read-m_card-image-wrapper__3GFzu"
2345
+ }, !isEmpty(linkedImage) ? /*#__PURE__*/React.createElement("figure", {
2346
+ className: "also-read-m_card-image__3CwAv"
2347
+ }, /*#__PURE__*/React.createElement(LazyLoadImages, null, /*#__PURE__*/React.createElement(ResponsiveImage, {
2348
+ slug: linkedImage,
2349
+ "aspect-ratio": imageAspectRatio,
2350
+ defaultWidth: 480,
2351
+ widths: [250, 480, 640],
2352
+ imgParams: {
2353
+ auto: ["format", "compress"]
2354
+ },
2355
+ alt: alternateText
2356
+ }))) : /*#__PURE__*/React.createElement("div", {
2357
+ className: "arr--fallback-also-read also-read-m_image__2jdRP"
2358
+ }, /*#__PURE__*/React.createElement(FallbackImage, null)));
2359
+ };
2360
+
2361
+ DisplayImage.propTypes = {
2362
+ story: PropTypes.shape({
2363
+ "hero-image-caption": PropTypes.string,
2364
+ headline: PropTypes.string
2365
+ }),
2366
+ linkedImage: PropTypes.string,
2367
+ template: PropTypes.string,
2368
+ isRightAlign: PropTypes.bool
2369
+ };
2370
+
2371
+ var AlsoReadBase = function AlsoReadBase(_ref2) {
2372
+ var _ref2$story = _ref2.story,
2373
+ story = _ref2$story === void 0 ? {} : _ref2$story,
2374
+ element = _ref2.element,
2375
+ _ref2$template = _ref2.template,
2376
+ template = _ref2$template === void 0 ? "" : _ref2$template,
2377
+ _ref2$opts = _ref2.opts,
2378
+ opts = _ref2$opts === void 0 ? {} : _ref2$opts,
2379
+ _ref2$css = _ref2.css,
2380
+ css = _ref2$css === void 0 ? {} : _ref2$css;
2381
+ _ref2.config;
2382
+ _ref2.render;
2383
+ var restProps = _objectWithoutProperties(_ref2, _excluded);
2384
+
2385
+ var content = element.text;
2386
+ if (!content) return null;
2387
+ var linkedStories = get_1(story, ["linked-stories"], {});
2388
+ var linkedStoryId = get_1(element, ["metadata", "linked-story-id"]);
2389
+ var linkedStorySlug = get_1(linkedStories, [linkedStoryId, "url"]);
2390
+ var linkedImage = get_1(linkedStories, [linkedStoryId, "hero-image-s3-key"], "");
2391
+ var storyUrl = linkedStorySlug && linkedStorySlug;
2392
+ var configData = useStateValue() || {};
2393
+ var textInvertColor = getTextColor(configData.theme);
2394
+ var _opts$title = opts.title,
2395
+ title = _opts$title === void 0 ? "" : _opts$title;
2396
+ var textColor = css.textColor;
2397
+ var displayTitle = title || "Also Read";
2398
+ var isDefault = template === "" || template === "default";
2399
+ var isRightAlign = template === "imageRightAlign";
2400
+ var templateStyle = template ? "alsoread-".concat(template) : "alsoread-default";
2401
+ return /*#__PURE__*/React.createElement(Link, _extends({
2402
+ "data-test-id": "also-read",
2403
+ href: storyUrl,
2404
+ "aria-label": "also-read"
2405
+ }, restProps, {
2406
+ className: "arrow-component arr--also-read-element " + _getClassName(templateStyle, _styleModuleImportMap) + (" " + (restProps ? restProps.className || "" : ""))
2407
+ }), !isDefault && /*#__PURE__*/React.createElement("div", {
2408
+ className: _getClassName("default-text ".concat(textInvertColor), _styleModuleImportMap)
2409
+ }, displayTitle), isDefault && /*#__PURE__*/React.createElement(DisplayImage, {
2410
+ story: story,
2411
+ linkedImage: linkedImage,
2412
+ template: template,
2413
+ isRightAlign: isRightAlign
2414
+ }), /*#__PURE__*/React.createElement("div", {
2415
+ className: "also-read-m_content-wrapper__26AZX"
2416
+ }, /*#__PURE__*/React.createElement("div", {
2417
+ className: "also-read-m_headline__VzF-c",
2418
+ style: textColor ? {
2419
+ color: textColor
2420
+ } : {
2421
+ color: textInvertColor
2422
+ },
2423
+ dangerouslySetInnerHTML: {
2424
+ __html: content
2425
+ }
2426
+ }), isRightAlign && /*#__PURE__*/React.createElement(DisplayImage, {
2427
+ story: story,
2428
+ linkedImage: linkedImage,
2429
+ template: template
2430
+ })));
2431
+ };
2432
+
2433
+ AlsoReadBase.propTypes = {
2434
+ /** template can be default, textLeftAlign or imageRightAlign */
2435
+ template: PropTypes.string,
2436
+ story: PropTypes.shape({
2437
+ "linked-stories": PropTypes.object
2438
+ }),
2439
+ element: PropTypes.shape({
2440
+ text: PropTypes.string,
2441
+ metadata: PropTypes.shape({
2442
+ linkedStoryId: PropTypes.shape({
2443
+ url: PropTypes.string,
2444
+ "hero-image-s3-key": PropTypes.string
2445
+ })
2446
+ })
2447
+ }),
2448
+ opts: PropTypes.shape({
2449
+ title: PropTypes.string
2450
+ }),
2451
+ config: shapeConfig,
2452
+ render: PropTypes.func,
2453
+ css: PropTypes.object
2454
+ };
2455
+ var AlsoRead = withElementWrapper(AlsoReadBase);
2456
+
2457
+ export { AlsoRead };