@depay/widgets 6.3.0 → 6.4.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.
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useState, useContext, useEffect } from 'react';
1
+ import React, { useState, useContext, useEffect, useRef } from 'react';
2
2
  import { NavigateStackContext, ReactDialogStack } from '@depay/react-dialog-stack';
3
3
  import { getWallet, wallets } from '@depay/web3-wallets';
4
4
  import ReactDOM from 'react-dom';
@@ -918,7 +918,8 @@ var ClosableProvider = (function (props) {
918
918
  closable: closable,
919
919
  setClosable: setClosable,
920
920
  close: close,
921
- open: open
921
+ open: open,
922
+ setOpen: setOpen
922
923
  }
923
924
  }, props.children);
924
925
  });
@@ -973,23 +974,21 @@ var Dialog$1 = (function (props) {
973
974
  }, /*#__PURE__*/React.createElement("div", {
974
975
  className: ["DialogHeader", props.stacked ? 'TextCenter' : ''].join(' ')
975
976
  }, props.stacked && /*#__PURE__*/React.createElement("div", {
976
- className: "DialogHeaderAction PaddingTopS PaddingLeftS PaddingRightS"
977
+ className: "DialogHeaderActionLeft PaddingTopS PaddingLeftS PaddingRightS"
977
978
  }, /*#__PURE__*/React.createElement("button", {
978
979
  onClick: function onClick() {
979
980
  return navigate('back');
980
981
  },
981
982
  className: "ButtonCircular",
982
983
  title: "Go back"
983
- }, /*#__PURE__*/React.createElement(ChevronLeft, null))), /*#__PURE__*/React.createElement("div", {
984
- className: "DialogHeaderTitle"
985
- }, props.header), /*#__PURE__*/React.createElement("div", {
986
- className: "DialogHeaderAction PaddingTopS PaddingLeftS PaddingRightS"
984
+ }, /*#__PURE__*/React.createElement(ChevronLeft, null))), props.header, /*#__PURE__*/React.createElement("div", {
985
+ className: "DialogHeaderActionRight PaddingTopS PaddingLeftS PaddingRightS"
987
986
  }, closable && /*#__PURE__*/React.createElement("button", {
988
987
  onClick: close,
989
988
  className: "ButtonCircular",
990
989
  title: "Close dialog"
991
990
  }, /*#__PURE__*/React.createElement(CloseIcon, null)))), /*#__PURE__*/React.createElement("div", {
992
- className: "DialogBody"
991
+ className: ["DialogBody", props.bodyClassName].join(' ')
993
992
  }, props.body), /*#__PURE__*/React.createElement("div", {
994
993
  className: "DialogFooter"
995
994
  }, props.footer));
