@xylabs/sdk-react 2.9.10 → 2.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/dist/calcSpacing.js +3 -3
  2. package/dist/calcSpacing.js.map +1 -1
  3. package/dist/cjs5/components/Portal/Portal.d.ts +3 -0
  4. package/dist/cjs5/components/Portal/PortalProps.d.ts +7 -0
  5. package/dist/cjs5/components/Portal/index.d.ts +2 -0
  6. package/dist/cjs5/components/index.d.ts +1 -0
  7. package/dist/cjs5/index.js +1144 -1651
  8. package/dist/cjs5/index.js.map +1 -1
  9. package/dist/components/AppBarEx/AppBarEx.js +7 -7
  10. package/dist/components/AppBarEx/AppBarEx.js.map +1 -1
  11. package/dist/components/AppBarEx/AppBarEx.stories.js +3 -4
  12. package/dist/components/AppBarEx/AppBarEx.stories.js.map +1 -1
  13. package/dist/components/Background.js +2 -3
  14. package/dist/components/Background.js.map +1 -1
  15. package/dist/components/BasePage/BasePage.js +7 -6
  16. package/dist/components/BasePage/BasePage.js.map +1 -1
  17. package/dist/components/BasePage/BasePage.stories.js +5 -6
  18. package/dist/components/BasePage/BasePage.stories.js.map +1 -1
  19. package/dist/components/Breadcrumbs/BreadcrumbsEx.js +12 -12
  20. package/dist/components/Breadcrumbs/BreadcrumbsEx.js.map +1 -1
  21. package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js +4 -5
  22. package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js.map +1 -1
  23. package/dist/components/BusyCircularProgress.js +5 -5
  24. package/dist/components/BusyCircularProgress.js.map +1 -1
  25. package/dist/components/BusyLinearProgress.js +5 -5
  26. package/dist/components/BusyLinearProgress.js.map +1 -1
  27. package/dist/components/ButtonEx/ButtonEx.js +5 -5
  28. package/dist/components/ButtonEx/ButtonEx.js.map +1 -1
  29. package/dist/components/ButtonEx/ButtonEx.stories.js +5 -6
  30. package/dist/components/ButtonEx/ButtonEx.stories.js.map +1 -1
  31. package/dist/components/ButtonEx/ButtonExBase.js +6 -6
  32. package/dist/components/ButtonEx/ButtonExBase.js.map +1 -1
  33. package/dist/components/ButtonEx/ButtonExTo.js +6 -6
  34. package/dist/components/ButtonEx/ButtonExTo.js.map +1 -1
  35. package/dist/components/CookieConsent/CookieConsent.js +5 -6
  36. package/dist/components/CookieConsent/CookieConsent.js.map +1 -1
  37. package/dist/components/CookieConsent/CookieConsent.stories.js +10 -11
  38. package/dist/components/CookieConsent/CookieConsent.stories.js.map +1 -1
  39. package/dist/components/CookieConsent/CookieConsentBody.js +11 -11
  40. package/dist/components/CookieConsent/CookieConsentBody.js.map +1 -1
  41. package/dist/components/CoverProgress.js +4 -5
  42. package/dist/components/CoverProgress.js.map +1 -1
  43. package/dist/components/Errors/ErrorViewer.js +5 -5
  44. package/dist/components/Errors/ErrorViewer.js.map +1 -1
  45. package/dist/components/Errors/ErrorViewer.stories.js +3 -4
  46. package/dist/components/Errors/ErrorViewer.stories.js.map +1 -1
  47. package/dist/components/Errors/ErrorsViewer.js +5 -5
  48. package/dist/components/Errors/ErrorsViewer.js.map +1 -1
  49. package/dist/components/Errors/ErrorsViewer.stories.js +3 -4
  50. package/dist/components/Errors/ErrorsViewer.stories.js.map +1 -1
  51. package/dist/components/EthAccount/EthAccount.js +12 -12
  52. package/dist/components/EthAccount/EthAccount.js.map +1 -1
  53. package/dist/components/EthAccount/EthAccount.stories.js +8 -9
  54. package/dist/components/EthAccount/EthAccount.stories.js.map +1 -1
  55. package/dist/components/EthBlock.js +3 -4
  56. package/dist/components/EthBlock.js.map +1 -1
  57. package/dist/components/Experiments/Experiment.js +2 -2
  58. package/dist/components/Experiments/Experiment.js.map +1 -1
  59. package/dist/components/Experiments/Experiments.js +43 -66
  60. package/dist/components/Experiments/Experiments.js.map +1 -1
  61. package/dist/components/Experiments/Experiments.stories.js +5 -6
  62. package/dist/components/Experiments/Experiments.stories.js.map +1 -1
  63. package/dist/components/Experiments/ExperimentsDebugger.js +20 -22
  64. package/dist/components/Experiments/ExperimentsDebugger.js.map +1 -1
  65. package/dist/components/Experiments/ExperimentsDebugger.stories.js +3 -4
  66. package/dist/components/Experiments/ExperimentsDebugger.stories.js.map +1 -1
  67. package/dist/components/Experiments/models/index.js +2 -2
  68. package/dist/components/Experiments/models/index.js.map +1 -1
  69. package/dist/components/FlexBox/BusyBox.js +6 -6
  70. package/dist/components/FlexBox/BusyBox.js.map +1 -1
  71. package/dist/components/FlexBox/BusyBox.stories.js +7 -8
  72. package/dist/components/FlexBox/BusyBox.stories.js.map +1 -1
  73. package/dist/components/FlexBox/FlexCol.js +4 -5
  74. package/dist/components/FlexBox/FlexCol.js.map +1 -1
  75. package/dist/components/FlexBox/FlexCol.stories.js +10 -11
  76. package/dist/components/FlexBox/FlexCol.stories.js.map +1 -1
  77. package/dist/components/FlexBox/FlexRow.js +4 -5
  78. package/dist/components/FlexBox/FlexRow.js.map +1 -1
  79. package/dist/components/FlexBox/FlexRow.stories.js +14 -15
  80. package/dist/components/FlexBox/FlexRow.stories.js.map +1 -1
  81. package/dist/components/HoverScale.js +12 -15
  82. package/dist/components/HoverScale.js.map +1 -1
  83. package/dist/components/Identicon.js +22 -22
  84. package/dist/components/Identicon.js.map +1 -1
  85. package/dist/components/InvertableThemeProvider/InvertableThemeContext.js +1 -1
  86. package/dist/components/InvertableThemeProvider/InvertableThemeContext.js.map +1 -1
  87. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js +7 -9
  88. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js.map +1 -1
  89. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js +3 -4
  90. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js.map +1 -1
  91. package/dist/components/LinkEx/LinkToEx.js +4 -4
  92. package/dist/components/LinkEx/LinkToEx.js.map +1 -1
  93. package/dist/components/NumberStatus/NumberStatus.js +10 -10
  94. package/dist/components/NumberStatus/NumberStatus.js.map +1 -1
  95. package/dist/components/NumberStatus/NumberStatus.stories.js +11 -12
  96. package/dist/components/NumberStatus/NumberStatus.stories.js.map +1 -1
  97. package/dist/components/Portal/Portal.d.ts +3 -0
  98. package/dist/components/Portal/Portal.js +20 -0
  99. package/dist/components/Portal/Portal.js.map +1 -0
  100. package/dist/components/Portal/PortalProps.d.ts +7 -0
  101. package/dist/components/Portal/PortalProps.js +2 -0
  102. package/dist/components/Portal/PortalProps.js.map +1 -0
  103. package/dist/components/Portal/index.d.ts +2 -0
  104. package/dist/components/Portal/index.js +3 -0
  105. package/dist/components/Portal/index.js.map +1 -0
  106. package/dist/components/QuickTipButton/QuickTipButton.js +5 -5
  107. package/dist/components/QuickTipButton/QuickTipButton.js.map +1 -1
  108. package/dist/components/QuickTipButton/QuickTipButton.stories.js +3 -4
  109. package/dist/components/QuickTipButton/QuickTipButton.stories.js.map +1 -1
  110. package/dist/components/RedirectWithQuery.js +6 -8
  111. package/dist/components/RedirectWithQuery.js.map +1 -1
  112. package/dist/components/RichResult/RichResult.js +4 -5
  113. package/dist/components/RichResult/RichResult.js.map +1 -1
  114. package/dist/components/ScrollToTop.js +3 -3
  115. package/dist/components/ScrollToTop.js.map +1 -1
  116. package/dist/components/ScrollToTopButton.js +8 -8
  117. package/dist/components/ScrollToTopButton.js.map +1 -1
  118. package/dist/components/TokenAmount/TokenAmount.js +8 -8
  119. package/dist/components/TokenAmount/TokenAmount.js.map +1 -1
  120. package/dist/components/TokenAmount/TokenAmount.stories.js +9 -10
  121. package/dist/components/TokenAmount/TokenAmount.stories.js.map +1 -1
  122. package/dist/components/dialogs/ErrorDialog.js +12 -12
  123. package/dist/components/dialogs/ErrorDialog.js.map +1 -1
  124. package/dist/components/dialogs/ErrorDialog.stories.js +3 -4
  125. package/dist/components/dialogs/ErrorDialog.stories.js.map +1 -1
  126. package/dist/components/dialogs/MessageDialog.js +4 -4
  127. package/dist/components/dialogs/MessageDialog.js.map +1 -1
  128. package/dist/components/dialogs/MessageDialog.stories.js +3 -4
  129. package/dist/components/dialogs/MessageDialog.stories.js.map +1 -1
  130. package/dist/components/index.d.ts +1 -0
  131. package/dist/components/index.js +1 -0
  132. package/dist/components/index.js.map +1 -1
  133. package/dist/contexts/CookieConsent/Context.js +1 -1
  134. package/dist/contexts/CookieConsent/Context.js.map +1 -1
  135. package/dist/contexts/CookieConsent/Loader.js +8 -10
  136. package/dist/contexts/CookieConsent/Loader.js.map +1 -1
  137. package/dist/contexts/CookieConsent/use.js +1 -1
  138. package/dist/contexts/CookieConsent/use.js.map +1 -1
  139. package/dist/contexts/Ethers/Context.js +1 -1
  140. package/dist/contexts/Ethers/Context.js.map +1 -1
  141. package/dist/contexts/Ethers/Infura.js +8 -9
  142. package/dist/contexts/Ethers/Infura.js.map +1 -1
  143. package/dist/contexts/Ethers/Loader.js +3 -3
  144. package/dist/contexts/Ethers/Loader.js.map +1 -1
  145. package/dist/contexts/Ethers/MetaMask.js +73 -100
  146. package/dist/contexts/Ethers/MetaMask.js.map +1 -1
  147. package/dist/contexts/Ethers/MyEtherWallet.js +54 -80
  148. package/dist/contexts/Ethers/MyEtherWallet.js.map +1 -1
  149. package/dist/contexts/Ethers/Opera.js +39 -51
  150. package/dist/contexts/Ethers/Opera.js.map +1 -1
  151. package/dist/contexts/Ethers/Trust.js +30 -42
  152. package/dist/contexts/Ethers/Trust.js.map +1 -1
  153. package/dist/contexts/NetworkSettings/Context.js +1 -1
  154. package/dist/contexts/NetworkSettings/Context.js.map +1 -1
  155. package/dist/contexts/NetworkSettings/Loader.js +3 -4
  156. package/dist/contexts/NetworkSettings/Loader.js.map +1 -1
  157. package/dist/contexts/UserEvents/Context.js +1 -1
  158. package/dist/contexts/UserEvents/Context.js.map +1 -1
  159. package/dist/contexts/UserEvents/Loader.js +2 -4
  160. package/dist/contexts/UserEvents/Loader.js.map +1 -1
  161. package/dist/esm2015/components/Portal/Portal.d.ts +3 -0
  162. package/dist/esm2015/components/Portal/PortalProps.d.ts +7 -0
  163. package/dist/esm2015/components/Portal/index.d.ts +2 -0
  164. package/dist/esm2015/components/index.d.ts +1 -0
  165. package/dist/esm2015/index.js +1144 -1652
  166. package/dist/esm2015/index.js.map +1 -1
  167. package/dist/esm2017/components/Portal/Portal.d.ts +3 -0
  168. package/dist/esm2017/components/Portal/PortalProps.d.ts +7 -0
  169. package/dist/esm2017/components/Portal/index.d.ts +2 -0
  170. package/dist/esm2017/components/index.d.ts +1 -0
  171. package/dist/esm2017/index.js +1144 -1652
  172. package/dist/esm2017/index.js.map +1 -1
  173. package/dist/esm5/components/Portal/Portal.d.ts +3 -0
  174. package/dist/esm5/components/Portal/PortalProps.d.ts +7 -0
  175. package/dist/esm5/components/Portal/index.d.ts +2 -0
  176. package/dist/esm5/components/index.d.ts +1 -0
  177. package/dist/esm5/index.js +1144 -1652
  178. package/dist/esm5/index.js.map +1 -1
  179. package/dist/hooks/useBreakpoint.js +7 -7
  180. package/dist/hooks/useBreakpoint.js.map +1 -1
  181. package/dist/hooks/useLocalStorage.js +5 -6
  182. package/dist/hooks/useLocalStorage.js.map +1 -1
  183. package/dist/hooks/useMounted.js +5 -6
  184. package/dist/hooks/useMounted.js.map +1 -1
  185. package/dist/hooks/useNavigateToEthAddress.js +7 -7
  186. package/dist/hooks/useNavigateToEthAddress.js.map +1 -1
  187. package/dist/hooks/useSpacing.js +2 -2
  188. package/dist/hooks/useSpacing.js.map +1 -1
  189. package/dist/hooks/useUserEvents.js +2 -2
  190. package/dist/hooks/useUserEvents.js.map +1 -1
  191. package/dist/hooks/useWebP.js +19 -32
  192. package/dist/hooks/useWebP.js.map +1 -1
  193. package/dist/hooks/useWindowSize.js +4 -5
  194. package/dist/hooks/useWindowSize.js.map +1 -1
  195. package/dist/lib/Tracking/Drip/BaseEvent.js +18 -28
  196. package/dist/lib/Tracking/Drip/BaseEvent.js.map +1 -1
  197. package/dist/lib/Tracking/Drip/CustomEvent.js +2 -8
  198. package/dist/lib/Tracking/Drip/CustomEvent.js.map +1 -1
  199. package/dist/lib/Tracking/Drip/StandardEvents.js +4 -7
  200. package/dist/lib/Tracking/Drip/StandardEvents.js.map +1 -1
  201. package/dist/lib/Tracking/Facebook/BaseEvent.js +8 -16
  202. package/dist/lib/Tracking/Facebook/BaseEvent.js.map +1 -1
  203. package/dist/lib/Tracking/Facebook/CustomEvent.js +8 -21
  204. package/dist/lib/Tracking/Facebook/CustomEvent.js.map +1 -1
  205. package/dist/lib/Tracking/Facebook/Fbq.js +11 -13
  206. package/dist/lib/Tracking/Facebook/Fbq.js.map +1 -1
  207. package/dist/lib/Tracking/Facebook/StandardEvent.js +8 -21
  208. package/dist/lib/Tracking/Facebook/StandardEvent.js.map +1 -1
  209. package/dist/lib/Tracking/Facebook/StandardEvents.js +38 -42
  210. package/dist/lib/Tracking/Facebook/StandardEvents.js.map +1 -1
  211. package/dist/lib/Tracking/Facebook/UserEventHandler.js +23 -54
  212. package/dist/lib/Tracking/Facebook/UserEventHandler.js.map +1 -1
  213. package/dist/lib/Tracking/Google/BaseEvent.js +23 -45
  214. package/dist/lib/Tracking/Google/BaseEvent.js.map +1 -1
  215. package/dist/lib/Tracking/Google/CustomEvent.js +2 -8
  216. package/dist/lib/Tracking/Google/CustomEvent.js.map +1 -1
  217. package/dist/lib/Tracking/Google/Gtag.js +37 -41
  218. package/dist/lib/Tracking/Google/Gtag.js.map +1 -1
  219. package/dist/lib/Tracking/Google/Gtm.js +18 -21
  220. package/dist/lib/Tracking/Google/Gtm.js.map +1 -1
  221. package/dist/lib/Tracking/Google/StandardEvent.js +2 -8
  222. package/dist/lib/Tracking/Google/StandardEvent.js.map +1 -1
  223. package/dist/lib/Tracking/Google/StandardEvents.js +62 -66
  224. package/dist/lib/Tracking/Google/StandardEvents.js.map +1 -1
  225. package/dist/lib/Tracking/Google/UserEventHandler.js +23 -54
  226. package/dist/lib/Tracking/Google/UserEventHandler.js.map +1 -1
  227. package/dist/lib/Tracking/Reddit/BaseEvent.js +8 -16
  228. package/dist/lib/Tracking/Reddit/BaseEvent.js.map +1 -1
  229. package/dist/lib/Tracking/Reddit/CustomEvent.js +8 -21
  230. package/dist/lib/Tracking/Reddit/CustomEvent.js.map +1 -1
  231. package/dist/lib/Tracking/Reddit/Rdt.js +11 -15
  232. package/dist/lib/Tracking/Reddit/Rdt.js.map +1 -1
  233. package/dist/lib/Tracking/Reddit/StandardEvent.js +8 -21
  234. package/dist/lib/Tracking/Reddit/StandardEvent.js.map +1 -1
  235. package/dist/lib/Tracking/Reddit/StandardEvents.js +18 -21
  236. package/dist/lib/Tracking/Reddit/StandardEvents.js.map +1 -1
  237. package/dist/lib/Tracking/Referrer.js +12 -13
  238. package/dist/lib/Tracking/Referrer.js.map +1 -1
  239. package/dist/lib/Tracking/Snapchat/BaseEvent.js +8 -16
  240. package/dist/lib/Tracking/Snapchat/BaseEvent.js.map +1 -1
  241. package/dist/lib/Tracking/Snapchat/Snaptr.js +10 -21
  242. package/dist/lib/Tracking/Snapchat/Snaptr.js.map +1 -1
  243. package/dist/lib/Tracking/Snapchat/StandardEvent.js +7 -19
  244. package/dist/lib/Tracking/Snapchat/StandardEvent.js.map +1 -1
  245. package/dist/lib/Tracking/Snapchat/StandardEvents.js +60 -64
  246. package/dist/lib/Tracking/Snapchat/StandardEvents.js.map +1 -1
  247. package/dist/lib/Tracking/Tiktok/BaseEvent.js +8 -16
  248. package/dist/lib/Tracking/Tiktok/BaseEvent.js.map +1 -1
  249. package/dist/lib/Tracking/Tiktok/CustomEvent.js +8 -21
  250. package/dist/lib/Tracking/Tiktok/CustomEvent.js.map +1 -1
  251. package/dist/lib/Tracking/Tiktok/StandardEvent.js +8 -21
  252. package/dist/lib/Tracking/Tiktok/StandardEvent.js.map +1 -1
  253. package/dist/lib/Tracking/Tiktok/StandardEvents.js +34 -38
  254. package/dist/lib/Tracking/Tiktok/StandardEvents.js.map +1 -1
  255. package/dist/lib/Tracking/Tiktok/Ttq.js +14 -18
  256. package/dist/lib/Tracking/Tiktok/Ttq.js.map +1 -1
  257. package/dist/lib/Tracking/Xy/BaseEvent.js +8 -16
  258. package/dist/lib/Tracking/Xy/BaseEvent.js.map +1 -1
  259. package/dist/lib/Tracking/Xy/CustomEvent.js +2 -8
  260. package/dist/lib/Tracking/Xy/CustomEvent.js.map +1 -1
  261. package/dist/lib/Tracking/Xy/StandardEvent.js +2 -8
  262. package/dist/lib/Tracking/Xy/StandardEvent.js.map +1 -1
  263. package/dist/lib/Tracking/Xy/UserEventHandler.js +23 -54
  264. package/dist/lib/Tracking/Xy/UserEventHandler.js.map +1 -1
  265. package/dist/lib/Tracking/XyoUserEventHandler.js +22 -54
  266. package/dist/lib/Tracking/XyoUserEventHandler.js.map +1 -1
  267. package/dist/lib/getApiStage.js +1 -1
  268. package/dist/lib/getApiStage.js.map +1 -1
  269. package/dist/lib/global.js +1 -1
  270. package/dist/lib/global.js.map +1 -1
  271. package/dist/lib/isLocalHost.js +1 -1
  272. package/dist/lib/isLocalHost.js.map +1 -1
  273. package/dist/lib/profile.js +13 -22
  274. package/dist/lib/profile.js.map +1 -1
  275. package/dist/lib/safeLocalStorage.js +3 -3
  276. package/dist/lib/safeLocalStorage.js.map +1 -1
  277. package/dist/lib/safeSessionStorage.js +3 -3
  278. package/dist/lib/safeSessionStorage.js.map +1 -1
  279. package/dist/lib/useAsyncEffect.js +5 -5
  280. package/dist/lib/useAsyncEffect.js.map +1 -1
  281. package/dist/mergeBoxlikeStyles.js +19 -5
  282. package/dist/mergeBoxlikeStyles.js.map +1 -1
  283. package/dist/node/components/Portal/Portal.d.ts +3 -0
  284. package/dist/node/components/Portal/PortalProps.d.ts +7 -0
  285. package/dist/node/components/Portal/index.d.ts +2 -0
  286. package/dist/node/components/index.d.ts +1 -0
  287. package/dist/node/index.js +1144 -1651
  288. package/dist/node/index.js.map +1 -1
  289. package/dist/node-esm/components/Portal/Portal.d.ts +3 -0
  290. package/dist/node-esm/components/Portal/PortalProps.d.ts +7 -0
  291. package/dist/node-esm/components/Portal/index.d.ts +2 -0
  292. package/dist/node-esm/components/index.d.ts +1 -0
  293. package/dist/node-esm/index.js +1144 -1652
  294. package/dist/node-esm/index.js.map +1 -1
  295. package/package.json +13 -12
  296. package/src/components/BasePage/BasePage.tsx +2 -0
  297. package/src/components/Portal/Portal.tsx +23 -0
  298. package/src/components/Portal/PortalProps.ts +6 -0
  299. package/src/components/Portal/index.ts +2 -0
  300. package/src/components/index.ts +1 -0
@@ -18,6 +18,7 @@ var queryString = require('query-string');
18
18
  var styles$1 = require('@mui/material/styles');
19
19
  var clone = require('lodash/clone');
20
20
  var numeral = require('numeral');
21
+ var reactDom = require('react-dom');
21
22
 
22
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
24
 
@@ -39,33 +40,6 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
40
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
41
  PERFORMANCE OF THIS SOFTWARE.
41
42
  ***************************************************************************** */
42
- /* global Reflect, Promise */
43
-
44
- var extendStatics = function(d, b) {
45
- extendStatics = Object.setPrototypeOf ||
46
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
48
- return extendStatics(d, b);
49
- };
50
-
51
- function __extends(d, b) {
52
- if (typeof b !== "function" && b !== null)
53
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
54
- extendStatics(d, b);
55
- function __() { this.constructor = d; }
56
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
57
- }
58
-
59
- var __assign = function() {
60
- __assign = Object.assign || function __assign(t) {
61
- for (var s, i = 1, n = arguments.length; i < n; i++) {
62
- s = arguments[i];
63
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
64
- }
65
- return t;
66
- };
67
- return __assign.apply(this, arguments);
68
- };
69
43
 
70
44
  function __rest(s, e) {
71
45
  var t = {};
@@ -87,176 +61,107 @@ function __awaiter(thisArg, _arguments, P, generator) {
87
61
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
88
62
  step((generator = generator.apply(thisArg, _arguments || [])).next());
89
63
  });
90
- }
91
-
92
- function __generator(thisArg, body) {
93
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
94
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
95
- function verb(n) { return function (v) { return step([n, v]); }; }
96
- function step(op) {
97
- if (f) throw new TypeError("Generator is already executing.");
98
- while (_) try {
99
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
100
- if (y = 0, t) op = [op[0] & 2, t.value];
101
- switch (op[0]) {
102
- case 0: case 1: t = op; break;
103
- case 4: _.label++; return { value: op[1], done: false };
104
- case 5: _.label++; y = op[1]; op = [0]; continue;
105
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
106
- default:
107
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
108
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
109
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
110
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
111
- if (t[2]) _.ops.pop();
112
- _.trys.pop(); continue;
113
- }
114
- op = body.call(thisArg, _);
115
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
116
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
117
- }
118
- }
119
-
120
- function __values(o) {
121
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
122
- if (m) return m.call(o);
123
- if (o && typeof o.length === "number") return {
124
- next: function () {
125
- if (o && i >= o.length) o = void 0;
126
- return { value: o && o[i++], done: !o };
127
- }
128
- };
129
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
130
- }
131
-
132
- function __read(o, n) {
133
- var m = typeof Symbol === "function" && o[Symbol.iterator];
134
- if (!m) return o;
135
- var i = m.call(o), r, ar = [], e;
136
- try {
137
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
138
- }
139
- catch (error) { e = { error: error }; }
140
- finally {
141
- try {
142
- if (r && !r.done && (m = i["return"])) m.call(i);
143
- }
144
- finally { if (e) throw e.error; }
145
- }
146
- return ar;
147
- }
148
-
149
- function __spreadArray(to, from, pack) {
150
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
151
- if (ar || !(i in from)) {
152
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
153
- ar[i] = from[i];
154
- }
155
- }
156
- return to.concat(ar || Array.prototype.slice.call(from));
157
64
  }
158
65
 
159
- var BusyCircularProgress = function (_a) {
160
- var bgcolor = _a.bgcolor, style = _a.style, rounded = _a.rounded, size = _a.size, _b = _a.opacity, opacity = _b === void 0 ? 0.85 : _b, props = __rest(_a, ["bgcolor", "style", "rounded", "size", "opacity"]);
161
- var theme = material.useTheme();
162
- return (jsxRuntime.jsx(material.Box, __assign({ display: "flex", bgcolor: material.alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat("".concat(opacity))), flexGrow: 1, position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "center", alignItems: "center", overflow: "hidden", style: __assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsxRuntime.jsx(material.CircularProgress, __assign({ size: size }, props), void 0) }), void 0));
66
+ const BusyCircularProgress = (_a) => {
67
+ var { bgcolor, style, rounded, size, opacity = 0.85 } = _a, props = __rest(_a, ["bgcolor", "style", "rounded", "size", "opacity"]);
68
+ const theme = material.useTheme();
69
+ return (jsxRuntime.jsx(material.Box, Object.assign({ display: "flex", bgcolor: material.alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat(`${opacity}`)), flexGrow: 1, position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "center", alignItems: "center", overflow: "hidden", style: Object.assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsxRuntime.jsx(material.CircularProgress, Object.assign({ size: size }, props), void 0) }), void 0));
163
70
  };
164
71
 
165
- var BusyLinearProgress = function (_a) {
166
- var bgcolor = _a.bgcolor, style = _a.style, rounded = _a.rounded, _b = _a.opacity, opacity = _b === void 0 ? 0.85 : _b, props = __rest(_a, ["bgcolor", "style", "rounded", "opacity"]);
167
- var theme = material.useTheme();
168
- return (jsxRuntime.jsx(material.Box, __assign({ display: "flex", flexDirection: "column", bgcolor: material.alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat("".concat(opacity))), position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "flex-start", alignItems: "stretch", overflow: "hidden", style: __assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsxRuntime.jsx(material.LinearProgress, __assign({}, props), void 0) }), void 0));
72
+ const BusyLinearProgress = (_a) => {
73
+ var { bgcolor, style, rounded, opacity = 0.85 } = _a, props = __rest(_a, ["bgcolor", "style", "rounded", "opacity"]);
74
+ const theme = material.useTheme();
75
+ return (jsxRuntime.jsx(material.Box, Object.assign({ display: "flex", flexDirection: "column", bgcolor: material.alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat(`${opacity}`)), position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "flex-start", alignItems: "stretch", overflow: "hidden", style: Object.assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsxRuntime.jsx(material.LinearProgress, Object.assign({}, props), void 0) }), void 0));
169
76
  };
170
77
 
