@depay/widgets 4.4.1 → 5.0.0

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.
@@ -1034,6 +1034,8 @@
1034
1034
 
1035
1035
  var ClosableContext = /*#__PURE__*/react.createContext();
1036
1036
 
1037
+ var UpdatableContext = /*#__PURE__*/react.createContext();
1038
+
1037
1039
  var ClosableProvider = (function (props) {
1038
1040
  var _useState = react.useState(true),
1039
1041
  _useState2 = _slicedToArray(_useState, 2),
@@ -1045,11 +1047,15 @@
1045
1047
  open = _useState4[0],
1046
1048
  setOpen = _useState4[1];
1047
1049
 
1050
+ var _useContext = react.useContext(UpdatableContext),
1051
+ setUpdatable = _useContext.setUpdatable;
1052
+
1048
1053
  var close = function close() {
1049
1054
  if (!closable) {
1050
1055
  return;
1051
1056
  }
1052
1057
 
1058
+ setUpdatable(false);
1053
1059
  setOpen(false);
1054
1060
  setTimeout(props.unmount, 300);
1055
1061
  };
@@ -1995,12 +2001,7 @@
1995
2001
  className: "DialogBody"
1996
2002
  }, props.body), /*#__PURE__*/react.createElement("div", {
1997
2003
  className: "DialogFooter"
1998
- }, props.footer, /*#__PURE__*/react.createElement("a", {
1999
- href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
2000
- rel: "noopener noreferrer",
2001
- target: "_blank",
2002
- className: "FooterLink"
2003
- }, "by DePay")));
2004
+ }, props.footer));
2004
2005
  });
2005
2006
 
2006
2007
  var ConnectingWalletDialog = (function (props) {
@@ -2050,9 +2051,9 @@
2050
2051
  className: "TextButton"
2051
2052
  }, "Connect with another wallet")))),
2052
2053
  footer: /*#__PURE__*/react.createElement("div", {
2053
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
2054
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
2054
2055
  }, /*#__PURE__*/react.createElement("button", {
2055
- className: "ButtonPrimary wide",
2056
+ className: "ButtonPrimary",
2056
2057
  onClick: function onClick() {
2057
2058
  return props.connect(wallet);
2058
2059
  }
@@ -30530,6 +30531,8 @@
30530
30531
  var request$1 = async ({ provider, address, api, method, params }) => {
30531
30532
  if (api) {
30532
30533
  return contractCall({ address, api, method, params, provider })
30534
+ } else if (method === 'latestBlockNumber') {
30535
+ return provider.getBlockNumber()
30533
30536
  } else if (method === 'balance') {
30534
30537
  return balance({ address, provider })
30535
30538
  }
@@ -30586,8 +30589,20 @@
30586
30589
  if (typeof url == 'object') {
30587
30590
  return url
30588
30591
  }
30589
- let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<address>[\w\d]+)\/(?<method>[\w\d]+)/);
30590
- return deconstructed.groups
30592
+ let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+))?/);
30593
+
30594
+ if(deconstructed.groups.part2 == undefined) {
30595
+ return {
30596
+ blockchain: deconstructed.groups.blockchain,
30597
+ method: deconstructed.groups.part1
30598
+ }
30599
+ } else {
30600
+ return {
30601
+ blockchain: deconstructed.groups.blockchain,
30602
+ address: deconstructed.groups.part1,
30603
+ method: deconstructed.groups.part2
30604
+ }
30605
+ }
30591
30606
  };
30592
30607
 
30593
30608
  let request = async function (url, options) {
@@ -51568,10 +51583,11 @@
51568
51583
  function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
51569
51584
  class Transaction {
51570
51585
 
51571
- constructor({ blockchain, from, to, api, method, params, value, sent, confirmed, ensured, failed }) {
51586
+ constructor({ blockchain, from, nonce, to, api, method, params, value, sent, confirmed, ensured, failed }) {
51572
51587
 
51573
51588
  this.blockchain = blockchain;
51574
51589
  this.from = from;
51590
+ this.nonce = nonce;
51575
51591
  this.to = to;
51576
51592
  this.api = api;
51577
51593
  this.method = method;
@@ -51679,6 +51695,7 @@
51679
51695
  await executeSubmit$1({ transaction, provider, signer }).then((sentTransaction)=>{
51680
51696
  if (sentTransaction) {
51681
51697
  transaction.id = sentTransaction.hash;
51698
+ transaction.nonce = sentTransaction.nonce;
51682
51699
  transaction.url = Blockchain.findByName(transaction.blockchain).explorerUrlFor({ transaction });
51683
51700
  if (transaction.sent) transaction.sent(transaction);
51684
51701
  sentTransaction.wait(1).then(() => {
@@ -51879,6 +51896,7 @@
51879
51896
  transaction.url = blockchain.explorerUrlFor({ transaction });
51880
51897
  if (transaction.sent) transaction.sent(transaction);
51881
51898
  let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
51899
+ transaction.nonce = sentTransaction.nonce;
51882
51900
  if(!sentTransaction) {
51883
51901
  transaction._failed = true;
51884
51902
  console.log('Error retrieving transaction');
@@ -52166,7 +52184,7 @@
52166
52184
  return connect(wallet);
52167
52185
  }
52168
52186
  }, /*#__PURE__*/react.createElement("div", {
52169
- className: "CardImage PaddingLeftM"
52187
+ className: "CardImage"
52170
52188
  }, /*#__PURE__*/react.createElement("img", {
52171
52189
  src: wallet.logo
52172
52190
  })), /*#__PURE__*/react.createElement("div", {
@@ -52179,9 +52197,9 @@
52179
52197
  });
52180
52198
  return /*#__PURE__*/react.createElement(Dialog, {
52181
52199
  header: /*#__PURE__*/react.createElement("div", {
52182
- className: "PaddingTopS PaddingLeftM PaddingRightM"
52200
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
52183
52201
  }, /*#__PURE__*/react.createElement("h1", {
52184
- className: "LineHeightL FontSizeL TextLeft"
52202
+ className: "LineHeightL FontSizeL"
52185
52203
  }, "Select a wallet")),
52186
52204
  body: /*#__PURE__*/react.createElement("div", {
52187
52205
  className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
@@ -52189,11 +52207,13 @@
52189
52207
  footer: /*#__PURE__*/react.createElement("div", {
52190
52208
  className: "PaddingBottomS"
52191
52209
  }, /*#__PURE__*/react.createElement("button", {
52192
- className: "FontSizeS FontWeightBold TextGrey TextButton",
52210
+ className: "FontSizeS FontWeightBold TextButton",
52193
52211
  onClick: function onClick() {
52194
52212
  return setShowExplanation(!showExplanation);
52195
52213
  }
52196
- }, /*#__PURE__*/react.createElement("strong", null, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
52214
+ }, /*#__PURE__*/react.createElement("strong", {
52215
+ className: "Opacity05"
52216
+ }, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
52197
52217
  className: "PaddingLeftM PaddingRightM"
52198
52218
  }, "Wallets are used to send, receive, and store digital assets. Wallets come in many forms. They are either built into your browser, an extension added to your browser, a piece of hardware plugged into your computer or even an app on your phone."))
52199
52219
  });
@@ -52471,7 +52491,7 @@
52471
52491
  })), /*#__PURE__*/react.createElement("div", {
52472
52492
  className: "DialogBody"
52473
52493
  }, /*#__PURE__*/react.createElement("div", {
52474
- className: "GraphicWrapper"
52494
+ className: "GraphicWrapper PaddingTopS"
52475
52495
  }, /*#__PURE__*/react.createElement("img", {
52476
52496
  className: "Graphic",
52477
52497
  src: ErrorGraphic
@@ -52489,15 +52509,12 @@
52489
52509
  className: "FontSizeM PaddingTopS"
52490
52510
  }, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
52491
52511
  className: "DialogFooter"
52492
- }, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
52512
+ }, /*#__PURE__*/react.createElement("div", {
52513
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
52514
+ }, /*#__PURE__*/react.createElement("button", {
52493
52515
  className: "ButtonPrimary",
52494
52516
  onClick: close
52495
- }, "Try again")), /*#__PURE__*/react.createElement("a", {
52496
- href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
52497
- rel: "noopener noreferrer",
52498
- target: "_blank",
52499
- className: "FooterLink"
52500
- }, "by DePay"))));
52517
+ }, "Try again")))));
52501
52518
  } else {
52502
52519
  return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
52503
52520
  value: {
@@ -52509,28 +52526,28 @@
52509
52526
  }
52510
52527
  });
52511
52528
 
52529
+ var BlockchainLogoStyle = (function (style) {
52530
+ return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
52531
+ });
52532
+
52512
52533
  var ButtonCircularStyle = (function () {
52513
52534
  return "\n\n .ButtonCircular {\n border-radius: 99rem;\n cursor: pointer;\n height: 34px;\n opacity: 0.5;\n padding: 5px 4px 4px 4px;\n width: 34px;\n }\n\n .ButtonCircular:hover {\n background: rgba(0,0,0,0.1);\n opacity: 1;\n }\n\n .ButtonCircular:active {\n background: rgba(0,0,0,0.25);\n opacity: 1;\n }\n ";
52514
52535
  });
52515
52536
 
52516
52537
  var ButtonPrimaryStyle = (function (style) {
52517
- return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius: 9999rem;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 1.3rem;\n font-weight: 400;\n height: 2.8rem;\n line-height: 2.8rem;\n justify-content: center;\n min-width: 12rem;\n overflow: hidden;\n padding: 0 1.4rem;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(style.colors.buttonText, ";\n }\n\n .ButtonPrimary.round {\n padding: 0;\n width: 3.4rem;\n min-width: 3.4rem;\n }\n\n .ButtonPrimary.wide {\n border-radius: 0.8rem;\n width: 100%;\n display: block;\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ");
52538
+ return "\n\n .ButtonPrimary {\n align-items: center;\n align-self: center;\n background: ".concat(style.colors.primary, ";\n border-radius: 0.8rem;\n border: 1px solid transparent;\n box-shadow: 0 0 16px rgba(0,0,0,0.1);\n font-size: 1.3rem;\n font-weight: 400;\n line-height: 2.8rem;\n height: 3.6rem;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n padding: 0.4rem 0;\n position: relative;\n text-align: center;\n text-decoration: none;\n text-overflow: ellipsis;\n transition: background 0.1s;\n vertical-align: middle;\n display: inline-block;\n }\n\n .ButtonPrimary, .ButtonPrimary * {\n color: ").concat(style.colors.buttonText, ";\n }\n\n .ButtonPrimary.disabled {\n background: rgb(210,210,210);\n color: rgb(140,140,140);\n }\n\n .ButtonPrimary:not(.disabled){\n cursor: pointer;\n }\n .ButtonPrimary:not(.disabled):hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.1);\n }\n .ButtonPrimary:not(.disabled):active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n ");
52518
52539
  });
