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