/** @param {string} mode */
export function normalizeIPForwardMode(mode) {
  if (mode === 'append' || mode === 'replace') return mode
  if (mode === 'proxy') return 'append'
  if (mode === 'real') return 'replace'
  return 'replace'
}

/** @param {string} mode @param {(key: string) => string} t */
export function ipForwardModeLabel(mode, t) {
  const key = normalizeIPForwardMode(mode)
  return t(`ipForward.${key}.label`)
}

/** @param {string} mode @param {(key: string) => string} t */
export function ipForwardModeHint(mode, t) {
  const key = normalizeIPForwardMode(mode)
  return t(`ipForward.${key}.hint`)
}