@@ -1145,6 +1144,7 @@ var SelectWalletDialog = (function (props) {
1145
1144
  }, /*#__PURE__*/React.createElement("div", {
1146
1145
  className: "CardImage"
1147
1146
  }, /*#__PURE__*/React.createElement("img", {
1147
+ className: "transparent",
1148
1148
  src: wallet.info.logo
1149
1149
  })), /*#__PURE__*/React.createElement("div", {
1150
1150
  className: "CardBody"
@@ -1161,7 +1161,7 @@ var SelectWalletDialog = (function (props) {
1161
1161
  className: "LineHeightL FontSizeL"
1162
1162
  }, "Select a wallet")),
1163
1163
  body: /*#__PURE__*/React.createElement("div", {
1164
- className: "PaddingTopS PaddingBottomXS PaddingLeftS PaddingRightS"
1164
+ className: "PaddingBottomS PaddingLeftS PaddingRightS"
1165
1165
  }, walletCards),
1166
1166
  footer: /*#__PURE__*/React.createElement("div", {
1167
1167
  className: "PaddingBottomS"
@@ -1587,7 +1587,7 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
1587
1587
  }(React.Component);
1588
1588
 
1589
1589
  var ErrorProvider = (function (props) {
1590
- var _useState = useState(),
1590
+ var _useState = useState(props.error),
1591
1591
  _useState2 = _slicedToArray(_useState, 2),
1592
1592
  error = _useState2[0],
1593
1593
  setError = _useState2[1];
@@ -1600,8 +1600,8 @@ var ErrorProvider = (function (props) {
1600
1600
  var setErrorFromChildren = function setErrorFromChildren(error) {
1601
1601
  setError(error);
1602
1602
 
1603
- if (props.error) {
1604
- props.error(error);
1603
+ if (props.errorCallback) {
1604
+ props.errorCallback(error);
1605
1605
  }
1606
1606
  };
1607
1607
 
@@ -1660,6 +1660,10 @@ var ErrorProvider = (function (props) {
1660
1660
  }
1661
1661
  });
1662
1662
 
1663
+ var AlertStyle = (function (style) {
1664
+ return "\n\n .Alert {\n background: rgba(0,0,0,0.08);\n border-radius: 0.4rem;\n font-weight: 500;\n padding: 0.5rem;\n }\n ";
1665
+ });
1666
+
1663
1667
  var BlockchainLogoStyle = (function (style) {
1664
1668
  return "\n\n .BlockchainLogo {\n border-radius: 999px;\n }\n\n .BlockchainLogo.small {\n height: 18px;\n width: 18px;\n }\n ";
1665
1669
  });
@@ -1673,11 +1677,11 @@ var ButtonPrimaryStyle = (function (style) {
1673
1677
  });
1674
1678
 
1675
1679
  var CardStyle = (function (style) {
1676
- 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 ");
1680
+ 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 .Card.Row {\n border-radius: 0;\n margin-bottom: 0;\n box-shadow: none;\n min-height: 4.3rem;\n padding: 0.4rem 1.3rem;\n border-top: 1px solid rgba(0,0,0,0.05);\n }\n\n .Card.Row .CardText {\n font-size: 1.2rem;\n }\n\n .CardTokenSymbol {\n width: 40%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .CardTokenName {\n text-align: right;\n opacity: 0.5;\n width: 60%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n \n .Card.Row .CardTokenName .CardText {\n font-size: 1rem;\n }\n\n .Card.Row .CardImage {\n width: 2.5rem;\n }\n\n .Card.Row .CardImage img {\n height: 1.9rem;\n width: 1.9rem;\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 .CardImage.small {\n width: 1.7rem;\n }\n\n .CardImage.small img {\n height: 1.4rem;\n width: 1.4rem;\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 background: rgba(0,0,0,0.1);\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 img.transparent {\n border: none;\n background: none;\n box-shadow: none;\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.26rem;\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 ");
1677
1681
  });
1678
1682
 
1679
1683
  var DialogStyle = (function (style) {
1680
- 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: 60vh !important;\n }\n\n .DialogFooter {\n padding-bottom: 20px;\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 ";
1684
+ 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 background: rgb(248,248,248);\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 }\n\n .DialogFooter {\n padding-bottom: 20px;\n }\n\n .ReactDialogStackCell {\n vertical-align: bottom;\n }\n\n .ReactDialogAnimation {\n bottom: -100px !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.ScrollHeight {\n height: 30vh !important;\n max-height: 30vh !important;\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 min-height: 3.4rem;\n position: relative;\n width: 100%;\n }\n\n .DialogHeaderActionRight {\n position: absolute;\n top: 0;\n right: 0;\n height: 3rem;\n }\n\n .DialogHeaderActionLeft {\n position: absolute;\n top: 0;\n left: 0;\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 ";
1681
1685
  });
1682
1686
 
1683
1687
  var FontStyle = (function (style) {
@@ -1708,6 +1712,10 @@ var LabelStyle = (function (style) {
1708
1712
  return "\n\n .Label {\n background: rgb(248,248,248);\n border-radius: 999px;\n color: ".concat(style.colors.primary, ";\n font-size: 0.8rem;\n padding: 0.1rem 0.5rem;\n margin: 0.1rem;\n }\n\n ");
1709
1713
  });
1710
1714
 
1715
+ var LinkStyle = (function (style) {
1716
+ return "\n\n .Link {\n color: ".concat(style.colors.primary, ";\n cursor: pointer;\n text-decoration: none;\n }\n\n .Link:hover {\n filter: brightness(0.8);\n }\n\n .Link:active {\n filter: brightness(1.0);\n }\n ");
1717
+ });
1718
+
1711
1719
  var LoadingTextStyle = (function (style) {
1712
1720
  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 ");
1713
1721
  });
@@ -1732,10 +1740,18 @@ var ResetStyle = (function () {
1732
1740
  return "\n\n html, body, div, span, applet, object, iframe,\n h1, h2, h3, h4, h5, h6, p, blockquote, pre,\n a, abbr, acronym, address, big, cite, code,\n del, dfn, em, img, ins, kbd, q, s, samp,\n small, strike, strong, sub, sup, tt, var,\n b, u, i, center,\n dl, dt, dd, ol, ul, li,\n fieldset, form, label, legend,\n table, caption, tbody, tfoot, thead, tr, th, td,\n article, aside, canvas, details, embed, \n figure, figcaption, footer, header, hgroup, \n menu, nav, output, ruby, section, summary,\n time, mark, audio, video {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n text-align: inherit;\n vertical-align: baseline;\n }\n\n article, aside, details, figcaption, figure, \n footer, header, hgroup, menu, nav, section {\n display: block;\n }\n\n body {\n line-height: 1;\n }\n\n ol, ul {\n list-style: none;\n }\n\n blockquote, q {\n quotes: none;\n }\n\n blockquote:before, blockquote:after,\n q:before, q:after {\n content: '';\n content: none;\n }\n \n table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n * {\n box-sizing: border-box;\n }\n\n button {\n border: 0;\n background: none;\n outline: none;\n }\n\n ";
1733
1741
  });
1734
1742
 
1743
+ var SearchStyle = (function (style) {
1744
+ return "\n\n .Search {\n border-radius: 0.8rem;\n border: 1px solid rgba(0,0,0,0.2);\n outline: none !important;\n color: ".concat(style.colors.text, ";\n font-size: 1.2rem;\n padding: 0.8rem;\n width: 100%;\n }\n\n .Search::placeholder {\n color: rgb(180,180,180);\n } \n\n .Search:focus, .Search:focus-visible {\n border: 1px solid ").concat(style.colors.primary, ";\n }\n\n ");
1745
+ });
1746
+
1735
1747
  var SkeletonStyle = (function () {
1736
1748
  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 ";
1737
1749
  });
1738
1750
 
1751
+ var TableStyle = (function (style) {
1752
+ return "\n\n .Table {\n border-collapse: separate;\n border-radius: 0.4rem;\n border-style: hidden;\n border: 1px solid rgba(0,0,0,0.1);\n font-size: 94%;\n width: 100%;\n }\n\n .Table tr.small td {\n font-size: 90%;\n }\n\n .Table tr td {\n border-bottom: 1px solid rgba(0,0,0,0.1);\n word-break: break-all;\n }\n \n .Table tr:last-child td {\n border-bottom: none;\n }\n \n .Table tr td {\n padding: 0.5rem 0.9rem;\n text-align: left;\n }\n \n .Table tr td:first-child {\n width: 30%\n }\n\n .Table tr td:last-child {\n width: 70%\n }\n \n .Table .TableSubTitle {\n font-weight: 300;\n opacity: 0.7;\n }\n\n .Table tr td:last-child {\n font-weight: 500;\n }\n ";
1753
+ });
1754
+
1739
1755
  var TextButtonStyle = (function (style) {
1740
1756
  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 ");
1741
1757
  });
@@ -1745,7 +1761,15 @@ var TextStyle = (function (style) {
1745
1761
  });
1746
1762
 
1747
1763
  var TokenAmountStyle = (function () {
1748
- return "\n \n .TokenAmountRow {\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: row;\n }\n\n .TokenAmountCell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .TokenSymbolCell {\n \n }\n ";
1764
+ return "\n \n .TokenAmountRow {\n min-width: 0;\n width: 100%;\n display: flex;\n flex-direction: row;\n }\n\n .TokenAmountCell {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .TokenSymbolCell {\n }\n ";
1765
+ });
1766
+
1767
+ var TokenImageStyle = (function (style) {
1768
+ return "\n\n .TokenImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n background: rgba(0,0,0,0.1);\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 .TokenImage.medium img {\n height: 5.8rem;\n width: 5.8rem;\n }\n ";
1769
+ });
1770
+
1771
+ var TooltipStyle = (function (style) {
1772
+ return "\n\n .Tooltip {\n background: ".concat(style.colors.primary, ";\n border-radius: 0.6rem;\n color: ").concat(style.colors.buttonText, ";\n padding: 0.6rem 0.8rem;\n position: relative;\n box-shadow: 0 0 8px rgba(0,0,0,0.2);\n }\n\n .TooltipArrowUp {\n border-bottom: 10px solid ").concat(style.colors.primary, ";\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n height: 0; \n left: 12px;\n position: absolute;\n top: -8px;\n width: 0; \n }\n ");
1749
1773
  });
1750
1774
 
1751
1775
  var styleRenderer = (function (style) {
@@ -1758,7 +1782,7 @@ var styleRenderer = (function (style) {
1758
1782
  },
1759
1783
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
1760
1784
  }, style);
1761
- 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('');
1785
+ 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(), SearchStyle(style), TokenImageStyle(), AlertStyle(), TableStyle(), LinkStyle(style), TooltipStyle(style)].join('');
1762
1786
  });
1763
1787
 
1764
1788
  var mount = (function (_ref, content) {
@@ -1871,7 +1895,7 @@ var Connect = function Connect(options) {
1871
1895
 
1872
1896
  return function (container) {
1873
1897
  return /*#__PURE__*/React.createElement(ErrorProvider, {
1874
- error: error,
1898
+ errorCallback: error,
1875
1899
  container: container,
1876
1900
  unmount: unmount
1877
1901
  }, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
@@ -3002,7 +3026,7 @@ var DonationOverviewSkeleton = (function (props) {
3002
3026
  className: "LineHeightL FontSizeL"
3003
3027
  }, "Donation")),
3004
3028
  body: /*#__PURE__*/React.createElement("div", {
3005
- className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
3029
+ className: "PaddingLeftM PaddingRightM PaddingBottomXS"
3006
3030
  }, /*#__PURE__*/React.createElement("div", {
3007
3031
  className: "Card Skeleton"
3008
3032
  }, /*#__PURE__*/React.createElement("div", {
@@ -3311,7 +3335,7 @@ var DonationOverviewDialog = (function (props) {
3311
3335
  className: "LineHeightL FontSizeL"
3312
3336
  }, "Donation")),
3313
3337
  body: /*#__PURE__*/React.createElement("div", {
3314
- className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
3338
+ className: "PaddingLeftM PaddingRightM PaddingBottomXS"
3315
3339
  }, /*#__PURE__*/React.createElement("div", {
3316
3340
  className: ["Card", paymentState == 'initialized' ? '' : 'disabled'].join(' '),
3317
3341
  title: paymentState == 'initialized' ? "Change amount" : undefined,
@@ -3720,7 +3744,7 @@ var Donation = /*#__PURE__*/function () {
3720
3744
  }, function (unmount) {
3721
3745
  return function (container) {
3722
3746
  return /*#__PURE__*/React.createElement(ErrorProvider, {
3723
- error: error,
3747
+ errorCallback: error,
3724
3748
  container: container,
3725
3749
  unmount: unmount
3726
3750
  }, /*#__PURE__*/React.createElement(ConfigurationProvider, {
@@ -3911,7 +3935,7 @@ var Login = function Login(options) {
3911
3935
 
3912
3936
  return function (container) {
3913
3937
  return /*#__PURE__*/React.createElement(ErrorProvider, {
3914
- error: error,
3938
+ errorCallback: error,
3915
3939
  container: container,
3916
3940
  unmount: unmount
3917
3941
  }, /*#__PURE__*/React.createElement(ConfigurationProvider, {
@@ -3993,7 +4017,7 @@ var PaymentOverviewSkeleton = (function (props) {
3993
4017
  className: "LineHeightL FontSizeL"
3994
4018
  }, "Payment")),
3995
4019
  body: /*#__PURE__*/React.createElement("div", {
3996
- className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
4020
+ className: "PaddingLeftM PaddingRightM PaddingBottomXS"
3997
4021
  }, amountsMissing && /*#__PURE__*/React.createElement("div", {
3998
4022
  className: "Card Skeleton"
3999
4023
  }, /*#__PURE__*/React.createElement("div", {
@@ -4044,7 +4068,7 @@ var PaymentOverviewDialog = (function (props) {
4044
4068
  className: "LineHeightL FontSizeL"
4045
4069
  }, "Payment")),
4046
4070
  body: /*#__PURE__*/React.createElement("div", {
4047
- className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
4071
+ className: "PaddingLeftM PaddingRightM PaddingBottomXS"
4048
4072
  }, amountsMissing && /*#__PURE__*/React.createElement("div", {
4049
4073
  className: ["Card", paymentState == 'initialized' ? '' : 'disabled'].join(' '),
4050
4074
  title: paymentState == 'initialized' ? "Change amount" : undefined,
@@ -4191,7 +4215,7 @@ var Payment = /*#__PURE__*/function () {
4191
4215
  }, function (unmount) {
4192
4216
  return function (container) {
4193
4217
  return /*#__PURE__*/React.createElement(ErrorProvider, {
4194
- error: error,
4218
+ errorCallback: error,
4195
4219
  container: container,
4196
4220
  unmount: unmount
4197
4221
  }, /*#__PURE__*/React.createElement(ConfigurationProvider, {
@@ -4345,7 +4369,7 @@ var SaleOverviewSkeleton = (function (props) {
4345
4369
  className: "LineHeightL FontSizeL"
4346
4370
  }, "Purchase")),
4347
4371
  body: /*#__PURE__*/React.createElement("div", {
4348
- className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
4372
+ className: "PaddingLeftM PaddingRightM PaddingBottomXS"
4349
4373
  }, /*#__PURE__*/React.createElement("div", {
4350
4374
  className: "Card Skeleton",
4351
4375
  style: {
@@ -4429,7 +4453,7 @@ var SaleOverviewDialog = (function (props) {
4429
4453
  className: "LineHeightL FontSizeL"
4430
4454
  }, "Purchase")),
4431
4455
  body: /*#__PURE__*/React.createElement("div", {
4432
- className: "PaddingTopS PaddingLeftM PaddingRightM PaddingBottomXS"
4456
+ className: "PaddingLeftM PaddingRightM PaddingBottomXS"
4433
4457
  }, /*#__PURE__*/React.createElement("div", {
4434
4458
  className: ["Card", paymentState == 'initialized' ? '' : 'disabled'].join(' '),
4435
4459
  title: paymentState == 'initialized' ? "Change amount" : undefined,
@@ -4595,7 +4619,7 @@ var Sale = /*#__PURE__*/function () {
4595
4619
  }, function (unmount) {
4596
4620
  return function (container) {
4597
4621
  return /*#__PURE__*/React.createElement(ErrorProvider, {
4598
- error: error,
4622
+ errorCallback: error,
4599
4623
  container: container,
4600
4624
  unmount: unmount
4601
4625
  }, /*#__PURE__*/React.createElement(ConfigurationProvider, {
@@ -4655,12 +4679,552 @@ var Sale = /*#__PURE__*/function () {
4655
4679
  };
4656
4680
  }();
4657
4681
 
4682
+ var SelectionContext = /*#__PURE__*/React.createContext();
4683
+
4684
+ var SelectionProvider = (function (props) {
4685
+ var _useState = useState({}),
4686
+ _useState2 = _slicedToArray(_useState, 2),
4687
+ selection = _useState2[0],
4688
+ setSelection = _useState2[1];
4689
+
4690
+ return /*#__PURE__*/React.createElement(SelectionContext.Provider, {
4691
+ value: {
4692
+ selection: selection,
4693
+ setSelection: setSelection
4694
+ }
4695
+ }, props.children);
4696
+ });
4697
+
4698
+ var msToTime = (function (ms) {
4699
+ var year, month, day, hour, minute, second;
4700
+ second = Math.floor(ms / 1000);
4701
+ minute = Math.floor(second / 60);
4702
+ second = second % 60;
4703
+ hour = Math.floor(minute / 60);
4704
+ minute = minute % 60;
4705
+ day = Math.floor(hour / 24);
4706
+ hour = hour % 24;
4707
+ month = Math.floor(day / 30);
4708
+ day = day % 30;
4709
+ year = Math.floor(month / 12);
4710
+ month = month % 12;
4711
+ return {
4712
+ year: year,
4713
+ month: month,
4714
+ day: day,
4715
+ hour: hour,
4716
+ minute: minute,
4717
+ second: second
4718
+ };
4719
+ });
4720
+
4721
+ var ConfirmTokenSelectionDialog = (function (props) {
4722
+ var _useContext = useContext(SelectionContext),
4723
+ selection = _useContext.selection;
4724
+
4725
+ var _useContext2 = useContext(ClosableContext),
4726
+ setOpen = _useContext2.setOpen;
4727
+
4728
+ var token = selection.token;
4729
+ var address = token.address || token.external_id;
4730
+ var logo = token.logo || token.image;
4731
+ var blockchain = Blockchain.findByName(token.blockchain);
4732
+ var age = token.first_transfer ? msToTime(new Date() - new Date(token.first_transfer)) : undefined;
4733
+
4734
+ if (age) {
4735
+ age = [age.year && age.year >= 1 ? age.year >= 2 ? "".concat(age.year, " years") : "1 year" : undefined, age.month && age.month >= 1 ? age.month >= 2 ? "".concat(age.month, " months") : "1 month" : undefined, age.day && age.day >= 1 && age.month <= 1 && age.year < 1 ? age.day >= 2 ? "".concat(age.day, " days !!!") : "1 day !!!" : undefined].filter(function (n) {
4736
+ return n;
4737
+ }).join(' ');
4738
+ }
4739
+
4740
+ var holders = token.unique_senders ? token.unique_senders : undefined;
4741
+
4742
+ if (holders) {
4743
+ if (holders > 1000000) {
4744
+ holders = "Millions";
4745
+ } else if (holders > 100000) {
4746
+ holders = "Hundreds of Thousands";
4747
+ } else if (holders > 2000) {
4748
+ holders = "Thousands";
4749
+ } else if (holders > 100) {
4750
+ holders = "Hundreds";
4751
+ } else {
4752
+ holders = "Only a Few!!!";
4753
+ }
4754
+ }
4755
+
4756
+ var onClickConfirm = function onClickConfirm() {
4757
+ setOpen(false);
4758
+ props.resolve({
4759
+ blockchain: token.blockchain,
4760
+ address: token.external_id,
4761
+ symbol: token.symbol,
4762
+ name: token.name,
4763
+ decimals: token.decimals,
4764
+ logo: token.image
4765
+ });
4766
+ setTimeout(props.unmount, 300);
4767
+ };
4768
+
4769
+ return /*#__PURE__*/React.createElement(Dialog$1, {
4770
+ header: /*#__PURE__*/React.createElement("div", {
4771
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
4772
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
4773
+ className: "LineHeightL FontSizeL"
4774
+ }, "Confirm Selection"))),
4775
+ stacked: true,
4776
+ body: /*#__PURE__*/React.createElement("div", {
4777
+ className: "PaddingTopS PaddingLeftM PaddingRightM"
4778
+ }, /*#__PURE__*/React.createElement("div", {
4779
+ className: "TokenImage medium"
4780
+ }, logo && /*#__PURE__*/React.createElement("img", {
4781
+ src: logo
4782
+ }), !logo && /*#__PURE__*/React.createElement(TokenImage, {
4783
+ blockchain: token.blockchain,
4784
+ address: address
4785
+ })), /*#__PURE__*/React.createElement("div", {
4786
+ className: "PaddingTopS"
4787
+ }, /*#__PURE__*/React.createElement("div", {
4788
+ className: "Alert"
4789
+ }, /*#__PURE__*/React.createElement("strong", null, "Please review this information"))), /*#__PURE__*/React.createElement("div", {
4790
+ className: "PaddingTopXS"
4791
+ }, /*#__PURE__*/React.createElement("table", {
4792
+ className: "Table"
4793
+ }, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", {
4794
+ className: "small"
4795
+ }, /*#__PURE__*/React.createElement("td", {
4796
+ colSpan: "2"
4797
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
4798
+ className: "Link",
4799
+ href: blockchain.explorerUrlFor({
4800
+ token: address
4801
+ }),
4802
+ target: "_blank",
4803
+ rel: "noopener noreferrer"
4804
+ }, address)))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
4805
+ className: "TableSubTitle"
4806
+ }, "Blockchain")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, blockchain.label))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
4807
+ className: "TableSubTitle"
4808
+ }, "Symbol")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, token.symbol))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
4809
+ className: "TableSubTitle"
4810
+ }, "Name")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, token.name))), age && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
4811
+ className: "TableSubTitle"
4812
+ }, "Age")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, age))), holders && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
4813
+ className: "TableSubTitle"
4814
+ }, "Holders")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, holders))))))),
4815
+ footer: /*#__PURE__*/React.createElement("div", {
4816
+ className: "PaddingTopS PaddingRightM PaddingLeftM PaddingBottomS"
4817
+ }, /*#__PURE__*/React.createElement("button", {
4818
+ className: "ButtonPrimary",
4819
+ onClick: onClickConfirm
4820
+ }, "Confirm"))
4821
+ });
4822
+ });
4823
+
4824
+ var SelectBlockchainDialog = (function (props) {
4825
+ var _useContext = useContext(SelectionContext),
4826
+ setSelection = _useContext.setSelection;
4827
+
4828
+ var _useContext2 = useContext(NavigateStackContext),
4829
+ navigate = _useContext2.navigate;
4830
+
4831
+ var stacked = Object.keys(props.selection).length > 1;
4832
+ var blockchains = [Blockchain.findByName('ethereum'), Blockchain.findByName('bsc')];
4833
+
4834
+ var selectBlockchain = function selectBlockchain(blockchain) {
4835
+ setSelection(Object.assign(props.selection, {
4836
+ blockchain: blockchain
4837
+ }));
4838
+
4839
+ if (stacked) {
4840
+ navigate('back');
4841
+ } else {
4842
+ props.resolve(blockchain);
4843
+ }
4844
+ };
4845
+
4846
+ var elements = blockchains.map(function (blockchain, index) {
4847
+ return /*#__PURE__*/React.createElement("div", {
4848
+ key: index,
4849
+ className: "Card Row",
4850
+ onClick: function onClick() {
4851
+ return selectBlockchain(blockchain);
4852
+ }
4853
+ }, /*#__PURE__*/React.createElement("div", {
4854
+ className: "CardImage"
4855
+ }, /*#__PURE__*/React.createElement("img", {
4856
+ className: "transparent",
4857
+ src: blockchain.logo
4858
+ })), /*#__PURE__*/React.createElement("div", {
4859
+ className: "CardBody"
4860
+ }, /*#__PURE__*/React.createElement("span", {
4861
+ className: "CardText"
4862
+ }, blockchain.label)));
4863
+ });
4864
+ return /*#__PURE__*/React.createElement(Dialog$1, {
4865
+ header: /*#__PURE__*/React.createElement("div", {
4866
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
4867
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
4868
+ className: "LineHeightL FontSizeL"
4869
+ }, "Select Blockchain"))),
4870
+ stacked: stacked,
4871
+ bodyClassName: "ScrollHeight",
4872
+ body: /*#__PURE__*/React.createElement("div", {
4873
+ className: "PaddingTopS"
4874
+ }, elements),
4875
+ footer: /*#__PURE__*/React.createElement("div", {
4876
+ className: "PaddingTopS PaddingRightM PaddingLeftM PaddingBottomS"
4877
+ })
4878
+ });
4879
+ });
4880
+
4881
+ var SelectTokenDialog = (function (props) {
4882
+ var _useContext = useContext(NavigateStackContext),
4883
+ navigate = _useContext.navigate;
4884
+
4885
+ var _useContext2 = useContext(ClosableContext),
4886
+ setOpen = _useContext2.setOpen;
4887
+
4888
+ var _useContext3 = useContext(SelectionContext),
4889
+ setSelection = _useContext3.setSelection;
4890
+
4891
+ var _useState = useState(Blockchain.findByName('ethereum')),
4892
+ _useState2 = _slicedToArray(_useState, 2),
4893
+ blockchain = _useState2[0],
4894
+ setBlockchain = _useState2[1];
4895
+
4896
+ var _useState3 = useState(),
4897
+ _useState4 = _slicedToArray(_useState3, 2),
4898
+ requestController = _useState4[0],
4899
+ setRequestController = _useState4[1];
4900
+
4901
+ var _useState5 = useState(false),
4902
+ _useState6 = _slicedToArray(_useState5, 2),
4903
+ showAddToken = _useState6[0],
4904
+ setShowAddToken = _useState6[1];
4905
+
4906
+ var _useState7 = useState([]),
4907
+ _useState8 = _slicedToArray(_useState7, 2),
4908
+ tokens = _useState8[0],
4909
+ setTokens = _useState8[1];
4910
+
4911
+ var _useState9 = useState(),
4912
+ _useState10 = _slicedToArray(_useState9, 2);
4913
+ _useState10[0];
4914
+ _useState10[1];
4915
+
4916
+ var searchElement = useRef();
4917
+ useEffect(function () {
4918
+ setSelection(Object.assign(props.selection, {
4919
+ blockchain: blockchain,
4920
+ token: undefined
4921
+ }));
4922
+ }, []);
4923
+ useEffect(function () {
4924
+ setBlockchain(props.selection.blockchain);
4925
+ setTokens(props.selection.blockchain.tokens);
4926
+
4927
+ if (searchElement.current) {
4928
+ searchElement.current.value = '';
4929
+ searchElement.current.focus();
4930
+ }
4931
+ }, [props.selection.blockchain]);
4932
+
4933
+ var onClickChangeBlockchain = function onClickChangeBlockchain() {
4934
+ navigate('SelectBlockchain');
4935
+ };
4936
+
4937
+ var onClickAddToken = function onClickAddToken() {
4938
+ setShowAddToken(true);
4939
+
4940
+ if (searchElement.current) {
4941
+ searchElement.current.value = '';
4942
+ searchElement.current.focus();
4943
+ }
4944
+ };
4945
+
4946
+ var onChangeSearch = function onChangeSearch(event) {
4947
+ if (requestController) {
4948
+ requestController.abort();
4949
+ }
4950
+
4951
+ var newRequestController = new AbortController();
4952
+ setRequestController(newRequestController);
4953
+ var signal = newRequestController.signal;
4954
+ var term = event.target.value;
4955
+
4956
+ if (term.match(/^0x/)) {
4957
+ setTokens([]);
4958
+ var token;
4959
+
4960
+ try {
4961
+ token = new Token({
4962
+ blockchain: blockchain.name,
4963
+ address: term
4964
+ });
4965
+ } catch (_unused) {}
4966
+
4967
+ if (token == undefined) {
4968
+ return;
4969
+ }
4970
+
4971
+ Promise.all([token.name(), token.symbol(), token.decimals()]).then(function (_ref) {
4972
+ var _ref2 = _slicedToArray(_ref, 3),
4973
+ name = _ref2[0],
4974
+ symbol = _ref2[1],
4975
+ decimals = _ref2[2];
4976
+
4977
+ setTokens([{
4978
+ name: name,
4979
+ symbol: symbol,
4980
+ decimals: decimals,
4981
+ address: term,
4982
+ blockchain: blockchain.name
4983
+ }]);
4984
+ });
4985
+ } else if (term && term.length) {
4986
+ setTokens([]);
4987
+ fetch("https://api.depay.fi/v2/tokens/search?blockchain=".concat(blockchain.name, "&term=").concat(term), {
4988
+ signal: signal,
4989
+ headers: {
4990
+ 'X-Api-Key': apiKey
4991
+ }
4992
+ }).then(function (response) {
4993
+ if (response.status == 200) {
4994
+ response.json().then(function (tokens) {
4995
+ setTokens(tokens);
4996
+ });
4997
+ }
4998
+ })["catch"](function () {});
4999
+ } else {
5000
+ setTokens(props.selection.blockchain.tokens);
5001
+ }
5002
+ };
5003
+
5004
+ var select = function select(token) {
5005
+ if (blockchain.tokens.find(function (majorToken) {
5006
+ return majorToken.address.toLowerCase() == (token.address || token.external_id).toLowerCase();
5007
+ })) {
5008
+ setOpen(false);
5009
+ props.resolve({
5010
+ blockchain: blockchain.name,
5011
+ address: token.address || token.external_id,
5012
+ logo: token.logo || token.image,
5013
+ name: token.name,
5014
+ symbol: token.symbol,
5015
+ decimals: token.decimals
5016
+ });
5017
+ setTimeout(props.unmount, 300);
5018
+ } else {
5019
+ setSelection(Object.assign(props.selection, {
5020
+ token: token
5021
+ }));
5022
+ navigate('ConfirmTokenSelection');
5023
+ }
5024
+ };
5025
+
5026
+ var elements = tokens.map(function (token, index) {
5027
+ return /*#__PURE__*/React.createElement("div", {
5028
+ key: "".concat(index, "-").concat(token.address),
5029
+ className: "Card Row",
5030
+ onClick: function onClick() {
5031
+ return select(token);
5032
+ }
5033
+ }, /*#__PURE__*/React.createElement("div", {
5034
+ className: "CardImage"
5035
+ }, token.logo && /*#__PURE__*/React.createElement("img", {
5036
+ src: token.logo
5037
+ }), token.image && /*#__PURE__*/React.createElement("img", {
5038
+ src: token.image
5039
+ }), !(token.logo || token.image) && /*#__PURE__*/React.createElement(TokenImage, {
5040
+ blockchain: token.blockchain,
5041
+ address: token.external_id || token.address
5042
+ })), /*#__PURE__*/React.createElement("div", {
5043
+ className: "CardBody"
5044
+ }, /*#__PURE__*/React.createElement("div", {
5045
+ className: "CardTokenSymbol",
5046
+ title: token.symbol
5047
+ }, /*#__PURE__*/React.createElement("span", {
5048
+ className: "CardText"
5049
+ }, token.symbol)), /*#__PURE__*/React.createElement("div", {
5050
+ className: "CardTokenName",
5051
+ title: token.name
5052
+ }, /*#__PURE__*/React.createElement("span", {
5053
+ className: "CardText"
5054
+ }, token.name))));
5055
+ });
5056
+
5057
+ if (props.selection.blockchain == undefined) {
5058
+ return null;
5059
+ }
5060
+
5061
+ return /*#__PURE__*/React.createElement(Dialog$1, {
5062
+ header: /*#__PURE__*/React.createElement("div", {
5063
+ className: "PaddingTopS PaddingLeftM PaddingRightM TextLeft"
5064
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
5065
+ className: "LineHeightL FontSizeL"
5066
+ }, "Select Token")), /*#__PURE__*/React.createElement("div", {
5067
+ className: "PaddingTopS PaddingBottomXS"
5068
+ }, /*#__PURE__*/React.createElement("div", {
5069
+ className: "Card small",
5070
+ onClick: onClickChangeBlockchain
5071
+ }, /*#__PURE__*/React.createElement("div", {
5072
+ className: "CardImage small"
5073
+ }, /*#__PURE__*/React.createElement("img", {
5074
+ className: "transparent",
5075
+ src: props.selection.blockchain.logo
5076
+ })), /*#__PURE__*/React.createElement("div", {
5077
+ className: "CardBody"
5078
+ }, props.selection.blockchain.label), /*#__PURE__*/React.createElement("div", {
5079
+ className: "CardAction"
5080
+ }, /*#__PURE__*/React.createElement(ChevronRight, null)))), /*#__PURE__*/React.createElement("div", {
5081
+ className: "PaddingTopXS PaddingBottomS"
5082
+ }, /*#__PURE__*/React.createElement("input", {
5083
+ onChange: onChangeSearch,
5084
+ className: "Search",
5085
+ autoFocus: true,
5086
+ placeholder: "Search name or paste address",
5087
+ ref: searchElement
5088
+ }), showAddToken && /*#__PURE__*/React.createElement("div", {
5089
+ className: "PaddingTopXS PaddingRightXS PaddingLeftXS"
5090
+ }, /*#__PURE__*/React.createElement("div", {
5091
+ className: "Tooltip"
5092
+ }, /*#__PURE__*/React.createElement("span", {
5093
+ className: "TooltipArrowUp"
5094
+ }), "Paste or enter token address here!")))),
5095
+ bodyClassName: "ScrollHeight",
5096
+ body: /*#__PURE__*/React.createElement("div", {
5097
+ className: ""
5098
+ }, elements),
5099
+ footer: /*#__PURE__*/React.createElement("div", {
5100
+ className: "PaddingTopS PaddingRightM PaddingLeftM PaddingBottomS"
5101
+ }, /*#__PURE__*/React.createElement("div", {
5102
+ className: "PaddingTopXS PaddingBottomXS"
5103
+ }, /*#__PURE__*/React.createElement("div", {
5104
+ className: "Link",
5105
+ onClick: onClickAddToken
5106
+ }, "Token missing? Add it.")))
5107
+ });
5108
+ });
5109
+
5110
+ var SelectStack = (function (props) {
5111
+ var _useContext = useContext(ConfigurationContext),
5112
+ what = _useContext.what;
5113
+
5114
+ var _useContext2 = useContext(ClosableContext),
5115
+ open = _useContext2.open,
5116
+ close = _useContext2.close;
5117
+
5118
+ var _useContext3 = useContext(SelectionContext),
5119
+ selection = _useContext3.selection;
5120
+
5121
+ var start;
5122
+
5123
+ switch (what) {
5124
+ default:
5125
+ start = 'SelectToken';
5126
+ }
5127
+
5128
+ return /*#__PURE__*/React.createElement(ReactDialogStack, {
5129
+ open: open,
5130
+ close: close,
5131
+ start: start,
5132
+ container: props.container,
5133
+ document: props.document,
5134
+ dialogs: {
5135
+ SelectToken: /*#__PURE__*/React.createElement(SelectTokenDialog, {
5136
+ selection: selection,
5137
+ resolve: props.resolve,
5138
+ unmount: props.unmount
5139
+ }),
5140
+ SelectBlockchain: /*#__PURE__*/React.createElement(SelectBlockchainDialog, {
5141
+ selection: selection,
5142
+ resolve: props.resolve
5143
+ }),
5144
+ ConfirmTokenSelection: /*#__PURE__*/React.createElement(ConfirmTokenSelectionDialog, {
5145
+ selection: selection,
5146
+ resolve: props.resolve,
5147
+ unmount: props.unmount
5148
+ })
5149
+ }
5150
+ });
5151
+ });
5152
+
5153
+ var Select = function Select(options) {
5154
+ var style, error, document, what;
5155
+
5156
+ if (_typeof(options) == 'object') {
5157
+ style = options.style;
5158
+ error = options.error;
5159
+ document = options.document;
5160
+ what = options.what;
5161
+ }
5162
+
5163
+ var startupError;
5164
+
5165
+ if (what == undefined) {
5166
+ startupError = '"what" needs to be configured!';
5167
+ } else if (['token'].indexOf(what) < 0) {
5168
+ startupError = "Unknown \"what\" configured: ".concat(what, "!");
5169
+ }
5170
+
5171
+ return new Promise( /*#__PURE__*/function () {
5172
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(resolve, reject) {
5173
+ return regenerator.wrap(function _callee$(_context) {
5174
+ while (1) {
5175
+ switch (_context.prev = _context.next) {
5176
+ case 0:
5177
+ mount({
5178
+ style: style,
5179
+ document: ensureDocument(document)
5180
+ }, function (unmount) {
5181
+ var userClosedDialog = function userClosedDialog() {
5182
+ reject('USER_CLOSED_DIALOG');
5183
+ unmount();
5184
+ };
5185
+
5186
+ return function (container) {
5187
+ return /*#__PURE__*/React.createElement(ErrorProvider, {
5188
+ error: startupError,
5189
+ errorCallback: error,
5190
+ container: container,
5191
+ unmount: unmount
5192
+ }, /*#__PURE__*/React.createElement(ConfigurationProvider, {
5193
+ configuration: {
5194
+ what: what
5195
+ }
5196
+ }, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
5197
+ unmount: userClosedDialog
5198
+ }, /*#__PURE__*/React.createElement(SelectionProvider, null, /*#__PURE__*/React.createElement(SelectStack, {
5199
+ document: document,
5200
+ container: container,
5201
+ unmount: unmount,
5202
+ resolve: resolve
5203
+ })), /*#__PURE__*/React.createElement(PoweredBy, null)))));
5204
+ };
5205
+ });
5206
+
5207
+ case 1:
5208
+ case "end":
5209
+ return _context.stop();
5210
+ }
5211
+ }
5212
+ }, _callee);
5213
+ }));
5214
+
5215
+ return function (_x, _x2) {
5216
+ return _ref.apply(this, arguments);
5217
+ };
5218
+ }());
5219
+ };
5220
+
4658
5221
  var DePayWidgets = {
4659
5222
  Connect: Connect,
4660
5223
  Donation: Donation,
4661
5224
  Login: Login,
4662
5225
  Payment: Payment,
4663
5226
  Sale: Sale,
5227
+ Select: Select,
4664
5228
  provider: provider
4665
5229
  };
4666
5230