import isObject_default from "./isObject.js";
import isSymbol_default from "./isSymbol.js";
import _baseTrim_default from "./_baseTrim.js";
var NAN = NaN, reIsBadHex = /^[-+]0x[0-9a-f]+$/i, reIsBinary = /^0b[01]+$/i, reIsOctal = /^0o[0-7]+$/i, freeParseInt = parseInt;
function toNumber(c) {
	if (typeof c == "number") return c;
	if (isSymbol_default(c)) return NAN;
	if (isObject_default(c)) {
		var l = typeof c.valueOf == "function" ? c.valueOf() : c;
		c = isObject_default(l) ? l + "" : l;
	}
	if (typeof c != "string") return c === 0 ? c : +c;
	c = _baseTrim_default(c);
	var u = reIsBinary.test(c);
	return u || reIsOctal.test(c) ? freeParseInt(c.slice(2), u ? 2 : 8) : reIsBadHex.test(c) ? NAN : +c;
}
var toNumber_default = toNumber;
export { toNumber_default as default };
