@mjhls/mjh-framework 1.0.1005-next12-0001 → 1.0.1005-next12-0002

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 (605) hide show
  1. package/dist/cjs/AD-e1bb7536.js +1 -0
  2. package/dist/cjs/AD.js +1 -32
  3. package/dist/cjs/AD300x250-0bcfcd78.js +1 -0
  4. package/dist/cjs/AD300x250.js +1 -95
  5. package/dist/cjs/AD300x250x600-01659df6.js +1 -0
  6. package/dist/cjs/AD300x250x600.js +1 -112
  7. package/dist/cjs/AD728x90-c92f784d.js +1 -0
  8. package/dist/cjs/AD728x90.js +1 -109
  9. package/dist/cjs/ADFloatingFooter-f0650a0e.js +1 -0
  10. package/dist/cjs/ADFloatingFooter.js +1 -143
  11. package/dist/cjs/ADFooter-b3d98c5f.js +1 -0
  12. package/dist/cjs/ADFooter.js +1 -53
  13. package/dist/cjs/ADGutter-8451a0e7.js +1 -0
  14. package/dist/cjs/ADGutter.js +1 -115
  15. package/dist/cjs/ADInfeed-7019b746.js +1 -0
  16. package/dist/cjs/ADSkyscraper-2db48edc.js +1 -0
  17. package/dist/cjs/ADSkyscraper.js +1 -117
  18. package/dist/cjs/ADSponsoredResources-126ab84c.js +1 -0
  19. package/dist/cjs/ADSponsoredResources.js +1 -114
  20. package/dist/cjs/ADWebcast-26543865.js +1 -0
  21. package/dist/cjs/ADWebcast.js +1 -119
  22. package/dist/cjs/ADWelcome-6261c769.js +1 -0
  23. package/dist/cjs/ADWelcome.js +1 -166
  24. package/dist/cjs/ADlgInfeed-42059b30.js +1 -0
  25. package/dist/cjs/AccordionPanel-b018a969.js +1 -0
  26. package/dist/cjs/AccordionPanel.js +1 -94
  27. package/dist/cjs/AdSlot-8a0b4211.js +1 -0
  28. package/dist/cjs/AdSlot.js +1 -251
  29. package/dist/cjs/AdSlotsProvider-e06c4b39.js +1 -0
  30. package/dist/cjs/AdSlotsProvider.js +1 -183
  31. package/dist/cjs/AlgoliaSearch-05bab51c.js +1 -0
  32. package/dist/cjs/AlgoliaSearch.js +1 -195
  33. package/dist/cjs/AlphabeticList-94ed00ad.js +1 -0
  34. package/dist/cjs/AlphabeticList.js +1 -135
  35. package/dist/cjs/ArticleCarousel-6599cb34.js +1 -0
  36. package/dist/cjs/ArticleCarousel.js +1 -46
  37. package/dist/cjs/ArticleProgramLandingPage-2cc43252.js +1 -0
  38. package/dist/cjs/ArticleProgramLandingPage.js +1 -188
  39. package/dist/cjs/ArticleSeriesLandingPage-4af0758a.js +1 -0
  40. package/dist/cjs/ArticleSeriesLandingPage.js +1 -162
  41. package/dist/cjs/ArticleSeriesListing-476cb622.js +1 -0
  42. package/dist/cjs/ArticleSeriesListing.js +1 -315
  43. package/dist/cjs/Auth.js +1 -3514
  44. package/dist/cjs/AuthWrapper.js +1 -143
  45. package/dist/cjs/AuthorComponent-dd3ac7f5.js +1 -0
  46. package/dist/cjs/Beam.js +1 -350
  47. package/dist/cjs/Breadcrumbs-10474e7d.js +1 -0
  48. package/dist/cjs/Breadcrumbs.js +1 -107
  49. package/dist/cjs/CMEDeck-c7276c4c.js +1 -0
  50. package/dist/cjs/CMEDeck.js +1 -443
  51. package/dist/cjs/Column1-9a0e0262.js +1 -0
  52. package/dist/cjs/Column1.js +1 -39
  53. package/dist/cjs/Column2-47fa24ac.js +1 -0
  54. package/dist/cjs/Column2.js +1 -74
  55. package/dist/cjs/Column3-7407a3a2.js +1 -0
  56. package/dist/cjs/Column3.js +1 -143
  57. package/dist/cjs/ConferenceArticleCard-a48a5eb4.js +1 -0
  58. package/dist/cjs/ConferenceArticleCard.js +1 -93
  59. package/dist/cjs/ConferenceBanner-9fb497af.js +1 -0
  60. package/dist/cjs/ContentCard-0543793a.js +1 -0
  61. package/dist/cjs/ContentCardPaginated.js +1 -417
  62. package/dist/cjs/DeckContent.js +1 -507
  63. package/dist/cjs/DeckQueue.js +1 -403
  64. package/dist/cjs/DeckQueuePaginated.js +1 -348
  65. package/dist/cjs/Dfp-eb398ac3.js +1 -0
  66. package/dist/cjs/DropdownButton-3f21ccbf.js +6 -0
  67. package/dist/cjs/Dvm-4aab0fca.js +1 -0
  68. package/dist/cjs/EventsDeck-7614cec4.js +1 -0
  69. package/dist/cjs/EventsDeck.js +1 -884
  70. package/dist/cjs/ExternalResources-c1d4e253.js +1 -0
  71. package/dist/cjs/ExternalResources.js +1 -222
  72. package/dist/cjs/Feature-4254dfe3.js +1 -0
  73. package/dist/cjs/Feature.js +1 -129
  74. package/dist/cjs/ForbesHero-82c18210.js +1 -0
  75. package/dist/cjs/ForbesHero.js +1 -137
  76. package/dist/cjs/GridContent-6c8dd8e5.js +1 -0
  77. package/dist/cjs/GridContent.js +1 -828
  78. package/dist/cjs/GridContentPaginated.js +1 -704
  79. package/dist/cjs/GridHero-c6784d3f.js +1 -0
  80. package/dist/cjs/GridHero.js +1 -147
  81. package/dist/cjs/GroupDeck-6920bcf7.js +1 -0
  82. package/dist/cjs/GroupDeck.js +1 -314
  83. package/dist/cjs/HamMagazine.js +1 -602
  84. package/dist/cjs/HamburgerNav-02a13006.js +1 -0
  85. package/dist/cjs/Header-268a2cda.js +1 -0
  86. package/dist/cjs/Header.js +1 -39
  87. package/dist/cjs/HealthCareProfessionalModal.js +1 -78
  88. package/dist/cjs/Hero-79a1f7a3.js +1 -0
  89. package/dist/cjs/Hero.js +1 -48
  90. package/dist/cjs/HighlightenVideo-20edba55.js +1 -0
  91. package/dist/cjs/HighlightenVideo.js +1 -69
  92. package/dist/cjs/HorizontalArticleListing-4a44f354.js +1 -0
  93. package/dist/cjs/HorizontalArticleListing.js +1 -169
  94. package/dist/cjs/HorizontalHero-c5a3cb7a.js +1 -0
  95. package/dist/cjs/HorizontalHero.js +1 -111
  96. package/dist/cjs/ImageSlider-d1359f16.js +1 -0
  97. package/dist/cjs/IssueContentDeck-48a04696.js +1 -0
  98. package/dist/cjs/IssueContentDeck.js +1 -241
  99. package/dist/cjs/IssueDeck-41ebd17b.js +1 -0
  100. package/dist/cjs/IssueDeck.js +1 -268
  101. package/dist/cjs/IssueLanding-06765ae0.js +1 -0
  102. package/dist/cjs/IssueLanding.js +1 -176
  103. package/dist/cjs/KMTracker-4e1de793.js +1 -0
  104. package/dist/cjs/KMTracker.js +1 -27
  105. package/dist/cjs/LeftNav-c7283941.js +1 -0
  106. package/dist/cjs/LeftNav.js +1 -154
  107. package/dist/cjs/Magazine-0d15b137.js +1 -0
  108. package/dist/cjs/MasterDeck-0e168ac1.js +1 -0
  109. package/dist/cjs/MasterDeck.js +1 -555
  110. package/dist/cjs/MasterDeckPaginated.js +1 -469
  111. package/dist/cjs/MediaSeriesCard-07b6f758.js +1 -0
  112. package/dist/cjs/MediaSeriesLanding.js +1 -508
  113. package/dist/cjs/MediaSeriesLandingPaginated.js +1 -534
  114. package/dist/cjs/Native-ee78edeb.js +1 -0
  115. package/dist/cjs/NavDvm.js +1 -276
  116. package/dist/cjs/NavFooter-f905aca3.js +1 -0
  117. package/dist/cjs/NavMagazine.js +1 -613
  118. package/dist/cjs/NavNative.js +1 -880
  119. package/dist/cjs/Normal-ad14a1b1.js +1 -0
  120. package/dist/cjs/OncliveHero-5c7454fe.js +1 -0
  121. package/dist/cjs/OncliveHero.js +1 -79
  122. package/dist/cjs/OncliveLargeHero-46e0a793.js +1 -0
  123. package/dist/cjs/OncliveLargeHero.js +1 -241
  124. package/dist/cjs/PageFilter-bdffe62b.js +1 -0
  125. package/dist/cjs/PageFilter.js +1 -72
  126. package/dist/cjs/Pagination-825e4903.js +1 -0
  127. package/dist/cjs/PartnerDetailListing-848c514f.js +1 -0
  128. package/dist/cjs/PartnerDetailListing.js +1 -344
  129. package/dist/cjs/PartnerDetailListingPaginated.js +1 -353
  130. package/dist/cjs/PdfDownload-c99142ff.js +1 -0
  131. package/dist/cjs/PdfDownload.js +1 -28
  132. package/dist/cjs/PixelTracking.js +1 -165
  133. package/dist/cjs/PodcastsLanding.js +1 -236
  134. package/dist/cjs/PopUpModal-c1cbf9b6.js +1 -0
  135. package/dist/cjs/PopUpModal.js +1 -58
  136. package/dist/cjs/PtceDeck.js +1 -149
  137. package/dist/cjs/PubSection-08e834ca.js +1 -0
  138. package/dist/cjs/PubSection.js +1 -120
  139. package/dist/cjs/PubToc-6e2a3f50.js +1 -0
  140. package/dist/cjs/PubToc.js +1 -87
  141. package/dist/cjs/PublicationDeck-e242bd17.js +1 -0
  142. package/dist/cjs/PublicationDeck.js +1 -183
  143. package/dist/cjs/PublicationFeature-0e2014fb.js +1 -0
  144. package/dist/cjs/PublicationLanding-d54d80d4.js +1 -0
  145. package/dist/cjs/PublicationLanding.js +1 -853
  146. package/dist/cjs/Queue-8e0e436f.js +1 -0
  147. package/dist/cjs/QueueDeckExpanded-e420bdec.js +1 -0
  148. package/dist/cjs/QueueDeckExpanded.js +1 -1540
  149. package/dist/cjs/QueueDeckExpandedPaginated.js +1 -1388
  150. package/dist/cjs/RecentNews.js +1 -91
  151. package/dist/cjs/RelatedContent-4ac0ceca.js +1 -0
  152. package/dist/cjs/RelatedContent.js +1 -114
  153. package/dist/cjs/RelatedTopicsDropdown-4736b927.js +1 -0
  154. package/dist/cjs/RelatedTopicsDropdown.js +1 -90
  155. package/dist/cjs/RolesDeck-83cbb45e.js +1 -0
  156. package/dist/cjs/RolesDeck.js +1 -94
  157. package/dist/cjs/Schema-8c138aa8.js +1 -0
  158. package/dist/cjs/Schema.js +1 -103
  159. package/dist/cjs/Search.js +1 -66
  160. package/dist/cjs/Segment.js +1 -452
  161. package/dist/cjs/SeriesListingDeck.js +1 -248
  162. package/dist/cjs/SeriesSlider-720871f8.js +1 -0
  163. package/dist/cjs/SetCookie.js +1 -10
  164. package/dist/cjs/SideFooter-17e666a3.js +1 -0
  165. package/dist/cjs/SideFooter.js +1 -150
  166. package/dist/cjs/SocialIcons-425827d3.js +1 -0
  167. package/dist/cjs/SocialIcons.js +1 -103
  168. package/dist/cjs/SocialNavFooter-8f053a08.js +1 -0
  169. package/dist/cjs/SocialSearchComponent-dea3dbc8.js +1 -0
  170. package/dist/cjs/SocialShare-3d7c8abe.js +1 -0
  171. package/dist/cjs/SocialShare.js +1 -74
  172. package/dist/cjs/TaxonomyCard-e881cb43.js +1 -0
  173. package/dist/cjs/TaxonomyCard.js +1 -257
  174. package/dist/cjs/TaxonomyDescription-9a13ded6.js +1 -0
  175. package/dist/cjs/TaxonomyDescription.js +1 -209
  176. package/dist/cjs/TemplateNormal.js +1 -203
  177. package/dist/cjs/ThumbnailCard-101f04b8.js +1 -0
  178. package/dist/cjs/ThumbnailCard.js +1 -59
  179. package/dist/cjs/Ustream-b7692d0a.js +1 -0
  180. package/dist/cjs/Ustream.js +1 -156
  181. package/dist/cjs/VerticalHero-a61b1a2e.js +1 -0
  182. package/dist/cjs/VerticalHero.js +1 -74
  183. package/dist/cjs/VideoProgramLandingPage-5508836c.js +1 -0
  184. package/dist/cjs/VideoProgramLandingPage.js +1 -264
  185. package/dist/cjs/VideoSeriesCard.js +1 -88
  186. package/dist/cjs/VideoSeriesFilter-9650cf01.js +1 -0
  187. package/dist/cjs/VideoSeriesFilter.js +1 -128
  188. package/dist/cjs/VideoSeriesLandingPage-d1fae653.js +1 -0
  189. package/dist/cjs/VideoSeriesLandingPage.js +1 -178
  190. package/dist/cjs/VideoSeriesListing-91f5aa6d.js +1 -0
  191. package/dist/cjs/VideoSeriesListing.js +1 -422
  192. package/dist/cjs/View.js +1 -2680
  193. package/dist/cjs/YahooHero-2df6a408.js +1 -0
  194. package/dist/cjs/YahooHero.js +1 -126
  195. package/dist/cjs/YoutubeGroup-d8a93da0.js +1 -0
  196. package/dist/cjs/YoutubeGroup.js +1 -371
  197. package/dist/cjs/_commonjsHelpers-0a7b82d9.js +1 -0
  198. package/dist/cjs/beam-aaf6fbe9.js +1 -0
  199. package/dist/cjs/checkSisterSite-d2d62375.js +1 -0
  200. package/dist/cjs/defineProperty-ba7cd53d.js +1 -0
  201. package/dist/cjs/entities-8feddf1d.js +1 -0
  202. package/dist/cjs/extends-5ede7877.js +1 -0
  203. package/dist/cjs/faundadb.js +1 -406
  204. package/dist/cjs/getContentCategory-ee6d9fdf.js +1 -0
  205. package/dist/cjs/getKeywords-5341ea76.js +1 -0
  206. package/dist/cjs/getKeywords.js +1 -46
  207. package/dist/cjs/getPrototypeOf-99b1cfd8.js +1 -0
  208. package/dist/cjs/getPtceActivities.js +1 -89
  209. package/dist/cjs/getQuery-154617ad.js +1 -0
  210. package/dist/cjs/getQuery.js +1 -28
  211. package/dist/cjs/getRelatedArticle-dbed93dc.js +1 -0
  212. package/dist/cjs/getRelatedArticle.js +1 -478
  213. package/dist/cjs/getRootDocGroup.js +1 -62
  214. package/dist/cjs/getSerializers.js +1 -68
  215. package/dist/cjs/getSeriesDetail-e2980903.js +1 -0
  216. package/dist/cjs/getSeriesDetail.js +1 -40
  217. package/dist/cjs/getTargeting-a1ecaa0b.js +1 -0
  218. package/dist/cjs/getTargeting.js +1 -13
  219. package/dist/cjs/index-14c8083b.js +1 -0
  220. package/dist/cjs/index-3291d44c.js +1 -0
  221. package/dist/cjs/index-5cca2099.js +1 -0
  222. package/dist/cjs/index-66647f61.js +1 -0
  223. package/dist/cjs/index.js +1 -643
  224. package/dist/cjs/searchForm-bb5e3dbf.js +1 -0
  225. package/dist/cjs/segment-lib-7a16e514.js +1 -0
  226. package/dist/cjs/setCookie-e72f573d.js +1 -0
  227. package/dist/cjs/slicedToArray-c9e22c6a.js +1 -0
  228. package/dist/cjs/style-inject.es-dcee06b6.js +1 -30
  229. package/dist/cjs/timeDifferenceCalc.js +1 -39
  230. package/dist/cjs/toConsumableArray-7afb7984.js +1 -0
  231. package/dist/cjs/typeof-a861d137.js +1 -0
  232. package/dist/cjs/unsupportedIterableToArray-294d47a8.js +1 -0
  233. package/dist/cjs/urlFor-86a2f4db.js +1 -0
  234. package/dist/cjs/urlFor.js +1 -65
  235. package/dist/cjs/urlForFile-52afb8e9.js +1 -0
  236. package/dist/cjs/ustream-api-05a918f3.js +1 -0
  237. package/dist/esm/AD-8a57f623.js +1 -0
  238. package/dist/esm/AD.js +1 -26
  239. package/dist/esm/AD300x250-10ccde99.js +1 -0
  240. package/dist/esm/AD300x250.js +1 -89
  241. package/dist/esm/AD300x250x600-10e29b3d.js +1 -0
  242. package/dist/esm/AD300x250x600.js +1 -106
  243. package/dist/esm/AD728x90-2b0e930d.js +1 -0
  244. package/dist/esm/AD728x90.js +1 -103
  245. package/dist/esm/ADFloatingFooter-f23caacf.js +1 -0
  246. package/dist/esm/ADFloatingFooter.js +1 -137
  247. package/dist/esm/ADFooter-4c20b5fc.js +1 -0
  248. package/dist/esm/ADFooter.js +1 -47
  249. package/dist/esm/ADGutter-59cf52e3.js +1 -0
  250. package/dist/esm/ADGutter.js +1 -109
  251. package/dist/esm/ADInfeed-8ce85d87.js +1 -0
  252. package/dist/esm/ADSkyscraper-bfd33e46.js +1 -0
  253. package/dist/esm/ADSkyscraper.js +1 -111
  254. package/dist/esm/ADSponsoredResources-0410407c.js +1 -0
  255. package/dist/esm/ADSponsoredResources.js +1 -108
  256. package/dist/esm/ADWebcast-6f27e384.js +1 -0
  257. package/dist/esm/ADWebcast.js +1 -113
  258. package/dist/esm/ADWelcome-421d5621.js +1 -0
  259. package/dist/esm/ADWelcome.js +1 -160
  260. package/dist/esm/ADlgInfeed-19d0f057.js +1 -0
  261. package/dist/esm/AccordionPanel-123022f0.js +1 -0
  262. package/dist/esm/AccordionPanel.js +1 -87
  263. package/dist/esm/AdSlot-16696371.js +1 -0
  264. package/dist/esm/AdSlot.js +1 -244
  265. package/dist/esm/AdSlotsProvider-5ead284e.js +1 -0
  266. package/dist/esm/AdSlotsProvider.js +1 -176
  267. package/dist/esm/AlgoliaSearch-1343b721.js +1 -0
  268. package/dist/esm/AlgoliaSearch.js +1 -188
  269. package/dist/esm/AlphabeticList-f1ca5612.js +1 -0
  270. package/dist/esm/AlphabeticList.js +1 -129
  271. package/dist/esm/ArticleCarousel-ba29666c.js +1 -0
  272. package/dist/esm/ArticleCarousel.js +1 -40
  273. package/dist/esm/ArticleProgramLandingPage-d996da8f.js +1 -0
  274. package/dist/esm/ArticleProgramLandingPage.js +1 -182
  275. package/dist/esm/ArticleSeriesLandingPage-67cda955.js +1 -0
  276. package/dist/esm/ArticleSeriesLandingPage.js +1 -156
  277. package/dist/esm/ArticleSeriesListing-22e8f5a6.js +1 -0
  278. package/dist/esm/ArticleSeriesListing.js +1 -308
  279. package/dist/esm/Auth.js +1 -3494
  280. package/dist/esm/AuthWrapper.js +1 -136
  281. package/dist/esm/AuthorComponent-f3e14fdd.js +1 -0
  282. package/dist/esm/Beam.js +1 -348
  283. package/dist/esm/Breadcrumbs-8838701e.js +1 -0
  284. package/dist/esm/Breadcrumbs.js +1 -100
  285. package/dist/esm/CMEDeck-182d8eb7.js +1 -0
  286. package/dist/esm/CMEDeck.js +1 -437
  287. package/dist/esm/Column1-3304e0a7.js +1 -0
  288. package/dist/esm/Column1.js +1 -29
  289. package/dist/esm/Column2-2d42433b.js +1 -0
  290. package/dist/esm/Column2.js +1 -64
  291. package/dist/esm/Column3-94c8661b.js +1 -0
  292. package/dist/esm/Column3.js +1 -133
  293. package/dist/esm/ConferenceArticleCard-c10c5b7f.js +1 -0
  294. package/dist/esm/ConferenceArticleCard.js +1 -87
  295. package/dist/esm/ConferenceBanner-8a6f3ed9.js +1 -0
  296. package/dist/esm/ContentCard-01c2e43a.js +1 -0
  297. package/dist/esm/ContentCardPaginated.js +1 -406
  298. package/dist/esm/DeckContent.js +1 -497
  299. package/dist/esm/DeckQueue.js +1 -393
  300. package/dist/esm/DeckQueuePaginated.js +1 -337
  301. package/dist/esm/Dfp-c3c626b1.js +1 -0
  302. package/dist/esm/DropdownButton-c4621022.js +6 -0
  303. package/dist/esm/Dvm-138f924d.js +1 -0
  304. package/dist/esm/EventsDeck-e5aad41d.js +1 -0
  305. package/dist/esm/EventsDeck.js +1 -871
  306. package/dist/esm/ExternalResources-e9656681.js +1 -0
  307. package/dist/esm/ExternalResources.js +1 -215
  308. package/dist/esm/Feature-69a30cea.js +1 -0
  309. package/dist/esm/Feature.js +1 -122
  310. package/dist/esm/ForbesHero-0b0a5436.js +1 -0
  311. package/dist/esm/ForbesHero.js +1 -131
  312. package/dist/esm/GridContent-d8df59ae.js +1 -0
  313. package/dist/esm/GridContent.js +1 -818
  314. package/dist/esm/GridContentPaginated.js +1 -693
  315. package/dist/esm/GridHero-0d17636c.js +1 -0
  316. package/dist/esm/GridHero.js +1 -141
  317. package/dist/esm/GroupDeck-4c581822.js +1 -0
  318. package/dist/esm/GroupDeck.js +1 -308
  319. package/dist/esm/HamMagazine.js +1 -590
  320. package/dist/esm/HamburgerNav-5fcf79ae.js +1 -0
  321. package/dist/esm/Header-b0624adc.js +1 -0
  322. package/dist/esm/Header.js +1 -30
  323. package/dist/esm/HealthCareProfessionalModal.js +1 -70
  324. package/dist/esm/Hero-1b663f28.js +1 -0
  325. package/dist/esm/Hero.js +1 -42
  326. package/dist/esm/HighlightenVideo-5c3fd0fd.js +1 -0
  327. package/dist/esm/HighlightenVideo.js +1 -63
  328. package/dist/esm/HorizontalArticleListing-cccace2e.js +1 -0
  329. package/dist/esm/HorizontalArticleListing.js +1 -163
  330. package/dist/esm/HorizontalHero-8633a55c.js +1 -0
  331. package/dist/esm/HorizontalHero.js +1 -105
  332. package/dist/esm/ImageSlider-c354db50.js +1 -0
  333. package/dist/esm/IssueContentDeck-915409a7.js +1 -0
  334. package/dist/esm/IssueContentDeck.js +1 -231
  335. package/dist/esm/IssueDeck-61a4a550.js +1 -0
  336. package/dist/esm/IssueDeck.js +1 -258
  337. package/dist/esm/IssueLanding-a59c91ee.js +1 -0
  338. package/dist/esm/IssueLanding.js +1 -170
  339. package/dist/esm/KMTracker-d9e1c288.js +1 -0
  340. package/dist/esm/KMTracker.js +1 -25
  341. package/dist/esm/LeftNav-a3852fbe.js +1 -0
  342. package/dist/esm/LeftNav.js +1 -145
  343. package/dist/esm/Magazine-7d6e5dcd.js +1 -0
  344. package/dist/esm/MasterDeck-41c7cd70.js +1 -0
  345. package/dist/esm/MasterDeck.js +1 -548
  346. package/dist/esm/MasterDeckPaginated.js +1 -461
  347. package/dist/esm/MediaSeriesCard-cf72ce87.js +1 -0
  348. package/dist/esm/MediaSeriesLanding.js +1 -501
  349. package/dist/esm/MediaSeriesLandingPaginated.js +1 -527
  350. package/dist/esm/Native-bf89940a.js +1 -0
  351. package/dist/esm/NavDvm.js +1 -264
  352. package/dist/esm/NavFooter-83d89acd.js +1 -0
  353. package/dist/esm/NavMagazine.js +1 -601
  354. package/dist/esm/NavNative.js +1 -865
  355. package/dist/esm/Normal-06895213.js +1 -0
  356. package/dist/esm/OncliveHero-19794e52.js +1 -0
  357. package/dist/esm/OncliveHero.js +1 -73
  358. package/dist/esm/OncliveLargeHero-01d4c10f.js +1 -0
  359. package/dist/esm/OncliveLargeHero.js +1 -235
  360. package/dist/esm/PageFilter-81144bcb.js +1 -0
  361. package/dist/esm/PageFilter.js +1 -66
  362. package/dist/esm/Pagination-44c3ff7c.js +1 -0
  363. package/dist/esm/PartnerDetailListing-429d60e1.js +1 -0
  364. package/dist/esm/PartnerDetailListing.js +1 -338
  365. package/dist/esm/PartnerDetailListingPaginated.js +1 -347
  366. package/dist/esm/PdfDownload-eff648d3.js +1 -0
  367. package/dist/esm/PdfDownload.js +1 -22
  368. package/dist/esm/PixelTracking.js +1 -156
  369. package/dist/esm/PodcastsLanding.js +1 -229
  370. package/dist/esm/PopUpModal-a2735a23.js +1 -0
  371. package/dist/esm/PopUpModal.js +1 -51
  372. package/dist/esm/PtceDeck.js +1 -143
  373. package/dist/esm/PubSection-3d940b53.js +1 -0
  374. package/dist/esm/PubSection.js +1 -114
  375. package/dist/esm/PubToc-52a85696.js +1 -0
  376. package/dist/esm/PubToc.js +1 -81
  377. package/dist/esm/PublicationDeck-538d397e.js +1 -0
  378. package/dist/esm/PublicationDeck.js +1 -173
  379. package/dist/esm/PublicationFeature-6deea07c.js +1 -0
  380. package/dist/esm/PublicationLanding-48ebce9b.js +1 -0
  381. package/dist/esm/PublicationLanding.js +1 -843
  382. package/dist/esm/Queue-847df47f.js +1 -0
  383. package/dist/esm/QueueDeckExpanded-fdc60f72.js +1 -0
  384. package/dist/esm/QueueDeckExpanded.js +1 -1534
  385. package/dist/esm/QueueDeckExpandedPaginated.js +1 -1382
  386. package/dist/esm/RecentNews.js +1 -85
  387. package/dist/esm/RelatedContent-f3eaad29.js +1 -0
  388. package/dist/esm/RelatedContent.js +1 -108
  389. package/dist/esm/RelatedTopicsDropdown-0cf5829a.js +1 -0
  390. package/dist/esm/RelatedTopicsDropdown.js +1 -82
  391. package/dist/esm/RolesDeck-6146633e.js +1 -0
  392. package/dist/esm/RolesDeck.js +1 -84
  393. package/dist/esm/Schema-c7f42de0.js +1 -0
  394. package/dist/esm/Schema.js +1 -97
  395. package/dist/esm/Search.js +1 -57
  396. package/dist/esm/Segment.js +1 -450
  397. package/dist/esm/SeriesListingDeck.js +1 -242
  398. package/dist/esm/SeriesSlider-a00cd257.js +1 -0
  399. package/dist/esm/SetCookie.js +1 -8
  400. package/dist/esm/SideFooter-7cd5abc0.js +1 -0
  401. package/dist/esm/SideFooter.js +1 -144
  402. package/dist/esm/SocialIcons-c7861c13.js +1 -0
  403. package/dist/esm/SocialIcons.js +1 -97
  404. package/dist/esm/SocialNavFooter-66c6cf3c.js +1 -0
  405. package/dist/esm/SocialSearchComponent-e74e11f8.js +1 -0
  406. package/dist/esm/SocialShare-9cc43665.js +1 -0
  407. package/dist/esm/SocialShare.js +1 -67
  408. package/dist/esm/TaxonomyCard-507f5c95.js +1 -0
  409. package/dist/esm/TaxonomyCard.js +1 -247
  410. package/dist/esm/TaxonomyDescription-ee6ae52e.js +1 -0
  411. package/dist/esm/TaxonomyDescription.js +1 -202
  412. package/dist/esm/TemplateNormal.js +1 -196
  413. package/dist/esm/ThumbnailCard-b7a3af71.js +1 -0
  414. package/dist/esm/ThumbnailCard.js +1 -52
  415. package/dist/esm/Ustream-29dc2277.js +1 -0
  416. package/dist/esm/Ustream.js +1 -150
  417. package/dist/esm/VerticalHero-ffc93a70.js +1 -0
  418. package/dist/esm/VerticalHero.js +1 -68
  419. package/dist/esm/VideoProgramLandingPage-179db5b2.js +1 -0
  420. package/dist/esm/VideoProgramLandingPage.js +1 -255
  421. package/dist/esm/VideoSeriesCard.js +1 -82
  422. package/dist/esm/VideoSeriesFilter-b6bd4c07.js +1 -0
  423. package/dist/esm/VideoSeriesFilter.js +1 -122
  424. package/dist/esm/VideoSeriesLandingPage-180a2469.js +1 -0
  425. package/dist/esm/VideoSeriesLandingPage.js +1 -172
  426. package/dist/esm/VideoSeriesListing-62650a53.js +1 -0
  427. package/dist/esm/VideoSeriesListing.js +1 -415
  428. package/dist/esm/View.js +1 -2669
  429. package/dist/esm/YahooHero-ddfeb2a5.js +1 -0
  430. package/dist/esm/YahooHero.js +1 -120
  431. package/dist/esm/YoutubeGroup-1dd6f1ba.js +1 -0
  432. package/dist/esm/YoutubeGroup.js +1 -365
  433. package/dist/esm/_commonjsHelpers-57e89916.js +1 -0
  434. package/dist/esm/beam-50a5c4d8.js +1 -0
  435. package/dist/esm/checkSisterSite-20e2bf62.js +1 -0
  436. package/dist/esm/defineProperty-18999f8e.js +1 -0
  437. package/dist/esm/entities-8b138943.js +1 -0
  438. package/dist/esm/extends-e61fd370.js +1 -0
  439. package/dist/esm/faundadb.js +1 -396
  440. package/dist/esm/getContentCategory-f99fdf90.js +1 -0
  441. package/dist/esm/getKeywords-2512775a.js +1 -0
  442. package/dist/esm/getKeywords.js +1 -44
  443. package/dist/esm/getPrototypeOf-a8361cb6.js +1 -0
  444. package/dist/esm/getPtceActivities.js +1 -87
  445. package/dist/esm/getQuery-bfc0390c.js +1 -0
  446. package/dist/esm/getQuery.js +1 -26
  447. package/dist/esm/getRelatedArticle-66a08458.js +1 -0
  448. package/dist/esm/getRelatedArticle.js +1 -476
  449. package/dist/esm/getRootDocGroup.js +1 -60
  450. package/dist/esm/getSerializers.js +1 -62
  451. package/dist/esm/getSeriesDetail-aef9680c.js +1 -0
  452. package/dist/esm/getSeriesDetail.js +1 -38
  453. package/dist/esm/getTargeting-eeb7bb6a.js +1 -0
  454. package/dist/esm/getTargeting.js +1 -7
  455. package/dist/esm/index-00bbf2b1.js +1 -0
  456. package/dist/esm/index-24498aa0.js +1 -0
  457. package/dist/esm/index-541d17f5.js +1 -0
  458. package/dist/esm/index-a96a4f73.js +1 -0
  459. package/dist/esm/index.js +1 -536
  460. package/dist/esm/searchForm-8218e558.js +1 -0
  461. package/dist/esm/segment-lib-3a19dbdd.js +1 -0
  462. package/dist/esm/setCookie-0f2ab6df.js +1 -0
  463. package/dist/esm/slicedToArray-f57adb2c.js +1 -0
  464. package/dist/esm/style-inject.es-1f59c1d0.js +1 -28
  465. package/dist/esm/timeDifferenceCalc.js +1 -37
  466. package/dist/esm/toConsumableArray-2f86a0c1.js +1 -0
  467. package/dist/esm/typeof-92b42de1.js +1 -0
  468. package/dist/esm/unsupportedIterableToArray-b359dd50.js +1 -0
  469. package/dist/esm/urlFor-649884fa.js +1 -0
  470. package/dist/esm/urlFor.js +1 -63
  471. package/dist/esm/urlForFile-3b87fb01.js +1 -0
  472. package/dist/esm/ustream-api-7998d140.js +1 -0
  473. package/package.json +21 -20
  474. package/dist/cjs/ADInfeed-08a6ef56.js +0 -66
  475. package/dist/cjs/ADlgInfeed-f46139b2.js +0 -60
  476. package/dist/cjs/AuthorComponent-17e1c62b.js +0 -96
  477. package/dist/cjs/BlockContent-8b494587.js +0 -916
  478. package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
  479. package/dist/cjs/Dfp-bcaa7e3f.js +0 -103
  480. package/dist/cjs/ImageSlider-10cd194f.js +0 -1383
  481. package/dist/cjs/MediaSeriesCard-a6e3f32e.js +0 -81
  482. package/dist/cjs/NavFooter-4799de4b.js +0 -71
  483. package/dist/cjs/Pagination-7624a3bd.js +0 -90
  484. package/dist/cjs/PublicationFeature-6f89fb97.js +0 -130
  485. package/dist/cjs/SeriesSlider-08699353.js +0 -332
  486. package/dist/cjs/SocialSearchComponent-59192efd.js +0 -213
  487. package/dist/cjs/Tooltip-7be5df78.js +0 -9229
  488. package/dist/cjs/_commonjsHelpers-06173234.js +0 -25
  489. package/dist/cjs/_is-array-aa52fa1e.js +0 -74
  490. package/dist/cjs/_iter-detect-05795553.js +0 -52
  491. package/dist/cjs/_library-dd23b178.js +0 -5
  492. package/dist/cjs/_object-pie-68c5bcbc.js +0 -16
  493. package/dist/cjs/_object-sap-171b9ea5.js +0 -16
  494. package/dist/cjs/_object-to-array-9bac8737.js +0 -25
  495. package/dist/cjs/asyncToGenerator-df19209d.js +0 -1395
  496. package/dist/cjs/brightcove-react-player-loader.es-5c98aec7.js +0 -2232
  497. package/dist/cjs/checkSisterSite-b29833b2.js +0 -19
  498. package/dist/cjs/core.get-iterator-method-f3c44602.js +0 -584
  499. package/dist/cjs/debounce-529c8d06.js +0 -216
  500. package/dist/cjs/define-property-21887c62.js +0 -20
  501. package/dist/cjs/entities-310b46ee.js +0 -506
  502. package/dist/cjs/eq-bb2843ed.js +0 -79
  503. package/dist/cjs/extends-7df78678.js +0 -86
  504. package/dist/cjs/get-adbb11e3.js +0 -920
  505. package/dist/cjs/getContentCategory-f38a4c00.js +0 -11
  506. package/dist/cjs/getTargeting-5eabd6e2.js +0 -164
  507. package/dist/cjs/iconBase-68959171.js +0 -84
  508. package/dist/cjs/index-187c967e.js +0 -54
  509. package/dist/cjs/index-44481153.js +0 -1664
  510. package/dist/cjs/index-99edf08a.js +0 -1572
  511. package/dist/cjs/index-9d365128.js +0 -613
  512. package/dist/cjs/index-b278e08f.js +0 -10526
  513. package/dist/cjs/index-b5eb3ff8.js +0 -551
  514. package/dist/cjs/index-bd6c9f56.js +0 -211
  515. package/dist/cjs/index.es-f3e47207.js +0 -445
  516. package/dist/cjs/index.esm-44f3e2d0.js +0 -13
  517. package/dist/cjs/index.esm-48e0f0d8.js +0 -19
  518. package/dist/cjs/index.esm-f4cf6943.js +0 -97
  519. package/dist/cjs/index.esm-f93506ac.js +0 -25
  520. package/dist/cjs/inherits-420ee86f.js +0 -185
  521. package/dist/cjs/isSymbol-04666465.js +0 -209
  522. package/dist/cjs/js.cookie-a511c430.js +0 -160
  523. package/dist/cjs/keys-d207942e.js +0 -25
  524. package/dist/cjs/lodash-7fd85bcf.js +0 -17147
  525. package/dist/cjs/main-7b5e57b0.js +0 -898
  526. package/dist/cjs/md5-e1ca5797.js +0 -323
  527. package/dist/cjs/moment-ca3bd9fb.js +0 -5669
  528. package/dist/cjs/react-social-icons-07939b41.js +0 -616
  529. package/dist/cjs/slicedToArray-f6d4eaa8.js +0 -95
  530. package/dist/cjs/smoothscroll-5054361f.js +0 -438
  531. package/dist/cjs/stringify-bbc68047.js +0 -17
  532. package/dist/cjs/toConsumableArray-c9b8a0d0.js +0 -74
  533. package/dist/cjs/toNumber-36d1e7e5.js +0 -69
  534. package/dist/cjs/typeof-ec08d471.js +0 -382
  535. package/dist/cjs/urlForFile-ad96158c.js +0 -24
  536. package/dist/cjs/ustream-api-9ebe112f.js +0 -106
  537. package/dist/cjs/util-f2c1b65b.js +0 -576
  538. package/dist/cjs/visibility-sensor-eb2c5b69.js +0 -597
  539. package/dist/cjs/web.dom.iterable-e34bf324.js +0 -50
  540. package/dist/esm/ADInfeed-36973a76.js +0 -59
  541. package/dist/esm/ADlgInfeed-f6e898d5.js +0 -54
  542. package/dist/esm/AuthorComponent-b0a47123.js +0 -90
  543. package/dist/esm/BlockContent-d05b5b23.js +0 -909
  544. package/dist/esm/ConferenceBanner-9162d0ca.js +0 -18
  545. package/dist/esm/Dfp-e151d2de.js +0 -96
  546. package/dist/esm/ImageSlider-5ae6287a.js +0 -1375
  547. package/dist/esm/MediaSeriesCard-66045ffb.js +0 -75
  548. package/dist/esm/NavFooter-da30eae3.js +0 -65
  549. package/dist/esm/Pagination-1e09918f.js +0 -82
  550. package/dist/esm/PublicationFeature-0379cc20.js +0 -121
  551. package/dist/esm/SeriesSlider-b364d074.js +0 -326
  552. package/dist/esm/SocialSearchComponent-09b55779.js +0 -204
  553. package/dist/esm/Tooltip-af3e4ee9.js +0 -9220
  554. package/dist/esm/_commonjsHelpers-0c4b6f40.js +0 -19
  555. package/dist/esm/_is-array-31d40a83.js +0 -71
  556. package/dist/esm/_iter-detect-72edfd60.js +0 -48
  557. package/dist/esm/_library-528f1934.js +0 -3
  558. package/dist/esm/_object-pie-33c40e79.js +0 -13
  559. package/dist/esm/_object-sap-4201ccf6.js +0 -14
  560. package/dist/esm/_object-to-array-fa0feeff.js +0 -23
  561. package/dist/esm/asyncToGenerator-9c835201.js +0 -1387
  562. package/dist/esm/brightcove-react-player-loader.es-4abff0b1.js +0 -2226
  563. package/dist/esm/checkSisterSite-baa4fb6b.js +0 -17
  564. package/dist/esm/core.get-iterator-method-8c71f470.js +0 -547
  565. package/dist/esm/debounce-9207d8ee.js +0 -214
  566. package/dist/esm/define-property-a8a00786.js +0 -18
  567. package/dist/esm/entities-7cc3bf45.js +0 -503
  568. package/dist/esm/eq-b470f743.js +0 -76
  569. package/dist/esm/extends-7fbbe94e.js +0 -83
  570. package/dist/esm/get-1e515072.js +0 -918
  571. package/dist/esm/getContentCategory-15dcc413.js +0 -9
  572. package/dist/esm/getTargeting-eed01f73.js +0 -161
  573. package/dist/esm/iconBase-602d52fe.js +0 -81
  574. package/dist/esm/index-1819118a.js +0 -1655
  575. package/dist/esm/index-3a7c5bbe.js +0 -10504
  576. package/dist/esm/index-51a80699.js +0 -548
  577. package/dist/esm/index-6c12bdd5.js +0 -605
  578. package/dist/esm/index-c7e2ac95.js +0 -52
  579. package/dist/esm/index-db3bb315.js +0 -207
  580. package/dist/esm/index-fa2ffe86.js +0 -1570
  581. package/dist/esm/index.es-c6222053.js +0 -439
  582. package/dist/esm/index.esm-55f22b35.js +0 -14
  583. package/dist/esm/index.esm-9d701385.js +0 -90
  584. package/dist/esm/index.esm-c6715e80.js +0 -10
  585. package/dist/esm/index.esm-d1125763.js +0 -18
  586. package/dist/esm/inherits-d26c739e.js +0 -179
  587. package/dist/esm/isSymbol-1981418f.js +0 -203
  588. package/dist/esm/js.cookie-6874175c.js +0 -158
  589. package/dist/esm/keys-5e9bd229.js +0 -23
  590. package/dist/esm/lodash-ec8c6b48.js +0 -17145
  591. package/dist/esm/main-43ca42fe.js +0 -886
  592. package/dist/esm/md5-4e42248e.js +0 -321
  593. package/dist/esm/moment-b6f49411.js +0 -5667
  594. package/dist/esm/react-social-icons-3822f1ce.js +0 -609
  595. package/dist/esm/slicedToArray-99bcfd93.js +0 -92
  596. package/dist/esm/smoothscroll-0cd4c7a6.js +0 -436
  597. package/dist/esm/stringify-0c65d837.js +0 -15
  598. package/dist/esm/toConsumableArray-47a5394a.js +0 -71
  599. package/dist/esm/toNumber-2f7a84cd.js +0 -67
  600. package/dist/esm/typeof-d92ed6e0.js +0 -378
  601. package/dist/esm/urlForFile-0fc42ed8.js +0 -22
  602. package/dist/esm/ustream-api-cbba615a.js +0 -104
  603. package/dist/esm/util-7700fc59.js +0 -574
  604. package/dist/esm/visibility-sensor-f40c2564.js +0 -590
  605. package/dist/esm/web.dom.iterable-406140e0.js +0 -48