52519
52540
 
52520
52541
  var CardStyle = (function (style) {
52521
- return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.6rem 0.6rem;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.1rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
52542
+ return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.5rem 0.5rem;\n margin: 0;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 3.6rem;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.1rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
52522
52543
  });
52523
52544
 
52524
52545
  var DialogStyle = (function (style) {
52525
- return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .FooterLink {\n bottom: 0;\n left: 0;\n position: absolute;\n padding-bottom: 1rem;\n right: 0;\n width: 100%;\n }\n\n .DialogFooter {\n padding-bottom: 50px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !important;\n max-height: 66vh !important;\n top: inherit !important;\n transition: opacity 0.4s ease, bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n .DialogBody {\n background: rgb(248,248,248);\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.HeightAuto {\n height: auto;\n }\n\n .DialogHeader {\n background: rgb(248,248,248);\n border-top-left-radius: 0.8rem;\n border-top-right-radius: 0.8rem;\n display: flex;\n flex-direction: row;\n position: relative;\n }\n\n .DialogHeaderTitle {\n flex-basis: auto;\n flex-grow: 1;\n }\n \n .DialogHeaderAction {\n height: 3rem;\n }\n\n .DialogFooter {\n background: rgb(248,248,248);\n border-bottom-left-radius: 0.8rem;\n border-bottom-right-radius: 0.8rem;\n line-height: 1.5rem;\n min-height: 2rem;\n position: relative;\n text-align: center;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n display: table;\n }\n\n ";
52546
+ return "\n\n .ReactDialogBackground {\n backdrop-filter: blur(5px);\n background: rgba(0,0,0,0.7);\n }\n\n .Dialog {\n margin: 0 auto;\n position: relative;\n width: 420px;\n box-shadow: 0 0 20px rgba(0,0,0,0.1);\n border-radius: 0.8rem;\n }\n\n @media screen and (max-width: 450px) {\n \n .Dialog, .ReactDialogAnimation {\n width: 100%;\n }\n\n }\n\n @media (orientation: portrait) and (max-width: 900px) {\n\n .Dialog {\n align-content: stretch;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n .DialogBody {\n flex: 1;\n align-items: flex-end;\n max-height: 40vh !important;\n }\n\n .DialogFooter {\n padding-bottom: 50px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !important;\n max-height: 66vh !important;\n top: inherit !important;\n transition: opacity 0.4s ease, bottom 0.4s ease;\n }\n\n .ReactDialog.ReactDialogOpen .ReactDialogAnimation {\n bottom: 0px !important;\n }\n\n .DialogFooter {\n border-bottom-left-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n }\n }\n\n .DialogBody {\n background: rgb(248,248,248);\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .DialogBody.HeightAuto {\n height: auto;\n }\n\n .DialogHeader {\n background: rgb(248,248,248);\n border-top-left-radius: 0.8rem;\n border-top-right-radius: 0.8rem;\n display: flex;\n flex-direction: row;\n position: relative;\n }\n\n .DialogHeaderTitle {\n flex-basis: auto;\n flex-grow: 1;\n }\n \n .DialogHeaderAction {\n height: 3rem;\n }\n\n .DialogFooter {\n background: rgb(248,248,248);\n border-bottom-left-radius: 0.8rem;\n border-bottom-right-radius: 0.8rem;\n line-height: 1.5rem;\n min-height: 2rem;\n position: relative;\n text-align: center;\n }\n\n .ReactShadowDOMInsideContainer > .ReactDialog {\n display: table;\n }\n\n ";
52526
52547
  });
52527
52548
 
52528
52549
  var FontStyle = (function (style) {
52529
- return "\n\n .Dialog, * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 1rem;\n }\n\n .FontSizeM {\n font-size: 1.2rem;\n }\n\n .FontSizeL {\n font-size: 1.4rem;\n }\n\n .FontSizeXL {\n font-size: 2.0rem;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
52530
- });
52531
-
52532
- var FooterStyle = (function (style) {
52533
- return "\n\n .FooterLink {\n color: rgba(0,0,0,0.2);\n display: inline-block;\n font-size: 0.9rem;\n text-decoration: none;\n }\n\n .FooterLink:hover, .FooterLink:active {\n color: ".concat(style.colors.primary, ";\n }\n ");
52550
+ return "\n\n *, div, div * {\n font-family: ".concat(style.fontFamily, ";\n }\n\n .FontSizeS {\n font-size: 1rem;\n }\n\n .FontSizeM {\n font-size: 1.2rem;\n }\n\n .FontSizeL {\n font-size: 1.4rem;\n }\n\n .FontSizeXL {\n font-size: 2.0rem;\n }\n\n .FontWeightBold {\n font-weight: bold;\n }\n\n .FontItalic {\n font-style: italic;\n }\n ");
52534
52551
  });
52535
52552
 
52536
52553
  var GraphicStyle = (function () {
@@ -52542,7 +52559,7 @@
52542
52559
  });
52543
52560
 
52544
52561
  var IconStyle = (function (style) {
52545
- return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 1.4rem;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 1.4rem;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n \n ");
52562
+ return "\n\n .Icon {\n fill : ".concat(style.colors.icons, ";\n stroke : ").concat(style.colors.icons, ";\n }\n\n .ChevronLeft, .ChevronRight {\n position: relative;\n top: 1px;\n }\n\n .Checkmark {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .CheckMark.small {\n height: 16px;\n width: 16px;\n }\n\n .DigitalWalletIcon {\n height: 24px;\n position: relative;\n top: -1px;\n vertical-align: middle;\n width: 24px;\n }\n\n .ButtonPrimary .Icon {\n fill : ").concat(style.colors.buttonText, ";\n stroke : ").concat(style.colors.buttonText, ";\n }\n\n .Loading {\n border: 3px solid ").concat(style.colors.primary, ";\n border-top: 3px solid rgba(0,0,0,0.1);\n border-radius: 100%;\n position: relative;\n left: -1px;\n width: 18px;\n height: 18px;\n animation: spin 1.5s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ");
52546
52563
  });
52547
52564
 
52548
52565
  var ImageStyle = (function (style) {
@@ -52561,10 +52578,18 @@
52561
52578
  return "\n\n .LoadingText {\n color: ".concat(style.colors.buttonText, ";\n display: inline-block;\n text-decoration: none;\n }\n\n @keyframes blink {\n 0% { opacity: .2; }\n 20% { opacity: 1; }\n 100% { opacity: .2; }\n }\n \n .LoadingText .dot {\n animation-name: blink;\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n }\n \n .LoadingText .dot:nth-child(2) {\n animation-delay: .2s;\n }\n \n .LoadingText .dot:nth-child(3) {\n animation-delay: .4s;\n }\n ");
52562
52579
  });
52563
52580
 
52581
+ var OpacityStyle = (function (style) {
52582
+ return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
52583
+ });
52584
+
52564
52585
  var PaddingStyle = (function () {
52565
52586
  return "\n\n .PaddingTopXS {\n padding-top: 0.2rem;\n }\n\n .PaddingRightXS {\n padding-right: 0.2rem;\n }\n\n .PaddingBottomXS {\n padding-bottom: 0.2rem;\n }\n\n .PaddingLeftXS {\n padding-left: 0.2rem; \n }\n\n .PaddingTopS {\n padding-top: 0.8rem;\n }\n\n .PaddingRightS {\n padding-right: 0.8rem;\n }\n\n .PaddingBottomS {\n padding-bottom: 0.8rem;\n }\n\n .PaddingLeftS {\n padding-left: 0.8rem; \n }\n\n .PaddingTopM {\n padding-top: 1.2rem;\n }\n\n .PaddingRightM {\n padding-right: 1.2rem;\n }\n\n .PaddingBottomM {\n padding-bottom: 1.2rem;\n }\n\n .PaddingLeftM {\n padding-left: 1.2rem; \n }\n\n .PaddingTopL {\n padding-top: 1.8rem;\n }\n\n .PaddingRightL {\n padding-right: 1.8rem;\n }\n\n .PaddingBottomL {\n padding-bottom: 1.8rem;\n }\n\n .PaddingLeftL {\n padding-left: 1.28em; \n }\n ";
52566
52587
  });
52567
52588
 
52589
+ var PoweredByStyle = (function (style) {
52590
+ return "\n\n .PoweredByWrapper {\n display: block;\n left: 0;\n padding-top: 0.2rem;\n position: fixed;\n right: 0;\n text-align: center;\n top: 0;\n }\n\n .PoweredByLink {\n color: white;\n opacity: 0.4;\n display: inline-block;\n font-size: 0.78rem;\n font-style: italic;\n font-weight: bold;\n letter-spacing: -0.2px;\n margin-left: 0.5rem;\n text-decoration: none;\n }\n\n .PoweredByLink:hover, .PoweredByLink:active {\n opacity: 1.0;\n color: ".concat(style.colors.primary, ";\n }\n ");
52591
+ });
52592
+
52568
52593
  var RangeSliderStyle = (function (style) {
52569
52594
  return "\n\n .rangeslider {\n margin: 20px 0;\n position: relative;\n background: #e6e6e6;\n -ms-touch-action: none;\n touch-action: none;\n }\n\n .rangeslider,\n .rangeslider__fill {\n display: block;\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);\n }\n\n .rangeslider__handle {\n outline: none;\n cursor: pointer;\n display: inline-block;\n position: absolute;\n border-radius: 50%;\n background-color: " + style.colors.primary + ";\n border: 1px solid white;\n box-shadow: 0 0 8px rgba(0,0,0,0.1);\n }\n\n .rangeslider__handle:hover {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.2);\n }\n\n .rangeslider__handle:active {\n box-shadow: inset 0 0 300px rgba(0,0,0,0.3);\n }\n\n .rangeslider__active {\n opacity: 1;\n }\n\n .rangeslider__handle-tooltip {\n display: none;\n }\n\n .rangeslider-horizontal {\n height: 12px;\n border-radius: 10px;\n }\n\n .rangeslider-horizontal .rangeslider__fill {\n height: 100%;\n background-color: " + style.colors.primary + ";\n border-radius: 10px;\n top: 0;\n }\n .rangeslider-horizontal .rangeslider__handle {\n width: 18px;\n height: 18px;\n border-radius: 30px;\n top: 50%;\n transform: translate3d(-50%, -50%, 0);\n }\n\n\n .rangeslider-horizontal .rangeslider__handle-tooltip {\n top: -55px;\n }\n\n ";
52570
52595
  });
@@ -52574,15 +52599,15 @@
52574
52599
  });
