@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.
- package/dist/calcSpacing.js +3 -3
- package/dist/calcSpacing.js.map +1 -1
- package/dist/cjs5/components/Portal/Portal.d.ts +3 -0
- package/dist/cjs5/components/Portal/PortalProps.d.ts +7 -0
- package/dist/cjs5/components/Portal/index.d.ts +2 -0
- package/dist/cjs5/components/index.d.ts +1 -0
- package/dist/cjs5/index.js +1144 -1651
- package/dist/cjs5/index.js.map +1 -1
- package/dist/components/AppBarEx/AppBarEx.js +7 -7
- package/dist/components/AppBarEx/AppBarEx.js.map +1 -1
- package/dist/components/AppBarEx/AppBarEx.stories.js +3 -4
- package/dist/components/AppBarEx/AppBarEx.stories.js.map +1 -1
- package/dist/components/Background.js +2 -3
- package/dist/components/Background.js.map +1 -1
- package/dist/components/BasePage/BasePage.js +7 -6
- package/dist/components/BasePage/BasePage.js.map +1 -1
- package/dist/components/BasePage/BasePage.stories.js +5 -6
- package/dist/components/BasePage/BasePage.stories.js.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsEx.js +12 -12
- package/dist/components/Breadcrumbs/BreadcrumbsEx.js.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js +4 -5
- package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js.map +1 -1
- package/dist/components/BusyCircularProgress.js +5 -5
- package/dist/components/BusyCircularProgress.js.map +1 -1
- package/dist/components/BusyLinearProgress.js +5 -5
- package/dist/components/BusyLinearProgress.js.map +1 -1
- package/dist/components/ButtonEx/ButtonEx.js +5 -5
- package/dist/components/ButtonEx/ButtonEx.js.map +1 -1
- package/dist/components/ButtonEx/ButtonEx.stories.js +5 -6
- package/dist/components/ButtonEx/ButtonEx.stories.js.map +1 -1
- package/dist/components/ButtonEx/ButtonExBase.js +6 -6
- package/dist/components/ButtonEx/ButtonExBase.js.map +1 -1
- package/dist/components/ButtonEx/ButtonExTo.js +6 -6
- package/dist/components/ButtonEx/ButtonExTo.js.map +1 -1
- package/dist/components/CookieConsent/CookieConsent.js +5 -6
- package/dist/components/CookieConsent/CookieConsent.js.map +1 -1
- package/dist/components/CookieConsent/CookieConsent.stories.js +10 -11
- package/dist/components/CookieConsent/CookieConsent.stories.js.map +1 -1
- package/dist/components/CookieConsent/CookieConsentBody.js +11 -11
- package/dist/components/CookieConsent/CookieConsentBody.js.map +1 -1
- package/dist/components/CoverProgress.js +4 -5
- package/dist/components/CoverProgress.js.map +1 -1
- package/dist/components/Errors/ErrorViewer.js +5 -5
- package/dist/components/Errors/ErrorViewer.js.map +1 -1
- package/dist/components/Errors/ErrorViewer.stories.js +3 -4
- package/dist/components/Errors/ErrorViewer.stories.js.map +1 -1
- package/dist/components/Errors/ErrorsViewer.js +5 -5
- package/dist/components/Errors/ErrorsViewer.js.map +1 -1
- package/dist/components/Errors/ErrorsViewer.stories.js +3 -4
- package/dist/components/Errors/ErrorsViewer.stories.js.map +1 -1
- package/dist/components/EthAccount/EthAccount.js +12 -12
- package/dist/components/EthAccount/EthAccount.js.map +1 -1
- package/dist/components/EthAccount/EthAccount.stories.js +8 -9
- package/dist/components/EthAccount/EthAccount.stories.js.map +1 -1
- package/dist/components/EthBlock.js +3 -4
- package/dist/components/EthBlock.js.map +1 -1
- package/dist/components/Experiments/Experiment.js +2 -2
- package/dist/components/Experiments/Experiment.js.map +1 -1
- package/dist/components/Experiments/Experiments.js +43 -66
- package/dist/components/Experiments/Experiments.js.map +1 -1
- package/dist/components/Experiments/Experiments.stories.js +5 -6
- package/dist/components/Experiments/Experiments.stories.js.map +1 -1
- package/dist/components/Experiments/ExperimentsDebugger.js +20 -22
- package/dist/components/Experiments/ExperimentsDebugger.js.map +1 -1
- package/dist/components/Experiments/ExperimentsDebugger.stories.js +3 -4
- package/dist/components/Experiments/ExperimentsDebugger.stories.js.map +1 -1
- package/dist/components/Experiments/models/index.js +2 -2
- package/dist/components/Experiments/models/index.js.map +1 -1
- package/dist/components/FlexBox/BusyBox.js +6 -6
- package/dist/components/FlexBox/BusyBox.js.map +1 -1
- package/dist/components/FlexBox/BusyBox.stories.js +7 -8
- package/dist/components/FlexBox/BusyBox.stories.js.map +1 -1
- package/dist/components/FlexBox/FlexCol.js +4 -5
- package/dist/components/FlexBox/FlexCol.js.map +1 -1
- package/dist/components/FlexBox/FlexCol.stories.js +10 -11
- package/dist/components/FlexBox/FlexCol.stories.js.map +1 -1
- package/dist/components/FlexBox/FlexRow.js +4 -5
- package/dist/components/FlexBox/FlexRow.js.map +1 -1
- package/dist/components/FlexBox/FlexRow.stories.js +14 -15
- package/dist/components/FlexBox/FlexRow.stories.js.map +1 -1
- package/dist/components/HoverScale.js +12 -15
- package/dist/components/HoverScale.js.map +1 -1
- package/dist/components/Identicon.js +22 -22
- package/dist/components/Identicon.js.map +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeContext.js +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeContext.js.map +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js +7 -9
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js.map +1 -1
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js +3 -4
- package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js.map +1 -1
- package/dist/components/LinkEx/LinkToEx.js +4 -4
- package/dist/components/LinkEx/LinkToEx.js.map +1 -1
- package/dist/components/NumberStatus/NumberStatus.js +10 -10
- package/dist/components/NumberStatus/NumberStatus.js.map +1 -1
- package/dist/components/NumberStatus/NumberStatus.stories.js +11 -12
- package/dist/components/NumberStatus/NumberStatus.stories.js.map +1 -1
- package/dist/components/Portal/Portal.d.ts +3 -0
- package/dist/components/Portal/Portal.js +20 -0
- package/dist/components/Portal/Portal.js.map +1 -0
- package/dist/components/Portal/PortalProps.d.ts +7 -0
- package/dist/components/Portal/PortalProps.js +2 -0
- package/dist/components/Portal/PortalProps.js.map +1 -0
- package/dist/components/Portal/index.d.ts +2 -0
- package/dist/components/Portal/index.js +3 -0
- package/dist/components/Portal/index.js.map +1 -0
- package/dist/components/QuickTipButton/QuickTipButton.js +5 -5
- package/dist/components/QuickTipButton/QuickTipButton.js.map +1 -1
- package/dist/components/QuickTipButton/QuickTipButton.stories.js +3 -4
- package/dist/components/QuickTipButton/QuickTipButton.stories.js.map +1 -1
- package/dist/components/RedirectWithQuery.js +6 -8
- package/dist/components/RedirectWithQuery.js.map +1 -1
- package/dist/components/RichResult/RichResult.js +4 -5
- package/dist/components/RichResult/RichResult.js.map +1 -1
- package/dist/components/ScrollToTop.js +3 -3
- package/dist/components/ScrollToTop.js.map +1 -1
- package/dist/components/ScrollToTopButton.js +8 -8
- package/dist/components/ScrollToTopButton.js.map +1 -1
- package/dist/components/TokenAmount/TokenAmount.js +8 -8
- package/dist/components/TokenAmount/TokenAmount.js.map +1 -1
- package/dist/components/TokenAmount/TokenAmount.stories.js +9 -10
- package/dist/components/TokenAmount/TokenAmount.stories.js.map +1 -1
- package/dist/components/dialogs/ErrorDialog.js +12 -12
- package/dist/components/dialogs/ErrorDialog.js.map +1 -1
- package/dist/components/dialogs/ErrorDialog.stories.js +3 -4
- package/dist/components/dialogs/ErrorDialog.stories.js.map +1 -1
- package/dist/components/dialogs/MessageDialog.js +4 -4
- package/dist/components/dialogs/MessageDialog.js.map +1 -1
- package/dist/components/dialogs/MessageDialog.stories.js +3 -4
- package/dist/components/dialogs/MessageDialog.stories.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/contexts/CookieConsent/Context.js +1 -1
- package/dist/contexts/CookieConsent/Context.js.map +1 -1
- package/dist/contexts/CookieConsent/Loader.js +8 -10
- package/dist/contexts/CookieConsent/Loader.js.map +1 -1
- package/dist/contexts/CookieConsent/use.js +1 -1
- package/dist/contexts/CookieConsent/use.js.map +1 -1
- package/dist/contexts/Ethers/Context.js +1 -1
- package/dist/contexts/Ethers/Context.js.map +1 -1
- package/dist/contexts/Ethers/Infura.js +8 -9
- package/dist/contexts/Ethers/Infura.js.map +1 -1
- package/dist/contexts/Ethers/Loader.js +3 -3
- package/dist/contexts/Ethers/Loader.js.map +1 -1
- package/dist/contexts/Ethers/MetaMask.js +73 -100
- package/dist/contexts/Ethers/MetaMask.js.map +1 -1
- package/dist/contexts/Ethers/MyEtherWallet.js +54 -80
- package/dist/contexts/Ethers/MyEtherWallet.js.map +1 -1
- package/dist/contexts/Ethers/Opera.js +39 -51
- package/dist/contexts/Ethers/Opera.js.map +1 -1
- package/dist/contexts/Ethers/Trust.js +30 -42
- package/dist/contexts/Ethers/Trust.js.map +1 -1
- package/dist/contexts/NetworkSettings/Context.js +1 -1
- package/dist/contexts/NetworkSettings/Context.js.map +1 -1
- package/dist/contexts/NetworkSettings/Loader.js +3 -4
- package/dist/contexts/NetworkSettings/Loader.js.map +1 -1
- package/dist/contexts/UserEvents/Context.js +1 -1
- package/dist/contexts/UserEvents/Context.js.map +1 -1
- package/dist/contexts/UserEvents/Loader.js +2 -4
- package/dist/contexts/UserEvents/Loader.js.map +1 -1
- package/dist/esm2015/components/Portal/Portal.d.ts +3 -0
- package/dist/esm2015/components/Portal/PortalProps.d.ts +7 -0
- package/dist/esm2015/components/Portal/index.d.ts +2 -0
- package/dist/esm2015/components/index.d.ts +1 -0
- package/dist/esm2015/index.js +1144 -1652
- package/dist/esm2015/index.js.map +1 -1
- package/dist/esm2017/components/Portal/Portal.d.ts +3 -0
- package/dist/esm2017/components/Portal/PortalProps.d.ts +7 -0
- package/dist/esm2017/components/Portal/index.d.ts +2 -0
- package/dist/esm2017/components/index.d.ts +1 -0
- package/dist/esm2017/index.js +1144 -1652
- package/dist/esm2017/index.js.map +1 -1
- package/dist/esm5/components/Portal/Portal.d.ts +3 -0
- package/dist/esm5/components/Portal/PortalProps.d.ts +7 -0
- package/dist/esm5/components/Portal/index.d.ts +2 -0
- package/dist/esm5/components/index.d.ts +1 -0
- package/dist/esm5/index.js +1144 -1652
- package/dist/esm5/index.js.map +1 -1
- package/dist/hooks/useBreakpoint.js +7 -7
- package/dist/hooks/useBreakpoint.js.map +1 -1
- package/dist/hooks/useLocalStorage.js +5 -6
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useMounted.js +5 -6
- package/dist/hooks/useMounted.js.map +1 -1
- package/dist/hooks/useNavigateToEthAddress.js +7 -7
- package/dist/hooks/useNavigateToEthAddress.js.map +1 -1
- package/dist/hooks/useSpacing.js +2 -2
- package/dist/hooks/useSpacing.js.map +1 -1
- package/dist/hooks/useUserEvents.js +2 -2
- package/dist/hooks/useUserEvents.js.map +1 -1
- package/dist/hooks/useWebP.js +19 -32
- package/dist/hooks/useWebP.js.map +1 -1
- package/dist/hooks/useWindowSize.js +4 -5
- package/dist/hooks/useWindowSize.js.map +1 -1
- package/dist/lib/Tracking/Drip/BaseEvent.js +18 -28
- package/dist/lib/Tracking/Drip/BaseEvent.js.map +1 -1
- package/dist/lib/Tracking/Drip/CustomEvent.js +2 -8
- package/dist/lib/Tracking/Drip/CustomEvent.js.map +1 -1
- package/dist/lib/Tracking/Drip/StandardEvents.js +4 -7
- package/dist/lib/Tracking/Drip/StandardEvents.js.map +1 -1
- package/dist/lib/Tracking/Facebook/BaseEvent.js +8 -16
- package/dist/lib/Tracking/Facebook/BaseEvent.js.map +1 -1
- package/dist/lib/Tracking/Facebook/CustomEvent.js +8 -21
- package/dist/lib/Tracking/Facebook/CustomEvent.js.map +1 -1
- package/dist/lib/Tracking/Facebook/Fbq.js +11 -13
- package/dist/lib/Tracking/Facebook/Fbq.js.map +1 -1
- package/dist/lib/Tracking/Facebook/StandardEvent.js +8 -21
- package/dist/lib/Tracking/Facebook/StandardEvent.js.map +1 -1
- package/dist/lib/Tracking/Facebook/StandardEvents.js +38 -42
- package/dist/lib/Tracking/Facebook/StandardEvents.js.map +1 -1
- package/dist/lib/Tracking/Facebook/UserEventHandler.js +23 -54
- package/dist/lib/Tracking/Facebook/UserEventHandler.js.map +1 -1
- package/dist/lib/Tracking/Google/BaseEvent.js +23 -45
- package/dist/lib/Tracking/Google/BaseEvent.js.map +1 -1
- package/dist/lib/Tracking/Google/CustomEvent.js +2 -8
- package/dist/lib/Tracking/Google/CustomEvent.js.map +1 -1
- package/dist/lib/Tracking/Google/Gtag.js +37 -41
- package/dist/lib/Tracking/Google/Gtag.js.map +1 -1
- package/dist/lib/Tracking/Google/Gtm.js +18 -21
- package/dist/lib/Tracking/Google/Gtm.js.map +1 -1
- package/dist/lib/Tracking/Google/StandardEvent.js +2 -8
- package/dist/lib/Tracking/Google/StandardEvent.js.map +1 -1
- package/dist/lib/Tracking/Google/StandardEvents.js +62 -66
- package/dist/lib/Tracking/Google/StandardEvents.js.map +1 -1
- package/dist/lib/Tracking/Google/UserEventHandler.js +23 -54
- package/dist/lib/Tracking/Google/UserEventHandler.js.map +1 -1
- package/dist/lib/Tracking/Reddit/BaseEvent.js +8 -16
- package/dist/lib/Tracking/Reddit/BaseEvent.js.map +1 -1
- package/dist/lib/Tracking/Reddit/CustomEvent.js +8 -21
- package/dist/lib/Tracking/Reddit/CustomEvent.js.map +1 -1
- package/dist/lib/Tracking/Reddit/Rdt.js +11 -15
- package/dist/lib/Tracking/Reddit/Rdt.js.map +1 -1
- package/dist/lib/Tracking/Reddit/StandardEvent.js +8 -21
- package/dist/lib/Tracking/Reddit/StandardEvent.js.map +1 -1
- package/dist/lib/Tracking/Reddit/StandardEvents.js +18 -21
- package/dist/lib/Tracking/Reddit/StandardEvents.js.map +1 -1
- package/dist/lib/Tracking/Referrer.js +12 -13
- package/dist/lib/Tracking/Referrer.js.map +1 -1
- package/dist/lib/Tracking/Snapchat/BaseEvent.js +8 -16
- package/dist/lib/Tracking/Snapchat/BaseEvent.js.map +1 -1
- package/dist/lib/Tracking/Snapchat/Snaptr.js +10 -21
- package/dist/lib/Tracking/Snapchat/Snaptr.js.map +1 -1
- package/dist/lib/Tracking/Snapchat/StandardEvent.js +7 -19
- package/dist/lib/Tracking/Snapchat/StandardEvent.js.map +1 -1
- package/dist/lib/Tracking/Snapchat/StandardEvents.js +60 -64
- package/dist/lib/Tracking/Snapchat/StandardEvents.js.map +1 -1
- package/dist/lib/Tracking/Tiktok/BaseEvent.js +8 -16
- package/dist/lib/Tracking/Tiktok/BaseEvent.js.map +1 -1
- package/dist/lib/Tracking/Tiktok/CustomEvent.js +8 -21
- package/dist/lib/Tracking/Tiktok/CustomEvent.js.map +1 -1
- package/dist/lib/Tracking/Tiktok/StandardEvent.js +8 -21
- package/dist/lib/Tracking/Tiktok/StandardEvent.js.map +1 -1
- package/dist/lib/Tracking/Tiktok/StandardEvents.js +34 -38
- package/dist/lib/Tracking/Tiktok/StandardEvents.js.map +1 -1
- package/dist/lib/Tracking/Tiktok/Ttq.js +14 -18
- package/dist/lib/Tracking/Tiktok/Ttq.js.map +1 -1
- package/dist/lib/Tracking/Xy/BaseEvent.js +8 -16
- package/dist/lib/Tracking/Xy/BaseEvent.js.map +1 -1
- package/dist/lib/Tracking/Xy/CustomEvent.js +2 -8
- package/dist/lib/Tracking/Xy/CustomEvent.js.map +1 -1
- package/dist/lib/Tracking/Xy/StandardEvent.js +2 -8
- package/dist/lib/Tracking/Xy/StandardEvent.js.map +1 -1
- package/dist/lib/Tracking/Xy/UserEventHandler.js +23 -54
- package/dist/lib/Tracking/Xy/UserEventHandler.js.map +1 -1
- package/dist/lib/Tracking/XyoUserEventHandler.js +22 -54
- package/dist/lib/Tracking/XyoUserEventHandler.js.map +1 -1
- package/dist/lib/getApiStage.js +1 -1
- package/dist/lib/getApiStage.js.map +1 -1
- package/dist/lib/global.js +1 -1
- package/dist/lib/global.js.map +1 -1
- package/dist/lib/isLocalHost.js +1 -1
- package/dist/lib/isLocalHost.js.map +1 -1
- package/dist/lib/profile.js +13 -22
- package/dist/lib/profile.js.map +1 -1
- package/dist/lib/safeLocalStorage.js +3 -3
- package/dist/lib/safeLocalStorage.js.map +1 -1
- package/dist/lib/safeSessionStorage.js +3 -3
- package/dist/lib/safeSessionStorage.js.map +1 -1
- package/dist/lib/useAsyncEffect.js +5 -5
- package/dist/lib/useAsyncEffect.js.map +1 -1
- package/dist/mergeBoxlikeStyles.js +19 -5
- package/dist/mergeBoxlikeStyles.js.map +1 -1
- package/dist/node/components/Portal/Portal.d.ts +3 -0
- package/dist/node/components/Portal/PortalProps.d.ts +7 -0
- package/dist/node/components/Portal/index.d.ts +2 -0
- package/dist/node/components/index.d.ts +1 -0
- package/dist/node/index.js +1144 -1651
- package/dist/node/index.js.map +1 -1
- package/dist/node-esm/components/Portal/Portal.d.ts +3 -0
- package/dist/node-esm/components/Portal/PortalProps.d.ts +7 -0
- package/dist/node-esm/components/Portal/index.d.ts +2 -0
- package/dist/node-esm/components/index.d.ts +1 -0
- package/dist/node-esm/index.js +1144 -1652
- package/dist/node-esm/index.js.map +1 -1
- package/package.json +13 -12
- package/src/components/BasePage/BasePage.tsx +2 -0
- package/src/components/Portal/Portal.tsx +23 -0
- package/src/components/Portal/PortalProps.ts +6 -0
- package/src/components/Portal/index.ts +2 -0
- package/src/components/index.ts +1 -0
package/dist/cjs5/index.js
CHANGED
|
@@ -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
|
-
|
|
160
|
-
var
|
|
161
|
-
|
|
162
|
-
return (jsxRuntime.jsx(material.Box,
|
|
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
|
-
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
return (jsxRuntime.jsx(material.Box,
|
|
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
|
-
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
return (jsxRuntime.jsxs(material.Box,
|
|
175
|
-
?
|
|
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
|
-
|
|
179
|
-
return jsxRuntime.jsx(BusyBox,
|
|
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
|
-
|
|
182
|
-
return jsxRuntime.jsx(FlexCol,
|
|
88
|
+
const FlexGrowCol = (props) => {
|
|
89
|
+
return jsxRuntime.jsx(FlexCol, Object.assign({ flexGrow: 1 }, props), void 0);
|
|
183
90
|
};
|
|
184
91
|
|
|
185
|
-
|
|
186
|
-
return jsxRuntime.jsx(BusyBox,
|
|
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
|
-
|
|
189
|
-
return jsxRuntime.jsx(FlexRow,
|
|
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
|
-
|
|
196
|
-
return jsxRuntime.jsx(FlexRow,
|
|
102
|
+
const Background = (props) => {
|
|
103
|
+
return jsxRuntime.jsx(FlexRow, Object.assign({}, props), void 0);
|
|
197
104
|
};
|
|
198
105
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
return (jsxRuntime.jsxs(FlexCol,
|
|
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
|
-
|
|
206
|
-
|
|
207
|
-
return (jsxRuntime.jsxs(FlexGrowCol,
|
|
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,
|
|
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
|
-
|
|
119
|
+
const CoverProgress = (props) => {
|
|
213
120
|
var _a;
|
|
214
|
-
|
|
215
|
-
|
|
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,
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
236
|
-
return (jsxRuntime.jsx(FlexRow, { children: jsxRuntime.jsx(material.Box,
|
|
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
|
-
|
|
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
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
-
|
|
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
|
-
|
|
259
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
276
|
-
row.forEach(
|
|
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
|
-
|
|
290
|
-
var
|
|
291
|
-
|
|
292
|
-
react.useEffect(
|
|
293
|
-
updateCanvas(canvas, { bg
|
|
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,
|
|
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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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,
|
|
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
|
-
|
|
312
|
-
var
|
|
313
|
-
|
|
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
|
-
|
|
318
|
-
|
|
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
|
-
|
|
324
|
-
return (jsxRuntime.jsx(material.Zoom,
|
|
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
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return (jsxRuntime.jsxs(FlexGrowRow,
|
|
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,
|
|
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
|
-
|
|
240
|
+
const CookieConsentContext = react.createContext({});
|
|
337
241
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
-
|
|
247
|
+
const setAcceptedToLocalStorage = (accepted) => {
|
|
345
248
|
localStorage.setItem(CookiesAcceptedLocalStorageName, accepted ? 'true' : 'false');
|
|
346
249
|
};
|
|
347
|
-
|
|
348
|
-
|
|
250
|
+
const [accepted, setAccepted] = react.useState(getAcceptedFromLocalStorage());
|
|
251
|
+
const setAcceptedHandler = (accepted) => {
|
|
349
252
|
setAcceptedToLocalStorage(accepted);
|
|
350
253
|
setAccepted(accepted);
|
|
351
254
|
};
|
|
352
|
-
|
|
255
|
+
const clearAccepted = () => {
|
|
353
256
|
localStorage.removeItem(CookiesAcceptedLocalStorageName);
|
|
354
257
|
setAccepted(getAcceptedFromLocalStorage());
|
|
355
258
|
};
|
|
356
|
-
return (jsxRuntime.jsx(CookieConsentContext.Provider,
|
|
259
|
+
return (jsxRuntime.jsx(CookieConsentContext.Provider, Object.assign({ value: { accepted, clearAccepted, setAccepted: setAcceptedHandler, storageName: CookiesAcceptedLocalStorageName } }, { children: children }), void 0));
|
|
357
260
|
};
|
|
358
261
|
|
|
359
|
-
|
|
262
|
+
const useCookieConsent = () => {
|
|
360
263
|
return react.useContext(CookieConsentContext);
|
|
361
264
|
};
|
|
362
265
|
|
|
363
|
-
|
|
266
|
+
const EthersContext = react.createContext({});
|
|
364
267
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
return (jsxRuntime.jsx(EthersContext.Provider,
|
|
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
|
|
275
|
+
chainId,
|
|
373
276
|
isConnected: true,
|
|
374
|
-
provider
|
|
277
|
+
provider,
|
|
375
278
|
signer: null,
|
|
376
279
|
} }, { children: children }), void 0));
|
|
377
280
|
};
|
|
378
281
|
|
|
379
|
-
|
|
282
|
+
const getApiStage = () => {
|
|
380
283
|
return sdkJs.getApiStage(document.location.hostname);
|
|
381
284
|
};
|
|
382
285
|
|
|
383
|
-
|
|
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
|
-
|
|
393
|
-
|
|
295
|
+
let mounted = true;
|
|
296
|
+
const promise = effect(() => {
|
|
394
297
|
return mounted;
|
|
395
298
|
});
|
|
396
299
|
Promise.resolve(promise)
|
|
397
|
-
.then(
|
|
300
|
+
.then((callback) => {
|
|
398
301
|
if (callback) {
|
|
399
302
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
400
303
|
}
|
|
401
304
|
})
|
|
402
|
-
.catch(
|
|
403
|
-
console.log(
|
|
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
|
-
|
|
412
|
-
|
|
314
|
+
let logProfiling = false;
|
|
315
|
+
const enableProfileLogging = (enabled) => {
|
|
413
316
|
logProfiling = enabled;
|
|
414
317
|
};
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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
|
-
|
|
329
|
+
const getLocalStorageObject = (key, log) => {
|
|
436
330
|
var _a;
|
|
437
|
-
|
|
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
|
-
|
|
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
|
-
|
|
349
|
+
const getSessionStorageObject = (key, log) => {
|
|
456
350
|
var _a;
|
|
457
|
-
|
|
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
|
-
|
|
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
|
-
|
|
476
|
-
|
|
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
|
-
|
|
484
|
-
|
|
377
|
+
getFromLocal() {
|
|
378
|
+
const value = localStorage.getItem(Referrer.storageId);
|
|
485
379
|
if (value && value.length > 0) {
|
|
486
380
|
return value;
|
|
487
381
|
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
|
|
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
|
-
|
|
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
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
-
|
|
528
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
529
|
-
|
|
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
|
-
|
|
540
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
541
|
-
|
|
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
|
-
|
|
552
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
553
|
-
|
|
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
|
-
|
|
564
|
-
}(pixel.UserEventHandler));
|
|
424
|
+
}
|
|
425
|
+
}
|
|
565
426
|
|
|
566
427
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
567
|
-
|
|
428
|
+
const global = window;
|
|
568
429
|
|
|
569
|
-
|
|
570
|
-
|
|
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
|
-
|
|
577
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
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
|
-
|
|
447
|
+
}
|
|
448
|
+
getDcq() {
|
|
597
449
|
if (!global._dcq) {
|
|
598
450
|
throw Error('DCQ not found');
|
|
599
451
|
}
|
|
600
452
|
return global._dcq;
|
|
601
|
-
}
|
|
602
|
-
|
|
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
|
-
|
|
617
|
-
}(DripBaseEvent));
|
|
460
|
+
}
|
|
618
461
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
462
|
+
class DripCustomEvent extends DripBaseEvent {
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
class DripStandardEvents {
|
|
466
|
+
identify() {
|
|
623
467
|
return new DripBaseEvent('identify');
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
}());
|
|
468
|
+
}
|
|
469
|
+
}
|
|
627
470
|
|
|
628
|
-
|
|
629
|
-
|
|
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
|
-
|
|
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
|
-
|
|
652
|
-
this.fbq('track', event,
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
this.fbq('trackCustom', event,
|
|
656
|
-
}
|
|
657
|
-
|
|
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
|
-
|
|
661
|
-
|
|
502
|
+
class FacebookBaseEvent {
|
|
503
|
+
constructor(name) {
|
|
662
504
|
this.name = name;
|
|
663
505
|
this.fbq = sdkJs.assertEx(Fbq.instance, 'Missing Fbq');
|
|
664
506
|
}
|
|
665
|
-
|
|
666
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
667
|
-
|
|
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
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
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
|
-
|
|
722
|
-
}(FacebookBaseEvent));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
723
522
|
|
|
724
|
-
|
|
725
|
-
|
|
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
|
-
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
class FacebookStandardEvents {
|
|
533
|
+
addPaymentInfo() {
|
|
728
534
|
return new FacebookStandardEvent('AddPaymentInfo');
|
|
729
|
-
}
|
|
730
|
-
|
|
535
|
+
}
|
|
536
|
+
addToCart() {
|
|
731
537
|
return new FacebookStandardEvent('AddToCart');
|
|
732
|
-
}
|
|
733
|
-
|
|
538
|
+
}
|
|
539
|
+
addToWishList() {
|
|
734
540
|
return new FacebookStandardEvent('AddToWishList');
|
|
735
|
-
}
|
|
736
|
-
|
|
541
|
+
}
|
|
542
|
+
completedRegistration() {
|
|
737
543
|
return new FacebookStandardEvent('CompleteRegistration');
|
|
738
|
-
}
|
|
739
|
-
|
|
544
|
+
}
|
|
545
|
+
contact() {
|
|
740
546
|
return new FacebookStandardEvent('Contact');
|
|
741
|
-
}
|
|
742
|
-
|
|
547
|
+
}
|
|
548
|
+
customizeProduct() {
|
|
743
549
|
return new FacebookStandardEvent('CustomizeProduct');
|
|
744
|
-
}
|
|
745
|
-
|
|
550
|
+
}
|
|
551
|
+
donate() {
|
|
746
552
|
return new FacebookStandardEvent('Donate');
|
|
747
|
-
}
|
|
748
|
-
|
|
553
|
+
}
|
|
554
|
+
findLocation() {
|
|
749
555
|
return new FacebookStandardEvent('FindLocation');
|
|
750
|
-
}
|
|
751
|
-
|
|
556
|
+
}
|
|
557
|
+
initiateCheckout() {
|
|
752
558
|
return new FacebookStandardEvent('InitiateCheckout');
|
|
753
|
-
}
|
|
754
|
-
|
|
559
|
+
}
|
|
560
|
+
lead() {
|
|
755
561
|
return new FacebookStandardEvent('Lead');
|
|
756
|
-
}
|
|
757
|
-
|
|
562
|
+
}
|
|
563
|
+
pageView() {
|
|
758
564
|
return new FacebookStandardEvent('PageView');
|
|
759
|
-
}
|
|
760
|
-
|
|
565
|
+
}
|
|
566
|
+
purchase() {
|
|
761
567
|
return new FacebookStandardEvent('Purchase');
|
|
762
|
-
}
|
|
763
|
-
|
|
568
|
+
}
|
|
569
|
+
schedule() {
|
|
764
570
|
return new FacebookStandardEvent('Schedule');
|
|
765
|
-
}
|
|
766
|
-
|
|
571
|
+
}
|
|
572
|
+
search() {
|
|
767
573
|
return new FacebookStandardEvent('Search');
|
|
768
|
-
}
|
|
769
|
-
|
|
574
|
+
}
|
|
575
|
+
startTrial() {
|
|
770
576
|
return new FacebookStandardEvent('StartTrial');
|
|
771
|
-
}
|
|
772
|
-
|
|
577
|
+
}
|
|
578
|
+
submitApplication() {
|
|
773
579
|
return new FacebookStandardEvent('SubmitApplication');
|
|
774
|
-
}
|
|
775
|
-
|
|
580
|
+
}
|
|
581
|
+
subscribe() {
|
|
776
582
|
return new FacebookStandardEvent('Subscribe');
|
|
777
|
-
}
|
|
778
|
-
|
|
583
|
+
}
|
|
584
|
+
viewContent() {
|
|
779
585
|
return new FacebookStandardEvent('ViewContent');
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
}());
|
|
586
|
+
}
|
|
587
|
+
}
|
|
783
588
|
|
|
784
|
-
|
|
785
|
-
|
|
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
|
-
|
|
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
|
-
|
|
609
|
+
const remainingSearch = parsedQueryString ? queryString.stringify(parsedQueryString) : '';
|
|
805
610
|
sessionStorage.setItem('initialQuery', remainingSearch);
|
|
806
611
|
sessionStorage.setItem('initialPage', document.location.href);
|
|
807
612
|
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
this.gtag('config', ga4id, { page_path:
|
|
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
|
-
|
|
620
|
+
static getInitialQuery() {
|
|
816
621
|
return sessionStorage.getItem('initialQuery') || '';
|
|
817
|
-
}
|
|
818
|
-
|
|
622
|
+
}
|
|
623
|
+
static getInitialPage() {
|
|
819
624
|
return sessionStorage.getItem('initialPage') || '';
|
|
820
|
-
}
|
|
821
|
-
|
|
625
|
+
}
|
|
626
|
+
static getInitialReferrer() {
|
|
822
627
|
return sessionStorage.getItem('initialReferrer') || '';
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
|
|
628
|
+
}
|
|
629
|
+
static clearDataLayer() {
|
|
630
|
+
const dataLayer = global.dataLayer;
|
|
826
631
|
dataLayer.length = 0;
|
|
827
|
-
}
|
|
828
|
-
|
|
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
|
-
|
|
638
|
+
}
|
|
639
|
+
static reinit(ga4id, awid, domains) {
|
|
835
640
|
this.instance = new Gtag(ga4id, awid, domains);
|
|
836
641
|
return this.instance;
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
|
|
642
|
+
}
|
|
643
|
+
static updatePagePath(page_path) {
|
|
644
|
+
const instance = sdkJs.assertEx(this.instance, 'Not initialized');
|
|
840
645
|
return instance.updatePagePath(page_path);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
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:
|
|
651
|
+
}, event_timeout: 2000, page_location: Gtag.getInitialPage(), page_referrer: Gtag.getInitialReferrer(), send_to: this.ga4id }));
|
|
848
652
|
});
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
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:
|
|
658
|
+
}, event_timeout: 2000, send_to: `${this.awid}/${event}` }));
|
|
856
659
|
});
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
}());
|
|
660
|
+
}
|
|
661
|
+
}
|
|
860
662
|
|
|
861
|
-
|
|
862
|
-
|
|
663
|
+
class Gtm {
|
|
664
|
+
constructor(containerId) {
|
|
863
665
|
this.containerId = containerId;
|
|
864
|
-
|
|
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
|
-
|
|
670
|
+
static getInitialQuery() {
|
|
869
671
|
return sessionStorage.getItem('initialQuery') || '';
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
672
|
+
}
|
|
673
|
+
static clearDataLayer() {
|
|
674
|
+
const global = window;
|
|
675
|
+
const dataLayer = global.dataLayer;
|
|
874
676
|
dataLayer.length = 0;
|
|
875
|
-
}
|
|
876
|
-
|
|
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
|
-
|
|
883
|
-
|
|
884
|
-
return new Promise(function (resolve) {
|
|
683
|
+
}
|
|
684
|
+
send(event, data, eventTimeout = 500) {
|
|
685
|
+
return new Promise((resolve) => {
|
|
885
686
|
var _a;
|
|
886
|
-
|
|
887
|
-
(_a = global.dataLayer) === null || _a === void 0 ? void 0 : _a.push(
|
|
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
|
|
690
|
+
}, eventTimeout }));
|
|
890
691
|
});
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
}());
|
|
692
|
+
}
|
|
693
|
+
}
|
|
894
694
|
|
|
895
|
-
|
|
896
|
-
|
|
695
|
+
class GoogleBaseEvent {
|
|
696
|
+
constructor(name, adwordConversionId) {
|
|
897
697
|
this.name = name;
|
|
898
698
|
this.adwordConversionId = adwordConversionId;
|
|
899
699
|
}
|
|
900
|
-
|
|
901
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
902
|
-
return
|
|
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
|
-
|
|
911
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
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
|
-
|
|
928
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
929
|
-
|
|
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
|
-
|
|
717
|
+
}
|
|
718
|
+
gtag() {
|
|
940
719
|
return sdkJs.assertEx(Gtag.instance, 'Missing/uninitialized gtag');
|
|
941
|
-
}
|
|
942
|
-
|
|
720
|
+
}
|
|
721
|
+
gtm() {
|
|
943
722
|
return sdkJs.assertEx(Gtm.instance, 'Missing/uninitialized gtm');
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
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
|
-
|
|
973
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
974
|
-
|
|
975
|
-
return
|
|
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
|
-
|
|
986
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
987
|
-
|
|
988
|
-
return
|
|
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
|
-
|
|
999
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1000
|
-
|
|
1001
|
-
return
|
|
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
|
-
|
|
1020
|
-
}(GoogleBaseEvent));
|
|
754
|
+
}
|
|
1021
755
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
756
|
+
class GoogleStandardEvent extends GoogleBaseEvent {
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
class GoogleStandardEvents {
|
|
760
|
+
addPaymentInfo() {
|
|
1026
761
|
return new GoogleStandardEvent('add_paymennt_info');
|
|
1027
|
-
}
|
|
1028
|
-
|
|
762
|
+
}
|
|
763
|
+
addShippingInfo() {
|
|
1029
764
|
return new GoogleStandardEvent('add_shipping_info');
|
|
1030
|
-
}
|
|
1031
|
-
|
|
765
|
+
}
|
|
766
|
+
addToCart() {
|
|
1032
767
|
return new GoogleStandardEvent('add_to_cart');
|
|
1033
|
-
}
|
|
1034
|
-
|
|
768
|
+
}
|
|
769
|
+
addToWishList() {
|
|
1035
770
|
return new GoogleStandardEvent('add_to_wishlist');
|
|
1036
|
-
}
|
|
1037
|
-
|
|
771
|
+
}
|
|
772
|
+
beginCheckout() {
|
|
1038
773
|
return new GoogleStandardEvent('begin_checkout');
|
|
1039
|
-
}
|
|
1040
|
-
|
|
774
|
+
}
|
|
775
|
+
earnVirtualCurrency() {
|
|
1041
776
|
return new GoogleStandardEvent('earn_virtual_currency');
|
|
1042
|
-
}
|
|
1043
|
-
|
|
777
|
+
}
|
|
778
|
+
generateLead() {
|
|
1044
779
|
return new GoogleStandardEvent('generate_lead');
|
|
1045
|
-
}
|
|
1046
|
-
|
|
780
|
+
}
|
|
781
|
+
joinGroup() {
|
|
1047
782
|
return new GoogleStandardEvent('join_group');
|
|
1048
|
-
}
|
|
1049
|
-
|
|
783
|
+
}
|
|
784
|
+
levelEnd() {
|
|
1050
785
|
return new GoogleStandardEvent('level_end');
|
|
1051
|
-
}
|
|
1052
|
-
|
|
786
|
+
}
|
|
787
|
+
levelStart() {
|
|
1053
788
|
return new GoogleStandardEvent('level_start');
|
|
1054
|
-
}
|
|
1055
|
-
|
|
789
|
+
}
|
|
790
|
+
levelUp() {
|
|
1056
791
|
return new GoogleStandardEvent('level_up');
|
|
1057
|
-
}
|
|
1058
|
-
|
|
792
|
+
}
|
|
793
|
+
login() {
|
|
1059
794
|
return new GoogleStandardEvent('login');
|
|
1060
|
-
}
|
|
1061
|
-
|
|
795
|
+
}
|
|
796
|
+
postScore() {
|
|
1062
797
|
return new GoogleStandardEvent('post_score');
|
|
1063
|
-
}
|
|
1064
|
-
|
|
798
|
+
}
|
|
799
|
+
purchase() {
|
|
1065
800
|
return new GoogleStandardEvent('purchase');
|
|
1066
|
-
}
|
|
1067
|
-
|
|
801
|
+
}
|
|
802
|
+
refund() {
|
|
1068
803
|
return new GoogleStandardEvent('refund');
|
|
1069
|
-
}
|
|
1070
|
-
|
|
804
|
+
}
|
|
805
|
+
removeFromCart() {
|
|
1071
806
|
return new GoogleStandardEvent('remove_from_cart');
|
|
1072
|
-
}
|
|
1073
|
-
|
|
807
|
+
}
|
|
808
|
+
search() {
|
|
1074
809
|
return new GoogleStandardEvent('search');
|
|
1075
|
-
}
|
|
1076
|
-
|
|
810
|
+
}
|
|
811
|
+
selectContent() {
|
|
1077
812
|
return new GoogleStandardEvent('select_content');
|
|
1078
|
-
}
|
|
1079
|
-
|
|
813
|
+
}
|
|
814
|
+
selectItem() {
|
|
1080
815
|
return new GoogleStandardEvent('select_item');
|
|
1081
|
-
}
|
|
1082
|
-
|
|
816
|
+
}
|
|
817
|
+
selectPromotion() {
|
|
1083
818
|
return new GoogleStandardEvent('select_promotion');
|
|
1084
|
-
}
|
|
1085
|
-
|
|
819
|
+
}
|
|
820
|
+
share() {
|
|
1086
821
|
return new GoogleStandardEvent('share');
|
|
1087
|
-
}
|
|
1088
|
-
|
|
822
|
+
}
|
|
823
|
+
signUp() {
|
|
1089
824
|
return new GoogleStandardEvent('sign_up');
|
|
1090
|
-
}
|
|
1091
|
-
|
|
825
|
+
}
|
|
826
|
+
spendVirtualCurrency() {
|
|
1092
827
|
return new GoogleStandardEvent('spend_virtual_currency');
|
|
1093
|
-
}
|
|
1094
|
-
|
|
828
|
+
}
|
|
829
|
+
tutorialBegin() {
|
|
1095
830
|
return new GoogleStandardEvent('tutorial_begin');
|
|
1096
|
-
}
|
|
1097
|
-
|
|
831
|
+
}
|
|
832
|
+
tutorialComplete() {
|
|
1098
833
|
return new GoogleStandardEvent('tutorial_complete');
|
|
1099
|
-
}
|
|
1100
|
-
|
|
834
|
+
}
|
|
835
|
+
unlockAchievement() {
|
|
1101
836
|
return new GoogleStandardEvent('unlock_achievement');
|
|
1102
|
-
}
|
|
1103
|
-
|
|
837
|
+
}
|
|
838
|
+
viewCart() {
|
|
1104
839
|
return new GoogleStandardEvent('view_cart');
|
|
1105
|
-
}
|
|
1106
|
-
|
|
840
|
+
}
|
|
841
|
+
viewItem() {
|
|
1107
842
|
return new GoogleStandardEvent('view_item');
|
|
1108
|
-
}
|
|
1109
|
-
|
|
843
|
+
}
|
|
844
|
+
viewItemList() {
|
|
1110
845
|
return new GoogleStandardEvent('view_item_list');
|
|
1111
|
-
}
|
|
1112
|
-
|
|
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
|
-
|
|
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
|
-
|
|
862
|
+
}
|
|
863
|
+
static getRdt() {
|
|
1132
864
|
if (global.rdt) {
|
|
1133
865
|
return global.rdt;
|
|
1134
866
|
}
|
|
1135
867
|
console.warn('Missing rdt');
|
|
1136
|
-
}
|
|
1137
|
-
|
|
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
|
-
|
|
876
|
+
}
|
|
877
|
+
track(event, data) {
|
|
1146
878
|
try {
|
|
1147
|
-
Rdt.getRdt()('track', event,
|
|
879
|
+
Rdt.getRdt()('track', event, Object.assign({}, data));
|
|
1148
880
|
}
|
|
1149
881
|
catch (ex) {
|
|
1150
882
|
console.error(ex);
|
|
1151
883
|
}
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
}());
|
|
884
|
+
}
|
|
885
|
+
}
|
|
1155
886
|
|
|
1156
|
-
|
|
1157
|
-
|
|
887
|
+
class RedditBaseEvent {
|
|
888
|
+
constructor(name) {
|
|
1158
889
|
this.name = name;
|
|
1159
890
|
this.rdt = sdkJs.assertEx(Rdt.instance, 'Missing Rdt');
|
|
1160
891
|
}
|
|
1161
|
-
|
|
1162
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1163
|
-
|
|
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
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
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
|
-
|
|
1218
|
-
}(RedditBaseEvent));
|
|
905
|
+
}
|
|
906
|
+
}
|
|
1219
907
|
|
|
1220
|
-
|
|
1221
|
-
|
|
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
|
-
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
class RedditStandardEvents {
|
|
918
|
+
pageView() {
|
|
1224
919
|
return new RedditStandardEvent('PageView');
|
|
1225
|
-
}
|
|
1226
|
-
|
|
920
|
+
}
|
|
921
|
+
viewContent() {
|
|
1227
922
|
return new RedditStandardEvent('ViewContent');
|
|
1228
|
-
}
|
|
1229
|
-
|
|
923
|
+
}
|
|
924
|
+
addToCart() {
|
|
1230
925
|
return new RedditStandardEvent('AddToCart');
|
|
1231
|
-
}
|
|
1232
|
-
|
|
926
|
+
}
|
|
927
|
+
addToWishlist() {
|
|
1233
928
|
return new RedditStandardEvent('AddToWishlist');
|
|
1234
|
-
}
|
|
1235
|
-
|
|
929
|
+
}
|
|
930
|
+
purchase() {
|
|
1236
931
|
return new RedditStandardEvent('Purchase');
|
|
1237
|
-
}
|
|
1238
|
-
|
|
932
|
+
}
|
|
933
|
+
signup() {
|
|
1239
934
|
return new RedditStandardEvent('SignUp');
|
|
1240
|
-
}
|
|
1241
|
-
|
|
935
|
+
}
|
|
936
|
+
lead() {
|
|
1242
937
|
return new RedditStandardEvent('Lead');
|
|
1243
|
-
}
|
|
1244
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1260
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1261
|
-
|
|
1262
|
-
|
|
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
|
-
|
|
1274
|
-
}());
|
|
956
|
+
}
|
|
957
|
+
}
|
|
1275
958
|
|
|
1276
|
-
|
|
1277
|
-
|
|
959
|
+
class SnapchatBaseEvent {
|
|
960
|
+
constructor(name) {
|
|
1278
961
|
this.name = name;
|
|
1279
962
|
}
|
|
1280
|
-
|
|
1281
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1282
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1316
|
-
|
|
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
|
-
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
class SnapchatStandardEvents {
|
|
979
|
+
pageView() {
|
|
1319
980
|
return new SnapchatStandardEvent('PAGE_VIEW');
|
|
1320
|
-
}
|
|
1321
|
-
|
|
981
|
+
}
|
|
982
|
+
signUp() {
|
|
1322
983
|
return new SnapchatStandardEvent('SIGN_UP');
|
|
1323
|
-
}
|
|
1324
|
-
|
|
984
|
+
}
|
|
985
|
+
purchase() {
|
|
1325
986
|
return new SnapchatStandardEvent('PURCHASE');
|
|
1326
|
-
}
|
|
1327
|
-
|
|
987
|
+
}
|
|
988
|
+
save() {
|
|
1328
989
|
return new SnapchatStandardEvent('SAVE');
|
|
1329
|
-
}
|
|
1330
|
-
|
|
990
|
+
}
|
|
991
|
+
startCheckout() {
|
|
1331
992
|
return new SnapchatStandardEvent('START_CHECKOUT');
|
|
1332
|
-
}
|
|
1333
|
-
|
|
993
|
+
}
|
|
994
|
+
addCart() {
|
|
1334
995
|
return new SnapchatStandardEvent('ADD_CART');
|
|
1335
|
-
}
|
|
1336
|
-
|
|
996
|
+
}
|
|
997
|
+
openApp() {
|
|
1337
998
|
return new SnapchatStandardEvent('OPEN_APP');
|
|
1338
|
-
}
|
|
1339
|
-
|
|
999
|
+
}
|
|
1000
|
+
viewContent() {
|
|
1340
1001
|
return new SnapchatStandardEvent('VIEW_CONTENT');
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1002
|
+
}
|
|
1003
|
+
addBilling() {
|
|
1343
1004
|
return new SnapchatStandardEvent('ADD_BILLING');
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1005
|
+
}
|
|
1006
|
+
search() {
|
|
1346
1007
|
return new SnapchatStandardEvent('SEARCH');
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1008
|
+
}
|
|
1009
|
+
subscribe() {
|
|
1349
1010
|
return new SnapchatStandardEvent('SUBSCRIBE');
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1011
|
+
}
|
|
1012
|
+
adClick() {
|
|
1352
1013
|
return new SnapchatStandardEvent('AD_CLICK');
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1014
|
+
}
|
|
1015
|
+
adView() {
|
|
1355
1016
|
return new SnapchatStandardEvent('AD_VIEW');
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1017
|
+
}
|
|
1018
|
+
completeTutorial() {
|
|
1358
1019
|
return new SnapchatStandardEvent('COMPLETE_TUTORIAL');
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1020
|
+
}
|
|
1021
|
+
invite() {
|
|
1361
1022
|
return new SnapchatStandardEvent('INVITE');
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1023
|
+
}
|
|
1024
|
+
login() {
|
|
1364
1025
|
return new SnapchatStandardEvent('LOGIN');
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1026
|
+
}
|
|
1027
|
+
share() {
|
|
1367
1028
|
return new SnapchatStandardEvent('SHARE');
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1029
|
+
}
|
|
1030
|
+
reserve() {
|
|
1370
1031
|
return new SnapchatStandardEvent('RESERVE');
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1032
|
+
}
|
|
1033
|
+
achievementUnlocked() {
|
|
1373
1034
|
return new SnapchatStandardEvent('ACHIEVEMENT_UNLOCKED');
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1035
|
+
}
|
|
1036
|
+
addToWishlist() {
|
|
1376
1037
|
return new SnapchatStandardEvent('ADD_TO_WISHLIST');
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1038
|
+
}
|
|
1039
|
+
spentCredits() {
|
|
1379
1040
|
return new SnapchatStandardEvent('SPENT_CREDITS');
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1041
|
+
}
|
|
1042
|
+
rate() {
|
|
1382
1043
|
return new SnapchatStandardEvent('RATE');
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1044
|
+
}
|
|
1045
|
+
startTrial() {
|
|
1385
1046
|
return new SnapchatStandardEvent('START_TRIAL');
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1047
|
+
}
|
|
1048
|
+
listView() {
|
|
1388
1049
|
return new SnapchatStandardEvent('LIST_VIEW');
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1050
|
+
}
|
|
1051
|
+
custom1() {
|
|
1391
1052
|
return new SnapchatStandardEvent('CUSTOM_EVENT_1');
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1053
|
+
}
|
|
1054
|
+
custom2() {
|
|
1394
1055
|
return new SnapchatStandardEvent('CUSTOM_EVENT_2');
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1056
|
+
}
|
|
1057
|
+
custom3() {
|
|
1397
1058
|
return new SnapchatStandardEvent('CUSTOM_EVENT_3');
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1059
|
+
}
|
|
1060
|
+
custom4() {
|
|
1400
1061
|
return new SnapchatStandardEvent('CUSTOM_EVENT_4');
|
|
1401
|
-
}
|
|
1402
|
-
|
|
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
|
-
|
|
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(
|
|
1076
|
+
console.error(`Ttq.init: ${ex}`);
|
|
1419
1077
|
}
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1078
|
+
}
|
|
1079
|
+
static getTtq() {
|
|
1422
1080
|
if (global.ttq) {
|
|
1423
1081
|
return global.ttq;
|
|
1424
1082
|
}
|
|
1425
1083
|
console.warn('Missing ttq');
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1084
|
+
}
|
|
1085
|
+
static page() {
|
|
1428
1086
|
try {
|
|
1429
1087
|
Ttq.getTtq().page();
|
|
1430
1088
|
}
|
|
1431
1089
|
catch (ex) {
|
|
1432
|
-
console.error(
|
|
1090
|
+
console.error(`Ttq.page: ${ex}`);
|
|
1433
1091
|
}
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1092
|
+
}
|
|
1093
|
+
track(event, data) {
|
|
1436
1094
|
try {
|
|
1437
|
-
Ttq.getTtq().track(event,
|
|
1095
|
+
Ttq.getTtq().track(event, Object.assign({}, data));
|
|
1438
1096
|
}
|
|
1439
1097
|
catch (ex) {
|
|
1440
|
-
console.error(
|
|
1098
|
+
console.error(`Ttq.track: ${ex}`);
|
|
1441
1099
|
}
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
}());
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1445
1102
|
|
|
1446
|
-
|
|
1447
|
-
|
|
1103
|
+
class TiktokBaseEvent {
|
|
1104
|
+
constructor(name) {
|
|
1448
1105
|
this.name = name;
|
|
1449
1106
|
this.ttq = sdkJs.assertEx(Ttq.instance, 'Missing Ttq');
|
|
1450
1107
|
}
|
|
1451
|
-
|
|
1452
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1453
|
-
|
|
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
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
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
|
-
|
|
1508
|
-
}(TiktokBaseEvent));
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1509
1123
|
|
|
1510
|
-
|
|
1511
|
-
|
|
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
|
-
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
class TiktokStandardEvents {
|
|
1134
|
+
pageView() {
|
|
1514
1135
|
return new TiktokStandardEvent('Browse');
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1136
|
+
}
|
|
1137
|
+
viewContent() {
|
|
1517
1138
|
return new TiktokStandardEvent('ViewContent');
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1139
|
+
}
|
|
1140
|
+
addToCart() {
|
|
1520
1141
|
return new TiktokStandardEvent('AddToCart');
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1142
|
+
}
|
|
1143
|
+
checkout() {
|
|
1523
1144
|
return new TiktokStandardEvent('Checkout');
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1145
|
+
}
|
|
1146
|
+
purchase() {
|
|
1526
1147
|
return new TiktokStandardEvent('Purchase');
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1148
|
+
}
|
|
1149
|
+
registration() {
|
|
1529
1150
|
return new TiktokStandardEvent('Registration');
|
|
1530
|
-
}
|
|
1531
|
-
|
|
1151
|
+
}
|
|
1152
|
+
startCheckout() {
|
|
1532
1153
|
return new TiktokStandardEvent('StartCheckout');
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1154
|
+
}
|
|
1155
|
+
addBilling() {
|
|
1535
1156
|
return new TiktokStandardEvent('AddBilling');
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1157
|
+
}
|
|
1158
|
+
search() {
|
|
1538
1159
|
return new TiktokStandardEvent('Search');
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1160
|
+
}
|
|
1161
|
+
viewForm() {
|
|
1541
1162
|
return new TiktokStandardEvent('ViewForm');
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1163
|
+
}
|
|
1164
|
+
clickForm() {
|
|
1544
1165
|
return new TiktokStandardEvent('ClickForm');
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1166
|
+
}
|
|
1167
|
+
submitForm() {
|
|
1547
1168
|
return new TiktokStandardEvent('SubmitForm');
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1169
|
+
}
|
|
1170
|
+
viewDownloadPage() {
|
|
1550
1171
|
return new TiktokStandardEvent('ViewDownloadPage');
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1172
|
+
}
|
|
1173
|
+
clickInDownloadPage() {
|
|
1553
1174
|
return new TiktokStandardEvent('ClickInDownloadPage');
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1175
|
+
}
|
|
1176
|
+
clickToDownload() {
|
|
1556
1177
|
return new TiktokStandardEvent('ClickToDownload');
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1178
|
+
}
|
|
1179
|
+
clickButton() {
|
|
1559
1180
|
return new TiktokStandardEvent('ClickButton');
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
}());
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1563
1183
|
|
|
1564
|
-
|
|
1565
|
-
|
|
1184
|
+
class XyBaseEvent {
|
|
1185
|
+
constructor(name) {
|
|
1566
1186
|
this.name = name;
|
|
1567
1187
|
}
|
|
1568
|
-
|
|
1569
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1570
|
-
|
|
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
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
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
|
-
|
|
1608
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1609
|
-
|
|
1610
|
-
return
|
|
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
|
-
|
|
1621
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1622
|
-
|
|
1623
|
-
return
|
|
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
|
-
|
|
1634
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1635
|
-
|
|
1636
|
-
return
|
|
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
|
-
|
|
1647
|
-
}());
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1648
1224
|
|
|
1649
|
-
|
|
1650
|
-
|
|
1225
|
+
const MetaMaskEthersLoader = (props) => {
|
|
1226
|
+
const { children, enabled = true } = props;
|
|
1651
1227
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
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
|
-
|
|
1237
|
+
const connect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1662
1238
|
var _a;
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
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',
|
|
1676
|
-
console.log(
|
|
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',
|
|
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
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
react.useEffect(
|
|
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
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
if (
|
|
1705
|
-
|
|
1706
|
-
|
|
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
|
-
|
|
1710
|
-
|
|
1279
|
+
provider = new providers.InfuraProvider(1, infuraKey);
|
|
1280
|
+
providerName = 'Infura (Default)';
|
|
1711
1281
|
}
|
|
1712
|
-
|
|
1713
|
-
setProvider(
|
|
1714
|
-
setProviderName(
|
|
1715
|
-
setWalletProvider(
|
|
1716
|
-
|
|
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
|
-
|
|
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(
|
|
1293
|
+
setSigner(signer);
|
|
1724
1294
|
}
|
|
1725
1295
|
}, [ethereum, isConnected, enabled]);
|
|
1726
|
-
useAsyncEffect(
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
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
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
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
|
-
})
|
|
1776
|
-
|
|
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
|
|
1779
|
-
connect
|
|
1780
|
-
error
|
|
1781
|
-
isConnected
|
|
1782
|
-
localAddress
|
|
1783
|
-
provider
|
|
1784
|
-
providerName
|
|
1327
|
+
chainId,
|
|
1328
|
+
connect,
|
|
1329
|
+
error,
|
|
1330
|
+
isConnected,
|
|
1331
|
+
localAddress,
|
|
1332
|
+
provider,
|
|
1333
|
+
providerName,
|
|
1785
1334
|
signer: isConnected ? signer : undefined,
|
|
1786
|
-
walletProvider
|
|
1335
|
+
walletProvider,
|
|
1787
1336
|
} }, { children: children }), void 0));
|
|
1788
1337
|
};
|
|
1789
1338
|
|
|
1790
|
-
|
|
1791
|
-
|
|
1339
|
+
const MyEtherWalletEthersLoader = (props) => {
|
|
1340
|
+
const { children } = props;
|
|
1792
1341
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
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
|
-
|
|
1350
|
+
const connect = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1802
1351
|
var _a;
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
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
|
-
|
|
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(
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
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
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
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
|
-
})
|
|
1886
|
-
|
|
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
|
|
1889
|
-
connect
|
|
1890
|
-
error
|
|
1891
|
-
isConnected
|
|
1892
|
-
localAddress
|
|
1893
|
-
provider
|
|
1894
|
-
providerName
|
|
1411
|
+
chainId,
|
|
1412
|
+
connect,
|
|
1413
|
+
error,
|
|
1414
|
+
isConnected,
|
|
1415
|
+
localAddress,
|
|
1416
|
+
provider,
|
|
1417
|
+
providerName,
|
|
1895
1418
|
signer: isConnected ? signer : undefined,
|
|
1896
|
-
walletProvider
|
|
1419
|
+
walletProvider,
|
|
1897
1420
|
} }, { children: children }), void 0));
|
|
1898
1421
|
};
|
|
1899
1422
|
|
|
1900
|
-
|
|
1423
|
+
const OperaEthersLoader = (props) => {
|
|
1901
1424
|
var _a, _b, _c, _d, _e, _f;
|
|
1902
|
-
|
|
1425
|
+
const { children } = props;
|
|
1903
1426
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
useAsyncEffect(
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
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
|
-
|
|
1946
|
-
|
|
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
|
|
1949
|
-
error
|
|
1950
|
-
isConnected
|
|
1951
|
-
localAddress
|
|
1952
|
-
provider
|
|
1953
|
-
signer
|
|
1459
|
+
chainId,
|
|
1460
|
+
error,
|
|
1461
|
+
isConnected,
|
|
1462
|
+
localAddress,
|
|
1463
|
+
provider,
|
|
1464
|
+
signer,
|
|
1954
1465
|
} }, { children: children }), void 0));
|
|
1955
1466
|
};
|
|
1956
1467
|
|
|
1957
|
-
|
|
1958
|
-
|
|
1468
|
+
const TrustEthersLoader = (props) => {
|
|
1469
|
+
const { children } = props;
|
|
1959
1470
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
useAsyncEffect(
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
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
|
-
|
|
1994
|
-
|
|
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
|
|
1997
|
-
error
|
|
1998
|
-
localAddress
|
|
1999
|
-
provider
|
|
2000
|
-
signer
|
|
1495
|
+
chainId,
|
|
1496
|
+
error,
|
|
1497
|
+
localAddress,
|
|
1498
|
+
provider,
|
|
1499
|
+
signer,
|
|
2001
1500
|
} }, { children: children }), void 0));
|
|
2002
1501
|
};
|
|
2003
1502
|
|
|
2004
|
-
|
|
1503
|
+
const EthersLoader = (props) => {
|
|
2005
1504
|
var _a, _b, _c, _d;
|
|
2006
1505
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2007
|
-
|
|
2008
|
-
|
|
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
|
-
|
|
1526
|
+
const NetworkSettingsContext = react.createContext({});
|
|
2028
1527
|
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
return (jsxRuntime.jsx(NetworkSettingsContext.Provider,
|
|
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
|
-
|
|
1538
|
+
const UserEventsContext = react.createContext({});
|
|
2040
1539
|
|
|
2041
|
-
|
|
2042
|
-
|
|
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
|
-
|
|
2047
|
-
for (
|
|
2048
|
-
|
|
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
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
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,
|
|
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
|
-
|
|
2078
|
-
var
|
|
2079
|
-
|
|
2080
|
-
|
|
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,
|
|
1598
|
+
return jsxRuntime.jsx(ButtonExBase, Object.assign({ onClick: localOnClick }, props), void 0);
|
|
2087
1599
|
};
|
|
2088
1600
|
|
|
2089
|
-
|
|
2090
|
-
var to = _a
|
|
1601
|
+
const ButtonEx = (_a) => {
|
|
1602
|
+
var { to } = _a, props = __rest(_a, ["to"]);
|
|
2091
1603
|
if (to) {
|
|
2092
|
-
return jsxRuntime.jsx(ButtonExTo,
|
|
1604
|
+
return jsxRuntime.jsx(ButtonExTo, Object.assign({ to: to }, props), void 0);
|
|
2093
1605
|
}
|
|
2094
1606
|
else {
|
|
2095
|
-
return jsxRuntime.jsx(ButtonExBase,
|
|
1607
|
+
return jsxRuntime.jsx(ButtonExBase, Object.assign({}, props), void 0);
|
|
2096
1608
|
}
|
|
2097
1609
|
};
|
|
2098
1610
|
|
|
2099
|
-
|
|
2100
|
-
var
|
|
2101
|
-
|
|
2102
|
-
|
|
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(
|
|
1620
|
+
react.useEffect(() => {
|
|
2109
1621
|
if (acceptOnScroll) {
|
|
2110
1622
|
window.addEventListener('scroll', onScroll);
|
|
2111
|
-
return
|
|
1623
|
+
return () => {
|
|
2112
1624
|
window.removeEventListener('scroll', onScroll);
|
|
2113
1625
|
};
|
|
2114
1626
|
}
|
|
2115
1627
|
});
|
|
2116
|
-
|
|
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(
|
|
1638
|
+
setTimeout(() => {
|
|
2127
1639
|
onAcceptClick();
|
|
2128
1640
|
}, acceptOnTimer);
|
|
2129
1641
|
}
|
|
2130
1642
|
if (!storageName) {
|
|
2131
|
-
return (jsxRuntime.jsx(FlexRow,
|
|
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,
|
|
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
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
return accepted ? null : (jsxRuntime.jsx(CookieConsentBody,
|
|
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
|
-
|
|
1661
|
+
const InvertableThemeContext = react.createContext({
|
|
2150
1662
|
options: {},
|
|
2151
1663
|
});
|
|
2152
1664
|
|
|
2153
|
-
|
|
2154
|
-
var
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
2173
|
-
var
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
return (jsxRuntime.jsxs(FlexCol,
|
|
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
|
-
|
|
2180
|
-
|
|
2181
|
-
for (
|
|
2182
|
-
result.push(
|
|
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
|
-
|
|
1706
|
+
const BreadcrumbsEx = (_a) => {
|
|
2187
1707
|
var _b;
|
|
2188
|
-
var
|
|
2189
|
-
|
|
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),
|
|
2195
|
-
return (jsxRuntime.jsxs(material.Breadcrumbs,
|
|
2196
|
-
|
|
2197
|
-
return (jsxRuntime.jsx(material.Link,
|
|
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
|
-
|
|
1721
|
+
const toAxiosError = (error) => {
|
|
2202
1722
|
return error.isAxiosError ? error : undefined;
|
|
2203
1723
|
};
|
|
2204
|
-
|
|
1724
|
+
const ErrorDialogOpen = (_a) => {
|
|
2205
1725
|
var _b, _c;
|
|
2206
|
-
var
|
|
2207
|
-
|
|
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
|
-
|
|
1730
|
+
const onRetryClicked = () => {
|
|
2211
1731
|
onAction === null || onAction === void 0 ? void 0 : onAction(true);
|
|
2212
1732
|
};
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
return (jsxRuntime.jsxs(material.Dialog,
|
|
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
|
-
|
|
2218
|
-
var
|
|
1737
|
+
const ErrorDialog = (_a) => {
|
|
1738
|
+
var { open, error } = _a, props = __rest(_a, ["open", "error"]);
|
|
2219
1739
|
if (error) {
|
|
2220
|
-
return jsxRuntime.jsx(ErrorDialogOpen,
|
|
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
|
-
|
|
2228
|
-
var
|
|
2229
|
-
return (jsxRuntime.jsxs(material.Dialog,
|
|
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
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
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
|
-
|
|
2257
|
-
|
|
1776
|
+
const useLocalStorage = (key, defaultValue) => {
|
|
1777
|
+
const [storedValue, setStoredValue] = react.useState(() => {
|
|
2258
1778
|
try {
|
|
2259
|
-
|
|
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
|
-
})
|
|
2267
|
-
|
|
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
|
-
|
|
2277
|
-
|
|
2278
|
-
react.useEffect(
|
|
1796
|
+
const useMounted = () => {
|
|
1797
|
+
const [mounted, setMounted] = react.useState(true);
|
|
1798
|
+
react.useEffect(() => {
|
|
2279
1799
|
setMounted(true);
|
|
2280
|
-
return
|
|
1800
|
+
return () => {
|
|
2281
1801
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2282
1802
|
setMounted(false);
|
|
2283
1803
|
};
|
|
2284
1804
|
}, []);
|
|
2285
|
-
return
|
|
1805
|
+
return () => {
|
|
2286
1806
|
return mounted;
|
|
2287
1807
|
};
|
|
2288
1808
|
};
|
|
2289
1809
|
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
1810
|
+
const useNavigateToEthAddress = () => {
|
|
1811
|
+
const navigate = reactRouterDom.useNavigate();
|
|
1812
|
+
const navigateToEthAddress = (address, event, page, to, toOptions, toEtherScan) => {
|
|
2293
1813
|
var _a;
|
|
2294
|
-
|
|
1814
|
+
const openInEtherScan = toEtherScan || (!to && !page);
|
|
2295
1815
|
if (openInEtherScan) {
|
|
2296
|
-
window.open(
|
|
1816
|
+
window.open(`https://etherscan.io/address/${address.toString()}`, '_blank');
|
|
2297
1817
|
}
|
|
2298
1818
|
else {
|
|
2299
|
-
|
|
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
|
|
1828
|
+
return { navigateToEthAddress };
|
|
2309
1829
|
};
|
|
2310
1830
|
|
|
2311
|
-
|
|
2312
|
-
|
|
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
|
-
|
|
2317
|
-
|
|
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
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
useAsyncEffect(
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
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
|
-
})
|
|
1853
|
+
}
|
|
1854
|
+
}), [supportsWebP]);
|
|
2343
1855
|
return img;
|
|
2344
1856
|
};
|
|
2345
|
-
|
|
2346
|
-
return
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
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
|
-
|
|
1867
|
+
const [windowSize, setWindowSize] = react.useState({
|
|
2361
1868
|
height: undefined,
|
|
2362
1869
|
width: undefined,
|
|
2363
|
-
})
|
|
2364
|
-
react.useEffect(
|
|
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
|
|
1880
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
2374
1881
|
}, []);
|
|
2375
1882
|
return windowSize;
|
|
2376
1883
|
}
|
|
2377
1884
|
|
|
2378
|
-
|
|
2379
|
-
var
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
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(
|
|
1894
|
+
window.open(`https://etherscan.io/address/${address.toString()}`, '_blank');
|
|
2388
1895
|
}
|
|
2389
1896
|
};
|
|
2390
|
-
|
|
2391
|
-
|
|
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,
|
|
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
|
-
|
|
2403
|
-
|
|
1909
|
+
const Experiment = (props) => {
|
|
1910
|
+
const { children } = props;
|
|
2404
1911
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: children }, void 0);
|
|
2405
1912
|
};
|
|
2406
1913
|
|
|
2407
|
-
|
|
2408
|
-
|
|
1914
|
+
const OutcomesLocalStorageKey = 'outcomes';
|
|
1915
|
+
const ExperimentsLocalStorageKey = 'experiments';
|
|
2409
1916
|
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
1917
|
+
const defaultLocalStorageKey = 'testData';
|
|
1918
|
+
const experimentsTestData = {};
|
|
1919
|
+
let outcomes = {}; //prevent multi-outcome
|
|
1920
|
+
const saveOutcomes = () => {
|
|
2414
1921
|
setLocalStorageObject(OutcomesLocalStorageKey, outcomes);
|
|
2415
1922
|
};
|
|
2416
|
-
|
|
1923
|
+
const loadOutcomes = () => {
|
|
2417
1924
|
outcomes = getLocalStorageObject(OutcomesLocalStorageKey);
|
|
2418
1925
|
};
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
for (
|
|
2422
|
-
dataArray.push(
|
|
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
|
-
|
|
2428
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
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
|
-
|
|
2462
|
-
|
|
1957
|
+
const saveExperimentDebugRanges = (name, totalWeight, childList) => {
|
|
1958
|
+
const experiments = getLocalStorageObject(ExperimentsLocalStorageKey) || {};
|
|
2463
1959
|
experiments[name] = {
|
|
2464
|
-
totalWeight
|
|
2465
|
-
variants: childList.map(
|
|
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
|
-
|
|
2476
|
-
var
|
|
2477
|
-
|
|
2478
|
-
|
|
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
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
1976
|
+
const localStorageKey = buildLocalStorageKey(localStorageProp);
|
|
1977
|
+
const childList = makeChildrenArray(children);
|
|
1978
|
+
const totalWeight = calcTotalWeight(childList);
|
|
2484
1979
|
saveExperimentDebugRanges(name, totalWeight, childList);
|
|
2485
|
-
|
|
2486
|
-
|
|
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
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
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
|
-
|
|
2499
|
-
|
|
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
|
-
|
|
2005
|
+
const ExperimentsDebugger = (_a) => {
|
|
2521
2006
|
var props = __rest(_a, []);
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
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,
|
|
2528
|
-
}
|
|
2529
|
-
return (jsxRuntime.jsx(FlexCol,
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
{ label:
|
|
2534
|
-
|
|
2535
|
-
|
|
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
|
-
|
|
2541
|
-
return (jsxRuntime.jsxs(FlexCol,
|
|
2542
|
-
|
|
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(
|
|
2546
|
-
} }, void 0) }, void 0)] }),
|
|
2028
|
+
setOutcomes(Object.assign({}, outcomes));
|
|
2029
|
+
} }, void 0) }, void 0)] }), `experiment-${name}`));
|
|
2547
2030
|
}) }), void 0));
|
|
2548
2031
|
};
|
|
2549
2032
|
|
|
2550
|
-
|
|
2551
|
-
var to = _a
|
|
2552
|
-
return jsxRuntime.jsx(material.Link,
|
|
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
|
-
|
|
2038
|
+
const NumberStatus = (_a) => {
|
|
2556
2039
|
var _b, _c;
|
|
2557
|
-
var
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
return (jsxRuntime.jsx(ButtonEx,
|
|
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
|
-
|
|
2568
|
-
var
|
|
2569
|
-
|
|
2570
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.IconButton,
|
|
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
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2074
|
+
const RichResult = (props) => {
|
|
2075
|
+
const { thing } = props;
|
|
2076
|
+
const thingWithContext = thing;
|
|
2576
2077
|
thingWithContext['@context'] = 'https://schema.org';
|
|
2577
|
-
return jsxRuntime.jsx("script",
|
|
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
|
-
|
|
2636
|
-
|
|
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
|
-
|
|
2645
|
-
var
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
return (jsxRuntime.jsx(ButtonEx,
|
|
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;
|