@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,4670 @@
1
+ import { Link, ResponsiveImage, ResponsiveHeroImage, LinkBase, collectionToStories } from '@quintype/components';
2
+ import PropTypes, { PropTypes as PropTypes$1 } from 'prop-types';
3
+ import React, { useState, useEffect, useRef, useContext, createContext } from 'react';
4
+ import { connect, useSelector, useDispatch } from 'react-redux';
5
+ import ReactDOM from 'react-dom';
6
+ import Timeago from 'react-timeago';
7
+ import { utcToZonedTime, format } from 'date-fns-tz';
8
+
9
+ /**
10
+ * Checks if `value` is classified as an `Array` object.
11
+ *
12
+ * @static
13
+ * @memberOf _
14
+ * @since 0.1.0
15
+ * @category Lang
16
+ * @param {*} value The value to check.
17
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
18
+ * @example
19
+ *
20
+ * _.isArray([1, 2, 3]);
21
+ * // => true
22
+ *
23
+ * _.isArray(document.body.children);
24
+ * // => false
25
+ *
26
+ * _.isArray('abc');
27
+ * // => false
28
+ *
29
+ * _.isArray(_.noop);
30
+ * // => false
31
+ */
32
+ var isArray = Array.isArray;
33
+
34
+ var isArray_1 = isArray;
35
+
36
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
37
+
38
+ function getDefaultExportFromCjs (x) {
39
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
40
+ }
41
+
42
+ function createCommonjsModule(fn) {
43
+ var module = { exports: {} };
44
+ return fn(module, module.exports), module.exports;
45
+ }
46
+
47
+ /** Detect free variable `global` from Node.js. */
48
+
49
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
50
+
51
+ var _freeGlobal = freeGlobal;
52
+
53
+ /** Detect free variable `self`. */
54
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
55
+
56
+ /** Used as a reference to the global object. */
57
+ var root = _freeGlobal || freeSelf || Function('return this')();
58
+
59
+ var _root = root;
60
+
61
+ /** Built-in value references. */
62
+ var Symbol$1 = _root.Symbol;
63
+
64
+ var _Symbol = Symbol$1;
65
+
66
+ /** Used for built-in method references. */
67
+ var objectProto$4 = Object.prototype;
68
+
69
+ /** Used to check objects for own properties. */
70
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
71
+
72
+ /**
73
+ * Used to resolve the
74
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
75
+ * of values.
76
+ */
77
+ var nativeObjectToString$1 = objectProto$4.toString;
78
+
79
+ /** Built-in value references. */
80
+ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
81
+
82
+ /**
83
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
84
+ *
85
+ * @private
86
+ * @param {*} value The value to query.
87
+ * @returns {string} Returns the raw `toStringTag`.
88
+ */
89
+ function getRawTag(value) {
90
+ var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
91
+ tag = value[symToStringTag$1];
92
+
93
+ try {
94
+ value[symToStringTag$1] = undefined;
95
+ var unmasked = true;
96
+ } catch (e) {}
97
+
98
+ var result = nativeObjectToString$1.call(value);
99
+ if (unmasked) {
100
+ if (isOwn) {
101
+ value[symToStringTag$1] = tag;
102
+ } else {
103
+ delete value[symToStringTag$1];
104
+ }
105
+ }
106
+ return result;
107
+ }
108
+
109
+ var _getRawTag = getRawTag;
110
+
111
+ /** Used for built-in method references. */
112
+ var objectProto$3 = Object.prototype;
113
+
114
+ /**
115
+ * Used to resolve the
116
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
117
+ * of values.
118
+ */
119
+ var nativeObjectToString = objectProto$3.toString;
120
+
121
+ /**
122
+ * Converts `value` to a string using `Object.prototype.toString`.
123
+ *
124
+ * @private
125
+ * @param {*} value The value to convert.
126
+ * @returns {string} Returns the converted string.
127
+ */
128
+ function objectToString(value) {
129
+ return nativeObjectToString.call(value);
130
+ }
131
+
132
+ var _objectToString = objectToString;
133
+
134
+ /** `Object#toString` result references. */
135
+ var nullTag = '[object Null]',
136
+ undefinedTag = '[object Undefined]';
137
+
138
+ /** Built-in value references. */
139
+ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
140
+
141
+ /**
142
+ * The base implementation of `getTag` without fallbacks for buggy environments.
143
+ *
144
+ * @private
145
+ * @param {*} value The value to query.
146
+ * @returns {string} Returns the `toStringTag`.
147
+ */
148
+ function baseGetTag(value) {
149
+ if (value == null) {
150
+ return value === undefined ? undefinedTag : nullTag;
151
+ }
152
+ return (symToStringTag && symToStringTag in Object(value))
153
+ ? _getRawTag(value)
154
+ : _objectToString(value);
155
+ }
156
+
157
+ var _baseGetTag = baseGetTag;
158
+
159
+ /**
160
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
161
+ * and has a `typeof` result of "object".
162
+ *
163
+ * @static
164
+ * @memberOf _
165
+ * @since 4.0.0
166
+ * @category Lang
167
+ * @param {*} value The value to check.
168
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
169
+ * @example
170
+ *
171
+ * _.isObjectLike({});
172
+ * // => true
173
+ *
174
+ * _.isObjectLike([1, 2, 3]);
175
+ * // => true
176
+ *
177
+ * _.isObjectLike(_.noop);
178
+ * // => false
179
+ *
180
+ * _.isObjectLike(null);
181
+ * // => false
182
+ */
183
+ function isObjectLike(value) {
184
+ return value != null && typeof value == 'object';
185
+ }
186
+
187
+ var isObjectLike_1 = isObjectLike;
188
+
189
+ /** `Object#toString` result references. */
190
+ var symbolTag = '[object Symbol]';
191
+
192
+ /**
193
+ * Checks if `value` is classified as a `Symbol` primitive or object.
194
+ *
195
+ * @static
196
+ * @memberOf _
197
+ * @since 4.0.0
198
+ * @category Lang
199
+ * @param {*} value The value to check.
200
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
201
+ * @example
202
+ *
203
+ * _.isSymbol(Symbol.iterator);
204
+ * // => true
205
+ *
206
+ * _.isSymbol('abc');
207
+ * // => false
208
+ */
209
+ function isSymbol(value) {
210
+ return typeof value == 'symbol' ||
211
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
212
+ }
213
+
214
+ var isSymbol_1 = isSymbol;
215
+
216
+ /** Used to match property names within property paths. */
217
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
218
+ reIsPlainProp = /^\w*$/;
219
+
220
+ /**
221
+ * Checks if `value` is a property name and not a property path.
222
+ *
223
+ * @private
224
+ * @param {*} value The value to check.
225
+ * @param {Object} [object] The object to query keys on.
226
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
227
+ */
228
+ function isKey(value, object) {
229
+ if (isArray_1(value)) {
230
+ return false;
231
+ }
232
+ var type = typeof value;
233
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
234
+ value == null || isSymbol_1(value)) {
235
+ return true;
236
+ }
237
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
238
+ (object != null && value in Object(object));
239
+ }
240
+
241
+ var _isKey = isKey;
242
+
243
+ /**
244
+ * Checks if `value` is the
245
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
246
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
247
+ *
248
+ * @static
249
+ * @memberOf _
250
+ * @since 0.1.0
251
+ * @category Lang
252
+ * @param {*} value The value to check.
253
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
254
+ * @example
255
+ *
256
+ * _.isObject({});
257
+ * // => true
258
+ *
259
+ * _.isObject([1, 2, 3]);
260
+ * // => true
261
+ *
262
+ * _.isObject(_.noop);
263
+ * // => true
264
+ *
265
+ * _.isObject(null);
266
+ * // => false
267
+ */
268
+ function isObject(value) {
269
+ var type = typeof value;
270
+ return value != null && (type == 'object' || type == 'function');
271
+ }
272
+
273
+ var isObject_1 = isObject;
274
+
275
+ /** `Object#toString` result references. */
276
+ var asyncTag = '[object AsyncFunction]',
277
+ funcTag = '[object Function]',
278
+ genTag = '[object GeneratorFunction]',
279
+ proxyTag = '[object Proxy]';
280
+
281
+ /**
282
+ * Checks if `value` is classified as a `Function` object.
283
+ *
284
+ * @static
285
+ * @memberOf _
286
+ * @since 0.1.0
287
+ * @category Lang
288
+ * @param {*} value The value to check.
289
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
290
+ * @example
291
+ *
292
+ * _.isFunction(_);
293
+ * // => true
294
+ *
295
+ * _.isFunction(/abc/);
296
+ * // => false
297
+ */
298
+ function isFunction(value) {
299
+ if (!isObject_1(value)) {
300
+ return false;
301
+ }
302
+ // The use of `Object#toString` avoids issues with the `typeof` operator
303
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
304
+ var tag = _baseGetTag(value);
305
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
306
+ }
307
+
308
+ var isFunction_1 = isFunction;
309
+
310
+ /** Used to detect overreaching core-js shims. */
311
+ var coreJsData = _root['__core-js_shared__'];
312
+
313
+ var _coreJsData = coreJsData;
314
+
315
+ /** Used to detect methods masquerading as native. */
316
+ var maskSrcKey = (function() {
317
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
318
+ return uid ? ('Symbol(src)_1.' + uid) : '';
319
+ }());
320
+
321
+ /**
322
+ * Checks if `func` has its source masked.
323
+ *
324
+ * @private
325
+ * @param {Function} func The function to check.
326
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
327
+ */
328
+ function isMasked(func) {
329
+ return !!maskSrcKey && (maskSrcKey in func);
330
+ }
331
+
332
+ var _isMasked = isMasked;
333
+
334
+ /** Used for built-in method references. */
335
+ var funcProto$1 = Function.prototype;
336
+
337
+ /** Used to resolve the decompiled source of functions. */
338
+ var funcToString$1 = funcProto$1.toString;
339
+
340
+ /**
341
+ * Converts `func` to its source code.
342
+ *
343
+ * @private
344
+ * @param {Function} func The function to convert.
345
+ * @returns {string} Returns the source code.
346
+ */
347
+ function toSource(func) {
348
+ if (func != null) {
349
+ try {
350
+ return funcToString$1.call(func);
351
+ } catch (e) {}
352
+ try {
353
+ return (func + '');
354
+ } catch (e) {}
355
+ }
356
+ return '';
357
+ }
358
+
359
+ var _toSource = toSource;
360
+
361
+ /**
362
+ * Used to match `RegExp`
363
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
364
+ */
365
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
366
+
367
+ /** Used to detect host constructors (Safari). */
368
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
369
+
370
+ /** Used for built-in method references. */
371
+ var funcProto = Function.prototype,
372
+ objectProto$2 = Object.prototype;
373
+
374
+ /** Used to resolve the decompiled source of functions. */
375
+ var funcToString = funcProto.toString;
376
+
377
+ /** Used to check objects for own properties. */
378
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
379
+
380
+ /** Used to detect if a method is native. */
381
+ var reIsNative = RegExp('^' +
382
+ funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
383
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
384
+ );
385
+
386
+ /**
387
+ * The base implementation of `_.isNative` without bad shim checks.
388
+ *
389
+ * @private
390
+ * @param {*} value The value to check.
391
+ * @returns {boolean} Returns `true` if `value` is a native function,
392
+ * else `false`.
393
+ */
394
+ function baseIsNative(value) {
395
+ if (!isObject_1(value) || _isMasked(value)) {
396
+ return false;
397
+ }
398
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
399
+ return pattern.test(_toSource(value));
400
+ }
401
+
402
+ var _baseIsNative = baseIsNative;
403
+
404
+ /**
405
+ * Gets the value at `key` of `object`.
406
+ *
407
+ * @private
408
+ * @param {Object} [object] The object to query.
409
+ * @param {string} key The key of the property to get.
410
+ * @returns {*} Returns the property value.
411
+ */
412
+ function getValue(object, key) {
413
+ return object == null ? undefined : object[key];
414
+ }
415
+
416
+ var _getValue = getValue;
417
+
418
+ /**
419
+ * Gets the native function at `key` of `object`.
420
+ *
421
+ * @private
422
+ * @param {Object} object The object to query.
423
+ * @param {string} key The key of the method to get.
424
+ * @returns {*} Returns the function if it's native, else `undefined`.
425
+ */
426
+ function getNative(object, key) {
427
+ var value = _getValue(object, key);
428
+ return _baseIsNative(value) ? value : undefined;
429
+ }
430
+
431
+ var _getNative = getNative;
432
+
433
+ /* Built-in method references that are verified to be native. */
434
+ var nativeCreate = _getNative(Object, 'create');
435
+
436
+ var _nativeCreate = nativeCreate;
437
+
438
+ /**
439
+ * Removes all key-value entries from the hash.
440
+ *
441
+ * @private
442
+ * @name clear
443
+ * @memberOf Hash
444
+ */
445
+ function hashClear() {
446
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
447
+ this.size = 0;
448
+ }
449
+
450
+ var _hashClear = hashClear;
451
+
452
+ /**
453
+ * Removes `key` and its value from the hash.
454
+ *
455
+ * @private
456
+ * @name delete
457
+ * @memberOf Hash
458
+ * @param {Object} hash The hash to modify.
459
+ * @param {string} key The key of the value to remove.
460
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
461
+ */
462
+ function hashDelete(key) {
463
+ var result = this.has(key) && delete this.__data__[key];
464
+ this.size -= result ? 1 : 0;
465
+ return result;
466
+ }
467
+
468
+ var _hashDelete = hashDelete;
469
+
470
+ /** Used to stand-in for `undefined` hash values. */
471
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
472
+
473
+ /** Used for built-in method references. */
474
+ var objectProto$1 = Object.prototype;
475
+
476
+ /** Used to check objects for own properties. */
477
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
478
+
479
+ /**
480
+ * Gets the hash value for `key`.
481
+ *
482
+ * @private
483
+ * @name get
484
+ * @memberOf Hash
485
+ * @param {string} key The key of the value to get.
486
+ * @returns {*} Returns the entry value.
487
+ */
488
+ function hashGet(key) {
489
+ var data = this.__data__;
490
+ if (_nativeCreate) {
491
+ var result = data[key];
492
+ return result === HASH_UNDEFINED$1 ? undefined : result;
493
+ }
494
+ return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
495
+ }
496
+
497
+ var _hashGet = hashGet;
498
+
499
+ /** Used for built-in method references. */
500
+ var objectProto = Object.prototype;
501
+
502
+ /** Used to check objects for own properties. */
503
+ var hasOwnProperty = objectProto.hasOwnProperty;
504
+
505
+ /**
506
+ * Checks if a hash value for `key` exists.
507
+ *
508
+ * @private
509
+ * @name has
510
+ * @memberOf Hash
511
+ * @param {string} key The key of the entry to check.
512
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
513
+ */
514
+ function hashHas(key) {
515
+ var data = this.__data__;
516
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
517
+ }
518
+
519
+ var _hashHas = hashHas;
520
+
521
+ /** Used to stand-in for `undefined` hash values. */
522
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
523
+
524
+ /**
525
+ * Sets the hash `key` to `value`.
526
+ *
527
+ * @private
528
+ * @name set
529
+ * @memberOf Hash
530
+ * @param {string} key The key of the value to set.
531
+ * @param {*} value The value to set.
532
+ * @returns {Object} Returns the hash instance.
533
+ */
534
+ function hashSet(key, value) {
535
+ var data = this.__data__;
536
+ this.size += this.has(key) ? 0 : 1;
537
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
538
+ return this;
539
+ }
540
+
541
+ var _hashSet = hashSet;
542
+
543
+ /**
544
+ * Creates a hash object.
545
+ *
546
+ * @private
547
+ * @constructor
548
+ * @param {Array} [entries] The key-value pairs to cache.
549
+ */
550
+ function Hash(entries) {
551
+ var index = -1,
552
+ length = entries == null ? 0 : entries.length;
553
+
554
+ this.clear();
555
+ while (++index < length) {
556
+ var entry = entries[index];
557
+ this.set(entry[0], entry[1]);
558
+ }
559
+ }
560
+
561
+ // Add methods to `Hash`.
562
+ Hash.prototype.clear = _hashClear;
563
+ Hash.prototype['delete'] = _hashDelete;
564
+ Hash.prototype.get = _hashGet;
565
+ Hash.prototype.has = _hashHas;
566
+ Hash.prototype.set = _hashSet;
567
+
568
+ var _Hash = Hash;
569
+
570
+ /**
571
+ * Removes all key-value entries from the list cache.
572
+ *
573
+ * @private
574
+ * @name clear
575
+ * @memberOf ListCache
576
+ */
577
+ function listCacheClear() {
578
+ this.__data__ = [];
579
+ this.size = 0;
580
+ }
581
+
582
+ var _listCacheClear = listCacheClear;
583
+
584
+ /**
585
+ * Performs a
586
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
587
+ * comparison between two values to determine if they are equivalent.
588
+ *
589
+ * @static
590
+ * @memberOf _
591
+ * @since 4.0.0
592
+ * @category Lang
593
+ * @param {*} value The value to compare.
594
+ * @param {*} other The other value to compare.
595
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
596
+ * @example
597
+ *
598
+ * var object = { 'a': 1 };
599
+ * var other = { 'a': 1 };
600
+ *
601
+ * _.eq(object, object);
602
+ * // => true
603
+ *
604
+ * _.eq(object, other);
605
+ * // => false
606
+ *
607
+ * _.eq('a', 'a');
608
+ * // => true
609
+ *
610
+ * _.eq('a', Object('a'));
611
+ * // => false
612
+ *
613
+ * _.eq(NaN, NaN);
614
+ * // => true
615
+ */
616
+ function eq(value, other) {
617
+ return value === other || (value !== value && other !== other);
618
+ }
619
+
620
+ var eq_1 = eq;
621
+
622
+ /**
623
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
624
+ *
625
+ * @private
626
+ * @param {Array} array The array to inspect.
627
+ * @param {*} key The key to search for.
628
+ * @returns {number} Returns the index of the matched value, else `-1`.
629
+ */
630
+ function assocIndexOf(array, key) {
631
+ var length = array.length;
632
+ while (length--) {
633
+ if (eq_1(array[length][0], key)) {
634
+ return length;
635
+ }
636
+ }
637
+ return -1;
638
+ }
639
+
640
+ var _assocIndexOf = assocIndexOf;
641
+
642
+ /** Used for built-in method references. */
643
+ var arrayProto = Array.prototype;
644
+
645
+ /** Built-in value references. */
646
+ var splice = arrayProto.splice;
647
+
648
+ /**
649
+ * Removes `key` and its value from the list cache.
650
+ *
651
+ * @private
652
+ * @name delete
653
+ * @memberOf ListCache
654
+ * @param {string} key The key of the value to remove.
655
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
656
+ */
657
+ function listCacheDelete(key) {
658
+ var data = this.__data__,
659
+ index = _assocIndexOf(data, key);
660
+
661
+ if (index < 0) {
662
+ return false;
663
+ }
664
+ var lastIndex = data.length - 1;
665
+ if (index == lastIndex) {
666
+ data.pop();
667
+ } else {
668
+ splice.call(data, index, 1);
669
+ }
670
+ --this.size;
671
+ return true;
672
+ }
673
+
674
+ var _listCacheDelete = listCacheDelete;
675
+
676
+ /**
677
+ * Gets the list cache value for `key`.
678
+ *
679
+ * @private
680
+ * @name get
681
+ * @memberOf ListCache
682
+ * @param {string} key The key of the value to get.
683
+ * @returns {*} Returns the entry value.
684
+ */
685
+ function listCacheGet(key) {
686
+ var data = this.__data__,
687
+ index = _assocIndexOf(data, key);
688
+
689
+ return index < 0 ? undefined : data[index][1];
690
+ }
691
+
692
+ var _listCacheGet = listCacheGet;
693
+
694
+ /**
695
+ * Checks if a list cache value for `key` exists.
696
+ *
697
+ * @private
698
+ * @name has
699
+ * @memberOf ListCache
700
+ * @param {string} key The key of the entry to check.
701
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
702
+ */
703
+ function listCacheHas(key) {
704
+ return _assocIndexOf(this.__data__, key) > -1;
705
+ }
706
+
707
+ var _listCacheHas = listCacheHas;
708
+
709
+ /**
710
+ * Sets the list cache `key` to `value`.
711
+ *
712
+ * @private
713
+ * @name set
714
+ * @memberOf ListCache
715
+ * @param {string} key The key of the value to set.
716
+ * @param {*} value The value to set.
717
+ * @returns {Object} Returns the list cache instance.
718
+ */
719
+ function listCacheSet(key, value) {
720
+ var data = this.__data__,
721
+ index = _assocIndexOf(data, key);
722
+
723
+ if (index < 0) {
724
+ ++this.size;
725
+ data.push([key, value]);
726
+ } else {
727
+ data[index][1] = value;
728
+ }
729
+ return this;
730
+ }
731
+
732
+ var _listCacheSet = listCacheSet;
733
+
734
+ /**
735
+ * Creates an list cache object.
736
+ *
737
+ * @private
738
+ * @constructor
739
+ * @param {Array} [entries] The key-value pairs to cache.
740
+ */
741
+ function ListCache(entries) {
742
+ var index = -1,
743
+ length = entries == null ? 0 : entries.length;
744
+
745
+ this.clear();
746
+ while (++index < length) {
747
+ var entry = entries[index];
748
+ this.set(entry[0], entry[1]);
749
+ }
750
+ }
751
+
752
+ // Add methods to `ListCache`.
753
+ ListCache.prototype.clear = _listCacheClear;
754
+ ListCache.prototype['delete'] = _listCacheDelete;
755
+ ListCache.prototype.get = _listCacheGet;
756
+ ListCache.prototype.has = _listCacheHas;
757
+ ListCache.prototype.set = _listCacheSet;
758
+
759
+ var _ListCache = ListCache;
760
+
761
+ /* Built-in method references that are verified to be native. */
762
+ var Map = _getNative(_root, 'Map');
763
+
764
+ var _Map = Map;
765
+
766
+ /**
767
+ * Removes all key-value entries from the map.
768
+ *
769
+ * @private
770
+ * @name clear
771
+ * @memberOf MapCache
772
+ */
773
+ function mapCacheClear() {
774
+ this.size = 0;
775
+ this.__data__ = {
776
+ 'hash': new _Hash,
777
+ 'map': new (_Map || _ListCache),
778
+ 'string': new _Hash
779
+ };
780
+ }
781
+
782
+ var _mapCacheClear = mapCacheClear;
783
+
784
+ /**
785
+ * Checks if `value` is suitable for use as unique object key.
786
+ *
787
+ * @private
788
+ * @param {*} value The value to check.
789
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
790
+ */
791
+ function isKeyable(value) {
792
+ var type = typeof value;
793
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
794
+ ? (value !== '__proto__')
795
+ : (value === null);
796
+ }
797
+
798
+ var _isKeyable = isKeyable;
799
+
800
+ /**
801
+ * Gets the data for `map`.
802
+ *
803
+ * @private
804
+ * @param {Object} map The map to query.
805
+ * @param {string} key The reference key.
806
+ * @returns {*} Returns the map data.
807
+ */
808
+ function getMapData(map, key) {
809
+ var data = map.__data__;
810
+ return _isKeyable(key)
811
+ ? data[typeof key == 'string' ? 'string' : 'hash']
812
+ : data.map;
813
+ }
814
+
815
+ var _getMapData = getMapData;
816
+
817
+ /**
818
+ * Removes `key` and its value from the map.
819
+ *
820
+ * @private
821
+ * @name delete
822
+ * @memberOf MapCache
823
+ * @param {string} key The key of the value to remove.
824
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
825
+ */
826
+ function mapCacheDelete(key) {
827
+ var result = _getMapData(this, key)['delete'](key);
828
+ this.size -= result ? 1 : 0;
829
+ return result;
830
+ }
831
+
832
+ var _mapCacheDelete = mapCacheDelete;
833
+
834
+ /**
835
+ * Gets the map value for `key`.
836
+ *
837
+ * @private
838
+ * @name get
839
+ * @memberOf MapCache
840
+ * @param {string} key The key of the value to get.
841
+ * @returns {*} Returns the entry value.
842
+ */
843
+ function mapCacheGet(key) {
844
+ return _getMapData(this, key).get(key);
845
+ }
846
+
847
+ var _mapCacheGet = mapCacheGet;
848
+
849
+ /**
850
+ * Checks if a map value for `key` exists.
851
+ *
852
+ * @private
853
+ * @name has
854
+ * @memberOf MapCache
855
+ * @param {string} key The key of the entry to check.
856
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
857
+ */
858
+ function mapCacheHas(key) {
859
+ return _getMapData(this, key).has(key);
860
+ }
861
+
862
+ var _mapCacheHas = mapCacheHas;
863
+
864
+ /**
865
+ * Sets the map `key` to `value`.
866
+ *
867
+ * @private
868
+ * @name set
869
+ * @memberOf MapCache
870
+ * @param {string} key The key of the value to set.
871
+ * @param {*} value The value to set.
872
+ * @returns {Object} Returns the map cache instance.
873
+ */
874
+ function mapCacheSet(key, value) {
875
+ var data = _getMapData(this, key),
876
+ size = data.size;
877
+
878
+ data.set(key, value);
879
+ this.size += data.size == size ? 0 : 1;
880
+ return this;
881
+ }
882
+
883
+ var _mapCacheSet = mapCacheSet;
884
+
885
+ /**
886
+ * Creates a map cache object to store key-value pairs.
887
+ *
888
+ * @private
889
+ * @constructor
890
+ * @param {Array} [entries] The key-value pairs to cache.
891
+ */
892
+ function MapCache(entries) {
893
+ var index = -1,
894
+ length = entries == null ? 0 : entries.length;
895
+
896
+ this.clear();
897
+ while (++index < length) {
898
+ var entry = entries[index];
899
+ this.set(entry[0], entry[1]);
900
+ }
901
+ }
902
+
903
+ // Add methods to `MapCache`.
904
+ MapCache.prototype.clear = _mapCacheClear;
905
+ MapCache.prototype['delete'] = _mapCacheDelete;
906
+ MapCache.prototype.get = _mapCacheGet;
907
+ MapCache.prototype.has = _mapCacheHas;
908
+ MapCache.prototype.set = _mapCacheSet;
909
+
910
+ var _MapCache = MapCache;
911
+
912
+ /** Error message constants. */
913
+ var FUNC_ERROR_TEXT = 'Expected a function';
914
+
915
+ /**
916
+ * Creates a function that memoizes the result of `func`. If `resolver` is
917
+ * provided, it determines the cache key for storing the result based on the
918
+ * arguments provided to the memoized function. By default, the first argument
919
+ * provided to the memoized function is used as the map cache key. The `func`
920
+ * is invoked with the `this` binding of the memoized function.
921
+ *
922
+ * **Note:** The cache is exposed as the `cache` property on the memoized
923
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
924
+ * constructor with one whose instances implement the
925
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
926
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
927
+ *
928
+ * @static
929
+ * @memberOf _
930
+ * @since 0.1.0
931
+ * @category Function
932
+ * @param {Function} func The function to have its output memoized.
933
+ * @param {Function} [resolver] The function to resolve the cache key.
934
+ * @returns {Function} Returns the new memoized function.
935
+ * @example
936
+ *
937
+ * var object = { 'a': 1, 'b': 2 };
938
+ * var other = { 'c': 3, 'd': 4 };
939
+ *
940
+ * var values = _.memoize(_.values);
941
+ * values(object);
942
+ * // => [1, 2]
943
+ *
944
+ * values(other);
945
+ * // => [3, 4]
946
+ *
947
+ * object.a = 2;
948
+ * values(object);
949
+ * // => [1, 2]
950
+ *
951
+ * // Modify the result cache.
952
+ * values.cache.set(object, ['a', 'b']);
953
+ * values(object);
954
+ * // => ['a', 'b']
955
+ *
956
+ * // Replace `_.memoize.Cache`.
957
+ * _.memoize.Cache = WeakMap;
958
+ */
959
+ function memoize(func, resolver) {
960
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
961
+ throw new TypeError(FUNC_ERROR_TEXT);
962
+ }
963
+ var memoized = function() {
964
+ var args = arguments,
965
+ key = resolver ? resolver.apply(this, args) : args[0],
966
+ cache = memoized.cache;
967
+
968
+ if (cache.has(key)) {
969
+ return cache.get(key);
970
+ }
971
+ var result = func.apply(this, args);
972
+ memoized.cache = cache.set(key, result) || cache;
973
+ return result;
974
+ };
975
+ memoized.cache = new (memoize.Cache || _MapCache);
976
+ return memoized;
977
+ }
978
+
979
+ // Expose `MapCache`.
980
+ memoize.Cache = _MapCache;
981
+
982
+ var memoize_1 = memoize;
983
+
984
+ /** Used as the maximum memoize cache size. */
985
+ var MAX_MEMOIZE_SIZE = 500;
986
+
987
+ /**
988
+ * A specialized version of `_.memoize` which clears the memoized function's
989
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
990
+ *
991
+ * @private
992
+ * @param {Function} func The function to have its output memoized.
993
+ * @returns {Function} Returns the new memoized function.
994
+ */
995
+ function memoizeCapped(func) {
996
+ var result = memoize_1(func, function(key) {
997
+ if (cache.size === MAX_MEMOIZE_SIZE) {
998
+ cache.clear();
999
+ }
1000
+ return key;
1001
+ });
1002
+
1003
+ var cache = result.cache;
1004
+ return result;
1005
+ }
1006
+
1007
+ var _memoizeCapped = memoizeCapped;
1008
+
1009
+ /** Used to match property names within property paths. */
1010
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1011
+
1012
+ /** Used to match backslashes in property paths. */
1013
+ var reEscapeChar = /\\(\\)?/g;
1014
+
1015
+ /**
1016
+ * Converts `string` to a property path array.
1017
+ *
1018
+ * @private
1019
+ * @param {string} string The string to convert.
1020
+ * @returns {Array} Returns the property path array.
1021
+ */
1022
+ var stringToPath = _memoizeCapped(function(string) {
1023
+ var result = [];
1024
+ if (string.charCodeAt(0) === 46 /* . */) {
1025
+ result.push('');
1026
+ }
1027
+ string.replace(rePropName, function(match, number, quote, subString) {
1028
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1029
+ });
1030
+ return result;
1031
+ });
1032
+
1033
+ var _stringToPath = stringToPath;
1034
+
1035
+ /**
1036
+ * A specialized version of `_.map` for arrays without support for iteratee
1037
+ * shorthands.
1038
+ *
1039
+ * @private
1040
+ * @param {Array} [array] The array to iterate over.
1041
+ * @param {Function} iteratee The function invoked per iteration.
1042
+ * @returns {Array} Returns the new mapped array.
1043
+ */
1044
+ function arrayMap(array, iteratee) {
1045
+ var index = -1,
1046
+ length = array == null ? 0 : array.length,
1047
+ result = Array(length);
1048
+
1049
+ while (++index < length) {
1050
+ result[index] = iteratee(array[index], index, array);
1051
+ }
1052
+ return result;
1053
+ }
1054
+
1055
+ var _arrayMap = arrayMap;
1056
+
1057
+ /** Used as references for various `Number` constants. */
1058
+ var INFINITY$1 = 1 / 0;
1059
+
1060
+ /** Used to convert symbols to primitives and strings. */
1061
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1062
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
1063
+
1064
+ /**
1065
+ * The base implementation of `_.toString` which doesn't convert nullish
1066
+ * values to empty strings.
1067
+ *
1068
+ * @private
1069
+ * @param {*} value The value to process.
1070
+ * @returns {string} Returns the string.
1071
+ */
1072
+ function baseToString(value) {
1073
+ // Exit early for strings to avoid a performance hit in some environments.
1074
+ if (typeof value == 'string') {
1075
+ return value;
1076
+ }
1077
+ if (isArray_1(value)) {
1078
+ // Recursively convert values (susceptible to call stack limits).
1079
+ return _arrayMap(value, baseToString) + '';
1080
+ }
1081
+ if (isSymbol_1(value)) {
1082
+ return symbolToString ? symbolToString.call(value) : '';
1083
+ }
1084
+ var result = (value + '');
1085
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
1086
+ }
1087
+
1088
+ var _baseToString = baseToString;
1089
+
1090
+ /**
1091
+ * Converts `value` to a string. An empty string is returned for `null`
1092
+ * and `undefined` values. The sign of `-0` is preserved.
1093
+ *
1094
+ * @static
1095
+ * @memberOf _
1096
+ * @since 4.0.0
1097
+ * @category Lang
1098
+ * @param {*} value The value to convert.
1099
+ * @returns {string} Returns the converted string.
1100
+ * @example
1101
+ *
1102
+ * _.toString(null);
1103
+ * // => ''
1104
+ *
1105
+ * _.toString(-0);
1106
+ * // => '-0'
1107
+ *
1108
+ * _.toString([1, 2, 3]);
1109
+ * // => '1,2,3'
1110
+ */
1111
+ function toString(value) {
1112
+ return value == null ? '' : _baseToString(value);
1113
+ }
1114
+
1115
+ var toString_1 = toString;
1116
+
1117
+ /**
1118
+ * Casts `value` to a path array if it's not one.
1119
+ *
1120
+ * @private
1121
+ * @param {*} value The value to inspect.
1122
+ * @param {Object} [object] The object to query keys on.
1123
+ * @returns {Array} Returns the cast property path array.
1124
+ */
1125
+ function castPath(value, object) {
1126
+ if (isArray_1(value)) {
1127
+ return value;
1128
+ }
1129
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
1130
+ }
1131
+
1132
+ var _castPath = castPath;
1133
+
1134
+ /** Used as references for various `Number` constants. */
1135
+ var INFINITY = 1 / 0;
1136
+
1137
+ /**
1138
+ * Converts `value` to a string key if it's not a string or symbol.
1139
+ *
1140
+ * @private
1141
+ * @param {*} value The value to inspect.
1142
+ * @returns {string|symbol} Returns the key.
1143
+ */
1144
+ function toKey(value) {
1145
+ if (typeof value == 'string' || isSymbol_1(value)) {
1146
+ return value;
1147
+ }
1148
+ var result = (value + '');
1149
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1150
+ }
1151
+
1152
+ var _toKey = toKey;
1153
+
1154
+ /**
1155
+ * The base implementation of `_.get` without support for default values.
1156
+ *
1157
+ * @private
1158
+ * @param {Object} object The object to query.
1159
+ * @param {Array|string} path The path of the property to get.
1160
+ * @returns {*} Returns the resolved value.
1161
+ */
1162
+ function baseGet(object, path) {
1163
+ path = _castPath(path, object);
1164
+
1165
+ var index = 0,
1166
+ length = path.length;
1167
+
1168
+ while (object != null && index < length) {
1169
+ object = object[_toKey(path[index++])];
1170
+ }
1171
+ return (index && index == length) ? object : undefined;
1172
+ }
1173
+
1174
+ var _baseGet = baseGet;
1175
+
1176
+ /**
1177
+ * Gets the value at `path` of `object`. If the resolved value is
1178
+ * `undefined`, the `defaultValue` is returned in its place.
1179
+ *
1180
+ * @static
1181
+ * @memberOf _
1182
+ * @since 3.7.0
1183
+ * @category Object
1184
+ * @param {Object} object The object to query.
1185
+ * @param {Array|string} path The path of the property to get.
1186
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1187
+ * @returns {*} Returns the resolved value.
1188
+ * @example
1189
+ *
1190
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1191
+ *
1192
+ * _.get(object, 'a[0].b.c');
1193
+ * // => 3
1194
+ *
1195
+ * _.get(object, ['a', '0', 'b', 'c']);
1196
+ * // => 3
1197
+ *
1198
+ * _.get(object, 'a.b.c', 'default');
1199
+ * // => 'default'
1200
+ */
1201
+ function get(object, path, defaultValue) {
1202
+ var result = object == null ? undefined : _baseGet(object, path);
1203
+ return result === undefined ? defaultValue : result;
1204
+ }
1205
+
1206
+ var get_1 = get;
1207
+
1208
+ function _arrayWithHoles(arr) {
1209
+ if (Array.isArray(arr)) return arr;
1210
+ }
1211
+
1212
+ function _iterableToArrayLimit(arr, i) {
1213
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1214
+
1215
+ if (_i == null) return;
1216
+ var _arr = [];
1217
+ var _n = true;
1218
+ var _d = false;
1219
+
1220
+ var _s, _e;
1221
+
1222
+ try {
1223
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
1224
+ _arr.push(_s.value);
1225
+
1226
+ if (i && _arr.length === i) break;
1227
+ }
1228
+ } catch (err) {
1229
+ _d = true;
1230
+ _e = err;
1231
+ } finally {
1232
+ try {
1233
+ if (!_n && _i["return"] != null) _i["return"]();
1234
+ } finally {
1235
+ if (_d) throw _e;
1236
+ }
1237
+ }
1238
+
1239
+ return _arr;
1240
+ }
1241
+
1242
+ function _arrayLikeToArray(arr, len) {
1243
+ if (len == null || len > arr.length) len = arr.length;
1244
+
1245
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
1246
+ arr2[i] = arr[i];
1247
+ }
1248
+
1249
+ return arr2;
1250
+ }
1251
+
1252
+ function _unsupportedIterableToArray(o, minLen) {
1253
+ if (!o) return;
1254
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1255
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1256
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1257
+ if (n === "Map" || n === "Set") return Array.from(o);
1258
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1259
+ }
1260
+
1261
+ function _nonIterableRest() {
1262
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1263
+ }
1264
+
1265
+ function _slicedToArray(arr, i) {
1266
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1267
+ }
1268
+
1269
+ var isClient = typeof window !== "undefined";
1270
+
1271
+ var hasIntersectionObserverSupport = function hasIntersectionObserverSupport() {
1272
+ return typeof window.IntersectionObserver !== "undefined";
1273
+ }; // import intersection observer polyfill only if on client
1274
+ // and if not supported by browser
1275
+
1276
+
1277
+ var getIntersectionObserver = function getIntersectionObserver() {
1278
+ return Promise.resolve(isClient && !hasIntersectionObserverSupport() && import('intersection-observer'));
1279
+ }; // options for intersection observer in order to improve the effect
1280
+
1281
+
1282
+ var intersectionObserverOptions = {
1283
+ root: null,
1284
+ // windows viewport will be used
1285
+ rootMargin: "200px 0px 0px 0px"
1286
+ };
1287
+
1288
+ var handleIntersect = function handleIntersect(entries, observer) {
1289
+ entries.filter(function (entry) {
1290
+ return entry.isIntersecting;
1291
+ }).forEach(function (entry) {
1292
+ var target = entry.target;
1293
+
1294
+ target._onIntersect(observer);
1295
+ });
1296
+ }; // get observer from the cache or create a new one
1297
+
1298
+
1299
+ var getObserver = function getObserver() {
1300
+ return getIntersectionObserver().then(function (_) {
1301
+
1302
+ if (isClient) {
1303
+ return new window.IntersectionObserver(handleIntersect, intersectionObserverOptions);
1304
+ }
1305
+ });
1306
+ };
1307
+
1308
+ var useNearScreen = (function (_ref) {
1309
+ var ref = _ref.ref;
1310
+
1311
+ var _useState = useState(false),
1312
+ _useState2 = _slicedToArray(_useState, 2),
1313
+ show = _useState2[0],
1314
+ setShow = _useState2[1];
1315
+
1316
+ useEffect(function () {
1317
+ var current = ref.current;
1318
+ if (!current) return; // get observer async and only when needed
1319
+
1320
+ getObserver().then(function (observer) {
1321
+ return observer.observe(current);
1322
+ }); // mutate the current target to add a method to be executed when intersecting
1323
+
1324
+ current._onIntersect = function (observer) {
1325
+ setShow(true);
1326
+ observer.unobserve(current);
1327
+ }; // clean observed element when unmounted
1328
+
1329
+
1330
+ return function () {
1331
+ return current._isSubscribed = false;
1332
+ };
1333
+ }, [ref]);
1334
+ return show;
1335
+ });
1336
+
1337
+ var EMPTY_HTML = {
1338
+ __html: ""
1339
+ };
1340
+ var isServer = typeof window === "undefined";
1341
+ var ProgressiveHydration = function ProgressiveHydration(props) {
1342
+ var children = props.children;
1343
+ var ref = useRef(null);
1344
+ var isNearScreen = useNearScreen({
1345
+ ref: ref
1346
+ });
1347
+ useEffect(function () {
1348
+ var el = ref.current; // CLIENT:
1349
+ // If we want to force the hydration OR the element is near screen
1350
+ // then we hydrate the content to get the functionality ready
1351
+
1352
+ if (isNearScreen) {
1353
+ var action = el.hasChildNodes() ? "hydrate" : "render";
1354
+ ReactDOM[action](children, el);
1355
+ }
1356
+ }, [children, isNearScreen]); // SERVER: Just render the content as usual
1357
+
1358
+ if (isServer) {
1359
+ return /*#__PURE__*/React.createElement("div", {
1360
+ ref: ref
1361
+ }, children);
1362
+ } // CLIENT: Avoid hydration until we say so
1363
+
1364
+
1365
+ return /*#__PURE__*/React.createElement("div", {
1366
+ ref: ref,
1367
+ suppressHydrationWarning: true,
1368
+ dangerouslySetInnerHTML: EMPTY_HTML
1369
+ });
1370
+ };
1371
+ ProgressiveHydration.propTypes = {
1372
+ children: PropTypes.element
1373
+ };
1374
+
1375
+ function _typeof(obj) {
1376
+ "@babel/helpers - typeof";
1377
+
1378
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1379
+ return typeof obj;
1380
+ } : function (obj) {
1381
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1382
+ }, _typeof(obj);
1383
+ }
1384
+
1385
+ /**
1386
+ * Copyright (c) 2014-present, Facebook, Inc.
1387
+ *
1388
+ * This source code is licensed under the MIT license found in the
1389
+ * LICENSE file in the root directory of this source tree.
1390
+ */
1391
+
1392
+ createCommonjsModule(function (module) {
1393
+ var runtime = (function (exports) {
1394
+
1395
+ var Op = Object.prototype;
1396
+ var hasOwn = Op.hasOwnProperty;
1397
+ var undefined$1; // More compressible than void 0.
1398
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
1399
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
1400
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1401
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1402
+
1403
+ function define(obj, key, value) {
1404
+ Object.defineProperty(obj, key, {
1405
+ value: value,
1406
+ enumerable: true,
1407
+ configurable: true,
1408
+ writable: true
1409
+ });
1410
+ return obj[key];
1411
+ }
1412
+ try {
1413
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
1414
+ define({}, "");
1415
+ } catch (err) {
1416
+ define = function(obj, key, value) {
1417
+ return obj[key] = value;
1418
+ };
1419
+ }
1420
+
1421
+ function wrap(innerFn, outerFn, self, tryLocsList) {
1422
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1423
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1424
+ var generator = Object.create(protoGenerator.prototype);
1425
+ var context = new Context(tryLocsList || []);
1426
+
1427
+ // The ._invoke method unifies the implementations of the .next,
1428
+ // .throw, and .return methods.
1429
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
1430
+
1431
+ return generator;
1432
+ }
1433
+ exports.wrap = wrap;
1434
+
1435
+ // Try/catch helper to minimize deoptimizations. Returns a completion
1436
+ // record like context.tryEntries[i].completion. This interface could
1437
+ // have been (and was previously) designed to take a closure to be
1438
+ // invoked without arguments, but in all the cases we care about we
1439
+ // already have an existing method we want to call, so there's no need
1440
+ // to create a new function object. We can even get away with assuming
1441
+ // the method takes exactly one argument, since that happens to be true
1442
+ // in every case, so we don't have to touch the arguments object. The
1443
+ // only additional allocation required is the completion record, which
1444
+ // has a stable shape and so hopefully should be cheap to allocate.
1445
+ function tryCatch(fn, obj, arg) {
1446
+ try {
1447
+ return { type: "normal", arg: fn.call(obj, arg) };
1448
+ } catch (err) {
1449
+ return { type: "throw", arg: err };
1450
+ }
1451
+ }
1452
+
1453
+ var GenStateSuspendedStart = "suspendedStart";
1454
+ var GenStateSuspendedYield = "suspendedYield";
1455
+ var GenStateExecuting = "executing";
1456
+ var GenStateCompleted = "completed";
1457
+
1458
+ // Returning this object from the innerFn has the same effect as
1459
+ // breaking out of the dispatch switch statement.
1460
+ var ContinueSentinel = {};
1461
+
1462
+ // Dummy constructor functions that we use as the .constructor and
1463
+ // .constructor.prototype properties for functions that return Generator
1464
+ // objects. For full spec compliance, you may wish to configure your
1465
+ // minifier not to mangle the names of these two functions.
1466
+ function Generator() {}
1467
+ function GeneratorFunction() {}
1468
+ function GeneratorFunctionPrototype() {}
1469
+
1470
+ // This is a polyfill for %IteratorPrototype% for environments that
1471
+ // don't natively support it.
1472
+ var IteratorPrototype = {};
1473
+ define(IteratorPrototype, iteratorSymbol, function () {
1474
+ return this;
1475
+ });
1476
+
1477
+ var getProto = Object.getPrototypeOf;
1478
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1479
+ if (NativeIteratorPrototype &&
1480
+ NativeIteratorPrototype !== Op &&
1481
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1482
+ // This environment has a native %IteratorPrototype%; use it instead
1483
+ // of the polyfill.
1484
+ IteratorPrototype = NativeIteratorPrototype;
1485
+ }
1486
+
1487
+ var Gp = GeneratorFunctionPrototype.prototype =
1488
+ Generator.prototype = Object.create(IteratorPrototype);
1489
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
1490
+ define(Gp, "constructor", GeneratorFunctionPrototype);
1491
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
1492
+ GeneratorFunction.displayName = define(
1493
+ GeneratorFunctionPrototype,
1494
+ toStringTagSymbol,
1495
+ "GeneratorFunction"
1496
+ );
1497
+
1498
+ // Helper for defining the .next, .throw, and .return methods of the
1499
+ // Iterator interface in terms of a single ._invoke method.
1500
+ function defineIteratorMethods(prototype) {
1501
+ ["next", "throw", "return"].forEach(function(method) {
1502
+ define(prototype, method, function(arg) {
1503
+ return this._invoke(method, arg);
1504
+ });
1505
+ });
1506
+ }
1507
+
1508
+ exports.isGeneratorFunction = function(genFun) {
1509
+ var ctor = typeof genFun === "function" && genFun.constructor;
1510
+ return ctor
1511
+ ? ctor === GeneratorFunction ||
1512
+ // For the native GeneratorFunction constructor, the best we can
1513
+ // do is to check its .name property.
1514
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
1515
+ : false;
1516
+ };
1517
+
1518
+ exports.mark = function(genFun) {
1519
+ if (Object.setPrototypeOf) {
1520
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1521
+ } else {
1522
+ genFun.__proto__ = GeneratorFunctionPrototype;
1523
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
1524
+ }
1525
+ genFun.prototype = Object.create(Gp);
1526
+ return genFun;
1527
+ };
1528
+
1529
+ // Within the body of any async function, `await x` is transformed to
1530
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1531
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
1532
+ // meant to be awaited.
1533
+ exports.awrap = function(arg) {
1534
+ return { __await: arg };
1535
+ };
1536
+
1537
+ function AsyncIterator(generator, PromiseImpl) {
1538
+ function invoke(method, arg, resolve, reject) {
1539
+ var record = tryCatch(generator[method], generator, arg);
1540
+ if (record.type === "throw") {
1541
+ reject(record.arg);
1542
+ } else {
1543
+ var result = record.arg;
1544
+ var value = result.value;
1545
+ if (value &&
1546
+ typeof value === "object" &&
1547
+ hasOwn.call(value, "__await")) {
1548
+ return PromiseImpl.resolve(value.__await).then(function(value) {
1549
+ invoke("next", value, resolve, reject);
1550
+ }, function(err) {
1551
+ invoke("throw", err, resolve, reject);
1552
+ });
1553
+ }
1554
+
1555
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
1556
+ // When a yielded Promise is resolved, its final value becomes
1557
+ // the .value of the Promise<{value,done}> result for the
1558
+ // current iteration.
1559
+ result.value = unwrapped;
1560
+ resolve(result);
1561
+ }, function(error) {
1562
+ // If a rejected Promise was yielded, throw the rejection back
1563
+ // into the async generator function so it can be handled there.
1564
+ return invoke("throw", error, resolve, reject);
1565
+ });
1566
+ }
1567
+ }
1568
+
1569
+ var previousPromise;
1570
+
1571
+ function enqueue(method, arg) {
1572
+ function callInvokeWithMethodAndArg() {
1573
+ return new PromiseImpl(function(resolve, reject) {
1574
+ invoke(method, arg, resolve, reject);
1575
+ });
1576
+ }
1577
+
1578
+ return previousPromise =
1579
+ // If enqueue has been called before, then we want to wait until
1580
+ // all previous Promises have been resolved before calling invoke,
1581
+ // so that results are always delivered in the correct order. If
1582
+ // enqueue has not been called before, then it is important to
1583
+ // call invoke immediately, without waiting on a callback to fire,
1584
+ // so that the async generator function has the opportunity to do
1585
+ // any necessary setup in a predictable way. This predictability
1586
+ // is why the Promise constructor synchronously invokes its
1587
+ // executor callback, and why async functions synchronously
1588
+ // execute code before the first await. Since we implement simple
1589
+ // async functions in terms of async generators, it is especially
1590
+ // important to get this right, even though it requires care.
1591
+ previousPromise ? previousPromise.then(
1592
+ callInvokeWithMethodAndArg,
1593
+ // Avoid propagating failures to Promises returned by later
1594
+ // invocations of the iterator.
1595
+ callInvokeWithMethodAndArg
1596
+ ) : callInvokeWithMethodAndArg();
1597
+ }
1598
+
1599
+ // Define the unified helper method that is used to implement .next,
1600
+ // .throw, and .return (see defineIteratorMethods).
1601
+ this._invoke = enqueue;
1602
+ }
1603
+
1604
+ defineIteratorMethods(AsyncIterator.prototype);
1605
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1606
+ return this;
1607
+ });
1608
+ exports.AsyncIterator = AsyncIterator;
1609
+
1610
+ // Note that simple async functions are implemented on top of
1611
+ // AsyncIterator objects; they just return a Promise for the value of
1612
+ // the final result produced by the iterator.
1613
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1614
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
1615
+
1616
+ var iter = new AsyncIterator(
1617
+ wrap(innerFn, outerFn, self, tryLocsList),
1618
+ PromiseImpl
1619
+ );
1620
+
1621
+ return exports.isGeneratorFunction(outerFn)
1622
+ ? iter // If outerFn is a generator, return the full iterator.
1623
+ : iter.next().then(function(result) {
1624
+ return result.done ? result.value : iter.next();
1625
+ });
1626
+ };
1627
+
1628
+ function makeInvokeMethod(innerFn, self, context) {
1629
+ var state = GenStateSuspendedStart;
1630
+
1631
+ return function invoke(method, arg) {
1632
+ if (state === GenStateExecuting) {
1633
+ throw new Error("Generator is already running");
1634
+ }
1635
+
1636
+ if (state === GenStateCompleted) {
1637
+ if (method === "throw") {
1638
+ throw arg;
1639
+ }
1640
+
1641
+ // Be forgiving, per 25.3.3.3.3 of the spec:
1642
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1643
+ return doneResult();
1644
+ }
1645
+
1646
+ context.method = method;
1647
+ context.arg = arg;
1648
+
1649
+ while (true) {
1650
+ var delegate = context.delegate;
1651
+ if (delegate) {
1652
+ var delegateResult = maybeInvokeDelegate(delegate, context);
1653
+ if (delegateResult) {
1654
+ if (delegateResult === ContinueSentinel) continue;
1655
+ return delegateResult;
1656
+ }
1657
+ }
1658
+
1659
+ if (context.method === "next") {
1660
+ // Setting context._sent for legacy support of Babel's
1661
+ // function.sent implementation.
1662
+ context.sent = context._sent = context.arg;
1663
+
1664
+ } else if (context.method === "throw") {
1665
+ if (state === GenStateSuspendedStart) {
1666
+ state = GenStateCompleted;
1667
+ throw context.arg;
1668
+ }
1669
+
1670
+ context.dispatchException(context.arg);
1671
+
1672
+ } else if (context.method === "return") {
1673
+ context.abrupt("return", context.arg);
1674
+ }
1675
+
1676
+ state = GenStateExecuting;
1677
+
1678
+ var record = tryCatch(innerFn, self, context);
1679
+ if (record.type === "normal") {
1680
+ // If an exception is thrown from innerFn, we leave state ===
1681
+ // GenStateExecuting and loop back for another invocation.
1682
+ state = context.done
1683
+ ? GenStateCompleted
1684
+ : GenStateSuspendedYield;
1685
+
1686
+ if (record.arg === ContinueSentinel) {
1687
+ continue;
1688
+ }
1689
+
1690
+ return {
1691
+ value: record.arg,
1692
+ done: context.done
1693
+ };
1694
+
1695
+ } else if (record.type === "throw") {
1696
+ state = GenStateCompleted;
1697
+ // Dispatch the exception by looping back around to the
1698
+ // context.dispatchException(context.arg) call above.
1699
+ context.method = "throw";
1700
+ context.arg = record.arg;
1701
+ }
1702
+ }
1703
+ };
1704
+ }
1705
+
1706
+ // Call delegate.iterator[context.method](context.arg) and handle the
1707
+ // result, either by returning a { value, done } result from the
1708
+ // delegate iterator, or by modifying context.method and context.arg,
1709
+ // setting context.delegate to null, and returning the ContinueSentinel.
1710
+ function maybeInvokeDelegate(delegate, context) {
1711
+ var method = delegate.iterator[context.method];
1712
+ if (method === undefined$1) {
1713
+ // A .throw or .return when the delegate iterator has no .throw
1714
+ // method always terminates the yield* loop.
1715
+ context.delegate = null;
1716
+
1717
+ if (context.method === "throw") {
1718
+ // Note: ["return"] must be used for ES3 parsing compatibility.
1719
+ if (delegate.iterator["return"]) {
1720
+ // If the delegate iterator has a return method, give it a
1721
+ // chance to clean up.
1722
+ context.method = "return";
1723
+ context.arg = undefined$1;
1724
+ maybeInvokeDelegate(delegate, context);
1725
+
1726
+ if (context.method === "throw") {
1727
+ // If maybeInvokeDelegate(context) changed context.method from
1728
+ // "return" to "throw", let that override the TypeError below.
1729
+ return ContinueSentinel;
1730
+ }
1731
+ }
1732
+
1733
+ context.method = "throw";
1734
+ context.arg = new TypeError(
1735
+ "The iterator does not provide a 'throw' method");
1736
+ }
1737
+
1738
+ return ContinueSentinel;
1739
+ }
1740
+
1741
+ var record = tryCatch(method, delegate.iterator, context.arg);
1742
+
1743
+ if (record.type === "throw") {
1744
+ context.method = "throw";
1745
+ context.arg = record.arg;
1746
+ context.delegate = null;
1747
+ return ContinueSentinel;
1748
+ }
1749
+
1750
+ var info = record.arg;
1751
+
1752
+ if (! info) {
1753
+ context.method = "throw";
1754
+ context.arg = new TypeError("iterator result is not an object");
1755
+ context.delegate = null;
1756
+ return ContinueSentinel;
1757
+ }
1758
+
1759
+ if (info.done) {
1760
+ // Assign the result of the finished delegate to the temporary
1761
+ // variable specified by delegate.resultName (see delegateYield).
1762
+ context[delegate.resultName] = info.value;
1763
+
1764
+ // Resume execution at the desired location (see delegateYield).
1765
+ context.next = delegate.nextLoc;
1766
+
1767
+ // If context.method was "throw" but the delegate handled the
1768
+ // exception, let the outer generator proceed normally. If
1769
+ // context.method was "next", forget context.arg since it has been
1770
+ // "consumed" by the delegate iterator. If context.method was
1771
+ // "return", allow the original .return call to continue in the
1772
+ // outer generator.
1773
+ if (context.method !== "return") {
1774
+ context.method = "next";
1775
+ context.arg = undefined$1;
1776
+ }
1777
+
1778
+ } else {
1779
+ // Re-yield the result returned by the delegate method.
1780
+ return info;
1781
+ }
1782
+
1783
+ // The delegate iterator is finished, so forget it and continue with
1784
+ // the outer generator.
1785
+ context.delegate = null;
1786
+ return ContinueSentinel;
1787
+ }
1788
+
1789
+ // Define Generator.prototype.{next,throw,return} in terms of the
1790
+ // unified ._invoke helper method.
1791
+ defineIteratorMethods(Gp);
1792
+
1793
+ define(Gp, toStringTagSymbol, "Generator");
1794
+
1795
+ // A Generator should always return itself as the iterator object when the
1796
+ // @@iterator function is called on it. Some browsers' implementations of the
1797
+ // iterator prototype chain incorrectly implement this, causing the Generator
1798
+ // object to not be returned from this call. This ensures that doesn't happen.
1799
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
1800
+ define(Gp, iteratorSymbol, function() {
1801
+ return this;
1802
+ });
1803
+
1804
+ define(Gp, "toString", function() {
1805
+ return "[object Generator]";
1806
+ });
1807
+
1808
+ function pushTryEntry(locs) {
1809
+ var entry = { tryLoc: locs[0] };
1810
+
1811
+ if (1 in locs) {
1812
+ entry.catchLoc = locs[1];
1813
+ }
1814
+
1815
+ if (2 in locs) {
1816
+ entry.finallyLoc = locs[2];
1817
+ entry.afterLoc = locs[3];
1818
+ }
1819
+
1820
+ this.tryEntries.push(entry);
1821
+ }
1822
+
1823
+ function resetTryEntry(entry) {
1824
+ var record = entry.completion || {};
1825
+ record.type = "normal";
1826
+ delete record.arg;
1827
+ entry.completion = record;
1828
+ }
1829
+
1830
+ function Context(tryLocsList) {
1831
+ // The root entry object (effectively a try statement without a catch
1832
+ // or a finally block) gives us a place to store values thrown from
1833
+ // locations where there is no enclosing try statement.
1834
+ this.tryEntries = [{ tryLoc: "root" }];
1835
+ tryLocsList.forEach(pushTryEntry, this);
1836
+ this.reset(true);
1837
+ }
1838
+
1839
+ exports.keys = function(object) {
1840
+ var keys = [];
1841
+ for (var key in object) {
1842
+ keys.push(key);
1843
+ }
1844
+ keys.reverse();
1845
+
1846
+ // Rather than returning an object with a next method, we keep
1847
+ // things simple and return the next function itself.
1848
+ return function next() {
1849
+ while (keys.length) {
1850
+ var key = keys.pop();
1851
+ if (key in object) {
1852
+ next.value = key;
1853
+ next.done = false;
1854
+ return next;
1855
+ }
1856
+ }
1857
+
1858
+ // To avoid creating an additional object, we just hang the .value
1859
+ // and .done properties off the next function object itself. This
1860
+ // also ensures that the minifier will not anonymize the function.
1861
+ next.done = true;
1862
+ return next;
1863
+ };
1864
+ };
1865
+
1866
+ function values(iterable) {
1867
+ if (iterable) {
1868
+ var iteratorMethod = iterable[iteratorSymbol];
1869
+ if (iteratorMethod) {
1870
+ return iteratorMethod.call(iterable);
1871
+ }
1872
+
1873
+ if (typeof iterable.next === "function") {
1874
+ return iterable;
1875
+ }
1876
+
1877
+ if (!isNaN(iterable.length)) {
1878
+ var i = -1, next = function next() {
1879
+ while (++i < iterable.length) {
1880
+ if (hasOwn.call(iterable, i)) {
1881
+ next.value = iterable[i];
1882
+ next.done = false;
1883
+ return next;
1884
+ }
1885
+ }
1886
+
1887
+ next.value = undefined$1;
1888
+ next.done = true;
1889
+
1890
+ return next;
1891
+ };
1892
+
1893
+ return next.next = next;
1894
+ }
1895
+ }
1896
+
1897
+ // Return an iterator with no values.
1898
+ return { next: doneResult };
1899
+ }
1900
+ exports.values = values;
1901
+
1902
+ function doneResult() {
1903
+ return { value: undefined$1, done: true };
1904
+ }
1905
+
1906
+ Context.prototype = {
1907
+ constructor: Context,
1908
+
1909
+ reset: function(skipTempReset) {
1910
+ this.prev = 0;
1911
+ this.next = 0;
1912
+ // Resetting context._sent for legacy support of Babel's
1913
+ // function.sent implementation.
1914
+ this.sent = this._sent = undefined$1;
1915
+ this.done = false;
1916
+ this.delegate = null;
1917
+
1918
+ this.method = "next";
1919
+ this.arg = undefined$1;
1920
+
1921
+ this.tryEntries.forEach(resetTryEntry);
1922
+
1923
+ if (!skipTempReset) {
1924
+ for (var name in this) {
1925
+ // Not sure about the optimal order of these conditions:
1926
+ if (name.charAt(0) === "t" &&
1927
+ hasOwn.call(this, name) &&
1928
+ !isNaN(+name.slice(1))) {
1929
+ this[name] = undefined$1;
1930
+ }
1931
+ }
1932
+ }
1933
+ },
1934
+
1935
+ stop: function() {
1936
+ this.done = true;
1937
+
1938
+ var rootEntry = this.tryEntries[0];
1939
+ var rootRecord = rootEntry.completion;
1940
+ if (rootRecord.type === "throw") {
1941
+ throw rootRecord.arg;
1942
+ }
1943
+
1944
+ return this.rval;
1945
+ },
1946
+
1947
+ dispatchException: function(exception) {
1948
+ if (this.done) {
1949
+ throw exception;
1950
+ }
1951
+
1952
+ var context = this;
1953
+ function handle(loc, caught) {
1954
+ record.type = "throw";
1955
+ record.arg = exception;
1956
+ context.next = loc;
1957
+
1958
+ if (caught) {
1959
+ // If the dispatched exception was caught by a catch block,
1960
+ // then let that catch block handle the exception normally.
1961
+ context.method = "next";
1962
+ context.arg = undefined$1;
1963
+ }
1964
+
1965
+ return !! caught;
1966
+ }
1967
+
1968
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1969
+ var entry = this.tryEntries[i];
1970
+ var record = entry.completion;
1971
+
1972
+ if (entry.tryLoc === "root") {
1973
+ // Exception thrown outside of any try block that could handle
1974
+ // it, so set the completion value of the entire function to
1975
+ // throw the exception.
1976
+ return handle("end");
1977
+ }
1978
+
1979
+ if (entry.tryLoc <= this.prev) {
1980
+ var hasCatch = hasOwn.call(entry, "catchLoc");
1981
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
1982
+
1983
+ if (hasCatch && hasFinally) {
1984
+ if (this.prev < entry.catchLoc) {
1985
+ return handle(entry.catchLoc, true);
1986
+ } else if (this.prev < entry.finallyLoc) {
1987
+ return handle(entry.finallyLoc);
1988
+ }
1989
+
1990
+ } else if (hasCatch) {
1991
+ if (this.prev < entry.catchLoc) {
1992
+ return handle(entry.catchLoc, true);
1993
+ }
1994
+
1995
+ } else if (hasFinally) {
1996
+ if (this.prev < entry.finallyLoc) {
1997
+ return handle(entry.finallyLoc);
1998
+ }
1999
+
2000
+ } else {
2001
+ throw new Error("try statement without catch or finally");
2002
+ }
2003
+ }
2004
+ }
2005
+ },
2006
+
2007
+ abrupt: function(type, arg) {
2008
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2009
+ var entry = this.tryEntries[i];
2010
+ if (entry.tryLoc <= this.prev &&
2011
+ hasOwn.call(entry, "finallyLoc") &&
2012
+ this.prev < entry.finallyLoc) {
2013
+ var finallyEntry = entry;
2014
+ break;
2015
+ }
2016
+ }
2017
+
2018
+ if (finallyEntry &&
2019
+ (type === "break" ||
2020
+ type === "continue") &&
2021
+ finallyEntry.tryLoc <= arg &&
2022
+ arg <= finallyEntry.finallyLoc) {
2023
+ // Ignore the finally entry if control is not jumping to a
2024
+ // location outside the try/catch block.
2025
+ finallyEntry = null;
2026
+ }
2027
+
2028
+ var record = finallyEntry ? finallyEntry.completion : {};
2029
+ record.type = type;
2030
+ record.arg = arg;
2031
+
2032
+ if (finallyEntry) {
2033
+ this.method = "next";
2034
+ this.next = finallyEntry.finallyLoc;
2035
+ return ContinueSentinel;
2036
+ }
2037
+
2038
+ return this.complete(record);
2039
+ },
2040
+
2041
+ complete: function(record, afterLoc) {
2042
+ if (record.type === "throw") {
2043
+ throw record.arg;
2044
+ }
2045
+
2046
+ if (record.type === "break" ||
2047
+ record.type === "continue") {
2048
+ this.next = record.arg;
2049
+ } else if (record.type === "return") {
2050
+ this.rval = this.arg = record.arg;
2051
+ this.method = "return";
2052
+ this.next = "end";
2053
+ } else if (record.type === "normal" && afterLoc) {
2054
+ this.next = afterLoc;
2055
+ }
2056
+
2057
+ return ContinueSentinel;
2058
+ },
2059
+
2060
+ finish: function(finallyLoc) {
2061
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2062
+ var entry = this.tryEntries[i];
2063
+ if (entry.finallyLoc === finallyLoc) {
2064
+ this.complete(entry.completion, entry.afterLoc);
2065
+ resetTryEntry(entry);
2066
+ return ContinueSentinel;
2067
+ }
2068
+ }
2069
+ },
2070
+
2071
+ "catch": function(tryLoc) {
2072
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2073
+ var entry = this.tryEntries[i];
2074
+ if (entry.tryLoc === tryLoc) {
2075
+ var record = entry.completion;
2076
+ if (record.type === "throw") {
2077
+ var thrown = record.arg;
2078
+ resetTryEntry(entry);
2079
+ }
2080
+ return thrown;
2081
+ }
2082
+ }
2083
+
2084
+ // The context.catch method must only be called with a location
2085
+ // argument that corresponds to a known catch block.
2086
+ throw new Error("illegal catch attempt");
2087
+ },
2088
+
2089
+ delegateYield: function(iterable, resultName, nextLoc) {
2090
+ this.delegate = {
2091
+ iterator: values(iterable),
2092
+ resultName: resultName,
2093
+ nextLoc: nextLoc
2094
+ };
2095
+
2096
+ if (this.method === "next") {
2097
+ // Deliberately forget the last sent value so that we don't
2098
+ // accidentally pass it on to the delegate.
2099
+ this.arg = undefined$1;
2100
+ }
2101
+
2102
+ return ContinueSentinel;
2103
+ }
2104
+ };
2105
+
2106
+ // Regardless of whether this script is executing as a CommonJS module
2107
+ // or not, return the runtime object so that we can declare the variable
2108
+ // regeneratorRuntime in the outer scope, which allows this module to be
2109
+ // injected easily by `bin/regenerator --include-runtime script.js`.
2110
+ return exports;
2111
+
2112
+ }(
2113
+ // If this script is executing as a CommonJS module, use module.exports
2114
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
2115
+ // object. Either way, the resulting object will be used to initialize
2116
+ // the regeneratorRuntime variable at the top of this file.
2117
+ module.exports
2118
+ ));
2119
+
2120
+ try {
2121
+ regeneratorRuntime = runtime;
2122
+ } catch (accidentalStrictMode) {
2123
+ // This module should not be running in strict mode, so the above
2124
+ // assignment should always work unless something is misconfigured. Just
2125
+ // in case runtime.js accidentally runs in strict mode, in modern engines
2126
+ // we can explicitly access globalThis. In older engines we can escape
2127
+ // strict mode using a global Function call. This could conceivably fail
2128
+ // if a Content Security Policy forbids using Function, but in that case
2129
+ // the proper solution is to fix the accidental strict mode problem. If
2130
+ // you've misconfigured your bundler to force strict mode and applied a
2131
+ // CSP to forbid Function, and you're not willing to fix either of those
2132
+ // problems, please detail your unique predicament in a GitHub issue.
2133
+ if (typeof globalThis === "object") {
2134
+ globalThis.regeneratorRuntime = runtime;
2135
+ } else {
2136
+ Function("r", "regeneratorRuntime = r")(runtime);
2137
+ }
2138
+ }
2139
+ });
2140
+
2141
+ /**
2142
+ * A specialized version of `_.reduce` for arrays without support for
2143
+ * iteratee shorthands.
2144
+ *
2145
+ * @private
2146
+ * @param {Array} [array] The array to iterate over.
2147
+ * @param {Function} iteratee The function invoked per iteration.
2148
+ * @param {*} [accumulator] The initial value.
2149
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
2150
+ * the initial value.
2151
+ * @returns {*} Returns the accumulated value.
2152
+ */
2153
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
2154
+ var index = -1,
2155
+ length = array == null ? 0 : array.length;
2156
+
2157
+ if (initAccum && length) {
2158
+ accumulator = array[++index];
2159
+ }
2160
+ while (++index < length) {
2161
+ accumulator = iteratee(accumulator, array[index], index, array);
2162
+ }
2163
+ return accumulator;
2164
+ }
2165
+
2166
+ var _arrayReduce = arrayReduce;
2167
+
2168
+ /**
2169
+ * The base implementation of `_.propertyOf` without support for deep paths.
2170
+ *
2171
+ * @private
2172
+ * @param {Object} object The object to query.
2173
+ * @returns {Function} Returns the new accessor function.
2174
+ */
2175
+ function basePropertyOf(object) {
2176
+ return function(key) {
2177
+ return object == null ? undefined : object[key];
2178
+ };
2179
+ }
2180
+
2181
+ var _basePropertyOf = basePropertyOf;
2182
+
2183
+ /** Used to map Latin Unicode letters to basic Latin letters. */
2184
+ var deburredLetters = {
2185
+ // Latin-1 Supplement block.
2186
+ '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
2187
+ '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
2188
+ '\xc7': 'C', '\xe7': 'c',
2189
+ '\xd0': 'D', '\xf0': 'd',
2190
+ '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
2191
+ '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
2192
+ '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
2193
+ '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
2194
+ '\xd1': 'N', '\xf1': 'n',
2195
+ '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
2196
+ '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
2197
+ '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
2198
+ '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
2199
+ '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
2200
+ '\xc6': 'Ae', '\xe6': 'ae',
2201
+ '\xde': 'Th', '\xfe': 'th',
2202
+ '\xdf': 'ss',
2203
+ // Latin Extended-A block.
2204
+ '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
2205
+ '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
2206
+ '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
2207
+ '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
2208
+ '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
2209
+ '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
2210
+ '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
2211
+ '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
2212
+ '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
2213
+ '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
2214
+ '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
2215
+ '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
2216
+ '\u0134': 'J', '\u0135': 'j',
2217
+ '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
2218
+ '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
2219
+ '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
2220
+ '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
2221
+ '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
2222
+ '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
2223
+ '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
2224
+ '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
2225
+ '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
2226
+ '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
2227
+ '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
2228
+ '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
2229
+ '\u0163': 't', '\u0165': 't', '\u0167': 't',
2230
+ '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
2231
+ '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
2232
+ '\u0174': 'W', '\u0175': 'w',
2233
+ '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
2234
+ '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
2235
+ '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
2236
+ '\u0132': 'IJ', '\u0133': 'ij',
2237
+ '\u0152': 'Oe', '\u0153': 'oe',
2238
+ '\u0149': "'n", '\u017f': 's'
2239
+ };
2240
+
2241
+ /**
2242
+ * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
2243
+ * letters to basic Latin letters.
2244
+ *
2245
+ * @private
2246
+ * @param {string} letter The matched letter to deburr.
2247
+ * @returns {string} Returns the deburred letter.
2248
+ */
2249
+ var deburrLetter = _basePropertyOf(deburredLetters);
2250
+
2251
+ var _deburrLetter = deburrLetter;
2252
+
2253
+ /** Used to match Latin Unicode letters (excluding mathematical operators). */
2254
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
2255
+
2256
+ /** Used to compose unicode character classes. */
2257
+ var rsComboMarksRange$1 = '\\u0300-\\u036f',
2258
+ reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
2259
+ rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
2260
+ rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
2261
+
2262
+ /** Used to compose unicode capture groups. */
2263
+ var rsCombo$1 = '[' + rsComboRange$1 + ']';
2264
+
2265
+ /**
2266
+ * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
2267
+ * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
2268
+ */
2269
+ var reComboMark = RegExp(rsCombo$1, 'g');
2270
+
2271
+ /**
2272
+ * Deburrs `string` by converting
2273
+ * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
2274
+ * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
2275
+ * letters to basic Latin letters and removing
2276
+ * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
2277
+ *
2278
+ * @static
2279
+ * @memberOf _
2280
+ * @since 3.0.0
2281
+ * @category String
2282
+ * @param {string} [string=''] The string to deburr.
2283
+ * @returns {string} Returns the deburred string.
2284
+ * @example
2285
+ *
2286
+ * _.deburr('déjà vu');
2287
+ * // => 'deja vu'
2288
+ */
2289
+ function deburr(string) {
2290
+ string = toString_1(string);
2291
+ return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
2292
+ }
2293
+
2294
+ var deburr_1 = deburr;
2295
+
2296
+ /** Used to match words composed of alphanumeric characters. */
2297
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
2298
+
2299
+ /**
2300
+ * Splits an ASCII `string` into an array of its words.
2301
+ *
2302
+ * @private
2303
+ * @param {string} The string to inspect.
2304
+ * @returns {Array} Returns the words of `string`.
2305
+ */
2306
+ function asciiWords(string) {
2307
+ return string.match(reAsciiWord) || [];
2308
+ }
2309
+
2310
+ var _asciiWords = asciiWords;
2311
+
2312
+ /** Used to detect strings that need a more robust regexp to match words. */
2313
+ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
2314
+
2315
+ /**
2316
+ * Checks if `string` contains a word composed of Unicode symbols.
2317
+ *
2318
+ * @private
2319
+ * @param {string} string The string to inspect.
2320
+ * @returns {boolean} Returns `true` if a word is found, else `false`.
2321
+ */
2322
+ function hasUnicodeWord(string) {
2323
+ return reHasUnicodeWord.test(string);
2324
+ }
2325
+
2326
+ var _hasUnicodeWord = hasUnicodeWord;
2327
+
2328
+ /** Used to compose unicode character classes. */
2329
+ var rsAstralRange = '\\ud800-\\udfff',
2330
+ rsComboMarksRange = '\\u0300-\\u036f',
2331
+ reComboHalfMarksRange = '\\ufe20-\\ufe2f',
2332
+ rsComboSymbolsRange = '\\u20d0-\\u20ff',
2333
+ rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
2334
+ rsDingbatRange = '\\u2700-\\u27bf',
2335
+ rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
2336
+ rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
2337
+ rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
2338
+ rsPunctuationRange = '\\u2000-\\u206f',
2339
+ rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
2340
+ rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
2341
+ rsVarRange = '\\ufe0e\\ufe0f',
2342
+ rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
2343
+
2344
+ /** Used to compose unicode capture groups. */
2345
+ var rsApos$1 = "['\u2019]",
2346
+ rsBreak = '[' + rsBreakRange + ']',
2347
+ rsCombo = '[' + rsComboRange + ']',
2348
+ rsDigits = '\\d+',
2349
+ rsDingbat = '[' + rsDingbatRange + ']',
2350
+ rsLower = '[' + rsLowerRange + ']',
2351
+ rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
2352
+ rsFitz = '\\ud83c[\\udffb-\\udfff]',
2353
+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
2354
+ rsNonAstral = '[^' + rsAstralRange + ']',
2355
+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
2356
+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
2357
+ rsUpper = '[' + rsUpperRange + ']',
2358
+ rsZWJ = '\\u200d';
2359
+
2360
+ /** Used to compose unicode regexes. */
2361
+ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
2362
+ rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
2363
+ rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?',
2364
+ rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?',
2365
+ reOptMod = rsModifier + '?',
2366
+ rsOptVar = '[' + rsVarRange + ']?',
2367
+ rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
2368
+ rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
2369
+ rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
2370
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
2371
+ rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
2372
+
2373
+ /** Used to match complex or compound words. */
2374
+ var reUnicodeWord = RegExp([
2375
+ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
2376
+ rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
2377
+ rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
2378
+ rsUpper + '+' + rsOptContrUpper,
2379
+ rsOrdUpper,
2380
+ rsOrdLower,
2381
+ rsDigits,
2382
+ rsEmoji
2383
+ ].join('|'), 'g');
2384
+
2385
+ /**
2386
+ * Splits a Unicode `string` into an array of its words.
2387
+ *
2388
+ * @private
2389
+ * @param {string} The string to inspect.
2390
+ * @returns {Array} Returns the words of `string`.
2391
+ */
2392
+ function unicodeWords(string) {
2393
+ return string.match(reUnicodeWord) || [];
2394
+ }
2395
+
2396
+ var _unicodeWords = unicodeWords;
2397
+
2398
+ /**
2399
+ * Splits `string` into an array of its words.
2400
+ *
2401
+ * @static
2402
+ * @memberOf _
2403
+ * @since 3.0.0
2404
+ * @category String
2405
+ * @param {string} [string=''] The string to inspect.
2406
+ * @param {RegExp|string} [pattern] The pattern to match words.
2407
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
2408
+ * @returns {Array} Returns the words of `string`.
2409
+ * @example
2410
+ *
2411
+ * _.words('fred, barney, & pebbles');
2412
+ * // => ['fred', 'barney', 'pebbles']
2413
+ *
2414
+ * _.words('fred, barney, & pebbles', /[^, ]+/g);
2415
+ * // => ['fred', 'barney', '&', 'pebbles']
2416
+ */
2417
+ function words(string, pattern, guard) {
2418
+ string = toString_1(string);
2419
+ pattern = guard ? undefined : pattern;
2420
+
2421
+ if (pattern === undefined) {
2422
+ return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
2423
+ }
2424
+ return string.match(pattern) || [];
2425
+ }
2426
+
2427
+ var words_1 = words;
2428
+
2429
+ /** Used to compose unicode capture groups. */
2430
+ var rsApos = "['\u2019]";
2431
+
2432
+ /** Used to match apostrophes. */
2433
+ var reApos = RegExp(rsApos, 'g');
2434
+
2435
+ /**
2436
+ * Creates a function like `_.camelCase`.
2437
+ *
2438
+ * @private
2439
+ * @param {Function} callback The function to combine each word.
2440
+ * @returns {Function} Returns the new compounder function.
2441
+ */
2442
+ function createCompounder(callback) {
2443
+ return function(string) {
2444
+ return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
2445
+ };
2446
+ }
2447
+
2448
+ var _createCompounder = createCompounder;
2449
+
2450
+ /**
2451
+ * Converts `string`, as space separated words, to upper case.
2452
+ *
2453
+ * @static
2454
+ * @memberOf _
2455
+ * @since 4.0.0
2456
+ * @category String
2457
+ * @param {string} [string=''] The string to convert.
2458
+ * @returns {string} Returns the upper cased string.
2459
+ * @example
2460
+ *
2461
+ * _.upperCase('--foo-bar');
2462
+ * // => 'FOO BAR'
2463
+ *
2464
+ * _.upperCase('fooBar');
2465
+ * // => 'FOO BAR'
2466
+ *
2467
+ * _.upperCase('__foo_bar__');
2468
+ * // => 'FOO BAR'
2469
+ */
2470
+ var upperCase = _createCompounder(function(result, word, index) {
2471
+ return result + (index ? ' ' : '') + word.toUpperCase();
2472
+ });
2473
+
2474
+ var upperCase_1 = upperCase;
2475
+
2476
+ /**
2477
+ * Converts `string`, as space separated words, to lower case.
2478
+ *
2479
+ * @static
2480
+ * @memberOf _
2481
+ * @since 4.0.0
2482
+ * @category String
2483
+ * @param {string} [string=''] The string to convert.
2484
+ * @returns {string} Returns the lower cased string.
2485
+ * @example
2486
+ *
2487
+ * _.lowerCase('--Foo-Bar--');
2488
+ * // => 'foo bar'
2489
+ *
2490
+ * _.lowerCase('fooBar');
2491
+ * // => 'foo bar'
2492
+ *
2493
+ * _.lowerCase('__FOO_BAR__');
2494
+ * // => 'foo bar'
2495
+ */
2496
+ var lowerCase = _createCompounder(function(result, word, index) {
2497
+ return result + (index ? ' ' : '') + word.toLowerCase();
2498
+ });
2499
+
2500
+ var lowerCase_1 = lowerCase;
2501
+
2502
+ function truncate() {
2503
+ var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
2504
+ var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
2505
+ var ellipsis = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2506
+ var putEllipsis = ellipsis ? " ..." : "";
2507
+ return typeof string === "string" && string.length > limit ? string.substring(0, limit) + putEllipsis : string;
2508
+ }
2509
+ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestamp) {
2510
+ var config = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
2511
+ var _config$showTime = config.showTime,
2512
+ showTime = _config$showTime === void 0 ? false : _config$showTime,
2513
+ _config$isTimeFirst = config.isTimeFirst,
2514
+ isTimeFirst = _config$isTimeFirst === void 0 ? false : _config$isTimeFirst,
2515
+ _config$isUpperCase = config.isUpperCase,
2516
+ isUpperCase = _config$isUpperCase === void 0 ? false : _config$isUpperCase,
2517
+ _config$disableMeridi = config.disableMeridiem,
2518
+ disableMeridiem = _config$disableMeridi === void 0 ? false : _config$disableMeridi,
2519
+ _config$timeFormat = config.timeFormat,
2520
+ timeFormat = _config$timeFormat === void 0 ? "12hours" : _config$timeFormat;
2521
+ var monthList = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
2522
+ var dateTime = new Date(timestamp);
2523
+ var date = dateTime.getDate().toString().padStart(2, 0);
2524
+ var month = monthList[dateTime.getMonth()];
2525
+ var localizedMonth = month;
2526
+
2527
+ if (isUpperCase) {
2528
+ localizedMonth = upperCase_1(month);
2529
+ }
2530
+
2531
+ var year = dateTime.getFullYear();
2532
+ var localizedMeridiem = config.localizedMeridiem,
2533
+ localizedMonths = config.localizedMonths,
2534
+ _config$direction = config.direction,
2535
+ direction = _config$direction === void 0 ? "ltr" : _config$direction;
2536
+ var time = formatAMPM(timestamp, timeFormat);
2537
+ var timeWithLocalizedMeridiem = time;
2538
+ var timetoShow;
2539
+
2540
+ if (localizedMonths) {
2541
+ localizedMonth = get_1(localizedMonths, [lowerCase_1(month)]) || month;
2542
+ }
2543
+
2544
+ if (localizedMeridiem) {
2545
+ var isAm = time.includes("am");
2546
+ var _localizedMeridiem$am = localizedMeridiem.am,
2547
+ am = _localizedMeridiem$am === void 0 ? "am" : _localizedMeridiem$am,
2548
+ _localizedMeridiem$pm = localizedMeridiem.pm,
2549
+ pm = _localizedMeridiem$pm === void 0 ? "pm" : _localizedMeridiem$pm;
2550
+ timeWithLocalizedMeridiem = (isAm ? time.replace("am", am) : time.replace("pm", pm)) || time;
2551
+ }
2552
+
2553
+ if (direction === "rtl") {
2554
+ timetoShow = showTime ? "".concat(timeWithLocalizedMeridiem) : "";
2555
+ return "".concat(date, " ").concat(localizedMonth, ", ").concat(year, " ").concat(timetoShow, " ");
2556
+ } else {
2557
+ if (disableMeridiem) {
2558
+ return "".concat(localizedMonth, " ").concat(date, ", ").concat(year);
2559
+ } else if (isTimeFirst) {
2560
+ return "".concat(timeWithLocalizedMeridiem, ", ").concat(date, " ").concat(localizedMonth, " ").concat(year);
2561
+ } else {
2562
+ timetoShow = showTime ? ", ".concat(timeWithLocalizedMeridiem) : "";
2563
+ return "".concat(date, " ").concat(localizedMonth, ", ").concat(year).concat(timetoShow);
2564
+ }
2565
+ }
2566
+ };
2567
+ function formatter(value, unit, suffix, date, config) {
2568
+ var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
2569
+ // unit here refers to seconds, minute, minutes,...
2570
+
2571
+ var localizedSuffix = get_1(config, ["localizedPublishTime", suffix]) || suffix;
2572
+ var localizedUnitOfTime;
2573
+
2574
+ if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
2575
+ return timestampToFormat(value, unit, suffix, date, config);
2576
+ } else if (value > 1) {
2577
+ localizedUnitOfTime = get_1(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
2578
+ return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
2579
+ }
2580
+
2581
+ localizedUnitOfTime = get_1(config, ["localizedPublishTime", unit]) || unit;
2582
+ return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
2583
+ }
2584
+
2585
+ function formatAMPM(timestamp) {
2586
+ var timeFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "12hours";
2587
+ var dateTime = new Date(timestamp);
2588
+ var hours = dateTime.getHours();
2589
+ var minutes = dateTime.getMinutes();
2590
+ var ampm = hours >= 12 ? "pm" : "am";
2591
+ hours = hours % 12;
2592
+ hours = hours || 12;
2593
+ minutes = minutes < 10 ? "0" + minutes : minutes;
2594
+ var strTime = hours + ":" + minutes + " " + ampm;
2595
+
2596
+ if (timeFormat === "24hours") {
2597
+ return dateTime.toLocaleTimeString([], {
2598
+ hour: "2-digit",
2599
+ minute: "2-digit"
2600
+ });
2601
+ }
2602
+
2603
+ return strTime;
2604
+ }
2605
+
2606
+ var hexToRGB = function hexToRGB(hex) {
2607
+ var r = parseInt(hex.slice(1, 3), 16);
2608
+ var g = parseInt(hex.slice(3, 5), 16);
2609
+ var b = parseInt(hex.slice(5, 7), 16);
2610
+ return {
2611
+ r: r,
2612
+ g: g,
2613
+ b: b
2614
+ };
2615
+ };
2616
+ var getLuminanceOfColor = function getLuminanceOfColor(hex) {
2617
+ var _hexToRGB = hexToRGB(hex),
2618
+ r = _hexToRGB.r,
2619
+ g = _hexToRGB.g,
2620
+ b = _hexToRGB.b;
2621
+
2622
+ return r * 0.299 + g * 0.587 + b * 0.114;
2623
+ };
2624
+ var rgbToHex = function rgbToHex() {
2625
+ var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgba(255, 255, 255, 0)";
2626
+ var rgba = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
2627
+ 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;
2628
+ };
2629
+ var clientWidths = {
2630
+ mobile: 767,
2631
+ tablet: 1024
2632
+ };
2633
+ var clientWidth = function clientWidth(device) {
2634
+ var foundDeviceWidth = get_1(clientWidths, device);
2635
+
2636
+ if (foundDeviceWidth) {
2637
+ return get_1(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
2638
+ }
2639
+
2640
+ return false;
2641
+ };
2642
+ var getTextColor = function getTextColor() {
2643
+ var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(255,255,255)";
2644
+ var isRegexCheck = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(theme);
2645
+ var getHexValue = !isRegexCheck ? rgbToHex(theme) : theme;
2646
+ var textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
2647
+ return textColor;
2648
+ };
2649
+ var getSlot = function getSlot(type, component, storyCallback, collectionCallback) {
2650
+ switch (type) {
2651
+ case "story":
2652
+ return storyCallback();
2653
+
2654
+ case "collection":
2655
+ return collectionCallback();
2656
+
2657
+ default:
2658
+ return component ? component() : null;
2659
+ }
2660
+ };
2661
+ var getSlug = function getSlug(collection) {
2662
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2663
+ var _config$magazineSlug = config.magazineSlug,
2664
+ magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug,
2665
+ _config$isArchivePage = config.isArchivePage,
2666
+ isArchivePage = _config$isArchivePage === void 0 ? false : _config$isArchivePage;
2667
+
2668
+ if (isArchivePage) {
2669
+ return "/magazine/archive/".concat(magazineSlug);
2670
+ }
2671
+
2672
+ if (magazineSlug) {
2673
+ return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
2674
+ }
2675
+
2676
+ var isSection = collection.template === "section";
2677
+
2678
+ if (isSection) {
2679
+ var sectionId = get_1(collection, ["metadata", "section", "0", "id"], "");
2680
+ var sections = config.sections;
2681
+ var section = sections && sections.find(function (section) {
2682
+ return section.id === sectionId;
2683
+ });
2684
+ return section ? section["section-url"] : "/";
2685
+ }
2686
+
2687
+ return "/collection/".concat(collection.slug);
2688
+ };
2689
+ function isExternalStory() {
2690
+ var story = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2691
+ var _story$storyTemplate = story["story-template"],
2692
+ storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
2693
+ _story$metadata = story.metadata,
2694
+ metadata = _story$metadata === void 0 ? {} : _story$metadata;
2695
+ return storyTemplate === "news-elsewhere" ? get_1(metadata, ["reference-url"], "") : "";
2696
+ } // Adds target='_blank' attribute to anchor tags if not present
2697
+ var isEmpty = function isEmpty(value) {
2698
+ return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
2699
+ _typeof(value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
2700
+ };
2701
+ PropTypes.shape({
2702
+ "sketches-host": PropTypes.string,
2703
+ "cdn-name": PropTypes.string,
2704
+ "cdn-image": PropTypes.string
2705
+ });
2706
+ PropTypes.shape({
2707
+ headline: PropTypes.string,
2708
+ "last-published-at": PropTypes.number,
2709
+ subheadline: PropTypes.string
2710
+ });
2711
+ var getStoryUrl = function getStoryUrl(story) {
2712
+ var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
2713
+ return get_1(story, ["story-template"]) === "news-elsewhere" ? get_1(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
2714
+ };
2715
+ var navigateTo = function navigateTo(dispatch) {
2716
+ var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
2717
+ global.app.navigateToPage(dispatch, url);
2718
+ };
2719
+ var generateNavigateSlug = function generateNavigateSlug() {
2720
+ var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2721
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2722
+ var customUrlPath = arguments.length > 2 ? arguments[2] : undefined;
2723
+
2724
+ if (customUrlPath) {
2725
+ return customUrlPath;
2726
+ }
2727
+
2728
+ var _config$magazineSlug2 = config.magazineSlug,
2729
+ magazineSlug = _config$magazineSlug2 === void 0 ? "" : _config$magazineSlug2,
2730
+ _config$isArchivePage2 = config.isArchivePage,
2731
+ isArchivePage = _config$isArchivePage2 === void 0 ? false : _config$isArchivePage2;
2732
+
2733
+ if (isArchivePage) {
2734
+ return "/magazine/archive/".concat(magazineSlug);
2735
+ }
2736
+
2737
+ if (magazineSlug) {
2738
+ return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
2739
+ }
2740
+
2741
+ if (collection) {
2742
+ return getSlug(collection, config);
2743
+ }
2744
+
2745
+ return "/";
2746
+ };
2747
+ var getTimeStamp = function getTimeStamp(date, _formatter) {
2748
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2749
+ var template = arguments.length > 3 ? arguments[3] : undefined;
2750
+ var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
2751
+
2752
+ if (timezone && template === "story") {
2753
+ var zonedTime = timezone && utcToZonedTime(date, timezone);
2754
+ var formatZonedTime = zonedTime && format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
2755
+ timeZone: timezone
2756
+ });
2757
+ var timeStamp = timestampToFormat("", "", "", date, config);
2758
+ return /*#__PURE__*/React.createElement("time", {
2759
+ dateTime: formatZonedTime
2760
+ }, timeStamp);
2761
+ }
2762
+
2763
+ return /*#__PURE__*/React.createElement(Timeago, {
2764
+ date: date,
2765
+ formatter: function formatter(value, unit, suffix, date) {
2766
+ return _formatter(value, unit, suffix, date, config);
2767
+ }
2768
+ });
2769
+ };
2770
+
2771
+ var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
2772
+
2773
+ Object.defineProperty(exports, "__esModule", {
2774
+ value: true
2775
+ });
2776
+ exports["default"] = void 0;
2777
+ var optionsDefaults = {
2778
+ attributeNames: {
2779
+ styleName: 'className'
2780
+ },
2781
+ generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
2782
+ handleMissingStyleName: 'throw'
2783
+ };
2784
+ var _default = optionsDefaults;
2785
+ exports["default"] = _default;
2786
+
2787
+
2788
+ });
2789
+
2790
+ var getClassName = createCommonjsModule(function (module, exports) {
2791
+
2792
+ Object.defineProperty(exports, "__esModule", {
2793
+ value: true
2794
+ });
2795
+ exports["default"] = void 0;
2796
+
2797
+ var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
2798
+
2799
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2800
+
2801
+ var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
2802
+ return styleName.indexOf('.') !== -1;
2803
+ };
2804
+
2805
+ var handleError = function handleError(message, handleMissingStyleName) {
2806
+ if (handleMissingStyleName === 'throw') {
2807
+ throw new Error(message);
2808
+ } else if (handleMissingStyleName === 'warn') {
2809
+ // eslint-disable-next-line no-console
2810
+ console.warn(message);
2811
+ }
2812
+
2813
+ return null;
2814
+ };
2815
+
2816
+ var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
2817
+ // Note:
2818
+ // Do not use the desctructing syntax with Babel.
2819
+ // Desctructing adds _slicedToArray helper.
2820
+ var styleNameParts = styleName.split('.');
2821
+ var importName = styleNameParts[0];
2822
+ var moduleName = styleNameParts[1];
2823
+ var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
2824
+
2825
+ if (!moduleName) {
2826
+ return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
2827
+ }
2828
+
2829
+ if (!styleModuleImportMap[importName]) {
2830
+ return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
2831
+ }
2832
+
2833
+ if (!styleModuleImportMap[importName][moduleName]) {
2834
+ return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
2835
+ }
2836
+
2837
+ return styleModuleImportMap[importName][moduleName];
2838
+ };
2839
+
2840
+ var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
2841
+ var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
2842
+ var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
2843
+ return styleModuleImportMap[importKey][styleName] && importKey;
2844
+ }).filter(function (importKey) {
2845
+ return importKey;
2846
+ });
2847
+
2848
+ if (importKeysWithMatches.length > 1) {
2849
+ 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');
2850
+ }
2851
+
2852
+ if (importKeysWithMatches.length === 0) {
2853
+ return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
2854
+ }
2855
+
2856
+ return styleModuleImportMap[importKeysWithMatches[0]][styleName];
2857
+ };
2858
+
2859
+ var _default = function _default(styleNameValue, styleModuleImportMap, options) {
2860
+ var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
2861
+
2862
+ var _ref = options || {},
2863
+ _ref$handleMissingSty = _ref.handleMissingStyleName,
2864
+ handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
2865
+ _ref$autoResolveMulti = _ref.autoResolveMultipleImports,
2866
+ autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
2867
+
2868
+ if (!styleNameValue) {
2869
+ return '';
2870
+ }
2871
+
2872
+ return styleNameValue.split(' ').filter(function (styleName) {
2873
+ return styleName;
2874
+ }).map(function (styleName) {
2875
+ if (isNamespacedStyleName(styleName)) {
2876
+ return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
2877
+ }
2878
+
2879
+ if (styleModuleImportMapKeys.length === 0) {
2880
+ throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
2881
+ }
2882
+
2883
+ if (styleModuleImportMapKeys.length > 1) {
2884
+ if (!autoResolveMultipleImports) {
2885
+ throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
2886
+ }
2887
+
2888
+ return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
2889
+ }
2890
+
2891
+ var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
2892
+
2893
+ if (!styleModuleMap[styleName]) {
2894
+ return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
2895
+ }
2896
+
2897
+ return styleModuleMap[styleName];
2898
+ }).filter(function (className) {
2899
+ // Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
2900
+ return className;
2901
+ }).join(' ');
2902
+ };
2903
+
2904
+ exports["default"] = _default;
2905
+
2906
+
2907
+ });
2908
+
2909
+ var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
2910
+
2911
+ var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
2912
+
2913
+ var StateProvider = function StateProvider(RowComponent) {
2914
+ return function (props) {
2915
+ return (
2916
+ /*#__PURE__*/
2917
+ // eslint-disable-next-line react/prop-types
2918
+ React.createElement(StateContext.Provider, {
2919
+ value: props.config
2920
+ }, /*#__PURE__*/React.createElement(RowComponent, props))
2921
+ );
2922
+ };
2923
+ };
2924
+ var useStateValue = function useStateValue() {
2925
+ return useContext(StateContext);
2926
+ };
2927
+
2928
+ var _styleModuleImportMap$d = {
2929
+ "./timestamp.m.css": {
2930
+ "time": "timestamp-m_time__2v46i",
2931
+ "time-wrapper": "timestamp-m_time-wrapper__3O2lM",
2932
+ "bottom-fix": "timestamp-m_bottom-fix__1Zh8r",
2933
+ "dark": "timestamp-m_dark__2lk9E",
2934
+ "light": "timestamp-m_light__2QlrI"
2935
+ }
2936
+ };
2937
+ var TimeStamp = function TimeStamp(_ref) {
2938
+ var story = _ref.story,
2939
+ isBottom = _ref.isBottom,
2940
+ _ref$config = _ref.config,
2941
+ config = _ref$config === void 0 ? {} : _ref$config;
2942
+ var configState = useStateValue() || {};
2943
+ var isTime = get_1(config, ["showTime"], get_1(configState, ["showTime"], true));
2944
+ var time = story["last-published-at"] || story["first-published-at"];
2945
+ var isBottomClasses = isBottom ? "bottom-fix" : "";
2946
+ var textColor = getTextColor(configState.theme);
2947
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isTime && /*#__PURE__*/React.createElement("div", {
2948
+ "data-test-id": "publish-time",
2949
+ className: "time arr--publish-time " + _getClassName("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$d)
2950
+ }, /*#__PURE__*/React.createElement("div", {
2951
+ className: "timestamp-m_time-wrapper__3O2lM"
2952
+ }, getTimeStamp(time, formatter, config))));
2953
+ };
2954
+ TimeStamp.propTypes = {
2955
+ /** The Story Object from the API response */
2956
+ story: PropTypes.object,
2957
+ isBottom: PropTypes.bool,
2958
+ config: PropTypes.object
2959
+ };
2960
+
2961
+ var _styleModuleImportMap$c = {
2962
+ "./author.m.css": {
2963
+ "author": "author-m_author__WRuLm",
2964
+ "author-image": "author-m_author-image__3q2oc",
2965
+ "author-name": "author-m_author-name__3WP-O",
2966
+ "bottom-fix": "author-m_bottom-fix__223TT",
2967
+ "prefix": "author-m_prefix__YSInK",
2968
+ "rtl-image": "author-m_rtl-image__2nglD",
2969
+ "ltr-image": "author-m_ltr-image__3bc0L",
2970
+ "dark": "author-m_dark__2TTlp",
2971
+ "light": "author-m_light__3y8_x"
2972
+ }
2973
+ };
2974
+
2975
+ var AuthorBase = function AuthorBase(_ref) {
2976
+ var story = _ref.story,
2977
+ hideAuthorImage = _ref.hideAuthorImage,
2978
+ isBottom = _ref.isBottom,
2979
+ _ref$prefix = _ref.prefix,
2980
+ prefix = _ref$prefix === void 0 ? "" : _ref$prefix,
2981
+ _ref$config = _ref.config,
2982
+ config = _ref$config === void 0 ? {} : _ref$config;
2983
+ var configData = useStateValue() || {};
2984
+ var isAuthor = get_1(configData, ["showAuthor"], true);
2985
+
2986
+ var _get = get_1(story, ["authors", "0"], ""),
2987
+ avatarUrl = _get["avatar-url"],
2988
+ avatarS3Key = _get["avatar-s3-key"],
2989
+ authorName = _get.name,
2990
+ slug = _get.slug;
2991
+
2992
+ var isBottomClasses = isBottom ? "bottom-fix" : "";
2993
+ var textColor = getTextColor(configData.theme);
2994
+ var mountAt = get_1(config, ["mountAt"], "");
2995
+
2996
+ var authorImage = function authorImage(dir) {
2997
+ if (!avatarUrl && !avatarS3Key) {
2998
+ return null;
2999
+ }
3000
+
3001
+ return /*#__PURE__*/React.createElement("div", {
3002
+ "data-test-id": "author-image",
3003
+ className: _getClassName("author-image ".concat(dir, "-image"), _styleModuleImportMap$c)
3004
+ }, /*#__PURE__*/React.createElement("figure", null, avatarS3Key ? /*#__PURE__*/React.createElement(ResponsiveImage, {
3005
+ slug: avatarS3Key,
3006
+ "aspect-ratio": [1, 1],
3007
+ defaultWidth: 400,
3008
+ imgParams: {
3009
+ auto: ["format", "compress"]
3010
+ },
3011
+ alt: authorName
3012
+ }) : /*#__PURE__*/React.createElement("img", {
3013
+ src: avatarUrl
3014
+ })));
3015
+ };
3016
+
3017
+ var isPrefix = function isPrefix(dir) {
3018
+ if (prefix) {
3019
+ return /*#__PURE__*/React.createElement("div", {
3020
+ className: "arr-author-prefix " + _getClassName("prefix ".concat(textColor), _styleModuleImportMap$c)
3021
+ }, prefix);
3022
+ }
3023
+
3024
+ return !hideAuthorImage && authorImage(dir);
3025
+ };
3026
+
3027
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isAuthor && /*#__PURE__*/React.createElement(Link, {
3028
+ href: "".concat(mountAt, "/author/") + slug,
3029
+ "aria-label": "author-name",
3030
+ className: "author-name arr-author-name arrow-component " + _getClassName("author ".concat(isBottomClasses), _styleModuleImportMap$c)
3031
+ }, isPrefix("ltr"), /*#__PURE__*/React.createElement("div", {
3032
+ "data-test-id": "author-name",
3033
+ className: "author-name " + _getClassName("author-name ".concat(textColor), _styleModuleImportMap$c)
3034
+ }, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
3035
+ };
3036
+
3037
+ function mapStateToProps$1(state) {
3038
+ return {
3039
+ config: get_1(state, ["qt", "config"], {})
3040
+ };
3041
+ }
3042
+
3043
+ var Author = connect(mapStateToProps$1)(AuthorBase);
3044
+ AuthorBase.propTypes = {
3045
+ /** The Story Object from the API response */
3046
+ story: PropTypes.object.isRequired,
3047
+
3048
+ /** Hide Author Avatar Image */
3049
+ hideAuthorImage: PropTypes.bool,
3050
+ // fix Author bottom of the storyCard
3051
+ isBottom: PropTypes.bool,
3052
+ // fix prefix before the author name
3053
+ prefix: PropTypes.string,
3054
+ config: PropTypes.object
3055
+ };
3056
+ AuthorBase.defaultProps = {
3057
+ hideAuthorImage: false,
3058
+ isBottom: false,
3059
+ prefix: ""
3060
+ };
3061
+
3062
+ var _styleModuleImportMap$b = {
3063
+ "./dot.m.css": {
3064
+ "dark": "dot-m_dark__1Njxl",
3065
+ "light": "dot-m_light__27IA3"
3066
+ }
3067
+ };
3068
+ var Dot = function Dot(_ref) {
3069
+ var _ref$width = _ref.width,
3070
+ width = _ref$width === void 0 ? "3px" : _ref$width,
3071
+ _ref$height = _ref.height,
3072
+ height = _ref$height === void 0 ? "3px" : _ref$height,
3073
+ _ref$color = _ref.color,
3074
+ color = _ref$color === void 0 ? "light" : _ref$color;
3075
+ return /*#__PURE__*/React.createElement("div", {
3076
+ className: _getClassName(color, _styleModuleImportMap$b)
3077
+ }, /*#__PURE__*/React.createElement("svg", {
3078
+ xmlns: "http://www.w3.org/2000/svg",
3079
+ width: width,
3080
+ height: height,
3081
+ viewBox: "0 0 3 3"
3082
+ }, /*#__PURE__*/React.createElement("circle", {
3083
+ cx: "87",
3084
+ cy: "9",
3085
+ r: "1",
3086
+ fill: "inherit",
3087
+ fillRule: "nonzero",
3088
+ transform: "translate(-86 -8)"
3089
+ })));
3090
+ };
3091
+ Dot.propTypes = {
3092
+ /** height , width and color of the dot icon */
3093
+ color: PropTypes.string,
3094
+ width: PropTypes.string,
3095
+ height: PropTypes.string
3096
+ };
3097
+
3098
+ var _styleModuleImportMap$a = {
3099
+ "./divider.m.css": {
3100
+ "dark": "divider-m_dark__26FRi",
3101
+ "light": "divider-m_light__w-7sy"
3102
+ }
3103
+ };
3104
+ var Divider = function Divider(_ref) {
3105
+ var _ref$width = _ref.width,
3106
+ width = _ref$width === void 0 ? "1" : _ref$width,
3107
+ _ref$height = _ref.height,
3108
+ height = _ref$height === void 0 ? "10" : _ref$height,
3109
+ _ref$color = _ref.color,
3110
+ color = _ref$color === void 0 ? "light" : _ref$color;
3111
+ return /*#__PURE__*/React.createElement("div", {
3112
+ className: _getClassName(color, _styleModuleImportMap$a)
3113
+ }, /*#__PURE__*/React.createElement("svg", {
3114
+ xmlns: "http://www.w3.org/2000/svg",
3115
+ width: width,
3116
+ height: height
3117
+ }, /*#__PURE__*/React.createElement("path", {
3118
+ fill: "inherit",
3119
+ d: "M0 0h1v10H0z"
3120
+ })));
3121
+ };
3122
+ Divider.propTypes = {
3123
+ /** height , width and color of the dot icon */
3124
+ color: PropTypes.string,
3125
+ width: PropTypes.string,
3126
+ height: PropTypes.string
3127
+ };
3128
+
3129
+ var _styleModuleImportMap$9 = {
3130
+ "./read-time.m.css": {
3131
+ "read-time-wrapper": "read-time-m_read-time-wrapper__3GyC_",
3132
+ "dot-indicator": "read-time-m_dot-indicator__3Sqh2",
3133
+ "dark": "read-time-m_dark__3yRaK",
3134
+ "light": "read-time-m_light__1GAZu"
3135
+ }
3136
+ };
3137
+ var ReadTime = function ReadTime(_ref) {
3138
+ var story = _ref.story,
3139
+ _ref$opts = _ref.opts,
3140
+ opts = _ref$opts === void 0 ? {} : _ref$opts,
3141
+ _ref$isLightTheme = _ref.isLightTheme,
3142
+ isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
3143
+ var config = useStateValue() || {};
3144
+ var showReadTime = get_1(config, ["showReadTime"]) || get_1(opts, ["showReadTime"], true);
3145
+ var readTime = get_1(story, ["read-time"], 0);
3146
+ var textColor = isLightTheme ? "light" : getTextColor(config.theme);
3147
+ if (!showReadTime || !readTime) return null;
3148
+ var timeToRead = get_1(opts, ["localizedTimeToRead"]) || "min read";
3149
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3150
+ "data-test-id": "read-time",
3151
+ className: "arrow-component arr--read-time " + _getClassName("read-time-wrapper ".concat(textColor), _styleModuleImportMap$9)
3152
+ }, /*#__PURE__*/React.createElement("span", {
3153
+ className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
3154
+ }, /*#__PURE__*/React.createElement(Dot, {
3155
+ color: textColor
3156
+ })), /*#__PURE__*/React.createElement("span", null, readTime, " ", timeToRead)));
3157
+ };
3158
+ ReadTime.propTypes = {
3159
+ story: PropTypes.shape({
3160
+ "read-time": PropTypes.number
3161
+ }),
3162
+ opts: PropTypes.shape({
3163
+ showReadTime: PropTypes.bool
3164
+ }),
3165
+ isLightTheme: PropTypes.bool
3166
+ };
3167
+
3168
+ var _styleModuleImportMap$8 = {
3169
+ "./author-with-timestamp.m.css": {
3170
+ "author-time-wrapper": "author-with-timestamp-m_author-time-wrapper__G7_eI",
3171
+ "author-image": "author-with-timestamp-m_author-image__24xrD",
3172
+ "dot": "author-with-timestamp-m_dot__1LHXD",
3173
+ "bottom-fix": "author-with-timestamp-m_bottom-fix__1rWGv",
3174
+ "dash": "author-with-timestamp-m_dash__2L5XC"
3175
+ }
3176
+ };
3177
+ var AuthorWithTime = function AuthorWithTime(_ref) {
3178
+ var story = _ref.story,
3179
+ separator = _ref.separator,
3180
+ isBottom = _ref.isBottom,
3181
+ hideAuthorImage = _ref.hideAuthorImage,
3182
+ prefix = _ref.prefix,
3183
+ _ref$config = _ref.config,
3184
+ config = _ref$config === void 0 ? {} : _ref$config,
3185
+ isLightTheme = _ref.isLightTheme;
3186
+ var configState = useStateValue() || {};
3187
+ var isAuthor = get_1(config, ["showAuthor"], get_1(configState, ["showAuthor"], true));
3188
+ var isTime = get_1(config, ["showTime"], get_1(configState, ["showTime"], true));
3189
+ var isReadTime = get_1(configState, ["showReadTime"], true);
3190
+ var isBottomClasses = isBottom ? "bottom-fix" : "";
3191
+ var seperatorStyle = separator === "dot" ? "dot" : "dash";
3192
+ var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
3193
+
3194
+ var getSeparator = function getSeparator() {
3195
+ if (separator === "divider") {
3196
+ return /*#__PURE__*/React.createElement(Divider, {
3197
+ color: textColor
3198
+ });
3199
+ }
3200
+
3201
+ return /*#__PURE__*/React.createElement(Dot, {
3202
+ color: textColor
3203
+ });
3204
+ };
3205
+
3206
+ var getTimeStamp = function getTimeStamp() {
3207
+ if (!isTime) return null;
3208
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isAuthor && /*#__PURE__*/React.createElement("span", {
3209
+ className: "arr-separator " + _getClassName("".concat(seperatorStyle), _styleModuleImportMap$8)
3210
+ }, getSeparator()), /*#__PURE__*/React.createElement(TimeStamp, {
3211
+ story: story,
3212
+ config: config
3213
+ }), isReadTime && /*#__PURE__*/React.createElement(ReadTime, {
3214
+ story: story,
3215
+ opts: config,
3216
+ isLightTheme: isLightTheme
3217
+ }));
3218
+ };
3219
+
3220
+ return /*#__PURE__*/React.createElement("div", {
3221
+ className: "arr--author-time " + _getClassName("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$8)
3222
+ }, isAuthor ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Author, {
3223
+ story: story,
3224
+ isBottom: true,
3225
+ hideAuthorImage: hideAuthorImage,
3226
+ prefix: prefix
3227
+ }), getTimeStamp()) : getTimeStamp());
3228
+ };
3229
+ AuthorWithTime.propTypes = {
3230
+ story: PropTypes.object,
3231
+
3232
+ /** Style of separator between the Author & Timestamp */
3233
+ separator: PropTypes.oneOf(["dot", "divider"]),
3234
+
3235
+ /** hide the author image */
3236
+ hideAuthorImage: PropTypes.bool,
3237
+ // fix author and time at the end
3238
+ isBottom: PropTypes.bool,
3239
+ // fix prefix before the author name
3240
+ prefix: PropTypes.string,
3241
+ config: PropTypes.object,
3242
+ isLightTheme: PropTypes.bool
3243
+ };
3244
+ AuthorWithTime.defaultProps = {
3245
+ separator: "dot",
3246
+ isBottom: false,
3247
+ hideAuthorImage: true,
3248
+ prefix: "",
3249
+ isLightTheme: false
3250
+ };
3251
+
3252
+ var _styleModuleImportMap$7 = {
3253
+ "./collection-name.m.css": {
3254
+ "collection": "collection-name-m_collection__JD6sx",
3255
+ "collection-borderLeft": "collection-name-m_collection-borderLeft__3Dznk",
3256
+ "border-left": "collection-name-m_border-left__3_pYw",
3257
+ "collection-borderBottomFull": "collection-name-m_collection-borderBottomFull__Dkq3K",
3258
+ "collection-borderBottom": "collection-name-m_collection-borderBottom__2rdQM",
3259
+ "collection-crossLine": "collection-name-m_collection-crossLine__1sIpN",
3260
+ "border-bottom": "collection-name-m_border-bottom__1MnlV",
3261
+ "dark": "collection-name-m_dark__nMe5H",
3262
+ "light": "collection-name-m_light__1vFDN"
3263
+ }
3264
+ };
3265
+ var CollectionNameBase = function CollectionNameBase(_ref) {
3266
+ var _ref$collectionNameBo = _ref.collectionNameBorderColor,
3267
+ collectionNameBorderColor = _ref$collectionNameBo === void 0 ? "" : _ref$collectionNameBo,
3268
+ collection = _ref.collection,
3269
+ config = _ref.config,
3270
+ collectionNameTemplate = _ref.collectionNameTemplate,
3271
+ headerLevel = _ref.headerLevel,
3272
+ _ref$customCollection = _ref.customCollectionName,
3273
+ customCollectionName = _ref$customCollection === void 0 ? "" : _ref$customCollection,
3274
+ _ref$navigate = _ref.navigate,
3275
+ navigate = _ref$navigate === void 0 ? true : _ref$navigate;
3276
+ var collectionTitle = useStateValue() || {};
3277
+ var showRowTitle = get_1(collectionTitle, ["showRowTitle"], true);
3278
+ var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
3279
+ var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
3280
+ var slug = navigate && collection && getSlug(collection, config) || "";
3281
+ var collectionName = customCollectionName || collection.name || "";
3282
+ var textColor = getTextColor(collectionTitle.theme);
3283
+ var HeaderTag = "h" + headerLevel;
3284
+ var CollectionNameBorderColor = rgbToHex(collectionNameBorderColor);
3285
+ var borderBottomFullStyle = templateStyle.includes("collection-borderBottomFull") ? "4px solid ".concat(CollectionNameBorderColor) : "";
3286
+
3287
+ var borderBottomStyle = function borderBottomStyle() {
3288
+ return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/React.createElement("div", {
3289
+ className: "collection-name-m_border-bottom__1MnlV",
3290
+ style: {
3291
+ borderBottom: "4px solid ".concat(CollectionNameBorderColor)
3292
+ }
3293
+ }) : "";
3294
+ };
3295
+
3296
+ var isMobile = clientWidth("mobile");
3297
+
3298
+ var getBorderHeight = function getBorderHeight() {
3299
+ if (isMobile) {
3300
+ switch (headerLevel) {
3301
+ case "1":
3302
+ return "32px";
3303
+
3304
+ case "2":
3305
+ return "24px";
3306
+
3307
+ case "3":
3308
+ return "20px";
3309
+
3310
+ case "4":
3311
+ return "18px";
3312
+
3313
+ case "5":
3314
+ return "16px";
3315
+
3316
+ case "6":
3317
+ return "16px";
3318
+
3319
+ default:
3320
+ return "20px";
3321
+ }
3322
+ }
3323
+
3324
+ switch (headerLevel) {
3325
+ case "1":
3326
+ return "40px";
3327
+
3328
+ case "2":
3329
+ return "32px";
3330
+
3331
+ case "3":
3332
+ return "24px";
3333
+
3334
+ case "4":
3335
+ return "20px";
3336
+
3337
+ case "5":
3338
+ return "18px";
3339
+
3340
+ case "6":
3341
+ return "16px";
3342
+
3343
+ default:
3344
+ return "24px";
3345
+ }
3346
+ };
3347
+
3348
+ return /*#__PURE__*/React.createElement(React.Fragment, null, showRowTitle && collectionName && /*#__PURE__*/React.createElement("div", {
3349
+ style: {
3350
+ borderBottom: borderBottomFullStyle
3351
+ },
3352
+ "data-test-id": "collection-name",
3353
+ className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$7)
3354
+ }, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React.createElement("span", {
3355
+ className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
3356
+ style: {
3357
+ color: CollectionNameBorderColor,
3358
+ fontSize: getBorderHeight()
3359
+ }
3360
+ }), slug && !slug.includes(undefined) ? /*#__PURE__*/React.createElement(Link, {
3361
+ href: slug,
3362
+ "aria-label": "collection-name"
3363
+ }, /*#__PURE__*/React.createElement(HeaderTag, null, collectionName)) : /*#__PURE__*/React.createElement(HeaderTag, null, collectionName), borderBottomStyle()));
3364
+ };
3365
+ CollectionNameBase.propTypes = {
3366
+ /** Collection name border color */
3367
+ collectionNameBorderColor: PropTypes$1.string,
3368
+
3369
+ /** The Collection Object from the API response */
3370
+ collection: PropTypes$1.object,
3371
+
3372
+ /** The publisher config from the API response */
3373
+ config: PropTypes$1.object,
3374
+
3375
+ /** The style template for the component */
3376
+ collectionNameTemplate: PropTypes$1.oneOf(["", "borderLeft", "borderBottom", "crossLine", "borderBottomFull"]),
3377
+
3378
+ /** Header tags ranging h1-h6, where h[headerLevel] */
3379
+ headerLevel: PropTypes$1.string,
3380
+ customCollectionName: PropTypes$1.string,
3381
+ navigate: PropTypes$1.bool
3382
+ };
3383
+ CollectionNameBase.defaultProps = {
3384
+ collectionNameTemplate: "",
3385
+ headerLevel: "3"
3386
+ };
3387
+
3388
+ function mapStateToProps(state) {
3389
+ return {
3390
+ config: get_1(state, ["qt", "config"], {})
3391
+ };
3392
+ }
3393
+
3394
+ var CollectionName = connect(mapStateToProps)(CollectionNameBase);
3395
+
3396
+ var CrownIcon = function CrownIcon(_ref) {
3397
+ var height = _ref.height,
3398
+ width = _ref.width,
3399
+ _ref$color = _ref.color,
3400
+ color = _ref$color === void 0 ? "#D8D8D8" : _ref$color,
3401
+ positionTop = _ref.positionTop;
3402
+ return /*#__PURE__*/React.createElement("svg", {
3403
+ xmlns: "http://www.w3.org/2000/svg",
3404
+ width: width,
3405
+ height: height,
3406
+ viewBox: "0 0 40 40",
3407
+ style: {
3408
+ position: "relative",
3409
+ top: positionTop
3410
+ }
3411
+ }, /*#__PURE__*/React.createElement("g", {
3412
+ fill: "none",
3413
+ fillRule: "evenodd",
3414
+ stroke: "none",
3415
+ strokeWidth: "1"
3416
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
3417
+ transform: "translate(8 8)"
3418
+ }, /*#__PURE__*/React.createElement("path", {
3419
+ d: "M0 0H24V24H0z"
3420
+ }), /*#__PURE__*/React.createElement("g", {
3421
+ fill: color,
3422
+ fillRule: "nonzero",
3423
+ transform: "translate(0 2)"
3424
+ }, /*#__PURE__*/React.createElement("path", {
3425
+ d: "M21.043 19.553c0-.743-.601-1.344-1.344-1.344h-15.4a1.343 1.343 0 100 2.688h15.4c.743 0 1.344-.603 1.344-1.344zM1.598 8.673c.022 0 .042 0 .064-.003l2.131 7.713h16.411l2.132-7.713c.022 0 .041.003.063.003a1.599 1.599 0 10-1.52-1.108L17.025 9.82 12.882 2.95a1.599 1.599 0 10-1.765 0L6.976 9.82 3.121 7.565a1.599 1.599 0 10-1.523 1.107z"
3426
+ }))))));
3427
+ };
3428
+ CrownIcon.propTypes = {
3429
+ height: PropTypes.string,
3430
+ width: PropTypes.string,
3431
+ color: PropTypes.string,
3432
+ positionTop: PropTypes.string
3433
+ };
3434
+
3435
+ var KeyIcon = function KeyIcon(_ref) {
3436
+ var height = _ref.height,
3437
+ width = _ref.width,
3438
+ _ref$color = _ref.color,
3439
+ color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
3440
+ positionTop = _ref.positionTop;
3441
+ return /*#__PURE__*/React.createElement("svg", {
3442
+ xmlns: "http://www.w3.org/2000/svg",
3443
+ width: width,
3444
+ height: height,
3445
+ viewBox: "0 0 40 40",
3446
+ style: {
3447
+ position: "relative",
3448
+ top: positionTop
3449
+ }
3450
+ }, /*#__PURE__*/React.createElement("g", {
3451
+ fill: "none",
3452
+ fillRule: "evenodd",
3453
+ stroke: "none",
3454
+ strokeWidth: "1"
3455
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
3456
+ transform: "translate(8 8)"
3457
+ }, /*#__PURE__*/React.createElement("path", {
3458
+ d: "M0 0H24V24H0z"
3459
+ }), /*#__PURE__*/React.createElement("path", {
3460
+ fill: color,
3461
+ fillRule: "nonzero",
3462
+ d: "M12.71 4.364A6.54 6.54 0 000 6.545a6.54 6.54 0 0012.71 2.182h4.745v4.364h4.363V8.727H24V4.364H12.71zM6.544 8.727a2.181 2.181 0 110-4.362 2.181 2.181 0 010 4.362z",
3463
+ transform: "translate(0 5)"
3464
+ })))));
3465
+ };
3466
+ KeyIcon.propTypes = {
3467
+ height: PropTypes.string,
3468
+ width: PropTypes.string,
3469
+ color: PropTypes.string,
3470
+ positionTop: PropTypes.string
3471
+ };
3472
+
3473
+ var LockIcon = function LockIcon(_ref) {
3474
+ var height = _ref.height,
3475
+ width = _ref.width,
3476
+ _ref$color = _ref.color,
3477
+ color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
3478
+ positionTop = _ref.positionTop;
3479
+ return /*#__PURE__*/React.createElement("svg", {
3480
+ xmlns: "http://www.w3.org/2000/svg",
3481
+ width: width,
3482
+ height: height,
3483
+ viewBox: "0 0 40 40",
3484
+ style: {
3485
+ position: "relative",
3486
+ top: positionTop
3487
+ }
3488
+ }, /*#__PURE__*/React.createElement("g", {
3489
+ fill: "none",
3490
+ fillRule: "evenodd",
3491
+ stroke: "none",
3492
+ strokeWidth: "1"
3493
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
3494
+ transform: "translate(8 8)"
3495
+ }, /*#__PURE__*/React.createElement("path", {
3496
+ d: "M0 0H24V24H0z"
3497
+ }), /*#__PURE__*/React.createElement("g", {
3498
+ fill: color,
3499
+ fillRule: "nonzero",
3500
+ transform: "translate(3)"
3501
+ }, /*#__PURE__*/React.createElement("path", {
3502
+ d: "M15.692 9h-.747V6c0-3.31-2.681-6-5.978-6C5.67 0 2.989 2.69 2.989 6v3h-.747A2.249 2.249 0 000 11.25v10.5A2.249 2.249 0 002.242 24h13.45a2.249 2.249 0 002.242-2.25v-10.5A2.249 2.249 0 0015.692 9zM4.982 6c0-2.206 1.787-4 3.985-4s3.985 1.794 3.985 4v3h-7.97V6z"
3503
+ }))))));
3504
+ };
3505
+ LockIcon.propTypes = {
3506
+ height: PropTypes.string,
3507
+ width: PropTypes.string,
3508
+ color: PropTypes.string,
3509
+ positionTop: PropTypes.string
3510
+ };
3511
+
3512
+ var StarIcon = function StarIcon(_ref) {
3513
+ var width = _ref.width,
3514
+ height = _ref.height,
3515
+ _ref$color = _ref.color,
3516
+ color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
3517
+ _ref$positionTop = _ref.positionTop,
3518
+ positionTop = _ref$positionTop === void 0 ? "" : _ref$positionTop;
3519
+ return /*#__PURE__*/React.createElement("svg", {
3520
+ xmlns: "http://www.w3.org/2000/svg",
3521
+ width: width,
3522
+ height: height,
3523
+ viewBox: "0 0 40 40",
3524
+ style: {
3525
+ position: "relative",
3526
+ top: positionTop
3527
+ }
3528
+ }, /*#__PURE__*/React.createElement("g", {
3529
+ fill: "none",
3530
+ fillRule: "evenodd",
3531
+ stroke: "none",
3532
+ strokeWidth: "1"
3533
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
3534
+ fill: color,
3535
+ d: "M20 26L12.946577 29.7082039 14.2936609 21.854102 8.5873218 16.2917961 16.4732885 15.145898 20 8 23.5267115 15.145898 31.4126782 16.2917961 25.7063391 21.854102 27.053423 29.7082039z"
3536
+ }))));
3537
+ };
3538
+ StarIcon.propTypes = {
3539
+ height: PropTypes.string,
3540
+ width: PropTypes.string,
3541
+ color: PropTypes.string,
3542
+ positionTop: PropTypes.string
3543
+ };
3544
+
3545
+ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
3546
+ var width = _ref.width,
3547
+ height = _ref.height,
3548
+ color = _ref.color,
3549
+ iconType = _ref.iconType,
3550
+ positionTop = _ref.positionTop;
3551
+
3552
+ switch (iconType) {
3553
+ case "crown":
3554
+ return /*#__PURE__*/React.createElement(CrownIcon, {
3555
+ width: width,
3556
+ height: height,
3557
+ color: color,
3558
+ positionTop: positionTop
3559
+ });
3560
+
3561
+ case "lock":
3562
+ return /*#__PURE__*/React.createElement(LockIcon, {
3563
+ width: width,
3564
+ height: height,
3565
+ color: color,
3566
+ positionTop: positionTop
3567
+ });
3568
+
3569
+ case "key":
3570
+ return /*#__PURE__*/React.createElement(KeyIcon, {
3571
+ width: width,
3572
+ height: height,
3573
+ color: color,
3574
+ positionTop: positionTop
3575
+ });
3576
+
3577
+ default:
3578
+ return /*#__PURE__*/React.createElement(StarIcon, {
3579
+ width: width,
3580
+ height: height,
3581
+ color: color,
3582
+ positionTop: positionTop
3583
+ });
3584
+ }
3585
+ };
3586
+ PremiumStoryIcon.propTypes = {
3587
+ width: PropTypes.string,
3588
+ height: PropTypes.string,
3589
+ color: PropTypes.string,
3590
+ iconType: PropTypes.string,
3591
+ positionTop: PropTypes.string
3592
+ };
3593
+
3594
+ function LiveIcon() {
3595
+ return /*#__PURE__*/React.createElement("svg", {
3596
+ className: "live-icon",
3597
+ xmlns: "http://www.w3.org/2000/svg",
3598
+ width: "25",
3599
+ height: "24",
3600
+ viewBox: "0 0 25 24"
3601
+ }, /*#__PURE__*/React.createElement("path", {
3602
+ fill: "#ff5858",
3603
+ d: "M12 18a6 6 0 110-12 6 6 0 010 12zm0 2.5a8.5 8.5 0 110-17 8.5 8.5 0 010 17zm0-1a7.5 7.5 0 100-15 7.5 7.5 0 000 15z"
3604
+ }));
3605
+ }
3606
+
3607
+ var _styleModuleImportMap$6 = {
3608
+ "./headline.m.css": {
3609
+ "wrapper": "headline-m_wrapper__3nUmh",
3610
+ "headline": "headline-m_headline__3_NhV",
3611
+ "dark": "headline-m_dark__en3hW",
3612
+ "light": "headline-m_light__3lKJB"
3613
+ }
3614
+ };
3615
+ var Headline = function Headline(_ref) {
3616
+ var story = _ref.story,
3617
+ headerLevel = _ref.headerLevel,
3618
+ _ref$premiumStoryIcon = _ref.premiumStoryIconConfig,
3619
+ premiumStoryIconConfig = _ref$premiumStoryIcon === void 0 ? {} : _ref$premiumStoryIcon,
3620
+ isLink = _ref.isLink;
3621
+ var configData = useStateValue() || {};
3622
+ var _premiumStoryIconConf = premiumStoryIconConfig.iconColor,
3623
+ iconColor = _premiumStoryIconConf === void 0 ? "#F7B500" : _premiumStoryIconConf,
3624
+ _premiumStoryIconConf2 = premiumStoryIconConfig.iconStyle,
3625
+ iconStyle = _premiumStoryIconConf2 === void 0 ? "star" : _premiumStoryIconConf2,
3626
+ _premiumStoryIconConf3 = premiumStoryIconConfig.enablePremiumStoryIcon,
3627
+ enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
3628
+ _premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
3629
+ showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
3630
+ var alternateHeadline = get_1(story, ["alternative", "home", "default", "headline"]);
3631
+ var premiumStory = enablePremiumStoryIcon && get_1(story, ["access"]) === "subscription";
3632
+ var headline = alternateHeadline || story.headline;
3633
+ var HeaderTag = "h" + headerLevel;
3634
+
3635
+ var positionHeadline = function positionHeadline() {
3636
+ switch (parseInt(headerLevel)) {
3637
+ case 1:
3638
+ return "-2px";
3639
+
3640
+ case 2:
3641
+ return "2px";
3642
+
3643
+ case 3:
3644
+ return "4px";
3645
+
3646
+ case 4:
3647
+ return "5px";
3648
+
3649
+ default:
3650
+ return "6px";
3651
+ }
3652
+ };
3653
+
3654
+ var textColor = getTextColor(configData.theme);
3655
+ var wrapperClass = premiumStory ? "wrapper" : "";
3656
+ var iconSize = "24px";
3657
+ var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !get_1(story, ["metadata", "is-closed"], false);
3658
+ return /*#__PURE__*/React.createElement("div", {
3659
+ "data-test-id": "headline",
3660
+ className: "arrow-component arr--headline " + _getClassName(wrapperClass, _styleModuleImportMap$6)
3661
+ }, premiumStory && /*#__PURE__*/React.createElement(PremiumStoryIcon, {
3662
+ width: iconSize,
3663
+ height: iconSize,
3664
+ color: iconColor,
3665
+ iconType: iconStyle,
3666
+ positionTop: positionHeadline()
3667
+ }), isLink ? /*#__PURE__*/React.createElement(Link, {
3668
+ href: getStoryUrl(story, "/".concat(story.slug)),
3669
+ externalLink: isExternalStory(story),
3670
+ "aria-label": "headline"
3671
+ }, /*#__PURE__*/React.createElement(HeaderTag, {
3672
+ className: _getClassName("headline ".concat(textColor), _styleModuleImportMap$6)
3673
+ }, enableLiveIcon && /*#__PURE__*/React.createElement(LiveIcon, null), headline)) : /*#__PURE__*/React.createElement(HeaderTag, {
3674
+ className: _getClassName("headline ".concat(textColor), _styleModuleImportMap$6)
3675
+ }, enableLiveIcon && /*#__PURE__*/React.createElement(LiveIcon, null), headline));
3676
+ };
3677
+ Headline.propTypes = {
3678
+ /** The Story Object from the API response */
3679
+ story: PropTypes.object.isRequired,
3680
+
3681
+ /** Header tags ranging h1-h6, where h[headerLevel] */
3682
+ headerLevel: PropTypes.string,
3683
+ premiumStoryIconConfig: PropTypes.shape({
3684
+ iconColor: PropTypes.string,
3685
+ iconType: PropTypes.string,
3686
+ enablePremiumStoryIcon: PropTypes.bool
3687
+ }),
3688
+ isLink: PropTypes.bool
3689
+ };
3690
+ Headline.defaultProps = {
3691
+ headerLevel: "6",
3692
+ isLink: true
3693
+ };
3694
+
3695
+ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
3696
+ var _ref$width = _ref.width,
3697
+ width = _ref$width === void 0 ? 40 : _ref$width,
3698
+ _ref$height = _ref.height,
3699
+ height = _ref$height === void 0 ? 30 : _ref$height,
3700
+ _ref$iconColor = _ref.iconColor,
3701
+ iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
3702
+ return /*#__PURE__*/React.createElement("svg", {
3703
+ width: width,
3704
+ height: height,
3705
+ viewBox: "0 0 102 76",
3706
+ version: "1.1"
3707
+ }, /*#__PURE__*/React.createElement("g", {
3708
+ id: "demo-home-copy",
3709
+ stroke: "none",
3710
+ strokeWidth: "1",
3711
+ fill: "none",
3712
+ fillRule: "evenodd",
3713
+ transform: "translate(-377.000000, -314.000000)"
3714
+ }, /*#__PURE__*/React.createElement("g", {
3715
+ id: "Group-13",
3716
+ transform: "translate(377.000000, 314.000000)"
3717
+ }, /*#__PURE__*/React.createElement("path", {
3718
+ 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",
3719
+ id: "Combined-Shape",
3720
+ fill: iconColor,
3721
+ fillRule: "nonzero"
3722
+ }), /*#__PURE__*/React.createElement("rect", {
3723
+ id: "Rectangle-19",
3724
+ stroke: iconColor,
3725
+ strokeWidth: "3",
3726
+ x: "1.5",
3727
+ y: "1.5",
3728
+ width: "99",
3729
+ height: "73",
3730
+ rx: "3"
3731
+ }))));
3732
+ };
3733
+ ImageFallbackIcon.propTypes = {
3734
+ width: PropTypes.object,
3735
+ height: PropTypes.object,
3736
+ iconColor: PropTypes.object
3737
+ };
3738
+
3739
+ var imageFallback = function imageFallback() {
3740
+ return /*#__PURE__*/React.createElement("div", {
3741
+ className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
3742
+ }, /*#__PURE__*/React.createElement("figure", {
3743
+ className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
3744
+ }, /*#__PURE__*/React.createElement(ImageFallbackIcon, null)));
3745
+ };
3746
+
3747
+ var FallbackImage = function FallbackImage(_ref) {
3748
+ var slug = _ref.slug;
3749
+
3750
+ if (slug) {
3751
+ return /*#__PURE__*/React.createElement(Link, {
3752
+ href: slug,
3753
+ "aria-label": "image-fallback"
3754
+ }, imageFallback());
3755
+ } else {
3756
+ return imageFallback();
3757
+ }
3758
+ };
3759
+ FallbackImage.propTypes = {
3760
+ slug: PropTypes.string
3761
+ };
3762
+
3763
+ var HyperLinkIcon = function HyperLinkIcon() {
3764
+ return /*#__PURE__*/React.createElement("svg", {
3765
+ xmlns: "http://www.w3.org/2000/svg",
3766
+ width: "36",
3767
+ height: "28"
3768
+ }, /*#__PURE__*/React.createElement("g", {
3769
+ fill: "none",
3770
+ fillRule: "evenodd"
3771
+ }, /*#__PURE__*/React.createElement("rect", {
3772
+ width: "36",
3773
+ height: "28",
3774
+ fill: "#3D6FCF",
3775
+ rx: "4"
3776
+ }), /*#__PURE__*/React.createElement("path", {
3777
+ stroke: "#FFF",
3778
+ strokeLinecap: "round",
3779
+ strokeLinejoin: "round",
3780
+ strokeWidth: "2",
3781
+ d: "M22 14.667v4c0 .736-.597 1.333-1.333 1.333h-7.334A1.333 1.333 0 0112 18.667v-7.334c0-.736.597-1.333 1.333-1.333h4M20 8h4v4m-7.333 3.333L24 8"
3782
+ })));
3783
+ };
3784
+
3785
+ var HyperLink = function HyperLink(_ref) {
3786
+ var _ref$hyperLink = _ref.hyperLink,
3787
+ hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
3788
+ if (!hyperLink) return null;
3789
+ return /*#__PURE__*/React.createElement(Link, {
3790
+ href: hyperLink,
3791
+ "aria-label": "hyperlink-button",
3792
+ className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
3793
+ target: "_blank",
3794
+ rel: "noopener noreferrer"
3795
+ }, /*#__PURE__*/React.createElement(HyperLinkIcon, null));
3796
+ };
3797
+ HyperLink.propTypes = {
3798
+ hyperLink: PropTypes.string
3799
+ };
3800
+
3801
+ var _styleModuleImportMap$5 = {
3802
+ "./hero-image.m.css": {
3803
+ "hero-image": "hero-image-m_hero-image__3lraV",
3804
+ "right-padding": "hero-image-m_right-padding__1LkCe",
3805
+ "left-padding": "hero-image-m_left-padding__pYRAj",
3806
+ "right-padding-mob": "hero-image-m_right-padding-mob__3-uOU",
3807
+ "placeholder": "hero-image-m_placeholder__1omCm",
3808
+ "hero-image-mob": "hero-image-m_hero-image-mob__13JJp",
3809
+ "with-padding": "hero-image-m_with-padding__324G_",
3810
+ "image": "hero-image-m_image__1mz0U"
3811
+ }
3812
+ };
3813
+ var HeroImage = function HeroImage(_ref) {
3814
+ var story = _ref.story,
3815
+ FullBleed = _ref.FullBleed,
3816
+ aspectRatio = _ref.aspectRatio,
3817
+ defaultWidth = _ref.defaultWidth,
3818
+ widths = _ref.widths,
3819
+ isHorizontal = _ref.isHorizontal,
3820
+ isHorizontalMobile = _ref.isHorizontalMobile,
3821
+ isHorizontalWithImageLast = _ref.isHorizontalWithImageLast,
3822
+ defaultFallback = _ref.defaultFallback,
3823
+ isStoryPageImage = _ref.isStoryPageImage,
3824
+ config = _ref.config;
3825
+
3826
+ var _ref2 = useStateValue() || {},
3827
+ _ref2$fallbackImageUr = _ref2.fallbackImageUrl,
3828
+ fallbackImageUrl = _ref2$fallbackImageUr === void 0 ? "" : _ref2$fallbackImageUr;
3829
+
3830
+ var _config$StoryTemplate = config.StoryTemplateIcon,
3831
+ StoryTemplateIcon = _config$StoryTemplate === void 0 ? function () {
3832
+ return null;
3833
+ } : _config$StoryTemplate;
3834
+ var showImagePlaceholder = useSelector(function (state) {
3835
+ return get_1(state, ["qt", "config", "showPlaceholder"]);
3836
+ });
3837
+ var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
3838
+ var fullBleed = FullBleed ? "" : "with-padding";
3839
+ var heroImageClass = "hero-image";
3840
+ if (isHorizontal) heroImageClass = "right-padding";else if (isHorizontalWithImageLast) heroImageClass = "left-padding";
3841
+ var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
3842
+
3843
+ var getPadding = function getPadding(aspectRatio) {
3844
+ var _aspectRatio = _slicedToArray(aspectRatio, 2),
3845
+ height = _aspectRatio[0],
3846
+ width = _aspectRatio[1];
3847
+
3848
+ if (height > 0 && width > 0) {
3849
+ var padding = width / height * 100;
3850
+ return padding;
3851
+ }
3852
+
3853
+ return 0;
3854
+ };
3855
+
3856
+ var _aspectRatio2 = _slicedToArray(aspectRatio, 2),
3857
+ mobileAspectRatio = _aspectRatio2[0],
3858
+ _aspectRatio2$ = _aspectRatio2[1],
3859
+ desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
3860
+
3861
+ var isMobile = clientWidth("mobile");
3862
+ var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
3863
+ var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
3864
+ var slug = get_1(story, ["hero-image-s3-key"]) || get_1(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
3865
+ var hyperLink = get_1(story, ["hero-image-hyperlink"], "");
3866
+
3867
+ var fallbackImage = function fallbackImage() {
3868
+ if (!slug) {
3869
+ if (fallbackImageUrl && !isStoryPageImage) {
3870
+ return /*#__PURE__*/React.createElement("figure", {
3871
+ style: {
3872
+ paddingTop: imagePadding + "%"
3873
+ },
3874
+ className: "arr--responsive-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$5)
3875
+ }, /*#__PURE__*/React.createElement("img", {
3876
+ className: "qt-image",
3877
+ "data-src": "".concat(fallbackImageUrl),
3878
+ alt: "image-fallback"
3879
+ }));
3880
+ }
3881
+
3882
+ return /*#__PURE__*/React.createElement(React.Fragment, null, defaultFallback ? /*#__PURE__*/React.createElement("div", {
3883
+ "data-test-id": "arr--fallback-hero-image",
3884
+ style: {
3885
+ paddingTop: imagePadding + "%"
3886
+ },
3887
+ className: "arr--fallback-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$5)
3888
+ }, /*#__PURE__*/React.createElement(StoryTemplateIcon, {
3889
+ storyTemplate: story["story-template"]
3890
+ }), /*#__PURE__*/React.createElement(FallbackImage, null)) : null);
3891
+ }
3892
+
3893
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("figure", {
3894
+ style: {
3895
+ paddingTop: imagePadding + "%"
3896
+ },
3897
+ className: "arr--responsive-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$5)
3898
+ }, /*#__PURE__*/React.createElement(StoryTemplateIcon, {
3899
+ storyTemplate: story["story-template"]
3900
+ }), /*#__PURE__*/React.createElement(ResponsiveHeroImage, {
3901
+ story: story,
3902
+ aspectRatio: imageAspectRatio,
3903
+ defaultWidth: defaultWidth,
3904
+ widths: widths,
3905
+ imgParams: {
3906
+ auto: ["format", "compress"],
3907
+ fit: "max"
3908
+ }
3909
+ })), isStoryPageImage && hyperLink && /*#__PURE__*/React.createElement(HyperLink, {
3910
+ hyperLink: hyperLink
3911
+ }));
3912
+ };
3913
+
3914
+ return story && (isStoryPageImage ? /*#__PURE__*/React.createElement("div", {
3915
+ "data-test-id": "arr--hero-image",
3916
+ className: "arr--hero-image " + _getClassName("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$5)
3917
+ }, fallbackImage()) : /*#__PURE__*/React.createElement(Link, {
3918
+ "data-test-id": "arr--hero-image",
3919
+ href: getStoryUrl(story, "/".concat(story.slug)),
3920
+ externalLink: isExternalStory(story),
3921
+ "aria-label": "fallback-hero-image",
3922
+ className: "arr--hero-image " + _getClassName("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$5)
3923
+ }, fallbackImage()));
3924
+ };
3925
+ HeroImage.propTypes = {
3926
+ /** The Story Object from the API response */
3927
+ story: PropTypes.object.isRequired,
3928
+
3929
+ /** Removes the Hero Image padding for the image to bleed over the margin */
3930
+ FullBleed: PropTypes.bool,
3931
+
3932
+ /** The default width for the image, in case the browser does not support srcset */
3933
+ defaultWidth: PropTypes.number,
3934
+
3935
+ /** The list of available widths */
3936
+ widths: PropTypes.array,
3937
+ // fatch the correct hero image
3938
+ aspectRatio: PropTypes.array,
3939
+ // Hints for the browser to choose the best size
3940
+
3941
+ /** This prop is responsible for adding padding-right of the image and remove padding bottom of the image */
3942
+ isHorizontal: PropTypes.bool,
3943
+
3944
+ /** This prop is responsible for adding padding-bottom in desktop and padding-right in mobile */
3945
+ isHorizontalMobile: PropTypes.bool,
3946
+ // this prop is responsive for rendering fallback image on story page
3947
+ defaultFallback: PropTypes.bool,
3948
+ isHorizontalWithImageLast: PropTypes.bool,
3949
+ isStoryPageImage: PropTypes.bool,
3950
+ config: PropTypes.object
3951
+ };
3952
+ HeroImage.defaultProps = {
3953
+ FullBleed: true,
3954
+ aspectRatio: [[1, 1], [16, 9]],
3955
+ defaultWidth: 480,
3956
+ widths: [250, 480, 640],
3957
+ isHorizontal: false,
3958
+ isHorizontalMobile: false,
3959
+ defaultFallback: true,
3960
+ isStoryPageImage: false,
3961
+ isHorizontalWithImageLast: false,
3962
+ config: {}
3963
+ };
3964
+
3965
+ function _defineProperty(obj, key, value) {
3966
+ if (key in obj) {
3967
+ Object.defineProperty(obj, key, {
3968
+ value: value,
3969
+ enumerable: true,
3970
+ configurable: true,
3971
+ writable: true
3972
+ });
3973
+ } else {
3974
+ obj[key] = value;
3975
+ }
3976
+
3977
+ return obj;
3978
+ }
3979
+
3980
+ var _styleModuleImportMap$4 = {
3981
+ "./load-more.m.css": {
3982
+ "button": "load-more-m_button__1mmf1",
3983
+ "default": "load-more-m_default__2_k4V",
3984
+ "dark": "load-more-m_dark__3dfzb",
3985
+ "light": "load-more-m_light__ePZQI"
3986
+ }
3987
+ };
3988
+
3989
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3990
+
3991
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3992
+ var LoadmoreButton = function LoadmoreButton(_ref) {
3993
+ var _ref$config = _ref.config,
3994
+ config = _ref$config === void 0 ? {} : _ref$config,
3995
+ collection = _ref.collection,
3996
+ _ref$template = _ref.template,
3997
+ template = _ref$template === void 0 ? "SubsequentLoadCount" : _ref$template,
3998
+ onClick = _ref.onClick,
3999
+ navigate = _ref.navigate,
4000
+ qtConfig = _ref.qtConfig;
4001
+ var _config$showButton = config.showButton,
4002
+ showButton = _config$showButton === void 0 ? true : _config$showButton,
4003
+ _config$buttonText = config.buttonText,
4004
+ buttonText = _config$buttonText === void 0 ? "Read More" : _config$buttonText,
4005
+ _config$theme = config.theme,
4006
+ theme = _config$theme === void 0 ? "" : _config$theme,
4007
+ _config$customUrlPath = config.customUrlPath,
4008
+ customUrlPath = _config$customUrlPath === void 0 ? "" : _config$customUrlPath;
4009
+ if (!showButton) return null;
4010
+ var textColor = getTextColor(theme);
4011
+ var slug = customUrlPath ? "/".concat(customUrlPath) : generateNavigateSlug(collection, _objectSpread(_objectSpread({}, qtConfig), config));
4012
+ return template === "SubsequentLoadCount" ? /*#__PURE__*/React.createElement("div", {
4013
+ onClick: onClick,
4014
+ "data-test-id": "load-more",
4015
+ className: "arr--button " + _getClassName("button ".concat(textColor, " default"), _styleModuleImportMap$4)
4016
+ }, buttonText) : /*#__PURE__*/React.createElement(LinkBase, {
4017
+ href: slug,
4018
+ navigateTo: navigate,
4019
+ "data-test-id": "load-more",
4020
+ "aria-label": "load-more"
4021
+ }, /*#__PURE__*/React.createElement("div", {
4022
+ className: "arr--button " + _getClassName("button ".concat(textColor, " default"), _styleModuleImportMap$4)
4023
+ }, buttonText));
4024
+ };
4025
+ LoadmoreButton.propTypes = {
4026
+ collection: PropTypes.object,
4027
+ template: PropTypes.string,
4028
+ config: PropTypes.object,
4029
+ onClick: PropTypes.func,
4030
+ navigate: PropTypes.func,
4031
+ qtConfig: PropTypes.object
4032
+ };
4033
+
4034
+ var _styleModuleImportMap$3 = {
4035
+ "./section.m.css": {
4036
+ "section": "section-m_section__2N4S3",
4037
+ "section-borderBottomSml": "section-m_section-borderBottomSml__2GNbo",
4038
+ "border-bottom": "section-m_border-bottom__3cRoD",
4039
+ "section-borderLeft": "section-m_section-borderLeft__3hKVj",
4040
+ "border-left": "section-m_border-left__2oUyp",
4041
+ "section-solid": "section-m_section-solid__1vB1Q",
4042
+ "dark": "section-m_dark__1r3C4",
4043
+ "light": "section-m_light__306hW"
4044
+ }
4045
+ };
4046
+ var SectionTag = function SectionTag(_ref) {
4047
+ var story = _ref.story,
4048
+ _ref$template = _ref.template,
4049
+ template = _ref$template === void 0 ? "" : _ref$template,
4050
+ _ref$borderColor = _ref.borderColor,
4051
+ borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
4052
+ isLightTheme = _ref.isLightTheme;
4053
+ var config = useStateValue() || {};
4054
+ var isSection = get_1(config, ["showSection"], true);
4055
+ var templateFromRowContext = get_1(config, ["sectionTagTemplate"]);
4056
+ var section = get_1(story, ["sections", 0], "");
4057
+ var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
4058
+ var getUrl = section ? section["section-url"] : "/";
4059
+ var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
4060
+ var textColor = isLightTheme ? "light" : getTextColor(colorToApplyContrast);
4061
+ var sectionTagBorderColor = rgbToHex(borderColor);
4062
+ var templateStyle = supportedTemplates.includes(template) ? "section section-".concat(template) : "section";
4063
+
4064
+ if (templateFromRowContext) {
4065
+ templateStyle = supportedTemplates.includes(templateFromRowContext) ? "section section-".concat(templateFromRowContext) : "section";
4066
+ }
4067
+
4068
+ if (!isSection) return null;
4069
+ return /*#__PURE__*/React.createElement(Link, {
4070
+ href: getUrl,
4071
+ className: "arrow-component arr--section-name",
4072
+ "aria-label": "section-name"
4073
+ }, /*#__PURE__*/React.createElement("div", {
4074
+ "data-test-id": "sectionTag",
4075
+ style: {
4076
+ backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
4077
+ },
4078
+ className: "section-tag arrow-component " + _getClassName("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$3)
4079
+ }, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React.createElement("span", {
4080
+ className: "section-m_border-left__2oUyp",
4081
+ style: {
4082
+ color: sectionTagBorderColor
4083
+ }
4084
+ }), section["display-name"] || section["name"], /*#__PURE__*/React.createElement("div", {
4085
+ className: "section-m_border-bottom__3cRoD",
4086
+ style: {
4087
+ backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
4088
+ }
4089
+ })));
4090
+ };
4091
+ SectionTag.propTypes = {
4092
+ /** The Story Object from the API response */
4093
+ story: PropTypes.object.isRequired,
4094
+
4095
+ /** The style template for section tag */
4096
+ template: PropTypes.oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
4097
+ borderColor: PropTypes.string,
4098
+ solidBorderColor: PropTypes.string,
4099
+ isLightTheme: PropTypes.bool
4100
+ };
4101
+ SectionTag.defaultProps = {
4102
+ template: "",
4103
+ isLightTheme: false
4104
+ };
4105
+
4106
+ var _styleModuleImportMap$2 = {
4107
+ "./subheadline.m.css": {
4108
+ "subheadline": "subheadline-m_subheadline__3fd7z",
4109
+ "dark": "subheadline-m_dark__28u00",
4110
+ "light": "subheadline-m_light__2YUOe"
4111
+ }
4112
+ };
4113
+ var Subheadline = function Subheadline(_ref) {
4114
+ var story = _ref.story,
4115
+ _ref$truncateChars = _ref.truncateChars,
4116
+ truncateChars = _ref$truncateChars === void 0 ? 200 : _ref$truncateChars,
4117
+ lineClamp = _ref.lineClamp,
4118
+ _ref$clazzName = _ref.clazzName,
4119
+ clazzName = _ref$clazzName === void 0 ? "" : _ref$clazzName,
4120
+ forceShowAtom = _ref.forceShowAtom,
4121
+ showFullContent = _ref.showFullContent;
4122
+ var config = useStateValue() || {};
4123
+ var subheadline = forceShowAtom || get_1(config, ["showSubheadline"], true);
4124
+ if (!subheadline) return null;
4125
+ var textColor = getTextColor(config.theme);
4126
+ return /*#__PURE__*/React.createElement("div", {
4127
+ style: {
4128
+ WebkitLineClamp: lineClamp
4129
+ },
4130
+ "data-test-id": "subheadline",
4131
+ className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") + _getClassName("subheadline ".concat(textColor), _styleModuleImportMap$2)
4132
+ }, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
4133
+ };
4134
+ Subheadline.propTypes = {
4135
+ /** The Story Object from the API response */
4136
+ story: PropTypes.object.isRequired,
4137
+ // Restricts the number of lines for subheadline.
4138
+ lineClamp: PropTypes.number,
4139
+
4140
+ /** Number of characters to truncate the subheadline */
4141
+ truncateChars: PropTypes.number,
4142
+ clazzName: PropTypes.string,
4143
+ forceShowAtom: PropTypes.bool,
4144
+ showFullContent: PropTypes.bool
4145
+ };
4146
+ Subheadline.defaultProps = {
4147
+ forceShowAtom: false,
4148
+ showFullContent: false
4149
+ };
4150
+
4151
+ var _styleModuleImportMap$1 = {
4152
+ "./storycard.m.css": {
4153
+ "author-timestamp-wrapper": "storycard-m_author-timestamp-wrapper__20yjp",
4154
+ "default-card": "storycard-m_default-card__1-POn",
4155
+ "horizontal-card": "storycard-m_horizontal-card___7afz",
4156
+ "backgroung-img": "storycard-m_backgroung-img__1FMJT",
4157
+ "content-overlap": "storycard-m_content-overlap__1yNHR",
4158
+ "border-full": "storycard-m_border-full__1nhy7",
4159
+ "light": "storycard-m_light__3EhXN",
4160
+ "dark": "storycard-m_dark__2wCTq",
4161
+ "border-bottom": "storycard-m_border-bottom__2_E-I",
4162
+ "border-boxShadow": "storycard-m_border-boxShadow__2-k3Z",
4163
+ "center-align": "storycard-m_center-align__1Sn8-",
4164
+ "content-bottom": "storycard-m_content-bottom__1QHeC",
4165
+ "content-full": "storycard-m_content-full__2zJmU",
4166
+ "content-boxShadow": "storycard-m_content-boxShadow__2IAWZ",
4167
+ "hero-image": "storycard-m_hero-image__1H3MB",
4168
+ "right-padding": "storycard-m_right-padding__12-lQ",
4169
+ "horizontal-mob": "storycard-m_horizontal-mob__17JG2",
4170
+ "content": "storycard-m_content__1Q9vq",
4171
+ "border-default": "storycard-m_border-default__PEZ1x",
4172
+ "card": "storycard-m_card__KJwRa",
4173
+ "horizontal-image-last": "storycard-m_horizontal-image-last__3o6LY"
4174
+ }
4175
+ };
4176
+ var StoryCard = function StoryCard(_ref) {
4177
+ var story = _ref.story,
4178
+ children = _ref.children,
4179
+ isHorizontal = _ref.isHorizontal,
4180
+ aspectRatio = _ref.aspectRatio,
4181
+ border = _ref.border,
4182
+ useImageAsBackground = _ref.useImageAsBackground,
4183
+ bgImgContentOverlap = _ref.bgImgContentOverlap,
4184
+ theme = _ref.theme,
4185
+ borderColor = _ref.borderColor,
4186
+ isHorizontalMobile = _ref.isHorizontalMobile,
4187
+ centerAlign = _ref.centerAlign,
4188
+ headerLevel = _ref.headerLevel,
4189
+ hideAuthorImage = _ref.hideAuthorImage,
4190
+ prefix = _ref.prefix,
4191
+ config = _ref.config,
4192
+ isHorizontalWithImageLast = _ref.isHorizontalWithImageLast;
4193
+ if (!story || isEmpty(story)) return /*#__PURE__*/React.createElement("div", null);
4194
+ var borderOptions = ["default", "full", "bottom", "boxShadow"];
4195
+ var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : ""; // TODO optimize conditions
4196
+
4197
+ var horizontalCardStyle = "default-card";
4198
+ if (isHorizontal) horizontalCardStyle = "horizontal-card";else if (isHorizontalWithImageLast) horizontalCardStyle = "horizontal-image-last";
4199
+ var bgImageClasses = useImageAsBackground ? "backgroung-img" : "";
4200
+ var bgImgContentOverlapClass = bgImgContentOverlap ? "content-overlap" : "";
4201
+ var textColor = getTextColor(theme);
4202
+ var horizontalMobileClasses = isHorizontalMobile ? "horizontal-mob" : "";
4203
+ var defaultStorycard = /*#__PURE__*/React.createElement(DefaultStoryCard, {
4204
+ story: story,
4205
+ aspectRatio: aspectRatio,
4206
+ border: border,
4207
+ isHorizontalMobile: isHorizontalMobile,
4208
+ isHorizontal: isHorizontal,
4209
+ centerAlign: centerAlign,
4210
+ headerLevel: headerLevel,
4211
+ borderColor: borderColor,
4212
+ hideAuthorImage: hideAuthorImage,
4213
+ prefix: prefix,
4214
+ config: config,
4215
+ isHorizontalWithImageLast: isHorizontalWithImageLast
4216
+ });
4217
+ return /*#__PURE__*/React.createElement("div", {
4218
+ "data-test-id": "story-card",
4219
+ style: {
4220
+ backgroundColor: theme,
4221
+ color: textColor
4222
+ },
4223
+ className: "arr--story-card " + _getClassName("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap$1)
4224
+ }, children || defaultStorycard);
4225
+ };
4226
+
4227
+ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
4228
+ var story = _ref2.story;
4229
+ _ref2.border;
4230
+ var isHorizontal = _ref2.isHorizontal,
4231
+ aspectRatio = _ref2.aspectRatio,
4232
+ headerLevel = _ref2.headerLevel,
4233
+ _ref2$isHorizontalMob = _ref2.isHorizontalMobile,
4234
+ isHorizontalMobile = _ref2$isHorizontalMob === void 0 ? false : _ref2$isHorizontalMob,
4235
+ _ref2$centerAlign = _ref2.centerAlign,
4236
+ centerAlign = _ref2$centerAlign === void 0 ? false : _ref2$centerAlign,
4237
+ borderColor = _ref2.borderColor,
4238
+ hideAuthorImage = _ref2.hideAuthorImage,
4239
+ prefix = _ref2.prefix,
4240
+ isHorizontalWithImageLast = _ref2.isHorizontalWithImageLast,
4241
+ config = _ref2.config;
4242
+ var alignment = centerAlign ? "center-align" : "";
4243
+ var SectionTagborderColor = rgbToHex(borderColor);
4244
+ var _config$localizationC = config.localizationConfig,
4245
+ localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
4246
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isHorizontal ? /*#__PURE__*/React.createElement(HeroImage, {
4247
+ config: config,
4248
+ story: story,
4249
+ isHorizontal: true,
4250
+ isHorizontalMobile: isHorizontalMobile,
4251
+ aspectRatio: aspectRatio
4252
+ }) : isHorizontalWithImageLast ? /*#__PURE__*/React.createElement(HeroImage, {
4253
+ config: config,
4254
+ story: story,
4255
+ isHorizontalWithImageLast: true,
4256
+ isHorizontalMobile: isHorizontalMobile,
4257
+ aspectRatio: aspectRatio
4258
+ }) : /*#__PURE__*/React.createElement(HeroImage, {
4259
+ story: story,
4260
+ config: config,
4261
+ isHorizontalMobile: isHorizontalMobile,
4262
+ aspectRatio: aspectRatio
4263
+ }), /*#__PURE__*/React.createElement("div", {
4264
+ className: "arr--story-content " + _getClassName("content ".concat(alignment), _styleModuleImportMap$1)
4265
+ }, /*#__PURE__*/React.createElement(SectionTag, {
4266
+ story: story,
4267
+ borderColor: SectionTagborderColor
4268
+ }), /*#__PURE__*/React.createElement(Headline, {
4269
+ story: story,
4270
+ headerLevel: headerLevel,
4271
+ premiumStoryIconConfig: config
4272
+ }), /*#__PURE__*/React.createElement(AuthorWithTime, {
4273
+ config: localizationConfig,
4274
+ story: story,
4275
+ isBottom: true,
4276
+ prefix: prefix,
4277
+ hideAuthorImage: hideAuthorImage
4278
+ }), /*#__PURE__*/React.createElement(Subheadline, {
4279
+ story: story
4280
+ })));
4281
+ };
4282
+
4283
+ DefaultStoryCard.propTypes = {
4284
+ story: PropTypes.object.isRequired,
4285
+ border: PropTypes.oneOfType([PropTypes.string]),
4286
+ isBottom: PropTypes.bool,
4287
+ isHorizontal: PropTypes.bool,
4288
+ aspectRatio: PropTypes.oneOfType([PropTypes.array]),
4289
+ isHorizontalMobile: PropTypes.bool,
4290
+ centerAlign: PropTypes.bool,
4291
+ headerLevel: PropTypes.string,
4292
+ borderColor: PropTypes.string,
4293
+ hideAuthorImage: PropTypes.bool,
4294
+ prefix: PropTypes.string,
4295
+ config: PropTypes.object,
4296
+ isHorizontalWithImageLast: PropTypes.bool
4297
+ };
4298
+ StoryCard.propTypes = {
4299
+ /** The Story Object from the API response */
4300
+ story: PropTypes.object.isRequired,
4301
+ children: PropTypes.node,
4302
+
4303
+ /** Flip the Story Card to Horizonal mode */
4304
+ isHorizontal: PropTypes.bool,
4305
+
4306
+ /** Add border to the Story Card */
4307
+ border: PropTypes.oneOfType([PropTypes.string]),
4308
+ // story card with background image
4309
+ useImageAsBackground: PropTypes.bool,
4310
+ // story card content overlap with image
4311
+ bgImgContentOverlap: PropTypes.bool,
4312
+
4313
+ /** add aspect ratio for hero image */
4314
+ aspectRatio: PropTypes.oneOfType([PropTypes.array]),
4315
+
4316
+ /** add theme(dark /light/custom color) for storycard */
4317
+ theme: PropTypes.string,
4318
+
4319
+ /** flip the story card mobile design horizontal */
4320
+ isHorizontalMobile: PropTypes.bool,
4321
+ // make content center align in desktop and left align in mobile
4322
+ centerAlign: PropTypes.bool,
4323
+ headerLevel: PropTypes.string,
4324
+ borderColor: PropTypes.string,
4325
+ // handle author image through storycard
4326
+ hideAuthorImage: PropTypes.bool,
4327
+ // handle author prefix through storycard
4328
+ prefix: PropTypes.string,
4329
+ config: PropTypes.object,
4330
+ isHorizontalWithImageLast: PropTypes.bool
4331
+ };
4332
+ StoryCard.defaultProps = {
4333
+ isHorizontal: false,
4334
+ isHorizontalMobile: false,
4335
+ border: "default",
4336
+ theme: "",
4337
+ centerAlign: false,
4338
+ borderColor: "",
4339
+ isHorizontalWithImageLast: false
4340
+ };
4341
+
4342
+ var _styleModuleImportMap = {
4343
+ "./storycardContent.m.css": {
4344
+ "wrapper": "storycardContent-m_wrapper__TEmfA",
4345
+ "horizontal-content-wrapper": "storycardContent-m_horizontal-content-wrapper__NgpuC",
4346
+ "border-full": "storycardContent-m_border-full__2km37"
4347
+ }
4348
+ };
4349
+ var StorycardContent = function StorycardContent(_ref) {
4350
+ var story = _ref.story,
4351
+ children = _ref.children,
4352
+ theme = _ref.theme,
4353
+ border = _ref.border,
4354
+ isHorizontalMobile = _ref.isHorizontalMobile,
4355
+ headerLevel = _ref.headerLevel,
4356
+ borderColor = _ref.borderColor,
4357
+ config = _ref.config;
4358
+ var textColor = getTextColor(theme);
4359
+ var borderOptions = ["full"];
4360
+ var SectionTagborderColor = rgbToHex(borderColor);
4361
+ var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : "";
4362
+ var horizontalCard = isHorizontalMobile ? "horizontal-content-wrapper" : "";
4363
+ return /*#__PURE__*/React.createElement("div", {
4364
+ "data-test-id": "story-card-content",
4365
+ style: {
4366
+ backgroundColor: theme,
4367
+ color: textColor
4368
+ },
4369
+ className: "arr--content-wrapper " + _getClassName("wrapper ".concat(borderTemplate, " ").concat(horizontalCard), _styleModuleImportMap)
4370
+ }, children || /*#__PURE__*/React.createElement(DefaultStoryCardContent, {
4371
+ story: story,
4372
+ headerLevel: headerLevel,
4373
+ isHorizontalMobile: isHorizontalMobile,
4374
+ borderColor: SectionTagborderColor,
4375
+ config: config
4376
+ }));
4377
+ };
4378
+
4379
+ var DefaultStoryCardContent = function DefaultStoryCardContent(_ref2) {
4380
+ var story = _ref2.story,
4381
+ headerLevel = _ref2.headerLevel,
4382
+ borderColor = _ref2.borderColor,
4383
+ _ref2$config = _ref2.config,
4384
+ config = _ref2$config === void 0 ? {} : _ref2$config;
4385
+ var SectionTagborderColor = rgbToHex(borderColor);
4386
+ var _config$localizationC = config.localizationConfig,
4387
+ localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
4388
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionTag, {
4389
+ story: story,
4390
+ borderColor: SectionTagborderColor
4391
+ }), /*#__PURE__*/React.createElement(Headline, {
4392
+ story: story,
4393
+ headerLevel: headerLevel,
4394
+ premiumStoryIconConfig: config
4395
+ }), /*#__PURE__*/React.createElement(AuthorWithTime, {
4396
+ config: localizationConfig,
4397
+ story: story
4398
+ }));
4399
+ };
4400
+
4401
+ DefaultStoryCardContent.propTypes = {
4402
+ story: PropTypes.object.isRequired,
4403
+ border: PropTypes.string,
4404
+ theme: PropTypes.string,
4405
+ isHorizontalMobile: PropTypes.bool,
4406
+ headerLevel: PropTypes.string,
4407
+ borderColor: PropTypes.string,
4408
+ config: PropTypes.object
4409
+ };
4410
+ StorycardContent.propTypes = {
4411
+ story: PropTypes.object.isRequired,
4412
+ children: PropTypes.node,
4413
+ theme: PropTypes.string,
4414
+ border: PropTypes.string,
4415
+ isHorizontalMobile: PropTypes.bool,
4416
+ headerLevel: PropTypes.string,
4417
+ borderColor: PropTypes.string,
4418
+ config: PropTypes.object
4419
+ };
4420
+
4421
+ var LoadMoreTarget = function LoadMoreTarget(_ref) {
4422
+ var collection = _ref.collection,
4423
+ componentName = _ref.componentName,
4424
+ offset = _ref.offset,
4425
+ limit = _ref.limit;
4426
+ return /*#__PURE__*/React.createElement("div", {
4427
+ id: "ELM-".concat(collection.id),
4428
+ "data-collection-slug": collection["slug"],
4429
+ "data-component-name": componentName,
4430
+ "data-collection-offset": offset,
4431
+ "data-collection-limit": limit
4432
+ });
4433
+ };
4434
+ LoadMoreTarget.propTypes = {
4435
+ collection: PropTypes.shape({
4436
+ id: PropTypes.string,
4437
+ slug: PropTypes.string
4438
+ }),
4439
+ componentName: PropTypes.string,
4440
+ offset: PropTypes.number,
4441
+ limit: PropTypes.number
4442
+ };
4443
+
4444
+ var loadMore = function loadMore(_ref) {
4445
+ var isLoading = _ref.isLoading,
4446
+ storyItems = _ref.storyItems,
4447
+ getMoreStories = _ref.getMoreStories,
4448
+ _ref$subsequentLoadCo = _ref.subsequentLoadCount,
4449
+ subsequentLoadCount = _ref$subsequentLoadCo === void 0 ? 8 : _ref$subsequentLoadCo;
4450
+ if (isLoading) return;
4451
+ var limit = subsequentLoadCount;
4452
+ var offset = storyItems.length;
4453
+ getMoreStories(offset, limit);
4454
+ };
4455
+
4456
+ var OneColStoryListBase = function OneColStoryListBase(_ref2) {
4457
+ var collection = _ref2.collection,
4458
+ _ref2$config = _ref2.config,
4459
+ config = _ref2$config === void 0 ? {} : _ref2$config,
4460
+ getMoreStories = _ref2.getMoreStories,
4461
+ isLoadMoreVisible = _ref2.isLoadMoreVisible,
4462
+ isLoading = _ref2.isLoading,
4463
+ isolatedLoadMore = _ref2.isolatedLoadMore;
4464
+ var storyItems = collectionToStories(collection);
4465
+ if (!storyItems.length) return null;
4466
+ var _config$collectionNam = config.collectionNameBorderColor,
4467
+ collectionNameBorderColor = _config$collectionNam === void 0 ? "" : _config$collectionNam,
4468
+ _config$borderColor = config.borderColor,
4469
+ borderColor = _config$borderColor === void 0 ? "" : _config$borderColor,
4470
+ _config$theme = config.theme,
4471
+ theme = _config$theme === void 0 ? "" : _config$theme,
4472
+ _config$border = config.border,
4473
+ border = _config$border === void 0 ? "" : _config$border,
4474
+ _config$slotConfig = config.slotConfig,
4475
+ slotConfig = _config$slotConfig === void 0 ? [] : _config$slotConfig,
4476
+ _config$collectionNam2 = config.collectionNameTemplate,
4477
+ collectionNameTemplate = _config$collectionNam2 === void 0 ? "" : _config$collectionNam2,
4478
+ _config$footerSlotCon = config.footerSlotConfig,
4479
+ footerSlotConfig = _config$footerSlotCon === void 0 ? {} : _config$footerSlotCon,
4480
+ _config$footerButton = config.footerButton,
4481
+ footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
4482
+ _config$localizationC = config.localizationConfig,
4483
+ localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC,
4484
+ _config$subsequentLoa = config.subsequentLoadCount,
4485
+ subsequentLoadCount = _config$subsequentLoa === void 0 ? 8 : _config$subsequentLoa;
4486
+ var footerSlot = footerSlotConfig.footerSlot;
4487
+
4488
+ var _get = get_1(slotConfig, [0], {}),
4489
+ type = _get.type,
4490
+ component = _get.component;
4491
+
4492
+ var dispatch = useDispatch();
4493
+ var qtConfig = useSelector(function (state) {
4494
+ return get_1(state, ["qt", "config"], {});
4495
+ });
4496
+
4497
+ var getLoadMore = function getLoadMore(opts) {
4498
+ if (!isLoadMoreVisible) return null;
4499
+
4500
+ if (isolatedLoadMore) {
4501
+ return /*#__PURE__*/React.createElement(LoadMoreTarget, {
4502
+ collection: collection,
4503
+ componentName: "OneColStoryList",
4504
+ offset: storyItems.length,
4505
+ limit: subsequentLoadCount
4506
+ });
4507
+ }
4508
+
4509
+ var url = generateNavigateSlug(collection, qtConfig);
4510
+ return /*#__PURE__*/React.createElement(ProgressiveHydration, null, /*#__PURE__*/React.createElement(LoadmoreButton, {
4511
+ config: config,
4512
+ collection: collection,
4513
+ template: footerButton,
4514
+ onClick: function onClick() {
4515
+ return loadMore(opts);
4516
+ },
4517
+ navigate: function navigate() {
4518
+ return navigateTo(dispatch, url);
4519
+ },
4520
+ qtConfig: qtConfig
4521
+ }));
4522
+ };
4523
+
4524
+ var footerSlotComp = footerSlot ? footerSlot() : null;
4525
+
4526
+ var borderHandler = function borderHandler(story) {
4527
+ switch (border) {
4528
+ case "bottom":
4529
+ return /*#__PURE__*/React.createElement("div", {
4530
+ className: "one-col-story-list-m_one-col-border-bottom__13nPb"
4531
+ }, /*#__PURE__*/React.createElement(StoryCard, {
4532
+ story: story,
4533
+ theme: theme,
4534
+ headerLevel: "4",
4535
+ isHorizontal: true,
4536
+ border: border,
4537
+ aspectRatio: [[1, 1], [4, 3]],
4538
+ borderColor: borderColor,
4539
+ prefix: "By",
4540
+ config: config
4541
+ }));
4542
+
4543
+ case "full":
4544
+ return /*#__PURE__*/React.createElement("div", {
4545
+ className: "one-col-story-list-m_one-col-border-full__3PSl0"
4546
+ }, /*#__PURE__*/React.createElement(StoryCard, {
4547
+ story: story,
4548
+ border: border,
4549
+ theme: theme,
4550
+ isHorizontal: true,
4551
+ borderColor: borderColor
4552
+ }, /*#__PURE__*/React.createElement(HeroImage, {
4553
+ story: story,
4554
+ isHorizontal: true,
4555
+ aspectRatio: [[1, 1], [4, 3]]
4556
+ }), /*#__PURE__*/React.createElement("div", {
4557
+ className: "one-col-story-list-m_story-card-content-wrapper__1baqS"
4558
+ }, /*#__PURE__*/React.createElement(StorycardContent, {
4559
+ story: story,
4560
+ borderColor: borderColor,
4561
+ config: config
4562
+ }, /*#__PURE__*/React.createElement(SectionTag, {
4563
+ story: story
4564
+ }), /*#__PURE__*/React.createElement(Headline, {
4565
+ story: story,
4566
+ headerLevel: "4",
4567
+ premiumStoryIconConfig: config
4568
+ }), /*#__PURE__*/React.createElement(Subheadline, {
4569
+ story: story
4570
+ }), /*#__PURE__*/React.createElement(AuthorWithTime, {
4571
+ config: localizationConfig,
4572
+ story: story,
4573
+ prefix: "By"
4574
+ })))));
4575
+
4576
+ default:
4577
+ return /*#__PURE__*/React.createElement("div", {
4578
+ className: "one-col-story-list-m_one-col-border-default__2BDg7"
4579
+ }, /*#__PURE__*/React.createElement(StoryCard, {
4580
+ story: story,
4581
+ theme: theme,
4582
+ headerLevel: "4",
4583
+ isHorizontal: true,
4584
+ border: border,
4585
+ aspectRatio: [[1, 1], [4, 3]],
4586
+ borderColor: borderColor,
4587
+ prefix: "By",
4588
+ config: config
4589
+ }));
4590
+ }
4591
+ };
4592
+
4593
+ var textColor = getTextColor(theme);
4594
+ return /*#__PURE__*/React.createElement("div", {
4595
+ className: "full-width-with-padding arrow-component",
4596
+ "data-test-id": "one-col-story-list",
4597
+ style: {
4598
+ backgroundColor: theme,
4599
+ color: textColor
4600
+ }
4601
+ }, /*#__PURE__*/React.createElement("div", {
4602
+ className: "one-col-story-list-m_one-col-story-list-wrapper__ICvTq"
4603
+ }, /*#__PURE__*/React.createElement(CollectionName, {
4604
+ collection: collection,
4605
+ collectionNameTemplate: collectionNameTemplate,
4606
+ collectionNameBorderColor: collectionNameBorderColor
4607
+ }), /*#__PURE__*/React.createElement("div", {
4608
+ className: "one-col-story-list-m_wrapper__38qTp",
4609
+ style: {
4610
+ backgroundColor: theme,
4611
+ color: textColor
4612
+ }
4613
+ }, /*#__PURE__*/React.createElement("div", {
4614
+ className: "one-col-story-list-m_one-col-first-story__1aC6i"
4615
+ }, storyItems.slice(0, 1).map(function (story, index) {
4616
+ return /*#__PURE__*/React.createElement("div", {
4617
+ key: "default-".concat(index)
4618
+ }, borderHandler(story));
4619
+ })), /*#__PURE__*/React.createElement("div", {
4620
+ className: "one-col-story-list-m_one-col-story-list__3d6Bp"
4621
+ }, storyItems.slice(1).map(function (story, index) {
4622
+ return /*#__PURE__*/React.createElement("div", {
4623
+ key: "default-".concat(index)
4624
+ }, borderHandler(story));
4625
+ })), /*#__PURE__*/React.createElement("div", {
4626
+ className: "one-col-story-list-m_one-col-ads__UN_hF"
4627
+ }, getSlot(type, component, function () {
4628
+ return null;
4629
+ }, function () {
4630
+ return null;
4631
+ }))), /*#__PURE__*/React.createElement("div", {
4632
+ className: "one-col-story-list-m_footer-ad-wrapper__NGgvp"
4633
+ }, getLoadMore({
4634
+ isLoading: isLoading,
4635
+ storyItems: storyItems,
4636
+ getMoreStories: getMoreStories,
4637
+ subsequentLoadCount: subsequentLoadCount
4638
+ }), /*#__PURE__*/React.createElement("div", {
4639
+ className: "one-col-story-list-m_ad-wrapper__3_cNc"
4640
+ }, footerSlotComp))));
4641
+ };
4642
+ OneColStoryListBase.propTypes = {
4643
+ /** collection is the array of objects which is returning by API */
4644
+ collection: PropTypes.object.isRequired,
4645
+
4646
+ /** The config for the Row */
4647
+ config: PropTypes.shape({
4648
+ borderColor: PropTypes.string,
4649
+ theme: PropTypes.string,
4650
+ border: PropTypes.string,
4651
+ footerButton: PropTypes.string,
4652
+ // row title style
4653
+ collectionNameTemplate: PropTypes.string,
4654
+ // row title style colour
4655
+ collectionNameBorderColor: PropTypes.string,
4656
+ subsequentLoadCount: PropTypes.number
4657
+ }),
4658
+ getMoreStories: PropTypes.func,
4659
+ isLoadMoreVisible: PropTypes.bool,
4660
+ isLoading: PropTypes.bool,
4661
+ isolatedLoadMore: PropTypes.bool
4662
+ };
4663
+ OneColStoryListBase.defaultProps = {
4664
+ getMoreStories: function getMoreStories() {},
4665
+ isLoadMoreVisible: true,
4666
+ isLoading: false
4667
+ };
4668
+ var OneColStoryList = StateProvider(OneColStoryListBase);
4669
+
4670
+ export { OneColStoryList, OneColStoryListBase };