52575
52600
 
52576
52601
  var SkeletonStyle = (function () {
52577
- return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
52602
+ return "\n \n .Skeleton {\n background: rgb(230,230,230) !important;\n border: 0px solid transparent !important;\n box-shadow: none !important;\n cursor: inherit !important;\n line-height: 0;\n overflow: hidden;\n position: relative;\n }\n\n @keyframes SkeletonBackgroundAnimation {\n from {\n left: -500px;\n }\n to {\n left: +120%;\n }\n }\n\n .SkeletonBackground {\n animation: 2s SkeletonBackgroundAnimation 0.2s ease infinite;\n background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.1) 50%, transparent 100%);\n height: 100%;\n left: -140%;\n position: absolute;\n top: 0;\n width: 400px;\n }\n\n .SkeletonWrapper {\n line-height: 0;\n }\n ";
52578
52603
  });
52579
52604
 
52580
52605
  var TextButtonStyle = (function (style) {
52581
- return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton.TextGrey {\n color: grey;\n }\n \n .TextButton.TextGrey:hover {\n color: ").concat(style.colors.primary, "\n }\n ");
52606
+ return "\n\n .TextButton {\n cursor: pointer;\n font-size: 16px;\n color: ".concat(style.colors.primary, "\n }\n\n .TextButton:hover * {\n opacity: 1.0;\n }\n ");
52582
52607
  });
52583
52608
 
52584
52609
  var TextStyle = (function (style) {
52585
- return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .TextGrey {\n color: grey;\n }\n\n .LineHeightL {\n line-height: 2.0rem;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 1.2rem;\n border: 0.5rem solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 0.9rem;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ");
52610
+ return "\n\n * {\n color: ".concat(style.colors.text, ";\n }\n\n h1, h2, h3, h4, h5, h6 {\n display: block;\n }\n\n .TextLeft, .TextLeft * {\n text-align: left;\n }\n\n .TextCenter, .TextCenter * {\n text-align: center;\n }\n\n .LineHeightL {\n line-height: 2.0rem;\n }\n\n .ErrorSnippetText {\n background: rgb(30, 30, 20);\n border-radius: 1.2rem;\n border: 0.5rem solid rgb(30, 30, 20);\n color: #00FF41;\n font-size: 0.9rem;\n font-style: italic;\n max-height: 100px;\n padding: 6px;\n overflow-wrap: break-word;\n overflow-y: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n ");
52586
52611
  });
52587
52612
 
52588
52613
  var TokenAmountStyle = (function () {
@@ -52599,7 +52624,7 @@
52599
52624
  },
52600
52625
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
52601
52626
  }, style);
52602
- return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), FooterStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), IconStyle(style), PaddingStyle(), HeightStyle(), LabelStyle(style), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle()].join('');
52627
+ return [ResetStyle(), FontStyle(style), DialogStyle(), ButtonCircularStyle(), ButtonPrimaryStyle(style), CardStyle(style), PoweredByStyle(style), GraphicStyle(), SkeletonStyle(), TokenAmountStyle(), TextStyle(style), IconStyle(style), OpacityStyle(), PaddingStyle(), HeightStyle(), LabelStyle(style), LoadingTextStyle(style), RangeSliderStyle(style), InputStyle(), TextButtonStyle(style), ImageStyle(), BlockchainLogoStyle()].join('');
52603
52628
  });
52604
52629
 
52605
52630
  function _interopDefaultLegacy$2 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -52719,6 +52744,31 @@
52719
52744
  return unmount;
52720
52745
  });
52721
52746
 
52747
+ var PoweredBy = (function () {
52748
+ return /*#__PURE__*/react.createElement("div", {
52749
+ className: "PoweredByWrapper"
52750
+ }, /*#__PURE__*/react.createElement("a", {
52751
+ href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
52752
+ rel: "noopener noreferrer",
52753
+ target: "_blank",
52754
+ className: "PoweredByLink"
52755
+ }, "by DePay"));
52756
+ });
52757
+
52758
+ var UpdatableProvider = (function (props) {
52759
+ var _useState = react.useState(true),
52760
+ _useState2 = _slicedToArray(_useState, 2),
52761
+ updatable = _useState2[0],
52762
+ setUpdatable = _useState2[1];
52763
+
52764
+ return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
52765
+ value: {
52766
+ updatable: updatable,
52767
+ setUpdatable: setUpdatable
52768
+ }
52769
+ }, props.children);
52770
+ });
52771
+
52722
52772
  var Connect = function Connect(options) {
52723
52773
  var style, error, document;
52724
52774
 
@@ -52774,7 +52824,7 @@
52774
52824
  error: error,
52775
52825
  container: container,
52776
52826
  unmount: unmount
52777
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
52827
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
52778
52828
  unmount: rejectBeforeUnmount
52779
52829
  }, /*#__PURE__*/react.createElement(ConnectStack, {
52780
52830
  document: document,
@@ -52782,7 +52832,7 @@
52782
52832
  resolve: resolve,
52783
52833
  reject: reject,
52784
52834
  autoClose: true
52785
- })));
52835
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))));
52786
52836
  };
52787
52837
  });
52788
52838
 
@@ -65369,7 +65419,9 @@
65369
65419
  }, /*#__PURE__*/react.createElement("strong", {
65370
65420
  className: "FontSizeM"
65371
65421
  }, "We were not able to find any asset of value in your wallet. Please top up your account in order to proceed with this payment."))),
65372
- footer: /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
65422
+ footer: /*#__PURE__*/react.createElement("div", {
65423
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
65424
+ }, /*#__PURE__*/react.createElement("button", {
65373
65425
  className: "ButtonPrimary",
65374
65426
  onClick: close
65375
65427
  }, "Ok"))
@@ -65380,7 +65432,7 @@
65380
65432
 
65381
65433
  var PaymentRoutingContext = /*#__PURE__*/react.createContext();
65382
65434
 
65383
- var UpdateContext = /*#__PURE__*/react.createContext();
65435
+ var TrackingContext = /*#__PURE__*/react.createContext();
65384
65436
 
65385
65437
  var PaymentProvider = (function (props) {
65386
65438
  var _useContext = react.useContext(ErrorContext),
@@ -65389,7 +65441,6 @@
65389
65441
  var _useContext2 = react.useContext(ConfigurationContext),
65390
65442
  _sent = _useContext2.sent,
65391
65443
  _confirmed = _useContext2.confirmed,
65392
- _ensured = _useContext2.ensured,
65393
65444
  _failed = _useContext2.failed;
65394
65445
 
65395
65446
  var _useContext3 = react.useContext(PaymentRoutingContext),
@@ -65403,13 +65454,17 @@
65403
65454
  var _useContext5 = react.useContext(PaymentRoutingContext),
65404
65455
  allRoutes = _useContext5.allRoutes;
65405
65456
 
65406
- var _useContext6 = react.useContext(UpdateContext);
65407
- _useContext6.update;
65408
- var setUpdate = _useContext6.setUpdate;
65457
+ var _useContext6 = react.useContext(UpdatableContext),
65458
+ setUpdatable = _useContext6.setUpdatable;
65409
65459
 
65410
65460
  var _useContext7 = react.useContext(WalletContext),
65411
65461
  wallet = _useContext7.wallet;
65412
65462
 
65463
+ var _useContext8 = react.useContext(TrackingContext),
65464
+ forward = _useContext8.forward,
65465
+ tracking = _useContext8.tracking,
65466
+ initializeTracking = _useContext8.initializeTracking;
65467
+
65413
65468
  var _useState = react.useState(),
65414
65469
  _useState2 = _slicedToArray(_useState, 2),
65415
65470
  payment = _useState2[0],
@@ -65430,53 +65485,81 @@
65430
65485
  paymentState = _useState8[0],
65431
65486
  setPaymentState = _useState8[1];
65432
65487
 
65433
- var pay = function pay(_ref) {
65434
- var navigate = _ref.navigate;
65435
- setClosable(false);
65436
- setPaymentState('paying');
65437
- setUpdate(false);
65438
- wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
65439
- sent: function sent(transaction) {
65440
- if (_sent) {
65441
- _sent(transaction);
65442
- }
65443
- },
65444
- confirmed: function confirmed(transaction) {
65445
- setClosable(true);
65446
- setPaymentState('confirmed');
65488
+ var pay = /*#__PURE__*/function () {
65489
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
65490
+ var navigate, currentBlock;
65491
+ return regenerator.wrap(function _callee$(_context) {
65492
+ while (1) {
65493
+ switch (_context.prev = _context.next) {
65494
+ case 0:
65495
+ navigate = _ref.navigate;
65496
+ setClosable(false);
65497
+ setPaymentState('paying');
65498
+ setUpdatable(false);
65499
+ _context.next = 6;
65500
+ return request({
65501
+ blockchain: payment.route.transaction.blockchain,
65502
+ method: 'latestBlockNumber'
65503
+ });
65447
65504
 
65448
- if (_confirmed) {
65449
- _confirmed(transaction);
65450
- }
65451
- },
65452
- ensured: function ensured(transaction) {
65453
- if (_ensured) {
65454
- _ensured(transaction);
65455
- }
65456
- },
65457
- failed: function failed(transaction, error) {
65458
- if (_failed) {
65459
- _failed(transaction, error);
65460
- }
65505
+ case 6:
65506
+ currentBlock = _context.sent;
65507
+ wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
65508
+ sent: function sent(transaction) {
65509
+ if (_sent) {
65510
+ _sent(transaction);
65511
+ }
65512
+ },
65513
+ confirmed: function confirmed(transaction) {
65514
+ if (tracking != true) {
65515
+ setClosable(true);
65516
+ }
65461
65517
 
65462
- setPaymentState('initialized');
65463
- setClosable(true);
65464
- setUpdate(true);
65465
- navigate('PaymentError');
65466
- }
65467
- })).then(function (sentTransaction) {
65468
- setTransaction(sentTransaction);
65469
- })["catch"](function (error) {
65470
- console.log('error', error);
65471
- setPaymentState('initialized');
65472
- setClosable(true);
65473
- setUpdate(true);
65518
+ setPaymentState('confirmed');
65474
65519
 
65475
- if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
65476
- navigate('WrongNetwork');
65477
- }
65478
- });
65479
- };
65520
+ if (_confirmed) {
65521
+ _confirmed(transaction);
65522
+ }
65523
+ },
65524
+ failed: function failed(transaction, error) {
65525
+ if (_failed) {
65526
+ _failed(transaction, error);
65527
+ }
65528
+
65529
+ setPaymentState('initialized');
65530
+ setClosable(true);
65531
+ setUpdatable(true);
65532
+ navigate('PaymentError');
65533
+ }
65534
+ })).then(function (sentTransaction) {
65535
+ if (tracking) {
65536
+ initializeTracking(sentTransaction, currentBlock);
65537
+ }
65538
+
65539
+ setTransaction(sentTransaction);
65540
+ })["catch"](function (error) {
65541
+ console.log('error', error);
65542
+ setPaymentState('initialized');
65543
+ setClosable(true);
65544
+ setUpdatable(true);
65545
+
65546
+ if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
65547
+ navigate('WrongNetwork');
65548
+ }
65549
+ });
65550
+
65551
+ case 8:
65552
+ case "end":
65553
+ return _context.stop();
65554
+ }
65555
+ }
65556
+ }, _callee);
65557
+ }));
65558
+
65559
+ return function pay(_x) {
65560
+ return _ref2.apply(this, arguments);
65561
+ };
65562
+ }();
65480
65563
 