171
- var BusyBox = function (_a) {
172
- var background = _a.background, children = _a.children, component = _a.component, _b = _a.busyVariant, busyVariant = _b === void 0 ? 'circular' : _b, busySize = _a.busySize, _c = _a.busyOpacity, busyOpacity = _c === void 0 ? 0.85 : _c, busyColor = _a.busyColor, busy = _a.busy, busyCircularProps = _a.busyCircularProps, busyLinearProps = _a.busyLinearProps, paper = _a.paper, style = _a.style, props = __rest(_a, ["background", "children", "component", "busyVariant", "busySize", "busyOpacity", "busyColor", "busy", "busyCircularProps", "busyLinearProps", "paper", "style"]);
173
- var theme = material.useTheme();
174
- return (jsxRuntime.jsxs(material.Box, __assign({ component: paper ? material.Paper : component, position: "relative", style: background
175
- ? __assign({ backgroundColor: theme.palette.background.default, color: theme.palette.text.primary }, style) : style }, props, { children: [children, busy && busyVariant === 'linear' ? (jsxRuntime.jsx(BusyLinearProgress, __assign({ color: busyColor, opacity: busyOpacity }, busyLinearProps), void 0)) : null, busy && busyVariant === 'circular' ? (jsxRuntime.jsx(BusyCircularProgress, __assign({ color: busyColor, opacity: busyOpacity, size: busySize }, busyCircularProps), void 0)) : null] }), void 0));
78
+ const BusyBox = (_a) => {
79
+ var { background, children, component, busyVariant = 'circular', busySize, busyOpacity = 0.85, busyColor, busy, busyCircularProps, busyLinearProps, paper, style } = _a, props = __rest(_a, ["background", "children", "component", "busyVariant", "busySize", "busyOpacity", "busyColor", "busy", "busyCircularProps", "busyLinearProps", "paper", "style"]);
80
+ const theme = material.useTheme();
81
+ return (jsxRuntime.jsxs(material.Box, Object.assign({ component: paper ? material.Paper : component, position: "relative", style: background
82
+ ? Object.assign({ backgroundColor: theme.palette.background.default, color: theme.palette.text.primary }, style) : style }, props, { children: [children, busy && busyVariant === 'linear' ? (jsxRuntime.jsx(BusyLinearProgress, Object.assign({ color: busyColor, opacity: busyOpacity }, busyLinearProps), void 0)) : null, busy && busyVariant === 'circular' ? (jsxRuntime.jsx(BusyCircularProgress, Object.assign({ color: busyColor, opacity: busyOpacity, size: busySize }, busyCircularProps), void 0)) : null] }), void 0));
176
83
  };
177
84
 
178
- var FlexCol = function (props) {
179
- return jsxRuntime.jsx(BusyBox, __assign({ alignItems: "center", display: "flex", flexDirection: "column", justifyContent: "center" }, props), void 0);
85
+ const FlexCol = (props) => {
86
+ return jsxRuntime.jsx(BusyBox, Object.assign({ alignItems: "center", display: "flex", flexDirection: "column", justifyContent: "center" }, props), void 0);
180
87
  };
181
- var FlexGrowCol = function (props) {
182
- return jsxRuntime.jsx(FlexCol, __assign({ flexGrow: 1 }, props), void 0);
88
+ const FlexGrowCol = (props) => {
89
+ return jsxRuntime.jsx(FlexCol, Object.assign({ flexGrow: 1 }, props), void 0);
183
90
  };
184
91
 
185
- var FlexRow = function (props) {
186
- return jsxRuntime.jsx(BusyBox, __assign({ alignItems: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, props), void 0);
92
+ const FlexRow = (props) => {
93
+ return jsxRuntime.jsx(BusyBox, Object.assign({ alignItems: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, props), void 0);
187
94
  };
188
- var FlexGrowRow = function (props) {
189
- return jsxRuntime.jsx(FlexRow, __assign({ flexGrow: 1 }, props), void 0);
95
+ const FlexGrowRow = (props) => {
96
+ return jsxRuntime.jsx(FlexRow, Object.assign({ flexGrow: 1 }, props), void 0);
190
97
  };
191
98
 
192
99
  /**
193
100
  * @deprecated The functionality of Background is now part of FlexBox. Use the 'background' property to enable the background.
194
101
  */
195
- var Background = function (props) {
196
- return jsxRuntime.jsx(FlexRow, __assign({}, props), void 0);
102
+ const Background = (props) => {
103
+ return jsxRuntime.jsx(FlexRow, Object.assign({}, props), void 0);
197
104
  };
198
105
 
199
- var ErrorViewer = function (props) {
200
- var error = props.error, boxProps = __rest(props, ["error"]);
201
- var theme = material.useTheme();
202
- return (jsxRuntime.jsxs(FlexCol, __assign({ color: theme.palette.error.main }, boxProps, { children: [jsxRuntime.jsx(material.Typography, __assign({ align: "center", variant: "subtitle1" }, { children: error === null || error === void 0 ? void 0 : error.name }), void 0), jsxRuntime.jsx(material.Typography, __assign({ align: "center", variant: "body2" }, { children: error === null || error === void 0 ? void 0 : error.message }), void 0)] }), void 0));
106
+ const ErrorViewer = (props) => {
107
+ const { error } = props, boxProps = __rest(props, ["error"]);
108
+ const theme = material.useTheme();
109
+ return (jsxRuntime.jsxs(FlexCol, Object.assign({ color: theme.palette.error.main }, boxProps, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ align: "center", variant: "subtitle1" }, { children: error === null || error === void 0 ? void 0 : error.name }), void 0), jsxRuntime.jsx(material.Typography, Object.assign({ align: "center", variant: "body2" }, { children: error === null || error === void 0 ? void 0 : error.message }), void 0)] }), void 0));
203
110
  };
204
111
 
205
- var ErrorsViewer = function (props) {
206
- var onRetry = props.onRetry, errors = props.errors, boxProps = __rest(props, ["onRetry", "errors"]);
207
- return (jsxRuntime.jsxs(FlexGrowCol, __assign({ padding: 1 }, boxProps, { children: [errors === null || errors === void 0 ? void 0 : errors.map(function (error, index) {
112
+ const ErrorsViewer = (props) => {
113
+ const { onRetry, errors } = props, boxProps = __rest(props, ["onRetry", "errors"]);
114
+ return (jsxRuntime.jsxs(FlexGrowCol, Object.assign({ padding: 1 }, boxProps, { children: [errors === null || errors === void 0 ? void 0 : errors.map((error, index) => {
208
115
  return jsxRuntime.jsx(ErrorViewer, { error: error }, index);
209
- }), onRetry ? (jsxRuntime.jsx(material.IconButton, __assign({ onClick: onRetry }, { children: jsxRuntime.jsx(ai.AiOutlineReload, {}, void 0) }), void 0)) : null] }), void 0));
116
+ }), onRetry ? (jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: onRetry }, { children: jsxRuntime.jsx(ai.AiOutlineReload, {}, void 0) }), void 0)) : null] }), void 0));
210
117
  };
211
118
 
212
- var CoverProgress = function (props) {
119
+ const CoverProgress = (props) => {
213
120
  var _a;
214
- var _b = props.paper, paper = _b === void 0 ? true : _b, open = props.open, _c = props.opacity, opacity = _c === void 0 ? 0.25 : _c, errors = props.errors, onRetry = props.onRetry;
215
- var theme = material.useTheme();
121
+ const { paper = true, open, opacity = 0.25, errors, onRetry } = props;
122
+ const theme = material.useTheme();
216
123
  if (open) {
217
- return (jsxRuntime.jsx(FlexGrowRow, __assign({ position: "absolute", margin: -1, top: 0, bottom: 0, right: 0, left: 0, bgcolor: paper ? theme.palette.background.paper : theme.palette.background.default }, { children: ((_a = errors === null || errors === void 0 ? void 0 : errors.length) !== null && _a !== void 0 ? _a : 0) === 0 ? (jsxRuntime.jsx(material.CircularProgress, { style: { opacity: opacity } }, void 0)) : (jsxRuntime.jsx(ErrorsViewer, { margin: 1, errors: errors, onRetry: onRetry }, void 0)) }), void 0));
124
+ return (jsxRuntime.jsx(FlexGrowRow, Object.assign({ position: "absolute", margin: -1, top: 0, bottom: 0, right: 0, left: 0, bgcolor: paper ? theme.palette.background.paper : theme.palette.background.default }, { children: ((_a = errors === null || errors === void 0 ? void 0 : errors.length) !== null && _a !== void 0 ? _a : 0) === 0 ? (jsxRuntime.jsx(material.CircularProgress, { style: { opacity } }, void 0)) : (jsxRuntime.jsx(ErrorsViewer, { margin: 1, errors: errors, onRetry: onRetry }, void 0)) }), void 0));
218
125
  }
219
126
  return null;
220
127
  };
221
128
 
222
- var HoverScale = function (props) {
223
- var children = props.children, _a = props.scale, scale = _a === void 0 ? 1.1 : _a;
224
- var useStyles = styles.makeStyles(function () {
225
- return styles.createStyles({
226
- zoomdiv: {
227
- '&:hover': {
228
- transform: "scale(".concat(scale, ")"),
229
- transitionDuration: '0.2s',
230
- transitionTimingFunction: 'ease',
231
- },
129
+ const HoverScale = (props) => {
130
+ const { children, scale = 1.1 } = props;
131
+ const useStyles = styles.makeStyles(() => styles.createStyles({
132
+ zoomdiv: {
133
+ '&:hover': {
134
+ transform: `scale(${scale})`,
135
+ transitionDuration: '0.2s',
136
+ transitionTimingFunction: 'ease',
232
137
  },
233
- });
234
- });
235
- var classes = useStyles();
236
- return (jsxRuntime.jsx(FlexRow, { children: jsxRuntime.jsx(material.Box, __assign({ className: classes.zoomdiv }, { children: children }), void 0) }, void 0));
138
+ },
139
+ }));
140
+ const classes = useStyles();
141
+ return (jsxRuntime.jsx(FlexRow, { children: jsxRuntime.jsx(material.Box, Object.assign({ className: classes.zoomdiv }, { children: children }), void 0) }, void 0));
237
142
  };
238
143
 
239
- var range = function (n, in_min, in_max, out_min, out_max) {
144
+ const range = (n, in_min, in_max, out_min, out_max) => {
240
145
  return ((n - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min;
241
146
  };
242
- var updateCanvas = function (canvas, props) {
243
- var _a = props.value, value = _a === void 0 ? '' : _a, _b = props.size, size = _b === void 0 ? 400 : _b, _c = props.bg, bg = _c === void 0 ? 'transparent' : _c, _d = props.count, count = _d === void 0 ? 5 : _d, palette = props.palette, _e = props.iconPadding, iconPadding = _e === void 0 ? 0 : _e;
244
- var fg = props.fg;
245
- var hash = md5__default["default"](value);
246
- var block = Math.floor(size / count);
247
- var hashcolor = hash.slice(0, 6);
248
- var current = canvas.current;
147
+ const updateCanvas = (canvas, props) => {
148
+ const { value = '', size = 400, bg = 'transparent', count = 5, palette, iconPadding = 0 } = props;
149
+ let { fg } = props;
150
+ const hash = md5__default["default"](value);
151
+ const block = Math.floor(size / count);
152
+ const hashcolor = hash.slice(0, 6);
153
+ const current = canvas.current;
249
154
  if (!current) {
250
155
  return;
251
156
  }
252
157
  if (palette && palette.length) {
253
- var index = Math.floor(range(parseInt(hash.slice(-3), 16), 0, 4095, 0, palette.length));
158
+ const index = Math.floor(range(parseInt(hash.slice(-3), 16), 0, 4095, 0, palette.length));
254
159
  fg = palette[index];
255
160
  }
256
161
  current.width = block * count + iconPadding;
257
162
  current.height = block * count + iconPadding;
258
- var arr = hash.split('').map(function (el) {
259
- var parsedEl = parseInt(el, 16);
163
+ const arr = hash.split('').map((el) => {
164
+ const parsedEl = parseInt(el, 16);
260
165
  if (parsedEl < 8) {
261
166
  return 0;
262
167
  }
@@ -264,16 +169,16 @@ var updateCanvas = function (canvas, props) {
264
169
  return 1;
265
170
  }
266
171
  });
267
- var map = [];
172
+ const map = [];
268
173
  map[0] = map[4] = arr.slice(0, 5);
269
174
  map[1] = map[3] = arr.slice(5, 10);
270
175
  map[2] = arr.slice(10, 15);
271
- var ctx = current.getContext('2d');
176
+ const ctx = current.getContext('2d');
272
177
  if (ctx) {
273
178
  ctx.imageSmoothingEnabled = false;
274
179
  ctx.clearRect(0, 0, current.width, current.height);
275
- map.forEach(function (row, i) {
276
- row.forEach(function (el, j) {
180
+ map.forEach((row, i) => {
181
+ row.forEach((el, j) => {
277
182
  if (el) {
278
183
  ctx.fillStyle = fg ? fg : '#' + hashcolor;
279
184
  ctx.fillRect(block * i + iconPadding, block * j + iconPadding, block - iconPadding, block - iconPadding);
@@ -286,101 +191,99 @@ var updateCanvas = function (canvas, props) {
286
191
  });
287
192
  }
288
193
  };
289
- var Identicon = function (_a) {
290
- var _b = _a.size, size = _b === void 0 ? 400 : _b, _c = _a.className, className = _c === void 0 ? 'identicon' : _c, bg = _a.bg, count = _a.count, fg = _a.fg, iconPadding = _a.iconPadding, palette = _a.palette, value = _a.value, props = __rest(_a, ["size", "className", "bg", "count", "fg", "iconPadding", "palette", "value"]);
291
- var canvas = react.useRef(null);
292
- react.useEffect(function () {
293
- updateCanvas(canvas, { bg: bg, className: className, count: count, fg: fg, iconPadding: iconPadding, palette: palette, size: size, value: value });
194
+ const Identicon = (_a) => {
195
+ var { size = 400, className = 'identicon', bg, count, fg, iconPadding, palette, value } = _a, props = __rest(_a, ["size", "className", "bg", "count", "fg", "iconPadding", "palette", "value"]);
196
+ const canvas = react.useRef(null);
197
+ react.useEffect(() => {
198
+ updateCanvas(canvas, { bg, className, count, fg, iconPadding, palette, size, value });
294
199
  });
295
- return (jsxRuntime.jsx(FlexRow, __assign({}, props, { children: jsxRuntime.jsx("canvas", { className: className, ref: canvas, style: { height: size, width: size } }, void 0) }), void 0));
200
+ return (jsxRuntime.jsx(FlexRow, Object.assign({}, props, { children: jsxRuntime.jsx("canvas", { className: className, ref: canvas, style: { height: size, width: size } }, void 0) }), void 0));
296
201
  };
297
202
 
298
- var RedirectWithQuery = function (_a) {
299
- var to = _a.to, toOptions = _a.toOptions;
300
- var newPath = "".concat(to).concat(document.location.search);
301
- var navigate = reactRouterDom.useNavigate();
302
- var pathname = reactRouterDom.useLocation().pathname;
303
- react.useEffect(function () {
203
+ const RedirectWithQuery = ({ to, toOptions }) => {
204
+ const newPath = `${to}${document.location.search}`;
205
+ const navigate = reactRouterDom.useNavigate();
206
+ const { pathname } = reactRouterDom.useLocation();
207
+ react.useEffect(() => {
304
208
  if (newPath !== pathname) {
305
- navigate(newPath, __assign({ replace: true }, toOptions));
209
+ navigate(newPath, Object.assign({ replace: true }, toOptions));
306
210
  }
307
211
  });
308
212
  return jsxRuntime.jsx("div", {}, void 0);
309
213
  };
310
214
 
311
- var ScrollToTopButton = function (_a) {
312
- var children = _a.children, anchorId = _a.anchorId, props = __rest(_a, ["children", "anchorId"]);
313
- var trigger = material.useScrollTrigger({
215
+ const ScrollToTopButton = (_a) => {
216
+ var { children, anchorId } = _a, props = __rest(_a, ["children", "anchorId"]);
217
+ const trigger = material.useScrollTrigger({
314
218
  disableHysteresis: true,
315
219
  threshold: 100,
316
220
  });
317
- var handleClick = function (event) {
318
- var anchor = (event.target.ownerDocument || document).querySelector("#".concat(anchorId));
221
+ const handleClick = (event) => {
222
+ const anchor = (event.target.ownerDocument || document).querySelector(`#${anchorId}`);
319
223
  if (anchor) {
320
224
  anchor.scrollIntoView({ behavior: 'smooth', block: 'center' });
321
225
  }
322
226
  };
323
- var theme = material.useTheme();
324
- return (jsxRuntime.jsx(material.Zoom, __assign({ in: trigger }, props, { children: jsxRuntime.jsx(material.Box, __assign({ zIndex: 10, position: "fixed", right: theme.spacing(2), bottom: theme.spacing(2), onClick: handleClick, role: "presentation" }, { children: children }), void 0) }), void 0));
227
+ const theme = material.useTheme();
228
+ return (jsxRuntime.jsx(material.Zoom, Object.assign({ in: trigger }, props, { children: jsxRuntime.jsx(material.Box, Object.assign({ zIndex: 10, position: "fixed", right: theme.spacing(2), bottom: theme.spacing(2), onClick: handleClick, role: "presentation" }, { children: children }), void 0) }), void 0));
325
229
  };
326
230
 
327
- var AppBarEx = function (props) {
328
- var contextToolbar = props.contextToolbar, systemToolbar = props.systemToolbar, container = props.container, style = props.style, appbarProps = __rest(props, ["contextToolbar", "systemToolbar", "container", "style"]);
329
- var theme = material.useTheme();
330
- var AppBarExInner = function () {
331
- return (jsxRuntime.jsxs(FlexGrowRow, __assign({ justifyContent: "space-between" }, { children: [contextToolbar !== null && contextToolbar !== void 0 ? contextToolbar : jsxRuntime.jsx(material.Toolbar, {}, void 0), systemToolbar !== null && systemToolbar !== void 0 ? systemToolbar : jsxRuntime.jsx(material.Toolbar, {}, void 0)] }), void 0));
231
+ const AppBarEx = (props) => {
232
+ const { contextToolbar, systemToolbar, container, style } = props, appbarProps = __rest(props, ["contextToolbar", "systemToolbar", "container", "style"]);
233
+ const theme = material.useTheme();
234
+ const AppBarExInner = () => {
235
+ return (jsxRuntime.jsxs(FlexGrowRow, Object.assign({ justifyContent: "space-between" }, { children: [contextToolbar !== null && contextToolbar !== void 0 ? contextToolbar : jsxRuntime.jsx(material.Toolbar, {}, void 0), systemToolbar !== null && systemToolbar !== void 0 ? systemToolbar : jsxRuntime.jsx(material.Toolbar, {}, void 0)] }), void 0));
332
236
  };
333
- return (jsxRuntime.jsx(material.AppBar, __assign({ position: "static", style: __assign({ backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, display: 'flex' }, style) }, appbarProps, { children: container ? (jsxRuntime.jsx(material.Container, __assign({ maxWidth: container }, { children: jsxRuntime.jsx(AppBarExInner, {}, void 0) }), void 0)) : (jsxRuntime.jsx(AppBarExInner, {}, void 0)) }), void 0));
237
+ return (jsxRuntime.jsx(material.AppBar, Object.assign({ position: "static", style: Object.assign({ backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, display: 'flex' }, style) }, appbarProps, { children: container ? (jsxRuntime.jsx(material.Container, Object.assign({ maxWidth: container }, { children: jsxRuntime.jsx(AppBarExInner, {}, void 0) }), void 0)) : (jsxRuntime.jsx(AppBarExInner, {}, void 0)) }), void 0));
334
238
  };
335
239
 
336
- var CookieConsentContext = react.createContext({});
240
+ const CookieConsentContext = react.createContext({});
337
241
 
338
- var CookiesAcceptedLocalStorageName = 'CookiesAccepted';
339
- var CookieConsentLoader = function (_a) {
340
- var children = _a.children;
341
- var getAcceptedFromLocalStorage = function () {
242
+ const CookiesAcceptedLocalStorageName = 'CookiesAccepted';
243
+ const CookieConsentLoader = ({ children }) => {
244
+ const getAcceptedFromLocalStorage = () => {
342
245
  return localStorage.getItem(CookiesAcceptedLocalStorageName) === 'true';
343
246
  };
344
- var setAcceptedToLocalStorage = function (accepted) {
247
+ const setAcceptedToLocalStorage = (accepted) => {
345
248
  localStorage.setItem(CookiesAcceptedLocalStorageName, accepted ? 'true' : 'false');
346
249
  };
347
- var _b = __read(react.useState(getAcceptedFromLocalStorage()), 2), accepted = _b[0], setAccepted = _b[1];
348
- var setAcceptedHandler = function (accepted) {
250
+ const [accepted, setAccepted] = react.useState(getAcceptedFromLocalStorage());
251
+ const setAcceptedHandler = (accepted) => {
349
252
  setAcceptedToLocalStorage(accepted);
350
253
  setAccepted(accepted);
351
254
  };
352
- var clearAccepted = function () {
255
+ const clearAccepted = () => {
353
256
  localStorage.removeItem(CookiesAcceptedLocalStorageName);
354
257
  setAccepted(getAcceptedFromLocalStorage());
355
258
  };
356
- return (jsxRuntime.jsx(CookieConsentContext.Provider, __assign({ value: { accepted: accepted, clearAccepted: clearAccepted, setAccepted: setAcceptedHandler, storageName: CookiesAcceptedLocalStorageName } }, { children: children }), void 0));
259
+ return (jsxRuntime.jsx(CookieConsentContext.Provider, Object.assign({ value: { accepted, clearAccepted, setAccepted: setAcceptedHandler, storageName: CookiesAcceptedLocalStorageName } }, { children: children }), void 0));
357
260
  };
358
261
 
359
- var useCookieConsent = function () {
262
+ const useCookieConsent = () => {
360
263
  return react.useContext(CookieConsentContext);
361
264
  };
362
265
 
363
- var EthersContext = react.createContext({});
266
+ const EthersContext = react.createContext({});
364
267
 
365
- var infuraKey = '1d9f8053c65a49cfb99fafaa8ef201c0';
366
- var InfuraEthersLoader = function (props) {
367
- var children = props.children;
368
- var chainId = 1;
369
- var provider = new providers.InfuraProvider(1, infuraKey);
370
- return (jsxRuntime.jsx(EthersContext.Provider, __assign({ value: {
268
+ const infuraKey = '1d9f8053c65a49cfb99fafaa8ef201c0';
269
+ const InfuraEthersLoader = (props) => {
270
+ const { children } = props;
271
+ const chainId = 1;
272
+ const provider = new providers.InfuraProvider(1, infuraKey);
273
+ return (jsxRuntime.jsx(EthersContext.Provider, Object.assign({ value: {
371
274
  busy: false,
372
- chainId: chainId,
275
+ chainId,
373
276
  isConnected: true,
374
- provider: provider,
277
+ provider,
375
278
  signer: null,
376
279
  } }, { children: children }), void 0));
377
280
  };
378
281
 
379
- var getApiStage = function () {
282
+ const getApiStage = () => {
380
283
  return sdkJs.getApiStage(document.location.hostname);
381
284
  };
382
285
 
383
- var isLocalhost = !!(window.location.hostname === 'localhost' ||
286
+ const isLocalhost = !!(window.location.hostname === 'localhost' ||
384
287
  // [::1] is the IPv6 localhost address.
385
288
  window.location.hostname === '[::1]' ||
386
289
  // 127.0.0.0/8 are considered localhost for IPv4.
@@ -389,18 +292,18 @@ var isLocalhost = !!(window.location.hostname === 'localhost' ||
389
292
  /* eslint-disable react-hooks/exhaustive-deps */
390
293
  function useAsyncEffect(effect, inputs) {
391
294
  react.useEffect(function () {
392
- var mounted = true;
393
- var promise = effect(function () {
295
+ let mounted = true;
296
+ const promise = effect(() => {
394
297
  return mounted;
395
298
  });
396
299
  Promise.resolve(promise)
397
- .then(function (callback) {
300
+ .then((callback) => {
398
301
  if (callback) {
399
302
  callback === null || callback === void 0 ? void 0 : callback();
400
303
  }
401
304
  })
402
- .catch(function (reason) {
403
- console.log("useAsyncEffect Excepted: ".concat(reason));
305
+ .catch((reason) => {
306
+ console.log(`useAsyncEffect Excepted: ${reason}`);
404
307
  });
405
308
  return function () {
406
309
  mounted = false;
@@ -408,33 +311,24 @@ function useAsyncEffect(effect, inputs) {
408
311
  }, inputs !== null && inputs !== void 0 ? inputs : []);
409
312
  }
410
313
 
411
- var logProfiling = false;
412
- var enableProfileLogging = function (enabled) {
314
+ let logProfiling = false;
315
+ const enableProfileLogging = (enabled) => {
413
316
  logProfiling = enabled;
414
317
  };
415
- var profileResults = [];
416
- var profileBlock = function (name, closure) { return __awaiter(void 0, void 0, void 0, function () {
417
- var startTime, endTime;
418
- return __generator(this, function (_a) {
419
- switch (_a.label) {
420
- case 0:
421
- startTime = Date.now();
422
- return [4 /*yield*/, closure()];
423
- case 1:
424
- _a.sent();
425
- endTime = Date.now();
426
- profileResults.push({ endTime: endTime, name: name, startTime: startTime });
427
- if (logProfiling) {
428
- console.log("Timed ".concat(name, " [").concat(endTime - startTime, "ms]"));
429
- }
430
- return [2 /*return*/];
431
- }
432
- });
433
- }); };
318
+ const profileResults = [];
319
+ const profileBlock = (name, closure) => __awaiter(void 0, void 0, void 0, function* () {
320
+ const startTime = Date.now();
321
+ yield closure();
322
+ const endTime = Date.now();
323
+ profileResults.push({ endTime, name, startTime });
324
+ if (logProfiling) {
325
+ console.log(`Timed ${name} [${endTime - startTime}ms]`);
326
+ }
327
+ });
434
328
 
435
- var getLocalStorageObject = function (key, log) {
329
+ const getLocalStorageObject = (key, log) => {
436
330
  var _a;
437
- var result = {};
331
+ let result = {};
438
332
  try {
439
333
  result = JSON.parse((_a = localStorage.getItem(key)) !== null && _a !== void 0 ? _a : '{}');
440
334
  }
@@ -443,7 +337,7 @@ var getLocalStorageObject = function (key, log) {
443
337
  }
444
338
  return result;
445
339
  };
446
- var setLocalStorageObject = function (key, value, log) {
340
+ const setLocalStorageObject = (key, value, log) => {
447
341
  try {
448
342
  localStorage.setItem(key, JSON.stringify(value));
449
343
  }
@@ -452,9 +346,9 @@ var setLocalStorageObject = function (key, value, log) {
452
346
  }
453
347
  };
454
348
 
455
- var getSessionStorageObject = function (key, log) {
349
+ const getSessionStorageObject = (key, log) => {
456
350
  var _a;
457
- var result = {};
351
+ let result = {};
458
352
  try {
459
353
  result = JSON.parse((_a = sessionStorage.getItem(key)) !== null && _a !== void 0 ? _a : '{}');
460
354
  }
@@ -463,7 +357,7 @@ var getSessionStorageObject = function (key, log) {
463
357
  }
464
358
  return result;
465
359
  };
466
- var setSessionStorageObject = function (key, value, log) {
360
+ const setSessionStorageObject = (key, value, log) => {
467
361
  try {
468
362
  sessionStorage.setItem(key, JSON.stringify(value));
469
363
  }
@@ -472,161 +366,110 @@ var setSessionStorageObject = function (key, value, log) {
472
366
  }
473
367
  };
474
368
 
475
- var Referrer = /** @class */ (function () {
476
- function Referrer() {
369
+ class Referrer {
370
+ constructor() {
477
371
  var _a, _b;
478
372
  this.session = (_a = this.getFromSession()) !== null && _a !== void 0 ? _a : document.referrer;
479
373
  sessionStorage.setItem(Referrer.storageId, this.session);
480
374
  this.local = (_b = this.getFromLocal()) !== null && _b !== void 0 ? _b : document.referrer;
481
375
  localStorage.setItem(Referrer.storageId, this.local);
482
376
  }
483
- Referrer.prototype.getFromLocal = function () {
484
- var value = localStorage.getItem(Referrer.storageId);
377
+ getFromLocal() {
378
+ const value = localStorage.getItem(Referrer.storageId);
485
379
  if (value && value.length > 0) {
486
380
  return value;
487
381
  }
488
- };
489
- Referrer.prototype.getFromSession = function () {
490
- var value = sessionStorage.getItem(Referrer.storageId);
382
+ }
383
+ getFromSession() {
384
+ const value = sessionStorage.getItem(Referrer.storageId);
491
385
  if (value && value.length > 0) {
492
386
  return value;
493
387
  }
494
- };
495
- Referrer.prototype.toJson = function () {
388
+ }
389
+ toJson() {
496
390
  if ((this.local && this.local.length > 0) || (this.session && this.session.length > 0)) {
497
391
  return {
498
392
  local: this.local,
499
393
  session: this.session,
500
394
  };
501
395
  }
502
- };
503
- Referrer.storageId = '_coin_referrer';
504
- return Referrer;
505
- }());
506
-
507
- var XyoUserEventHandler = /** @class */ (function (_super) {
508
- __extends(XyoUserEventHandler, _super);
509
- function XyoUserEventHandler(handlers) {
510
- if (handlers === void 0) { handlers = []; }
511
- var _this = _super.call(this) || this;
512
- _this.handlers = handlers;
513
- return _this;
514
- }
515
- XyoUserEventHandler.prototype.testStarted = function (data) {
516
- return __awaiter(this, void 0, void 0, function () {
517
- return __generator(this, function (_a) {
518
- switch (_a.label) {
519
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.testStarted(data); }))];
520
- case 1:
521
- _a.sent();
522
- return [2 /*return*/];
523
- }
524
- });
396
+ }
397
+ }
398
+ Referrer.storageId = '_coin_referrer';
399
+
400
+ class XyoUserEventHandler extends pixel.UserEventHandler {
401
+ constructor(handlers = []) {
402
+ super();
403
+ this.handlers = handlers;
404
+ }
405
+ testStarted(data) {
406
+ return __awaiter(this, void 0, void 0, function* () {
407
+ yield Promise.allSettled(this.handlers.map((handler) => handler.testStarted(data)));
525
408
  });
526
- };
527
- XyoUserEventHandler.prototype.funnelStarted = function (data) {
528
- return __awaiter(this, void 0, void 0, function () {
529
- return __generator(this, function (_a) {
530
- switch (_a.label) {
531
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.funnelStarted(data); }))];
532
- case 1:
533
- _a.sent();
534
- return [2 /*return*/];
535
- }
536
- });
409
+ }
410
+ funnelStarted(data) {
411
+ return __awaiter(this, void 0, void 0, function* () {
412
+ yield Promise.allSettled(this.handlers.map((handler) => handler.funnelStarted(data)));
537
413
  });
538
- };
539
- XyoUserEventHandler.prototype.viewContent = function (data) {
540
- return __awaiter(this, void 0, void 0, function () {
541
- return __generator(this, function (_a) {
542
- switch (_a.label) {
543
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.viewContent(data); }))];
544
- case 1:
545
- _a.sent();
546
- return [2 /*return*/];
547
- }
548
- });
414
+ }
415
+ viewContent(data) {
416
+ return __awaiter(this, void 0, void 0, function* () {
417
+ yield Promise.allSettled(this.handlers.map((handler) => handler.viewContent(data)));
549
418
  });
550
- };
551
- XyoUserEventHandler.prototype.userClick = function (data) {
552
- return __awaiter(this, void 0, void 0, function () {
553
- return __generator(this, function (_a) {
554
- switch (_a.label) {
555
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.userClick(data); }))];
556
- case 1:
557
- _a.sent();
558
- return [2 /*return*/];
559
- }
560
- });
419
+ }
420
+ userClick(data) {
421
+ return __awaiter(this, void 0, void 0, function* () {
422
+ yield Promise.allSettled(this.handlers.map((handler) => handler.userClick(data)));
561
423
  });
562
- };
563
- return XyoUserEventHandler;
564
- }(pixel.UserEventHandler));
424
+ }
425
+ }
565
426
 
566
427
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
567
- var global = window;
428
+ const global = window;
568
429
 
569
- var DripBaseEvent = /** @class */ (function () {
570
- function DripBaseEvent(name, param) {
430
+ class DripBaseEvent {
431
+ constructor(name, param) {
571
432
  this.name = name;
572
433
  this.param = param;
573
434
  this.dcq = this.getDcq();
574
435
  this.dcs = this.getDcs();
575
436
  }
576
- DripBaseEvent.prototype.send = function (data) {
577
- return __awaiter(this, void 0, void 0, function () {
578
- var payload;
579
- return __generator(this, function (_a) {
580
- switch (_a.label) {
581
- case 0:
582
- payload = [this.name];
583
- if (this.param) {
584
- payload.push(this.param);
585
- }
586
- payload.push(data);
587
- this.dcq.push(payload);
588
- return [4 /*yield*/, sdkJs.delay(0)];
589
- case 1:
590
- _a.sent();
591
- return [2 /*return*/];
592
- }
593
- });
437
+ send(data) {
438
+ return __awaiter(this, void 0, void 0, function* () {
439
+ const payload = [this.name];
440
+ if (this.param) {
441
+ payload.push(this.param);
442
+ }
443
+ payload.push(data);
444
+ this.dcq.push(payload);
445
+ yield sdkJs.delay(0);
594
446
  });
595
- };
596
- DripBaseEvent.prototype.getDcq = function () {
447
+ }
448
+ getDcq() {
597
449
  if (!global._dcq) {
598
450
  throw Error('DCQ not found');
599
451
  }
600
452
  return global._dcq;
601
- };
602
- DripBaseEvent.prototype.getDcs = function () {
453
+ }
454
+ getDcs() {
603
455
  if (!global._dcs) {
604
456
  throw Error('DCS not found');
605
457
  }
606
458
  return global._dcs;
607
- };
608
- return DripBaseEvent;
609
- }());
610
-
611
- var DripCustomEvent = /** @class */ (function (_super) {
612
- __extends(DripCustomEvent, _super);
613
- function DripCustomEvent() {
614
- return _super !== null && _super.apply(this, arguments) || this;
615
459
  }
616
- return DripCustomEvent;
617
- }(DripBaseEvent));
460
+ }
618
461
 
619
- var DripStandardEvents = /** @class */ (function () {
620
- function DripStandardEvents() {
621
- }
622
- DripStandardEvents.prototype.identify = function () {
462
+ class DripCustomEvent extends DripBaseEvent {
463
+ }
464
+
465
+ class DripStandardEvents {
466
+ identify() {
623
467
  return new DripBaseEvent('identify');
624
- };
625
- return DripStandardEvents;
626
- }());
468
+ }
469
+ }
627
470
 
628
- var Fbq = /** @class */ (function () {
629
- function Fbq(pixelId) {
471
+ class Fbq {
472
+ constructor(pixelId) {
630
473
  this.pixelId = pixelId;
631
474
  this.fbq = function () {
632
475
  // eslint-disable-next-line prefer-rest-params,prefer-spread
@@ -642,147 +485,109 @@ var Fbq = /** @class */ (function () {
642
485
  this.fbq('init', pixelId);
643
486
  this.fbq('track', 'PageView');
644
487
  }
645
- Fbq.init = function (pixelId) {
488
+ static init(pixelId) {
646
489
  if (!this.instance) {
647
490
  this.instance = new Fbq(pixelId);
648
491
  }
649
492
  return this.instance;
650
- };
651
- Fbq.prototype.track = function (event, data) {
652
- this.fbq('track', event, __assign({}, data));
653
- };
654
- Fbq.prototype.trackCustom = function (event, data) {
655
- this.fbq('trackCustom', event, __assign({}, data));
656
- };
657
- return Fbq;
658
- }());
493
+ }
494
+ track(event, data) {
495
+ this.fbq('track', event, Object.assign({}, data));
496
+ }
497
+ trackCustom(event, data) {
498
+ this.fbq('trackCustom', event, Object.assign({}, data));
499
+ }
500
+ }
659
501
 
660
- var FacebookBaseEvent = /** @class */ (function () {
661
- function FacebookBaseEvent(name) {
502
+ class FacebookBaseEvent {
503
+ constructor(name) {
662
504
  this.name = name;
663
505
  this.fbq = sdkJs.assertEx(Fbq.instance, 'Missing Fbq');
664
506
  }
665
- FacebookBaseEvent.prototype.send = function (_data) {
666
- return __awaiter(this, void 0, void 0, function () {
667
- return __generator(this, function (_a) {
668
- switch (_a.label) {
669
- case 0: return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
670
- case 1:
671
- _a.sent(); //force async to increase reporting odds
672
- return [2 /*return*/];
673
- }
674
- });
675
- });
676
- };
677
- return FacebookBaseEvent;
678
- }());
679
-
680
- var FacebookCustomEvent = /** @class */ (function (_super) {
681
- __extends(FacebookCustomEvent, _super);
682
- function FacebookCustomEvent() {
683
- return _super !== null && _super.apply(this, arguments) || this;
684
- }
685
- FacebookCustomEvent.prototype.send = function (data) {
686
- return __awaiter(this, void 0, void 0, function () {
687
- return __generator(this, function (_a) {
688
- switch (_a.label) {
689
- case 0:
690
- this.fbq.trackCustom(this.name, data);
691
- return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
692
- case 1:
693
- _a.sent(); //force async to increase reporting odds
694
- return [2 /*return*/];
695
- }
696
- });
507
+ send(_data) {
508
+ return __awaiter(this, void 0, void 0, function* () {
509
+ yield sdkJs.delay(0); //force async to increase reporting odds
697
510
  });
698
- };
699
- return FacebookCustomEvent;
700
- }(FacebookBaseEvent));
701
-
702
- var FacebookStandardEvent = /** @class */ (function (_super) {
703
- __extends(FacebookStandardEvent, _super);
704
- function FacebookStandardEvent() {
705
- return _super !== null && _super.apply(this, arguments) || this;
706
- }
707
- FacebookStandardEvent.prototype.send = function (data) {
708
- return __awaiter(this, void 0, void 0, function () {
709
- return __generator(this, function (_a) {
710
- switch (_a.label) {
711
- case 0:
712
- this.fbq.track(this.name, data);
713
- return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
714
- case 1:
715
- _a.sent(); //force async to increase reporting odds
716
- return [2 /*return*/];
717
- }
718
- });
511
+ }
512
+ }
513
+
514
+ class FacebookCustomEvent extends FacebookBaseEvent {
515
+ send(data) {
516
+ return __awaiter(this, void 0, void 0, function* () {
517
+ this.fbq.trackCustom(this.name, data);
518
+ yield sdkJs.delay(0); //force async to increase reporting odds
719
519
  });
720
- };
721
- return FacebookStandardEvent;
722
- }(FacebookBaseEvent));
520
+ }
521
+ }
723
522
 
724
- var FacebookStandardEvents = /** @class */ (function () {
725
- function FacebookStandardEvents() {
523
+ class FacebookStandardEvent extends FacebookBaseEvent {
524
+ send(data) {
525
+ return __awaiter(this, void 0, void 0, function* () {
526
+ this.fbq.track(this.name, data);
527
+ yield sdkJs.delay(0); //force async to increase reporting odds
528
+ });
726
529
  }
727
- FacebookStandardEvents.prototype.addPaymentInfo = function () {
530
+ }
531
+
532
+ class FacebookStandardEvents {
533
+ addPaymentInfo() {
728
534
  return new FacebookStandardEvent('AddPaymentInfo');
729
- };
730
- FacebookStandardEvents.prototype.addToCart = function () {
535
+ }
536
+ addToCart() {
731
537
  return new FacebookStandardEvent('AddToCart');
732
- };
733
- FacebookStandardEvents.prototype.addToWishList = function () {
538
+ }
539
+ addToWishList() {
734
540
  return new FacebookStandardEvent('AddToWishList');
735
- };
736
- FacebookStandardEvents.prototype.completedRegistration = function () {
541
+ }
542
+ completedRegistration() {
737
543
  return new FacebookStandardEvent('CompleteRegistration');
738
- };
739
- FacebookStandardEvents.prototype.contact = function () {
544
+ }
545
+ contact() {
740
546
  return new FacebookStandardEvent('Contact');
741
- };
742
- FacebookStandardEvents.prototype.customizeProduct = function () {
547
+ }
548
+ customizeProduct() {
743
549
  return new FacebookStandardEvent('CustomizeProduct');
744
- };
745
- FacebookStandardEvents.prototype.donate = function () {
550
+ }
551
+ donate() {
746
552
  return new FacebookStandardEvent('Donate');
747
- };
748
- FacebookStandardEvents.prototype.findLocation = function () {
553
+ }
554
+ findLocation() {
749
555
  return new FacebookStandardEvent('FindLocation');
750
- };
751
- FacebookStandardEvents.prototype.initiateCheckout = function () {
556
+ }
557
+ initiateCheckout() {
752
558
  return new FacebookStandardEvent('InitiateCheckout');
753
- };
754
- FacebookStandardEvents.prototype.lead = function () {
559
+ }
560
+ lead() {
755
561
  return new FacebookStandardEvent('Lead');
756
- };
757
- FacebookStandardEvents.prototype.pageView = function () {
562
+ }
563
+ pageView() {
758
564
  return new FacebookStandardEvent('PageView');
759
- };
760
- FacebookStandardEvents.prototype.purchase = function () {
565
+ }
566
+ purchase() {
761
567
  return new FacebookStandardEvent('Purchase');
762
- };
763
- FacebookStandardEvents.prototype.schedule = function () {
568
+ }
569
+ schedule() {
764
570
  return new FacebookStandardEvent('Schedule');
765
- };
766
- FacebookStandardEvents.prototype.search = function () {
571
+ }
572
+ search() {
767
573
  return new FacebookStandardEvent('Search');
768
- };
769
- FacebookStandardEvents.prototype.startTrial = function () {
574
+ }
575
+ startTrial() {
770
576
  return new FacebookStandardEvent('StartTrial');
771
- };
772
- FacebookStandardEvents.prototype.submitApplication = function () {
577
+ }
578
+ submitApplication() {
773
579
  return new FacebookStandardEvent('SubmitApplication');
774
- };
775
- FacebookStandardEvents.prototype.subscribe = function () {
580
+ }
581
+ subscribe() {
776
582
  return new FacebookStandardEvent('Subscribe');
777
- };
778
- FacebookStandardEvents.prototype.viewContent = function () {
583
+ }
584
+ viewContent() {
779
585
  return new FacebookStandardEvent('ViewContent');
780
- };
781
- return FacebookStandardEvents;
782
- }());
586
+ }
587
+ }
783
588
 
784
- var Gtag = /** @class */ (function () {
785
- function Gtag(ga4id, awid, domains) {
589
+ class Gtag {
590
+ constructor(ga4id, awid, domains) {
786
591
  var _a, _b, _c, _d;
787
592
  this.ga4id = ga4id;
788
593
  this.awid = awid;
@@ -797,328 +602,255 @@ var Gtag = /** @class */ (function () {
797
602
  this.gtag('js', new Date());
798
603
  this.gtag('config', ga4id);
799
604
  //this.gtag('config', awid) - this is configured in the Data Stream in Google Analytics
800
- var parsedQueryString = queryString.parse(document.location.search);
605
+ const parsedQueryString = queryString.parse(document.location.search);
801
606
  //we handle the utm_referrer here incase a referrer was forwarded (special.coinapp.co does this)
802
607
  sessionStorage.setItem('initialReferrer', decodeURIComponent((_d = (_c = parsedQueryString['utm_referrer']) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : document.referrer));
803
608
  delete parsedQueryString['utm_referrer'];
804
- var remainingSearch = parsedQueryString ? queryString.stringify(parsedQueryString) : '';
609
+ const remainingSearch = parsedQueryString ? queryString.stringify(parsedQueryString) : '';
805
610
  sessionStorage.setItem('initialQuery', remainingSearch);
806
611
  sessionStorage.setItem('initialPage', document.location.href);
807
612
  }
808
- Gtag.prototype.updatePagePath = function (page_path) {
809
- var ga4id = sdkJs.assertEx(this.ga4id, 'Missing GA4ID');
810
- var pathOnly = page_path.split('?')[0];
811
- var search = Gtag.getInitialQuery();
812
- this.gtag('config', ga4id, { page_path: "".concat(pathOnly).concat(search) });
813
- };
613
+ updatePagePath(page_path) {
614
+ const ga4id = sdkJs.assertEx(this.ga4id, 'Missing GA4ID');
615
+ const pathOnly = page_path.split('?')[0];
616
+ const search = Gtag.getInitialQuery();
617
+ this.gtag('config', ga4id, { page_path: `${pathOnly}${search}` });
618
+ }
814
619
  //
815
- Gtag.getInitialQuery = function () {
620
+ static getInitialQuery() {
816
621
  return sessionStorage.getItem('initialQuery') || '';
817
- };
818
- Gtag.getInitialPage = function () {
622
+ }
623
+ static getInitialPage() {
819
624
  return sessionStorage.getItem('initialPage') || '';
820
- };
821
- Gtag.getInitialReferrer = function () {
625
+ }
626
+ static getInitialReferrer() {
822
627
  return sessionStorage.getItem('initialReferrer') || '';
823
- };
824
- Gtag.clearDataLayer = function () {
825
- var dataLayer = global.dataLayer;
628
+ }
629
+ static clearDataLayer() {
630
+ const dataLayer = global.dataLayer;
826
631
  dataLayer.length = 0;
827
- };
828
- Gtag.init = function (ga4id, awid, domains) {
632
+ }
633
+ static init(ga4id, awid, domains) {
829
634
  if (!this.instance) {
830
635
  return this.reinit(ga4id, awid, domains);
831
636
  }
832
637
  return this.instance;
833
- };
834
- Gtag.reinit = function (ga4id, awid, domains) {
638
+ }
639
+ static reinit(ga4id, awid, domains) {
835
640
  this.instance = new Gtag(ga4id, awid, domains);
836
641
  return this.instance;
837
- };
838
- Gtag.updatePagePath = function (page_path) {
839
- var instance = sdkJs.assertEx(this.instance, 'Not initialized');
642
+ }
643
+ static updatePagePath(page_path) {
644
+ const instance = sdkJs.assertEx(this.instance, 'Not initialized');
840
645
  return instance.updatePagePath(page_path);
841
- };
842
- Gtag.prototype.sendAnalytics = function (event, data) {
843
- var _this = this;
844
- return new Promise(function (resolve) {
845
- _this.gtag('event', event, __assign(__assign({}, data), { event_callback: function () {
646
+ }
647
+ sendAnalytics(event, data) {
648
+ return new Promise((resolve) => {
649
+ this.gtag('event', event, Object.assign(Object.assign({}, data), { event_callback: () => {
846
650
  resolve();
847
- }, event_timeout: 2000, page_location: Gtag.getInitialPage(), page_referrer: Gtag.getInitialReferrer(), send_to: _this.ga4id }));
651
+ }, event_timeout: 2000, page_location: Gtag.getInitialPage(), page_referrer: Gtag.getInitialReferrer(), send_to: this.ga4id }));
848
652
  });
849
- };
850
- Gtag.prototype.sendAdwords = function (event, data) {
851
- var _this = this;
852
- return new Promise(function (resolve) {
853
- _this.gtag('event', 'conversion', __assign(__assign({}, data), { event_callback: function () {
653
+ }
654
+ sendAdwords(event, data) {
655
+ return new Promise((resolve) => {
656
+ this.gtag('event', 'conversion', Object.assign(Object.assign({}, data), { event_callback: () => {
854
657
  resolve();
855
- }, event_timeout: 2000, send_to: "".concat(_this.awid, "/").concat(event) }));
658
+ }, event_timeout: 2000, send_to: `${this.awid}/${event}` }));
856
659
  });
857
- };
858
- return Gtag;
859
- }());
660
+ }
661
+ }
860
662
 
861
- var Gtm = /** @class */ (function () {
862
- function Gtm(containerId) {
663
+ class Gtm {
664
+ constructor(containerId) {
863
665
  this.containerId = containerId;
864
- var global = window;
666
+ const global = window;
865
667
  global.dataLayer = global.dataLayer || [];
866
668
  global.dataLayer.push({ event: 'gtm.js', 'gtm.start': new Date().getTime() });
867
669
  }
868
- Gtm.getInitialQuery = function () {
670
+ static getInitialQuery() {
869
671
  return sessionStorage.getItem('initialQuery') || '';
870
- };
871
- Gtm.clearDataLayer = function () {
872
- var global = window;
873
- var dataLayer = global.dataLayer;
672
+ }
673
+ static clearDataLayer() {
674
+ const global = window;
675
+ const dataLayer = global.dataLayer;
874
676
  dataLayer.length = 0;
875
- };
876
- Gtm.init = function (containerId) {
677
+ }
678
+ static init(containerId) {
877
679
  if (!this.instance) {
878
680
  this.instance = new Gtm(containerId);
879
681
  }
880
682
  return this.instance;
881
- };
882
- Gtm.prototype.send = function (event, data, eventTimeout) {
883
- if (eventTimeout === void 0) { eventTimeout = 500; }
884
- return new Promise(function (resolve) {
683
+ }
684
+ send(event, data, eventTimeout = 500) {
685
+ return new Promise((resolve) => {
885
686
  var _a;
886
- var global = window;
887
- (_a = global.dataLayer) === null || _a === void 0 ? void 0 : _a.push(__assign(__assign({ event: event }, data), { eventCallback: function () {
687
+ const global = window;
688
+ (_a = global.dataLayer) === null || _a === void 0 ? void 0 : _a.push(Object.assign(Object.assign({ event }, data), { eventCallback: () => {
888
689
  resolve();
889
- }, eventTimeout: eventTimeout }));
690
+ }, eventTimeout }));
890
691
  });
891
- };
892
- return Gtm;
893
- }());
692
+ }
693
+ }
894
694
 
895
- var GoogleBaseEvent = /** @class */ (function () {
896
- function GoogleBaseEvent(name, adwordConversionId) {
695
+ class GoogleBaseEvent {
696
+ constructor(name, adwordConversionId) {
897
697
  this.name = name;
898
698
  this.adwordConversionId = adwordConversionId;
899
699
  }
900
- GoogleBaseEvent.prototype.send = function (data) {
901
- return __awaiter(this, void 0, void 0, function () {
902
- return __generator(this, function (_a) {
903
- switch (_a.label) {
904
- case 0: return [4 /*yield*/, this.sendGtag(data)];
905
- case 1: return [2 /*return*/, _a.sent()];
906
- }
907
- });
700
+ send(data) {
701
+ return __awaiter(this, void 0, void 0, function* () {
702
+ return yield this.sendGtag(data);
908
703
  });
909
- };
910
- GoogleBaseEvent.prototype.sendGtag = function (data) {
911
- return __awaiter(this, void 0, void 0, function () {
912
- return __generator(this, function (_a) {
913
- switch (_a.label) {
914
- case 0: return [4 /*yield*/, this.gtag().sendAnalytics(this.name, data)];
915
- case 1:
916
- _a.sent();
917
- if (!this.adwordConversionId) return [3 /*break*/, 3];
918
- return [4 /*yield*/, this.gtag().sendAdwords(this.adwordConversionId, data)];
919
- case 2:
920
- _a.sent();
921
- _a.label = 3;
922
- case 3: return [2 /*return*/];
923
- }
924
- });
704
+ }
705
+ sendGtag(data) {
706
+ return __awaiter(this, void 0, void 0, function* () {
707
+ yield this.gtag().sendAnalytics(this.name, data);
708
+ if (this.adwordConversionId) {
709
+ yield this.gtag().sendAdwords(this.adwordConversionId, data);
710
+ }
925
711
  });
926
- };
927
- GoogleBaseEvent.prototype.sendGtm = function (data) {
928
- return __awaiter(this, void 0, void 0, function () {
929
- return __generator(this, function (_a) {
930
- switch (_a.label) {
931
- case 0: return [4 /*yield*/, this.gtm().send(this.name, data)];
932
- case 1:
933
- _a.sent();
934
- return [2 /*return*/];
935
- }
936
- });
712
+ }
713
+ sendGtm(data) {
714
+ return __awaiter(this, void 0, void 0, function* () {
715
+ yield this.gtm().send(this.name, data);
937
716
  });
938
- };
939
- GoogleBaseEvent.prototype.gtag = function () {
717
+ }
718
+ gtag() {
940
719
  return sdkJs.assertEx(Gtag.instance, 'Missing/uninitialized gtag');
941
- };
942
- GoogleBaseEvent.prototype.gtm = function () {
720
+ }
721
+ gtm() {
943
722
  return sdkJs.assertEx(Gtm.instance, 'Missing/uninitialized gtm');
944
- };
945
- return GoogleBaseEvent;
946
- }());
947
-
948
- var GoogleCustomEvent = /** @class */ (function (_super) {
949
- __extends(GoogleCustomEvent, _super);
950
- function GoogleCustomEvent() {
951
- return _super !== null && _super.apply(this, arguments) || this;
952
- }
953
- return GoogleCustomEvent;
954
- }(GoogleBaseEvent));
955
-
956
- var GoogleUserEventHandler = /** @class */ (function () {
957
- function GoogleUserEventHandler() {
958
- }
959
- GoogleUserEventHandler.prototype.testStarted = function (data) {
960
- return __awaiter(this, void 0, void 0, function () {
961
- var event;
962
- return __generator(this, function (_a) {
963
- switch (_a.label) {
964
- case 0:
965
- event = new GoogleCustomEvent('TestStarted');
966
- return [4 /*yield*/, event.send(data)];
967
- case 1: return [2 /*return*/, _a.sent()];
968
- }
969
- });
723
+ }
724
+ }
725
+
726
+ class GoogleCustomEvent extends GoogleBaseEvent {
727
+ }
728
+
729
+ class GoogleUserEventHandler {
730
+ testStarted(data) {
731
+ return __awaiter(this, void 0, void 0, function* () {
732
+ const event = new GoogleCustomEvent('TestStarted');
733
+ return yield event.send(data);
970
734
  });
971
- };
972
- GoogleUserEventHandler.prototype.funnelStarted = function (data) {
973
- return __awaiter(this, void 0, void 0, function () {
974
- var event;
975
- return __generator(this, function (_a) {
976
- switch (_a.label) {
977
- case 0:
978
- event = new GoogleCustomEvent('FunnelStarted');
979
- return [4 /*yield*/, event.send(data)];
980
- case 1: return [2 /*return*/, _a.sent()];
981
- }
982
- });
735
+ }
736
+ funnelStarted(data) {
737
+ return __awaiter(this, void 0, void 0, function* () {
738
+ const event = new GoogleCustomEvent('FunnelStarted');
739
+ return yield event.send(data);
983
740
  });
984
- };
985
- GoogleUserEventHandler.prototype.viewContent = function (data) {
986
- return __awaiter(this, void 0, void 0, function () {
987
- var event;
988
- return __generator(this, function (_a) {
989
- switch (_a.label) {
990
- case 0:
991
- event = new GoogleCustomEvent('ViewContent');
992
- return [4 /*yield*/, event.send(data)];
993
- case 1: return [2 /*return*/, _a.sent()];
994
- }
995
- });
741
+ }
742
+ viewContent(data) {
743
+ return __awaiter(this, void 0, void 0, function* () {
744
+ const event = new GoogleCustomEvent('ViewContent');
745
+ return yield event.send(data);
996
746
  });
997
- };
998
- GoogleUserEventHandler.prototype.userClick = function (data) {
999
- return __awaiter(this, void 0, void 0, function () {
1000
- var event;
1001
- return __generator(this, function (_a) {
1002
- switch (_a.label) {
1003
- case 0:
1004
- event = new GoogleCustomEvent('UserClick');
1005
- return [4 /*yield*/, event.send(data)];
1006
- case 1: return [2 /*return*/, _a.sent()];
1007
- }
1008
- });
747
+ }
748
+ userClick(data) {
749
+ return __awaiter(this, void 0, void 0, function* () {
750
+ const event = new GoogleCustomEvent('UserClick');
751
+ return yield event.send(data);
1009
752
  });
1010
- };
1011
- return GoogleUserEventHandler;
1012
- }());
1013
-
1014
- var GoogleStandardEvent = /** @class */ (function (_super) {
1015
- __extends(GoogleStandardEvent, _super);
1016
- function GoogleStandardEvent() {
1017
- return _super !== null && _super.apply(this, arguments) || this;
1018
753
  }
1019
- return GoogleStandardEvent;
1020
- }(GoogleBaseEvent));
754
+ }
1021
755
 
1022
- var GoogleStandardEvents = /** @class */ (function () {
1023
- function GoogleStandardEvents() {
1024
- }
1025
- GoogleStandardEvents.prototype.addPaymentInfo = function () {
756
+ class GoogleStandardEvent extends GoogleBaseEvent {
757
+ }
758
+
759
+ class GoogleStandardEvents {
760
+ addPaymentInfo() {
1026
761
  return new GoogleStandardEvent('add_paymennt_info');
1027
- };
1028
- GoogleStandardEvents.prototype.addShippingInfo = function () {
762
+ }
763
+ addShippingInfo() {
1029
764
  return new GoogleStandardEvent('add_shipping_info');
1030
- };
1031
- GoogleStandardEvents.prototype.addToCart = function () {
765
+ }
766
+ addToCart() {
1032
767
  return new GoogleStandardEvent('add_to_cart');
1033
- };
1034
- GoogleStandardEvents.prototype.addToWishList = function () {
768
+ }
769
+ addToWishList() {
1035
770
  return new GoogleStandardEvent('add_to_wishlist');
1036
- };
1037
- GoogleStandardEvents.prototype.beginCheckout = function () {
771
+ }
772
+ beginCheckout() {
1038
773
  return new GoogleStandardEvent('begin_checkout');
1039
- };
1040
- GoogleStandardEvents.prototype.earnVirtualCurrency = function () {
774
+ }
775
+ earnVirtualCurrency() {
1041
776
  return new GoogleStandardEvent('earn_virtual_currency');
1042
- };
1043
- GoogleStandardEvents.prototype.generateLead = function () {
777
+ }
778
+ generateLead() {
1044
779
  return new GoogleStandardEvent('generate_lead');
1045
- };
1046
- GoogleStandardEvents.prototype.joinGroup = function () {
780
+ }
781
+ joinGroup() {
1047
782
  return new GoogleStandardEvent('join_group');
1048
- };
1049
- GoogleStandardEvents.prototype.levelEnd = function () {
783
+ }
784
+ levelEnd() {
1050
785
  return new GoogleStandardEvent('level_end');
1051
- };
1052
- GoogleStandardEvents.prototype.levelStart = function () {
786
+ }
787
+ levelStart() {
1053
788
  return new GoogleStandardEvent('level_start');
1054
- };
1055
- GoogleStandardEvents.prototype.levelUp = function () {
789
+ }
790
+ levelUp() {
1056
791
  return new GoogleStandardEvent('level_up');
1057
- };
1058
- GoogleStandardEvents.prototype.login = function () {
792
+ }
793
+ login() {
1059
794
  return new GoogleStandardEvent('login');
1060
- };
1061
- GoogleStandardEvents.prototype.postScore = function () {
795
+ }
796
+ postScore() {
1062
797
  return new GoogleStandardEvent('post_score');
1063
- };
1064
- GoogleStandardEvents.prototype.purchase = function () {
798
+ }
799
+ purchase() {
1065
800
  return new GoogleStandardEvent('purchase');
1066
- };
1067
- GoogleStandardEvents.prototype.refund = function () {
801
+ }
802
+ refund() {
1068
803
  return new GoogleStandardEvent('refund');
1069
- };
1070
- GoogleStandardEvents.prototype.removeFromCart = function () {
804
+ }
805
+ removeFromCart() {
1071
806
  return new GoogleStandardEvent('remove_from_cart');
1072
- };
1073
- GoogleStandardEvents.prototype.search = function () {
807
+ }
808
+ search() {
1074
809
  return new GoogleStandardEvent('search');
1075
- };
1076
- GoogleStandardEvents.prototype.selectContent = function () {
810
+ }
811
+ selectContent() {
1077
812
  return new GoogleStandardEvent('select_content');
1078
- };
1079
- GoogleStandardEvents.prototype.selectItem = function () {
813
+ }
814
+ selectItem() {
1080
815
  return new GoogleStandardEvent('select_item');
1081
- };
1082
- GoogleStandardEvents.prototype.selectPromotion = function () {
816
+ }
817
+ selectPromotion() {
1083
818
  return new GoogleStandardEvent('select_promotion');
1084
- };
1085
- GoogleStandardEvents.prototype.share = function () {
819
+ }
820
+ share() {
1086
821
  return new GoogleStandardEvent('share');
1087
- };
1088
- GoogleStandardEvents.prototype.signUp = function () {
822
+ }
823
+ signUp() {
1089
824
  return new GoogleStandardEvent('sign_up');
1090
- };
1091
- GoogleStandardEvents.prototype.spendVirtualCurrency = function () {
825
+ }
826
+ spendVirtualCurrency() {
1092
827
  return new GoogleStandardEvent('spend_virtual_currency');
1093
- };
1094
- GoogleStandardEvents.prototype.tutorialBegin = function () {
828
+ }
829
+ tutorialBegin() {
1095
830
  return new GoogleStandardEvent('tutorial_begin');
1096
- };
1097
- GoogleStandardEvents.prototype.tutorialComplete = function () {
831
+ }
832
+ tutorialComplete() {
1098
833
  return new GoogleStandardEvent('tutorial_complete');
1099
- };
1100
- GoogleStandardEvents.prototype.unlockAchievement = function () {
834
+ }
835
+ unlockAchievement() {
1101
836
  return new GoogleStandardEvent('unlock_achievement');
1102
- };
1103
- GoogleStandardEvents.prototype.viewCart = function () {
837
+ }
838
+ viewCart() {
1104
839
  return new GoogleStandardEvent('view_cart');
1105
- };
1106
- GoogleStandardEvents.prototype.viewItem = function () {
840
+ }
841
+ viewItem() {
1107
842
  return new GoogleStandardEvent('view_item');
1108
- };
1109
- GoogleStandardEvents.prototype.viewItemList = function () {
843
+ }
844
+ viewItemList() {
1110
845
  return new GoogleStandardEvent('view_item_list');
1111
- };
1112
- GoogleStandardEvents.prototype.viewPromotion = function () {
846
+ }
847
+ viewPromotion() {
1113
848
  return new GoogleStandardEvent('view_promotion');
1114
- };
1115
- return GoogleStandardEvents;
1116
- }());
1117
-
1118
- var Rdt = /** @class */ (function () {
1119
- function Rdt() {
1120
849
  }
1121
- Rdt.init = function (pixelId) {
850
+ }
851
+
852
+ class Rdt {
853
+ static init(pixelId) {
1122
854
  try {
1123
855
  Rdt.instance = new Rdt();
1124
856
  Rdt.instance.load(pixelId);
@@ -1127,553 +859,391 @@ var Rdt = /** @class */ (function () {
1127
859
  catch (ex) {
1128
860
  console.error(ex);
1129
861
  }
1130
- };
1131
- Rdt.getRdt = function () {
862
+ }
863
+ static getRdt() {
1132
864
  if (global.rdt) {
1133
865
  return global.rdt;
1134
866
  }
1135
867
  console.warn('Missing rdt');
1136
- };
1137
- Rdt.prototype.load = function (id) {
868
+ }
869
+ load(id) {
1138
870
  try {
1139
871
  Rdt.getRdt()('init', id);
1140
872
  }
1141
873
  catch (ex) {
1142
874
  console.error(ex);
1143
875
  }
1144
- };
1145
- Rdt.prototype.track = function (event, data) {
876
+ }
877
+ track(event, data) {
1146
878
  try {
1147
- Rdt.getRdt()('track', event, __assign({}, data));
879
+ Rdt.getRdt()('track', event, Object.assign({}, data));
1148
880
  }
1149
881
  catch (ex) {
1150
882
  console.error(ex);
1151
883
  }
1152
- };
1153
- return Rdt;
1154
- }());
884
+ }
885
+ }
1155
886
 
1156
- var RedditBaseEvent = /** @class */ (function () {
1157
- function RedditBaseEvent(name) {
887
+ class RedditBaseEvent {
888
+ constructor(name) {
1158
889
  this.name = name;
1159
890
  this.rdt = sdkJs.assertEx(Rdt.instance, 'Missing Rdt');
1160
891
  }
1161
- RedditBaseEvent.prototype.send = function (_data) {
1162
- return __awaiter(this, void 0, void 0, function () {
1163
- return __generator(this, function (_a) {
1164
- switch (_a.label) {
1165
- case 0: return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
1166
- case 1:
1167
- _a.sent(); //force async to increase reporting odds
1168
- return [2 /*return*/];
1169
- }
1170
- });
892
+ send(_data) {
893
+ return __awaiter(this, void 0, void 0, function* () {
894
+ yield sdkJs.delay(0); //force async to increase reporting odds
1171
895
  });
1172
- };
1173
- return RedditBaseEvent;
1174
- }());
1175
-
1176
- var RedditCustomEvent = /** @class */ (function (_super) {
1177
- __extends(RedditCustomEvent, _super);
1178
- function RedditCustomEvent() {
1179
- return _super !== null && _super.apply(this, arguments) || this;
1180
- }
1181
- RedditCustomEvent.prototype.send = function (data) {
1182
- return __awaiter(this, void 0, void 0, function () {
1183
- return __generator(this, function (_a) {
1184
- switch (_a.label) {
1185
- case 0:
1186
- this.rdt.track(this.name, data);
1187
- return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
1188
- case 1:
1189
- _a.sent(); //force async to increase reporting odds
1190
- return [2 /*return*/];
1191
- }
1192
- });
1193
- });
1194
- };
1195
- return RedditCustomEvent;
1196
- }(RedditBaseEvent));
1197
-
1198
- var RedditStandardEvent = /** @class */ (function (_super) {
1199
- __extends(RedditStandardEvent, _super);
1200
- function RedditStandardEvent() {
1201
- return _super !== null && _super.apply(this, arguments) || this;
1202
- }
1203
- RedditStandardEvent.prototype.send = function (data) {
1204
- return __awaiter(this, void 0, void 0, function () {
1205
- return __generator(this, function (_a) {
1206
- switch (_a.label) {
1207
- case 0:
1208
- this.rdt.track(this.name, data);
1209
- return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
1210
- case 1:
1211
- _a.sent(); //force async to increase reporting odds
1212
- return [2 /*return*/];
1213
- }
1214
- });
896
+ }
897
+ }
898
+
899
+ class RedditCustomEvent extends RedditBaseEvent {
900
+ send(data) {
901
+ return __awaiter(this, void 0, void 0, function* () {
902
+ this.rdt.track(this.name, data);
903
+ yield sdkJs.delay(0); //force async to increase reporting odds
1215
904
  });
1216
- };
1217
- return RedditStandardEvent;
1218
- }(RedditBaseEvent));
905
+ }
906
+ }
1219
907
 
1220
- var RedditStandardEvents = /** @class */ (function () {
1221
- function RedditStandardEvents() {
908
+ class RedditStandardEvent extends RedditBaseEvent {
909
+ send(data) {
910
+ return __awaiter(this, void 0, void 0, function* () {
911
+ this.rdt.track(this.name, data);
912
+ yield sdkJs.delay(0); //force async to increase reporting odds
913
+ });
1222
914
  }
1223
- RedditStandardEvents.prototype.pageView = function () {
915
+ }
916
+
917
+ class RedditStandardEvents {
918
+ pageView() {
1224
919
  return new RedditStandardEvent('PageView');
1225
- };
1226
- RedditStandardEvents.prototype.viewContent = function () {
920
+ }
921
+ viewContent() {
1227
922
  return new RedditStandardEvent('ViewContent');
1228
- };
1229
- RedditStandardEvents.prototype.addToCart = function () {
923
+ }
924
+ addToCart() {
1230
925
  return new RedditStandardEvent('AddToCart');
1231
- };
1232
- RedditStandardEvents.prototype.addToWishlist = function () {
926
+ }
927
+ addToWishlist() {
1233
928
  return new RedditStandardEvent('AddToWishlist');
1234
- };
1235
- RedditStandardEvents.prototype.purchase = function () {
929
+ }
930
+ purchase() {
1236
931
  return new RedditStandardEvent('Purchase');
1237
- };
1238
- RedditStandardEvents.prototype.signup = function () {
932
+ }
933
+ signup() {
1239
934
  return new RedditStandardEvent('SignUp');
1240
- };
1241
- RedditStandardEvents.prototype.lead = function () {
935
+ }
936
+ lead() {
1242
937
  return new RedditStandardEvent('Lead');
1243
- };
1244
- RedditStandardEvents.prototype.search = function () {
938
+ }
939
+ search() {
1245
940
  return new RedditStandardEvent('Search');
1246
- };
1247
- return RedditStandardEvents;
1248
- }());
1249
-
1250
- var SnapTr = /** @class */ (function () {
1251
- function SnapTr() {
1252
941
  }
1253
- SnapTr.getSnapTr = function () {
942
+ }
943
+
944
+ class SnapTr {
945
+ static getSnapTr() {
1254
946
  if (global.snaptr) {
1255
947
  return global.snaptr;
1256
948
  }
1257
949
  console.warn('Missing snaptr');
1258
- };
1259
- SnapTr.track = function (event, data) {
1260
- return __awaiter(this, void 0, void 0, function () {
1261
- return __generator(this, function (_a) {
1262
- switch (_a.label) {
1263
- case 0:
1264
- this.getSnapTr()('track', event, data);
1265
- return [4 /*yield*/, sdkJs.delay(0)];
1266
- case 1:
1267
- _a.sent();
1268
- return [2 /*return*/];
1269
- }
1270
- });
950
+ }
951
+ static track(event, data) {
952
+ return __awaiter(this, void 0, void 0, function* () {
953
+ this.getSnapTr()('track', event, data);
954
+ yield sdkJs.delay(0);
1271
955
  });
1272
- };
1273
- return SnapTr;
1274
- }());
956
+ }
957
+ }
1275
958
 
1276
- var SnapchatBaseEvent = /** @class */ (function () {
1277
- function SnapchatBaseEvent(name) {
959
+ class SnapchatBaseEvent {
960
+ constructor(name) {
1278
961
  this.name = name;
1279
962
  }
1280
- SnapchatBaseEvent.prototype.send = function (_data) {
1281
- return __awaiter(this, void 0, void 0, function () {
1282
- return __generator(this, function (_a) {
1283
- switch (_a.label) {
1284
- case 0: return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
1285
- case 1:
1286
- _a.sent(); //force async to increase reporting odds
1287
- return [2 /*return*/];
1288
- }
1289
- });
963
+ send(_data) {
964
+ return __awaiter(this, void 0, void 0, function* () {
965
+ yield sdkJs.delay(0); //force async to increase reporting odds
1290
966
  });
1291
- };
1292
- return SnapchatBaseEvent;
1293
- }());
1294
-
1295
- var SnapchatStandardEvent = /** @class */ (function (_super) {
1296
- __extends(SnapchatStandardEvent, _super);
1297
- function SnapchatStandardEvent() {
1298
- return _super !== null && _super.apply(this, arguments) || this;
1299
- }
1300
- SnapchatStandardEvent.prototype.send = function (data) {
1301
- return __awaiter(this, void 0, void 0, function () {
1302
- return __generator(this, function (_a) {
1303
- switch (_a.label) {
1304
- case 0: return [4 /*yield*/, SnapTr.track(this.name, data)];
1305
- case 1:
1306
- _a.sent();
1307
- return [2 /*return*/];
1308
- }
1309
- });
1310
- });
1311
- };
1312
- return SnapchatStandardEvent;
1313
- }(SnapchatBaseEvent));
967
+ }
968
+ }
1314
969
 
1315
- var SnapchatStandardEvents = /** @class */ (function () {
1316
- function SnapchatStandardEvents() {
970
+ class SnapchatStandardEvent extends SnapchatBaseEvent {
971
+ send(data) {
972
+ return __awaiter(this, void 0, void 0, function* () {
973
+ yield SnapTr.track(this.name, data);
974
+ });
1317
975
  }
1318
- SnapchatStandardEvents.prototype.pageView = function () {
976
+ }
977
+
978
+ class SnapchatStandardEvents {
979
+ pageView() {
1319
980
  return new SnapchatStandardEvent('PAGE_VIEW');
1320
- };
1321
- SnapchatStandardEvents.prototype.signUp = function () {
981
+ }
982
+ signUp() {
1322
983
  return new SnapchatStandardEvent('SIGN_UP');
1323
- };
1324
- SnapchatStandardEvents.prototype.purchase = function () {
984
+ }
985
+ purchase() {
1325
986
  return new SnapchatStandardEvent('PURCHASE');
1326
- };
1327
- SnapchatStandardEvents.prototype.save = function () {
987
+ }
988
+ save() {
1328
989
  return new SnapchatStandardEvent('SAVE');
1329
- };
1330
- SnapchatStandardEvents.prototype.startCheckout = function () {
990
+ }
991
+ startCheckout() {
1331
992
  return new SnapchatStandardEvent('START_CHECKOUT');
1332
- };
1333
- SnapchatStandardEvents.prototype.addCart = function () {
993
+ }
994
+ addCart() {
1334
995
  return new SnapchatStandardEvent('ADD_CART');
1335
- };
1336
- SnapchatStandardEvents.prototype.openApp = function () {
996
+ }
997
+ openApp() {
1337
998
  return new SnapchatStandardEvent('OPEN_APP');
1338
- };
1339
- SnapchatStandardEvents.prototype.viewContent = function () {
999
+ }
1000
+ viewContent() {
1340
1001
  return new SnapchatStandardEvent('VIEW_CONTENT');
1341
- };
1342
- SnapchatStandardEvents.prototype.addBilling = function () {
1002
+ }
1003
+ addBilling() {
1343
1004
  return new SnapchatStandardEvent('ADD_BILLING');
1344
- };
1345
- SnapchatStandardEvents.prototype.search = function () {
1005
+ }
1006
+ search() {
1346
1007
  return new SnapchatStandardEvent('SEARCH');
1347
- };
1348
- SnapchatStandardEvents.prototype.subscribe = function () {
1008
+ }
1009
+ subscribe() {
1349
1010
  return new SnapchatStandardEvent('SUBSCRIBE');
1350
- };
1351
- SnapchatStandardEvents.prototype.adClick = function () {
1011
+ }
1012
+ adClick() {
1352
1013
  return new SnapchatStandardEvent('AD_CLICK');
1353
- };
1354
- SnapchatStandardEvents.prototype.adView = function () {
1014
+ }
1015
+ adView() {
1355
1016
  return new SnapchatStandardEvent('AD_VIEW');
1356
- };
1357
- SnapchatStandardEvents.prototype.completeTutorial = function () {
1017
+ }
1018
+ completeTutorial() {
1358
1019
  return new SnapchatStandardEvent('COMPLETE_TUTORIAL');
1359
- };
1360
- SnapchatStandardEvents.prototype.invite = function () {
1020
+ }
1021
+ invite() {
1361
1022
  return new SnapchatStandardEvent('INVITE');
1362
- };
1363
- SnapchatStandardEvents.prototype.login = function () {
1023
+ }
1024
+ login() {
1364
1025
  return new SnapchatStandardEvent('LOGIN');
1365
- };
1366
- SnapchatStandardEvents.prototype.share = function () {
1026
+ }
1027
+ share() {
1367
1028
  return new SnapchatStandardEvent('SHARE');
1368
- };
1369
- SnapchatStandardEvents.prototype.reserve = function () {
1029
+ }
1030
+ reserve() {
1370
1031
  return new SnapchatStandardEvent('RESERVE');
1371
- };
1372
- SnapchatStandardEvents.prototype.achievementUnlocked = function () {
1032
+ }
1033
+ achievementUnlocked() {
1373
1034
  return new SnapchatStandardEvent('ACHIEVEMENT_UNLOCKED');
1374
- };
1375
- SnapchatStandardEvents.prototype.addToWishlist = function () {
1035
+ }
1036
+ addToWishlist() {
1376
1037
  return new SnapchatStandardEvent('ADD_TO_WISHLIST');
1377
- };
1378
- SnapchatStandardEvents.prototype.spentCredits = function () {
1038
+ }
1039
+ spentCredits() {
1379
1040
  return new SnapchatStandardEvent('SPENT_CREDITS');
1380
- };
1381
- SnapchatStandardEvents.prototype.rate = function () {
1041
+ }
1042
+ rate() {
1382
1043
  return new SnapchatStandardEvent('RATE');
1383
- };
1384
- SnapchatStandardEvents.prototype.startTrial = function () {
1044
+ }
1045
+ startTrial() {
1385
1046
  return new SnapchatStandardEvent('START_TRIAL');
1386
- };
1387
- SnapchatStandardEvents.prototype.listView = function () {
1047
+ }
1048
+ listView() {
1388
1049
  return new SnapchatStandardEvent('LIST_VIEW');
1389
- };
1390
- SnapchatStandardEvents.prototype.custom1 = function () {
1050
+ }
1051
+ custom1() {
1391
1052
  return new SnapchatStandardEvent('CUSTOM_EVENT_1');
1392
- };
1393
- SnapchatStandardEvents.prototype.custom2 = function () {
1053
+ }
1054
+ custom2() {
1394
1055
  return new SnapchatStandardEvent('CUSTOM_EVENT_2');
1395
- };
1396
- SnapchatStandardEvents.prototype.custom3 = function () {
1056
+ }
1057
+ custom3() {
1397
1058
  return new SnapchatStandardEvent('CUSTOM_EVENT_3');
1398
- };
1399
- SnapchatStandardEvents.prototype.custom4 = function () {
1059
+ }
1060
+ custom4() {
1400
1061
  return new SnapchatStandardEvent('CUSTOM_EVENT_4');
1401
- };
1402
- SnapchatStandardEvents.prototype.custom5 = function () {
1062
+ }
1063
+ custom5() {
1403
1064
  return new SnapchatStandardEvent('CUSTOM_EVENT_5');
1404
- };
1405
- return SnapchatStandardEvents;
1406
- }());
1407
-
1408
- var Ttq = /** @class */ (function () {
1409
- function Ttq() {
1410
1065
  }
1411
- Ttq.init = function (pixelId) {
1066
+ }
1067
+
1068
+ class Ttq {
1069
+ static init(pixelId) {
1412
1070
  try {
1413
1071
  Ttq.instance = new Ttq();
1414
1072
  Ttq.getTtq().load(pixelId);
1415
1073
  Ttq.page();
1416
1074
  }
1417
1075
  catch (ex) {
1418
- console.error("Ttq.init: ".concat(ex));
1076
+ console.error(`Ttq.init: ${ex}`);
1419
1077
  }
1420
- };
1421
- Ttq.getTtq = function () {
1078
+ }
1079
+ static getTtq() {
1422
1080
  if (global.ttq) {
1423
1081
  return global.ttq;
1424
1082
  }
1425
1083
  console.warn('Missing ttq');
1426
- };
1427
- Ttq.page = function () {
1084
+ }
1085
+ static page() {
1428
1086
  try {
1429
1087
  Ttq.getTtq().page();
1430
1088
  }
1431
1089
  catch (ex) {
1432
- console.error("Ttq.page: ".concat(ex));
1090
+ console.error(`Ttq.page: ${ex}`);
1433
1091
  }
1434
- };
1435
- Ttq.prototype.track = function (event, data) {
1092
+ }
1093
+ track(event, data) {
1436
1094
  try {
1437
- Ttq.getTtq().track(event, __assign({}, data));
1095
+ Ttq.getTtq().track(event, Object.assign({}, data));
1438
1096
  }
1439
1097
  catch (ex) {
1440
- console.error("Ttq.track: ".concat(ex));
1098
+ console.error(`Ttq.track: ${ex}`);
1441
1099
  }
1442
- };
1443
- return Ttq;
1444
- }());
1100
+ }
1101
+ }
1445
1102
 
1446
- var TiktokBaseEvent = /** @class */ (function () {
1447
- function TiktokBaseEvent(name) {
1103
+ class TiktokBaseEvent {
1104
+ constructor(name) {
1448
1105
  this.name = name;
1449
1106
  this.ttq = sdkJs.assertEx(Ttq.instance, 'Missing Ttq');
1450
1107
  }
1451
- TiktokBaseEvent.prototype.send = function (_data) {
1452
- return __awaiter(this, void 0, void 0, function () {
1453
- return __generator(this, function (_a) {
1454
- switch (_a.label) {
1455
- case 0: return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
1456
- case 1:
1457
- _a.sent(); //force async to increase reporting odds
1458
- return [2 /*return*/];
1459
- }
1460
- });
1461
- });
1462
- };
1463
- return TiktokBaseEvent;
1464
- }());
1465
-
1466
- var TiktokCustomEvent = /** @class */ (function (_super) {
1467
- __extends(TiktokCustomEvent, _super);
1468
- function TiktokCustomEvent() {
1469
- return _super !== null && _super.apply(this, arguments) || this;
1470
- }
1471
- TiktokCustomEvent.prototype.send = function (data) {
1472
- return __awaiter(this, void 0, void 0, function () {
1473
- return __generator(this, function (_a) {
1474
- switch (_a.label) {
1475
- case 0:
1476
- this.ttq.track(this.name, data);
1477
- return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
1478
- case 1:
1479
- _a.sent(); //force async to increase reporting odds
1480
- return [2 /*return*/];
1481
- }
1482
- });
1108
+ send(_data) {
1109
+ return __awaiter(this, void 0, void 0, function* () {
1110
+ yield sdkJs.delay(0); //force async to increase reporting odds
1483
1111
  });
1484
- };
1485
- return TiktokCustomEvent;
1486
- }(TiktokBaseEvent));
1487
-
1488
- var TiktokStandardEvent = /** @class */ (function (_super) {
1489
- __extends(TiktokStandardEvent, _super);
1490
- function TiktokStandardEvent() {
1491
- return _super !== null && _super.apply(this, arguments) || this;
1492
- }
1493
- TiktokStandardEvent.prototype.send = function (data) {
1494
- return __awaiter(this, void 0, void 0, function () {
1495
- return __generator(this, function (_a) {
1496
- switch (_a.label) {
1497
- case 0:
1498
- this.ttq.track(this.name, data);
1499
- return [4 /*yield*/, sdkJs.delay(0)]; //force async to increase reporting odds
1500
- case 1:
1501
- _a.sent(); //force async to increase reporting odds
1502
- return [2 /*return*/];
1503
- }
1504
- });
1112
+ }
1113
+ }
1114
+
1115
+ class TiktokCustomEvent extends TiktokBaseEvent {
1116
+ send(data) {
1117
+ return __awaiter(this, void 0, void 0, function* () {
1118
+ this.ttq.track(this.name, data);
1119
+ yield sdkJs.delay(0); //force async to increase reporting odds
1505
1120
  });
1506
- };
1507
- return TiktokStandardEvent;
1508
- }(TiktokBaseEvent));
1121
+ }
1122
+ }
1509
1123
 
1510
- var TiktokStandardEvents = /** @class */ (function () {
1511
- function TiktokStandardEvents() {
1124
+ class TiktokStandardEvent extends TiktokBaseEvent {
1125
+ send(data) {
1126
+ return __awaiter(this, void 0, void 0, function* () {
1127
+ this.ttq.track(this.name, data);
1128
+ yield sdkJs.delay(0); //force async to increase reporting odds
1129
+ });
1512
1130
  }
1513
- TiktokStandardEvents.prototype.pageView = function () {
1131
+ }
1132
+
1133
+ class TiktokStandardEvents {
1134
+ pageView() {
1514
1135
  return new TiktokStandardEvent('Browse');
1515
- };
1516
- TiktokStandardEvents.prototype.viewContent = function () {
1136
+ }
1137
+ viewContent() {
1517
1138
  return new TiktokStandardEvent('ViewContent');
1518
- };
1519
- TiktokStandardEvents.prototype.addToCart = function () {
1139
+ }
1140
+ addToCart() {
1520
1141
  return new TiktokStandardEvent('AddToCart');
1521
- };
1522
- TiktokStandardEvents.prototype.checkout = function () {
1142
+ }
1143
+ checkout() {
1523
1144
  return new TiktokStandardEvent('Checkout');
1524
- };
1525
- TiktokStandardEvents.prototype.purchase = function () {
1145
+ }
1146
+ purchase() {
1526
1147
  return new TiktokStandardEvent('Purchase');
1527
- };
1528
- TiktokStandardEvents.prototype.registration = function () {
1148
+ }
1149
+ registration() {
1529
1150
  return new TiktokStandardEvent('Registration');
1530
- };
1531
- TiktokStandardEvents.prototype.startCheckout = function () {
1151
+ }
1152
+ startCheckout() {
1532
1153
  return new TiktokStandardEvent('StartCheckout');
1533
- };
1534
- TiktokStandardEvents.prototype.addBilling = function () {
1154
+ }
1155
+ addBilling() {
1535
1156
  return new TiktokStandardEvent('AddBilling');
1536
- };
1537
- TiktokStandardEvents.prototype.search = function () {
1157
+ }
1158
+ search() {
1538
1159
  return new TiktokStandardEvent('Search');
1539
- };
1540
- TiktokStandardEvents.prototype.viewForm = function () {
1160
+ }
1161
+ viewForm() {
1541
1162
  return new TiktokStandardEvent('ViewForm');
1542
- };
1543
- TiktokStandardEvents.prototype.clickForm = function () {
1163
+ }
1164
+ clickForm() {
1544
1165
  return new TiktokStandardEvent('ClickForm');
1545
- };
1546
- TiktokStandardEvents.prototype.submitForm = function () {
1166
+ }
1167
+ submitForm() {
1547
1168
  return new TiktokStandardEvent('SubmitForm');
1548
- };
1549
- TiktokStandardEvents.prototype.viewDownloadPage = function () {
1169
+ }
1170
+ viewDownloadPage() {
1550
1171
  return new TiktokStandardEvent('ViewDownloadPage');
1551
- };
1552
- TiktokStandardEvents.prototype.clickInDownloadPage = function () {
1172
+ }
1173
+ clickInDownloadPage() {
1553
1174
  return new TiktokStandardEvent('ClickInDownloadPage');
1554
- };
1555
- TiktokStandardEvents.prototype.clickToDownload = function () {
1175
+ }
1176
+ clickToDownload() {
1556
1177
  return new TiktokStandardEvent('ClickToDownload');
1557
- };
1558
- TiktokStandardEvents.prototype.clickButton = function () {
1178
+ }
1179
+ clickButton() {
1559
1180
  return new TiktokStandardEvent('ClickButton');
1560
- };
1561
- return TiktokStandardEvents;
1562
- }());
1181
+ }
1182
+ }
1563
1183
 
1564
- var XyBaseEvent = /** @class */ (function () {
1565
- function XyBaseEvent(name) {
1184
+ class XyBaseEvent {
1185
+ constructor(name) {
1566
1186
  this.name = name;
1567
1187
  }
1568
- XyBaseEvent.prototype.send = function (fields) {
1569
- return __awaiter(this, void 0, void 0, function () {
1570
- return __generator(this, function (_a) {
1571
- switch (_a.label) {
1572
- case 0: return [4 /*yield*/, pixel.XyPixel.instance.send(this.name, fields)];
1573
- case 1:
1574
- _a.sent();
1575
- return [2 /*return*/];
1576
- }
1577
- });
1188
+ send(fields) {
1189
+ return __awaiter(this, void 0, void 0, function* () {
1190
+ yield pixel.XyPixel.instance.send(this.name, fields);
1578
1191
  });
1579
- };
1580
- return XyBaseEvent;
1581
- }());
1582
-
1583
- var XyCustomEvent = /** @class */ (function (_super) {
1584
- __extends(XyCustomEvent, _super);
1585
- function XyCustomEvent() {
1586
- return _super !== null && _super.apply(this, arguments) || this;
1587
- }
1588
- return XyCustomEvent;
1589
- }(XyBaseEvent));
1590
-
1591
- var XyUserEventHandler = /** @class */ (function () {
1592
- function XyUserEventHandler() {
1593
- }
1594
- XyUserEventHandler.prototype.testStarted = function (data) {
1595
- return __awaiter(this, void 0, void 0, function () {
1596
- var event;
1597
- return __generator(this, function (_a) {
1598
- switch (_a.label) {
1599
- case 0:
1600
- event = new XyCustomEvent('TestStarted');
1601
- return [4 /*yield*/, event.send(data)];
1602
- case 1: return [2 /*return*/, _a.sent()];
1603
- }
1604
- });
1192
+ }
1193
+ }
1194
+
1195
+ class XyCustomEvent extends XyBaseEvent {
1196
+ }
1197
+
1198
+ class XyUserEventHandler {
1199
+ testStarted(data) {
1200
+ return __awaiter(this, void 0, void 0, function* () {
1201
+ const event = new XyCustomEvent('TestStarted');
1202
+ return yield event.send(data);
1605
1203
  });
1606
- };
1607
- XyUserEventHandler.prototype.funnelStarted = function (data) {
1608
- return __awaiter(this, void 0, void 0, function () {
1609
- var event;
1610
- return __generator(this, function (_a) {
1611
- switch (_a.label) {
1612
- case 0:
1613
- event = new XyCustomEvent('FunnelStarted');
1614
- return [4 /*yield*/, event.send(data)];
1615
- case 1: return [2 /*return*/, _a.sent()];
1616
- }
1617
- });
1204
+ }
1205
+ funnelStarted(data) {
1206
+ return __awaiter(this, void 0, void 0, function* () {
1207
+ const event = new XyCustomEvent('FunnelStarted');
1208
+ return yield event.send(data);
1618
1209
  });
1619
- };
1620
- XyUserEventHandler.prototype.viewContent = function (data) {
1621
- return __awaiter(this, void 0, void 0, function () {
1622
- var event;
1623
- return __generator(this, function (_a) {
1624
- switch (_a.label) {
1625
- case 0:
1626
- event = new XyCustomEvent('ViewContent');
1627
- return [4 /*yield*/, event.send(data)];
1628
- case 1: return [2 /*return*/, _a.sent()];
1629
- }
1630
- });
1210
+ }
1211
+ viewContent(data) {
1212
+ return __awaiter(this, void 0, void 0, function* () {
1213
+ const event = new XyCustomEvent('ViewContent');
1214
+ return yield event.send(data);
1631
1215
  });
1632
- };
1633
- XyUserEventHandler.prototype.userClick = function (data) {
1634
- return __awaiter(this, void 0, void 0, function () {
1635
- var event;
1636
- return __generator(this, function (_a) {
1637
- switch (_a.label) {
1638
- case 0:
1639
- event = new XyCustomEvent('UserClick');
1640
- return [4 /*yield*/, event.send(data)];
1641
- case 1: return [2 /*return*/, _a.sent()];
1642
- }
1643
- });
1216
+ }
1217
+ userClick(data) {
1218
+ return __awaiter(this, void 0, void 0, function* () {
1219
+ const event = new XyCustomEvent('UserClick');
1220
+ return yield event.send(data);
1644
1221
  });
1645
- };
1646
- return XyUserEventHandler;
1647
- }());
1222
+ }
1223
+ }
1648
1224
 
1649
- var MetaMaskEthersLoader = function (props) {
1650
- var children = props.children, _a = props.enabled, enabled = _a === void 0 ? true : _a;
1225
+ const MetaMaskEthersLoader = (props) => {
1226
+ const { children, enabled = true } = props;
1651
1227
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1652
- var global = window;
1653
- var ethereum = global.ethereum;
1654
- var _b = __read(react.useState(), 2), error = _b[0], setError = _b[1];
1655
- var _c = __read(react.useState(), 2), localAddress = _c[0], setLocalAddress = _c[1];
1656
- var _d = __read(react.useState(0), 2), resetCount = _d[0], setResetCount = _d[1];
1657
- var _e = __read(react.useState(), 2), providerName = _e[0], setProviderName = _e[1];
1228
+ const global = window;
1229
+ const ethereum = global.ethereum;
1230
+ const [error, setError] = react.useState();
1231
+ const [localAddress, setLocalAddress] = react.useState();
1232
+ const [resetCount, setResetCount] = react.useState(0);
1233
+ const [providerName, setProviderName] = react.useState();
1658
1234
  if (ethereum) {
1659
1235
  ethereum.autoRefreshOnNetworkChange = false;
1660
1236
  }
1661
- var connect = function () { return __awaiter(void 0, void 0, void 0, function () {
1237
+ const connect = () => __awaiter(void 0, void 0, void 0, function* () {
1662
1238
  var _a;
1663
- return __generator(this, function (_b) {
1664
- switch (_b.label) {
1665
- case 0: return [4 /*yield*/, ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable())];
1666
- case 1:
1667
- _b.sent();
1668
- return [2 /*return*/, localAddress ? [localAddress.toString()] : []];
1669
- }
1670
- });
1671
- }); };
1672
- var _f = __read(react.useState(), 2), isConnected = _f[0], setIsConnected = _f[1];
1673
- react.useEffect(function () {
1239
+ yield ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable());
1240
+ return localAddress ? [localAddress.toString()] : [];
1241
+ });
1242
+ const [isConnected, setIsConnected] = react.useState();
1243
+ react.useEffect(() => {
1674
1244
  if (ethereum && enabled) {
1675
- ethereum.on('accountsChanged', function (accounts) {
1676
- console.log("accountsChanged: ".concat(JSON.stringify(accounts)));
1245
+ ethereum.on('accountsChanged', (accounts) => {
1246
+ console.log(`accountsChanged: ${JSON.stringify(accounts)}`);
1677
1247
  setResetCount(resetCount + 1);
1678
1248
  if (accounts.length > 0) {
1679
1249
  setLocalAddress(sdkJs.EthAddress.fromString(accounts[0]));
@@ -1682,7 +1252,7 @@ var MetaMaskEthersLoader = function (props) {
1682
1252
  setLocalAddress(undefined);
1683
1253
  }
1684
1254
  });
1685
- ethereum.on('chainChanged', function (chainId) {
1255
+ ethereum.on('chainChanged', (chainId) => {
1686
1256
  setResetCount(resetCount + 1);
1687
1257
  if (chainId) {
1688
1258
  setChainId(parseInt(chainId));
@@ -1693,130 +1263,103 @@ var MetaMaskEthersLoader = function (props) {
1693
1263
  });
1694
1264
  }
1695
1265
  }, [ethereum, resetCount, enabled]);
1696
- var _g = __read(react.useState(), 2), walletProvider = _g[0], setWalletProvider = _g[1];
1697
- var _h = __read(react.useState(), 2), provider = _h[0], setProvider = _h[1];
1698
- var _j = __read(react.useState(), 2), signer = _j[0], setSigner = _j[1];
1699
- react.useEffect(function () {
1266
+ const [walletProvider, setWalletProvider] = react.useState();
1267
+ const [provider, setProvider] = react.useState();
1268
+ const [signer, setSigner] = react.useState();
1269
+ react.useEffect(() => {
1700
1270
  if (enabled) {
1701
- var walletProvider_1 = ethereum ? new providers.Web3Provider(ethereum) : null;
1702
- var provider_1 = null;
1703
- var providerName_1 = null;
1704
- if (walletProvider_1) {
1705
- provider_1 = walletProvider_1;
1706
- providerName_1 = 'Meta Mask';
1271
+ const walletProvider = ethereum ? new providers.Web3Provider(ethereum) : null;
1272
+ let provider = null;
1273
+ let providerName = null;
1274
+ if (walletProvider) {
1275
+ provider = walletProvider;
1276
+ providerName = 'Meta Mask';
1707
1277
  }
1708
1278
  else {
1709
- provider_1 = new providers.InfuraProvider(1, infuraKey);
1710
- providerName_1 = 'Infura (Default)';
1279
+ provider = new providers.InfuraProvider(1, infuraKey);
1280
+ providerName = 'Infura (Default)';
1711
1281
  }
1712
- provider_1 = walletProvider_1 !== null && walletProvider_1 !== void 0 ? walletProvider_1 : provider_1;
1713
- setProvider(provider_1);
1714
- setProviderName(providerName_1);
1715
- setWalletProvider(walletProvider_1);
1716
- var signer_1 = null;
1282
+ provider = walletProvider !== null && walletProvider !== void 0 ? walletProvider : provider;
1283
+ setProvider(provider);
1284
+ setProviderName(providerName);
1285
+ setWalletProvider(walletProvider);
1286
+ let signer = null;
1717
1287
  try {
1718
- signer_1 = walletProvider_1 === null || walletProvider_1 === void 0 ? void 0 : walletProvider_1.getSigner();
1288
+ signer = walletProvider === null || walletProvider === void 0 ? void 0 : walletProvider.getSigner();
1719
1289
  }
1720
1290
  catch (ex) {
1721
1291
  console.error(ex);
1722
1292
  }
1723
- setSigner(signer_1);
1293
+ setSigner(signer);
1724
1294
  }
1725
1295
  }, [ethereum, isConnected, enabled]);
1726
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1727
- var localAddress_1, _a, _b, ex_1;
1728
- return __generator(this, function (_c) {
1729
- switch (_c.label) {
1730
- case 0:
1731
- if (!(signer && enabled)) return [3 /*break*/, 4];
1732
- _c.label = 1;
1733
- case 1:
1734
- _c.trys.push([1, 3, , 4]);
1735
- _b = (_a = sdkJs.EthAddress).fromString;
1736
- return [4 /*yield*/, signer.getAddress()];
1737
- case 2:
1738
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1739
- console.log("Setting Local Address: ".concat(localAddress_1));
1740
- if (isMounted()) {
1741
- setLocalAddress(localAddress_1);
1742
- setIsConnected(true);
1743
- }
1744
- return [3 /*break*/, 4];
1745
- case 3:
1746
- ex_1 = _c.sent();
1747
- if (isMounted()) {
1748
- setError(Error("localAddress: ".concat(ex_1)));
1749
- setLocalAddress(undefined);
1750
- setIsConnected(false);
1751
- }
1752
- return [3 /*break*/, 4];
1753
- case 4: return [2 /*return*/];
1296
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1297
+ if (signer && enabled) {
1298
+ try {
1299
+ const localAddress = sdkJs.EthAddress.fromString(yield signer.getAddress());
1300
+ console.log(`Setting Local Address: ${localAddress}`);
1301
+ if (isMounted()) {
1302
+ setLocalAddress(localAddress);
1303
+ setIsConnected(true);
1304
+ }
1754
1305
  }
1755
- });
1756
- }); }, [signer, resetCount, enabled]);
1757
- var _k = __read(react.useState(), 2), chainId = _k[0], setChainId = _k[1];
1758
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1759
- var chainId_1;
1760
- var _a;
1761
- return __generator(this, function (_b) {
1762
- switch (_b.label) {
1763
- case 0:
1764
- if (!enabled) return [3 /*break*/, 2];
1765
- return [4 /*yield*/, (provider === null || provider === void 0 ? void 0 : provider.getNetwork())];
1766
- case 1:
1767
- chainId_1 = (_a = (_b.sent())) === null || _a === void 0 ? void 0 : _a.chainId;
1768
- if (!isMounted())
1769
- return [2 /*return*/];
1770
- setChainId(chainId_1);
1771
- _b.label = 2;
1772
- case 2: return [2 /*return*/];
1306
+ catch (ex) {
1307
+ if (isMounted()) {
1308
+ setError(Error(`localAddress: ${ex}`));
1309
+ setLocalAddress(undefined);
1310
+ setIsConnected(false);
1311
+ }
1773
1312
  }
1774
- });
1775
- }); }, [provider, enabled]);
1776
- return (jsxRuntime.jsx(EthersContext.Provider, __assign({ value: {
1313
+ }
1314
+ }), [signer, resetCount, enabled]);
1315
+ const [chainId, setChainId] = react.useState();
1316
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1317
+ var _b;
1318
+ if (enabled) {
1319
+ const chainId = (_b = (yield (provider === null || provider === void 0 ? void 0 : provider.getNetwork()))) === null || _b === void 0 ? void 0 : _b.chainId;
1320
+ if (!isMounted())
1321
+ return;
1322
+ setChainId(chainId);
1323
+ }
1324
+ }), [provider, enabled]);
1325
+ return (jsxRuntime.jsx(EthersContext.Provider, Object.assign({ value: {
1777
1326
  busy: false,
1778
- chainId: chainId,
1779
- connect: connect,
1780
- error: error,
1781
- isConnected: isConnected,
1782
- localAddress: localAddress,
1783
- provider: provider,
1784
- providerName: providerName,
1327
+ chainId,
1328
+ connect,
1329
+ error,
1330
+ isConnected,
1331
+ localAddress,
1332
+ provider,
1333
+ providerName,
1785
1334
  signer: isConnected ? signer : undefined,
1786
- walletProvider: walletProvider,
1335
+ walletProvider,
1787
1336
  } }, { children: children }), void 0));
1788
1337
  };
1789
1338
 
1790
- var MyEtherWalletEthersLoader = function (props) {
1791
- var children = props.children;
1339
+ const MyEtherWalletEthersLoader = (props) => {
1340
+ const { children } = props;
1792
1341
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1793
- var global = window;
1794
- var ethereum = global.ethereum;
1795
- var _a = __read(react.useState(), 2), error = _a[0], setError = _a[1];
1796
- var _b = __read(react.useState(), 2), localAddress = _b[0], setLocalAddress = _b[1];
1797
- var _c = __read(react.useState(), 2), providerName = _c[0], setProviderName = _c[1];
1342
+ const global = window;
1343
+ const ethereum = global.ethereum;
1344
+ const [error, setError] = react.useState();
1345
+ const [localAddress, setLocalAddress] = react.useState();
1346
+ const [providerName, setProviderName] = react.useState();
1798
1347
  if (ethereum) {
1799
1348
  ethereum.autoRefreshOnNetworkChange = false;
1800
1349
  }
1801
- var connect = function () { return __awaiter(void 0, void 0, void 0, function () {
1350
+ const connect = () => __awaiter(void 0, void 0, void 0, function* () {
1802
1351
  var _a;
1803
- return __generator(this, function (_b) {
1804
- switch (_b.label) {
1805
- case 0: return [4 /*yield*/, ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable())];
1806
- case 1:
1807
- _b.sent();
1808
- return [2 /*return*/, localAddress ? [localAddress.toString()] : []];
1809
- }
1810
- });
1811
- }); };
1812
- var _d = __read(react.useState(), 2), isConnected = _d[0], setIsConnected = _d[1];
1813
- var _e = __read(react.useState(), 2), walletProvider = _e[0], setWalletProvider = _e[1];
1814
- var _f = __read(react.useState(), 2), provider = _f[0], setProvider = _f[1];
1815
- var _g = __read(react.useState(), 2), signer = _g[0], setSigner = _g[1];
1816
- react.useEffect(function () {
1817
- var walletProvider = ethereum ? new providers.Web3Provider(ethereum) : null;
1818
- var provider = null;
1819
- var providerName = null;
1352
+ yield ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable());
1353
+ return localAddress ? [localAddress.toString()] : [];
1354
+ });
1355
+ const [isConnected, setIsConnected] = react.useState();
1356
+ const [walletProvider, setWalletProvider] = react.useState();
1357
+ const [provider, setProvider] = react.useState();
1358
+ const [signer, setSigner] = react.useState();
1359
+ react.useEffect(() => {
1360
+ const walletProvider = ethereum ? new providers.Web3Provider(ethereum) : null;
1361
+ let provider = null;
1362
+ let providerName = null;
1820
1363
  if (walletProvider) {
1821
1364
  provider = walletProvider;
1822
1365
  providerName = 'MyEtherWallet';
@@ -1828,7 +1371,7 @@ var MyEtherWalletEthersLoader = function (props) {
1828
1371
  setProvider(provider);
1829
1372
  setProviderName(providerName);
1830
1373
  setWalletProvider(walletProvider);
1831
- var signer = null;
1374
+ let signer = null;
1832
1375
  try {
1833
1376
  signer = walletProvider === null || walletProvider === void 0 ? void 0 : walletProvider.getSigner();
1834
1377
  }
@@ -1837,175 +1380,131 @@ var MyEtherWalletEthersLoader = function (props) {
1837
1380
  }
1838
1381
  setSigner(signer);
1839
1382
  }, [ethereum, isConnected]);
1840
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1841
- var localAddress_1, _a, _b, ex_1;
1842
- return __generator(this, function (_c) {
1843
- switch (_c.label) {
1844
- case 0:
1845
- if (!signer) return [3 /*break*/, 4];
1846
- _c.label = 1;
1847
- case 1:
1848
- _c.trys.push([1, 3, , 4]);
1849
- _b = (_a = sdkJs.EthAddress).fromString;
1850
- return [4 /*yield*/, signer.getAddress()];
1851
- case 2:
1852
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1853
- if (isMounted()) {
1854
- setLocalAddress(localAddress_1);
1855
- setIsConnected(true);
1856
- }
1857
- return [3 /*break*/, 4];
1858
- case 3:
1859
- ex_1 = _c.sent();
1860
- if (isMounted()) {
1861
- setError(Error("localAddress: ".concat(ex_1)));
1862
- setLocalAddress(undefined);
1863
- setIsConnected(false);
1864
- }
1865
- return [3 /*break*/, 4];
1866
- case 4: return [2 /*return*/];
1383
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1384
+ if (signer) {
1385
+ try {
1386
+ const localAddress = sdkJs.EthAddress.fromString(yield signer.getAddress());
1387
+ if (isMounted()) {
1388
+ setLocalAddress(localAddress);
1389
+ setIsConnected(true);
1390
+ }
1867
1391
  }
1868
- });
1869
- }); }, [signer]);
1870
- var _h = __read(react.useState(), 2), chainId = _h[0], setChainId = _h[1];
1871
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1872
- var chainId;
1873
- var _a;
1874
- return __generator(this, function (_b) {
1875
- switch (_b.label) {
1876
- case 0: return [4 /*yield*/, (provider === null || provider === void 0 ? void 0 : provider.getNetwork())];
1877
- case 1:
1878
- chainId = (_a = (_b.sent())) === null || _a === void 0 ? void 0 : _a.chainId;
1879
- if (!isMounted())
1880
- return [2 /*return*/];
1881
- setChainId(chainId);
1882
- return [2 /*return*/];
1392
+ catch (ex) {
1393
+ if (isMounted()) {
1394
+ setError(Error(`localAddress: ${ex}`));
1395
+ setLocalAddress(undefined);
1396
+ setIsConnected(false);
1397
+ }
1883
1398
  }
1884
- });
1885
- }); }, [provider]);
1886
- return (jsxRuntime.jsx(EthersContext.Provider, __assign({ value: {
1399
+ }
1400
+ }), [signer]);
1401
+ const [chainId, setChainId] = react.useState();
1402
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1403
+ var _b;
1404
+ const chainId = (_b = (yield (provider === null || provider === void 0 ? void 0 : provider.getNetwork()))) === null || _b === void 0 ? void 0 : _b.chainId;
1405
+ if (!isMounted())
1406
+ return;
1407
+ setChainId(chainId);
1408
+ }), [provider]);
1409
+ return (jsxRuntime.jsx(EthersContext.Provider, Object.assign({ value: {
1887
1410
  busy: false,
1888
- chainId: chainId,
1889
- connect: connect,
1890
- error: error,
1891
- isConnected: isConnected,
1892
- localAddress: localAddress,
1893
- provider: provider,
1894
- providerName: providerName,
1411
+ chainId,
1412
+ connect,
1413
+ error,
1414
+ isConnected,
1415
+ localAddress,
1416
+ provider,
1417
+ providerName,
1895
1418
  signer: isConnected ? signer : undefined,
1896
- walletProvider: walletProvider,
1419
+ walletProvider,
1897
1420
  } }, { children: children }), void 0));
1898
1421
  };
1899
1422
 
1900
- var OperaEthersLoader = function (props) {
1423
+ const OperaEthersLoader = (props) => {
1901
1424
  var _a, _b, _c, _d, _e, _f;
1902
- var children = props.children;
1425
+ const { children } = props;
1903
1426
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1904
- var global = window;
1905
- var ethereum = global.ethereum;
1906
- var _g = __read(react.useState(), 2), error = _g[0], setError = _g[1];
1907
- var _h = __read(react.useState(), 2), signer = _h[0], setSigner = _h[1];
1908
- var _j = __read(react.useState(), 2), provider = _j[0], setProvider = _j[1];
1909
- var _k = __read(react.useState(((_c = (_b = (_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.addresses) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0 ? sdkJs.EthAddress.fromString((_e = (_d = global.ethereum) === null || _d === void 0 ? void 0 : _d.addresses) === null || _e === void 0 ? void 0 : _e[0]) : null), 2), localAddress = _k[0], setLocalAddress = _k[1];
1910
- var chainId = (ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) ? parseInt(ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) : 1;
1911
- var isConnected = (_f = ethereum === null || ethereum === void 0 ? void 0 : ethereum.isConnected()) !== null && _f !== void 0 ? _f : false;
1912
- useAsyncEffect(function (mounted) { return __awaiter(void 0, void 0, void 0, function () {
1913
- var operaProvider, provider_1, signer_1, localAddress_1, _a, _b, ex_1;
1914
- return __generator(this, function (_c) {
1915
- switch (_c.label) {
1916
- case 0:
1917
- if (!ethereum) return [3 /*break*/, 4];
1918
- ethereum.enable();
1919
- operaProvider = new providers.Web3Provider(ethereum);
1920
- provider_1 = operaProvider;
1921
- signer_1 = operaProvider.getSigner();
1922
- _c.label = 1;
1923
- case 1:
1924
- _c.trys.push([1, 3, , 4]);
1925
- _b = (_a = sdkJs.EthAddress).fromString;
1926
- return [4 /*yield*/, signer_1.getAddress()];
1927
- case 2:
1928
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1929
- ethereum.autoRefreshOnNetworkChange = false;
1930
- if (mounted()) {
1931
- setSigner(signer_1);
1932
- setProvider(provider_1);
1933
- setLocalAddress(localAddress_1);
1934
- }
1935
- return [3 /*break*/, 4];
1936
- case 3:
1937
- ex_1 = _c.sent();
1938
- if (mounted()) {
1939
- setError(Error("localAddress: ".concat(ex_1)));
1940
- }
1941
- return [3 /*break*/, 4];
1942
- case 4: return [2 /*return*/];
1427
+ const global = window;
1428
+ const ethereum = global.ethereum;
1429
+ const [error, setError] = react.useState();
1430
+ const [signer, setSigner] = react.useState();
1431
+ const [provider, setProvider] = react.useState();
1432
+ const [localAddress, setLocalAddress] = react.useState(((_c = (_b = (_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.addresses) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0 ? sdkJs.EthAddress.fromString((_e = (_d = global.ethereum) === null || _d === void 0 ? void 0 : _d.addresses) === null || _e === void 0 ? void 0 : _e[0]) : null);
1433
+ const chainId = (ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) ? parseInt(ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) : 1;
1434
+ const isConnected = (_f = ethereum === null || ethereum === void 0 ? void 0 : ethereum.isConnected()) !== null && _f !== void 0 ? _f : false;
1435
+ useAsyncEffect((mounted) => __awaiter(void 0, void 0, void 0, function* () {
1436
+ if (ethereum) {
1437
+ ethereum.enable();
1438
+ const operaProvider = new providers.Web3Provider(ethereum);
1439
+ const provider = operaProvider;
1440
+ const signer = operaProvider.getSigner();
1441
+ try {
1442
+ const localAddress = sdkJs.EthAddress.fromString(yield signer.getAddress());
1443
+ ethereum.autoRefreshOnNetworkChange = false;
1444
+ if (mounted()) {
1445
+ setSigner(signer);
1446
+ setProvider(provider);
1447
+ setLocalAddress(localAddress);
1448
+ }
1943
1449
  }
1944
- });
1945
- }); }, [ethereum]);
1946
- return (jsxRuntime.jsx(EthersContext.Provider, __assign({ value: {
1450
+ catch (ex) {
1451
+ if (mounted()) {
1452
+ setError(Error(`localAddress: ${ex}`));
1453
+ }
1454
+ }
1455
+ }
1456
+ }), [ethereum]);
1457
+ return (jsxRuntime.jsx(EthersContext.Provider, Object.assign({ value: {
1947
1458
  busy: false,
1948
- chainId: chainId,
1949
- error: error,
1950
- isConnected: isConnected,
1951
- localAddress: localAddress,
1952
- provider: provider,
1953
- signer: signer,
1459
+ chainId,
1460
+ error,
1461
+ isConnected,
1462
+ localAddress,
1463
+ provider,
1464
+ signer,
1954
1465
  } }, { children: children }), void 0));
1955
1466
  };
1956
1467
 
1957
- var TrustEthersLoader = function (props) {
1958
- var children = props.children;
1468
+ const TrustEthersLoader = (props) => {
1469
+ const { children } = props;
1959
1470
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1960
- var global = window;
1961
- var _a = __read(react.useState(), 2), error = _a[0], setError = _a[1];
1962
- var _b = __read(react.useState(), 2), localAddress = _b[0], setLocalAddress = _b[1];
1963
- var trustProvider = new providers.Web3Provider(global.ethereum);
1964
- var signer = trustProvider.getSigner();
1965
- var chainId = 1;
1966
- var provider = trustProvider;
1967
- useAsyncEffect(function (mounted) { return __awaiter(void 0, void 0, void 0, function () {
1968
- var localAddress_1, _a, _b, ex_1;
1969
- return __generator(this, function (_c) {
1970
- switch (_c.label) {
1971
- case 0:
1972
- if (!signer) return [3 /*break*/, 4];
1973
- _c.label = 1;
1974
- case 1:
1975
- _c.trys.push([1, 3, , 4]);
1976
- _b = (_a = sdkJs.EthAddress).fromString;
1977
- return [4 /*yield*/, signer.getAddress()];
1978
- case 2:
1979
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1980
- if (mounted()) {
1981
- setLocalAddress(localAddress_1);
1982
- }
1983
- return [3 /*break*/, 4];
1984
- case 3:
1985
- ex_1 = _c.sent();
1986
- if (mounted()) {
1987
- setError(Error("localAddress: ".concat(ex_1)));
1988
- }
1989
- return [3 /*break*/, 4];
1990
- case 4: return [2 /*return*/];
1471
+ const global = window;
1472
+ const [error, setError] = react.useState();
1473
+ const [localAddress, setLocalAddress] = react.useState();
1474
+ const trustProvider = new providers.Web3Provider(global.ethereum);
1475
+ const signer = trustProvider.getSigner();
1476
+ const chainId = 1;
1477
+ const provider = trustProvider;
1478
+ useAsyncEffect((mounted) => __awaiter(void 0, void 0, void 0, function* () {
1479
+ if (signer) {
1480
+ try {
1481
+ const localAddress = sdkJs.EthAddress.fromString(yield signer.getAddress());
1482
+ if (mounted()) {
1483
+ setLocalAddress(localAddress);
1484
+ }
1991
1485
  }
1992
- });
1993
- }); }, [signer]);
1994
- return (jsxRuntime.jsx(EthersContext.Provider, __assign({ value: {
1486
+ catch (ex) {
1487
+ if (mounted()) {
1488
+ setError(Error(`localAddress: ${ex}`));
1489
+ }
1490
+ }
1491
+ }
1492
+ }), [signer]);
1493
+ return (jsxRuntime.jsx(EthersContext.Provider, Object.assign({ value: {
1995
1494
  busy: false,
1996
- chainId: chainId,
1997
- error: error,
1998
- localAddress: localAddress,
1999
- provider: provider,
2000
- signer: signer,
1495
+ chainId,
1496
+ error,
1497
+ localAddress,
1498
+ provider,
1499
+ signer,
2001
1500
  } }, { children: children }), void 0));
2002
1501
  };
2003
1502
 
2004
- var EthersLoader = function (props) {
1503
+ const EthersLoader = (props) => {
2005
1504
  var _a, _b, _c, _d;
2006
1505
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2007
- var global = window;
2008
- var children = props.children;
1506
+ const global = window;
1507
+ const { children } = props;
2009
1508
  if ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.isMetaMask) {
2010
1509
  return jsxRuntime.jsx(MetaMaskEthersLoader, { children: children }, void 0);
2011
1510
  }
@@ -2024,11 +1523,11 @@ var EthersLoader = function (props) {
2024
1523
  return jsxRuntime.jsx(InfuraEthersLoader, { children: children }, void 0);
2025
1524
  };
2026
1525
 
2027
- var NetworkSettingsContext = react.createContext({});
1526
+ const NetworkSettingsContext = react.createContext({});
2028
1527
 
2029
- var NetworkSettingsLoader = function (props) {
2030
- var children = props.children;
2031
- return (jsxRuntime.jsx(NetworkSettingsContext.Provider, __assign({ value: {
1528
+ const NetworkSettingsLoader = (props) => {
1529
+ const { children } = props;
1530
+ return (jsxRuntime.jsx(NetworkSettingsContext.Provider, Object.assign({ value: {
2032
1531
  xyBondAddress: sdkJs.EthAddress.fromString('0x1a024A698EEBdB86ccf3fCaF2F589839bdc066AD'),
2033
1532
  xyFhrMerkleSendAddress: sdkJs.EthAddress.fromString('0x46FEEBDffC8076D9E5fd8a11CF1508810472A79f'),
2034
1533
  xyGovernanceAddress: sdkJs.EthAddress.fromString('0x01925d0fFE4a6a6162B51ba611e3D4780Fc2dF42'),
@@ -2036,16 +1535,15 @@ var NetworkSettingsLoader = function (props) {
2036
1535
  } }, { children: children }), void 0));
2037
1536
  };
2038
1537
 
2039
- var UserEventsContext = react.createContext({});
1538
+ const UserEventsContext = react.createContext({});
2040
1539
 
2041
- var UserEventsLoader = function (_a) {
2042
- var userEvents = _a.userEvents, children = _a.children;
2043
- return jsxRuntime.jsx(UserEventsContext.Provider, __assign({ value: { userEvents: userEvents } }, { children: children }), void 0);
1540
+ const UserEventsLoader = ({ userEvents, children }) => {
1541
+ return jsxRuntime.jsx(UserEventsContext.Provider, Object.assign({ value: { userEvents } }, { children: children }), void 0);
2044
1542
  };
2045
1543
 
2046
- var calcSpacing = function (theme, values) {
2047
- for (var i = 0; i < values.length; i++) {
2048
- var value = values[i];
1544
+ const calcSpacing = (theme, values) => {
1545
+ for (let i = 0; i < values.length; i++) {
1546
+ const value = values[i];
2049
1547
  if (value !== undefined) {
2050
1548
  if (typeof value === 'string') {
2051
1549
  return value;
@@ -2057,63 +1555,77 @@ var calcSpacing = function (theme, values) {
2057
1555
  }
2058
1556
  };
2059
1557
 
2060
- var mergeBoxlikeStyles = function (theme, props, defaultProps) {
2061
- var _a = __assign(__assign({}, defaultProps), props), alignContent = _a.alignContent, alignItems = _a.alignItems, alignSelf = _a.alignSelf, bgcolor = _a.bgcolor, border = _a.border, borderColor = _a.borderColor, display = _a.display, flexGrow = _a.flexGrow, flexShrink = _a.flexShrink, flexDirection = _a.flexDirection, flexWrap = _a.flexWrap, justifyContent = _a.justifyContent, justifyItems = _a.justifyItems, justifySelf = _a.justifySelf, height = _a.height, minHeight = _a.minHeight, minWidth = _a.minWidth, margin = _a.margin, marginX = _a.marginX, marginY = _a.marginY, marginTop = _a.marginTop, marginLeft = _a.marginLeft, marginRight = _a.marginRight, marginBottom = _a.marginBottom, padding = _a.padding, paddingX = _a.paddingX, paddingY = _a.paddingY, paddingTop = _a.paddingTop, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingBottom = _a.paddingBottom, position = _a.position, style = _a.style, width = _a.width, rootProps = __rest(_a, ["alignContent", "alignItems", "alignSelf", "bgcolor", "border", "borderColor", "display", "flexGrow", "flexShrink", "flexDirection", "flexWrap", "justifyContent", "justifyItems", "justifySelf", "height", "minHeight", "minWidth", "margin", "marginX", "marginY", "marginTop", "marginLeft", "marginRight", "marginBottom", "padding", "paddingX", "paddingY", "paddingTop", "paddingLeft", "paddingRight", "paddingBottom", "position", "style", "width"]);
2062
- var mergedStyle = __assign({ alignContent: alignContent, alignItems: alignItems, alignSelf: alignSelf, backgroundColor: bgcolor, border: border, borderColor: borderColor, display: display, flexDirection: flexDirection, flexGrow: flexGrow, flexShrink: flexShrink, flexWrap: flexWrap, height: height, justifyContent: justifyContent, justifyItems: justifyItems, justifySelf: justifySelf, marginBottom: calcSpacing(theme, [marginBottom, marginY, margin]), marginLeft: calcSpacing(theme, [marginLeft, marginX, margin]), marginRight: calcSpacing(theme, [marginRight, marginX, margin]), marginTop: calcSpacing(theme, [marginTop, marginY, margin]), minHeight: minHeight, minWidth: minWidth, paddingBottom: calcSpacing(theme, [paddingBottom, paddingY, padding]), paddingLeft: calcSpacing(theme, [paddingLeft, paddingX, padding]), paddingRight: calcSpacing(theme, [paddingRight, paddingX, padding]), paddingTop: calcSpacing(theme, [paddingTop, paddingY, padding]), position: position, width: width }, style);
2063
- return __assign(__assign({}, rootProps), { style: mergedStyle });
2064
- };
2065
-
2066
- var ButtonExBase = function (props) {
2067
- var theme = material.useTheme();
2068
- var _a = mergeBoxlikeStyles(theme, props), busy = _a.busy, _b = _a.busyVariant, busyVariant = _b === void 0 ? 'linear' : _b, busyOpacity = _a.busyOpacity, onClick = _a.onClick, children = _a.children, rootProps = __rest(_a, ["busy", "busyVariant", "busyOpacity", "onClick", "children"]);
2069
- var localOnClick = function (event) {
1558
+ const mergeBoxlikeStyles = (theme, props, defaultProps) => {
1559
+ const _a = Object.assign(Object.assign({}, defaultProps), props), { alignContent, alignItems, alignSelf, bgcolor, border, borderColor, display, flexGrow, flexShrink, flexDirection, flexWrap, justifyContent, justifyItems, justifySelf, height, minHeight, minWidth, margin, marginX, marginY, marginTop, marginLeft, marginRight, marginBottom, padding, paddingX, paddingY, paddingTop, paddingLeft, paddingRight, paddingBottom, position, style, width } = _a, rootProps = __rest(_a, ["alignContent", "alignItems", "alignSelf", "bgcolor", "border", "borderColor", "display", "flexGrow", "flexShrink", "flexDirection", "flexWrap", "justifyContent", "justifyItems", "justifySelf", "height", "minHeight", "minWidth", "margin", "marginX", "marginY", "marginTop", "marginLeft", "marginRight", "marginBottom", "padding", "paddingX", "paddingY", "paddingTop", "paddingLeft", "paddingRight", "paddingBottom", "position", "style", "width"]);
1560
+ const mergedStyle = Object.assign({ alignContent,
1561
+ alignItems,
1562
+ alignSelf, backgroundColor: bgcolor, border,
1563
+ borderColor,
1564
+ display,
1565
+ flexDirection,
1566
+ flexGrow,
1567
+ flexShrink,
1568
+ flexWrap,
1569
+ height,
1570
+ justifyContent,
1571
+ justifyItems,
1572
+ justifySelf, marginBottom: calcSpacing(theme, [marginBottom, marginY, margin]), marginLeft: calcSpacing(theme, [marginLeft, marginX, margin]), marginRight: calcSpacing(theme, [marginRight, marginX, margin]), marginTop: calcSpacing(theme, [marginTop, marginY, margin]), minHeight,
1573
+ minWidth, paddingBottom: calcSpacing(theme, [paddingBottom, paddingY, padding]), paddingLeft: calcSpacing(theme, [paddingLeft, paddingX, padding]), paddingRight: calcSpacing(theme, [paddingRight, paddingX, padding]), paddingTop: calcSpacing(theme, [paddingTop, paddingY, padding]), position,
1574
+ width }, style);
1575
+ return Object.assign(Object.assign({}, rootProps), { style: mergedStyle });
1576
+ };
1577
+
1578
+ const ButtonExBase = (props) => {
1579
+ const theme = material.useTheme();
1580
+ const _a = mergeBoxlikeStyles(theme, props), { busy, busyVariant = 'linear', busyOpacity, onClick, children } = _a, rootProps = __rest(_a, ["busy", "busyVariant", "busyOpacity", "onClick", "children"]);
1581
+ const localOnClick = (event) => {
2070
1582
  if (!busy) {
2071
1583
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
2072
1584
  }
2073
1585
  };
2074
- return (jsxRuntime.jsxs(material.Button, __assign({ onClick: localOnClick }, rootProps, { children: [busy && busyVariant === 'linear' ? jsxRuntime.jsx(BusyLinearProgress, { rounded: true, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0 }, void 0) : null, busy && busyVariant === 'circular' ? (jsxRuntime.jsx(BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0.5 }, void 0)) : null, children] }), void 0));
1586
+ return (jsxRuntime.jsxs(material.Button, Object.assign({ onClick: localOnClick }, rootProps, { children: [busy && busyVariant === 'linear' ? jsxRuntime.jsx(BusyLinearProgress, { rounded: true, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0 }, void 0) : null, busy && busyVariant === 'circular' ? (jsxRuntime.jsx(BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0.5 }, void 0)) : null, children] }), void 0));
2075
1587
  };
2076
1588
 
2077
- var ButtonExTo = function (_a) {
2078
- var to = _a.to, toOptions = _a.toOptions, onClick = _a.onClick, props = __rest(_a, ["to", "toOptions", "onClick"]);
2079
- var navigate = reactRouterDom.useNavigate();
2080
- var localOnClick = function (event) {
1589
+ const ButtonExTo = (_a) => {
1590
+ var { to, toOptions, onClick } = _a, props = __rest(_a, ["to", "toOptions", "onClick"]);
1591
+ const navigate = reactRouterDom.useNavigate();
1592
+ const localOnClick = (event) => {
2081
1593
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
2082
1594
  if (to) {
2083
1595
  navigate(to, toOptions);
2084
1596
  }
2085
1597
  };
2086
- return jsxRuntime.jsx(ButtonExBase, __assign({ onClick: localOnClick }, props), void 0);
1598
+ return jsxRuntime.jsx(ButtonExBase, Object.assign({ onClick: localOnClick }, props), void 0);
2087
1599
  };
2088
1600
 
2089
- var ButtonEx = function (_a) {
2090
- var to = _a.to, props = __rest(_a, ["to"]);
1601
+ const ButtonEx = (_a) => {
1602
+ var { to } = _a, props = __rest(_a, ["to"]);
2091
1603
  if (to) {
2092
- return jsxRuntime.jsx(ButtonExTo, __assign({ to: to }, props), void 0);
1604
+ return jsxRuntime.jsx(ButtonExTo, Object.assign({ to: to }, props), void 0);
2093
1605
  }
2094
1606
  else {
2095
- return jsxRuntime.jsx(ButtonExBase, __assign({}, props), void 0);
1607
+ return jsxRuntime.jsx(ButtonExBase, Object.assign({}, props), void 0);
2096
1608
  }
2097
1609
  };
2098
1610
 
2099
- var CookieConsentBody = function (_a) {
2100
- var acceptOnScroll = _a.acceptOnScroll, _b = _a.acceptOnTimer, acceptOnTimer = _b === void 0 ? 0 : _b, onAccept = _a.onAccept, props = __rest(_a, ["acceptOnScroll", "acceptOnTimer", "onAccept"]);
2101
- var _c = useCookieConsent(), accepted = _c.accepted, setAccepted = _c.setAccepted, storageName = _c.storageName;
2102
- var onScroll = function () {
1611
+ const CookieConsentBody = (_a) => {
1612
+ var { acceptOnScroll, acceptOnTimer = 0, onAccept } = _a, props = __rest(_a, ["acceptOnScroll", "acceptOnTimer", "onAccept"]);
1613
+ const { accepted, setAccepted, storageName } = useCookieConsent();
1614
+ const onScroll = () => {
2103
1615
  //hide it one the user has scrolled at least one page
2104
1616
  if (window.scrollY > window.innerHeight && !accepted) {
2105
1617
  onAcceptClick();
2106
1618
  }
2107
1619
  };
2108
- react.useEffect(function () {
1620
+ react.useEffect(() => {
2109
1621
  if (acceptOnScroll) {
2110
1622
  window.addEventListener('scroll', onScroll);
2111
- return function () {
1623
+ return () => {
2112
1624
  window.removeEventListener('scroll', onScroll);
2113
1625
  };
2114
1626
  }
2115
1627
  });
2116
- var onAcceptClick = function () {
1628
+ const onAcceptClick = () => {
2117
1629
  if (setAccepted) {
2118
1630
  setAccepted === null || setAccepted === void 0 ? void 0 : setAccepted(true);
2119
1631
  }
@@ -2123,21 +1635,21 @@ var CookieConsentBody = function (_a) {
2123
1635
  onAccept === null || onAccept === void 0 ? void 0 : onAccept(true);
2124
1636
  };
2125
1637
  if (acceptOnTimer > 0 && !accepted) {
2126
- setTimeout(function () {
1638
+ setTimeout(() => {
2127
1639
  onAcceptClick();
2128
1640
  }, acceptOnTimer);
2129
1641
  }
2130
1642
  if (!storageName) {
2131
- return (jsxRuntime.jsx(FlexRow, __assign({ justifyContent: "center", paddingY: 2 }, props, { children: jsxRuntime.jsx(material.Typography, __assign({ color: "error", variant: "body1" }, { children: "Missing CookieConsentContext" }), void 0) }), void 0));
1643
+ return (jsxRuntime.jsx(FlexRow, Object.assign({ justifyContent: "center", paddingY: 2 }, props, { children: jsxRuntime.jsx(material.Typography, Object.assign({ color: "error", variant: "body1" }, { children: "Missing CookieConsentContext" }), void 0) }), void 0));
2132
1644
  }
2133
- return accepted ? null : (jsxRuntime.jsxs(FlexRow, __assign({ justifyContent: "space-between" }, props, { children: [jsxRuntime.jsxs(material.Typography, __assign({ variant: "body2", margin: 2 }, { children: ['This site uses ', jsxRuntime.jsx(material.Link, __assign({ href: "https://cookiesandyou.com/", rel: "noopener noreferrer", target: "_blank" }, { children: "cookies" }), void 0), ' and ', jsxRuntime.jsx(material.Link, __assign({ href: "https://policies.google.com/technologies/partner-sites", rel: "noopener noreferrer", target: "_blank" }, { children: "Google\u00A0tools" }), void 0), ' to analyze traffic and for ads measurement purposes.'] }), void 0), jsxRuntime.jsx(ButtonEx, __assign({ variant: "contained", color: "secondary", onClick: onAcceptClick, margin: 2 }, { children: "Accept" }), void 0)] }), void 0));
1645
+ return accepted ? null : (jsxRuntime.jsxs(FlexRow, Object.assign({ justifyContent: "space-between" }, props, { children: [jsxRuntime.jsxs(material.Typography, Object.assign({ variant: "body2", margin: 2 }, { children: ['This site uses ', jsxRuntime.jsx(material.Link, Object.assign({ href: "https://cookiesandyou.com/", rel: "noopener noreferrer", target: "_blank" }, { children: "cookies" }), void 0), ' and ', jsxRuntime.jsx(material.Link, Object.assign({ href: "https://policies.google.com/technologies/partner-sites", rel: "noopener noreferrer", target: "_blank" }, { children: "Google\u00A0tools" }), void 0), ' to analyze traffic and for ads measurement purposes.'] }), void 0), jsxRuntime.jsx(ButtonEx, Object.assign({ variant: "contained", color: "secondary", onClick: onAcceptClick, margin: 2 }, { children: "Accept" }), void 0)] }), void 0));
2134
1646
  };
2135
1647
 
2136
- var CookieConsent = function (props) {
2137
- var storageName = useCookieConsent().storageName;
2138
- var Inner = function () {
2139
- var accepted = useCookieConsent().accepted;
2140
- return accepted ? null : (jsxRuntime.jsx(CookieConsentBody, __assign({ background: true, paper: true, position: "fixed", bottom: 0, maxWidth: "100vw", width: "100%", zIndex: 1000 }, props), void 0));
1648
+ const CookieConsent = (props) => {
1649
+ const { storageName } = useCookieConsent();
1650
+ const Inner = () => {
1651
+ const { accepted } = useCookieConsent();
1652
+ return accepted ? null : (jsxRuntime.jsx(CookieConsentBody, Object.assign({ background: true, paper: true, position: "fixed", bottom: 0, maxWidth: "100vw", width: "100%", zIndex: 1000 }, props), void 0));
2141
1653
  };
2142
1654
  //if not inside a context, make a context
2143
1655
  if (!storageName) {
@@ -2146,96 +1658,104 @@ var CookieConsent = function (props) {
2146
1658
  return jsxRuntime.jsx(Inner, {}, void 0);
2147
1659
  };
2148
1660
 
2149
- var InvertableThemeContext = react.createContext({
1661
+ const InvertableThemeContext = react.createContext({
2150
1662
  options: {},
2151
1663
  });
2152
1664
 
2153
- var InvertableThemeProvider = function (_a) {
2154
- var _b, _c;
2155
- var options = _a.options, children = _a.children, dark = _a.dark, _d = _a.scoped, scoped = _d === void 0 ? false : _d, _e = _a.invert, invert = _e === void 0 ? false : _e, noResponsiveFonts = _a.noResponsiveFonts;
2156
- var contextInvertableTheme = react.useContext(InvertableThemeContext);
2157
- var clonedOptions = clone__default["default"]((_b = options !== null && options !== void 0 ? options : contextInvertableTheme.options) !== null && _b !== void 0 ? _b : {});
2158
- clonedOptions.palette = (_c = clonedOptions.palette) !== null && _c !== void 0 ? _c : {};
1665
+ const InvertableThemeProvider = ({ options, children, dark, scoped = false, invert = false, noResponsiveFonts, }) => {
1666
+ var _a, _b;
1667
+ const contextInvertableTheme = react.useContext(InvertableThemeContext);
1668
+ const clonedOptions = clone__default["default"]((_a = options !== null && options !== void 0 ? options : contextInvertableTheme.options) !== null && _a !== void 0 ? _a : {});
1669
+ clonedOptions.palette = (_b = clonedOptions.palette) !== null && _b !== void 0 ? _b : {};
2159
1670
  if (invert) {
2160
1671
  clonedOptions.palette.mode = clonedOptions.palette.mode === 'dark' ? 'light' : 'dark';
2161
1672
  }
2162
1673
  if (dark !== undefined) {
2163
1674
  clonedOptions.palette.mode = dark ? 'dark' : 'light';
2164
1675
  }
2165
- var theme = styles$1.createTheme(clonedOptions);
1676
+ let theme = styles$1.createTheme(clonedOptions);
2166
1677
  if (!noResponsiveFonts) {
2167
1678
  theme = material.responsiveFontSizes(theme);
2168
1679
  }
2169
- return scoped ? (jsxRuntime.jsx(material.ScopedCssBaseline, { children: jsxRuntime.jsx(InvertableThemeContext.Provider, __assign({ value: { options: clonedOptions } }, { children: jsxRuntime.jsx(material.ThemeProvider, __assign({ theme: theme }, { children: children }), void 0) }), void 0) }, void 0)) : (jsxRuntime.jsx(InvertableThemeContext.Provider, __assign({ value: { options: clonedOptions } }, { children: jsxRuntime.jsx(material.ThemeProvider, __assign({ theme: theme }, { children: children }), void 0) }), void 0));
1680
+ return scoped ? (jsxRuntime.jsx(material.ScopedCssBaseline, { children: jsxRuntime.jsx(InvertableThemeContext.Provider, Object.assign({ value: { options: clonedOptions } }, { children: jsxRuntime.jsx(material.ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0) }, void 0)) : (jsxRuntime.jsx(InvertableThemeContext.Provider, Object.assign({ value: { options: clonedOptions } }, { children: jsxRuntime.jsx(material.ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0));
1681
+ };
1682
+
1683
+ // The point of this component it to return to the top of the page on any router navigate
1684
+ const ScrollToTop = () => {
1685
+ const { pathname } = reactRouterDom.useLocation();
1686
+ react.useEffect(() => {
1687
+ window.scrollTo(0, 0);
1688
+ }, [pathname]);
1689
+ return null;
2170
1690
  };
2171
1691
 
2172
- var BasePage = function (_a) {
2173
- var disableGutters = _a.disableGutters, children = _a.children, beta = _a.beta, container = _a.container, hideFooter = _a.hideFooter, appFooter = _a.appFooter, appBar = _a.appBar, cookieConsent = _a.cookieConsent, filterBar = _a.filterBar, hideAppBar = _a.hideAppBar, hideFilterBar = _a.hideFilterBar, _b = _a.noindex, noindex = _b === void 0 ? false : _b, _c = _a.scrollToTopButton, scrollToTopButton = _c === void 0 ? false : _c, title = _a.title, props = __rest(_a, ["disableGutters", "children", "beta", "container", "hideFooter", "appFooter", "appBar", "cookieConsent", "filterBar", "hideAppBar", "hideFilterBar", "noindex", "scrollToTopButton", "title"]);
2174
- var theme = material.useTheme();
2175
- var scrollToTopAnchorId = 'scroll-to-top-anchor';
2176
- return (jsxRuntime.jsxs(FlexCol, __assign({ justifyContent: "flex-start", color: theme.palette.text.primary, alignItems: "stretch", width: "100%", maxWidth: "100vw", minHeight: "100vh" }, props, { children: [jsxRuntime.jsx(reactHelmet.Helmet, __assign({ title: title }, { children: noindex ? jsxRuntime.jsx("meta", { content: "noindex", name: "robots" }, void 0) : null }), void 0), scrollToTopButton ? jsxRuntime.jsx("div", { id: scrollToTopAnchorId }, void 0) : null, hideAppBar ? null : appBar, hideFilterBar ? null : filterBar, beta ? (jsxRuntime.jsx(FlexRow, __assign({ margin: 1, position: "absolute", top: 0, left: 0, bgcolor: "#cccccc88", paddingX: 1, style: { opacity: 0.5 } }, { children: jsxRuntime.jsx(material.Typography, __assign({ variant: "body2" }, { children: "Important: This page is a Beta page. It is possible that some information may not be correct." }), void 0) }), void 0)) : null, container ? (jsxRuntime.jsx(material.Container, __assign({ style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1 }, maxWidth: container, disableGutters: disableGutters }, { children: children }), void 0)) : (children), hideFooter ? null : jsxRuntime.jsx("footer", { children: appFooter }, void 0), cookieConsent !== null && cookieConsent !== void 0 ? cookieConsent : (jsxRuntime.jsx(material.ScopedCssBaseline, { children: jsxRuntime.jsx(InvertableThemeProvider, __assign({ invert: true }, { children: jsxRuntime.jsx(CookieConsent, { borderRadius: 0 }, void 0) }), void 0) }, void 0)), scrollToTopButton ? (jsxRuntime.jsx(ScrollToTopButton, __assign({ anchorId: scrollToTopAnchorId }, { children: jsxRuntime.jsx(material.Fab, __assign({ "aria-label": "scroll to top", color: "secondary", size: "small" }, { children: jsxRuntime.jsx(iconsMaterial.KeyboardArrowUp, {}, void 0) }), void 0) }), void 0)) : null] }), void 0));
1692
+ const BasePage = (_a) => {
1693
+ var { disableGutters, children, beta, container, hideFooter, appFooter, appBar, cookieConsent, filterBar, hideAppBar, hideFilterBar, noindex = false, scrollToTopButton = false, title } = _a, props = __rest(_a, ["disableGutters", "children", "beta", "container", "hideFooter", "appFooter", "appBar", "cookieConsent", "filterBar", "hideAppBar", "hideFilterBar", "noindex", "scrollToTopButton", "title"]);
1694
+ const theme = material.useTheme();
1695
+ const scrollToTopAnchorId = 'scroll-to-top-anchor';
1696
+ return (jsxRuntime.jsxs(FlexCol, Object.assign({ justifyContent: "flex-start", color: theme.palette.text.primary, alignItems: "stretch", width: "100%", maxWidth: "100vw", minHeight: "100vh" }, props, { children: [jsxRuntime.jsx(ScrollToTop, {}, void 0), jsxRuntime.jsx(reactHelmet.Helmet, Object.assign({ title: title }, { children: noindex ? jsxRuntime.jsx("meta", { content: "noindex", name: "robots" }, void 0) : null }), void 0), scrollToTopButton ? jsxRuntime.jsx("div", { id: scrollToTopAnchorId }, void 0) : null, hideAppBar ? null : appBar, hideFilterBar ? null : filterBar, beta ? (jsxRuntime.jsx(FlexRow, Object.assign({ margin: 1, position: "absolute", top: 0, left: 0, bgcolor: "#cccccc88", paddingX: 1, style: { opacity: 0.5 } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body2" }, { children: "Important: This page is a Beta page. It is possible that some information may not be correct." }), void 0) }), void 0)) : null, container ? (jsxRuntime.jsx(material.Container, Object.assign({ style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1 }, maxWidth: container, disableGutters: disableGutters }, { children: children }), void 0)) : (children), hideFooter ? null : jsxRuntime.jsx("footer", { children: appFooter }, void 0), cookieConsent !== null && cookieConsent !== void 0 ? cookieConsent : (jsxRuntime.jsx(material.ScopedCssBaseline, { children: jsxRuntime.jsx(InvertableThemeProvider, Object.assign({ invert: true }, { children: jsxRuntime.jsx(CookieConsent, { borderRadius: 0 }, void 0) }), void 0) }, void 0)), scrollToTopButton ? (jsxRuntime.jsx(ScrollToTopButton, Object.assign({ anchorId: scrollToTopAnchorId }, { children: jsxRuntime.jsx(material.Fab, Object.assign({ "aria-label": "scroll to top", color: "secondary", size: "small" }, { children: jsxRuntime.jsx(iconsMaterial.KeyboardArrowUp, {}, void 0) }), void 0) }), void 0)) : null] }), void 0));
2177
1697
  };
2178
1698
 
2179
- var getPartialPath = function (pathParts, index) {
2180
- var result = [];
2181
- for (var i = 0; i <= index; i++) {
2182
- result.push("".concat(pathParts[i], "/"));
1699
+ const getPartialPath = (pathParts, index) => {
1700
+ const result = [];
1701
+ for (let i = 0; i <= index; i++) {
1702
+ result.push(`${pathParts[i]}/`);
2183
1703
  }
2184
1704
  return result.join('');
2185
1705
  };
2186
- var BreadcrumbsEx = function (_a) {
1706
+ const BreadcrumbsEx = (_a) => {
2187
1707
  var _b;
2188
- var titles = _a.titles, _c = _a.path, path = _c === void 0 ? document.location.pathname : _c, _d = _a.separator, separator = _d === void 0 ? '|' : _d, logo = _a.logo, children = _a.children, props = __rest(_a, ["titles", "path", "separator", "logo", "children"]);
2189
- var pathParts = path.split('/');
1708
+ var { titles, path = document.location.pathname, separator = '|', logo, children } = _a, props = __rest(_a, ["titles", "path", "separator", "logo", "children"]);
1709
+ const pathParts = path.split('/');
2190
1710
  //if the url has a trailing '/', remove the last part
2191
1711
  if (((_b = pathParts[pathParts.length - 1]) === null || _b === void 0 ? void 0 : _b.length) === 0) {
2192
1712
  pathParts.pop();
2193
1713
  }
2194
- sdkJs.assertEx(pathParts.length - 1 === (titles === null || titles === void 0 ? void 0 : titles.length), "Path/Title length mismatch: ".concat(JSON.stringify(titles), " with ").concat(JSON.stringify(pathParts)));
2195
- return (jsxRuntime.jsxs(material.Breadcrumbs, __assign({ separator: separator }, props, { children: [pathParts.map(function (_pathPart, index) {
2196
- var path = getPartialPath(pathParts, index);
2197
- return (jsxRuntime.jsx(material.Link, __assign({ title: index > 0 ? titles === null || titles === void 0 ? void 0 : titles[index - 1] : 'COIN', color: index === pathParts.length - 1 ? 'textPrimary' : 'inherit', component: reactRouterDom.Link, to: path }, { children: index > 0 ? (titles === null || titles === void 0 ? void 0 : titles[index - 1]) : (jsxRuntime.jsx(FlexRow, { children: typeof logo === 'string' ? jsxRuntime.jsx("img", { src: logo }, void 0) : logo }, void 0)) }), path));
1714
+ sdkJs.assertEx(pathParts.length - 1 === (titles === null || titles === void 0 ? void 0 : titles.length), `Path/Title length mismatch: ${JSON.stringify(titles)} with ${JSON.stringify(pathParts)}`);
1715
+ return (jsxRuntime.jsxs(material.Breadcrumbs, Object.assign({ separator: separator }, props, { children: [pathParts.map((_pathPart, index) => {
1716
+ const path = getPartialPath(pathParts, index);
1717
+ return (jsxRuntime.jsx(material.Link, Object.assign({ title: index > 0 ? titles === null || titles === void 0 ? void 0 : titles[index - 1] : 'COIN', color: index === pathParts.length - 1 ? 'textPrimary' : 'inherit', component: reactRouterDom.Link, to: path }, { children: index > 0 ? (titles === null || titles === void 0 ? void 0 : titles[index - 1]) : (jsxRuntime.jsx(FlexRow, { children: typeof logo === 'string' ? jsxRuntime.jsx("img", { src: logo }, void 0) : logo }, void 0)) }), path));
2198
1718
  }), children] }), void 0));
2199
1719
  };
2200
1720
 
2201
- var toAxiosError = function (error) {
1721
+ const toAxiosError = (error) => {
2202
1722
  return error.isAxiosError ? error : undefined;
2203
1723
  };
2204
- var ErrorDialogOpen = function (_a) {
1724
+ const ErrorDialogOpen = (_a) => {
2205
1725
  var _b, _c;
2206
- var onAction = _a.onAction, _d = _a.title, title = _d === void 0 ? 'Oops. Something went wrong.' : _d, _e = _a.error, error = _e === void 0 ? Error('Unknown Error') : _e, props = __rest(_a, ["onAction", "title", "error"]);
2207
- var onCloseClicked = function () {
1726
+ var { onAction, title = 'Oops. Something went wrong.', error = Error('Unknown Error') } = _a, props = __rest(_a, ["onAction", "title", "error"]);
1727
+ const onCloseClicked = () => {
2208
1728
  onAction === null || onAction === void 0 ? void 0 : onAction(false);
2209
1729
  };
2210
- var onRetryClicked = function () {
1730
+ const onRetryClicked = () => {
2211
1731
  onAction === null || onAction === void 0 ? void 0 : onAction(true);
2212
1732
  };
2213
- var axiosError = toAxiosError(error);
2214
- var message = (_b = error.message) !== null && _b !== void 0 ? _b : error.toString();
2215
- return (jsxRuntime.jsxs(material.Dialog, __assign({}, props, { children: [jsxRuntime.jsx(material.DialogTitle, { children: title }, void 0), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(FlexRow, { children: jsxRuntime.jsx(material.Typography, __assign({ color: "error" }, { children: axiosError ? "".concat(message, " [").concat((_c = axiosError === null || axiosError === void 0 ? void 0 : axiosError.code) !== null && _c !== void 0 ? _c : 'Connection Failure', "]") : "".concat(message) }), void 0) }, void 0) }, void 0), jsxRuntime.jsx(material.DialogActions, { children: jsxRuntime.jsxs(FlexRow, __assign({ justifyContent: "space-between", width: "100%", minWidth: "300px" }, { children: [jsxRuntime.jsx(ButtonEx, __assign({ onClick: onCloseClicked, variant: "text" }, { children: "Close" }), void 0), jsxRuntime.jsx(ButtonEx, __assign({ onClick: onRetryClicked, variant: "text" }, { children: "Retry" }), void 0)] }), void 0) }, void 0)] }), void 0));
1733
+ const axiosError = toAxiosError(error);
1734
+ const message = (_b = error.message) !== null && _b !== void 0 ? _b : error.toString();
1735
+ return (jsxRuntime.jsxs(material.Dialog, Object.assign({}, props, { children: [jsxRuntime.jsx(material.DialogTitle, { children: title }, void 0), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(FlexRow, { children: jsxRuntime.jsx(material.Typography, Object.assign({ color: "error" }, { children: axiosError ? `${message} [${(_c = axiosError === null || axiosError === void 0 ? void 0 : axiosError.code) !== null && _c !== void 0 ? _c : 'Connection Failure'}]` : `${message}` }), void 0) }, void 0) }, void 0), jsxRuntime.jsx(material.DialogActions, { children: jsxRuntime.jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%", minWidth: "300px" }, { children: [jsxRuntime.jsx(ButtonEx, Object.assign({ onClick: onCloseClicked, variant: "text" }, { children: "Close" }), void 0), jsxRuntime.jsx(ButtonEx, Object.assign({ onClick: onRetryClicked, variant: "text" }, { children: "Retry" }), void 0)] }), void 0) }, void 0)] }), void 0));
2216
1736
  };
2217
- var ErrorDialog = function (_a) {
2218
- var open = _a.open, error = _a.error, props = __rest(_a, ["open", "error"]);
1737
+ const ErrorDialog = (_a) => {
1738
+ var { open, error } = _a, props = __rest(_a, ["open", "error"]);
2219
1739
  if (error) {
2220
- return jsxRuntime.jsx(ErrorDialogOpen, __assign({ open: !!error || open, error: error }, props), void 0);
1740
+ return jsxRuntime.jsx(ErrorDialogOpen, Object.assign({ open: !!error || open, error: error }, props), void 0);
2221
1741
  }
2222
1742
  else {
2223
1743
  return null;
2224
1744
  }
2225
1745
  };
2226
1746
 
2227
- var MessageDialog = function (_a) {
2228
- var onOk = _a.onOk, onCancel = _a.onCancel, children = _a.children, title = _a.title, props = __rest(_a, ["onOk", "onCancel", "children", "title"]);
2229
- return (jsxRuntime.jsxs(material.Dialog, __assign({}, props, { children: [jsxRuntime.jsx(material.DialogTitle, { children: title }, void 0), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(FlexCol, __assign({ alignItems: "stretch" }, { children: children }), void 0) }, void 0), jsxRuntime.jsx(material.DialogActions, { children: jsxRuntime.jsxs(FlexRow, __assign({ justifyContent: "space-between", width: "100%" }, { children: [jsxRuntime.jsx(material.Button, __assign({ onClick: onCancel, variant: "text" }, { children: "Cancel" }), void 0), jsxRuntime.jsx(material.Button, __assign({ onClick: onOk, variant: "text" }, { children: "Ok" }), void 0)] }), void 0) }, void 0)] }), void 0));
1747
+ const MessageDialog = (_a) => {
1748
+ var { onOk, onCancel, children, title } = _a, props = __rest(_a, ["onOk", "onCancel", "children", "title"]);
1749
+ return (jsxRuntime.jsxs(material.Dialog, Object.assign({}, props, { children: [jsxRuntime.jsx(material.DialogTitle, { children: title }, void 0), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(FlexCol, Object.assign({ alignItems: "stretch" }, { children: children }), void 0) }, void 0), jsxRuntime.jsx(material.DialogActions, { children: jsxRuntime.jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%" }, { children: [jsxRuntime.jsx(material.Button, Object.assign({ onClick: onCancel, variant: "text" }, { children: "Cancel" }), void 0), jsxRuntime.jsx(material.Button, Object.assign({ onClick: onOk, variant: "text" }, { children: "Ok" }), void 0)] }), void 0) }, void 0)] }), void 0));
2230
1750
  };
2231
1751
 
2232
- var useBreakpoint = function () {
2233
- var theme = material.useTheme();
2234
- var xs = material.useMediaQuery(theme.breakpoints.only('xs'));
2235
- var sm = material.useMediaQuery(theme.breakpoints.only('sm'));
2236
- var md = material.useMediaQuery(theme.breakpoints.only('md'));
2237
- var lg = material.useMediaQuery(theme.breakpoints.only('lg'));
2238
- var xl = material.useMediaQuery(theme.breakpoints.only('xl'));
1752
+ const useBreakpoint = () => {
1753
+ const theme = material.useTheme();
1754
+ const xs = material.useMediaQuery(theme.breakpoints.only('xs'));
1755
+ const sm = material.useMediaQuery(theme.breakpoints.only('sm'));
1756
+ const md = material.useMediaQuery(theme.breakpoints.only('md'));
1757
+ const lg = material.useMediaQuery(theme.breakpoints.only('lg'));
1758
+ const xl = material.useMediaQuery(theme.breakpoints.only('xl'));
2239
1759
  if (xs) {
2240
1760
  return 'xs';
2241
1761
  }
@@ -2253,18 +1773,18 @@ var useBreakpoint = function () {
2253
1773
  }
2254
1774
  };
2255
1775
 
2256
- var useLocalStorage = function (key, defaultValue) {
2257
- var _a = __read(react.useState(function () {
1776
+ const useLocalStorage = (key, defaultValue) => {
1777
+ const [storedValue, setStoredValue] = react.useState(() => {
2258
1778
  try {
2259
- var item = getLocalStorageObject(key);
1779
+ const item = getLocalStorageObject(key);
2260
1780
  return item || defaultValue;
2261
1781
  }
2262
1782
  catch (ex) {
2263
1783
  //Error is already logged
2264
1784
  return defaultValue;
2265
1785
  }
2266
- }), 2), storedValue = _a[0], setStoredValue = _a[1];
2267
- var setValue = function (value) {
1786
+ });
1787
+ const setValue = (value) => {
2268
1788
  console.log('setValue', value);
2269
1789
  setStoredValue(value);
2270
1790
  setLocalStorageObject(key, value);
@@ -2273,30 +1793,30 @@ var useLocalStorage = function (key, defaultValue) {
2273
1793
  return [storedValue, setValue];
2274
1794
  };
2275
1795
 
2276
- var useMounted = function () {
2277
- var _a = __read(react.useState(true), 2), mounted = _a[0], setMounted = _a[1];
2278
- react.useEffect(function () {
1796
+ const useMounted = () => {
1797
+ const [mounted, setMounted] = react.useState(true);
1798
+ react.useEffect(() => {
2279
1799
  setMounted(true);
2280
- return function () {
1800
+ return () => {
2281
1801
  // eslint-disable-next-line react-hooks/exhaustive-deps
2282
1802
  setMounted(false);
2283
1803
  };
2284
1804
  }, []);
2285
- return function () {
1805
+ return () => {
2286
1806
  return mounted;
2287
1807
  };
2288
1808
  };
2289
1809
 
2290
- var useNavigateToEthAddress = function () {
2291
- var navigate = reactRouterDom.useNavigate();
2292
- var navigateToEthAddress = function (address, event, page, to, toOptions, toEtherScan) {
1810
+ const useNavigateToEthAddress = () => {
1811
+ const navigate = reactRouterDom.useNavigate();
1812
+ const navigateToEthAddress = (address, event, page, to, toOptions, toEtherScan) => {
2293
1813
  var _a;
2294
- var openInEtherScan = toEtherScan || (!to && !page);
1814
+ const openInEtherScan = toEtherScan || (!to && !page);
2295
1815
  if (openInEtherScan) {
2296
- window.open("https://etherscan.io/address/".concat(address.toString()), '_blank');
1816
+ window.open(`https://etherscan.io/address/${address.toString()}`, '_blank');
2297
1817
  }
2298
1818
  else {
2299
- var path = (_a = to === null || to === void 0 ? void 0 : to.toString()) !== null && _a !== void 0 ? _a : "/".concat(page, "/").concat(address.toString());
1819
+ const path = (_a = to === null || to === void 0 ? void 0 : to.toString()) !== null && _a !== void 0 ? _a : `/${page}/${address.toString()}`;
2300
1820
  if (event.metaKey || toEtherScan) {
2301
1821
  window.open(path, '_blank');
2302
1822
  }
@@ -2305,63 +1825,50 @@ var useNavigateToEthAddress = function () {
2305
1825
  }
2306
1826
  }
2307
1827
  };
2308
- return { navigateToEthAddress: navigateToEthAddress };
1828
+ return { navigateToEthAddress };
2309
1829
  };
2310
1830
 
2311
- var useSpacing = function (value) {
2312
- var theme = material.useTheme();
1831
+ const useSpacing = (value) => {
1832
+ const theme = material.useTheme();
2313
1833
  return theme.spacing(typeof value === 'string' ? parseInt(value) : value);
2314
1834
  };
2315
1835
 
2316
- var useUserEvents = function () {
2317
- var userEvents = react.useContext(UserEventsContext).userEvents;
1836
+ const useUserEvents = () => {
1837
+ const { userEvents } = react.useContext(UserEventsContext);
2318
1838
  if (!userEvents) {
2319
1839
  console.error('useUserEvents must be called inside a UserEventsContext');
2320
1840
  }
2321
1841
  return userEvents;
2322
1842
  };
2323
1843
 
2324
- var supportsWebP = undefined;
2325
- var useWebP = function (webp, alt) {
2326
- var _a = __read(react.useState(supportsWebP === true ? webp : supportsWebP === false ? alt : undefined), 2), img = _a[0], setImg = _a[1];
2327
- useAsyncEffect(function (mounted) { return __awaiter(void 0, void 0, void 0, function () {
2328
- return __generator(this, function (_a) {
2329
- switch (_a.label) {
2330
- case 0:
2331
- if (!(supportsWebP === undefined)) return [3 /*break*/, 2];
2332
- return [4 /*yield*/, getSupportsWebP()];
2333
- case 1:
2334
- supportsWebP = _a.sent();
2335
- if (mounted()) {
2336
- setImg(supportsWebP ? webp : alt);
2337
- }
2338
- _a.label = 2;
2339
- case 2: return [2 /*return*/];
1844
+ let supportsWebP = undefined;
1845
+ const useWebP = (webp, alt) => {
1846
+ const [img, setImg] = react.useState(supportsWebP === true ? webp : supportsWebP === false ? alt : undefined);
1847
+ useAsyncEffect((mounted) => __awaiter(void 0, void 0, void 0, function* () {
1848
+ if (supportsWebP === undefined) {
1849
+ supportsWebP = yield getSupportsWebP();
1850
+ if (mounted()) {
1851
+ setImg(supportsWebP ? webp : alt);
2340
1852
  }
2341
- });
2342
- }); }, [supportsWebP]);
1853
+ }
1854
+ }), [supportsWebP]);
2343
1855
  return img;
2344
1856
  };
2345
- var getSupportsWebP = function () { return __awaiter(void 0, void 0, void 0, function () {
2346
- return __generator(this, function (_a) {
2347
- switch (_a.label) {
2348
- case 0: return [4 /*yield*/, new Promise(function (resolve) {
2349
- var image = new Image();
2350
- image.onerror = function () { return resolve(false); };
2351
- image.onload = function () { return resolve(image.width === 1); };
2352
- image.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=';
2353
- }).catch(function () { return false; })];
2354
- case 1: return [2 /*return*/, _a.sent()];
2355
- }
2356
- });
2357
- }); };
1857
+ const getSupportsWebP = () => __awaiter(void 0, void 0, void 0, function* () {
1858
+ return yield new Promise((resolve) => {
1859
+ const image = new Image();
1860
+ image.onerror = () => resolve(false);
1861
+ image.onload = () => resolve(image.width === 1);
1862
+ image.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=';
1863
+ }).catch(() => false);
1864
+ });
2358
1865
 
2359
1866
  function useWindowSize() {
2360
- var _a = __read(react.useState({
1867
+ const [windowSize, setWindowSize] = react.useState({
2361
1868
  height: undefined,
2362
1869
  width: undefined,
2363
- }), 2), windowSize = _a[0], setWindowSize = _a[1];
2364
- react.useEffect(function () {
1870
+ });
1871
+ react.useEffect(() => {
2365
1872
  function handleResize() {
2366
1873
  setWindowSize({
2367
1874
  height: window.innerHeight,
@@ -2370,25 +1877,25 @@ function useWindowSize() {
2370
1877
  }
2371
1878
  window.addEventListener('resize', handleResize);
2372
1879
  handleResize();
2373
- return function () { return window.removeEventListener('resize', handleResize); };
1880
+ return () => window.removeEventListener('resize', handleResize);
2374
1881
  }, []);
2375
1882
  return windowSize;
2376
1883
  }
2377
1884
 
2378
- var EthAccount = function (_a) {
2379
- var address = _a.address, _b = _a.icon, icon = _b === void 0 ? false : _b, _c = _a.iconSize, iconSize = _c === void 0 ? 16 : _c, _d = _a.iconOnly, iconOnly = _d === void 0 ? false : _d, _e = _a.addressLength, addressLength = _e === void 0 ? 'auto' : _e, _f = _a.fontFamily, fontFamily = _f === void 0 ? '"Source Code Pro",monospace' : _f, toEtherScan = _a.toEtherScan, onButtonClick = _a.onButtonClick, props = __rest(_a, ["address", "icon", "iconSize", "iconOnly", "addressLength", "fontFamily", "toEtherScan", "onButtonClick"]);
2380
- var localAddress = react.useContext(EthersContext).localAddress;
2381
- var theme = material.useTheme();
2382
- var large = material.useMediaQuery(theme.breakpoints.up('md'));
2383
- var isLocalAddress = address ? (localAddress === null || localAddress === void 0 ? void 0 : localAddress.toString()) === address.toString() : false;
2384
- var onClickLocal = function (event) {
1885
+ const EthAccount = (_a) => {
1886
+ var { address, icon = false, iconSize = 16, iconOnly = false, addressLength = 'auto', fontFamily = '"Source Code Pro",monospace', toEtherScan, onButtonClick } = _a, props = __rest(_a, ["address", "icon", "iconSize", "iconOnly", "addressLength", "fontFamily", "toEtherScan", "onButtonClick"]);
1887
+ const { localAddress } = react.useContext(EthersContext);
1888
+ const theme = material.useTheme();
1889
+ const large = material.useMediaQuery(theme.breakpoints.up('md'));
1890
+ const isLocalAddress = address ? (localAddress === null || localAddress === void 0 ? void 0 : localAddress.toString()) === address.toString() : false;
1891
+ const onClickLocal = (event) => {
2385
1892
  onButtonClick === null || onButtonClick === void 0 ? void 0 : onButtonClick(event);
2386
1893
  if (toEtherScan && address) {
2387
- window.open("https://etherscan.io/address/".concat(address.toString()), '_blank');
1894
+ window.open(`https://etherscan.io/address/${address.toString()}`, '_blank');
2388
1895
  }
2389
1896
  };
2390
- var addressToDisplay = sdkJs.assertEx(address !== null && address !== void 0 ? address : sdkJs.EthAddress.fromString('0x00'), 'Bad Eth Address');
2391
- var testToDisplay = addressLength === 'long'
1897
+ const addressToDisplay = sdkJs.assertEx(address !== null && address !== void 0 ? address : sdkJs.EthAddress.fromString('0x00'), 'Bad Eth Address');
1898
+ const testToDisplay = addressLength === 'long'
2392
1899
  ? addressToDisplay.toString()
2393
1900
  : addressLength === 'short'
2394
1901
  ? addressToDisplay.toShortString()
@@ -2396,36 +1903,36 @@ var EthAccount = function (_a) {
2396
1903
  ? addressToDisplay.toString()
2397
1904
  : addressToDisplay.toShortString();
2398
1905
  // Note: We use the all zero address for spacing in case it is
2399
- return (jsxRuntime.jsx(ButtonEx, __assign({ onClick: onClickLocal, title: "0x".concat(address === null || address === void 0 ? void 0 : address.toHex()) }, props, { children: jsxRuntime.jsxs(FlexGrowRow, __assign({ justifyContent: "space-between", alignItems: "center" }, { children: [icon && address ? jsxRuntime.jsx(Identicon, { size: iconSize, value: address === null || address === void 0 ? void 0 : address.toHex() }, void 0) : null, iconOnly ? null : (jsxRuntime.jsxs(FlexRow, { children: [jsxRuntime.jsx(material.Typography, __assign({ marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily, visibility: address ? 'inherit' : 'hidden' }, { children: testToDisplay }), void 0), address ? null : (jsxRuntime.jsx(material.Typography, __assign({ position: "absolute", marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily }, { children: "-- --" }), void 0))] }, void 0)), isLocalAddress ? jsxRuntime.jsx(FlexRow, __assign({ marginLeft: 0.5 }, { children: "(You)" }), void 0) : null] }), void 0) }), void 0));
1906
+ return (jsxRuntime.jsx(ButtonEx, Object.assign({ onClick: onClickLocal, title: `0x${address === null || address === void 0 ? void 0 : address.toHex()}` }, props, { children: jsxRuntime.jsxs(FlexGrowRow, Object.assign({ justifyContent: "space-between", alignItems: "center" }, { children: [icon && address ? jsxRuntime.jsx(Identicon, { size: iconSize, value: address === null || address === void 0 ? void 0 : address.toHex() }, void 0) : null, iconOnly ? null : (jsxRuntime.jsxs(FlexRow, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily, visibility: address ? 'inherit' : 'hidden' }, { children: testToDisplay }), void 0), address ? null : (jsxRuntime.jsx(material.Typography, Object.assign({ position: "absolute", marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily }, { children: "-- --" }), void 0))] }, void 0)), isLocalAddress ? jsxRuntime.jsx(FlexRow, Object.assign({ marginLeft: 0.5 }, { children: "(You)" }), void 0) : null] }), void 0) }), void 0));
2400
1907
  };
2401
1908
 
2402
- var Experiment = function (props) {
2403
- var children = props.children;
1909
+ const Experiment = (props) => {
1910
+ const { children } = props;
2404
1911
  return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children }, void 0);
2405
1912
  };
2406
1913
 
2407
- var OutcomesLocalStorageKey = 'outcomes';
2408
- var ExperimentsLocalStorageKey = 'experiments';
1914
+ const OutcomesLocalStorageKey = 'outcomes';
1915
+ const ExperimentsLocalStorageKey = 'experiments';
2409
1916
 
2410
- var defaultLocalStorageKey = 'testData';
2411
- var experimentsTestData = {};
2412
- var outcomes = {}; //prevent multi-outcome
2413
- var saveOutcomes = function () {
1917
+ const defaultLocalStorageKey = 'testData';
1918
+ const experimentsTestData = {};
1919
+ let outcomes = {}; //prevent multi-outcome
1920
+ const saveOutcomes = () => {
2414
1921
  setLocalStorageObject(OutcomesLocalStorageKey, outcomes);
2415
1922
  };
2416
- var loadOutcomes = function () {
1923
+ const loadOutcomes = () => {
2417
1924
  outcomes = getLocalStorageObject(OutcomesLocalStorageKey);
2418
1925
  };
2419
- var mergeData = function (data, log) {
2420
- var dataArray = [];
2421
- for (var key in data) {
2422
- dataArray.push("".concat(key, "-").concat(data[key]));
1926
+ const mergeData = (data, log) => {
1927
+ const dataArray = [];
1928
+ for (const key in data) {
1929
+ dataArray.push(`${key}-${data[key]}`);
2423
1930
  }
2424
1931
  log === null || log === void 0 ? void 0 : log.info('MergeData', dataArray.join('|'));
2425
1932
  return dataArray.join('|');
2426
1933
  };
2427
- var missingKeyError = new Error('Experiment Elements must have Keys');
2428
- var makeChildrenArray = function (children) {
1934
+ const missingKeyError = new Error('Experiment Elements must have Keys');
1935
+ const makeChildrenArray = (children) => {
2429
1936
  if (Array.isArray(children)) {
2430
1937
  return children;
2431
1938
  }
@@ -2433,36 +1940,25 @@ var makeChildrenArray = function (children) {
2433
1940
  return [children];
2434
1941
  }
2435
1942
  };
2436
- var buildLocalStorageKey = function (localStorageProp) {
1943
+ const buildLocalStorageKey = (localStorageProp) => {
2437
1944
  return localStorageProp === true
2438
1945
  ? defaultLocalStorageKey
2439
1946
  : typeof localStorageProp === 'string'
2440
1947
  ? localStorageProp !== null && localStorageProp !== void 0 ? localStorageProp : defaultLocalStorageKey
2441
1948
  : '';
2442
1949
  };
2443
- var calcTotalWeight = function (childList) {
2444
- var e_1, _a;
2445
- var totalWeight = 0;
2446
- try {
2447
- for (var childList_1 = __values(childList), childList_1_1 = childList_1.next(); !childList_1_1.done; childList_1_1 = childList_1.next()) {
2448
- var child = childList_1_1.value;
2449
- totalWeight += child.props.weight;
2450
- }
2451
- }
2452
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2453
- finally {
2454
- try {
2455
- if (childList_1_1 && !childList_1_1.done && (_a = childList_1.return)) _a.call(childList_1);
2456
- }
2457
- finally { if (e_1) throw e_1.error; }
1950
+ const calcTotalWeight = (childList) => {
1951
+ let totalWeight = 0;
1952
+ for (const child of childList) {
1953
+ totalWeight += child.props.weight;
2458
1954
  }
2459
1955
  return totalWeight;
2460
1956
  };
2461
- var saveExperimentDebugRanges = function (name, totalWeight, childList) {
2462
- var experiments = getLocalStorageObject(ExperimentsLocalStorageKey) || {};
1957
+ const saveExperimentDebugRanges = (name, totalWeight, childList) => {
1958
+ const experiments = getLocalStorageObject(ExperimentsLocalStorageKey) || {};
2463
1959
  experiments[name] = {
2464
- totalWeight: totalWeight,
2465
- variants: childList.map(function (child) {
1960
+ totalWeight,
1961
+ variants: childList.map((child) => {
2466
1962
  var _a;
2467
1963
  return ({
2468
1964
  name: (_a = child.key) === null || _a === void 0 ? void 0 : _a.toString(),
@@ -2472,109 +1968,114 @@ var saveExperimentDebugRanges = function (name, totalWeight, childList) {
2472
1968
  };
2473
1969
  setLocalStorageObject(ExperimentsLocalStorageKey, experiments);
2474
1970
  };
2475
- var Experiments = function (props) {
2476
- var e_2, _a;
2477
- var _b, _c;
2478
- var name = props.name, children = props.children, _d = props.localStorageProp, localStorageProp = _d === void 0 ? true : _d;
2479
- var userEvents = useUserEvents();
1971
+ const Experiments = (props) => {
1972
+ var _a, _b;
1973
+ const { name, children, localStorageProp = true } = props;
1974
+ const userEvents = useUserEvents();
2480
1975
  loadOutcomes();
2481
- var localStorageKey = buildLocalStorageKey(localStorageProp);
2482
- var childList = makeChildrenArray(children);
2483
- var totalWeight = calcTotalWeight(childList);
1976
+ const localStorageKey = buildLocalStorageKey(localStorageProp);
1977
+ const childList = makeChildrenArray(children);
1978
+ const totalWeight = calcTotalWeight(childList);
2484
1979
  saveExperimentDebugRanges(name, totalWeight, childList);
2485
- var firstTime = outcomes[name] === undefined;
2486
- var targetWeight = (_b = outcomes[name]) !== null && _b !== void 0 ? _b : Math.random() * totalWeight;
1980
+ const firstTime = outcomes[name] === undefined;
1981
+ let targetWeight = (_a = outcomes[name]) !== null && _a !== void 0 ? _a : Math.random() * totalWeight;
2487
1982
  outcomes[name] = targetWeight;
2488
1983
  saveOutcomes();
2489
- try {
2490
- for (var childList_2 = __values(childList), childList_2_1 = childList_2.next(); !childList_2_1.done; childList_2_1 = childList_2.next()) {
2491
- var child = childList_2_1.value;
2492
- targetWeight -= child.props.weight;
2493
- if (targetWeight > 0)
2494
- continue;
2495
- if (!child.key) {
2496
- throw missingKeyError;
1984
+ for (const child of childList) {
1985
+ targetWeight -= child.props.weight;
1986
+ if (targetWeight > 0)
1987
+ continue;
1988
+ if (!child.key) {
1989
+ throw missingKeyError;
1990
+ }
1991
+ experimentsTestData[name] = (_b = child.key) === null || _b === void 0 ? void 0 : _b.toString();
1992
+ if (firstTime) {
1993
+ if (localStorageProp !== false) {
1994
+ localStorage.setItem(localStorageKey, mergeData(experimentsTestData));
2497
1995
  }
2498
- experimentsTestData[name] = (_c = child.key) === null || _c === void 0 ? void 0 : _c.toString();
2499
- if (firstTime) {
2500
- if (localStorageProp !== false) {
2501
- localStorage.setItem(localStorageKey, mergeData(experimentsTestData));
2502
- }
2503
- if (userEvents) {
2504
- sdkJs.forget(userEvents.testStarted({ name: name, variation: child.key }));
2505
- }
1996
+ if (userEvents) {
1997
+ sdkJs.forget(userEvents.testStarted({ name, variation: child.key }));
2506
1998
  }
2507
- return child;
2508
1999
  }
2509
- }
2510
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2511
- finally {
2512
- try {
2513
- if (childList_2_1 && !childList_2_1.done && (_a = childList_2.return)) _a.call(childList_2);
2514
- }
2515
- finally { if (e_2) throw e_2.error; }
2000
+ return child;
2516
2001
  }
2517
2002
  throw new Error('Experiment Choice Failed');
2518
2003
  };
2519
2004
 
2520
- var ExperimentsDebugger = function (_a) {
2005
+ const ExperimentsDebugger = (_a) => {
2521
2006
  var props = __rest(_a, []);
2522
- var _b = __read(useLocalStorage(ExperimentsLocalStorageKey, {}), 1), experiments = _b[0];
2523
- var _c = __read(useLocalStorage(OutcomesLocalStorageKey, {}), 2), outcomes = _c[0], setOutcomes = _c[1];
2524
- var sumUpVariants = function (items) { return items.reduce(function (acc, curr) { return acc + curr.weight; }, 0); };
2525
- var experimentEntries = Object.entries(experiments);
2007
+ const [experiments] = useLocalStorage(ExperimentsLocalStorageKey, {});
2008
+ const [outcomes, setOutcomes] = useLocalStorage(OutcomesLocalStorageKey, {});
2009
+ const sumUpVariants = (items) => items.reduce((acc, curr) => acc + curr.weight, 0);
2010
+ const experimentEntries = Object.entries(experiments);
2526
2011
  if (!experiments || !experimentEntries.length) {
2527
- return (jsxRuntime.jsxs(FlexCol, __assign({ alignItems: "stretch" }, props, { children: [jsxRuntime.jsx(material.Typography, __assign({ variant: "subtitle1" }, { children: "No Experiments loaded" }), void 0), jsxRuntime.jsx(material.Typography, __assign({ variant: "subtitle2" }, { children: "Visit a page with an experiment to load the data" }), void 0)] }), void 0));
2528
- }
2529
- return (jsxRuntime.jsx(FlexCol, __assign({ alignItems: "stretch" }, props, { children: Object.entries(experiments).map(function (data) {
2530
- var _a = __read(data, 2), name = _a[0], experiment = _a[1];
2531
- var outcome = (outcomes[name] || 0);
2532
- var marks = __spreadArray([
2533
- { label: "".concat(experiment.variants[0].name, " | ").concat(experiment.variants[0].weight), value: 0 }
2534
- ], __read(experiment.variants.map(function (_a, index) {
2535
- var weight = _a.weight;
2536
- return ({
2537
- label: index === experiment.variants.length - 1 ? 'End' : "".concat(experiment.variants[index + 1].name, " | ").concat(weight),
2012
+ return (jsxRuntime.jsxs(FlexCol, Object.assign({ alignItems: "stretch" }, props, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ variant: "subtitle1" }, { children: "No Experiments loaded" }), void 0), jsxRuntime.jsx(material.Typography, Object.assign({ variant: "subtitle2" }, { children: "Visit a page with an experiment to load the data" }), void 0)] }), void 0));
2013
+ }
2014
+ return (jsxRuntime.jsx(FlexCol, Object.assign({ alignItems: "stretch" }, props, { children: Object.entries(experiments).map((data) => {
2015
+ const [name, experiment] = data;
2016
+ const outcome = (outcomes[name] || 0);
2017
+ const marks = [
2018
+ { label: `${experiment.variants[0].name} | ${experiment.variants[0].weight}`, value: 0 },
2019
+ ...experiment.variants.map(({ weight }, index) => ({
2020
+ label: index === experiment.variants.length - 1 ? 'End' : `${experiment.variants[index + 1].name} | ${weight}`,
2538
2021
  value: index === 0 ? weight : sumUpVariants(experiment.variants.slice(0, index + 1)),
2539
- });
2540
- })), false);
2541
- return (jsxRuntime.jsxs(FlexCol, __assign({ alignItems: "stretch", paddingX: 4, marginBottom: 4 }, props, { children: [jsxRuntime.jsxs(FlexRow, { children: [name, ":\u00A0", outcome] }, void 0), jsxRuntime.jsx(FlexRow, { children: jsxRuntime.jsx(material.Slider, { "aria-label": "Experiment ".concat(name), defaultValue: outcome, value: outcome, marks: marks, onChange: function (e, value) {
2542
- var truncated = Number((Array.isArray(value) ? value[0] : value).toFixed(2));
2022
+ })),
2023
+ ];
2024
+ return (jsxRuntime.jsxs(FlexCol, Object.assign({ alignItems: "stretch", paddingX: 4, marginBottom: 4 }, props, { children: [jsxRuntime.jsxs(FlexRow, { children: [name, ":\u00A0", outcome] }, void 0), jsxRuntime.jsx(FlexRow, { children: jsxRuntime.jsx(material.Slider, { "aria-label": `Experiment ${name}`, defaultValue: outcome, value: outcome, marks: marks, onChange: (e, value) => {
2025
+ const truncated = Number((Array.isArray(value) ? value[0] : value).toFixed(2));
2543
2026
  outcomes[name] = truncated;
2544
2027
  // Spread operator triggers rerender
2545
- setOutcomes(__assign({}, outcomes));
2546
- } }, void 0) }, void 0)] }), "experiment-".concat(name)));
2028
+ setOutcomes(Object.assign({}, outcomes));
2029
+ } }, void 0) }, void 0)] }), `experiment-${name}`));
2547
2030
  }) }), void 0));
2548
2031
  };
2549
2032
 
2550
- var LinkToEx = function (_a) {
2551
- var to = _a.to, props = __rest(_a, ["to"]);
2552
- return jsxRuntime.jsx(material.Link, __assign({ component: reactRouterDom.Link, to: to }, props), void 0);
2033
+ const LinkToEx = (_a) => {
2034
+ var { to } = _a, props = __rest(_a, ["to"]);
2035
+ return jsxRuntime.jsx(material.Link, Object.assign({ component: reactRouterDom.Link, to: to }, props), void 0);
2553
2036
  };
2554
2037
 
2555
- var NumberStatus = function (_a) {
2038
+ const NumberStatus = (_a) => {
2556
2039
  var _b, _c;
2557
- var error = _a.error, _d = _a.format, format = _d === void 0 ? '0[.]0a' : _d, _e = _a.color, color = _e === void 0 ? 'primary' : _e, title = _a.title, value = _a.value, size = _a.size, fontSize = _a.fontSize, _f = _a.rounded, rounded = _f === void 0 ? false : _f, _g = _a.autoWidth, autoWidth = _g === void 0 ? false : _g, style = _a.style, props = __rest(_a, ["error", "format", "color", "title", "value", "size", "fontSize", "rounded", "autoWidth", "style"]);
2558
- var theme = material.useTheme();
2559
- var palette = color === 'inherit' ? undefined : theme.palette[color];
2560
- var bgColorTop = (_b = palette === null || palette === void 0 ? void 0 : palette.dark) !== null && _b !== void 0 ? _b : theme.palette.background.paper;
2561
- var bgColorBottom = (_c = palette === null || palette === void 0 ? void 0 : palette.main) !== null && _c !== void 0 ? _c : theme.palette.background.default;
2562
- var sizePixels = size === 'large' ? 96 : size === 'small' ? 64 : 80;
2563
- var calcFontSize = fontSize !== null && fontSize !== void 0 ? fontSize : sizePixels * 0.2;
2564
- return (jsxRuntime.jsx(ButtonEx, __assign({ size: size, padding: 0, style: __assign({ borderRadius: rounded ? theme.shape.borderRadius : 0, overflow: rounded ? 'hidden' : undefined }, style) }, props, { children: jsxRuntime.jsxs(FlexCol, __assign({ alignItems: "stretch", height: sizePixels, width: autoWidth ? '100%' : sizePixels, busy: value === undefined && !error }, { children: [jsxRuntime.jsx(FlexGrowRow, __assign({ bgcolor: bgColorTop, color: theme.palette.getContrastText(bgColorTop), fontSize: calcFontSize, fontFamily: "Source Code Pro,monospace", alignItems: "center", height: sizePixels * 0.75 }, { children: numeral__default["default"](value).format(format) }), void 0), jsxRuntime.jsx(FlexGrowRow, __assign({ bgcolor: bgColorBottom, borderTop: "1px", color: theme.palette.getContrastText(bgColorBottom), fontSize: sizePixels * 0.12, fontFamily: theme.typography.fontFamily, height: sizePixels * 0.25 }, { children: title }), void 0)] }), void 0) }), void 0));
2040
+ var { error, format = '0[.]0a', color = 'primary', title, value, size, fontSize, rounded = false, autoWidth = false, style } = _a, props = __rest(_a, ["error", "format", "color", "title", "value", "size", "fontSize", "rounded", "autoWidth", "style"]);
2041
+ const theme = material.useTheme();
2042
+ const palette = color === 'inherit' ? undefined : theme.palette[color];
2043
+ const bgColorTop = (_b = palette === null || palette === void 0 ? void 0 : palette.dark) !== null && _b !== void 0 ? _b : theme.palette.background.paper;
2044
+ const bgColorBottom = (_c = palette === null || palette === void 0 ? void 0 : palette.main) !== null && _c !== void 0 ? _c : theme.palette.background.default;
2045
+ const sizePixels = size === 'large' ? 96 : size === 'small' ? 64 : 80;
2046
+ const calcFontSize = fontSize !== null && fontSize !== void 0 ? fontSize : sizePixels * 0.2;
2047
+ return (jsxRuntime.jsx(ButtonEx, Object.assign({ size: size, padding: 0, style: Object.assign({ borderRadius: rounded ? theme.shape.borderRadius : 0, overflow: rounded ? 'hidden' : undefined }, style) }, props, { children: jsxRuntime.jsxs(FlexCol, Object.assign({ alignItems: "stretch", height: sizePixels, width: autoWidth ? '100%' : sizePixels, busy: value === undefined && !error }, { children: [jsxRuntime.jsx(FlexGrowRow, Object.assign({ bgcolor: bgColorTop, color: theme.palette.getContrastText(bgColorTop), fontSize: calcFontSize, fontFamily: "Source Code Pro,monospace", alignItems: "center", height: sizePixels * 0.75 }, { children: numeral__default["default"](value).format(format) }), void 0), jsxRuntime.jsx(FlexGrowRow, Object.assign({ bgcolor: bgColorBottom, borderTop: "1px", color: theme.palette.getContrastText(bgColorBottom), fontSize: sizePixels * 0.12, fontFamily: theme.typography.fontFamily, height: sizePixels * 0.25 }, { children: title }), void 0)] }), void 0) }), void 0));
2048
+ };
2049
+
2050
+ const Portal = ({ children, className, el = 'div', target = 'body' }) => {
2051
+ const [container] = react.useState(document.createElement(el));
2052
+ if (className) {
2053
+ container.classList.add(className);
2054
+ }
2055
+ react.useEffect(() => {
2056
+ const targetElement = document.querySelector(target);
2057
+ if (!targetElement) {
2058
+ console.warn(`Unable to find target element: ${target}`);
2059
+ }
2060
+ targetElement === null || targetElement === void 0 ? void 0 : targetElement.appendChild(container);
2061
+ return () => {
2062
+ targetElement === null || targetElement === void 0 ? void 0 : targetElement.removeChild(container);
2063
+ };
2064
+ }, [container, target]);
2065
+ return reactDom.createPortal(children, container);
2565
2066
  };
2566
2067
 
2567
- var QuickTipButton = function (_a) {
2568
- var title = _a.title, children = _a.children, props = __rest(_a, ["title", "children"]);
2569
- var _b = __read(react.useState(false), 2), messageOpen = _b[0], setMessageOpen = _b[1];
2570
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.IconButton, __assign({ onClick: function () { return setMessageOpen(true); }, size: "small" }, props, { children: jsxRuntime.jsx(ai.AiOutlineQuestionCircle, { size: 16 }, void 0) }), void 0), jsxRuntime.jsx(MessageDialog, __assign({ onOk: function () { return setMessageOpen(false); }, onCancel: function () { return setMessageOpen(false); }, onClose: function () { return setMessageOpen(false); }, open: messageOpen, title: title !== null && title !== void 0 ? title : '' }, { children: children }), void 0)] }, void 0));
2068
+ const QuickTipButton = (_a) => {
2069
+ var { title, children } = _a, props = __rest(_a, ["title", "children"]);
2070
+ const [messageOpen, setMessageOpen] = react.useState(false);
2071
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: () => setMessageOpen(true), size: "small" }, props, { children: jsxRuntime.jsx(ai.AiOutlineQuestionCircle, { size: 16 }, void 0) }), void 0), jsxRuntime.jsx(MessageDialog, Object.assign({ onOk: () => setMessageOpen(false), onCancel: () => setMessageOpen(false), onClose: () => setMessageOpen(false), open: messageOpen, title: title !== null && title !== void 0 ? title : '' }, { children: children }), void 0)] }, void 0));
2571
2072
  };
2572
2073
 
2573
- var RichResult = function (props) {
2574
- var thing = props.thing;
2575
- var thingWithContext = thing;
2074
+ const RichResult = (props) => {
2075
+ const { thing } = props;
2076
+ const thingWithContext = thing;
2576
2077
  thingWithContext['@context'] = 'https://schema.org';
2577
- return jsxRuntime.jsx("script", __assign({ type: "application/ld+json" }, { children: JSON.stringify(thingWithContext) }), void 0);
2078
+ return jsxRuntime.jsx("script", Object.assign({ type: "application/ld+json" }, { children: JSON.stringify(thingWithContext) }), void 0);
2578
2079
  };
2579
2080
 
2580
2081
  exports.ActionStatusType = void 0;
@@ -2621,19 +2122,10 @@ exports.MapCategoryType = void 0;
2621
2122
  MapCategoryType["VenueMap"] = "VenueMap";
2622
2123
  })(exports.MapCategoryType || (exports.MapCategoryType = {}));
2623
2124
 
2624
- // The point of this component it to return to the top of the page on any router navigate
2625
- var ScrollToTop = function () {
2626
- var pathname = reactRouterDom.useLocation().pathname;
2627
- react.useEffect(function () {
2628
- window.scrollTo(0, 0);
2629
- }, [pathname]);
2630
- return null;
2631
- };
2632
-
2633
2125
  var img = "data:image/svg+xml,%3csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 238'%3e%3cdefs%3e%3cstyle%3e.cls-1%7bfill:%23999%3b%7d%3c/style%3e%3c/defs%3e%3ctitle%3eicon_gray%3c/title%3e%3cpath class='cls-1' d='M74.5%2c28.33%2c21.29%2c120.5%2c74.5%2c212.67H180.94l1.76-3%2c51.46-89.13L180.94%2c28.33ZM84.65%2c40.54h78.83L111.65%2c56.93a15.85%2c15.85%2c0%2c0%2c1%2c2%2c5l59.66-18.81L185.22%2c101a20.12%2c20.12%2c0%2c0%2c1%2c5.36-.78l-10-47.91%2c37.87%2c65.53h-7.62a24.21%2c24.21%2c0%2c0%2c1%2c.15%2c2.68%2c23.29%2c23.29%2c0%2c0%2c1-.15%2c2.68h7.62l-39.1%2c67.75%2c10.92-50.13A20.57%2c20.57%2c0%2c0%2c1%2c185%2c140l-12.88%2c59-58.37-19.53a17.61%2c17.61%2c0%2c0%2c1-1.7%2c5l47.5%2c15.92H84.65l4-6.85A20.17%2c20.17%2c0%2c0%2c1%2c83.93%2c191L80%2c197.78%2c42.67%2c133.13l37%2c32.66a20.52%2c20.52%2c0%2c0%2c1%2c3.6-4L36.69%2c120.66%2c85%2c77.79a17.45%2c17.45%2c0%2c0%2c1-3.19-4.32l-39.46%2c35L80%2c43.22l5.56%2c9.69A17.51%2c17.51%2c0%2c0%2c1%2c90.12%2c50Zm28.24%2c31.17a16.15%2c16.15%2c0%2c0%2c1-2.68%2c4.64l62%2c35.81a19.74%2c19.74%2c0%2c0%2c1%2c2.83-4.54Zm-20%2c10.51v75.33a18%2c18%2c0%2c0%2c1%2c2.47-.16%2c17.18%2c17.18%2c0%2c0%2c1%2c2.89.21v-75a11.21%2c11.21%2c0%2c0%2c1-1.29%2c0%2c17.57%2c17.57%2c0%2c0%2c1-4.07-.47Zm79.34%2c46.63-62.08%2c35.81a18.45%2c18.45%2c0%2c0%2c1%2c2.68%2c4.68l62.23-36a19.68%2c19.68%2c0%2c0%2c1-2.83-4.53Z'/%3e%3cpath class='cls-1' d='M97%2c48.58a17.06%2c17.06%2c0%2c1%2c0%2c17%2c17%2c17.08%2c17.08%2c0%2c0%2c0-17-17Zm0%2c5.36a11.7%2c11.7%2c0%2c1%2c1-11.7%2c11.69A11.65%2c11.65%2c0%2c0%2c1%2c97%2c53.94Z'/%3e%3cpath class='cls-1' d='M95.37%2c157.39a18.73%2c18.73%2c0%2c1%2c0%2c18.7%2c18.7%2c18.74%2c18.74%2c0%2c0%2c0-18.7-18.7Zm0%2c5.31A13.4%2c13.4%2c0%2c1%2c1%2c82%2c176.09a13.37%2c13.37%2c0%2c0%2c1%2c13.4-13.39Z'/%3e%3cpath class='cls-1' d='M190.73%2c100.2A20.3%2c20.3%2c0%2c1%2c0%2c211%2c120.5a20.34%2c20.34%2c0%2c0%2c0-20.3-20.3Zm0%2c5.36a14.94%2c14.94%2c0%2c1%2c1-14.94%2c14.94%2c14.88%2c14.88%2c0%2c0%2c1%2c14.94-14.94Z'/%3e%3c/svg%3e";
2634
2126
 
2635
- var base10Shift = function (bn, places) {
2636
- var factor = new sdkJs.BigNumber(10).pow(new sdkJs.BigNumber(Math.abs(places)));
2127
+ const base10Shift = (bn, places) => {
2128
+ const factor = new sdkJs.BigNumber(10).pow(new sdkJs.BigNumber(Math.abs(places)));
2637
2129
  if (places > 0) {
2638
2130
  return bn.mul(factor);
2639
2131
  }
@@ -2641,11 +2133,11 @@ var base10Shift = function (bn, places) {
2641
2133
  return bn.div(factor);
2642
2134
  }
2643
2135
  };
2644
- var TokenAmount = function (_a) {
2645
- var _b = _a.textFontFamily, textFontFamily = _b === void 0 ? '"Source Code Pro",monospace' : _b, textColor = _a.textColor, statusColor = _a.statusColor, style = _a.style, amount = _a.amount, _c = _a.places, places = _c === void 0 ? -18 : _c, logo = _a.logo, label = _a.label, onButtonClick = _a.onButtonClick, props = __rest(_a, ["textFontFamily", "textColor", "statusColor", "style", "amount", "places", "logo", "label", "onButtonClick"]);
2646
- var adjustedAmount = amount ? base10Shift(amount, places).toNumber() : undefined;
2647
- var amountString = adjustedAmount ? Math.trunc(adjustedAmount).toLocaleString() : '-';
2648
- return (jsxRuntime.jsx(ButtonEx, __assign({ style: __assign({ backgroundColor: statusColor }, style), variant: "outlined", onClick: onButtonClick }, props, { children: jsxRuntime.jsxs(FlexRow, __assign({ justifyContent: "space-between", width: "100%", busy: amount === undefined, busySize: 16 }, { children: [jsxRuntime.jsxs(FlexRow, { children: [logo ? jsxRuntime.jsx("img", { src: img, height: 24 }, void 0) : null, label ? (jsxRuntime.jsx(material.Typography, __assign({ marginRight: 1, marginLeft: logo ? 1 : 0, noWrap: true, fontFamily: textFontFamily, variant: "caption" }, { children: label }), void 0)) : null] }, void 0), jsxRuntime.jsx(material.Typography, __assign({ color: textColor, noWrap: true, fontFamily: textFontFamily, variant: "body1", style: { textTransform: 'none' } }, { children: amountString }), void 0)] }), void 0) }), void 0));
2136
+ const TokenAmount = (_a) => {
2137
+ var { textFontFamily = '"Source Code Pro",monospace', textColor, statusColor, style, amount, places = -18, logo, label, onButtonClick } = _a, props = __rest(_a, ["textFontFamily", "textColor", "statusColor", "style", "amount", "places", "logo", "label", "onButtonClick"]);
2138
+ const adjustedAmount = amount ? base10Shift(amount, places).toNumber() : undefined;
2139
+ const amountString = adjustedAmount ? Math.trunc(adjustedAmount).toLocaleString() : '-';
2140
+ return (jsxRuntime.jsx(ButtonEx, Object.assign({ style: Object.assign({ backgroundColor: statusColor }, style), variant: "outlined", onClick: onButtonClick }, props, { children: jsxRuntime.jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%", busy: amount === undefined, busySize: 16 }, { children: [jsxRuntime.jsxs(FlexRow, { children: [logo ? jsxRuntime.jsx("img", { src: img, height: 24 }, void 0) : null, label ? (jsxRuntime.jsx(material.Typography, Object.assign({ marginRight: 1, marginLeft: logo ? 1 : 0, noWrap: true, fontFamily: textFontFamily, variant: "caption" }, { children: label }), void 0)) : null] }, void 0), jsxRuntime.jsx(material.Typography, Object.assign({ color: textColor, noWrap: true, fontFamily: textFontFamily, variant: "body1", style: { textTransform: 'none' } }, { children: amountString }), void 0)] }), void 0) }), void 0));
2649
2141
  };
2650
2142
 
2651
2143
  Object.defineProperty(exports, 'useMediaQuery', {
@@ -2693,6 +2185,7 @@ exports.MessageDialog = MessageDialog;
2693
2185
  exports.NetworkSettingsContext = NetworkSettingsContext;
2694
2186
  exports.NetworkSettingsLoader = NetworkSettingsLoader;
2695
2187
  exports.NumberStatus = NumberStatus;
2188
+ exports.Portal = Portal;
2696
2189
  exports.QuickTipButton = QuickTipButton;
2697
2190
  exports.Rdt = Rdt;
2698
2191
  exports.RedditCustomEvent = RedditCustomEvent;