package/dist/cjs/Auth.js CHANGED
@@ -1,3514 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
6
- require('./core.get-iterator-method-f3c44602.js');
7
- require('./_library-dd23b178.js');
8
- require('./_iter-detect-05795553.js');
9
- require('./_object-pie-68c5bcbc.js');
10
- var _extends = require('./extends-7df78678.js');
11
- require('./web.dom.iterable-e34bf324.js');
12
- var React = require('react');
13
- var Router = require('next/router');
14
- var slicedToArray = require('./slicedToArray-f6d4eaa8.js');
15
- var stringify = require('./stringify-bbc68047.js');
16
- var asyncToGenerator = require('./asyncToGenerator-df19209d.js');
17
- var reactBootstrap = require('react-bootstrap');
18
- var util = require('./util-f2c1b65b.js');
19
- var index = require('./index-bd6c9f56.js');
20
- var useSWR = require('swr');
21
- var Local = require('passport-local');
22
- var mysql = require('mysql');
23
- var md5 = require('./md5-e1ca5797.js');
24
-
25
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
-
27
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
- var Router__default = /*#__PURE__*/_interopDefaultLegacy(Router);
29
- var useSWR__default = /*#__PURE__*/_interopDefaultLegacy(useSWR);
30
- var Local__default = /*#__PURE__*/_interopDefaultLegacy(Local);
31
- var mysql__default = /*#__PURE__*/_interopDefaultLegacy(mysql);
32
-
33
- var returnFormField = function returnFormField(_ref) {
34
- var name = _ref.name,
35
- label = _ref.label,
36
- type = _ref.type,
37
- _ref$required = _ref.required,
38
- required = _ref$required === undefined ? false : _ref$required,
39
- _ref$readonly = _ref.readonly,
40
- readonly = _ref$readonly === undefined ? false : _ref$readonly,
41
- _ref$options = _ref.options,
42
- options = _ref$options === undefined ? null : _ref$options,
43
- _ref$groupType = _ref.groupType,
44
- groupType = _ref$groupType === undefined ? '' : _ref$groupType,
45
- _ref$errors = _ref.errors,
46
- errors = _ref$errors === undefined ? {} : _ref$errors,
47
- _ref$handleChanged = _ref.handleChanged,
48
- handleChanged = _ref$handleChanged === undefined ? null : _ref$handleChanged,
49
- _ref$default_value = _ref.default_value,
50
- default_value = _ref$default_value === undefined ? null : _ref$default_value;
51
-
52
- var opts = [];
53
- if (groupType) {
54
- opts['as'] = groupType;
55
- if (groupType === reactBootstrap.Col) {
56
- opts['xs'] = 12;
57
- opts['md'] = 6;
58
- }
59
- }
60
-
61
- if (handleChanged) {
62
- opts['onChange'] = handleChanged;
63
- }
64
-
65
- if (readonly) {
66
- opts['readOnly'] = readonly;
67
- }
68
-
69
- if (type == 'text' || type == 'email' || type == 'password' || type == 'number') {
70
- return React__default['default'].createElement(
71
- reactBootstrap.Form.Group,
72
- _extends._extends({}, opts, { controlId: name }),
73
- React__default['default'].createElement(
74
- reactBootstrap.Form.Label,
75
- { kye: name + '_label' },
76
- label,
77
- required && React__default['default'].createElement(
78
- 'span',
79
- { style: { color: 'red' } },
80
- '*'
81
- )
82
- ),
83
- React__default['default'].createElement(reactBootstrap.Form.Control, { key: name + '_' + type, type: type, readOnly: readonly, name: name, placeholder: '', defaultValue: default_value, required: required }),
84
- React__default['default'].createElement(
85
- reactBootstrap.Form.Control.Feedback,
86
- { key: name + '_feedback', type: 'invalid' },
87
- errors[name]
88
- )
89
- );
90
- }
91
- if (type == 'select') {
92
- return React__default['default'].createElement(
93
- reactBootstrap.Form.Group,
94
- _extends._extends({}, opts, { key: name, controlId: name }),
95
- React__default['default'].createElement(
96
- reactBootstrap.Form.Label,
97
- { key: name + '_' + label },
98
- label,
99
- required && React__default['default'].createElement(
100
- 'span',
101
- { key: name + '_required_span', style: { color: 'red' } },
102
- '*'
103
- )
104
- ),
105
- React__default['default'].createElement(
106
- reactBootstrap.Form.Control,
107
- { key: name + '_select', as: 'select', name: name, required: required, defaultValue: default_value },
108
- React__default['default'].createElement('option', { value: '', key: name + '_options_empty' }),
109
- options.map(function (option, index) {
110
- var value = option.value ? option.value : option;
111
- var label = option.label ? option.label : option;
112
- var key = name + '_options_' + index;
113
- return React__default['default'].createElement(
114
- 'option',
115
- { key: key, value: value },
116
- label
117
- );
118
- })
119
- )
120
- );
121
- }
122
-
123
- if (type == 'radio' || type == 'checkbox') {
124
- return React__default['default'].createElement(
125
- reactBootstrap.Form.Group,
126
- opts,
127
- React__default['default'].createElement(
128
- reactBootstrap.Form.Label,
129
- null,
130
- label,
131
- required && React__default['default'].createElement(
132
- 'span',
133
- { style: { color: 'red' } },
134
- '*'
135
- )
136
- ),
137
- options.map(function (option, index) {
138
- return React__default['default'].createElement(
139
- reactBootstrap.Form.Check,
140
- { type: type, key: index, required: required },
141
- React__default['default'].createElement(reactBootstrap.Form.Check.Input, { type: type, key: type + '_' + index + '_input', defaultChecked: default_value ? default_value === option.value : false, name: name, id: name + '_' + index, value: option.value, required: required }),
142
- React__default['default'].createElement(reactBootstrap.Form.Check.Label, { style: { cursor: 'pointer' }, 'for': name + '_' + index, key: type + '_' + index + '_label', dangerouslySetInnerHTML: { __html: option.label } })
143
- );
144
- })
145
- );
146
- }
147
- };
148
-
149
- var _this = undefined;
150
-
151
- var dataHandler = function () {
152
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(api_url, body) {
153
- var res, result;
154
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
155
- while (1) {
156
- switch (_context.prev = _context.next) {
157
- case 0:
158
- _context.prev = 0;
159
- _context.next = 3;
160
- return fetch(api_url, {
161
- method: 'POST',
162
- headers: { 'Content-Type': 'application/json' },
163
- body: stringify._JSON$stringify(body)
164
- });
165
-
166
- case 3:
167
- res = _context.sent;
168
-
169
- if (!(res.status === 200)) {
170
- _context.next = 13;
171
- break;
172
- }
173
-
174
- _context.next = 7;
175
- return res.json();
176
-
177
- case 7:
178
- result = _context.sent;
179
-
180
- if (!result.error) {
181
- _context.next = 10;
182
- break;
183
- }
184
-
185
- throw new Error(result.error);
186
-
187
- case 10:
188
- return _context.abrupt('return', result.data);
189
-
190
- case 13:
191
- _context.t0 = Error;
192
- _context.next = 16;
193
- return res.text();
194
-
195
- case 16:
196
- _context.t1 = _context.sent;
197
- throw new _context.t0(_context.t1);
198
-
199
- case 18:
200
- _context.next = 24;
201
- break;
202
-
203
- case 20:
204
- _context.prev = 20;
205
- _context.t2 = _context['catch'](0);
206
-
207
- console.error('data handler failed : ' + api_url, _context.t2);
208
- return _context.abrupt('return', null);
209
-
210
- case 24:
211
- case 'end':
212
- return _context.stop();
213
- }
214
- }
215
- }, _callee, _this, [[0, 20]]);
216
- }));
217
-
218
- return function dataHandler(_x, _x2) {
219
- return _ref.apply(this, arguments);
220
- };
221
- }();
222
-
223
- function useUser() {
224
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
225
- redirectTo = _ref.redirectTo,
226
- redirectIfFound = _ref.redirectIfFound;
227
-
228
- var _useSWR = useSWR__default['default']('/api/auth/user', dataHandler),
229
- data = _useSWR.data,
230
- error = _useSWR.error;
231
-
232
- var user = data;
233
- var finished = Boolean(data);
234
- var hasUser = Boolean(user);
235
-
236
- React.useEffect(function () {
237
- if (!redirectTo || !finished) return;
238
- if (
239
- // If redirectTo is set, redirect if the user was not found.
240
- redirectTo && !redirectIfFound && !hasUser ||
241
- // If redirectIfFound is also set, redirect if the user was found
242
- redirectIfFound && hasUser) {
243
- Router__default['default'].push(redirectTo);
244
- }
245
- }, [redirectTo, redirectIfFound, finished, hasUser]);
246
-
247
- return error ? null : user;
248
- }
249
-
250
- var hooks = /*#__PURE__*/Object.freeze({
251
- __proto__: null,
252
- useUser: useUser
253
- });
254
-
255
- var LoginForm = function LoginForm(props) {
256
- var handleSubmit = function () {
257
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(e) {
258
- var body, res;
259
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
260
- while (1) {
261
- switch (_context.prev = _context.next) {
262
- case 0:
263
- event.preventDefault();
264
-
265
- if (errorMsg) setErrorMsg('');
266
- setLoading(true);
267
-
268
- body = {
269
- email: e.currentTarget.email.value,
270
- password: e.currentTarget.password.value
271
- };
272
- _context.prev = 4;
273
- _context.next = 7;
274
- return fetch('/api/auth/login', {
275
- method: 'POST',
276
- headers: { 'Content-Type': 'application/json' },
277
- body: stringify._JSON$stringify(body)
278
- });
279
-
280
- case 7:
281
- res = _context.sent;
282
-
283
- setLoading(false);
284
-
285
- if (!(res.status === 200)) {
286
- _context.next = 13;
287
- break;
288
- }
289
-
290
- // here, Router.push() does not carry new cookie value.
291
- // so need hard redirect
292
- window.location.href = callbackUrl;
293
- _context.next = 18;
294
- break;
295
-
296
- case 13:
297
- _context.t0 = Error;
298
- _context.next = 16;
299
- return res.text();
300
-
301
- case 16:
302
- _context.t1 = _context.sent;
303
- throw new _context.t0(_context.t1);
304
-
305
- case 18:
306
- _context.next = 23;
307
- break;
308
-
309
- case 20:
310
- _context.prev = 20;
311
- _context.t2 = _context['catch'](4);
312
-
313
- setErrorMsg(_context.t2.message);
314
-
315
- case 23:
316
- case 'end':
317
- return _context.stop();
318
- }
319
- }
320
- }, _callee, this, [[4, 20]]);
321
- }));
322
-
323
- return function handleSubmit(_x) {
324
- return _ref.apply(this, arguments);
325
- };
326
- }();
327
-
328
- var _props$callbackUrl = props.callbackUrl,
329
- callbackUrl = _props$callbackUrl === undefined ? '/' : _props$callbackUrl;
330
-
331
-
332
- React.useEffect(function () {
333
- if (props.user) {
334
- window.location.href = '/auth/profile';
335
- }
336
- }, []);
337
- useUser('/auth/profile', true);
338
-
339
- var _useState = React.useState(''),
340
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
341
- errorMsg = _useState2[0],
342
- setErrorMsg = _useState2[1];
343
-
344
- var _useState3 = React.useState(false),
345
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
346
- loading = _useState4[0],
347
- setLoading = _useState4[1];
348
-
349
- return React__default['default'].createElement(
350
- reactBootstrap.Form,
351
- { className: 'login', onSubmit: handleSubmit },
352
- React__default['default'].createElement(
353
- 'h1',
354
- null,
355
- 'Login'
356
- ),
357
- React__default['default'].createElement('hr', null),
358
- returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
359
- returnFormField({ name: 'password', label: 'Password', type: 'password', required: true }),
360
- React__default['default'].createElement('hr', null),
361
- React__default['default'].createElement(
362
- reactBootstrap.Form.Row,
363
- null,
364
- React__default['default'].createElement(
365
- reactBootstrap.Form.Group,
366
- { as: reactBootstrap.Col },
367
- React__default['default'].createElement(
368
- 'a',
369
- { href: '/auth/signup' },
370
- 'I don\'t have an account'
371
- )
372
- ),
373
- React__default['default'].createElement(
374
- reactBootstrap.Form.Group,
375
- { as: reactBootstrap.Col, className: 'text-right' },
376
- !loading && React__default['default'].createElement(
377
- reactBootstrap.Button,
378
- { type: 'submit' },
379
- 'Login'
380
- ),
381
- loading && React__default['default'].createElement(
382
- reactBootstrap.Button,
383
- { variant: 'primary', disabled: true },
384
- React__default['default'].createElement(reactBootstrap.Spinner, { as: 'span', animation: 'border', role: 'status', 'aria-hidden': 'true', size: 'sm' }),
385
- React__default['default'].createElement(
386
- 'span',
387
- { className: 'sr-only' },
388
- 'Loading...'
389
- )
390
- )
391
- )
392
- ),
393
- errorMsg && React__default['default'].createElement(
394
- 'p',
395
- { className: 'error' },
396
- errorMsg
397
- ),
398
- React__default['default'].createElement(
399
- 'style',
400
- { jsx: 'true'.toString() },
401
- '\n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
402
- )
403
- );
404
- };
405
-
406
- // get country & state options
407
- var countries = ["United States", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas (the)", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia (Plurinational State of)", "Bonaire, Sint Eustatius and Saba", "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory (the)", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cabo Verde", "Cambodia", "Cameroon", "Canada", "Cayman Islands (the)", "Central African Republic (the)", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands (the)", "Colombia", "Comoros (the)", "Congo (the Democratic Republic of the)", "Congo (the)", "Cook Islands (the)", "Costa Rica", "Croatia", "Cuba", "Curaçao", "Cyprus", "Czechia", "Côte d'Ivoire", "Denmark", "Djibouti", "Dominica", "Dominican Republic (the)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Eswatini", "Ethiopia", "Falkland Islands (the) [Malvinas]", "Faroe Islands (the)", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Territories (the)", "Gabon", "Gambia (the)", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard Island and McDonald Islands", "Holy See (the)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea (the Democratic People's Republic of)", "Korea (the Republic of)", "Kuwait", "Kyrgyzstan", "Lao People's Democratic Republic (the)", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands (the)", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia (Federated States of)", "Moldova (the Republic of)", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands (the)", "New Caledonia", "New Zealand", "Nicaragua", "Niger (the)", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands (the)", "Norway", "Oman", "Pakistan", "Palau", "Palestine, State of", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines (the)", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Republic of North Macedonia", "Romania", "Russian Federation (the)", "Rwanda", "Réunion", "Saint Barthélemy", "Saint Helena, Ascension and Tristan da Cunha", "Saint Kitts and Nevis", "Saint Lucia", "Saint Martin (French part)", "Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Sint Maarten (Dutch part)", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Sudan", "Spain", "Sri Lanka", "Sudan (the)", "Suriname", "Svalbard and Jan Mayen", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan (Province of China)", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Timor-Leste", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands (the)", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates (the)", "United Kingdom of Great Britain and Northern Ireland (the)", "United States Minor Outlying Islands (the)", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela (Bolivarian Republic of)", "Viet Nam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna", "Western Sahara", "Yemen", "Zambia", "Zimbabwe", "Åland Islands"];
408
-
409
- var states = ['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FM', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MH', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PW', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY'];
410
-
411
- var _this$1 = undefined;
412
-
413
- var SignupForm = function SignupForm(props) {
414
- var handleSubmit = function () {
415
- var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(e) {
416
- var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
417
-
418
- return asyncToGenerator.regenerator.wrap(function _callee3$(_context3) {
419
- while (1) {
420
- switch (_context3.prev = _context3.next) {
421
- case 0:
422
- event.preventDefault();
423
- setLoading(true);
424
- if (errorMsg) setErrorMsg('');
425
-
426
- formData = new FormData(e.currentTarget);
427
- body = {};
428
- _iteratorNormalCompletion = true;
429
- _didIteratorError = false;
430
- _iteratorError = undefined;
431
- _context3.prev = 8;
432
-
433
- for (_iterator = slicedToArray._getIterator(formData.keys()); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
434
- key = _step.value;
435
-
436
- body[key] = formData.get(key);
437
- }
438
-
439
- _context3.next = 16;
440
- break;
441
-
442
- case 12:
443
- _context3.prev = 12;
444
- _context3.t0 = _context3['catch'](8);
445
- _didIteratorError = true;
446
- _iteratorError = _context3.t0;
447
-
448
- case 16:
449
- _context3.prev = 16;
450
- _context3.prev = 17;
451
-
452
- if (!_iteratorNormalCompletion && _iterator.return) {
453
- _iterator.return();
454
- }
455
-
456
- case 19:
457
- _context3.prev = 19;
458
-
459
- if (!_didIteratorError) {
460
- _context3.next = 22;
461
- break;
462
- }
463
-
464
- throw _iteratorError;
465
-
466
- case 22:
467
- return _context3.finish(19);
468
-
469
- case 23:
470
- return _context3.finish(16);
471
-
472
- case 24:
473
- _context3.prev = 24;
474
- _context3.next = 27;
475
- return fetch('/api/auth/signup', {
476
- method: 'POST',
477
- headers: { 'Content-Type': 'application/json' },
478
- body: stringify._JSON$stringify(body)
479
- });
480
-
481
- case 27:
482
- res = _context3.sent;
483
-
484
- setLoading(false);
485
-
486
- if (!(res.status === 200)) {
487
- _context3.next = 33;
488
- break;
489
- }
490
-
491
- window.location.href = '/';
492
- _context3.next = 38;
493
- break;
494
-
495
- case 33:
496
- _context3.t1 = Error;
497
- _context3.next = 36;
498
- return res.text();
499
-
500
- case 36:
501
- _context3.t2 = _context3.sent;
502
- throw new _context3.t1(_context3.t2);
503
-
504
- case 38:
505
- _context3.next = 43;
506
- break;
507
-
508
- case 40:
509
- _context3.prev = 40;
510
- _context3.t3 = _context3['catch'](24);
511
-
512
- setErrorMsg(_context3.t3.message);
513
-
514
- case 43:
515
- case 'end':
516
- return _context3.stop();
517
- }
518
- }
519
- }, _callee3, this, [[8, 12, 16, 24], [17,, 19, 23], [24, 40]]);
520
- }));
521
-
522
- return function handleSubmit(_x2) {
523
- return _ref3.apply(this, arguments);
524
- };
525
- }();
526
-
527
- var _useState = React.useState(''),
528
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
529
- errorMsg = _useState2[0],
530
- setErrorMsg = _useState2[1];
531
-
532
- var _useState3 = React.useState(false),
533
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
534
- countryUS = _useState4[0],
535
- setCountryUS = _useState4[1];
536
-
537
- var _useState5 = React.useState([]),
538
- _useState6 = slicedToArray._slicedToArray(_useState5, 2),
539
- healthcareOccupation = _useState6[0],
540
- setHealthcareOccupation = _useState6[1];
541
-
542
- var _useState7 = React.useState([]),
543
- _useState8 = slicedToArray._slicedToArray(_useState7, 2),
544
- nonHealthcareOccupation = _useState8[0],
545
- setNonHealthcareOccupation = _useState8[1];
546
-
547
- var loadInitData = function () {
548
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
549
- var healthcare_occupation, non_healthcare_occupation;
550
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
551
- while (1) {
552
- switch (_context.prev = _context.next) {
553
- case 0:
554
- _context.next = 2;
555
- return dataHandler('/api/auth/data', { action: 'get-occupation', type: 'Healthcare' });
556
-
557
- case 2:
558
- healthcare_occupation = _context.sent;
559
- _context.next = 5;
560
- return dataHandler('/api/auth/data', { action: 'get-occupation', type: 'Non-Healthcare' });
561
-
562
- case 5:
563
- non_healthcare_occupation = _context.sent;
564
-
565
-
566
- setHealthcareOccupation(healthcare_occupation);
567
- setNonHealthcareOccupation(non_healthcare_occupation);
568
-
569
- case 8:
570
- case 'end':
571
- return _context.stop();
572
- }
573
- }
574
- }, _callee, _this$1);
575
- }));
576
-
577
- return function loadInitData() {
578
- return _ref.apply(this, arguments);
579
- };
580
- }();
581
-
582
- React.useEffect(function () {
583
- if (props.user) {
584
- window.location.href = '/auth/profile';
585
- } else {
586
- loadInitData();
587
- }
588
- }, []);
589
-
590
- // make it to change layout based on radio buton
591
- var handleCountryChanged = function handleCountryChanged(e) {
592
- if (e.target.value === 'United States') {
593
- setCountryUS(true);
594
- } else {
595
- setCountryUS(false);
596
- }
597
- };
598
-
599
- var _useState9 = React.useState(true),
600
- _useState10 = slicedToArray._slicedToArray(_useState9, 2),
601
- healcareProfessional = _useState10[0],
602
- setHealthcareProfessional = _useState10[1];
603
-
604
- var handleHealthcareProfessionalChanged = function handleHealthcareProfessionalChanged(e) {
605
-
606
- if (e.target.value === 'Y') {
607
- setHealthcareProfessional(true);
608
- } else {
609
- setHealthcareProfessional(false);
610
- }
611
- document.getElementById('occupation').value = '';
612
- setOccupationFields(null);
613
- };
614
-
615
- var _useState11 = React.useState(null),
616
- _useState12 = slicedToArray._slicedToArray(_useState11, 2),
617
- occupationFields = _useState12[0],
618
- setOccupationFields = _useState12[1];
619
-
620
- var handleOccupationChanged = function () {
621
- var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(e) {
622
- var occupation, fields;
623
- return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
624
- while (1) {
625
- switch (_context2.prev = _context2.next) {
626
- case 0:
627
- occupation = e.target.value;
628
- _context2.next = 3;
629
- return dataHandler('/api/auth/data', { action: 'get-fields', occupation: occupation });
630
-
631
- case 3:
632
- fields = _context2.sent;
633
-
634
- setOccupationFields(fields);
635
-
636
- case 5:
637
- case 'end':
638
- return _context2.stop();
639
- }
640
- }
641
- }, _callee2, _this$1);
642
- }));
643
-
644
- return function handleOccupationChanged(_x) {
645
- return _ref2.apply(this, arguments);
646
- };
647
- }();
648
-
649
- var _useState13 = React.useState(false),
650
- _useState14 = slicedToArray._slicedToArray(_useState13, 2),
651
- loading = _useState14[0],
652
- setLoading = _useState14[1];
653
-
654
- return React__default['default'].createElement(
655
- reactBootstrap.Form,
656
- { className: 'login', id: 'signupForm', onSubmit: handleSubmit },
657
- React__default['default'].createElement(
658
- 'h1',
659
- null,
660
- 'Sign Up'
661
- ),
662
- React__default['default'].createElement('hr', null),
663
- returnFormField({ name: 'email', label: 'Email', type: 'email', required: true }),
664
- React__default['default'].createElement(
665
- reactBootstrap.Form.Row,
666
- null,
667
- returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: reactBootstrap.Col, required: true }),
668
- returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: reactBootstrap.Col, required: true })
669
- ),
670
- React__default['default'].createElement(
671
- reactBootstrap.Form.Row,
672
- null,
673
- returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: reactBootstrap.Col, required: true }),
674
- returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: reactBootstrap.Col, required: true })
675
- ),
676
- React__default['default'].createElement(
677
- reactBootstrap.Form.Row,
678
- null,
679
- returnFormField({
680
- name: 'country',
681
- label: 'Country',
682
- type: 'select',
683
- required: true,
684
- groupType: reactBootstrap.Col,
685
- options: countries,
686
- handleChanged: handleCountryChanged
687
- }),
688
- countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: reactBootstrap.Col, options: states })
689
- ),
690
- React__default['default'].createElement(
691
- reactBootstrap.Form.Row,
692
- null,
693
- countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: reactBootstrap.Col }),
694
- countryUS && returnFormField({ name: 'phone', label: 'Phone', type: 'text', required: true, groupType: reactBootstrap.Col })
695
- ),
696
- returnFormField({
697
- name: 'healthcare_professional',
698
- label: 'Are You a Health Care Professional?',
699
- type: 'radio',
700
- required: true,
701
- options: [{ value: 'Y', label: 'Yes', checked: true }, { value: 'N', label: 'No', checked: false }],
702
- handleChanged: handleHealthcareProfessionalChanged,
703
- default_value: 'Y'
704
- }),
705
- healcareProfessional && returnFormField({
706
- name: 'occupation',
707
- label: 'Occupation',
708
- type: 'select',
709
- required: true,
710
- options: healthcareOccupation,
711
- handleChanged: handleOccupationChanged
712
- }),
713
- !healcareProfessional && returnFormField({
714
- name: 'occupation',
715
- label: 'Non Provider Role',
716
- type: 'select',
717
- required: true,
718
- options: nonHealthcareOccupation,
719
- handleChanged: handleOccupationChanged
720
- }),
721
- occupationFields && occupationFields.map(function (field) {
722
- return returnFormField({
723
- name: field.name,
724
- label: field.label,
725
- type: field.type,
726
- required: field.required === 1,
727
- options: field.options
728
- });
729
- }),
730
- returnFormField({
731
- name: 'agree',
732
- label: 'Terms & Conditions | Privacy Policy',
733
- type: 'checkbox',
734
- required: true,
735
- options: [{ label: 'By registering you agree to our <a href="/terms" style="color:blue">Terms and Conditions</a> and <a href="/privacy" style="color:blue">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
736
- }),
737
- React__default['default'].createElement('hr', null),
738
- React__default['default'].createElement(
739
- reactBootstrap.Form.Row,
740
- null,
741
- React__default['default'].createElement(
742
- reactBootstrap.Form.Group,
743
- { as: reactBootstrap.Col },
744
- React__default['default'].createElement(
745
- 'a',
746
- { href: '/auth/login' },
747
- 'I already have an account'
748
- )
749
- ),
750
- React__default['default'].createElement(
751
- reactBootstrap.Form.Group,
752
- { as: reactBootstrap.Col, className: 'text-right' },
753
- !loading && React__default['default'].createElement(
754
- reactBootstrap.Button,
755
- { type: 'submit' },
756
- 'Sign Up'
757
- ),
758
- loading && React__default['default'].createElement(
759
- reactBootstrap.Button,
760
- { variant: 'primary', disabled: true },
761
- React__default['default'].createElement(reactBootstrap.Spinner, {
762
- as: 'span',
763
- animation: 'border',
764
- role: 'status',
765
- 'aria-hidden': 'true',
766
- size: 'sm'
767
- }),
768
- React__default['default'].createElement(
769
- 'span',
770
- { className: 'sr-only' },
771
- 'Loading...'
772
- )
773
- )
774
- )
775
- ),
776
- errorMsg && React__default['default'].createElement(
777
- 'p',
778
- { className: 'error' },
779
- errorMsg
780
- ),
781
- React__default['default'].createElement(
782
- 'style',
783
- { jsx: 'true'.toString() },
784
- ' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n '
785
- )
786
- );
787
- };
788
-
789
- var _this$2 = undefined;
790
-
791
- var SignupForm$1 = function SignupForm(props) {
792
- var handleSubmit = function () {
793
- var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(e) {
794
- var formData, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key, res;
795
-
796
- return asyncToGenerator.regenerator.wrap(function _callee3$(_context3) {
797
- while (1) {
798
- switch (_context3.prev = _context3.next) {
799
- case 0:
800
- event.preventDefault();
801
-
802
- setErrorMsg('');
803
- setSuccessMsg('');
804
- setLoading(true);
805
-
806
- formData = new FormData(e.currentTarget);
807
- body = {};
808
- _iteratorNormalCompletion = true;
809
- _didIteratorError = false;
810
- _iteratorError = undefined;
811
- _context3.prev = 9;
812
-
813
- for (_iterator = slicedToArray._getIterator(formData.keys()); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
814
- key = _step.value;
815
-
816
- body[key] = formData.get(key);
817
- }
818
-
819
- _context3.next = 17;
820
- break;
821
-
822
- case 13:
823
- _context3.prev = 13;
824
- _context3.t0 = _context3['catch'](9);
825
- _didIteratorError = true;
826
- _iteratorError = _context3.t0;
827
-
828
- case 17:
829
- _context3.prev = 17;
830
- _context3.prev = 18;
831
-
832
- if (!_iteratorNormalCompletion && _iterator.return) {
833
- _iterator.return();
834
- }
835
-
836
- case 20:
837
- _context3.prev = 20;
838
-
839
- if (!_didIteratorError) {
840
- _context3.next = 23;
841
- break;
842
- }
843
-
844
- throw _iteratorError;
845
-
846
- case 23:
847
- return _context3.finish(20);
848
-
849
- case 24:
850
- return _context3.finish(17);
851
-
852
- case 25:
853
- body['user_id'] = userData.id;
854
-
855
- _context3.prev = 26;
856
- _context3.next = 29;
857
- return fetch('/api/auth/profile', {
858
- method: 'POST',
859
- headers: { 'Content-Type': 'application/json' },
860
- body: stringify._JSON$stringify(body)
861
- });
862
-
863
- case 29:
864
- res = _context3.sent;
865
-
866
- setLoading(false);
867
-
868
- if (!(res.status === 200)) {
869
- _context3.next = 35;
870
- break;
871
- }
872
-
873
- setSuccessMsg('Your request has been processed successfully!');
874
- _context3.next = 40;
875
- break;
876
-
877
- case 35:
878
- _context3.t1 = Error;
879
- _context3.next = 38;
880
- return res.text();
881
-
882
- case 38:
883
- _context3.t2 = _context3.sent;
884
- throw new _context3.t1(_context3.t2);
885
-
886
- case 40:
887
- _context3.next = 45;
888
- break;
889
-
890
- case 42:
891
- _context3.prev = 42;
892
- _context3.t3 = _context3['catch'](26);
893
-
894
- setErrorMsg(_context3.t3.message);
895
-
896
- case 45:
897
- case 'end':
898
- return _context3.stop();
899
- }
900
- }
901
- }, _callee3, this, [[9, 13, 17, 25], [18,, 20, 24], [26, 42]]);
902
- }));
903
-
904
- return function handleSubmit(_x2) {
905
- return _ref3.apply(this, arguments);
906
- };
907
- }();
908
-
909
- var _useState = React.useState(''),
910
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
911
- errorMsg = _useState2[0],
912
- setErrorMsg = _useState2[1];
913
-
914
- var _useState3 = React.useState(false),
915
- _useState4 = slicedToArray._slicedToArray(_useState3, 2),
916
- countryUS = _useState4[0],
917
- setCountryUS = _useState4[1];
918
-
919
- var _useState5 = React.useState([]),
920
- _useState6 = slicedToArray._slicedToArray(_useState5, 2),
921
- healthcareOccupation = _useState6[0],
922
- setHealthcareOccupation = _useState6[1];
923
-
924
- var _useState7 = React.useState([]),
925
- _useState8 = slicedToArray._slicedToArray(_useState7, 2),
926
- nonHealthcareOccupation = _useState8[0],
927
- setNonHealthcareOccupation = _useState8[1];
928
-
929
- var _useState9 = React.useState(null),
930
- _useState10 = slicedToArray._slicedToArray(_useState9, 2),
931
- userData = _useState10[0],
932
- setUserData = _useState10[1];
933
-
934
- var user = props.user;
935
-
936
- var loadInitData = function () {
937
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
938
- var healthcare_occupation, non_healthcare_occupation, foundOccupation, fields;
939
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
940
- while (1) {
941
- switch (_context.prev = _context.next) {
942
- case 0:
943
- _context.next = 2;
944
- return dataHandler('/api/auth/data', { action: 'get-occupation', type: 'Healthcare' });
945
-
946
- case 2:
947
- healthcare_occupation = _context.sent;
948
- _context.next = 5;
949
- return dataHandler('/api/auth/data', { action: 'get-occupation', type: 'Non-Healthcare' });
950
-
951
- case 5:
952
- non_healthcare_occupation = _context.sent;
953
- foundOccupation = healthcare_occupation.find(function (item) {
954
- return item.value === user.shared.occupation_id;
955
- });
956
-
957
- if (foundOccupation) {
958
- user.shared.healthcare_professional = 'Y';
959
- } else {
960
- user.shared.healthcare_professional = 'N';
961
- }
962
-
963
- setHealthcareOccupation(healthcare_occupation);
964
- setNonHealthcareOccupation(non_healthcare_occupation);
965
- setUserData(user);
966
-
967
- if (user.shared.country === 'United States') {
968
- setCountryUS(true);
969
- } else {
970
- setCountryUS(false);
971
- }
972
-
973
- _context.next = 14;
974
- return dataHandler('/api/auth/data', { action: 'get-fields', occupation: user.shared.occupation_id });
975
-
976
- case 14:
977
- fields = _context.sent;
978
-
979
- setOccupationFields(fields);
980
-
981
- case 16:
982
- case 'end':
983
- return _context.stop();
984
- }
985
- }
986
- }, _callee, _this$2);
987
- }));
988
-
989
- return function loadInitData() {
990
- return _ref.apply(this, arguments);
991
- };
992
- }();
993
-
994
- React.useEffect(function () {
995
- if (!user) {
996
- window.location.href = '/auth/login';
997
- } else {
998
- loadInitData();
999
- }
1000
- }, []);
1001
-
1002
- // make it to change layout based on radio buton
1003
- var handleCountryChanged = function handleCountryChanged(e) {
1004
- if (e.target.value === 'United States') {
1005
- setCountryUS(true);
1006
- } else {
1007
- setCountryUS(false);
1008
- }
1009
- };
1010
-
1011
- var _useState11 = React.useState(true),
1012
- _useState12 = slicedToArray._slicedToArray(_useState11, 2),
1013
- healcareProfessional = _useState12[0],
1014
- setHealthcareProfessional = _useState12[1];
1015
-
1016
- var handleHealthcareProfessionalChanged = function handleHealthcareProfessionalChanged(e) {
1017
-
1018
- if (e.target.value === 'Y') {
1019
- setHealthcareProfessional(true);
1020
- } else {
1021
- setHealthcareProfessional(false);
1022
- }
1023
- document.getElementById('occupation').value = '';
1024
- setOccupationFields(null);
1025
- };
1026
-
1027
- var _useState13 = React.useState(null),
1028
- _useState14 = slicedToArray._slicedToArray(_useState13, 2),
1029
- occupationFields = _useState14[0],
1030
- setOccupationFields = _useState14[1];
1031
-
1032
- var handleOccupationChanged = function () {
1033
- var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(e) {
1034
- var occupation, fields;
1035
- return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
1036
- while (1) {
1037
- switch (_context2.prev = _context2.next) {
1038
- case 0:
1039
- occupation = e.target.value;
1040
- _context2.next = 3;
1041
- return dataHandler('/api/auth/data', { action: 'get-fields', occupation: occupation });
1042
-
1043
- case 3:
1044
- fields = _context2.sent;
1045
-
1046
- setOccupationFields(fields);
1047
-
1048
- case 5:
1049
- case 'end':
1050
- return _context2.stop();
1051
- }
1052
- }
1053
- }, _callee2, _this$2);
1054
- }));
1055
-
1056
- return function handleOccupationChanged(_x) {
1057
- return _ref2.apply(this, arguments);
1058
- };
1059
- }();
1060
-
1061
- var _useState15 = React.useState(''),
1062
- _useState16 = slicedToArray._slicedToArray(_useState15, 2),
1063
- successMsg = _useState16[0],
1064
- setSuccessMsg = _useState16[1];
1065
-
1066
- var _useState17 = React.useState(false),
1067
- _useState18 = slicedToArray._slicedToArray(_useState17, 2),
1068
- loading = _useState18[0],
1069
- setLoading = _useState18[1];
1070
-
1071
- return React__default['default'].createElement(
1072
- reactBootstrap.Form,
1073
- { className: 'login', id: 'signupForm', onSubmit: handleSubmit },
1074
- React__default['default'].createElement(
1075
- 'h1',
1076
- null,
1077
- 'Profile'
1078
- ),
1079
- React__default['default'].createElement('hr', null),
1080
- userData ? React__default['default'].createElement(
1081
- React__default['default'].Fragment,
1082
- null,
1083
- returnFormField({ name: 'email', label: 'Email', type: 'email', required: true, readonly: true, default_value: userData.email }),
1084
- React__default['default'].createElement(
1085
- reactBootstrap.Form.Row,
1086
- null,
1087
- returnFormField({ name: 'password', label: 'Password', type: 'password', groupType: reactBootstrap.Col, required: false }),
1088
- returnFormField({ name: 'rpassword', label: 'Retype Password', type: 'password', groupType: reactBootstrap.Col, required: false })
1089
- ),
1090
- React__default['default'].createElement(
1091
- reactBootstrap.Form.Row,
1092
- null,
1093
- returnFormField({ name: 'first_name', label: 'First Name', type: 'text', groupType: reactBootstrap.Col, required: true, default_value: userData.shared.first_name }),
1094
- returnFormField({ name: 'last_name', label: 'Last Name', type: 'text', groupType: reactBootstrap.Col, required: true, default_value: userData.shared.last_name })
1095
- ),
1096
- React__default['default'].createElement(
1097
- reactBootstrap.Form.Row,
1098
- null,
1099
- returnFormField({
1100
- name: 'country',
1101
- label: 'Country',
1102
- type: 'select',
1103
- required: true,
1104
- groupType: reactBootstrap.Col,
1105
- options: countries,
1106
- handleChanged: handleCountryChanged,
1107
- default_value: userData.shared.country
1108
- }),
1109
- countryUS && returnFormField({ name: 'state', label: 'State', type: 'select', required: true, groupType: reactBootstrap.Col, options: states, default_value: userData.shared.state })
1110
- ),
1111
- React__default['default'].createElement(
1112
- reactBootstrap.Form.Row,
1113
- null,
1114
- countryUS && returnFormField({ name: 'zip', label: 'Working Zip Code', type: 'text', required: true, groupType: reactBootstrap.Col, default_value: userData.shared.zip }),
1115
- countryUS && returnFormField({ name: 'phone', label: 'Phone', type: 'text', required: true, groupType: reactBootstrap.Col, default_value: userData.shared.phone })
1116
- ),
1117
- returnFormField({
1118
- name: 'healthcare_professional',
1119
- label: 'Are You a Health Care Professional?',
1120
- type: 'radio',
1121
- required: true,
1122
- options: [{ value: 'Y', label: 'Yes', checked: true }, { value: 'N', label: 'No', checked: false }],
1123
- default_value: userData.shared.healthcare_professional,
1124
- handleChanged: handleHealthcareProfessionalChanged
1125
- }),
1126
- healcareProfessional && returnFormField({
1127
- name: 'occupation',
1128
- label: 'Occupation',
1129
- type: 'select',
1130
- required: true,
1131
- options: healthcareOccupation,
1132
- handleChanged: handleOccupationChanged,
1133
- default_value: userData.shared.occupation_id
1134
- }),
1135
- !healcareProfessional && returnFormField({
1136
- name: 'occupation',
1137
- label: 'Non Provider Role',
1138
- type: 'select',
1139
- required: true,
1140
- options: nonHealthcareOccupation,
1141
- handleChanged: handleOccupationChanged,
1142
- default_value: userData.shared.occupation_id
1143
- }),
1144
- occupationFields && occupationFields.map(function (field) {
1145
- return returnFormField({
1146
- name: field.name,
1147
- label: field.label,
1148
- type: field.type,
1149
- required: field.required === 1,
1150
- options: field.options,
1151
- default_value: userData.shared[field.name]
1152
- });
1153
- }),
1154
- returnFormField({
1155
- name: 'agree',
1156
- label: 'Terms & Conditions | Privacy Policy',
1157
- type: 'checkbox',
1158
- required: true,
1159
- options: [{ label: 'By registering you agree to our <a href="/terms">Terms and Conditions</a> and <a href="/privacy">Privacy Policy</a> and understand that you will be receiving email communications', value: 'Y' }]
1160
- }),
1161
- React__default['default'].createElement('hr', null),
1162
- React__default['default'].createElement(
1163
- reactBootstrap.Form.Row,
1164
- null,
1165
- React__default['default'].createElement(
1166
- reactBootstrap.Form.Group,
1167
- { as: reactBootstrap.Col },
1168
- !loading && React__default['default'].createElement(
1169
- reactBootstrap.Button,
1170
- { type: 'submit' },
1171
- 'Update'
1172
- ),
1173
- loading && React__default['default'].createElement(
1174
- reactBootstrap.Button,
1175
- { variant: 'primary', disabled: true },
1176
- React__default['default'].createElement(reactBootstrap.Spinner, {
1177
- as: 'span',
1178
- animation: 'border',
1179
- role: 'status',
1180
- 'aria-hidden': 'true',
1181
- size: 'sm'
1182
- }),
1183
- React__default['default'].createElement(
1184
- 'span',
1185
- { className: 'sr-only' },
1186
- 'Loading...'
1187
- )
1188
- )
1189
- )
1190
- )
1191
- ) : React__default['default'].createElement(reactBootstrap.Spinner, {
1192
- as: 'span',
1193
- animation: 'border',
1194
- role: 'status',
1195
- 'aria-hidden': 'true',
1196
- size: 'sm'
1197
- }),
1198
- errorMsg && React__default['default'].createElement(
1199
- 'p',
1200
- { className: 'error' },
1201
- errorMsg
1202
- ),
1203
- successMsg && React__default['default'].createElement(
1204
- 'p',
1205
- { className: 'success' },
1206
- successMsg
1207
- ),
1208
- React__default['default'].createElement(
1209
- 'style',
1210
- { jsx: 'true'.toString() },
1211
- ' \n .login {\n margin: 0 auto;\n padding: 1rem;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n .error {\n color: red;\n margin: 1rem 0 0;\n }\n .success {\n color: green;\n margin: 1rem 0 0;\n }\n '
1212
- )
1213
- );
1214
- };
1215
-
1216
- var TOKEN_NAME = 'token';
1217
- var MAX_AGE = 60 * 60 * 8; // 8 hours
1218
-
1219
- function setTokenCookie(res, token, eKey) {
1220
- var cookies_serailized = [];
1221
- cookies_serailized.push(index.serialize_1(TOKEN_NAME, token, {
1222
- //maxAge: MAX_AGE, // we want login cookie to expire when browser
1223
- //expires: new Date(Date.now() + MAX_AGE * 1000),
1224
- //httpOnly: true,
1225
- //secure: process.env.NODE_ENV === 'production',
1226
- path: '/'
1227
- //sameSite: 'lax',
1228
- }));
1229
-
1230
- cookies_serailized.push(index.serialize_1('eKey', eKey, {
1231
- //maxAge: MAX_AGE, // we want login cookie to expire when browser
1232
- //expires: new Date(Date.now() + MAX_AGE * 1000),
1233
- //httpOnly: true,
1234
- //secure: process.env.NODE_ENV === 'production',
1235
- path: '/'
1236
- //sameSite: 'lax',
1237
- }));
1238
-
1239
- res.setHeader('Set-Cookie', cookies_serailized);
1240
- }
1241
-
1242
- function removeTokenCookie(res) {
1243
- var cookies_serailized = [];
1244
- cookies_serailized.push(index.serialize_1(TOKEN_NAME, '', {
1245
- maxAge: -1,
1246
- expires: new Date(Date.now() - MAX_AGE * 1000),
1247
- path: '/'
1248
- }));
1249
- cookies_serailized.push(index.serialize_1('eKey', '', {
1250
- maxAge: -1,
1251
- expires: new Date(Date.now() - MAX_AGE * 1000),
1252
- path: '/'
1253
- }));
1254
-
1255
- res.setHeader('Set-Cookie', cookies_serailized);
1256
- }
1257
-
1258
- function parseCookies(req) {
1259
- // For API Routes we don't need to parse the cookies.
1260
- if (req.cookies) return req.cookies;
1261
-
1262
- // For pages we do need to parse the cookies.
1263
- var cookie = req.headers ? req.headers.cookie : null;
1264
- return index.parse_1(cookie || '');
1265
- }
1266
-
1267
- function getTokenCookie(req) {
1268
- var cookies = parseCookies(req);
1269
- return cookies[TOKEN_NAME];
1270
- }
1271
-
1272
- var authCookies = /*#__PURE__*/Object.freeze({
1273
- __proto__: null,
1274
- setTokenCookie: setTokenCookie,
1275
- removeTokenCookie: removeTokenCookie,
1276
- parseCookies: parseCookies,
1277
- getTokenCookie: getTokenCookie
1278
- });
1279
-
1280
- function encryptSession(session) {
1281
- var buffer = new Buffer(stringify._JSON$stringify(session));
1282
- return buffer.toString('base64');
1283
- //return jwt.sign(session, TOKEN_SECRET)
1284
- //return Iron.seal(session, TOKEN_SECRET, Iron.defaults)
1285
- }
1286
-
1287
- var getSession = function () {
1288
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(req) {
1289
- var token, buff;
1290
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
1291
- while (1) {
1292
- switch (_context.prev = _context.next) {
1293
- case 0:
1294
- token = getTokenCookie(req);
1295
-
1296
- if (!token) {
1297
- _context.next = 4;
1298
- break;
1299
- }
1300
-
1301
- buff = new Buffer(token, 'base64');
1302
- return _context.abrupt('return', JSON.parse(buff.toString('utf8')));
1303
-
1304
- case 4:
1305
- return _context.abrupt('return', null);
1306
-
1307
- case 5:
1308
- case 'end':
1309
- return _context.stop();
1310
- }
1311
- }
1312
- }, _callee, this);
1313
- }));
1314
-
1315
- return function getSession(_x) {
1316
- return _ref.apply(this, arguments);
1317
- };
1318
- }();
1319
-
1320
- var iron = /*#__PURE__*/Object.freeze({
1321
- __proto__: null,
1322
- encryptSession: encryptSession,
1323
- getSession: getSession
1324
- });
1325
-
1326
- var toStr = Object.prototype.toString;
1327
-
1328
- var isArguments = function isArguments(value) {
1329
- var str = toStr.call(value);
1330
- var isArgs = str === '[object Arguments]';
1331
- if (!isArgs) {
1332
- isArgs = str !== '[object Array]' &&
1333
- value !== null &&
1334
- typeof value === 'object' &&
1335
- typeof value.length === 'number' &&
1336
- value.length >= 0 &&
1337
- toStr.call(value.callee) === '[object Function]';
1338
- }
1339
- return isArgs;
1340
- };
1341
-
1342
- var keysShim;
1343
- if (!Object.keys) {
1344
- // modified from https://github.com/es-shims/es5-shim
1345
- var has = Object.prototype.hasOwnProperty;
1346
- var toStr$1 = Object.prototype.toString;
1347
- var isArgs = isArguments; // eslint-disable-line global-require
1348
- var isEnumerable = Object.prototype.propertyIsEnumerable;
1349
- var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
1350
- var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
1351
- var dontEnums = [
1352
- 'toString',
1353
- 'toLocaleString',
1354
- 'valueOf',
1355
- 'hasOwnProperty',
1356
- 'isPrototypeOf',
1357
- 'propertyIsEnumerable',
1358
- 'constructor'
1359
- ];
1360
- var equalsConstructorPrototype = function (o) {
1361
- var ctor = o.constructor;
1362
- return ctor && ctor.prototype === o;
1363
- };
1364
- var excludedKeys = {
1365
- $applicationCache: true,
1366
- $console: true,
1367
- $external: true,
1368
- $frame: true,
1369
- $frameElement: true,
1370
- $frames: true,
1371
- $innerHeight: true,
1372
- $innerWidth: true,
1373
- $onmozfullscreenchange: true,
1374
- $onmozfullscreenerror: true,
1375
- $outerHeight: true,
1376
- $outerWidth: true,
1377
- $pageXOffset: true,
1378
- $pageYOffset: true,
1379
- $parent: true,
1380
- $scrollLeft: true,
1381
- $scrollTop: true,
1382
- $scrollX: true,
1383
- $scrollY: true,
1384
- $self: true,
1385
- $webkitIndexedDB: true,
1386
- $webkitStorageInfo: true,
1387
- $window: true
1388
- };
1389
- var hasAutomationEqualityBug = (function () {
1390
- /* global window */
1391
- if (typeof window === 'undefined') { return false; }
1392
- for (var k in window) {
1393
- try {
1394
- if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
1395
- try {
1396
- equalsConstructorPrototype(window[k]);
1397
- } catch (e) {
1398
- return true;
1399
- }
1400
- }
1401
- } catch (e) {
1402
- return true;
1403
- }
1404
- }
1405
- return false;
1406
- }());
1407
- var equalsConstructorPrototypeIfNotBuggy = function (o) {
1408
- /* global window */
1409
- if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
1410
- return equalsConstructorPrototype(o);
1411
- }
1412
- try {
1413
- return equalsConstructorPrototype(o);
1414
- } catch (e) {
1415
- return false;
1416
- }
1417
- };
1418
-
1419
- keysShim = function keys(object) {
1420
- var isObject = object !== null && typeof object === 'object';
1421
- var isFunction = toStr$1.call(object) === '[object Function]';
1422
- var isArguments = isArgs(object);
1423
- var isString = isObject && toStr$1.call(object) === '[object String]';
1424
- var theKeys = [];
1425
-
1426
- if (!isObject && !isFunction && !isArguments) {
1427
- throw new TypeError('Object.keys called on a non-object');
1428
- }
1429
-
1430
- var skipProto = hasProtoEnumBug && isFunction;
1431
- if (isString && object.length > 0 && !has.call(object, 0)) {
1432
- for (var i = 0; i < object.length; ++i) {
1433
- theKeys.push(String(i));
1434
- }
1435
- }
1436
-
1437
- if (isArguments && object.length > 0) {
1438
- for (var j = 0; j < object.length; ++j) {
1439
- theKeys.push(String(j));
1440
- }
1441
- } else {
1442
- for (var name in object) {
1443
- if (!(skipProto && name === 'prototype') && has.call(object, name)) {
1444
- theKeys.push(String(name));
1445
- }
1446
- }
1447
- }
1448
-
1449
- if (hasDontEnumBug) {
1450
- var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
1451
-
1452
- for (var k = 0; k < dontEnums.length; ++k) {
1453
- if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
1454
- theKeys.push(dontEnums[k]);
1455
- }
1456
- }
1457
- }
1458
- return theKeys;
1459
- };
1460
- }
1461
- var implementation = keysShim;
1462
-
1463
- var slice = Array.prototype.slice;
1464
-
1465
-
1466
- var origKeys = Object.keys;
1467
- var keysShim$1 = origKeys ? function keys(o) { return origKeys(o); } : implementation;
1468
-
1469
- var originalKeys = Object.keys;
1470
-
1471
- keysShim$1.shim = function shimObjectKeys() {
1472
- if (Object.keys) {
1473
- var keysWorksWithArguments = (function () {
1474
- // Safari 5.0 bug
1475
- var args = Object.keys(arguments);
1476
- return args && args.length === arguments.length;
1477
- }(1, 2));
1478
- if (!keysWorksWithArguments) {
1479
- Object.keys = function keys(object) { // eslint-disable-line func-name-matching
1480
- if (isArguments(object)) {
1481
- return originalKeys(slice.call(object));
1482
- }
1483
- return originalKeys(object);
1484
- };
1485
- }
1486
- } else {
1487
- Object.keys = keysShim$1;
1488
- }
1489
- return Object.keys || keysShim$1;
1490
- };
1491
-
1492
- var objectKeys = keysShim$1;
1493
-
1494
- var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
1495
-
1496
- var toStr$2 = Object.prototype.toString;
1497
- var concat = Array.prototype.concat;
1498
- var origDefineProperty = Object.defineProperty;
1499
-
1500
- var isFunction = function (fn) {
1501
- return typeof fn === 'function' && toStr$2.call(fn) === '[object Function]';
1502
- };
1503
-
1504
- var arePropertyDescriptorsSupported = function () {
1505
- var obj = {};
1506
- try {
1507
- origDefineProperty(obj, 'x', { enumerable: false, value: obj });
1508
- // eslint-disable-next-line no-unused-vars, no-restricted-syntax
1509
- for (var _ in obj) { // jscs:ignore disallowUnusedVariables
1510
- return false;
1511
- }
1512
- return obj.x === obj;
1513
- } catch (e) { /* this is IE 8. */
1514
- return false;
1515
- }
1516
- };
1517
- var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
1518
-
1519
- var defineProperty = function (object, name, value, predicate) {
1520
- if (name in object && (!isFunction(predicate) || !predicate())) {
1521
- return;
1522
- }
1523
- if (supportsDescriptors) {
1524
- origDefineProperty(object, name, {
1525
- configurable: true,
1526
- enumerable: false,
1527
- value: value,
1528
- writable: true
1529
- });
1530
- } else {
1531
- object[name] = value;
1532
- }
1533
- };
1534
-
1535
- var defineProperties = function (object, map) {
1536
- var predicates = arguments.length > 2 ? arguments[2] : {};
1537
- var props = objectKeys(map);
1538
- if (hasSymbols) {
1539
- props = concat.call(props, Object.getOwnPropertySymbols(map));
1540
- }
1541
- for (var i = 0; i < props.length; i += 1) {
1542
- defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
1543
- }
1544
- };
1545
-
1546
- defineProperties.supportsDescriptors = !!supportsDescriptors;
1547
-
1548
- var defineProperties_1 = defineProperties;
1549
-
1550
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
1551
- var shams = function hasSymbols() {
1552
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
1553
- if (typeof Symbol.iterator === 'symbol') { return true; }
1554
-
1555
- var obj = {};
1556
- var sym = Symbol('test');
1557
- var symObj = Object(sym);
1558
- if (typeof sym === 'string') { return false; }
1559
-
1560
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
1561
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
1562
-
1563
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
1564
- // if (sym instanceof Symbol) { return false; }
1565
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
1566
- // if (!(symObj instanceof Symbol)) { return false; }
1567
-
1568
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
1569
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
1570
-
1571
- var symVal = 42;
1572
- obj[sym] = symVal;
1573
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
1574
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
1575
-
1576
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
1577
-
1578
- var syms = Object.getOwnPropertySymbols(obj);
1579
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
1580
-
1581
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
1582
-
1583
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
1584
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
1585
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
1586
- }
1587
-
1588
- return true;
1589
- };
1590
-
1591
- var origSymbol = _commonjsHelpers.commonjsGlobal.Symbol;
1592
-
1593
-
1594
- var hasSymbols$1 = function hasNativeSymbols() {
1595
- if (typeof origSymbol !== 'function') { return false; }
1596
- if (typeof Symbol !== 'function') { return false; }
1597
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
1598
- if (typeof Symbol('bar') !== 'symbol') { return false; }
1599
-
1600
- return shams();
1601
- };
1602
-
1603
- /* eslint no-invalid-this: 1 */
1604
-
1605
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1606
- var slice$1 = Array.prototype.slice;
1607
- var toStr$3 = Object.prototype.toString;
1608
- var funcType = '[object Function]';
1609
-
1610
- var implementation$1 = function bind(that) {
1611
- var target = this;
1612
- if (typeof target !== 'function' || toStr$3.call(target) !== funcType) {
1613
- throw new TypeError(ERROR_MESSAGE + target);
1614
- }
1615
- var args = slice$1.call(arguments, 1);
1616
-
1617
- var bound;
1618
- var binder = function () {
1619
- if (this instanceof bound) {
1620
- var result = target.apply(
1621
- this,
1622
- args.concat(slice$1.call(arguments))
1623
- );
1624
- if (Object(result) === result) {
1625
- return result;
1626
- }
1627
- return this;
1628
- } else {
1629
- return target.apply(
1630
- that,
1631
- args.concat(slice$1.call(arguments))
1632
- );
1633
- }
1634
- };
1635
-
1636
- var boundLength = Math.max(0, target.length - args.length);
1637
- var boundArgs = [];
1638
- for (var i = 0; i < boundLength; i++) {
1639
- boundArgs.push('$' + i);
1640
- }
1641
-
1642
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
1643
-
1644
- if (target.prototype) {
1645
- var Empty = function Empty() {};
1646
- Empty.prototype = target.prototype;
1647
- bound.prototype = new Empty();
1648
- Empty.prototype = null;
1649
- }
1650
-
1651
- return bound;
1652
- };
1653
-
1654
- var functionBind = Function.prototype.bind || implementation$1;
1655
-
1656
- /* globals
1657
- Atomics,
1658
- SharedArrayBuffer,
1659
- */
1660
-
1661
- var undefined$1;
1662
-
1663
- var $TypeError = TypeError;
1664
-
1665
- var $gOPD = Object.getOwnPropertyDescriptor;
1666
- if ($gOPD) {
1667
- try {
1668
- $gOPD({}, '');
1669
- } catch (e) {
1670
- $gOPD = null; // this is IE 8, which has a broken gOPD
1671
- }
1672
- }
1673
-
1674
- var throwTypeError = function () { throw new $TypeError(); };
1675
- var ThrowTypeError = $gOPD
1676
- ? (function () {
1677
- try {
1678
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
1679
- arguments.callee; // IE 8 does not throw here
1680
- return throwTypeError;
1681
- } catch (calleeThrows) {
1682
- try {
1683
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1684
- return $gOPD(arguments, 'callee').get;
1685
- } catch (gOPDthrows) {
1686
- return throwTypeError;
1687
- }
1688
- }
1689
- }())
1690
- : throwTypeError;
1691
-
1692
- var hasSymbols$2 = hasSymbols$1();
1693
-
1694
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
1695
- var generatorFunction = undefined$1;
1696
- var asyncFunction = undefined$1;
1697
- var asyncGenFunction = undefined$1;
1698
-
1699
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
1700
-
1701
- var INTRINSICS = {
1702
- '%Array%': Array,
1703
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
1704
- '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer.prototype,
1705
- '%ArrayIteratorPrototype%': hasSymbols$2 ? getProto([][Symbol.iterator]()) : undefined$1,
1706
- '%ArrayPrototype%': Array.prototype,
1707
- '%ArrayProto_entries%': Array.prototype.entries,
1708
- '%ArrayProto_forEach%': Array.prototype.forEach,
1709
- '%ArrayProto_keys%': Array.prototype.keys,
1710
- '%ArrayProto_values%': Array.prototype.values,
1711
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
1712
- '%AsyncFunction%': asyncFunction,
1713
- '%AsyncFunctionPrototype%': undefined$1,
1714
- '%AsyncGenerator%': undefined$1,
1715
- '%AsyncGeneratorFunction%': asyncGenFunction,
1716
- '%AsyncGeneratorPrototype%': undefined$1,
1717
- '%AsyncIteratorPrototype%': undefined$1,
1718
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
1719
- '%Boolean%': Boolean,
1720
- '%BooleanPrototype%': Boolean.prototype,
1721
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
1722
- '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined$1 : DataView.prototype,
1723
- '%Date%': Date,
1724
- '%DatePrototype%': Date.prototype,
1725
- '%decodeURI%': decodeURI,
1726
- '%decodeURIComponent%': decodeURIComponent,
1727
- '%encodeURI%': encodeURI,
1728
- '%encodeURIComponent%': encodeURIComponent,
1729
- '%Error%': Error,
1730
- '%ErrorPrototype%': Error.prototype,
1731
- '%eval%': eval, // eslint-disable-line no-eval
1732
- '%EvalError%': EvalError,
1733
- '%EvalErrorPrototype%': EvalError.prototype,
1734
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
1735
- '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array.prototype,
1736
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
1737
- '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array.prototype,
1738
- '%Function%': Function,
1739
- '%FunctionPrototype%': Function.prototype,
1740
- '%Generator%': undefined$1,
1741
- '%GeneratorFunction%': generatorFunction,
1742
- '%GeneratorPrototype%': undefined$1,
1743
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
1744
- '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array.prototype,
1745
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
1746
- '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined$1 : Int8Array.prototype,
1747
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
1748
- '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array.prototype,
1749
- '%isFinite%': isFinite,
1750
- '%isNaN%': isNaN,
1751
- '%IteratorPrototype%': hasSymbols$2 ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
1752
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
1753
- '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined$1,
1754
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
1755
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
1756
- '%MapPrototype%': typeof Map === 'undefined' ? undefined$1 : Map.prototype,
1757
- '%Math%': Math,
1758
- '%Number%': Number,
1759
- '%NumberPrototype%': Number.prototype,
1760
- '%Object%': Object,
1761
- '%ObjectPrototype%': Object.prototype,
1762
- '%ObjProto_toString%': Object.prototype.toString,
1763
- '%ObjProto_valueOf%': Object.prototype.valueOf,
1764
- '%parseFloat%': parseFloat,
1765
- '%parseInt%': parseInt,
1766
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
1767
- '%PromisePrototype%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype,
1768
- '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined$1 : Promise.prototype.then,
1769
- '%Promise_all%': typeof Promise === 'undefined' ? undefined$1 : Promise.all,
1770
- '%Promise_reject%': typeof Promise === 'undefined' ? undefined$1 : Promise.reject,
1771
- '%Promise_resolve%': typeof Promise === 'undefined' ? undefined$1 : Promise.resolve,
1772
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
1773
- '%RangeError%': RangeError,
1774
- '%RangeErrorPrototype%': RangeError.prototype,
1775
- '%ReferenceError%': ReferenceError,
1776
- '%ReferenceErrorPrototype%': ReferenceError.prototype,
1777
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
1778
- '%RegExp%': RegExp,
1779
- '%RegExpPrototype%': RegExp.prototype,
1780
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
1781
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$2 ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
1782
- '%SetPrototype%': typeof Set === 'undefined' ? undefined$1 : Set.prototype,
1783
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
1784
- '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer.prototype,
1785
- '%String%': String,
1786
- '%StringIteratorPrototype%': hasSymbols$2 ? getProto(''[Symbol.iterator]()) : undefined$1,
1787
- '%StringPrototype%': String.prototype,
1788
- '%Symbol%': hasSymbols$2 ? Symbol : undefined$1,
1789
- '%SymbolPrototype%': hasSymbols$2 ? Symbol.prototype : undefined$1,
1790
- '%SyntaxError%': SyntaxError,
1791
- '%SyntaxErrorPrototype%': SyntaxError.prototype,
1792
- '%ThrowTypeError%': ThrowTypeError,
1793
- '%TypedArray%': TypedArray,
1794
- '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined$1,
1795
- '%TypeError%': $TypeError,
1796
- '%TypeErrorPrototype%': $TypeError.prototype,
1797
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
1798
- '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array.prototype,
1799
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
1800
- '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray.prototype,
1801
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
1802
- '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array.prototype,
1803
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
1804
- '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array.prototype,
1805
- '%URIError%': URIError,
1806
- '%URIErrorPrototype%': URIError.prototype,
1807
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
1808
- '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap.prototype,
1809
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
1810
- '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet.prototype
1811
- };
1812
-
1813
-
1814
- var $replace = functionBind.call(Function.call, String.prototype.replace);
1815
-
1816
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1817
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1818
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1819
- var stringToPath = function stringToPath(string) {
1820
- var result = [];
1821
- $replace(string, rePropName, function (match, number, quote, subString) {
1822
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
1823
- });
1824
- return result;
1825
- };
1826
- /* end adaptation */
1827
-
1828
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1829
- if (!(name in INTRINSICS)) {
1830
- throw new SyntaxError('intrinsic ' + name + ' does not exist!');
1831
- }
1832
-
1833
- // istanbul ignore if // hopefully this is impossible to test :-)
1834
- if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
1835
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1836
- }
1837
-
1838
- return INTRINSICS[name];
1839
- };
1840
-
1841
- var GetIntrinsic = function GetIntrinsic(name, allowMissing) {
1842
- if (typeof name !== 'string' || name.length === 0) {
1843
- throw new TypeError('intrinsic name must be a non-empty string');
1844
- }
1845
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1846
- throw new TypeError('"allowMissing" argument must be a boolean');
1847
- }
1848
-
1849
- var parts = stringToPath(name);
1850
-
1851
- var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
1852
- for (var i = 1; i < parts.length; i += 1) {
1853
- if (value != null) {
1854
- if ($gOPD && (i + 1) >= parts.length) {
1855
- var desc = $gOPD(value, parts[i]);
1856
- if (!allowMissing && !(parts[i] in value)) {
1857
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1858
- }
1859
- // By convention, when a data property is converted to an accessor
1860
- // property to emulate a data property that does not suffer from
1861
- // the override mistake, that accessor's getter is marked with
1862
- // an `originalValue` property. Here, when we detect this, we
1863
- // uphold the illusion by pretending to see that original data
1864
- // property, i.e., returning the value rather than the getter
1865
- // itself.
1866
- value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]];
1867
- } else {
1868
- value = value[parts[i]];
1869
- }
1870
- }
1871
- }
1872
- return value;
1873
- };
1874
-
1875
- var callBind = _commonjsHelpers.createCommonjsModule(function (module) {
1876
-
1877
-
1878
-
1879
-
1880
-
1881
- var $apply = GetIntrinsic('%Function.prototype.apply%');
1882
- var $call = GetIntrinsic('%Function.prototype.call%');
1883
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
1884
-
1885
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
1886
-
1887
- if ($defineProperty) {
1888
- try {
1889
- $defineProperty({}, 'a', { value: 1 });
1890
- } catch (e) {
1891
- // IE 8 has a broken defineProperty
1892
- $defineProperty = null;
1893
- }
1894
- }
1895
-
1896
- module.exports = function callBind() {
1897
- return $reflectApply(functionBind, $call, arguments);
1898
- };
1899
-
1900
- var applyBind = function applyBind() {
1901
- return $reflectApply(functionBind, $apply, arguments);
1902
- };
1903
-
1904
- if ($defineProperty) {
1905
- $defineProperty(module.exports, 'apply', { value: applyBind });
1906
- } else {
1907
- module.exports.apply = applyBind;
1908
- }
1909
- });
1910
- var callBind_1 = callBind.apply;
1911
-
1912
- var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
1913
-
1914
- var callBound = function callBoundIntrinsic(name, allowMissing) {
1915
- var intrinsic = GetIntrinsic(name, !!allowMissing);
1916
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
1917
- return callBind(intrinsic);
1918
- }
1919
- return intrinsic;
1920
- };
1921
-
1922
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
1923
-
1924
- if ($defineProperty) {
1925
- try {
1926
- $defineProperty({}, 'a', { value: 1 });
1927
- } catch (e) {
1928
- // IE 8 has a broken defineProperty
1929
- $defineProperty = null;
1930
- }
1931
- }
1932
-
1933
-
1934
-
1935
- var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
1936
-
1937
- // eslint-disable-next-line max-params
1938
- var DefineOwnProperty = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
1939
- if (!$defineProperty) {
1940
- if (!IsDataDescriptor(desc)) {
1941
- // ES3 does not support getters/setters
1942
- return false;
1943
- }
1944
- if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {
1945
- return false;
1946
- }
1947
-
1948
- // fallback for ES3
1949
- if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
1950
- // a non-enumerable existing property
1951
- return false;
1952
- }
1953
-
1954
- // property does not exist at all, or exists but is enumerable
1955
- var V = desc['[[Value]]'];
1956
- // eslint-disable-next-line no-param-reassign
1957
- O[P] = V; // will use [[Define]]
1958
- return SameValue(O[P], V);
1959
- }
1960
- $defineProperty(O, P, FromPropertyDescriptor(desc));
1961
- return true;
1962
- };
1963
-
1964
- var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
1965
-
1966
- var $TypeError$1 = GetIntrinsic('%TypeError%');
1967
- var $SyntaxError = GetIntrinsic('%SyntaxError%');
1968
-
1969
-
1970
-
1971
- var predicates = {
1972
- // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
1973
- 'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
1974
- if (Type(Desc) !== 'Object') {
1975
- return false;
1976
- }
1977
- var allowed = {
1978
- '[[Configurable]]': true,
1979
- '[[Enumerable]]': true,
1980
- '[[Get]]': true,
1981
- '[[Set]]': true,
1982
- '[[Value]]': true,
1983
- '[[Writable]]': true
1984
- };
1985
-
1986
- for (var key in Desc) { // eslint-disable-line
1987
- if (src(Desc, key) && !allowed[key]) {
1988
- return false;
1989
- }
1990
- }
1991
-
1992
- var isData = src(Desc, '[[Value]]');
1993
- var IsAccessor = src(Desc, '[[Get]]') || src(Desc, '[[Set]]');
1994
- if (isData && IsAccessor) {
1995
- throw new $TypeError$1('Property Descriptors may not be both accessor and data descriptors');
1996
- }
1997
- return true;
1998
- }
1999
- };
2000
-
2001
- var assertRecord = function assertRecord(Type, recordType, argumentName, value) {
2002
- var predicate = predicates[recordType];
2003
- if (typeof predicate !== 'function') {
2004
- throw new $SyntaxError('unknown record type: ' + recordType);
2005
- }
2006
- if (!predicate(Type, value)) {
2007
- throw new $TypeError$1(argumentName + ' must be a ' + recordType);
2008
- }
2009
- };
2010
-
2011
- // https://www.ecma-international.org/ecma-262/5.1/#sec-8
2012
-
2013
- var Type = function Type(x) {
2014
- if (x === null) {
2015
- return 'Null';
2016
- }
2017
- if (typeof x === 'undefined') {
2018
- return 'Undefined';
2019
- }
2020
- if (typeof x === 'function' || typeof x === 'object') {
2021
- return 'Object';
2022
- }
2023
- if (typeof x === 'number') {
2024
- return 'Number';
2025
- }
2026
- if (typeof x === 'boolean') {
2027
- return 'Boolean';
2028
- }
2029
- if (typeof x === 'string') {
2030
- return 'String';
2031
- }
2032
- };
2033
-
2034
- // https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values
2035
-
2036
- var Type$1 = function Type$1(x) {
2037
- if (typeof x === 'symbol') {
2038
- return 'Symbol';
2039
- }
2040
- return Type(x);
2041
- };
2042
-
2043
- // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
2044
-
2045
- var FromPropertyDescriptor = function FromPropertyDescriptor(Desc) {
2046
- if (typeof Desc === 'undefined') {
2047
- return Desc;
2048
- }
2049
-
2050
- assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
2051
-
2052
- var obj = {};
2053
- if ('[[Value]]' in Desc) {
2054
- obj.value = Desc['[[Value]]'];
2055
- }
2056
- if ('[[Writable]]' in Desc) {
2057
- obj.writable = Desc['[[Writable]]'];
2058
- }
2059
- if ('[[Get]]' in Desc) {
2060
- obj.get = Desc['[[Get]]'];
2061
- }
2062
- if ('[[Set]]' in Desc) {
2063
- obj.set = Desc['[[Set]]'];
2064
- }
2065
- if ('[[Enumerable]]' in Desc) {
2066
- obj.enumerable = Desc['[[Enumerable]]'];
2067
- }
2068
- if ('[[Configurable]]' in Desc) {
2069
- obj.configurable = Desc['[[Configurable]]'];
2070
- }
2071
- return obj;
2072
- };
2073
-
2074
- var $gOPD$1 = GetIntrinsic('%Object.getOwnPropertyDescriptor%');
2075
- if ($gOPD$1) {
2076
- try {
2077
- $gOPD$1([], 'length');
2078
- } catch (e) {
2079
- // IE 8 has a broken gOPD
2080
- $gOPD$1 = null;
2081
- }
2082
- }
2083
-
2084
- var getOwnPropertyDescriptor = $gOPD$1;
2085
-
2086
- var $Array = GetIntrinsic('%Array%');
2087
-
2088
- // eslint-disable-next-line global-require
2089
- var toStr$4 = !$Array.isArray && callBound('Object.prototype.toString');
2090
-
2091
- // https://www.ecma-international.org/ecma-262/6.0/#sec-isarray
2092
-
2093
- var IsArray = $Array.isArray || function IsArray(argument) {
2094
- return toStr$4(argument) === '[object Array]';
2095
- };
2096
-
2097
- // https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey
2098
-
2099
- var IsPropertyKey = function IsPropertyKey(argument) {
2100
- return typeof argument === 'string' || typeof argument === 'symbol';
2101
- };
2102
-
2103
- var hasSymbols$3 = hasSymbols$1();
2104
- var hasToStringTag = hasSymbols$3 && typeof Symbol.toStringTag === 'symbol';
2105
- var hasOwnProperty;
2106
- var regexExec;
2107
- var isRegexMarker;
2108
- var badStringifier;
2109
-
2110
- if (hasToStringTag) {
2111
- hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
2112
- regexExec = Function.call.bind(RegExp.prototype.exec);
2113
- isRegexMarker = {};
2114
-
2115
- var throwRegexMarker = function () {
2116
- throw isRegexMarker;
2117
- };
2118
- badStringifier = {
2119
- toString: throwRegexMarker,
2120
- valueOf: throwRegexMarker
2121
- };
2122
-
2123
- if (typeof Symbol.toPrimitive === 'symbol') {
2124
- badStringifier[Symbol.toPrimitive] = throwRegexMarker;
2125
- }
2126
- }
2127
-
2128
- var toStr$5 = Object.prototype.toString;
2129
- var gOPD = Object.getOwnPropertyDescriptor;
2130
- var regexClass = '[object RegExp]';
2131
-
2132
- var isRegex = hasToStringTag
2133
- // eslint-disable-next-line consistent-return
2134
- ? function isRegex(value) {
2135
- if (!value || typeof value !== 'object') {
2136
- return false;
2137
- }
2138
-
2139
- var descriptor = gOPD(value, 'lastIndex');
2140
- var hasLastIndexDataProperty = descriptor && hasOwnProperty(descriptor, 'value');
2141
- if (!hasLastIndexDataProperty) {
2142
- return false;
2143
- }
2144
-
2145
- try {
2146
- regexExec(value, badStringifier);
2147
- } catch (e) {
2148
- return e === isRegexMarker;
2149
- }
2150
- }
2151
- : function isRegex(value) {
2152
- // In older browsers, typeof regex incorrectly returns 'function'
2153
- if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
2154
- return false;
2155
- }
2156
-
2157
- return toStr$5.call(value) === regexClass;
2158
- };
2159
-
2160
- // http://www.ecma-international.org/ecma-262/5.1/#sec-9.2
2161
-
2162
- var ToBoolean = function ToBoolean(value) { return !!value; };
2163
-
2164
- var $match = GetIntrinsic('%Symbol.match%', true);
2165
-
2166
-
2167
-
2168
-
2169
-
2170
- // https://ecma-international.org/ecma-262/6.0/#sec-isregexp
2171
-
2172
- var IsRegExp = function IsRegExp(argument) {
2173
- if (!argument || typeof argument !== 'object') {
2174
- return false;
2175
- }
2176
- if ($match) {
2177
- var isRegExp = argument[$match];
2178
- if (typeof isRegExp !== 'undefined') {
2179
- return ToBoolean(isRegExp);
2180
- }
2181
- }
2182
- return isRegex(argument);
2183
- };
2184
-
2185
- var fnToStr = Function.prototype.toString;
2186
- var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
2187
- var badArrayLike;
2188
- var isCallableMarker;
2189
- if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
2190
- try {
2191
- badArrayLike = Object.defineProperty({}, 'length', {
2192
- get: function () {
2193
- throw isCallableMarker;
2194
- }
2195
- });
2196
- isCallableMarker = {};
2197
- // eslint-disable-next-line no-throw-literal
2198
- reflectApply(function () { throw 42; }, null, badArrayLike);
2199
- } catch (_) {
2200
- if (_ !== isCallableMarker) {
2201
- reflectApply = null;
2202
- }
2203
- }
2204
- } else {
2205
- reflectApply = null;
2206
- }
2207
-
2208
- var constructorRegex = /^\s*class\b/;
2209
- var isES6ClassFn = function isES6ClassFunction(value) {
2210
- try {
2211
- var fnStr = fnToStr.call(value);
2212
- return constructorRegex.test(fnStr);
2213
- } catch (e) {
2214
- return false; // not a function
2215
- }
2216
- };
2217
-
2218
- var tryFunctionObject = function tryFunctionToStr(value) {
2219
- try {
2220
- if (isES6ClassFn(value)) { return false; }
2221
- fnToStr.call(value);
2222
- return true;
2223
- } catch (e) {
2224
- return false;
2225
- }
2226
- };
2227
- var toStr$6 = Object.prototype.toString;
2228
- var fnClass = '[object Function]';
2229
- var genClass = '[object GeneratorFunction]';
2230
- var hasToStringTag$1 = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
2231
-
2232
- var isCallable = reflectApply
2233
- ? function isCallable(value) {
2234
- if (!value) { return false; }
2235
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
2236
- if (typeof value === 'function' && !value.prototype) { return true; }
2237
- try {
2238
- reflectApply(value, null, badArrayLike);
2239
- } catch (e) {
2240
- if (e !== isCallableMarker) { return false; }
2241
- }
2242
- return !isES6ClassFn(value);
2243
- }
2244
- : function isCallable(value) {
2245
- if (!value) { return false; }
2246
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
2247
- if (typeof value === 'function' && !value.prototype) { return true; }
2248
- if (hasToStringTag$1) { return tryFunctionObject(value); }
2249
- if (isES6ClassFn(value)) { return false; }
2250
- var strClass = toStr$6.call(value);
2251
- return strClass === fnClass || strClass === genClass;
2252
- };
2253
-
2254
- // http://www.ecma-international.org/ecma-262/5.1/#sec-9.11
2255
-
2256
- var IsCallable = isCallable;
2257
-
2258
- var $TypeError$2 = GetIntrinsic('%TypeError%');
2259
-
2260
-
2261
-
2262
-
2263
-
2264
- // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
2265
-
2266
- var ToPropertyDescriptor = function ToPropertyDescriptor(Obj) {
2267
- if (Type$1(Obj) !== 'Object') {
2268
- throw new $TypeError$2('ToPropertyDescriptor requires an object');
2269
- }
2270
-
2271
- var desc = {};
2272
- if (src(Obj, 'enumerable')) {
2273
- desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
2274
- }
2275
- if (src(Obj, 'configurable')) {
2276
- desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
2277
- }
2278
- if (src(Obj, 'value')) {
2279
- desc['[[Value]]'] = Obj.value;
2280
- }
2281
- if (src(Obj, 'writable')) {
2282
- desc['[[Writable]]'] = ToBoolean(Obj.writable);
2283
- }
2284
- if (src(Obj, 'get')) {
2285
- var getter = Obj.get;
2286
- if (typeof getter !== 'undefined' && !IsCallable(getter)) {
2287
- throw new $TypeError$2('getter must be a function');
2288
- }
2289
- desc['[[Get]]'] = getter;
2290
- }
2291
- if (src(Obj, 'set')) {
2292
- var setter = Obj.set;
2293
- if (typeof setter !== 'undefined' && !IsCallable(setter)) {
2294
- throw new $TypeError$2('setter must be a function');
2295
- }
2296
- desc['[[Set]]'] = setter;
2297
- }
2298
-
2299
- if ((src(desc, '[[Get]]') || src(desc, '[[Set]]')) && (src(desc, '[[Value]]') || src(desc, '[[Writable]]'))) {
2300
- throw new $TypeError$2('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
2301
- }
2302
- return desc;
2303
- };
2304
-
2305
- var $TypeError$3 = GetIntrinsic('%TypeError%');
2306
-
2307
-
2308
-
2309
- var $isEnumerable$1 = callBound('Object.prototype.propertyIsEnumerable');
2310
-
2311
-
2312
-
2313
-
2314
-
2315
-
2316
-
2317
-
2318
-
2319
- // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
2320
-
2321
- var OrdinaryGetOwnProperty = function OrdinaryGetOwnProperty(O, P) {
2322
- if (Type$1(O) !== 'Object') {
2323
- throw new $TypeError$3('Assertion failed: O must be an Object');
2324
- }
2325
- if (!IsPropertyKey(P)) {
2326
- throw new $TypeError$3('Assertion failed: P must be a Property Key');
2327
- }
2328
- if (!src(O, P)) {
2329
- return void 0;
2330
- }
2331
- if (!getOwnPropertyDescriptor) {
2332
- // ES3 / IE 8 fallback
2333
- var arrayLength = IsArray(O) && P === 'length';
2334
- var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
2335
- return {
2336
- '[[Configurable]]': !(arrayLength || regexLastIndex),
2337
- '[[Enumerable]]': $isEnumerable$1(O, P),
2338
- '[[Value]]': O[P],
2339
- '[[Writable]]': true
2340
- };
2341
- }
2342
- return ToPropertyDescriptor(getOwnPropertyDescriptor(O, P));
2343
- };
2344
-
2345
- // https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
2346
-
2347
- var IsDataDescriptor = function IsDataDescriptor(Desc) {
2348
- if (typeof Desc === 'undefined') {
2349
- return false;
2350
- }
2351
-
2352
- assertRecord(Type$1, 'Property Descriptor', 'Desc', Desc);
2353
-
2354
- if (!src(Desc, '[[Value]]') && !src(Desc, '[[Writable]]')) {
2355
- return false;
2356
- }
2357
-
2358
- return true;
2359
- };
2360
-
2361
- var isPrimitive = function isPrimitive(value) {
2362
- return value === null || (typeof value !== 'function' && typeof value !== 'object');
2363
- };
2364
-
2365
- var $Object = GetIntrinsic('%Object%');
2366
-
2367
-
2368
-
2369
- var $preventExtensions = $Object.preventExtensions;
2370
- var $isExtensible = $Object.isExtensible;
2371
-
2372
- // https://www.ecma-international.org/ecma-262/6.0/#sec-isextensible-o
2373
-
2374
- var IsExtensible = $preventExtensions
2375
- ? function IsExtensible(obj) {
2376
- return !isPrimitive(obj) && $isExtensible(obj);
2377
- }
2378
- : function IsExtensible(obj) {
2379
- return !isPrimitive(obj);
2380
- };
2381
-
2382
- var _isNaN = Number.isNaN || function isNaN(a) {
2383
- return a !== a;
2384
- };
2385
-
2386
- // http://www.ecma-international.org/ecma-262/5.1/#sec-9.12
2387
-
2388
- var SameValue = function SameValue(x, y) {
2389
- if (x === y) { // 0 === -0, but they are not identical.
2390
- if (x === 0) { return 1 / x === 1 / y; }
2391
- return true;
2392
- }
2393
- return _isNaN(x) && _isNaN(y);
2394
- };
2395
-
2396
- var $TypeError$4 = GetIntrinsic('%TypeError%');
2397
-
2398
-
2399
-
2400
-
2401
-
2402
-
2403
-
2404
-
2405
-
2406
-
2407
-
2408
- // https://www.ecma-international.org/ecma-262/6.0/#sec-createdataproperty
2409
-
2410
- var CreateDataProperty = function CreateDataProperty(O, P, V) {
2411
- if (Type$1(O) !== 'Object') {
2412
- throw new $TypeError$4('Assertion failed: Type(O) is not Object');
2413
- }
2414
- if (!IsPropertyKey(P)) {
2415
- throw new $TypeError$4('Assertion failed: IsPropertyKey(P) is not true');
2416
- }
2417
- var oldDesc = OrdinaryGetOwnProperty(O, P);
2418
- var extensible = !oldDesc || IsExtensible(O);
2419
- var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']);
2420
- if (immutable || !extensible) {
2421
- return false;
2422
- }
2423
- return DefineOwnProperty(
2424
- IsDataDescriptor,
2425
- SameValue,
2426
- FromPropertyDescriptor,
2427
- O,
2428
- P,
2429
- {
2430
- '[[Configurable]]': true,
2431
- '[[Enumerable]]': true,
2432
- '[[Value]]': V,
2433
- '[[Writable]]': true
2434
- }
2435
- );
2436
- };
2437
-
2438
- var $TypeError$5 = GetIntrinsic('%TypeError%');
2439
-
2440
- // http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
2441
-
2442
- var CheckObjectCoercible = function CheckObjectCoercible(value, optMessage) {
2443
- if (value == null) {
2444
- throw new $TypeError$5(optMessage || ('Cannot call method on ' + value));
2445
- }
2446
- return value;
2447
- };
2448
-
2449
- var RequireObjectCoercible = CheckObjectCoercible;
2450
-
2451
- var $Object$1 = GetIntrinsic('%Object%');
2452
-
2453
-
2454
-
2455
- // https://www.ecma-international.org/ecma-262/6.0/#sec-toobject
2456
-
2457
- var ToObject = function ToObject(value) {
2458
- RequireObjectCoercible(value);
2459
- return $Object$1(value);
2460
- };
2461
-
2462
- var $gOPD$2 = Object.getOwnPropertyDescriptor;
2463
- var $getOwnNames = Object.getOwnPropertyNames;
2464
- var $getSymbols = Object.getOwnPropertySymbols;
2465
- var $concat = callBound('Array.prototype.concat');
2466
- var $reduce = callBound('Array.prototype.reduce');
2467
- var getAll = $getSymbols ? function (obj) {
2468
- return $concat($getOwnNames(obj), $getSymbols(obj));
2469
- } : $getOwnNames;
2470
-
2471
- var isES5 = IsCallable($gOPD$2) && IsCallable($getOwnNames);
2472
-
2473
- var implementation$2 = function getOwnPropertyDescriptors(value) {
2474
- RequireObjectCoercible(value);
2475
- if (!isES5) {
2476
- throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor');
2477
- }
2478
-
2479
- var O = ToObject(value);
2480
- return $reduce(
2481
- getAll(O),
2482
- function (acc, key) {
2483
- var descriptor = $gOPD$2(O, key);
2484
- if (typeof descriptor !== 'undefined') {
2485
- CreateDataProperty(acc, key, descriptor);
2486
- }
2487
- return acc;
2488
- },
2489
- {}
2490
- );
2491
- };
2492
-
2493
- var polyfill = function getPolyfill() {
2494
- return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation$2;
2495
- };
2496
-
2497
- var shim = function shimGetOwnPropertyDescriptors() {
2498
- var polyfill$1 = polyfill();
2499
- defineProperties_1(
2500
- Object,
2501
- { getOwnPropertyDescriptors: polyfill$1 },
2502
- { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill$1; } }
2503
- );
2504
- return polyfill$1;
2505
- };
2506
-
2507
- defineProperties_1(implementation$2, {
2508
- getPolyfill: polyfill,
2509
- implementation: implementation$2,
2510
- shim: shim
2511
- });
2512
-
2513
- var object_getownpropertydescriptors = implementation$2;
2514
-
2515
- var isES5$1 = typeof Object.defineProperty === 'function'
2516
- && typeof Object.defineProperties === 'function';
2517
-
2518
- var hasProto = [].__proto__ === Array.prototype; // eslint-disable-line no-proto
2519
-
2520
- if (!isES5$1 || !hasProto) {
2521
- throw new TypeError('util.promisify requires a true ES5 environment, that also supports `__proto__`');
2522
- }
2523
-
2524
-
2525
-
2526
- if (typeof Promise !== 'function') {
2527
- throw new TypeError('`Promise` must be globally available for util.promisify to work.');
2528
- }
2529
-
2530
-
2531
-
2532
- var $slice = callBound('Array.prototype.slice');
2533
- var $concat$1 = callBound('Array.prototype.concat');
2534
- var $forEach = callBound('Array.prototype.forEach');
2535
-
2536
- var hasSymbols$4 = hasSymbols$1();
2537
-
2538
- var kCustomPromisifiedSymbol = hasSymbols$4 ? Symbol('util.promisify.custom') : null;
2539
- var kCustomPromisifyArgsSymbol = hasSymbols$4 ? Symbol('customPromisifyArgs') : null;
2540
-
2541
- var implementation$3 = function promisify(orig) {
2542
- if (typeof orig !== 'function') {
2543
- var error = new TypeError('The "original" argument must be of type function');
2544
- error.name = 'TypeError [ERR_INVALID_ARG_TYPE]';
2545
- error.code = 'ERR_INVALID_ARG_TYPE';
2546
- throw error;
2547
- }
2548
-
2549
- if (hasSymbols$4 && orig[kCustomPromisifiedSymbol]) {
2550
- var customFunction = orig[kCustomPromisifiedSymbol];
2551
- if (typeof customFunction !== 'function') {
2552
- throw new TypeError('The [util.promisify.custom] property must be a function');
2553
- }
2554
- Object.defineProperty(customFunction, kCustomPromisifiedSymbol, {
2555
- configurable: true,
2556
- enumerable: false,
2557
- value: customFunction,
2558
- writable: false
2559
- });
2560
- return customFunction;
2561
- }
2562
-
2563
- // Names to create an object from in case the callback receives multiple
2564
- // arguments, e.g. ['stdout', 'stderr'] for child_process.exec.
2565
- var argumentNames = orig[kCustomPromisifyArgsSymbol];
2566
-
2567
- var promisified = function fn() {
2568
- var args = $slice(arguments);
2569
- var self = this; // eslint-disable-line no-invalid-this
2570
- return new Promise(function (resolve, reject) {
2571
- orig.apply(self, $concat$1(args, function (err) {
2572
- var values = arguments.length > 1 ? $slice(arguments, 1) : [];
2573
- if (err) {
2574
- reject(err);
2575
- } else if (typeof argumentNames !== 'undefined' && values.length > 1) {
2576
- var obj = {};
2577
- $forEach(argumentNames, function (name, index) {
2578
- obj[name] = values[index];
2579
- });
2580
- resolve(obj);
2581
- } else {
2582
- resolve(values[0]);
2583
- }
2584
- }));
2585
- });
2586
- };
2587
-
2588
- promisified.__proto__ = orig.__proto__; // eslint-disable-line no-proto
2589
-
2590
- Object.defineProperty(promisified, kCustomPromisifiedSymbol, {
2591
- configurable: true,
2592
- enumerable: false,
2593
- value: promisified,
2594
- writable: false
2595
- });
2596
- return Object.defineProperties(promisified, object_getownpropertydescriptors(orig));
2597
- };
2598
-
2599
- var custom = kCustomPromisifiedSymbol;
2600
- var customPromisifyArgs = kCustomPromisifyArgsSymbol;
2601
- implementation$3.custom = custom;
2602
- implementation$3.customPromisifyArgs = customPromisifyArgs;
2603
-
2604
- var polyfill$1 = function getPolyfill() {
2605
- if (typeof util.util.promisify === 'function') {
2606
- return util.util.promisify;
2607
- }
2608
- return implementation$3;
2609
- };
2610
-
2611
- var shim$1 = function shimUtilPromisify() {
2612
- var polyfill = polyfill$1();
2613
- if (polyfill !== util.util.promisify) {
2614
- Object.defineProperty(util.util, 'promisify', {
2615
- configurable: true,
2616
- enumerable: true,
2617
- value: polyfill,
2618
- writable: true
2619
- });
2620
- }
2621
- return polyfill;
2622
- };
2623
-
2624
- var polyfill$2 = polyfill$1();
2625
-
2626
-
2627
- /* eslint-disable no-unused-vars */
2628
- var boundPromisify = function promisify(orig) {
2629
- /* eslint-enable no-unused-vars */
2630
- return polyfill$2.apply(util.util, arguments);
2631
- };
2632
- defineProperties_1(boundPromisify, {
2633
- custom: polyfill$2.custom,
2634
- customPromisifyArgs: polyfill$2.customPromisifyArgs,
2635
- getPolyfill: polyfill$1,
2636
- implementation: implementation$3,
2637
- shim: shim$1
2638
- });
2639
-
2640
- var util_promisify = boundPromisify;
2641
-
2642
- util_promisify.shim();
2643
-
2644
- function connect() {
2645
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
2646
-
2647
- if (!config) {
2648
- config = {
2649
- host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
2650
- user: 'nasp',
2651
- password: 'uRNkF9SkfXQs6AKK',
2652
- database: 'user'
2653
- };
2654
- }
2655
-
2656
- var connection = mysql__default['default'].createConnection(config);
2657
- return {
2658
- query: function query(sql, args) {
2659
- return util.util.promisify(connection.query).call(connection, sql, args);
2660
- },
2661
- beginTransaction: function beginTransaction() {
2662
- return util.util.promisify(connection.beginTransaction).call(connection);
2663
- },
2664
- commit: function commit() {
2665
- return util.util.promisify(connection.commit).call(connection);
2666
- },
2667
- rollback: function rollback() {
2668
- return util.util.promisify(connection.rollback).call(connection);
2669
- },
2670
- close: function close() {
2671
- return util.util.promisify(connection.end).call(connection);
2672
- }
2673
- };
2674
- }
2675
-
2676
- var db = connect;
2677
-
2678
- var _this$3 = undefined;
2679
-
2680
- var config = {
2681
- host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
2682
- user: 'nasp',
2683
- password: 'uRNkF9SkfXQs6AKK',
2684
- database: 'user'
2685
- };
2686
-
2687
- var findUser = function () {
2688
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(email) {
2689
- var password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
2690
- var db$1, query, res, user, hash, passwordsMatch, user_shared, occupation_id;
2691
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
2692
- while (1) {
2693
- switch (_context.prev = _context.next) {
2694
- case 0:
2695
- db$1 = null;
2696
- _context.prev = 1;
2697
-
2698
-
2699
- db$1 = db(config);
2700
-
2701
- query = '\n select * \n from user \n where trim(lower(email)) = ?\n ';
2702
- _context.next = 6;
2703
- return db$1.query(query, [email.toLowerCase().trim()]);
2704
-
2705
- case 6:
2706
- res = _context.sent;
2707
- user = res.length > 0 ? res[0] : null;
2708
-
2709
- if (user) {
2710
- _context.next = 10;
2711
- break;
2712
- }
2713
-
2714
- throw new Error('Invalid credential provided');
2715
-
2716
- case 10:
2717
- if (!password) {
2718
- _context.next = 15;
2719
- break;
2720
- }
2721
-
2722
- hash = md5.md5(password);
2723
- passwordsMatch = hash === user.password;
2724
-
2725
- if (passwordsMatch) {
2726
- _context.next = 15;
2727
- break;
2728
- }
2729
-
2730
- throw new Error('Password doesn\'t match');
2731
-
2732
- case 15:
2733
-
2734
- query = '\n select * \n from user_shared \n where user_id = ?\n ';
2735
- _context.next = 18;
2736
- return db$1.query(query, [user.id]);
2737
-
2738
- case 18:
2739
- res = _context.sent;
2740
- user_shared = res.length > 0 ? res[0] : null;
2741
-
2742
- user.shared = user_shared;
2743
-
2744
- // occupation
2745
- query = '\n select id \n from occupation \n where name = ?\n ';
2746
- _context.next = 24;
2747
- return db$1.query(query, [user_shared.occupation]);
2748
-
2749
- case 24:
2750
- res = _context.sent;
2751
- occupation_id = res.length > 0 ? res[0].id : '';
2752
-
2753
- user.shared.occupation_id = occupation_id;
2754
-
2755
- _context.next = 29;
2756
- return db$1.close();
2757
-
2758
- case 29:
2759
- return _context.abrupt('return', {
2760
- error: '',
2761
- user: user
2762
- });
2763
-
2764
- case 32:
2765
- _context.prev = 32;
2766
- _context.t0 = _context['catch'](1);
2767
-
2768
- if (!db$1) {
2769
- _context.next = 37;
2770
- break;
2771
- }
2772
-
2773
- _context.next = 37;
2774
- return db$1.close();
2775
-
2776
- case 37:
2777
- return _context.abrupt('return', {
2778
- error: _context.t0.message,
2779
- user: null
2780
- });
2781
-
2782
- case 38:
2783
- case 'end':
2784
- return _context.stop();
2785
- }
2786
- }
2787
- }, _callee, this, [[1, 32]]);
2788
- }));
2789
-
2790
- return function findUser(_x) {
2791
- return _ref.apply(this, arguments);
2792
- };
2793
- }();
2794
-
2795
- var updateUser = function () {
2796
- var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(data) {
2797
- var db$1, query, res, hash, columns, i, column, occupation_name;
2798
- return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
2799
- while (1) {
2800
- switch (_context2.prev = _context2.next) {
2801
- case 0:
2802
- db$1 = null;
2803
- _context2.prev = 1;
2804
-
2805
-
2806
- validateUserData(data);
2807
-
2808
- db$1 = db(config);
2809
-
2810
- _context2.next = 6;
2811
- return db$1.beginTransaction();
2812
-
2813
- case 6:
2814
- if (data.user_id) {
2815
- _context2.next = 8;
2816
- break;
2817
- }
2818
-
2819
- throw new Error('Please provide user ID');
2820
-
2821
- case 8:
2822
-
2823
- data.email = data.email.toLowerCase().trim();
2824
-
2825
- // check if new email is taken
2826
- query = '\n select * \n from user \n where lower(trim(email)) = ?\n and id != ?\n ';
2827
- _context2.next = 12;
2828
- return db$1.query(query, [data.email, data.user_id]);
2829
-
2830
- case 12:
2831
- res = _context2.sent;
2832
-
2833
- if (!(res && res.length > 0)) {
2834
- _context2.next = 15;
2835
- break;
2836
- }
2837
-
2838
- throw new Error('Email already taken');
2839
-
2840
- case 15:
2841
- if (!data.password) {
2842
- _context2.next = 23;
2843
- break;
2844
- }
2845
-
2846
- hash = md5.md5(data.password);
2847
-
2848
- query = '\n update user \n set password = ?\n where user_id = ?\n ';
2849
- _context2.next = 20;
2850
- return db$1.query(query, [hash, data.user_id]);
2851
-
2852
- case 20:
2853
- res = _context2.sent;
2854
-
2855
- if (!(!res || res.affectedRows < 1)) {
2856
- _context2.next = 23;
2857
- break;
2858
- }
2859
-
2860
- throw new Error('Failed to update password');
2861
-
2862
- case 23:
2863
-
2864
- query = 'show columns from user_shared';
2865
- _context2.next = 26;
2866
- return db$1.query(query);
2867
-
2868
- case 26:
2869
- columns = _context2.sent;
2870
-
2871
-
2872
- for (i = 0; i < columns.length; i++) {
2873
- column = columns[i].Field;
2874
-
2875
- if (typeof data[column] === 'undefined') {
2876
- data[column] = '';
2877
- }
2878
- }
2879
-
2880
- // user_shared
2881
- query = '\n update user_shared\n set \n first_name = ?,\n last_name = ?,\n country = ?,\n city = ?,\n state = ?,\n zip = ?,\n phone = ?,\n occupation = ?,\n primary_specialty = ?,\n area_of_practice = ?,\n work_place = ?,\n graduation_year = ?,\n medical_school = ?,\n npi = ?,\n role = ?,\n updated = current_timestamp\n where user_id = ?\n ';
2882
-
2883
- _context2.next = 31;
2884
- return getOccupationNameById(db$1, data.occupation);
2885
-
2886
- case 31:
2887
- occupation_name = _context2.sent;
2888
- _context2.next = 34;
2889
- return db$1.query(query, [data.first_name, data.last_name, data.country, data.city, data.state, data.zip, data.phone, occupation_name, data.primary_specialty, data.area_of_practice, data.work_place, data.graduation_year, data.medical_school, data.npi, data.role, data.user_id]);
2890
-
2891
- case 34:
2892
- res = _context2.sent;
2893
-
2894
- if (!(!res || res.affectedRows < 1)) {
2895
- _context2.next = 37;
2896
- break;
2897
- }
2898
-
2899
- throw new Error('Failed to update user shared information record');
2900
-
2901
- case 37:
2902
- _context2.next = 39;
2903
- return db$1.commit();
2904
-
2905
- case 39:
2906
- _context2.next = 41;
2907
- return db$1.close();
2908
-
2909
- case 41:
2910
-
2911
- db$1 = null;
2912
-
2913
- return _context2.abrupt('return', {
2914
- error: '',
2915
- user: findUser(data.email)
2916
- });
2917
-
2918
- case 45:
2919
- _context2.prev = 45;
2920
- _context2.t0 = _context2['catch'](1);
2921
-
2922
-
2923
- console.log('error:', _context2.t0);
2924
-
2925
- if (!db$1) {
2926
- _context2.next = 53;
2927
- break;
2928
- }
2929
-
2930
- _context2.next = 51;
2931
- return db$1.rollback();
2932
-
2933
- case 51:
2934
- _context2.next = 53;
2935
- return db$1.close();
2936
-
2937
- case 53:
2938
- return _context2.abrupt('return', {
2939
- error: _context2.t0.message,
2940
- user: null
2941
- });
2942
-
2943
- case 54:
2944
- case 'end':
2945
- return _context2.stop();
2946
- }
2947
- }
2948
- }, _callee2, this, [[1, 45]]);
2949
- }));
2950
-
2951
- return function updateUser(_x3) {
2952
- return _ref2.apply(this, arguments);
2953
- };
2954
- }();
2955
-
2956
- var validateUserData = function validateUserData(data) {
2957
- var requirePassword = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2958
-
2959
- if (!data.email) {
2960
- throw new Error('Email is required');
2961
- }
2962
-
2963
- if (requirePassword && !data.password) {
2964
- throw new Error('Password is required');
2965
- }
2966
-
2967
- if (data.password && data.password !== data.rpassword) {
2968
- throw new Error('Password does not match');
2969
- }
2970
-
2971
- if (!data.first_name) {
2972
- throw new Error('First name is required');
2973
- }
2974
-
2975
- if (!data.last_name) {
2976
- throw new Error('Last name is required');
2977
- }
2978
-
2979
- if (!data.country) {
2980
- throw new Error('Country is required');
2981
- }
2982
-
2983
- if (data.country === 'United States') {
2984
- if (!data.state) {
2985
- throw new Error('State is required');
2986
- }
2987
-
2988
- if (!data.zip) {
2989
- throw new Error('Zip code is required');
2990
- }
2991
-
2992
- if (!data.phone) {
2993
- throw new Error('Phone is required');
2994
- }
2995
- }
2996
- };
2997
-
2998
- var getOccupationNameById = function () {
2999
- var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(db, occupation_id) {
3000
- var query, res;
3001
- return asyncToGenerator.regenerator.wrap(function _callee3$(_context3) {
3002
- while (1) {
3003
- switch (_context3.prev = _context3.next) {
3004
- case 0:
3005
- query = '\n select name\n from occupation \n where id = ?\n ';
3006
- _context3.next = 3;
3007
- return db.query(query, [occupation_id]);
3008
-
3009
- case 3:
3010
- res = _context3.sent;
3011
-
3012
- if (!(res && res.length > 0)) {
3013
- _context3.next = 6;
3014
- break;
3015
- }
3016
-
3017
- return _context3.abrupt('return', res[0].name);
3018
-
3019
- case 6:
3020
- throw new Error('Failed to get occupation name by ID: ' + occupation_id);
3021
-
3022
- case 7:
3023
- case 'end':
3024
- return _context3.stop();
3025
- }
3026
- }
3027
- }, _callee3, _this$3);
3028
- }));
3029
-
3030
- return function getOccupationNameById(_x5, _x6) {
3031
- return _ref3.apply(this, arguments);
3032
- };
3033
- }();
3034
-
3035
- var createUser = function () {
3036
- var _ref4 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee4(data) {
3037
- var db$1, query, res, hash, columns, i, column, user_id, occupation_name;
3038
- return asyncToGenerator.regenerator.wrap(function _callee4$(_context4) {
3039
- while (1) {
3040
- switch (_context4.prev = _context4.next) {
3041
- case 0:
3042
- db$1 = null;
3043
- _context4.prev = 1;
3044
-
3045
-
3046
- validateUserData(data, true);
3047
-
3048
- db$1 = db(config);
3049
-
3050
- _context4.next = 6;
3051
- return db$1.beginTransaction();
3052
-
3053
- case 6:
3054
-
3055
- data.email = data.email.toLowerCase().trim();
3056
-
3057
- // check if user exists
3058
- query = '\n select * \n from user \n where lower(trim(email)) = ?\n ';
3059
- _context4.next = 10;
3060
- return db$1.query(query, [data.email]);
3061
-
3062
- case 10:
3063
- res = _context4.sent;
3064
-
3065
- if (!(res && res.length > 0)) {
3066
- _context4.next = 13;
3067
- break;
3068
- }
3069
-
3070
- throw new Error('User already exists');
3071
-
3072
- case 13:
3073
- hash = md5.md5(data.password);
3074
-
3075
- // basic user info
3076
-
3077
- query = '\n insert into user ( \n email, password, created\n ) values (\n ?, ?, current_timestamp\n )\n ';
3078
- _context4.next = 17;
3079
- return db$1.query(query, [data.email, hash]);
3080
-
3081
- case 17:
3082
- res = _context4.sent;
3083
-
3084
- if (!(!res || res.insertId < 1)) {
3085
- _context4.next = 20;
3086
- break;
3087
- }
3088
-
3089
- throw new Error('Failed to create user');
3090
-
3091
- case 20:
3092
-
3093
- query = 'show columns from user_shared';
3094
- _context4.next = 23;
3095
- return db$1.query(query);
3096
-
3097
- case 23:
3098
- columns = _context4.sent;
3099
-
3100
-
3101
- for (i = 0; i < columns.length; i++) {
3102
- column = columns[i].Field;
3103
-
3104
- if (typeof data[column] === 'undefined') {
3105
- data[column] = '';
3106
- }
3107
- }
3108
-
3109
- user_id = res.insertId;
3110
-
3111
- // user_shared
3112
-
3113
- query = '\n insert into user_shared (\n user_id, first_name, last_name, country, city, state, zip, phone, \n occupation, primary_specialty, area_of_practice, work_place, graduation_year, medical_school, \n npi, role, updated \n ) values (\n ?, ?, ?, ?, ?, ?, ?, ?,\n ?, ?, ?, ?, ?, ?,\n ?, ?, current_timestamp\n )\n ';
3114
-
3115
- _context4.next = 29;
3116
- return getOccupationNameById(db$1, data.occupation);
3117
-
3118
- case 29:
3119
- occupation_name = _context4.sent;
3120
- _context4.next = 32;
3121
- return db$1.query(query, [user_id, data.first_name, data.last_name, data.country, data.city, data.state, data.zip, data.phone, occupation_name, data.primary_specialty, data.area_of_practice, data.work_place, data.graduation_year, data.medical_school, data.npi, data.role]);
3122
-
3123
- case 32:
3124
- res = _context4.sent;
3125
-
3126
- if (!(!res || res.affectedRows < 1)) {
3127
- _context4.next = 35;
3128
- break;
3129
- }
3130
-
3131
- throw new Error('Failed to create user shared information record');
3132
-
3133
- case 35:
3134
- _context4.next = 37;
3135
- return db$1.commit();
3136
-
3137
- case 37:
3138
- _context4.next = 39;
3139
- return db$1.close();
3140
-
3141
- case 39:
3142
- return _context4.abrupt('return', {
3143
- error: '',
3144
- user: findUser(data.email)
3145
- });
3146
-
3147
- case 42:
3148
- _context4.prev = 42;
3149
- _context4.t0 = _context4['catch'](1);
3150
-
3151
- if (!db$1) {
3152
- _context4.next = 49;
3153
- break;
3154
- }
3155
-
3156
- _context4.next = 47;
3157
- return db$1.rollback();
3158
-
3159
- case 47:
3160
- _context4.next = 49;
3161
- return db$1.close();
3162
-
3163
- case 49:
3164
- return _context4.abrupt('return', {
3165
- error: _context4.t0.message,
3166
- user: null
3167
- });
3168
-
3169
- case 50:
3170
- case 'end':
3171
- return _context4.stop();
3172
- }
3173
- }
3174
- }, _callee4, this, [[1, 42]]);
3175
- }));
3176
-
3177
- return function createUser(_x7) {
3178
- return _ref4.apply(this, arguments);
3179
- };
3180
- }();
3181
-
3182
- var createUser$1 = function () {
3183
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(data) {
3184
- var res;
3185
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
3186
- while (1) {
3187
- switch (_context.prev = _context.next) {
3188
- case 0:
3189
- _context.next = 2;
3190
- return createUser(data);
3191
-
3192
- case 2:
3193
- res = _context.sent;
3194
-
3195
- if (!res.error) {
3196
- _context.next = 5;
3197
- break;
3198
- }
3199
-
3200
- throw new Error(res.error);
3201
-
3202
- case 5:
3203
- return _context.abrupt('return', res.user);
3204
-
3205
- case 6:
3206
- case 'end':
3207
- return _context.stop();
3208
- }
3209
- }
3210
- }, _callee, this);
3211
- }));
3212
-
3213
- return function createUser(_x) {
3214
- return _ref.apply(this, arguments);
3215
- };
3216
- }();
3217
-
3218
- var updateUser$1 = function () {
3219
- var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(data) {
3220
- var res;
3221
- return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
3222
- while (1) {
3223
- switch (_context2.prev = _context2.next) {
3224
- case 0:
3225
- _context2.next = 2;
3226
- return updateUser(data);
3227
-
3228
- case 2:
3229
- res = _context2.sent;
3230
-
3231
- if (!res.error) {
3232
- _context2.next = 5;
3233
- break;
3234
- }
3235
-
3236
- throw new Error(res.error);
3237
-
3238
- case 5:
3239
- return _context2.abrupt('return', res.user);
3240
-
3241
- case 6:
3242
- case 'end':
3243
- return _context2.stop();
3244
- }
3245
- }
3246
- }, _callee2, this);
3247
- }));
3248
-
3249
- return function updateUser(_x2) {
3250
- return _ref2.apply(this, arguments);
3251
- };
3252
- }();
3253
-
3254
- var findUser$1 = function () {
3255
- var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(_ref4) {
3256
- var email = _ref4.email,
3257
- password = _ref4.password;
3258
- var res;
3259
- return asyncToGenerator.regenerator.wrap(function _callee3$(_context3) {
3260
- while (1) {
3261
- switch (_context3.prev = _context3.next) {
3262
- case 0:
3263
- _context3.next = 2;
3264
- return findUser(email, password);
3265
-
3266
- case 2:
3267
- res = _context3.sent;
3268
-
3269
- if (!res.error) {
3270
- _context3.next = 5;
3271
- break;
3272
- }
3273
-
3274
- throw new Error(res.error);
3275
-
3276
- case 5:
3277
- return _context3.abrupt('return', res.user);
3278
-
3279
- case 6:
3280
- case 'end':
3281
- return _context3.stop();
3282
- }
3283
- }
3284
- }, _callee3, this);
3285
- }));
3286
-
3287
- return function findUser(_x3) {
3288
- return _ref3.apply(this, arguments);
3289
- };
3290
- }();
3291
-
3292
- var user = /*#__PURE__*/Object.freeze({
3293
- __proto__: null,
3294
- createUser: createUser$1,
3295
- updateUser: updateUser$1,
3296
- findUser: findUser$1
3297
- });
3298
-
3299
- var localStrategy = new Local__default['default'].Strategy({
3300
- usernameField: 'email',
3301
- passwordField: 'password'
3302
- }, function (email, password, done) {
3303
-
3304
- findUser$1({ email: email, password: password }).then(function (user) {
3305
- done(null, user);
3306
- }).catch(function (error) {
3307
- done(error);
3308
- });
3309
- });
3310
-
3311
- var passportLocal = /*#__PURE__*/Object.freeze({
3312
- __proto__: null,
3313
- localStrategy: localStrategy
3314
- });
3315
-
3316
- var _this$4 = undefined;
3317
-
3318
- var config$1 = {
3319
- host: 'sanity-datasource.cluster-crao688bsrdh.us-east-1.rds.amazonaws.com',
3320
- user: 'nasp',
3321
- password: 'uRNkF9SkfXQs6AKK',
3322
- database: 'user'
3323
- };
3324
-
3325
- var getOccupation = function () {
3326
- var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(type) {
3327
- var db$1, query, result;
3328
- return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
3329
- while (1) {
3330
- switch (_context.prev = _context.next) {
3331
- case 0:
3332
- db$1 = db(config$1);
3333
- query = '\n select name as label, id as value\n from occupation\n where type = ?\n ';
3334
- _context.next = 4;
3335
- return db$1.query(query, [type]);
3336
-
3337
- case 4:
3338
- result = _context.sent;
3339
- _context.next = 7;
3340
- return db$1.close();
3341
-
3342
- case 7:
3343
- return _context.abrupt('return', result);
3344
-
3345
- case 8:
3346
- case 'end':
3347
- return _context.stop();
3348
- }
3349
- }
3350
- }, _callee, _this$4);
3351
- }));
3352
-
3353
- return function getOccupation(_x) {
3354
- return _ref.apply(this, arguments);
3355
- };
3356
- }();
3357
-
3358
- var getFieldsAndOptions = function () {
3359
- var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee2(occupation) {
3360
- var db$1, query, result, i, field, optionQuery, options;
3361
- return asyncToGenerator.regenerator.wrap(function _callee2$(_context2) {
3362
- while (1) {
3363
- switch (_context2.prev = _context2.next) {
3364
- case 0:
3365
- db$1 = db(config$1);
3366
- query = '\n select * \n from field\n where occupation_id = ?\n order by sorting\n ';
3367
- _context2.next = 4;
3368
- return db$1.query(query, [occupation]);
3369
-
3370
- case 4:
3371
- result = _context2.sent;
3372
- i = 0;
3373
-
3374
- case 6:
3375
- if (!(i < result.length)) {
3376
- _context2.next = 17;
3377
- break;
3378
- }
3379
-
3380
- field = result[i];
3381
-
3382
- if (!(field.type === 'select')) {
3383
- _context2.next = 14;
3384
- break;
3385
- }
3386
-
3387
- optionQuery = '\n select * \n from options\n where list_id = ?\n order by sorting\n ';
3388
- _context2.next = 12;
3389
- return db$1.query(optionQuery, [field.list_id]);
3390
-
3391
- case 12:
3392
- options = _context2.sent;
3393
-
3394
- field.options = options ? options : [];
3395
-
3396
- case 14:
3397
- i++;
3398
- _context2.next = 6;
3399
- break;
3400
-
3401
- case 17:
3402
- _context2.next = 19;
3403
- return db$1.close();
3404
-
3405
- case 19:
3406
- return _context2.abrupt('return', result);
3407
-
3408
- case 20:
3409
- case 'end':
3410
- return _context2.stop();
3411
- }
3412
- }
3413
- }, _callee2, _this$4);
3414
- }));
3415
-
3416
- return function getFieldsAndOptions(_x2) {
3417
- return _ref2.apply(this, arguments);
3418
- };
3419
- }();
3420
-
3421
- var ProcessData = (function () {
3422
- var _ref3 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee3(req, res) {
3423
- var action, data, type, occupation;
3424
- return asyncToGenerator.regenerator.wrap(function _callee3$(_context3) {
3425
- while (1) {
3426
- switch (_context3.prev = _context3.next) {
3427
- case 0:
3428
- _context3.prev = 0;
3429
- action = req.body.action;
3430
- data = null;
3431
- _context3.t0 = action;
3432
- _context3.next = _context3.t0 === 'get-occupation' ? 6 : _context3.t0 === 'get-fields' ? 11 : 16;
3433
- break;
3434
-
3435
- case 6:
3436
- type = req.body.type;
3437
- _context3.next = 9;
3438
- return getOccupation(type);
3439
-
3440
- case 9:
3441
- data = _context3.sent;
3442
- return _context3.abrupt('break', 17);
3443
-
3444
- case 11:
3445
- occupation = req.body.occupation;
3446
- _context3.next = 14;
3447
- return getFieldsAndOptions(occupation);
3448
-
3449
- case 14:
3450
- data = _context3.sent;
3451
- return _context3.abrupt('break', 17);
3452
-
3453
- case 16:
3454
- throw new Error('Invalid action: ' + action);
3455
-
3456
- case 17:
3457
- return _context3.abrupt('return', res.json({
3458
- error: '',
3459
- data: data
3460
- }));
3461
-
3462
- case 20:
3463
- _context3.prev = 20;
3464
- _context3.t1 = _context3['catch'](0);
3465
- return _context3.abrupt('return', res.json({
3466
- error: _context3.t1.message,
3467
- data: null
3468
- }));
3469
-
3470
- case 23:
3471
- case 'end':
3472
- return _context3.stop();
3473
- }
3474
- }
3475
- }, _callee3, this, [[0, 20]]);
3476
- }));
3477
-
3478
- return function (_x3, _x4) {
3479
- return _ref3.apply(this, arguments);
3480
- };
3481
- })();
3482
-
3483
- var LoginForm_1 = LoginForm;
3484
- var SignupForm_1 = SignupForm;
3485
- var ProfileForm_1 = SignupForm$1;
3486
- var AuthCookies_1 = authCookies;
3487
- var AuthHooks_1 = hooks;
3488
- var Iron_1 = iron;
3489
- var PassportLocal_1 = passportLocal;
3490
- var User_1 = user;
3491
- var ProcessData_1 = ProcessData;
3492
-
3493
- var auth = {
3494
- LoginForm: LoginForm_1,
3495
- SignupForm: SignupForm_1,
3496
- ProfileForm: ProfileForm_1,
3497
- AuthCookies: AuthCookies_1,
3498
- AuthHooks: AuthHooks_1,
3499
- Iron: Iron_1,
3500
- PassportLocal: PassportLocal_1,
3501
- User: User_1,
3502
- ProcessData: ProcessData_1
3503
- };
3504
-
3505
- exports.AuthCookies = AuthCookies_1;
3506
- exports.AuthHooks = AuthHooks_1;
3507
- exports.Iron = Iron_1;
3508
- exports.LoginForm = LoginForm_1;
3509
- exports.PassportLocal = PassportLocal_1;
3510
- exports.ProcessData = ProcessData_1;
3511
- exports.ProfileForm = ProfileForm_1;
3512
- exports.SignupForm = SignupForm_1;
3513
- exports.User = User_1;
3514
- exports.default = auth;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-5cca2099.js");require("./_commonjsHelpers-0a7b82d9.js"),require("./index-3291d44c.js"),require("./slicedToArray-c9e22c6a.js"),require("./unsupportedIterableToArray-294d47a8.js"),require("react"),require("./extends-5ede7877.js"),require("react-bootstrap"),require("next/router"),require("swr"),require("cookie"),require("passport-local"),require("mysql"),require("util"),require("md5"),exports.AuthCookies=e.AuthCookies_1,exports.AuthHooks=e.AuthHooks_1,exports.Iron=e.Iron_1,exports.LoginForm=e.LoginForm_1,exports.PassportLocal=e.PassportLocal_1,exports.ProcessData=e.ProcessData_1,exports.ProfileForm=e.ProfileForm_1,exports.SignupForm=e.SignupForm_1,exports.User=e.User_1,exports.default=e.auth;