65481
65564
  var approve = function approve() {
65482
65565
  setClosable(false);
@@ -65497,15 +65580,20 @@
65497
65580
  });
65498
65581
  };
65499
65582
 
65583
+ react.useEffect(function () {
65584
+ if (forward) {
65585
+ setPaymentState('confirmed');
65586
+ }
65587
+ }, [forward]);
65500
65588
  react.useEffect(function () {
65501
65589
  if (selectedRoute) {
65502
65590
  var fromToken = selectedRoute.fromToken;
65503
65591
  selectedRoute.transaction.params;
65504
- Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref2) {
65505
- var _ref3 = _slicedToArray(_ref2, 3),
65506
- name = _ref3[0],
65507
- symbol = _ref3[1],
65508
- amount = _ref3[2];
65592
+ Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
65593
+ var _ref4 = _slicedToArray(_ref3, 3),
65594
+ name = _ref4[0],
65595
+ symbol = _ref4[1],
65596
+ amount = _ref4[2];
65509
65597
 
65510
65598
  setPayment({
65511
65599
  route: selectedRoute,
@@ -65521,9 +65609,9 @@
65521
65609
  }, [selectedRoute]);
65522
65610
  react.useEffect(function () {
65523
65611
  if (allRoutes && allRoutes.length == 0) {
65524
- setUpdate(false);
65612
+ setUpdatable(false);
65525
65613
  } else if (allRoutes && allRoutes.length > 0) {
65526
- setUpdate(true);
65614
+ setUpdatable(true);
65527
65615
  }
65528
65616
  }, [allRoutes]);
65529
65617
 
@@ -70345,8 +70433,8 @@
70345
70433
  var _useContext = react.useContext(WalletContext),
70346
70434
  account = _useContext.account;
70347
70435
 
70348
- var _useContext2 = react.useContext(UpdateContext),
70349
- update = _useContext2.update;
70436
+ var _useContext2 = react.useContext(UpdatableContext),
70437
+ updatable = _useContext2.updatable;
70350
70438
 
70351
70439
  var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
70352
70440
  var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
@@ -70361,9 +70449,9 @@
70361
70449
  var getPaymentRoutes = function getPaymentRoutes(_ref) {
70362
70450
  var allRoutes = _ref.allRoutes,
70363
70451
  selectedRoute = _ref.selectedRoute,
70364
- update = _ref.update;
70452
+ updatable = _ref.updatable;
70365
70453
 
70366
- if (update == false || !props.accept || !account) {
70454
+ if (updatable == false || !props.accept || !account) {
70367
70455
  return;
70368
70456
  }
70369
70457
 
@@ -70466,13 +70554,13 @@
70466
70554
  getPaymentRoutes({
70467
70555
  allRoutes: allRoutes,
70468
70556
  selectedRoute: selectedRoute,
70469
- update: update
70557
+ updatable: updatable
70470
70558
  });
70471
70559
  }, 15000);
70472
70560
  return function () {
70473
70561
  return clearTimeout(timeout);
70474
70562
  };
70475
- }, [reloadCount, allRoutes, selectedRoute, update]);
70563
+ }, [reloadCount, allRoutes, selectedRoute, updatable]);
70476
70564
  react.useEffect(function () {
70477
70565
  if (account && props.accept) {
70478
70566
  setAllRoutes(undefined);
@@ -70502,8 +70590,8 @@
70502
70590
  var _useContext2 = react.useContext(WalletContext),
70503
70591
  account = _useContext2.account;
70504
70592
 
70505
- var _useContext3 = react.useContext(UpdateContext),
70506
- update = _useContext3.update;
70593
+ var _useContext3 = react.useContext(UpdatableContext),
70594
+ updatable = _useContext3.updatable;
70507
70595
 
70508
70596
  var _useContext4 = react.useContext(PaymentContext),
70509
70597
  payment = _useContext4.payment;
@@ -70522,10 +70610,10 @@
70522
70610
  setReloadCount = _useState4[1];
70523
70611
 
70524
70612
  var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
70525
- var update = _ref.update,
70613
+ var updatable = _ref.updatable,
70526
70614
  payment = _ref.payment;
70527
70615
 
70528
- if (update == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
70616
+ if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
70529
70617
  return;
70530
70618
  }
70531
70619
 
@@ -70568,7 +70656,7 @@
70568
70656
  react.useEffect(function () {
70569
70657
  if (account && payment) {
70570
70658
  getToTokenLocalValue({
70571
- update: update,
70659
+ updatable: updatable,
70572
70660
  payment: payment
70573
70661
  });
70574
70662
  }
@@ -70577,13 +70665,13 @@
70577
70665
  var timeout = setTimeout(function () {
70578
70666
  setReloadCount(reloadCount + 1);
70579
70667
  getToTokenLocalValue({
70580
- update: update
70668
+ updatable: updatable
70581
70669
  });
70582
70670
  }, 15000);
70583
70671
  return function () {
70584
70672
  return clearTimeout(timeout);
70585
70673
  };
70586
- }, [reloadCount, update]);
70674
+ }, [reloadCount, updatable]);
70587
70675
  return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
70588
70676
  value: {
70589
70677
  paymentValue: paymentValue
@@ -72470,7 +72558,9 @@
72470
72558
  changeAmount(toValidValue(maxAmount));
72471
72559
  }
72472
72560
  }, "(Max)")))))),
72473
- footer: /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
72561
+ footer: /*#__PURE__*/react.createElement("div", {
72562
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72563
+ }, /*#__PURE__*/react.createElement("button", {
72474
72564
  className: "ButtonPrimary",
72475
72565
  onClick: changeAmountAndGoBack
72476
72566
  }, "Done"))
@@ -72557,6 +72647,7 @@
72557
72647
  }, [allRoutes]);
