import { getExtensionKey } from '../../../state/helpers';
import { getIsRovoChatEnabled } from '../../../utils/rovo';
const extractRovoChatAction = (response, rovoConfig, actionOptions) => {
  // Experiment cleanup note: platform_sl_3p_auth_rovo_action
  // If action is available by default, we need to allow RovoChatAction to be configurable to opt-out
  // if (!canShowAction(CardAction.RovoChatAction, actionOptions)) {
  // 	return;
  // }

  const isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
  if (!isRovoChatEnabled) {
    return;
  }

  // Experiment cleanup note: platform_sl_3p_auth_rovo_action
  // If feature isn't support all 3P, this value should come from meta.supportedFeature
  const isSupportedFeature = getExtensionKey(response) === 'google-object-provider';
  const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : actionOptions.rovoChatAction) === true;
  return isSupportedFeature && isOptIn ? true : undefined;
};
export default extractRovoChatAction;