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