72558
72648
  react.useEffect(function () {
72559
72649
  setCards(allPaymentRoutesWithData.map(function (payment, index) {
72650
+ var blockchain = Blockchain.findByName(payment.route.blockchain);
72560
72651
  return /*#__PURE__*/react.createElement("div", {
72561
72652
  key: index,
72562
72653
  className: "Card",
@@ -72570,6 +72661,11 @@
72570
72661
  }, /*#__PURE__*/react.createElement(TokenImage_1, {
72571
72662
  blockchain: payment.route.blockchain,
72572
72663
  address: payment.route.fromToken.address
72664
+ }), /*#__PURE__*/react.createElement("img", {
72665
+ className: "BlockchainLogo small",
72666
+ src: blockchain.logo,
72667
+ alt: blockchain.label,
72668
+ title: blockchain.label
72573
72669
  })), /*#__PURE__*/react.createElement("div", {
72574
72670
  className: "CardBody"
72575
72671
  }, /*#__PURE__*/react.createElement("div", {
@@ -72610,25 +72706,12 @@
72610
72706
  });
72611
72707
  });
72612
72708
 
72613
- var Checkmark = (function () {
72614
- return /*#__PURE__*/react.createElement("svg", {
72615
- className: "Checkmark Icon",
72616
- version: "1.1",
72617
- xmlns: "http://www.w3.org/2000/svg",
72618
- x: "0px",
72619
- y: "0px",
72620
- viewBox: "0 0 24 24"
72621
- }, /*#__PURE__*/react.createElement("path", {
72622
- d: "M20,4.9L9.2,16l-5.4-3.9c-0.7-0.5-1.6-0.3-2.1,0.3c-0.5,0.7-0.3,1.6,0.3,2.1l6.4,4.7c0.3,0.2,0.6,0.3,0.9,0.3 c0.4,0,0.8-0.2,1.1-0.5l11.7-12c0.6-0.6,0.6-1.6,0-2.2C21.6,4.3,20.6,4.3,20,4.9z"
72623
- }));
72624
- });
72625
-
72626
72709
  var DonationOverviewSkeleton = (function (props) {
72627
72710
  return /*#__PURE__*/react.createElement(Dialog, {
72628
72711
  header: /*#__PURE__*/react.createElement("div", {
72629
- className: "PaddingTopS PaddingLeftM PaddingRightM"
72712
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72630
72713
  }, /*#__PURE__*/react.createElement("h1", {
72631
- className: "LineHeightL FontSizeL TextLeft"
72714
+ className: "LineHeightL FontSizeL"
72632
72715
  }, "Donation")),
72633
72716
  body: /*#__PURE__*/react.createElement("div", {
72634
72717
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72642,7 +72725,7 @@
72642
72725
  className: "SkeletonBackground"
72643
72726
  }))),
72644
72727
  footer: /*#__PURE__*/react.createElement("div", {
72645
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
72728
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72646
72729
  }, /*#__PURE__*/react.createElement("div", {
72647
72730
  className: "SkeletonWrapper"
72648
72731
  }, /*#__PURE__*/react.createElement("div", {
@@ -72653,6 +72736,60 @@
72653
72736
  });
72654
72737
  });
72655
72738
 
72739
+ var Checkmark = (function (props) {
72740
+ return /*#__PURE__*/react.createElement("svg", {
72741
+ className: "Checkmark Icon " + props.className,
72742
+ version: "1.1",
72743
+ xmlns: "http://www.w3.org/2000/svg",
72744
+ x: "0px",
72745
+ y: "0px",
72746
+ viewBox: "0 0 24 24"
72747
+ }, /*#__PURE__*/react.createElement("path", {
72748
+ d: "M20,4.9L9.2,16l-5.4-3.9c-0.7-0.5-1.6-0.3-2.1,0.3c-0.5,0.7-0.3,1.6,0.3,2.1l6.4,4.7c0.3,0.2,0.6,0.3,0.9,0.3 c0.4,0,0.8-0.2,1.1-0.5l11.7-12c0.6-0.6,0.6-1.6,0-2.2C21.6,4.3,20.6,4.3,20,4.9z"
72749
+ }));
72750
+ });
72751
+
72752
+ var DigitalWalletIcon = (function (props) {
72753
+ return /*#__PURE__*/react.createElement("svg", {
72754
+ className: "DigitalWalletIcon Icon " + props.className,
72755
+ version: "1.1",
72756
+ xmlns: "http://www.w3.org/2000/svg",
72757
+ height: "24",
72758
+ width: "24",
72759
+ viewBox: "0 0 24 24"
72760
+ }, /*#__PURE__*/react.createElement("path", {
72761
+ d: "M8.51,4.84l-.39-.53,4-2.89a2.2,2.2,0,0,1,3.06.48l.4.56-.53.39-.4-.56A1.54,1.54,0,0,0,12.5,2Z",
72762
+ transform: "translate(-0.81 -1)"
72763
+ }), /*#__PURE__*/react.createElement("path", {
72764
+ d: "M9.77,4.89l-.21-.62,6.31-2.13h0a2.18,2.18,0,0,1,.67-.1h0a2.21,2.21,0,0,1,2.08,1.49l.32.95-.63.21L18,3.73a1.53,1.53,0,0,0-1.45-1h0a1.61,1.61,0,0,0-.48.08h0Z",
72765
+ transform: "translate(-0.81 -1)"
72766
+ }), /*#__PURE__*/react.createElement("path", {
72767
+ d: "M19.72,16.2H18.27a3.28,3.28,0,1,1,0-6.56h1.45a3.21,3.21,0,0,1,1.33.28h0a3.28,3.28,0,0,1,0,6A3.21,3.21,0,0,1,19.72,16.2Zm-1.45-5.9a2.63,2.63,0,0,0,0,5.25h1.45a2.56,2.56,0,0,0,1.06-.23,2.62,2.62,0,0,0,0-4.8,2.55,2.55,0,0,0-1.06-.22ZM19,14.53a1.61,1.61,0,1,1,1.61-1.61A1.62,1.62,0,0,1,19,14.53ZM19,12a1,1,0,1,0,.95.95A1,1,0,0,0,19,12Z",
72768
+ transform: "translate(-0.81 -1)"
72769
+ }), /*#__PURE__*/react.createElement("path", {
72770
+ d: "M10.49,19.69a1.58,1.58,0,1,1,1.58-1.57A1.57,1.57,0,0,1,10.49,19.69Zm0-2.49a.92.92,0,1,0,.92.92A.92.92,0,0,0,10.49,17.2Z",
72771
+ transform: "translate(-0.81 -1)"
72772
+ }), /*#__PURE__*/react.createElement("path", {
72773
+ d: "M19.09,22.14H2.79a2,2,0,0,1-2-2V6.25a2.1,2.1,0,0,1,0-.43,2,2,0,0,1,.48-.92,2,2,0,0,1,1.48-.65H19.09a2,2,0,0,1,.64.1,2,2,0,0,1,1.36,1.79v0a.28.28,0,0,1,0,.09v3.91h-.66v-4a1.49,1.49,0,0,0-.23-.69A1.35,1.35,0,0,0,19.52,5a1.26,1.26,0,0,0-.43-.08H2.82a1.34,1.34,0,0,0-1,.44A1.49,1.49,0,0,0,1.5,6a1.5,1.5,0,0,0,0,.29V20.13a1.36,1.36,0,0,0,1.34,1.35H19.09a1.35,1.35,0,0,0,1.35-1.35V15.68h.66v4.45A2,2,0,0,1,19.09,22.14Z",
72774
+ transform: "translate(-0.81 -1)"
72775
+ }), /*#__PURE__*/react.createElement("path", {
72776
+ d: "M9.27,9.31a1.58,1.58,0,1,1,0-3.15,1.58,1.58,0,0,1,0,3.15Zm0-2.5a.92.92,0,1,0,.92.92A.92.92,0,0,0,9.27,6.81Z",
72777
+ transform: "translate(-0.81 -1)"
72778
+ }), /*#__PURE__*/react.createElement("path", {
72779
+ d: "M7.11,14.67A1.58,1.58,0,1,1,8.69,13.1,1.57,1.57,0,0,1,7.11,14.67Zm0-2.49A.92.92,0,1,0,8,13.1.92.92,0,0,0,7.11,12.18Z",
72780
+ transform: "translate(-0.81 -1)"
72781
+ }), /*#__PURE__*/react.createElement("rect", {
72782
+ x: "0.33",
72783
+ y: "11.77",
72784
+ width: "4.72",
72785
+ height: "0.66"
72786
+ }), /*#__PURE__*/react.createElement("polygon", {
72787
+ points: "2.08 9.53 0.33 9.53 0.33 8.87 1.8 8.87 4.28 6.39 7.21 6.39 7.21 7.05 4.55 7.05 2.08 9.53"
72788
+ }), /*#__PURE__*/react.createElement("polygon", {
72789
+ points: "8.43 17.45 4.53 17.45 2.63 15.55 0.33 15.55 0.33 14.89 2.9 14.89 4.8 16.79 8.43 16.79 8.43 17.45"
72790
+ }));
72791
+ });
72792
+
72656
72793
  var LoadingText = (function (props) {
72657
72794
  return /*#__PURE__*/react.createElement("div", {
72658
72795
  className: "LoadingText"
@@ -72665,26 +72802,143 @@
72665
72802
  }, "."));
72666
72803
  });
72667
72804
 
72668
- var DonationOverviewDialog = (function (props) {
72805
+ var Footer = (function () {
72669
72806
  var _useContext = react.useContext(ConfigurationContext),
72670
72807
  currencyCode = _useContext.currencyCode;
72671
72808
 
72672
72809
  var _useContext2 = react.useContext(ChangableAmountContext),
72673
72810
  amount = _useContext2.amount;
72811
+ _useContext2.amountsMissing;
72674
72812
 
72675
- var _useContext3 = react.useContext(PaymentContext),
72676
- payment = _useContext3.payment,
72677
- paymentState = _useContext3.paymentState,
72678
- pay = _useContext3.pay,
72679
- transaction = _useContext3.transaction,
72680
- approve = _useContext3.approve,
72681
- approvalTransaction = _useContext3.approvalTransaction;
72813
+ var _useContext3 = react.useContext(TrackingContext),
72814
+ tracking = _useContext3.tracking,
72815
+ forward = _useContext3.forward,
72816
+ forwardTo = _useContext3.forwardTo;
72682
72817
 
72683
- var _useContext4 = react.useContext(NavigateStackContext_1),
72684
- navigate = _useContext4.navigate;
72818
+ var _useContext4 = react.useContext(PaymentContext),
72819
+ payment = _useContext4.payment,
72820
+ paymentState = _useContext4.paymentState,
72821
+ pay = _useContext4.pay,
72822
+ transaction = _useContext4.transaction,
72823
+ approve = _useContext4.approve,
72824
+ approvalTransaction = _useContext4.approvalTransaction;
72825
+
72826
+ var _useContext5 = react.useContext(PaymentValueContext),
72827
+ paymentValue = _useContext5.paymentValue;
72685
72828
 
72686
- var _useContext5 = react.useContext(ClosableContext),
72687
- close = _useContext5.close;
72829
+ var _useContext6 = react.useContext(NavigateStackContext_1),
72830
+ navigate = _useContext6.navigate;
72831
+
72832
+ var _useContext7 = react.useContext(ClosableContext),
72833
+ close = _useContext7.close;
72834
+
72835
+ var trackingInfo = function trackingInfo() {
72836
+ if (tracking != true) {
72837
+ return null;
72838
+ }
72839
+
72840
+ if (forward) {
72841
+ return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72842
+ className: "Card transparent small disabled"
72843
+ }, /*#__PURE__*/react.createElement("div", {
72844
+ className: "CardImage"
72845
+ }, /*#__PURE__*/react.createElement("div", {
72846
+ className: "TextCenter Opacity05"
72847
+ }, /*#__PURE__*/react.createElement(Checkmark, {
72848
+ className: "small"
72849
+ }))), /*#__PURE__*/react.createElement("div", {
72850
+ className: "CardBody"
72851
+ }, /*#__PURE__*/react.createElement("div", {
72852
+ className: "CardBodyWrapper"
72853
+ }, /*#__PURE__*/react.createElement("div", {
72854
+ className: "Opacity05"
72855
+ }, "Payment confirmation has been stored")))));
72856
+ } else {
72857
+ return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72858
+ className: "Card transparent small disabled"
72859
+ }, /*#__PURE__*/react.createElement("div", {
72860
+ className: "CardImage"
72861
+ }, /*#__PURE__*/react.createElement("div", {
72862
+ className: "TextCenter"
72863
+ }, /*#__PURE__*/react.createElement("div", {
72864
+ className: "Loading Icon"
72865
+ }))), /*#__PURE__*/react.createElement("div", {
72866
+ className: "CardBody"
72867
+ }, /*#__PURE__*/react.createElement("div", {
72868
+ className: "CardBodyWrapper"
72869
+ }, /*#__PURE__*/react.createElement("div", {
72870
+ className: "Opacity05"
72871
+ }, "Storing payment confirmation")))));
72872
+ }
72873
+ };
72874
+
72875
+ var additionalPaymentInformation = function additionalPaymentInformation() {
72876
+ if (paymentState == 'paying' && transaction == undefined) {
72877
+ return /*#__PURE__*/react.createElement("div", {
72878
+ className: "PaddingBottomS"
72879
+ }, /*#__PURE__*/react.createElement("div", {
72880
+ className: "Card transparent disabled small"
72881
+ }, /*#__PURE__*/react.createElement("div", {
72882
+ className: "CardImage"
72883
+ }, /*#__PURE__*/react.createElement("div", {
72884
+ className: "TextCenter Opacity05"
72885
+ }, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
72886
+ className: "small"
72887
+ }))), /*#__PURE__*/react.createElement("div", {
72888
+ className: "CardBody"
72889
+ }, /*#__PURE__*/react.createElement("div", {
72890
+ className: "CardBodyWrapper"
72891
+ }, /*#__PURE__*/react.createElement("div", {
72892
+ className: "Opacity05"
72893
+ }, "Confirm transaction in your wallet")))));
72894
+ } else if (paymentState == 'confirmed') {
72895
+ return /*#__PURE__*/react.createElement("div", {
72896
+ className: "PaddingBottomS"
72897
+ }, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72898
+ className: "Card transparent small",
72899
+ title: "Payment has been confirmed by the network",
72900
+ href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
72901
+ target: "_blank",
72902
+ rel: "noopener noreferrer"
72903
+ }, /*#__PURE__*/react.createElement("div", {
72904
+ className: "CardImage"
72905
+ }, /*#__PURE__*/react.createElement("div", {
72906
+ className: "TextCenter Opacity05"
72907
+ }, /*#__PURE__*/react.createElement(Checkmark, {
72908
+ className: "small"
72909
+ }))), /*#__PURE__*/react.createElement("div", {
72910
+ className: "CardBody"
72911
+ }, /*#__PURE__*/react.createElement("div", {
72912
+ className: "CardBodyWrapper"
72913
+ }, /*#__PURE__*/react.createElement("div", {
72914
+ className: "Opacity05"
72915
+ }, "Payment has been confirmed"))))), trackingInfo());
72916
+ }
72917
+ };
72918
+
72919
+ var approvalButton = function approvalButton() {
72920
+ if (!payment.route.approvalRequired || payment.route.directTransfer) {
72921
+ return null;
72922
+ } else if (paymentState == 'initialized') {
72923
+ return /*#__PURE__*/react.createElement("div", {
72924
+ className: "PaddingBottomS"
72925
+ }, /*#__PURE__*/react.createElement("button", {
72926
+ className: "ButtonPrimary",
72927
+ onClick: approve,
72928
+ title: "Allow ".concat(payment.symbol, " to be used as payment")
72929
+ }, "Allow ", payment.symbol, " to be used as payment"));
72930
+ } else if (paymentState == 'approving') {
72931
+ return /*#__PURE__*/react.createElement("div", {
72932
+ className: "PaddingBottomS"
72933
+ }, /*#__PURE__*/react.createElement("a", {
72934
+ className: "ButtonPrimary",
72935
+ title: "Approving payment token - please wait",
72936
+ href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
72937
+ target: "_blank",
72938
+ rel: "noopener noreferrer"
72939
+ }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
72940
+ }
72941
+ };
72688
72942
 
72689
72943
  var mainAction = function mainAction() {
72690
72944
  if (paymentState == 'initialized' || paymentState == 'approving') {
@@ -72699,10 +72953,10 @@
72699
72953
  navigate: navigate
72700
72954
  });
72701
72955
  }
72702
- }, "Pay ", new Currency({
72956
+ }, "Pay ", amount ? new Currency({
72703
72957
  amount: amount.toFixed(2),
72704
72958
  code: currencyCode
72705
- }).toString());
72959
+ }).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
72706
72960
  } else if (paymentState == 'paying') {
72707
72961
  return /*#__PURE__*/react.createElement("a", {
72708
72962
  className: "ButtonPrimary",
@@ -72712,39 +72966,51 @@
72712
72966
  rel: "noopener noreferrer"
72713
72967
  }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
72714
72968
  } else if (paymentState == 'confirmed') {
72715
- return /*#__PURE__*/react.createElement("button", {
72716
- className: "ButtonPrimary round",
72717
- title: "Done",
72718
- onClick: close
72719
- }, /*#__PURE__*/react.createElement(Checkmark, null));
72969
+ if (tracking == true) {
72970
+ if (forward) {
72971
+ if (forwardTo) {
72972
+ return /*#__PURE__*/react.createElement("a", {
72973
+ className: "ButtonPrimary",
72974
+ href: forwardTo,
72975
+ rel: "noopener noreferrer"
72976
+ }, "Continue");
72977
+ } else {
72978
+ return /*#__PURE__*/react.createElement("button", {
72979
+ className: "ButtonPrimary",
72980
+ onClick: close
72981
+ }, "Continue");
72982
+ }
72983
+ } else {
72984
+ return /*#__PURE__*/react.createElement("button", {
72985
+ className: "ButtonPrimary disabled",
72986
+ onClick: function onClick() {}
72987
+ }, "Continue");
72988
+ }
72989
+ } else {
72990
+ return /*#__PURE__*/react.createElement("button", {
72991
+ className: "ButtonPrimary",
72992
+ onClick: close
72993
+ }, "Close");
72994
+ }
72720
72995
  }
72721
72996
  };
