<?php

class AIOC_PricingCarouselItem extends ET_Builder_Module {

	public $slug       = 'aioc_pricing_carousel_item';
	public $type       = 'child';
	public $vb_support = 'on';

	protected $module_credits = array(
		'module_uri' => 'https://diviextended.com/product/all-in-one-carousel-for-divi',
		'author'     => 'Elicus',
		'author_uri' => 'http://elicus.com',
	);

	public function init() {
		$this->name                        = esc_html__( 'Pricing Carousel Item', 'all-in-one-carousel-for-divi' );
		$this->advanced_setting_title_text = esc_html__( 'Pricing', 'all-in-one-carousel-for-divi' );
		$this->child_title_var             = 'title';
		$this->main_css_element            = '.aioc_pricing_carousel %%order_class%%';
		if ( is_archive() ) {
			$this->main_css_element = '%%order_class%%';
		}
		add_filter( 'et_builder_processed_range_value', array( $this, 'aioc_builder_processed_range_value' ), 10, 3 );
	}


	public function get_settings_modal_toggles() {
		return array(
			'general'  => array(
				'toggles' => array(
					'main_content' => array(
						'title' => esc_html__( 'Content', 'all-in-one-carousel-for-divi' ),
					),
					'elements'     => array(
						'title' => esc_html__( 'Elements', 'all-in-one-carousel-for-divi' ),
					),
					'ribbon'       => array(
						'title' => esc_html__( 'Ribbon', 'all-in-one-carousel-for-divi' ),
					),
					'button'       => array(
						'title' => esc_html__( 'Button', 'all-in-one-carousel-for-divi' ),
					),
				),
			),
			'advanced' => array(
				'toggles' => array(
					'heading_settings' => array(
						'title'             => esc_html__( 'Heading', 'all-in-one-carousel-for-divi' ),
						'sub_toggles'       => array(
							'general'  => array(
								'name' => 'General',
							),
							'title'    => array(
								'name' => 'Title',
							),
							'subtitle' => array(
								'name' => 'Subtitle',
							),
						),
						'tabbed_subtoggles' => true,
					),
					'price_settings'   => array(
						'title'             => esc_html__( 'Price', 'all-in-one-carousel-for-divi' ),
						'sub_toggles'       => array(
							'general'  => array(
								'name' => 'General',
							),
							'price'    => array(
								'name' => 'Price',
							),
							'currency' => array(
								'name' => 'Currency',
							),
							'per'      => array(
								'name' => 'Frequency',
							),
						),
						'tabbed_subtoggles' => true,
					),
					'element_settings' => array(
						'title'             => esc_html__( 'Elements', 'all-in-one-carousel-for-divi' ),
						'sub_toggles'       => array(
							'general' => array(
								'name' => 'General',
							),
							'element' => array(
								'name' => 'Element',
							),
						),
						'tabbed_subtoggles' => true,
					),
					'content_settings' => array(
						'title'             => esc_html__( 'Content', 'all-in-one-carousel-for-divi' ),
						'sub_toggles'       => array(
							'general'       => array(
								'name' => 'General',
							),
							'content'       => array(
								'name' => 'List',
							),
							'excluded_text' => array(
								'name' => 'Excluded List',
							),
						),
						'tabbed_subtoggles' => true,
					),
					'bullet_settings'  => array(
						'title'             => esc_html__( 'Bullet', 'all-in-one-carousel-for-divi' ),
						'sub_toggles'       => array(
							'all_bullets'     => array(
								'name' => 'All Bullets',
							),
							'exclude_bullets' => array(
								'name' => 'Excluded Bullets',
							),
						),
						'tabbed_subtoggles' => true,
					),
					'ribbon'           => array(
						'title' => esc_html__( 'Ribbon', 'all-in-one-carousel-for-divi' ),
					),
					'button'           => array(
						'title' => esc_html__( 'Button', 'all-in-one-carousel-for-divi' ),
					),
				),
			),
		);
	}

