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

	/**
	 * Get widget name.
	 *
	 * Retrieve Menu Bar widget name.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'menu-bar';
	}

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

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

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

	/**
	 * Register Menu Bar 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_menu_area',
			[
				'label' => __( 'Show/Hide Menu Area', '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(
			'show_menu_section',
			[
				'label' => __( 'Show/Hide Menu 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(
			'show_top_bar',
			[
				'label' => __( 'Show/Hide Top Bar', '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,
				'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
			]
		);

		$this->add_control(
			'show_menu_bar',
			[
				'label' => __( 'Show/Hide Menu Bar', '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(
			'show_side_bar',
			[
				'label' => __( 'Show/Hide SideBar', '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_menu_bar_style',
			[
				'label' => __( 'Select Menu Bar 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' ),
					'style-10' => __( 'Style 10', 'endless-addons' )
				],
				'default' => 'style-01'
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'menu_bar_section',
			[
				'label' => __( 'Menu Bar 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'  => __( 'Menubar 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-wrapper-area',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'menu_bar_language',
			[
				'label' => __( 'Menu Bar Language', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07', 'style-08', 'style-09', 'style-10')
                ]
			]
		);

        $this->add_control(
			'menu_show_language',
			[
				'label' => __( 'Show Menu Language Switcher', '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(
            'menu_language_shortcode',
            [
                'label' => __( 'Shortcode', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __( '[GTranslate]', 'endless-addons' ),
                'condition' => [
                    'menu_show_language' => 'show'
                ]
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
			'menu_bar_signin',
			[
				'label' => __( 'Menu Bar Signin', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07', 'style-09')
                ]
			]
		);

        $this->add_control(
			'menu_show_signin',
			[
				'label' => __( 'Show Menu Signin', '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(
            'menu_signin_text',
            [
                'label' => __( 'Signin Text', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __( 'Sign In', 'endless-addons' ),
                'condition' => [
                    'menu_show_signin' => 'show',
                    'select_menu_bar_style' => array('style-01', 'style-02', 'style-04', 'style-05')
                ]
            ]
        );

        $this->add_control(
			'signin_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',
				'condition' => [
                    'menu_show_phone' => 'show',
                    'select_menu_bar_style' => array('style-06', 'style-07', 'style-09')
                ]
			]
		);

        $this->add_control(
			'menu_signin_icon1', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'show_label' => true,
				'default' => 'bx bxs-user',
				'options' => endless_addons_icons(),
				'condition' => [
                    'signin_icon_type' => 'general',
                    'menu_show_signin' => 'show'
                ]
			]
		);

		$this->add_control(
			'menu_signin_icon2', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICONS,
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'signin_icon_type' => 'library',
                    'menu_show_signin' => 'show'
                ]
			]
		);

        $this->add_control(
            'menu_signin_link',
            [
                'label' => __( 'Signin Link', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __( '#', 'endless-addons' ),
                'condition' => [
                    'menu_show_signin' => 'show'
                ]
            ]
        );

		$this->end_controls_section();

		$this->start_controls_section(
			'menu_bar_phone',
			[
				'label' => __( 'Menu Bar Phone', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
				'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-03', 'style-04', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
			]
		);

        $this->add_control(
			'menu_show_phone',
			[
				'label' => __( 'Show Menu Phone', '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(
			'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',
				'condition' => [
                    'menu_show_phone' => 'show'
                ]
			]
		);

        $this->add_control(
			'menu_phone_icon1', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'show_label' => true,
				'default' => 'bx bxs-phone-call',
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'general',
                    'menu_show_phone' => 'show'
                ]
			]
		);

		$this->add_control(
			'menu_phone_icon2', [
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICONS,
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'library',
                    'menu_show_phone' => 'show'
                ]
			]
		);

        $this->add_control(
            'menu_phone_number',
            [
                'label' => __( 'Phone Number', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __( '+1 (514) 312-4433', 'endless-addons' ),
                'condition' => [
                    'menu_show_phone' => 'show'
                ]
            ]
        );

        $this->add_control(
            'menu_phone_link',
            [
                'label' => __( 'Phone Number Link', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __( 'tel:+1-(514)-312-4433', 'endless-addons' ),
                'condition' => [
                    'menu_show_phone' => 'show'
                ]
            ]
        );

        $this->end_controls_section();

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

		$this->add_control(
			'menu_show_social',
			[
				'label' => __( 'Show Menu Social', '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',
				'description' => 'Used only style-02, style-05, style-06, style-07, style-08',
				'toggle' => true
			]
		);

		$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_link',
			[
				'label' => __( 'Link', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::URL,
				'input_type' => 'url',
				'default' => [
					'url' => '#',
					'is_external' => true,
					'nofollow' => true
				]
			]
		);

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

		$this->end_controls_section();

		$this->start_controls_section(
			'menu_bar_content',
			[
				'label' => __( 'Menu Bar Content', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

        $this->add_control(
            'ea_main_menu', [
                'label' => __( 'Select Menu', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'options' => endless_addons_get_menu_array()
            ]
        );

        $this->add_control(
            'is_sticky',
            [
                'label' => __( 'Sticky Menu', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __( 'Yes', 'endless-addons' ),
                'label_off' => __( 'No', 'endless-addons' ),
                'return_value' => 'yes',
                'default' => 'no'
            ]
        );

		$this->add_control(
			'menu_show_btn',
			[
				'label' => __( 'Show/Hide Button', '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,
				'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02')
                ]
			]
		);

		$this->add_control(
            'menu_btn_text',
            [
                'label' => __( 'Button Text', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::TEXT,
                'default' => __( 'Get The Plugin', 'endless-addons' ),
                'condition' => [
                    'menu_show_btn' => 'show'
                ]
            ]
        );

        $this->add_control(
            'menu_btn_link_type',
            [
                'label' => esc_html__( 'Button Link Type', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'label_block' => true,
                'options' => [
                    '1'  => esc_html__( 'Link To Page', 'endless-addons' ),
                    '2' => esc_html__( 'External Link', 'endless-addons' )
                ], 
                'default' => '2',
                'condition' => [
                    'menu_show_btn' => 'show'
                ]
            ]
        );

        $this->add_control(
            'menu_btn_link_to_page',
            [
                'label' => esc_html__( 'Button Link Page', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'label_block' => true,
                'options' => endless_addons_get_page_as_list(),
                'condition' => [
                    'menu_btn_link_type' => '1',
                    'menu_show_btn' => 'show'
                ]
            ]
        );

        $this->add_control(
            'menu_btn_link',
            [
                'label'=> esc_html__('Button External Link', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::URL,
                'input_type' => 'url',
                'default' => [
                    'url' => '#',
                    'is_external' => true,
                    'nofollow' => true
                ],
                'condition' => [
                    'menu_btn_link_type' => '2',
                    'menu_show_btn' => 'show'
                ]
            ]
        );

        $this->add_control(
			'menu_show_sidebar_btn',
			[
				'label' => __( 'Show Sidebar Button', '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(
			'menu_show_search',
			[
				'label' => __( 'Show Menu Bar Search', '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,
				'condition' => [
                    'select_menu_bar_style' => array('style-04', 'style-05', 'style-06', 'style-07', 'style-08', 'style-09', 'style-10')
                ]
			]
		);

		$this->add_control(
			'menu_search_ph_text',
			[
				'label' => __( 'Search Placeholder Text', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Text', 'endless-addons' ),
				'default'  => __( 'Search for...', 'endless-addons' ),
				'condition' => [
                    'menu_show_search' => 'show',
                    'select_menu_bar_style' => array('style-04', 'style-05', 'style-06', 'style-07', 'style-08', 'style-09', 'style-10')
                ]
			]
		);

		$this->add_control(
			'menu_show_cart',
			[
				'label' => __( 'Show Menu Bar Cart', '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,
				'condition' => [
                    'select_menu_bar_style' => array('style-06', 'style-07', 'style-09')
                ]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'menu_bar_images',
			[
				'label' => __( 'Menu Bar Images', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'menu_bar_bg_img', [
				'label' => __( 'Background Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
                'show_label' => true,
			]
		);

		$this->add_control(
            'menu_main_logo',
            [
                'label' => __( 'Main Logo', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'show_label' => true
            ]
        );

		$this->end_controls_section();

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

		$this->add_control(
			'menu_sidebar_desc',
			[
				'label' => __( 'Sidebar Description', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'input_type' => 'textarea',
				'placeholder' => __( 'Description', 'endless-addons' ),
				'default' => __( 'Endless Addons Lorem ipsum dolor, sit amet consectetur adipisicing elit. Placeat voluptate perspiciatis eius laborum minus error illum mollitia distinctio deleniti reiciendis eaque adipisci architecto corrupti totam labore possimus, culpa dolore sint!', 'endless-addons')
			]
		);

		$this->add_control(
			'sidebar_show_contact',
			[
				'label' => __( 'Show Sidebar Contact', '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(
			'menu_sidebar_contact_title',
			[
				'label' => __( 'Sidebar Contact Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Contact Us', 'endless-addons' )
			]
		);

		$repeater = new \Elementor\Repeater();

		$repeater->add_control(
			'sidebar_contact_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(
			'sidebar_contact_icon1', 
			[
				'label' => __( 'Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'input_type' => 'icon',
				'default'  => 'bx bx-location-plus',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'sidebar_contact_icon_type' => 'general'
                ]
			]
		);

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

		$repeater->add_control(
			'sidebar_contact_details',
			[
				'label' => __( 'Contact Details', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'input_type' => 'textarea',
				'placeholder' => __( 'Description', 'endless-addons' )
			]
		);

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

		$this->add_control(
			'sidebar_show_social',
			[
				'label' => __( 'Show Sidebar Social', '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(
			'menu_sidebar_social_title',
			[
				'label' => __( 'Sidebar Social Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Sidebar Follow', 'endless-addons' )
			]
		);

		$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_bg_color',
			[
				'label' => __( 'Section Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wrapper-area' => 'background: {{VALUE}}'
                ]
			]
		);

		$this->add_control(
			'section_title_color',
			[
				'label' => __( 'Section Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wrapper-area .section-title 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-wrapper-area .section-title h2'
            ]
        );

        $this->add_control(
			'section_desc_color',
			[
				'label' => __( 'Section Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-wrapper-area .section-title 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-wrapper-area .section-title p'
            ]
        );

		$this->end_controls_section();

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

		$this->add_control(
			'menu_area_bg_color',
			[
				'label' => __( 'Menu Area Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-header-area' => 'background: {{VALUE}}'
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
			]
		);

		$this->add_control(
			'menu_bar_bg_color',
			[
				'label' => __( 'Menu Bar Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-navbar-area, .ea-header-area .ea-navbar-area .ea-nav' => 'background: {{VALUE}} !important'
                ]
			]
		);

		$this->add_control(
            'menu_bar_padding',
            [
                'label'         => esc_html__( 'Menu Item Padding', 'endless-addons' ),
                'type'          => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units'    => [ 'px', '%', 'em' ],
                'selectors'     => [
                    '{{WRAPPER}} .ea-navbar-area ul li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_control(
            'menu_bar_margin',
            [
                'label'         => esc_html__( 'Menu Item Margin', 'endless-addons' ),
                'type'          => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units'    => [ 'px', '%', 'em' ],
                'selectors'     => [
                    '{{WRAPPER}} .ea-navbar-area ul li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $this->add_control(
            'menu_bar_item_color',
            [
                'label' => esc_html__( 'Menu Item Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-navbar-area ul li a, .ea-navbar-area ul li ul.dropdown-menu li a' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'menu_bar_item_hover_color',
            [
                'label' => esc_html__( 'Menu Item Hover Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-navbar-area ul li a:hover, .ea-navbar-area ul li ul.dropdown-menu li a:hover' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'menu_bar_btn_bg_color',
            [
                'label' => esc_html__( 'Button Background Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-navbar-area .ea-nav .navbar .others-option .option-item .default-btn' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02')
                ]
            ]
        );

        $this->add_control(
            'menu_bar_btn_text_color',
            [
                'label' => esc_html__( 'Button Text Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-navbar-area .ea-nav .navbar .others-option .option-item .default-btn' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02')
                ]
            ]
        );

        $this->end_controls_section();

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

        $this->add_control(
            'side_bar_open_btn_color',
            [
                'label' => esc_html__( 'Open Button Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-navbar-area .ea-nav .navbar .others-option .option-item .sidebar-menu i' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'side_bar_open_btn_bg_color',
            [
                'label' => esc_html__( 'Open Button Background Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-navbar-area.ea-navbar-style-three .ea-nav .navbar .others-option .option-item .sidebar-menu' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => 'style-03'
                ]
            ]
        );

        $this->add_control(
            'side_bar_close_btn_color',
            [
                'label' => esc_html__( 'Close Button Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-sidebar-modal .sidebar-header .close-btn' => 'color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'side_bar_close_btn_bg_color',
            [
                'label' => esc_html__( 'Close Button Background Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-sidebar-modal .sidebar-header .close-btn' => 'background-color: {{VALUE}}',
                ],
            ]
        );

		$this->end_controls_section();

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

        $this->add_control(
            'menu_mobile_button_color',
            [
                'label' => esc_html__( 'Mobile Menu Open Button Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-responsive-nav .mean-container a.meanmenu-reveal span' => 'background-color: {{VALUE}}',
                ],
            ]
        );

        $this->add_control(
            'menu_mobile_close_color',
            [
                'label' => esc_html__( 'Mobile Menu Cross Sign Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-navbar-area .mean-bar a.meanmenu-reveal' => 'color: {{VALUE}}',
                ],
            ]
        );

		$this->end_controls_section();

		$this->start_controls_section(
			'menu_bar_additional_style',
			[
				'label' => __( 'Additional Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);
        
        $this->add_control(
            'phone_item_color',
            [
                'label' => esc_html__( 'Phone Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-top-header .ea-header-left-content li a, .ea-header-area .ea-navbar-area.ea-navbar-style-three .ea-nav .navbar .others-option .option-item .call-us, .ea-header-area .ea-navbar-area.ea-navbar-style-six .ea-nav .navbar .others-option .option-item .call-us' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-03', 'style-04', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
            ]
        );

        $this->add_control(
            'phone_bg_color',
            [
                'label' => esc_html__( 'Phone Background Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-navbar-area.ea-navbar-style-three .ea-nav .navbar .others-option .option-item .call-us' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => 'style-03'
                ]
            ]
        );

        $this->add_control(
            'phone_item_hover_color',
            [
                'label' => esc_html__( 'Phone Hover Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-top-header .ea-header-left-content li a:hover, .ea-header-area .ea-navbar-area.ea-navbar-style-three .ea-nav .navbar .others-option .option-item .call-us:hover, .ea-header-area .ea-navbar-area.ea-navbar-style-six .ea-nav .navbar .others-option .option-item .call-us:hover' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-03', 'style-04', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
            ]
        );

        $this->add_control(
            'logo_bg_color',
            [
                'label' => esc_html__( 'Logo Background Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-navbar-area.ea-navbar-style-ten .ea-nav .navbar .navbar-brand::before' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => 'style-10'
                ]
            ]
        );

        $this->add_control(
            'mini_cart_color',
            [
                'label' => esc_html__( 'Cart Icon Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-header-right-content li a.cart i, .ea-header-area .ea-navbar-area .ea-nav .navbar .others-option .option-item .cart i' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-06', 'style-07', 'style-09')
                ]
            ]
        );

        $this->add_control(
            'mini_cart_hover_color',
            [
                'label' => esc_html__( 'Cart Icon Hover Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-header-right-content li a.cart i:hover, .ea-header-area .ea-navbar-area .ea-nav .navbar .others-option .option-item .cart i:hover' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-06', 'style-07', 'style-09')
                ]
            ]
        );

        $this->add_control(
            'mini_cart_count_color',
            [
                'label' => esc_html__( 'Cart Count Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-header-right-content li a.cart .mini-cart-count, .ea-header-area .ea-navbar-area.ea-navbar-style-nine .ea-nav .navbar .others-option .option-item .cart span' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-06', 'style-07', 'style-09')
                ]
            ]
        );

        $this->add_control(
            'mini_cart_count_bg_color',
            [
                'label' => esc_html__( 'Cart Count Background Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-header-right-content li a.cart .mini-cart-count, .ea-header-area .ea-navbar-area.ea-navbar-style-nine .ea-nav .navbar .others-option .option-item .cart span' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-06', 'style-07', 'style-09')
                ]
            ]
        );

        $this->add_control(
            'signin_item_color',
            [
                'label' => esc_html__( 'Signin Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-top-header .ea-header-right-content li a.signin, .ea-header-area .ea-navbar-area.ea-navbar-style-nine .ea-nav .navbar .others-option .option-item .user, .ea-header-area .ea-navbar-area.ea-navbar-style-seven .ea-nav .navbar .others-option .option-item .user i' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07', 'style-09')
                ]
            ]
        );

        $this->add_control(
            'signin_item_hover_color',
            [
                'label' => esc_html__( 'Signin Hover Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-top-header .ea-header-right-content li a.signin:hover, .ea-header-area .ea-navbar-area.ea-navbar-style-nine .ea-nav .navbar .others-option .option-item .user:hover, .ea-header-area .ea-navbar-area.ea-navbar-style-seven .ea-nav .navbar .others-option .option-item .user i:hover' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-01', 'style-02', 'style-04', 'style-05', 'style-06', 'style-07', 'style-09')
                ]
            ]
        );

        $this->add_control(
            'social_item_color',
            [
                'label' => esc_html__( 'Social Item Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-top-header .ea-header-left-content li a i, .ea-wrapper-area .ea-header-area .ea-navbar-area .ea-nav .navbar .others-option .option-item .social-link li a i, .ea-header-area.style-eight .ea-header-right-content li a i' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-02', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
            ]
        );

        $this->add_control(
            'social_item_hover_color',
            [
                'label' => esc_html__( 'Social Item Hover Color', 'endless-addons' ),
                'type' => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .ea-header-area .ea-top-header .ea-header-left-content li a i:hover, .ea-wrapper-area .ea-header-area .ea-navbar-area .ea-nav .navbar .others-option .option-item .social-link li a i:hover, .ea-header-area.style-eight .ea-header-right-content li a i:hover' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'select_menu_bar_style' => array('style-02', 'style-05', 'style-06', 'style-07', 'style-08')
                ]
            ]
        );

		$this->end_controls_section();

	}

	/**
	 * Render Menu Bar 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['select_menu_bar_style'] == 'style-01' || $settings['select_menu_bar_style'] == 'style-02' ) :

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

	        $menu_btn_url = '';
	        if($settings['menu_btn_link_type'] == 1){
	            $menu_btn_url = get_page_link($settings['menu_btn_link_to_page']); 
	        } else {
	            $menu_btn_url = $settings['menu_btn_link']['url'];
	        }

        endif;

        $menu_main_logo = ! empty($settings['menu_main_logo']['url']) ? $settings['menu_main_logo']['url'] : '';

        if( $settings['is_sticky'] == 'yes' ):
            echo '<style>.ea-header-area.is-sticky{position:fixed !important;}</style>';
        else:
            echo '<style>.ea-header-area.is-sticky{position:initial !important;}</style>';
        endif;

		if( $settings['select_menu_bar_style'] == 'style-01' ) :
			$ea_wrapper_area = 'pb-100';
			$ea_header_area = 'ea-header-area';
			$ea_header_container_area = 'container';
			$ea_top_container_area = '';
			$ea_navbar_area = '';
			$bg_color = '';
			$phone_class = '';
			$ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-02' ) :
            $ea_wrapper_area = 'ptb-0';
            $ea_header_area = 'ea-header-area style-two';
            $ea_header_container_area = '';
            $ea_top_container_area = 'container';
            $ea_navbar_area = 'ea-navbar-style-two';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-03' ) :
	    	$ea_wrapper_area = 'pt-100';
            $ea_header_area = 'ea-header-area style-three';
            $ea_header_container_area = '';
            $ea_top_container_area = 'container';
            $ea_navbar_area = 'ea-navbar-style-three';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-04' ) :
	    	$ea_wrapper_area = 'ptb-100';
            $ea_header_area = 'ea-header-area style-four';
            $ea_header_container_area = '';
            $ea_top_container_area = 'container';
            $ea_navbar_area = 'ea-navbar-style-four';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-05' ) :
            $ea_wrapper_area = 'ptb-0';
            $ea_header_area = 'ea-header-area style-five';
            $ea_header_container_area = 'container';
            $ea_top_container_area = 'container';
            $ea_navbar_area = 'ea-navbar-style-five';
            $bg_color = 'bg-color';
            $phone_class = 'ms-3';
            $ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-06' ) :
	    	$ea_wrapper_area = 'ptb-100';
            $ea_header_area = 'ea-header-area style-six';
            $ea_header_container_area = 'container';
            $ea_top_container_area = 'container';
            $ea_navbar_area = 'ea-navbar-style-six';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-07' ) :
	    	$ea_wrapper_area = 'ptb-0';
            $ea_header_area = 'ea-header-area style-seven';
            $ea_header_container_area = 'container';
            $ea_top_container_area = 'container';
            $ea_navbar_area = 'ea-navbar-style-seven';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-08' ) :
            $ea_wrapper_area = 'ptb-100';
            $ea_header_area = 'ea-header-area style-eight';
            $ea_header_container_area = 'container';
            $ea_top_container_area = 'container';
            $ea_navbar_area = 'ea-navbar-style-eight';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container';
	    elseif( $settings['select_menu_bar_style'] == 'style-09' ) :
            $ea_wrapper_area = 'ptb-0';
            $ea_header_area = 'ea-header-area style-nine';
            $ea_header_container_area = '';
            $ea_top_container_area = '';
            $ea_navbar_area = 'ea-navbar-style-nine';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container-fluid';
	    elseif( $settings['select_menu_bar_style'] == 'style-10' ) :
            $ea_wrapper_area = 'ptb-100 bg-shape';
            $ea_header_area = 'ea-header-area style-ten';
            $ea_header_container_area = '';
            $ea_top_container_area = '';
            $ea_navbar_area = 'ea-navbar-style-ten';
            $bg_color = '';
            $phone_class = '';
            $ea_nav_container_area = 'container-fluid';
        endif;

		if( $settings['show_menu_area'] == 'show' ) : ?>
						
	        <!-- Start Navbar Design Area -->
	        <?php if( $settings['show_menu_section'] == 'show' ) : ?>
		        <div class="ea-wrapper-area <?php echo esc_attr($ea_wrapper_area); ?>">
		            <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>
		    <?php else: ?>
		    	<div class="ea-wrapper-area">
	        <?php endif; ?>
	            <?php if( $settings['menu_bar_bg_img']['url'] == '' ) : ?>
	                <header class="<?php echo esc_attr($ea_header_area); ?>"> 
	            <?php else: ?>
	                <header class="<?php echo esc_attr($ea_header_area); ?>" style="background-image:url(<?php echo esc_url( $settings['menu_bar_bg_img']['url'] ); ?>);">
	            <?php endif; ?>
	                <div class="<?php echo esc_attr($ea_header_container_area); ?>">
	                	<?php if( $settings['show_top_bar'] == 'show' ) : ?>
	                		<div class="<?php echo esc_attr($bg_color); ?>">
			                    <div class="ea-top-header">
			                    	<div class="<?php echo esc_attr($ea_top_container_area); ?>">
				                        <div class="row align-items-center">
				                            <div class="col-lg-6 col-sm-6">
				                                <ul class="ea-header-left-content">
				                                	<?php
				                                    if( $settings['menu_show_social'] == 'show' ) :
				                                    	if( $settings['select_menu_bar_style'] == 'style-02' || $settings['select_menu_bar_style'] == 'style-05' || $settings['select_menu_bar_style'] == 'style-06' ) :
					                                        foreach ( $settings['single_social_media'] as $item ) :
						                            		$target1 = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
						                                    $nofollow1 = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
							                            		<li>
							                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target1 ); ?> <?php echo wp_kses_post( $nofollow1 ); ?>>
							                                            <?php if( $item['icon_type'] == 'general' ) : ?>
										                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>"></i>
										                            	<?php else: 
										                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
										                            	endif; ?>
							                                        </a>
							                                    </li>
							                            	<?php endforeach;
					                            	    endif;
					                                endif; 
					                            	if( $settings['menu_show_phone'] == 'show' ) : if( $settings['select_menu_bar_style'] == 'style-01' || $settings['select_menu_bar_style'] == 'style-04' || $settings['select_menu_bar_style'] == 'style-05' || $settings['select_menu_bar_style'] == 'style-07' || $settings['select_menu_bar_style'] == 'style-08' ) : ?>
						                                    <li class="<?php echo esc_attr($phone_class); ?>">
						                                        <a href="<?php echo esc_html($settings['menu_phone_link']); ?>">
						                                            <?php if( $settings['icon_type'] == 'general' ) : ?>
							                                	    <i class="<?php echo wp_kses_post( $settings['menu_phone_icon1'] ); ?>"></i>
								                                	<?php else: 
								                                		endad_render_icon( $settings, 'icon', 'menu_phone_icon2' ); 
								                                	endif; ?>
						                                            <?php echo esc_html($settings['menu_phone_number']); ?>
						                                        </a>
						                                    </li>
					                                    <?php endif;
				                                    endif; ?>
				                                </ul>
				                            </div>
				    
				                            <div class="col-lg-6 col-sm-6">
				                                <ul class="ea-header-right-content">
				                                	<?php if( $settings['menu_show_language'] == 'show' ) : ?>
					                                    <li>
					                                        <?php echo do_shortcode($settings["menu_language_shortcode"]); ?>
					                                    </li>
				                                    <?php endif; ?>
				                                    <?php if( $settings['menu_show_signin'] == 'show' ) :
				                                    	if( $settings['select_menu_bar_style'] == 'style-01' || $settings['select_menu_bar_style'] == 'style-02' || $settings['select_menu_bar_style'] == 'style-04' || $settings['select_menu_bar_style'] == 'style-05' || $settings['select_menu_bar_style'] == 'style-06' ) : ?>
						                                    <li>
						                                        <a class="signin" href="<?php echo esc_url($settings['menu_signin_link']); ?>">
						                                        	<?php if( $settings['select_menu_bar_style'] == 'style-06' || $settings['select_menu_bar_style'] == 'style-09' ) :
						                                                if( $settings['signin_icon_type'] == 'general' ) : ?>
									                                	    <i class="<?php echo wp_kses_post( $settings['menu_signin_icon1'] ); ?>"></i>
										                                	<?php else: 
										                                		endad_render_icon( $settings, 'icon', 'menu_signin_icon2' ); 
									                                	endif;
						                                            else:
						                                            	echo esc_html($settings['menu_signin_text']);
								                                	endif; ?>
						                                        </a>
						                                    </li>
					                                    <?php endif;
				                                    endif;
				                                    if( $settings['menu_show_social'] == 'show' ) :
				                                    	if( $settings['select_menu_bar_style'] == 'style-08' ) :
					                                        foreach ( $settings['single_social_media'] as $item ) :
						                            		$target1 = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
						                                    $nofollow1 = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
							                            		<li>
							                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target1 ); ?> <?php echo wp_kses_post( $nofollow1 ); ?>>
							                                            <?php if( $item['icon_type'] == 'general' ) : ?>
										                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>"></i>
										                            	<?php else: 
										                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
										                            	endif; ?>
							                                        </a>
							                                    </li>
							                            	<?php endforeach;
					                            	    endif;
					                                endif;
				                                    if (class_exists('WooCommerce')):
				                                        if( $settings['menu_show_cart'] == 'show' ) :
				                                        	if( $settings['select_menu_bar_style'] == 'style-06' || $settings['select_menu_bar_style'] == 'style-07' || $settings['select_menu_bar_style'] == 'style-09' ) : ?>
						                                        <li>
						                                            <a href="<?php echo esc_url(wc_get_cart_url()) ?>" class="cart">
						                                                <i class='bx bx-cart'></i>
						                                                <span class="mini-cart-count"></span>
						                                            </a>
						                                        </li>
				                                            <?php endif;
				                                        endif;
				                                    endif; ?>
				                                </ul>
				                            </div>
				                        </div>
				                    </div>
			                    </div>
	                    <?php endif; ?>
	                    
	                    <?php if( $settings['show_menu_bar'] == 'show' ) : ?>
		                    <div class="ea-navbar-area is-sticky <?php echo esc_attr($ea_navbar_area); ?>">
		                        <div class="ea-responsive-nav">
		                            <div class="container">
		                            	<div class="ea-responsive-menu mean-container">
			                            	<div class="mean-bar">
							                    <a href="#nav" class="meanmenu-reveal">
													<span><span><span></span></span></span>
												</a>
												<nav class="mean-nav mean-menu">
													<?php
				                                    $ea_main_menu = ! empty($settings['ea_main_menu']) ? $settings['ea_main_menu'] : '';
				                                    $primary_nav_arg = [
				                                        'menu'            => $ea_main_menu,
				                                        'theme_location'  => 'menu-1',
				                                        'container'       => null,
				                                        'menu_class'      => 'navbar-nav m-auto',
				                                        'depth'           => 4,
				                                        'walker'          => new Endless_Addons_Bootstrap_Navwalker(),
				                                        'fallback_cb'     => 'Endless_Addons_Bootstrap_Navwalker::fallback',
				                                    ];
				        
				                                    $primary_nav_arg_primary = [
				                                        'menu'            => $ea_main_menu,
				                                        'theme_location'  => 'primary',
				                                        'container'       => null,
				                                        'menu_class'      => 'navbar-nav m-auto',
				                                        'depth'           => 4,
				                                        'walker'          => new Endless_Addons_Bootstrap_Navwalker(),
				                                        'fallback_cb'     => 'Endless_Addons_Bootstrap_Navwalker::fallback',
				                                    ];
				                            
				                                    if( has_nav_menu('menu-1') ) : wp_nav_menu( $primary_nav_arg ); 
				                                    elseif ( has_nav_menu('primary') ) : wp_nav_menu( $primary_nav_arg_primary );
				                                    else: 
				                                        if( is_user_logged_in() ) {
				                                        echo wp_kses_post( '<ul class="navbar-nav"><li class="nav-item"><a href="'.esc_url(home_url()).'/wp-admin/nav-menus.php">Create a menu</a></li></ul>', 'endless-addons' );
				                                        }
				                                        else{
				                                        echo wp_kses_post( '<ul class="navbar-nav"><li class="nav-item"><a href="'.esc_url(home_url()).'">Home</a></li></ul>', 'endless-addons' );
				                                        }
				                                    endif; ?>
												</nav>
											</div>
			                                <div class="logo">
			                                    <a href="<?php echo esc_url( home_url( '/' ) );?>">
				                                    <?php if( $menu_main_logo != '' ): ?>
				                                        <img src="<?php echo esc_url( $menu_main_logo ); ?>" alt="<?php bloginfo( 'name' ); ?>">
				                                    <?php else: ?>
				                                        <h4><?php bloginfo( 'name' ); ?></h4>
				                                    <?php endif; ?>
				                                </a>
			                                </div>
		                                </div>
		                            </div>
		                        </div>
		                        <div class="ea-nav">
		                            <div class="<?php echo esc_attr( $ea_nav_container_area ); ?>">
		                                <nav class="navbar navbar-expand-md navbar-light">
		                                    <a class="navbar-brand" href="<?php echo esc_url( home_url( '/' ) );?>">
			                                    <?php if( $menu_main_logo != '' ): ?>
			                                        <img src="<?php echo esc_url( $menu_main_logo ); ?>" alt="<?php bloginfo( 'name' ); ?>">
			                                    <?php else: ?>
			                                        <h4><?php bloginfo( 'name' ); ?></h4>
			                                    <?php endif; ?>
			                                </a>
		                                    <div class="collapse navbar-collapse">
		                                    	<div class="others-option d-flex align-items-center">
			                                    	<?php if( $settings['menu_show_sidebar_btn'] == 'show' ) : 
	                                                	if( $settings['select_menu_bar_style'] == 'style-09' ) : ?>
				                                            <div class="option-item">
					                                            <div class="sidebar-menu burger-menu">
					                                                <i class='bx bx-menu'></i>
					                                            </div>
					                                        </div>
				                                        <?php endif;
				                                    endif;
				                                    if( $settings['menu_show_search'] == 'show' ) : 
		                                                if( $settings['select_menu_bar_style'] == 'style-09' ) : ?>
			                                            	<div class="option-item">
					                                            <form action="<?php echo esc_url(home_url('/')); ?>" method="post" class="search-form">
				                                                    <input class="form-control" name="s" placeholder="<?php echo esc_html($settings['menu_search_ph_text']); ?>" type="text">
				                                                    <button class="search-button" type="submit">
				                                                        <i class="bx bx-search"></i>
				                                                    </button>
				                                                </form>
				                                            </div>
				                                        <?php endif;
			                                        endif; ?>
		                                        </div>
			                                    <?php $ea_main_menu = ! empty($settings['ea_main_menu']) ? $settings['ea_main_menu'] : '';
			                                    $primary_nav_arg = [
			                                        'menu'            => $ea_main_menu,
			                                        'theme_location'  => 'menu-1',
			                                        'container'       => null,
			                                        'menu_class'      => 'navbar-nav m-auto',
			                                        'depth'           => 4,
			                                        'walker'          => new Endless_Addons_Bootstrap_Navwalker(),
			                                        'fallback_cb'     => 'Endless_Addons_Bootstrap_Navwalker::fallback',
			                                    ];
			        
			                                    $primary_nav_arg_primary = [
			                                        'menu'            => $ea_main_menu,
			                                        'theme_location'  => 'primary',
			                                        'container'       => null,
			                                        'menu_class'      => 'navbar-nav m-auto',
			                                        'depth'           => 4,
			                                        'walker'          => new Endless_Addons_Bootstrap_Navwalker(),
			                                        'fallback_cb'     => 'Endless_Addons_Bootstrap_Navwalker::fallback',
			                                    ];
			                            
			                                    if( has_nav_menu('menu-1') ) : wp_nav_menu( $primary_nav_arg ); 
			                                    elseif ( has_nav_menu('primary') ) : wp_nav_menu( $primary_nav_arg_primary );
			                                    else: 
			                                        if( is_user_logged_in() ) {
			                                        echo wp_kses_post( '<ul class="navbar-nav"><li class="nav-item"><a href="'.esc_url(home_url()).'/wp-admin/nav-menus.php">Create a menu</a></li></ul>', 'endless-addons' );
			                                        }
			                                        else{
			                                        echo wp_kses_post( '<ul class="navbar-nav"><li class="nav-item"><a href="'.esc_url(home_url()).'">Home</a></li></ul>', 'endless-addons' );
			                                        }
			                                    endif; ?>
		                                        
		                                        <div class="others-option d-flex align-items-center">
		                                            <div class="option-item">
		                                            	<?php if( $settings['select_menu_bar_style'] == 'style-03' || $settings['select_menu_bar_style'] == 'style-06' ) :
			                                            	if( $settings['menu_show_phone'] == 'show' ) : ?>
				                                            	<a href="<?php echo esc_html($settings['menu_phone_link']); ?>" class="call-us">
					                                                <?php if( $settings['icon_type'] == 'general' ) : ?>
							                                	    <i class="<?php echo wp_kses_post( $settings['menu_phone_icon1'] ); ?>"></i>
								                                	<?php else: 
								                                		endad_render_icon( $settings, 'icon', 'menu_phone_icon2' ); 
								                                	endif; ?>
						                                            <?php echo esc_html($settings['menu_phone_number']); ?>
						                                        </a>
					                                        <?php endif;
				                                        endif; 
				                                        if( $settings['menu_show_btn'] == 'show' ) : ?>
			                                                <a href="<?php echo esc_url( $menu_btn_url ); ?>" <?php echo wp_kses_post( $target ); ?> <?php echo wp_kses_post( $nofollow ); ?> class="default-btn">
						                                        <?php echo esc_html__( $settings['menu_btn_text'] ); ?>
						                                    </a>
					                                    <?php endif; ?>
		                                            </div>
		                                            <?php if( $settings['menu_show_search'] == 'show' ) : 
		                                                if( $settings['select_menu_bar_style'] == 'style-04' || $settings['select_menu_bar_style'] == 'style-05' || $settings['select_menu_bar_style'] == 'style-08' || $settings['select_menu_bar_style'] == 'style-10' ) : ?>
			                                            	<div class="option-item">
					                                            <form action="<?php echo esc_url(home_url('/')); ?>" method="post" class="search-form">
				                                                    <input class="form-control" name="s" placeholder="<?php echo esc_html($settings['menu_search_ph_text']); ?>" type="text">
				                                                    <button class="search-button" type="submit">
				                                                        <i class="bx bx-search"></i>
				                                                    </button>
				                                                </form>
				                                            </div>
				                                        <?php endif;
				                                        if( $settings['select_menu_bar_style'] == 'style-06' || $settings['select_menu_bar_style'] == 'style-07' ) : ?>
				                                            <div class="option-item">
					                                           <i class="search-btn bx bx-search"></i>
					                                            <i class="close-btn bx bx-x"></i>
					                                            
					                                            <div class="search-overlay search-popup">
					                                                <div class='search-box'>
					                                                    <form action="<?php echo esc_url(home_url('/')); ?>" method="post" class="search-form">
						                                                    <input class="form-control" name="s" placeholder="<?php echo esc_html($settings['menu_search_ph_text']); ?>" type="text">
						                                                    <button class="search-button" type="submit">
						                                                        <i class="bx bx-search"></i>
						                                                    </button>
						                                                </form>
					                                                </div>
					                                            </div>
				                                            </div>
			                                            <?php endif;
	                                                endif;
	                                                if( $settings['select_menu_bar_style'] == 'style-09' || $settings['select_menu_bar_style'] == 'style-10' ) :
		                                                if( $settings['menu_show_language'] == 'show' ) : ?>
						                                    <div class="option-item">
						                                        <?php echo do_shortcode($settings["menu_language_shortcode"]); ?>
						                                    </div>
					                                    <?php endif;
				                                    endif;
				                                    if( $settings['menu_show_signin'] == 'show' && $settings['select_menu_bar_style'] == 'style-07' || $settings['menu_show_signin'] == 'show' && $settings['select_menu_bar_style'] == 'style-09' ) : ?>
					                                    <div class="option-item">
					                                        <a class="user" href="<?php echo esc_url($settings['menu_signin_link']); ?>">
					                                        	<?php
					                                                if( $settings['signin_icon_type'] == 'general' ) : ?>
								                                	    <i class="<?php echo wp_kses_post( $settings['menu_signin_icon1'] ); ?>"></i>
									                                	<?php else: 
									                                		endad_render_icon( $settings, 'icon', 'menu_signin_icon2' ); 
								                                	endif;
							                                	?>
					                                        </a>
					                                    </div>
				                                    <?php endif;
				                                    if (class_exists('WooCommerce')):
				                                        if( $settings['menu_show_cart'] == 'show' ) :
				                                        	if( $settings['select_menu_bar_style'] == 'style-09' ) : ?>
						                                        <div class="option-item">
						                                            <a href="<?php echo esc_url(wc_get_cart_url()) ?>" class="cart">
						                                                <i class='bx bx-cart'></i>
						                                                <span class="mini-cart-count"></span>
						                                            </a>
						                                        </div>
					                                        <?php endif;
					                                    endif;
				                                    endif;
				                                    if( $settings['menu_show_social'] == 'show' ) :
				                                    	if( $settings['select_menu_bar_style'] == 'style-07' ) : ?>
				                                    		<div class="option-item">
				                                    			<ul class="social-link">
							                                        <?php foreach ( $settings['single_social_media'] as $item ) :
								                            		$target1 = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
								                                    $nofollow1 = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
									                            		<li>
									                                        <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target1 ); ?> <?php echo wp_kses_post( $nofollow1 ); ?>>
									                                            <?php if( $item['icon_type'] == 'general' ) : ?>
												                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>"></i>
												                            	<?php else: 
												                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
												                            	endif; ?>
									                                        </a>
									                                    </li>
									                            	<?php endforeach; ?>
									                            </ul>
								                            </div>
					                            	    <?php endif;
					                                endif; 
	                                                if( $settings['menu_show_sidebar_btn'] == 'show' ) : 
	                                                	if( $settings['select_menu_bar_style'] == 'style-01' || $settings['select_menu_bar_style'] == 'style-02' || $settings['select_menu_bar_style'] == 'style-03' || $settings['select_menu_bar_style'] == 'style-04' || $settings['select_menu_bar_style'] == 'style-05' || $settings['select_menu_bar_style'] == 'style-06' || $settings['select_menu_bar_style'] == 'style-07' || $settings['select_menu_bar_style'] == 'style-08' || $settings['select_menu_bar_style'] == 'style-10' ) : ?>
				                                            <div class="option-item">
					                                            <div class="sidebar-menu burger-menu">
					                                                <i class='bx bx-menu'></i>
					                                            </div>
					                                        </div>
				                                        <?php endif;
			                                        endif; ?>
		                                        </div>
		                                    </div>
		                                </nav>
		                            </div>
		                        </div>

		                    </div>
	                    <?php endif; ?>
	                </div>
	            </header>
	        </div>
	        <!-- Start Sidebar Modal -->
	        <div class="ea-sidebar-modal ea-left-style-sidebar">
	            <div class="ea-sidebar-modal-inner">
					<div class="sidebar-header">
						<div class="sidebar-logo">
							<a href="<?php echo esc_url( home_url( '/' ) );?>">
                                <?php if( $menu_main_logo != '' ): ?>
                                    <img src="<?php echo esc_url( $menu_main_logo ); ?>" alt="<?php bloginfo( 'name' ); ?>">
                                <?php else: ?>
                                    <h4><?php bloginfo( 'name' ); ?></h4>
                                <?php endif; ?>
                            </a>
						</div>
						
						<span class="close-btn ea-sidebar-modal-close-btn">
							<i class="bx bx-x"></i>
						</span>
					</div>

	                <div class="sidebar-about">
	                    <div class="title">
	                        <p><?php echo wp_kses_post($settings['menu_sidebar_desc']); ?></p>
	                    </div>
	                </div>
                    <?php if( $settings['sidebar_show_contact'] == 'show' ) : ?>
		                <div class="contact-us">
		                    <h2><?php echo esc_html($settings['menu_sidebar_contact_title']); ?></h2>
		                    <ul>
		                    	<?php foreach ( $settings['sidebar_contact'] as $item ) : ?>
									<li>
										<?php if( $item['sidebar_contact_icon_type'] == 'general' ) : ?>
		                            	    <i class="<?php echo wp_kses_post( $item['sidebar_contact_icon1'] ); ?>"></i>
		                            	<?php else: 
		                            		endad_render_icon( $item, 'icon', 'sidebar_contact_icon2' ); 
		                            	endif; ?>
										<?php echo wp_kses_post($item['sidebar_contact_details']); ?>
									</li>
								<?php endforeach; ?>
							</ul>
						</div>
					<?php endif; ?>
                    <?php if( $settings['sidebar_show_social'] == 'show' ) : ?>
		                <div class="sidebar-follow-us">
							<h2><?php echo esc_html($settings['menu_sidebar_social_title']); ?></h2>
							<ul class="social-wrap">
		                        <?php foreach ( $settings['single_social_media'] as $item ) :
			                		$target1 = $item['social_media_link']['is_external'] ? ' target="_blank"' : '';
			                        $nofollow1 = $item['social_media_link']['nofollow'] ? ' rel="nofollow"' : ''; ?>
		                    		<li>
		                                <a href="<?php echo esc_url( $item['social_media_link']['url'] ); ?>" <?php echo wp_kses_post( $target1 ); ?> <?php echo wp_kses_post( $nofollow1 ); ?>>
		                                    <?php if( $item['icon_type'] == 'general' ) : ?>
			                            	    <i class="<?php echo wp_kses_post( $item['social_media_icon1'] ); ?>"></i>
			                            	<?php else: 
			                            		endad_render_icon( $item, 'icon', 'social_media_icon2' ); 
			                            	endif; ?>
		                                </a>
		                            </li>
		                    	<?php endforeach; ?>
			                </ul>
		                </div>
	                <?php endif; ?>
	            </div>
	        </div>
			<!-- End Sidebar Modal -->
	        <!-- End Navbar Design Area -->

        <?php endif;

    }

}
