import { WarmUpPickerParams, getExperimentsCompat } from '@wix/bex-core';
import { ComponentHooksFlowAPI } from '@wix/yoshi-flow-bm';
import { buildBMCairoEssentials } from './buildBMCairoEssentials';
import { getErrorMonitorCompat } from './errorMonitorCompat';
import { warmUpPickerStandalone as warmUpPickerStandaloneBase } from '../state/warmUpPickerStandalone';

export function warmUpPickerStandalone(
  flowAPI: ComponentHooksFlowAPI,
  params: WarmUpPickerParams,
) {
  warmUpPickerStandaloneBase(
    buildBMCairoEssentials(
      {
        moduleParams: flowAPI.moduleParams,
        moduleInfo: flowAPI.moduleInfo,
        componentInfo: flowAPI.componentInfo,
        httpClient: flowAPI.httpClient,
        errorMonitor: getErrorMonitorCompat(flowAPI),
        experiments: getExperimentsCompat(flowAPI),
      },
      params,
    ),
    params,
  );
}