	public function get_advanced_fields_config() {
		return array(
			'fonts'                        => array(
				'title'         => array(
					'label'          => esc_html__( 'Title', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default_on_front' => '1.2em',
						'range_settings'   => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default_on_front' => '',
						'range_settings'   => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'    => true,
					),
					'header_level'   => array(
						'default' => 'h4',
					),
					'css'            => array(
						'main'      => "{$this->main_css_element} .aioc_slide_title",
						'important' => 'all',
					),
					'tab_slug'       => 'advanced',
					'toggle_slug'    => 'heading_settings',
					'sub_toggle'     => 'title',
				),
				'subtitle'      => array(
					'label'          => esc_html__( 'Subtitle', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default_on_front' => '1.2em',
						'range_settings'   => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default_on_front' => '0px',
						'range_settings'   => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'    => true,
					),
					'css'            => array(
						'main'      => "{$this->main_css_element} .aioc_slide_subtitle",
						'important' => 'all',
					),
					'tab_slug'       => 'advanced',
					'toggle_slug'    => 'heading_settings',
					'sub_toggle'     => 'subtitle',
				),
				'content'       => array(
					'label'          => esc_html__( 'List', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '14px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'css'            => array(
						'main'      => "{$this->main_css_element} .aioc_pricing_content, {$this->main_css_element} .aioc_pricing_content li",
						'important' => 'all',
					),
					'tab_slug'       => 'advanced',
					'toggle_slug'    => 'content_settings',
					'sub_toggle'     => 'content',
				),
				'excluded_text' => array(
					'label'          => esc_html__( 'Excluded', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '14px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'css'            => array(
						'main'      => "{$this->main_css_element} .aioc_pricing_content ul li.aioc_not_available",
						'important' => 'all',
					),
					'tab_slug'       => 'advanced',
					'toggle_slug'    => 'content_settings',
					'sub_toggle'     => 'excluded_text',
				),
				'ribbon'        => array(
					'label'           => esc_html__( 'Ribbon', 'all-in-one-carousel-for-divi' ),
					'font_size'       => array(
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'     => array(
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing'  => array(
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'css'             => array(
						'main'      => "{$this->main_css_element} .aioc_slide_ribbon",
						'important' => 'all',
					),
					'hide_text_align' => true,
					'tab_slug'        => 'advanced',
					'toggle_slug'     => 'ribbon',
				),
				'price'         => array(
					'label'           => esc_html__( 'Price', 'all-in-one-carousel-for-divi' ),
					'font_size'       => array(
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'     => array(
						'default_on_front' => '1.2em',
						'range_settings'   => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing'  => array(
						'default_on_front' => '',
						'range_settings'   => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'    => true,
					),
					'css'             => array(
						'main'      => "{$this->main_css_element} .aioc_slide_price",
						'important' => 'all',
					),
					'hide_text_align' => true,
					'tab_slug'        => 'advanced',
					'toggle_slug'     => 'price_settings',
					'sub_toggle'      => 'price',
				),
				'currency'      => array(
					'label'           => esc_html__( 'Currency', 'all-in-one-carousel-for-divi' ),
					'font_size'       => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'     => array(
						'default_on_front' => '1.2em',
						'range_settings'   => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing'  => array(
						'default_on_front' => '',
						'range_settings'   => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'    => true,
					),
					'css'             => array(
						'main'      => "{$this->main_css_element} .aioc_slide_currency_sign",
						'important' => 'all',
					),
					'hide_text_align' => true,
					'tab_slug'        => 'advanced',
					'toggle_slug'     => 'price_settings',
					'sub_toggle'      => 'currency',
				),
				'per'           => array(
					'label'           => esc_html__( 'Frequency', 'all-in-one-carousel-for-divi' ),
					'font_size'       => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'     => array(
						'default_on_front' => '1.2em',
						'range_settings'   => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing'  => array(
						'default_on_front' => '',
						'range_settings'   => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'    => true,
					),
					'css'             => array(
						'main'      => "{$this->main_css_element} .aioc_slide_frequency",
						'important' => 'all',
					),
					'hide_text_align' => true,
					'tab_slug'        => 'advanced',
					'toggle_slug'     => 'price_settings',
					'sub_toggle'      => 'per',
				),
			),
			'margin_padding'               => array(
				'css' => array(
					'main'      => '%%order_class%% .aioc_slide_wrapper',
					'important' => 'all',
				),
			),
			'slide_content_margin_padding' => array(
				'elements' => array(
					'margin_padding' => array(
						'css' => array(
							'margin'    => false,
							'padding'   => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_elements',
							'important' => 'all',
						),
					),
				),
				'heading'  => array(
					'margin_padding' => array(
						'css' => array(
							'margin'    => false,
							'padding'   => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_heading',
							'important' => 'all',
						),
					),
				),
				'price'    => array(
					'margin_padding' => array(
						'css' => array(
							'margin'    => false,
							'padding'   => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content_top',
							'important' => 'all',
						),
					),
				),
				'content'  => array(
					'margin_padding' => array(
						'css' => array(
							'margin'    => false,
							'padding'   => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content',
							'important' => 'all',
						),
					),
				),
			),
			'button'                       => array(
				'button' => array(
					'label'          => esc_html__( 'Button', 'all-in-one-carousel-for-divi' ),
					'css'            => array(
						'main'      => "{$this->main_css_element} .et_pb_button",
						'alignment' => "{$this->main_css_element} .aioc_pricing_button_wrapper",
						'important' => 'all',
					),
					'margin_padding' => array(
						'custom_margin' => array(
							'default_on_front' => '20px|20px|20px|20px|false|false',
						),
						'css'           => array(
							'margin'    => "{$this->main_css_element} .aioc_pricing_button_wrapper",
							'padding'   => "{$this->main_css_element} .et_pb_button",
							'important' => 'all',
						),
					),
					'border_width'   => array(
						'default' => '2px',
					),
					'box_shadow'     => false,
					'tab_slug'       => 'advanced',
					'toggle_slug'    => 'button',
				),
			),
			'max_width'                    => array(
				'default' => array(
					'css' => array(
						'main'             => '%%order_class%%',
						'module_alignment' => '%%order_class%%',
					),
				),
			),
			'height'                       => array(
				'css' => array(
					'main'      => '%%order_class%%',
					'important' => 'all',
				),
			),
			'borders'                      => array(
				'default' => array(
					'css'      => array(
						'main'      => array(
							'border_styles' => '%%order_class%% .aioc_slide_wrapper',
							'border_radii'  => '%%order_class%% .aioc_slide_wrapper',
						),
						'important' => 'all',
					),
					'defaults' => array(
						'border_radii'  => 'on||||',
						'border_styles' => array(
							'width' => '1px',
							'color' => '#bebebe',
							'style' => 'solid',
						),
					),
				),
				'label'   => array(
					'css'         => array(
						'main'      => array(
							'border_styles' => '%%order_class%% .aioc_slide_label',
							'border_radii'  => '%%order_class%% .aioc_slide_label',
						),
						'important' => 'all',
					),
					'tab_slug'    => 'advanced',
					'toggle_slug' => 'label',
				),
			),
			'box_shadow'                   => array(
				'label'   => array(
					'css'         => array(
						'main'      => '%%order_class%% .aioc_slide_label',
						'important' => 'all',
					),
					'tab_slug'    => 'advanced',
					'toggle_slug' => 'label',
				),
				'default' => array(
					'css' => array(
						'main' => '%%order_class%% .aioc_slide_wrapper',
					),
				),
			),
			'background'                   => array(
				'css' => array(
					'main' => '%%order_class%% .aioc_slide_wrapper',
				),
			),
			'text'                         => false,
			'filters'                      => false,
			'text_shadow'                  => false,
		);
	}

	public function get_fields() {
		return array(
			'title'                    => array(
				'label'           => esc_html__( 'Title', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text',
				'option_category' => 'basic_option',
				'tab_slug'        => 'general',
				'toggle_slug'     => 'main_content',
				'description'     => esc_html__( 'Here you can input the text to be used for the title.', 'all-in-one-carousel-for-divi' ),
			),
			'subtitle'                 => array(
				'label'           => esc_html__( 'Subtitle', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text',
				'option_category' => 'basic_option',
				'tab_slug'        => 'general',
				'toggle_slug'     => 'main_content',
				'description'     => esc_html__( 'Here you can input the text to be used for the subtitle.', 'all-in-one-carousel-for-divi' ),
			),
			'currency'                 => array(
				'label'           => esc_html__( 'Currency', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text',
				'option_category' => 'basic_option',
				'description'     => esc_html__( 'Input your desired currency symbol here.', 'all-in-one-carousel-for-divi' ),
				'mobile_options'  => true,
				'hover'           => 'tabs',
				'tab_slug'        => 'general',
				'toggle_slug'     => 'main_content',
			),
			'per'                      => array(
				'label'           => esc_html__( 'Frequency', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text',
				'option_category' => 'basic_option',
				'description'     => esc_html__( 'If your pricing is subscription based, input the subscription payment cycle here.', 'all-in-one-carousel-for-divi' ),
				'mobile_options'  => true,
				'hover'           => 'tabs',
				'tab_slug'        => 'general',
				'toggle_slug'     => 'main_content',
			),
			'price'                    => array(
				'label'           => esc_html__( 'Price', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text',
				'option_category' => 'basic_option',
				'description'     => esc_html__( 'Input the value of the product here.', 'all-in-one-carousel-for-divi' ),
				'mobile_options'  => true,
				'hover'           => 'tabs',
				'tab_slug'        => 'general',
				'toggle_slug'     => 'main_content',
			),
			'content'                  => array(
				'label'           => esc_html__( 'Content', 'all-in-one-carousel-for-divi' ),
				'type'            => 'tiny_mce',
				'option_category' => 'basic_option',
				'toggle_slug'     => 'main_content',
				'description'     => sprintf(
					'%1$s<br/> + %2$s<br/> - %3$s',
					esc_html__( 'Input a list of features that are/are not included in the product. Separate items on a new line, and begin with either a + or - symbol: ', 'all-in-one-carousel-for-divi' ),
					esc_html__( 'Included option', 'all-in-one-carousel-for-divi' ),
					esc_html__( 'Excluded option', 'all-in-one-carousel-for-divi' )
				),
			),
			'element_type'             => array(
				'label'            => esc_html__( 'Element Type', 'all-in-one-carousel-for-divi' ),
				'type'             => 'select',
				'option_category'  => 'configuration',
				'options'          => array(
					'icon'  => esc_html__( 'Icon', 'all-in-one-carousel-for-divi' ),
					'image' => esc_html__( 'Image', 'all-in-one-carousel-for-divi' ),
				),
				'affects'          => array(
					'border_radii_image',
				),
				'default'          => 'icon',
				'default_on_front' => 'icon',
				'tab_slug'         => 'general',
				'toggle_slug'      => 'elements',
				'description'      => esc_html__( 'Here you can select the element type.', 'all-in-one-carousel-for-divi' ),
			),
			'image'                    => array(
				'label'              => esc_html__( 'Image', 'all-in-one-carousel-for-divi' ),
				'type'               => 'upload',
				'option_category'    => 'basic_option',
				'upload_button_text' => esc_attr__( 'Upload an image', 'all-in-one-carousel-for-divi' ),
				'choose_text'        => esc_attr__( 'Choose an Image', 'all-in-one-carousel-for-divi' ),
				'update_text'        => esc_attr__( 'Set As Image', 'all-in-one-carousel-for-divi' ),
				'dynamic_content'    => 'image',
				'show_if'            => array(
					'element_type' => 'image',
				),
				'tab_slug'           => 'general',
				'toggle_slug'        => 'elements',
				'description'        => esc_html__( 'Upload an image to display.', 'all-in-one-carousel-for-divi' ),
			),
			'image_alt'                => array(
				'label'           => esc_html__( 'Image Alt Text', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text',
				'option_category' => 'basic_option',
				'show_if'         => array(
					'element_type' => 'image',
				),
				'tab_slug'        => 'general',
				'toggle_slug'     => 'elements',
				'description'     => esc_html__( 'Here you can input the text to be used for the image as HTML ALT text.', 'all-in-one-carousel-for-divi' ),
			),
			'icon'                     => array(
				'label'           => esc_html__( 'Icon', 'all-in-one-carousel-for-divi' ),
				'type'            => 'select_icon',
				'option_category' => 'basic_option',
				'class'           => array(
					'et-pb-font-icon',
				),
				'show_if'         => array(
					'element_type' => 'icon',
				),
				'tab_slug'        => 'general',
				'toggle_slug'     => 'elements',
				'description'     => esc_html__( 'Choose an icon to display.', 'all-in-one-carousel-for-divi' ),
			),
			'ribbon_text'              => array(
				'label'           => esc_html__( 'Ribbon', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text',
				'option_category' => 'basic_option',
				'tab_slug'        => 'general',
				'toggle_slug'     => 'ribbon',
				'description'     => esc_html__( 'Here you can input the text to be used for the ribbon.', 'all-in-one-carousel-for-divi' ),
			),
			'button_text'              => array(
				'label'            => esc_html__( 'Button Text', 'all-in-one-carousel-for-divi' ),
				'type'             => 'text',
				'option_category'  => 'basic_option',
				'default'          => esc_html__( 'Read More', 'all-in-one-carousel-for-divi' ),
				'default_on_front' => esc_html__( 'Read More', 'all-in-one-carousel-for-divi' ),
				'tab_slug'         => 'general',
				'toggle_slug'      => 'button',
				'description'      => esc_html__( 'Here you can input the text to be used for the Button.', 'all-in-one-carousel-for-divi' ),
			),
			'button_url'               => array(
				'label'            => esc_html__( 'Url', 'all-in-one-carousel-for-divi' ),
				'type'             => 'text',
				'option_category'  => 'basic_option',
				'default'          => '#',
				'default_on_front' => '#',
				'dynamic_content'  => 'url',
				'tab_slug'         => 'general',
				'toggle_slug'      => 'button',
				'description'      => esc_html__( 'Here you can input the URL that you want to open when the user clicks on the button.', 'all-in-one-carousel-for-divi' ),
			),
			'button_url_new_window'    => array(
				'label'            => esc_html__( 'Link Target', 'all-in-one-carousel-for-divi' ),
				'type'             => 'select',
				'option_category'  => 'configuration',
				'options'          => array(
					'off' => esc_html__( 'In The Same Window', 'all-in-one-carousel-for-divi' ),
					'on'  => esc_html__( 'In The New Tab', 'all-in-one-carousel-for-divi' ),
				),
				'default'          => 'off',
				'default_on_front' => 'off',
				'tab_slug'         => 'general',
				'toggle_slug'      => 'button',
				'description'      => esc_html__( 'Here you can choose whether or not the link opens in a new window.', 'all-in-one-carousel-for-divi' ),
			),
			'bullet_spacing'           => array(
				'label'           => esc_html__( 'Bullet Spacing', 'all-in-one-carousel-for-divi' ),
				'type'            => 'range',
				'option_category' => 'font_option',
				'range_settings'  => array(
					'min'  => '1',
					'max'  => '120',
					'step' => '1',
				),
				'mobile_options'  => true,
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'bullet_settings',
				'sub_toggle'      => 'all_bullets',
				'description'     => esc_html__( 'Control the spacing between icon and list .', 'all-in-one-carousel-for-divi' ),
			),
			'bullet_color'             => array(
				'label'          => esc_html__( 'Bullet Color', 'all-in-one-carousel-for-divi' ),
				'description'    => esc_html__( "Pick a color to use for the bullets that appear next to each list item within the pricing table's feature area.", 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug'       => 'advanced',
				'toggle_slug'    => 'bullet_settings',
				'sub_toggle'     => 'all_bullets',
			),
			'exclude_bullet_color'     => array(
				'label'          => esc_html__( 'Excluded Bullet Color', 'all-in-one-carousel-for-divi' ),
				'description'    => esc_html__( "Pick a color to use for the excluded bullets that appear next to each list item within the pricing table's feature area.", 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug'       => 'advanced',
				'toggle_slug'    => 'bullet_settings',
				'sub_toggle'     => 'exclude_bullets',
			),
			'price_align'              => array(
				'label'           => esc_html__( 'Price Alignment', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text_align',
				'option_category' => 'layout',
				'options'         => et_builder_get_text_orientation_options( array( 'justified' ) ),
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'price_settings',
				'sub_toggle'      => 'general',
				'description'     => esc_html__( 'Here you can choose the price alignment.', 'all-in-one-carousel-for-divi' ),
				'options_icon'    => 'module_align',
			),
			'price_custom_padding'     => array(
				'label'           => esc_html__( 'Price Padding', 'all-in-one-carousel-for-divi' ),
				'type'            => 'custom_padding',
				'option_category' => 'layout',
				'mobile_options'  => true,
				'hover'           => false,
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'price_settings',
				'sub_toggle'      => 'general',
				'description'     => esc_html__( 'Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'all-in-one-carousel-for-divi' ),
			),
			'price_background_color'   => array(
				'label'          => esc_html__( 'Pricing Area Background Color', 'all-in-one-carousel-for-divi' ),
				'description'    => esc_html__( 'Pick a color to use for the background area that appears behind the pricing text.', 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'priority'       => 5,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug'       => 'advanced',
				'toggle_slug'    => 'price_settings',
				'sub_toggle'     => 'general',
			),
			'price_border_color'       => array(
				'label'          => esc_html__( 'Price Separator Color', 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug'       => 'advanced',
				'toggle_slug'    => 'price_settings',
				'sub_toggle'     => 'general',
				'description'    => esc_html__( 'Here you can select price border bottom color.', 'all-in-one-carousel-for-divi' ),
			),
			'heading_custom_padding'   => array(
				'label'           => esc_html__( 'Heading Area Padding', 'all-in-one-carousel-for-divi' ),
				'type'            => 'custom_padding',
				'option_category' => 'layout',
				'mobile_options'  => true,
				'hover'           => false,
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'heading_settings',
				'sub_toggle'      => 'general',
				'description'     => esc_html__( 'Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'all-in-one-carousel-for-divi' ),
			),
			'heading_background_color' => array(
				'label'        => esc_html__( 'Heading Area Background', 'all-in-one-carousel-for-divi' ),
				'type'         => 'color-alpha',
				'custom_color' => true,
				'hover'        => 'tabs',
				'tab_slug'     => 'advanced',
				'toggle_slug'  => 'heading_settings',
				'sub_toggle'   => 'general',
				'description'  => esc_html__( 'Here you can choose a custom color to be used for the header background.', 'all-in-one-carousel-for-divi' ),
			),
			'heading_border_color'     => array(
				'label'          => esc_html__( 'Heading Separator Color', 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug'       => 'advanced',
				'toggle_slug'    => 'heading_settings',
				'sub_toggle'     => 'general',
				'description'    => esc_html__( 'Here you can select heading border bottom color.', 'all-in-one-carousel-for-divi' ),
			),
			'elements_align'           => array(
				'label'           => esc_html__( 'Elements Alignment', 'all-in-one-carousel-for-divi' ),
				'type'            => 'text_align',
				'option_category' => 'layout',
				'options'         => et_builder_get_text_orientation_options( array( 'justified' ) ),
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'element_settings',
				'sub_toggle'      => 'general',
				'description'     => esc_html__( 'Here you can choose global alignment.', 'all-in-one-carousel-for-divi' ),
				'options_icon'    => 'module_align',
			),
			'elements_custom_padding'  => array(
				'label'           => esc_html__( 'Element Area Padding', 'all-in-one-carousel-for-divi' ),
				'type'            => 'custom_padding',
				'option_category' => 'layout',
				'mobile_options'  => true,
				'hover'           => false,
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'element_settings',
				'sub_toggle'      => 'general',
				'description'     => esc_html__( 'Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'all-in-one-carousel-for-divi' ),
			),
			/*
			'elements_border_color'            => array(
				'label'          => esc_html__( 'Elements border Color', 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug'              => 'advanced',
				'toggle_slug'  			=> 'element_settings',
				'sub_toggle' 			=> 'general',
				'description'      => esc_html__( 'Here you can select elements border bottom color.', 'all-in-one-carousel-for-divi' ),
			),
			*/
			'icon_font_size'           => array(
				'label'           => esc_html__( 'Icon Font Size', 'all-in-one-carousel-for-divi' ),
				'type'            => 'range',
				'option_category' => 'font_option',
				'range_settings'  => array(
					'min'  => '1',
					'max'  => '120',
					'step' => '1',
				),
				'show_if'         => array(
					'element_type' => 'icon',
				),
				'mobile_options'  => true,
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'element_settings',
				'sub_toggle'      => 'element',
				'description'     => esc_html__( 'Control the size of the icon by increasing or decreasing the font size.', 'all-in-one-carousel-for-divi' ),
			),
			'icon_color'               => array(
				'label'          => esc_html__( 'Icon Color', 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'hover'          => 'tabs',
				'mobile_options' => true,
				'show_if'        => array(
					'element_type' => 'icon',
				),
				'tab_slug'       => 'advanced',
				'toggle_slug'    => 'element_settings',
				'sub_toggle'     => 'element',
				'description'    => esc_html__( 'Here you can define a custom color for your icon.', 'all-in-one-carousel-for-divi' ),
			),
			'image_width'              => array(
				'label'           => esc_html__( 'Image Width', 'all-in-one-carousel-for-divi' ),
				'description'     => esc_html__( 'Adjust the image width within the slide.', 'all-in-one-carousel-for-divi' ),
				'type'            => 'range',
				'option_category' => 'layout',
				'default_unit'    => '%',
				'allowed_units'   => array( '%', 'em', 'rem', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ex', 'vh', 'vw' ),
				'range_settings'  => array(
					'min'  => '1',
					'max'  => '100',
					'step' => '1',
				),
				'show_if'         => array(
					'element_type' => 'image',
				),
				'mobile_options'  => true,
				'sticky'          => true,
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'element_settings',
				'sub_toggle'      => 'element',
			),
			'content_custom_padding'   => array(
				'label'            => esc_html__( 'Content Area Padding', 'all-in-one-carousel-for-divi' ),
				'type'             => 'custom_padding',
				'option_category'  => 'layout',
				'mobile_options'   => true,
				'hover'            => false,
				'default'          => '||||true|true',
				'default_on_front' => '||||true|true',
				'tab_slug'         => 'advanced',
				'toggle_slug'      => 'content_settings',
				'sub_toggle'       => 'general',
				'description'      => esc_html__( 'Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'all-in-one-carousel-for-divi' ),
			),
			/*
			'content_border_color'            => array(
				'label'          => esc_html__( 'Content border Color', 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug' => 'advanced',
				'toggle_slug' => 'content_settings',
				'sub_toggle' => 'general',
				'description'      => esc_html__( 'Here you can select content border bottom color.', 'all-in-one-carousel-for-divi' ),
			),
			*/
			'bullet_icon'              => array(
				'label'           => esc_html__( 'Include Icon', 'all-in-one-carousel-for-divi' ),
				'type'            => 'select_icon',
				'option_category' => 'basic_option',
				'class'           => array(
					'et-pb-font-icon',
				),
				'default'         => ET_BUILDER_PRODUCT_VERSION < '4.13.0' ? '%%61%%' : '&#x5e;||divi||400',
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'bullet_settings',
				'sub_toggle'      => 'all_bullets',
				'description'     => esc_html__( 'Choose an include icon to display.', 'all-in-one-carousel-for-divi' ),
			),
			'exclude_icon'             => array(
				'label'           => esc_html__( 'Exclude Icon', 'all-in-one-carousel-for-divi' ),
				'type'            => 'select_icon',
				'option_category' => 'basic_option',
				'class'           => array(
					'et-pb-font-icon',
				),
				'default'         => ET_BUILDER_PRODUCT_VERSION < '4.13.0' ? '%%44%%' : '&#x4d;||divi||400',
				'tab_slug'        => 'advanced',
				'toggle_slug'     => 'bullet_settings',
				'sub_toggle'      => 'exclude_bullets',
				'description'     => esc_html__( 'Choose an exclude icon to display.', 'all-in-one-carousel-for-divi' ),
			),
			'ribbon_bg_color'          => array(
				'label'          => esc_html__( 'Ribbon Background Color', 'all-in-one-carousel-for-divi' ),
				'type'           => 'color-alpha',
				'custom_color'   => true,
				'hover'          => 'tabs',
				'mobile_options' => true,
				'sticky'         => true,
				'tab_slug'       => 'advanced',
				'toggle_slug'    => 'ribbon',
				'description'    => esc_html__( 'Here you can select ribbon background color.', 'all-in-one-carousel-for-divi' ),
			),
		);

	}

	public function render( $attrs, $content, $render_slug ) {
		global $slide_effect;

		$multi_view           = et_pb_multi_view_options( $this );
		$currency             = $this->props['currency'];
		$per                  = $this->props['per'];
		$price                = $this->props['price'];
		$heading_border_color = $this->props['heading_border_color'];
		$price_border_color   = $this->props['price_border_color'];
		$price_align          = $this->props['price_align'];
		$elements_align       = $this->props['elements_align'];
		$element_type         = $this->props['element_type'];
		$bullet_spacing       = $this->props['bullet_spacing'];
		$ribbon_bg_color      = $this->props['ribbon_bg_color'];

		$button_text           = sprintf( esc_html__( '%s', 'all-in-one-carousel-for-divi' ), $this->props['button_text'] );
		$button_url_new_window = $this->props['button_url_new_window'];
		$image_alt             = sprintf( esc_html__( '%s', 'all-in-one-carousel-for-divi' ), $this->props['image_alt'] );
		$slide_border_radius   = '' !== $this->props['border_radii'] ? explode( '|', $this->props['border_radii'] ) : '';
		$title_level           = $this->props['title_level'];
		$processed_title_level = et_pb_process_header_level( $title_level, 'h4' );
		$processed_title_level = esc_html( $processed_title_level );
		$bullet_icon           = $exclude_icon = '';

		$icon_classes = implode(
			' ',
			array(
				'aioc_pricing_carousel_icon',
				'et-pb-icon',
			)
		);

		$image = $multi_view->render_element(
			array(
				'tag'      => 'img',
				'attrs'    => array(
					'src'          => '{{image}}',
					'data-mfp-src' => '{{image}}',
					'class'        => 'aioc_slide_image',
					'alt'          => $image_alt,
				),
				'required' => 'image',
			)
		);

		$icon = $multi_view->render_element(
			array(
				'content'  => '{{icon}}',
				'attrs'    => array(
					'class' => $icon_classes,
				),
				'required' => 'icon',
			)
		);

		$title = $multi_view->render_element(
			array(
				'tag'      => $processed_title_level,
				'content'  => '{{title}}',
				'attrs'    => array(
					'class' => 'aioc_slide_title',
				),
				'required' => 'title',
			)
		);

		$subtitle = $multi_view->render_element(
			array(
				'tag'      => 'span',
				'content'  => '{{subtitle}}',
				'attrs'    => array(
					'class' => 'aioc_slide_subtitle',
				),
				'required' => 'subtitle',
			)
		);

		$currency = $multi_view->render_element(
			array(
				'content' => '{{currency}}',
				'attrs'   => array(
					'class' => 'aioc_slide_currency_sign',
				),
			)
		);

		$per = $multi_view->render_element(
			array(
				'content'  => '{{per}}',
				'required' => 'per',
			)
		);

		$price = $multi_view->render_element(
			array(
				'tag'      => 'span',
				'content'  => '{{price}}',
				'attrs'    => array(
					'class' => 'aioc_slide_price',
				),
				'required' => 'price',
			)
		);

		$content = $multi_view->render_element(
			array(
				'tag'      => 'ul',
				'content'  => '{{content}}',
				'attrs'    => array(
					'class' => 'aioc_slide_content',
				),
				'required' => 'content',
			)
		);

		$ribbon = $multi_view->render_element(
			array(
				'tag'      => 'span',
				'content'  => '{{ribbon_text}}',
				'attrs'    => array(
					'class' => 'aioc_slide_ribbon',
				),
				'required' => 'ribbon_text',
			)
		);

		$button = $this->render_button(
			array(
				'display_button'      => '' !== $this->props['button_url'] ? true : false,
				'button_text'         => $button_text,
				'button_text_escaped' => true,
				'has_wrapper'         => false,
				'button_url'          => esc_url( $this->props['button_url'] ),
				'url_new_window'      => esc_attr( $this->props['button_url_new_window'] ),
				'button_custom'       => isset( $this->props['custom_button'] ) ? esc_attr( $this->props['custom_button'] ) : 'off',
				'custom_icon'         => isset( $this->props['button_icon'] ) ? $this->props['button_icon'] : '',
				'button_rel'          => isset( $this->props['button_rel'] ) ? esc_attr( $this->props['button_rel'] ) : '',
			)
		);

		if ( isset( $this->props['button_icon'] ) ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '%%order_class%% .aioc_pricing_button_wrapper .et_pb_button::after',
					'declaration' => 'content: attr(data-icon);',
				)
			);
		}

		if ( '' !== $image || '' !== $icon ) {
			$element_wrapper = sprintf(
				'<div class="aioc_pricing_elements">%1$s%2$s</div>',
				'' !== $image ? '<div class="aioc_slide_image_wrapper">' . et_core_intentionally_unescaped( $image, 'html' ) . '</div>' : '',
				et_core_intentionally_unescaped( $icon, 'html' )
			);
		}

		if ( '' !== $currency || '' !== $price || '' !== $per ) {
			$price_wrapper = sprintf(
				'<div class="aioc_pricing_content_top">
				<div class="aioc_price_wrapper">
				%1$s%2$s%3$s
				</div>
				</div>',
				et_core_intentionally_unescaped( $currency, 'html' ),
				et_core_intentionally_unescaped( $price, 'html' ),
				'' !== $per ? '<span class="aioc_slide_frequency"><span class="aioc_frequency_slash">/</span>' . et_core_intentionally_unescaped( $per, 'html' ) . '</span>' : ''
			);
		}

		if ( '' !== $this->props['bullet_icon'] ) {
			$bullet_icon = ' data-icon="' . esc_attr( et_pb_process_font_icon( $this->props['bullet_icon'] ) ) . '"';
		}
		if ( '' !== $this->props['exclude_icon'] ) {
			$exclude_icon = ' data-icon="' . esc_attr( et_pb_process_font_icon( $this->props['exclude_icon'] ) ) . '"';
		}

		$items             = '';
		$extracted_content = $this->aioc_extract_pricing_items( $this->props['content'] );
		foreach ( $extracted_content as $item ) {
			$availability_class = ( $item['available'] === 'off' ) ? 'class="aioc_not_available"' : '';
			// $item_icon = ( $item['available'] === 'off' ) ? $exclude_icon : $bullet_icon;
			$item_icon = ( $exclude_icon === '' && $bullet_icon !== '' ) ? $bullet_icon : ( $item['available'] === 'off' ? $exclude_icon : $bullet_icon );

			$items .= sprintf(
				'<li %1$s%2$s>%3$s</li>',
				$availability_class,
				$item_icon,
				$item['content']
			);
		}

		if ( '' !== $title || '' !== $subtitle ) {
			$heading_wrapper = sprintf(
				'<div class="aioc_pricing_heading">%1$s%2$s</div>',
				et_core_intentionally_unescaped( $title, 'html' ),
				et_core_intentionally_unescaped( $subtitle, 'html' )
			);
		}

		if ( '' !== $ribbon || isset( $heading_wrapper ) || isset( $price_wrapper ) || isset( $element_wrapper ) || '' !== $items || '' !== $button ) {
			$content_wrapper = sprintf(
				'<div class="aioc_slide_content_wrapper">
					%1$s
					%2$s
					%3$s
					%4$s
					%5$s
					<div class="aioc_pricing_button_wrapper">%6$s</div>
				</div>',
				et_core_intentionally_unescaped( $ribbon, 'html' ),
				isset( $heading_wrapper ) ? et_core_intentionally_unescaped( $heading_wrapper, 'html' ) : '',
				isset( $price_wrapper ) ? et_core_intentionally_unescaped( $price_wrapper, 'html' ) : '',
				isset( $element_wrapper ) ? et_core_intentionally_unescaped( $element_wrapper, 'html' ) : '',
				'' !== $items ? '<div class="aioc_pricing_content"><ul class="aioc_pricing_items">' . et_core_intentionally_unescaped( $items, 'html' ) . '</ul></div>' : '',
				et_core_intentionally_unescaped( $button, 'html' )
			);
		}

		if ( isset( $content_wrapper ) ) {
			$slide_wrapper = sprintf(
				'<div class="aioc_slide_wrapper">%1$s</div>',
				isset( $content_wrapper ) ? et_core_intentionally_unescaped( $content_wrapper, 'html' ) : ''
			);
		} else {
			$slide_wrapper = '';
		}

		if ( ! isset( $content_wrapper ) ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '%%order_class%% .aioc_slide_image_wrapper',
					'declaration' => 'height: 100%;',
				)
			);
		}

		if ( 'coverflow' === $slide_effect && '' !== $slide_border_radius ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '%%order_class%% .aioc_slide_content_wrapper',
					'declaration' => sprintf(
						'border-radius: %1$s %2$s %3$s %4$s;',
						esc_attr( $slide_border_radius[1] ),
						esc_attr( $slide_border_radius[2] ),
						esc_attr( $slide_border_radius[3] ),
						esc_attr( $slide_border_radius[4] )
					),
				)
			);
		}

		// Price Alignment
		if ( 'left' === $price_align ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content_top',
					'declaration' => 'text-align: left;',
				)
			);
		}
		if ( 'center' === $price_align ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content_top',
					'declaration' => 'text-align: center;',
				)
			);
		}
		if ( 'right' === $price_align ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content_top',
					'declaration' => 'text-align: right;',
				)
			);
		}

		// Elements Alignment
		if ( 'left' === $elements_align ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_elements',
					'declaration' => 'text-align: left;',
				)
			);
		}
		if ( 'center' === $elements_align ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_elements',
					'declaration' => 'text-align: center;',
				)
			);
		}
		if ( 'right' === $elements_align ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_elements',
					'declaration' => 'text-align: right;',
				)
			);
		}

		// Image Width
		if ( isset( $this->props['image_width'] ) && '' !== $this->props['image_width'] ) {
			$this->generate_styles(
				array(
					'hover'                           => false,
					'base_attr_name'                  => 'image_width',
					'selector'                        => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_elements .aioc_slide_image',
					'sticky_pseudo_selector_location' => 'prefix',
					'css_property'                    => 'width',
					'important'                       => true,
					'render_slug'                     => esc_attr( $render_slug ),
					'type'                            => 'range',
				)
			);
		}

		$this->generate_styles(
			array(
				'hover'                           => false,
				'base_attr_name'                  => 'bullet_spacing',
				'selector'                        => '%%order_class%% .aioc_pricing_content li:before',
				'sticky_pseudo_selector_location' => 'prefix',
				'css_property'                    => 'padding-right',
				'important'                       => true,
				'render_slug'                     => esc_attr( $render_slug ),
				'type'                            => 'range',
			)
		);

		// Bullet color.
		$this->generate_styles(
			array(
				'base_attr_name' => 'bullet_color',
				'selector'       => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content ul li:before',
				'hover_selector' => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content ul:hover li:before',
				'css_property'   => 'color',
				'render_slug'    => esc_attr( $render_slug ),
				'type'           => 'color',
			)
		);

		// Excluded Bullet color.
		$this->generate_styles(
			array(
				'base_attr_name' => 'exclude_bullet_color',
				'selector'       => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content ul li.aioc_not_available:before',
				'hover_selector' => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content ul:hover li.aioc_not_available:before',
				'css_property'   => 'color',
				'render_slug'    => esc_attr( $render_slug ),
				'type'           => 'color',
			)
		);

		// Header Bg Color
		$this->generate_styles(
			array(
				'base_attr_name' => 'heading_background_color',
				'selector'       => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_heading',
				'hover_selector' => '.aioc_pricing_carousel %%order_class%%:hover .aioc_pricing_heading',
				'css_property'   => 'background-color',
				'important'      => true,
				'render_slug'    => esc_attr( $render_slug ),
				'type'           => 'color',
			)
		);

		if ( '' !== $heading_border_color ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_heading',
					'declaration' => sprintf(
						'border-bottom: 1px solid %1$s !important;',
						esc_attr( $heading_border_color )
					),
				)
			);
		}

		// Price Bg Color
		$this->generate_styles(
			array(
				'base_attr_name' => 'price_background_color',
				'selector'       => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content_top',
				'hover_selector' => '.aioc_pricing_carousel %%order_class%%:hover .aioc_pricing_content_top',
				'css_property'   => 'background-color',
				'important'      => true,
				'render_slug'    => esc_attr( $render_slug ),
				'type'           => 'color',
			)
		);

		if ( '' !== $price_border_color ) {
			self::set_style(
				$render_slug,
				array(
					'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_content_top',
					'declaration' => sprintf(
						'border-bottom: 1px solid %1$s !important;',
						esc_attr( $price_border_color )
					),
				)
			);
		}

		if ( '' !== $ribbon ) {
			if ( '' !== $ribbon_bg_color ) {
				self::set_style(
					$render_slug,
					array(
						'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_slide_ribbon',
						'declaration' => sprintf(
							'box-shadow: 0 0 0 999px %1$s;',
							esc_attr( $ribbon_bg_color )
						),
					)
				);
			}

			// Ribbon Bg Color
			$this->generate_styles(
				array(
					'base_attr_name' => 'ribbon_bg_color',
					'selector'       => '.aioc_pricing_carousel %%order_class%% .aioc_slide_ribbon',
					'hover_selector' => '.aioc_pricing_carousel %%order_class%%:hover .aioc_slide_ribbon',
					'css_property'   => 'background-color',
					'important'      => true,
					'render_slug'    => esc_attr( $render_slug ),
					'type'           => 'color',
				)
			);
		}

		if ( '' !== $icon ) {
			$icon_font_size = et_pb_responsive_options()->get_property_values( $this->props, 'icon_font_size' );
			$icon_color     = et_pb_responsive_options()->get_property_values( $this->props, 'icon_color' );
			et_pb_responsive_options()->generate_responsive_css( $icon_font_size, '.aioc_pricing_carousel %%order_class%% .aioc_pricing_carousel_icon', 'font-size', $render_slug, '', 'range' );
			et_pb_responsive_options()->generate_responsive_css( $icon_color, '.aioc_pricing_carousel %%order_class%% .aioc_pricing_carousel_icon', 'color', $render_slug, '', 'color' );
			$icon_color_hover = $this->get_hover_value( 'icon_color' );
			if ( $icon_color_hover ) {
				self::set_style(
					$render_slug,
					array(
						'selector'    => '.aioc_pricing_carousel %%order_class%% .aioc_pricing_carousel_icon:hover',
						'declaration' => sprintf(
							'color: %1$s !important;',
							esc_attr( $icon_color_hover )
						),
					)
				);
			}

			if ( class_exists( 'ET_Builder_Module_Helper_Style_Processor' ) && method_exists( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ) ) {
				$this->generate_styles(
					array(
						'utility_arg'    => 'icon_font_family',
						'render_slug'    => esc_attr( $render_slug ),
						'base_attr_name' => 'icon',
						'important'      => true,
						'selector'       => '%%order_class%% .aioc_pricing_carousel_icon',
						'processor'      => array(
							'ET_Builder_Module_Helper_Style_Processor',
							'process_extended_icon',
						),
					)
				);
			}
		}

		$fields = array( 'slide_content_margin_padding' );
		AIOC_Helper::process_advanced_margin_padding_css( $this, $render_slug, $this->margin_padding, $fields );

		$background_layout_class_names = et_pb_background_layout_options()->get_background_layout_class( $this->props );
		$this->add_classname(
			array(
				$this->get_text_orientation_classname(),
				esc_attr( $background_layout_class_names[0] ),
				'aioc_slide_carousel_slide',
				'swiper-slide',
			)
		);

		$file = et_is_builder_plugin_active() ? 'style-dbp' : 'style';
		wp_enqueue_style( 'aioc-pricing-carousel-item-style', ALL_IN_ONE_CAROUSEL_FOR_DIVI_PATH . 'includes/modules/PricingCarouselItem/' . $file . '.min.css', array(), '1.0.0' );

		return $slide_wrapper;
	}

	// Extract pricing items from the content
	public function aioc_extract_pricing_items( $content ) {
		$output = array();
		$lines  = array_filter( explode( "\n", str_replace( array( '<p>', '</p>', '<br />' ), "\n", $content ) ) );

		foreach ( $lines as $line ) {
			$line = trim( $line );
			if ( '&#8211;' === substr( $line, 0, 7 ) ) {
				$line = '-' . substr( $line, 7 );
			}
			if ( '' === $line ) {
				continue;
			}
			$first_character = $line[0];
			if ( in_array( $first_character, array( '-', '+' ), true ) ) {
				$line = trim( substr( $line, 1 ) );
			}
			$output[] = array(
				'content'   => $line,
				'available' => ( '-' === $first_character ) ? 'off' : 'on',
			);
		}
		return $output;
	}

	/**
	 * Filter multi view value.
	 *
	 * @since 3.27.1
	 *
	 * @see ET_Builder_Module_Helper_MultiViewOptions::filter_value
	 *
	 * @param mixed                                     $raw_value Props raw value.
	 * @param array                                     $args {
	 *                                         Context data.
	 *
	 *     @type string $context      Context param: content, attrs, visibility, classes.
	 *     @type string $name         Module options props name.
	 *     @type string $mode         Current data mode: desktop, hover, tablet, phone.
	 *     @type string $attr_key     Attribute key for attrs context data. Example: src, class, etc.
	 *     @type string $attr_sub_key Attribute sub key that availabe when passing attrs value as array such as styes. Example: padding-top, margin-botton, etc.
	 * }
	 * @param ET_Builder_Module_Helper_MultiViewOptions $multi_view Multiview object instance.
	 *
	 * @return mixed
	 */
	public function multi_view_filter_value( $raw_value, $args, $multi_view ) {
		$name = isset( $args['name'] ) ? $args['name'] : '';
		$mode = isset( $args['mode'] ) ? $args['mode'] : '';

		if ( ( $raw_value && 'icon' === $name ) || ( $raw_value && 'bullet_icon' === $name ) || ( $raw_value && 'exclude_icon' === $name ) ) {
			$processed_value = html_entity_decode( et_pb_process_font_icon( $raw_value ) );
			if ( '%%1%%' === $raw_value ) {
				$processed_value = '"';
			}
			return $processed_value;
		}

		return $raw_value;
	}

	public function aioc_builder_processed_range_value( $result, $range, $range_string ) {
		if ( false !== strpos( $result, '0calc' ) ) {
			return $range;
		}
		return $result;
	}

}

new AIOC_PricingCarouselItem();