72722
72997
 
72723
- var approvalAction = function approvalAction() {
72724
- if (paymentState == 'initialized') {
72725
- return /*#__PURE__*/react.createElement("div", {
72726
- className: "PaddingBottomS"
72727
- }, /*#__PURE__*/react.createElement("button", {
72728
- className: "ButtonPrimary wide",
72729
- onClick: approve,
72730
- title: "Allow ".concat(payment.symbol, " to be used as payment")
72731
- }, "Allow ", payment.symbol, " to be used as payment"));
72732
- } else if (paymentState == 'approving') {
72733
- return /*#__PURE__*/react.createElement("div", {
72734
- className: "PaddingBottomS"
72735
- }, /*#__PURE__*/react.createElement("a", {
72736
- className: "ButtonPrimary wide",
72737
- title: "Approving payment token - please wait",
72738
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
72739
- target: "_blank",
72740
- rel: "noopener noreferrer"
72741
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
72742
- }
72743
- };
72998
+ return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
72999
+ });
72744
73000
 
72745
- var actions = function actions() {
72746
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
72747
- };
73001
+ var DonationOverviewDialog = (function (props) {
73002
+ var _useContext = react.useContext(ConfigurationContext),
73003
+ currencyCode = _useContext.currencyCode;
73004
+
73005
+ var _useContext2 = react.useContext(ChangableAmountContext),
73006
+ amount = _useContext2.amount;
73007
+
73008
+ var _useContext3 = react.useContext(PaymentContext),
73009
+ payment = _useContext3.payment,
73010
+ paymentState = _useContext3.paymentState;
73011
+
73012
+ var _useContext4 = react.useContext(NavigateStackContext_1),
73013
+ navigate = _useContext4.navigate;
72748
73014
 
72749
73015
  if (payment == undefined) {
72750
73016
  return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
@@ -72752,9 +73018,9 @@
72752
73018
 
72753
73019
  return /*#__PURE__*/react.createElement(Dialog, {
72754
73020
  header: /*#__PURE__*/react.createElement("div", {
72755
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73021
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72756
73022
  }, /*#__PURE__*/react.createElement("h1", {
72757
- className: "LineHeightL FontSizeL TextLeft"
73023
+ className: "LineHeightL FontSizeL"
72758
73024
  }, "Donation")),
72759
73025
  body: /*#__PURE__*/react.createElement("div", {
72760
73026
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72817,8 +73083,8 @@
72817
73083
  className: "CardAction"
72818
73084
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
72819
73085
  footer: /*#__PURE__*/react.createElement("div", {
72820
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
72821
- }, actions())
73086
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73087
+ }, /*#__PURE__*/react.createElement(Footer, null))
72822
73088
  });
72823
73089
  });
72824
73090
 
@@ -72855,9 +73121,9 @@
72855
73121
  rel: "noopener noreferrer"
72856
73122
  }, "View on explorer")))),
