<?php
namespace Prodigy\Includes\Frontend\Mappers;

use Prodigy\Includes\Prodigy_Elementor_Template_Loader;

/**
 * Prodigy search data mapper
 *
 * @version    2.8.6
 * @package    Prodigy
 * @subpackage Prodigy/includes
 */
class Prodigy_Search_Data_Mapper extends Prodigy_Main_Data_Mapper {

	/**
	 * @param array $options
	 *
	 * @return array
	 */
	public function get_default_parameters( array $options ): array {
		$icon_type = 'icon';
		if ( ! empty( $options['prg_style_search_icon']['value']['url'] ) ) {
			$icon_type = 'svg';
		}
		$icon_class  = $options['prg_style_search_icon']['value'] ?? 'icon icon-search';
		$placeholder = $options['prg_style_search_icon_placeholder'] ?? 'Search';
		$search_type = $options['type'] ?? 'normal';

		return array(
			'settings'                => $options,
			'customizer_shop_options' => $this->customizer_shop_options,
			'icon_class'              => $icon_class,
			'placeholder'             => $placeholder,
			'search_type'             => $search_type,
			'icon_type'               => $icon_type,
			'is_elementor_header'     => Prodigy_Elementor_Template_Loader::is_include_header_template(),
		);
	}
}
