import { notReachable as i } from "../notReachable.js";
import { getDefaultIntentsToken as s } from "./getDefaultIntentsToken.js";
import { createTokenSorter as a } from "./sort.js";
const k = ({
  across: t,
  tokens: e,
  balances: n,
  supportedChains: o
}) => {
  if (Object.keys(n).length > 0)
    return e.filter((r) => {
      switch (t) {
        case "all":
          return !0;
        case "wallet":
          return !r.isIntent;
        case "intents":
          return r.isIntent;
        default:
          return i(t, { throwError: !1 }), !0;
      }
    }).sort(a(n, o))[0] ?? s({ tokens: e });
};
export {
  k as getTokenWithHighBalance
};
//# sourceMappingURL=getTokenWithHighBalance.js.map
