import Zone from "../zone.mjs";
import SystemZone from "../zones/systemZone.mjs";
import IANAZone from "../zones/IANAZone.mjs";
import FixedOffsetZone from "../zones/fixedOffsetZone.mjs";
import InvalidZone from "../zones/invalidZone.mjs";
import { isNumber, isString, isUndefined } from "./util.mjs";

//#region ../../node_modules/.pnpm/luxon@3.5.0/node_modules/luxon/src/impl/zoneUtil.js
function normalizeZone(input, defaultZone) {
	if (isUndefined(input) || input === null) return defaultZone;
	else if (input instanceof Zone) return input;
	else if (isString(input)) {
		const lowered = input.toLowerCase();
		if (lowered === "default") return defaultZone;
		else if (lowered === "local" || lowered === "system") return SystemZone.instance;
		else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;
		else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
	} else if (isNumber(input)) return FixedOffsetZone.instance(input);
	else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") return input;
	else return new InvalidZone(input);
}

//#endregion
export { normalizeZone };
//# sourceMappingURL=zoneUtil.mjs.map