<?php
/**
 * Elementor Social Media Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.5
 */
class Elementor_Social_Media_Widget extends \Elementor\Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Social Media widget name.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'social-media';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve Social Media widget title.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return __( 'Social Media', 'endless-addons' );
	}

	/**
	 * Get widget icon.
	 *
	 * Retrieve Social Media widget icon.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'fa fa-share';
	}

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the Social Media widget belongs to.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return [ 'endless-elements' ];
	}

	/**
	 * Register Social Media widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.5
	 * @access protected
	 */
	protected function register_controls() {

		$this->start_controls_section(
			'default_section',
			[    
				'label' => __( 'Settings', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT
			]
		);

		$this->add_control(
			'show_social_media',
			[
				'label' => __( 'Show/Hide Social Media Section', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'title' => __( 'Show', 'endless-addons' ),
						'icon' => 'fa fa-check'
					],
					'hide' => [
						'title' => __( 'Hide', 'endless-addons' ),
						'icon' => 'fa fa-close'
					]
				],
				'default' => 'show',
				'toggle' => true
			]
		);

		$this->add_control(
			'select_social_media_style',
			[
				'label' => __( 'Select Social Media Style', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'style-01' => __( 'Style 01', 'endless-addons' ),
					'style-02' => __( 'Style 02', 'endless-addons' ),
					'style-03' => __( 'Style 03', 'endless-addons' ),
					'style-04' => __( 'Style 04', 'endless-addons' ),
					'style-05' => __( 'Style 05', 'endless-addons' ),
					'style-06' => __( 'Style 06', 'endless-addons' ),
					'style-07' => __( 'Style 07', 'endless-addons' ),
					'style-08' => __( 'Style 08', 'endless-addons' ),
					'style-09' => __( 'Style 09', 'endless-addons' ),
				],
				'default' => 'style-01'
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'social_media_section',
			[
				'label' => __( 'Social Media Section', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'section_title',
			[
				'label' => __( 'Section Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Design 1', 'endless-addons' )
			]
		);

		$this->add_control(
			'section_desc',
			[
				'label' => __( 'Section Description', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::WYSIWYG,
				'input_type' => 'WYSIWYG',
				'placeholder' => __( 'Description', 'endless-addons' ),
				'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt dolore magna aliqua. Quis ipsum suspendisse ultrices gravida.', 'endless-addons')
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name' => 'section_background',
				'label' => __( 'Background', 'plugin-domain' ),
				'types' => [ 'classic', 'gradient', 'video' ],
				'selector' => '{{WRAPPER}} .ea-social-media-area',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'social_media_list',
			[
				'label' => __( 'Social Media List', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'social_media_featured_img', [
				'label' => __( 'Featured Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
                'show_label' => true,
                'condition' => [
                    'select_social_media_style' => array('style-01', 'style-03', 'style-05', 'style-07')
                ]
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Image_Size::get_type(),
			[
				'name' => 'thumbnail',
				'default' => 'full',
				'separator' => 'none',
				'exclude' => [
					'full',
					'custom',
					'large',
					'shop_catalog',
					'shop_single',
					'shop_thumbnail'
				],
				'condition' => [
					'select_social_media_style' => array('style-01', 'style-03', 'style-05', 'style-07')
				]
			]
		);

		$repeater = new \Elementor\Repeater();

		$repeater->add_control(
			'icon_type',
			[
				'label' => __( 'Icon Type', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'general' => __( 'General', 'endless-addons' ),
					'library' => __( 'Library', 'endless-addons' ),
				],
				'default' => 'general'
			]
		);

		$repeater->add_control(
			'social_media_icon1', 
			[
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'input_type' => 'icon',
				'default'  => 'bx bxl-facebook',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'general'
                ]
			]
		);

		$repeater->add_control(
			'social_media_icon2', 
			[
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICONS,
				'input_type' => 'icon',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'library'
                ]
			]
		);

		$repeater->add_control(
			'social_media_title', [
				'label' => __( 'Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'description' => 'Used Only Style-01, Style-05, Style-07',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Facebook', 'endless-addons' )
			]
		);

		$repeater->add_control(
			'social_media_link',
			[
				'label' => __( 'Link', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::URL,
				'input_type' => 'url',
				'default' => [
					'url' => '#',
					'is_external' => true,
					'nofollow' => true
				]
			]
		);

		$repeater->add_control(
            'want_to_customize',
            [
                'label' => __( 'Want to customize?', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __( 'Yes', 'endless-addons' ),
                'label_off' => __( 'No', 'endless-addons' ),
                'return_value' => 'yes',
                'default' => 'no'
            ]
        );

		$repeater->add_control(
			'social_media_icolor',
			[
				'label' => __( 'Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'condition' => [
                    'want_to_customize' => 'yes'
                ]
			]
		);

		$repeater->add_control(
			'social_media_color',
			[
				'label' => __( 'Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'condition' => [
                    'want_to_customize' => 'yes'
                ]
			]
		);

		$this->add_control(
			'single_social_media',
			[
				'label' => __( 'Social Media List 1', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'fields' => $repeater->get_controls(),
				'default' => [
					[
						'list_title' => __( 'Social Media #1', 'endless-addons' ),
						'list_content' => __( 'Social Media Content', 'endless-addons' ),
					],
				
				],
			]
		);

		$repeater = new \Elementor\Repeater();

		$repeater->add_control(
			'icon_type2',
			[
				'label' => __( 'Icon Type', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'general' => __( 'General', 'endless-addons' ),
					'library' => __( 'Library', 'endless-addons' ),
				],
				'default' => 'general'
			]
		);

		$repeater->add_control(
			'social_media2_icon1', 
			[
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'input_type' => 'icon',
				'default'  => 'bx bxl-facebook',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type2' => 'general'
                ]
			]
		);

		$repeater->add_control(
			'social_media2_icon2', 
			[
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICONS,
				'input_type' => 'icon',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type2' => 'library'
                ]
			]
		);

		$repeater->add_control(
			'social_media_title2', [
				'label' => __( 'Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'description' => 'Used Only Style-01, Style-05, Style-07',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Facebook', 'endless-addons' )
			]
		);

		$repeater->add_control(
			'social_media_link2',
			[
				'label' => __( 'Link', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::URL,
				'input_type' => 'url',
				'default' => [
					'url' => '#',
					'is_external' => true,
					'nofollow' => true
				]
			]
		);

		$repeater->add_control(
            'want_to_customize_two',
            [
                'label' => __( 'Want to customize?', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __( 'Yes', 'endless-addons' ),
                'label_off' => __( 'No', 'endless-addons' ),
                'return_value' => 'yes',
                'default' => 'no'
            ]
        );

		$repeater->add_control(
			'social_media_icolor2',
			[
				'label' => __( 'Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'condition' => [
                    'want_to_customize_two' => 'yes'
                ]
			]
		);

		$repeater->add_control(
			'social_media_color2',
			[
				'label' => __( 'Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'condition' => [
                    'want_to_customize_two' => 'yes'
                ]
			]
		);

		$this->add_control(
			'single_social_media2',
			[
				'label' => __( 'Social Media List 2', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::REPEATER,
				'fields' => $repeater->get_controls(),
				'default' => [
					[
						'list_title' => __( 'Social Media #1', 'endless-addons' ),
						'list_content' => __( 'Social Media Content', 'endless-addons' ),
					],
				
				],
				'condition' => [
                    'select_social_media_style' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style',
			[
				'label' => __( 'Section Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->add_control(
			'section_title_color',
			[
				'label' => __( 'Section Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-social-media-area .section-title h2, .ea-social-media-area .ea-social-content h2' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'section_title_typography',
                'label' => __( 'Section Title Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-social-media-area .section-title h2, .ea-social-media-area .ea-social-content h2'
            ]
        );

        $this->add_control(
			'section_desc_color',
			[
				'label' => __( 'Section Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-social-media-area .section-title p, .ea-social-media-area .ea-social-content p' => 'color: {{VALUE}}'
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'section_desc_typography',
                'label' => __( 'Section Description Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-social-media-area .section-title p, .ea-social-media-area .ea-social-content p'
            ]
        );

		$this->end_controls_section();

		$this->start_controls_section(
			'social_media_style',
			[
				'label' => __( 'Social Media Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->add_control(
			'social_height',
			[
				'label' => __( 'Height', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 100,
						'max' => 1000
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-social-media-area ul li i' => 'height: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_control(
			'social_width',
			[
				'label' => __( 'Width', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 100,
						'max' => 1000
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-social-media-area ul li i' => 'width: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_control(
            'social_border_radius',
            [
                'label' => __( 'Border Radius', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', '%' ],
                'separator' => 'after',
                'selectors' => [
                    '{{WRAPPER}} .ea-social-media-area ul li i' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

		$this->end_controls_section();

		$this->start_controls_section(
			'_section_overlay_style',
			[
				'label' => __('Background Overlay', 'endless-addons'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->start_controls_tabs('_tabs_overlay_style');

		$this->start_controls_tab(
			'_tab_overlay_normal',
			[
				'label' => __('Normal', 'endless-addons'),
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name'     => 'hover_overlay_normal',
				'label' => __('Background', 'endless-addons'),
				'show_label' => true,
				'types' => ['classic', 'gradient'],
				'exclude' => [
					'classic' => 'image'
				],
				'selector' => '{{WRAPPER}} .ea-social-media-area',
			]
		);

		$this->end_controls_tab();

		$this->start_controls_tab(
			'_tab_overlay_hover',
			[
				'label' => __('Hover', 'endless-addons'),
			]
		);


		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name'     => 'hover_overlay_hover',
				'label' => __('Background', 'endless-addons'),
				'show_label' => true,
				'types' => ['classic', 'gradient'],
				'exclude' => [
					'classic' => 'image'
				],
				'selector' => '{{WRAPPER}} .ea-social-media-area:hover',
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();

		require plugin_dir_path( dirname( __FILE__ ) ) . 'floating/ea-social-floating.php';
		
	}

	/**
	 * Render Social Media widget output on the frontend.
	 *
	 * Written in PHP and used to generate the final HTML.
	 *
	 * @since 1.0.5
	 * @access protected
	 */
	protected function render() {

		$settings = $this->get_settings_for_display(); 

		if( $settings['show_social_media'] == 'show' ) :

			if( $settings['select_social_media_style'] == 'style-01' ) : ?>
	            <!-- Start Social Media Design One Area -->
		        <section class="ea-social-media-area pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo esc_html($settings['section_desc']); ?></p>
		                </div>
		                <div class="row align-items-center">
		                    <div class="col-lg-4">
	                            <?php if( ! $settings['social_media_featured_img']['url'] == '' ) : ?>
	                            	<div class="ea-social-media-img-one ea-elementor-floating">
	                                    <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'social_media_featured_img' ); ?>
	                                </div>
	                            <?php endif; ?> 
		                   </div>
		                   <div class="col-lg-8">
		                        <div class="row">
		                        	<div class="col-lg-6">
		                        		<ul class="ea-social-media-list">
			                            	<?php foreach ( $settings['single_social_media'] as $item ) :
			                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
			                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
			                            		<li class="ea-list-item">
			                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?> style="background-color:<?php echo $item['social_media_color']; ?>">
			                                            <?php if( $item['icon_type'] == 'general' ) : ?>
						                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="color:<?php echo $item['social_media_icolor']; ?>"></i>
						                            	<?php else: 
						                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
						                            	endif; ?>
			                                            <?php echo esc_html($item['social_media_title']); ?>
			                                        </a>
			                                    </li>
			                            	<?php endforeach; ?>
		                                </ul>
		                            </div>
		                            <div class="col-lg-6">
		                        		<ul class="ea-social-media-list">
			                            	<?php foreach ( $settings['single_social_media2'] as $item2 ) :
			                            		$target2 = $item2['social_media_link2']['is_external'] ? ' target="_blank"' : '';
			                                    $nofollow2 = $item2['social_media_link2']['nofollow'] ? ' rel="nofollow"' : ''; ?>
			                            		<li class="ea-list-item">
			                                        <a href="<?php echo esc_url( $item2['social_media_link2']['url'] ); ?>" <?php echo wp_kses_post( $target2 ); ?> <?php echo wp_kses_post( $nofollow2 ); ?> style="background-color:<?php echo $item2['social_media_color2']; ?>">
			                                            <?php if( $item2['icon_type2'] == 'general' ) : ?>
						                            	    <i class="<?php echo wp_kses_post( $item2['social_media2_icon1'] ); ?>" style="color:<?php echo $item2['social_media_icolor2']; ?>"></i>
						                            	<?php else: 
						                            		endad_render_icon( $item2, 'icon', 'social_media2_icon2' ); 
						                            	endif; ?>
			                                            <?php echo esc_html($item2['social_media_title2']); ?>
			                                        </a>
			                                    </li>
			                            	<?php endforeach; ?>
		                                </ul>
		                            </div>
		                        </div>
		                   </div>
		                </div>
		            </div>
		        </section>
		        <!-- End Social Media Design One Area -->
		    <?php elseif( $settings['select_social_media_style'] == 'style-02' ) : ?>
	            <!-- Start Social Media Design Two Area -->
		        <section class="ea-social-media-area bg-color-f8eff7 pt-100 pb-70">
		            <div class="container">
		            	<div class="row align-items-center">
			            	<div class="col-lg-6">
				                <div class="ea-social-content">
				                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
				                    <p><?php echo esc_html($settings['section_desc']); ?></p>
				                </div>
				            </div>
			                <div class="col-lg-6 text-center">
	                    		<ul class="ea-social-media-grid">
	                            	<?php foreach ( $settings['single_social_media'] as $item ) :
	                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
	                                            <?php if( $item['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="background-color:<?php echo $item['social_media_color']; ?>;color:<?php echo $item['social_media_icolor']; ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
	                            </ul>
	                    		<ul class="ea-social-media-grid">
	                            	<?php foreach ( $settings['single_social_media2'] as $item2 ) :
	                            		$target2 = $item2['social_media_link2']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow2 = $item2['social_media_link2']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a href="<?php echo esc_url( $item2['social_media_link2']['url'] ); ?>" <?php echo wp_kses_post( $target2 ); ?> <?php echo wp_kses_post( $nofollow2 ); ?>>
	                                            <?php if( $item2['icon_type2'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item2['social_media2_icon1'] ); ?>" style="background-color:<?php echo $item2['social_media_color2']; ?>;color:<?php echo $item2['social_media_icolor2']; ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item2, 'icon', 'social_media2_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
	                            </ul>
			                </div>
			            </div>
		            </div>
		        </section>
		        <!-- End Social Media Design Two Area -->
		    <?php elseif( $settings['select_social_media_style'] == 'style-03' ) : ?>
	            <!-- Start Social Media Design Three Area -->
		        <section class="ea-social-media-area pt-100 pb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo esc_html($settings['section_desc']); ?></p>
		                </div>
		                <div class="row align-items-center">
		                    <div class="col-lg-7">
                        		<ul class="ea-social-media-list style-two">
	                            	<?php foreach ( $settings['single_social_media'] as $item ) :
	                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?> style="background-color:<?php echo $item['social_media_color']; ?>">
	                                            <?php if( $item['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="color:<?php echo $item['social_media_icolor']; ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
                                </ul>
		                   </div>
		                   <div class="col-lg-5">
	                            <?php if( ! $settings['social_media_featured_img']['url'] == '' ) : ?>
	                            	<div class="ea-social-media-img-one ea-elementor-floating">
	                                    <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'social_media_featured_img' ); ?>
	                                </div>
	                            <?php endif; ?> 
		                   </div>
		                </div>
		            </div>
		        </section>
		        <!-- End Social Media Design Three Area -->
		        <?php elseif( $settings['select_social_media_style'] == 'style-04' ) : ?>
		            <!-- Start Social Media Design Four Area -->
			        <section class="ea-social-media-area bg-color-f6eee1 pt-100 pb-70">
			            <div class="container">
			            	<div class="row align-items-center">
				                <div class="col-lg-6 text-center">
		                    		<ul class="ea-social-media-grid style-four">
		                            	<?php foreach ( $settings['single_social_media'] as $item ) :
		                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
		                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
		                            		<li class="ea-list-item">
		                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
		                                            <?php if( $item['icon_type'] == 'general' ) : ?>
					                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="background-color:<?php echo $item['social_media_color']; ?>;color:<?php echo $item['social_media_icolor']; ?>"></i>
					                            	<?php else: 
					                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
					                            	endif; ?>
		                                        </a>
		                                    </li>
		                            	<?php endforeach; ?>
		                            </ul>
		                    		<ul class="ea-social-media-grid style-four">
		                            	<?php foreach ( $settings['single_social_media2'] as $item2 ) :
		                            		$target2 = $item2['social_media_link2']['is_external'] ? ' target="_blank"' : '';
		                                    $nofollow2 = $item2['social_media_link2']['nofollow'] ? ' rel="nofollow"' : ''; ?>
		                            		<li class="ea-list-item">
		                                        <a href="<?php echo esc_url( $item2['social_media_link2']['url'] ); ?>" <?php echo wp_kses_post( $target2 ); ?> <?php echo wp_kses_post( $nofollow2 ); ?>>
		                                            <?php if( $item2['icon_type2'] == 'general' ) : ?>
					                            	    <i class="<?php echo wp_kses_post( $item2['social_media2_icon1'] ); ?>" style="background-color:<?php echo $item2['social_media_color2']; ?>;color:<?php echo $item2['social_media_icolor2']; ?>"></i>
					                            	<?php else: 
					                            		endad_render_icon( $item2, 'icon', 'social_media2_icon2' ); 
					                            	endif; ?>
		                                        </a>
		                                    </li>
		                            	<?php endforeach; ?>
		                            </ul>
				                </div>
				                <div class="col-lg-6">
					                <div class="ea-social-content">
					                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
					                    <p><?php echo esc_html($settings['section_desc']); ?></p>
					                </div>
					            </div>
				            </div>
			            </div>
			        </section>
			        <!-- End Social Media Design Four Area -->
			<?php elseif( $settings['select_social_media_style'] == 'style-05' ) : ?>
	            <!-- Start Social Media Design Five Area -->
		        <section class="ea-social-media-area pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo esc_html($settings['section_desc']); ?></p>
		                </div>
		                <div class="row align-items-center">
		                    <div class="col-lg-4">
	                            <?php if( ! $settings['social_media_featured_img']['url'] == '' ) : ?>
	                            	<div class="ea-social-media-img-one ea-elementor-floating">
	                                    <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'social_media_featured_img' ); ?>
	                                </div>
	                            <?php endif; ?> 
		                   </div>
		                   <div class="col-lg-8">
		                        <div class="row">
		                        	<div class="col-lg-6">
		                        		<ul class="ea-social-media-list style-five">
			                            	<?php foreach ( $settings['single_social_media'] as $item ) :
			                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
			                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
			                            		<li class="ea-list-item">
			                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?> style="background-color:<?php echo $item['social_media_color']; ?>">
			                                            <?php if( $item['icon_type'] == 'general' ) : ?>
						                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="color:<?php echo $item['social_media_icolor']; ?>"></i>
						                            	<?php else: 
						                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
						                            	endif; ?>
			                                            <?php echo esc_html($item['social_media_title']); ?>
			                                        </a>
			                                    </li>
			                            	<?php endforeach; ?>
		                                </ul>
		                            </div>
		                            <div class="col-lg-6">
		                        		<ul class="ea-social-media-list style-five">
			                            	<?php foreach ( $settings['single_social_media2'] as $item2 ) :
			                            		$target2 = $item2['social_media_link2']['is_external'] ? ' target="_blank"' : '';
			                                    $nofollow2 = $item2['social_media_link2']['nofollow'] ? ' rel="nofollow"' : ''; ?>
			                            		<li class="ea-list-item">
			                                        <a href="<?php echo esc_url( $item2['social_media_link2']['url'] ); ?>" <?php echo wp_kses_post( $target2 ); ?> <?php echo wp_kses_post( $nofollow2 ); ?> style="background-color:<?php echo $item2['social_media_color2']; ?>">
			                                            <?php if( $item2['icon_type2'] == 'general' ) : ?>
						                            	    <i class="<?php echo wp_kses_post( $item2['social_media2_icon1'] ); ?>" style="color:<?php echo $item2['social_media_icolor2']; ?>"></i>
						                            	<?php else: 
						                            		endad_render_icon( $item2, 'icon', 'social_media2_icon2' ); 
						                            	endif; ?>
			                                            <?php echo esc_html($item2['social_media_title2']); ?>
			                                        </a>
			                                    </li>
			                            	<?php endforeach; ?>
		                                </ul>
		                            </div>
		                        </div>
		                   </div>
		                </div>
		            </div>
		        </section>
		        <!-- End Social Media Design Five Area -->
		    <?php elseif( $settings['select_social_media_style'] == 'style-06' ) : ?>
	            <!-- Start Social Media Design Six Area -->
		        <section class="ea-social-media-area bg-color-f0f2f9 pt-100 pb-70">
		            <div class="container">
		            	<div class="row align-items-center">
			            	<div class="col-lg-6">
				                <div class="ea-social-content">
				                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
				                    <p><?php echo esc_html($settings['section_desc']); ?></p>
				                </div>
				            </div>
			                <div class="col-lg-6 text-center">
	                    		<ul class="ea-social-media-grid style-six">
	                            	<?php foreach ( $settings['single_social_media'] as $item ) :
	                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
	                                            <?php if( $item['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="background-color:<?php echo $item['social_media_color']; ?>;color:<?php echo $item['social_media_icolor']; ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
	                            </ul>
	                    		<ul class="ea-social-media-grid style-six">
	                            	<?php foreach ( $settings['single_social_media2'] as $item2 ) :
	                            		$target2 = $item2['social_media_link2']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow2 = $item2['social_media_link2']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a href="<?php echo esc_url( $item2['social_media_link2']['url'] ); ?>" <?php echo wp_kses_post( $target2 ); ?> <?php echo wp_kses_post( $nofollow2 ); ?>>
	                                            <?php if( $item2['icon_type2'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item2['social_media2_icon1'] ); ?>" style="background-color:<?php echo $item2['social_media_color2']; ?>;color:<?php echo $item2['social_media_icolor2']; ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item2, 'icon', 'social_media2_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
	                            </ul>
			                </div>
			            </div>
		            </div>
		        </section>
		        <!-- End Social Media Design Six Area -->
		    <?php elseif( $settings['select_social_media_style'] == 'style-07' ) : ?>
	            <!-- Start Social Media Design Seven Area -->
		        <section class="ea-social-media-area pt-100 pb-70">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo esc_html($settings['section_desc']); ?></p>
		                </div>
		                <div class="row align-items-center">
		                   <div class="col-lg-8">
		                        <div class="row">
		                        	<div class="col-lg-6">
		                        		<ul class="ea-social-media-list style-seven">
			                            	<?php foreach ( $settings['single_social_media'] as $item ) :
			                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
			                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
			                            		<li class="ea-list-item">
			                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?> style="background-color:<?php echo $item['social_media_color']; ?>">
			                                            <?php if( $item['icon_type'] == 'general' ) : ?>
						                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="color:<?php echo $item['social_media_icolor']; ?>"></i>
						                            	<?php else: 
						                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
						                            	endif; ?>
			                                            <?php echo esc_html($item['social_media_title']); ?>
			                                        </a>
			                                    </li>
			                            	<?php endforeach; ?>
		                                </ul>
		                            </div>
		                            <div class="col-lg-6">
		                        		<ul class="ea-social-media-list style-seven">
			                            	<?php foreach ( $settings['single_social_media2'] as $item2 ) :
			                            		$target2 = $item2['social_media_link2']['is_external'] ? ' target="_blank"' : '';
			                                    $nofollow2 = $item2['social_media_link2']['nofollow'] ? ' rel="nofollow"' : ''; ?>
			                            		<li class="ea-list-item">
			                                        <a href="<?php echo esc_url( $item2['social_media_link2']['url'] ); ?>" <?php echo wp_kses_post( $target2 ); ?> <?php echo wp_kses_post( $nofollow2 ); ?> style="background-color:<?php echo $item2['social_media_color2']; ?>">
			                                            <?php if( $item2['icon_type2'] == 'general' ) : ?>
						                            	    <i class="<?php echo wp_kses_post( $item2['social_media2_icon1'] ); ?>" style="color:<?php echo $item2['social_media_icolor2']; ?>"></i>
						                            	<?php else: 
						                            		endad_render_icon( $item2, 'icon', 'social_media2_icon2' ); 
						                            	endif; ?>
			                                            <?php echo esc_html($item2['social_media_title2']); ?>
			                                        </a>
			                                    </li>
			                            	<?php endforeach; ?>
		                                </ul>
		                            </div>
		                        </div>
		                   </div>
		                   	<div class="col-lg-4">
	                            <?php if( ! $settings['social_media_featured_img']['url'] == '' ) : ?>
	                            	<div class="ea-social-media-img-one ea-elementor-floating">
	                                    <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'social_media_featured_img' ); ?>
	                                </div>
	                            <?php endif; ?> 
		                   </div>
		                </div>
		            </div>
		        </section>
		        <!-- End Social Media Design Seven Area -->
		    <?php elseif( $settings['select_social_media_style'] == 'style-08' ) : ?>
		        <!-- Start Social Media Design Eight Area -->
		        <section class="ea-social-media-area bg-color-e8f4ff pt-100 pb-70">
		            <div class="container">
		            	<div class="row align-items-center">
			            	<div class="col-lg-6">
				                <div class="ea-social-content">
				                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
				                    <p><?php echo esc_html($settings['section_desc']); ?></p>
				                </div>
				            </div>
			                <div class="col-lg-6 text-center">
	                    		<ul class="ea-social-media-grid style-eight">
	                            	<?php foreach ( $settings['single_social_media'] as $item ) :
	                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a style="border: 3px solid <?php echo $item['social_media_icolor']; ?>" href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
	                                            <?php if( $item['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="color:<?php echo $item['social_media_icolor']; ?>;"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
	                            </ul>
	                    		<ul class="ea-social-media-grid style-eight">
	                            	<?php foreach ( $settings['single_social_media2'] as $item2 ) :
	                            		$target2 = $item2['social_media_link2']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow2 = $item2['social_media_link2']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a style="border: 3px solid <?php echo $item2['social_media_icolor2']; ?>" href="<?php echo esc_url( $item2['social_media_link2']['url'] ); ?>" <?php echo wp_kses_post( $target2 ); ?> <?php echo wp_kses_post( $nofollow2 ); ?>>
	                                            <?php if( $item2['icon_type2'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item2['social_media2_icon1'] ); ?>" style="color:<?php echo $item2['social_media_icolor2']; ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item2, 'icon', 'social_media2_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
	                            </ul>
			                </div>
			            </div>
		            </div>
		        </section>
		        <!-- End Social Media Design Eight Area -->
		    <?php elseif( $settings['select_social_media_style'] == 'style-09' ) : ?>
		        <!-- Start Social Media Design Nine Area -->
		        <section class="ea-social-media-area style-nine bg-shape pt-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html($settings['section_title']); ?></h2>
		                    <p><?php echo esc_html($settings['section_desc']); ?></p>
		                </div>
			            <div class="row justify-content-center">
			            	<div class="col-lg-8">
	                    		<ul class="ea-social-media-grid style-nine">
	                            	<?php foreach ( $settings['single_social_media'] as $item ) :
	                            		$target = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
	                                    $nofollow = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
	                            		<li class="ea-list-item">
	                                        <a style="background-color:<?php echo $item['social_media_color']; ?>" href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?>>
	                                            <?php if( $item['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>" style="color:<?php echo $item['social_media_icolor']; ?>;"></i>
				                            	<?php else: 
				                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
				                            	endif; ?>
	                                        </a>
	                                    </li>
	                            	<?php endforeach; ?>
	                            </ul>
                            </div>
			            </div>
		            </div>
		        </section>
		        <!-- End Social Media Design Nine Area -->
	        <?php endif;

        endif;

    }

}
