@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.
@@ -1030,6 +1030,8 @@ var react = createCommonjsModule$4(function (module) {
1030
1030
 
1031
1031
  var ClosableContext = /*#__PURE__*/react.createContext();
1032
1032
 
1033
+ var UpdatableContext = /*#__PURE__*/react.createContext();
1034
+
1033
1035
  var ClosableProvider = (function (props) {
1034
1036
  var _useState = react.useState(true),
1035
1037
  _useState2 = _slicedToArray(_useState, 2),
@@ -1041,11 +1043,15 @@ var ClosableProvider = (function (props) {
1041
1043
  open = _useState4[0],
1042
1044
  setOpen = _useState4[1];
1043
1045
 
1046
+ var _useContext = react.useContext(UpdatableContext),
1047
+ setUpdatable = _useContext.setUpdatable;
1048
+
1044
1049
  var close = function close() {
1045
1050
  if (!closable) {
1046
1051
  return;
1047
1052
  }
1048
1053
 
1054
+ setUpdatable(false);
1049
1055
  setOpen(false);
1050
1056
  setTimeout(props.unmount, 300);
1051
1057
  };
@@ -1991,12 +1997,7 @@ var Dialog = (function (props) {
1991
1997
  className: "DialogBody"
1992
1998
  }, props.body), /*#__PURE__*/react.createElement("div", {
1993
1999
  className: "DialogFooter"
1994
- }, props.footer, /*#__PURE__*/react.createElement("a", {
1995
- href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
1996
- rel: "noopener noreferrer",
1997
- target: "_blank",
1998
- className: "FooterLink"
1999
- }, "by DePay")));
2000
+ }, props.footer));
2000
2001
  });
2001
2002
 
2002
2003
  var ConnectingWalletDialog = (function (props) {
@@ -2046,9 +2047,9 @@ var ConnectingWalletDialog = (function (props) {
2046
2047
  className: "TextButton"
2047
2048
  }, "Connect with another wallet")))),