72857
73123
  footer: /*#__PURE__*/react.createElement("div", {
72858
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73124
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72859
73125
  }, /*#__PURE__*/react.createElement("button", {
72860
- className: "ButtonPrimary wide",
73126
+ className: "ButtonPrimary",
72861
73127
  onClick: function onClick() {
72862
73128
  return navigate('back');
72863
73129
  }
@@ -72878,9 +73144,9 @@
72878
73144
  return /*#__PURE__*/react.createElement(Dialog, {
72879
73145
  stacked: true,
72880
73146
  header: /*#__PURE__*/react.createElement("div", {
72881
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73147
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72882
73148
  }, /*#__PURE__*/react.createElement("h1", {
72883
- className: "LineHeightL FontSizeL TextLeft"
73149
+ className: "LineHeightL FontSizeL"
72884
73150
  }, "Wrong Network")),
72885
73151
  body: /*#__PURE__*/react.createElement("div", {
72886
73152
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72897,7 +73163,7 @@
72897
73163
  className: "FontSizeM"
72898
73164
  }, "Please make sure you connect your wallet to the correct network before you try again!"))),
72899
73165
  footer: /*#__PURE__*/react.createElement("div", {
72900
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73166
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72901
73167
  }, /*#__PURE__*/react.createElement("button", {
72902
73168
  className: "ButtonPrimary",
72903
73169
  onClick: function onClick() {
@@ -72928,16 +73194,122 @@
72928
73194
  });
72929
73195
  });
72930
73196
 
72931
- var UpdateProvider = (function (props) {
72932
- var _useState = react.useState(true),
73197
+ var TrackingProvider = (function (props) {
73198
+ var _useContext = react.useContext(ConfigurationContext),
73199
+ track = _useContext.track;
73200
+
73201
+ var _useState = react.useState(track && !!track.endpoint),
72933
73202
  _useState2 = _slicedToArray(_useState, 2),
72934
- update = _useState2[0],
72935
- setUpdate = _useState2[1];
73203
+ tracking = _useState2[0],
73204
+ setTracking = _useState2[1];
72936
73205
 
72937
- return /*#__PURE__*/react.createElement(UpdateContext.Provider, {
73206
+ var _useState3 = react.useState(false),
73207
+ _useState4 = _slicedToArray(_useState3, 2),
73208
+ forward = _useState4[0],
73209
+ setForward = _useState4[1];
73210
+
73211
+ var _useState5 = react.useState(),
73212
+ _useState6 = _slicedToArray(_useState5, 2),
73213
+ forwardTo = _useState6[0],
73214
+ setForwardTo = _useState6[1];
73215
+
73216
+ var _useContext2 = react.useContext(ClosableContext),
73217
+ setClosable = _useContext2.setClosable;
73218
+
73219
+ react.useEffect(function () {
73220
+ setTracking(track && !!track.endpoint);
73221
+ }, [track]);
73222
+
73223
+ var openSocket = function openSocket(transaction) {
73224
+ var socket = new WebSocket('wss://integrate.depay.fi/cable');
73225
+
73226
+ socket.onopen = function (event) {
73227
+ var msg = {
73228
+ command: 'subscribe',
73229
+ identifier: JSON.stringify({
73230
+ blockchain: transaction.blockchain,
73231
+ sender: transaction.from.toLowerCase(),
73232
+ nonce: transaction.nonce,
73233
+ channel: 'PaymentChannel'
73234
+ })
73235
+ };
73236
+ socket.send(JSON.stringify(msg));
73237
+ };
73238
+
73239
+ socket.onclose = function (event) {};
73240
+
73241
+ socket.onmessage = function (event) {
73242
+ var item = JSON.parse(event.data);
73243
+
73244
+ if (item.type === "ping") {
73245
+ return;
73246
+ }
73247
+
73248
+ if (item.message && item.message.forward) {
73249
+ setClosable(!item.message.forward_to);
73250
+ setForwardTo(item.message.forward_to);
73251
+ setForward(item.message.forward);
73252
+ socket.close();
73253
+
73254
+ if (!!item.message.forward_to) {
73255
+ setTimeout(function () {
73256
+ props.document.location.href = item.message.forward_to;
73257
+ }, 500);
73258
+ }
73259
+ }
73260
+ };
73261
+
73262
+ socket.onerror = function (error) {
73263
+ console.log('WebSocket Error: ' + error);
73264
+ };
73265
+ };
73266
+
73267
+ var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
73268
+ attempt = parseInt(attempt || 1, 10);
73269
+ console.log('RETRY TRACKING ATTEMPT ', attempt);
73270
+
73271
+ if (attempt < 3) {
73272
+ setTimeout(function () {
73273
+ startTracking(transaction, afterBlock, attempt + 1);
73274
+ }, 3000);
73275
+ } else {
73276
+ console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
73277
+ }
73278
+ };
73279
+
73280
+ var startTracking = function startTracking(transaction, afterBlock, attempt) {
73281
+ fetch(track.endpoint, {
73282
+ method: 'POST',
73283
+ body: JSON.stringify({
73284
+ blockchain: transaction.blockchain,
73285
+ transaction: transaction.id.toLowerCase(),
73286
+ sender: transaction.from.toLowerCase(),
73287
+ nonce: transaction.nonce,
73288
+ after_block: afterBlock
73289
+ })
73290
+ }).then(function (response) {
73291
+ if (response.status == 200) {
73292
+ console.log('TRACKING INITIALIZED');
73293
+ } else {
73294
+ retryStartTracking(transaction, afterBlock, attempt);
73295
+ }
73296
+ })["catch"](function (error) {
73297
+ console.log('TRACKING FAILED', error);
73298
+ retryStartTracking(transaction, afterBlock, attempt);
73299
+ });
73300
+ };
73301
+
73302
+ var initializeTracking = function initializeTracking(transaction, afterBlock) {
73303
+ openSocket(transaction);
73304
+ startTracking(transaction, afterBlock);
73305
+ };
73306
+
73307
+ return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
72938
73308
  value: {
72939
- update: update,
72940
- setUpdate: setUpdate
73309
+ tracking: tracking,
73310
+ initializeTracking: initializeTracking,
73311
+ forward: forward,
73312
+ forwardTo: forwardTo
72941
73313
  }
72942
73314
  }, props.children);
72943
73315
  });
@@ -73040,12 +73412,12 @@
73040
73412
 
73041
73413
  var Donation = /*#__PURE__*/function () {
73042
73414
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73043
- var amount, accept, event, sent, confirmed, ensured, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
73415
+ var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
73044
73416
  return regenerator.wrap(function _callee2$(_context2) {
73045
73417
  while (1) {
73046
73418
  switch (_context2.prev = _context2.next) {
73047
73419
  case 0:
73048
- amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, ensured = _ref3.ensured, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, document = _ref3.document;
73420
+ amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, document = _ref3.document;
73049
73421
  _context2.prev = 1;
73050
73422
  _context2.next = 4;
73051
73423
  return preflight$2({
@@ -73071,26 +73443,27 @@
73071
73443
  event: event,
73072
73444
  sent: sent,
73073
73445
  confirmed: confirmed,
73074
- ensured: ensured,
73075
73446
  failed: failed,
73076
73447
  blacklist: blacklist,
73077
73448
  providers: providers
73078
73449
  }
73079
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
73450
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73080
73451
  unmount: unmount
73081
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
73452
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73082
73453
  container: container,
73083
73454
  connected: connected,
73084
73455
  unmount: unmount
73085
73456
  }, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
73086
73457
  accept: accept
73458
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
73459
+ document: ensureDocument(document)
73087
73460
  }, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
73088
73461
  container: container,
73089
73462
  document: document
73090
73463
  }, /*#__PURE__*/react.createElement(DonationStack, {
73091
73464
  document: document,
73092
73465
  container: container
73093
- })))))))));
73466
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
73094
73467
  };
73095
73468
  });
