@mjhls/mjh-framework 1.0.883 → 1.0.884-beta.1

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