@brave/swap-interface
Version:
Brave Swap - an open-source swap interface by Brave, focussed on usability and multi-chain support.
1,820 lines (1,817 loc) • 1.71 MB
JavaScript
var yj = Object.defineProperty;
var Bj = (A, M, I) => M in A ? yj(A, M, { enumerable: !0, configurable: !0, writable: !0, value: I }) : A[M] = I;
var WI = (A, M, I) => (Bj(A, typeof M != "symbol" ? M + "" : M, I), I);
import * as rM from "react";
import G, { createContext as bI, useReducer as oj, useContext as VN, useRef as VI, useCallback as XI, useEffect as Sj, createElement as kM, PureComponent as XN } from "react";
import Y, { ThemeProvider as sj } from "styled-components";
var uA = /* @__PURE__ */ ((A) => (A[A.Solana = 501] = "Solana", A[A.Ethereum = 60] = "Ethereum", A))(uA || {}), bj = /* @__PURE__ */ ((A) => (A.ETHEREUM_MAINNET = "0x1", A.BINANCE_SMART_CHAIN = "0x38", A.POLYGON = "0x89", A.AVALANCHE = "0xa86a", A.CELO = "0xa4ec", A.FANTOM = "0xfa", A.OPTIMISM = "0xa", A.SOLANA_MAINNET = "0x65", A))(bj || {});
const OM = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", gI = "So11111111111111111111111111111111111111112", Qj = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", g4 = 100, WA = "brave-swap-data-theme";
var fM = { exports: {} }, eM = {};
/** @license React v16.14.0
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hI;
function Gj() {
if (hI)
return eM;
hI = 1;
var A = G, M = 60103;
if (eM.Fragment = 60107, typeof Symbol == "function" && Symbol.for) {
var I = Symbol.for;
M = I("react.element"), eM.Fragment = I("react.fragment");
}
var N = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = Object.prototype.hasOwnProperty, D = { key: !0, ref: !0, __self: !0, __source: !0 };
function c(x, i, T) {
var Z, U = {}, L = null, Q = null;
T !== void 0 && (L = "" + T), i.key !== void 0 && (L = "" + i.key), i.ref !== void 0 && (Q = i.ref);
for (Z in i)
j.call(i, Z) && !D.hasOwnProperty(Z) && (U[Z] = i[Z]);
if (x && x.defaultProps)
for (Z in i = x.defaultProps, i)
U[Z] === void 0 && (U[Z] = i[Z]);
return { $$typeof: M, type: x, key: L, ref: Q, props: U, _owner: N.current };
}
return eM.jsx = c, eM.jsxs = c, eM;
}
var DI = {};
/** @license React v16.14.0
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var FI;
function Zj() {
return FI || (FI = 1, function(A) {
process.env.NODE_ENV !== "production" && function() {
var M = G, I = 60103, N = 60106;
A.Fragment = 60107;
var j = 60108, D = 60114, c = 60109, x = 60110, i = 60112, T = 60113, Z = 60120, U = 60115, L = 60116, Q = 60121, p = 60122, E = 60117, r = 60129, b = 60131;
if (typeof Symbol == "function" && Symbol.for) {
var l = Symbol.for;
I = l("react.element"), N = l("react.portal"), A.Fragment = l("react.fragment"), j = l("react.strict_mode"), D = l("react.profiler"), c = l("react.provider"), x = l("react.context"), i = l("react.forward_ref"), T = l("react.suspense"), Z = l("react.suspense_list"), U = l("react.memo"), L = l("react.lazy"), Q = l("react.block"), p = l("react.server.block"), E = l("react.fundamental"), l("react.scope"), l("react.opaque.id"), r = l("react.debug_trace_mode"), l("react.offscreen"), b = l("react.legacy_hidden");
}
var o = typeof Symbol == "function" && Symbol.iterator, y = "@@iterator";
function O(s) {
if (s === null || typeof s != "object")
return null;
var v = o && s[o] || s[y];
return typeof v == "function" ? v : null;
}
var m = M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function H(s) {
{
for (var v = arguments.length, h = new Array(v > 1 ? v - 1 : 0), gA = 1; gA < v; gA++)
h[gA - 1] = arguments[gA];
g("error", s, h);
}
}
function g(s, v, h) {
{
var gA = m.ReactDebugCurrentFrame, CA = "";
if (t) {
var lA = w(t.type), AA = t._owner;
CA += a(lA, t._source, AA && w(AA.type));
}
CA += gA.getStackAddendum(), CA !== "" && (v += "%s", h = h.concat([CA]));
var DA = h.map(function(dA) {
return "" + dA;
});
DA.unshift("Warning: " + v), Function.prototype.apply.call(console[s], console, DA);
}
}
var z = !1;
function e(s) {
return !!(typeof s == "string" || typeof s == "function" || s === A.Fragment || s === D || s === r || s === j || s === T || s === Z || s === b || z || typeof s == "object" && s !== null && (s.$$typeof === L || s.$$typeof === U || s.$$typeof === c || s.$$typeof === x || s.$$typeof === i || s.$$typeof === E || s.$$typeof === Q || s[0] === p));
}
var n = /^(.*)[\\\/]/;
function a(s, v, h) {
var gA = "";
if (v) {
var CA = v.fileName, lA = CA.replace(n, "");
if (/^index\./.test(lA)) {
var AA = CA.match(n);
if (AA) {
var DA = AA[1];
if (DA) {
var dA = DA.replace(n, "");
lA = dA + "/" + lA;
}
}
}
gA = " (at " + lA + ":" + v.lineNumber + ")";
} else
h && (gA = " (created by " + h + ")");
return `
in ` + (s || "Unknown") + gA;
}
var d = 1;
function B(s) {
return s._status === d ? s._result : null;
}
function C(s, v, h) {
var gA = v.displayName || v.name || "";
return s.displayName || (gA !== "" ? h + "(" + gA + ")" : h);
}
function w(s) {
if (s == null)
return null;
if (typeof s.tag == "number" && H("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof s == "function")
return s.displayName || s.name || null;
if (typeof s == "string")
return s;
switch (s) {
case A.Fragment:
return "Fragment";
case N:
return "Portal";
case D:
return "Profiler";
case j:
return "StrictMode";
case T:
return "Suspense";
case Z:
return "SuspenseList";
}
if (typeof s == "object")
switch (s.$$typeof) {
case x:
return "Context.Consumer";
case c:
return "Context.Provider";
case i:
return C(s, s.render, "ForwardRef");
case U:
return w(s.type);
case Q:
return w(s.render);
case L: {
var v = s, h = B(v);
if (h)
return w(h);
break;
}
}
return null;
}
var S = {};
m.ReactDebugCurrentFrame;
var t = null;
function R(s) {
t = s;
}
function X(s, v, h, gA, CA) {
{
var lA = Function.call.bind(Object.prototype.hasOwnProperty);
for (var AA in s)
if (lA(s, AA)) {
var DA = void 0;
try {
if (typeof s[AA] != "function") {
var dA = Error((gA || "React class") + ": " + h + " type `" + AA + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[AA] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw dA.name = "Invariant Violation", dA;
}
DA = s[AA](v, AA, gA, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (GA) {
DA = GA;
}
DA && !(DA instanceof Error) && (R(CA), H("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", gA || "React class", h, AA, typeof DA), R(null)), DA instanceof Error && !(DA.message in S) && (S[DA.message] = !0, R(CA), H("Failed %s type: %s", h, DA.message), R(null));
}
}
}
var V = m.ReactCurrentOwner, _ = Object.prototype.hasOwnProperty, eA = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, cA, q, jA;
jA = {};
function wA(s) {
if (_.call(s, "ref")) {
var v = Object.getOwnPropertyDescriptor(s, "ref").get;
if (v && v.isReactWarning)
return !1;
}
return s.ref !== void 0;
}
function XA(s) {
if (_.call(s, "key")) {
var v = Object.getOwnPropertyDescriptor(s, "key").get;
if (v && v.isReactWarning)
return !1;
}
return s.key !== void 0;
}
function iA(s, v) {
if (typeof s.ref == "string" && V.current && v && V.current.stateNode !== v) {
var h = w(V.current.type);
jA[h] || (H('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', w(V.current.type), s.ref), jA[h] = !0);
}
}
function xA(s, v) {
{
var h = function() {
cA || (cA = !0, H("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", v));
};
h.isReactWarning = !0, Object.defineProperty(s, "key", {
get: h,
configurable: !0
});
}
}
function tA(s, v) {
{
var h = function() {
q || (q = !0, H("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", v));
};
h.isReactWarning = !0, Object.defineProperty(s, "ref", {
get: h,
configurable: !0
});
}
}
var hA = function(s, v, h, gA, CA, lA, AA) {
var DA = {
$$typeof: I,
type: s,
key: v,
ref: h,
props: AA,
_owner: lA
};
return DA._store = {}, Object.defineProperty(DA._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(DA, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: gA
}), Object.defineProperty(DA, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: CA
}), Object.freeze && (Object.freeze(DA.props), Object.freeze(DA)), DA;
};
function aA(s, v, h, gA, CA) {
{
var lA, AA = {}, DA = null, dA = null;
h !== void 0 && (DA = "" + h), XA(v) && (DA = "" + v.key), wA(v) && (dA = v.ref, iA(v, CA));
for (lA in v)
_.call(v, lA) && !eA.hasOwnProperty(lA) && (AA[lA] = v[lA]);
if (s && s.defaultProps) {
var GA = s.defaultProps;
for (lA in GA)
AA[lA] === void 0 && (AA[lA] = GA[lA]);
}
if (DA || dA) {
var W = typeof s == "function" ? s.displayName || s.name || "Unknown" : s;
DA && xA(AA, W), dA && tA(AA, W);
}
return hA(s, DA, dA, CA, gA, V.current, AA);
}
}
var EA = m.ReactCurrentOwner;
m.ReactDebugCurrentFrame;
function zA(s) {
t = s;
}
var PA;
PA = !1;
function iM(s) {
return typeof s == "object" && s !== null && s.$$typeof === I;
}
function aM() {
{
if (EA.current) {
var s = w(EA.current.type);
if (s)
return `
Check the render method of \`` + s + "`.";
}
return "";
}
}
function EM(s) {
{
if (s !== void 0) {
var v = s.fileName.replace(/^.*[\\\/]/, ""), h = s.lineNumber;
return `
Check your code at ` + v + ":" + h + ".";
}
return "";
}
}
var FA = {};
function LM(s) {
{
var v = aM();
if (!v) {
var h = typeof s == "string" ? s : s.displayName || s.name;
h && (v = `
Check the top-level render call using <` + h + ">.");
}
return v;
}
}
function fA(s, v) {
{
if (!s._store || s._store.validated || s.key != null)
return;
s._store.validated = !0;
var h = LM(v);
if (FA[h])
return;
FA[h] = !0;
var gA = "";
s && s._owner && s._owner !== EA.current && (gA = " It was passed a child from " + w(s._owner.type) + "."), zA(s), H('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', h, gA), zA(null);
}
}
function zM(s, v) {
{
if (typeof s != "object")
return;
if (Array.isArray(s))
for (var h = 0; h < s.length; h++) {
var gA = s[h];
iM(gA) && fA(gA, v);
}
else if (iM(s))
s._store && (s._store.validated = !0);
else if (s) {
var CA = O(s);
if (typeof CA == "function" && CA !== s.entries)
for (var lA = CA.call(s), AA; !(AA = lA.next()).done; )
iM(AA.value) && fA(AA.value, v);
}
}
}
function MI(s) {
{
var v = s.type;
if (v == null || typeof v == "string")
return;
var h;
if (typeof v == "function")
h = v.propTypes;
else if (typeof v == "object" && (v.$$typeof === i || v.$$typeof === U))
h = v.propTypes;
else
return;
if (h) {
var gA = w(v);
X(h, s.props, "prop", gA, s);
} else if (v.PropTypes !== void 0 && !PA) {
PA = !0;
var CA = w(v);
H("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", CA || "Unknown");
}
typeof v.getDefaultProps == "function" && !v.getDefaultProps.isReactClassApproved && H("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function tM(s) {
{
for (var v = Object.keys(s.props), h = 0; h < v.length; h++) {
var gA = v[h];
if (gA !== "children" && gA !== "key") {
zA(s), H("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", gA), zA(null);
break;
}
}
s.ref !== null && (zA(s), H("Invalid attribute `ref` supplied to `React.Fragment`."), zA(null));
}
}
function kA(s, v, h, gA, CA, lA) {
{
var AA = e(s);
if (!AA) {
var DA = "";
(s === void 0 || typeof s == "object" && s !== null && Object.keys(s).length === 0) && (DA += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var dA = EM(CA);
dA ? DA += dA : DA += aM();
var GA;
s === null ? GA = "null" : Array.isArray(s) ? GA = "array" : s !== void 0 && s.$$typeof === I ? (GA = "<" + (w(s.type) || "Unknown") + " />", DA = " Did you accidentally export a JSX literal instead of a component?") : GA = typeof s, H("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", GA, DA);
}
var W = aA(s, v, h, CA, lA);
if (W == null)
return W;
if (AA) {
var F = v.children;
if (F !== void 0)
if (gA)
if (Array.isArray(F)) {
for (var IA = 0; IA < F.length; IA++)
zM(F[IA], s);
Object.freeze && Object.freeze(F);
} else
H("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
zM(F, s);
}
return s === A.Fragment ? tM(W) : MI(W), W;
}
}
function DM(s, v, h) {
return kA(s, v, h, !0);
}
function II(s, v, h) {
return kA(s, v, h, !1);
}
var NI = II, jI = DM;
A.jsx = NI, A.jsxs = jI;
}();
}(DI)), DI;
}
(function(A) {
process.env.NODE_ENV === "production" ? A.exports = Gj() : A.exports = Zj();
})(fM);
const bA = fM.exports.Fragment, u = fM.exports.jsx, P = fM.exports.jsxs, hN = bI(void 0), Uj = (A) => {
const {
children: M,
assetsList: I,
network: N,
account: j,
supportedNetworks: D,
exchanges: c,
walletAccounts: x,
defaultBaseCurrency: i,
isWalletConnected: T,
isReady: Z,
connectWallet: U,
disconnectWallet: L,
switchAccount: Q,
switchNetwork: p,
getLocale: E,
getBalance: r,
getTokenBalance: b,
getTokenBalances: l,
getTokenPrice: o,
getNetworkFeeEstimate: y,
ethWalletAdapter: O,
solWalletAdapter: m,
swapService: H
} = A;
return /* @__PURE__ */ u(hN.Provider, {
value: {
assetsList: I,
network: N,
account: j,
supportedNetworks: D,
exchanges: c,
walletAccounts: x,
defaultBaseCurrency: i,
isWalletConnected: T,
isReady: Z,
connectWallet: U,
disconnectWallet: L,
switchAccount: Q,
switchNetwork: p,
getLocale: E,
getBalance: r,
getTokenBalance: b,
getTokenBalances: l,
getTokenPrice: o,
getNetworkFeeEstimate: y,
ethWalletAdapter: O,
solWalletAdapter: m,
swapService: H
},
children: M
});
}, TA = () => {
const A = G.useContext(hN);
if (A === void 0)
throw new Error("useSwap must be used within a SwapProvider");
return A;
};
function rj(A, ...M) {
return (...I) => A(...M, ...I);
}
function bM(A) {
return function(...M) {
var I = M.pop();
return A.call(this, M, I);
};
}
var Oj = typeof queueMicrotask == "function" && queueMicrotask, FN = typeof setImmediate == "function" && setImmediate, fN = typeof process == "object" && typeof process.nextTick == "function";
function JN(A) {
setTimeout(A, 0);
}
function KN(A) {
return (M, ...I) => A(() => M(...I));
}
var dM;
Oj ? dM = queueMicrotask : FN ? dM = setImmediate : fN ? dM = process.nextTick : dM = JN;
var cM = KN(dM);
function nI(A) {
return QM(A) ? function(...M) {
const I = M.pop(), N = A.apply(this, M);
return fI(N, I);
} : bM(function(M, I) {
var N;
try {
N = A.apply(this, M);
} catch (j) {
return I(j);
}
if (N && typeof N.then == "function")
return fI(N, I);
I(null, N);
});
}
function fI(A, M) {
return A.then((I) => {
JI(M, null, I);
}, (I) => {
JI(M, I && I.message ? I : new Error(I));
});
}
function JI(A, M, I) {
try {
A(M, I);
} catch (N) {
cM((j) => {
throw j;
}, N);
}
}
function QM(A) {
return A[Symbol.toStringTag] === "AsyncFunction";
}
function Rj(A) {
return A[Symbol.toStringTag] === "AsyncGenerator";
}
function Yj(A) {
return typeof A[Symbol.asyncIterator] == "function";
}
function NA(A) {
if (typeof A != "function")
throw new Error("expected a function");
return QM(A) ? nI(A) : A;
}
function MA(A, M = A.length) {
if (!M)
throw new Error("arity is undefined");
function I(...N) {
return typeof N[M - 1] == "function" ? A.apply(this, N) : new Promise((j, D) => {
N[M - 1] = (c, ...x) => {
if (c)
return D(c);
j(x.length > 1 ? x : x[0]);
}, A.apply(this, N);
});
}
return I;
}
function qN(A) {
return function(I, ...N) {
return MA(function(D) {
var c = this;
return A(I, (x, i) => {
NA(x).apply(c, N.concat(i));
}, D);
});
};
}
function QI(A, M, I, N) {
M = M || [];
var j = [], D = 0, c = NA(I);
return A(M, (x, i, T) => {
var Z = D++;
c(x, (U, L) => {
j[Z] = L, T(U);
});
}, (x) => {
N(x, j);
});
}
function JM(A) {
return A && typeof A.length == "number" && A.length >= 0 && A.length % 1 === 0;
}
const KM = {};
function NM(A) {
function M(...I) {
if (A !== null) {
var N = A;
A = null, N.apply(this, I);
}
}
return Object.assign(M, A), M;
}
function Hj(A) {
return A[Symbol.iterator] && A[Symbol.iterator]();
}
function mj(A) {
var M = -1, I = A.length;
return function() {
return ++M < I ? { value: A[M], key: M } : null;
};
}
function Pj(A) {
var M = -1;
return function() {
var N = A.next();
return N.done ? null : (M++, { value: N.value, key: M });
};
}
function kj(A) {
var M = A ? Object.keys(A) : [], I = -1, N = M.length;
return function j() {
var D = M[++I];
return D === "__proto__" ? j() : I < N ? { value: A[D], key: D } : null;
};
}
function pj(A) {
if (JM(A))
return mj(A);
var M = Hj(A);
return M ? Pj(M) : kj(A);
}
function jM(A) {
return function(...M) {
if (A === null)
throw new Error("Callback was already called.");
var I = A;
A = null, I.apply(this, M);
};
}
function KI(A, M, I, N) {
let j = !1, D = !1, c = !1, x = 0, i = 0;
function T() {
x >= M || c || j || (c = !0, A.next().then(({ value: L, done: Q }) => {
if (!(D || j)) {
if (c = !1, Q) {
j = !0, x <= 0 && N(null);
return;
}
x++, I(L, i, Z), i++, T();
}
}).catch(U));
}
function Z(L, Q) {
if (x -= 1, !D) {
if (L)
return U(L);
if (L === !1) {
j = !0, D = !0;
return;
}
if (Q === KM || j && x <= 0)
return j = !0, N(null);
T();
}
}
function U(L) {
D || (c = !1, j = !0, N(L));
}
T();
}
var mA = (A) => (M, I, N) => {
if (N = NM(N), A <= 0)
throw new RangeError("concurrency limit cannot be less than 1");
if (!M)
return N(null);
if (Rj(M))
return KI(M, A, I, N);
if (Yj(M))
return KI(M[Symbol.asyncIterator](), A, I, N);
var j = pj(M), D = !1, c = !1, x = 0, i = !1;
function T(U, L) {
if (!c)
if (x -= 1, U)
D = !0, N(U);
else if (U === !1)
D = !0, c = !0;
else {
if (L === KM || D && x <= 0)
return D = !0, N(null);
i || Z();
}
}
function Z() {
for (i = !0; x < A && !D; ) {
var U = j();
if (U === null) {
D = !0, x <= 0 && N(null);
return;
}
x += 1, I(U.value, U.key, jM(T));
}
i = !1;
}
Z();
};
function vj(A, M, I, N) {
return mA(M)(A, NA(I), N);
}
var XM = MA(vj, 4);
function Wj(A, M, I) {
I = NM(I);
var N = 0, j = 0, { length: D } = A, c = !1;
D === 0 && I(null);
function x(i, T) {
i === !1 && (c = !0), c !== !0 && (i ? I(i) : (++j === D || T === KM) && I(null));
}
for (; N < D; N++)
M(A[N], N, jM(x));
}
function Vj(A, M, I) {
return XM(A, 1 / 0, M, I);
}
function Xj(A, M, I) {
var N = JM(A) ? Wj : Vj;
return N(A, NA(M), I);
}
var HA = MA(Xj, 3);
function hj(A, M, I) {
return QI(HA, A, M, I);
}
var GI = MA(hj, 3), Fj = qN(GI);
function fj(A, M, I) {
return XM(A, 1, M, I);
}
var _A = MA(fj, 3);
function Jj(A, M, I) {
return QI(_A, A, M, I);
}
var _N = MA(Jj, 3), Kj = qN(_N);
const nM = Symbol("promiseCallback");
function wM() {
let A, M;
function I(N, ...j) {
if (N)
return M(N);
A(j.length > 1 ? j : j[0]);
}
return I[nM] = new Promise((N, j) => {
A = N, M = j;
}), I;
}
function $N(A, M, I) {
typeof M != "number" && (I = M, M = null), I = NM(I || wM());
var N = Object.keys(A).length;
if (!N)
return I(null);
M || (M = N);
var j = {}, D = 0, c = !1, x = !1, i = /* @__PURE__ */ Object.create(null), T = [], Z = [], U = {};
Object.keys(A).forEach((o) => {
var y = A[o];
if (!Array.isArray(y)) {
L(o, [y]), Z.push(o);
return;
}
var O = y.slice(0, y.length - 1), m = O.length;
if (m === 0) {
L(o, y), Z.push(o);
return;
}
U[o] = m, O.forEach((H) => {
if (!A[H])
throw new Error("async.auto task `" + o + "` has a non-existent dependency `" + H + "` in " + O.join(", "));
p(H, () => {
m--, m === 0 && L(o, y);
});
});
}), b(), Q();
function L(o, y) {
T.push(() => r(o, y));
}
function Q() {
if (!c) {
if (T.length === 0 && D === 0)
return I(null, j);
for (; T.length && D < M; ) {
var o = T.shift();
o();
}
}
}
function p(o, y) {
var O = i[o];
O || (O = i[o] = []), O.push(y);
}
function E(o) {
var y = i[o] || [];
y.forEach((O) => O()), Q();
}
function r(o, y) {
if (!x) {
var O = jM((H, ...g) => {
if (D--, H === !1) {
c = !0;
return;
}
if (g.length < 2 && ([g] = g), H) {
var z = {};
if (Object.keys(j).forEach((e) => {
z[e] = j[e];
}), z[o] = g, x = !0, i = /* @__PURE__ */ Object.create(null), c)
return;
I(H, z);
} else
j[o] = g, E(o);
});
D++;
var m = NA(y[y.length - 1]);
y.length > 1 ? m(j, O) : m(O);
}
}
function b() {
for (var o, y = 0; Z.length; )
o = Z.pop(), y++, l(o).forEach((O) => {
--U[O] === 0 && Z.push(O);
});
if (y !== N)
throw new Error(
"async.auto cannot execute tasks due to a recursive dependency"
);
}
function l(o) {
var y = [];
return Object.keys(A).forEach((O) => {
const m = A[O];
Array.isArray(m) && m.indexOf(o) >= 0 && y.push(O);
}), y;
}
return I[nM];
}
var qj = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/, _j = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/, $j = /,/, Ag = /(=.+)?(\s*)$/;
function Mg(A) {
let M = "", I = 0, N = A.indexOf("*/");
for (; I < A.length; )
if (A[I] === "/" && A[I + 1] === "/") {
let j = A.indexOf(`
`, I);
I = j === -1 ? A.length : j;
} else if (N !== -1 && A[I] === "/" && A[I + 1] === "*") {
let j = A.indexOf("*/", I);
j !== -1 ? (I = j + 2, N = A.indexOf("*/", I)) : (M += A[I], I++);
} else
M += A[I], I++;
return M;
}
function Ig(A) {
const M = Mg(A.toString());
let I = M.match(qj);
if (I || (I = M.match(_j)), !I)
throw new Error(`could not parse args in autoInject
Source:
` + M);
let [, N] = I;
return N.replace(/\s/g, "").split($j).map((j) => j.replace(Ag, "").trim());
}
function Ng(A, M) {
var I = {};
return Object.keys(A).forEach((N) => {
var j = A[N], D, c = QM(j), x = !c && j.length === 1 || c && j.length === 0;
if (Array.isArray(j))
D = [...j], j = D.pop(), I[N] = D.concat(D.length > 0 ? i : j);
else if (x)
I[N] = j;
else {
if (D = Ig(j), j.length === 0 && !c && D.length === 0)
throw new Error("autoInject task functions require explicit parameters.");
c || D.pop(), I[N] = D.concat(i);
}
function i(T, Z) {
var U = D.map((L) => T[L]);
U.push(Z), NA(j)(...U);
}
}), $N(I, M);
}
class jg {
constructor() {
this.head = this.tail = null, this.length = 0;
}
removeLink(M) {
return M.prev ? M.prev.next = M.next : this.head = M.next, M.next ? M.next.prev = M.prev : this.tail = M.prev, M.prev = M.next = null, this.length -= 1, M;
}
empty() {
for (; this.head; )
this.shift();
return this;
}
insertAfter(M, I) {
I.prev = M, I.next = M.next, M.next ? M.next.prev = I : this.tail = I, M.next = I, this.length += 1;
}
insertBefore(M, I) {
I.prev = M.prev, I.next = M, M.prev ? M.prev.next = I : this.head = I, M.prev = I, this.length += 1;
}
unshift(M) {
this.head ? this.insertBefore(this.head, M) : qI(this, M);
}
push(M) {
this.tail ? this.insertAfter(this.tail, M) : qI(this, M);
}
shift() {
return this.head && this.removeLink(this.head);
}
pop() {
return this.tail && this.removeLink(this.tail);
}
toArray() {
return [...this];
}
*[Symbol.iterator]() {
for (var M = this.head; M; )
yield M.data, M = M.next;
}
remove(M) {
for (var I = this.head; I; ) {
var { next: N } = I;
M(I) && this.removeLink(I), I = N;
}
return this;
}
}
function qI(A, M) {
A.length = 1, A.head = A.tail = M;
}
function ZI(A, M, I) {
if (M == null)
M = 1;
else if (M === 0)
throw new RangeError("Concurrency must not be zero");
var N = NA(A), j = 0, D = [];
const c = {
error: [],
drain: [],
saturated: [],
unsaturated: [],
empty: []
};
function x(l, o) {
c[l].push(o);
}
function i(l, o) {
const y = (...O) => {
T(l, y), o(...O);
};
c[l].push(y);
}
function T(l, o) {
if (!l)
return Object.keys(c).forEach((y) => c[y] = []);
if (!o)
return c[l] = [];
c[l] = c[l].filter((y) => y !== o);
}
function Z(l, ...o) {
c[l].forEach((y) => y(...o));
}
var U = !1;
function L(l, o, y, O) {
if (O != null && typeof O != "function")
throw new Error("task callback must be a function");
b.started = !0;
var m, H;
function g(e, ...n) {
if (e)
return y ? H(e) : m();
if (n.length <= 1)
return m(n[0]);
m(n);
}
var z = b._createTaskItem(
l,
y ? g : O || g
);
if (o ? b._tasks.unshift(z) : b._tasks.push(z), U || (U = !0, cM(() => {
U = !1, b.process();
})), y || !O)
return new Promise((e, n) => {
m = e, H = n;
});
}
function Q(l) {
return function(o, ...y) {
j -= 1;
for (var O = 0, m = l.length; O < m; O++) {
var H = l[O], g = D.indexOf(H);
g === 0 ? D.shift() : g > 0 && D.splice(g, 1), H.callback(o, ...y), o != null && Z("error", o, H.data);
}
j <= b.concurrency - b.buffer && Z("unsaturated"), b.idle() && Z("drain"), b.process();
};
}
function p(l) {
return l.length === 0 && b.idle() ? (cM(() => Z("drain")), !0) : !1;
}
const E = (l) => (o) => {
if (!o)
return new Promise((y, O) => {
i(l, (m, H) => {
if (m)
return O(m);
y(H);
});
});
T(l), x(l, o);
};
var r = !1, b = {
_tasks: new jg(),
_createTaskItem(l, o) {
return {
data: l,
callback: o
};
},
*[Symbol.iterator]() {
yield* b._tasks[Symbol.iterator]();
},
concurrency: M,
payload: I,
buffer: M / 4,
started: !1,
paused: !1,
push(l, o) {
return Array.isArray(l) ? p(l) ? void 0 : l.map((y) => L(y, !1, !1, o)) : L(l, !1, !1, o);
},
pushAsync(l, o) {
return Array.isArray(l) ? p(l) ? void 0 : l.map((y) => L(y, !1, !0, o)) : L(l, !1, !0, o);
},
kill() {
T(), b._tasks.empty();
},
unshift(l, o) {
return Array.isArray(l) ? p(l) ? void 0 : l.map((y) => L(y, !0, !1, o)) : L(l, !0, !1, o);
},
unshiftAsync(l, o) {
return Array.isArray(l) ? p(l) ? void 0 : l.map((y) => L(y, !0, !0, o)) : L(l, !0, !0, o);
},
remove(l) {
b._tasks.remove(l);
},
process() {
if (!r) {
for (r = !0; !b.paused && j < b.concurrency && b._tasks.length; ) {
var l = [], o = [], y = b._tasks.length;
b.payload && (y = Math.min(y, b.payload));
for (var O = 0; O < y; O++) {
var m = b._tasks.shift();
l.push(m), D.push(m), o.push(m.data);
}
j += 1, b._tasks.length === 0 && Z("empty"), j === b.concurrency && Z("saturated");
var H = jM(Q(l));
N(o, H);
}
r = !1;
}
},
length() {
return b._tasks.length;
},
running() {
return j;
},
workersList() {
return D;
},
idle() {
return b._tasks.length + j === 0;
},
pause() {
b.paused = !0;
},
resume() {
b.paused !== !1 && (b.paused = !1, cM(b.process));
}
};
return Object.defineProperties(b, {
saturated: {
writable: !1,
value: E("saturated")
},
unsaturated: {
writable: !1,
value: E("unsaturated")
},
empty: {
writable: !1,
value: E("empty")
},
drain: {
writable: !1,
value: E("drain")
},
error: {
writable: !1,
value: E("error")
}
}), b;
}
function gg(A, M) {
return ZI(A, 1, M);
}
function Dg(A, M, I) {
return ZI(A, M, I);
}
function cg(A, M, I, N) {
N = NM(N);
var j = NA(I);
return _A(A, (D, c, x) => {
j(M, D, (i, T) => {
M = T, x(i);
});
}, (D) => N(D, M));
}
var yM = MA(cg, 4);
function Aj(...A) {
var M = A.map(NA);
return function(...I) {
var N = this, j = I[I.length - 1];
return typeof j == "function" ? I.pop() : j = wM(), yM(
M,
I,
(D, c, x) => {
c.apply(N, D.concat((i, ...T) => {
x(i, T);
}));
},
(D, c) => j(D, ...c)
), j[nM];
};
}
function ig(...A) {
return Aj(...A.reverse());
}
function zg(A, M, I, N) {
return QI(mA(M), A, I, N);
}
var qM = MA(zg, 4);
function eg(A, M, I, N) {
var j = NA(I);
return qM(A, M, (D, c) => {
j(D, (x, ...i) => x ? c(x) : c(x, i));
}, (D, c) => {
for (var x = [], i = 0; i < c.length; i++)
c[i] && (x = x.concat(...c[i]));
return N(D, x);
});
}
var hM = MA(eg, 4);
function xg(A, M, I) {
return hM(A, 1 / 0, M, I);
}
var _I = MA(xg, 3);
function ug(A, M, I) {
return hM(A, 1, M, I);
}
var $I = MA(ug, 3);
function lg(...A) {
return function(...M) {
var I = M.pop();
return I(null, ...A);
};
}
function $A(A, M) {
return (I, N, j, D) => {
var c = !1, x;
const i = NA(j);
I(N, (T, Z, U) => {
i(T, (L, Q) => {
if (L || L === !1)
return U(L);
if (A(Q) && !x)
return c = !0, x = M(!0, T), U(null, KM);
U();
});
}, (T) => {
if (T)
return D(T);
D(null, c ? x : M(!1));
});
};
}
function wg(A, M, I) {
return $A((N) => N, (N, j) => j)(HA, A, M, I);
}
var AN = MA(wg, 3);
function Cg(A, M, I, N) {
return $A((j) => j, (j, D) => D)(mA(M), A, I, N);
}
var MN = MA(Cg, 4);
function ng(A, M, I) {
return $A((N) => N, (N, j) => j)(mA(1), A, M, I);
}
var IN = MA(ng, 3);
function Mj(A) {
return (M, ...I) => NA(M)(...I, (N, ...j) => {
typeof console == "object" && (N ? console.error && console.error(N) : console[A] && j.forEach((D) => console[A](D)));
});
}
var Tg = Mj("dir");
function ag(A, M, I) {
I = jM(I);
var N = NA(A), j = NA(M), D;
function c(i, ...T) {
if (i)
return I(i);
i !== !1 && (D = T, j(...T, x));
}
function x(i, T) {
if (i)
return I(i);
if (i !== !1) {
if (!T)
return I(null, ...D);
N(c);
}
}
return x(null, !0);
}
var TI = MA(ag, 3);
function Eg(A, M, I) {
const N = NA(M);
return TI(A, (...j) => {
const D = j.pop();
N(...j, (c, x) => D(c, !x));
}, I);
}
function Ij(A) {
return (M, I, N) => A(M, N);
}
function Lg(A, M, I) {
return HA(A, Ij(NA(M)), I);
}
var NN = MA(Lg, 3);
function tg(A, M, I, N) {
return mA(M)(A, Ij(NA(I)), N);
}
var aI = MA(tg, 4);
function dg(A, M, I) {
return aI(A, 1, M, I);
}
var EI = MA(dg, 3);
function Nj(A) {
return QM(A) ? A : function(...M) {
var I = M.pop(), N = !0;
M.push((...j) => {
N ? cM(() => I(...j)) : I(...j);
}), A.apply(this, M), N = !1;
};
}
function yg(A, M, I) {
return $A((N) => !N, (N) => !N)(HA, A, M, I);
}
var jN = MA(yg, 3);
function Bg(A, M, I, N) {
return $A((j) => !j, (j) => !j)(mA(M), A, I, N);
}
var gN = MA(Bg, 4);
function og(A, M, I) {
return $A((N) => !N, (N) => !N)(_A, A, M, I);
}
var DN = MA(og, 3);
function Sg(A, M, I, N) {
var j = new Array(M.length);
A(M, (D, c, x) => {
I(D, (i, T) => {
j[c] = !!T, x(i);
});
}, (D) => {
if (D)
return N(D);
for (var c = [], x = 0; x < M.length; x++)
j[x] && c.push(M[x]);
N(null, c);
});
}
function sg(A, M, I, N) {
var j = [];
A(M, (D, c, x) => {
I(D, (i, T) => {
if (i)
return x(i);
T && j.push({ index: c, value: D }), x(i);
});
}, (D) => {
if (D)
return N(D);
N(null, j.sort((c, x) => c.index - x.index).map((c) => c.value));
});
}
function _M(A, M, I, N) {
var j = JM(M) ? Sg : sg;
return j(A, M, NA(I), N);
}
function bg(A, M, I) {
return _M(HA, A, M, I);
}
var cN = MA(bg, 3);
function Qg(A, M, I, N) {
return _M(mA(M), A, I, N);
}
var iN = MA(Qg, 4);
function Gg(A, M, I) {
return _M(_A, A, M, I);
}
var zN = MA(Gg, 3);
function Zg(A, M) {
var I = jM(M), N = NA(Nj(A));
function j(D) {
if (D)
return I(D);
D !== !1 && N(j);
}
return j();
}
var Ug = MA(Zg, 2);
function rg(A, M, I, N) {
var j = NA(I);
return qM(A, M, (D, c) => {
j(D, (x, i) => x ? c(x) : c(x, { key: i, val: D }));
}, (D, c) => {
for (var x = {}, { hasOwnProperty: i } = Object.prototype, T = 0; T < c.length; T++)
if (c[T]) {
var { key: Z } = c[T], { val: U } = c[T];
i.call(x, Z) ? x[Z].push(U) : x[Z] = [U];
}
return N(D, x);
});
}
var UI = MA(rg, 4);
function Og(A, M, I) {
return UI(A, 1 / 0, M, I);
}
function Rg(A, M, I) {
return UI(A, 1, M, I);
}
var Yg = Mj("log");
function Hg(A, M, I, N) {
N = NM(N);
var j = {}, D = NA(I);
return mA(M)(A, (c, x, i) => {
D(c, x, (T, Z) => {
if (T)
return i(T);
j[x] = Z, i(T);
});
}, (c) => N(c, j));
}
var rI = MA(Hg, 4);
function mg(A, M, I) {
return rI(A, 1 / 0, M, I);
}
function Pg(A, M, I) {
return rI(A, 1, M, I);
}
function kg(A, M = (I) => I) {
var I = /* @__PURE__ */ Object.create(null), N = /* @__PURE__ */ Object.create(null), j = NA(A), D = bM((c, x) => {
var i = M(...c);
i in I ? cM(() => x(null, ...I[i])) : i in N ? N[i].push(x) : (N[i] = [x], j(...c, (T, ...Z) => {
T || (I[i] = Z);
var U = N[i];
delete N[i];
for (var L = 0, Q = U.length; L < Q; L++)
U[L](T, ...Z);
}));
});
return D.memo = I, D.unmemoized = A, D;
}
var pM;
fN ? pM = process.nextTick : FN ? pM = setImmediate : pM = JN;
var pg = KN(pM), OI = MA((A, M, I) => {
var N = JM(M) ? [] : {};
A(M, (j, D, c) => {
NA(j)((x, ...i) => {
i.length < 2 && ([i] = i), N[D] = i, c(x);
});
}, (j) => I(j, N));
}, 3);
function vg(A, M) {
return OI(HA, A, M);
}
function Wg(A, M, I) {
return OI(mA(M), A, I);
}
function jj(A, M) {
var I = NA(A);
return ZI((N, j) => {
I(N[0], j);
}, M, 1);
}
class Vg {
constructor() {
this.heap = [], this.pushCount = Number.MIN_SAFE_INTEGER;
}
get length() {
return this.heap.length;
}
empty() {
return this.heap = [], this;
}
percUp(M) {
let I;
for (; M > 0 && cI(this.heap[M], this.heap[I = eN(M)]); ) {
let N = this.heap[M];
this.heap[M] = this.heap[I], this.heap[I] = N, M = I;
}
}
percDown(M) {
let I;
for (; (I = Xg(M)) < this.heap.length && (I + 1 < this.heap.length && cI(this.heap[I + 1], this.heap[I]) && (I = I + 1), !cI(this.heap[M], this.heap[I])); ) {
let N = this.heap[M];
this.heap[M] = this.heap[I], this.heap[I] = N, M = I;
}
}
push(M) {
M.pushCount = ++this.pushCount, this.heap.push(M), this.percUp(this.heap.length - 1);
}
unshift(M) {
return this.heap.push(M);
}
shift() {
let [M] = this.heap;
return this.heap[0] = this.heap[this.heap.length - 1], this.heap.pop(), this.percDown(0), M;
}
toArray() {
return [...this];
}
*[Symbol.iterator]() {
for (let M = 0; M < this.heap.length; M++)
yield this.heap[M].data;
}
remove(M) {
let I = 0;
for (let N = 0; N < this.heap.length; N++)
M(this.heap[N]) || (this.heap[I] = this.heap[N], I++);
this.heap.splice(I);
for (let N = eN(this.heap.length - 1); N >= 0; N--)
this.percDown(N);
return this;
}
}
function Xg(A) {
return (A << 1) + 1;
}
function eN(A) {
return (A + 1 >> 1) - 1;
}
function cI(A, M) {
return A.priority !== M.priority ? A.priority < M.priority : A.pushCount < M.pushCount;
}
function hg(A, M) {
var I = jj(A, M), {
push: N,
pushAsync: j
} = I;
I._tasks = new Vg(), I._createTaskItem = ({ data: c, priority: x }, i) => ({
data: c,
priority: x,
callback: i
});
function D(c, x) {
return Array.isArray(c) ? c.map((i) => ({ data: i, priority: x })) : { data: c, priority: x };
}
return I.push = function(c, x = 0, i) {
return N(D(c, x), i);
}, I.pushAsync = function(c, x = 0, i) {
return j(D(c, x), i);
}, delete I.unshift, delete I.unshiftAsync, I;
}
function Fg(A, M) {
if (M = NM(M), !Array.isArray(A))
return M(new TypeError("First argument to race must be an array of functions"));
if (!A.length)
return M();
for (var I = 0, N = A.length; I < N; I++)
NA(A[I])(M);
}
var fg = MA(Fg, 2);
function xN(A, M, I, N) {
var j = [...A].reverse();
return yM(j, M, I, N);
}
function LI(A) {
var M = NA(A);
return bM(function(N, j) {
return N.push((D, ...c) => {
let x = {};
if (D && (x.error = D), c.length > 0) {
var i = c;
c.length <= 1 && ([i] = c), x.value = i;
}
j(null, x);
}), M.apply(this, N);
});
}
function Jg(A) {
var M;
return Array.isArray(A) ? M = A.map(LI) : (M = {}, Object.keys(A).forEach((I) => {
M[I] = LI.call(this, A[I]);
})), M;
}
function RI(A, M, I, N) {
const j = NA(I);
return _M(A, M, (D, c) => {
j(D, (x, i) => {
c(x, !i);
});
}, N);
}
function Kg(A, M, I) {
return RI(HA, A, M, I);
}
var qg = MA(Kg, 3);
function _g(A, M, I, N) {
return RI(mA(M), A, I, N);
}
var $g = MA(_g, 4);
function AD(A, M, I) {
return RI(_A, A, M, I);
}
var MD = MA(AD, 3);
function gj(A) {
return function() {
return A;
};
}
const tI = 5, Dj = 0;
function dI(A, M, I) {
var N = {
times: tI,
intervalFunc: gj(Dj)
};
if (arguments.length < 3 && typeof A == "function" ? (I = M || wM(), M = A) : (ID(N, A), I = I || wM()), typeof M != "function")
throw new Error("Invalid arguments for async.retry");
var j = NA(M), D = 1;
function c() {
j((x, ...i) => {
x !== !1 && (x && D++ < N.times && (typeof N.errorFilter != "function" || N.errorFilter(x)) ? setTimeout(c, N.intervalFunc(D - 1)) : I(x, ...i));
});
}
return c(), I[nM];
}
function ID(A, M) {
if (typeof M == "object")
A.times = +M.times || tI, A.intervalFunc = typeof M.interval == "function" ? M.interval : gj(+M.interval || Dj), A.errorFilter = M.errorFilter;
else if (typeof M == "number" || typeof M == "string")
A.times = +M || tI;
else
throw new Error("Invalid arguments for async.retry");
}
function ND(A, M) {
M || (M = A, A = null);
let I = A && A.arity || M.length;
QM(M) && (I += 1);
var N = NA(M);
return bM((j, D) => {
(j.length < I - 1 || D == null) && (j.push(D), D = wM());
function c(x) {
N(...j, x);
}
return A ? dI(A, c, D) : dI(c, D), D[nM];
});
}
function jD(A, M) {
return OI(_A, A, M);
}
function gD(A, M, I) {
return $A(Boolean, (N) => N)(HA, A, M, I);
}
var uN = MA(gD, 3);
function DD(A, M, I, N) {
return $A(Boolean, (j) => j)(mA(M), A, I, N);
}
var lN = MA(DD, 4);
function cD(A, M, I) {
return $A(Boolean, (N) => N)(_A, A, M, I);
}
var wN = MA(cD, 3);
function iD(A, M, I) {
var N = NA(M);
return GI(A, (D, c) => {
N(D, (x, i) => {
if (x)
return c(x);
c(x, { value: D, criteria: i });
});
}, (D, c) => {
if (D)
return I(D);
I(null, c.sort(j).map((x) => x.value));
});
function j(D, c) {
var x = D.criteria, i = c.criteria;
return x < i ? -1 : x > i ? 1 : 0;
}
}
var zD = MA(iD, 3);
function eD(A, M, I) {
var N = NA(A);
return bM((j, D) => {
var c = !1, x;
function i() {
var T = A.name || "anonymous", Z = new Error('Callback function "' + T + '" timed out.');
Z.code = "ETIMEDOUT", I && (Z.info = I), c = !0, D(Z);
}
j.push((...T) => {
c || (D(...T), clearTimeout(x));
}), x = setTimeout(i, M), N(...j);
});
}
function xD(A) {
for (var M = Array(A); A--; )
M[A] = A;
return M;
}
function YI(A, M, I, N) {
var j = NA(I);
return qM(xD(A), M, j, N);
}
function uD(A, M, I) {
return YI(A, 1 / 0, M, I);
}
function lD(A, M, I) {
return YI(A, 1, M, I);
}
function wD(A, M, I, N) {
arguments.length <= 3 && typeof M == "function" && (N = I, I = M, M = Array.isArray(A) ? [] : {}), N = NM(N || wM());
var j = NA(I);
return HA(A, (D, c, x) => {
j(M, D, c, x);
}, (D) => N(D, M)), N[nM];
}
function CD(A, M) {
var I = null, N;
return EI(A, (j, D) => {
NA(j)((c, ...x) => {
if (c === !1)
return D(c);
x.length < 2 ? [N] = x : N = x, I = c, D(c ? null : {});
});
}, () => M(I, N));
}
var nD = MA(CD);
function TD(A) {
return (...M) => (A.unmemoized || A)(...M);
}
function aD(A, M, I) {
I = jM(I);
var N = NA(M), j = NA(A), D = [];
function c(i, ...T) {
if (i)
return I(i);
D = T, i !== !1 && j(x);
}
function x(i, T) {
if (i)
return I(i);
if (i !== !1) {
if (!T)
return I(null, ...D);
N(c);
}
}
return j(x);
}
var yI = MA(aD, 3);
function ED(A, M, I) {
const N = NA(A);
return yI((j) => N((D, c) => j(D, !c)), M, I);
}
function LD(A, M) {
if (M = NM(M), !Array.isArray(A))
return M(new Error("First argument to waterfall must be an array of functions"));
if (!A.length)
return M();
var I = 0;
function N(D) {
var c = NA(A[I++]);
c(...D, jM(j));
}
function j(D, ...c) {
if (D !== !1) {
if (D || I === A.length)
return M(D, ...c);
N(c);
}
}
N([]);
}
var tD = MA(LD), dD = {
apply: rj,
applyEach: Fj,
applyEachSeries: Kj,
asyncify: nI,
auto: $N,
autoInject: Ng,
cargo: gg,
cargoQueue: Dg,
compose: ig,
concat: _I,
concatLimit: hM,
concatSeries: $I,
constant: lg,
detect: AN,
detectLimit: MN,
detectSeries: IN,
dir: Tg,
doUntil: Eg,
doWhilst: TI,
each: NN,
eachLimit: aI,
eachOf: HA,
eachOfLimit: XM,
eachOfSeries: _A,
eachSeries: EI,
ensureAsync: Nj,
every: jN,
everyLimit: gN,
everySeries: DN,
filter: cN,
filterLimit: iN,
filterSeries: zN,
forever: Ug,
groupBy: Og,
groupByLimit: UI,
groupBySeries: Rg,
log: Yg,
map: GI,
mapLimit: qM,
mapSeries: _N,
mapValues: mg,
mapValuesLimit: rI,
mapValuesSeries: Pg,
memoize: kg,
nextTick: pg,
parallel: vg,
parallelLimit: Wg,
priorityQueue: hg,
queue: jj,
race: fg,
reduce: yM,
reduceRight: xN,
reflect: LI,
reflectAll: Jg,
reject: qg,
rejectLimit: $g,
rejectSeries: MD,
retry: dI,
retryable: ND,
seq: Aj,
series: jD,
setImmediate: cM,
some: uN,
someLimit: lN,
someSeries: wN,
sortBy: zD,
timeout: eD,
times: uD,
timesLimit: YI,
timesSeries: lD,
transform: wD,
tryEach: nD,
unmemoize: TD,
until: ED,
waterfall: tD,
whilst: yI,
all: jN,
allLimit: gN,
allSeries: DN,
any: uN,
anyLimit: lN,
anySeries: wN,
find: AN,
findLimit: MN,
findSeries: IN,
flatMap: _I,
flatMapLimit: hM,
flatMapSeries: $I,
forEach: NN,
forEachSeries: EI,
forEachLimit: aI,
forEachOf: HA,
forEachOfSeries: _A,
forEachOfLimit: XM,
inject: yM,
foldl: yM,
foldr: xN,
select: cN,
selectLimit: iN,
selectSeries: zN,
wrapSync: nI,
during: yI,
doDuring: TI
};
const yD = [
{
label: "braveSwapToAccount",
name: "to-account"
},
{
label: "braveSwapToAddress",
name: "to-address"
}
], BD = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTciIGhlaWdodD0iMTciIHZpZXdCb3g9IjAgMCAxNyAxNyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNi42MTU0IDAuNTYyNTQ1QzE2LjY0NDIgMC42MzM1MyAxNi42NjM2IDAuNzA3ODYzIDE2LjY2NjMgMC43ODQ4NzVDMTYuNjY2OSAwLjc4ODg5MyAxNi42NjQ5IDAuNzkzNTgxIDE2LjY2NDkgMC43OTc1OTlDMTYuNjY2MyAwLjg1NTg2IDE2LjY2MjMgMC45MTM0NTEgMTYuNjQ3NSAwLjk3MTA0M0wxMy4zMTQyIDE0LjMwOTVDMTMuMjYzMyAxNC41MTExIDEzLjEyMjcgMTQuNjc3MiAxMi45MzI2IDE0Ljc2MDJDMTIuODQ3NiAxNC43OTcgMTIuNzU3MiAxNC44MTUxIDEyLjY2NzUgMTQuODE1MUMxMi41NTUgMTQuODE1MSAxMi40NDM5IDE0Ljc4NyAxMi4zNDM1IDE0LjczMDdMOS4yODU5OSAxMy4wMzE4QzkuMjY0NTcgMTMuMDkyNyA5LjI0NDQ4IDEzLjE1NDMgOS4yMDQzMSAxMy4yMDg2TDcuMjQ4NzggMTUuODc1OUM3LjEyMDkxIDE2LjA1MDcgNi45MTk0IDE2LjE0ODQgNi43MTExOSAxNi4xNDg0QzYuNjQyOSAxNi4xNDg0IDYuNTczOTUgMTYuMTM4NCA2LjUwNyAxNi4xMTYzQzYuMjMzODUgMTYuMDI4NiA2LjA0NzA3IDE1Ljc3NTQgNi4wNDQzOSAxNS40ODgxTDYuMDAwMjEgMTAuODE5OUM2LjAwMDIxIDEwLjgwNjUgNi4wMDY5IDEwLjc5NTEgNi4wMDc1NyAxMC43ODI0QzYuMDA4MjQgMTAuNzYzIDYuMDE0MjcgMTAuNzQ0MiA2LjAxODI4IDEwLjcyNDhDNi4wMjY5OSAxMC42NjA1IDYuMDQxMDUgMTAuNTk4OSA2LjA2ODQ5IDEwLjUzODZ