UNPKG

@gamcaplabs/uniswapeasy

Version:

Uniswap V4 Liquidity Provider

1,171 lines (1,151 loc) 487 kB
'use strict'; var React = require('react'); var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray'); var _defineProperty = require('@babel/runtime/helpers/defineProperty'); var _slicedToArray = require('@babel/runtime/helpers/slicedToArray'); var _typeof = require('@babel/runtime/helpers/typeof'); var providers = require('@ethersproject/providers'); var core = require('@web3-react/core'); var eip1193 = require('@web3-react/eip1193'); var metamask = require('@web3-react/metamask'); var network = require('@web3-react/network'); var walletconnectV2 = require('@web3-react/walletconnect-v2'); var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator'); var _classCallCheck = require('@babel/runtime/helpers/classCallCheck'); var _createClass = require('@babel/runtime/helpers/createClass'); var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn'); var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf'); var _inherits = require('@babel/runtime/helpers/inherits'); var _regeneratorRuntime = require('@babel/runtime/regenerator'); var types = require('@web3-react/types'); var _get = require('@babel/runtime/helpers/get'); var QRCode = require('qrcode'); var invariant = require('tiny-invariant'); var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral'); var styled = require('styled-components'); var reactRedux = require('react-redux'); var toolkit = require('@reduxjs/toolkit'); var react = require('@reduxjs/toolkit/query/react'); var reduxPersist = require('redux-persist'); var localForage = require('localforage'); var sdkCore = require('@uniswap/sdk-core'); var JSBI = require('jsbi'); var ethers = require('ethers'); var constants = require('@ethersproject/constants'); var contracts = require('@ethersproject/contracts'); var address = require('@ethersproject/address'); var utils = require('ethers/lib/utils'); var units = require('@ethersproject/units'); var abi$1 = require('@ethersproject/abi'); var _extends = require('@babel/runtime/helpers/extends'); var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties'); var d3 = require('d3'); var rebass = require('rebass'); var styledComponents = require('rebass/styled-components'); if (_typeof(global.process) !== 'object') { // WCv2 alters global.process, and other libs (eg jotai) depend on a static object. // Avoid breaking jotai by setting it statically before it is first seen. global.process = { env: {} }; } var _CHAIN_NAMES_TO_IDS, _poolContractMap, _explorerMap; /** * List of all the networks supported by the Uniswap Interface */ var SupportedChainId = /*#__PURE__*/function (SupportedChainId) { SupportedChainId[SupportedChainId["MAINNET"] = 1] = "MAINNET"; SupportedChainId[SupportedChainId["ROPSTEN"] = 3] = "ROPSTEN"; SupportedChainId[SupportedChainId["RINKEBY"] = 4] = "RINKEBY"; SupportedChainId[SupportedChainId["GOERLI"] = 5] = "GOERLI"; SupportedChainId[SupportedChainId["KOVAN"] = 42] = "KOVAN"; SupportedChainId[SupportedChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE"; SupportedChainId[SupportedChainId["ARBITRUM_RINKEBY"] = 421611] = "ARBITRUM_RINKEBY"; SupportedChainId[SupportedChainId["OPTIMISM"] = 10] = "OPTIMISM"; SupportedChainId[SupportedChainId["OPTIMISM_GOERLI"] = 420] = "OPTIMISM_GOERLI"; SupportedChainId[SupportedChainId["POLYGON"] = 137] = "POLYGON"; SupportedChainId[SupportedChainId["POLYGON_MUMBAI"] = 80001] = "POLYGON_MUMBAI"; SupportedChainId[SupportedChainId["CELO"] = 42220] = "CELO"; SupportedChainId[SupportedChainId["CELO_ALFAJORES"] = 44787] = "CELO_ALFAJORES"; SupportedChainId[SupportedChainId["BNB"] = 56] = "BNB"; SupportedChainId[SupportedChainId["BASE"] = 8453] = "BASE"; SupportedChainId[SupportedChainId["ETHEREUM_SEPOLIA"] = 11155111] = "ETHEREUM_SEPOLIA"; return SupportedChainId; }({}); var ChainName = /*#__PURE__*/function (ChainName) { ChainName["MAINNET"] = "mainnet"; ChainName["ROPSTEN"] = "ropsten"; ChainName["RINKEBY"] = "rinkeby"; ChainName["GOERLI"] = "goerli"; ChainName["KOVAN"] = "kovan"; ChainName["OPTIMISM"] = "optimism-mainnet"; ChainName["OPTIMISM_GOERLI"] = "optimism-goerli"; ChainName["ARBITRUM_ONE"] = "arbitrum-mainnet"; ChainName["ARBITRUM_RINKEBY"] = "arbitrum-rinkeby"; ChainName["POLYGON"] = "polygon-mainnet"; ChainName["POLYGON_MUMBAI"] = "polygon-mumbai"; ChainName["CELO"] = "celo"; ChainName["CELO_ALFAJORES"] = "celo-alfajores"; ChainName["BNB"] = "bnb"; ChainName["BASE"] = "base"; ChainName["ETHEREUM_SEPOLIA"] = "ethereum-sepolia"; return ChainName; }({}); (_CHAIN_NAMES_TO_IDS = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CHAIN_NAMES_TO_IDS, ChainName.MAINNET, SupportedChainId.MAINNET), ChainName.ROPSTEN, SupportedChainId.ROPSTEN), ChainName.RINKEBY, SupportedChainId.RINKEBY), ChainName.GOERLI, SupportedChainId.GOERLI), ChainName.KOVAN, SupportedChainId.KOVAN), ChainName.POLYGON, SupportedChainId.POLYGON), ChainName.POLYGON_MUMBAI, SupportedChainId.POLYGON_MUMBAI), ChainName.ARBITRUM_ONE, SupportedChainId.ARBITRUM_ONE), ChainName.ARBITRUM_RINKEBY, SupportedChainId.ARBITRUM_RINKEBY), ChainName.OPTIMISM, SupportedChainId.OPTIMISM), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CHAIN_NAMES_TO_IDS, ChainName.OPTIMISM_GOERLI, SupportedChainId.OPTIMISM_GOERLI), ChainName.CELO, SupportedChainId.CELO), ChainName.CELO_ALFAJORES, SupportedChainId.CELO_ALFAJORES), ChainName.BNB, SupportedChainId.BNB), ChainName.BASE, SupportedChainId.BASE), ChainName.ETHEREUM_SEPOLIA, SupportedChainId.ETHEREUM_SEPOLIA)); /** * Array of all the supported chain IDs */ Object.values(SupportedChainId).filter(function (id) { return typeof id === "number"; }); [SupportedChainId.MAINNET, SupportedChainId.POLYGON, SupportedChainId.OPTIMISM, SupportedChainId.ARBITRUM_ONE, SupportedChainId.CELO, SupportedChainId.BNB, SupportedChainId.BASE]; /** * All the chain IDs that are running the Ethereum protocol. */ var L1_CHAIN_IDS = [SupportedChainId.MAINNET, SupportedChainId.ROPSTEN, SupportedChainId.RINKEBY, SupportedChainId.GOERLI, SupportedChainId.KOVAN, SupportedChainId.POLYGON, SupportedChainId.POLYGON_MUMBAI, SupportedChainId.CELO, SupportedChainId.CELO_ALFAJORES]; /** * Controls some L2 specific behavior, e.g. slippage tolerance, special UI behavior. * The expectation is that all of these networks have immediate transaction confirmation. */ var L2_CHAIN_IDS = [SupportedChainId.ARBITRUM_ONE, SupportedChainId.ARBITRUM_RINKEBY, SupportedChainId.OPTIMISM, SupportedChainId.OPTIMISM_GOERLI, SupportedChainId.BASE]; function isSupportedChainId(chainId) { if (!chainId) return false; //TODO: Remove this once contracts are deployed on other chains return chainId === 11155111; // return ALL_SUPPORTED_CHAIN_IDS.includes(chainId as SupportedChainId); } var poolContractMap = (_poolContractMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_poolContractMap, SupportedChainId.ETHEREUM_SEPOLIA, { poolManager: "0xf7a031A182aFB3061881156df520FE7912A51617", poolModifyLiquidity: "0x140C64C63c52cE05138E21564b72b0B2Dff9B67f" }), SupportedChainId.MAINNET, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.ROPSTEN, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.RINKEBY, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.GOERLI, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.KOVAN, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.ARBITRUM_ONE, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.ARBITRUM_RINKEBY, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.OPTIMISM, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.OPTIMISM_GOERLI, { poolManager: "", poolModifyLiquidity: "" }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_poolContractMap, SupportedChainId.POLYGON, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.POLYGON_MUMBAI, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.CELO, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.CELO_ALFAJORES, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.BNB, { poolManager: "", poolModifyLiquidity: "" }), SupportedChainId.BASE, { poolManager: "", poolModifyLiquidity: "" })); var explorerMap = (_explorerMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_explorerMap, SupportedChainId.MAINNET, "https://etherscan.io"), SupportedChainId.ROPSTEN, "https://ropsten.etherscan.io"), SupportedChainId.RINKEBY, "https://rinkeby.etherscan.io"), SupportedChainId.GOERLI, "https://goerli.etherscan.io"), SupportedChainId.KOVAN, "https://kovan.etherscan.io"), SupportedChainId.ARBITRUM_ONE, "https://arbiscan.io"), SupportedChainId.ARBITRUM_RINKEBY, "https://testnet.arbiscan.io"), SupportedChainId.OPTIMISM, "https://optimistic.etherscan.io"), SupportedChainId.OPTIMISM_GOERLI, "https://goerli-optimism.etherscan.io"), SupportedChainId.POLYGON, "https://polygonscan.com"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_explorerMap, SupportedChainId.POLYGON_MUMBAI, "https://mumbai.polygonscan.com"), SupportedChainId.CELO, "https://explorer.celo.org"), SupportedChainId.CELO_ALFAJORES, "https://alfajores-blockscout.celo-testnet.org"), SupportedChainId.BNB, "https://bscscan.com"), SupportedChainId.BASE, "https://basescan.org/"), SupportedChainId.ETHEREUM_SEPOLIA, "https://sepolia.etherscan.io")); var getExplorerLink = function getExplorerLink(chainId) { if (!chainId) return ""; return explorerMap[chainId]; }; function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); } function parseChainId(chainId) { return Number.parseInt(chainId, 16); } var JsonRpcConnector = /*#__PURE__*/function (_Connector) { function JsonRpcConnector(_ref) { var _this; var actions = _ref.actions, provider = _ref.provider, onError = _ref.onError; _classCallCheck(this, JsonRpcConnector); _this = _callSuper$1(this, JsonRpcConnector, [actions, onError]); _this.customProvider = provider.on('connect', function (_ref2) { var chainId = _ref2.chainId; _this.actions.update({ chainId: parseChainId(chainId) }); }).on('disconnect', function (error) { var _this$onError, _this2; (_this$onError = (_this2 = _this).onError) === null || _this$onError === void 0 || _this$onError.call(_this2, error); _this.actions.resetState(); }).on('chainChanged', function (chainId) { _this.actions.update({ chainId: parseChainId(chainId) }); }).on('accountsChanged', function (accounts) { _this.actions.update({ accounts: accounts }); }); return _this; } _inherits(JsonRpcConnector, _Connector); return _createClass(JsonRpcConnector, [{ key: "activate", value: function () { var _activate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { var _yield$Promise$all, _yield$Promise$all2, chainId, accounts; return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: this.actions.startActivation(); _context.prev = 1; _context.next = 4; return Promise.all([this.customProvider.getNetwork(), this.customProvider.listAccounts()]); case 4: _yield$Promise$all = _context.sent; _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2); chainId = _yield$Promise$all2[0].chainId; accounts = _yield$Promise$all2[1]; this.actions.update({ chainId: chainId, accounts: accounts }); _context.next = 15; break; case 11: _context.prev = 11; _context.t0 = _context["catch"](1); this.actions.resetState(); throw _context.t0; case 15: case "end": return _context.stop(); } }, _callee, this, [[1, 11]]); })); function activate() { return _activate.apply(this, arguments); } return activate; }() }]); }(types.Connector); function supportedChainId(chainId) { if (typeof chainId === 'number' && chainId in SupportedChainId) { return chainId; } return undefined; } var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; (function (global, undefined$1) { if (global.setImmediate) { return; } var nextHandle = 1; // Spec says greater than zero var tasksByHandle = {}; var currentlyRunningATask = false; var doc = global.document; var registerImmediate; function setImmediate(callback) { // Callback can either be a function or a string if (typeof callback !== "function") { callback = new Function("" + callback); } // Copy function arguments var args = new Array(arguments.length - 1); for (var i = 0; i < args.length; i++) { args[i] = arguments[i + 1]; } // Store and register the task var task = { callback: callback, args: args }; tasksByHandle[nextHandle] = task; registerImmediate(nextHandle); return nextHandle++; } function clearImmediate(handle) { delete tasksByHandle[handle]; } function run(task) { var callback = task.callback; var args = task.args; switch (args.length) { case 0: callback(); break; case 1: callback(args[0]); break; case 2: callback(args[0], args[1]); break; case 3: callback(args[0], args[1], args[2]); break; default: callback.apply(undefined$1, args); break; } } function runIfPresent(handle) { // From the spec: "Wait until any invocations of this algorithm started before this one have completed." // So if we're currently running a task, we'll need to delay this invocation. if (currentlyRunningATask) { // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a // "too much recursion" error. setTimeout(runIfPresent, 0, handle); } else { var task = tasksByHandle[handle]; if (task) { currentlyRunningATask = true; try { run(task); } finally { clearImmediate(handle); currentlyRunningATask = false; } } } } function installNextTickImplementation() { registerImmediate = function registerImmediate(handle) { process.nextTick(function () { runIfPresent(handle); }); }; } function canUsePostMessage() { // The test against `importScripts` prevents this implementation from being installed inside a web worker, // where `global.postMessage` means something completely different and can't be used for this purpose. if (global.postMessage && !global.importScripts) { var postMessageIsAsynchronous = true; var oldOnMessage = global.onmessage; global.onmessage = function () { postMessageIsAsynchronous = false; }; global.postMessage("", "*"); global.onmessage = oldOnMessage; return postMessageIsAsynchronous; } } function installPostMessageImplementation() { // Installs an event handler on `global` for the `message` event: see // * https://developer.mozilla.org/en/DOM/window.postMessage // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages var messagePrefix = "setImmediate$" + Math.random() + "$"; var onGlobalMessage = function onGlobalMessage(event) { if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) { runIfPresent(+event.data.slice(messagePrefix.length)); } }; if (global.addEventListener) { global.addEventListener("message", onGlobalMessage, false); } else { global.attachEvent("onmessage", onGlobalMessage); } registerImmediate = function registerImmediate(handle) { global.postMessage(messagePrefix + handle, "*"); }; } function installMessageChannelImplementation() { var channel = new MessageChannel(); channel.port1.onmessage = function (event) { var handle = event.data; runIfPresent(handle); }; registerImmediate = function registerImmediate(handle) { channel.port2.postMessage(handle); }; } function installReadyStateChangeImplementation() { var html = doc.documentElement; registerImmediate = function registerImmediate(handle) { // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. var script = doc.createElement("script"); script.onreadystatechange = function () { runIfPresent(handle); script.onreadystatechange = null; html.removeChild(script); script = null; }; html.appendChild(script); }; } function installSetTimeoutImplementation() { registerImmediate = function registerImmediate(handle) { setTimeout(runIfPresent, 0, handle); }; } // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments. if ({}.toString.call(global.process) === "[object process]") { // For Node.js before 0.9 installNextTickImplementation(); } else if (canUsePostMessage()) { // For non-IE10 modern browsers installPostMessageImplementation(); } else if (global.MessageChannel) { // For web workers, where supported installMessageChannelImplementation(); } else if (doc && "onreadystatechange" in doc.createElement("script")) { // For IE 6–8 installReadyStateChangeImplementation(); } else { // For older browsers installSetTimeoutImplementation(); } attachTo.setImmediate = setImmediate; attachTo.clearImmediate = clearImmediate; })(typeof self === "undefined" ? typeof commonjsGlobal === "undefined" ? commonjsGlobal : commonjsGlobal : self); function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } var WalletConnectQR = /*#__PURE__*/function (_WalletConnect) { function WalletConnectQR(_ref) { var _this; var actions = _ref.actions, options = _ref.options, defaultChainId = _ref.defaultChainId, timeout = _ref.timeout, onError = _ref.onError; _classCallCheck(this, WalletConnectQR); _this = _callSuper(this, WalletConnectQR, [{ actions: actions, options: _objectSpread$9(_objectSpread$9({}, options), {}, { showQrModal: false }), defaultChainId: defaultChainId, timeout: timeout, onError: onError }]); _this.events.once(walletconnectV2.URI_AVAILABLE, function () { var _this$provider; (_this$provider = _this.provider) === null || _this$provider === void 0 || _this$provider.events.on("disconnect", _this.deactivate); }); _this.events.on(walletconnectV2.URI_AVAILABLE, /*#__PURE__*/function () { var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(uri) { return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _this.svg = undefined; if (uri) { _context.next = 3; break; } return _context.abrupt("return"); case 3: _context.next = 5; return QRCode.toString(uri, { // Leave a margin to increase contrast in dark mode. margin: 1, // Use 55*2=110 for the width to prevent distortion. The generated viewbox is "0 0 55 55". width: 110, type: "svg" }); case 5: _this.svg = _context.sent; _this.events.emit(WalletConnectQR.SVG_AVAILABLE, _this.svg); case 7: case "end": return _context.stop(); } }, _callee); })); return function (_x) { return _ref2.apply(this, arguments); }; }()); return _this; } _inherits(WalletConnectQR, _WalletConnect); return _createClass(WalletConnectQR, [{ key: "deactivate", value: function deactivate() { this.events.emit(walletconnectV2.URI_AVAILABLE); return _get(_getPrototypeOf(WalletConnectQR.prototype), "deactivate", this).call(this); } }]); }(walletconnectV2.WalletConnect); _defineProperty(WalletConnectQR, "SVG_AVAILABLE", "svg_available"); var ConnectorsContext = /*#__PURE__*/React.createContext(null); function Provider$3(_ref) { var connectors = _ref.connectors, children = _ref.children; var _useWeb3React = core.useWeb3React(), chainId = _useWeb3React.chainId, connector = _useWeb3React.connector; // The network chainId must be kept synchronized to avoid a loop when disconnecting and for a better UX. React.useEffect(function () { if (connector !== connectors.network) { try { connectors.network.activate(chainId); } catch (e) { // Unknown chains (eg hardhat) will fail to connect, and should not crash } } }, [chainId, connector, connectors.network]); return /*#__PURE__*/React.createElement(ConnectorsContext.Provider, { value: connectors }, children); } var _JSON_RPC_FALLBACK_EN; // import { StaticJsonRpcProvider } from "@ethersproject/providers"; /** * Fallback JSON RPC endpoints. * These are used if the integrator does not provide an endpoint, or if the endpoint does not work. * * MetaMask allows switching to any URL, but displays a warning if it is not on the "Safe" list: * https://github.com/MetaMask/metamask-mobile/blob/bdb7f37c90e4fc923881a07fca38d4e77c73a579/app/core/RPCMethods/wallet_addEthereumChain.js#L228-L235 * https://chainid.network/chains.json * * These "Safe" URLs are listed first, followed by other fallback URLs, which are taken from chainlist.org. */ var JSON_RPC_FALLBACK_ENDPOINTS = (_JSON_RPC_FALLBACK_EN = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_JSON_RPC_FALLBACK_EN, SupportedChainId.MAINNET, [ // "Safe" URLs "https://cloudflare-eth.com", // "Fallback" URLs "https://rpc.ankr.com/eth", "https://eth-mainnet.public.blastapi.io"]), SupportedChainId.ROPSTEN, [ // "Fallback" URLs "https://rpc.ankr.com/eth_ropsten"]), SupportedChainId.RINKEBY, [ // "Fallback" URLs "https://rinkeby-light.eth.linkpool.io/"]), SupportedChainId.GOERLI, [ // "Safe" URLs "https://goerli.gateway.tenderly.co", // "Fallback" URLs "https://rpc.ankr.com/eth_goerli"]), SupportedChainId.KOVAN, [ // "Fallback" URLs "https://eth-kovan.public.blastapi.io"]), SupportedChainId.POLYGON, [ // "Safe" URLs "https://polygon-rpc.com/"]), SupportedChainId.POLYGON_MUMBAI, [ // "Safe" URLs "https://matic-mumbai.chainstacklabs.com", "https://rpc-mumbai.maticvigil.com", "https://matic-testnet-archive-rpc.bwarelabs.com"]), SupportedChainId.ARBITRUM_ONE, [ // "Safe" URLs "https://arb1.arbitrum.io/rpc", // "Fallback" URLs "https://arbitrum.public-rpc.com"]), SupportedChainId.ARBITRUM_RINKEBY, [ // "Safe" URLs "https://rinkeby.arbitrum.io/rpc"]), SupportedChainId.OPTIMISM, [ // "Safe" URLs "https://mainnet.optimism.io/", // "Fallback" URLs "https://rpc.ankr.com/optimism"]), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_JSON_RPC_FALLBACK_EN, SupportedChainId.OPTIMISM_GOERLI, [ // "Safe" URLs "https://goerli.optimism.io"]), SupportedChainId.CELO, [ // "Safe" URLs "https://forno.celo.org"]), SupportedChainId.CELO_ALFAJORES, [ // "Safe" URLs "https://alfajores-forno.celo-testnet.org"]), SupportedChainId.BNB, [ // "Safe" URLs "https://endpoints.omniatech.io/v1/bsc/mainnet/public", "https://bsc-mainnet.gateway.pokt.network/v1/lb/6136201a7bad1500343e248d", "https://1rpc.io/bnb", "https://bsc-dataseed3.binance.org", "https://bsc-dataseed2.defibit.io", "https://bsc-dataseed1.ninicoin.io", "https://binance.nodereal.io", "https://bsc-dataseed4.defibit.io", "https://rpc.ankr.com/bsc"]), SupportedChainId.BASE, [ // "Safe" URLs "https://mainnet.base.org", "https://base.gateway.tenderly.co", "https://base.publicnode.com", // "Fallback" URLs "https://1rpc.io/base", "https://base.meowrpc.com"]), SupportedChainId.ETHEREUM_SEPOLIA, [ // "Safe" URLs "https://sepolia.drpc.org", "https://rpc2.sepolia.org", "https://eth-sepolia.g.alchemy.com/v2/demo", "https://ethereum-sepolia.blockpi.network/v1/rpc/public"])); //map every supported chain id to StaticJsonRpcProvider instance (first endpoint in the array is used as the provider URL) // type should be Record<SupportedChainId, StaticJsonRpcProvider> // export const JSON_RPC_FALLBACK_PROVIDERS: Record< // SupportedChainId, // StaticJsonRpcProvider // > = Object.fromEntries( // Object.entries(JSON_RPC_FALLBACK_ENDPOINTS).map(([chainId, endpoints]) => [ // Number(chainId) as SupportedChainId, // new StaticJsonRpcProvider(endpoints[0]), // ]) // ) as Record<SupportedChainId, StaticJsonRpcProvider>; var JsonRpcUrlMapContext = /*#__PURE__*/React.createContext(undefined); function Provider$2(_ref) { var jsonRpcMap = _ref.jsonRpcMap, children = _ref.children; return /*#__PURE__*/React.createElement(JsonRpcUrlMapContext.Provider, { value: jsonRpcMap }, children); } function toJsonRpcMap(getChainConnections) { var _ref2; return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, SupportedChainId.MAINNET, getChainConnections(SupportedChainId.MAINNET)), SupportedChainId.ROPSTEN, getChainConnections(SupportedChainId.ROPSTEN)), SupportedChainId.RINKEBY, getChainConnections(SupportedChainId.RINKEBY)), SupportedChainId.GOERLI, getChainConnections(SupportedChainId.GOERLI)), SupportedChainId.KOVAN, getChainConnections(SupportedChainId.KOVAN)), SupportedChainId.POLYGON, getChainConnections(SupportedChainId.POLYGON)), SupportedChainId.POLYGON_MUMBAI, getChainConnections(SupportedChainId.POLYGON_MUMBAI)), SupportedChainId.ARBITRUM_ONE, getChainConnections(SupportedChainId.ARBITRUM_ONE)), SupportedChainId.ARBITRUM_RINKEBY, getChainConnections(SupportedChainId.ARBITRUM_RINKEBY)), SupportedChainId.OPTIMISM, getChainConnections(SupportedChainId.OPTIMISM)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, SupportedChainId.OPTIMISM_GOERLI, getChainConnections(SupportedChainId.OPTIMISM_GOERLI)), SupportedChainId.CELO, getChainConnections(SupportedChainId.CELO)), SupportedChainId.CELO_ALFAJORES, getChainConnections(SupportedChainId.CELO_ALFAJORES)), SupportedChainId.BNB, getChainConnections(SupportedChainId.BNB)), SupportedChainId.BASE, getChainConnections(SupportedChainId.BASE)), SupportedChainId.ETHEREUM_SEPOLIA, getChainConnections(SupportedChainId.ETHEREUM_SEPOLIA)); } function getChainConnections(connectionMap, chainId) { var _filter; var value = connectionMap === null || connectionMap === void 0 ? void 0 : connectionMap[chainId]; return (_filter = (Array.isArray(value) ? value : [value]).filter(function (value) { return Boolean(value); })).concat.apply(_filter, _toConsumableArray(JSON_RPC_FALLBACK_ENDPOINTS[chainId])); } function toJsonRpcConnectionMap(connectionMap) { function getJsonRpcProvider(chainId) { var _getChainConnections = getChainConnections(connectionMap, chainId), _getChainConnections2 = _slicedToArray(_getChainConnections, 1), connection = _getChainConnections2[0]; return providers.JsonRpcProvider.isProvider(connection) ? connection : new providers.StaticJsonRpcProvider(connection, Number(chainId)); } return toJsonRpcMap(getJsonRpcProvider); } function toJsonRpcUrlMap(connectionMap) { function getJsonRpcUrl(chainId) { var _getChainConnections3 = getChainConnections(connectionMap, chainId), _getChainConnections4 = _slicedToArray(_getChainConnections3, 1), connection = _getChainConnections4[0]; return providers.JsonRpcProvider.isProvider(connection) ? connection.connection.url : connection; } return toJsonRpcMap(getJsonRpcUrl); } function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var DEFAULT_CHAIN_ID = SupportedChainId.MAINNET; function Provider$1(_ref2) { var _ref2$defaultChainId = _ref2.defaultChainId, chainId = _ref2$defaultChainId === void 0 ? SupportedChainId.MAINNET : _ref2$defaultChainId, jsonRpcUrlMap = _ref2.jsonRpcUrlMap, provider = _ref2.provider, children = _ref2.children; var defaultChainId = React.useMemo(function () { if (!supportedChainId(chainId)) { console.warn("Unsupported chainId: ".concat(chainId, ". Falling back to ").concat(DEFAULT_CHAIN_ID, " (").concat(SupportedChainId[DEFAULT_CHAIN_ID], ").")); return DEFAULT_CHAIN_ID; } return chainId; }, [chainId]); var web3ReactConnectors = useWeb3ReactConnectors({ provider: provider, jsonRpcUrlMap: jsonRpcUrlMap, defaultChainId: defaultChainId }); var key = React.useRef(0); var prioritizedConnectors = React.useMemo(function () { // Re-key Web3ReactProvider before rendering new connectors, as it expects connectors to be // referentially static. key.current += 1; var prioritizedConnectors = [web3ReactConnectors.user, web3ReactConnectors.metaMask, web3ReactConnectors.walletConnect, web3ReactConnectors.walletConnectQR, web3ReactConnectors.network]; return prioritizedConnectors.filter(function (connector) { return Boolean(connector); }); }, [web3ReactConnectors]); var connectors = React.useMemo(function () { var _web3ReactConnectors$; return { user: (_web3ReactConnectors$ = web3ReactConnectors.user) === null || _web3ReactConnectors$ === void 0 ? void 0 : _web3ReactConnectors$[0], metaMask: web3ReactConnectors.metaMask[0], walletConnect: web3ReactConnectors.walletConnect[0], walletConnectQR: web3ReactConnectors.walletConnectQR[0], network: web3ReactConnectors.network[0] }; }, [web3ReactConnectors]); var shouldEagerlyConnect = provider === undefined; // !== null React.useEffect(function () { // Ignore any errors during connection so they do not propagate to the widget. if (connectors.user) { connectors.user.activate()["catch"](function () { return undefined; }); return; } else if (shouldEagerlyConnect) { var eagerConnectors = [connectors.metaMask, connectors.walletConnect]; eagerConnectors.forEach(function (connector) { return connector.connectEagerly()["catch"](function () { return undefined; }); }); } connectors.network.activate()["catch"](function () { return undefined; }); }, [connectors.metaMask, connectors.user, connectors.walletConnect, connectors.network, shouldEagerlyConnect]); return /*#__PURE__*/React.createElement(core.Web3ReactProvider, { connectors: prioritizedConnectors, key: key.current }, /*#__PURE__*/React.createElement(Provider$2, { jsonRpcMap: jsonRpcUrlMap }, /*#__PURE__*/React.createElement(Provider$3, { connectors: connectors }, children))); } function initializeWeb3ReactConnector(Constructor, options) { var _initializeConnector = core.initializeConnector(function (actions) { return new Constructor(_objectSpread$8({ actions: actions }, options)); }), _initializeConnector2 = _slicedToArray(_initializeConnector, 2), connector = _initializeConnector2[0], hooks = _initializeConnector2[1]; if (options && "provider" in options) { // Short-circuit provider selection to improve performance and testability. // Without doing so, provider will be unavailable for a frame. hooks.useProvider = function () { return options.provider; }; } return [connector, hooks]; } function useWeb3ReactConnectors(_ref3) { var defaultChainId = _ref3.defaultChainId, provider = _ref3.provider, jsonRpcUrlMap = _ref3.jsonRpcUrlMap; var _useMemo = React.useMemo(function () { return [toJsonRpcUrlMap(jsonRpcUrlMap), toJsonRpcConnectionMap(jsonRpcUrlMap)]; }, [jsonRpcUrlMap]), _useMemo2 = _slicedToArray(_useMemo, 2), urlMap = _useMemo2[0], connectionMap = _useMemo2[1]; var user = React.useMemo(function () { if (!provider) return; if (providers.JsonRpcProvider.isProvider(provider)) { return initializeWeb3ReactConnector(JsonRpcConnector, { provider: provider, onError: console.error }); } else if (providers.JsonRpcProvider.isProvider(provider.provider)) { throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly"); } else { return initializeWeb3ReactConnector(eip1193.EIP1193, { provider: provider, onError: console.error }); } }, [provider]); var metaMask = React.useMemo(function () { return initializeWeb3ReactConnector(metamask.MetaMask, { onError: function onError() { throw new Error("MetaMask is not available"); } }); }, []); var walletConnectDefaultOptions = React.useMemo(function () { return { rpcMap: urlMap, projectId: "c6c9bacd35afa3eb9e6cccf6d8464395", // this requires the connecting wallet to support eth mainnet // TODO: add goerli to l1 chains and remove from chains // add ethereum sepolia to l2 chains and remove from chains chains: [SupportedChainId.MAINNET, SupportedChainId.ETHEREUM_SEPOLIA], optionalChains: [].concat(_toConsumableArray(L1_CHAIN_IDS), _toConsumableArray(L2_CHAIN_IDS)), optionalMethods: ["eth_signTypedData", "eth_signTypedData_v4", "eth_sign"], qrModalOptions: { themeVariables: { "--w3m-z-index": "1000" } } }; }, [urlMap]); var walletConnect = React.useMemo(function () { return initializeWeb3ReactConnector(walletconnectV2.WalletConnect, { options: _objectSpread$8(_objectSpread$8({}, walletConnectDefaultOptions), {}, { showQrModal: true }), defaultChainId: defaultChainId, onError: console.error }); }, [defaultChainId, walletConnectDefaultOptions]); var walletConnectQR = React.useMemo(function () { return initializeWeb3ReactConnector(WalletConnectQR, { options: _objectSpread$8(_objectSpread$8({}, walletConnectDefaultOptions), {}, { showQrModal: false }), defaultChainId: defaultChainId, onError: console.error }); }, [defaultChainId, walletConnectDefaultOptions]); var network$1 = React.useMemo(function () { return initializeWeb3ReactConnector(network.Network, { urlMap: connectionMap, defaultChainId: defaultChainId }); }, [connectionMap, defaultChainId]); return React.useMemo(function () { return { user: user, metaMask: metaMask, walletConnect: walletConnect, walletConnectQR: walletConnectQR, network: network$1 }; }, [metaMask, network$1, user, walletConnect, walletConnectQR]); } var tealLight = { surfacesAndElevation: { pageBackground: "#F9FAFB", elevation1: "#FFFFFF", elevation2: "#F9FAFB", elevation3: "#F3F4F6" // elevation4: "#E5E7EB", }, borders: { borders: "#D1D5DB", dividers: "#E5E7EB", dividerBlank: "#FFFFFF" }, text: { primary: "#181B24", secondary: "#4B5563", tertiary: "#9CA3AF", // placeholder: "#9CA3AF", // disabled: "#D1D5DB", color: "#1FA5BB", gain: "#11D626", loss: "#FD4040" }, components: { icon: { icon: "#9CA3AF" }, button: { primary: { background: "#12131A", foreground: "#FFFFFF", hoverAndFocusBackground: "#181B24", hoverAndFocusForeground: "#FFFFFF", disabledBackground: "#F3F4F6", disabledForeground: "#D1D5DB" }, secondary: { foreground: "#4B5563", hoverAndFocusBackground: "#F3F4F6", hoverAndFocusForeground: "#4B5563", disabledBorder: "#E5E7EB", disabledForeground: "#D1D5DB", border: "#D1D5DB", hoverAndFocusBorder: "#E5E7EB", background: "#F9FAFB" }, // tertiary: { // background: "#F3F4F6", // hoverAndFocusBackground: "#F9FAFB", // disabledForeground: "#D1D5DB", // disabledBackground: "#F3F4F6", // foreground: "#4B5563", // hoverAndFocusForeground: "#4B5563", // }, ghost: { background: "#4B5563", hoverAndFocusBackground: "#F3F4F6", hoverAndFocusForeground: "#4B5563", disabledBackground: "#D1D5DB" } // alert: { // background: "#EB1717", // foreground: "#FFF1F1", // hoverAndFocusBackground: "#C60F0F", // hoverAndFocusForeground: "#FFF1F1", // disabledForeground: "#D1D5DB", // disabledBackground: "#F3F4F6", // }, }, // focusRing: { // focusRing: "#AFEBF2", // }, badge: { // primaryBackground: "#64D5E4", // primaryForefround: "#FFFFFF", neutralBackground: "#F3F4F6", neutralForeground: "#4B5563", // successBackground: "#11D626", // successForeground: "#FFFFFF", alertBackground: "#EB1717", alertForeground: "#FFFFFF" }, inputFieldCurrencyField: { background: "#FFFFFF", border: "#E5E7EB", // hoverBackground: "#FFFFFF", foreground: "#9CA3AF", // hoverForeground: "#9CA3AF", // typeAndActiveBackground: "#FFFFFF", typeAndActiveForeground: "#181B24", // borderDestructive: "#FD4040", // disabledBackground: "#F9FAFB", disabledForeground: "#D1D5DB", // typeAndActiveBorder: "#64D5E4", filledBackground: "#FFFFFF", filledForeground: "#181B24" // filledBorder: "#E5E7EB", }, dropdown: { background: "#FFFFFF", foreground: "#4B5563", // disabledForeground: "#D1D5DB", hoverForeground: "#181B24", hoverBackground: "#F9FAFB" }, chip: { background: "#F3F4F6", foreground: "#4B5563" // hoverAndFocusBackground: "#E5E7EB", // hoverAndFocusForeground: "#4B5563", // activeBackground: "#64D5E4", // activeForeground: "#FFFFFF", // disabledBackground: "#F3F4F6", // disabledForeground: "#D1D5DB", }, // tab: { // foreground: "#9CA3AF", // hoverAndFocusBackground: "#F9FAFB", // hoverAndFocusForeground: "#4B5563", // activeBackground: "#F9FAFB", // activeForeground: "#181B24", // disabledForeground: "#D1D5DB", // activeHoverAndFocusBackground: "#F9FAFB", // activeHoverAndFocusForeground: "#181B24", // }, toggle: { activeDefaultBackground: "#64D5E4", activeDefaultForeground: "#FFFFFF", // activeDisabledBackground: "#AFEBF2", // activeDisabledForeground: "#3AC1D6", // inactiveDisabledBackground: "#E5E7EB", // inactiveDisabledForeground: "#D1D5DB", inactiveDefaultBackground: "#E5E7EB" // inactiveDefaultForeground: "#FFFFFF", // inactiveHoverAndFocusBackground: "#E5E7EB", // inactiveHoverAndFocusForeground: "#F9FAFB", // activeHoverAndFocusBackground: "#3AC1D6", // activeHoverAndFocusForeground: "#FFFFFF", }, // segmentationControl: { // baseInactiveHoverAndFocusForeground: "#4B5563", // baseActiveBackground: "#F9FAFB", // baseActiveForeground: "#181B24", // baseDisabledForeground: "#9CA3AF", // background: "#F9FAFB", // baseInactiveForeground: "#9CA3AF", // border: "#E5E7EB", // }, tooltip: { background: "#181B24", foreground: "#FFFFFF" }, // radioButton: { // selectedDefaultBackground: "#64D5E4", // selectedDefaultForeground: "#FFFFFF", // selectedHoverAndFocusBackground: "#3AC1D6", // selectedHoverAndFocusForeground: "#FFFFFF", // selectedDisabledBackground: "#E5E7EB", // selectedDisabledForeground: "#D1D5DB", // unselectedStroke: "#D1D5DB", // unselectedHoverAndFocusBackground: "#EEFCFD", // unselectedHoverAndFocusForeground: "#1FA5BB", // unselectedDisabledBackground: "#F3F4F6", // unselectedDisabledStroke: "#E5E7EB", // unselectedHoverAndFocusStroke: "#64D5E4", // }, // checkbox: { // unselectedStroke: "#D1D5DB", // unselectedHoverAndFocusStroke: "#64D5E4", // unselectedHoverAndFocusBackground: "#EEFCFD", // unselectedHoverAndFocusForeground: "#1FA5BB", // unselectedDisabledStroke: "#E5E7EB", // unselectedDisabledBackground: "#F3F4F6", // selectedDefaultBackground: "#64D5E4", // selectedDefaultForeground: "#FFFFFF", // selectedHoverAndFocusBackground: "#3AC1D6", // selectedHoverAndFocusForeground: "#FFFFFF", // selectedDisabledBackground: "#E5E7EB", // selectedDisabledForeground: "#D1D5DB", // }, // selector: { // border: "#E5E7EB", // hoverBackground: "#FFFFFF", // activeBackground: "#FFFFFF", // }, textButton: { // secondary: { // default: "#181B24", // hoverAndFocus: "#181B24", // disabled: "#D1D5DB", // }, primary: { "default": "#64D5E4" // hoverAndFocus: "#3AC1D6", // disabled: "#D1D5DB", }, tertiary: { "default": "#9CA3AF" // hoverAndFocus: "#6B7280", // disabled: "#D1D5DB", } }, graph: { main: "#64D5E4" // secondary: "#3AC1D6", } } }; var tealDark = { surfacesAndElevation: { pageBackground: "#000103", elevation1: "#12131A", elevation2: "#181B24", elevation3: "#273345" // elevation4: "#374151", }, borders: { borders: "#273345", dividers: "#181B24", dividerBlank: "#12131A" }, text: { primary: "#FFFFFF", secondary: "#D1D5DB", tertiary: "#9CA3AF", // placeholder: "#9CA3AF", // disabled: "#6B7280", color: "#64D5E4", gain: "#4FEF5F", loss: "#FD4040" }, components: { icon: { icon: "#9CA3AF" }, button: { primary: { background: "#F3F4F6", foreground: "#12131A", hoverAndFocusBackground: "#FFFFFF", hoverAndFocusForeground: "#12131A", disabledBackground: "#273345", disabledForeground: "#6B7280" }, secondary: { foreground: "#D1D5DB", hoverAndFocusBackground: "#273345", hoverAndFocusForeground: "#D1D5DB", disabledBorder: "#273345", disabledForeground: "#4B5563", border: "#273345", hoverAndFocusBorder: "#273345", background: "#181B24" }, // tertiary: { // background: "#374151", // hoverAndFocusBackground: "#4B5563", // disabledForeground: "#6B7280", // disabledBackground: "#273345", // foreground: "#D1D5DB", // hoverAndFocusForeground: "#D1D5DB", // }, ghost: { background: "#D1D5DB", hoverAndFocusBackground: "#273345", hoverAndFocusForeground: "#D1D5DB", disabledBackground: "#6B7280" } // alert: { // background: "#A31111", // foreground: "#FFE0E0", // hoverAndFocusBackground: "#C60F0F", // hoverAndFocusForeground: "#FFE0E0", // disabledForeground: "#6B7280", // disabledBackground: "#273345", // }, }, // focusRing: { // focusRing: "#AFEBF2", // }, badge: { // primaryBackground: "#64D5E4", // primaryForefround: "#FFFFFF", neutralBackground: "#273345", neutralForeground: "#F3F4F6", // successBackground: "#013208", // successForeground: "#4FEF5F", alertBackground: "#4A0505", alertForeground: "#FD4040" }, inputFieldCurrencyField: { background: "#181B24", border: "#181B24", // hoverBackground: "#273345", foreground: "#9CA3AF", // hoverForeground: "#9CA3AF", // typeAndActiveBackground: "#181B24", typeAndActiveForeground: "#FFFFFF", // borderDestructive: "#FD4040", // disabledBackground: "#181B24", disabledForeground: "#6B7280", // typeAndActiveBorder: "#64D5E4", filledBackground: "#181B24", filledForeground: "#FFFFFF" // filledBorder: "#181B24", }, dropdown: { background: "#181B24", foreground: "#D1D5DB", // disabledForeground: "#6B7280", hoverForeground: "#FFFFFF", hoverBackground: "#181B24" }, chip: { background: "#273345", foreground: "#D1D5DB" // hoverAndFocusBackground: "#374151", // hoverAndFocusForeground: "#D1D5DB", // activeBackground: "#64D5E4", // activeForeground: "#FFFFFF", // disabledBackground: "#273345", // disabledForeground: "#6B7280", }, // tab: { // foreground: "#9CA3AF", // hoverAndFocusBackground: "#181B24", // hoverAndFocusForeground: "#D1D5DB", // activeBackground: "#273345", // activeForeground: "#FFFFFF", // disabledForeground: "#6B7280", // activeHoverAndFocusBackground: "#273345", // activeHoverAndFocusForeground: "#FFFFFF", // }, toggle: { activeDefaultBackground: "#64D5E4", activeDefaultForeground: "#FFFFFF", // activeDisabledBackground: "#AFEBF2", // activeDisabledForeground: "#3AC1D6", // inactiveDisabledBackground: "#374151", // inactiveDisabledForeground: "#6B7280", inactiveDefaultBackground: "#374151" // inactiveDefaultForeground: "#F3F4F6", // inactiveHoverAndFocusBackground: "#4B5563", // inactiveHoverAndFocusForeground: "#F3F4F6", // activeHoverAndFocusBackground: "#1F4A5A", // activeHoverAndFocusForeground: "#FFFFFF", }, // segmentationControl: { // baseInactiveHoverAndFocusForeground: "#D1D5DB", // baseActiveBackground: "#273345", // baseActiveForeground: "#FFFFFF", // baseDisabledForeground: "#9CA3AF", // background: "#181B24", // baseInactiveForeground: "#9CA3AF", // border: "#181B24", // }, tooltip: { background: "#273345", foreground: "#FFFFFF" }, // radioButton: { // selectedDefaultBackground: "#64D5E4", // selectedDefaultForeground: "#FFFFFF", // selectedHoverAndFocusBackground: "#64D5E4", // selectedHoverAndFocusForeground: "#FFFFFF", // selectedDisabledBackground: "#374151", // selectedDisabledForegro