73096
73469
  return _context2.abrupt("return", {
@@ -73158,9 +73531,9 @@
73158
73531
 
73159
73532
  return /*#__PURE__*/react.createElement(Dialog, {
73160
73533
  header: /*#__PURE__*/react.createElement("div", {
73161
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73534
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73162
73535
  }, /*#__PURE__*/react.createElement("h1", {
73163
- className: "LineHeightL FontSizeL TextLeft"
73536
+ className: "LineHeightL FontSizeL"
73164
73537
  }, "Payment")),
73165
73538
  body: /*#__PURE__*/react.createElement("div", {
73166
73539
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73174,7 +73547,7 @@
73174
73547
  className: "SkeletonBackground"
73175
73548
  }))),
73176
73549
  footer: /*#__PURE__*/react.createElement("div", {
73177
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73550
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73178
73551
  }, /*#__PURE__*/react.createElement("div", {
73179
73552
  className: "SkeletonWrapper"
73180
73553
  }, /*#__PURE__*/react.createElement("div", {
@@ -73189,17 +73562,13 @@
73189
73562
  var _useContext = react.useContext(ConfigurationContext),
73190
73563
  currencyCode = _useContext.currencyCode;
73191
73564
 
73192
- var _useContext2 = react.useContext(ChangableAmountContext),
73193
- amount = _useContext2.amount,
73194
- amountsMissing = _useContext2.amountsMissing;
73565
+ var _useContext2 = react.useContext(PaymentContext),
73566
+ payment = _useContext2.payment,
73567
+ paymentState = _useContext2.paymentState;
73195
73568
 
73196
- var _useContext3 = react.useContext(PaymentContext),
73197
- payment = _useContext3.payment,
73198
- paymentState = _useContext3.paymentState,
73199
- pay = _useContext3.pay,
73200
- transaction = _useContext3.transaction,
73201
- approve = _useContext3.approve,
73202
- approvalTransaction = _useContext3.approvalTransaction;
73569
+ var _useContext3 = react.useContext(ChangableAmountContext),
73570
+ amount = _useContext3.amount,
73571
+ amountsMissing = _useContext3.amountsMissing;
73203
73572
 
73204
73573
  var _useContext4 = react.useContext(PaymentValueContext),
73205
73574
  paymentValue = _useContext4.paymentValue;
@@ -73207,78 +73576,15 @@
73207
73576
  var _useContext5 = react.useContext(NavigateStackContext_1),
73208
73577
  navigate = _useContext5.navigate;
73209
73578
 
73210
- var _useContext6 = react.useContext(ClosableContext),
73211
- close = _useContext6.close;
73212
-
73213
- var mainAction = function mainAction() {
73214
- if (paymentState == 'initialized' || paymentState == 'approving') {
73215
- return /*#__PURE__*/react.createElement("button", {
73216
- className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
73217
- onClick: function onClick() {
73218
- if (payment.route.approvalRequired && !payment.route.directTransfer) {
73219
- return;
73220
- }
73221
-
73222
- pay({
73223
- navigate: navigate
73224
- });
73225
- }
73226
- }, "Pay ", amount ? new Currency({
73227
- amount: amount.toFixed(2),
73228
- code: currencyCode
73229
- }).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
73230
- } else if (paymentState == 'paying') {
73231
- return /*#__PURE__*/react.createElement("a", {
73232
- className: "ButtonPrimary",
73233
- title: "Performing the payment - please wait",
73234
- href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
73235
- target: "_blank",
73236
- rel: "noopener noreferrer"
73237
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
73238
- } else if (paymentState == 'confirmed') {
73239
- return /*#__PURE__*/react.createElement("button", {
73240
- className: "ButtonPrimary round",
73241
- title: "Done",
73242
- onClick: close
73243
- }, /*#__PURE__*/react.createElement(Checkmark, null));
73244
- }
73245
- };
73246
-
73247
- var approvalAction = function approvalAction() {
73248
- if (paymentState == 'initialized') {
73249
- return /*#__PURE__*/react.createElement("div", {
73250
- className: "PaddingBottomS"
73251
- }, /*#__PURE__*/react.createElement("button", {
73252
- className: "ButtonPrimary wide",
73253
- onClick: approve,
73254
- title: "Allow ".concat(payment.symbol, " to be used as payment")
73255
- }, "Allow ", payment.symbol, " to be used as payment"));
73256
- } else if (paymentState == 'approving') {
73257
- return /*#__PURE__*/react.createElement("div", {
73258
- className: "PaddingBottomS"
73259
- }, /*#__PURE__*/react.createElement("a", {
73260
- className: "ButtonPrimary wide",
73261
- title: "Approving payment token - please wait",
73262
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
73263
- target: "_blank",
73264
- rel: "noopener noreferrer"
73265
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
73266
- }
73267
- };
73268
-
73269
- var actions = function actions() {
73270
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
73271
- };
73272
-
73273
73579
  if (payment == undefined || paymentValue == undefined) {
73274
73580
  return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
73275
73581
  }
73276
73582
 
73277
73583
  return /*#__PURE__*/react.createElement(Dialog, {
73278
73584
  header: /*#__PURE__*/react.createElement("div", {
73279
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73585
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73280
73586
  }, /*#__PURE__*/react.createElement("h1", {
73281
- className: "LineHeightL FontSizeL TextLeft"
73587
+ className: "LineHeightL FontSizeL"
73282
73588
  }, "Payment")),
73283
73589
  body: /*#__PURE__*/react.createElement("div", {
73284
73590
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73341,8 +73647,8 @@
73341
73647
  className: "CardAction"
73342
73648
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
73343
73649
  footer: /*#__PURE__*/react.createElement("div", {
73344
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73345
- }, actions())
73650
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73651
+ }, /*#__PURE__*/react.createElement(Footer, null))
73346
73652
  });
73347
73653
  });
73348
73654
 
@@ -73408,12 +73714,12 @@
73408
73714
 
73409
73715
  var Payment = /*#__PURE__*/function () {
73410
73716
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73411
- var accept, amount, event, sent, confirmed, ensured, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, document, unmount;
73717
+ var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
73412
73718
  return regenerator.wrap(function _callee2$(_context2) {
73413
73719
  while (1) {
73414
73720
  switch (_context2.prev = _context2.next) {
73415
73721
  case 0:
73416
- accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, ensured = _ref3.ensured, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, whitelist = _ref3.whitelist, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, document = _ref3.document;
73722
+ accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, whitelist = _ref3.whitelist, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, document = _ref3.document;
73417
73723
  _context2.prev = 1;
73418
73724
  _context2.next = 4;
73419
73725
  return preflight$1({
@@ -73439,15 +73745,15 @@
73439
73745
  event: event,
73440
73746
  sent: sent,
73441
73747
  confirmed: confirmed,
73442
- ensured: ensured,
73443
73748
  failed: failed,
73444
73749
  whitelist: whitelist,
73445
73750
  blacklist: blacklist,
73446
- providers: providers
73751
+ providers: providers,
73752
+ track: track
73447
73753
  }
73448
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
73754
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73449
73755
  unmount: unmount
73450
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
73756
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73451
73757
  document: document,
73452
73758
  container: container,
73453
73759
  connected: connected,
@@ -73459,13 +73765,15 @@
73459
73765
  whitelist: whitelist,
73460
73766
  blacklist: blacklist,
73461
73767
  event: event
73768
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
73769
+ document: ensureDocument(document)
73462
73770
  }, /*#__PURE__*/react.createElement(PaymentProvider, {
73463
73771
  container: container,
73464
73772
  document: document
73465
73773
  }, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
73466
73774
  document: document,
73467
73775
  container: container
73468
- })))))))))));
73776
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
73469
73777
  };
73470
73778
  });
73471
73779
  return _context2.abrupt("return", {
@@ -73575,9 +73883,9 @@
73575
73883
  var SaleOverviewSkeleton = (function (props) {
73576
73884
  return /*#__PURE__*/react.createElement(Dialog, {
73577
73885
  header: /*#__PURE__*/react.createElement("div", {
73578
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73886
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73579
73887
  }, /*#__PURE__*/react.createElement("h1", {
73580
- className: "LineHeightL FontSizeL TextLeft"
73888
+ className: "LineHeightL FontSizeL"
73581
73889
  }, "Purchase")),
73582
73890
  body: /*#__PURE__*/react.createElement("div", {
73583
73891
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73594,7 +73902,7 @@
73594
73902
  className: "SkeletonBackground"
73595
73903
  }))),
73596
73904
  footer: /*#__PURE__*/react.createElement("div", {
73597
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73905
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73598
73906
  }, /*#__PURE__*/react.createElement("div", {
73599
73907
  className: "SkeletonWrapper"
73600
73908
  }, /*#__PURE__*/react.createElement("div", {
@@ -73606,11 +73914,10 @@
73606
73914
  });
73607
73915
 
73608
73916
  var SaleOverviewDialog = (function (props) {
73609
- var _useContext = react.useContext(ChangableAmountContext),
73610
- amount = _useContext.amount;
73917
+ var _useContext = react.useContext(ChangableAmountContext);
73918
+ _useContext.amount;
73611
73919
 
73612
73920
  var _useContext2 = react.useContext(ConfigurationContext),
73613
- currencyCode = _useContext2.currencyCode,
73614
73921
  tokenImage = _useContext2.tokenImage;
73615
73922
 
73616
73923
  var _useContext3 = react.useContext(PaymentValueContext),
@@ -73618,87 +73925,20 @@
73618
73925
 
73619
73926
  var _useContext4 = react.useContext(PaymentContext),
73620
73927
  payment = _useContext4.payment,
73621
- paymentState = _useContext4.paymentState,
73622
- pay = _useContext4.pay,
73623
- transaction = _useContext4.transaction,
73624
- approve = _useContext4.approve,
73625
- approvalTransaction = _useContext4.approvalTransaction;
73928
+ paymentState = _useContext4.paymentState;
73626
73929
 
73627
73930
  var _useContext5 = react.useContext(NavigateStackContext_1),
73628
73931
  navigate = _useContext5.navigate;
73629
73932
 
73630
- var _useContext6 = react.useContext(ClosableContext),
73631
- close = _useContext6.close;
73632
-
73633
- var _useContext7 = react.useContext(ToTokenContext),
73634
- toToken = _useContext7.toToken,
73635
- toTokenReadableAmount = _useContext7.toTokenReadableAmount;
73933
+ var _useContext6 = react.useContext(ToTokenContext),
73934
+ toToken = _useContext6.toToken,
73935
+ toTokenReadableAmount = _useContext6.toTokenReadableAmount;
73636
73936
 
73637
73937
  var _useState = react.useState(),
73638
73938
  _useState2 = _slicedToArray(_useState, 2),
73639
73939
  salePerTokenValue = _useState2[0],
73640
73940
  setSalePerTokenValue = _useState2[1];
73641
73941
 
73642
- var mainAction = function mainAction() {
73643
- if (paymentState == 'initialized' || paymentState == 'approving') {
73644
- return /*#__PURE__*/react.createElement("button", {
73645
- className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
73646
- onClick: function onClick() {
73647
- if (payment.route.approvalRequired && !payment.route.directTransfer) {
73648
- return;
73649
- }
73650
-
73651
- pay({
73652
- navigate: navigate
73653
- });
73654
- }
73655
- }, "Pay ", new Currency({
73656
- amount: amount.toFixed(2),
73657
- code: currencyCode
73658
- }).toString());
73659
- } else if (paymentState == 'paying') {
73660
- return /*#__PURE__*/react.createElement("a", {
73661
- className: "ButtonPrimary",
73662
- title: "Performing the payment - please wait",
73663
- href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
73664
- target: "_blank",
73665
- rel: "noopener noreferrer"
73666
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
73667
- } else if (paymentState == 'confirmed') {
73668
- return /*#__PURE__*/react.createElement("button", {
73669
- className: "ButtonPrimary round",
73670
- title: "Done",
73671
- onClick: close
73672
- }, /*#__PURE__*/react.createElement(Checkmark, null));
73673
- }
73674
- };
73675
-
73676
- var approvalAction = function approvalAction() {
73677
- if (paymentState == 'initialized') {
73678
- return /*#__PURE__*/react.createElement("div", {
73679
- className: "PaddingBottomS"
73680
- }, /*#__PURE__*/react.createElement("button", {
73681
- className: "ButtonPrimary wide",
73682
- onClick: approve,
73683
- title: "Allow ".concat(payment.symbol, " to be used as payment")
73684
- }, "Allow ", payment.symbol, " to be used as payment"));
73685
- } else if (paymentState == 'approving') {
73686
- return /*#__PURE__*/react.createElement("div", {
73687
- className: "PaddingBottomS"
73688
- }, /*#__PURE__*/react.createElement("a", {
73689
- className: "ButtonPrimary wide",
73690
- title: "Approving payment token - please wait",
73691
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
73692
- target: "_blank",
73693
- rel: "noopener noreferrer"
73694
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
73695
- }
73696
- };
73697
-
73698
- var actions = function actions() {
73699
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
73700
- };
73701
-
73702
73942
  react.useEffect(function () {
73703
73943
  if (paymentValue) {
73704
73944
  setSalePerTokenValue(new Currency({
@@ -73727,9 +73967,9 @@
73727
73967
 
73728
73968
  return /*#__PURE__*/react.createElement(Dialog, {
73729
73969
  header: /*#__PURE__*/react.createElement("div", {
73730
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73970
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73731
73971
  }, /*#__PURE__*/react.createElement("h1", {
73732
- className: "LineHeightL FontSizeL TextLeft"
73972
+ className: "LineHeightL FontSizeL"
73733
73973
  }, "Purchase")),
73734
73974
  body: /*#__PURE__*/react.createElement("div", {
73735
73975
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73798,8 +74038,8 @@
73798
74038
  className: "CardAction"
73799
74039
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
73800
74040
  footer: /*#__PURE__*/react.createElement("div", {
73801
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73802
- }, actions())
74041
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
74042
+ }, /*#__PURE__*/react.createElement(Footer, null))
73803
74043
  });
73804
74044
  });
73805
74045
 
@@ -73872,12 +74112,12 @@
73872
74112
 
73873
74113
  var Sale = /*#__PURE__*/function () {
73874
74114
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73875
- var amount, sell, sent, confirmed, ensured, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
74115
+ var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
73876
74116
  return regenerator.wrap(function _callee2$(_context2) {
73877
74117
  while (1) {
73878
74118
  switch (_context2.prev = _context2.next) {
73879
74119
  case 0:
73880
- amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed, ensured = _ref3.ensured, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, tokenImage = _ref3.tokenImage, document = _ref3.document;
74120
+ amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, tokenImage = _ref3.tokenImage, document = _ref3.document;
73881
74121
  _context2.prev = 1;
73882
74122
  _context2.next = 4;
73883
74123
  return preflight({
@@ -73909,26 +74149,27 @@
73909
74149
  currency: currency,
73910
74150
  sent: sent,
73911
74151
  confirmed: confirmed,
73912
- ensured: ensured,
73913
74152
  failed: failed,
73914
74153
  blacklist: blacklist,
73915
74154
  providers: providers
73916
74155
  }
73917
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
74156
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73918
74157
  unmount: unmount
73919
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
74158
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73920
74159
  container: container,
73921
74160
  connected: connected,
73922
74161
  unmount: unmount
73923
74162
  }, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
73924
74163
  accept: accept
74164
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
74165
+ document: ensureDocument(document)
73925
74166
  }, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
73926
74167
  container: container,
73927
74168
  document: document
73928
74169
  }, /*#__PURE__*/react.createElement(SaleStack, {
73929
74170
  document: document,
73930
74171
  container: container
73931
- })))))))));
74172
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
73932
74173
  };
73933
74174
  });
73934
74175
  return _context2.abrupt("return", {