@mjhls/mjh-framework 1.0.848 → 1.0.850-affiliatefix-v1

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 (182) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD300x250.js +1 -1
  3. package/dist/cjs/AD300x250x600.js +1 -1
  4. package/dist/cjs/AD728x90.js +1 -1
  5. package/dist/cjs/ADFloatingFooter.js +1 -1
  6. package/dist/cjs/ADGutter.js +1 -1
  7. package/dist/cjs/ADSkyscraper.js +1 -1
  8. package/dist/cjs/ADSponsoredResources.js +1 -1
  9. package/dist/cjs/ADWebcast.js +1 -1
  10. package/dist/cjs/ADWelcome.js +1 -1
  11. package/dist/cjs/AccordionPanel.js +2 -2
  12. package/dist/cjs/AdSlot.js +1 -69
  13. package/dist/cjs/AdSlotsProvider.js +5 -15
  14. package/dist/cjs/AlgoliaSearch.js +14 -37
  15. package/dist/cjs/ArticleCarousel.js +1 -1
  16. package/dist/cjs/ArticleProgramLandingPage.js +4 -4
  17. package/dist/cjs/ArticleSeriesLandingPage.js +3 -3
  18. package/dist/cjs/ArticleSeriesListing.js +3 -3
  19. package/dist/cjs/Auth.js +2 -2
  20. package/dist/cjs/AuthWrapper.js +1564 -290
  21. package/dist/cjs/CMEDeck.js +1 -1
  22. package/dist/cjs/Column3.js +1 -1
  23. package/dist/cjs/DeckContent.js +2 -2
  24. package/dist/cjs/DeckQueue.js +3 -3
  25. package/dist/cjs/EventsDeck.js +1 -1
  26. package/dist/cjs/ExternalResources.js +4 -4
  27. package/dist/cjs/Feature.js +1 -1
  28. package/dist/cjs/GridContent.js +45 -164
  29. package/dist/cjs/HamMagazine.js +6 -6
  30. package/dist/cjs/HorizontalArticleListing.js +4 -4
  31. package/dist/cjs/HorizontalHero.js +2 -2
  32. package/dist/cjs/IssueLanding.js +6 -6
  33. package/dist/cjs/LeftNav.js +1 -1
  34. package/dist/cjs/MasterDeck.js +3 -3
  35. package/dist/cjs/MediaSeriesLanding.js +120 -20
  36. package/dist/cjs/NavMagazine.js +6 -6
  37. package/dist/cjs/NavNative.js +9 -9
  38. package/dist/cjs/OncliveHero.js +1 -1
  39. package/dist/cjs/PartnerDetailListing.js +12 -7
  40. package/dist/cjs/PdfDownload.js +2 -2
  41. package/dist/cjs/PubSection.js +3 -3
  42. package/dist/cjs/QueueDeckExpanded.js +3 -3
  43. package/dist/cjs/RecentNews.js +2 -2
  44. package/dist/cjs/SeriesListingDeck.js +2 -2
  45. package/dist/cjs/{SeriesSlider-cbab9f0f.js → SeriesSlider-34c6cc2b.js} +1 -1
  46. package/dist/cjs/{SocialSearchComponent-ecb4f972.js → SocialSearchComponent-948138c7.js} +3 -3
  47. package/dist/cjs/TaxonomyDescription.js +4 -4
  48. package/dist/cjs/TemplateNormal.js +6 -6
  49. package/dist/cjs/Ustream.js +4 -4
  50. package/dist/cjs/VideoProgramLandingPage.js +4 -4
  51. package/dist/cjs/VideoSeriesLandingPage.js +3 -3
  52. package/dist/cjs/VideoSeriesListing.js +5 -7
  53. package/dist/cjs/View.js +7 -88
  54. package/dist/cjs/YoutubeGroup.js +1 -1
  55. package/dist/cjs/getQuery.js +2 -2
  56. package/dist/cjs/getSerializers.js +4 -4
  57. package/dist/{esm/iconBase-602d52fe.js → cjs/iconBase-be4097c0.js} +33 -8
  58. package/dist/cjs/{index-572bb6bc.js → index-060c5d65.js} +34 -91
  59. package/dist/cjs/{index-8041a4eb.js → index-50be6759.js} +15 -9
  60. package/dist/cjs/{index.esm-974f47d9.js → index.esm-00a6aade.js} +1 -1
  61. package/dist/cjs/{index.esm-8123cf40.js → index.esm-2bb721c8.js} +1 -1
  62. package/dist/cjs/{index.esm-44f3e2d0.js → index.esm-c1e16606.js} +1 -1
  63. package/dist/cjs/{index.esm-05850a2f.js → index.esm-f27f80d9.js} +1 -1
  64. package/dist/cjs/index.js +14 -13
  65. package/dist/cjs/{main-025fdc78.js → main-f1c77adb.js} +3 -3
  66. package/dist/cjs/typeof-1358762e.js +33 -0
  67. package/dist/esm/AD.js +7 -7
  68. package/dist/esm/AD300x250.js +6 -6
  69. package/dist/esm/AD300x250x600.js +6 -6
  70. package/dist/esm/AD728x90.js +7 -7
  71. package/dist/esm/ADFloatingFooter.js +9 -9
  72. package/dist/esm/ADFooter.js +6 -6
  73. package/dist/esm/ADGutter.js +9 -9
  74. package/dist/esm/{ADInfeed-f20eb524.js → ADInfeed-4bf3b2f9.js} +5 -5
  75. package/dist/esm/ADSkyscraper.js +9 -9
  76. package/dist/esm/ADSponsoredResources.js +9 -9
  77. package/dist/esm/ADWebcast.js +9 -9
  78. package/dist/esm/ADWelcome.js +13 -13
  79. package/dist/esm/{ADlgInfeed-c85a91b1.js → ADlgInfeed-a3377c4a.js} +4 -4
  80. package/dist/esm/AccordionPanel.js +18 -18
  81. package/dist/esm/AdSlot.js +5 -73
  82. package/dist/esm/AdSlotsProvider.js +8 -18
  83. package/dist/esm/AlgoliaSearch.js +224 -247
  84. package/dist/esm/AlphabeticList.js +13 -13
  85. package/dist/esm/ArticleCarousel.js +6 -6
  86. package/dist/esm/ArticleProgramLandingPage.js +17 -17
  87. package/dist/esm/ArticleSeriesLandingPage.js +12 -12
  88. package/dist/esm/ArticleSeriesListing.js +31 -31
  89. package/dist/esm/Auth.js +72 -72
  90. package/dist/esm/AuthWrapper.js +1580 -306
  91. package/dist/esm/{AuthorComponent-5ae7409f.js → AuthorComponent-30aeba69.js} +10 -10
  92. package/dist/esm/{BlockContent-52cf21c5.js → BlockContent-c99c9a8d.js} +3 -3
  93. package/dist/esm/Breadcrumbs.js +11 -11
  94. package/dist/esm/CMEDeck.js +61 -61
  95. package/dist/esm/Column1.js +5 -5
  96. package/dist/esm/Column2.js +12 -12
  97. package/dist/esm/Column3.js +23 -23
  98. package/dist/esm/ConferenceArticleCard.js +13 -13
  99. package/dist/esm/{ConferenceBanner-9162d0ca.js → ConferenceBanner-8792ebd2.js} +4 -4
  100. package/dist/esm/DeckContent.js +49 -49
  101. package/dist/esm/DeckQueue.js +44 -44
  102. package/dist/esm/{Dfp-43f121ff.js → Dfp-2c43d2a0.js} +10 -10
  103. package/dist/esm/EventsDeck.js +64 -64
  104. package/dist/esm/ExternalResources.js +35 -35
  105. package/dist/esm/Feature.js +15 -15
  106. package/dist/esm/ForbesHero.js +26 -26
  107. package/dist/esm/GridContent.js +104 -222
  108. package/dist/esm/GridHero.js +27 -27
  109. package/dist/esm/GroupDeck.js +34 -34
  110. package/dist/esm/HamMagazine.js +86 -86
  111. package/dist/esm/Header.js +8 -8
  112. package/dist/esm/Hero.js +6 -6
  113. package/dist/esm/HighlightenVideo.js +14 -14
  114. package/dist/esm/HorizontalArticleListing.js +31 -31
  115. package/dist/esm/HorizontalHero.js +20 -20
  116. package/dist/esm/IssueContentDeck.js +39 -39
  117. package/dist/esm/IssueDeck.js +33 -33
  118. package/dist/esm/IssueLanding.js +22 -22
  119. package/dist/esm/LeftNav.js +16 -16
  120. package/dist/esm/MasterDeck.js +38 -38
  121. package/dist/esm/MediaSeriesLanding.js +436 -336
  122. package/dist/esm/NavDvm.js +43 -43
  123. package/dist/esm/{NavFooter-c29526b7.js → NavFooter-e27bd93b.js} +12 -12
  124. package/dist/esm/NavMagazine.js +89 -89
  125. package/dist/esm/NavNative.js +83 -83
  126. package/dist/esm/OncliveHero.js +13 -13
  127. package/dist/esm/OncliveLargeHero.js +50 -50
  128. package/dist/esm/PageFilter.js +6 -6
  129. package/dist/esm/PartnerDetailListing.js +68 -63
  130. package/dist/esm/PdfDownload.js +7 -7
  131. package/dist/esm/PopUpModal.js +8 -8
  132. package/dist/esm/PubSection.js +14 -14
  133. package/dist/esm/PubToc.js +5 -5
  134. package/dist/esm/PublicationDeck.js +33 -33
  135. package/dist/esm/PublicationLanding.js +49 -49
  136. package/dist/esm/QueueDeckExpanded.js +246 -246
  137. package/dist/esm/RecentNews.js +18 -18
  138. package/dist/esm/RelatedContent.js +15 -15
  139. package/dist/esm/RelatedTopicsDropdown.js +11 -11
  140. package/dist/esm/RolesDeck.js +13 -13
  141. package/dist/esm/Search.js +5 -5
  142. package/dist/esm/SeriesListingDeck.js +19 -19
  143. package/dist/esm/{SeriesSlider-5c62a578.js → SeriesSlider-5d5c08f4.js} +19 -19
  144. package/dist/esm/SideFooter.js +19 -19
  145. package/dist/esm/SocialIcons.js +7 -7
  146. package/dist/esm/{SocialSearchComponent-cd38ae60.js → SocialSearchComponent-db963c3e.js} +22 -22
  147. package/dist/esm/SocialShare.js +25 -25
  148. package/dist/esm/TaxonomyCard.js +35 -35
  149. package/dist/esm/TaxonomyDescription.js +13 -13
  150. package/dist/esm/TemplateNormal.js +29 -29
  151. package/dist/esm/ThumbnailCard.js +9 -9
  152. package/dist/esm/Ustream.js +18 -18
  153. package/dist/esm/VerticalHero.js +11 -11
  154. package/dist/esm/VideoProgramLandingPage.js +24 -24
  155. package/dist/esm/VideoSeriesCard.js +14 -14
  156. package/dist/esm/VideoSeriesFilter.js +6 -6
  157. package/dist/esm/VideoSeriesLandingPage.js +12 -12
  158. package/dist/esm/VideoSeriesListing.js +49 -51
  159. package/dist/esm/View.js +168 -249
  160. package/dist/esm/YahooHero.js +23 -23
  161. package/dist/esm/YoutubeGroup.js +28 -28
  162. package/dist/esm/{brightcove-react-player-loader.es-b43c695a.js → brightcove-react-player-loader.es-57a70a56.js} +3 -3
  163. package/dist/esm/getQuery.js +2 -2
  164. package/dist/esm/getSerializers.js +8 -8
  165. package/dist/{cjs/iconBase-68959171.js → esm/iconBase-ccc56b97.js} +2 -5
  166. package/dist/esm/{index-aa0e654d.js → index-01d53c17.js} +366 -423
  167. package/dist/esm/{index-35bdcc81.js → index-755f2cc2.js} +4 -4
  168. package/dist/esm/{index-67e1773f.js → index-98ca9cec.js} +15 -9
  169. package/dist/esm/{index-2446af28.js → index-f0fc23eb.js} +3 -3
  170. package/dist/esm/{index.es-c6222053.js → index.es-a6137319.js} +5 -5
  171. package/dist/esm/{index.esm-8016b507.js → index.esm-37268dca.js} +16 -16
  172. package/dist/esm/{index.esm-c6715e80.js → index.esm-9b042655.js} +1 -1
  173. package/dist/esm/{index.esm-a8ff922c.js → index.esm-d4932dea.js} +1 -1
  174. package/dist/esm/{index.esm-3fdda599.js → index.esm-f6156a57.js} +1 -1
  175. package/dist/esm/index.js +40 -39
  176. package/dist/esm/{main-b5c5aac1.js → main-d4165069.js} +19 -19
  177. package/dist/esm/{react-social-icons-91f9716f.js → react-social-icons-9be47857.js} +5 -5
  178. package/dist/esm/typeof-2f07d0e8.js +30 -0
  179. package/dist/esm/{visibility-sensor-f40c2564.js → visibility-sensor-72fd8f8b.js} +2 -2
  180. package/package.json +1 -1
  181. /package/dist/cjs/{ADInfeed-9d179b24.js → ADInfeed-859820d9.js} +0 -0
  182. /package/dist/cjs/{ADlgInfeed-e1ba988c.js → ADlgInfeed-da3a36a6.js} +0 -0
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var slicedToArray = require('./slicedToArray-5d1bc3b3.js');
3
+ var slicedToArray$1 = require('./slicedToArray-5d1bc3b3.js');
4
4
  var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
