//#region src/agent/tools/search/region.ts
const CHINA_TIMEZONES = new Set([
	"Asia/Shanghai",
	"Asia/Chongqing",
	"Asia/Harbin",
	"Asia/Urumqi",
	"Asia/Kashgar"
]);
/**
* Resolve region for HTML search fallback: explicit config → timezone → global.
*/
function resolveWebSearchRegion(web) {
	if (web?.region === "cn" || web?.region === "global") return web.region;
	try {
		const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
		if (timezone && CHINA_TIMEZONES.has(timezone)) return "cn";
	} catch {}
	return "global";
}
//#endregion
export { resolveWebSearchRegion };

//# sourceMappingURL=region.js.map