/**
 * @param {number} messageType
 * @param {string|object} messageContent
 * @returns {any}
 */
export function parseMessageContent(messageType, messageContent) {
	// 与患者端一致：卡片类 JSON；3 视频可能是 URL 字符串或 { url }
	if ([3, 4, 9, 10, 11, 12, 13, 14].includes(messageType)) {
		try {
			return typeof messageContent === 'object' ? messageContent : JSON.parse(messageContent);
		} catch (e) {
			return messageContent;
		}
	}
	return messageContent;
}
