import { z as isObject_default } from "./isArrayLikeObject-LXbTYiBa.js";
import { t as isSymbol_default } from "./isSymbol-DCbjQG_U.js";
var reWhitespace = /\s/;
function trimmedEndIndex(e) {
  for (var d = e.length; d-- && reWhitespace.test(e.charAt(d)); ) ;
  return d;
}
var _trimmedEndIndex_default = trimmedEndIndex, reTrimStart = /^\s+/;
function baseTrim(e) {
  return e && e.slice(0, _trimmedEndIndex_default(e) + 1).replace(reTrimStart, "");
}
var _baseTrim_default = baseTrim, NAN = NaN, reIsBadHex = /^[-+]0x[0-9a-f]+$/i, reIsBinary = /^0b[01]+$/i, reIsOctal = /^0o[0-7]+$/i, freeParseInt = parseInt;
function toNumber(f) {
  if (typeof f == "number") return f;
  if (isSymbol_default(f)) return NAN;
  if (isObject_default(f)) {
    var p = typeof f.valueOf == "function" ? f.valueOf() : f;
    f = isObject_default(p) ? p + "" : p;
  }
  if (typeof f != "string") return f === 0 ? f : +f;
  f = _baseTrim_default(f);
  var m = reIsBinary.test(f);
  return m || reIsOctal.test(f) ? freeParseInt(f.slice(2), m ? 2 : 8) : reIsBadHex.test(f) ? NAN : +f;
}
var toNumber_default = toNumber;
export {
  toNumber_default as t
};
