(function( $ ) {
	wp.customize.bind( 'ready', function() {

		var optPrefix = '#customize-control-spa_sauna_options-';
		
		// Label
		function spa_sauna_customizer_label( id, title ) {

			// Site Identity

			if ( id === 'custom_logo' || id === 'site_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Global Color Setting

			if ( id === 'spa_sauna_global_color' || id === 'spa_sauna_heading_color' || id === 'spa_sauna_paragraph_color') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// General Setting

			if ( id === 'spa_sauna_scroll_hide' || id === 'spa_sauna_preloader_hide' || id === 'spa_sauna_sticky_header' || id === 'spa_sauna_products_per_row' || id === 'spa_sauna_scroll_top_position' || id === 'spa_sauna_products_per_row' || id === 'spa_sauna_width_option' || id === 'spa_sauna_nav_menu_text_transform')  {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Colors

			if ( id === 'spa_sauna_theme_color' || id === 'background_color' || id === 'background_image' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Header Image

			if ( id === 'header_image' || id === 'spa_sauna_post_layout' || id === 'spa_sauna_404_page_main_heading' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Social Icon

			if ( id === 'spa_sauna_facebook_icon' || id === 'spa_sauna_twitter_icon' || id === 'spa_sauna_intagram_icon'|| id === 'spa_sauna_linkedin_icon'|| id === 'spa_sauna_pintrest_icon' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			//  Header
			
			if ( id === 'spa_sauna_header_button_text' || id === 'spa_sauna_topbar_timing' || id === 'spa_sauna_topbar_phone_number' || id === 'spa_sauna_topbar_email_id' || id === 'spa_sauna_topbar_location' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}


			// Slider

			if ( id === 'spa_sauna_slider_section_setting' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Pricing Plans

			if ( id === 'spa_sauna_activities_section_setting' || id === 'spa_sauna_pricing_section_icon_left1' || id === 'spa_sauna_pricing_center_image'  || id === 'spa_sauna_pricing_section_icon_right1') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Footer

			if ( id === 'spa_sauna_footer_widget_content_alignment' || id === 'spa_sauna_show_hide_copyright') {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Post Settings

			if ( id === 'spa_sauna_post_page_title' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}

			// Single Post Settings

			if ( id === 'spa_sauna_single_post_thumb' ) {
				$( '#customize-control-'+ id ).before('<li class="tab-title customize-control">'+ title  +'</li>');
			} else {
				$( '#customize-control-spa_sauna_options-'+ id ).before('<li class="tab-title customize-control">'+ title +'</li>');
			}
			
		}

	    // Site Identity
		spa_sauna_customizer_label( 'custom_logo', 'Logo Setup' );
		spa_sauna_customizer_label( 'site_icon', 'Favicon' );

		// Global Color Setting
		spa_sauna_customizer_label( 'spa_sauna_global_color', 'Global Color' );
		spa_sauna_customizer_label( 'spa_sauna_heading_color', 'Heading Typography' );
		spa_sauna_customizer_label( 'spa_sauna_paragraph_color', 'Paragraph Typography' );

		// General Setting
		spa_sauna_customizer_label( 'spa_sauna_preloader_hide', 'Preloader' );
		spa_sauna_customizer_label( 'spa_sauna_sticky_header', 'Sticky Header' );
		spa_sauna_customizer_label( 'spa_sauna_scroll_hide', 'Scroll To Top' );
		spa_sauna_customizer_label( 'spa_sauna_scroll_top_position', 'Scroll to top Position' );
		spa_sauna_customizer_label( 'spa_sauna_products_per_row', 'woocommerce Setting' );
		spa_sauna_customizer_label( 'spa_sauna_width_option', 'Site Width Layouts' );
		spa_sauna_customizer_label( 'spa_sauna_nav_menu_text_transform', 'Nav Menus Text Transform' );

		// Colors
		spa_sauna_customizer_label( 'spa_sauna_theme_color', 'Theme Color' );
		spa_sauna_customizer_label( 'background_color', 'Colors' );
		spa_sauna_customizer_label( 'background_image', 'Image' );

		//Header Image
		spa_sauna_customizer_label( 'header_image', 'Header Image' );

		spa_sauna_customizer_label( 'spa_sauna_post_layout', 'Post Layouts Settings' );

		spa_sauna_customizer_label( 'spa_sauna_404_page_main_heading', '404 Page Settings' )

		// Social Icon
		spa_sauna_customizer_label( 'spa_sauna_facebook_icon', 'Facebook' );
		spa_sauna_customizer_label( 'spa_sauna_twitter_icon', 'Twitter' );
		spa_sauna_customizer_label( 'spa_sauna_intagram_icon', 'Intagram' );
		spa_sauna_customizer_label( 'spa_sauna_linkedin_icon', 'Linkedin' );
		spa_sauna_customizer_label( 'spa_sauna_pintrest_icon', 'Pintrest' );

		// Header 
		spa_sauna_customizer_label( 'spa_sauna_header_button_text', 'Header Button' );
		spa_sauna_customizer_label( 'spa_sauna_topbar_timing', 'Topbar Text' );
		spa_sauna_customizer_label( 'spa_sauna_topbar_phone_number', 'Phone Number' );
		spa_sauna_customizer_label( 'spa_sauna_topbar_location', 'Location' );
		spa_sauna_customizer_label( 'spa_sauna_topbar_email_id', 'Email ID' );

		//Slider
		spa_sauna_customizer_label( 'spa_sauna_slider_section_setting', 'Slider' );

		//Pricing Plans
		spa_sauna_customizer_label( 'spa_sauna_activities_section_setting', 'Pricing Plans' );
		spa_sauna_customizer_label( 'spa_sauna_pricing_section_icon_left1', 'Pricing Left' );
		spa_sauna_customizer_label( 'spa_sauna_pricing_center_image', 'Pricing Center Image' );
		spa_sauna_customizer_label( 'spa_sauna_pricing_section_icon_right1', 'Pricing Right' );

		//Footer
		spa_sauna_customizer_label( 'spa_sauna_footer_widget_content_alignment', 'Footer' );
		spa_sauna_customizer_label( 'spa_sauna_show_hide_copyright', 'Copyright' );

		//Post setting
		spa_sauna_customizer_label( 'spa_sauna_post_page_title', 'Post Settings' );

		//Single post setting
		spa_sauna_customizer_label( 'spa_sauna_single_post_thumb', 'Single Post Settings' );
	

	});

})( jQuery );
