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