//#region src/plus/pisellReservation/data/associatedMenuListIdsFromOpenData.ts
/**
* 从 pico 开放数据解析餐牌 ID 列表（`menu.associated_menus` 常为 `{ label, value }[]`）。
*/
function mapAssociatedMenusToMenuListIds(openData) {
	var _o$menu, _ref, _ref2;
	if (!openData || typeof openData !== "object") return [];
	const o = openData;
	const menuSection = (_o$menu = o.menu) !== null && _o$menu !== void 0 ? _o$menu : o["menu"];
	const raw = (_ref = (_ref2 = menuSection && typeof menuSection === "object" && menuSection.associated_menus) !== null && _ref2 !== void 0 ? _ref2 : o["menu.associated_menus"]) !== null && _ref !== void 0 ? _ref : o.associated_menus;
	if (!Array.isArray(raw)) return [];
	const ids = [];
	for (const item of raw) if (item != null && typeof item === "object" && "value" in item) {
		const n = Number(item.value);
		if (Number.isFinite(n) && n > 0) ids.push(Math.floor(n));
	} else {
		const n = Number(item);
		if (Number.isFinite(n) && n > 0) ids.push(Math.floor(n));
	}
	return [...new Set(ids)];
}
//#endregion
export { mapAssociatedMenusToMenuListIds };