5
+ var _typeof = require('./typeof-1358762e.js');
5
6
  var React = require('react');
6
7
  var reactBootstrap = require('react-bootstrap');
7
8
  var styleInject_es = require('./style-inject.es-dcee06b6.js');
@@ -14,6 +15,998 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
14
15
 
15
16
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
17
 
18
+ var interopRequireWildcard = _commonjsHelpers.createCommonjsModule(function (module) {
19
+ var _typeof$1 = _typeof._typeof_1["default"];
20
+
21
+ function _getRequireWildcardCache(nodeInterop) {
22
+ if (typeof WeakMap !== "function") return null;
23
+ var cacheBabelInterop = new WeakMap();
24
+ var cacheNodeInterop = new WeakMap();
25
+ return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
26
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
27
+ })(nodeInterop);
28
+ }
29
+
30
+ function _interopRequireWildcard(obj, nodeInterop) {
31
+ if (!nodeInterop && obj && obj.__esModule) {
32
+ return obj;
33
+ }
34
+
35
+ if (obj === null || _typeof$1(obj) !== "object" && typeof obj !== "function") {
36
+ return {
37
+ "default": obj
38
+ };
39
+ }
40
+
41
+ var cache = _getRequireWildcardCache(nodeInterop);
42
+
43
+ if (cache && cache.has(obj)) {
44
+ return cache.get(obj);
45
+ }
46
+
47
+ var newObj = {};
48
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
49
+
50
+ for (var key in obj) {
51
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
52
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
53
+
54
+ if (desc && (desc.get || desc.set)) {
55
+ Object.defineProperty(newObj, key, desc);
56
+ } else {
57
+ newObj[key] = obj[key];
58
+ }
59
+ }
60
+ }
61
+
62
+ newObj["default"] = obj;
63
+
64
+ if (cache) {
65
+ cache.set(obj, newObj);
66
+ }
67
+
68
+ return newObj;
69
+ }
70
+
71
+ module.exports = _interopRequireWildcard;
72
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
73
+ });
74
+
75
+ _commonjsHelpers.unwrapExports(interopRequireWildcard);
76
+
77
+ var interopRequireDefault = _commonjsHelpers.createCommonjsModule(function (module) {
78
+ function _interopRequireDefault(obj) {
79
+ return obj && obj.__esModule ? obj : {
80
+ "default": obj
81
+ };
82
+ }
83
+
84
+ module.exports = _interopRequireDefault;
85
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
86
+ });
87
+
88
+ _commonjsHelpers.unwrapExports(interopRequireDefault);
89
+
90
+ var runtime_1 = _commonjsHelpers.createCommonjsModule(function (module) {
91
+ /**
92
+ * Copyright (c) 2014-present, Facebook, Inc.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ */
97
+
98
+ var runtime = (function (exports) {
99
+
100
+ var Op = Object.prototype;
101
+ var hasOwn = Op.hasOwnProperty;
102
+ var undefined$1; // More compressible than void 0.
103
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
104
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
105
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
106
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
107
+
108
+ function define(obj, key, value) {
109
+ Object.defineProperty(obj, key, {
110
+ value: value,
111
+ enumerable: true,
112
+ configurable: true,
113
+ writable: true
114
+ });
115
+ return obj[key];
116
+ }
117
+ try {
118
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
119
+ define({}, "");
120
+ } catch (err) {
121
+ define = function(obj, key, value) {
122
+ return obj[key] = value;
123
+ };
124
+ }
125
+
126
+ function wrap(innerFn, outerFn, self, tryLocsList) {
127
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
128
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
129
+ var generator = Object.create(protoGenerator.prototype);
130
+ var context = new Context(tryLocsList || []);
131
+
132
+ // The ._invoke method unifies the implementations of the .next,
133
+ // .throw, and .return methods.
134
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
135
+
136
+ return generator;
137
+ }
138
+ exports.wrap = wrap;
139
+
140
+ // Try/catch helper to minimize deoptimizations. Returns a completion
141
+ // record like context.tryEntries[i].completion. This interface could
142
+ // have been (and was previously) designed to take a closure to be
143
+ // invoked without arguments, but in all the cases we care about we
144
+ // already have an existing method we want to call, so there's no need
145
+ // to create a new function object. We can even get away with assuming
146
+ // the method takes exactly one argument, since that happens to be true
147
+ // in every case, so we don't have to touch the arguments object. The
148
+ // only additional allocation required is the completion record, which
149
+ // has a stable shape and so hopefully should be cheap to allocate.
150
+ function tryCatch(fn, obj, arg) {
151
+ try {
152
+ return { type: "normal", arg: fn.call(obj, arg) };
153
+ } catch (err) {
154
+ return { type: "throw", arg: err };
155
+ }
156
+ }
157
+
158
+ var GenStateSuspendedStart = "suspendedStart";
159
+ var GenStateSuspendedYield = "suspendedYield";
160
+ var GenStateExecuting = "executing";
161
+ var GenStateCompleted = "completed";
162
+
163
+ // Returning this object from the innerFn has the same effect as
164
+ // breaking out of the dispatch switch statement.
165
+ var ContinueSentinel = {};
166
+
167
+ // Dummy constructor functions that we use as the .constructor and
168
+ // .constructor.prototype properties for functions that return Generator
169
+ // objects. For full spec compliance, you may wish to configure your
170
+ // minifier not to mangle the names of these two functions.
171
+ function Generator() {}
172
+ function GeneratorFunction() {}
173
+ function GeneratorFunctionPrototype() {}
174
+
175
+ // This is a polyfill for %IteratorPrototype% for environments that
176
+ // don't natively support it.
177
+ var IteratorPrototype = {};
178
+ IteratorPrototype[iteratorSymbol] = function () {
179
+ return this;
180
+ };
181
+
182
+ var getProto = Object.getPrototypeOf;
183
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
184
+ if (NativeIteratorPrototype &&
185
+ NativeIteratorPrototype !== Op &&
186
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
187
+ // This environment has a native %IteratorPrototype%; use it instead
188
+ // of the polyfill.
189
+ IteratorPrototype = NativeIteratorPrototype;
190
+ }
191
+
192
+ var Gp = GeneratorFunctionPrototype.prototype =
193
+ Generator.prototype = Object.create(IteratorPrototype);
194
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
195
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
196
+ GeneratorFunction.displayName = define(
197
+ GeneratorFunctionPrototype,
198
+ toStringTagSymbol,
199
+ "GeneratorFunction"
200
+ );
201
+
202
+ // Helper for defining the .next, .throw, and .return methods of the
203
+ // Iterator interface in terms of a single ._invoke method.
204
+ function defineIteratorMethods(prototype) {
205
+ ["next", "throw", "return"].forEach(function(method) {
206
+ define(prototype, method, function(arg) {
207
+ return this._invoke(method, arg);
208
+ });
209
+ });
210
+ }
211
+
212
+ exports.isGeneratorFunction = function(genFun) {
213
+ var ctor = typeof genFun === "function" && genFun.constructor;
214
+ return ctor
215
+ ? ctor === GeneratorFunction ||
216
+ // For the native GeneratorFunction constructor, the best we can
217
+ // do is to check its .name property.
218
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
219
+ : false;
220
+ };
221
+
222
+ exports.mark = function(genFun) {
223
+ if (Object.setPrototypeOf) {
224
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
225
+ } else {
226
+ genFun.__proto__ = GeneratorFunctionPrototype;
227
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
228
+ }
229
+ genFun.prototype = Object.create(Gp);
230
+ return genFun;
231
+ };
232
+
233
+ // Within the body of any async function, `await x` is transformed to
234
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
235
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
236
+ // meant to be awaited.
237
+ exports.awrap = function(arg) {
238
+ return { __await: arg };
239
+ };
240
+
241
+ function AsyncIterator(generator, PromiseImpl) {
242
+ function invoke(method, arg, resolve, reject) {
243
+ var record = tryCatch(generator[method], generator, arg);
244
+ if (record.type === "throw") {
245
+ reject(record.arg);
246
+ } else {
247
+ var result = record.arg;
248
+ var value = result.value;
249
+ if (value &&
250
+ typeof value === "object" &&
251
+ hasOwn.call(value, "__await")) {
252
+ return PromiseImpl.resolve(value.__await).then(function(value) {
253
+ invoke("next", value, resolve, reject);
254
+ }, function(err) {
255
+ invoke("throw", err, resolve, reject);
256
+ });
257
+ }
258
+
259
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
260
+ // When a yielded Promise is resolved, its final value becomes
261
+ // the .value of the Promise<{value,done}> result for the
262
+ // current iteration.
263
+ result.value = unwrapped;
264
+ resolve(result);
265
+ }, function(error) {
266
+ // If a rejected Promise was yielded, throw the rejection back
267
+ // into the async generator function so it can be handled there.
268
+ return invoke("throw", error, resolve, reject);
269
+ });
270
+ }
271
+ }
272
+
273
+ var previousPromise;
274
+
275
+ function enqueue(method, arg) {
276
+ function callInvokeWithMethodAndArg() {
277
+ return new PromiseImpl(function(resolve, reject) {
278
+ invoke(method, arg, resolve, reject);
279
+ });
280
+ }
281
+
282
+ return previousPromise =
283
+ // If enqueue has been called before, then we want to wait until
284
+ // all previous Promises have been resolved before calling invoke,
285
+ // so that results are always delivered in the correct order. If
286
+ // enqueue has not been called before, then it is important to
287
+ // call invoke immediately, without waiting on a callback to fire,
288
+ // so that the async generator function has the opportunity to do
289
+ // any necessary setup in a predictable way. This predictability
290
+ // is why the Promise constructor synchronously invokes its
291
+ // executor callback, and why async functions synchronously
292
+ // execute code before the first await. Since we implement simple
293
+ // async functions in terms of async generators, it is especially
294
+ // important to get this right, even though it requires care.
295
+ previousPromise ? previousPromise.then(
296
+ callInvokeWithMethodAndArg,
297
+ // Avoid propagating failures to Promises returned by later
298
+ // invocations of the iterator.
299
+ callInvokeWithMethodAndArg
300
+ ) : callInvokeWithMethodAndArg();
301
+ }
302
+
303
+ // Define the unified helper method that is used to implement .next,
304
+ // .throw, and .return (see defineIteratorMethods).
305
+ this._invoke = enqueue;
306
+ }
307
+
308
+ defineIteratorMethods(AsyncIterator.prototype);
309
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
310
+ return this;
311
+ };
312
+ exports.AsyncIterator = AsyncIterator;
313
+
314
+ // Note that simple async functions are implemented on top of
315
+ // AsyncIterator objects; they just return a Promise for the value of
316
+ // the final result produced by the iterator.
317
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
318
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
319
+
320
+ var iter = new AsyncIterator(
321
+ wrap(innerFn, outerFn, self, tryLocsList),
322
+ PromiseImpl
323
+ );
324
+
325
+ return exports.isGeneratorFunction(outerFn)
326
+ ? iter // If outerFn is a generator, return the full iterator.
327
+ : iter.next().then(function(result) {
328
+ return result.done ? result.value : iter.next();
329
+ });
330
+ };
331
+
332
+ function makeInvokeMethod(innerFn, self, context) {
333
+ var state = GenStateSuspendedStart;
334
+
335
+ return function invoke(method, arg) {
336
+ if (state === GenStateExecuting) {
337
+ throw new Error("Generator is already running");
338
+ }
339
+
340
+ if (state === GenStateCompleted) {
341
+ if (method === "throw") {
342
+ throw arg;
343
+ }
344
+
345
+ // Be forgiving, per 25.3.3.3.3 of the spec:
346
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
347
+ return doneResult();
348
+ }
349
+
350
+ context.method = method;
351
+ context.arg = arg;
352
+
353
+ while (true) {
354
+ var delegate = context.delegate;
355
+ if (delegate) {
356
+ var delegateResult = maybeInvokeDelegate(delegate, context);
357
+ if (delegateResult) {
358
+ if (delegateResult === ContinueSentinel) continue;
359
+ return delegateResult;
360
+ }
361
+ }
362
+
363
+ if (context.method === "next") {
364
+ // Setting context._sent for legacy support of Babel's
365
+ // function.sent implementation.
366
+ context.sent = context._sent = context.arg;
367
+
368
+ } else if (context.method === "throw") {
369
+ if (state === GenStateSuspendedStart) {
370
+ state = GenStateCompleted;
371
+ throw context.arg;
372
+ }
373
+
374
+ context.dispatchException(context.arg);
375
+
376
+ } else if (context.method === "return") {
377
+ context.abrupt("return", context.arg);
378
+ }
379
+
380
+ state = GenStateExecuting;
381
+
382
+ var record = tryCatch(innerFn, self, context);
383
+ if (record.type === "normal") {
384
+ // If an exception is thrown from innerFn, we leave state ===
385
+ // GenStateExecuting and loop back for another invocation.
386
+ state = context.done
387
+ ? GenStateCompleted
388
+ : GenStateSuspendedYield;
389
+
390
+ if (record.arg === ContinueSentinel) {
391
+ continue;
392
+ }
393
+
394
+ return {
395
+ value: record.arg,
396
+ done: context.done
397
+ };
398
+
399
+ } else if (record.type === "throw") {
400
+ state = GenStateCompleted;
401
+ // Dispatch the exception by looping back around to the
402
+ // context.dispatchException(context.arg) call above.
403
+ context.method = "throw";
404
+ context.arg = record.arg;
405
+ }
406
+ }
407
+ };
408
+ }
409
+
410
+ // Call delegate.iterator[context.method](context.arg) and handle the
411
+ // result, either by returning a { value, done } result from the
412
+ // delegate iterator, or by modifying context.method and context.arg,
413
+ // setting context.delegate to null, and returning the ContinueSentinel.
414
+ function maybeInvokeDelegate(delegate, context) {
415
+ var method = delegate.iterator[context.method];
416
+ if (method === undefined$1) {
417
+ // A .throw or .return when the delegate iterator has no .throw
418
+ // method always terminates the yield* loop.
419
+ context.delegate = null;
420
+
421
+ if (context.method === "throw") {
422
+ // Note: ["return"] must be used for ES3 parsing compatibility.
423
+ if (delegate.iterator["return"]) {
424
+ // If the delegate iterator has a return method, give it a
425
+ // chance to clean up.
426
+ context.method = "return";
427
+ context.arg = undefined$1;
428
+ maybeInvokeDelegate(delegate, context);
429
+
430
+ if (context.method === "throw") {
431
+ // If maybeInvokeDelegate(context) changed context.method from
432
+ // "return" to "throw", let that override the TypeError below.
433
+ return ContinueSentinel;
434
+ }
435
+ }
436
+
437
+ context.method = "throw";
438
+ context.arg = new TypeError(
439
+ "The iterator does not provide a 'throw' method");
440
+ }
441
+
442
+ return ContinueSentinel;
443
+ }
444
+
445
+ var record = tryCatch(method, delegate.iterator, context.arg);
446
+
447
+ if (record.type === "throw") {
448
+ context.method = "throw";
449
+ context.arg = record.arg;
450
+ context.delegate = null;
451
+ return ContinueSentinel;
452
+ }
453
+
454
+ var info = record.arg;
455
+
456
+ if (! info) {
457
+ context.method = "throw";
458
+ context.arg = new TypeError("iterator result is not an object");
459
+ context.delegate = null;
460
+ return ContinueSentinel;
461
+ }
462
+
463
+ if (info.done) {
464
+ // Assign the result of the finished delegate to the temporary
465
+ // variable specified by delegate.resultName (see delegateYield).
466
+ context[delegate.resultName] = info.value;
467
+
468
+ // Resume execution at the desired location (see delegateYield).
469
+ context.next = delegate.nextLoc;
470
+
471
+ // If context.method was "throw" but the delegate handled the
472
+ // exception, let the outer generator proceed normally. If
473
+ // context.method was "next", forget context.arg since it has been
474
+ // "consumed" by the delegate iterator. If context.method was
475
+ // "return", allow the original .return call to continue in the
476
+ // outer generator.
477
+ if (context.method !== "return") {
478
+ context.method = "next";
479
+ context.arg = undefined$1;
480
+ }
481
+
482
+ } else {
483
+ // Re-yield the result returned by the delegate method.
484
+ return info;
485
+ }
486
+
487
+ // The delegate iterator is finished, so forget it and continue with
488
+ // the outer generator.
489
+ context.delegate = null;
490
+ return ContinueSentinel;
491
+ }
492
+
493
+ // Define Generator.prototype.{next,throw,return} in terms of the
494
+ // unified ._invoke helper method.
495
+ defineIteratorMethods(Gp);
496
+
497
+ define(Gp, toStringTagSymbol, "Generator");
498
+
499
+ // A Generator should always return itself as the iterator object when the
500
+ // @@iterator function is called on it. Some browsers' implementations of the
501
+ // iterator prototype chain incorrectly implement this, causing the Generator
502
+ // object to not be returned from this call. This ensures that doesn't happen.
503
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
504
+ Gp[iteratorSymbol] = function() {
505
+ return this;
506
+ };
507
+
508
+ Gp.toString = function() {
509
+ return "[object Generator]";
510
+ };
511
+
512
+ function pushTryEntry(locs) {
513
+ var entry = { tryLoc: locs[0] };
514
+
515
+ if (1 in locs) {
516
+ entry.catchLoc = locs[1];
517
+ }
518
+
519
+ if (2 in locs) {
520
+ entry.finallyLoc = locs[2];
521
+ entry.afterLoc = locs[3];
522
+ }
523
+
524
+ this.tryEntries.push(entry);
525
+ }
526
+
527
+ function resetTryEntry(entry) {
528
+ var record = entry.completion || {};
529
+ record.type = "normal";
530
+ delete record.arg;
531
+ entry.completion = record;
532
+ }
533
+
534
+ function Context(tryLocsList) {
535
+ // The root entry object (effectively a try statement without a catch
536
+ // or a finally block) gives us a place to store values thrown from
537
+ // locations where there is no enclosing try statement.
538
+ this.tryEntries = [{ tryLoc: "root" }];
539
+ tryLocsList.forEach(pushTryEntry, this);
540
+ this.reset(true);
541
+ }
542
+
543
+ exports.keys = function(object) {
544
+ var keys = [];
545
+ for (var key in object) {
546
+ keys.push(key);
547
+ }
548
+ keys.reverse();
549
+
550
+ // Rather than returning an object with a next method, we keep
551
+ // things simple and return the next function itself.
552
+ return function next() {
553
+ while (keys.length) {
554
+ var key = keys.pop();
555
+ if (key in object) {
556
+ next.value = key;
557
+ next.done = false;
558
+ return next;
559
+ }
560
+ }
561
+
562
+ // To avoid creating an additional object, we just hang the .value
563
+ // and .done properties off the next function object itself. This
564
+ // also ensures that the minifier will not anonymize the function.
565
+ next.done = true;
566
+ return next;
567
+ };
568
+ };
569
+
570
+ function values(iterable) {
571
+ if (iterable) {
572
+ var iteratorMethod = iterable[iteratorSymbol];
573
+ if (iteratorMethod) {
574
+ return iteratorMethod.call(iterable);
575
+ }
576
+
577
+ if (typeof iterable.next === "function") {
578
+ return iterable;
579
+ }
580
+
581
+ if (!isNaN(iterable.length)) {
582
+ var i = -1, next = function next() {
583
+ while (++i < iterable.length) {
584
+ if (hasOwn.call(iterable, i)) {
585
+ next.value = iterable[i];
586
+ next.done = false;
587
+ return next;
588
+ }
589
+ }
590
+
591
+ next.value = undefined$1;
592
+ next.done = true;
593
+
594
+ return next;
595
+ };
596
+
597
+ return next.next = next;
598
+ }
599
+ }
600
+
601
+ // Return an iterator with no values.
602
+ return { next: doneResult };
603
+ }
604
+ exports.values = values;
605
+
606
+ function doneResult() {
607
+ return { value: undefined$1, done: true };
608
+ }
609
+
610
+ Context.prototype = {
611
+ constructor: Context,
612
+
613
+ reset: function(skipTempReset) {
614
+ this.prev = 0;
615
+ this.next = 0;
616
+ // Resetting context._sent for legacy support of Babel's
617
+ // function.sent implementation.
618
+ this.sent = this._sent = undefined$1;
619
+ this.done = false;
620
+ this.delegate = null;
621
+
622
+ this.method = "next";
623
+ this.arg = undefined$1;
624
+
625
+ this.tryEntries.forEach(resetTryEntry);
626
+
627
+ if (!skipTempReset) {
628
+ for (var name in this) {
629
+ // Not sure about the optimal order of these conditions:
630
+ if (name.charAt(0) === "t" &&
631
+ hasOwn.call(this, name) &&
632
+ !isNaN(+name.slice(1))) {
633
+ this[name] = undefined$1;
634
+ }
635
+ }
636
+ }
637
+ },
638
+
639
+ stop: function() {
640
+ this.done = true;
641
+
642
+ var rootEntry = this.tryEntries[0];
643
+ var rootRecord = rootEntry.completion;
644
+ if (rootRecord.type === "throw") {
645
+ throw rootRecord.arg;
646
+ }
647
+
648
+ return this.rval;
649
+ },
650
+
651
+ dispatchException: function(exception) {
652
+ if (this.done) {
653
+ throw exception;
654
+ }
655
+
656
+ var context = this;
657
+ function handle(loc, caught) {
658
+ record.type = "throw";
659
+ record.arg = exception;
660
+ context.next = loc;
661
+
662
+ if (caught) {
663
+ // If the dispatched exception was caught by a catch block,
664
+ // then let that catch block handle the exception normally.
665
+ context.method = "next";
666
+ context.arg = undefined$1;
667
+ }
668
+
669
+ return !! caught;
670
+ }
671
+
672
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
673
+ var entry = this.tryEntries[i];
674
+ var record = entry.completion;
675
+
676
+ if (entry.tryLoc === "root") {
677
+ // Exception thrown outside of any try block that could handle
678
+ // it, so set the completion value of the entire function to
679
+ // throw the exception.
680
+ return handle("end");
681
+ }
682
+
683
+ if (entry.tryLoc <= this.prev) {
684
+ var hasCatch = hasOwn.call(entry, "catchLoc");
685
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
686
+
687
+ if (hasCatch && hasFinally) {
688
+ if (this.prev < entry.catchLoc) {
689
+ return handle(entry.catchLoc, true);
690
+ } else if (this.prev < entry.finallyLoc) {
691
+ return handle(entry.finallyLoc);
692
+ }
693
+
694
+ } else if (hasCatch) {
695
+ if (this.prev < entry.catchLoc) {
696
+ return handle(entry.catchLoc, true);
697
+ }
698
+
699
+ } else if (hasFinally) {
700
+ if (this.prev < entry.finallyLoc) {
701
+ return handle(entry.finallyLoc);
702
+ }
703
+
704
+ } else {
705
+ throw new Error("try statement without catch or finally");
706
+ }
707
+ }
708
+ }
709
+ },
710
+
711
+ abrupt: function(type, arg) {
712
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
713
+ var entry = this.tryEntries[i];
714
+ if (entry.tryLoc <= this.prev &&
715
+ hasOwn.call(entry, "finallyLoc") &&
716
+ this.prev < entry.finallyLoc) {
717
+ var finallyEntry = entry;
718
+ break;
719
+ }
720
+ }
721
+
722
+ if (finallyEntry &&
723
+ (type === "break" ||
724
+ type === "continue") &&
725
+ finallyEntry.tryLoc <= arg &&
726
+ arg <= finallyEntry.finallyLoc) {
727
+ // Ignore the finally entry if control is not jumping to a
728
+ // location outside the try/catch block.
729
+ finallyEntry = null;
730
+ }
731
+
732
+ var record = finallyEntry ? finallyEntry.completion : {};
733
+ record.type = type;
734
+ record.arg = arg;
735
+
736
+ if (finallyEntry) {
737
+ this.method = "next";
738
+ this.next = finallyEntry.finallyLoc;
739
+ return ContinueSentinel;
740
+ }
741
+
742
+ return this.complete(record);
743
+ },
744
+
745
+ complete: function(record, afterLoc) {
746
+ if (record.type === "throw") {
747
+ throw record.arg;
748
+ }
749
+
750
+ if (record.type === "break" ||
751
+ record.type === "continue") {
752
+ this.next = record.arg;
753
+ } else if (record.type === "return") {
754
+ this.rval = this.arg = record.arg;
755
+ this.method = "return";
756
+ this.next = "end";
757
+ } else if (record.type === "normal" && afterLoc) {
758
+ this.next = afterLoc;
759
+ }
760
+
761
+ return ContinueSentinel;
762
+ },
763
+
764
+ finish: function(finallyLoc) {
765
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
766
+ var entry = this.tryEntries[i];
767
+ if (entry.finallyLoc === finallyLoc) {
768
+ this.complete(entry.completion, entry.afterLoc);
769
+ resetTryEntry(entry);
770
+ return ContinueSentinel;
771
+ }
772
+ }
773
+ },
774
+
775
+ "catch": function(tryLoc) {
776
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
777
+ var entry = this.tryEntries[i];
778
+ if (entry.tryLoc === tryLoc) {
779
+ var record = entry.completion;
780
+ if (record.type === "throw") {
781
+ var thrown = record.arg;
782
+ resetTryEntry(entry);
783
+ }
784
+ return thrown;
785
+ }
786
+ }
787
+
788
+ // The context.catch method must only be called with a location
789
+ // argument that corresponds to a known catch block.
790
+ throw new Error("illegal catch attempt");
791
+ },
792
+
793
+ delegateYield: function(iterable, resultName, nextLoc) {
794
+ this.delegate = {
795
+ iterator: values(iterable),
796
+ resultName: resultName,
797
+ nextLoc: nextLoc
798
+ };
799
+
800
+ if (this.method === "next") {
801
+ // Deliberately forget the last sent value so that we don't
802
+ // accidentally pass it on to the delegate.
803
+ this.arg = undefined$1;
804
+ }
805
+
806
+ return ContinueSentinel;
807
+ }
808
+ };
809
+
810
+ // Regardless of whether this script is executing as a CommonJS module
811
+ // or not, return the runtime object so that we can declare the variable
812
+ // regeneratorRuntime in the outer scope, which allows this module to be
813
+ // injected easily by `bin/regenerator --include-runtime script.js`.
814
+ return exports;
815
+
816
+ }(
817
+ // If this script is executing as a CommonJS module, use module.exports
818
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
819
+ // object. Either way, the resulting object will be used to initialize
820
+ // the regeneratorRuntime variable at the top of this file.
821
+ module.exports
822
+ ));
823
+
824
+ try {
825
+ regeneratorRuntime = runtime;
826
+ } catch (accidentalStrictMode) {
827
+ // This module should not be running in strict mode, so the above
828
+ // assignment should always work unless something is misconfigured. Just
829
+ // in case runtime.js accidentally runs in strict mode, we can escape
830
+ // strict mode using a global Function call. This could conceivably fail
831
+ // if a Content Security Policy forbids using Function, but in that case
832
+ // the proper solution is to fix the accidental strict mode problem. If
833
+ // you've misconfigured your bundler to force strict mode and applied a
834
+ // CSP to forbid Function, and you're not willing to fix either of those
835
+ // problems, please detail your unique predicament in a GitHub issue.
836
+ Function("r", "regeneratorRuntime = r")(runtime);
837
+ }
838
+ });
839
+
840
+ var regenerator = runtime_1;
841
+
842
+ var defineProperty = _commonjsHelpers.createCommonjsModule(function (module) {
843
+ function _defineProperty(obj, key, value) {
844
+ if (key in obj) {
845
+ Object.defineProperty(obj, key, {
846
+ value: value,
847
+ enumerable: true,
848
+ configurable: true,
849
+ writable: true
850
+ });
851
+ } else {
852
+ obj[key] = value;
853
+ }
854
+
855
+ return obj;
856
+ }
857
+
858
+ module.exports = _defineProperty;
859
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
860
+ });
861
+
862
+ _commonjsHelpers.unwrapExports(defineProperty);
863
+
864
+ var asyncToGenerator = _commonjsHelpers.createCommonjsModule(function (module) {
865
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
866
+ try {
867
+ var info = gen[key](arg);
868
+ var value = info.value;
869
+ } catch (error) {
870
+ reject(error);
871
+ return;
872
+ }
873
+
874
+ if (info.done) {
875
+ resolve(value);
876
+ } else {
877
+ Promise.resolve(value).then(_next, _throw);
878
+ }
879
+ }
880
+
881
+ function _asyncToGenerator(fn) {
882
+ return function () {
883
+ var self = this,
884
+ args = arguments;
885
+ return new Promise(function (resolve, reject) {
886
+ var gen = fn.apply(self, args);
887
+
888
+ function _next(value) {
889
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
890
+ }
891
+
892
+ function _throw(err) {
893
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
894
+ }
895
+
896
+ _next(undefined);
897
+ });
898
+ };
899
+ }
900
+
901
+ module.exports = _asyncToGenerator;
902
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
903
+ });
904
+
905
+ _commonjsHelpers.unwrapExports(asyncToGenerator);
906
+
907
+ var arrayWithHoles = _commonjsHelpers.createCommonjsModule(function (module) {
908
+ function _arrayWithHoles(arr) {
909
+ if (Array.isArray(arr)) return arr;
910
+ }
911
+
912
+ module.exports = _arrayWithHoles;
913
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
914
+ });
915
+
916
+ _commonjsHelpers.unwrapExports(arrayWithHoles);
917
+
918
+ var iterableToArrayLimit = _commonjsHelpers.createCommonjsModule(function (module) {
919
+ function _iterableToArrayLimit(arr, i) {
920
+ var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
921
+
922
+ if (_i == null) return;
923
+ var _arr = [];
924
+ var _n = true;
925
+ var _d = false;
926
+
927
+ var _s, _e;
928
+
929
+ try {
930
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
931
+ _arr.push(_s.value);
932
+
933
+ if (i && _arr.length === i) break;
934
+ }
935
+ } catch (err) {
936
+ _d = true;
937
+ _e = err;
938
+ } finally {
939
+ try {
940
+ if (!_n && _i["return"] != null) _i["return"]();
941
+ } finally {
942
+ if (_d) throw _e;
943
+ }
944
+ }
945
+
946
+ return _arr;
947
+ }
948
+
949
+ module.exports = _iterableToArrayLimit;
950
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
951
+ });
952
+
953
+ _commonjsHelpers.unwrapExports(iterableToArrayLimit);
954
+
955
+ var arrayLikeToArray = _commonjsHelpers.createCommonjsModule(function (module) {
956
+ function _arrayLikeToArray(arr, len) {
957
+ if (len == null || len > arr.length) len = arr.length;
958
+
959
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
960
+ arr2[i] = arr[i];
961
+ }
962
+
963
+ return arr2;
964
+ }
965
+
966
+ module.exports = _arrayLikeToArray;
967
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
968
+ });
969
+
970
+ _commonjsHelpers.unwrapExports(arrayLikeToArray);
971
+
972
+ var unsupportedIterableToArray = _commonjsHelpers.createCommonjsModule(function (module) {
973
+ function _unsupportedIterableToArray(o, minLen) {
974
+ if (!o) return;
975
+ if (typeof o === "string") return arrayLikeToArray(o, minLen);
976
+ var n = Object.prototype.toString.call(o).slice(8, -1);
977
+ if (n === "Object" && o.constructor) n = o.constructor.name;
978
+ if (n === "Map" || n === "Set") return Array.from(o);
979
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
980
+ }
981
+
982
+ module.exports = _unsupportedIterableToArray;
983
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
984
+ });
985
+
986
+ _commonjsHelpers.unwrapExports(unsupportedIterableToArray);
987
+
988
+ var nonIterableRest = _commonjsHelpers.createCommonjsModule(function (module) {
989
+ function _nonIterableRest() {
990
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
991
+ }
992
+
993
+ module.exports = _nonIterableRest;
994
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
995
+ });
996
+
997
+ _commonjsHelpers.unwrapExports(nonIterableRest);
998
+
999
+ var slicedToArray = _commonjsHelpers.createCommonjsModule(function (module) {
1000
+ function _slicedToArray(arr, i) {
1001
+ return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
1002
+ }
1003
+
1004
+ module.exports = _slicedToArray;
1005
+ module.exports["default"] = module.exports, module.exports.__esModule = true;
1006
+ });
1007
+
1008
+ _commonjsHelpers.unwrapExports(slicedToArray);
1009
+
17
1010
  var logger = _commonjsHelpers.createCommonjsModule(function (module, exports) {
18
1011
 
19
1012
  Object.defineProperty(exports, "__esModule", {
@@ -22,39 +1015,25 @@ Object.defineProperty(exports, "__esModule", {
22
1015
  exports.setLogger = setLogger;
23
1016
  exports.proxyLogger = proxyLogger;
24
1017
  exports.default = void 0;
25
- var _logger = {
26
- error(code) {
27
- for (var _len = arguments.length, message = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
28
- message[_key - 1] = arguments[_key];
29
- }
30
-
31
- console.error("[next-auth][error][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/errors#".concat(code.toLowerCase()), ...message);
1018
+ const _logger = {
1019
+ error(code, ...message) {
1020
+ console.error(`[next-auth][error][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/errors#${code.toLowerCase()}`, ...message);
32
1021
  },
33
1022
 
34
- warn(code) {
35
- for (var _len2 = arguments.length, message = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
36
- message[_key2 - 1] = arguments[_key2];
37
- }
38
-
39
- console.warn("[next-auth][warn][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/warnings#".concat(code.toLowerCase()), ...message);
1023
+ warn(code, ...message) {
1024
+ console.warn(`[next-auth][warn][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/warnings#${code.toLowerCase()}`, ...message);
40
1025
  },
41
1026
 
42
- debug(code) {
1027
+ debug(code, ...message) {
43
1028
  var _process, _process$env;
44
1029
 
45
1030
  if (!((_process = process) !== null && _process !== void 0 && (_process$env = _process.env) !== null && _process$env !== void 0 && _process$env._NEXTAUTH_DEBUG)) return;
46
-
47
- for (var _len3 = arguments.length, message = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
48
- message[_key3 - 1] = arguments[_key3];
49
- }
50
-
51
- console.log("[next-auth][debug][".concat(code.toLowerCase(), "]"), ...message);
1031
+ console.log(`[next-auth][debug][${code.toLowerCase()}]`, ...message);
52
1032
  }
53
1033
 
54
1034
  };
55
1035
 
56
- function setLogger() {
57
- var newLogger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1036
+ function setLogger(newLogger = {}) {
58
1037
  if (newLogger.error) _logger.error = newLogger.error;
59
1038
  if (newLogger.warn) _logger.warn = newLogger.warn;
60
1039
  if (newLogger.debug) _logger.debug = newLogger.debug;
@@ -63,27 +1042,20 @@ function setLogger() {
63
1042
  var _default = _logger;
64
1043
  exports.default = _default;
65
1044
 
66
- function proxyLogger() {
67
- var logger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _logger;
68
- var basePath = arguments.length > 1 ? arguments[1] : undefined;
69
-
1045
+ function proxyLogger(logger = _logger, basePath) {
70
1046
  try {
71
- if (typeof window === 'undefined') {
1047
+ if (typeof window === "undefined") {
72
1048
  return logger;
73
1049
  }
74
1050
 
75
- var clientLogger = {};
76
-
77
- var _loop = function _loop(level) {
78
- clientLogger[level] = function (code) {
79
- for (var _len4 = arguments.length, message = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
80
- message[_key4 - 1] = arguments[_key4];
81
- }
1051
+ const clientLogger = {};
82
1052
 
1053
+ for (const level in logger) {
1054
+ clientLogger[level] = (code, ...message) => {
83
1055
  _logger[level](code, ...message);
84
1056
 
85
- var url = "".concat(basePath, "/_log");
86
- var body = new URLSearchParams({
1057
+ const url = `${basePath}/_log`;
1058
+ const body = new URLSearchParams({
87
1059
  level,
88
1060
  code,
89
1061
  message: JSON.stringify(message.map(m => {
@@ -104,21 +1076,17 @@ function proxyLogger() {
104
1076
  }
105
1077
 
106
1078
  return fetch(url, {
107
- method: 'POST',
1079
+ method: "POST",
108
1080
  headers: {
109
- 'Content-Type': 'application/json'
1081
+ "Content-Type": "application/json"
110
1082
  },
111
1083
  body
112
1084
  });
113
1085
  };
114
- };
115
-
116
- for (var level in logger) {
117
- _loop(level);
118
1086
  }
119
1087
 
120
1088
  return clientLogger;
121
- } catch (_unused) {
1089
+ } catch {
122
1090
  return _logger;
123
1091
  }
124
1092
  }
@@ -136,18 +1104,18 @@ Object.defineProperty(exports, "__esModule", {
136
1104
  exports.default = parseUrl;
137
1105
 
138
1106
  function parseUrl(url) {
139
- var defaultHost = 'http://localhost:3000';
140
- var defaultPath = '/api/auth';
1107
+ const defaultHost = 'http://localhost:3000';
1108
+ const defaultPath = '/api/auth';
141
1109
 
142
1110
  if (!url) {
143
- url = "".concat(defaultHost).concat(defaultPath);
1111
+ url = `${defaultHost}${defaultPath}`;
144
1112
  }
145
1113
 
146
- var protocol = url.startsWith('http:') ? 'http' : 'https';
1114
+ const protocol = url.startsWith('http:') ? 'http' : 'https';
147
1115
  url = url.replace(/^https?:\/\//, '').replace(/\/$/, '');
148
- var [_host, ..._path] = url.split('/');
149
- var baseUrl = _host ? "".concat(protocol, "://").concat(_host) : defaultHost;
150
- var basePath = _path.length > 0 ? "/".concat(_path.join('/')) : defaultPath;
1116
+ const [_host, ..._path] = url.split('/');
1117
+ const baseUrl = _host ? `${protocol}://${_host}` : defaultHost;
1118
+ const basePath = _path.length > 0 ? `/${_path.join('/')}` : defaultPath;
151
1119
  return {
152
1120
  baseUrl,
153
1121
  basePath
@@ -159,39 +1127,40 @@ _commonjsHelpers.unwrapExports(parseUrl_1);
159
1127
 
160
1128
  var client$1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
161
1129
 
1130
+
1131
+
1132
+
1133
+
162
1134
  Object.defineProperty(exports, "__esModule", {
163
1135
  value: true
164
1136
  });
165
1137
  exports.useSession = useSession;
166
- exports.getSession = getSession;
167
- exports.getProviders = getProviders;
168
- exports.signIn = signIn;
169
- exports.signOut = signOut;
170
- exports.setOptions = setOptions;
1138
+ exports.session = exports.getSession = getSession;
1139
+ exports.csrfToken = exports.getCsrfToken = getCsrfToken;
1140
+ exports.providers = exports.getProviders = getProviders;
1141
+ exports.signin = exports.signIn = signIn;
1142
+ exports.signout = exports.signOut = signOut;
1143
+ exports.options = exports.setOptions = setOptions;
171
1144
  exports.Provider = Provider;
172
1145
  exports.default = void 0;
173
1146
 
1147
+ var _regenerator = interopRequireDefault(regenerator);
174
1148
 
1149
+ var _defineProperty2 = interopRequireDefault(defineProperty);
175
1150
 
176
- var _logger2 = _interopRequireWildcard(logger);
1151
+ var _asyncToGenerator2 = interopRequireDefault(asyncToGenerator);
177
1152
 
178
- var _parseUrl = _interopRequireDefault(parseUrl_1);
1153
+ var _slicedToArray2 = interopRequireDefault(slicedToArray);
179
1154
 
180
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
181
1155
 
182
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
183
1156
 
184
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
185
-
186
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1157
+ var _logger2 = interopRequireWildcard(logger);
187
1158
 
188
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1159
+ var _parseUrl = interopRequireDefault(parseUrl_1);
189
1160
 
190
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
191
-
192
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1161
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
193
1162
 
194
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
1163
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
195
1164
 
196
1165
  var __NEXTAUTH = {
197
1166
  baseUrl: (0, _parseUrl.default)(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
@@ -204,17 +1173,19 @@ var __NEXTAUTH = {
204
1173
  _clientSyncTimer: null,
205
1174
  _eventListenersAdded: false,
206
1175
  _clientSession: undefined,
207
- _getSession: () => {}
1176
+ _getSession: function _getSession() {}
208
1177
  };
209
1178
  var logger$1 = (0, _logger2.proxyLogger)(_logger2.default, __NEXTAUTH.basePath);
210
1179
  var broadcast = BroadcastChannel();
211
1180
 
212
1181
  if (typeof window !== 'undefined' && !__NEXTAUTH._eventListenersAdded) {
213
1182
  __NEXTAUTH._eventListenersAdded = true;
214
- broadcast.receive(() => __NEXTAUTH._getSession({
215
- event: 'storage'
216
- }));
217
- document.addEventListener('visibilitychange', () => {
1183
+ broadcast.receive(function () {
1184
+ return __NEXTAUTH._getSession({
1185
+ event: 'storage'
1186
+ });
1187
+ });
1188
+ document.addEventListener('visibilitychange', function () {
218
1189
  !document.hidden && __NEXTAUTH._getSession({
219
1190
  event: 'visibilitychange'
220
1191
  });
@@ -230,50 +1201,103 @@ function useSession(session) {
230
1201
  }
231
1202
 
232
1203
  function _useSessionHook(session) {
233
- var [data, setData] = (0, React__default['default'].useState)(session);
234
- var [loading, setLoading] = (0, React__default['default'].useState)(!data);
235
- (0, React__default['default'].useEffect)(() => {
236
- __NEXTAUTH._getSession = _asyncToGenerator(function* () {
237
- var {
238
- event = null
239
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
240
-
241
- try {
242
- var triggredByEvent = event !== null;
243
- var triggeredByStorageEvent = event === 'storage';
244
- var clientMaxAge = __NEXTAUTH.clientMaxAge;
245
- var clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
246
-
247
- var currentTime = _now();
248
-
249
- var clientSession = __NEXTAUTH._clientSession;
250
-
251
- if (!triggeredByStorageEvent && clientSession !== undefined) {
252
- if (clientMaxAge === 0 && triggredByEvent !== true) {
253
- return;
254
- } else if (clientMaxAge > 0 && clientSession === null) {
255
- return;
256
- } else if (clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge) {
257
- return;
1204
+ var _useState = (0, React__default['default'].useState)(session),
1205
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
1206
+ data = _useState2[0],
1207
+ setData = _useState2[1];
1208
+
1209
+ var _useState3 = (0, React__default['default'].useState)(!data),
1210
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
1211
+ loading = _useState4[0],
1212
+ setLoading = _useState4[1];
1213
+
1214
+ (0, React__default['default'].useEffect)(function () {
1215
+ __NEXTAUTH._getSession = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
1216
+ var _ref2,
1217
+ _ref2$event,
1218
+ event,
1219
+ triggredByEvent,
1220
+ triggeredByStorageEvent,
1221
+ clientMaxAge,
1222
+ clientLastSync,
1223
+ currentTime,
1224
+ clientSession,
1225
+ newClientSessionData,
1226
+ _args = arguments;
1227
+
1228
+ return _regenerator.default.wrap(function _callee$(_context) {
1229
+ while (1) {
1230
+ switch (_context.prev = _context.next) {
1231
+ case 0:
1232
+ _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$event = _ref2.event, event = _ref2$event === void 0 ? null : _ref2$event;
1233
+ _context.prev = 1;
1234
+ triggredByEvent = event !== null;
1235
+ triggeredByStorageEvent = event === 'storage';
1236
+ clientMaxAge = __NEXTAUTH.clientMaxAge;
1237
+ clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
1238
+ currentTime = _now();
1239
+ clientSession = __NEXTAUTH._clientSession;
1240
+
1241
+ if (!(!triggeredByStorageEvent && clientSession !== undefined)) {
1242
+ _context.next = 19;
1243
+ break;
1244
+ }
1245
+
1246
+ if (!(clientMaxAge === 0 && triggredByEvent !== true)) {
1247
+ _context.next = 13;
1248
+ break;
1249
+ }
1250
+
1251
+ return _context.abrupt("return");
1252
+
1253
+ case 13:
1254
+ if (!(clientMaxAge > 0 && clientSession === null)) {
1255
+ _context.next = 17;
1256
+ break;
1257
+ }
1258
+
1259
+ return _context.abrupt("return");
1260
+
1261
+ case 17:
1262
+ if (!(clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge)) {
1263
+ _context.next = 19;
1264
+ break;
1265
+ }
1266
+
1267
+ return _context.abrupt("return");
1268
+
1269
+ case 19:
1270
+ if (clientSession === undefined) {
1271
+ __NEXTAUTH._clientSession = null;
1272
+ }
1273
+
1274
+ __NEXTAUTH._clientLastSync = _now();
1275
+ _context.next = 23;
1276
+ return getSession({
1277
+ triggerEvent: !triggeredByStorageEvent
1278
+ });
1279
+
1280
+ case 23:
1281
+ newClientSessionData = _context.sent;
1282
+ __NEXTAUTH._clientSession = newClientSessionData;
1283
+ setData(newClientSessionData);
1284
+ setLoading(false);
1285
+ _context.next = 33;
1286
+ break;
1287
+
1288
+ case 29:
1289
+ _context.prev = 29;
1290
+ _context.t0 = _context["catch"](1);
1291
+ logger$1.error('CLIENT_USE_SESSION_ERROR', _context.t0);
1292
+ setLoading(false);
1293
+
1294
+ case 33:
1295
+ case "end":
1296
+ return _context.stop();
258
1297
  }
259
1298
  }
260
-
261
- if (clientSession === undefined) {
262
- __NEXTAUTH._clientSession = null;
263
- }
264
-
265
- __NEXTAUTH._clientLastSync = _now();
266
- var newClientSessionData = yield getSession({
267
- triggerEvent: !triggeredByStorageEvent
268
- });
269
- __NEXTAUTH._clientSession = newClientSessionData;
270
- setData(newClientSessionData);
271
- setLoading(false);
272
- } catch (error) {
273
- logger$1.error('CLIENT_USE_SESSION_ERROR', error);
274
- setLoading(false);
275
- }
276
- });
1299
+ }, _callee, null, [[1, 29]]);
1300
+ }));
277
1301
 
278
1302
  __NEXTAUTH._getSession();
279
1303
  });
@@ -285,22 +1309,38 @@ function getSession(_x) {
285
1309
  }
286
1310
 
287
1311
  function _getSession2() {
288
- _getSession2 = _asyncToGenerator(function* (ctx) {
1312
+ _getSession2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(ctx) {
289
1313
  var _ctx$triggerEvent;
290
1314
 
291
- var session = yield _fetchData('session', ctx);
1315
+ var session;
1316
+ return _regenerator.default.wrap(function _callee4$(_context4) {
1317
+ while (1) {
1318
+ switch (_context4.prev = _context4.next) {
1319
+ case 0:
1320
+ _context4.next = 2;
1321
+ return _fetchData('session', ctx);
1322
+
1323
+ case 2:
1324
+ session = _context4.sent;
1325
+
1326
+ if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
1327
+ broadcast.post({
1328
+ event: 'session',
1329
+ data: {
1330
+ trigger: 'getSession'
1331
+ }
1332
+ });
1333
+ }
292
1334
 
293
- if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
294
- broadcast.post({
295
- event: 'session',
296
- data: {
297
- trigger: 'getSession'
298
- }
299
- });
300
- }
1335
+ return _context4.abrupt("return", session);
301
1336
 
302
- return session;
303
- });
1337
+ case 5:
1338
+ case "end":
1339
+ return _context4.stop();
1340
+ }
1341
+ }
1342
+ }, _callee4);
1343
+ }));
304
1344
  return _getSession2.apply(this, arguments);
305
1345
  }
306
1346
 
@@ -309,11 +1349,50 @@ function getCsrfToken(_x2) {
309
1349
  }
310
1350
 
311
1351
  function _getCsrfToken() {
312
- _getCsrfToken = _asyncToGenerator(function* (ctx) {
1352
+ _getCsrfToken = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(ctx) {
313
1353
  var _yield$_fetchData;
314
1354
 
315
- return (_yield$_fetchData = yield _fetchData('csrf', ctx)) === null || _yield$_fetchData === void 0 ? void 0 : _yield$_fetchData.csrfToken;
316
- });
1355
+ return _regenerator.default.wrap(function _callee5$(_context5) {
1356
+ while (1) {
1357
+ switch (_context5.prev = _context5.next) {
1358
+ case 0:
1359
+ _context5.next = 2;
1360
+ return _fetchData('csrf', ctx);
1361
+
1362
+ case 2:
1363
+ _context5.t1 = _yield$_fetchData = _context5.sent;
1364
+ _context5.t0 = _context5.t1 === null;
1365
+
1366
+ if (_context5.t0) {
1367
+ _context5.next = 6;
1368
+ break;
1369
+ }
1370
+
1371
+ _context5.t0 = _yield$_fetchData === void 0;
1372
+
1373
+ case 6:
1374
+ if (!_context5.t0) {
1375
+ _context5.next = 10;
1376
+ break;
1377
+ }
1378
+
1379
+ _context5.t2 = void 0;
1380
+ _context5.next = 11;
1381
+ break;
1382
+
1383
+ case 10:
1384
+ _context5.t2 = _yield$_fetchData.csrfToken;
1385
+
1386
+ case 11:
1387
+ return _context5.abrupt("return", _context5.t2);
1388
+
1389
+ case 12:
1390
+ case "end":
1391
+ return _context5.stop();
1392
+ }
1393
+ }
1394
+ }, _callee5);
1395
+ }));
317
1396
  return _getCsrfToken.apply(this, arguments);
318
1397
  }
319
1398
 
@@ -322,9 +1401,20 @@ function getProviders() {
322
1401
  }
323
1402
 
324
1403
  function _getProviders() {
325
- _getProviders = _asyncToGenerator(function* () {
326
- return _fetchData('providers');
327
- });
1404
+ _getProviders = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6() {
1405
+ return _regenerator.default.wrap(function _callee6$(_context6) {
1406
+ while (1) {
1407
+ switch (_context6.prev = _context6.next) {
1408
+ case 0:
1409
+ return _context6.abrupt("return", _fetchData('providers'));
1410
+
1411
+ case 1:
1412
+ case "end":
1413
+ return _context6.stop();
1414
+ }
1415
+ }
1416
+ }, _callee6);
1417
+ }));
328
1418
  return _getProviders.apply(this, arguments);
329
1419
  }
330
1420
 
@@ -333,68 +1423,130 @@ function signIn(_x3) {
333
1423
  }
334
1424
 
335
1425
  function _signIn() {
336
- _signIn = _asyncToGenerator(function* (provider) {
337
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
338
- var authorizationParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
339
- var {
340
- callbackUrl = window.location,
341
- redirect = true
342
- } = options;
343
-
344
- var baseUrl = _apiBaseUrl();
345
-
346
- var providers = yield getProviders();
347
-
348
- if (!(provider in providers)) {
349
- window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
350
- return;
351
- }
352
-
353
- var isCredentials = providers[provider].type === 'credentials';
354
- var isEmail = providers[provider].type === 'email';
355
- var canRedirectBeDisabled = isCredentials || isEmail;
356
- var signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
357
- var fetchOptions = {
358
- method: 'post',
359
- headers: {
360
- 'Content-Type': 'application/x-www-form-urlencoded'
361
- },
362
- body: new URLSearchParams(_objectSpread(_objectSpread({}, options), {}, {
363
- csrfToken: yield getCsrfToken(),
1426
+ _signIn = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(provider) {
1427
+ var options,
1428
+ authorizationParams,
1429
+ _options$callbackUrl,
364
1430
  callbackUrl,
365
- json: true
366
- }))
367
- };
368
-
369
- var _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
370
-
371
- var res = yield fetch(_signInUrl, fetchOptions);
372
- var data = yield res.json();
1431
+ _options$redirect,
1432
+ redirect,
1433
+ baseUrl,
1434
+ providers,
1435
+ isCredentials,
1436
+ isEmail,
1437
+ canRedirectBeDisabled,
1438
+ signInUrl,
1439
+ fetchOptions,
1440
+ _signInUrl,
1441
+ res,
1442
+ data,
1443
+ _data$url,
1444
+ url,
1445
+ error,
1446
+ _args7 = arguments;
1447
+
1448
+ return _regenerator.default.wrap(function _callee7$(_context7) {
1449
+ while (1) {
1450
+ switch (_context7.prev = _context7.next) {
1451
+ case 0:
1452
+ options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
1453
+ authorizationParams = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {};
1454
+ _options$callbackUrl = options.callbackUrl, callbackUrl = _options$callbackUrl === void 0 ? window.location : _options$callbackUrl, _options$redirect = options.redirect, redirect = _options$redirect === void 0 ? true : _options$redirect;
1455
+ baseUrl = _apiBaseUrl();
1456
+ _context7.next = 6;
1457
+ return getProviders();
1458
+
1459
+ case 6:
1460
+ providers = _context7.sent;
1461
+
1462
+ if (provider in providers) {
1463
+ _context7.next = 10;
1464
+ break;
1465
+ }
373
1466
 
374
- if (redirect || !canRedirectBeDisabled) {
375
- var _data$url;
1467
+ window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
1468
+ return _context7.abrupt("return");
1469
+
1470
+ case 10:
1471
+ isCredentials = providers[provider].type === 'credentials';
1472
+ isEmail = providers[provider].type === 'email';
1473
+ canRedirectBeDisabled = isCredentials || isEmail;
1474
+ signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
1475
+ _context7.t0 = {
1476
+ 'Content-Type': 'application/x-www-form-urlencoded'
1477
+ };
1478
+ _context7.t1 = URLSearchParams;
1479
+ _context7.t2 = _objectSpread;
1480
+ _context7.t3 = _objectSpread({}, options);
1481
+ _context7.t4 = {};
1482
+ _context7.next = 21;
1483
+ return getCsrfToken();
1484
+
1485
+ case 21:
1486
+ _context7.t5 = _context7.sent;
1487
+ _context7.t6 = callbackUrl;
1488
+ _context7.t7 = {
1489
+ csrfToken: _context7.t5,
1490
+ callbackUrl: _context7.t6,
1491
+ json: true
1492
+ };
1493
+ _context7.t8 = (0, _context7.t2)(_context7.t3, _context7.t4, _context7.t7);
1494
+ _context7.t9 = new _context7.t1(_context7.t8);
1495
+ fetchOptions = {
1496
+ method: 'post',
1497
+ headers: _context7.t0,
1498
+ body: _context7.t9
1499
+ };
1500
+ _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
1501
+ _context7.next = 30;
1502
+ return fetch(_signInUrl, fetchOptions);
1503
+
1504
+ case 30:
1505
+ res = _context7.sent;
1506
+ _context7.next = 33;
1507
+ return res.json();
1508
+
1509
+ case 33:
1510
+ data = _context7.sent;
1511
+
1512
+ if (!(redirect || !canRedirectBeDisabled)) {
1513
+ _context7.next = 39;
1514
+ break;
1515
+ }
376
1516
 
377
- var url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
378
- window.location = url;
379
- if (url.includes('#')) window.location.reload();
380
- return;
381
- }
1517
+ url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
1518
+ window.location = url;
1519
+ if (url.includes('#')) window.location.reload();
1520
+ return _context7.abrupt("return");
382
1521
 
383
- var error = new URL(data.url).searchParams.get('error');
1522
+ case 39:
1523
+ error = new URL(data.url).searchParams.get('error');
384
1524
 
385
- if (res.ok) {
386
- yield __NEXTAUTH._getSession({
387
- event: 'storage'
388
- });
389
- }
1525
+ if (!res.ok) {
1526
+ _context7.next = 43;
1527
+ break;
1528
+ }
390
1529
 
391
- return {
392
- error,
393
- status: res.status,
394
- ok: res.ok,
395
- url: error ? null : data.url
396
- };
397
- });
1530
+ _context7.next = 43;
1531
+ return __NEXTAUTH._getSession({
1532
+ event: 'storage'
1533
+ });
1534
+
1535
+ case 43:
1536
+ return _context7.abrupt("return", {
1537
+ error: error,
1538
+ status: res.status,
1539
+ ok: res.ok,
1540
+ url: error ? null : data.url
1541
+ });
1542
+
1543
+ case 44:
1544
+ case "end":
1545
+ return _context7.stop();
1546
+ }
1547
+ }
1548
+ }, _callee7);
1549
+ }));
398
1550
  return _signIn.apply(this, arguments);
399
1551
  }
400
1552
 
@@ -403,59 +1555,101 @@ function signOut() {
403
1555
  }
404
1556
 
405
1557
  function _signOut() {
406
- _signOut = _asyncToGenerator(function* () {
407
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
408
- var {
409
- callbackUrl = window.location,
410
- redirect = true
411
- } = options;
412
-
413
- var baseUrl = _apiBaseUrl();
414
-
415
- var fetchOptions = {
416
- method: 'post',
417
- headers: {
418
- 'Content-Type': 'application/x-www-form-urlencoded'
419
- },
420
- body: new URLSearchParams({
421
- csrfToken: yield getCsrfToken(),
1558
+ _signOut = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee8() {
1559
+ var options,
1560
+ _options$callbackUrl2,
422
1561
  callbackUrl,
423
- json: true
424
- })
425
- };
426
- var res = yield fetch("".concat(baseUrl, "/signout"), fetchOptions);
427
- var data = yield res.json();
428
- broadcast.post({
429
- event: 'session',
430
- data: {
431
- trigger: 'signout'
432
- }
433
- });
1562
+ _options$redirect2,
1563
+ redirect,
1564
+ baseUrl,
1565
+ fetchOptions,
1566
+ res,
1567
+ data,
1568
+ _data$url2,
1569
+ url,
1570
+ _args8 = arguments;
1571
+
1572
+ return _regenerator.default.wrap(function _callee8$(_context8) {
1573
+ while (1) {
1574
+ switch (_context8.prev = _context8.next) {
1575
+ case 0:
1576
+ options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
1577
+ _options$callbackUrl2 = options.callbackUrl, callbackUrl = _options$callbackUrl2 === void 0 ? window.location : _options$callbackUrl2, _options$redirect2 = options.redirect, redirect = _options$redirect2 === void 0 ? true : _options$redirect2;
1578
+ baseUrl = _apiBaseUrl();
1579
+ _context8.t0 = {
1580
+ 'Content-Type': 'application/x-www-form-urlencoded'
1581
+ };
1582
+ _context8.t1 = URLSearchParams;
1583
+ _context8.next = 7;
1584
+ return getCsrfToken();
1585
+
1586
+ case 7:
1587
+ _context8.t2 = _context8.sent;
1588
+ _context8.t3 = callbackUrl;
1589
+ _context8.t4 = {
1590
+ csrfToken: _context8.t2,
1591
+ callbackUrl: _context8.t3,
1592
+ json: true
1593
+ };
1594
+ _context8.t5 = new _context8.t1(_context8.t4);
1595
+ fetchOptions = {
1596
+ method: 'post',
1597
+ headers: _context8.t0,
1598
+ body: _context8.t5
1599
+ };
1600
+ _context8.next = 14;
1601
+ return fetch("".concat(baseUrl, "/signout"), fetchOptions);
1602
+
1603
+ case 14:
1604
+ res = _context8.sent;
1605
+ _context8.next = 17;
1606
+ return res.json();
1607
+
1608
+ case 17:
1609
+ data = _context8.sent;
1610
+ broadcast.post({
1611
+ event: 'session',
1612
+ data: {
1613
+ trigger: 'signout'
1614
+ }
1615
+ });
1616
+
1617
+ if (!redirect) {
1618
+ _context8.next = 24;
1619
+ break;
1620
+ }
434
1621
 
435
- if (redirect) {
436
- var _data$url2;
1622
+ url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
1623
+ window.location = url;
1624
+ if (url.includes('#')) window.location.reload();
1625
+ return _context8.abrupt("return");
437
1626
 
438
- var url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
439
- window.location = url;
440
- if (url.includes('#')) window.location.reload();
441
- return;
442
- }
1627
+ case 24:
1628
+ _context8.next = 26;
1629
+ return __NEXTAUTH._getSession({
1630
+ event: 'storage'
1631
+ });
443
1632
 
444
- yield __NEXTAUTH._getSession({
445
- event: 'storage'
446
- });
447
- return data;
448
- });
1633
+ case 26:
1634
+ return _context8.abrupt("return", data);
1635
+
1636
+ case 27:
1637
+ case "end":
1638
+ return _context8.stop();
1639
+ }
1640
+ }
1641
+ }, _callee8);
1642
+ }));
449
1643
  return _signOut.apply(this, arguments);
450
1644
  }
451
1645
 
452
1646
  function setOptions() {
453
- var {
454
- baseUrl,
455
- basePath,
456
- clientMaxAge,
457
- keepAlive
458
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1647
+ var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1648
+ baseUrl = _ref3.baseUrl,
1649
+ basePath = _ref3.basePath,
1650
+ clientMaxAge = _ref3.clientMaxAge,
1651
+ keepAlive = _ref3.keepAlive;
1652
+
459
1653
  if (baseUrl) __NEXTAUTH.baseUrl = baseUrl;
460
1654
  if (basePath) __NEXTAUTH.basePath = basePath;
461
1655
  if (clientMaxAge) __NEXTAUTH.clientMaxAge = clientMaxAge;
@@ -468,21 +1662,38 @@ function setOptions() {
468
1662
  clearTimeout(__NEXTAUTH._clientSyncTimer);
469
1663
  }
470
1664
 
471
- __NEXTAUTH._clientSyncTimer = setTimeout(_asyncToGenerator(function* () {
472
- if (!__NEXTAUTH._clientSession) return;
473
- yield __NEXTAUTH._getSession({
474
- event: 'timer'
475
- });
476
- }), keepAlive * 1000);
1665
+ __NEXTAUTH._clientSyncTimer = setTimeout((0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2() {
1666
+ return _regenerator.default.wrap(function _callee2$(_context2) {
1667
+ while (1) {
1668
+ switch (_context2.prev = _context2.next) {
1669
+ case 0:
1670
+ if (__NEXTAUTH._clientSession) {
1671
+ _context2.next = 2;
1672
+ break;
1673
+ }
1674
+
1675
+ return _context2.abrupt("return");
1676
+
1677
+ case 2:
1678
+ _context2.next = 4;
1679
+ return __NEXTAUTH._getSession({
1680
+ event: 'timer'
1681
+ });
1682
+
1683
+ case 4:
1684
+ case "end":
1685
+ return _context2.stop();
1686
+ }
1687
+ }
1688
+ }, _callee2);
1689
+ })), keepAlive * 1000);
477
1690
  }
478
1691
  }
479
1692
 
480
- function Provider(_ref3) {
481
- var {
482
- children,
483
- session,
484
- options
485
- } = _ref3;
1693
+ function Provider(_ref5) {
1694
+ var children = _ref5.children,
1695
+ session = _ref5.session,
1696
+ options = _ref5.options;
486
1697
  setOptions(options);
487
1698
  return (0, React__default['default'].createElement)(SessionContext.Provider, {
488
1699
  value: useSession(session)
@@ -494,27 +1705,58 @@ function _fetchData(_x4) {
494
1705
  }
495
1706
 
496
1707
  function _fetchData2() {
497
- _fetchData2 = _asyncToGenerator(function* (path) {
498
- var {
499
- ctx,
500
- req = ctx === null || ctx === void 0 ? void 0 : ctx.req
501
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
502
-
503
- try {
504
- var baseUrl = yield _apiBaseUrl();
505
- var options = req ? {
506
- headers: {
507
- cookie: req.headers.cookie
1708
+ _fetchData2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee9(path) {
1709
+ var _ref7,
1710
+ ctx,
1711
+ _ref7$req,
1712
+ req,
1713
+ baseUrl,
1714
+ options,
1715
+ res,
1716
+ data,
1717
+ _args9 = arguments;
1718
+
1719
+ return _regenerator.default.wrap(function _callee9$(_context9) {
1720
+ while (1) {
1721
+ switch (_context9.prev = _context9.next) {
1722
+ case 0:
1723
+ _ref7 = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : {}, ctx = _ref7.ctx, _ref7$req = _ref7.req, req = _ref7$req === void 0 ? ctx === null || ctx === void 0 ? void 0 : ctx.req : _ref7$req;
1724
+ _context9.prev = 1;
1725
+ _context9.next = 4;
1726
+ return _apiBaseUrl();
1727
+
1728
+ case 4:
1729
+ baseUrl = _context9.sent;
1730
+ options = req ? {
1731
+ headers: {
1732
+ cookie: req.headers.cookie
1733
+ }
1734
+ } : {};
1735
+ _context9.next = 8;
1736
+ return fetch("".concat(baseUrl, "/").concat(path), options);
1737
+
1738
+ case 8:
1739
+ res = _context9.sent;
1740
+ _context9.next = 11;
1741
+ return res.json();
1742
+
1743
+ case 11:
1744
+ data = _context9.sent;
1745
+ return _context9.abrupt("return", Object.keys(data).length > 0 ? data : null);
1746
+
1747
+ case 15:
1748
+ _context9.prev = 15;
1749
+ _context9.t0 = _context9["catch"](1);
1750
+ logger$1.error('CLIENT_FETCH_ERROR', path, _context9.t0);
1751
+ return _context9.abrupt("return", null);
1752
+
1753
+ case 19:
1754
+ case "end":
1755
+ return _context9.stop();
508
1756
  }
509
- } : {};
510
- var res = yield fetch("".concat(baseUrl, "/").concat(path), options);
511
- var data = yield res.json();
512
- return Object.keys(data).length > 0 ? data : null;
513
- } catch (error) {
514
- logger$1.error('CLIENT_FETCH_ERROR', path, error);
515
- return null;
516
- }
517
- });
1757
+ }
1758
+ }, _callee9, null, [[1, 15]]);
1759
+ }));
518
1760
  return _fetchData2.apply(this, arguments);
519
1761
  }
520
1762
 
@@ -537,41 +1779,66 @@ function _now() {
537
1779
  function BroadcastChannel() {
538
1780
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'nextauth.message';
539
1781
  return {
540
- receive(onReceive) {
1782
+ receive: function receive(onReceive) {
541
1783
  if (typeof window === 'undefined') return;
542
1784
  window.addEventListener('storage', function () {
543
- var _ref4 = _asyncToGenerator(function* (event) {
544
- if (event.key !== name) return;
545
- var message = JSON.parse(event.newValue);
546
- if ((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data)) return;
547
- onReceive(message);
548
- });
1785
+ var _ref6 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(event) {
1786
+ var message;
1787
+ return _regenerator.default.wrap(function _callee3$(_context3) {
1788
+ while (1) {
1789
+ switch (_context3.prev = _context3.next) {
1790
+ case 0:
1791
+ if (!(event.key !== name)) {
1792
+ _context3.next = 2;
1793
+ break;
1794
+ }
1795
+
1796
+ return _context3.abrupt("return");
1797
+
1798
+ case 2:
1799
+ message = JSON.parse(event.newValue);
1800
+
1801
+ if (!((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data))) {
1802
+ _context3.next = 5;
1803
+ break;
1804
+ }
1805
+
1806
+ return _context3.abrupt("return");
1807
+
1808
+ case 5:
1809
+ onReceive(message);
1810
+
1811
+ case 6:
1812
+ case "end":
1813
+ return _context3.stop();
1814
+ }
1815
+ }
1816
+ }, _callee3);
1817
+ }));
549
1818
 
550
1819
  return function (_x5) {
551
- return _ref4.apply(this, arguments);
1820
+ return _ref6.apply(this, arguments);
552
1821
  };
553
1822
  }());
554
1823
  },
555
-
556
- post(message) {
1824
+ post: function post(message) {
557
1825
  if (typeof localStorage === 'undefined') return;
558
1826
  localStorage.setItem(name, JSON.stringify(_objectSpread(_objectSpread({}, message), {}, {
559
1827
  timestamp: _now()
560
1828
  })));
561
1829
  }
562
-
563
1830
  };
564
1831
  }
565
1832
 
566
1833
  var _default = {
567
- getSession,
568
- getCsrfToken,
569
- getProviders,
570
- useSession,
571
- signIn,
572
- signOut,
573
- Provider,
574
- setOptions,
1834
+ getSession: getSession,
1835
+ getCsrfToken: getCsrfToken,
1836
+ getProviders: getProviders,
1837
+ useSession: useSession,
1838
+ signIn: signIn,
1839
+ signOut: signOut,
1840
+ Provider: Provider,
1841
+ setOptions: setOptions,
575
1842
  options: setOptions,
576
1843
  session: getSession,
577
1844
  providers: getProviders,
@@ -584,10 +1851,17 @@ exports.default = _default;
584
1851
 
585
1852
  _commonjsHelpers.unwrapExports(client$1);
586
1853
  client$1.useSession;
1854
+ client$1.session;
587
1855
  client$1.getSession;
1856
+ client$1.csrfToken;
1857
+ client$1.getCsrfToken;
1858
+ client$1.providers;
588
1859
  client$1.getProviders;
1860
+ client$1.signin;
589
1861
  client$1.signIn;
1862
+ client$1.signout;
590
1863
  client$1.signOut;
1864
+ client$1.options;
591
1865
  client$1.setOptions;
592
1866
  client$1.Provider;
593
1867
 
@@ -604,27 +1878,27 @@ var AuthWrapper = function AuthWrapper(_ref) {
604
1878
  formUrl = _ref$formUrl === undefined ? '' : _ref$formUrl;
605
1879
 
606
1880
  var _nextAuth$useSession = client.useSession(),
607
- _nextAuth$useSession2 = slicedToArray._slicedToArray(_nextAuth$useSession, 2),
1881
+ _nextAuth$useSession2 = slicedToArray$1._slicedToArray(_nextAuth$useSession, 2),
608
1882
  session = _nextAuth$useSession2[0],
609
1883
  loading = _nextAuth$useSession2[1];
610
1884
 
611
1885
  var _useState = React.useState(null),
612
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
1886
+ _useState2 = slicedToArray$1._slicedToArray(_useState, 2),
613
1887
  callbackUrl = _useState2[0],
614
1888
  setCallbackUrl = _useState2[1];
615
1889
 
616
1890
  var _useState3 = React.useState(),
617
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
1891
+ _useState4 = slicedToArray$1._slicedToArray(_useState3, 2),
618
1892
  email = _useState4[0],
619
1893
  setEmail = _useState4[1];
620
1894
 
621
1895
  var _useState5 = React.useState(false),
622
- _useState6 = slicedToArray._slicedToArray(_useState5, 2),
1896
+ _useState6 = slicedToArray$1._slicedToArray(_useState5, 2),
623
1897
  showForm = _useState6[0],
624
1898
  setShowForm = _useState6[1];
625
1899
 
626
1900
  var _useState7 = React.useState(),
627
- _useState8 = slicedToArray._slicedToArray(_useState7, 2),
1901
+ _useState8 = slicedToArray$1._slicedToArray(_useState7, 2),
628
1902
  password = _useState8[0],
629
1903
  setPassword = _useState8[1];
630
1904