<?php
/**
 * Elementor Banner Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.5
 */

use \Elementor\Plugin;

class Elementor_Banner_Widget extends \Elementor\Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Banner widget name.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'banner';
	}

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

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

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

	/**
	 * Register Banner 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_banner',
			[
				'label' => __( 'Show/Hide Banner 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(
			'banner_custom_style',
			[
				'label' => __( 'Select Banner Style', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'style-1' => __( 'Style 1', 'endless-addons' ),
					'style-2' => __( 'Style 2', 'endless-addons' ),
					'style-3' => __( 'Style 3', 'endless-addons' ),
					'style-4' => __( 'Style 4', 'endless-addons' ),
					'style-5' => __( 'Style 5', 'endless-addons' ),
					'style-6' => __( 'Style 6', 'endless-addons' ),
					'style-7' => __( 'Style 7', 'endless-addons' ),
					'style-8' => __( 'Style 8', 'endless-addons' ),
					'style-9' => __( 'Style 9', 'endless-addons' ),
					'style-10' => __( 'Style 10', 'endless-addons' )
				],
				'default' => 'style-1',
				'description' => __( 'Multiple styles only effect on banner gradient background color, select colors from style tab for see the effect', 'endless-addons' ),
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'banner_section',
			[
				'label' => __( 'Banner Content', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);
		
		$this->add_control(
			'banner_content_position',
			[
				'label' => __( 'Banner Content Position', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'default' => __( 'Default', 'endless-addons' ),
					'reverse' => __( 'Reverse', 'endless-addons' )
				],
				'default' => 'default'
			]
		);

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

		$this->add_control(
			'ea_title_tag',
			[
				'label' => __( 'Title Tag', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'h1' => __( 'h1', 'endless-addons' ),
					'h2' => __( 'h2', 'endless-addons' ),
					'h3' => __( 'h3', 'endless-addons' ),
					'h4' => __( 'h4', 'endless-addons' ),
					'h5' => __( 'h5', 'endless-addons' ),
					'h6' => __( 'h6', 'endless-addons' )
				],
				'default' => 'h2'
			]
		);

		$this->add_control(
            'ea_content_text_type',
            [
                'label' => __('Content Type', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => [
                    'content' => __('Content', 'endless-addons'),
                    'template' => __('Saved Templates', 'endless-addons'),
                ],
                'default' => 'content',
            ]
        );

		$this->add_control(
			'banner_desc',
			[
				'label' => __( 'Banner Description', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::WYSIWYG,
				'input_type' => 'WYSIWYG',
				'placeholder' => __( 'Description', 'endless-addons' ),
				'default' => __( 'Powerful elementor widgets to create beautiful websites', 'endless-addons'),
				'condition' => [
                    'ea_content_text_type' => 'content'
                ]
			]
		);

		$this->add_control(
            'ea_content_templates',
            [
                'label' => __('Choose Template', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => ea_get_elementor_templates(),
                'condition' => [
                    'ea_content_text_type' => 'template',
                ],
            ]
        );

		$this->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'
			]
		);

		$this->add_control(
			'banner_btn_icon1', 
			[
				'label' => __( 'Button Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'input_type' => 'icon',
				'default'  => 'bx bxs-file-doc',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'general'
                ]
			]
		);

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

		$this->add_control(
			'banner_btn_text',
			[
				'label' => __( 'Banner Button Text', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Text', 'endless-addons' ),
				'default' => __( 'Documentation', 'endless-addons' )
			]
		);

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

		$this->add_control(
			'btn_icon_position',
			[
				'label' => __( 'Button Icon Position', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'before' => __( 'Before Text', 'endless-addons' ),
					'after' => __( 'After Text', 'endless-addons' )
				],
				'default' => 'before'
			]
		);

		$this->add_control(
			'banner_video_title',
			[
				'label' => __( 'Banner Video Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default' => 'Watch Setup Video'
			]
		);

		$this->add_control(
			'banner_video_link',
			[
				'label' => __( 'Banner Video Link', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'url',
				'placeholder' => __( 'URL', 'endless-addons' ),
				'default' => 'http://www.youtube.com/watch?v=0O2aH4XLbto'
			]
		);

		$this->add_control(
			'video_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'
			]
		);

		$this->add_control(
			'banner_video_icon1', 
			[
				'label' => __( 'Video Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'input_type' => 'icon',
				'default'  => 'bx bx-play',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'video_icon_type' => 'general'
                ]
			]
		);

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

		$this->add_control(
			'banner_video_img',
			[
				'label' => __( 'Banner Video Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'default' => [
					'url' => plugin_dir_url( dirname( __FILE__ ) ) . '../public/img/page-banner.jpg'
				],
				'show_label' => true
			]
		);

		$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'
				]
			]
		);

		$this->end_controls_section();

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

		$this->add_control(
			'banner_bg1_color',
			[
				'label' => __( 'Background Left Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'  => ''
			]
		);

		$this->add_control(
			'banner_bg12_color',
			[
				'label' => __( 'Background Middle Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'  => '',
				'condition' => [
                    'banner_custom_style' => array('style-3', 'style-4', 'style-5', 'style-7', 'style-8'),
                ]
			]
		);

		$this->add_control(
			'banner_bg2_color',
			[
				'label' => __( 'Background Right Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'default'  => ''
			]
		);

		$this->add_control(
			'banner_title_color',
			[
				'label' => __( 'Banner Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-area .ea-page-banner-content .banner-title' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'banner_title_typography',
                'label' => __( 'Banner Title Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-page-banner-area .ea-page-banner-content .banner-title'
            ]
        );

        $this->add_control(
			'banner_desc_color',
			[
				'label' => __( 'Banner Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-area .ea-page-banner-content p' => 'color: {{VALUE}}'
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'banner_desc_typography',
                'label' => __( 'Banner Description Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-page-banner-area .ea-page-banner-content p'
            ]
        );

        $this->end_controls_section();

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

		$this->add_control(
			'button_bg_color',
			[
				'label' => __( 'Button Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-content .banner-default-btn' => 'background: {{VALUE}}'
                ],
			]
		);

		$this->add_control(
			'button_color',
			[
				'label' => __( 'Button Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-content .banner-default-btn' => 'color: {{VALUE}}'
                ],
			]
		);

		$this->add_control(
			'button_bg_hover_color',
			[
				'label' => __( 'Button Background Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-content .banner-default-btn:hover' => 'background: {{VALUE}}'
                ],
			]
		);

		$this->add_control(
			'button_hover_color',
			[
				'label' => __( 'Button Hover Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-content .banner-default-btn:hover' => 'color: {{VALUE}}'
                ],
			]
		);

		$this->end_controls_section();

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

        $this->add_control(
			'banner_img_bg_color',
			[
				'label' => __( 'Video Image Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'input_type' => 'color',
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-area .ea-page-banner-image' => 'background-color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'banner_img_height',
			[
				'label' => __( 'Video Image Height', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 50,
						'max' => 500
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-page-banner-image img' => 'height: {{SIZE}}{{UNIT}}',
				],
			]
		);

		$this->add_control(
			'banner_img_width',
			[
				'label' => __( 'Video Image Width', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
					'px' => [
						'min' => 50,
						'max' => 500
					]
				],
				'selectors' => [
					'{{WRAPPER}} .ea-page-banner-image img' => 'width: {{SIZE}}{{UNIT}}',
				],
			]
		);

        $this->add_control(
			'banner_video_icon_color',
			[
				'label' => __( 'Banner Video Icon Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-image .video-btn i' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'banner_video_icon_size',
			[
				'label' => __( 'Banner Video Icon Size', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
                    'px' => [
                        'min' => 20,
                        'max' => 100,
                        'step' => 1,
                    ],
                ],
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-image .video-btn i' => 'font-size: {{SIZE}}px;'
                ]
			]
		);

		$this->add_control(
			'banner_video_title_color',
			[
				'label' => __( 'Banner Video Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-image span' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'banner_video_title_size',
			[
				'label' => __( 'Banner Video Icon Size', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'range' => [
                    'px' => [
                        'min' => 20,
                        'max' => 100,
                        'step' => 1,
                    ],
                ],
				'selectors' => [
                    '{{WRAPPER}} .ea-page-banner-image span' => 'font-size: {{SIZE}}px;'
                ]
			]
		);


		$this->end_controls_section();

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

	}

	/**
	 * Render Banner 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['btn_icon_position'] == 'before' ) : 
		    $this->add_render_attribute('btn_icon_position', 'class', 'is-btn-icon-left');
		elseif( $settings['btn_icon_position'] == 'after' ) :
            $this->add_render_attribute('btn_icon_position', 'class', 'is-btn-icon-right');
        endif; 

        if( $settings['banner_custom_style'] == 'style-1' ) :
			$banner_bg_class = ' bg1';
		elseif( $settings['banner_custom_style'] == 'style-2' ) :
			$banner_bg_class = ' bg2';
		elseif( $settings['banner_custom_style'] == 'style-3' ) :
			$banner_bg_class = ' bg3';
		elseif( $settings['banner_custom_style'] == 'style-4' ) :
			$banner_bg_class = ' bg5';
		elseif( $settings['banner_custom_style'] == 'style-5' ) :
			$banner_bg_class = ' bg12';
		elseif( $settings['banner_custom_style'] == 'style-6' ) :
			$banner_bg_class = ' bg6';
	    elseif( $settings['banner_custom_style'] == 'style-7' ) :
			$banner_bg_class = ' bg23';
	    elseif( $settings['banner_custom_style'] == 'style-8' ) :
			$banner_bg_class = ' bg26';
		elseif( $settings['banner_custom_style'] == 'style-9' ) :
			$banner_bg_class = ' bg7';
		elseif( $settings['banner_custom_style'] == 'style-10' ) :
			$banner_bg_class = ' bg8';
		else: $banner_bg_class = '';
		endif;

		$target = $settings['banner_btn_link']['is_external'] ? ' target="_blank"' : '';
	    $nofollow = $settings['banner_btn_link']['nofollow'] ? ' rel="nofollow"' : '';

		if( $settings['show_banner'] == 'show' ) : ?>
			<!-- Start Page Banner Area -->
	        <div class="ea-page-banner-area<?php echo esc_attr( $banner_bg_class ); ?>">
	            <div class="container">
	                <div class="row align-items-center">
	                	<?php if( $settings['banner_content_position'] == 'default' ) : ?>
		                    <div class="col-lg-6 col-md-12">
		                        <div class="ea-page-banner-content">
		                        	<<?php echo esc_attr($settings['ea_title_tag']); ?> class="banner-title"><?php echo esc_html($settings['banner_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
                                    <?php if($settings['ea_content_text_type'] == 'content') : ?>
		                                <p><?php echo wp_kses_post($settings['banner_desc']); ?></p>
		                            <?php elseif($settings['ea_content_text_type'] == 'template') : ?>
		                            	<p>
		                            		<?php if (!empty($settings['ea_content_templates'])) {
								                echo Plugin::$instance->frontend->get_builder_content($settings['ea_content_templates'], true);
								            } ?>
		                            	</p>
		                            <?php endif; ?>
		                            <?php if( ! $settings['banner_btn_text'] == '' ) : ?>
		                            	<div <?php echo $this->get_render_attribute_string('btn_icon_position'); ?>>
				                            <a href="<?php echo esc_url($settings['banner_btn_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?> class="banner-default-btn">
				                            	<?php if( $settings['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $settings['banner_btn_icon1'] ); ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $settings, 'icon', 'banner_btn_icon2' ); 
				                            	endif; ?>
				                            	<?php echo esc_html__($settings['banner_btn_text']); ?>  
				                            </a>
				                        </div>
		                            <?php endif; ?>
		                        </div>
		                    </div>
		                    <div class="col-lg-6 col-md-12">
		                        <div class="ea-page-banner-image ea-elementor-floating">
		                        	<?php if( ! $settings['banner_video_img']['url'] == '' ) : ?>
		                        		<?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'banner_video_img' ); ?>
	                                <?php endif; ?>
		                        	<?php if( ! $settings['banner_video_link'] == '' ) : ?>
			                            <a href="<?php echo esc_url( $settings['banner_video_link'] ); ?>" class="video-btn popup-video">
			                            	<?php if( $settings['video_icon_type'] == 'general' ) : ?>
			                            	    <i class="<?php echo wp_kses_post( $settings['banner_video_icon1'] ); ?>"></i>
			                            	<?php else: 
			                            		endad_render_icon( $settings, 'icon', 'banner_video_icon2' ); 
			                            	endif; ?>
			                            </a>
		                            <?php endif; ?>
		                            <span><?php echo esc_html__($settings['banner_video_title']); ?></span>
		                        </div>
		                    </div>
		                    <style>
		                    	.ea-page-banner-area::before {
							    	clip-path: polygon(0 100%, 100% 53.5%, 100% 100%, 0% 100%);
							    }
		                    </style>
	                    <?php elseif( $settings['banner_content_position'] == 'reverse' ) : ?>
	                    	<div class="col-lg-6 col-md-12">
		                        <div class="ea-page-banner-image ea-elementor-floating">
		                        	<?php if( ! $settings['banner_video_img']['url'] == '' ) : ?>
		                                <?php echo \Elementor\Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'banner_video_img' ); ?>
	                                <?php endif; ?>
		                        	<?php if( ! $settings['banner_video_link'] == '' ) : ?>
		                        		<div <?php echo $this->get_render_attribute_string('btn_icon_position'); ?>>
				                            <a href="<?php echo esc_url( $settings['banner_video_link'] ); ?>" class="video-btn popup-video">
				                            	<?php if( $settings['video_icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $settings['banner_video_icon1'] ); ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $settings, 'icon', 'banner_video_icon2' ); 
				                            	endif; ?>
				                            </a>
				                        </div>
		                            <?php endif; ?>
		                            <span><?php echo esc_html__($settings['banner_video_title']); ?></span>
		                        </div>
		                    </div>
	                    	<div class="col-lg-6 col-md-12">
		                        <div class="ea-page-banner-content">
		                            <<?php echo esc_attr($settings['ea_title_tag']); ?> class="banner-title"><?php echo esc_html($settings['banner_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
		                            <?php if($settings['ea_content_text_type'] == 'content') : ?>
		                                <p><?php echo wp_kses_post($settings['banner_desc']); ?></p>
		                            <?php elseif($settings['ea_content_text_type'] == 'template') : ?>
		                            	<p>
		                            		<?php if (!empty($settings['ea_content_templates'])) {
								                echo Plugin::$instance->frontend->get_builder_content($settings['ea_content_templates'], true);
								            } ?>
		                            	</p>
		                            <?php endif; ?>
		                            <?php if( ! $settings['banner_btn_text'] == '' ) : ?>
			                            <a href="<?php echo esc_url($settings['banner_btn_link']['url']); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?> class="banner-default-btn">
			                            	<?php if( $settings['icon_type'] == 'general' ) : ?>
			                            	    <i class="<?php echo wp_kses_post( $settings['banner_btn_icon1'] ); ?>"></i>
			                            	<?php else: 
			                            		endad_render_icon( $settings, 'icon', 'banner_btn_icon2' ); 
			                            	endif; ?>
			                            	<?php echo esc_html__($settings['banner_btn_text']); ?>  
			                            </a>
		                            <?php endif; ?>
		                        </div>
		                    </div>
                            <style>
		                    	.ea-page-banner-area::before {
							    	clip-path: polygon(0% 53.5%, 100% 100%, 100% 100%, 0 100%);
							    }
		                    </style>
	                    <?php endif; ?>
	                </div>
	            </div>
	        </div>
	        <!-- End Page Banner Area -->
        <?php endif; ?>

        <?php if( $settings['banner_custom_style'] == 'style-1' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(to right, <?php echo esc_attr( $settings['banner_bg1_color'] ); ?>, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?>) !important;
			    }
	        </style>

        <?php elseif( $settings['banner_custom_style'] == 'style-2' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(45deg,  <?php echo esc_attr( $settings['banner_bg1_color'] ); ?> 0%, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?> 100%) !important;
			    }
	        </style>
        
        <?php elseif( $settings['banner_custom_style'] == 'style-3' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(77deg, <?php echo esc_attr( $settings['banner_bg1_color'] ); ?> 0%, <?php echo esc_attr( $settings['banner_bg12_color'] ); ?> 35%, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?> 100%) !important;
			    }
	        </style>

	    <?php elseif( $settings['banner_custom_style'] == 'style-4' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(280deg, <?php echo esc_attr( $settings['banner_bg1_color'] ); ?> 0%, <?php echo esc_attr( $settings['banner_bg12_color'] ); ?> 35%, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?> 100%) !important;
			    }
	        </style>

	    <?php elseif( $settings['banner_custom_style'] == 'style-5' || $settings['banner_custom_style'] == 'style-7' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(77deg, <?php echo esc_attr( $settings['banner_bg1_color'] ); ?> 0%, <?php echo esc_attr( $settings['banner_bg12_color'] ); ?> 35%, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?> 100%) !important;
			    }
	        </style>

	    <?php elseif( $settings['banner_custom_style'] == 'style-6' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(to bottom, <?php echo esc_attr( $settings['banner_bg1_color'] ); ?>, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?>) !important;
			    }
	        </style>

	    <?php elseif( $settings['banner_custom_style'] == 'style-9' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(to right bottom, <?php echo esc_attr( $settings['banner_bg1_color'] ); ?>, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?>) !important;
			    }
	        </style>

	    <?php elseif( $settings['banner_custom_style'] == 'style-10' ) : ?>

	        <style>
	        	.ea-page-banner-area {
	        		background: linear-gradient(to left, <?php echo esc_attr( $settings['banner_bg1_color'] ); ?>, <?php echo esc_attr( $settings['banner_bg2_color'] ); ?>) !important;
			    }
	        </style>

        <?php endif; 

    }

}