2048
2049
  footer: /*#__PURE__*/react.createElement("div", {
2049
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
2050
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
2050
2051
  }, /*#__PURE__*/react.createElement("button", {
2051
- className: "ButtonPrimary wide",
2052
+ className: "ButtonPrimary",
2052
2053
  onClick: function onClick() {
2053
2054
  return props.connect(wallet);
2054
2055
  }
@@ -30526,6 +30527,8 @@ let balance = ({ address, provider }) => {
30526
30527
  var request$1 = async ({ provider, address, api, method, params }) => {
30527
30528
  if (api) {
30528
30529
  return contractCall({ address, api, method, params, provider })
30530
+ } else if (method === 'latestBlockNumber') {
30531
+ return provider.getBlockNumber()
30529
30532
  } else if (method === 'balance') {
30530
30533
  return balance({ address, provider })
30531
30534
  }
@@ -30582,8 +30585,20 @@ var parseUrl = (url) => {
30582
30585
  if (typeof url == 'object') {
30583
30586
  return url
30584
30587
  }
30585
- let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<address>[\w\d]+)\/(?<method>[\w\d]+)/);
30586
- return deconstructed.groups
30588
+ let deconstructed = url.match(/(?<blockchain>\w+):\/\/(?<part1>[\w\d]+)(\/(?<part2>[\w\d]+))?/);
30589
+
30590
+ if(deconstructed.groups.part2 == undefined) {
30591
+ return {
30592
+ blockchain: deconstructed.groups.blockchain,
30593
+ method: deconstructed.groups.part1
30594
+ }
30595
+ } else {
30596
+ return {
30597
+ blockchain: deconstructed.groups.blockchain,
30598
+ address: deconstructed.groups.part1,
30599
+ method: deconstructed.groups.part2
30600
+ }
30601
+ }
30587
30602
  };
30588
30603
 
30589
30604
  let request = async function (url, options) {
@@ -51564,10 +51579,11 @@ function parseUnits$1(value, unitName) {
51564
51579
  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; }
51565
51580
  class Transaction {
51566
51581
 
51567
- constructor({ blockchain, from, to, api, method, params, value, sent, confirmed, ensured, failed }) {
51582
+ constructor({ blockchain, from, nonce, to, api, method, params, value, sent, confirmed, ensured, failed }) {
51568
51583
 
51569
51584
  this.blockchain = blockchain;
51570
51585
  this.from = from;
51586
+ this.nonce = nonce;
51571
51587
  this.to = to;
51572
51588
  this.api = api;
51573
51589
  this.method = method;
@@ -51675,6 +51691,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
51675
51691
  await executeSubmit$1({ transaction, provider, signer }).then((sentTransaction)=>{
51676
51692
  if (sentTransaction) {
51677
51693
  transaction.id = sentTransaction.hash;
51694
+ transaction.nonce = sentTransaction.nonce;
51678
51695
  transaction.url = Blockchain.findByName(transaction.blockchain).explorerUrlFor({ transaction });
51679
51696
  if (transaction.sent) transaction.sent(transaction);
51680
51697
  sentTransaction.wait(1).then(() => {
@@ -51875,6 +51892,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
51875
51892
  transaction.url = blockchain.explorerUrlFor({ transaction });
51876
51893
  if (transaction.sent) transaction.sent(transaction);
51877
51894
  let sentTransaction = await retrieveTransaction(tx, transaction.blockchain);
51895
+ transaction.nonce = sentTransaction.nonce;
51878
51896
  if(!sentTransaction) {
51879
51897
  transaction._failed = true;
51880
51898
  console.log('Error retrieving transaction');
@@ -52162,7 +52180,7 @@ var SelectWalletDialog = (function (props) {
52162
52180
  return connect(wallet);
52163
52181
  }
52164
52182
  }, /*#__PURE__*/react.createElement("div", {
52165
- className: "CardImage PaddingLeftM"
52183
+ className: "CardImage"
52166
52184
  }, /*#__PURE__*/react.createElement("img", {
52167
52185
  src: wallet.logo
52168
52186
  })), /*#__PURE__*/react.createElement("div", {
@@ -52175,9 +52193,9 @@ var SelectWalletDialog = (function (props) {
52175
52193
  });
52176
52194
  return /*#__PURE__*/react.createElement(Dialog, {
52177
52195
  header: /*#__PURE__*/react.createElement("div", {
52178
- className: "PaddingTopS PaddingLeftM PaddingRightM"
52196
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
52179
52197
  }, /*#__PURE__*/react.createElement("h1", {
52180
- className: "LineHeightL FontSizeL TextLeft"
52198
+ className: "LineHeightL FontSizeL"
52181
52199
  }, "Select a wallet")),
52182
52200
  body: /*#__PURE__*/react.createElement("div", {
52183
52201
  className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
@@ -52185,11 +52203,13 @@ var SelectWalletDialog = (function (props) {
52185
52203
  footer: /*#__PURE__*/react.createElement("div", {
52186
52204
  className: "PaddingBottomS"
52187
52205
  }, /*#__PURE__*/react.createElement("button", {
52188
- className: "FontSizeS FontWeightBold TextGrey TextButton",
52206
+ className: "FontSizeS FontWeightBold TextButton",
52189
52207
  onClick: function onClick() {
52190
52208
  return setShowExplanation(!showExplanation);
52191
52209
  }
52192
- }, /*#__PURE__*/react.createElement("strong", null, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
52210
+ }, /*#__PURE__*/react.createElement("strong", {
52211
+ className: "Opacity05"
52212
+ }, "What is a wallet?")), showExplanation && /*#__PURE__*/react.createElement("p", {
52193
52213
  className: "PaddingLeftM PaddingRightM"
52194
52214
  }, "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."))
52195
52215
  });
@@ -52467,7 +52487,7 @@ var ErrorProvider = (function (props) {
52467
52487
  })), /*#__PURE__*/react.createElement("div", {
52468
52488
  className: "DialogBody"
52469
52489
  }, /*#__PURE__*/react.createElement("div", {
52470
- className: "GraphicWrapper"
52490
+ className: "GraphicWrapper PaddingTopS"
52471
52491
  }, /*#__PURE__*/react.createElement("img", {
52472
52492
  className: "Graphic",
52473
52493
  src: ErrorGraphic
@@ -52485,15 +52505,12 @@ var ErrorProvider = (function (props) {
52485
52505
  className: "FontSizeM PaddingTopS"
52486
52506
  }, "If this keeps happening, please report it.")))), /*#__PURE__*/react.createElement("div", {
52487
52507
  className: "DialogFooter"
52488
- }, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
52508
+ }, /*#__PURE__*/react.createElement("div", {
52509
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
52510
+ }, /*#__PURE__*/react.createElement("button", {
52489
52511
  className: "ButtonPrimary",
52490
52512
  onClick: close
52491
- }, "Try again")), /*#__PURE__*/react.createElement("a", {
52492
- href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
52493
- rel: "noopener noreferrer",
52494
- target: "_blank",
52495
- className: "FooterLink"
52496
- }, "by DePay"))));
52513
+ }, "Try again")))));
52497
52514
  } else {
52498
52515
  return /*#__PURE__*/react.createElement(ErrorContext.Provider, {
52499
52516
  value: {
@@ -52505,28 +52522,28 @@ var ErrorProvider = (function (props) {
52505
52522
  }
52506
52523
  });
52507
52524
 
52525
+ var BlockchainLogoStyle = (function (style) {
52526
+ return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
52527
+ });
52528
+
52508
52529
  var ButtonCircularStyle = (function () {
52509
52530
  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 ";
52510
52531
  });
52511
52532
 
52512
52533
  var ButtonPrimaryStyle = (function (style) {
52513
- 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 ");
52534
+ 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 ");
52514
52535
  });
52515
52536
 
52516
52537
  var CardStyle = (function (style) {
52517
- 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 ");
52538
+ 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 ");
52518
52539
  });
52519
52540
 
52520
52541
  var DialogStyle = (function (style) {
52521
- 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 ";
52542
+ 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 ";
52522
52543
  });
52523
52544
 
52524
52545
  var FontStyle = (function (style) {
52525
- 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 ");
52526
- });
52527
-
52528
- var FooterStyle = (function (style) {
52529
- 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 ");
52546
+ 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 ");
52530
52547
  });
52531
52548
 
52532
52549
  var GraphicStyle = (function () {
@@ -52538,7 +52555,7 @@ var HeightStyle = (function () {
52538
52555
  });
52539
52556
 
52540
52557
  var IconStyle = (function (style) {
52541
- 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 ");
52558
+ 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 ");
52542
52559
  });
52543
52560
 
52544
52561
  var ImageStyle = (function (style) {
@@ -52557,10 +52574,18 @@ var LoadingTextStyle = (function (style) {
52557
52574
  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 ");
52558
52575
  });
52559
52576
 
52577
+ var OpacityStyle = (function (style) {
52578
+ return "\n\n .Opacity05 {\n opacity: 0.5;\n }\n ";
52579
+ });
52580
+
52560
52581
  var PaddingStyle = (function () {
52561
52582
  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 ";
52562
52583
  });
52563
52584
 
52585
+ var PoweredByStyle = (function (style) {
52586
+ 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 ");
52587
+ });
52588
+
52564
52589
  var RangeSliderStyle = (function (style) {
52565
52590
  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 ";
52566
52591
  });
@@ -52570,15 +52595,15 @@ var ResetStyle = (function () {
52570
52595
  });
52571
52596
 
52572
52597
  var SkeletonStyle = (function () {
52573
- 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 ";
52598
+ 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 ";
52574
52599
  });
52575
52600
 
52576
52601
  var TextButtonStyle = (function (style) {
52577
- 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 ");
52602
+ 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 ");
52578
52603
  });
52579
52604
 
52580
52605
  var TextStyle = (function (style) {
52581
- 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 ");
52606
+ 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 ");
52582
52607
  });
52583
52608
 
52584
52609
  var TokenAmountStyle = (function () {
@@ -52595,7 +52620,7 @@ var styleRenderer = (function (style) {
52595
52620
  },
52596
52621
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
52597
52622
  }, style);
52598
- 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('');
52623
+ 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('');
52599
52624
  });
52600
52625
 
52601
52626
  function _interopDefaultLegacy$2 (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -52715,6 +52740,31 @@ var mount = (function (_ref, content) {
52715
52740
  return unmount;
52716
52741
  });
52717
52742
 
52743
+ var PoweredBy = (function () {
52744
+ return /*#__PURE__*/react.createElement("div", {
52745
+ className: "PoweredByWrapper"
52746
+ }, /*#__PURE__*/react.createElement("a", {
52747
+ href: 'https://depay.fi?utm_source=' + window.location.hostname + '&utm_medium=widget&utm_campaign=WidgetV2',
52748
+ rel: "noopener noreferrer",
52749
+ target: "_blank",
52750
+ className: "PoweredByLink"
52751
+ }, "by DePay"));
52752
+ });
52753
+
52754
+ var UpdatableProvider = (function (props) {
52755
+ var _useState = react.useState(true),
52756
+ _useState2 = _slicedToArray(_useState, 2),
52757
+ updatable = _useState2[0],
52758
+ setUpdatable = _useState2[1];
52759
+
52760
+ return /*#__PURE__*/react.createElement(UpdatableContext.Provider, {
52761
+ value: {
52762
+ updatable: updatable,
52763
+ setUpdatable: setUpdatable
52764
+ }
52765
+ }, props.children);
52766
+ });
52767
+
52718
52768
  var Connect = function Connect(options) {
52719
52769
  var style, error, document;
52720
52770
 
@@ -52770,7 +52820,7 @@ var Connect = function Connect(options) {
52770
52820
  error: error,
52771
52821
  container: container,
52772
52822
  unmount: unmount
52773
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
52823
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
52774
52824
  unmount: rejectBeforeUnmount
52775
52825
  }, /*#__PURE__*/react.createElement(ConnectStack, {
52776
52826
  document: document,
@@ -52778,7 +52828,7 @@ var Connect = function Connect(options) {
52778
52828
  resolve: resolve,
52779
52829
  reject: reject,
52780
52830
  autoClose: true
52781
- })));
52831
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))));
52782
52832
  };
52783
52833
  });
52784
52834
 
@@ -65365,7 +65415,9 @@ var NoPaymentMethodFoundDialog = (function () {
65365
65415
  }, /*#__PURE__*/react.createElement("strong", {
65366
65416
  className: "FontSizeM"
65367
65417
  }, "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."))),
65368
- footer: /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
65418
+ footer: /*#__PURE__*/react.createElement("div", {
65419
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
65420
+ }, /*#__PURE__*/react.createElement("button", {
65369
65421
  className: "ButtonPrimary",
65370
65422
  onClick: close
65371
65423
  }, "Ok"))
@@ -65376,7 +65428,7 @@ var PaymentContext = /*#__PURE__*/react.createContext();
65376
65428
 
65377
65429
  var PaymentRoutingContext = /*#__PURE__*/react.createContext();
65378
65430
 
65379
- var UpdateContext = /*#__PURE__*/react.createContext();
65431
+ var TrackingContext = /*#__PURE__*/react.createContext();
65380
65432
 
65381
65433
  var PaymentProvider = (function (props) {
65382
65434
  var _useContext = react.useContext(ErrorContext),
@@ -65385,7 +65437,6 @@ var PaymentProvider = (function (props) {
65385
65437
  var _useContext2 = react.useContext(ConfigurationContext),
65386
65438
  _sent = _useContext2.sent,
65387
65439
  _confirmed = _useContext2.confirmed,
65388
- _ensured = _useContext2.ensured,
65389
65440
  _failed = _useContext2.failed;
65390
65441
 
65391
65442
  var _useContext3 = react.useContext(PaymentRoutingContext),
@@ -65399,13 +65450,17 @@ var PaymentProvider = (function (props) {
65399
65450
  var _useContext5 = react.useContext(PaymentRoutingContext),
65400
65451
  allRoutes = _useContext5.allRoutes;
65401
65452
 
65402
- var _useContext6 = react.useContext(UpdateContext);
65403
- _useContext6.update;
65404
- var setUpdate = _useContext6.setUpdate;
65453
+ var _useContext6 = react.useContext(UpdatableContext),
65454
+ setUpdatable = _useContext6.setUpdatable;
65405
65455
 
65406
65456
  var _useContext7 = react.useContext(WalletContext),
65407
65457
  wallet = _useContext7.wallet;
65408
65458
 
65459
+ var _useContext8 = react.useContext(TrackingContext),
65460
+ forward = _useContext8.forward,
65461
+ tracking = _useContext8.tracking,
65462
+ initializeTracking = _useContext8.initializeTracking;
65463
+
65409
65464
  var _useState = react.useState(),
65410
65465
  _useState2 = _slicedToArray(_useState, 2),
65411
65466
  payment = _useState2[0],
@@ -65426,53 +65481,81 @@ var PaymentProvider = (function (props) {
65426
65481
  paymentState = _useState8[0],
65427
65482
  setPaymentState = _useState8[1];
65428
65483
 
65429
- var pay = function pay(_ref) {
65430
- var navigate = _ref.navigate;
65431
- setClosable(false);
65432
- setPaymentState('paying');
65433
- setUpdate(false);
65434
- wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
65435
- sent: function sent(transaction) {
65436
- if (_sent) {
65437
- _sent(transaction);
65438
- }
65439
- },
65440
- confirmed: function confirmed(transaction) {
65441
- setClosable(true);
65442
- setPaymentState('confirmed');
65484
+ var pay = /*#__PURE__*/function () {
65485
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
65486
+ var navigate, currentBlock;
65487
+ return regenerator.wrap(function _callee$(_context) {
65488
+ while (1) {
65489
+ switch (_context.prev = _context.next) {
65490
+ case 0:
65491
+ navigate = _ref.navigate;
65492
+ setClosable(false);
65493
+ setPaymentState('paying');
65494
+ setUpdatable(false);
65495
+ _context.next = 6;
65496
+ return request({
65497
+ blockchain: payment.route.transaction.blockchain,
65498
+ method: 'latestBlockNumber'
65499
+ });
65443
65500
 
65444
- if (_confirmed) {
65445
- _confirmed(transaction);
65446
- }
65447
- },
65448
- ensured: function ensured(transaction) {
65449
- if (_ensured) {
65450
- _ensured(transaction);
65451
- }
65452
- },
65453
- failed: function failed(transaction, error) {
65454
- if (_failed) {
65455
- _failed(transaction, error);
65456
- }
65501
+ case 6:
65502
+ currentBlock = _context.sent;
65503
+ wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
65504
+ sent: function sent(transaction) {
65505
+ if (_sent) {
65506
+ _sent(transaction);
65507
+ }
65508
+ },
65509
+ confirmed: function confirmed(transaction) {
65510
+ if (tracking != true) {
65511
+ setClosable(true);
65512
+ }
65457
65513
 
65458
- setPaymentState('initialized');
65459
- setClosable(true);
65460
- setUpdate(true);
65461
- navigate('PaymentError');
65462
- }
65463
- })).then(function (sentTransaction) {
65464
- setTransaction(sentTransaction);
65465
- })["catch"](function (error) {
65466
- console.log('error', error);
65467
- setPaymentState('initialized');
65468
- setClosable(true);
65469
- setUpdate(true);
65514
+ setPaymentState('confirmed');
65470
65515
 
65471
- if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
65472
- navigate('WrongNetwork');
65473
- }
65474
- });
65475
- };
65516
+ if (_confirmed) {
65517
+ _confirmed(transaction);
65518
+ }
65519
+ },
65520
+ failed: function failed(transaction, error) {
65521
+ if (_failed) {
65522
+ _failed(transaction, error);
65523
+ }
65524
+
65525
+ setPaymentState('initialized');
65526
+ setClosable(true);
65527
+ setUpdatable(true);
65528
+ navigate('PaymentError');
65529
+ }
65530
+ })).then(function (sentTransaction) {
65531
+ if (tracking) {
65532
+ initializeTracking(sentTransaction, currentBlock);
65533
+ }
65534
+
65535
+ setTransaction(sentTransaction);
65536
+ })["catch"](function (error) {
65537
+ console.log('error', error);
65538
+ setPaymentState('initialized');
65539
+ setClosable(true);
65540
+ setUpdatable(true);
65541
+
65542
+ if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
65543
+ navigate('WrongNetwork');
65544
+ }
65545
+ });
65546
+
65547
+ case 8:
65548
+ case "end":
65549
+ return _context.stop();
65550
+ }
65551
+ }
65552
+ }, _callee);
65553
+ }));
65554
+
65555
+ return function pay(_x) {
65556
+ return _ref2.apply(this, arguments);
65557
+ };
65558
+ }();
65476
65559
 
65477
65560
  var approve = function approve() {
65478
65561
  setClosable(false);
@@ -65493,15 +65576,20 @@ var PaymentProvider = (function (props) {
65493
65576
  });
65494
65577
  };
65495
65578
 
65579
+ react.useEffect(function () {
65580
+ if (forward) {
65581
+ setPaymentState('confirmed');
65582
+ }
65583
+ }, [forward]);
65496
65584
  react.useEffect(function () {
65497
65585
  if (selectedRoute) {
65498
65586
  var fromToken = selectedRoute.fromToken;
65499
65587
  selectedRoute.transaction.params;
65500
- Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref2) {
65501
- var _ref3 = _slicedToArray(_ref2, 3),
65502
- name = _ref3[0],
65503
- symbol = _ref3[1],
65504
- amount = _ref3[2];
65588
+ Promise.all([fromToken.name(), fromToken.symbol(), fromToken.readable(selectedRoute.fromAmount)]).then(function (_ref3) {
65589
+ var _ref4 = _slicedToArray(_ref3, 3),
65590
+ name = _ref4[0],
65591
+ symbol = _ref4[1],
65592
+ amount = _ref4[2];
65505
65593
 
65506
65594
  setPayment({
65507
65595
  route: selectedRoute,
@@ -65517,9 +65605,9 @@ var PaymentProvider = (function (props) {
65517
65605
  }, [selectedRoute]);
65518
65606
  react.useEffect(function () {
65519
65607
  if (allRoutes && allRoutes.length == 0) {
65520
- setUpdate(false);
65608
+ setUpdatable(false);
65521
65609
  } else if (allRoutes && allRoutes.length > 0) {
65522
- setUpdate(true);
65610
+ setUpdatable(true);
65523
65611
  }
65524
65612
  }, [allRoutes]);
65525
65613
 
@@ -70341,8 +70429,8 @@ var PaymentRoutingProvider = (function (props) {
70341
70429
  var _useContext = react.useContext(WalletContext),
70342
70430
  account = _useContext.account;
70343
70431
 
70344
- var _useContext2 = react.useContext(UpdateContext),
70345
- update = _useContext2.update;
70432
+ var _useContext2 = react.useContext(UpdatableContext),
70433
+ updatable = _useContext2.updatable;
70346
70434
 
70347
70435
  var prepareAcceptedPayments = function prepareAcceptedPayments(accept) {
70348
70436
  var toAddress = _typeof(accept.receiver) == 'object' ? accept.receiver.address : accept.receiver;
@@ -70357,9 +70445,9 @@ var PaymentRoutingProvider = (function (props) {
70357
70445
  var getPaymentRoutes = function getPaymentRoutes(_ref) {
70358
70446
  var allRoutes = _ref.allRoutes,
70359
70447
  selectedRoute = _ref.selectedRoute,
70360
- update = _ref.update;
70448
+ updatable = _ref.updatable;
70361
70449
 
70362
- if (update == false || !props.accept || !account) {
70450
+ if (updatable == false || !props.accept || !account) {
70363
70451
  return;
70364
70452
  }
70365
70453
 
@@ -70462,13 +70550,13 @@ var PaymentRoutingProvider = (function (props) {
70462
70550
  getPaymentRoutes({
70463
70551
  allRoutes: allRoutes,
70464
70552
  selectedRoute: selectedRoute,
70465
- update: update
70553
+ updatable: updatable
70466
70554
  });
70467
70555
  }, 15000);
70468
70556
  return function () {
70469
70557
  return clearTimeout(timeout);
70470
70558
  };
70471
- }, [reloadCount, allRoutes, selectedRoute, update]);
70559
+ }, [reloadCount, allRoutes, selectedRoute, updatable]);
70472
70560
  react.useEffect(function () {
70473
70561
  if (account && props.accept) {
70474
70562
  setAllRoutes(undefined);
@@ -70498,8 +70586,8 @@ var PaymentValueProvider = (function (props) {
70498
70586
  var _useContext2 = react.useContext(WalletContext),
70499
70587
  account = _useContext2.account;
70500
70588
 
70501
- var _useContext3 = react.useContext(UpdateContext),
70502
- update = _useContext3.update;
70589
+ var _useContext3 = react.useContext(UpdatableContext),
70590
+ updatable = _useContext3.updatable;
70503
70591
 
70504
70592
  var _useContext4 = react.useContext(PaymentContext),
70505
70593
  payment = _useContext4.payment;
@@ -70518,10 +70606,10 @@ var PaymentValueProvider = (function (props) {
70518
70606
  setReloadCount = _useState4[1];
70519
70607
 
70520
70608
  var getToTokenLocalValue = function getToTokenLocalValue(_ref) {
70521
- var update = _ref.update,
70609
+ var updatable = _ref.updatable,
70522
70610
  payment = _ref.payment;
70523
70611
 
70524
- if (update == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
70612
+ if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
70525
70613
  return;
70526
70614
  }
70527
70615
 
@@ -70564,7 +70652,7 @@ var PaymentValueProvider = (function (props) {
70564
70652
  react.useEffect(function () {
70565
70653
  if (account && payment) {
70566
70654
  getToTokenLocalValue({
70567
- update: update,
70655
+ updatable: updatable,
70568
70656
  payment: payment
70569
70657
  });
70570
70658
  }
@@ -70573,13 +70661,13 @@ var PaymentValueProvider = (function (props) {
70573
70661
  var timeout = setTimeout(function () {
70574
70662
  setReloadCount(reloadCount + 1);
70575
70663
  getToTokenLocalValue({
70576
- update: update
70664
+ updatable: updatable
70577
70665
  });
70578
70666
  }, 15000);
70579
70667
  return function () {
70580
70668
  return clearTimeout(timeout);
70581
70669
  };
70582
- }, [reloadCount, update]);
70670
+ }, [reloadCount, updatable]);
70583
70671
  return /*#__PURE__*/react.createElement(PaymentValueContext.Provider, {
70584
70672
  value: {
70585
70673
  paymentValue: paymentValue
@@ -72466,7 +72554,9 @@ var ChangeAmountDialog = (function (props) {
72466
72554
  changeAmount(toValidValue(maxAmount));
72467
72555
  }
72468
72556
  }, "(Max)")))))),
72469
- footer: /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("button", {
72557
+ footer: /*#__PURE__*/react.createElement("div", {
72558
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72559
+ }, /*#__PURE__*/react.createElement("button", {
72470
72560
  className: "ButtonPrimary",
72471
72561
  onClick: changeAmountAndGoBack
72472
72562
  }, "Done"))
@@ -72553,6 +72643,7 @@ var ChangePaymentDialog = (function (props) {
72553
72643
  }, [allRoutes]);
72554
72644
  react.useEffect(function () {
72555
72645
  setCards(allPaymentRoutesWithData.map(function (payment, index) {
72646
+ var blockchain = Blockchain.findByName(payment.route.blockchain);
72556
72647
  return /*#__PURE__*/react.createElement("div", {
72557
72648
  key: index,
72558
72649
  className: "Card",
@@ -72566,6 +72657,11 @@ var ChangePaymentDialog = (function (props) {
72566
72657
  }, /*#__PURE__*/react.createElement(TokenImage_1, {
72567
72658
  blockchain: payment.route.blockchain,
72568
72659
  address: payment.route.fromToken.address
72660
+ }), /*#__PURE__*/react.createElement("img", {
72661
+ className: "BlockchainLogo small",
72662
+ src: blockchain.logo,
72663
+ alt: blockchain.label,
72664
+ title: blockchain.label
72569
72665
  })), /*#__PURE__*/react.createElement("div", {
72570
72666
  className: "CardBody"
72571
72667
  }, /*#__PURE__*/react.createElement("div", {
@@ -72606,25 +72702,12 @@ var ChangePaymentDialog = (function (props) {
72606
72702
  });
72607
72703
  });
72608
72704
 
72609
- var Checkmark = (function () {
72610
- return /*#__PURE__*/react.createElement("svg", {
72611
- className: "Checkmark Icon",
72612
- version: "1.1",
72613
- xmlns: "http://www.w3.org/2000/svg",
72614
- x: "0px",
72615
- y: "0px",
72616
- viewBox: "0 0 24 24"
72617
- }, /*#__PURE__*/react.createElement("path", {
72618
- 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"
72619
- }));
72620
- });
72621
-
72622
72705
  var DonationOverviewSkeleton = (function (props) {
72623
72706
  return /*#__PURE__*/react.createElement(Dialog, {
72624
72707
  header: /*#__PURE__*/react.createElement("div", {
72625
- className: "PaddingTopS PaddingLeftM PaddingRightM"
72708
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72626
72709
  }, /*#__PURE__*/react.createElement("h1", {
72627
- className: "LineHeightL FontSizeL TextLeft"
72710
+ className: "LineHeightL FontSizeL"
72628
72711
  }, "Donation")),
72629
72712
  body: /*#__PURE__*/react.createElement("div", {
72630
72713
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72638,7 +72721,7 @@ var DonationOverviewSkeleton = (function (props) {
72638
72721
  className: "SkeletonBackground"
72639
72722
  }))),
72640
72723
  footer: /*#__PURE__*/react.createElement("div", {
72641
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
72724
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72642
72725
  }, /*#__PURE__*/react.createElement("div", {
72643
72726
  className: "SkeletonWrapper"
72644
72727
  }, /*#__PURE__*/react.createElement("div", {
@@ -72649,6 +72732,60 @@ var DonationOverviewSkeleton = (function (props) {
72649
72732
  });
72650
72733
  });
72651
72734
 
72735
+ var Checkmark = (function (props) {
72736
+ return /*#__PURE__*/react.createElement("svg", {
72737
+ className: "Checkmark Icon " + props.className,
72738
+ version: "1.1",
72739
+ xmlns: "http://www.w3.org/2000/svg",
72740
+ x: "0px",
72741
+ y: "0px",
72742
+ viewBox: "0 0 24 24"
72743
+ }, /*#__PURE__*/react.createElement("path", {
72744
+ 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"
72745
+ }));
72746
+ });
72747
+
72748
+ var DigitalWalletIcon = (function (props) {
72749
+ return /*#__PURE__*/react.createElement("svg", {
72750
+ className: "DigitalWalletIcon Icon " + props.className,
72751
+ version: "1.1",
72752
+ xmlns: "http://www.w3.org/2000/svg",
72753
+ height: "24",
72754
+ width: "24",
72755
+ viewBox: "0 0 24 24"
72756
+ }, /*#__PURE__*/react.createElement("path", {
72757
+ 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",
72758
+ transform: "translate(-0.81 -1)"
72759
+ }), /*#__PURE__*/react.createElement("path", {
72760
+ 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",
72761
+ transform: "translate(-0.81 -1)"
72762
+ }), /*#__PURE__*/react.createElement("path", {
72763
+ 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",
72764
+ transform: "translate(-0.81 -1)"
72765
+ }), /*#__PURE__*/react.createElement("path", {
72766
+ 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",
72767
+ transform: "translate(-0.81 -1)"
72768
+ }), /*#__PURE__*/react.createElement("path", {
72769
+ 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",
72770
+ transform: "translate(-0.81 -1)"
72771
+ }), /*#__PURE__*/react.createElement("path", {
72772
+ 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",
72773
+ transform: "translate(-0.81 -1)"
72774
+ }), /*#__PURE__*/react.createElement("path", {
72775
+ 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",
72776
+ transform: "translate(-0.81 -1)"
72777
+ }), /*#__PURE__*/react.createElement("rect", {
72778
+ x: "0.33",
72779
+ y: "11.77",
72780
+ width: "4.72",
72781
+ height: "0.66"
72782
+ }), /*#__PURE__*/react.createElement("polygon", {
72783
+ 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"
72784
+ }), /*#__PURE__*/react.createElement("polygon", {
72785
+ 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"
72786
+ }));
72787
+ });
72788
+
72652
72789
  var LoadingText = (function (props) {
72653
72790
  return /*#__PURE__*/react.createElement("div", {
72654
72791
  className: "LoadingText"
@@ -72661,26 +72798,143 @@ var LoadingText = (function (props) {
72661
72798
  }, "."));
72662
72799
  });
72663
72800
 
72664
- var DonationOverviewDialog = (function (props) {
72801
+ var Footer = (function () {
72665
72802
  var _useContext = react.useContext(ConfigurationContext),
72666
72803
  currencyCode = _useContext.currencyCode;
72667
72804
 
72668
72805
  var _useContext2 = react.useContext(ChangableAmountContext),
72669
72806
  amount = _useContext2.amount;
72807
+ _useContext2.amountsMissing;
72670
72808
 
72671
- var _useContext3 = react.useContext(PaymentContext),
72672
- payment = _useContext3.payment,
72673
- paymentState = _useContext3.paymentState,
72674
- pay = _useContext3.pay,
72675
- transaction = _useContext3.transaction,
72676
- approve = _useContext3.approve,
72677
- approvalTransaction = _useContext3.approvalTransaction;
72809
+ var _useContext3 = react.useContext(TrackingContext),
72810
+ tracking = _useContext3.tracking,
72811
+ forward = _useContext3.forward,
72812
+ forwardTo = _useContext3.forwardTo;
72678
72813
 
72679
- var _useContext4 = react.useContext(NavigateStackContext_1),
72680
- navigate = _useContext4.navigate;
72814
+ var _useContext4 = react.useContext(PaymentContext),
72815
+ payment = _useContext4.payment,
72816
+ paymentState = _useContext4.paymentState,
72817
+ pay = _useContext4.pay,
72818
+ transaction = _useContext4.transaction,
72819
+ approve = _useContext4.approve,
72820
+ approvalTransaction = _useContext4.approvalTransaction;
72821
+
72822
+ var _useContext5 = react.useContext(PaymentValueContext),
72823
+ paymentValue = _useContext5.paymentValue;
72681
72824
 
72682
- var _useContext5 = react.useContext(ClosableContext),
72683
- close = _useContext5.close;
72825
+ var _useContext6 = react.useContext(NavigateStackContext_1),
72826
+ navigate = _useContext6.navigate;
72827
+
72828
+ var _useContext7 = react.useContext(ClosableContext),
72829
+ close = _useContext7.close;
72830
+
72831
+ var trackingInfo = function trackingInfo() {
72832
+ if (tracking != true) {
72833
+ return null;
72834
+ }
72835
+
72836
+ if (forward) {
72837
+ return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72838
+ className: "Card transparent small disabled"
72839
+ }, /*#__PURE__*/react.createElement("div", {
72840
+ className: "CardImage"
72841
+ }, /*#__PURE__*/react.createElement("div", {
72842
+ className: "TextCenter Opacity05"
72843
+ }, /*#__PURE__*/react.createElement(Checkmark, {
72844
+ className: "small"
72845
+ }))), /*#__PURE__*/react.createElement("div", {
72846
+ className: "CardBody"
72847
+ }, /*#__PURE__*/react.createElement("div", {
72848
+ className: "CardBodyWrapper"
72849
+ }, /*#__PURE__*/react.createElement("div", {
72850
+ className: "Opacity05"
72851
+ }, "Payment confirmation has been stored")))));
72852
+ } else {
72853
+ return /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72854
+ className: "Card transparent small disabled"
72855
+ }, /*#__PURE__*/react.createElement("div", {
72856
+ className: "CardImage"
72857
+ }, /*#__PURE__*/react.createElement("div", {
72858
+ className: "TextCenter"
72859
+ }, /*#__PURE__*/react.createElement("div", {
72860
+ className: "Loading Icon"
72861
+ }))), /*#__PURE__*/react.createElement("div", {
72862
+ className: "CardBody"
72863
+ }, /*#__PURE__*/react.createElement("div", {
72864
+ className: "CardBodyWrapper"
72865
+ }, /*#__PURE__*/react.createElement("div", {
72866
+ className: "Opacity05"
72867
+ }, "Storing payment confirmation")))));
72868
+ }
72869
+ };
72870
+
72871
+ var additionalPaymentInformation = function additionalPaymentInformation() {
72872
+ if (paymentState == 'paying' && transaction == undefined) {
72873
+ return /*#__PURE__*/react.createElement("div", {
72874
+ className: "PaddingBottomS"
72875
+ }, /*#__PURE__*/react.createElement("div", {
72876
+ className: "Card transparent disabled small"
72877
+ }, /*#__PURE__*/react.createElement("div", {
72878
+ className: "CardImage"
72879
+ }, /*#__PURE__*/react.createElement("div", {
72880
+ className: "TextCenter Opacity05"
72881
+ }, /*#__PURE__*/react.createElement(DigitalWalletIcon, {
72882
+ className: "small"
72883
+ }))), /*#__PURE__*/react.createElement("div", {
72884
+ className: "CardBody"
72885
+ }, /*#__PURE__*/react.createElement("div", {
72886
+ className: "CardBodyWrapper"
72887
+ }, /*#__PURE__*/react.createElement("div", {
72888
+ className: "Opacity05"
72889
+ }, "Confirm transaction in your wallet")))));
72890
+ } else if (paymentState == 'confirmed') {
72891
+ return /*#__PURE__*/react.createElement("div", {
72892
+ className: "PaddingBottomS"
72893
+ }, /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("a", {
72894
+ className: "Card transparent small",
72895
+ title: "Payment has been confirmed by the network",
72896
+ href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
72897
+ target: "_blank",
72898
+ rel: "noopener noreferrer"
72899
+ }, /*#__PURE__*/react.createElement("div", {
72900
+ className: "CardImage"
72901
+ }, /*#__PURE__*/react.createElement("div", {
72902
+ className: "TextCenter Opacity05"
72903
+ }, /*#__PURE__*/react.createElement(Checkmark, {
72904
+ className: "small"
72905
+ }))), /*#__PURE__*/react.createElement("div", {
72906
+ className: "CardBody"
72907
+ }, /*#__PURE__*/react.createElement("div", {
72908
+ className: "CardBodyWrapper"
72909
+ }, /*#__PURE__*/react.createElement("div", {
72910
+ className: "Opacity05"
72911
+ }, "Payment has been confirmed"))))), trackingInfo());
72912
+ }
72913
+ };
72914
+
72915
+ var approvalButton = function approvalButton() {
72916
+ if (!payment.route.approvalRequired || payment.route.directTransfer) {
72917
+ return null;
72918
+ } else if (paymentState == 'initialized') {
72919
+ return /*#__PURE__*/react.createElement("div", {
72920
+ className: "PaddingBottomS"
72921
+ }, /*#__PURE__*/react.createElement("button", {
72922
+ className: "ButtonPrimary",
72923
+ onClick: approve,
72924
+ title: "Allow ".concat(payment.symbol, " to be used as payment")
72925
+ }, "Allow ", payment.symbol, " to be used as payment"));
72926
+ } else if (paymentState == 'approving') {
72927
+ return /*#__PURE__*/react.createElement("div", {
72928
+ className: "PaddingBottomS"
72929
+ }, /*#__PURE__*/react.createElement("a", {
72930
+ className: "ButtonPrimary",
72931
+ title: "Approving payment token - please wait",
72932
+ href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
72933
+ target: "_blank",
72934
+ rel: "noopener noreferrer"
72935
+ }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
72936
+ }
72937
+ };
72684
72938
 
72685
72939
  var mainAction = function mainAction() {
72686
72940
  if (paymentState == 'initialized' || paymentState == 'approving') {
@@ -72695,10 +72949,10 @@ var DonationOverviewDialog = (function (props) {
72695
72949
  navigate: navigate
72696
72950
  });
72697
72951
  }
72698
- }, "Pay ", new Currency({
72952
+ }, "Pay ", amount ? new Currency({
72699
72953
  amount: amount.toFixed(2),
72700
72954
  code: currencyCode
72701
- }).toString());
72955
+ }).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
72702
72956
  } else if (paymentState == 'paying') {
72703
72957
  return /*#__PURE__*/react.createElement("a", {
72704
72958
  className: "ButtonPrimary",
@@ -72708,39 +72962,51 @@ var DonationOverviewDialog = (function (props) {
72708
72962
  rel: "noopener noreferrer"
72709
72963
  }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
72710
72964
  } else if (paymentState == 'confirmed') {
72711
- return /*#__PURE__*/react.createElement("button", {
72712
- className: "ButtonPrimary round",
72713
- title: "Done",
72714
- onClick: close
72715
- }, /*#__PURE__*/react.createElement(Checkmark, null));
72965
+ if (tracking == true) {
72966
+ if (forward) {
72967
+ if (forwardTo) {
72968
+ return /*#__PURE__*/react.createElement("a", {
72969
+ className: "ButtonPrimary",
72970
+ href: forwardTo,
72971
+ rel: "noopener noreferrer"
72972
+ }, "Continue");
72973
+ } else {
72974
+ return /*#__PURE__*/react.createElement("button", {
72975
+ className: "ButtonPrimary",
72976
+ onClick: close
72977
+ }, "Continue");
72978
+ }
72979
+ } else {
72980
+ return /*#__PURE__*/react.createElement("button", {
72981
+ className: "ButtonPrimary disabled",
72982
+ onClick: function onClick() {}
72983
+ }, "Continue");
72984
+ }
72985
+ } else {
72986
+ return /*#__PURE__*/react.createElement("button", {
72987
+ className: "ButtonPrimary",
72988
+ onClick: close
72989
+ }, "Close");
72990
+ }
72716
72991
  }
72717
72992
  };
72718
72993
 
72719
- var approvalAction = function approvalAction() {
72720
- if (paymentState == 'initialized') {
72721
- return /*#__PURE__*/react.createElement("div", {
72722
- className: "PaddingBottomS"
72723
- }, /*#__PURE__*/react.createElement("button", {
72724
- className: "ButtonPrimary wide",
72725
- onClick: approve,
72726
- title: "Allow ".concat(payment.symbol, " to be used as payment")
72727
- }, "Allow ", payment.symbol, " to be used as payment"));
72728
- } else if (paymentState == 'approving') {
72729
- return /*#__PURE__*/react.createElement("div", {
72730
- className: "PaddingBottomS"
72731
- }, /*#__PURE__*/react.createElement("a", {
72732
- className: "ButtonPrimary wide",
72733
- title: "Approving payment token - please wait",
72734
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
72735
- target: "_blank",
72736
- rel: "noopener noreferrer"
72737
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
72738
- }
72739
- };
72994
+ return /*#__PURE__*/react.createElement("div", null, approvalButton(), additionalPaymentInformation(), mainAction());
72995
+ });
72740
72996
 
72741
- var actions = function actions() {
72742
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
72743
- };
72997
+ var DonationOverviewDialog = (function (props) {
72998
+ var _useContext = react.useContext(ConfigurationContext),
72999
+ currencyCode = _useContext.currencyCode;
73000
+
73001
+ var _useContext2 = react.useContext(ChangableAmountContext),
73002
+ amount = _useContext2.amount;
73003
+
73004
+ var _useContext3 = react.useContext(PaymentContext),
73005
+ payment = _useContext3.payment,
73006
+ paymentState = _useContext3.paymentState;
73007
+
73008
+ var _useContext4 = react.useContext(NavigateStackContext_1),
73009
+ navigate = _useContext4.navigate;
72744
73010
 
72745
73011
  if (payment == undefined) {
72746
73012
  return /*#__PURE__*/react.createElement(DonationOverviewSkeleton, null);
@@ -72748,9 +73014,9 @@ var DonationOverviewDialog = (function (props) {
72748
73014
 
72749
73015
  return /*#__PURE__*/react.createElement(Dialog, {
72750
73016
  header: /*#__PURE__*/react.createElement("div", {
72751
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73017
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72752
73018
  }, /*#__PURE__*/react.createElement("h1", {
72753
- className: "LineHeightL FontSizeL TextLeft"
73019
+ className: "LineHeightL FontSizeL"
72754
73020
  }, "Donation")),
72755
73021
  body: /*#__PURE__*/react.createElement("div", {
72756
73022
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72813,8 +73079,8 @@ var DonationOverviewDialog = (function (props) {
72813
73079
  className: "CardAction"
72814
73080
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
72815
73081
  footer: /*#__PURE__*/react.createElement("div", {
72816
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
72817
- }, actions())
73082
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73083
+ }, /*#__PURE__*/react.createElement(Footer, null))
72818
73084
  });
72819
73085
  });
72820
73086
 
@@ -72851,9 +73117,9 @@ var PaymentErrorDialog = (function () {
72851
73117
  rel: "noopener noreferrer"
72852
73118
  }, "View on explorer")))),
72853
73119
  footer: /*#__PURE__*/react.createElement("div", {
72854
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73120
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72855
73121
  }, /*#__PURE__*/react.createElement("button", {
72856
- className: "ButtonPrimary wide",
73122
+ className: "ButtonPrimary",
72857
73123
  onClick: function onClick() {
72858
73124
  return navigate('back');
72859
73125
  }
@@ -72874,9 +73140,9 @@ var WrongNetworkDialog = (function (props) {
72874
73140
  return /*#__PURE__*/react.createElement(Dialog, {
72875
73141
  stacked: true,
72876
73142
  header: /*#__PURE__*/react.createElement("div", {
72877
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73143
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
72878
73144
  }, /*#__PURE__*/react.createElement("h1", {
72879
- className: "LineHeightL FontSizeL TextLeft"
73145
+ className: "LineHeightL FontSizeL"
72880
73146
  }, "Wrong Network")),
72881
73147
  body: /*#__PURE__*/react.createElement("div", {
72882
73148
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -72893,7 +73159,7 @@ var WrongNetworkDialog = (function (props) {
72893
73159
  className: "FontSizeM"
72894
73160
  }, "Please make sure you connect your wallet to the correct network before you try again!"))),
72895
73161
  footer: /*#__PURE__*/react.createElement("div", {
72896
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73162
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
72897
73163
  }, /*#__PURE__*/react.createElement("button", {
72898
73164
  className: "ButtonPrimary",
72899
73165
  onClick: function onClick() {
@@ -72924,16 +73190,122 @@ var DonationStack = (function (props) {
72924
73190
  });
72925
73191
  });
72926
73192
 
72927
- var UpdateProvider = (function (props) {
72928
- var _useState = react.useState(true),
73193
+ var TrackingProvider = (function (props) {
73194
+ var _useContext = react.useContext(ConfigurationContext),
73195
+ track = _useContext.track;
73196
+
73197
+ var _useState = react.useState(track && !!track.endpoint),
72929
73198
  _useState2 = _slicedToArray(_useState, 2),
72930
- update = _useState2[0],
72931
- setUpdate = _useState2[1];
73199
+ tracking = _useState2[0],
73200
+ setTracking = _useState2[1];
72932
73201
 
72933
- return /*#__PURE__*/react.createElement(UpdateContext.Provider, {
73202
+ var _useState3 = react.useState(false),
73203
+ _useState4 = _slicedToArray(_useState3, 2),
73204
+ forward = _useState4[0],
73205
+ setForward = _useState4[1];
73206
+
73207
+ var _useState5 = react.useState(),
73208
+ _useState6 = _slicedToArray(_useState5, 2),
73209
+ forwardTo = _useState6[0],
73210
+ setForwardTo = _useState6[1];
73211
+
73212
+ var _useContext2 = react.useContext(ClosableContext),
73213
+ setClosable = _useContext2.setClosable;
73214
+
73215
+ react.useEffect(function () {
73216
+ setTracking(track && !!track.endpoint);
73217
+ }, [track]);
73218
+
73219
+ var openSocket = function openSocket(transaction) {
73220
+ var socket = new WebSocket('wss://integrate.depay.fi/cable');
73221
+
73222
+ socket.onopen = function (event) {
73223
+ var msg = {
73224
+ command: 'subscribe',
73225
+ identifier: JSON.stringify({
73226
+ blockchain: transaction.blockchain,
73227
+ sender: transaction.from.toLowerCase(),
73228
+ nonce: transaction.nonce,
73229
+ channel: 'PaymentChannel'
73230
+ })
73231
+ };
73232
+ socket.send(JSON.stringify(msg));
73233
+ };
73234
+
73235
+ socket.onclose = function (event) {};
73236
+
73237
+ socket.onmessage = function (event) {
73238
+ var item = JSON.parse(event.data);
73239
+
73240
+ if (item.type === "ping") {
73241
+ return;
73242
+ }
73243
+
73244
+ if (item.message && item.message.forward) {
73245
+ setClosable(!item.message.forward_to);
73246
+ setForwardTo(item.message.forward_to);
73247
+ setForward(item.message.forward);
73248
+ socket.close();
73249
+
73250
+ if (!!item.message.forward_to) {
73251
+ setTimeout(function () {
73252
+ props.document.location.href = item.message.forward_to;
73253
+ }, 500);
73254
+ }
73255
+ }
73256
+ };
73257
+
73258
+ socket.onerror = function (error) {
73259
+ console.log('WebSocket Error: ' + error);
73260
+ };
73261
+ };
73262
+
73263
+ var retryStartTracking = function retryStartTracking(transaction, afterBlock, attempt) {
73264
+ attempt = parseInt(attempt || 1, 10);
73265
+ console.log('RETRY TRACKING ATTEMPT ', attempt);
73266
+
73267
+ if (attempt < 3) {
73268
+ setTimeout(function () {
73269
+ startTracking(transaction, afterBlock, attempt + 1);
73270
+ }, 3000);
73271
+ } else {
73272
+ console.log('TRACKING FAILED AFTER 3 ATTEMPTS!');
73273
+ }
73274
+ };
73275
+
73276
+ var startTracking = function startTracking(transaction, afterBlock, attempt) {
73277
+ fetch(track.endpoint, {
73278
+ method: 'POST',
73279
+ body: JSON.stringify({
73280
+ blockchain: transaction.blockchain,
73281
+ transaction: transaction.id.toLowerCase(),
73282
+ sender: transaction.from.toLowerCase(),
73283
+ nonce: transaction.nonce,
73284
+ after_block: afterBlock
73285
+ })
73286
+ }).then(function (response) {
73287
+ if (response.status == 200) {
73288
+ console.log('TRACKING INITIALIZED');
73289
+ } else {
73290
+ retryStartTracking(transaction, afterBlock, attempt);
73291
+ }
73292
+ })["catch"](function (error) {
73293
+ console.log('TRACKING FAILED', error);
73294
+ retryStartTracking(transaction, afterBlock, attempt);
73295
+ });
73296
+ };
73297
+
73298
+ var initializeTracking = function initializeTracking(transaction, afterBlock) {
73299
+ openSocket(transaction);
73300
+ startTracking(transaction, afterBlock);
73301
+ };
73302
+
73303
+ return /*#__PURE__*/react.createElement(TrackingContext.Provider, {
72934
73304
  value: {
72935
- update: update,
72936
- setUpdate: setUpdate
73305
+ tracking: tracking,
73306
+ initializeTracking: initializeTracking,
73307
+ forward: forward,
73308
+ forwardTo: forwardTo
72937
73309
  }
72938
73310
  }, props.children);
72939
73311
  });
@@ -73036,12 +73408,12 @@ var preflight$2 = /*#__PURE__*/function () {
73036
73408
 
73037
73409
  var Donation = /*#__PURE__*/function () {
73038
73410
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73039
- var amount, accept, event, sent, confirmed, ensured, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
73411
+ var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, document, unmount;
73040
73412
  return regenerator.wrap(function _callee2$(_context2) {
73041
73413
  while (1) {
73042
73414
  switch (_context2.prev = _context2.next) {
73043
73415
  case 0:
73044
- 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;
73416
+ 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;
73045
73417
  _context2.prev = 1;
73046
73418
  _context2.next = 4;
73047
73419
  return preflight$2({
@@ -73067,26 +73439,27 @@ var Donation = /*#__PURE__*/function () {
73067
73439
  event: event,
73068
73440
  sent: sent,
73069
73441
  confirmed: confirmed,
73070
- ensured: ensured,
73071
73442
  failed: failed,
73072
73443
  blacklist: blacklist,
73073
73444
  providers: providers
73074
73445
  }
73075
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
73446
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73076
73447
  unmount: unmount
73077
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
73448
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73078
73449
  container: container,
73079
73450
  connected: connected,
73080
73451
  unmount: unmount
73081
73452
  }, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
73082
73453
  accept: accept
73454
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
73455
+ document: ensureDocument(document)
73083
73456
  }, /*#__PURE__*/react.createElement(DonationRoutingProvider, {
73084
73457
  container: container,
73085
73458
  document: document
73086
73459
  }, /*#__PURE__*/react.createElement(DonationStack, {
73087
73460
  document: document,
73088
73461
  container: container
73089
- })))))))));
73462
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
73090
73463
  };
73091
73464
  });
73092
73465
  return _context2.abrupt("return", {
@@ -73154,9 +73527,9 @@ var PaymentOverviewSkeleton = (function (props) {
73154
73527
 
73155
73528
  return /*#__PURE__*/react.createElement(Dialog, {
73156
73529
  header: /*#__PURE__*/react.createElement("div", {
73157
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73530
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73158
73531
  }, /*#__PURE__*/react.createElement("h1", {
73159
- className: "LineHeightL FontSizeL TextLeft"
73532
+ className: "LineHeightL FontSizeL"
73160
73533
  }, "Payment")),
73161
73534
  body: /*#__PURE__*/react.createElement("div", {
73162
73535
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73170,7 +73543,7 @@ var PaymentOverviewSkeleton = (function (props) {
73170
73543
  className: "SkeletonBackground"
73171
73544
  }))),
73172
73545
  footer: /*#__PURE__*/react.createElement("div", {
73173
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73546
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73174
73547
  }, /*#__PURE__*/react.createElement("div", {
73175
73548
  className: "SkeletonWrapper"
73176
73549
  }, /*#__PURE__*/react.createElement("div", {
@@ -73185,17 +73558,13 @@ var PaymentOverviewDialog = (function (props) {
73185
73558
  var _useContext = react.useContext(ConfigurationContext),
73186
73559
  currencyCode = _useContext.currencyCode;
73187
73560
 
73188
- var _useContext2 = react.useContext(ChangableAmountContext),
73189
- amount = _useContext2.amount,
73190
- amountsMissing = _useContext2.amountsMissing;
73561
+ var _useContext2 = react.useContext(PaymentContext),
73562
+ payment = _useContext2.payment,
73563
+ paymentState = _useContext2.paymentState;
73191
73564
 
73192
- var _useContext3 = react.useContext(PaymentContext),
73193
- payment = _useContext3.payment,
73194
- paymentState = _useContext3.paymentState,
73195
- pay = _useContext3.pay,
73196
- transaction = _useContext3.transaction,
73197
- approve = _useContext3.approve,
73198
- approvalTransaction = _useContext3.approvalTransaction;
73565
+ var _useContext3 = react.useContext(ChangableAmountContext),
73566
+ amount = _useContext3.amount,
73567
+ amountsMissing = _useContext3.amountsMissing;
73199
73568
 
73200
73569
  var _useContext4 = react.useContext(PaymentValueContext),
73201
73570
  paymentValue = _useContext4.paymentValue;
@@ -73203,78 +73572,15 @@ var PaymentOverviewDialog = (function (props) {
73203
73572
  var _useContext5 = react.useContext(NavigateStackContext_1),
73204
73573
  navigate = _useContext5.navigate;
73205
73574
 
73206
- var _useContext6 = react.useContext(ClosableContext),
73207
- close = _useContext6.close;
73208
-
73209
- var mainAction = function mainAction() {
73210
- if (paymentState == 'initialized' || paymentState == 'approving') {
73211
- return /*#__PURE__*/react.createElement("button", {
73212
- className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
73213
- onClick: function onClick() {
73214
- if (payment.route.approvalRequired && !payment.route.directTransfer) {
73215
- return;
73216
- }
73217
-
73218
- pay({
73219
- navigate: navigate
73220
- });
73221
- }
73222
- }, "Pay ", amount ? new Currency({
73223
- amount: amount.toFixed(2),
73224
- code: currencyCode
73225
- }).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
73226
- } else if (paymentState == 'paying') {
73227
- return /*#__PURE__*/react.createElement("a", {
73228
- className: "ButtonPrimary",
73229
- title: "Performing the payment - please wait",
73230
- href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
73231
- target: "_blank",
73232
- rel: "noopener noreferrer"
73233
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
73234
- } else if (paymentState == 'confirmed') {
73235
- return /*#__PURE__*/react.createElement("button", {
73236
- className: "ButtonPrimary round",
73237
- title: "Done",
73238
- onClick: close
73239
- }, /*#__PURE__*/react.createElement(Checkmark, null));
73240
- }
73241
- };
73242
-
73243
- var approvalAction = function approvalAction() {
73244
- if (paymentState == 'initialized') {
73245
- return /*#__PURE__*/react.createElement("div", {
73246
- className: "PaddingBottomS"
73247
- }, /*#__PURE__*/react.createElement("button", {
73248
- className: "ButtonPrimary wide",
73249
- onClick: approve,
73250
- title: "Allow ".concat(payment.symbol, " to be used as payment")
73251
- }, "Allow ", payment.symbol, " to be used as payment"));
73252
- } else if (paymentState == 'approving') {
73253
- return /*#__PURE__*/react.createElement("div", {
73254
- className: "PaddingBottomS"
73255
- }, /*#__PURE__*/react.createElement("a", {
73256
- className: "ButtonPrimary wide",
73257
- title: "Approving payment token - please wait",
73258
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
73259
- target: "_blank",
73260
- rel: "noopener noreferrer"
73261
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
73262
- }
73263
- };
73264
-
73265
- var actions = function actions() {
73266
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
73267
- };
73268
-
73269
73575
  if (payment == undefined || paymentValue == undefined) {
73270
73576
  return /*#__PURE__*/react.createElement(PaymentOverviewSkeleton, null);
73271
73577
  }
73272
73578
 
73273
73579
  return /*#__PURE__*/react.createElement(Dialog, {
73274
73580
  header: /*#__PURE__*/react.createElement("div", {
73275
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73581
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73276
73582
  }, /*#__PURE__*/react.createElement("h1", {
73277
- className: "LineHeightL FontSizeL TextLeft"
73583
+ className: "LineHeightL FontSizeL"
73278
73584
  }, "Payment")),
73279
73585
  body: /*#__PURE__*/react.createElement("div", {
73280
73586
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73337,8 +73643,8 @@ var PaymentOverviewDialog = (function (props) {
73337
73643
  className: "CardAction"
73338
73644
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
73339
73645
  footer: /*#__PURE__*/react.createElement("div", {
73340
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73341
- }, actions())
73646
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73647
+ }, /*#__PURE__*/react.createElement(Footer, null))
73342
73648
  });
73343
73649
  });
73344
73650
 
@@ -73404,12 +73710,12 @@ var preflight$1 = /*#__PURE__*/function () {
73404
73710
 
73405
73711
  var Payment = /*#__PURE__*/function () {
73406
73712
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73407
- var accept, amount, event, sent, confirmed, ensured, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, document, unmount;
73713
+ var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
73408
73714
  return regenerator.wrap(function _callee2$(_context2) {
73409
73715
  while (1) {
73410
73716
  switch (_context2.prev = _context2.next) {
73411
73717
  case 0:
73412
- 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;
73718
+ 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;
73413
73719
  _context2.prev = 1;
73414
73720
  _context2.next = 4;
73415
73721
  return preflight$1({
@@ -73435,15 +73741,15 @@ var Payment = /*#__PURE__*/function () {
73435
73741
  event: event,
73436
73742
  sent: sent,
73437
73743
  confirmed: confirmed,
73438
- ensured: ensured,
73439
73744
  failed: failed,
73440
73745
  whitelist: whitelist,
73441
73746
  blacklist: blacklist,
73442
- providers: providers
73747
+ providers: providers,
73748
+ track: track
73443
73749
  }
73444
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
73750
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73445
73751
  unmount: unmount
73446
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
73752
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73447
73753
  document: document,
73448
73754
  container: container,
73449
73755
  connected: connected,
@@ -73455,13 +73761,15 @@ var Payment = /*#__PURE__*/function () {
73455
73761
  whitelist: whitelist,
73456
73762
  blacklist: blacklist,
73457
73763
  event: event
73764
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
73765
+ document: ensureDocument(document)
73458
73766
  }, /*#__PURE__*/react.createElement(PaymentProvider, {
73459
73767
  container: container,
73460
73768
  document: document
73461
73769
  }, /*#__PURE__*/react.createElement(PaymentValueProvider, null, /*#__PURE__*/react.createElement(PaymentStack, {
73462
73770
  document: document,
73463
73771
  container: container
73464
- })))))))))));
73772
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))))));
73465
73773
  };
73466
73774
  });
73467
73775
  return _context2.abrupt("return", {
@@ -73571,9 +73879,9 @@ var SaleRoutingProvider = (function (props) {
73571
73879
  var SaleOverviewSkeleton = (function (props) {
73572
73880
  return /*#__PURE__*/react.createElement(Dialog, {
73573
73881
  header: /*#__PURE__*/react.createElement("div", {
73574
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73882
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73575
73883
  }, /*#__PURE__*/react.createElement("h1", {
73576
- className: "LineHeightL FontSizeL TextLeft"
73884
+ className: "LineHeightL FontSizeL"
73577
73885
  }, "Purchase")),
73578
73886
  body: /*#__PURE__*/react.createElement("div", {
73579
73887
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73590,7 +73898,7 @@ var SaleOverviewSkeleton = (function (props) {
73590
73898
  className: "SkeletonBackground"
73591
73899
  }))),
73592
73900
  footer: /*#__PURE__*/react.createElement("div", {
73593
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73901
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
73594
73902
  }, /*#__PURE__*/react.createElement("div", {
73595
73903
  className: "SkeletonWrapper"
73596
73904
  }, /*#__PURE__*/react.createElement("div", {
@@ -73602,11 +73910,10 @@ var SaleOverviewSkeleton = (function (props) {
73602
73910
  });
73603
73911
 
73604
73912
  var SaleOverviewDialog = (function (props) {
73605
- var _useContext = react.useContext(ChangableAmountContext),
73606
- amount = _useContext.amount;
73913
+ var _useContext = react.useContext(ChangableAmountContext);
73914
+ _useContext.amount;
73607
73915
 
73608
73916
  var _useContext2 = react.useContext(ConfigurationContext),
73609
- currencyCode = _useContext2.currencyCode,
73610
73917
  tokenImage = _useContext2.tokenImage;
73611
73918
 
73612
73919
  var _useContext3 = react.useContext(PaymentValueContext),
@@ -73614,87 +73921,20 @@ var SaleOverviewDialog = (function (props) {
73614
73921
 
73615
73922
  var _useContext4 = react.useContext(PaymentContext),
73616
73923
  payment = _useContext4.payment,
73617
- paymentState = _useContext4.paymentState,
73618
- pay = _useContext4.pay,
73619
- transaction = _useContext4.transaction,
73620
- approve = _useContext4.approve,
73621
- approvalTransaction = _useContext4.approvalTransaction;
73924
+ paymentState = _useContext4.paymentState;
73622
73925
 
73623
73926
  var _useContext5 = react.useContext(NavigateStackContext_1),
73624
73927
  navigate = _useContext5.navigate;
73625
73928
 
73626
- var _useContext6 = react.useContext(ClosableContext),
73627
- close = _useContext6.close;
73628
-
73629
- var _useContext7 = react.useContext(ToTokenContext),
73630
- toToken = _useContext7.toToken,
73631
- toTokenReadableAmount = _useContext7.toTokenReadableAmount;
73929
+ var _useContext6 = react.useContext(ToTokenContext),
73930
+ toToken = _useContext6.toToken,
73931
+ toTokenReadableAmount = _useContext6.toTokenReadableAmount;
73632
73932
 
73633
73933
  var _useState = react.useState(),
73634
73934
  _useState2 = _slicedToArray(_useState, 2),
73635
73935
  salePerTokenValue = _useState2[0],
73636
73936
  setSalePerTokenValue = _useState2[1];
73637
73937
 
73638
- var mainAction = function mainAction() {
73639
- if (paymentState == 'initialized' || paymentState == 'approving') {
73640
- return /*#__PURE__*/react.createElement("button", {
73641
- className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
73642
- onClick: function onClick() {
73643
- if (payment.route.approvalRequired && !payment.route.directTransfer) {
73644
- return;
73645
- }
73646
-
73647
- pay({
73648
- navigate: navigate
73649
- });
73650
- }
73651
- }, "Pay ", new Currency({
73652
- amount: amount.toFixed(2),
73653
- code: currencyCode
73654
- }).toString());
73655
- } else if (paymentState == 'paying') {
73656
- return /*#__PURE__*/react.createElement("a", {
73657
- className: "ButtonPrimary",
73658
- title: "Performing the payment - please wait",
73659
- href: transaction === null || transaction === void 0 ? void 0 : transaction.url,
73660
- target: "_blank",
73661
- rel: "noopener noreferrer"
73662
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Paying"));
73663
- } else if (paymentState == 'confirmed') {
73664
- return /*#__PURE__*/react.createElement("button", {
73665
- className: "ButtonPrimary round",
73666
- title: "Done",
73667
- onClick: close
73668
- }, /*#__PURE__*/react.createElement(Checkmark, null));
73669
- }
73670
- };
73671
-
73672
- var approvalAction = function approvalAction() {
73673
- if (paymentState == 'initialized') {
73674
- return /*#__PURE__*/react.createElement("div", {
73675
- className: "PaddingBottomS"
73676
- }, /*#__PURE__*/react.createElement("button", {
73677
- className: "ButtonPrimary wide",
73678
- onClick: approve,
73679
- title: "Allow ".concat(payment.symbol, " to be used as payment")
73680
- }, "Allow ", payment.symbol, " to be used as payment"));
73681
- } else if (paymentState == 'approving') {
73682
- return /*#__PURE__*/react.createElement("div", {
73683
- className: "PaddingBottomS"
73684
- }, /*#__PURE__*/react.createElement("a", {
73685
- className: "ButtonPrimary wide",
73686
- title: "Approving payment token - please wait",
73687
- href: approvalTransaction === null || approvalTransaction === void 0 ? void 0 : approvalTransaction.url,
73688
- target: "_blank",
73689
- rel: "noopener noreferrer"
73690
- }, /*#__PURE__*/react.createElement(LoadingText, null, "Approving")));
73691
- }
73692
- };
73693
-
73694
- var actions = function actions() {
73695
- return /*#__PURE__*/react.createElement("div", null, payment.route.approvalRequired && !payment.route.directTransfer && approvalAction(), mainAction());
73696
- };
73697
-
73698
73938
  react.useEffect(function () {
73699
73939
  if (paymentValue) {
73700
73940
  setSalePerTokenValue(new Currency({
@@ -73723,9 +73963,9 @@ var SaleOverviewDialog = (function (props) {
73723
73963
 
73724
73964
  return /*#__PURE__*/react.createElement(Dialog, {
73725
73965
  header: /*#__PURE__*/react.createElement("div", {
73726
- className: "PaddingTopS PaddingLeftM PaddingRightM"
73966
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
73727
73967
  }, /*#__PURE__*/react.createElement("h1", {
73728
- className: "LineHeightL FontSizeL TextLeft"
73968
+ className: "LineHeightL FontSizeL"
73729
73969
  }, "Purchase")),
73730
73970
  body: /*#__PURE__*/react.createElement("div", {
73731
73971
  className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
@@ -73794,8 +74034,8 @@ var SaleOverviewDialog = (function (props) {
73794
74034
  className: "CardAction"
73795
74035
  }, /*#__PURE__*/react.createElement(ChevronRight, null)))),
73796
74036
  footer: /*#__PURE__*/react.createElement("div", {
73797
- className: "PaddingTopXS PaddingRightM PaddingLeftM"
73798
- }, actions())
74037
+ className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
74038
+ }, /*#__PURE__*/react.createElement(Footer, null))
73799
74039
  });
73800
74040
  });
73801
74041
 
@@ -73868,12 +74108,12 @@ var preflight = /*#__PURE__*/function () {
73868
74108
 
73869
74109
  var Sale = /*#__PURE__*/function () {
73870
74110
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
73871
- var amount, sell, sent, confirmed, ensured, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
74111
+ var amount, sell, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, document, accept, unmount;
73872
74112
  return regenerator.wrap(function _callee2$(_context2) {
73873
74113
  while (1) {
73874
74114
  switch (_context2.prev = _context2.next) {
73875
74115
  case 0:
73876
- 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;
74116
+ 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;
73877
74117
  _context2.prev = 1;
73878
74118
  _context2.next = 4;
73879
74119
  return preflight({
@@ -73905,26 +74145,27 @@ var Sale = /*#__PURE__*/function () {
73905
74145
  currency: currency,
73906
74146
  sent: sent,
73907
74147
  confirmed: confirmed,
73908
- ensured: ensured,
73909
74148
  failed: failed,
73910
74149
  blacklist: blacklist,
73911
74150
  providers: providers
73912
74151
  }
73913
- }, /*#__PURE__*/react.createElement(ClosableProvider, {
74152
+ }, /*#__PURE__*/react.createElement(UpdatableProvider, null, /*#__PURE__*/react.createElement(ClosableProvider, {
73914
74153
  unmount: unmount
73915
- }, /*#__PURE__*/react.createElement(UpdateProvider, null, /*#__PURE__*/react.createElement(WalletProvider, {
74154
+ }, /*#__PURE__*/react.createElement(WalletProvider, {
73916
74155
  container: container,
73917
74156
  connected: connected,
73918
74157
  unmount: unmount
73919
74158
  }, /*#__PURE__*/react.createElement(ConversionRateProvider, null, /*#__PURE__*/react.createElement(ChangableAmountProvider, {
73920
74159
  accept: accept
74160
+ }, /*#__PURE__*/react.createElement(TrackingProvider, {
74161
+ document: ensureDocument(document)
73921
74162
  }, /*#__PURE__*/react.createElement(SaleRoutingProvider, {
73922
74163
  container: container,
73923
74164
  document: document
73924
74165
  }, /*#__PURE__*/react.createElement(SaleStack, {
73925
74166
  document: document,
73926
74167
  container: container
73927
- })))))))));
74168
+ }), /*#__PURE__*/react.createElement(PoweredBy, null))))))))));
73928
74169
  };
73929
74170
  });
73930
74171
  return _context2.abrupt("return", {