  // JavaScript Document


var y, speed, pos, maxPos;

function headerScroll()
{
     console.log("function headerScroll time start");
console.time();
	
	 var $navi = $("#header"), scrollTop = 0;
    $(window).scroll(function () {
		
        y = $(this).scrollTop();
        speed = 0.05;
        pos = y * speed;
        maxPos = 100;
		
        if (y > scrollTop) {
            pos = maxPos;

        } else {
            pos = 0;



        }
        
        scrollTop = y;
	//	console.log("y = "+y + "pos = "+ pos); 
		if(y>=100){
      $(".search-box").fadeOut(300);
      $(".search-btn i").removeClass("fa-times");
      $(".search-btn i").addClass("fa-search");
        if(y>=640){
			//$('.header-right-unit').addClass('pageScroll');

			}
			 $navi.css({
           // "-webkit-transform": "translateY(-" + pos + "%)",
            //"-moz-transform": "translateY(-" + pos + "%)",
            //"-o-transform": "translateY(-" + pos + "%)",
            //"transform": "translateY(-" + pos + "%)"
        });
			
		}else
    {
       //$('.header-right-unit').removeClass('pageScroll');
    }
    if(pos == 0){
     // $(".destination-link").css("display", "none");
    }

    if( $(window).scrollTop() <= 100 ) {
     // $(".destination-link").css("display", "block");
    }

		
if( $(window).scrollTop() >  bookingEnginePos ) {
	//$(".destination-link").addClass("deActive");
	$(".buttonResize").css({"opacity": "1", "z-index":"2", "width":"142"} );
  $(".home-header").css({ "width":"142"} );
  if (typeof glblPageTemplate != "undefined") {
  if (glblPageTemplate == "home-page" || glblPageTemplate == "overview-details") {
    if(safetyHygieneClosed == true){
      if($(window).width() > 767 ){ 
    $(".covid-update-info-wrapper").removeClass("activeInfo");
    $(".covid-band").removeClass("covid-band-active");
      }
    }
    }
  }
  } else
	{
    $(".buttonResize").css({"opacity": "0", "z-index":"-1" , "width":"0"} );
	$(".home-header").css({"width":"0"} );
    $(".availability-cta .booking-engine").hide();
    if (typeof glblPageTemplate != "undefined") {
    if (glblPageTemplate == "home-page" || glblPageTemplate == "overview-details") {
      if(safetyHygieneClosed == true){
        if($(window).width() > 767 ){
      //$(".covid-update-info-wrapper").addClass("activeInfo");
      //$(".covid-band").addClass("covid-band-active");
        }
      }
      }
    }
	}
		
      
    });



//Your code and orr loops
console.timeEnd();
  console.log("function headerScroll time End");

}




function menuAcoor()
{
    $('.ac-list > li.expanded > a').on('click', function(e) {
      e.preventDefault();
      if($(this).next('ul.sub-menu').is(':visible')) {
          $(this).removeClass('open');
          $(this).next('ul.sub-menu').slideUp();
      } else {
          $('.ac-list > li.expanded > a').removeClass('open');
          $(this).addClass('open');
          $('.ac-list > li.expanded > a').next('ul.sub-menu').slideUp();
          $(this).next('ul.sub-menu').slideToggle();
      }
    }); 
}

// $(document).ready(function(){
//   setTimeout(function(){
//     $(".banner-arrow-bottom").click(function(){
//       $("html, body").animate({ scrollTop: $("#intro-secn").offset().top - 100 + "px"}, 800);
//     });
//   }, 500);
    
// });

var freezeVp = function(e) {
  //  e.preventDefault();
};
function stopBodyScrolling (bool) {
    //if (bool === true) {
    //    document.body.addEventListener("touchmove", freezeVp, false);
	
    //} else {
    //    document.body.removeEventListener("touchmove", freezeVp, false);
	
    //}
}


var isOpenBookingWidgetClicked = false;
/*This function opens booking widget */
function openBookingEngine() {
    openReservationBookingWidget();
}

/*This function opens booking widget with Philae and Zahra calendar */
function openBookingEngineCruise() {
   
    fnBwSetHotelSelectedByHotelCode(glblCurrentPageHotelCode);
    openBookingEngine();

}



function openReservationBookingWidget() {

    if (!isOpenBookingWidgetClicked) {
        isOpenBookingWidgetClicked = true;
        // temp comment fnInitialiseCalanderAndConfigure();
        // temp added fnInitializeCruiseCalander();
        //temp comment  fnSetDefaulCODate();

    }

    // temp commenthowGenericMessageOnBookNow();

    if ($(window).width() <= 990) {
        // $("body, html").addClass("overflowHidden");

        $(".availability-cta .booking-engine").toggle();

        if ($(window).width() <= 767) {
            stopBodyScrolling(true);
        }


    }
    else {
        $(".availability-cta .booking-engine").toggle();

    }
    
}



function closeBookingEngine()
{
	if($(window).width()<= 990)
		 {
		  	//$("body, html").removeClass("overflowHidden"); 
			 stopBodyScrolling(false);
      		$(".availability-cta .booking-engine").toggle();
			 
		 }
	  else
		  {
			  $(".availability-cta .booking-engine").toggle();
	  
		  }
}

  var bookingEnginePos;
  $(window).load(function(){
    if ($('.bkhOffset').length){
      bookingEnginePos = $('.bkhOffset').offset().top;
    }
   // console.log(bookingEnginePos);
  });

$(document).ready(function(){

  var hotelMenuTab = $(".main-menu .hotel-menu-tab > a");
  var overviewLinkText = $(".main-menu > li.htl-tab a");

  if(window.location.href.indexOf("agra") > -1) {
    hotelMenuTab.text("Agra - The Oberoi Amarvilas");
    overviewLinkText.text("Resort Overview");

  }
  if(window.location.href.indexOf("bengaluru") > -1) {
    hotelMenuTab.text("Bengaluru - The Oberoi, Bengaluru");
    overviewLinkText.text("Hotel Overview");
  }
  if(window.location.href.indexOf("gurgaon") > -1) {
    hotelMenuTab.text("Gurgaon - The Oberoi, Gurgaon");
    overviewLinkText.text("Hotel Overview");
  }
  if(window.location.href.indexOf("jaipur") > -1) {
    hotelMenuTab.text("Jaipur - The Oberoi Rajvilas");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("kerala") > -1) {
    hotelMenuTab.text("Kerala - The Oberoi Vrinda, Luxury Kerala Cruiser");
    overviewLinkText.text("Cruiser Overview");
  }
  if(window.location.href.indexOf("kolkata") > -1) {
    hotelMenuTab.text("Kolkata - The Oberoi Grand");
    overviewLinkText.text("Hotel Overview");
  }
  if(window.location.href.indexOf("mumbai") > -1) {
    hotelMenuTab.text("Mumbai - The Oberoi, Mumbai");
    overviewLinkText.text("Hotel Overview");
  }
  if(window.location.href.indexOf("chandigarh") > -1) {
    hotelMenuTab.text("New Chandigarh - The Oberoi Sukhvilas Spa Resort");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("delhi") > -1) {
    hotelMenuTab.text("New Delhi - The Oberoi, New Delhi");
    overviewLinkText.text("Hotel Overview");
  }
  if(window.location.href.indexOf("ranthambhore") > -1) {
    hotelMenuTab.text("Ranthambhore - The Oberoi Vanyavilas Wildlife Resort");
    overviewLinkText.text("Resort Overview");
    }
    if (window.location.href.indexOf("bandhavgarh") > -1) {
        hotelMenuTab.text("Bandhavgarh - The Oberoi Vindhyavilas Wildlife Resort");
        overviewLinkText.text("Resort Overview");
    }
  if(window.location.href.indexOf("wfh") > -1) {
    hotelMenuTab.text("Shimla in the Himalayas - The Oberoi Wildflower Hall");
    overviewLinkText.text("Resort Overview");

  }
  if(window.location.href.indexOf("cecil") > -1) {
    hotelMenuTab.text("Shimla - The Oberoi Cecil");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("udaipur") > -1) {
    hotelMenuTab.text("Udaipur - The Oberoi Udaivilas");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("hasheesh") > -1) {
    hotelMenuTab.text("Sahl Hasheesh - The Oberoi Beach Resort");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("zahra") > -1) {
    hotelMenuTab.text("The Oberoi Zahra, Luxury Nile Cruiser");
    overviewLinkText.text("Cruiser Overview");
  }
  if(window.location.href.indexOf("philae") > -1) {
    hotelMenuTab.text("The Oberoi Philae, Luxury Nile Cruiser");
    overviewLinkText.text("Cruiser Overview");
  }
  if(window.location.href.indexOf("bali") > -1) {
    hotelMenuTab.text("Bali - The Oberoi Beach Resort");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("lombok") > -1) {
    hotelMenuTab.text("Lombok - The Oberoi Beach Resort");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("mauritius") > -1) {
    hotelMenuTab.text("Mauritius - The Oberoi Beach Resort");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("madina") > -1) {
    hotelMenuTab.text("Madina - The Oberoi, Madina");
    overviewLinkText.text("Hotel Overview");
  }
  if(window.location.href.indexOf("zorah") > -1) {
    hotelMenuTab.text("Dubai - The Oberoi Beach Resort, Al Zorah");
    overviewLinkText.text("Resort Overview");
  }
  if(window.location.href.indexOf("dubai") > -1) {
    hotelMenuTab.text("Dubai - The Oberoi, Dubai");
    overviewLinkText.text("Hotel Overview");
  }
  if(window.location.href.indexOf("marrakech") > -1) {
    hotelMenuTab.text("Morocco - The Oberoi, Marrakech");
    overviewLinkText.text("Hotel Overview");
  }

  

  var overViewLink2 = $(".header-logo-unit > a").attr("href");
  $(".main-menu > li.htl-tab a").attr("href", overViewLink2);


  $("#menu, #nav-icon").click(function(event){
      event.stopPropagation();
  });
/*---- code for language change start-----------------------*/
$('.language-component').click(function(){

  if(!$(this).hasClass('active'))
  {
    $(this).addClass('active');
    $('.language-menu').show();
  }
  else{
      $(this).removeClass('active');
      $('.language-menu').hide();
  }

});

    $('.language-menu ul li').click(function () {
        //  $('.language-menu ul li').removeClass('active');
        //  $(this).addClass('active');
        //var lan = $(this).attr('data-value');
        //$('.selected-language').text(lan);

        var tempLocationName = document.location.pathname + location.search;
        var thisLilanguage = $(this).data("value").toLowerCase();

        if ($(this).data("value").toLowerCase() == "en") {
            tempLocationName = tempLocationName.replace("/" + glblCurrentPageLanguageName + "/", "/");
        }
        else {
            var isLangageFoundInUrl = false;
            var allAvailablelanguage = [];
            $(".language-component .language-menu ul li").each(function () {
                allAvailablelanguage.push("/" + thisLilanguage+"/");
            });

            for (var i = 0; i < allAvailablelanguage.length; i++) {
                tempLocationName = tempLocationName.replace("/" + allAvailablelanguage[i] + "/", "/" + thisLilanguage + "/");

                if (tempLocationName.indexOf(allAvailablelanguage[i]) != -1) {
                    isLangageFoundInUrl = true;
                }
            }

            if (!isLangageFoundInUrl) {

                tempLocationName = "/" + thisLilanguage + tempLocationName.replace("//","");
            }
            
        }


        window.location = tempLocationName.replace("/en/", "/")
            .replace("/hotels-au-maroc-marrakech", "/hotels-in-morocco-marrakech")
            .replace("chambres-suites", "rooms-suites")
            .replace("fitness-au-spa", "spa-fitness")
            .replace("evenements", "events");

    });

$(document).mouseup(function (e) {
  var container = $(".language-component .language-menu"),
        containerParent = $('.language-component');
    if (!container.is(e.target) && container.has(e.target).length === 0 && !containerParent.is(e.target) && containerParent.has(e.target).length === 0) {
        container.hide();
        containerParent.removeClass('active');
    }
});


    $(function () {
        $(".language-component .language-menu ul li").each(function () {
            $(this).removeClass("active");
            $(".language-component .language-menu").hide();
            $(".language-component").removeClass("active");
            if (glblCurrentPageLanguageName.toLowerCase() == $(this).data("value").toLowerCase()) {
                console.log("data-value" + $(this).data("value").toLowerCase());
                $(this).addClass("active");
                $(".language-component .selected-language").html($(this).data("text"));
            }
        });
    });

/*---- code for language change end------------------------*/



  $(document).click(function(){
    $(".menu-container").removeClass("open");
  });

  $(".search-btn").click(function(){
    $(".search-box").fadeToggle(300);
$('.searchOverlay').toggleClass('active');
    $(this).find("i").toggleClass("fa-search");
    $(this).find("i").toggleClass("fa-times");
	  $('#desktopSearch').focus();
  });

  $(".close-search").click(function(){
    $(this).parents(".search-box").fadeOut(300);
$('.searchOverlay').toggleClass('active');
    $(".search-btn i").removeClass("fa-times");
    $(".search-btn i").addClass("fa-search");
  });

  if( $(window).width() <= 1024 ) {
   
    var leftMenu = $(".left-side-menu ul").html();
    var rightMenu = $(".right-side-menu ul").html();
    var rightMenuTop = $(".right-nav ul").html();
    var overViewLink = $(".header-logo-unit > a").attr("href");


    $(".hotel-menu-list").prepend("<li id='overview-link'><a href='javascript:;'>Overview</a></li>" + leftMenu + rightMenu + rightMenuTop);
    $("#overview-link a").attr("href", overViewLink);
    
    $(".hotel-menu-list .o-one-menu-wrap.o-one-menu-nodisplay-desktop").remove();

    $(".main-menu .hotel-menu-tab > a").click(function(){
      $(this).next(".hotel-menu-list").slideToggle();
      $(this).toggleClass("active");
    });
   
  

  

 



  $(".menu-hdng").click(function(){
    $(this).next(".menu-list").addClass("actv");
    //$(".backto-menu").show();
    $(".backto-menu span").addClass("actv2");
    $(".backto-menu span").removeClass("actv");
  });

  $(".menu-list > li > a").click(function(){
    $(this).next(".sub-menu-list").addClass("actv");
    $(".backto-menu span").addClass("actv3");
    $(".backto-menu span").removeClass("actv2");
    $(".backto-menu span").removeClass("actv");
  });

  $(".menu-close").click(function(){
    $(".menu-level-1, .menu-list, .sub-menu-list").removeClass("actv");
    $("body").removeClass("overflowHidden");
    $(".backto-menu").hide();
  });

  


  $(".menu-container").on('click', '.backto-menu span.actv', function() {
    if( $(".menu-level-1").hasClass("actv") ) {
        $(".hotel-menu-tab, .home-tab").show();
        $(".menu-level-1").removeClass("actv");

        $(".backto-menu span").removeClass("actv");

        $(".backto-menu").hide();
      }
  });

  $(".menu-container").on('click', '.backto-menu span.actv2', function() {
      $(".menu-list").removeClass("actv");

      $(".backto-menu span").removeClass("actv2");
      $(".backto-menu span").addClass("actv");
      
  });

  $(".menu-container").on('click', '.backto-menu span.actv3', function() {
      $(".sub-menu-list").removeClass("actv");

      $(".backto-menu span").removeClass("actv3");
      $(".backto-menu span").addClass("actv2");

  });
	  
//mobile main menu anchor set code for mobile	  
	  
//$(".mobLink").attr("href", "javascript:;");	  
	  
}

if( $(window).width() <= 1024 && $(window).width() > 991  ) {
  $(".main-menu > li.has-submenu:not(.type2) > a").click(function(){
    $(this).next(".menu-level-1").addClass("actv");
    $(".backto-menu").show();
    $(".backto-menu span").addClass("actv");
  });

   $(".main-menu > li.has-submenu:not(.type2)").click(function(){
    $(".hotel-menu-tab, .home-tab").hide();
  });

  

}

if( $(window).width() < 991 ) {
  $(".main-menu > li.has-submenu:not(.type2) > a").click(function(){

    $(this).next(".menu-level-1").toggleClass("actv");
    $(this).toggleClass("active");

  });

  $(".menu-hdng").click(function(){
    $(".backto-menu").show();
  });

  $(".menu-close").click(function(){
    $(".menu-container.mo-menu-conatiner .main-menu li.has-submenu>a").removeClass("active");
  });

  $(".menu-container").on('click', '.backto-menu span.actv2', function() {
    $(".backto-menu").hide();	
    $(".menu-container .main-menu>li:not(.has-submenu), .menu-container .social-menu, .menu-container .main-menu>li.type2").css("opacity","1");
  });

}
	

	
$(document).mouseup(function (e) {
  var container = $(".header-view-availability");
  if (!container.is(e.target) && container.has(e.target).length === 0 ) {
    container.find('.booking-engine').hide();
  }
});
	
	
});




function HamburgerOpen()
{
	var element = document.getElementById("nav-icon");
    var menu = document.getElementById("menu");
  //  var overlay = document.getElementById("overlay");
    element.classList.toggle("open");
    menu.classList.toggle("open");
   // overlay.classList.toggle("open");

    setTimeout(function(){
      $("body").addClass("overflowHidden");
    }, 800);

    
}

function MenuClose()
{
    var element = document.getElementById("nav-icon");
    var menu = document.getElementById("menu");
   // var overlay = document.getElementById("overlay");
    element.classList.toggle("open");
    menu.classList.toggle("open");
  //   overlay.classList.toggle("open");
}

function SecondLabelOpen()
{
     var sl = document.getElementById("second-label");
     sl.classList.toggle("open");
}
function backToFirst()
{
    var sl = document.getElementById("second-label");
     sl.classList.toggle("open"); 
}



//$(document).ready(function(){
//  
//  $(".banner-arrow-bottom").on('click', function(event) { 
//    if (this.hash !== "") {
//      event.preventDefault();
//      var hash = this.hash;
//     $('html, body').animate({
//        scrollTop: $(hash).offset().top-200
//      }, 500, function(){
//        window.location.hash = hash;
//      });
//    } 
//  });
//});
if($(window).width() < 767 ){
 $(".menu-container .main-menu .hotel-menu-tab>a").next(".menu-container .main-menu .hotel-menu-tab .hotel-menu-list").show();
 }
;
// JavaScript Document


$(window).load(function () {
    $(".banner-and-booking-widget .banner-image").height($(".banner-image > img").height());
    $(window).resize(function () {
        $(".banner-and-booking-widget .banner-image").height($(".banner-image > img").height());
    });
  //  $("html, body").scrollTop(0);


    if ($(window).width() > 767) {
        if (fnGetParameterByName("novideo") != "1") {
            setTimeout(function () {
                $("#videoPlayer").YTPlayer();
            }, 500);
        }



        $('#muteUnMute').click(function () {
            $(this).toggleClass('active');
            $("#videoPlayer").YTPToggleVolume()
        });
    }

});


$(document).ready(function(){

	
	
	
	$('.expand-video a').click(function(){
		
		var vUrl= $('.expand-video a').attr('data-videoUrl');
		
		$('#videoPlayer').YTPPause();
		
		$('#videoPopup').html('<button class="fullvideoClose"><img src="/images/oberoihotels/exotic-vacations/closeicon-white.svg"></button><iframe width="" height="" src="'+vUrl+'" frameborder="0" allow="autoplay" allowfullscreen allownetworking="internal"></iframe><div class="top-popup"><img src="/images/oberoihotels/common/Oberoi-HotelsResorts-white-logo.png" alt="" /></div>');
		$('#videoPopup').addClass('active');
							  
	});
	
	$(document).on('click', '.fullvideoClose', function () { 
 
		$('#videoPlayer').YTPPlay();
		
		$('#videoPopup').html('');
		
		$('#videoPopup').removeClass('active');
		
		
	});
	

	
});





$(window).scroll(function() {
 
	if($('#videoPlayer').length)
		{
	if( $(window).scrollTop() >  bookingEnginePos ) {
		$('#videoPlayer').YTPPause();
		console.log('video pause');
	}
	else
		{
			$('#videoPlayer').YTPPlay();
			console.log('video play');
		}
	}
});



$(window).load(function(){
	if ( window.location.href.indexOf('?film') > 0 || currenturlpathnamewithoutlanguage == '/film'  || currenturlpathnamewithoutlanguage == '/film/') 
	{
		$('.expand-video a').click();
		$('#videoPopup iframe').attr('src',"https://www.youtube.com/embed/ZvAHk0Tojao?autoplay=1&loop=1&rel=0&showinfo=0");
		
		if($(window).width()<= 991)
			{
				$('.video-btn').click()
			}
	}
	
	setTimeout(function(){
		$(window).resize();
	}, 300);
	setTimeout(function(){
		if( $(window).width() > 768 ) {
			$(".banner-image").addClass("disable");
			$(".banner-slide").addClass("disable");
		}
	}, 2000);
		setTimeout(function(){
				if ( window.location.href.indexOf('?film') > 0 || currenturlpathnamewithoutlanguage == '/film'  || currenturlpathnamewithoutlanguage == '/film/') {
					console.log('click again');
						$('.expand-video a').click();
							$('#videoPopup iframe').attr('src',"https://www.youtube.com/embed/ZvAHk0Tojao?autoplay=1&loop=1&rel=0&showinfo=0");
					if($(window).width()<= 991)
			{
				$('.video-btn').click()
			}

				}
			}, 2000);

	
});

var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -34.397, lng: 150.644},
          zoom: 8
        });
      }






function homePageBanner() {
	$(".udaivilas-banner").css({ 'overflow' : 'inherit'});
	$('.banner').slick({
		arrows:true,
		autoplay: true,
		dots: false,
		fade: true,
		speed: 2500,
    customPaging: function(slick,index) {
        return '<a href="javaScript:;">' + (index + 1) + '</a>';
    },
    responsive: [
		    {
		      breakpoint: 767,
		      settings: {
		        dots: false,
		        }
		    }
		    // You can unslick at a given breakpoint now by adding:
		    // settings: "unslick"
		    // instead of a settings object
		  ]

    
	});
}




/*    when you run this component indivisual uncomment below mnetion code

$(document).ready(function(){
	homePageBanner();
});

*/
;
// JavaScript Document
function desinationCarousel() {
	/*$('.destination-slider').slick({
		arrows:true,
		
		slidesToShow: 3,
		  slidesToScroll: 3,
		  infinite: true,
		  responsive: [
		    {
		      breakpoint: 767,
		      settings: {
		        slidesToShow: 2,
		        slidesToScroll: 2,
		        infinite: true,
		        }
		    },
		    {
		      breakpoint: 600,
		      settings: {
		        slidesToShow: 2,
		        slidesToScroll: 2
		      }
		    },
		    {
		      breakpoint: 480,
		      settings: {
		        slidesToShow: 1,
		        slidesToScroll: 1
		      }
		    }
		    // You can unslick at a given breakpoint now by adding:
		    // settings: "unslick"
		    // instead of a settings object
		  ]
		
	});*/
	
	$(".mo-oberoi-destination-tab-details-wrap .destination-slider, .exotic-vacation .destination-slider").slick({
		infinite: true,
		centerMode: true,
		lazyLoad:'ondemand',
		centerPadding: '15%',
		responsive: [
		    {
		      breakpoint: 767,
		      settings: {
			   centerMode: false,
			   arrows: false,
		        }
		    }
		  ]
	});
	
$('.mo-oberoi-destination-tab-details-wrap .destination-slider, .exotic-vacation .destination-slider').on('afterChange', function(event, slick, currentSlide, nextSlide){
  var sel = $(this).find('.slick-active.destination-slide').attr('data-country');
	//console.log(sel);
	$('.mo-oberoi-destination-tab-details-wrap .countryList li, .exotic-vacation .countryList li').removeClass('activec');
	$('.mo-oberoi-destination-tab-details-wrap .countryList li[data-filter='+sel+'], .exotic-vacation .countryList li[data-filter='+sel+']').addClass('activec');

	$(".mo-oberoi-destination-tab-details-wrap .selectedCountry, .exotic-vacation .selectedCountry").text(sel);

	fnAssignDataSrcToSrc();
});
	//$(".destination-slider").slick("slickFilter",".india");

/*$(".destinationTab li").on("click", function(){
	$(".destinationTab li").removeClass("active");
	  $(this).addClass("active");
        var fItem =$(".destinationTab ul li").attr("data-filter");
		//alert(fItem)

 //$(".destination-slider").slick("slickUnfilter");
 //$(".destination-slider").slick("slickFilter","."+ fItem+"");
		//$(".destination-slider").slick("slickUnfilter");
	    //$(".destination-slider").slick("slickFilter","."+ fItem+"");
	});*/
	


	
	
var winWidth = $(window).width();

if(winWidth<768){	
	$(".mo-oberoi-destination-tab-details-wrap .selectedCountry, .exotic-vacation .selectedCountry").click(function(){
		$(".mo-oberoi-destination-tab-details-wrap .countryList, .exotic-vacation .countryList").toggle();
		setTimeout(function(){
			$(window).scroll();
		},50)
	});

	$(".mo-oberoi-destination-tab-details-wrap .countryList li, .exotic-vacation .countryList li").click(function(){
		var countryValue = $(this).attr("data-filter");
		$('#countryFilter').attr("data-filter", countryValue);
		$(".mo-oberoi-destination-tab-details-wrap .selectedCountry, .exotic-vacation .selectedCountry").text($(this).text());
	
	});	
	
	$(document).click(function(event){
		$(".mo-oberoi-destination-tab-details-wrap .countryList, .exotic-vacation .countryList").hide();
	});	
	$(".mo-oberoi-destination-tab-details-wrap .selectedCountry, .exotic-vacation .selectedCountry").click(function(event){
		event.stopPropagation();
	});	
}
}


	
	function goToSlide(num)
	{
		$('.mo-oberoi-destination-tab-details-wrap .destination-slider, .exotic-vacation .destination-slider').slick('slickGoTo', num);
		$('.mo-oberoi-destination-tab-details-wrap .countryList  li, .exotic-vacation .countryList  li').removeClass('active');
		$('this').addClass('active');
	}

	$(".mo-oberoi-destination-tab-details-wrap .countryList li, .exotic-vacation .countryList li").click(function(){
	  $('.mo-oberoi-destination-tab-details-wrap .countryList li, .exotic-vacation .countryList li').removeClass('activec');
	  $(this).addClass('activec');
});

$(window).load(function(){
$('.mo-oberoi-destination-tab-details-wrap .slidesText p, .exotic-vacation .slidesText p').each(function(){
var hi =	$(this).height();
	
	//console.log(hi);
	if(hi<=25)
		{
			$(this).parent().parent('.text-container').children('.slidesBtn').addClass('singleLine');
		}
	
});	
	
});

$(document).ready(function(){

	setTimeout(function(){
		$(".destination .destinationTab li.activec").click();
	},100);	
	});

	
	

	;
 // JavaScript Document
function offersCarousel() {
$('.offers-slider').slick({
		arrows:true,
		slidesToShow: 2,
		  slidesToScroll: 1,
		lazyLoad:'progressive',
		  centerMode: false,
		centerPadding: '12%',
		  infinite: true,
		  responsive: [
		    {
		      breakpoint: 991,
		      settings: {
		        slidesToShow: 1,
		        slidesToScroll: 1,
				arrows:false,
//				adaptiveHeight: true
		        }
		    }
		    // You can unslick at a given breakpoint now by adding:
		    // settings: "unslick"
		    // instead of a settings object
		  ]
		
	});

$(".globalsingleImageSlider").slick({
dots: false,
arrows: true,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
responsive: [
 {
  breakpoint: 767,
  settings: {
  centerMode: false,
 
}
}
]
});
	

}

	

	;
// JavaScript Document



// JavaScript Document
function experiencesBanner() {
	$('.experiences-slider').slick({
		arrows:true,
		lazyLoad:'progressive',
		responsive: [
		    {
		      breakpoint: 991,
		      settings: {
				arrows:false,
				dots: false,
				adaptiveHeight: true
		        }
		    }
		    // You can unslick at a given breakpoint now by adding:
		    // settings: "unslick"
		    // instead of a settings object
		  ]
		
	});
}




/*    when you run this component indivisual uncomment below mnetion code

$(document).ready(function(){
	giftCardBanner();
});

*/
;
// JavaScript Document



// JavaScript Document
function giftCardBanner() {
	$('.gift-card-slider').slick({
		arrows:true,
		responsive: [
		    {
		      breakpoint: 767,
		      settings: {
		        slidesToShow: 1,
		        arrows:false,
		        dots:true,
		        customPaging: function(slick,index) {
        return '<a href="javaScript:;">' + (index + 1) + '</a>';
    }

		        }
		    }
		    ]
		
	});
}




/*    when you run this component indivisual uncomment below mnetion code

$(document).ready(function(){
	giftCardBanner();
});

*/
;
function awards() {

	if($(window).width() <= 767)
	{
		$(".awards-slider").slick({
		arrows:false,
		dots: false,
		responsive: [
		    {
		      breakpoint: 767,
		      settings: {
			   centerMode: false,
			   arrows: false,
			   dots: true,
			     customPaging: function(slick,index) {
        return '<a href="javaScript:;">' + (index + 1) + '</a>';
    			}
		        }
		    },
		  ]
	});
	}
	
}

;
// JavaScript Document
function eMagazineCarousel() {
	$('.e-magazine-slider').slick({
		arrows:true,
		slidesToShow: 3,
		  slidesToScroll: 3,
		  infinite: true,
		  responsive: [
		    {
		      breakpoint: 991,
		      settings: {
		        slidesToShow: 1,
		        slidesToScroll: 1,
		        centerMode: false,
		centerPadding: '50px',
				arrows:false
		        }
		    }
		    // You can unslick at a given breakpoint now by adding:
		    // settings: "unslick"
		    // instead of a settings object
		  ]
		
	});
};
// JavaScript Document
function instagramStudio() {
	$('.instagramStudio-slider').slick({
		arrows:true,
		slidesToShow: 6,
		  slidesToScroll: 1,
		  infinite: true,
		  responsive: [
		    {
		      breakpoint: 767,
		      settings: {
		        slidesToShow: 1,
		        slidesToScroll: 1,
		          centerMode: true,
					centerPadding: '50px',
				arrows:false,
		        infinite: true,
		        }
		    },
		    
		 
		    // You can unslick at a given breakpoint now by adding:
		    // settings: "unslick"
		    // instead of a settings object
		  ]
		
	});

	$('.instagramStudio-slider').on('afterChange', function(event, slick, currentSlide, nextSlide){
		fnAssignDataSrcToSrc();
	})
};
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):e.moment=a()}(this,function(){"use strict";function e(){return rt.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function t(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){var a;for(a in e)return!1;return!0}function n(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function _(e,a){var t,s=[];for(t=0;t<e.length;++t)s.push(a(e[t],t));return s}function d(e,a){return Object.prototype.hasOwnProperty.call(e,a)}function i(e,a){for(var t in a)d(a,t)&&(e[t]=a[t]);return d(a,"toString")&&(e.toString=a.toString),d(a,"valueOf")&&(e.valueOf=a.valueOf),e}function o(e,a,t,s){return Ae(e,a,t,s,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function u(e){return null==e._pf&&(e._pf=m()),e._pf}function l(e){if(null==e._isValid){var a=u(e),t=dt.call(a.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&a.overflow<0&&!a.empty&&!a.invalidMonth&&!a.invalidWeekday&&!a.nullInput&&!a.invalidFormat&&!a.userInvalidated&&(!a.meridiem||a.meridiem&&t);if(e._strict&&(s=s&&0===a.charsLeftOver&&0===a.unusedTokens.length&&void 0===a.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function M(e){var a=o(NaN);return null!=e?i(u(a),e):u(a).userInvalidated=!0,a}function h(e){return void 0===e}function L(e,a){var t,s,n;if(h(a._isAMomentObject)||(e._isAMomentObject=a._isAMomentObject),h(a._i)||(e._i=a._i),h(a._f)||(e._f=a._f),h(a._l)||(e._l=a._l),h(a._strict)||(e._strict=a._strict),h(a._tzm)||(e._tzm=a._tzm),h(a._isUTC)||(e._isUTC=a._isUTC),h(a._offset)||(e._offset=a._offset),h(a._pf)||(e._pf=u(a)),h(a._locale)||(e._locale=a._locale),it.length>0)for(t in it)s=it[t],n=a[s],h(n)||(e[s]=n);return e}function c(a){L(this,a),this._d=new Date(null!=a._d?a._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===ot&&(ot=!0,e.updateOffset(this),ot=!1)}function Y(e){return e instanceof c||null!=e&&null!=e._isAMomentObject}function y(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function p(e){var a=+e,t=0;return 0!==a&&isFinite(a)&&(t=y(a)),t}function f(e,a,t){var s,n=Math.min(e.length,a.length),r=Math.abs(e.length-a.length),_=0;for(s=0;s<n;s++)(t&&e[s]!==a[s]||!t&&p(e[s])!==p(a[s]))&&_++;return _+r}function k(a){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function D(a,t){var s=!0;return i(function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,a),s){for(var n,r=[],_=0;_<arguments.length;_++){if(n="","object"==typeof arguments[_]){n+="\n["+_+"] ";for(var d in arguments[0])n+=d+": "+arguments[0][d]+", ";n=n.slice(0,-2)}else n=arguments[_];r.push(n)}k(a+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),s=!1}return t.apply(this,arguments)},t)}function T(a,t){null!=e.deprecationHandler&&e.deprecationHandler(a,t),mt[a]||(k(t),mt[a]=!0)}function g(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function w(e,a){var s,n=i({},e);for(s in a)d(a,s)&&(t(e[s])&&t(a[s])?(n[s]={},i(n[s],e[s]),i(n[s],a[s])):null!=a[s]?n[s]=a[s]:delete n[s]);for(s in e)d(e,s)&&!d(a,s)&&t(e[s])&&(n[s]=i({},n[s]));return n}function v(e){null!=e&&this.set(e)}function S(e,a){var t=e.toLowerCase();yt[t]=yt[t+"s"]=yt[a]=e}function H(e){return"string"==typeof e?yt[e]||yt[e.toLowerCase()]:void 0}function b(e){var a,t,s={};for(t in e)d(e,t)&&(a=H(t))&&(s[a]=e[t]);return s}function j(e,a){pt[e]=a}function x(e){var a=[];for(var t in e)a.push({unit:t,priority:pt[t]});return a.sort(function(e,a){return e.priority-a.priority}),a}function P(a,t){return function(s){return null!=s?(A(this,a,s),e.updateOffset(this,t),this):W(this,a)}}function W(e,a){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+a]():NaN}function A(e,a,t){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+a](t)}function E(e,a,t){var s=""+Math.abs(e),n=a-s.length;return(e>=0?t?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+s}function F(e,a,t,s){var n=s;"string"==typeof s&&(n=function(){return this[s]()}),e&&(Tt[e]=n),a&&(Tt[a[0]]=function(){return E(n.apply(this,arguments),a[1],a[2])}),t&&(Tt[t]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function z(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function O(e){var a,t,s=e.match(ft);for(a=0,t=s.length;a<t;a++)Tt[s[a]]?s[a]=Tt[s[a]]:s[a]=z(s[a]);return function(a){var n,r="";for(n=0;n<t;n++)r+=s[n]instanceof Function?s[n].call(a,e):s[n];return r}}function J(e,a){return e.isValid()?(a=R(a,e.localeData()),Dt[a]=Dt[a]||O(a),Dt[a](e)):e.localeData().invalidDate()}function R(e,a){var t=5;for(kt.lastIndex=0;t>=0&&kt.test(e);)e=e.replace(kt,function(e){return a.longDateFormat(e)||e}),kt.lastIndex=0,t-=1;return e}function I(e,a,t){It[e]=g(a)?a:function(e,s){return e&&t?t:a}}function C(e,a){return d(It,e)?It[e](a._strict,a._locale):new RegExp(G(e))}function G(e){return N(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,a,t,s,n){return a||t||s||n}))}function N(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function U(e,a){var t,s=a;for("string"==typeof e&&(e=[e]),n(a)&&(s=function(e,t){t[a]=p(e)}),t=0;t<e.length;t++)Ct[e[t]]=s}function V(e,a){U(e,function(e,t,s,n){s._w=s._w||{},a(e,s._w,s,n)})}function $(e,a,t){null!=a&&d(Ct,e)&&Ct[e](a,t._a,t,e)}function K(e,a){return new Date(Date.UTC(e,a+1,0)).getUTCDate()}function Z(e,a,t){var s,n,r,_=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=o([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return t?"MMM"===a?(n=Qt.call(this._shortMonthsParse,_),-1!==n?n:null):(n=Qt.call(this._longMonthsParse,_),-1!==n?n:null):"MMM"===a?(n=Qt.call(this._shortMonthsParse,_),-1!==n?n:(n=Qt.call(this._longMonthsParse,_),-1!==n?n:null)):(n=Qt.call(this._longMonthsParse,_),-1!==n?n:(n=Qt.call(this._shortMonthsParse,_),-1!==n?n:null))}function q(e,a){var t;if(!e.isValid())return e;if("string"==typeof a)if(/^\d+$/.test(a))a=p(a);else if(a=e.localeData().monthsParse(a),!n(a))return e;return t=Math.min(e.date(),K(e.year(),a)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](a,t),e}function B(a){return null!=a?(q(this,a),e.updateOffset(this,!0),this):W(this,"Month")}function Q(){function e(e,a){return a.length-e.length}var a,t,s=[],n=[],r=[];for(a=0;a<12;a++)t=o([2e3,a]),s.push(this.monthsShort(t,"")),n.push(this.months(t,"")),r.push(this.months(t,"")),r.push(this.monthsShort(t,""));for(s.sort(e),n.sort(e),r.sort(e),a=0;a<12;a++)s[a]=N(s[a]),n[a]=N(n[a]);for(a=0;a<24;a++)r[a]=N(r[a]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function X(e){return ee(e)?366:365}function ee(e){return e%4==0&&e%100!=0||e%400==0}function ae(e,a,t,s,n,r,_){var d=new Date(e,a,t,s,n,r,_);return e<100&&e>=0&&isFinite(d.getFullYear())&&d.setFullYear(e),d}function te(e){var a=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(a.getUTCFullYear())&&a.setUTCFullYear(e),a}function se(e,a,t){var s=7+a-t;return-((7+te(e,0,s).getUTCDay()-a)%7)+s-1}function ne(e,a,t,s,n){var r,_,d=1+7*(a-1)+(7+t-s)%7+se(e,s,n);return d<=0?(r=e-1,_=X(r)+d):d>X(e)?(r=e+1,_=d-X(e)):(r=e,_=d),{year:r,dayOfYear:_}}function re(e,a,t){var s,n,r=se(e.year(),a,t),_=Math.floor((e.dayOfYear()-r-1)/7)+1;return _<1?(n=e.year()-1,s=_+_e(n,a,t)):_>_e(e.year(),a,t)?(s=_-_e(e.year(),a,t),n=e.year()+1):(n=e.year(),s=_),{week:s,year:n}}function _e(e,a,t){var s=se(e,a,t),n=se(e+1,a,t);return(X(e)-s+n)/7}function de(e,a){return"string"!=typeof e?e:isNaN(e)?(e=a.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function ie(e,a){return"string"==typeof e?a.weekdaysParse(e)%7||7:isNaN(e)?null:e}function oe(e,a,t){var s,n,r,_=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=o([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return t?"dddd"===a?(n=Qt.call(this._weekdaysParse,_),-1!==n?n:null):"ddd"===a?(n=Qt.call(this._shortWeekdaysParse,_),-1!==n?n:null):(n=Qt.call(this._minWeekdaysParse,_),-1!==n?n:null):"dddd"===a?(n=Qt.call(this._weekdaysParse,_),-1!==n?n:(n=Qt.call(this._shortWeekdaysParse,_),-1!==n?n:(n=Qt.call(this._minWeekdaysParse,_),-1!==n?n:null))):"ddd"===a?(n=Qt.call(this._shortWeekdaysParse,_),-1!==n?n:(n=Qt.call(this._weekdaysParse,_),-1!==n?n:(n=Qt.call(this._minWeekdaysParse,_),-1!==n?n:null))):(n=Qt.call(this._minWeekdaysParse,_),-1!==n?n:(n=Qt.call(this._weekdaysParse,_),-1!==n?n:(n=Qt.call(this._shortWeekdaysParse,_),-1!==n?n:null)))}function me(){function e(e,a){return a.length-e.length}var a,t,s,n,r,_=[],d=[],i=[],m=[];for(a=0;a<7;a++)t=o([2e3,1]).day(a),s=this.weekdaysMin(t,""),n=this.weekdaysShort(t,""),r=this.weekdays(t,""),_.push(s),d.push(n),i.push(r),m.push(s),m.push(n),m.push(r);for(_.sort(e),d.sort(e),i.sort(e),m.sort(e),a=0;a<7;a++)d[a]=N(d[a]),i[a]=N(i[a]),m[a]=N(m[a]);this._weekdaysRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+_.join("|")+")","i")}function ue(){return this.hours()%12||12}function le(e,a){F(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}function Me(e,a){return a._meridiemParse}function he(e){return e?e.toLowerCase().replace("_","-"):e}function Le(e){for(var a,t,s,n,r=0;r<e.length;){for(a=(n=he(e[r]).split("-")).length,t=(t=he(e[r+1]))?t.split("-"):null;a>0;){if(s=ce(n.slice(0,a).join("-")))return s;if(t&&t.length>=a&&f(n,t,!0)>=a-1)break;a--}r++}return null}function ce(e){var a=null;if(!cs[e]&&"undefined"!=typeof module&&module&&module.exports)try{a=ls._abbr,require("./locale/"+e),Ye(a)}catch(e){}return cs[e]}function Ye(e,a){var t;return e&&(t=h(a)?pe(e):ye(e,a))&&(ls=t),ls._abbr}function ye(e,a){if(null!==a){var t=Ls;if(a.abbr=e,null!=cs[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),t=cs[e]._config;else if(null!=a.parentLocale){if(null==cs[a.parentLocale])return Ys[a.parentLocale]||(Ys[a.parentLocale]=[]),Ys[a.parentLocale].push({name:e,config:a}),null;t=cs[a.parentLocale]._config}return cs[e]=new v(w(t,a)),Ys[e]&&Ys[e].forEach(function(e){ye(e.name,e.config)}),Ye(e),cs[e]}return delete cs[e],null}function pe(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ls;if(!a(e)){if(t=ce(e))return t;e=[e]}return Le(e)}function fe(e){var a,t=e._a;return t&&-2===u(e).overflow&&(a=t[Nt]<0||t[Nt]>11?Nt:t[Ut]<1||t[Ut]>K(t[Gt],t[Nt])?Ut:t[Vt]<0||t[Vt]>24||24===t[Vt]&&(0!==t[$t]||0!==t[Kt]||0!==t[Zt])?Vt:t[$t]<0||t[$t]>59?$t:t[Kt]<0||t[Kt]>59?Kt:t[Zt]<0||t[Zt]>999?Zt:-1,u(e)._overflowDayOfYear&&(a<Gt||a>Ut)&&(a=Ut),u(e)._overflowWeeks&&-1===a&&(a=qt),u(e)._overflowWeekday&&-1===a&&(a=Bt),u(e).overflow=a),e}function ke(e){var a,t,s,n,r,_,d=e._i,i=ys.exec(d)||ps.exec(d);if(i){for(u(e).iso=!0,a=0,t=ks.length;a<t;a++)if(ks[a][1].exec(i[1])){n=ks[a][0],s=!1!==ks[a][2];break}if(null==n)return void(e._isValid=!1);if(i[3]){for(a=0,t=Ds.length;a<t;a++)if(Ds[a][1].exec(i[3])){r=(i[2]||" ")+Ds[a][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(i[4]){if(!fs.exec(i[4]))return void(e._isValid=!1);_="Z"}e._f=n+(r||"")+(_||""),Se(e)}else e._isValid=!1}function De(a){var t=Ts.exec(a._i);return null!==t?void(a._d=new Date(+t[1])):(ke(a),void(!1===a._isValid&&(delete a._isValid,e.createFromInputFallback(a))))}function Te(e,a,t){return null!=e?e:null!=a?a:t}function ge(a){var t=new Date(e.now());return a._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function we(e){var a,t,s,n,r=[];if(!e._d){for(s=ge(e),e._w&&null==e._a[Ut]&&null==e._a[Nt]&&ve(e),e._dayOfYear&&(n=Te(e._a[Gt],s[Gt]),e._dayOfYear>X(n)&&(u(e)._overflowDayOfYear=!0),t=te(n,0,e._dayOfYear),e._a[Nt]=t.getUTCMonth(),e._a[Ut]=t.getUTCDate()),a=0;a<3&&null==e._a[a];++a)e._a[a]=r[a]=s[a];for(;a<7;a++)e._a[a]=r[a]=null==e._a[a]?2===a?1:0:e._a[a];24===e._a[Vt]&&0===e._a[$t]&&0===e._a[Kt]&&0===e._a[Zt]&&(e._nextDay=!0,e._a[Vt]=0),e._d=(e._useUTC?te:ae).apply(null,r),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Vt]=24)}}function ve(e){var a,t,s,n,r,_,d,i;if(null!=(a=e._w).GG||null!=a.W||null!=a.E)r=1,_=4,t=Te(a.GG,e._a[Gt],re(Ee(),1,4).year),s=Te(a.W,1),((n=Te(a.E,1))<1||n>7)&&(i=!0);else{r=e._locale._week.dow,_=e._locale._week.doy;var o=re(Ee(),r,_);t=Te(a.gg,e._a[Gt],o.year),s=Te(a.w,o.week),null!=a.d?((n=a.d)<0||n>6)&&(i=!0):null!=a.e?(n=a.e+r,(a.e<0||a.e>6)&&(i=!0)):n=r}s<1||s>_e(t,r,_)?u(e)._overflowWeeks=!0:null!=i?u(e)._overflowWeekday=!0:(d=ne(t,s,n,r,_),e._a[Gt]=d.year,e._dayOfYear=d.dayOfYear)}function Se(a){if(a._f!==e.ISO_8601){a._a=[],u(a).empty=!0;var t,s,n,r,_,d=""+a._i,i=d.length,o=0;for(n=R(a._f,a._locale).match(ft)||[],t=0;t<n.length;t++)r=n[t],(s=(d.match(C(r,a))||[])[0])&&((_=d.substr(0,d.indexOf(s))).length>0&&u(a).unusedInput.push(_),d=d.slice(d.indexOf(s)+s.length),o+=s.length),Tt[r]?(s?u(a).empty=!1:u(a).unusedTokens.push(r),$(r,s,a)):a._strict&&!s&&u(a).unusedTokens.push(r);u(a).charsLeftOver=i-o,d.length>0&&u(a).unusedInput.push(d),a._a[Vt]<=12&&!0===u(a).bigHour&&a._a[Vt]>0&&(u(a).bigHour=void 0),u(a).parsedDateParts=a._a.slice(0),u(a).meridiem=a._meridiem,a._a[Vt]=He(a._locale,a._a[Vt],a._meridiem),we(a),fe(a)}else ke(a)}function He(e,a,t){var s;return null==t?a:null!=e.meridiemHour?e.meridiemHour(a,t):null!=e.isPM?((s=e.isPM(t))&&a<12&&(a+=12),s||12!==a||(a=0),a):a}function be(e){var a,t,s,n,r;if(0===e._f.length)return u(e).invalidFormat=!0,void(e._d=new Date(NaN));for(n=0;n<e._f.length;n++)r=0,a=L({},e),null!=e._useUTC&&(a._useUTC=e._useUTC),a._f=e._f[n],Se(a),l(a)&&(r+=u(a).charsLeftOver,r+=10*u(a).unusedTokens.length,u(a).score=r,(null==s||r<s)&&(s=r,t=a));i(e,t||a)}function je(e){if(!e._d){var a=b(e._i);e._a=_([a.year,a.month,a.day||a.date,a.hour,a.minute,a.second,a.millisecond],function(e){return e&&parseInt(e,10)}),we(e)}}function xe(e){var a=new c(fe(Pe(e)));return a._nextDay&&(a.add(1,"d"),a._nextDay=void 0),a}function Pe(e){var t=e._i,s=e._f;return e._locale=e._locale||pe(e._l),null===t||void 0===s&&""===t?M({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),Y(t)?new c(fe(t)):(r(t)?e._d=t:a(s)?be(e):s?Se(e):We(e),l(e)||(e._d=null),e))}function We(t){var s=t._i;void 0===s?t._d=new Date(e.now()):r(s)?t._d=new Date(s.valueOf()):"string"==typeof s?De(t):a(s)?(t._a=_(s.slice(0),function(e){return parseInt(e,10)}),we(t)):"object"==typeof s?je(t):n(s)?t._d=new Date(s):e.createFromInputFallback(t)}function Ae(e,n,r,_,d){var i={};return!0!==r&&!1!==r||(_=r,r=void 0),(t(e)&&s(e)||a(e)&&0===e.length)&&(e=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=d,i._l=r,i._i=e,i._f=n,i._strict=_,xe(i)}function Ee(e,a,t,s){return Ae(e,a,t,s,!1)}function Fe(e,t){var s,n;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return Ee();for(s=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](s)||(s=t[n]);return s}function ze(e){var a=b(e),t=a.year||0,s=a.quarter||0,n=a.month||0,r=a.week||0,_=a.day||0,d=a.hour||0,i=a.minute||0,o=a.second||0,m=a.millisecond||0;this._milliseconds=+m+1e3*o+6e4*i+1e3*d*60*60,this._days=+_+7*r,this._months=+n+3*s+12*t,this._data={},this._locale=pe(),this._bubble()}function Oe(e){return e instanceof ze}function Je(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Re(e,a){F(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+E(~~(e/60),2)+a+E(~~e%60,2)})}function Ie(e,a){var t=(a||"").match(e);if(null===t)return null;var s=((t[t.length-1]||[])+"").match(vs)||["-",0,0],n=60*s[1]+p(s[2]);return 0===n?0:"+"===s[0]?n:-n}function Ce(a,t){var s,n;return t._isUTC?(s=t.clone(),n=(Y(a)||r(a)?a.valueOf():Ee(a).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+n),e.updateOffset(s,!1),s):Ee(a).local()}function Ge(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ne(){return!!this.isValid()&&this._isUTC&&0===this._offset}function Ue(e,a){var t,s,r,_=e,i=null;return Oe(e)?_={ms:e._milliseconds,d:e._days,M:e._months}:n(e)?(_={},a?_[a]=e:_.milliseconds=e):(i=Ss.exec(e))?(t="-"===i[1]?-1:1,_={y:0,d:p(i[Ut])*t,h:p(i[Vt])*t,m:p(i[$t])*t,s:p(i[Kt])*t,ms:p(Je(1e3*i[Zt]))*t}):(i=Hs.exec(e))?(t="-"===i[1]?-1:1,_={y:Ve(i[2],t),M:Ve(i[3],t),w:Ve(i[4],t),d:Ve(i[5],t),h:Ve(i[6],t),m:Ve(i[7],t),s:Ve(i[8],t)}):null==_?_={}:"object"==typeof _&&("from"in _||"to"in _)&&(r=Ke(Ee(_.from),Ee(_.to)),_={},_.ms=r.milliseconds,_.M=r.months),s=new ze(_),Oe(e)&&d(e,"_locale")&&(s._locale=e._locale),s}function Ve(e,a){var t=e&&parseFloat(e.replace(",","."));return(isNaN(t)?0:t)*a}function $e(e,a){var t={milliseconds:0,months:0};return t.months=a.month()-e.month()+12*(a.year()-e.year()),e.clone().add(t.months,"M").isAfter(a)&&--t.months,t.milliseconds=+a-+e.clone().add(t.months,"M"),t}function Ke(e,a){var t;return e.isValid()&&a.isValid()?(a=Ce(a,e),e.isBefore(a)?t=$e(e,a):(t=$e(a,e),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function Ze(e,a){return function(t,s){var n,r;return null===s||isNaN(+s)||(T(a,"moment()."+a+"(period, number) is deprecated. Please use moment()."+a+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=t,t=s,s=r),t="string"==typeof t?+t:t,n=Ue(t,s),qe(this,n,e),this}}function qe(a,t,s,n){var r=t._milliseconds,_=Je(t._days),d=Je(t._months);a.isValid()&&(n=null==n||n,r&&a._d.setTime(a._d.valueOf()+r*s),_&&A(a,"Date",W(a,"Date")+_*s),d&&q(a,W(a,"Month")+d*s),n&&e.updateOffset(a,_||d))}function Be(e,a){var t,s,n=12*(a.year()-e.year())+(a.month()-e.month()),r=e.clone().add(n,"months");return a-r<0?(t=e.clone().add(n-1,"months"),s=(a-r)/(r-t)):(t=e.clone().add(n+1,"months"),s=(a-r)/(t-r)),-(n+s)||0}function Qe(e){var a;return void 0===e?this._locale._abbr:(null!=(a=pe(e))&&(this._locale=a),this)}function Xe(){return this._locale}function ea(e,a){F(0,[e,e.length],0,a)}function aa(e,a,t,s,n){var r;return null==e?re(this,s,n).year:(r=_e(e,s,n),a>r&&(a=r),ta.call(this,e,a,t,s,n))}function ta(e,a,t,s,n){var r=ne(e,a,t,s,n),_=te(r.year,0,r.dayOfYear);return this.year(_.getUTCFullYear()),this.month(_.getUTCMonth()),this.date(_.getUTCDate()),this}function sa(e){return e}function na(e,a,t,s){var n=pe(),r=o().set(s,a);return n[t](r,e)}function ra(e,a,t){if(n(e)&&(a=e,e=void 0),e=e||"",null!=a)return na(e,a,t,"month");var s,r=[];for(s=0;s<12;s++)r[s]=na(e,s,t,"month");return r}function _a(e,a,t,s){"boolean"==typeof e?(n(a)&&(t=a,a=void 0),a=a||""):(a=e,t=a,e=!1,n(a)&&(t=a,a=void 0),a=a||"");var r=pe(),_=e?r._week.dow:0;if(null!=t)return na(a,(t+_)%7,s,"day");var d,i=[];for(d=0;d<7;d++)i[d]=na(a,(d+_)%7,s,"day");return i}function da(e,a,t,s){var n=Ue(a,t);return e._milliseconds+=s*n._milliseconds,e._days+=s*n._days,e._months+=s*n._months,e._bubble()}function ia(e){return e<0?Math.floor(e):Math.ceil(e)}function oa(e){return 4800*e/146097}function ma(e){return 146097*e/4800}function ua(e){return function(){return this.as(e)}}function la(e){return function(){return this._data[e]}}function Ma(e,a,t,s,n){return n.relativeTime(a||1,!!t,e,s)}function ha(e,a,t){var s=Ue(e).abs(),n=an(s.as("s")),r=an(s.as("m")),_=an(s.as("h")),d=an(s.as("d")),i=an(s.as("M")),o=an(s.as("y")),m=n<tn.s&&["s",n]||r<=1&&["m"]||r<tn.m&&["mm",r]||_<=1&&["h"]||_<tn.h&&["hh",_]||d<=1&&["d"]||d<tn.d&&["dd",d]||i<=1&&["M"]||i<tn.M&&["MM",i]||o<=1&&["y"]||["yy",o];return m[2]=a,m[3]=+e>0,m[4]=t,Ma.apply(null,m)}function La(){var e,a,t,s=sn(this._milliseconds)/1e3,n=sn(this._days),r=sn(this._months);a=y((e=y(s/60))/60),s%=60,e%=60;var _=t=y(r/12),d=r%=12,i=n,o=a,m=e,u=s,l=this.asSeconds();return l?(l<0?"-":"")+"P"+(_?_+"Y":"")+(d?d+"M":"")+(i?i+"D":"")+(o||m||u?"T":"")+(o?o+"H":"")+(m?m+"M":"")+(u?u+"S":""):"P0D"}function ca(e,a){var t=e.split("_");return a%10==1&&a%100!=11?t[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?t[1]:t[2]}function Ya(e,a,t){var s={mm:a?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:a?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===t?a?"хвіліна":"хвіліну":"h"===t?a?"гадзіна":"гадзіну":e+" "+ca(s[t],+e)}function ya(e,a,t){return e+" "+fa({mm:"munutenn",MM:"miz",dd:"devezh"}[t],e)}function pa(e){return e>9?pa(e%10):e}function fa(e,a){return 2===a?ka(e):e}function ka(e){var a={m:"v",b:"v",d:"z"};return void 0===a[e.charAt(0)]?e:a[e.charAt(0)]+e.substring(1)}function Da(e,a,t){var s=e+" ";switch(t){case"m":return a?"jedna minuta":"jedne minute";case"mm":return s+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return s+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return s+=1===e?"dan":"dana";case"MM":return s+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return s+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}function Ta(e){return e>1&&e<5&&1!=~~(e/10)}function ga(e,a,t,s){var n=e+" ";switch(t){case"s":return a||s?"pár sekund":"pár sekundami";case"m":return a?"minuta":s?"minutu":"minutou";case"mm":return a||s?n+(Ta(e)?"minuty":"minut"):n+"minutami";case"h":return a?"hodina":s?"hodinu":"hodinou";case"hh":return a||s?n+(Ta(e)?"hodiny":"hodin"):n+"hodinami";case"d":return a||s?"den":"dnem";case"dd":return a||s?n+(Ta(e)?"dny":"dní"):n+"dny";case"M":return a||s?"měsíc":"měsícem";case"MM":return a||s?n+(Ta(e)?"měsíce":"měsíců"):n+"měsíci";case"y":return a||s?"rok":"rokem";case"yy":return a||s?n+(Ta(e)?"roky":"let"):n+"lety"}}function wa(e,a,t,s){var n={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return a?n[t][0]:n[t][1]}function va(e,a,t,s){var n={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return a?n[t][0]:n[t][1]}function Sa(e,a,t,s){var n={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return a?n[t][2]?n[t][2]:n[t][1]:s?n[t][0]:n[t][1]}function Ha(e,a,t,s){var n="";switch(t){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"m":return s?"minuutin":"minuutti";case"mm":n=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":n=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":n=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":n=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":n=s?"vuoden":"vuotta"}return n=ba(e,s)+" "+n}function ba(e,a){return e<10?a?En[e]:An[e]:e}function ja(e,a,t){var s=e+" ";switch(t){case"m":return a?"jedna minuta":"jedne minute";case"mm":return s+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return a?"jedan sat":"jednog sata";case"hh":return s+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return s+=1===e?"dan":"dana";case"MM":return s+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return s+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}function xa(e,a,t,s){var n=e;switch(t){case"s":return s||a?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(s||a?" perc":" perce");case"mm":return n+(s||a?" perc":" perce");case"h":return"egy"+(s||a?" óra":" órája");case"hh":return n+(s||a?" óra":" órája");case"d":return"egy"+(s||a?" nap":" napja");case"dd":return n+(s||a?" nap":" napja");case"M":return"egy"+(s||a?" hónap":" hónapja");case"MM":return n+(s||a?" hónap":" hónapja");case"y":return"egy"+(s||a?" év":" éve");case"yy":return n+(s||a?" év":" éve")}return""}function Pa(e){return(e?"":"[múlt] ")+"["+Un[this.day()]+"] LT[-kor]"}function Wa(e){return e%100==11||e%10!=1}function Aa(e,a,t,s){var n=e+" ";switch(t){case"s":return a||s?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return a?"mínúta":"mínútu";case"mm":return Wa(e)?n+(a||s?"mínútur":"mínútum"):a?n+"mínúta":n+"mínútu";case"hh":return Wa(e)?n+(a||s?"klukkustundir":"klukkustundum"):n+"klukkustund";case"d":return a?"dagur":s?"dag":"degi";case"dd":return Wa(e)?a?n+"dagar":n+(s?"daga":"dögum"):a?n+"dagur":n+(s?"dag":"degi");case"M":return a?"mánuður":s?"mánuð":"mánuði";case"MM":return Wa(e)?a?n+"mánuðir":n+(s?"mánuði":"mánuðum"):a?n+"mánuður":n+(s?"mánuð":"mánuði");case"y":return a||s?"ár":"ári";case"yy":return Wa(e)?n+(a||s?"ár":"árum"):n+(a||s?"ár":"ári")}}function Ea(e,a,t,s){var n={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return a?n[t][0]:n[t][1]}function Fa(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var a=e%10,t=e/10;return Fa(0===a?t:a)}if(e<1e4){for(;e>=10;)e/=10;return Fa(e)}return e/=1e3,Fa(e)}function za(e,a,t,s){return a?Ja(t)[0]:s?Ja(t)[1]:Ja(t)[2]}function Oa(e){return e%10==0||e>10&&e<20}function Ja(e){return Kn[e].split("_")}function Ra(e,a,t,s){var n=e+" ";return 1===e?n+za(e,a,t[0],s):a?n+(Oa(e)?Ja(t)[1]:Ja(t)[0]):s?n+Ja(t)[1]:n+(Oa(e)?Ja(t)[1]:Ja(t)[2])}function Ia(e,a,t){return t?a%10==1&&a%100!=11?e[2]:e[3]:a%10==1&&a%100!=11?e[0]:e[1]}function Ca(e,a,t){return e+" "+Ia(Zn[t],e,a)}function Ga(e,a,t){return Ia(Zn[t],e,a)}function Na(e,a,t,s){var n="";if(a)switch(t){case"s":n="काही सेकंद";break;case"m":n="एक मिनिट";break;case"mm":n="%d मिनिटे";break;case"h":n="एक तास";break;case"hh":n="%d तास";break;case"d":n="एक दिवस";break;case"dd":n="%d दिवस";break;case"M":n="एक महिना";break;case"MM":n="%d महिने";break;case"y":n="एक वर्ष";break;case"yy":n="%d वर्षे"}else switch(t){case"s":n="काही सेकंदां";break;case"m":n="एका मिनिटा";break;case"mm":n="%d मिनिटां";break;case"h":n="एका तासा";break;case"hh":n="%d तासां";break;case"d":n="एका दिवसा";break;case"dd":n="%d दिवसां";break;case"M":n="एका महिन्या";break;case"MM":n="%d महिन्यां";break;case"y":n="एका वर्षा";break;case"yy":n="%d वर्षां"}return n.replace(/%d/i,e)}function Ua(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function Va(e,a,t){var s=e+" ";switch(t){case"m":return a?"minuta":"minutę";case"mm":return s+(Ua(e)?"minuty":"minut");case"h":return a?"godzina":"godzinę";case"hh":return s+(Ua(e)?"godziny":"godzin");case"MM":return s+(Ua(e)?"miesiące":"miesięcy");case"yy":return s+(Ua(e)?"lata":"lat")}}function $a(e,a,t){var s={mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},n=" ";return(e%100>=20||e>=100&&e%100==0)&&(n=" de "),e+n+s[t]}function Ka(e,a){var t=e.split("_");return a%10==1&&a%100!=11?t[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?t[1]:t[2]}function Za(e,a,t){var s={mm:a?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===t?a?"минута":"минуту":e+" "+Ka(s[t],+e)}function qa(e){return e>1&&e<5}function Ba(e,a,t,s){var n=e+" ";switch(t){case"s":return a||s?"pár sekúnd":"pár sekundami";case"m":return a?"minúta":s?"minútu":"minútou";case"mm":return a||s?n+(qa(e)?"minúty":"minút"):n+"minútami";case"h":return a?"hodina":s?"hodinu":"hodinou";case"hh":return a||s?n+(qa(e)?"hodiny":"hodín"):n+"hodinami";case"d":return a||s?"deň":"dňom";case"dd":return a||s?n+(qa(e)?"dni":"dní"):n+"dňami";case"M":return a||s?"mesiac":"mesiacom";case"MM":return a||s?n+(qa(e)?"mesiace":"mesiacov"):n+"mesiacmi";case"y":return a||s?"rok":"rokom";case"yy":return a||s?n+(qa(e)?"roky":"rokov"):n+"rokmi"}}function Qa(e,a,t,s){var n=e+" ";switch(t){case"s":return a||s?"nekaj sekund":"nekaj sekundami";case"m":return a?"ena minuta":"eno minuto";case"mm":return n+=1===e?a?"minuta":"minuto":2===e?a||s?"minuti":"minutama":e<5?a||s?"minute":"minutami":a||s?"minut":"minutami";case"h":return a?"ena ura":"eno uro";case"hh":return n+=1===e?a?"ura":"uro":2===e?a||s?"uri":"urama":e<5?a||s?"ure":"urami":a||s?"ur":"urami";case"d":return a||s?"en dan":"enim dnem";case"dd":return n+=1===e?a||s?"dan":"dnem":2===e?a||s?"dni":"dnevoma":a||s?"dni":"dnevi";case"M":return a||s?"en mesec":"enim mesecem";case"MM":return n+=1===e?a||s?"mesec":"mesecem":2===e?a||s?"meseca":"mesecema":e<5?a||s?"mesece":"meseci":a||s?"mesecev":"meseci";case"y":return a||s?"eno leto":"enim letom";case"yy":return n+=1===e?a||s?"leto":"letom":2===e?a||s?"leti":"letoma":e<5?a||s?"leta":"leti":a||s?"let":"leti"}}function Xa(e,a,t,s){var n=et(e);switch(t){case"mm":return n+" tup";case"hh":return n+" rep";case"dd":return n+" jaj";case"MM":return n+" jar";case"yy":return n+" DIS"}}function et(e){var a=Math.floor(e%1e3/100),t=Math.floor(e%100/10),s=e%10,n="";return a>0&&(n+=Dr[a]+"vatlh"),t>0&&(n+=(""!==n?" ":"")+Dr[t]+"maH"),s>0&&(n+=(""!==n?" ":"")+Dr[s]),""===n?"pagh":n}function at(e,a,t,s){var n={s:["viensas secunds","'iensas secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return s?n[t][0]:a?n[t][0]:n[t][1]}function tt(e,a){var t=e.split("_");return a%10==1&&a%100!=11?t[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?t[1]:t[2]}function st(e,a,t){var s={mm:a?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:a?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===t?a?"хвилина":"хвилину":"h"===t?a?"година":"годину":e+" "+tt(s[t],+e)}function nt(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}var rt,_t,dt=_t=Array.prototype.some?Array.prototype.some:function(e){for(var a=Object(this),t=a.length>>>0,s=0;s<t;s++)if(s in a&&e.call(this,a[s],s,a))return!0;return!1},it=e.momentProperties=[],ot=!1,mt={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var ut,lt,Mt=ut=Object.keys?Object.keys:function(e){var a,t=[];for(a in e)d(e,a)&&t.push(a);return t},ht={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Lt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ct=/\d{1,2}/,Yt={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},yt={},pt={},ft=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,kt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Dt={},Tt={},gt=/\d/,wt=/\d\d/,vt=/\d{3}/,St=/\d{4}/,Ht=/[+-]?\d{6}/,bt=/\d\d?/,jt=/\d\d\d\d?/,xt=/\d\d\d\d\d\d?/,Pt=/\d{1,3}/,Wt=/\d{1,4}/,At=/[+-]?\d{1,6}/,Et=/\d+/,Ft=/[+-]?\d+/,zt=/Z|[+-]\d\d:?\d\d/gi,Ot=/Z|[+-]\d\d(?::?\d\d)?/gi,Jt=/[+-]?\d+(\.\d{1,3})?/,Rt=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,It={},Ct={},Gt=0,Nt=1,Ut=2,Vt=3,$t=4,Kt=5,Zt=6,qt=7,Bt=8,Qt=lt=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var a;for(a=0;a<this.length;++a)if(this[a]===e)return a;return-1};F("M",["MM",2],"Mo",function(){return this.month()+1}),F("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),F("MMMM",0,0,function(e){return this.localeData().months(this,e)}),S("month","M"),j("month",8),I("M",bt),I("MM",bt,wt),I("MMM",function(e,a){return a.monthsShortRegex(e)}),I("MMMM",function(e,a){return a.monthsRegex(e)}),U(["M","MM"],function(e,a){a[Nt]=p(e)-1}),U(["MMM","MMMM"],function(e,a,t,s){var n=t._locale.monthsParse(e,s,t._strict);null!=n?a[Nt]=n:u(t).invalidMonth=e});var Xt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,es="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),as="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ts=Rt,ss=Rt;F("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),F(0,["YY",2],0,function(){return this.year()%100}),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),S("year","y"),j("year",1),I("Y",Ft),I("YY",bt,wt),I("YYYY",Wt,St),I("YYYYY",At,Ht),I("YYYYYY",At,Ht),U(["YYYYY","YYYYYY"],Gt),U("YYYY",function(a,t){t[Gt]=2===a.length?e.parseTwoDigitYear(a):p(a)}),U("YY",function(a,t){t[Gt]=e.parseTwoDigitYear(a)}),U("Y",function(e,a){a[Gt]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return p(e)+(p(e)>68?1900:2e3)};var ns=P("FullYear",!0);F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),S("week","w"),S("isoWeek","W"),j("week",5),j("isoWeek",5),I("w",bt),I("ww",bt,wt),I("W",bt),I("WW",bt,wt),V(["w","ww","W","WW"],function(e,a,t,s){a[s.substr(0,1)]=p(e)});var rs={dow:0,doy:6};F("d",0,"do","day"),F("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),F("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),F("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),S("day","d"),S("weekday","e"),S("isoWeekday","E"),j("day",11),j("weekday",11),j("isoWeekday",11),I("d",bt),I("e",bt),I("E",bt),I("dd",function(e,a){return a.weekdaysMinRegex(e)}),I("ddd",function(e,a){return a.weekdaysShortRegex(e)}),I("dddd",function(e,a){return a.weekdaysRegex(e)}),V(["dd","ddd","dddd"],function(e,a,t,s){var n=t._locale.weekdaysParse(e,s,t._strict);null!=n?a.d=n:u(t).invalidWeekday=e}),V(["d","e","E"],function(e,a,t,s){a[s]=p(e)});var _s="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ds="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),is="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),os=Rt,ms=Rt,us=Rt;F("H",["HH",2],0,"hour"),F("h",["hh",2],0,ue),F("k",["kk",2],0,function(){return this.hours()||24}),F("hmm",0,0,function(){return""+ue.apply(this)+E(this.minutes(),2)}),F("hmmss",0,0,function(){return""+ue.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)}),F("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)}),F("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)}),le("a",!0),le("A",!1),S("hour","h"),j("hour",13),I("a",Me),I("A",Me),I("H",bt),I("h",bt),I("HH",bt,wt),I("hh",bt,wt),I("hmm",jt),I("hmmss",xt),I("Hmm",jt),I("Hmmss",xt),U(["H","HH"],Vt),U(["a","A"],function(e,a,t){t._isPm=t._locale.isPM(e),t._meridiem=e}),U(["h","hh"],function(e,a,t){a[Vt]=p(e),u(t).bigHour=!0}),U("hmm",function(e,a,t){var s=e.length-2;a[Vt]=p(e.substr(0,s)),a[$t]=p(e.substr(s)),u(t).bigHour=!0}),U("hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[Vt]=p(e.substr(0,s)),a[$t]=p(e.substr(s,2)),a[Kt]=p(e.substr(n)),u(t).bigHour=!0}),U("Hmm",function(e,a,t){var s=e.length-2;a[Vt]=p(e.substr(0,s)),a[$t]=p(e.substr(s))}),U("Hmmss",function(e,a,t){var s=e.length-4,n=e.length-2;a[Vt]=p(e.substr(0,s)),a[$t]=p(e.substr(s,2)),a[Kt]=p(e.substr(n))});var ls,Ms=/[ap]\.?m?\.?/i,hs=P("Hours",!0),Ls={calendar:ht,longDateFormat:Lt,invalidDate:"Invalid date",ordinal:"%d",ordinalParse:ct,relativeTime:Yt,months:es,monthsShort:as,week:rs,weekdays:_s,weekdaysMin:is,weekdaysShort:ds,meridiemParse:Ms},cs={},Ys={},ys=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ps=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,fs=/Z|[+-]\d\d(?::?\d\d)?/,ks=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Ds=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ts=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=D("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.ISO_8601=function(){};var gs=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ee.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:M()}),ws=D("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ee.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:M()});Re("Z",":"),Re("ZZ",""),I("Z",Ot),I("ZZ",Ot),U(["Z","ZZ"],function(e,a,t){t._useUTC=!0,t._tzm=Ie(Ot,e)});var vs=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Ss=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Hs=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ue.fn=ze.prototype;var bs=Ze(1,"add"),js=Ze(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var xs=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});F(0,["gg",2],0,function(){return this.weekYear()%100}),F(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ea("gggg","weekYear"),ea("ggggg","weekYear"),ea("GGGG","isoWeekYear"),ea("GGGGG","isoWeekYear"),S("weekYear","gg"),S("isoWeekYear","GG"),j("weekYear",1),j("isoWeekYear",1),I("G",Ft),I("g",Ft),I("GG",bt,wt),I("gg",bt,wt),I("GGGG",Wt,St),I("gggg",Wt,St),I("GGGGG",At,Ht),I("ggggg",At,Ht),V(["gggg","ggggg","GGGG","GGGGG"],function(e,a,t,s){a[s.substr(0,2)]=p(e)}),V(["gg","GG"],function(a,t,s,n){t[n]=e.parseTwoDigitYear(a)}),F("Q",0,"Qo","quarter"),S("quarter","Q"),j("quarter",7),I("Q",gt),U("Q",function(e,a){a[Nt]=3*(p(e)-1)}),F("D",["DD",2],"Do","date"),S("date","D"),j("date",9),I("D",bt),I("DD",bt,wt),I("Do",function(e,a){return e?a._ordinalParse:a._ordinalParseLenient}),U(["D","DD"],Ut),U("Do",function(e,a){a[Ut]=p(e.match(bt)[0],10)});var Ps=P("Date",!0);F("DDD",["DDDD",3],"DDDo","dayOfYear"),S("dayOfYear","DDD"),j("dayOfYear",4),I("DDD",Pt),I("DDDD",vt),U(["DDD","DDDD"],function(e,a,t){t._dayOfYear=p(e)}),F("m",["mm",2],0,"minute"),S("minute","m"),j("minute",14),I("m",bt),I("mm",bt,wt),U(["m","mm"],$t);var Ws=P("Minutes",!1);F("s",["ss",2],0,"second"),S("second","s"),j("second",15),I("s",bt),I("ss",bt,wt),U(["s","ss"],Kt);var As=P("Seconds",!1);F("S",0,0,function(){return~~(this.millisecond()/100)}),F(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,function(){return 10*this.millisecond()}),F(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),F(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),F(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),F(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),F(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),S("millisecond","ms"),j("millisecond",16),I("S",Pt,gt),I("SS",Pt,wt),I("SSS",Pt,vt);var Es;for(Es="SSSS";Es.length<=9;Es+="S")I(Es,Et);for(Es="S";Es.length<=9;Es+="S")U(Es,function(e,a){a[Zt]=p(1e3*("0."+e))});var Fs=P("Milliseconds",!1);F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var zs=c.prototype;zs.add=bs,zs.calendar=function(a,t){var s=a||Ee(),n=Ce(s,this).startOf("day"),r=e.calendarFormat(this,n)||"sameElse",_=t&&(g(t[r])?t[r].call(this,s):t[r]);return this.format(_||this.localeData().calendar(r,this,Ee(s)))},zs.clone=function(){return new c(this)},zs.diff=function(e,a,t){var s,n,r,_;return this.isValid()?(s=Ce(e,this),s.isValid()?(n=6e4*(s.utcOffset()-this.utcOffset()),a=H(a),"year"===a||"month"===a||"quarter"===a?(_=Be(this,s),"quarter"===a?_/=3:"year"===a&&(_/=12)):(r=this-s,_="second"===a?r/1e3:"minute"===a?r/6e4:"hour"===a?r/36e5:"day"===a?(r-n)/864e5:"week"===a?(r-n)/6048e5:r),t?_:y(_)):NaN):NaN},zs.endOf=function(e){return e=H(e),void 0===e||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},zs.format=function(a){a||(a=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var t=J(this,a);return this.localeData().postformat(t)},zs.from=function(e,a){return this.isValid()&&(Y(e)&&e.isValid()||Ee(e).isValid())?Ue({to:this,from:e}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()},zs.fromNow=function(e){return this.from(Ee(),e)},zs.to=function(e,a){return this.isValid()&&(Y(e)&&e.isValid()||Ee(e).isValid())?Ue({from:this,to:e}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()},zs.toNow=function(e){return this.to(Ee(),e)},zs.get=function(e){return e=H(e),g(this[e])?this[e]():this},zs.invalidAt=function(){return u(this).overflow},zs.isAfter=function(e,a){var t=Y(e)?e:Ee(e);return!(!this.isValid()||!t.isValid())&&(a=H(h(a)?"millisecond":a),"millisecond"===a?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(a).valueOf())},zs.isBefore=function(e,a){var t=Y(e)?e:Ee(e);return!(!this.isValid()||!t.isValid())&&(a=H(h(a)?"millisecond":a),"millisecond"===a?this.valueOf()<t.valueOf():this.clone().endOf(a).valueOf()<t.valueOf())},zs.isBetween=function(e,a,t,s){return s=s||"()",("("===s[0]?this.isAfter(e,t):!this.isBefore(e,t))&&(")"===s[1]?this.isBefore(a,t):!this.isAfter(a,t))},zs.isSame=function(e,a){var t,s=Y(e)?e:Ee(e);return!(!this.isValid()||!s.isValid())&&(a=H(a||"millisecond"),"millisecond"===a?this.valueOf()===s.valueOf():(t=s.valueOf(),this.clone().startOf(a).valueOf()<=t&&t<=this.clone().endOf(a).valueOf()))},zs.isSameOrAfter=function(e,a){return this.isSame(e,a)||this.isAfter(e,a)},zs.isSameOrBefore=function(e,a){return this.isSame(e,a)||this.isBefore(e,a)},zs.isValid=function(){return l(this)},zs.lang=xs,zs.locale=Qe,zs.localeData=Xe,zs.max=ws,zs.min=gs,zs.parsingFlags=function(){return i({},u(this))},zs.set=function(e,a){if("object"==typeof e)for(var t=x(e=b(e)),s=0;s<t.length;s++)this[t[s].unit](e[t[s].unit]);else if(e=H(e),g(this[e]))return this[e](a);return this},zs.startOf=function(e){switch(e=H(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},zs.subtract=js,zs.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},zs.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},zs.toDate=function(){return new Date(this.valueOf())},zs.toISOString=function(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?g(Date.prototype.toISOString)?this.toDate().toISOString():J(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):J(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},zs.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",a="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z");var t="["+e+'("]',s=0<this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=a+'[")]';return this.format(t+s+"-MM-DD[T]HH:mm:ss.SSS"+n)},zs.toJSON=function(){return this.isValid()?this.toISOString():null},zs.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},zs.unix=function(){return Math.floor(this.valueOf()/1e3)},zs.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},zs.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},zs.year=ns,zs.isLeapYear=function(){return ee(this.year())},zs.weekYear=function(e){return aa.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},zs.isoWeekYear=function(e){return aa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},zs.quarter=zs.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},zs.month=B,zs.daysInMonth=function(){return K(this.year(),this.month())},zs.week=zs.weeks=function(e){var a=this.localeData().week(this);return null==e?a:this.add(7*(e-a),"d")},zs.isoWeek=zs.isoWeeks=function(e){var a=re(this,1,4).week;return null==e?a:this.add(7*(e-a),"d")},zs.weeksInYear=function(){var e=this.localeData()._week;return _e(this.year(),e.dow,e.doy)},zs.isoWeeksInYear=function(){return _e(this.year(),1,4)},zs.date=Ps,zs.day=zs.days=function(e){if(!this.isValid())return null!=e?this:NaN;var a=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=de(e,this.localeData()),this.add(e-a,"d")):a},zs.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var a=(this.day()+7-this.localeData()._week.dow)%7;return null==e?a:this.add(e-a,"d")},zs.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var a=ie(e,this.localeData());return this.day(this.day()%7?a:a-7)}return this.day()||7},zs.dayOfYear=function(e){var a=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?a:this.add(e-a,"d")},zs.hour=zs.hours=hs,zs.minute=zs.minutes=Ws,zs.second=zs.seconds=As,zs.millisecond=zs.milliseconds=Fs,zs.utcOffset=function(a,t){var s,n=this._offset||0;if(!this.isValid())return null!=a?this:NaN;if(null!=a){if("string"==typeof a){if(null===(a=Ie(Ot,a)))return this}else Math.abs(a)<16&&(a*=60);return!this._isUTC&&t&&(s=Ge(this)),this._offset=a,this._isUTC=!0,null!=s&&this.add(s,"m"),n!==a&&(!t||this._changeInProgress?qe(this,Ue(a-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?n:Ge(this)},zs.utc=function(e){return this.utcOffset(0,e)},zs.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ge(this),"m")),this},zs.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var e=Ie(zt,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},zs.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ee(e).utcOffset():0,(this.utcOffset()-e)%60==0)},zs.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},zs.isLocal=function(){return!!this.isValid()&&!this._isUTC},zs.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},zs.isUtc=Ne,zs.isUTC=Ne,zs.zoneAbbr=function(){return this._isUTC?"UTC":""},zs.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},zs.dates=D("dates accessor is deprecated. Use date instead.",Ps),zs.months=D("months accessor is deprecated. Use month instead",B),zs.years=D("years accessor is deprecated. Use year instead",ns),zs.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,a){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,a),this):-this.utcOffset()}),zs.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!h(this._isDSTShifted))return this._isDSTShifted;var e={};if(L(e,this),(e=Pe(e))._a){var a=e._isUTC?o(e._a):Ee(e._a);this._isDSTShifted=this.isValid()&&f(e._a,a.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var Os=v.prototype;Os.calendar=function(e,a,t){var s=this._calendar[e]||this._calendar.sameElse;return g(s)?s.call(a,t):s},Os.longDateFormat=function(e){var a=this._longDateFormat[e],t=this._longDateFormat[e.toUpperCase()];return a||!t?a:(this._longDateFormat[e]=t.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},Os.invalidDate=function(){return this._invalidDate},Os.ordinal=function(e){return this._ordinal.replace("%d",e)},Os.preparse=sa,Os.postformat=sa,Os.relativeTime=function(e,a,t,s){var n=this._relativeTime[t];return g(n)?n(e,a,t,s):n.replace(/%d/i,e)},Os.pastFuture=function(e,a){var t=this._relativeTime[e>0?"future":"past"];return g(t)?t(a):t.replace(/%s/i,a)},Os.set=function(e){var a,t;for(t in e)a=e[t],g(a)?this[t]=a:this["_"+t]=a;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},Os.months=function(e,t){return e?a(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Xt).test(t)?"format":"standalone"][e.month()]:this._months},Os.monthsShort=function(e,t){return e?a(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Xt.test(t)?"format":"standalone"][e.month()]:this._monthsShort},Os.monthsParse=function(e,a,t){var s,n,r;if(this._monthsParseExact)return Z.call(this,e,a,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(n=o([2e3,s]),t&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),t||this._monthsParse[s]||(r="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),t&&"MMMM"===a&&this._longMonthsParse[s].test(e))return s;if(t&&"MMM"===a&&this._shortMonthsParse[s].test(e))return s;if(!t&&this._monthsParse[s].test(e))return s}},Os.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Q.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=ss),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Os.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Q.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=ts),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Os.week=function(e){return re(e,this._week.dow,this._week.doy).week},Os.firstDayOfYear=function(){return this._week.doy},Os.firstDayOfWeek=function(){return this._week.dow},Os.weekdays=function(e,t){return e?a(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:this._weekdays},Os.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},Os.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},Os.weekdaysParse=function(e,a,t){var s,n,r;if(this._weekdaysParseExact)return oe.call(this,e,a,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(n=o([2e3,1]).day(s),t&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),t&&"dddd"===a&&this._fullWeekdaysParse[s].test(e))return s;if(t&&"ddd"===a&&this._shortWeekdaysParse[s].test(e))return s;if(t&&"dd"===a&&this._minWeekdaysParse[s].test(e))return s;if(!t&&this._weekdaysParse[s].test(e))return s}},Os.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||me.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=os),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Os.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||me.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ms),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Os.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||me.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=us),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Os.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Os.meridiem=function(e,a,t){return e>11?t?"pm":"PM":t?"am":"AM"},Ye("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var a=e%10;return e+(1===p(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")}}),e.lang=D("moment.lang is deprecated. Use moment.locale instead.",Ye),e.langData=D("moment.langData is deprecated. Use moment.localeData instead.",pe);var Js=Math.abs,Rs=ua("ms"),Is=ua("s"),Cs=ua("m"),Gs=ua("h"),Ns=ua("d"),Us=ua("w"),Vs=ua("M"),$s=ua("y"),Ks=la("milliseconds"),Zs=la("seconds"),qs=la("minutes"),Bs=la("hours"),Qs=la("days"),Xs=la("months"),en=la("years"),an=Math.round,tn={s:45,m:45,h:22,d:26,M:11},sn=Math.abs,nn=ze.prototype;nn.abs=function(){var e=this._data;return this._milliseconds=Js(this._milliseconds),this._days=Js(this._days),this._months=Js(this._months),e.milliseconds=Js(e.milliseconds),e.seconds=Js(e.seconds),e.minutes=Js(e.minutes),e.hours=Js(e.hours),e.months=Js(e.months),e.years=Js(e.years),this},nn.add=function(e,a){return da(this,e,a,1)},nn.subtract=function(e,a){return da(this,e,a,-1)},nn.as=function(e){var a,t,s=this._milliseconds;if("month"===(e=H(e))||"year"===e)return a=this._days+s/864e5,t=this._months+oa(a),"month"===e?t:t/12;switch(a=this._days+Math.round(ma(this._months)),e){case"week":return a/7+s/6048e5;case"day":return a+s/864e5;case"hour":return 24*a+s/36e5;case"minute":return 1440*a+s/6e4;case"second":return 86400*a+s/1e3;case"millisecond":return Math.floor(864e5*a)+s;default:throw new Error("Unknown unit "+e)}},nn.asMilliseconds=Rs,nn.asSeconds=Is,nn.asMinutes=Cs,nn.asHours=Gs,nn.asDays=Ns,nn.asWeeks=Us,nn.asMonths=Vs,nn.asYears=$s,nn.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)},nn._bubble=function(){var e,a,t,s,n,r=this._milliseconds,_=this._days,d=this._months,i=this._data;return r>=0&&_>=0&&d>=0||r<=0&&_<=0&&d<=0||(r+=864e5*ia(ma(d)+_),_=0,d=0),i.milliseconds=r%1e3,e=y(r/1e3),i.seconds=e%60,a=y(e/60),i.minutes=a%60,t=y(a/60),i.hours=t%24,_+=y(t/24),n=y(oa(_)),d+=n,_-=ia(ma(n)),s=y(d/12),d%=12,i.days=_,i.months=d,i.years=s,this},nn.get=function(e){return e=H(e),this[e+"s"]()},nn.milliseconds=Ks,nn.seconds=Zs,nn.minutes=qs,nn.hours=Bs,nn.days=Qs,nn.weeks=function(){return y(this.days()/7)},nn.months=Xs,nn.years=en,nn.humanize=function(e){var a=this.localeData(),t=ha(this,!e,a);return e&&(t=a.pastFuture(+this,t)),a.postformat(t)},nn.toISOString=La,nn.toString=La,nn.toJSON=La,nn.locale=Qe,nn.localeData=Xe,nn.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",La),nn.lang=xs,F("X",0,0,"unix"),F("x",0,0,"valueOf"),I("x",Ft),I("X",Jt),U("X",function(e,a,t){t._d=new Date(1e3*parseFloat(e,10))}),U("x",function(e,a,t){t._d=new Date(p(e))}),e.version="2.17.1",rt=Ee,e.fn=zs,e.min=function(){return Fe("isBefore",[].slice.call(arguments,0))},e.max=function(){return Fe("isAfter",[].slice.call(arguments,0))},e.now=function(){return Date.now?Date.now():+new Date},e.utc=o,e.unix=function(e){return Ee(1e3*e)},e.months=function(e,a){return ra(e,a,"months")},e.isDate=r,e.locale=Ye,e.invalid=M,e.duration=Ue,e.isMoment=Y,e.weekdays=function(e,a,t){return _a(e,a,t,"weekdays")},e.parseZone=function(){return Ee.apply(null,arguments).parseZone()},e.localeData=pe,e.isDuration=Oe,e.monthsShort=function(e,a){return ra(e,a,"monthsShort")},e.weekdaysMin=function(e,a,t){return _a(e,a,t,"weekdaysMin")},e.defineLocale=ye,e.updateLocale=function(e,a){if(null!=a){var t,s=Ls;null!=cs[e]&&(s=cs[e]._config),(t=new v(a=w(s,a))).parentLocale=cs[e],cs[e]=t,Ye(e)}else null!=cs[e]&&(null!=cs[e].parentLocale?cs[e]=cs[e].parentLocale:null!=cs[e]&&delete cs[e]);return cs[e]},e.locales=function(){return Mt(cs)},e.weekdaysShort=function(e,a,t){return _a(e,a,t,"weekdaysShort")},e.normalizeUnits=H,e.relativeTimeRounding=function(e){return void 0===e?an:"function"==typeof e&&(an=e,!0)},e.relativeTimeThreshold=function(e,a){return void 0!==tn[e]&&(void 0===a?tn[e]:(tn[e]=a,!0))},e.calendarFormat=function(e,a){var t=e.diff(a,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"},e.prototype=zs,e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,a,t){return e<12?t?"vm":"VM":t?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}}),e.defineLocale("ar-dz",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"أح_إث_ثلا_أر_خم_جم_سب".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:4}});var rn={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},_n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},dn={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},on=function(e){return function(a,t,s,n){var r=_n(a),_=dn[e][_n(a)];return 2===r&&(_=_[t?0:1]),_.replace(/%d/i,a)}},mn=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:mn,monthsShort:mn,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,a,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:on("s"),m:on("m"),mm:on("m"),h:on("h"),hh:on("h"),d:on("d"),dd:on("d"),M:on("M"),MM:on("M"),y:on("y"),yy:on("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return rn[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}}),e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}});var un={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},ln={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,a,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return ln[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return un[e]}).replace(/,/g,"،")},week:{dow:0,doy:6}}),e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}});var Mn={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},hn={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},Ln=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},cn={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},Yn=function(e){return function(a,t,s,n){var r=Ln(a),_=cn[e][Ln(a)];return 2===r&&(_=_[t?0:1]),_.replace(/%d/i,a)}},yn=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"];e.defineLocale("ar",{months:yn,monthsShort:yn,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,a,t){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:Yn("s"),m:Yn("m"),mm:Yn("m"),h:Yn("h"),hh:Yn("h"),d:Yn("d"),dd:Yn("d"),M:Yn("M"),MM:Yn("M"),y:Yn("y"),yy:Yn("y")},preparse:function(e){return e.replace(/\u200f/g,"").replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return hn[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return Mn[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}});var pn={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,a,t){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},ordinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var a=e%10,t=e%100-a,s=e>=100?100:null;return e+(pn[a]||pn[t]||pn[s])},week:{dow:1,doy:7}}),e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:Ya,mm:Ya,h:Ya,hh:Ya,d:"дзень",dd:Ya,M:"месяц",MM:Ya,y:"год",yy:Ya},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,a,t){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},ordinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,a){switch(a){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}}),e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var a=e%10,t=e%100;return 0===e?e+"-ев":0===t?e+"-ен":t>10&&t<20?e+"-ти":1===a?e+"-ви":2===a?e+"-ри":7===a||8===a?e+"-ми":e+"-ти"},week:{dow:1,doy:7}});var fn={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},kn={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return kn[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return fn[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,a){return 12===e&&(e=0),"রাত"===a&&e>=4||"দুপুর"===a&&e<5||"বিকাল"===a?e+12:e},meridiem:function(e,a,t){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}});var Dn={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},Tn={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return Tn[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return Dn[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,a){return 12===e&&(e=0),"མཚན་མོ"===a&&e>=4||"ཉིན་གུང"===a&&e<5||"དགོང་དག"===a?e+12:e},meridiem:function(e,a,t){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}}),e.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:ya,h:"un eur",hh:"%d eur",d:"un devezh",dd:ya,M:"ur miz",MM:ya,y:"ur bloaz",yy:function(e){switch(pa(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},ordinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4}}),e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:Da,mm:Da,h:Da,hh:Da,d:"dan",dd:Da,M:"mjesec",MM:Da,y:"godinu",yy:Da},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),e.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,a){var t=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==a&&"W"!==a||(t="a"),e+t},week:{dow:1,doy:4}});var gn="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),wn="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");e.defineLocale("cs",{months:gn,monthsShort:wn,monthsParse:function(e,a){var t,s=[];for(t=0;t<12;t++)s[t]=new RegExp("^"+e[t]+"$|^"+a[t]+"$","i");return s}(gn,wn),shortMonthsParse:function(e){var a,t=[];for(a=0;a<12;a++)t[a]=new RegExp("^"+e[a]+"$","i");return t}(wn),longMonthsParse:function(e){var a,t=[];for(a=0;a<12;a++)t[a]=new RegExp("^"+e[a]+"$","i");return t}(gn),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:ga,m:ga,mm:ga,h:ga,hh:ga,d:ga,dd:ga,M:ga,MM:ga,y:ga,yy:ga},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},ordinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}}),e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},ordinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var a=e,t="",s=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return a>20?t=40===a||50===a||60===a||80===a||100===a?"fed":"ain":a>0&&(t=s[a]),e+t},week:{dow:1,doy:4}}),e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY HH:mm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:wa,mm:"%d Minuten",h:wa,hh:"%d Stunden",d:wa,dd:wa,M:wa,MM:wa,y:wa,yy:wa},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:va,mm:"%d Minuten",h:va,hh:"%d Stunden",d:va,dd:va,M:va,MM:va,y:va,yy:va},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});var vn=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],Sn=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:vn,monthsShort:vn,weekdays:Sn,weekdaysShort:Sn,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,a,t){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}}),e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,a){return/D/.test(a.substring(0,a.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,a,t){return e>11?t?"μμ":"ΜΜ":t?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,a){var t=this._calendarEl[e],s=a&&a.hours();return g(t)&&(t=t.apply(a)),t.replace("{}",s%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},ordinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}}),e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}}),e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")}}),e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}}),e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}}),e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}}),e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato".split("_"),weekdaysShort:"Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Ĵa_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-an de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,a,t){return e>11?t?"p.t.m.":"P.T.M.":t?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}});var Hn="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),bn="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return/-MMM-/.test(a)?bn[e.month()]:Hn[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});var jn="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),xn="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return/-MMM-/.test(a)?xn[e.month()]:jn[e.month()]},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:Sa,m:Sa,mm:Sa,h:Sa,hh:Sa,d:Sa,dd:"%d päeva",M:Sa,MM:Sa,y:Sa,yy:Sa},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});var Pn={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},Wn={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,a,t){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,function(e){return Wn[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return Pn[e]}).replace(/,/g,"،")},ordinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}});var An="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),En=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",An[7],An[8],An[9]];e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:Ha,m:Ha,mm:Ha,h:Ha,hh:Ha,d:Ha,dd:Ha,M:Ha,MM:Ha,y:Ha,yy:Ha},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(e){return e+(1===e?"er":"e")}}),e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|e)/,ordinal:function(e){return e+(1===e?"er":"e")},week:{dow:1,doy:4}}),e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(e){return e+(1===e?"er":"")},week:{dow:1,doy:4}});var Fn="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),zn="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,a){return/-MMM-/.test(a)?zn[e.month()]:Fn[e.month()]},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}});var On=["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],Jn=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],Rn=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],In=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],Cn=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"];e.defineLocale("gd",{months:On,monthsShort:Jn,monthsParseExact:!0,weekdays:Rn,weekdaysShort:In,weekdaysMin:Cn,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},ordinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}}),e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,a,t){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?t?'לפנה"צ':"לפני הצהריים":e<18?t?'אחה"צ':"אחרי הצהריים":"בערב"}});var Gn={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},Nn={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return Nn[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return Gn[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,a){return 12===e&&(e=0),"रात"===a?e<4?e:e+12:"सुबह"===a?e:"दोपहर"===a?e>=10?e:e+12:"शाम"===a?e+12:void 0},meridiem:function(e,a,t){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}}),e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:ja,mm:ja,h:ja,hh:ja,d:"dan",dd:ja,M:"mjesec",MM:ja,y:"godinu",yy:ja},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});var Un="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,a,t){return e<12?!0===t?"de":"DE":!0===t?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return Pa.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return Pa.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:xa,m:xa,mm:xa,h:xa,hh:xa,d:xa,dd:xa,M:xa,MM:xa,y:xa,yy:xa},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},ordinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,a){switch(a){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}}),e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"siang"===a?e>=11?e:e+12:"sore"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,t){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:Aa,m:Aa,mm:Aa,h:"klukkustund",hh:Aa,d:Aa,dd:Aa,M:Aa,MM:Aa,y:Aa,yy:Aa},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),e.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,a,t){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},ordinalParse:/\d{1,2}日/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,a){return 12===e&&(e=0),"enjing"===a?e:"siyang"===a?e>=11?e:e+12:"sonten"===a||"ndalu"===a?e+12:void 0},meridiem:function(e,a,t){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}}),e.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return/(წამი|წუთი|საათი|წელი)/.test(e)?e.replace(/ი$/,"ში"):e+"ში"},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}});var Vn={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){var a=e%10,t=e>=100?100:null;return e+(Vn[e]||Vn[a]||Vn[t])},week:{dow:1,doy:7}}),e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}}),e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"일분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,a,t){return e<12?"오전":"오후"}});var $n={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кече саат] LT",lastWeek:"[Өткен аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},ordinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){var a=e%10,t=e>=100?100:null;return e+($n[e]||$n[a]||$n[t])},week:{dow:1,doy:7}}),e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return Fa(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return Fa(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",m:Ea,mm:"%d Minutten",h:Ea,hh:"%d Stonnen",d:Ea,dd:"%d Deeg",M:Ea,MM:"%d Méint",y:Ea,yy:"%d Joer"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,a,t){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},ordinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}});var Kn={m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,a,t,s){return a?"kelios sekundės":s?"kelių sekundžių":"kelias sekundes"},m:za,mm:Ra,h:za,hh:Ra,d:za,dd:Ra,M:za,MM:Ra,y:za,yy:Ra},ordinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}});var Zn={m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,a){return a?"dažas sekundes":"dažām sekundēm"},m:Ga,mm:Ca,h:Ga,hh:Ca,d:Ga,dd:Ca,M:Ga,MM:Ca,y:Ga,yy:Ca},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});var qn={words:{m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,a,t){var s=qn.words[t];return 1===t.length?a?s[0]:s[1]:e+" "+qn.correctGrammaticalCase(e,s)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",m:qn.translate,mm:qn.translate,h:qn.translate,hh:qn.translate,d:"dan",dd:qn.translate,M:"mjesec",MM:qn.translate,y:"godinu",yy:qn.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var a=e%10,t=e%100;return 0===e?e+"-ев":0===t?e+"-ен":t>10&&t<20?e+"-ти":1===a?e+"-ви":2===a?e+"-ри":7===a||8===a?e+"-ми":e+"-ти"},week:{dow:1,doy:7}}),e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,a){return 12===e&&(e=0),"രാത്രി"===a&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===a||"വൈകുന്നേരം"===a?e+12:e},meridiem:function(e,a,t){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}});var Bn={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},Qn={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:Na,m:Na,mm:Na,h:Na,hh:Na,d:Na,dd:Na,M:Na,MM:Na,y:Na,yy:Na},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return Qn[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return Bn[e]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(e,a){return 12===e&&(e=0),"रात्री"===a?e<4?e:e+12:"सकाळी"===a?e:"दुपारी"===a?e>=10?e:e+12:"सायंकाळी"===a?e+12:void 0},meridiem:function(e,a,t){return e<4?"रात्री":e<10?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}}),e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e>=11?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,t){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}}),e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,a){return 12===e&&(e=0),"pagi"===a?e:"tengahari"===a?e>=11?e:e+12:"petang"===a||"malam"===a?e+12:void 0},meridiem:function(e,a,t){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}});var Xn={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},er={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(e){return er[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return Xn[e]})},week:{dow:1,doy:4}}),e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});var ar={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},tr={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return tr[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return ar[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,a){return 12===e&&(e=0),"राति"===a?e<4?e:e+12:"बिहान"===a?e:"दिउँसो"===a?e>=10?e:e+12:"साँझ"===a?e+12:void 0},meridiem:function(e,a,t){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}});var sr="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),nr="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),rr=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],_r=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return/-MMM-/.test(a)?nr[e.month()]:sr[e.month()]},monthsRegex:_r,monthsShortRegex:_r,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:rr,longMonthsParse:rr,shortMonthsParse:rr,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}});var dr="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),ir="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),or=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],mr=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return/-MMM-/.test(a)?ir[e.month()]:dr[e.month()]},monthsRegex:mr,monthsShortRegex:mr,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:or,longMonthsParse:or,shortMonthsParse:or,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}}),e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});var ur={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},lr={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return lr[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return ur[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,a){return 12===e&&(e=0),"ਰਾਤ"===a?e<4?e:e+12:"ਸਵੇਰ"===a?e:"ਦੁਪਹਿਰ"===a?e>=10?e:e+12:"ਸ਼ਾਮ"===a?e+12:void 0},meridiem:function(e,a,t){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}});var Mr="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),hr="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");e.defineLocale("pl",{months:function(e,a){return""===a?"("+hr[e.month()]+"|"+Mr[e.month()]+")":/D MMMM/.test(a)?hr[e.month()]:Mr[e.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:Va,mm:Va,h:Va,hh:Va,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:Va,y:"rok",yy:Va},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),e.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:$a,h:"o oră",hh:$a,d:"o zi",dd:$a,M:"o lună",MM:$a,y:"un an",yy:$a},week:{dow:1,doy:7}});var Lr=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:Lr,longMonthsParse:Lr,shortMonthsParse:Lr,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:Za,mm:Za,h:"час",hh:Za,d:"день",dd:Za,M:"месяц",MM:Za,y:"год",yy:Za},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,a,t){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,a){switch(a){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:7}}),e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},ordinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,a,t){return e>11?t?"ප.ව.":"පස් වරු":t?"පෙ.ව.":"පෙර වරු"}});var cr="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),Yr="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");e.defineLocale("sk",{months:cr,monthsShort:Yr,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:Ba,m:Ba,mm:Ba,h:Ba,hh:Ba,d:Ba,dd:Ba,M:Ba,MM:Ba,y:Ba,yy:Ba},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:Qa,m:Qa,mm:Qa,h:Qa,hh:Qa,d:Qa,dd:Qa,M:Qa,MM:Qa,y:Qa,yy:Qa},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,a,t){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});var yr={words:{m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,a,t){var s=yr.words[t];return 1===t.length?a?s[0]:s[1]:e+" "+yr.correctGrammaticalCase(e,s)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:yr.translate,mm:yr.translate,h:yr.translate,hh:yr.translate,d:"дан",dd:yr.translate,M:"месец",MM:yr.translate,y:"годину",yy:yr.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});var pr={words:{m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,a){return 1===e?a[0]:e>=2&&e<=4?a[1]:a[2]},translate:function(e,a,t){var s=pr.words[t];return 1===t.length?a?s[0]:s[1]:e+" "+pr.correctGrammaticalCase(e,s)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:pr.translate,mm:pr.translate,h:pr.translate,hh:pr.translate,d:"dan",dd:pr.translate,M:"mesec",MM:pr.translate,y:"godinu",yy:pr.translate},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,a,t){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,a){return 12===e&&(e=0),"ekuseni"===a?e:"emini"===a?e>=11?e:e+12:"entsambama"===a||"ebusuku"===a?0===e?0:e+12:void 0},ordinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}}),e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"e":1===a?"a":2===a?"a":"e")},week:{dow:1,doy:4}}),e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}});var fr={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},kr={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},ordinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return kr[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return fr[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,a,t){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,a){return 12===e&&(e=0),"யாமம்"===a?e<2?e:e+12:"வைகறை"===a||"காலை"===a?e:"நண்பகல்"===a&&e>=10?e:e+12},week:{dow:0,doy:6}}),e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},ordinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,a){return 12===e&&(e=0),"రాత్రి"===a?e<4?e:e+12:"ఉదయం"===a?e:"మధ్యాహ్నం"===a?e>=10?e:e+12:"సాయంత్రం"===a?e+12:void 0},meridiem:function(e,a,t){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}}),e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juniu_Juliu_Augustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Aug_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sexta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sext_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Sex_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",m:"minutu ida",mm:"minutus %d",h:"horas ida",hh:"horas %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}}),e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,a,t){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},ordinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}});var Dr="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var a=e;return a=-1!==e.indexOf("jaj")?a.slice(0,-3)+"leS":-1!==e.indexOf("jar")?a.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?a.slice(0,-3)+"nem":a+" pIq"},past:function(e){var a=e;return a=-1!==e.indexOf("jaj")?a.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?a.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?a.slice(0,-3)+"ben":a+" ret"},s:"puS lup",m:"wa’ tup",mm:Xa,h:"wa’ rep",hh:Xa,d:"wa’ jaj",dd:Xa,M:"wa’ jar",MM:Xa,y:"wa’ DIS",yy:Xa},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});var Tr={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(e){if(0===e)return e+"'ıncı";var a=e%10,t=e%100-a,s=e>=100?100:null;return e+(Tr[a]||Tr[t]||Tr[s])},week:{dow:1,doy:7}}),e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,a,t){return e>11?t?"d'o":"D'O":t?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:at,m:at,mm:at,h:at,hh:at,d:at,dd:at,M:at,MM:at,y:at,yy:at},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}}),e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}}),e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,a){return{nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")}[/(\[[ВвУу]\]) ?dddd/.test(a)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(a)?"genitive":"nominative"][e.day()]},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:nt("[Сьогодні "),nextDay:nt("[Завтра "),lastDay:nt("[Вчора "),nextWeek:nt("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return nt("[Минулої] dddd [").call(this);case 1:case 2:case 4:return nt("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:st,mm:st,h:"годину",hh:st,d:"день",dd:st,M:"місяць",MM:st,y:"рік",yy:st},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,a,t){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,a){switch(a){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}}),e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}}),e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,a,t){return e<12?t?"sa":"SA":t?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},ordinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}}),e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var a=e%10;return e+(1==~~(e%100/10)?"th":1===a?"st":2===a?"nd":3===a?"rd":"th")},week:{dow:1,doy:4}}),e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},ordinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}}),e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,a){return 12===e&&(e=0),"凌晨"===a||"早上"===a||"上午"===a?e:"下午"===a||"晚上"===a?e+12:e>=11?e:e+12},meridiem:function(e,a,t){var s=100*e+a;return s<600?"凌晨":s<900?"早上":s<1130?"上午":s<1230?"中午":s<1800?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var a,t;return a=e().startOf("week"),t=this.diff(a,"days")>=7?"[下]":"[本]",0===this.minutes()?t+"dddAh点整":t+"dddAh点mm"},lastWeek:function(){var a,t;return a=e().startOf("week"),t=this.unix()<a.unix()?"[上]":"[本]",0===this.minutes()?t+"dddAh点整":t+"dddAh点mm"},sameElse:"LL"},ordinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}}),e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,a){return 12===e&&(e=0),"凌晨"===a||"早上"===a||"上午"===a?e:"中午"===a?e>=11?e:e+12:"下午"===a||"晚上"===a?e+12:void 0},meridiem:function(e,a,t){var s=100*e+a;return s<600?"凌晨":s<900?"早上":s<1130?"上午":s<1230?"中午":s<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}}),e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,a){return 12===e&&(e=0),"凌晨"===a||"早上"===a||"上午"===a?e:"中午"===a?e>=11?e:e+12:"下午"===a||"晚上"===a?e+12:void 0},meridiem:function(e,a,t){var s=100*e+a;return s<600?"凌晨":s<900?"早上":s<1130?"上午":s<1230?"中午":s<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,a){switch(a){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}}),e.locale("en"),e});;
/*! Hammer.JS - v2.0.8 - 2016-04-23
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
(function(window, document, exportName, undefined) {
  'use strict';

var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
var TEST_ELEMENT = document.createElement('div');

var TYPE_FUNCTION = 'function';

var round = Math.round;
var abs = Math.abs;
var now = Date.now;

/**
 * set a timeout with a given scope
 * @param {Function} fn
 * @param {Number} timeout
 * @param {Object} context
 * @returns {number}
 */
function setTimeoutContext(fn, timeout, context) {
    return setTimeout(bindFn(fn, context), timeout);
}

/**
 * if the argument is an array, we want to execute the fn on each entry
 * if it aint an array we don't want to do a thing.
 * this is used by all the methods that accept a single and array argument.
 * @param {*|Array} arg
 * @param {String} fn
 * @param {Object} [context]
 * @returns {Boolean}
 */
function invokeArrayArg(arg, fn, context) {
    if (Array.isArray(arg)) {
        each(arg, context[fn], context);
        return true;
    }
    return false;
}

/**
 * walk objects and arrays
 * @param {Object} obj
 * @param {Function} iterator
 * @param {Object} context
 */
function each(obj, iterator, context) {
    var i;

    if (!obj) {
        return;
    }

    if (obj.forEach) {
        obj.forEach(iterator, context);
    } else if (obj.length !== undefined) {
        i = 0;
        while (i < obj.length) {
            iterator.call(context, obj[i], i, obj);
            i++;
        }
    } else {
        for (i in obj) {
            obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
        }
    }
}

/**
 * wrap a method with a deprecation warning and stack trace
 * @param {Function} method
 * @param {String} name
 * @param {String} message
 * @returns {Function} A new function wrapping the supplied method.
 */
function deprecate(method, name, message) {
    var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
    return function() {
        var e = new Error('get-stack-trace');
        var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
            .replace(/^\s+at\s+/gm, '')
            .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';

        var log = window.console && (window.console.warn || window.console.log);
        if (log) {
            log.call(window.console, deprecationMessage, stack);
        }
        return method.apply(this, arguments);
    };
}

/**
 * extend object.
 * means that properties in dest will be overwritten by the ones in src.
 * @param {Object} target
 * @param {...Object} objects_to_assign
 * @returns {Object} target
 */
var assign;
if (typeof Object.assign !== 'function') {
    assign = function assign(target) {
        if (target === undefined || target === null) {
            throw new TypeError('Cannot convert undefined or null to object');
        }

        var output = Object(target);
        for (var index = 1; index < arguments.length; index++) {
            var source = arguments[index];
            if (source !== undefined && source !== null) {
                for (var nextKey in source) {
                    if (source.hasOwnProperty(nextKey)) {
                        output[nextKey] = source[nextKey];
                    }
                }
            }
        }
        return output;
    };
} else {
    assign = Object.assign;
}

/**
 * extend object.
 * means that properties in dest will be overwritten by the ones in src.
 * @param {Object} dest
 * @param {Object} src
 * @param {Boolean} [merge=false]
 * @returns {Object} dest
 */
var extend = deprecate(function extend(dest, src, merge) {
    var keys = Object.keys(src);
    var i = 0;
    while (i < keys.length) {
        if (!merge || (merge && dest[keys[i]] === undefined)) {
            dest[keys[i]] = src[keys[i]];
        }
        i++;
    }
    return dest;
}, 'extend', 'Use `assign`.');

/**
 * merge the values from src in the dest.
 * means that properties that exist in dest will not be overwritten by src
 * @param {Object} dest
 * @param {Object} src
 * @returns {Object} dest
 */
var merge = deprecate(function merge(dest, src) {
    return extend(dest, src, true);
}, 'merge', 'Use `assign`.');

/**
 * simple class inheritance
 * @param {Function} child
 * @param {Function} base
 * @param {Object} [properties]
 */
function inherit(child, base, properties) {
    var baseP = base.prototype,
        childP;

    childP = child.prototype = Object.create(baseP);
    childP.constructor = child;
    childP._super = baseP;

    if (properties) {
        assign(childP, properties);
    }
}

/**
 * simple function bind
 * @param {Function} fn
 * @param {Object} context
 * @returns {Function}
 */
function bindFn(fn, context) {
    return function boundFn() {
        return fn.apply(context, arguments);
    };
}

/**
 * let a boolean value also be a function that must return a boolean
 * this first item in args will be used as the context
 * @param {Boolean|Function} val
 * @param {Array} [args]
 * @returns {Boolean}
 */
function boolOrFn(val, args) {
    if (typeof val == TYPE_FUNCTION) {
        return val.apply(args ? args[0] || undefined : undefined, args);
    }
    return val;
}

/**
 * use the val2 when val1 is undefined
 * @param {*} val1
 * @param {*} val2
 * @returns {*}
 */
function ifUndefined(val1, val2) {
    return (val1 === undefined) ? val2 : val1;
}

/**
 * addEventListener with multiple events at once
 * @param {EventTarget} target
 * @param {String} types
 * @param {Function} handler
 */
function addEventListeners(target, types, handler) {
    each(splitStr(types), function(type) {
        target.addEventListener(type, handler, false);
    });
}

/**
 * removeEventListener with multiple events at once
 * @param {EventTarget} target
 * @param {String} types
 * @param {Function} handler
 */
function removeEventListeners(target, types, handler) {
    each(splitStr(types), function(type) {
        target.removeEventListener(type, handler, false);
    });
}

/**
 * find if a node is in the given parent
 * @method hasParent
 * @param {HTMLElement} node
 * @param {HTMLElement} parent
 * @return {Boolean} found
 */
function hasParent(node, parent) {
    while (node) {
        if (node == parent) {
            return true;
        }
        node = node.parentNode;
    }
    return false;
}

/**
 * small indexOf wrapper
 * @param {String} str
 * @param {String} find
 * @returns {Boolean} found
 */
function inStr(str, find) {
    return str.indexOf(find) > -1;
}

/**
 * split string on whitespace
 * @param {String} str
 * @returns {Array} words
 */
function splitStr(str) {
    return str.trim().split(/\s+/g);
}

/**
 * find if a array contains the object using indexOf or a simple polyFill
 * @param {Array} src
 * @param {String} find
 * @param {String} [findByKey]
 * @return {Boolean|Number} false when not found, or the index
 */
function inArray(src, find, findByKey) {
    if (src.indexOf && !findByKey) {
        return src.indexOf(find);
    } else {
        var i = 0;
        while (i < src.length) {
            if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
                return i;
            }
            i++;
        }
        return -1;
    }
}

/**
 * convert array-like objects to real arrays
 * @param {Object} obj
 * @returns {Array}
 */
function toArray(obj) {
    return Array.prototype.slice.call(obj, 0);
}

/**
 * unique array with objects based on a key (like 'id') or just by the array's value
 * @param {Array} src [{id:1},{id:2},{id:1}]
 * @param {String} [key]
 * @param {Boolean} [sort=False]
 * @returns {Array} [{id:1},{id:2}]
 */
function uniqueArray(src, key, sort) {
    var results = [];
    var values = [];
    var i = 0;

    while (i < src.length) {
        var val = key ? src[i][key] : src[i];
        if (inArray(values, val) < 0) {
            results.push(src[i]);
        }
        values[i] = val;
        i++;
    }

    if (sort) {
        if (!key) {
            results = results.sort();
        } else {
            results = results.sort(function sortUniqueArray(a, b) {
                return a[key] > b[key];
            });
        }
    }

    return results;
}

/**
 * get the prefixed property
 * @param {Object} obj
 * @param {String} property
 * @returns {String|Undefined} prefixed
 */
function prefixed(obj, property) {
    var prefix, prop;
    var camelProp = property[0].toUpperCase() + property.slice(1);

    var i = 0;
    while (i < VENDOR_PREFIXES.length) {
        prefix = VENDOR_PREFIXES[i];
        prop = (prefix) ? prefix + camelProp : property;

        if (prop in obj) {
            return prop;
        }
        i++;
    }
    return undefined;
}

/**
 * get a unique id
 * @returns {number} uniqueId
 */
var _uniqueId = 1;
function uniqueId() {
    return _uniqueId++;
}

/**
 * get the window object of an element
 * @param {HTMLElement} element
 * @returns {DocumentView|Window}
 */
function getWindowForElement(element) {
    var doc = element.ownerDocument || element;
    return (doc.defaultView || doc.parentWindow || window);
}

var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;

var SUPPORT_TOUCH = ('ontouchstart' in window);
var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);

var INPUT_TYPE_TOUCH = 'touch';
var INPUT_TYPE_PEN = 'pen';
var INPUT_TYPE_MOUSE = 'mouse';
var INPUT_TYPE_KINECT = 'kinect';

var COMPUTE_INTERVAL = 25;

var INPUT_START = 1;
var INPUT_MOVE = 2;
var INPUT_END = 4;
var INPUT_CANCEL = 8;

var DIRECTION_NONE = 1;
var DIRECTION_LEFT = 2;
var DIRECTION_RIGHT = 4;
var DIRECTION_UP = 8;
var DIRECTION_DOWN = 16;

var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;

var PROPS_XY = ['x', 'y'];
var PROPS_CLIENT_XY = ['clientX', 'clientY'];

/**
 * create new input type manager
 * @param {Manager} manager
 * @param {Function} callback
 * @returns {Input}
 * @constructor
 */
function Input(manager, callback) {
    var self = this;
    this.manager = manager;
    this.callback = callback;
    this.element = manager.element;
    this.target = manager.options.inputTarget;

    // smaller wrapper around the handler, for the scope and the enabled state of the manager,
    // so when disabled the input events are completely bypassed.
    this.domHandler = function(ev) {
        if (boolOrFn(manager.options.enable, [manager])) {
            self.handler(ev);
        }
    };

    this.init();

}

Input.prototype = {
    /**
     * should handle the inputEvent data and trigger the callback
     * @virtual
     */
    handler: function() { },

    /**
     * bind the events
     */
    init: function() {
        this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
        this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
        this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
    },

    /**
     * unbind the events
     */
    destroy: function() {
        this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
        this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
        this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
    }
};

/**
 * create new input type manager
 * called by the Manager constructor
 * @param {Hammer} manager
 * @returns {Input}
 */
function createInputInstance(manager) {
    var Type;
    var inputClass = manager.options.inputClass;

    if (inputClass) {
        Type = inputClass;
    } else if (SUPPORT_POINTER_EVENTS) {
        Type = PointerEventInput;
    } else if (SUPPORT_ONLY_TOUCH) {
        Type = TouchInput;
    } else if (!SUPPORT_TOUCH) {
        Type = MouseInput;
    } else {
        Type = TouchMouseInput;
    }
    return new (Type)(manager, inputHandler);
}

/**
 * handle input events
 * @param {Manager} manager
 * @param {String} eventType
 * @param {Object} input
 */
function inputHandler(manager, eventType, input) {
    var pointersLen = input.pointers.length;
    var changedPointersLen = input.changedPointers.length;
    var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
    var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));

    input.isFirst = !!isFirst;
    input.isFinal = !!isFinal;

    if (isFirst) {
        manager.session = {};
    }

    // source event is the normalized value of the domEvents
    // like 'touchstart, mouseup, pointerdown'
    input.eventType = eventType;

    // compute scale, rotation etc
    computeInputData(manager, input);

    // emit secret event
    manager.emit('hammer.input', input);

    manager.recognize(input);
    manager.session.prevInput = input;
}

/**
 * extend the data with some usable properties like scale, rotate, velocity etc
 * @param {Object} manager
 * @param {Object} input
 */
function computeInputData(manager, input) {
    var session = manager.session;
    var pointers = input.pointers;
    var pointersLength = pointers.length;

    // store the first input to calculate the distance and direction
    if (!session.firstInput) {
        session.firstInput = simpleCloneInputData(input);
    }

    // to compute scale and rotation we need to store the multiple touches
    if (pointersLength > 1 && !session.firstMultiple) {
        session.firstMultiple = simpleCloneInputData(input);
    } else if (pointersLength === 1) {
        session.firstMultiple = false;
    }

    var firstInput = session.firstInput;
    var firstMultiple = session.firstMultiple;
    var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;

    var center = input.center = getCenter(pointers);
    input.timeStamp = now();
    input.deltaTime = input.timeStamp - firstInput.timeStamp;

    input.angle = getAngle(offsetCenter, center);
    input.distance = getDistance(offsetCenter, center);

    computeDeltaXY(session, input);
    input.offsetDirection = getDirection(input.deltaX, input.deltaY);

    var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
    input.overallVelocityX = overallVelocity.x;
    input.overallVelocityY = overallVelocity.y;
    input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;

    input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
    input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;

    input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
        session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);

    computeIntervalInputData(session, input);

    // find the correct target
    var target = manager.element;
    if (hasParent(input.srcEvent.target, target)) {
        target = input.srcEvent.target;
    }
    input.target = target;
}

function computeDeltaXY(session, input) {
    var center = input.center;
    var offset = session.offsetDelta || {};
    var prevDelta = session.prevDelta || {};
    var prevInput = session.prevInput || {};

    if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
        prevDelta = session.prevDelta = {
            x: prevInput.deltaX || 0,
            y: prevInput.deltaY || 0
        };

        offset = session.offsetDelta = {
            x: center.x,
            y: center.y
        };
    }

    input.deltaX = prevDelta.x + (center.x - offset.x);
    input.deltaY = prevDelta.y + (center.y - offset.y);
}

/**
 * velocity is calculated every x ms
 * @param {Object} session
 * @param {Object} input
 */
function computeIntervalInputData(session, input) {
    var last = session.lastInterval || input,
        deltaTime = input.timeStamp - last.timeStamp,
        velocity, velocityX, velocityY, direction;

    if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
        var deltaX = input.deltaX - last.deltaX;
        var deltaY = input.deltaY - last.deltaY;

        var v = getVelocity(deltaTime, deltaX, deltaY);
        velocityX = v.x;
        velocityY = v.y;
        velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
        direction = getDirection(deltaX, deltaY);

        session.lastInterval = input;
    } else {
        // use latest velocity info if it doesn't overtake a minimum period
        velocity = last.velocity;
        velocityX = last.velocityX;
        velocityY = last.velocityY;
        direction = last.direction;
    }

    input.velocity = velocity;
    input.velocityX = velocityX;
    input.velocityY = velocityY;
    input.direction = direction;
}

/**
 * create a simple clone from the input used for storage of firstInput and firstMultiple
 * @param {Object} input
 * @returns {Object} clonedInputData
 */
function simpleCloneInputData(input) {
    // make a simple copy of the pointers because we will get a reference if we don't
    // we only need clientXY for the calculations
    var pointers = [];
    var i = 0;
    while (i < input.pointers.length) {
        pointers[i] = {
            clientX: round(input.pointers[i].clientX),
            clientY: round(input.pointers[i].clientY)
        };
        i++;
    }

    return {
        timeStamp: now(),
        pointers: pointers,
        center: getCenter(pointers),
        deltaX: input.deltaX,
        deltaY: input.deltaY
    };
}

/**
 * get the center of all the pointers
 * @param {Array} pointers
 * @return {Object} center contains `x` and `y` properties
 */
function getCenter(pointers) {
    var pointersLength = pointers.length;

    // no need to loop when only one touch
    if (pointersLength === 1) {
        return {
            x: round(pointers[0].clientX),
            y: round(pointers[0].clientY)
        };
    }

    var x = 0, y = 0, i = 0;
    while (i < pointersLength) {
        x += pointers[i].clientX;
        y += pointers[i].clientY;
        i++;
    }

    return {
        x: round(x / pointersLength),
        y: round(y / pointersLength)
    };
}

/**
 * calculate the velocity between two points. unit is in px per ms.
 * @param {Number} deltaTime
 * @param {Number} x
 * @param {Number} y
 * @return {Object} velocity `x` and `y`
 */
function getVelocity(deltaTime, x, y) {
    return {
        x: x / deltaTime || 0,
        y: y / deltaTime || 0
    };
}

/**
 * get the direction between two points
 * @param {Number} x
 * @param {Number} y
 * @return {Number} direction
 */
function getDirection(x, y) {
    if (x === y) {
        return DIRECTION_NONE;
    }

    if (abs(x) >= abs(y)) {
        return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
    }
    return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
}

/**
 * calculate the absolute distance between two points
 * @param {Object} p1 {x, y}
 * @param {Object} p2 {x, y}
 * @param {Array} [props] containing x and y keys
 * @return {Number} distance
 */
function getDistance(p1, p2, props) {
    if (!props) {
        props = PROPS_XY;
    }
    var x = p2[props[0]] - p1[props[0]],
        y = p2[props[1]] - p1[props[1]];

    return Math.sqrt((x * x) + (y * y));
}

/**
 * calculate the angle between two coordinates
 * @param {Object} p1
 * @param {Object} p2
 * @param {Array} [props] containing x and y keys
 * @return {Number} angle
 */
function getAngle(p1, p2, props) {
    if (!props) {
        props = PROPS_XY;
    }
    var x = p2[props[0]] - p1[props[0]],
        y = p2[props[1]] - p1[props[1]];
    return Math.atan2(y, x) * 180 / Math.PI;
}

/**
 * calculate the rotation degrees between two pointersets
 * @param {Array} start array of pointers
 * @param {Array} end array of pointers
 * @return {Number} rotation
 */
function getRotation(start, end) {
    return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
}

/**
 * calculate the scale factor between two pointersets
 * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
 * @param {Array} start array of pointers
 * @param {Array} end array of pointers
 * @return {Number} scale
 */
function getScale(start, end) {
    return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
}

var MOUSE_INPUT_MAP = {
    mousedown: INPUT_START,
    mousemove: INPUT_MOVE,
    mouseup: INPUT_END
};

var MOUSE_ELEMENT_EVENTS = 'mousedown';
var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';

/**
 * Mouse events input
 * @constructor
 * @extends Input
 */
function MouseInput() {
    this.evEl = MOUSE_ELEMENT_EVENTS;
    this.evWin = MOUSE_WINDOW_EVENTS;

    this.pressed = false; // mousedown state

    Input.apply(this, arguments);
}

inherit(MouseInput, Input, {
    /**
     * handle mouse events
     * @param {Object} ev
     */
    handler: function MEhandler(ev) {
        var eventType = MOUSE_INPUT_MAP[ev.type];

        // on start we want to have the left mouse button down
        if (eventType & INPUT_START && ev.button === 0) {
            this.pressed = true;
        }

        if (eventType & INPUT_MOVE && ev.which !== 1) {
            eventType = INPUT_END;
        }

        // mouse must be down
        if (!this.pressed) {
            return;
        }

        if (eventType & INPUT_END) {
            this.pressed = false;
        }

        this.callback(this.manager, eventType, {
            pointers: [ev],
            changedPointers: [ev],
            pointerType: INPUT_TYPE_MOUSE,
            srcEvent: ev
        });
    }
});

var POINTER_INPUT_MAP = {
    pointerdown: INPUT_START,
    pointermove: INPUT_MOVE,
    pointerup: INPUT_END,
    pointercancel: INPUT_CANCEL,
    pointerout: INPUT_CANCEL
};

// in IE10 the pointer types is defined as an enum
var IE10_POINTER_TYPE_ENUM = {
    2: INPUT_TYPE_TOUCH,
    3: INPUT_TYPE_PEN,
    4: INPUT_TYPE_MOUSE,
    5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
};

var POINTER_ELEMENT_EVENTS = 'pointerdown';
var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';

// IE10 has prefixed support, and case-sensitive
if (window.MSPointerEvent && !window.PointerEvent) {
    POINTER_ELEMENT_EVENTS = 'MSPointerDown';
    POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
}

/**
 * Pointer events input
 * @constructor
 * @extends Input
 */
function PointerEventInput() {
    this.evEl = POINTER_ELEMENT_EVENTS;
    this.evWin = POINTER_WINDOW_EVENTS;

    Input.apply(this, arguments);

    this.store = (this.manager.session.pointerEvents = []);
}

inherit(PointerEventInput, Input, {
    /**
     * handle mouse events
     * @param {Object} ev
     */
    handler: function PEhandler(ev) {
        var store = this.store;
        var removePointer = false;

        var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
        var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
        var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;

        var isTouch = (pointerType == INPUT_TYPE_TOUCH);

        // get index of the event in the store
        var storeIndex = inArray(store, ev.pointerId, 'pointerId');

        // start and mouse must be down
        if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
            if (storeIndex < 0) {
                store.push(ev);
                storeIndex = store.length - 1;
            }
        } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
            removePointer = true;
        }

        // it not found, so the pointer hasn't been down (so it's probably a hover)
        if (storeIndex < 0) {
            return;
        }

        // update the event in the store
        store[storeIndex] = ev;

        this.callback(this.manager, eventType, {
            pointers: store,
            changedPointers: [ev],
            pointerType: pointerType,
            srcEvent: ev
        });

        if (removePointer) {
            // remove from the store
            store.splice(storeIndex, 1);
        }
    }
});

var SINGLE_TOUCH_INPUT_MAP = {
    touchstart: INPUT_START,
    touchmove: INPUT_MOVE,
    touchend: INPUT_END,
    touchcancel: INPUT_CANCEL
};

var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';

/**
 * Touch events input
 * @constructor
 * @extends Input
 */
function SingleTouchInput() {
    this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
    this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
    this.started = false;

    Input.apply(this, arguments);
}

inherit(SingleTouchInput, Input, {
    handler: function TEhandler(ev) {
        var type = SINGLE_TOUCH_INPUT_MAP[ev.type];

        // should we handle the touch events?
        if (type === INPUT_START) {
            this.started = true;
        }

        if (!this.started) {
            return;
        }

        var touches = normalizeSingleTouches.call(this, ev, type);

        // when done, reset the started state
        if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
            this.started = false;
        }

        this.callback(this.manager, type, {
            pointers: touches[0],
            changedPointers: touches[1],
            pointerType: INPUT_TYPE_TOUCH,
            srcEvent: ev
        });
    }
});

/**
 * @this {TouchInput}
 * @param {Object} ev
 * @param {Number} type flag
 * @returns {undefined|Array} [all, changed]
 */
function normalizeSingleTouches(ev, type) {
    var all = toArray(ev.touches);
    var changed = toArray(ev.changedTouches);

    if (type & (INPUT_END | INPUT_CANCEL)) {
        all = uniqueArray(all.concat(changed), 'identifier', true);
    }

    return [all, changed];
}

var TOUCH_INPUT_MAP = {
    touchstart: INPUT_START,
    touchmove: INPUT_MOVE,
    touchend: INPUT_END,
    touchcancel: INPUT_CANCEL
};

var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';

/**
 * Multi-user touch events input
 * @constructor
 * @extends Input
 */
function TouchInput() {
    this.evTarget = TOUCH_TARGET_EVENTS;
    this.targetIds = {};

    Input.apply(this, arguments);
}

inherit(TouchInput, Input, {
    handler: function MTEhandler(ev) {
        var type = TOUCH_INPUT_MAP[ev.type];
        var touches = getTouches.call(this, ev, type);
        if (!touches) {
            return;
        }

        this.callback(this.manager, type, {
            pointers: touches[0],
            changedPointers: touches[1],
            pointerType: INPUT_TYPE_TOUCH,
            srcEvent: ev
        });
    }
});

/**
 * @this {TouchInput}
 * @param {Object} ev
 * @param {Number} type flag
 * @returns {undefined|Array} [all, changed]
 */
function getTouches(ev, type) {
    var allTouches = toArray(ev.touches);
    var targetIds = this.targetIds;

    // when there is only one touch, the process can be simplified
    if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
        targetIds[allTouches[0].identifier] = true;
        return [allTouches, allTouches];
    }

    var i,
        targetTouches,
        changedTouches = toArray(ev.changedTouches),
        changedTargetTouches = [],
        target = this.target;

    // get target touches from touches
    targetTouches = allTouches.filter(function(touch) {
        return hasParent(touch.target, target);
    });

    // collect touches
    if (type === INPUT_START) {
        i = 0;
        while (i < targetTouches.length) {
            targetIds[targetTouches[i].identifier] = true;
            i++;
        }
    }

    // filter changed touches to only contain touches that exist in the collected target ids
    i = 0;
    while (i < changedTouches.length) {
        if (targetIds[changedTouches[i].identifier]) {
            changedTargetTouches.push(changedTouches[i]);
        }

        // cleanup removed touches
        if (type & (INPUT_END | INPUT_CANCEL)) {
            delete targetIds[changedTouches[i].identifier];
        }
        i++;
    }

    if (!changedTargetTouches.length) {
        return;
    }

    return [
        // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
        uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
        changedTargetTouches
    ];
}

/**
 * Combined touch and mouse input
 *
 * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
 * This because touch devices also emit mouse events while doing a touch.
 *
 * @constructor
 * @extends Input
 */

var DEDUP_TIMEOUT = 2500;
var DEDUP_DISTANCE = 25;

function TouchMouseInput() {
    Input.apply(this, arguments);

    var handler = bindFn(this.handler, this);
    this.touch = new TouchInput(this.manager, handler);
    this.mouse = new MouseInput(this.manager, handler);

    this.primaryTouch = null;
    this.lastTouches = [];
}

inherit(TouchMouseInput, Input, {
    /**
     * handle mouse and touch events
     * @param {Hammer} manager
     * @param {String} inputEvent
     * @param {Object} inputData
     */
    handler: function TMEhandler(manager, inputEvent, inputData) {
        var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
            isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);

        if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
            return;
        }

        // when we're in a touch event, record touches to  de-dupe synthetic mouse event
        if (isTouch) {
            recordTouches.call(this, inputEvent, inputData);
        } else if (isMouse && isSyntheticEvent.call(this, inputData)) {
            return;
        }

        this.callback(manager, inputEvent, inputData);
    },

    /**
     * remove the event listeners
     */
    destroy: function destroy() {
        this.touch.destroy();
        this.mouse.destroy();
    }
});

function recordTouches(eventType, eventData) {
    if (eventType & INPUT_START) {
        this.primaryTouch = eventData.changedPointers[0].identifier;
        setLastTouch.call(this, eventData);
    } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
        setLastTouch.call(this, eventData);
    }
}

function setLastTouch(eventData) {
    var touch = eventData.changedPointers[0];

    if (touch.identifier === this.primaryTouch) {
        var lastTouch = {x: touch.clientX, y: touch.clientY};
        this.lastTouches.push(lastTouch);
        var lts = this.lastTouches;
        var removeLastTouch = function() {
            var i = lts.indexOf(lastTouch);
            if (i > -1) {
                lts.splice(i, 1);
            }
        };
        setTimeout(removeLastTouch, DEDUP_TIMEOUT);
    }
}

function isSyntheticEvent(eventData) {
    var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
    for (var i = 0; i < this.lastTouches.length; i++) {
        var t = this.lastTouches[i];
        var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
        if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
            return true;
        }
    }
    return false;
}

var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;

// magical touchAction value
var TOUCH_ACTION_COMPUTE = 'compute';
var TOUCH_ACTION_AUTO = 'auto';
var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
var TOUCH_ACTION_NONE = 'none';
var TOUCH_ACTION_PAN_X = 'pan-x';
var TOUCH_ACTION_PAN_Y = 'pan-y';
var TOUCH_ACTION_MAP = getTouchActionProps();

/**
 * Touch Action
 * sets the touchAction property or uses the js alternative
 * @param {Manager} manager
 * @param {String} value
 * @constructor
 */
function TouchAction(manager, value) {
    this.manager = manager;
    this.set(value);
}

TouchAction.prototype = {
    /**
     * set the touchAction value on the element or enable the polyfill
     * @param {String} value
     */
    set: function(value) {
        // find out the touch-action by the event handlers
        if (value == TOUCH_ACTION_COMPUTE) {
            value = this.compute();
        }

        if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
            this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
        }
        this.actions = value.toLowerCase().trim();
    },

    /**
     * just re-set the touchAction value
     */
    update: function() {
        this.set(this.manager.options.touchAction);
    },

    /**
     * compute the value for the touchAction property based on the recognizer's settings
     * @returns {String} value
     */
    compute: function() {
        var actions = [];
        each(this.manager.recognizers, function(recognizer) {
            if (boolOrFn(recognizer.options.enable, [recognizer])) {
                actions = actions.concat(recognizer.getTouchAction());
            }
        });
        return cleanTouchActions(actions.join(' '));
    },

    /**
     * this method is called on each input cycle and provides the preventing of the browser behavior
     * @param {Object} input
     */
    preventDefaults: function(input) {
        var srcEvent = input.srcEvent;
        var direction = input.offsetDirection;

        // if the touch action did prevented once this session
        if (this.manager.session.prevented) {
            srcEvent.preventDefault();
            return;
        }

        var actions = this.actions;
        var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
        var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
        var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];

        if (hasNone) {
            //do not prevent defaults if this is a tap gesture

            var isTapPointer = input.pointers.length === 1;
            var isTapMovement = input.distance < 2;
            var isTapTouchTime = input.deltaTime < 250;

            if (isTapPointer && isTapMovement && isTapTouchTime) {
                return;
            }
        }

        if (hasPanX && hasPanY) {
            // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
            return;
        }

        if (hasNone ||
            (hasPanY && direction & DIRECTION_HORIZONTAL) ||
            (hasPanX && direction & DIRECTION_VERTICAL)) {
            return this.preventSrc(srcEvent);
        }
    },

    /**
     * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
     * @param {Object} srcEvent
     */
    preventSrc: function(srcEvent) {
        this.manager.session.prevented = true;
        srcEvent.preventDefault();
    }
};

/**
 * when the touchActions are collected they are not a valid value, so we need to clean things up. *
 * @param {String} actions
 * @returns {*}
 */
function cleanTouchActions(actions) {
    // none
    if (inStr(actions, TOUCH_ACTION_NONE)) {
        return TOUCH_ACTION_NONE;
    }

    var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
    var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);

    // if both pan-x and pan-y are set (different recognizers
    // for different directions, e.g. horizontal pan but vertical swipe?)
    // we need none (as otherwise with pan-x pan-y combined none of these
    // recognizers will work, since the browser would handle all panning
    if (hasPanX && hasPanY) {
        return TOUCH_ACTION_NONE;
    }

    // pan-x OR pan-y
    if (hasPanX || hasPanY) {
        return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
    }

    // manipulation
    if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
        return TOUCH_ACTION_MANIPULATION;
    }

    return TOUCH_ACTION_AUTO;
}

function getTouchActionProps() {
    if (!NATIVE_TOUCH_ACTION) {
        return false;
    }
    var touchMap = {};
    var cssSupports = window.CSS && window.CSS.supports;
    ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {

        // If css.supports is not supported but there is native touch-action assume it supports
        // all values. This is the case for IE 10 and 11.
        touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
    });
    return touchMap;
}

/**
 * Recognizer flow explained; *
 * All recognizers have the initial state of POSSIBLE when a input session starts.
 * The definition of a input session is from the first input until the last input, with all it's movement in it. *
 * Example session for mouse-input: mousedown -> mousemove -> mouseup
 *
 * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
 * which determines with state it should be.
 *
 * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
 * POSSIBLE to give it another change on the next cycle.
 *
 *               Possible
 *                  |
 *            +-----+---------------+
 *            |                     |
 *      +-----+-----+               |
 *      |           |               |
 *   Failed      Cancelled          |
 *                          +-------+------+
 *                          |              |
 *                      Recognized       Began
 *                                         |
 *                                      Changed
 *                                         |
 *                                  Ended/Recognized
 */
var STATE_POSSIBLE = 1;
var STATE_BEGAN = 2;
var STATE_CHANGED = 4;
var STATE_ENDED = 8;
var STATE_RECOGNIZED = STATE_ENDED;
var STATE_CANCELLED = 16;
var STATE_FAILED = 32;

/**
 * Recognizer
 * Every recognizer needs to extend from this class.
 * @constructor
 * @param {Object} options
 */
function Recognizer(options) {
    this.options = assign({}, this.defaults, options || {});

    this.id = uniqueId();

    this.manager = null;

    // default is enable true
    this.options.enable = ifUndefined(this.options.enable, true);

    this.state = STATE_POSSIBLE;

    this.simultaneous = {};
    this.requireFail = [];
}

Recognizer.prototype = {
    /**
     * @virtual
     * @type {Object}
     */
    defaults: {},

    /**
     * set options
     * @param {Object} options
     * @return {Recognizer}
     */
    set: function(options) {
        assign(this.options, options);

        // also update the touchAction, in case something changed about the directions/enabled state
        this.manager && this.manager.touchAction.update();
        return this;
    },

    /**
     * recognize simultaneous with an other recognizer.
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    recognizeWith: function(otherRecognizer) {
        if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
            return this;
        }

        var simultaneous = this.simultaneous;
        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
        if (!simultaneous[otherRecognizer.id]) {
            simultaneous[otherRecognizer.id] = otherRecognizer;
            otherRecognizer.recognizeWith(this);
        }
        return this;
    },

    /**
     * drop the simultaneous link. it doesnt remove the link on the other recognizer.
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    dropRecognizeWith: function(otherRecognizer) {
        if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
            return this;
        }

        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
        delete this.simultaneous[otherRecognizer.id];
        return this;
    },

    /**
     * recognizer can only run when an other is failing
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    requireFailure: function(otherRecognizer) {
        if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
            return this;
        }

        var requireFail = this.requireFail;
        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
        if (inArray(requireFail, otherRecognizer) === -1) {
            requireFail.push(otherRecognizer);
            otherRecognizer.requireFailure(this);
        }
        return this;
    },

    /**
     * drop the requireFailure link. it does not remove the link on the other recognizer.
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    dropRequireFailure: function(otherRecognizer) {
        if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
            return this;
        }

        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
        var index = inArray(this.requireFail, otherRecognizer);
        if (index > -1) {
            this.requireFail.splice(index, 1);
        }
        return this;
    },

    /**
     * has require failures boolean
     * @returns {boolean}
     */
    hasRequireFailures: function() {
        return this.requireFail.length > 0;
    },

    /**
     * if the recognizer can recognize simultaneous with an other recognizer
     * @param {Recognizer} otherRecognizer
     * @returns {Boolean}
     */
    canRecognizeWith: function(otherRecognizer) {
        return !!this.simultaneous[otherRecognizer.id];
    },

    /**
     * You should use `tryEmit` instead of `emit` directly to check
     * that all the needed recognizers has failed before emitting.
     * @param {Object} input
     */
    emit: function(input) {
        var self = this;
        var state = this.state;

        function emit(event) {
            self.manager.emit(event, input);
        }

        // 'panstart' and 'panmove'
        if (state < STATE_ENDED) {
            emit(self.options.event + stateStr(state));
        }

        emit(self.options.event); // simple 'eventName' events

        if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
            emit(input.additionalEvent);
        }

        // panend and pancancel
        if (state >= STATE_ENDED) {
            emit(self.options.event + stateStr(state));
        }
    },

    /**
     * Check that all the require failure recognizers has failed,
     * if true, it emits a gesture event,
     * otherwise, setup the state to FAILED.
     * @param {Object} input
     */
    tryEmit: function(input) {
        if (this.canEmit()) {
            return this.emit(input);
        }
        // it's failing anyway
        this.state = STATE_FAILED;
    },

    /**
     * can we emit?
     * @returns {boolean}
     */
    canEmit: function() {
        var i = 0;
        while (i < this.requireFail.length) {
            if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
                return false;
            }
            i++;
        }
        return true;
    },

    /**
     * update the recognizer
     * @param {Object} inputData
     */
    recognize: function(inputData) {
        // make a new copy of the inputData
        // so we can change the inputData without messing up the other recognizers
        var inputDataClone = assign({}, inputData);

        // is is enabled and allow recognizing?
        if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
            this.reset();
            this.state = STATE_FAILED;
            return;
        }

        // reset when we've reached the end
        if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
            this.state = STATE_POSSIBLE;
        }

        this.state = this.process(inputDataClone);

        // the recognizer has recognized a gesture
        // so trigger an event
        if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
            this.tryEmit(inputDataClone);
        }
    },

    /**
     * return the state of the recognizer
     * the actual recognizing happens in this method
     * @virtual
     * @param {Object} inputData
     * @returns {Const} STATE
     */
    process: function(inputData) { }, // jshint ignore:line

    /**
     * return the preferred touch-action
     * @virtual
     * @returns {Array}
     */
    getTouchAction: function() { },

    /**
     * called when the gesture isn't allowed to recognize
     * like when another is being recognized or it is disabled
     * @virtual
     */
    reset: function() { }
};

/**
 * get a usable string, used as event postfix
 * @param {Const} state
 * @returns {String} state
 */
function stateStr(state) {
    if (state & STATE_CANCELLED) {
        return 'cancel';
    } else if (state & STATE_ENDED) {
        return 'end';
    } else if (state & STATE_CHANGED) {
        return 'move';
    } else if (state & STATE_BEGAN) {
        return 'start';
    }
    return '';
}

/**
 * direction cons to string
 * @param {Const} direction
 * @returns {String}
 */
function directionStr(direction) {
    if (direction == DIRECTION_DOWN) {
        return 'down';
    } else if (direction == DIRECTION_UP) {
        return 'up';
    } else if (direction == DIRECTION_LEFT) {
        return 'left';
    } else if (direction == DIRECTION_RIGHT) {
        return 'right';
    }
    return '';
}

/**
 * get a recognizer by name if it is bound to a manager
 * @param {Recognizer|String} otherRecognizer
 * @param {Recognizer} recognizer
 * @returns {Recognizer}
 */
function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
    var manager = recognizer.manager;
    if (manager) {
        return manager.get(otherRecognizer);
    }
    return otherRecognizer;
}

/**
 * This recognizer is just used as a base for the simple attribute recognizers.
 * @constructor
 * @extends Recognizer
 */
function AttrRecognizer() {
    Recognizer.apply(this, arguments);
}

inherit(AttrRecognizer, Recognizer, {
    /**
     * @namespace
     * @memberof AttrRecognizer
     */
    defaults: {
        /**
         * @type {Number}
         * @default 1
         */
        pointers: 1
    },

    /**
     * Used to check if it the recognizer receives valid input, like input.distance > 10.
     * @memberof AttrRecognizer
     * @param {Object} input
     * @returns {Boolean} recognized
     */
    attrTest: function(input) {
        var optionPointers = this.options.pointers;
        return optionPointers === 0 || input.pointers.length === optionPointers;
    },

    /**
     * Process the input and return the state for the recognizer
     * @memberof AttrRecognizer
     * @param {Object} input
     * @returns {*} State
     */
    process: function(input) {
        var state = this.state;
        var eventType = input.eventType;

        var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
        var isValid = this.attrTest(input);

        // on cancel input and we've recognized before, return STATE_CANCELLED
        if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
            return state | STATE_CANCELLED;
        } else if (isRecognized || isValid) {
            if (eventType & INPUT_END) {
                return state | STATE_ENDED;
            } else if (!(state & STATE_BEGAN)) {
                return STATE_BEGAN;
            }
            return state | STATE_CHANGED;
        }
        return STATE_FAILED;
    }
});

/**
 * Pan
 * Recognized when the pointer is down and moved in the allowed direction.
 * @constructor
 * @extends AttrRecognizer
 */
function PanRecognizer() {
    AttrRecognizer.apply(this, arguments);

    this.pX = null;
    this.pY = null;
}

inherit(PanRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof PanRecognizer
     */
    defaults: {
        event: 'pan',
        threshold: 10,
        pointers: 1,
        direction: DIRECTION_ALL
    },

    getTouchAction: function() {
        var direction = this.options.direction;
        var actions = [];
        if (direction & DIRECTION_HORIZONTAL) {
            actions.push(TOUCH_ACTION_PAN_Y);
        }
        if (direction & DIRECTION_VERTICAL) {
            actions.push(TOUCH_ACTION_PAN_X);
        }
        return actions;
    },

    directionTest: function(input) {
        var options = this.options;
        var hasMoved = true;
        var distance = input.distance;
        var direction = input.direction;
        var x = input.deltaX;
        var y = input.deltaY;

        // lock to axis?
        if (!(direction & options.direction)) {
            if (options.direction & DIRECTION_HORIZONTAL) {
                direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
                hasMoved = x != this.pX;
                distance = Math.abs(input.deltaX);
            } else {
                direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
                hasMoved = y != this.pY;
                distance = Math.abs(input.deltaY);
            }
        }
        input.direction = direction;
        return hasMoved && distance > options.threshold && direction & options.direction;
    },

    attrTest: function(input) {
        return AttrRecognizer.prototype.attrTest.call(this, input) &&
            (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
    },

    emit: function(input) {

        this.pX = input.deltaX;
        this.pY = input.deltaY;

        var direction = directionStr(input.direction);

        if (direction) {
            input.additionalEvent = this.options.event + direction;
        }
        this._super.emit.call(this, input);
    }
});

/**
 * Pinch
 * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
 * @constructor
 * @extends AttrRecognizer
 */
function PinchRecognizer() {
    AttrRecognizer.apply(this, arguments);
}

inherit(PinchRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof PinchRecognizer
     */
    defaults: {
        event: 'pinch',
        threshold: 0,
        pointers: 2
    },

    getTouchAction: function() {
        return [TOUCH_ACTION_NONE];
    },

    attrTest: function(input) {
        return this._super.attrTest.call(this, input) &&
            (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
    },

    emit: function(input) {
        if (input.scale !== 1) {
            var inOut = input.scale < 1 ? 'in' : 'out';
            input.additionalEvent = this.options.event + inOut;
        }
        this._super.emit.call(this, input);
    }
});

/**
 * Press
 * Recognized when the pointer is down for x ms without any movement.
 * @constructor
 * @extends Recognizer
 */
function PressRecognizer() {
    Recognizer.apply(this, arguments);

    this._timer = null;
    this._input = null;
}

inherit(PressRecognizer, Recognizer, {
    /**
     * @namespace
     * @memberof PressRecognizer
     */
    defaults: {
        event: 'press',
        pointers: 1,
        time: 251, // minimal time of the pointer to be pressed
        threshold: 9 // a minimal movement is ok, but keep it low
    },

    getTouchAction: function() {
        return [TOUCH_ACTION_AUTO];
    },

    process: function(input) {
        var options = this.options;
        var validPointers = input.pointers.length === options.pointers;
        var validMovement = input.distance < options.threshold;
        var validTime = input.deltaTime > options.time;

        this._input = input;

        // we only allow little movement
        // and we've reached an end event, so a tap is possible
        if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
            this.reset();
        } else if (input.eventType & INPUT_START) {
            this.reset();
            this._timer = setTimeoutContext(function() {
                this.state = STATE_RECOGNIZED;
                this.tryEmit();
            }, options.time, this);
        } else if (input.eventType & INPUT_END) {
            return STATE_RECOGNIZED;
        }
        return STATE_FAILED;
    },

    reset: function() {
        clearTimeout(this._timer);
    },

    emit: function(input) {
        if (this.state !== STATE_RECOGNIZED) {
            return;
        }

        if (input && (input.eventType & INPUT_END)) {
            this.manager.emit(this.options.event + 'up', input);
        } else {
            this._input.timeStamp = now();
            this.manager.emit(this.options.event, this._input);
        }
    }
});

/**
 * Rotate
 * Recognized when two or more pointer are moving in a circular motion.
 * @constructor
 * @extends AttrRecognizer
 */
function RotateRecognizer() {
    AttrRecognizer.apply(this, arguments);
}

inherit(RotateRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof RotateRecognizer
     */
    defaults: {
        event: 'rotate',
        threshold: 0,
        pointers: 2
    },

    getTouchAction: function() {
        return [TOUCH_ACTION_NONE];
    },

    attrTest: function(input) {
        return this._super.attrTest.call(this, input) &&
            (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
    }
});

/**
 * Swipe
 * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
 * @constructor
 * @extends AttrRecognizer
 */
function SwipeRecognizer() {
    AttrRecognizer.apply(this, arguments);
}

inherit(SwipeRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof SwipeRecognizer
     */
    defaults: {
        event: 'swipe',
        threshold: 10,
        velocity: 0.3,
        direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
        pointers: 1
    },

    getTouchAction: function() {
        return PanRecognizer.prototype.getTouchAction.call(this);
    },

    attrTest: function(input) {
        var direction = this.options.direction;
        var velocity;

        if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
            velocity = input.overallVelocity;
        } else if (direction & DIRECTION_HORIZONTAL) {
            velocity = input.overallVelocityX;
        } else if (direction & DIRECTION_VERTICAL) {
            velocity = input.overallVelocityY;
        }

        return this._super.attrTest.call(this, input) &&
            direction & input.offsetDirection &&
            input.distance > this.options.threshold &&
            input.maxPointers == this.options.pointers &&
            abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
    },

    emit: function(input) {
        var direction = directionStr(input.offsetDirection);
        if (direction) {
            this.manager.emit(this.options.event + direction, input);
        }

        this.manager.emit(this.options.event, input);
    }
});

/**
 * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
 * between the given interval and position. The delay option can be used to recognize multi-taps without firing
 * a single tap.
 *
 * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
 * multi-taps being recognized.
 * @constructor
 * @extends Recognizer
 */
function TapRecognizer() {
    Recognizer.apply(this, arguments);

    // previous time and center,
    // used for tap counting
    this.pTime = false;
    this.pCenter = false;

    this._timer = null;
    this._input = null;
    this.count = 0;
}

inherit(TapRecognizer, Recognizer, {
    /**
     * @namespace
     * @memberof PinchRecognizer
     */
    defaults: {
        event: 'tap',
        pointers: 1,
        taps: 1,
        interval: 300, // max time between the multi-tap taps
        time: 250, // max time of the pointer to be down (like finger on the screen)
        threshold: 9, // a minimal movement is ok, but keep it low
        posThreshold: 10 // a multi-tap can be a bit off the initial position
    },

    getTouchAction: function() {
        return [TOUCH_ACTION_MANIPULATION];
    },

    process: function(input) {
        var options = this.options;

        var validPointers = input.pointers.length === options.pointers;
        var validMovement = input.distance < options.threshold;
        var validTouchTime = input.deltaTime < options.time;

        this.reset();

        if ((input.eventType & INPUT_START) && (this.count === 0)) {
            return this.failTimeout();
        }

        // we only allow little movement
        // and we've reached an end event, so a tap is possible
        if (validMovement && validTouchTime && validPointers) {
            if (input.eventType != INPUT_END) {
                return this.failTimeout();
            }

            var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
            var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;

            this.pTime = input.timeStamp;
            this.pCenter = input.center;

            if (!validMultiTap || !validInterval) {
                this.count = 1;
            } else {
                this.count += 1;
            }

            this._input = input;

            // if tap count matches we have recognized it,
            // else it has began recognizing...
            var tapCount = this.count % options.taps;
            if (tapCount === 0) {
                // no failing requirements, immediately trigger the tap event
                // or wait as long as the multitap interval to trigger
                if (!this.hasRequireFailures()) {
                    return STATE_RECOGNIZED;
                } else {
                    this._timer = setTimeoutContext(function() {
                        this.state = STATE_RECOGNIZED;
                        this.tryEmit();
                    }, options.interval, this);
                    return STATE_BEGAN;
                }
            }
        }
        return STATE_FAILED;
    },

    failTimeout: function() {
        this._timer = setTimeoutContext(function() {
            this.state = STATE_FAILED;
        }, this.options.interval, this);
        return STATE_FAILED;
    },

    reset: function() {
        clearTimeout(this._timer);
    },

    emit: function() {
        if (this.state == STATE_RECOGNIZED) {
            this._input.tapCount = this.count;
            this.manager.emit(this.options.event, this._input);
        }
    }
});

/**
 * Simple way to create a manager with a default set of recognizers.
 * @param {HTMLElement} element
 * @param {Object} [options]
 * @constructor
 */
function Hammer(element, options) {
    options = options || {};
    options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
    return new Manager(element, options);
}

/**
 * @const {string}
 */
Hammer.VERSION = '2.0.8';

/**
 * default settings
 * @namespace
 */
Hammer.defaults = {
    /**
     * set if DOM events are being triggered.
     * But this is slower and unused by simple implementations, so disabled by default.
     * @type {Boolean}
     * @default false
     */
    domEvents: false,

    /**
     * The value for the touchAction property/fallback.
     * When set to `compute` it will magically set the correct value based on the added recognizers.
     * @type {String}
     * @default compute
     */
    touchAction: TOUCH_ACTION_COMPUTE,

    /**
     * @type {Boolean}
     * @default true
     */
    enable: true,

    /**
     * EXPERIMENTAL FEATURE -- can be removed/changed
     * Change the parent input target element.
     * If Null, then it is being set the to main element.
     * @type {Null|EventTarget}
     * @default null
     */
    inputTarget: null,

    /**
     * force an input class
     * @type {Null|Function}
     * @default null
     */
    inputClass: null,

    /**
     * Default recognizer setup when calling `Hammer()`
     * When creating a new Manager these will be skipped.
     * @type {Array}
     */
    preset: [
        // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
        [RotateRecognizer, {enable: false}],
        [PinchRecognizer, {enable: false}, ['rotate']],
        [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
        [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
        [TapRecognizer],
        [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
        [PressRecognizer]
    ],

    /**
     * Some CSS properties can be used to improve the working of Hammer.
     * Add them to this method and they will be set when creating a new Manager.
     * @namespace
     */
    cssProps: {
        /**
         * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
         * @type {String}
         * @default 'none'
         */
        userSelect: 'none',

        /**
         * Disable the Windows Phone grippers when pressing an element.
         * @type {String}
         * @default 'none'
         */
        touchSelect: 'none',

        /**
         * Disables the default callout shown when you touch and hold a touch target.
         * On iOS, when you touch and hold a touch target such as a link, Safari displays
         * a callout containing information about the link. This property allows you to disable that callout.
         * @type {String}
         * @default 'none'
         */
        touchCallout: 'none',

        /**
         * Specifies whether zooming is enabled. Used by IE10>
         * @type {String}
         * @default 'none'
         */
        contentZooming: 'none',

        /**
         * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
         * @type {String}
         * @default 'none'
         */
        userDrag: 'none',

        /**
         * Overrides the highlight color shown when the user taps a link or a JavaScript
         * clickable element in iOS. This property obeys the alpha value, if specified.
         * @type {String}
         * @default 'rgba(0,0,0,0)'
         */
        tapHighlightColor: 'rgba(0,0,0,0)'
    }
};

var STOP = 1;
var FORCED_STOP = 2;

/**
 * Manager
 * @param {HTMLElement} element
 * @param {Object} [options]
 * @constructor
 */
function Manager(element, options) {
    this.options = assign({}, Hammer.defaults, options || {});

    this.options.inputTarget = this.options.inputTarget || element;

    this.handlers = {};
    this.session = {};
    this.recognizers = [];
    this.oldCssProps = {};

    this.element = element;
    this.input = createInputInstance(this);
    this.touchAction = new TouchAction(this, this.options.touchAction);

    toggleCssProps(this, true);

    each(this.options.recognizers, function(item) {
        var recognizer = this.add(new (item[0])(item[1]));
        item[2] && recognizer.recognizeWith(item[2]);
        item[3] && recognizer.requireFailure(item[3]);
    }, this);
}

Manager.prototype = {
    /**
     * set options
     * @param {Object} options
     * @returns {Manager}
     */
    set: function(options) {
        assign(this.options, options);

        // Options that need a little more setup
        if (options.touchAction) {
            this.touchAction.update();
        }
        if (options.inputTarget) {
            // Clean up existing event listeners and reinitialize
            this.input.destroy();
            this.input.target = options.inputTarget;
            this.input.init();
        }
        return this;
    },

    /**
     * stop recognizing for this session.
     * This session will be discarded, when a new [input]start event is fired.
     * When forced, the recognizer cycle is stopped immediately.
     * @param {Boolean} [force]
     */
    stop: function(force) {
        this.session.stopped = force ? FORCED_STOP : STOP;
    },

    /**
     * run the recognizers!
     * called by the inputHandler function on every movement of the pointers (touches)
     * it walks through all the recognizers and tries to detect the gesture that is being made
     * @param {Object} inputData
     */
    recognize: function(inputData) {
        var session = this.session;
        if (session.stopped) {
            return;
        }

        // run the touch-action polyfill
        this.touchAction.preventDefaults(inputData);

        var recognizer;
        var recognizers = this.recognizers;

        // this holds the recognizer that is being recognized.
        // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
        // if no recognizer is detecting a thing, it is set to `null`
        var curRecognizer = session.curRecognizer;

        // reset when the last recognizer is recognized
        // or when we're in a new session
        if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
            curRecognizer = session.curRecognizer = null;
        }

        var i = 0;
        while (i < recognizers.length) {
            recognizer = recognizers[i];

            // find out if we are allowed try to recognize the input for this one.
            // 1.   allow if the session is NOT forced stopped (see the .stop() method)
            // 2.   allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
            //      that is being recognized.
            // 3.   allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
            //      this can be setup with the `recognizeWith()` method on the recognizer.
            if (session.stopped !== FORCED_STOP && ( // 1
                    !curRecognizer || recognizer == curRecognizer || // 2
                    recognizer.canRecognizeWith(curRecognizer))) { // 3
                recognizer.recognize(inputData);
            } else {
                recognizer.reset();
            }

            // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
            // current active recognizer. but only if we don't already have an active recognizer
            if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
                curRecognizer = session.curRecognizer = recognizer;
            }
            i++;
        }
    },

    /**
     * get a recognizer by its event name.
     * @param {Recognizer|String} recognizer
     * @returns {Recognizer|Null}
     */
    get: function(recognizer) {
        if (recognizer instanceof Recognizer) {
            return recognizer;
        }

        var recognizers = this.recognizers;
        for (var i = 0; i < recognizers.length; i++) {
            if (recognizers[i].options.event == recognizer) {
                return recognizers[i];
            }
        }
        return null;
    },

    /**
     * add a recognizer to the manager
     * existing recognizers with the same event name will be removed
     * @param {Recognizer} recognizer
     * @returns {Recognizer|Manager}
     */
    add: function(recognizer) {
        if (invokeArrayArg(recognizer, 'add', this)) {
            return this;
        }

        // remove existing
        var existing = this.get(recognizer.options.event);
        if (existing) {
            this.remove(existing);
        }

        this.recognizers.push(recognizer);
        recognizer.manager = this;

        this.touchAction.update();
        return recognizer;
    },

    /**
     * remove a recognizer by name or instance
     * @param {Recognizer|String} recognizer
     * @returns {Manager}
     */
    remove: function(recognizer) {
        if (invokeArrayArg(recognizer, 'remove', this)) {
            return this;
        }

        recognizer = this.get(recognizer);

        // let's make sure this recognizer exists
        if (recognizer) {
            var recognizers = this.recognizers;
            var index = inArray(recognizers, recognizer);

            if (index !== -1) {
                recognizers.splice(index, 1);
                this.touchAction.update();
            }
        }

        return this;
    },

    /**
     * bind event
     * @param {String} events
     * @param {Function} handler
     * @returns {EventEmitter} this
     */
    on: function(events, handler) {
        if (events === undefined) {
            return;
        }
        if (handler === undefined) {
            return;
        }

        var handlers = this.handlers;
        each(splitStr(events), function(event) {
            handlers[event] = handlers[event] || [];
            handlers[event].push(handler);
        });
        return this;
    },

    /**
     * unbind event, leave emit blank to remove all handlers
     * @param {String} events
     * @param {Function} [handler]
     * @returns {EventEmitter} this
     */
    off: function(events, handler) {
        if (events === undefined) {
            return;
        }

        var handlers = this.handlers;
        each(splitStr(events), function(event) {
            if (!handler) {
                delete handlers[event];
            } else {
                handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
            }
        });
        return this;
    },

    /**
     * emit event to the listeners
     * @param {String} event
     * @param {Object} data
     */
    emit: function(event, data) {
        // we also want to trigger dom events
        if (this.options.domEvents) {
            triggerDomEvent(event, data);
        }

        // no handlers, so skip it all
        var handlers = this.handlers[event] && this.handlers[event].slice();
        if (!handlers || !handlers.length) {
            return;
        }

        data.type = event;
        data.preventDefault = function() {
            data.srcEvent.preventDefault();
        };

        var i = 0;
        while (i < handlers.length) {
            handlers[i](data);
            i++;
        }
    },

    /**
     * destroy the manager and unbinds all events
     * it doesn't unbind dom events, that is the user own responsibility
     */
    destroy: function() {
        this.element && toggleCssProps(this, false);

        this.handlers = {};
        this.session = {};
        this.input.destroy();
        this.element = null;
    }
};

/**
 * add/remove the css properties as defined in manager.options.cssProps
 * @param {Manager} manager
 * @param {Boolean} add
 */
function toggleCssProps(manager, add) {
    var element = manager.element;
    if (!element.style) {
        return;
    }
    var prop;
    each(manager.options.cssProps, function(value, name) {
        prop = prefixed(element.style, name);
        if (add) {
            manager.oldCssProps[prop] = element.style[prop];
            element.style[prop] = value;
        } else {
            element.style[prop] = manager.oldCssProps[prop] || '';
        }
    });
    if (!add) {
        manager.oldCssProps = {};
    }
}

/**
 * trigger dom event
 * @param {String} event
 * @param {Object} data
 */
function triggerDomEvent(event, data) {
    var gestureEvent = document.createEvent('Event');
    gestureEvent.initEvent(event, true, true);
    gestureEvent.gesture = data;
    data.target.dispatchEvent(gestureEvent);
}

assign(Hammer, {
    INPUT_START: INPUT_START,
    INPUT_MOVE: INPUT_MOVE,
    INPUT_END: INPUT_END,
    INPUT_CANCEL: INPUT_CANCEL,

    STATE_POSSIBLE: STATE_POSSIBLE,
    STATE_BEGAN: STATE_BEGAN,
    STATE_CHANGED: STATE_CHANGED,
    STATE_ENDED: STATE_ENDED,
    STATE_RECOGNIZED: STATE_RECOGNIZED,
    STATE_CANCELLED: STATE_CANCELLED,
    STATE_FAILED: STATE_FAILED,

    DIRECTION_NONE: DIRECTION_NONE,
    DIRECTION_LEFT: DIRECTION_LEFT,
    DIRECTION_RIGHT: DIRECTION_RIGHT,
    DIRECTION_UP: DIRECTION_UP,
    DIRECTION_DOWN: DIRECTION_DOWN,
    DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
    DIRECTION_VERTICAL: DIRECTION_VERTICAL,
    DIRECTION_ALL: DIRECTION_ALL,

    Manager: Manager,
    Input: Input,
    TouchAction: TouchAction,

    TouchInput: TouchInput,
    MouseInput: MouseInput,
    PointerEventInput: PointerEventInput,
    TouchMouseInput: TouchMouseInput,
    SingleTouchInput: SingleTouchInput,

    Recognizer: Recognizer,
    AttrRecognizer: AttrRecognizer,
    Tap: TapRecognizer,
    Pan: PanRecognizer,
    Swipe: SwipeRecognizer,
    Pinch: PinchRecognizer,
    Rotate: RotateRecognizer,
    Press: PressRecognizer,

    on: addEventListeners,
    off: removeEventListeners,
    each: each,
    merge: merge,
    extend: extend,
    assign: assign,
    inherit: inherit,
    bindFn: bindFn,
    prefixed: prefixed
});

// this prevents errors when Hammer is loaded in the presence of an AMD
//  style loader but by script tag, not by the loader.
var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
freeGlobal.Hammer = Hammer;

if (typeof define === 'function' && define.amd) {
    define(function() {
        return Hammer;
    });
} else if (typeof module != 'undefined' && module.exports) {
    module.exports = Hammer;
} else {
    window[exportName] = Hammer;
}

})(window, document, 'Hammer');
;
/*
 * easy-autocomplete
 * jQuery plugin for autocompletion
 * 
 * @author Łukasz Pawełczak (http://github.com/pawelczak)
 * @version 1.3.5
 * Copyright  License: 
 */

/*
 * EasyAutocomplete - Configuration 
 */
var EasyAutocomplete = (function(scope){

	scope.Configuration = function Configuration(options) {
		var defaults = {
			data: "list-required",
			url: "list-required",
			dataType: "json",

			listLocation: function(data) {
				return data;
			},

			xmlElementName: "",

			getValue: function(element) {
				return element;
			},

			autocompleteOff: true,

			placeholder: false,

			ajaxCallback: function() {},

			matchResponseProperty: false,

			list: {
				sort: {
					enabled: false,
					method: function(a, b) {
						a = defaults.getValue(a);
						b = defaults.getValue(b);
						if (a < b) {
							return -1;
						}
						if (a > b) {
							return 1;
						}
						return 0;
					}
				},

				maxNumberOfElements: 6,

				hideOnEmptyPhrase: true,

				match: {
					enabled: false,
					caseSensitive: false,
					method: function(element, phrase) {

						if (element.search(phrase) > -1) {
							return true;
						} else {
							return false;
						}
					}
				},

				showAnimation: {
					type: "normal", //normal|slide|fade
					time: 400,
					callback: function() {}
				},

				hideAnimation: {
					type: "normal",
					time: 400,
					callback: function() {}
				},

				/* Events */
				onClickEvent: function() {},
				onSelectItemEvent: function() {},
				onLoadEvent: function() {},
				onChooseEvent: function() {},
				onKeyEnterEvent: function() {},
				onMouseOverEvent: function() {},
				onMouseOutEvent: function() {},	
				onShowListEvent: function() {},
				onHideListEvent: function() {}
			},

			highlightPhrase: true,

			theme: "",

			cssClasses: "",

			minCharNumber: 0,

			requestDelay: 0,

			adjustWidth: true,

			ajaxSettings: {},

			preparePostData: function(data, inputPhrase) {return data;},

			loggerEnabled: true,

			template: "",

			categoriesAssigned: false,

			categories: [{
				maxNumberOfElements: 4
			}]

		};
		
		var externalObjects = ["ajaxSettings", "template"];

		this.get = function(propertyName) {
			return defaults[propertyName];
		};

		this.equals = function(name, value) {
			if (isAssigned(name)) {
				if (defaults[name] === value) {
					return true;
				}
			} 
			
			return false;
		};

		this.checkDataUrlProperties = function() {
			if (defaults.url === "list-required" && defaults.data === "list-required") {
				return false;
			}
			return true;
		};
		this.checkRequiredProperties = function() {
			for (var propertyName in defaults) {
				if (defaults[propertyName] === "required") {
					logger.error("Option " + propertyName + " must be defined");
					return false;
				}
			}
			return true;
		};

		this.printPropertiesThatDoesntExist = function(consol, optionsToCheck) {
			printPropertiesThatDoesntExist(consol, optionsToCheck);
		};


		prepareDefaults();

		mergeOptions();

		if (defaults.loggerEnabled === true) {
			printPropertiesThatDoesntExist(console, options);	
		}

		addAjaxSettings();

		processAfterMerge();
		function prepareDefaults() {

			if (options.dataType === "xml") {
				
				if (!options.getValue) {

					options.getValue = function(element) {
						return $(element).text();
					};
				}

				
				if (!options.list) {

					options.list = {};
				} 

				if (!options.list.sort) {
					options.list.sort = {};
				}


				options.list.sort.method = function(a, b) {
					a = options.getValue(a);
					b = options.getValue(b);
					if (a < b) {
						return -1;
					}
					if (a > b) {
						return 1;
					}
					return 0;
				};

				if (!options.list.match) {
					options.list.match = {};
				}

				options.list.match.method = function(element, phrase) {

					if (element.search(phrase) > -1) {
						return true;
					} else {
						return false;
					}
				};

			}
			if (options.categories !== undefined && options.categories instanceof Array) {

				var categories = [];

				for (var i = 0, length = options.categories.length; i < length; i += 1) { 

					var category = options.categories[i];

					for (var property in defaults.categories[0]) {

						if (category[property] === undefined) {
							category[property] = defaults.categories[0][property];
						}
					}

					categories.push(category);
				}

				options.categories = categories;
			}
		}

		function mergeOptions() {

			defaults = mergeObjects(defaults, options);

			function mergeObjects(source, target) {
				var mergedObject = source || {};

				for (var propertyName in source) {
					if (target[propertyName] !== undefined && target[propertyName] !== null) {

						if (typeof target[propertyName] !== "object" || 
								target[propertyName] instanceof Array) {
							mergedObject[propertyName] = target[propertyName];
						} else {
							mergeObjects(source[propertyName], target[propertyName]);
						}
					}
				}
			
				/* If data is an object */
				if (target.data !== undefined && target.data !== null && typeof target.data === "object") {
					mergedObject.data = target.data;
				}

				return mergedObject;
			}
		}	


		function processAfterMerge() {
			
			if (defaults.url !== "list-required" && typeof defaults.url !== "function") {
				var defaultUrl = defaults.url;
				defaults.url = function() {
					return defaultUrl;
				};
			}

			if (defaults.ajaxSettings.url !== undefined && typeof defaults.ajaxSettings.url !== "function") {
				var defaultUrl = defaults.ajaxSettings.url;
				defaults.ajaxSettings.url = function() {
					return defaultUrl;
				};
			}

			if (typeof defaults.listLocation === "string") {
				var defaultlistLocation = defaults.listLocation;

				if (defaults.dataType.toUpperCase() === "XML") {
					defaults.listLocation = function(data) {
						return $(data).find(defaultlistLocation);
					};
				} else {
					defaults.listLocation = function(data) {
						return data[defaultlistLocation];
					};	
				}
			}

			if (typeof defaults.getValue === "string") {
				var defaultsGetValue = defaults.getValue;
				defaults.getValue = function(element) {
					return element[defaultsGetValue];
				};
			}

			if (options.categories !== undefined) {
				defaults.categoriesAssigned = true;
			}

		}

		function addAjaxSettings() {

			if (options.ajaxSettings !== undefined && typeof options.ajaxSettings === "object") {
				defaults.ajaxSettings = options.ajaxSettings;
			} else {
				defaults.ajaxSettings = {};	
			}
			
		}

		function isAssigned(name) {
			if (defaults[name] !== undefined && defaults[name] !== null) {
				return true;
			} else {
				return false;
			}
		}
		function printPropertiesThatDoesntExist(consol, optionsToCheck) {
			
			checkPropertiesIfExist(defaults, optionsToCheck);

			function checkPropertiesIfExist(source, target) {
				for(var property in target) {
					if (source[property] === undefined) {
						consol.log("Property '" + property + "' does not exist in EasyAutocomplete options API.");		
					}

					if (typeof source[property] === "object" && $.inArray(property, externalObjects) === -1) {
						checkPropertiesIfExist(source[property], target[property]);
					}
				}	
			}
		}
	};

	return scope;

})(EasyAutocomplete || {});


/*
 * EasyAutocomplete - Logger 
 */
var EasyAutocomplete = (function(scope){
	
	scope.Logger = function Logger() {

		this.error = function(message) {
			console.log("ERROR: " + message);
		};

		this.warning = function(message) {
			console.log("WARNING: " + message);
		};
	};

	return scope;

})(EasyAutocomplete || {});
	

/*
 * EasyAutocomplete - Constans
 */
var EasyAutocomplete = (function(scope){	
	
	scope.Constans = function Constans() {
		var constants = {
			CONTAINER_CLASS: "easy-autocomplete-container",
			CONTAINER_ID: "eac-container-",

			WRAPPER_CSS_CLASS: "easy-autocomplete"
		};

		this.getValue = function(propertyName) {
			return constants[propertyName];
		};

	};

	return scope;

})(EasyAutocomplete || {});

/*
 * EasyAutocomplete - ListBuilderService 
 *
 * @author Łukasz Pawełczak 
 *
 */
var EasyAutocomplete = (function(scope) {

	scope.ListBuilderService = function ListBuilderService(configuration, proccessResponseData) {


		this.init = function(data) {
			var listBuilder = [],
				builder = {};

			builder.data = configuration.get("listLocation")(data);
			builder.getValue = configuration.get("getValue");
			builder.maxListSize = configuration.get("list").maxNumberOfElements;

				
			listBuilder.push(builder);

			return listBuilder;
		};

		this.updateCategories = function(listBuilder, data) {
			
			if (configuration.get("categoriesAssigned")) {

				listBuilder = [];

				for(var i = 0; i < configuration.get("categories").length; i += 1) {

					var builder = convertToListBuilder(configuration.get("categories")[i], data);

					listBuilder.push(builder);
				}

			} 

			return listBuilder;
		};

		this.convertXml = function(listBuilder) {
			if(configuration.get("dataType").toUpperCase() === "XML") {

				for(var i = 0; i < listBuilder.length; i += 1) {
					listBuilder[i].data = convertXmlToList(listBuilder[i]);
				}
			}

			return listBuilder;
		};

		this.processData = function(listBuilder, inputPhrase) {

			for(var i = 0, length = listBuilder.length; i < length; i+=1) {
				listBuilder[i].data = proccessResponseData(configuration, listBuilder[i], inputPhrase);
			}

			return listBuilder;
		};

		this.checkIfDataExists = function(listBuilders) {

			for(var i = 0, length = listBuilders.length; i < length; i += 1) {

				if (listBuilders[i].data !== undefined && listBuilders[i].data instanceof Array) {
					if (listBuilders[i].data.length > 0) {
						return true;
					}
				} 
			}

			return false;
		};


		function convertToListBuilder(category, data) {

			var builder = {};

			if(configuration.get("dataType").toUpperCase() === "XML") {

				builder = convertXmlToListBuilder();
			} else {

				builder = convertDataToListBuilder();
			}
			

			if (category.header !== undefined) {
				builder.header = category.header;
			}

			if (category.maxNumberOfElements !== undefined) {
				builder.maxNumberOfElements = category.maxNumberOfElements;
			}

			if (configuration.get("list").maxNumberOfElements !== undefined) {

				builder.maxListSize = configuration.get("list").maxNumberOfElements;
			}

			if (category.getValue !== undefined) {

				if (typeof category.getValue === "string") {
					var defaultsGetValue = category.getValue;
					builder.getValue = function(element) {
						return element[defaultsGetValue];
					};
				} else if (typeof category.getValue === "function") {
					builder.getValue = category.getValue;
				}

			} else {
				builder.getValue = configuration.get("getValue");	
			}
			

			return builder;


			function convertXmlToListBuilder() {

				var builder = {},
					listLocation;

				if (category.xmlElementName !== undefined) {
					builder.xmlElementName = category.xmlElementName;
				}

				if (category.listLocation !== undefined) {

					listLocation = category.listLocation;
				} else if (configuration.get("listLocation") !== undefined) {

					listLocation = configuration.get("listLocation");
				}

				if (listLocation !== undefined) {
					if (typeof listLocation === "string") {
						builder.data = $(data).find(listLocation);
					} else if (typeof listLocation === "function") {

						builder.data = listLocation(data);
					}
				} else {

					builder.data = data;
				}

				return builder;
			}


			function convertDataToListBuilder() {

				var builder = {};

				if (category.listLocation !== undefined) {

					if (typeof category.listLocation === "string") {
						builder.data = data[category.listLocation];
					} else if (typeof category.listLocation === "function") {
						builder.data = category.listLocation(data);
					}
				} else {
					builder.data = data;
				}

				return builder;
			}
		}

		function convertXmlToList(builder) {
			var simpleList = [];

			if (builder.xmlElementName === undefined) {
				builder.xmlElementName = configuration.get("xmlElementName");
			}


			$(builder.data).find(builder.xmlElementName).each(function() {
				simpleList.push(this);
			});

			return simpleList;
		}

	};

	return scope;

})(EasyAutocomplete || {});


/*
 * EasyAutocomplete - Data proccess module
 *
 * Process list to display:
 * - sort 
 * - decrease number to specific number
 * - show only matching list
 *
 */
var EasyAutocomplete = (function(scope) {

	scope.proccess = function proccessData(config, listBuilder, phrase) {

		scope.proccess.match = match;

		var list = listBuilder.data,
			inputPhrase = phrase;//TODO REFACTOR

		list = findMatch(list, inputPhrase);
		list = reduceElementsInList(list);
		list = sort(list);

		return list;


		function findMatch(list, phrase) {
			var preparedList = [],
				value = "";

			if (config.get("list").match.enabled) {

				for(var i = 0, length = list.length; i < length; i += 1) {

					value = config.get("getValue")(list[i]);
					
					if (match(value, phrase)) {
						preparedList.push(list[i]);	
					}
					
				}

			} else {
				preparedList = list;
			}

			return preparedList;
		}

		function match(value, phrase) {

			if (!config.get("list").match.caseSensitive) {

				if (typeof value === "string") {
					value = value.toLowerCase();	
				}
				
				phrase = phrase.toLowerCase();
			}
			if (config.get("list").match.method(value, phrase)) {
				return true;
			} else {
				return false;
			}
		}

		function reduceElementsInList(list) {
			if (listBuilder.maxNumberOfElements !== undefined && list.length > listBuilder.maxNumberOfElements) {
				list = list.slice(0, listBuilder.maxNumberOfElements);
			}

			return list;
		}

		function sort(list) {
			if (config.get("list").sort.enabled) {
				list.sort(config.get("list").sort.method);
			}

			return list;
		}
		
	};


	return scope;


})(EasyAutocomplete || {});


/*
 * EasyAutocomplete - Template 
 *
 * 
 *
 */
var EasyAutocomplete = (function(scope){

	scope.Template = function Template(options) {


		var genericTemplates = {
			basic: {
				type: "basic",
				method: function(element) { return element; },
				cssClass: ""
			},
			description: {
				type: "description",
				fields: {
					description: "description"
				},
				method: function(element) {	return element + " - description"; },
				cssClass: "eac-description"
			},
			iconLeft: {
				type: "iconLeft",
				fields: {
					icon: ""
				},
				method: function(element) {
					return element;
				},
				cssClass: "eac-icon-left"
			},
			iconRight: {
				type: "iconRight",
				fields: {
					iconSrc: ""
				},
				method: function(element) {
					return element;
				},
				cssClass: "eac-icon-right"
			},
			links: {
				type: "links",
				fields: {
					link: ""
				},
				method: function(element) {
					return element;
				},
				cssClass: ""
			},
			custom: {
				type: "custom",
				method: function() {},
				cssClass: ""
			}
		},



		/*
		 * Converts method with {{text}} to function
		 */
		convertTemplateToMethod = function(template) {


			var _fields = template.fields,
				buildMethod;

			if (template.type === "description") {

				buildMethod = genericTemplates.description.method; 

				if (typeof _fields.description === "string") {
					buildMethod = function(elementValue, element) {
						return elementValue + " - <span>" + element[_fields.description] + "</span>";
					};					
				} else if (typeof _fields.description === "function") {
					buildMethod = function(elementValue, element) {
						return elementValue + " - <span>" + _fields.description(element) + "</span>";
					};	
				}

				return buildMethod;
			}

			if (template.type === "iconRight") {

				if (typeof _fields.iconSrc === "string") {
					buildMethod = function(elementValue, element) {
						return elementValue + "<img class='eac-icon' src='" + element[_fields.iconSrc] + "' />" ;
					};					
				} else if (typeof _fields.iconSrc === "function") {
					buildMethod = function(elementValue, element) {
						return elementValue + "<img class='eac-icon' src='" + _fields.iconSrc(element) + "' />" ;
					};
				}

				return buildMethod;
			}


			if (template.type === "iconLeft") {

				if (typeof _fields.iconSrc === "string") {
					buildMethod = function(elementValue, element) {
						return "<img class='eac-icon' src='" + element[_fields.iconSrc] + "' />" + elementValue;
					};					
				} else if (typeof _fields.iconSrc === "function") {
					buildMethod = function(elementValue, element) {
						return "<img class='eac-icon' src='" + _fields.iconSrc(element) + "' />" + elementValue;
					};
				}

				return buildMethod;
			}

			if(template.type === "links") {

				if (typeof _fields.link === "string") {
					buildMethod = function(elementValue, element) {
						return "<a href='" + element[_fields.link] + "' >" + elementValue + "</a>";
					};					
				} else if (typeof _fields.link === "function") {
					buildMethod = function(elementValue, element) {
						return "<a href='" + _fields.link(element) + "' >" + elementValue + "</a>";
					};
				}

				return buildMethod;
			}


			if (template.type === "custom") {

				return template.method;
			}

			return genericTemplates.basic.method;

		},


		prepareBuildMethod = function(options) {
			if (!options || !options.type) {

				return genericTemplates.basic.method;
			}

			if (options.type && genericTemplates[options.type]) {

				return convertTemplateToMethod(options);
			} else {

				return genericTemplates.basic.method;
			}

		},

		templateClass = function(options) {
			var emptyStringFunction = function() {return "";};

			if (!options || !options.type) {

				return emptyStringFunction;
			}

			if (options.type && genericTemplates[options.type]) {
				return (function () { 
					var _cssClass = genericTemplates[options.type].cssClass;
					return function() { return _cssClass;};
				})();
			} else {
				return emptyStringFunction;
			}
		};


		this.getTemplateClass = templateClass(options);

		this.build = prepareBuildMethod(options);


	};

	return scope;

})(EasyAutocomplete || {});


/*
 * EasyAutocomplete - jQuery plugin for autocompletion
 *
 */
var EasyAutocomplete = (function(scope) {

	
	scope.main = function Core($input, options) {
				
		var module = {
				name: "EasyAutocomplete",
				shortcut: "eac"
			};

		var consts = new scope.Constans(),
			config = new scope.Configuration(options),
			logger = new scope.Logger(),
			template = new scope.Template(options.template),
			listBuilderService = new scope.ListBuilderService(config, scope.proccess),
			checkParam = config.equals,

			$field = $input, 
			$container = "",
			elementsList = [],
			selectedElement = -1,
			requestDelayTimeoutId;

		scope.consts = consts;

		this.getConstants = function() {
			return consts;
		};

		this.getConfiguration = function() {
			return config;
		};

		this.getContainer = function() {
			return $container;
		};

		this.getSelectedItemIndex = function() {
			return selectedElement;
		};

		this.getItems = function () {
			return elementsList;
		};

		this.getItemData = function(index) {

			if (elementsList.length < index || elementsList[index] === undefined) {
				return -1;
			} else {
				return elementsList[index];
			}
		};

		this.getSelectedItemData = function() {
			return this.getItemData(selectedElement);
		};

		this.build = function() {
			prepareField();
		};

		this.init = function() {
			init();
		};
		function init() {

			if ($field.length === 0) {
				logger.error("Input field doesn't exist.");
				return;
			}

			if (!config.checkDataUrlProperties()) {
				logger.error("One of options variables 'data' or 'url' must be defined.");
				return;
			}

			if (!config.checkRequiredProperties()) {
				logger.error("Will not work without mentioned properties.");
				return;
			}


			prepareField();
			bindEvents();	

		}
		function prepareField() {

				
			if ($field.parent().hasClass(consts.getValue("WRAPPER_CSS_CLASS"))) {
				removeContainer();
				removeWrapper();
			} 
			
			createWrapper();
			createContainer();	

			$container = $("#" + getContainerId());
			if (config.get("placeholder")) {
				$field.attr("placeholder", config.get("placeholder"));
			}


			function createWrapper() {
				var $wrapper = $("<div>"),
					classes = consts.getValue("WRAPPER_CSS_CLASS");

			
				if (config.get("theme") && config.get("theme") !== "") {
					classes += " eac-" + config.get("theme");
				}

				if (config.get("cssClasses") && config.get("cssClasses") !== "") {
					classes += " " + config.get("cssClasses");
				}

				if (template.getTemplateClass() !== "") {
					classes += " " + template.getTemplateClass();
				}
				

				$wrapper
					.addClass(classes);
				$field.wrap($wrapper);


				if (config.get("adjustWidth") === true) {
					adjustWrapperWidth();	
				}
				

			}

			function adjustWrapperWidth() {
				var fieldWidth = $field.outerWidth();

				$field.parent().css("width", fieldWidth);				
			}

			function removeWrapper() {
				$field.unwrap();
			}

			function createContainer() {
				var $elements_container = $("<div>").addClass(consts.getValue("CONTAINER_CLASS"));

				$elements_container
						.attr("id", getContainerId())
						.prepend($("<ul>"));


				(function() {

					$elements_container
						/* List show animation */
						.on("show.eac", function() {

							switch(config.get("list").showAnimation.type) {

								case "slide":
									var animationTime = config.get("list").showAnimation.time,
										callback = config.get("list").showAnimation.callback;

									$elements_container.find("ul").slideDown(animationTime, callback);
								break;

								case "fade":
									var animationTime = config.get("list").showAnimation.time,
										callback = config.get("list").showAnimation.callback;

									$elements_container.find("ul").fadeIn(animationTime), callback;
								break;

								default:
									$elements_container.find("ul").show();
								break;
							}

							config.get("list").onShowListEvent();
							
						})
						/* List hide animation */
						.on("hide.eac", function() {

							switch(config.get("list").hideAnimation.type) {

								case "slide":
									var animationTime = config.get("list").hideAnimation.time,
										callback = config.get("list").hideAnimation.callback;

									$elements_container.find("ul").slideUp(animationTime, callback);
								break;

								case "fade":
									var animationTime = config.get("list").hideAnimation.time,
										callback = config.get("list").hideAnimation.callback;

									$elements_container.find("ul").fadeOut(animationTime, callback);
								break;

								default:
									$elements_container.find("ul").hide();
								break;
							}

							config.get("list").onHideListEvent();

						})
						.on("selectElement.eac", function() {
							$elements_container.find("ul li").removeClass("selected");
							$elements_container.find("ul li").eq(selectedElement).addClass("selected");

							config.get("list").onSelectItemEvent();
						})
						.on("loadElements.eac", function(event, listBuilders, phrase) {
			

							var $item = "",
								$listContainer = $elements_container.find("ul");

							$listContainer
								.empty()
								.detach();

							elementsList = [];
							var counter = 0;
							for(var builderIndex = 0, listBuildersLength = listBuilders.length; builderIndex < listBuildersLength; builderIndex += 1) {

								var listData = listBuilders[builderIndex].data;

								if (listData.length === 0) {
									continue;
								}

								if (listBuilders[builderIndex].header !== undefined && listBuilders[builderIndex].header.length > 0) {
									$listContainer.append("<div class='eac-category' >" + listBuilders[builderIndex].header + "</div>");
								}

								for(var i = 0, listDataLength = listData.length; i < listDataLength && counter < listBuilders[builderIndex].maxListSize; i += 1) {
									$item = $("<li><div class='eac-item'></div></li>");
									

									(function() {
										var j = i,
											itemCounter = counter,
											elementsValue = listBuilders[builderIndex].getValue(listData[j]);

										$item.find(" > div")
											.on("click", function() {

												$field.val(elementsValue).trigger("change");

												selectedElement = itemCounter;
												selectElement(itemCounter);

												config.get("list").onClickEvent();
												config.get("list").onChooseEvent();
											})
											.mouseover(function() {

												selectedElement = itemCounter;
												selectElement(itemCounter);	

												config.get("list").onMouseOverEvent();
											})
											.mouseout(function() {
												config.get("list").onMouseOutEvent();
											})
											.html(template.build(highlight(elementsValue, phrase), listData[j]));
									})();

									$listContainer.append($item);
									elementsList.push(listData[i]);
									counter += 1;
								}
							}

							$elements_container.append($listContainer);

							config.get("list").onLoadEvent();
						});

				})();

				$field.after($elements_container);
			}

			function removeContainer() {
				$field.next("." + consts.getValue("CONTAINER_CLASS")).remove();
			}

			function highlight(string, phrase) {

				if(config.get("highlightPhrase") && phrase !== "") {
					return highlightPhrase(string, phrase);	
				} else {
					return string;
				}
					
			}

			function escapeRegExp(str) {
				return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
 			}

			function highlightPhrase(string, phrase) {
				var escapedPhrase = escapeRegExp(phrase);
				return (string + "").replace(new RegExp("(" + escapedPhrase + ")", "gi") , "<b>$1</b>");
			}



		}
		function getContainerId() {
			
			var elementId = $field.attr("id");

			elementId = consts.getValue("CONTAINER_ID") + elementId;

			return elementId;
		}
		function bindEvents() {

			bindAllEvents();
			

			function bindAllEvents() {
				if (checkParam("autocompleteOff", true)) {
					removeAutocomplete();
				}

				bindFocusOut();
				bindKeyup();
				bindKeydown();
				bindKeypress();
				bindFocus();
				bindBlur();
			}

			function bindFocusOut() {
				$field.focusout(function () {

					var fieldValue = $field.val(),
						phrase;

					if (!config.get("list").match.caseSensitive) {
						fieldValue = fieldValue.toLowerCase();
					}

					for (var i = 0, length = elementsList.length; i < length; i += 1) {

						phrase = config.get("getValue")(elementsList[i]);
						if (!config.get("list").match.caseSensitive) {
							phrase = phrase.toLowerCase();
						}

						if (phrase === fieldValue) {
							selectedElement = i;
							selectElement(selectedElement);
							return;
						}
					}
				});
			}

			function bindKeyup() {
				$field
				.off("keyup")
				.keyup(function(event) {

					switch(event.keyCode) {

						case 27:

							hideContainer();
							loseFieldFocus();
						break;

						case 38:

							event.preventDefault();

							if(elementsList.length > 0 && selectedElement > 0) {

								selectedElement -= 1;

								$field.val(config.get("getValue")(elementsList[selectedElement]));

								selectElement(selectedElement);

							}						
						break;

						case 40:

							event.preventDefault();

							if(elementsList.length > 0 && selectedElement < elementsList.length - 1) {

								selectedElement += 1;

								$field.val(config.get("getValue")(elementsList[selectedElement]));

								selectElement(selectedElement);
								
							}

						break;

						default:

							if (event.keyCode > 40 || event.keyCode === 8) {

								var inputPhrase = $field.val();

								if (!(config.get("list").hideOnEmptyPhrase === true && event.keyCode === 8 && inputPhrase === "")) {

									if (config.get("requestDelay") > 0) {
										if (requestDelayTimeoutId !== undefined) {
											clearTimeout(requestDelayTimeoutId);
										}

										requestDelayTimeoutId = setTimeout(function () { loadData(inputPhrase);}, config.get("requestDelay"));
									} else {
										loadData(inputPhrase);
									}

								} else {
									hideContainer();
								}
								
							}


						break;
					}
				

					function loadData(inputPhrase) {


						if (inputPhrase.length < config.get("minCharNumber")) {
							return;
						}


						if (config.get("data") !== "list-required") {

							var data = config.get("data");

							var listBuilders = listBuilderService.init(data);

							listBuilders = listBuilderService.updateCategories(listBuilders, data);
							
							listBuilders = listBuilderService.processData(listBuilders, inputPhrase);

							loadElements(listBuilders, inputPhrase);

							if ($field.parent().find("li").length > 0) {
								showContainer();	
							} else {
								hideContainer();
							}

						}

						var settings = createAjaxSettings();

						if (settings.url === undefined || settings.url === "") {
							settings.url = config.get("url");
						}

						if (settings.dataType === undefined || settings.dataType === "") {
							settings.dataType = config.get("dataType");
						}


						if (settings.url !== undefined && settings.url !== "list-required") {

							settings.url = settings.url(inputPhrase);

							settings.data = config.get("preparePostData")(settings.data, inputPhrase);

							$.ajax(settings) 
								.done(function(data) {

									var listBuilders = listBuilderService.init(data);

									listBuilders = listBuilderService.updateCategories(listBuilders, data);
									
									listBuilders = listBuilderService.convertXml(listBuilders);
									if (checkInputPhraseMatchResponse(inputPhrase, data)) {

										listBuilders = listBuilderService.processData(listBuilders, inputPhrase);

										loadElements(listBuilders, inputPhrase);	
																				
									}

									if (listBuilderService.checkIfDataExists(listBuilders) && $field.parent().find("li").length > 0) {
										showContainer();	
									} else {
										hideContainer();
									}

									config.get("ajaxCallback")();

								})
								.fail(function() {
									logger.warning("Fail to load response data");
								})
								.always(function() {

								});
						}

						

						function createAjaxSettings() {

							var settings = {},
								ajaxSettings = config.get("ajaxSettings") || {};

							for (var set in ajaxSettings) {
								settings[set] = ajaxSettings[set];
							}

							return settings;
						}

						function checkInputPhraseMatchResponse(inputPhrase, data) {

							if (config.get("matchResponseProperty") !== false) {
								if (typeof config.get("matchResponseProperty") === "string") {
									return (data[config.get("matchResponseProperty")] === inputPhrase);
								}

								if (typeof config.get("matchResponseProperty") === "function") {
									return (config.get("matchResponseProperty")(data) === inputPhrase);
								}

								return true;
							} else {
								return true;
							}

						}

					}


				});
			}

			function bindKeydown() {
				$field
					.on("keydown", function(evt) {
	        		    evt = evt || window.event;
	        		    var keyCode = evt.keyCode;
	        		    if (keyCode === 38) {
	        		        suppressKeypress = true; 
	        		        return false;
	        		    }
		        	})
					.keydown(function(event) {

						if (event.keyCode === 13 && selectedElement > -1) {

							$field.val(config.get("getValue")(elementsList[selectedElement]));

							config.get("list").onKeyEnterEvent();
							config.get("list").onChooseEvent();

							selectedElement = -1;
							hideContainer();

							event.preventDefault();
						}
					});
			}

			function bindKeypress() {
				$field
				.off("keypress");
			}

			function bindFocus() {
				$field.focus(function() {

					if ($field.val() !== "" && elementsList.length > 0) {
						
						selectedElement = -1;
						showContainer();	
					}
									
				});
			}

			function bindBlur() {
				$field.blur(function() {
					setTimeout(function() { 
						
						selectedElement = -1;
						hideContainer();
					}, 250);
				});
			}

			function removeAutocomplete() {
				$field.attr("autocomplete","off");
			}

		}

		function showContainer() {
			$container.trigger("show.eac");
		}

		function hideContainer() {
			$container.trigger("hide.eac");
		}

		function selectElement(index) {
			
			$container.trigger("selectElement.eac", index);
		}

		function loadElements(list, phrase) {
			$container.trigger("loadElements.eac", [list, phrase]);
		}

		function loseFieldFocus() {
			$field.trigger("blur");
		}


	};
	scope.eacHandles = [];

	scope.getHandle = function(id) {
		return scope.eacHandles[id];
	};

	scope.inputHasId = function(input) {

		if($(input).attr("id") !== undefined && $(input).attr("id").length > 0) {
			return true;
		} else {
			return false;
		}

	};

	scope.assignRandomId = function(input) {

		var fieldId = "";

		do {
			fieldId = "eac-" + Math.floor(Math.random() * 10000);		
		} while ($("#" + fieldId).length !== 0);
		
		elementId = scope.consts.getValue("CONTAINER_ID") + fieldId;

		$(input).attr("id", fieldId);
 
	};

	scope.setHandle = function(handle, id) {
		scope.eacHandles[id] = handle;
	};


	return scope;

})(EasyAutocomplete || {});

(function($) {

	$.fn.easyAutocomplete = function(options) {

		return this.each(function() {
			var $this = $(this),
				eacHandle = new EasyAutocomplete.main($this, options);

			if (!EasyAutocomplete.inputHasId($this)) {
				EasyAutocomplete.assignRandomId($this);
			}

			eacHandle.init();

			EasyAutocomplete.setHandle(eacHandle, $this.attr("id"));

		});
	};

	$.fn.getSelectedItemIndex = function() {

		var inputId = $(this).attr("id");

		if (inputId !== undefined) {
			return EasyAutocomplete.getHandle(inputId).getSelectedItemIndex();
		}

		return -1;
	};

	$.fn.getItems = function () {

		var inputId = $(this).attr("id");

		if (inputId !== undefined) {
			return EasyAutocomplete.getHandle(inputId).getItems();
		}

		return -1;
	};

	$.fn.getItemData = function(index) {

		var inputId = $(this).attr("id");

		if (inputId !== undefined && index > -1) {
			return EasyAutocomplete.getHandle(inputId).getItemData(index);
		}

		return -1;
	};

	$.fn.getSelectedItemData = function() {

		var inputId = $(this).attr("id");

		if (inputId !== undefined) {
			return EasyAutocomplete.getHandle(inputId).getSelectedItemData();
		}

		return -1;
	};

})(jQuery);
;
//$(window).scroll(function(){
//	var offsetTop = $(".destination, .descriptionSec").offset().top  - 100;
//
//	if( $(window).scrollTop() >  offsetTop ) {
//		$(".chat").addClass("visible");
//	} else {
//		$(".chat").removeClass("visible");
//	}
//});;
var calenderYear = ["2024", "2025", "2026"];//store calender year array
var currentYear = moment().format("YYYY");//store current year
var todayDate = moment().format('DD/MMM/YYYY');//store today date
var isCruiseCalanderInitialised = false;
var dynamicCruiseCalendarData = "";
var tempCARRAY;

var cruiseParentClass = ".booking-engine";
if(document.location.href.indexOf("/oberoi-one") != -1 ){
    cruiseParentClass =  ".booking-engine-oberoi-one";

    $(".dashboard .offer-book-now-btn a.style2 ").click(function(){
        cruiseParentClass =  ".booking-engine";
    });
}



/*function for bind calender year*/
function fnBindYears() {
    var html = "";
    fnRemoveBlankColumns(calenderYear[indexOfYearToInitialise]);
    html = "<li  class= 'c-current-year' class='actv " + "year" + "-" + calenderYear[indexOfYearToInitialise] + "'>" + calenderYear[indexOfYearToInitialise] + "</li>";
    $(cruiseParentClass+" .c-year-list").html(html);
}

function disableNextPrevIfNoDateAvailable(year) {

    var nextYear = moment(year, "YYYY").clone().add(1, "y").format("YYYY");
    var prevYear = moment(year, "YYYY").clone().add(-1, "y").format("YYYY");

    $(cruiseParentClass+" .c-prv").removeClass("c-btn-deactive");
    $(cruiseParentClass+" .c-nxt").removeClass("c-btn-deactive");

    if (calenderYear.indexOf(prevYear) == -1) {
        $(cruiseParentClass+" .c-prv").addClass("c-btn-deactive");
    }

    if (calenderYear.indexOf(nextYear) == -1) {
        $(cruiseParentClass+" .c-nxt").addClass("c-btn-deactive");
    }
}

/* Set Zahra Philae Nights header such as Four Nights, Five Nights etc */
function fnSetCruiseHeader(hotelCode) {
    var htmlLuxorHeading = "";
    var htmlAswanHeading = "";
    $(cruiseParentClass+" .c-colmn-heading-luxor").html("");
    $(cruiseParentClass+" .c-colmn-heading-aswan").html("");

    /*Get Word from Number */
    var arrNumberToWord = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"];

    for (var i = 0; i < cruiseCalendarSettings.length; i++) {

        if (cruiseCalendarSettings[i].hotelCode == hotelCode) {
            for (var j = 0; j < cruiseCalendarSettings[i].settings.showLuxorNights.length; j++) {
                htmlLuxorHeading += "<div class='c-offer-night-col n44 c-col-night-heading col-luxor-" + j + "' data-column='luxor-" + j + "'><span class='c-col-txt'>" + arrNumberToWord[cruiseCalendarSettings[i].settings.showLuxorNights[j]] + "</span></div>";
            }

        }

        if (cruiseCalendarSettings[i].hotelCode == hotelCode) {
            for (var j = 0; j < cruiseCalendarSettings[i].settings.showAswanNights.length; j++) {
                htmlAswanHeading += "<div class='c-offer-night-col n44 c-col-night-heading col-aswan-" + j + "' data-column='aswan-" + j + "'><span class='c-col-txt'>" + arrNumberToWord[cruiseCalendarSettings[i].settings.showAswanNights[j]] + "</span></div>";
            }

        }
    }

    $(cruiseParentClass+" .c-colmn-heading-luxor").html(htmlLuxorHeading);
    $(cruiseParentClass+" .c-colmn-heading-aswan").html(htmlAswanHeading);
}

//create calender structure function
function fnCreateCruiseCalenderStructure(hotelCode) {
    $(cruiseParentClass+" .dynamic-cruise-calendar-data").html("");
    $(cruiseParentClass+" .c-colmn-heading-luxor").html("");
    $(cruiseParentClass+" .c-colmn-heading-aswan").html("");
    $(cruiseParentClass+" .c-prv").addClass("c-btn-deactive");

    //Temporary added on 03-01-2020
    //$(cruiseParentClass+" .c-nxt").addClass("c-btn-deactive");

    //Temporary comented on 03-01-2020
    $(cruiseParentClass+" .c-nxt").removeClass("c-btn-deactive");

    var data = "";
    indexOfYearToInitialise = 0;
    fnSetCruiseHeader(hotelCode);

    if (calenderYear.indexOf(moment().format("YYYY")) != -1) {
        indexOfYearToInitialise = calenderYear.indexOf(moment().format("YYYY"));
    }

    var pageSailingDateTab = "";
    for (var i = indexOfYearToInitialise; i < calenderYear.length; i++) {

        pageSailingDateTab += "<li data-itnermaintab = '" + calenderYear[i] + "'>" + calenderYear[i] + "</li>";


        for (var month = 1; month <= 12; month++) {
            data += '<div class="c-row  ' + 'row' + '-' + calenderYear[i] + '" data-id="' + month + '-' + calenderYear[i] + '">';
            data += '<div class="c-col c-month-col"><span class="c-col-txt">' + moment(month, "MM").clone().format("MMMM") + '</span></div>';
            data += '<div class="c-col c-offer-col">';
            data += '<div class="c-date-row">';


            for (var j = 0; j < cruiseCalendarSettings.length; j++) {

                if (cruiseCalendarSettings[j].hotelCode == hotelCode) {
                    for (var k = 0; k < cruiseCalendarSettings[j].settings.showLuxorNights.length; k++) {

                        data += '<div class="c-date-col-2 col-luxor-' + k + '"  data-column="luxor-' + k + '">';
                        data += fnPrintArrayDates(fnGetCruiseEmbarkationDateArray(hotelCode, "LUXOR", cruiseCalendarSettings[j].settings.showLuxorNights[k]), calenderYear[i], month, "LUXOR", cruiseCalendarSettings[j].settings.showLuxorNights[k]);
                        data += '</div>';
                    }
                }
            }

            data += '</div>';
            data += '</div>';
            data += '<div class="c-col c-offer-col">';
            data += '<div class="c-date-row">';

            for (var j = 0; j < cruiseCalendarSettings.length; j++) {

                if (cruiseCalendarSettings[j].hotelCode == hotelCode) {
                    for (var k = 0; k < cruiseCalendarSettings[j].settings.showAswanNights.length; k++) {

                        data += '<div class="c-date-col-2 col-aswan-' + k + '"  data-column="aswan-' + k + '">';
                        data += fnPrintArrayDates(fnGetCruiseEmbarkationDateArray(hotelCode, "aswan", cruiseCalendarSettings[j].settings.showAswanNights[k]), calenderYear[i], month, "ASWAN", cruiseCalendarSettings[j].settings.showAswanNights[k]);
                        data += '</div>';
                    }
                }
            }

            data += '</div>';
            data += '</div>';
            data += '</div>';
            data += '</div>';

        }




        $(cruiseParentClass+" .dynamic-cruise-calendar-data").html(data);
        fnPrintBlankDate();
    }

    if (!isCruiseCalanderInitialised) {
        $(".itiner-main-tabs").html(pageSailingDateTab);
        $(".itiner-main-tabs li:eq(0)").addClass("active");

    }



    fnHighlightDate();
    fnDisablePastDate();
    fnBindYears();
    fnChangeYear();


    /*Copy all cruise calendar to page sailing dates*/
    if (!isCruiseCalanderInitialised) {
        setTimeout(function () {
            dynamicCruiseCalendarData = $(cruiseParentClass+" .c-main-container").html();
            $('.pageCruseDates .c-main-container').html(dynamicCruiseCalendarData);
            bindItinerMainContentEvents();
        }, 1000);
    }

    isCruiseCalanderInitialised = true;
}

//code for loop diffrent array and print its date in html tag start here
function fnPrintArrayDates(objArray, year, month, embarkation, nights) {
    var dateData = "";

    var cruiseSoldOutDate = "";
    var hotelofferingid = glblBwConfiguration.hotelCode + "-" + embarkation + "-" + nights;
    console.log(hotelofferingid);
    var tempArray = fnBwCruiseCalendarSoldOutDates(hotelofferingid);
    console.log(tempArray);


    for (var i = 0; i < objArray.length; i++) {

        cruiseSoldOutDate = "";
        var date = objArray[i].split('-');
        if (date[0] == year && date[1] == month) {
            // debugger;

            var stringDateYYYYMMDD = date[0] + "-" + date[1] + "-" + date[2];
            if (tempArray.length > 0) {

                var tempSoldOutDate = tempArray.filter(function (item) {
                    return item.date == stringDateYYYYMMDD && item.restrictionType.toLowerCase() == "close";
                });


                if (tempSoldOutDate.length > 0 && moment(stringDateYYYYMMDD)._d >= moment()._d) {
                    cruiseSoldOutDate = "cruiseSoldOutDate";
                }
                else {
                    cruiseSoldOutDate = "";
                }
            }

          //  console.log(cruiseSoldOutDate + "cruiseSoldOutDate=hotelofferingid=" + hotelofferingid + stringDateYYYYMMDD);

            dateData += '<span class="c-date ' + cruiseSoldOutDate + '" data-embarkation= "' + embarkation + '" data-nights = "' + nights + '" data-id="' + stringDateYYYYMMDD + '" data-date="' + stringDateYYYYMMDD + '">' + moment(objArray[i], "YYYY-MM-DD").format("D") + '</span>';
        }

    }

    return dateData;
}

//code for print blank dates if date is not avaliable in array
function fnPrintBlankDate() {
    $(".dynamic-cruise-calendar-data .c-date-col-2").each(function () {
        if ($(this).html() == "") {
            $(this).html("<img src='/images/OberoiHotels/booking-engine/blank-date-line.png'>");
        }
    });
}


//function date higlights on click
function fnHighlightDate() {
    $(cruiseParentClass+" .c-date").unbind();
    $(cruiseParentClass+" .c-date").click(function () {
        fnHighlightSelectedDate($(this));
    });
}

function fnHighlightSelectedDate(thisSelector) {

    fnHighlightDateOnInitialize($(thisSelector).data("embarkation"), $(thisSelector).data("date"), $(thisSelector).data("nights"));
}

//function date higlight date on Initialize
function fnHighlightDateOnInitialize(embarkation, date, nights) {
    $(".c-date").removeClass("dateSelected");
    $(".checkInCheckOut").removeClass("cruiseCalenderDefaultScreen");

    $(".selectedEmbarkationDtls").hide();
    $(".availability-cta .booking-engine.layout2.left .checkInCheckOut .datesWrap").hide();
    $(".dynamic-cruise-calendar-data [data-date]").each(function () {
        
        if ($(this).data("embarkation") == embarkation
            && $(this).data("date") == date
            && $(this).data("nights") == nights) {

            var embarkationSelected = "";
            $(this).addClass("dateSelected");
            embarkationSelected = $(this).data("embarkation");
            embarkationSelected = embarkationSelected.toLowerCase();
            embarkationSelected = embarkationSelected.charAt(0).toUpperCase() + embarkationSelected.slice(1);
            $(".selectedEmbarCruiseName").html(embarkationSelected);
            $(".selectedEmbarkationDate").html("0" + $(this).data("nights"));
            $(".selectedEmbarkationDtls").show();


            fnShowHideSailingDatesTabContent(moment(date, "YYYY-MM-DD").format("YYYY"));
        }
        $(".availability-cta .booking-engine.layout2.left .checkInCheckOut .datesWrap").show();
    });

    var _hotelcdoe = $(cruiseParentClass+":eq(0) [data-hotelcode].active").data("hotelcode");
    setCalanderValuesCruise(embarkation, date, nights, _hotelcdoe);
    //  fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget();
    //fnDisplayDynamicMessageInCalendar(_hotelcdoe);

}

//code for disable past date
function fnDisablePastDate() {
    $(".dynamic-cruise-calendar-data [data-date]").each(function () {
        var dataDate = moment($(this).attr("data-date"), "YYYY-MM-DD");
        if (dataDate < moment()) {
            $(this).addClass("disabledDate");
        }
    });
}


//code for disable past date
function fnBwMarkSoldOutDates(hotel, embarkation, date) {
    $(".dynamic-cruise-calendar-data [data-date]").each(function () {
        var dataDate = moment($(this).attr("data-date"), "YYYY-MM-DD");
        if (dataDate < moment()) {
            $(this).addClass("disabledDate");
        }
    });
}


$(document).ready(function () {
    //show hide calender code
    $(".c-done-btn-mob").click(function () {
        $(cruiseParentClass+" .c-main-wrap").hide();
    });

    $('html').click(function () {
        $(cruiseParentClass+" .c-main-wrap").hide();
    });
    $(cruiseParentClass+".layout2 .selectEmbarkationBox").click(function (event) {
        event.stopPropagation();
    });

    $(".selectEmbarkationDate").click(function () {
     
        var _currIndex = $(this).closest(cruiseParentClass).attr('data-index');
        setTimeout(function(){
        $(cruiseParentClass+":eq(" + _currIndex + ") .c-main-wrap").show();
        $(".booking-engine-oberoi-one .c-main-wrap").show();
            console.log("selectEmbarkationDate clicked");
            $(cruiseParentClass + " .dynamic-cruise-calendar-data .c-row.row-" + $(".c-current-year").html()).css("display", "flex");

    },20);
    });


    /*------------cruise popup addClass code for small desktop resolution only start here-------------*/

    $(".availability-cta .bEnginepopUp .layout2cruiseParentClass").on('click', function () {
        $(".boxColumn.bEnginepopUp").removeClass("cruiseEmbarkationDatePopUP");
        $(".bookingEnginePopOverlay .close").removeClass("cruiseEmbrClose");
    });

    $(".selectEmbarkationDate").on('click', function () {
        $(".boxColumn.bEnginepopUp").addClass("cruiseEmbarkationDatePopUP");
        $(".bookingEnginePopOverlay .close").addClass("cruiseEmbrClose");
    });

    $(".bEnginepopUp cruiseParentClass.layout2 .hotelName, .c-main-wrap .yearWrap, .c-main-wrap .c-col").on('click', function () {
        event.stopPropagation();
    });

    $(".dynamic-cruise-calendar-data").on("click", ".c-col", function () {
        event.stopPropagation();
    })



    /*------------cruise popup addClass code for small desktop resolution only end here-------------*/


    setTimeout(function () {
        bindClickEventItinerMainTabs();
    }, 10);
	
	 
    
    var isiPad = navigator.userAgent.match(/iPad/i) != null;
    if(isiPad){
      $('html').addClass("ipad");
    }
	
});



/*code for change year on clicking on next and previous year arrow start here*/
function fnChangeYear() {

    $(cruiseParentClass+" .c-next-prev").unbind("click");
    $(cruiseParentClass+" .c-next-prev").click(function () {

        var isNext = false;
        if ($(this).attr("id") == "c-nxt") {
            isNext = true;
        }
        else {
            isNext = false;
        }

        var nextYear = moment($(cruiseParentClass+" .c-current-year").html(), "YYYY").clone().add(1, "y").format("YYYY");
        var prevYear = moment($(cruiseParentClass+" .c-current-year").html(), "YYYY").clone().add(-1, "y").format("YYYY");

        if (isNext) {

            if (calenderYear.indexOf(nextYear) != -1) {
                $(cruiseParentClass+" .c-current-year").html(nextYear);
            }
            fnRemoveBlankColumns(nextYear);

        }
        else {
            if (calenderYear.indexOf(prevYear) != -1) {
                $(cruiseParentClass+" .c-current-year").html(prevYear);
            }
            fnRemoveBlankColumns(prevYear);
        }
        disableNextPrevIfNoDateAvailable($(cruiseParentClass+" .c-current-year").html());

        $(cruiseParentClass+" .dynamic-cruise-calendar-data .c-row").hide();
        $(cruiseParentClass+" .dynamic-cruise-calendar-data .c-row.row-" + $(".c-current-year").html()).css("display", "flex");

        fnShowHideSailingDatesTabContent(moment($(".c-current-year").html(), "YYYY-MM-DD").format("YYYY"));


    });

    bindClickEventItinerMainTabs();
}

function fnShowHideSailingDatesTabContent(itnerTabId) {

    //console.log(itnerTabId + "--" + hotelcode + "--" + document.location.href);
    if ((document.location.href.indexOf("/nile-cruise-philae/sailing-dates") != -1 && glblBwConfiguration.hotelCode == "HBASWPH")
        || (document.location.href.indexOf("/nile-cruise-zahra/sailing-dates") != -1 && glblBwConfiguration.hotelCode == "HBASWZA")) {

        $(".itiner-main-tabs li").each(function () {
            $(this).removeClass("active");
            $(".itineraries-tab-section .dynamic-cruise-calendar-data .c-row.row-" + $(this).data("itnermaintab")).hide();
            if (moment($(this).data("itnermaintab"), "YYYY-MM-DD").format("YYYY") == itnerTabId) {
                $(this).addClass("active");
            }
        });


        $(".itineraries-tab-section .dynamic-cruise-calendar-data .c-row.row-" + itnerTabId).css("display", "flex");
        $(this).addClass("active");
        fnRemoveBlankColumnsFromTabs(itnerTabId);

    }


}

function bindClickEventItinerMainTabs() {
    $(".itiner-main-tabs li").unbind("click");
    $(".itiner-main-tabs li").click(function () {

        bindItinerMainContentEvents();

        //if (document.location.href.indexOf("/nile-cruise-zahra/sailing-dates") != -1) {
        //    hotelcode = "HBASWZA";
        //}
        //else if (document.location.href.indexOf("/nile-cruise-philae/sailing-dates") != -1) {
        //    hotelcode = "HBASWPH";
        //}

        setHotelSelectedByHotelCode(glblBwConfiguration.hotelCode);

        fnShowHideSailingDatesTabContent($(this).data("itnermaintab"));
    });

    bindItinerMainContentEvents();
    fnRemoveBlankColumnsFromTabs($("[data-itnermaintab].active").data("itnermaintab"));
}



/*Philae and Zahra Calander Code Section Start*/
/*Philae and Zahra Cruise Calander Structure Settings*/
var cruiseCalendarSettings = [{
    hotelCode: "HBASWPH",
    settings: {
        showLuxorNights: [4, 6],
        showAswanNights: [4, 6],
        selectDefaultEmbarkation: "LUXOR",
        selectDefaultNight: 4,
        startDate: "2022-01-01",
        endDate: "2024-12-31"
    }
},
{
    hotelCode: "HBASWZA",
    settings: {
        showLuxorNights: [4, 5, 7],
        showAswanNights: [3, 5, 7],
        selectDefaultEmbarkation: "LUXOR",
        selectDefaultNight: 5,
        startDate: "2022-01-01",
        endDate: "2024-12-31"
    }
}];


function showAndSetCruiseCalander(hotelCode) {
    $(cruiseParentClass+" .c-main-wrap").show();
    fnCreateCruiseCalenderStructure(hotelCode);
}

/*Date selected from table provided in pages such as Sailing Dates*/
function bindItinerMainContentEvents() {
    var _hotelcode = $(cruiseParentClass+":eq(0) [data-hotelcode].active").data("hotelcode");
    $(".pageCruseDates .c-date").unbind();
    $(".pageCruseDates .c-date").click(function () {

        var checkinDateSelected = $(this).data("date");
        var embarkationSelected = $(this).data("embarkation");
        var cruiseNightsSelected = $(this).data("nights");
        var objThis = $(this).data("nights");

        /*Check if selected Date is not past Date*/
        if (moment(checkinDateSelected, "YYYY-MM-DD").format("YYYY-MM-DD") >= moment().clone().format("YYYY-MM-DD")) {

            if (document.location.href.indexOf("/nile-cruise-zahra/sailing-dates") != -1) {
                _hotelcode = "HBASWZA";
            }
            else if (document.location.href.indexOf("/nile-cruise-philae/sailing-dates") != -1) {
                _hotelcode = "HBASWPH";
            }

            if (_hotelcode == "HBASWZA" || _hotelcode == "HBASWPH") {
                fnBwSetHotelSelectedByHotelCode(_hotelcode);
                fnInitializeCruiseCalander(_hotelcode);
                setCalanderValuesCruise(embarkationSelected, checkinDateSelected, cruiseNightsSelected, _hotelcode);
                fnHighlightDateOnInitialize(embarkationSelected, checkinDateSelected, cruiseNightsSelected);
                fnShowCalendarSectionOfSelectedDate(checkinDateSelected);
                $(".table-wrap span").removeClass("active");
                // $(this).addClass("active");

                openBookingEngine();
            }
        }


        fnShowHideSailingDatesTabContent(moment(checkinDateSelected, "YYYY-MM-DD").format("YYYY"));

    });

}


/*Show cruise calander section based on year. This piece of code is for pages such as Sailing Dates.
 get the Year from the Date and decriment year by 1 and set as text or HTML on class ".c-current-year"
 Now triggre the class ".c-nxt.c-next-prev" 
 This click works based on year availabe oas a text on class ".c-current-year"
 */
function fnShowCalendarSectionOfSelectedDate(checkinDateSelected) {

    var checkinYearSelected = moment(checkinDateSelected, "YYYY-MM-DD").add(-1, "year").format("YYYY");
    $(cruiseParentClass+" .c-current-year").html(checkinYearSelected);
    $(cruiseParentClass+" .c-nxt.c-next-prev").click();
}

/*TSets the selected Date in t-datpicker calendar */
function setCalanderValuesCruise(embarkationSelected, checkinDateSelected, cruiseNightsSelected, hotelSelected) {
    $(cruiseParentClass+" .offerMsgWrap").html("");
    $(cruiseParentClass+" .offerMsgWrap").hide();
    checkinDateSelected = moment(checkinDateSelected, "YYYY-MM-DD", true);
    var setStartDate = getCruiseSettingValueByKey(hotelSelected.split(";")[0], "startDate");
    var setEndDate = getCruiseSettingValueByKey(hotelSelected.split(";")[0], "endDate");

    /*Validate whether Date is in required format or not*/
    if (checkinDateSelected.isValid()) {

        /* Set Checking Date And Checkout Date*/
        setTimeout(function () {

            $(cruiseParentClass+" .t-datepicker").tDatePicker('setStartDate', moment(checkinDateSelected).clone().format("YYYY-MM-DD"));
            $(cruiseParentClass+" .t-datepicker").tDatePicker('setEndDate', setEndDate);
            $(cruiseParentClass+" .t-datepicker").tDatePicker('updateCI', moment(checkinDateSelected).clone().format("YYYY-MM-DD"));
            $(cruiseParentClass+" .t-datepicker").tDatePicker('updateCO', moment(checkinDateSelected).clone().add(cruiseNightsSelected, 'days').format("YYYY-MM-DD"));

        }, 10);
        $(cruiseParentClass+" .c-main-wrap").hide();
    }
}

function fnGetCruiseEmbarkationDateArray(hotelCode, embarkation, nights) {

    var datesToEnableInCalander = [];   

    if (hotelCode != "" && embarkation != "" & nights != "") {
        var tempArray = jsonPhilaeZahra.filter(function (item) {
            return item.hotelCode.toLowerCase() == hotelCode.toLowerCase() && item.embarkation.toLowerCase() == embarkation.toLowerCase() && item.nights == nights;
        })[0];

        if (typeof tempArray != "undefined") {
            datesToEnableInCalander = tempArray.date;
        }
    }

    if (datesToEnableInCalander.length > 0) {
        return datesToEnableInCalander.sort();
    }
    else {
        return datesToEnableInCalander;
    }
}

function getCruiseSettingValueByKey(hotelCode, keyName) {
    var keyValue = "";

    for (var i = 0; i < cruiseCalendarSettings.length; i++) {
        if (cruiseCalendarSettings[i].hotelCode == hotelCode) {
            if (keyName == "startDate") {
                keyValue = cruiseCalendarSettings[i].settings.startDate;
            }
            else if (keyName == "endDate") {
                keyValue = cruiseCalendarSettings[i].settings.endDate;
            }
            else if (keyName == "selectDefaultEmbarkation") {
                keyValue = cruiseCalendarSettings[i].settings.selectDefaultEmbarkation;
            }
            else if (keyName == "selectDefaultNight") {
                keyValue = cruiseCalendarSettings[i].settings.selectDefaultNight;
            }
            break;
        }
    }

    return keyValue;
}

function fnInitializeCruiseCalander(_hotelcode) {

    /*Global Variables startdate, enddate, minnights,dateEnabled, dateDisabled, */

    var dateEnabled = [];
    var dateDisabled = [];

    if ($(cruiseParentClass+" .selectedEmbarkationDtls").css('display') == "none") {
        $(".checkInCheckOut").addClass("cruiseCalenderDefaultScreen cruiseSelected");
    }

    $(cruiseParentClass+".bkhOffset .checkInCheckOut").attr("onClick", "fnBwShowCruisePopupScreen()");
    $(cruiseParentClass+".bkhOffset .checkInDate").css("pointer-events", "none");
    $(cruiseParentClass+".layout2 .selectEmbarkationBox").show();

    var startdate = getCruiseSettingValueByKey(_hotelcode, "startDate");
    var enddate = getCruiseSettingValueByKey(_hotelcode, "endDate");

    var selectDefaultEmbarkation = getCruiseSettingValueByKey(_hotelcode, "selectDefaultEmbarkation");
    var selectDefaultNight = getCruiseSettingValueByKey(_hotelcode, "selectDefaultNight");

    /*get enable dates*/
    dateEnabled = fnGetCruiseEmbarkationDateArray(_hotelcode, selectDefaultEmbarkation, selectDefaultNight);
    var minnights = selectDefaultNight;

    /*get disabled dates*/
    dateDisabled = enumerateDateFromStartAndEndDate(startdate, enddate, dateEnabled);


    var hotelofferingid = _hotelcode + "-" + selectDefaultEmbarkation + "-" + minnights;

    /*get dates based on hotelofferingid*/
    var tempArray = fnBwCruiseCalendarSoldOutDates(hotelofferingid);

    tempCARRAY = tempArray;

    /*get current available date*/
    var closetdate = getClosetDate(dateEnabled, "YYYY-MM-DD");

    var initialDate = "";
    var tempAvailableDates = [];

    /*Check whether closetdate is sold out date or not. If not then get next available date*/
    var tempSoldOutDate = tempArray.filter(function (item) {
        if (moment(moment(item.date)).isSameOrAfter(closetdate, 'day') && item.restrictionType.toLowerCase() != "close") {
            tempAvailableDates.push(item.date);
        }
    });

    if (tempAvailableDates.length > 0) {
        initialDate = tempAvailableDates[0];
    }
    else {
        initialDate = closetdate;
    }

    if (closetdate != Infinity) {
        calNums = 2;
        var tdate = moment(initialDate, "YYYY-MM-DD").clone().add(minnights, 'days').format("YYYY-MM-DD");
        $(cruiseParentClass+" .t-datepicker").tDatePicker('setStartDate', initialDate);
        $(cruiseParentClass+" .t-datepicker").tDatePicker('setEndDate', enddate);
        //$(cruiseParentClass+" .t-datepicker").tDatePicker('updateCI', initialDate);
        //$(cruiseParentClass+" .t-datepicker").tDatePicker('updateCO', tdate);

        $(cruiseParentClass+" .t-datepicker").tDatePicker('updateCI', '');
        $(cruiseParentClass+" .t-datepicker").tDatePicker('updateCO', '');

        fnCreateCruiseCalenderStructure(_hotelcode);

        //  fnHighlightDateOnInitialize(selectDefaultEmbarkation, closetdate, minnights);
    }
}

function fnRemoveBlankColumns(yearToCheck) {

    $(cruiseParentClass+" .c-col-night-heading").show();

    var arrEmbarkations = ["luxor", "aswan"];
    for (var embarkationIndex = 0; embarkationIndex < arrEmbarkations.length; embarkationIndex++) {
        for (var maxDaesInCalander = 0; maxDaesInCalander < 4; maxDaesInCalander++) {
            var isDateExist = false;
            var columnHeaderClass = "";

            $(cruiseParentClass+" .row-" + yearToCheck + " .col-" + arrEmbarkations[embarkationIndex] + "-" + maxDaesInCalander).each(function () {
                if (typeof $(this).find(".c-date").html() != "undefined") {
                    isDateExist = true;
                }
            });

            if (!isDateExist) {

                $(cruiseParentClass+" .row-" + yearToCheck + " .col-" + arrEmbarkations[embarkationIndex] + "-" + maxDaesInCalander).each(function () {
                    if (typeof $(this).find(".c-date").html() == "undefined") {
                        $(this).hide();
                        columnHeaderClass = ".col-" + arrEmbarkations[embarkationIndex] + "-" + maxDaesInCalander;
                        $(cruiseParentClass+" .c-col-night-heading" + columnHeaderClass).hide();

                    }
                });
            }
        }

    }

}

function fnRemoveBlankColumnsFromTabs(yearToCheck) {

    $(".pageCruseDates .c-col-night-heading").show();

    var arrEmbarkations = ["luxor", "aswan"];
    for (var embarkationIndex = 0; embarkationIndex < arrEmbarkations.length; embarkationIndex++) {
        for (var maxDaesInCalander = 0; maxDaesInCalander < 4; maxDaesInCalander++) {
            var isDateExist = false;
            var columnHeaderClass = "";

            $(".pageCruseDates .row-" + yearToCheck + " .col-" + arrEmbarkations[embarkationIndex] + "-" + maxDaesInCalander).each(function () {
                if (typeof $(this).find(".c-date").html() != "undefined") {
                    isDateExist = true;
                }
            });

            if (!isDateExist) {

                $(".pageCruseDates .row-" + yearToCheck + " .col-" + arrEmbarkations[embarkationIndex] + "-" + maxDaesInCalander).each(function () {
                    if (typeof $(this).find(".c-date").html() == "undefined") {
                        $(this).hide();
                        columnHeaderClass = ".col-" + arrEmbarkations[embarkationIndex] + "-" + maxDaesInCalander;
                        $(".pageCruseDates .c-col-night-heading" + columnHeaderClass).hide();

                    }
                });
            }
        }

    }

}



function fnBwCruiseCalendarSoldOutDates(hotelofferingid) {
    var foundData = false;
    var tempArray = arrCalendarSoldOutDates.filter(function (item) {
        if (item.hotelofferingid.toLowerCase() == hotelofferingid.toLowerCase()) {
            foundData = true;
            return item;
        }
    })[0];

    if (foundData) {
        if (tempArray.dates.length > 0) {
            return tempArray.dates;
        }
    }
    else {
        return [];
    }
}

$(document).ready(function () {
    setTimeout(function () {
        $(" .dynamic-cruise-calendar-data .c-row.row-" + $(".c-current-year").html()).css("display", "flex");
    }, 100);
});








;
/*
fnBwSetupBookingWidget()
fnBwInitializaCalendar()
fnBwCheckInCalendarSetAvailabilityPriceMarketingAssetAndOthers()
fnBwCheckOutCalendarSetAvailabilityPriceMarketingAssetAndOthers()
why does the price span addition happen 3 points
should end date be max 365 days from today?
check if code change in fnEnableCODates is required
creates a lot of configuration data - fnSetBookingWidgetByOffer
showSpecificHotelsInBookingWidget - changes hotel dropdown list if arrHotelsToShowInDropdown is not blank
checkout fnsetdatepickerafterinitialization
checkout fnsetdefaultcodate -- handles default co date and vanyavilas like special cases for generic calendar


Increment checkout default Date more than 1 for some hotels on page load.
This is not minimum night stay requirement as user can book 1 night stay as well.
This is required as most of the user prefer 2, 3, 4 etc nights in some hotels.
Based on this frequency we change checkout Date on page load.

what is the use of -- cruiseCalenderDefaultScreen
call fnInitialiseCalanderAndConfigure() for phiale or zahra selection

code to enable 1 extra date in co when last date of ci is selected

error to be shown if user selects more nights then covered under teh offer and offer thus become invalid
fnBwDisplayInvalidNumberOfNightsSelectedMessage

for offers where showNightsDropDown is true also set min nights config variale while initializing the widget
shownights drop down change event
change global config parameter minnights value
fnBwSetCheckOutDate()
co date onchange event handler
on checkout change display invalid night selection message if shownightsdropdown variable is true
rpc for a single hotel / configuration can vary on basis of either number of nights or date of stay

hotel droddown change event handler
room droddown change event handler
add room button click event
remove room button click event
guests - edit button click event
guests - cross/cancel button click event
promo code  - OK button click event

view availability
  booking widget selection validation
  rate code slection code - fnBwCheckAndSetOfferRateCode()

what is the use of the folowing elements:
.offerMsgWrap - to display error message of booking widget
('.dateWrap .mobCheckInCheckOut').removeClass('active'); - underline under the checkin and checkout box of mobile view
('.booking-engine .t-mobile-heading').show(); -- additionl html section displayed aove boking widget in mobile
('.booking-engine .t-check-in-mobile').html($('.t-date-check-in').html()); -- additional html element to display checkin date
('.booking-engine .t-check-out-mobile').html($('.t-date-check-out').html()); -- additional html element to display checkout date


what is the use of the folowing variables:
isPromocodeClick = true;
isOpenBookingWidgetClicked = true;
isHotelDropdownChangeEvent = true;

*/



var glblBwLastClickedObj;
var glblBwErrorMessageMomentDateFormat = "Do MMMM, YYYY";
var glBlBwRoomOrGuestSelected = false;

var glblBwDisplayMA = true;
var glblBwDisplayPrices = true;

var glblBwArrDoNotUseSoldOutDatesForHotels = [];

var glblBwWinW = $(window).width();
var glblBwWinH = $(window).height();

var glblBwConfiguration;

var glblBwToday = new Date(new Date().toDateString());

var glblBwCalendarInitializedOnce = false;
var glblBwNumCalendar = 2;
var glblBwBlCalendarAutoClose = false;

var glblBwMobilDeviceMaxWidth = 979;
var glblBwIsMobile = false;
var glblBwIsPromocodeClick = false;

var glblBwPromoCodeValidationSettings = { "blShowMessage": false, "errorMesage": "" };

/*Tracking Booking Widget Tracking Codes*/
var glblBwTrackingHotelDropdown = 0;
var glblBwTrackingCalendarDropdown = 0;
var glblBwTrackingRoomDropdown = 0;
var glblBwTrackingGuestDropdown = 0;
var glblBwTrackingViewAvailablityClick = 0;
var glblBwTrackingPomoCodeDropdown = 0;


/*Check whether browser support startsWith if no then add this functionality to it*/
if (!String.prototype.startsWith) {
    String.prototype.startsWith = function (searchString, position) {
        position = position || 0;
        return this.substr(position, searchString.length) === searchString;
    };
}

function fnBwPreventDefaultEvent(e) {
    e.preventDefault();
};

function fnBwSetBodyScrolling(bool) {
    if (bool === true) {
        document.body.addEventListener("touchmove", fnBwPreventDefaultEvent, false);
    } else {
        document.body.removeEventListener("touchmove", fnBwPreventDefaultEvent, false);
    }
}

var glblBwIsHotelChangedOrPageLoadClicked = false;
function fnBwSetHotelSelectedByHotelCode(_hotelcode) {
    if (_hotelcode != "") {
        console.log("fnBwSetHotelSelectedByHotelCode called");
        glblBwIsHotelChangedOrPageLoadClicked = true;
        fnBwSetupBookingWidget(_hotelcode);
        // fnBwSetDefaultCheckoutDate();
        glblBwIsHotelChangedOrPageLoadClicked = false;


        $(glblBwLastClickedObj).find('.addRoomDropDown .block .roomSelectOption:eq(0)').click();

        if(_hotelcode == "HBCCUOB"){
            $(".booking-engine .offerMsgWrap").show();    
            $(".booking-engine .offerMsgWrap").html("The Oberoi Grand, Kolkata is closed for restoration from 15th August, 2024");
            $(".booking-engine .viewAvailabilityButton, .booking-engine .checkInCheckOut, .booking-engine .checkInCheckOut .datesWrap, .booking-engine .noOfRoomsWrap, .booking-engine .noOfGuestWrap, .booking-engine .plusIcon").css('pointer-events', 'none');
            }
            else{
                $(".booking-engine .viewAvailabilityButton, .booking-engine .checkInCheckOut, .booking-engine .checkInCheckOut .datesWrap, .booking-engine .noOfRoomsWrap, .booking-engine .noOfGuestWrap, .booking-engine .plusIcon").css('pointer-events', 'auto')
            }


    }
    else {
        fnBwSomeErrorOccredInBW();
    }
    /*add any additional function call here that makes changes to elements other than booking widget*/
}

/*Set default checkout date based on configuration.
 This is required based on users experience i.e Mostlly user books stay for 2 night, 3 nights and so on
 */
function fnBwSetDefaultCheckoutDate() {

    console.log(glblBwIsHotelChangedOrPageLoadClicked);
    if (typeof glblBwConfiguration.offer.defaultCheckinAndCheckoutDateDifferenece != "undefined" && glblBwIsHotelChangedOrPageLoadClicked) {
        if (glblBwConfiguration.offer.defaultCheckinAndCheckoutDateDifferenece >= glblBwConfiguration.offer.minNights) {
            setTimeout(function () {


                var checkInDate = moment(moment($('.booking-engine .t-datepicker').clone().tDatePicker('getDates')[0]).clone());
                $('.booking-engine .t-datepicker').tDatePicker('setStartDate', checkInDate.format("YYYY-MM-DD"));
                $('.booking-engine .t-datepicker').tDatePicker('setEndDate', glblBwConfiguration.offer.endDate);
                $('.booking-engine .t-datepicker').tDatePicker('updateCI', checkInDate.clone().format("YYYY-MM-DD"));
                $('.booking-engine .t-datepicker').tDatePicker('updateCO', checkInDate.clone().add(glblBwConfiguration.offer.defaultCheckinAndCheckoutDateDifferenece, 'days').format("YYYY-MM-DD"));

                //add to disabled dates basis on enabled dates list


            }, 10);

        }
    }
}


function fnBwInitializaCalendar() {

    if (glblBwConfiguration.offer.addDaysInCheckinDateFromToday > 0) {
        var _temoStartDate = moment(glblBwConfiguration.offer.startDate)._d;
        if (_temoStartDate <= glblBwToday) {
            glblBwConfiguration.offer.startDate = moment().clone().add(glblBwConfiguration.offer.addDaysInCheckinDateFromToday, "days").format("YYYY-MM-DD");
        }
    }

    var _startDate = moment(glblBwConfiguration.offer.startDate)._d;
    if (_startDate < glblBwToday)
        _startDate = glblBwToday;
    var _endDate = moment(glblBwConfiguration.offer.endDate)._d;
    //temp code 366
    //if (_endDate > moment(_startDate).add(366, "days")._d) {
    //    _endDate = moment(_startDate).add(366, "days")._d;
    //}
    var _dateCheckIn;
    var _dateCheckOut;


    if (_endDate < glblBwToday) {
        _dateCheckIn = null;
        _dateCheckOutMoment = null;
    }
    else {
        var _dateCheckInMoment = fnBwGetInitialCheckinDate();
        _dateCheckIn = _dateCheckInMoment._d;


        var _dateCheckOutMoment = _dateCheckInMoment.clone().add(glblBwConfiguration.offer.minNights, "days");
        _dateCheckOut = _dateCheckOutMoment._d;


        if (typeof glblBwConfiguration.offer.defaultCheckinAndCheckoutDateDifferenece != "undefined") {
            if (glblBwConfiguration.offer.defaultCheckinAndCheckoutDateDifferenece >= glblBwConfiguration.offer.minNights) {

                _dateCheckOut = _dateCheckInMoment.clone().add(glblBwConfiguration.offer.defaultCheckinAndCheckoutDateDifferenece, "days")._d;
            }

        }
    }


    var _dateDisabled = glblBwConfiguration.offer.disabledDates;



    $('.booking-engine .t-datepicker').each(function () {


        $(this).addClass("t-datepicker-autoclose-" + glblBwBlCalendarAutoClose);

        $(this).unbind();
        $(this).tDatePicker({
            autoClose: glblBwBlCalendarAutoClose,
            durationArrowTop: 200,
            numCalendar: glblBwNumCalendar,
            iconDate: '',
            iconArrowTop: false,
            startDate: _startDate,
            endDate: _endDate,
            dateCheckIn: _dateCheckIn,
            dateCheckOut: _dateCheckOut,
            dateDisabled: _dateDisabled,
            CheckInDateHeading: glblBookingWidgetCommonDictionaryArray.SelectCheckInDate,
            CheckOutDateHeading: glblBookingWidgetCommonDictionaryArray.SelectCheckOutDate
        });
    }).on('clickDateCI', function (e, dateCI) {
        var objTDatepicker = this;
        setTimeout(function () {
            fnBwCheckInIconClicked(objTDatepicker);
        }, 10);
    }).on('clickDateCO', function (e, dateCO) {
        var objTDatepicker = this;
        setTimeout(function () {
            fnBwCheckOutIconClicked(objTDatepicker);
        }, 10);
    }).on('selectedCI', function (e, changeDateCI) {
        var objTDatepicker = this;
        setTimeout(function () {
            fnBwCheckInDateChanged(objTDatepicker);
        }, 10);
    }).on('selectedCO', function (e, changeDateCI) {
        var objTDatepicker = this;
        setTimeout(function () {
            fnBwCheckOutDateChanged(objTDatepicker);

            // Safely fetch check-in and check-out values from hidden inputs
            var checkIn = $(objTDatepicker).find('.t-input-check-in').val();
            var checkOut = $(objTDatepicker).find('.t-input-check-out').val();

            if (!checkIn || !checkOut) return; // exit if any is missing

            var date1 = new Date(checkIn);
            var date2 = new Date(checkOut);
            var nights = Math.ceil((date2 - date1) / (1000 * 3600 * 24));

            // Check coupon code in URL
            var fr_href = location.href;

            if (nights > 3 && fr_href.match("one-of-us-programme")) {
                $('.offerMsgWrap')
                    .text("A maximum of 3 nights can be booked")
                    .show();
                $('.errorMsg.erroPromocode').hide();
                $('.errorMsg.erroPromocode').text('');
                $(".viewAvailabilityButton").css({
                    "pointer-events": "none",
                    "opacity": "0.5",
                    "cursor": "not-allowed"
                });
            }
            else if (nights <= 3 && fr_href.match("one-of-us-programme")) {
                const urlParams = new URLSearchParams(window.location.search);
                const myParam = urlParams.get('coupon_code')
                var promoCodeForGuest = myParam;
                $(".booking-engine .promocodeDropDown .promocode").val(promoCodeForGuest);
                UnmarkStatus();
            }

            else {
                $('.offerMsgWrap').hide();
                UnmarkStatus();
            }

        }, 10);
    });

    //fnBwSetDefaultCheckoutDate();
}

// this function use date change in label on mouse hover of calender date temp basic.
function fnBwHoveCheckInCheckOutDateChange() {

    $(".booking-engine .t-datepicker-day tbody tr td").hover(
        function () {
            //console.log('td date hover In');
            var date = moment(parseInt($(this).attr('data-t-date')));
            if (!$(this).hasClass('t-disabled')) {
                $(this).parents('.dateWrap').find('.t-dates span').eq(0).text(date.format('DD') + ' ');
                $(this).parents('.dateWrap').find('.t-dates span').eq(1).text(date.format('MMM') + ' ');
                $(this).parents('.dateWrap').find('.t-dates span').eq(2).text(date.format('YYYY') + ' ');
            }

        }, function () {

            var OrignalDate = moment($(this).closest('.dateWrap').find('input').attr('value'));
            //console.log('td date hover out');
            if (OrignalDate.format('DD') != 'Invalid date') {
                $(this).parents('.dateWrap').find('.t-dates span').eq(0).text(OrignalDate.format('DD') + ' ');
                $(this).parents('.dateWrap').find('.t-dates span').eq(1).text(OrignalDate.format('MMM') + ' ');
                $(this).parents('.dateWrap').find('.t-dates span').eq(2).text(OrignalDate.format('YYYY') + ' ');
            }
            else {
                $(this).parents('.dateWrap').find('.t-dates span').text(' ');
            }

        }
    );
    // in some case hover out is failed so we write below code.
    $(".t-datepicker-day tbody").mouseleave(function () {
        console.log('tbody over out....');
        var OrignalDate = moment($(this).closest('.dateWrap').find('input').attr('value'));
        if (OrignalDate.format('DD') != 'Invalid date') {
            $(this).parents('.dateWrap').find('.t-dates span').eq(0).text(OrignalDate.format('DD') + ' ');
            $(this).parents('.dateWrap').find('.t-dates span').eq(1).text(OrignalDate.format('MMM') + ' ');
            $(this).parents('.dateWrap').find('.t-dates span').eq(2).text(OrignalDate.format('YYYY') + ' ');

        }
        else {
            $(this).parents('.dateWrap').find('.t-dates span').text(' ');
        }

    });

}


function fnBwSomeErrorOccredInBW(errMessage) {
    if (errMessage != "") {
        // alert(errMessage);
        console.log("errMessage " + errMessage);
    }
    else {
        alert("some problem with booking widget, admin has been informed.");
    }
    /*send email to admin with configuration and other details*/
}

function fnBwShowMobileElementsOfBookingCalendar(objTDatepicker) {
    if (glblBwIsMobile) {
        var objBE = $(objTDatepicker).closest('.booking-engine');
        $(objBE).find('.t-mobile-heading').show();
        $(objBE).find('.t-check-in-mobile').html($(objBE).find('.t-date-check-in').html());
        $(objBE).find('.t-check-out-mobile').html($(objBE).find('.t-date-check-out').html());
    }
}

//#region BW elements - event handler code
function fnBwOpenBookingEngine() {
    if ($(window).width() <= 767) {
        fnBwSetBodyScrolling(true);
    }
    $(".booking-engine").toggle();
}

function fnBwCloseBookingEngine() {
    if ($(window).width() <= 767) {
        fnBwSetBodyScrolling(false);
    }
    $(".booking-engine").toggle();
}

function fnBwCloseAllDropDowns() {
    //remove active class from dropdown triggers
    $('.booking-engine .triggerDropDown').removeClass('active');
    //hide dropdowns
    $('.booking-engine .dropDown').hide();
    //hide mobile specific heading
    $('.booking-engine .t-mobile-heading').hide();

    //hide calendar
    //the following code restores original checkout date so instead we need to call $('body').click()
    //$('.booking-engine .t-datepicker').tDatePicker('hide');
    $('body').click();
}

function fnBwAllDropDownOnClick(objThis) {
    //what is the use of this
    $(".booking-engine .c-main-wrap").hide();
    //why is the following added
    //$(objThis).next('.dropDown').toggle(); // added by prince  

    console.log(objThis);
    if ($(objThis).hasClass('active')) {
        //if open
        //close it by using toggle
        fnBwCloseAllDropDowns();


    } else {
        //if closed
        //close all
        fnBwCloseAllDropDowns();
        $(objThis).addClass('active');

        if ($(objThis).next('.dropDown').hasClass('slideDown')) {
            $(objThis).next('.dropDown').slideToggle();
        } else {
            $(objThis).next('.dropDown').toggle();
        }
        //open it by using toggle
    }
    //toggle

   
    /*For click Tracking*/
    if ($(objThis).hasClass("hotelLabel")) {
        fnBwHotelDropdownClick($(objThis));
    }
    else if ($(objThis).hasClass("addRoomLabel")) {
        fnBwAddRoomClick(objThis);
    }
    else if ($(objThis).hasClass("addGuestLabel")) {
        fnBwGuestDropdownClick(objThis);
    }
    else if ($(objThis).hasClass("plusIcon")) {
        fnBwPromoCodeDropdownClick(objThis);
    }
    /*For click Tracking end*/

}

function fnBwHotelDropDownOnChange(objThis) {
    var _hotelCode = $(objThis).attr('data-hotelcode');
    fnBwSetHotelSelectedByHotelCode(_hotelCode);
    fnBwCloseAllDropDowns();
}


function fnBwRoomDropDownOnChange(objThis) {
    var objBE = $(objThis).closest('.booking-engine');
    var _currIndex = $(objThis).index();

    var _currRoomCount = _currIndex + 1;
    $('.booking-engine .addRoomDropDown .block .roomSelectOption').removeClass('active');

    /*Set Dropdown active based on selection*/
    fnBwRoomDropDownAddClassActive(_currIndex);

    $('.booking-engine .noOfRoomsWrap .addRoomLabel .roomsCount .value').html(('0' + _currRoomCount).slice(-2));

    if (_currRoomCount == 1) {
        $('.booking-engine .noOfRoomsWrap .addRoomLabel .roomsCount .lbl').html(glblBookingWidgetCommonDictionaryArray.Room + ' &nbsp;');
    } else {
        $('.booking-engine .noOfRoomsWrap .addRoomLabel .roomsCount .lbl').html(glblBookingWidgetCommonDictionaryArray.Rooms);
    }
    if (_currRoomCount == 3) {
        $('.booking-engine .noOfGuestWrap .addGuestDropDown .actionWrap .addRoomButton').hide();
    }
    $('.booking-engine .dropDown').hide();
    $('.booking-engine .triggerDropDown').removeClass('active');

    var _currBlockGuest = $(objBE).find('.addGuestDropDown .blockWrapper .block').length;
    if (_currRoomCount > _currBlockGuest) {
        var a = _currBlockGuest + 1;
        for (i = a; i <= _currRoomCount; i++) {
            var newGuestBlock = '<div class="block">' +
                '<div class="editBlock"><div class="edit">' + glblBookingWidgetCommonDictionaryArray.Edit + '</div><div class="closeIcn">x</div></div>' +
                '<div class="roomsIndividualCount"> ' + glblBookingWidgetCommonDictionaryArray.Room + i + '</div>' +
                '<div class="roomGuestCount roomGuestCountSummery">2 ' + glblBookingWidgetCommonDictionaryArray.Adults + ' <span class="roomChild">, 0 ' + glblBookingWidgetCommonDictionaryArray.Children + ' </span></div>' +
                '<div class="roomGuestCount" style="display:none;">' +
                '<div class="choose adult">' +
                '<div class="label">' + glblBookingWidgetCommonDictionaryArray.Adult + '</div>' +
                '<div class="number">' +
                '<ul>' +
                '<li>1</li>' +
                '<li class="active">2</li>' +
                '<li class="extraAdult">3</li>' +
                '<li class="extraAdult">4</li>' +
                '<li class="extraAdult1">5</li>' +
                '<li class="extraAdult1">6</li>' +
                '</ul>' +
                '</div>' +
                '</div>' +
                '<div class="choose child">' +
                '<div class="label">' + glblBookingWidgetCommonDictionaryArray.Children + '</div>' +
                '<div class="number">' +
                '<ul>' +
                '<li>1</li>' +
                '<li>2</li>' +    
                '<li class="extraChild">3</li>' +
                '</ul>' +
                '</div>' +
                '<div class="closeIcn">x</div>' +
                '</div>' +
                '<div class="childAgeWrap childAge1">' +
                '<div class="label">' + glblBookingWidgetCommonDictionaryArray.AgeOfChild + ' 1</div>' +
                '<div class="ageList">' +
                '<ul>' +
                '<li>1</li>' +
                '<li>2</li>' +
                '<li>3</li>' +
                '<li>4</li>' +
                '<li>5</li>' +
                '<li>6</li>' +
                '<li>7</li>' +
                '<li>8</li>' +
                '<li>9</li>' +
                '<li>10</li>' +
                '<li>11</li>' +
                '<li>12</li>' +
                '</ul>' +
                '</div>' +
                '</div>' +
                '<div class="childAgeWrap childAge2">' +
                '<div class="label">' + glblBookingWidgetCommonDictionaryArray.AgeOfChild + ' 2</div>' +
                '<div class="ageList">' +
                '<ul>' +
                '<li>1</li>' +
                '<li>2</li>' +
                '<li>3</li>' +
                '<li>4</li>' +
                '<li>5</li>' +
                '<li>6</li>' +
                '<li>7</li>' +
                '<li>8</li>' +
                '<li>9</li>' +
                '<li>10</li>' +
                '<li>11</li>' +
                '<li>12</li>' +
                '</ul>' +
                '</div>' +
                '</div>' +
                '<div class="childAgeWrap childAge3">' +
                '<div class="label">Age of child 3</div>' +
                '<div class="ageList">' +
                '<ul>' +
                '<li>1</li>' +
                '<li>2</li>' +
                '<li>3</li>' +
                '<li>4</li>' +
                '<li>5</li>' +
                '<li>6</li>' +
                '<li>7</li>' +
                '<li>8</li>' +
                '<li>9</li>' +
                '<li>10</li>' +
                '<li>11</li>' +
                '<li>12</li>' +
                '</ul>' +
                '</div>' +
                '</div>' +
                '</div>';
            $('.booking-engine .addGuestDropDown .blockWrapper').append(newGuestBlock);
        }
    } else {
        var a = _currRoomCount + 1;
        for (i = _currBlockGuest; i > _currRoomCount; i--) {
            $('.booking-engine .addGuestDropDown .blockWrapper .block:last-child').remove();
            //show add button if room count is less than 4
            $('.booking-engine .addGuestDropDown .actionWrap .addRoomButton').show();
        }
    }

    if ($('.booking-engine .DropDownExtraGuest').length > 0) {
        $(".extraAdult,.extraChild").show();
    }
    else {
        $(".extraAdult,.extraChild").hide();
        $(".extraAdult1").hide();
    }

    fnBwCalculateNumberOfGuest(objBE);

}

function fnBwGuestDropDownConfirmButtonOnClick(objThis) {
    console.log("guest drop down - confirm button - on click");
    var objBE = $(objThis).closest('.booking-engine');
    fnBwCreateGuestCountOfActiveBlock(objBE);
    fnBwCalculateNumberOfGuest(objBE);
    $(objBE).find('.noOfGuestWrap .addGuestLabel').removeClass('active');
    $(objBE).find('.noOfGuestWrap .addGuestDropDown').hide();
    $(objBE).find('.editBlock .edit').show();

    //fnBwSyncHtml();

}
var testObe = "";
function fnBwGuestDropDownAddRoomButtonOnClick(objThis) {
    var objBE = $(objThis).closest('.booking-engine');
    testObe = objBE;
    //create guest count of active block
    fnBwCreateGuestCountOfActiveBlock(objBE);
    //add new block of hotel room with guest count
    var _currRoomCount = $(objBE).find('.addGuestDropDown .blockWrapper .block').length;

    console.log("_currRoomCount=" + _currRoomCount);
    if (_currRoomCount < 3) {
        var newGuestBlock = '<div class="block individualRoomSection active">' +
            '<div class="roomsIndividualCount">' + glblBookingWidgetCommonDictionaryArray.Room + ' ' + parseInt(_currRoomCount + 1) + '</div>' +
            '<div class="roomGuestCount">' +
            '<div class="choose adult">' +
            '<div class="label">' + glblBookingWidgetCommonDictionaryArray.Adult + '</div>' +
            '<div class="number">' +
            '<ul>' +
            '<li>1</li>' +
            '<li class="active">2</li>' +
            '<li class="extraAdult">3</li>' +
            '<li class="extraAdult">4</li>' +
            '<li class="extraAdult1">5</li>' +
            '<li class="extraAdult1">6</li>' +
            '</ul>' +
            '</div>' +
            '</div>' +
            '<div class="choose child">' +
            '<div class="label">' + glblBookingWidgetCommonDictionaryArray.Children + '</div>' +
            '<div class="number">' +
            '<ul>' +
            '<li>1</li>' +
            '<li>2</li>' +
            '<li class="extraChild">3</li>' +
            '</ul>' +
            '</div>' +
            '<div class="closeIcn">x</div>' +
            '</div>' +
            '<div class="childAgeWrap childAge1">' +
            '<div class="label">' + glblBookingWidgetCommonDictionaryArray.AgeOfChild + ' 1</div>' +
            '<div class="ageList">' +
            '<ul>' +
            '<li>1</li>' +
            '<li>2</li>' +
            '<li>3</li>' +
            '<li>4</li>' +
            '<li>5</li>' +
            '<li>6</li>' +
            '<li>7</li>' +
            '<li>8</li>' +
            '<li>9</li>' +
            '<li>10</li>' +
            '<li>11</li>' +
            '<li>12</li>' +
            '</ul>' +
            '</div>' +
            '</div>' +
            '<div class="childAgeWrap childAge2">' +
            '<div class="label">' + glblBookingWidgetCommonDictionaryArray.AgeOfChild + ' 2</div>' +
            '<div class="ageList">' +
            '<ul>' +
            '<li>1</li>' +
            '<li>2</li>' +
            '<li>3</li>' +
            '<li>4</li>' +
            '<li>5</li>' +
            '<li>6</li>' +
            '<li>7</li>' +
            '<li>8</li>' +
            '<li>9</li>' +
            '<li>10</li>' +
            '<li>11</li>' +
            '<li>12</li>' +
            '</ul>' +
            '</div>' +
            '</div>' +
            '<div class="childAgeWrap childAge3">' +
            '<div class="label">Age of child 3</div>' +
            '<div class="ageList">' +
            '<ul>' +
            '<li>1</li>' +
            '<li>2</li>' +
            '<li>3</li>' +
            '<li>4</li>' +
            '<li>5</li>' +
            '<li>6</li>' +
            '<li>7</li>' +
            '<li>8</li>' +
            '<li>9</li>' +
            '<li>10</li>' +
            '<li>11</li>' +
            '<li>12</li>' +
            '</ul>' +
            '</div>' +
            '</div>' +
            '</div>';
        $(newGuestBlock).insertAfter('.booking-engine .blockWrapper .block:last-child');
        //add rooms in rooms dropdown
        var _currUpdateRoomCount = _currRoomCount + 1;
        var _roomCountWithZero = ('0' + _currUpdateRoomCount).slice(-2);
        $('.booking-engine .noOfRoomsWrap .addRoomLabel .roomsCount .value').html(_roomCountWithZero);
        $('.booking-engine .mobile .counter').html(_roomCountWithZero);
        $('.booking-engine .addRoomDropDown .block .roomSelectOption').removeClass('active');
        $('.booking-engine .addRoomDropDown .block .roomSelectOption:eq(' + _currRoomCount + ')').addClass('active');
        if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDXBAZ") {
            $('.roomGuestCount').addClass('alzorah-guests');
        }
        else {
            $('.roomGuestCount').removeClass('alzorah-guests');
        }
    }
    if (_currRoomCount >= 2) {
        $('.booking-engine .addGuestDropDown .actionWrap .addRoomButton').hide();
    }
    $('.booking-engine .editBlock .edit').show();


    fnBwSetDefaultAdult();

    fnBwCalculateNumberOfGuest(objBE);

    fnBwRoomDropDownAddClassActive(_currRoomCount);


    if ($('.booking-engine .DropDownExtraGuest').length > 0) {
        $(".extraAdult,.extraChild").show();
    }
    else {
        $(".extraAdult,.extraChild").hide();
        $(".extraAdult1").hide();
    }
}

function fnBwRoomDropDownAddClassActive(index) {
    $('.booking-engine').each(function (i) {
        $('.booking-engine:eq(' + i + ') .addRoomDropDown .block .roomSelectOption:eq(' + index + ')').addClass('active');
    });
}

function fnBwCreateGuestCountOfActiveBlock(objBE) {

    console.log("fnBwCreateGuestCountOfActiveBlock" + objBE);

    var adultCount = $(objBE).find('.block.active').find('.choose.adult li.active').index();
    var childCount = $(objBE).find('.block.active').find('.choose.child li.active').index();
    var adultTxt = glblBookingWidgetCommonDictionaryArray.Adult;
    var childTxt = glblBookingWidgetCommonDictionaryArray.Children;
    var _currBlockCount = $(objBE).find('.blockWrapper .block.active').index();
    if (adultCount > 0) {
        adultTxt = glblBookingWidgetCommonDictionaryArray.Adults;
    }
    if (childCount > 0) {
        childTxt = glblBookingWidgetCommonDictionaryArray.Children;
    }
    $(objBE).find('.addGuestDropDown .block.active').find('.roomGuestCount').hide();
    $('<div class="roomGuestCount roomGuestCountSummery">' + (parseInt(adultCount) + 1) + ' ' + adultTxt + '<span class="roomChild"> ,' + (parseInt(childCount) + 1) + ' ' + childTxt + '</span></div>').insertAfter($(objBE).find('.addGuestDropDown .block.active').find('.roomsIndividualCount'));
    if ($(objBE).find('.block.active .edit').length) {
        $(objBE).find('.block .editBlock').show();
    } else {
        $(objBE).find('.block.active').prepend('<div class="editBlock"><div class="edit">' + glblBookingWidgetCommonDictionaryArray.Edit + '</div><div class="closeIcn">x</div></div>');
    }
    $(objBE).find('.block').removeClass('active');
    $(objBE).find('.block .editBlock').show();
}
function fnBwCalculateNumberOfGuest(objBE) {

    if (typeof glblBwConfiguration != "undefined") {
        if (typeof glblBwConfiguration.offer != "undefined") {
            fnBwHideChildrenBasedOnConfiguration(glblBwConfiguration.offer.hideChildrenSelectionBox);
        }
    }

    var _totalGuestCount = 0;
    $(objBE).find('.blockWrapper .block').each(function (i) {
        if ($(this).hasClass('active')) {
            var adultCount = $(objBE).find('.block.active').find('.choose.adult li.active').index();
            var childCount = $(objBE).find('.block.active').find('.choose.child li.active').index();
            _totalGuestCount += (adultCount + 1) + (childCount + 1);
        } else {
            var numberPattern = /\d+/g;
            var noOfGuest = $(this).find('.roomGuestCount').html().match(numberPattern);
            var offset = "";
            offset = parseInt(noOfGuest[0]) + parseInt(noOfGuest[1]);
            _totalGuestCount += offset;
        }
    });
    var _guestCountWithZero = ('0' + _totalGuestCount).slice(-2);
    $(objBE).find('.noOfGuestWrap .addGuestLabel .guestCount .value').html(_guestCountWithZero);

    fnBwSyncHtml(objBE);

    fnBwBindClickEventsOnDynamicElementsOfGuestDetailsSection();
}


function fnBwPromoCodeShowMessageFlag(_promocode) {

    glblBwPromoCodeValidationSettings["blShowMessage"] = false;
    glblBwPromoCodeValidationSettings["errorMesage"] = "";

    glblBwCheckincheckoutdatedifference = parseInt(getDateDifference(glblBwCheckindate.split(";")[0], glblBwCheckoutdate.split(";")[0], "YYYY-MM-DD"));
    var fr_href = location.href;
    var finalname = fr_href.match(/([^\/]*)\/*$/)[1];
    if (!fr_href.match("one-of-us-programme")) {

        if (glblBwIsPromocodeClick) {
            console.log(1);
            if (_promocode == "") {
                glblBwPromoCodeValidationSettings["errorMesage"] = "Please enter promocode";
                glblBwPromoCodeValidationSettings["blShowMessage"] = true;
            }
            else if (_promocode != "" && fnBwGetRpcByPromoCode() == "") {
                glblBwPromoCodeValidationSettings["errorMesage"] = "Promocode is invalid or not eligible";
                glblBwPromoCodeValidationSettings["blShowMessage"] = true;
            }
        }
        else {
            console.log(2 + "--" + _promocode + "--" + fnBwGetRpcByPromoCode());
            if (_promocode != "" && fnBwGetRpcByPromoCode() == "") {
                glblBwPromoCodeValidationSettings["errorMesage"] = "Promocode is invalid or not eligible";
                glblBwPromoCodeValidationSettings["blShowMessage"] = true;
            }
        }
    }
    return glblBwPromoCodeValidationSettings["blShowMessage"];
}


var glblBwCurrIndex = 0;
var glblBwErrorMessage = "";
var glblBwErrorField = "";
var glblBwUrlwithparameters = "";
var glblBwResconsoleurl = "";
var glblBwHotelcode = "";
var glblBwCheckindate = "";
var glblBwCheckoutdate = "";
var glblBwAdult = "";
var glblBwChild = 0;
var glblBwChildage = "";
var glblBwPromocode = "";
var glblBwRooms = 1;

var glblBwRoom1allchildage = "";
var glblBwRoom2allchildage = "";
var glblBwRoom3allchildage = "";

var glblBwRoom1child1age = "";
var glblBwRoom1child2age = "";

var glblBwRoom2child1age = "";
var glblBwRoom2child2age = "";

var glblBwRoom3child1age = "";
var glblBwRoom3child2age = "";
var glblBwRateaccesscode = "";
var glblBwMinnights = 1;
var glblBwPlaceofembarkation = "";
var glblBwCheckincheckoutdatedifference = 1;

function fnBwViewAvailabilityButtonOnClick(objThis) {

    console.log("fnBwViewAvailabilityButtonOnClick clicked");

    //set error messages such as no room
    if (typeof glblBwConfiguration != "undefined" && typeof glblBwConfiguration.ErrorMessage == "undefined") {
        fnBwSetGlobalErrorMessage();
    }

    isOpenBookingWidgetClicked = true;
    var objBE = $(objThis).closest('.booking-engine');
    glblBwHotelcode = $(objBE).find('.allHotels').find('li.active').attr('data-hotelcode');
    glblBwHotelcode = glblBwHotelcode != undefined ? glblBwHotelcode : "";

    glblBwCheckindate = $(objBE).find('.t-input-check-in').val();
    glblBwCheckoutdate = $(objBE).find('.t-input-check-out').val();
    glblBwRooms = parseInt($(objBE).find('.blockWrapper .block').length);
    glblBwPromocode = $(objBE).find('.promocode').val();
    $(objBE).find('.promocodeDropDown').hide();
    $(objBE).find('.erroPromocode').hide();
    $(objBE).find('.offerMsgWrap').html("");
    $(objBE).find('.offerMsgWrap').hide();

    var isWidgetHave3ChildAgeSelection = false;
    if ($('.booking-engine .DropDownExtraGuest').length > 0) {
        isWidgetHave3ChildAgeSelection = true;
    }

    if (glblBwRooms == 1) {

        if (fnBwGetAdultAndChild(objBE, 1)[1] == 0) {
            glblBwRoom1allchildage = 0;
        } else if (fnBwGetAdultAndChild(objBE, 1)[1] == 1) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2];
        } else if (fnBwGetAdultAndChild(objBE, 1)[1] == 2) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2] + "-" + fnBwGetAdultAndChild(objBE, 1)[3];
        }

        if (isWidgetHave3ChildAgeSelection) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2] + "-" + fnBwGetAdultAndChild(objBE, 1)[3] + "-" + fnBwGetAdultAndChild(objBE, 1)[4];
        }

        glblBwAdult = fnBwGetAdultAndChild(objBE, 1)[0];
        glblBwChild = fnBwGetAdultAndChild(objBE, 1)[1];
        glblBwChildage = glblBwRoom1allchildage;
    }
    //If user selects 2 room
    else if (glblBwRooms == 2) {

        glblBwHotelcode = glblBwHotelcode + ";" + glblBwHotelcode;
        glblBwCheckindate = glblBwCheckindate + ";" + glblBwCheckindate;
        glblBwCheckoutdate = glblBwCheckoutdate + ";" + glblBwCheckoutdate;
        glblBwAdult = fnBwGetAdultAndChild(objBE, 1)[0] + ";" + fnBwGetAdultAndChild(objBE, 2)[0];
        glblBwChild = fnBwGetAdultAndChild(objBE, 1)[1] + ";" + fnBwGetAdultAndChild(objBE, 2)[1];

        if (fnBwGetAdultAndChild(objBE, 1)[1] == 0) {
            glblBwRoom1allchildage = 0;
        } else if (fnBwGetAdultAndChild(objBE, 1)[1] == 1) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2];
        } else if (fnBwGetAdultAndChild(objBE, 1)[1] == 2) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2] + "-" + fnBwGetAdultAndChild(objBE, 1)[3];
        }

        if (isWidgetHave3ChildAgeSelection) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2] + "-" + fnBwGetAdultAndChild(objBE, 1)[3] + "-" + fnBwGetAdultAndChild(objBE, 1)[4];
        }

        if (fnBwGetAdultAndChild(objBE, 2)[1] == 0) {
            glblBwRoom2allchildage = 0;
        } else if (fnBwGetAdultAndChild(objBE, 2)[1] == 1) {
            glblBwRoom2allchildage = fnBwGetAdultAndChild(objBE, 1)[2];
        } else if (fnBwGetAdultAndChild(objBE, 2)[1] == 2) {
            glblBwRoom2allchildage = fnBwGetAdultAndChild(objBE, 2)[2] + "-" + fnBwGetAdultAndChild(objBE, 2)[3];
        }

        if (isWidgetHave3ChildAgeSelection) {
            glblBwRoom2allchildage = fnBwGetAdultAndChild(objBE, 2)[2] + "-" + fnBwGetAdultAndChild(objBE, 2)[3] + "-" + fnBwGetAdultAndChild(objBE, 2)[4];
        }

        glblBwChildage = glblBwRoom1allchildage + ";" + glblBwRoom2allchildage;
    }
    //If user selects 3 room.
    else if (glblBwRooms == 3) {

        glblBwHotelcode = glblBwHotelcode + ";" + glblBwHotelcode + ";" + glblBwHotelcode;
        glblBwCheckindate = glblBwCheckindate + ";" + glblBwCheckindate + ";" + glblBwCheckindate;
        glblBwCheckoutdate = glblBwCheckoutdate + ";" + glblBwCheckoutdate + ";" + glblBwCheckoutdate;
        glblBwAdult = fnBwGetAdultAndChild(objBE, 1)[0] + ";" + fnBwGetAdultAndChild(objBE, 2)[0] + ";" + fnBwGetAdultAndChild(objBE, 3)[0];
        glblBwChild = fnBwGetAdultAndChild(objBE, 1)[1] + ";" + fnBwGetAdultAndChild(objBE, 2)[1] + ";" + fnBwGetAdultAndChild(objBE, 3)[1];

        if (fnBwGetAdultAndChild(objBE, 1)[1] == 0) {
            glblBwRoom1allchildage = 0;
        } else if (fnBwGetAdultAndChild(objBE, 1)[1] == 1) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2];
        } else if (fnBwGetAdultAndChild(objBE, 1)[1] == 2) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2] + "-" + fnBwGetAdultAndChild(objBE, 1)[3];
        }

        if (isWidgetHave3ChildAgeSelection) {
            glblBwRoom1allchildage = fnBwGetAdultAndChild(objBE, 1)[2] + "-" + fnBwGetAdultAndChild(objBE, 1)[3] + "-" + fnBwGetAdultAndChild(objBE, 1)[4];
        }

        if (fnBwGetAdultAndChild(objBE, 2)[1] == 0) {
            glblBwRoom2allchildage = 0;
        } else if (fnBwGetAdultAndChild(objBE, 2)[1] == 1) {
            glblBwRoom2allchildage = fnBwGetAdultAndChild(objBE, 1)[2];
        } else if (fnBwGetAdultAndChild(objBE, 2)[1] == 2) {
            glblBwRoom2allchildage = fnBwGetAdultAndChild(objBE, 2)[2] + "-" + fnBwGetAdultAndChild(objBE, 2)[3];
        }

        if (isWidgetHave3ChildAgeSelection) {
            glblBwRoom2allchildage = fnBwGetAdultAndChild(objBE, 2)[2] + "-" + fnBwGetAdultAndChild(objBE, 2)[3] + "-" + fnBwGetAdultAndChild(objBE, 2)[4];
        }

        if (fnBwGetAdultAndChild(objBE, 3)[1] == 0) {
            glblBwRoom3allchildage = 0;
        } else if (fnBwGetAdultAndChild(objBE, 3)[1] == 1) {
            glblBwRoom3allchildage = fnBwGetAdultAndChild(objBE, 1)[2];
        } else if (fnBwGetAdultAndChild(objBE, 3)[1] == 2) {
            glblBwRoom3allchildage = fnBwGetAdultAndChild(objBE, 3)[2] + "-" + fnBwGetAdultAndChild(objBE, 3)[3];
        }
        if (isWidgetHave3ChildAgeSelection) {
            glblBwRoom3allchildage = fnBwGetAdultAndChild(objBE, 3)[2] + "-" + fnBwGetAdultAndChild(objBE, 3)[3] + "-" + fnBwGetAdultAndChild(objBE, 3)[4];
        }

        glblBwChildage = glblBwRoom1allchildage + ";" + glblBwRoom2allchildage + ";" + glblBwRoom3allchildage;
    }

    var finalUrlWithParameters = "";


    if (fnBwBoolIsReservationValid()) {

        if (fnBwPromoCodeShowMessageFlag(glblBwPromocode)) {
            fnBwShowPromoError(glblBwPromoCodeValidationSettings["errorMesage"]);
        }
        else {
            if (!glblBwIsPromocodeClick) {
                glblBwCheckincheckoutdatedifference = parseInt(getDateDifference(glblBwCheckindate.split(";")[0], glblBwCheckoutdate.split(";")[0], "YYYY-MM-DD"));
                glblBwRateaccesscode = fnBwGetRpc();

                var rpcAgainstRateCode = fnBwGetRpcByPromoCode();
                if (rpcAgainstRateCode != "") {
                    glblBwRateaccesscode = rpcAgainstRateCode;
                }

                try {

                    if (document.location.hostname != "ohrnewsite.iabeta.in") {

                        /*Save Booking Query*/
                        var formData = [];

                        formData.push({ name: "checkin", value: glblBwCheckindate.split(";")[0] });
                        formData.push({ name: "checkout", value: glblBwCheckoutdate.split(";")[0] });
                        formData.push({ name: "hotelcode", value: glblBwHotelcode.split(";")[0] });
                        formData.push({ name: "persons", value: fnBwGetAdultAndChild(objBE, 1)[0] + fnBwGetAdultAndChild(objBE, 2)[0] + fnBwGetAdultAndChild(objBE, 3)[0] });
                        formData.push({ name: "rooms", value: glblBwRooms });
                        formData.push({ name: "room1aduts", value: fnBwGetAdultAndChild(objBE, 1)[0] });
                        formData.push({ name: "room1children", value: fnBwGetAdultAndChild(objBE, 1)[1] });
                        formData.push({ name: "room2aduts", value: fnBwGetAdultAndChild(objBE, 2)[0] });
                        formData.push({ name: "room2children", value: fnBwGetAdultAndChild(objBE, 2)[1] });
                        formData.push({ name: "room3aduts", value: fnBwGetAdultAndChild(objBE, 3)[0] });
                        formData.push({ name: "room3children", value: fnBwGetAdultAndChild(objBE, 3)[1] });
                        formData.push({ name: "rateaccesscode", value: glblBwRateaccesscode });
                        formData.push({ name: "currentpageurl", value: document.URL });
                        formData.push({ name: "referer", value: document.referrer });
                        formData.push({ name: "room1child1age", value: fnBwGetAdultAndChild(objBE, 1)[2] });
                        formData.push({ name: "room1child2age", value: fnBwGetAdultAndChild(objBE, 1)[3] });
                        formData.push({ name: "room2child1age", value: fnBwGetAdultAndChild(objBE, 2)[2] });
                        formData.push({ name: "room2child2age", value: fnBwGetAdultAndChild(objBE, 2)[3] });
                        formData.push({ name: "room3child1age", value: fnBwGetAdultAndChild(objBE, 3)[2] });
                        formData.push({ name: "room3child2age", value: fnBwGetAdultAndChild(objBE, 3)[3] });
                        formData.push({ name: "promocode", value: glblBwPromocode });

                        $.ajax({
                            url: "/handlers/booking-console-data.ashx",
                            data: formData,
                            dataType: "jsonp",
                            type: "POST",
                            async: false,
                            success: function (result) {

                            },
                            error: function (err) {
                            }
                        });
                    }
                }
                catch (Exx) {
                    console.log("Error booking-console-data.ashx");
                }



                var objReservation = new bwMakeReservation();
                objReservation.resconsoleurl = glblBwResconsoleurl;
                objReservation.hotelcode = glblBwHotelcode;
                objReservation.checkindate = glblBwCheckindate;
                objReservation.checkoutdate = glblBwCheckoutdate;
                objReservation.adult = glblBwAdult;
                objReservation.child = glblBwChild;
                objReservation.childage = glblBwChildage;
                objReservation.promocode = glblBwPromocode;

                objReservation.rooms = glblBwRooms;
                objReservation.room1allchildage = glblBwRoom1allchildage;
                objReservation.room2allchildage = glblBwRoom2allchildage;
                objReservation.room3allchildage = glblBwRoom3allchildage;

                objReservation.room1child1age = glblBwRoom1child1age;
                objReservation.room1child2age = glblBwRoom1child2age;

                objReservation.room2child1age = glblBwRoom2child1age;
                objReservation.room2child2age = glblBwRoom2child2age;

                objReservation.room3child1age = glblBwRoom3child1age;
                objReservation.room3child2age = glblBwRoom3child2age;
                objReservation.rateaccesscode = glblBwRateaccesscode;

                objReservation.minnights = glblBwMinnights;

                objReservation.booknow();
            }
        }
    }
    else {
        console.log("error block");
        $(objBE).find('.offerMsgWrap').html(glblBwErrorMessage);
        $(objBE).find('.offerMsgWrap').show();
    }
}

function fnBwShowPromoError(message) {

    $(glblBwLastClickedObj).find('.promocodeDropDown ').hide();
    $('.erroPromocode').hide();
    $(".erroPromocode").html("");
    $(glblBwLastClickedObj).find('.plusIcon').removeClass("active");
    $(".erroPromocode").html(message);
    $(glblBwLastClickedObj).find('.plusIcon').addClass("active");
    $(glblBwLastClickedObj).find('.promocodeDropDown').show();
    $(glblBwLastClickedObj).find('.erroPromocode').show();
}


function fnBwBoolIsReservationValid() {

    glblBwErrorMessage = "";
    var datedifference = getDateDifference(moment(glblBwCheckindate).format("YYYY-MM-DD"), moment(glblBwCheckoutdate).format("YYYY-MM-DD"), "YYYY-MM-DD");
    var _hotelcode = glblBwHotelcode.split(';');

    if (_hotelcode == "" || _hotelcode == "null") {
        glblBwErrorMessage = "Please select hotel.";
        return false;
    }
    else if (glblBwCheckindate == "" || glblBwCheckindate.indexOf("null") == 0) {
        glblBwErrorMessage = "Please select check-in Date.";
        return false;
    }
    else if (glblBwCheckoutdate == "" || glblBwCheckoutdate.indexOf("null") == 0) {
        glblBwErrorMessage = "Please select check-out Date.";
        return false;
    }
    else if (typeof glblBwConfiguration.ErrorMessage != "undefined" && glblBwConfiguration.ErrorMessage != "") {
        glblBwErrorMessage = glblBwConfiguration.ErrorMessage;
        return false;
    }

    return true;
}

function bwMakeReservation() {
    this.resconsoleurl = "";
    this.hotelcode = "";
    this.checkindate = "";
    this.checkoutdate = "";
    this.adult = "";
    this.child = 0;
    this.childage = "";
    this.promocode = "";
    this.placeofembarkation = "";
    this.roomtype = "";
    this.rooms = 1;
    this.room1allchildage = "";
    this.room2allchildage = "";
    this.room3allchildage = "";

    this.room1child1age = "";
    this.room1child2age = "";

    this.room2child1age = "";
    this.room2child2age = "";

    this.room3child1age = "";
    this.room3child2age = "";
    this.rateaccesscode = "";

    this.minnights = 1;

    /*For decesion making */
    this.pagename = "";
    this.pagetype = "";

}

bwMakeReservation.prototype.booknow = function () {

    var ret = "";

    var finalURL = "https://res.oberoihotels.com/";
    var configcode = "oberoi";
    var themecode = "oberoi";
    var languagForSynxis = "en-GB";

    var _hotelcode = fnBwGetSynxisHotelCodeFromTrustHotelCode(this.hotelcode.toString().split(";")[0]);
    var custom_nothn = "";
    console.log("bwMakeReservation.prototype.booknow " + _hotelcode);

    /*If true then add parameter in synxis url where this parameter is used to make some decesions such as hide price compare widget*/
    if (fnBwBoolSendCustomeParameterCustomNothn()) {
        custom_nothn = "&custom_nothn=1";
    }

    //  console.log(this.adult);
    this.adult = this.adult.toString().replace(/;/g, ',');
    this.child = this.child.toString().replace(/;/g, ',').replace(/-/g, "|");
    this.childage = this.childage.toString().replace(/;/g, ",").replace(/-/g, "|");
    this.checkindate = this.checkindate.toString().replace(/;/g, ",");
    this.checkoutdate = this.checkoutdate.toString().replace(/;/g, ",");

    if (readCookie("SsoAccessToken") != "" && readCookie("SsoAccessToken") != "false") {
        if (this.rateaccesscode != "") {
            if (this.rateaccesscode.indexOf("WEBEXL") == -1) {
                if (this.rateaccesscode.indexOf("WEB-") != -1) {
                    this.rateaccesscode = this.rateaccesscode.replace(/-/g, "EXL-");
                }
            }
        }
    }

   
    if (this.pagename == "sugardoctormedicarellp" && _hotelcode == "5271") {

        finalUrlWithParameters = finalURL + "?hotel=" + _hotelcode + "&rate=" + this.rateaccesscode + "&arrive=" + this.checkindate + "&depart=" + this.checkoutdate + "&rooms=" + this.rooms + "&adult=" + this.adult + "&child=" + this.child + "&childages=" + this.childage + "&themecode=InitialThemeTrident&configcode=InitialConfigTrident&chain=24188&level=hotel&locale=en-US&sbe_ri=0" + custom_nothn;
    }
   

    else {

        if (_hotelcode.indexOf("5265") != -1) {
            configcode = "oberoicruise";
        }
        //else if (_hotelcode.indexOf("5274") != -1 || _hotelcode.indexOf("5283") != -1) {
        //    configcode = "oberoi_geo";
        //}
        //else if ((_hotelcode.indexOf("5257") != -1 || _hotelcode.indexOf("5282") != -1) && $('.booking-engine .DropDownExtraGuest').length > 0) {
        //    configcode = "OberoiFourGuest";
        //}
        //else if (_hotelcode.indexOf("5287") != -1) {
        //    configcode = "OberoiMauritius";
        //}
        
        
        else if (_hotelcode.indexOf("5276") != -1) {
            configcode = "OberoiRajvilas";
            themecode = "OberoiRajVilas";
        }//agra
        else if (_hotelcode.indexOf("5256") != -1) {

            themecode = "OberoiAmarvilas";
        }//Bengaluru
        else if (_hotelcode.indexOf("5269") != -1) {
            configcode = "OberoiBengaluru";
            themecode = "OberoiBengaluru";
        }//Gurgaon
        else if (_hotelcode.indexOf("5272") != -1) {

            configcode = "OberoiBengaluru";
            themecode = "OberoiGurgaon";
        }
        //Kolkata
        else if (_hotelcode.indexOf("5257") != -1) {
            configcode = "OberoiFourGuest";
            themecode = "OberoiKolkata";
        }
        //Mumbai
        else if (_hotelcode.indexOf("5270") != -1) {

            configcode = "OberoiMumbai";
            themecode = "OberoiMumbai";
        }
        //NewDelhi
        else if (_hotelcode.indexOf("5280") != -1) {
            configcode = "OberoiBengaluru";
            themecode = "OberoiNewDelhi";
        }
        //Sukhvilas
        else if (_hotelcode.indexOf("5275") != -1) {

            themecode = "OberoiSukhvilas";
        }
        //OberoiVanyavilas
        else if (_hotelcode.indexOf("5285") != -1) {

            themecode = "OberoiVanyavilas";
        }
  //Bandhavgarh
        else if (_hotelcode.indexOf("48143") != -1) {

            themecode = "OberoiVindhyavilas";
        }
        //OberoiWildFlowerHall
        else if (_hotelcode.indexOf("5255") != -1) {
          //  configcode = "OberoiRajvilas";
            themecode = "OberoiWildFlowerHall";
        }
        //OberoiCecil
        else if (_hotelcode.indexOf("5289") != -1) {

            themecode = "OberoiCecil";
        }
        //OberoiUdaivilas
        else if (_hotelcode.indexOf("5261") != -1) {

            themecode = "OberoiUdaivilas";
        }
        //OberoiSahlHaseesh
        else if (_hotelcode.indexOf("5283") != -1) {

            themecode = "OberoiSahlHaseesh";
            configcode = "oberoi_geo";
        }
        //OberoiPhilae
        else if (_hotelcode.indexOf("5264") != -1) {
            configcode = "oberoicruise";
            themecode = "OberoiPhilae";
        }

        //OberoiZahra
        else if (_hotelcode.indexOf("5267") != -1) {
            configcode = "oberoicruise";
            themecode = "OberoiZahra";
        }
        //OberoiBali
        else if (_hotelcode.indexOf("5258") != -1) {

            themecode = "OberoiBali";
            configcode = "oberoilombok";          
        }
        //OberoiLombok
        else if (_hotelcode.indexOf("5266") != -1) {
            themecode = "OberoiLombok";
            configcode = "oberoilombok";          
        }
        //OberoiMadina
        else if (_hotelcode.indexOf("5286") != -1) {

            themecode = "OberoiMadina";
        }
        //OberoiMauritius
        else if (_hotelcode.indexOf("5287") != -1) {
            configcode = "OberoiMauritius";
            themecode = "OberoiMauritius";
        }
        //OberoiAlZorah
        else if (_hotelcode.indexOf("5274") != -1) {
            configcode = "oberoi_geo";
            themecode = "OberoiAlZorah";
        }
        //Marrakech
        else if (_hotelcode.indexOf("9796") != -1) {
            
            themecode = "OberoiMarrakech";

        }

        if (typeof glblCurrentPageLanguageName != "undefined" && glblCurrentPageLanguageName != "en") {
            languagForSynxis = glblCurrentPageLanguageName;
        }

        var href = location.href;
        var finalname = href.match(/([^\/]*)\/*$/)[1];
        var pagetype = "";
        if (href.match("alliance")) {
            pagetype = "alliance";
        }
        else { pagetype = "others"; }
        if (finalname == "kotak-securities-limited") {
            finalUrlWithParameters = finalURL + "?hotel=" + _hotelcode + "&rate=" + this.rateaccesscode + "&arrive=" + this.checkindate + "&depart=" + this.checkoutdate + "&rooms=" + this.rooms + "&adult=" + this.adult + "&child=" + this.child + "&childages=" + this.childage + "&themecode=" + themecode + "&configcode=" + configcode + "&chain=24188&level=hotel&locale=" + languagForSynxis + "&pagetype=" + pagetype + "&sbe_ri=0";
        }
        else if (href.match("one-of-us-programme")) {
            pagetype = "fnf_programme";
            const urlParams = new URLSearchParams(window.location.search);
            const myParam = urlParams.get('coupon_code')
            finalUrlWithParameters = finalURL + "?hotel=" + _hotelcode + "&rate=" + this.rateaccesscode + "&fnf_coupon_code=" + myParam + "&arrive=" + this.checkindate + "&depart=" + this.checkoutdate + "&rooms=" + this.rooms + "&adult=" + this.adult + "&child=" + this.child + "&childages=" + this.childage + "&themecode=" + themecode + "&configcode=oberoifnf&chain=24188&level=hotel&locale=" + languagForSynxis + "&pagetype=" + pagetype + "&sbe_ri=0";
        }
        else if (finalname == "world-economic-forum") {
          
            finalUrlWithParameters = finalURL + "?hotel=" + _hotelcode + "&group=OC2502WORL&arrive=" + this.checkindate + "&depart=" + this.checkoutdate + "&rooms=" + this.rooms + "&adult=" + this.adult + "&child=" + this.child + "&childages=" + this.childage + "&themecode=" + themecode + "&configcode=" + configcode + "&brand=ob&chain=24188&level=hotel&locale=" + languagForSynxis + "&pagetype=" + pagetype + "&sbe_ri=0" + custom_nothn;
        }
        else {
            finalUrlWithParameters = finalURL + "?hotel=" + _hotelcode + "&rate=" + this.rateaccesscode + "&arrive=" + this.checkindate + "&depart=" + this.checkoutdate + "&rooms=" + this.rooms + "&adult=" + this.adult + "&child=" + this.child + "&childages=" + this.childage + "&themecode=" + themecode + "&configcode=" + configcode + "&brand=ob&chain=24188&level=hotel&locale=" + languagForSynxis + "&pagetype=" + pagetype + "&sbe_ri=0" + custom_nothn;
        }

       
    }



    console.log("RPC=", this.rateaccesscode);
    console.log("finalUrlWithParameters " + finalUrlWithParameters);

    fnBwViewAvailAbilityBeforeRedirectionClick($(this));


    setUserLastSearchData(finalUrlWithParameters);

    if (fnGetParameterByNameNew("iatesting") == "") {

        createCookieWithDomainName("bookingSourceDomain", "website", 10, ".oberoihotels.com");

        if (readCookie("SsoAccessToken") != "" && readCookie("SsoAccessToken") != "false") {

            if (readCookie("OberoiOneMemberTier").toLowerCase() == "blue") {
                finalUrlWithParameters += "&filter=member";

            }
            else {
                finalUrlWithParameters += "&filter=ob1";
            }

            this.createVirualFormAndPostIt(finalUrlWithParameters, readCookie("SsoAccessToken"));
        }
        else {
            window.location = finalUrlWithParameters;
        }
    }
    else {
        // console.log("Final URL = " + finalUrlWithParameters);
    }

    return ret;
}


function fnBwBoolSendCustomeParameterCustomNothn() {

    var currentURLPath = document.location.pathname.toLocaleLowerCase();

    if (currentURLPath.startsWith("/special-offers-lp")
        || currentURLPath.startsWith("/partner")
        || currentURLPath.startsWith("/alliances")
        || currentURLPath.startsWith("/events-landing-page")
    ) {
        return true;
    }
    else {
        return false;
    }

}


function fnBwGetSynxisHotelCodeFromTrustHotelCode(hotelCodeTrust) {

    var hotelCodeSynxis = "5261";
    var objHotelCodeMapping = {
        "HTLMRCO": "9796",
        "HBDPSOB": "5258",
        "HBBLROB": "5269",
        "HBDELOG": "5272",
        "HBAMIOB": "5266",
        "HBMRUTO": "5287",
        "HBBOMOB": "5270",
        "HBDELOB": "5280",
        "HBHRGOB": "5283",
        "HBAGROB": "5256",
        "HBDXBAZ": "5274",
        "HBSLVOB": "5289",
        "HBDXBOB": "5282",
        "HBCCUOB": "5257",
        "HBCOKVR": "5265",
        "HBASWPH": "5264",
        "HBJAIOB": "5276",
        "HBIXCOB": "5275",
        "HBUDROB": "5261",
        "HBJAIVA": "5285",
        "HBJAIVIND": "48143",
        "HBASWZA": "5267",
        "HBMEDOB": "5286",
        "HBSLVWH": "5255",
        "HBBOMOT": "5271"

    };


    hotelCodeTrust = hotelCodeTrust.toUpperCase();
    if (objHotelCodeMapping[hotelCodeTrust] != undefined)
        hotelCodeSynxis = objHotelCodeMapping[hotelCodeTrust];
    else {
        console.log("hotelCodeTrust -- " + hotelCodeTrust);
    }
    return hotelCodeSynxis;
}

/* Get hotelcode by synxis code for card abandoment pop up (Marketing asset)  */
function getHotelCodeBySynxisCode(synxisCode) {

    /* Note hotelcode HBBOMOT is for Trident Nariman Point Mumbai
       This code is used on Offer /lp/hotels-in-mumbai/sugardoctormedicarellp
    */
    var hotelTrustCode = "";

    var arrSynxixCodeAndHotelCode = {
        "_9796": "HTLMRCO",
        "_5258": "HBDPSOB",
        "_5269": "HBBLROB",
        "_5272": "HBDELOG",
        "_5266": "HBAMIOB",
        "_5287": "HBMRUTO",
        "_5270": "HBBOMOB",
        "_5280": "HBDELOB",
        "_5283": "HBHRGOB",
        "_5256": "HBAGROB",
        "_5274": "HBDXBAZ",
        "_5289": "HBSLVOB",
        "_5282": "HBDXBOB",
        "_5257": "HBCCUOB",
        "_5265": "HBCOKVR",
        "_5264": "HBASWPH",
        "_5276": "HBJAIOB",
        "_5275": "HBIXCOB",
        "_5261": "HBUDROB",
        "_5285": "HBJAIVA",
        "_48143": "HBJAIVIND",
        "_5267": "HBASWZA",
        "_5286": "HBMEDOB",
        "_5255": "HBSLVWH"
    };

    if (arrSynxixCodeAndHotelCode["_" + synxisCode] != undefined)
        hotelTrustCode = arrSynxixCodeAndHotelCode["_" + synxisCode];
    else {
        console.log("hotelTrustCode -- " + hotelTrustCode);
    }

    return hotelTrustCode;
}

bwMakeReservation.prototype.createVirualFormAndPostIt = function (targetUrl, ssoAccessToken) {
    //get base url
    //var currentURL = window.location.href;
    var currentURL = targetUrl;
    console.log("currentURL - " + currentURL);
    var hrefParts = currentURL.split("?");
    var basePath = hrefParts[0];
    console.log("basePath - " + basePath);
    var querystring = ""
    if (hrefParts.length > 1) {
        querystring = hrefParts[1].split("#")[0];
    }
    console.log("querystring - " + querystring);

    if (targetUrl.toLocaleLowerCase().indexOf("filter") == -1) {
        if (readCookie("OberoiOneMemberTier").toLowerCase() == "" || readCookie("OberoiOneMemberTier").toLowerCase() == "blue") {
            querystring += "&filter=member";
        }
        else {
            querystring += "&filter=ob1";
        }
    }

    var querystringParameters = querystring.split("&");
    var formPostJsonObject = {};
    for (var i = 0; i < querystringParameters.length; i++) {
        var parameter = querystringParameters[i];
        var parameterNameValue = parameter.split('=');
        var parameterName = parameterNameValue[0];
        var parameterValue = "";
        if (parameterNameValue.length > 1) {
            parameterValue = parameterNameValue[1];
        }
        formPostJsonObject[parameterName] = parameterValue;
    }
    console.log("formPostJsonObject - " + formPostJsonObject);

    if (ssoAccessToken != "") {
        formPostJsonObject["session"] = ssoAccessToken;
    }
    console.log("ssoAccessToken - " + ssoAccessToken);

    //get query string parameters
    $.redirect(basePath,
        formPostJsonObject,
        "post", "_self");
}

/*GET values of adult, child, child1age and child2age using index number start from 1
Each .block class contain group of stay details*/
function fnBwGetAdultAndChild(objBE, roomselected) {

    roomselected = roomselected - 1;

    var adult = 0;
    adult = $(objBE).find('.blockWrapper .block').eq(roomselected).find('.choose.adult li.active').html();
    if (adult == undefined) {
        adult = 0;
    }
    var child = 0;
    child = $(objBE).find('.blockWrapper .block').eq(roomselected).find('.choose.child li.active').html();
    if (child == undefined) {
        child = 0;
    }
    var child1age = 0;
    child1age = $(objBE).find('.blockWrapper .block').eq(roomselected).find('.childAgeWrap.childAge1 li.active').html();
    if (child1age == undefined) {
        child1age = 0;
    }
    var child2age = 0;
    child2age = $(objBE).find('.blockWrapper .block').eq(roomselected).find('.childAgeWrap.childAge2 li.active').html();
    if (child2age == undefined) {
        child2age = 0;
    }

    var child3age = 0;
    child3age = $(objBE).find('.blockWrapper .block').eq(roomselected).find('.childAgeWrap.childAge3 li.active').html();
    if (child3age == undefined) {
        child3age = 0;
    }

    return [parseInt(adult), parseInt(child), parseInt(child1age), parseInt(child2age), parseInt(child3age)];
}

function fnBwBindClickEventsOnDynamicElementsOfGuestDetailsSection() {

    /*booking-engine click event*/
    $('.booking-engine').unbind();
    $('.booking-engine').click(function () {
        glblBwLastClickedObj = $(this);
    });




    //number of adult - on click
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .adult .number ul li').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .adult .number ul li').click(function () {
        $(this).closest('.number').find('li').removeClass('active');
        $(this).addClass('active');

        if ($('.booking-engine .DropDownExtraGuest').length > 0) {
            var _currIndex = $(this).index();
            var _this = $(this);
            var _childRemain = 3;
            if (glblBwConfiguration.hotelCode.toUpperCase() != "HBDXBAZ") {
            $(this).closest('.block').find('.child .number ul li').hide();
            _childRemain = _childRemain - _currIndex - 1;
            for (i = 0; i <= _childRemain; i++) {
                _this.closest('.block').find('.child .number ul li:eq(' + i + ')').show();
            }
            _this.closest('.block').find('.child .closeIcn').click();
        }

        }


    });

    //number of child - on click
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .child .number ul li').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .child .number ul li').click(function () {
        $(this).closest('.number').find('li').removeClass('active');
        $(this).addClass("active");
        var _currIndex = $(this).index();
        var _this = $(this);
        $(this).closest('.number').next('.closeIcn').show();
        $(this).closest('.block').find('.childAgeWrap').hide();
        for (i = 0; i <= _currIndex; i++) {
            _this.closest('.block').find('.childAgeWrap:eq(' + i + ')').show();
        }

        if (glblBwConfiguration.offerCode == 'Default The Oberoi Beach Resort Al Zorah'
            && $(this).text() == "2"
            && $(this).closest('.individualRoomSection').index() == 0
        ) {

            $(".hotelChooseChildInfoWrap, .hotelChooseChildInfoWrapOverlay").show();
        }

    });

    $(".hotelChooseChildInfoWrap .hotelChooseChildInfoCloseBtn").click(function(){
        if($('.hotelChooseChildInfoCheckBox input[type="checkbox"]').is(':checked')){
          $(".hotelChooseChildInfoErrorMsg").hide();
         $(".hotelChooseChildInfoWrap, .hotelChooseChildInfoWrapOverlay").hide();
         $(".booking-engine .noOfGuestWrap .addGuestDropDown").show();
        }
        else{
            $(".hotelChooseChildInfoErrorMsg").show();
        }
     
    });

    //delete child - on click
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .child .closeIcn').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .child .closeIcn').click(function () {
        $(this).hide();
        $(this).prev('.number').find('li').removeClass('active');
        $(this).closest('.block').find('.childAgeWrap').hide();
        $(this).closest('.block').find('.childAgeWrap li').removeClass('active');
    });

    //age of child - on click
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .childAgeWrap ul li').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .childAgeWrap ul li').click(function () {
        $(this).closest('.childAgeWrap').find('li').removeClass('active');
        $(this).addClass('active');
    });

    //edit room - on click

    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .editBlock .edit').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .editBlock .edit').click(function () {
       
        var objBE = $(this).closest('.booking-engine');
        fnBwCreateGuestCountOfActiveBlock(objBE);
        var objBlock = $(this).closest('.blockWrapper .block');
        $(objBlock).find('.roomGuestCount:eq(0)').remove();
        $(objBlock).find('.roomGuestCount').show();
        $(objBlock).addClass('active');
        $(objBE).find('.editBlock .edit').show();
        $(this).hide();      
       // $(objBE).find('.roomGuestCount .adult .number ul li.active').click();
        //setTimeout(function () {
        //    $(glblBwLastClickedObj).find('.roomGuestCount .adult .number ul li.active').click();
        //}, 10);
        fnBwGuestShowHideGuestBasedOnAdultsOnClick();

        fnBwCalculateNumberOfGuest();
    });

    //delete room - on click
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .editBlock .closeIcn').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .blockWrapper .editBlock .closeIcn').click(function () {
        var objBE = $(this).closest('.booking-engine');
        var obj = $(this).closest('.blockWrapper .block').index();
        $(objBE).find('.addGuestDropDown .actionWrap .addRoomButton').show();
        var _currBlockCountBefore = $(objBE).find('.blockWrapper .block').length;
        if (_currBlockCountBefore >= 2) {
            $(objBE).find('.blockWrapper .block:eq(' + obj + ')').remove();
            var _currBlockCount = $(objBE).find('.blockWrapper .block').length;
            var _currBlockIndex = parseInt(_currBlockCount) - 1;
            $(objBE).find('.addRoomDropDown .block .roomSelectOption').removeClass('active');
            $(objBE).find('.addRoomDropDown .block .roomSelectOption:eq(' + _currBlockIndex + ')').addClass('active');
            var _roomCountWithZero = ('0' + _currBlockCount).slice(-2);
            $(objBE).find('.noOfRoomsWrap .addRoomLabel .roomsCount .value').html(_roomCountWithZero);
            $(objBE).find('.mobile .counter').html(_roomCountWithZero);
            for (i = 0; i < _currBlockCount; i++) {
                var roomCount = parseInt(i) + 1;
                $(objBE).find('.blockWrapper .block:eq(' + i + ')').find('.roomsIndividualCount').html(glblBookingWidgetCommonDictionaryArray.Room + ' ' + roomCount);
                $(objBE).find('.blockWrapper .block:eq(' + i + ')').find('.editBlock').html('<div class="edit">' + glblBookingWidgetCommonDictionaryArray.Edit + '</div><div class="closeIcn">x</div>');
            }
        }
        fnBwCalculateNumberOfGuest(objBE);

    });


    fnBwGuestShowHideGuestBasedOnAdultsOnClick();
}

//#endregion

//#region BW elements - bind event handlers
function fnBwBindEventHandlers() {
    console.log("fnBindEventHandlers called");
    //for oberoi


    //bw event handlers:
    //open drop down on click of parent div for all dropdowns in booking widget
    $('.booking-engine .triggerDropDown').unbind();
    $('.booking-engine .triggerDropDown').click(function () {
        console.log(".booking-engine .triggerDropDown called");
        fnBwAllDropDownOnClick(this);
    });

    //hotel drop down - on change
    $('.booking-engine .hotelListDropDown .hotelList .hotelBlock .list ul > li').unbind();
    $('.booking-engine .hotelListDropDown .hotelList .hotelBlock .list ul > li').click(function () {
        fnBwHotelDropDownOnChange(this);
    });

    //under initialize calendar
    //check in calendar - clickDateCI
    //check in calendar - onChangeCI
    //check out calendar - clickDateCO
    //check out calendar - onChangeCO

    //room drop down - on change
    $('.booking-engine .addRoomDropDown .block .roomSelectOption').unbind();
    $('.booking-engine .addRoomDropDown .block .roomSelectOption').click(function () {
        fnBwRoomDropDownOnChange(this);
    });

    //guest drop down - add room button - on click
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .actionWrap .addRoomButton').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .actionWrap .addRoomButton').click(function () {
        fnBwGuestDropDownAddRoomButtonOnClick(this);
    });
    //guest drop down - confirm button - on click
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .actionWrap .actionButton').unbind();
    $('.booking-engine .noOfGuestWrap .addGuestDropDown .actionWrap .actionButton').click(function () {
        fnBwGuestDropDownConfirmButtonOnClick(this);
    });

    //dynamically created elements
    //edit room - on click
    //delete room - on click
    //adult number span - on click
    //child number span - on click
    //child delete - on click
    //age of child number span - on click
    fnBwBindClickEventsOnDynamicElementsOfGuestDetailsSection();

    ////promo code text box - on lost focus
    //$(".booking-engine .promocodeDropDown").blur(function () {
    //    fnBwIsPromoCodeValid(this);
    //});

    //book a stay / view availability - on click
    $(".booking-engine .viewAvailabilityButton").unbind();
    $(".booking-engine .viewAvailabilityButton").click(function () {
        fnBwViewAvailabilityButtonOnClick(this);
    });

    //popup close buttons in case of mobile view - on click
    $('.booking-engine .close, .booking-engine .backWrap').unbind();
    $('.booking-engine .close, .booking-engine .backWrap').click(function () {
        fnBwCloseAllDropDowns();
    });

    //booking calendar next previous arrows - this is added to each creation of calendar element in default calendar event handlers
    //fnBwCalendarAddNextPrevEventHandler();

    /* start added by prince - maybe for special pages that have promocode already filled - pls confirm*/
    $(".booking-engine .triggerDropDown.activeAlways").unbind();
    $(".booking-engine .triggerDropDown.activeAlways").hover(function () {
        $('.booking-engine .activeAlways').removeClass('activeAlways');
    });

    $(".promocodeDropDown button").unbind();
    $(".promocodeDropDown button").click(function () {
        glblBwIsPromocodeClick = true;
        fnBwViewAvailabilityButtonOnClick(glblBwLastClickedObj);
        glblBwIsPromocodeClick = false;
    });


}//#endregion

//put comment here
$(document).mouseup(function (e) {


    /*To close dropdown sections available in booking widget */
    var container = $(".booking-engine .dropDown"),
        containerParent = $('.booking-engine .triggerDropDown');
    if (!container.is(e.target) && container.has(e.target).length === 0 && !containerParent.is(e.target) && containerParent.has(e.target).length === 0) {
        container.hide();
        containerParent.removeClass('active');
        fnBwCalculateNumberOfGuest(glblBwLastClickedObj);
        //fnBwSyncHtml();

    }


    /*To close booking widget when user clicks outside of booking engine section */
    var container2 = $(".header-view-availability");
    if (!container2.is(e.target) && container2.has(e.target).length === 0) {

        //fnBwSyncHtml();

        //$('.triggerDropDown').find('active').removeClass('active');
        container2.find('.booking-engine').hide();



        if ($(".booking-engine .offerMsgWrap").length > 0) {
            $(".booking-engine .offerMsgWrap").show();
        }
    }
});


//#region Sync booking Engine html from horizonatl to vertical and vice versa
function fnBwSyncHtml(objThis) {
    glblBwLastClickedObj = objThis;
    var _bookingWidgetLength = $(".booking-engine");

    if (typeof glblBwLastClickedObj != "undefined" && _bookingWidgetLength.length > 0) {

        if (_bookingWidgetLength.length == 2) {
            if (glblBwLastClickedObj.context.dataset.index == "0") {
                $(".booking-engine:eq(1) .noOfGuestWrap").html($(".booking-engine:eq(0) .noOfGuestWrap").html());
                // console.log("AAAAAAA");
                fnBwBindEventHandlers();

            }
            else if (glblBwLastClickedObj.context.dataset.index == "1") {
                $(".booking-engine:eq(0) .noOfGuestWrap").html($(".booking-engine:eq(1) .noOfGuestWrap").html());
                // console.log("BBBBBBB");
                fnBwBindEventHandlers();

            }

            $(".booking-engine.bkhOffset .calanderBottomMessage").html("");
        }
    }

}//#endregion

//#region calendar default event - handlers

function fnBwCheckInDateChanged(objTDatepicker) {

    console.log("fnBwCheckInDateChanged called");
    $(".booking-engine .offerMsgWrap").html("");
    $(".booking-engine .offerMsgWrap").hide();
    fnBwCalendarAddNextPrevEventHandler();
    fnBwCheckOutCalendarSetAvailabilityPriceMarketingAssetAndOthers();
    fnBwDisplayMarketingAssetsInCalendar();

    //this would work only if min nights > 1
    fnBwSetCheckOutDate();

    //this function change date  on hover for apperance purpose only
    fnBwHoveCheckInCheckOutDateChange();

    fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget();
    //hide mobile elements
    //fnBwHideMobileElementsOfBookingCalendar();

    $(objTDatepicker).find('.dateWrap .mobCheckInCheckOut').removeClass('active');
    $(objTDatepicker).find('.dateWrap .mobCheckInCheckOut:eq(1)').addClass('active');

    $(objTDatepicker).find('.t-check-in-mobile').html($('.booking-engine .t-date-check-in').html());
    $(objTDatepicker).find('.t-check-out-mobile').html($('.booking-engine .t-date-check-out').html());
}



function fnBwCheckInIconClicked(objTDatepicker) {

    $(".booking-engine .offerMsgWrap").html("");
    $(".booking-engine .offerMsgWrap").hide();

    console.log("fnBwCheckInIconClicked called");
    fnBwCalendarAddNextPrevEventHandler();
    //add text for disabled date range
    fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget();

    fnBwCheckInCalendarSetAvailabilityPriceMarketingAssetAndOthers();
    fnBwDisplayMarketingAssetsInCalendar();
    //fnBwCheckInCalendarDisableDatesInDateRange();
    //fnBwCheckInCalendarDisableDaysOfWeek();

    //this function change date  on hover for apperance purpose only
    fnBwHoveCheckInCheckOutDateChange();

    //show mobile elements
    fnBwShowMobileElementsOfBookingCalendar(objTDatepicker);

    $(objTDatepicker).find('.dateWrap .mobCheckInCheckOut').removeClass('active');
    $(objTDatepicker).find('.dateWrap .mobCheckInCheckOut:eq(0)').addClass('active');

    $(objTDatepicker).find('.t-check-in-mobile').html($('.booking-engine .t-date-check-in').html());
    $(objTDatepicker).find('.t-check-out-mobile').html($('.booking-engine .t-date-check-out').html());


    /*For tracking*/
    fnBwClickDateCI(objTDatepicker);
}

function fnBwCheckOutDateChanged(objTDatepicker) {
    console.log("fnBwCheckOutDateChanged called");

    $(".booking-engine .offerMsgWrap").html("");
    $(".booking-engine .offerMsgWrap").hide();

    //only for case where we need to select exact number of nights as per offer
    fnBwDisplayInvalidNumberOfNightsSelectedMessage();

    fnBwCalendarAddNextPrevEventHandler();
    fnBwCheckOutCalendarSetAvailabilityPriceMarketingAssetAndOthers();
    fnBwDisplayMarketingAssetsInCalendar();
    fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget();

    /*Set global error messages such as no no room between stay or restricted date*/
    fnBwSetGlobalErrorMessage();

    //hide mobile elements
    //fnBwHideMobileElementsOfBookingCalendar();

    $(objTDatepicker).find('.t-check-in-mobile').html($('.booking-engine .t-date-check-in').html());
    $(objTDatepicker).find('.t-check-out-mobile').html($('.booking-engine .t-date-check-out').html());
}

function fnBwCheckOutIconClicked(objTDatepicker) {
    console.log("fnBwCheckOutIconClicked called");
    fnBwCalendarAddNextPrevEventHandler();
    //add text for disabled date range
    fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget();

    //disable dates
    fnBwCheckOutCalendarSetAvailabilityPriceMarketingAssetAndOthers();
    fnBwDisplayMarketingAssetsInCalendar();

    //this function change date  on hover for apperance purpose only
    fnBwHoveCheckInCheckOutDateChange();


    //show mobile elements
    fnBwShowMobileElementsOfBookingCalendar(objTDatepicker);

    $(objTDatepicker).find('.dateWrap .mobCheckInCheckOut').removeClass('active');
    $(objTDatepicker).find('.dateWrap .mobCheckInCheckOut:eq(1)').addClass('active');

    $(objTDatepicker).find('.t-check-in-mobile').html($('.booking-engine .t-date-check-in').html());
    $(objTDatepicker).find('.t-check-out-mobile').html($('.booking-engine .t-date-check-out').html());


    /*For tracking*/
    fnBwClickDateCO(objTDatepicker);
}
//#endregion 

//#region disable dates function 
//checkin calendar
function fnBwCheckInCalendarSetAvailabilityPriceMarketingAssetAndOthers() {
    fnBwCheckInCalendarDisableDaysOfWeek();
    var elementSelector = ".booking-engine .checkInDate [data-t-date]";
    $(elementSelector).each(function () {
        if ($(this).attr("data-t-date") != "") {
            var dateMoment = moment(moment(new Date(parseInt($(this).attr("data-t-date")))).format("YYYY-MM-DD"));

            //assuming that current selected date is outside disabled date range
            var outsideDisabledDateRange = true;

            //code to check if current selected date is outside disabled date range
            if (typeof glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate != "undefined") {
                if (dateMoment.isValid()) {
                    var disableDateFromCheck = moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate);
                    var disableDateToCheck = moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeEndDate);
                    if (dateMoment._d >= disableDateFromCheck._d
                        && dateMoment._d <= disableDateToCheck._d) {
                        $(this).addClass("t-disabled");
                        outsideDisabledDateRange = false;
                    }
                }
            }

            if (dateMoment.isValid() && outsideDisabledDateRange) {

                //code fix to following 1 line might have to be done
                //if min nights > 1 than last checkin date shud be min nights before end date of offer


                if (dateMoment._d >= moment(glblBwConfiguration.offer.endDate)
                    .subtract(glblBwConfiguration.offer.minNights - 1, "days")._d) {
                    $(this).addClass("t-disabled");
                }
                else if (dateMoment._d >= glblBwToday) {

                    //set price and sold out dates
                    if (glblBwArrDoNotUseSoldOutDatesForHotels.indexOf(glblBwConfiguration.hotelCode.toUpperCase()) == -1) {
                        if (glblBwConfiguration.AvailabilityAndPrice != null) {

                            //check if today and any further dates available as per min nights required
                            //for (var i = 0; i < glblBwConfiguration.offer.minNights; i++) {
                            //    var dateMomentString = dateMoment.clone().add(i, "days").format("YYYY-MM-DD");

                            //    //if (glblBwConfiguration.AvailabilityAndPrice.indexOf(dateMomentString) != -1) {
                            //    //    if (i == 0) {
                            //    //        blThisDateSoldOut = true;
                            //    //    }
                            //    //    else {
                            //    //        blThisDateNotAvailableForCheckIn = true;
                            //    //    }
                            //    //}


                            //}

                            var tempArrayDates = glblBwConfiguration.AvailabilityAndPrice.filter(function (item) {
                                return item.date == dateMoment.format("YYYY-MM-DD");
                            })[0];


                            if (typeof tempArrayDates != "undefined") {
                                var momentDateTempArray = moment(tempArrayDates.date, "YYYY-MM-DD");

                                if (tempArrayDates.restrictionType.toLowerCase() == "close") {
                                    $(this).addClass("t-disabled " + glblBwConfiguration.hotelCode + "" + dateMoment.format("YYYYMM") +"");
                                     //code for closed hotel date
                                    if (glblBwConfiguration.hotelCode == "HBJAIVA") {
                                        if($(this).hasClass("HBJAIVA202307") || $(this).hasClass("HBJAIVA202308")){
                                            $(this).addClass("closedHotel");
                                            $(this).parents(".t-table-wrap").addClass("hotelClosedTable");
                                        }
                                       
                                    }

                                    $(this).addClass("soldOutDate " + glblBwConfiguration.hotelCode + "" + dateMoment.format("YYYYMM") +"");
                                }


                                else {
                                    if (fnBwBoolShowPricesOnHotels()) {
                                        var tempHtml = $(this).html();
                                        if (tempHtml.indexOf('date-price') == -1) {
                                            $(this).html(tempHtml + "<span class='date-price'>" + fnBwNumberWithCommas(tempArrayDates.minimumPrice) + "</span>");
                                        }
                                    }
                                    if (fnBwBoolShowPricesOnHotelsBaliLombok()) {
                                        var tempHtml = $(this).html();
                                        let price = "";
                                        if (tempHtml.indexOf('date-price') == -1) {
                                            if (tempArrayDates.minimumPrice >= 1000000) {
                                                price = (tempArrayDates.minimumPrice / 1000000).toFixed(1) + 'M';
                                            }
                                            $(this).html(tempHtml + "<span class='date-price'> " + price + " </span>");
                                        }
                                    }
                                    if (tempArrayDates.restrictionType.toLowerCase() == "minstay"
                                        || tempArrayDates.restrictionType.toLowerCase() == "minstayoncheckin"
                                    ) {
                                        if (glblBwConfiguration.hotelCode.toUpperCase() != "HBCOKVR") {
                                            $(this).addClass("t-message-day minNightRequired");
                                            $(this).attr("restriction-type", "minstay");
                                            $(this).attr("duration-stay", parseInt(tempArrayDates.durationOfStay));
                                            $(".t-hover-day-content").remove();
                                            $(this).html($(this).html() + "<span class='t-message-day-content'>Min." + parseInt(tempArrayDates.durationOfStay) + " Nights Stay required</span><span class='t-message-day-restricted'></span>");
                                        }
                                    }
                                }
                            }

                        }
                    }
                    //marketing assets
                    //class name - marketingFlag
                    //disabled date range
                    //disabled days of week
                    //disabled individual dates
                }
            }
        }
    });

}
function fnBwCheckInCalendarDisableDatesInDateRange() {
    if (glblBwConfiguration.offer.disabledDateRange.exists) {
        // var disableDateFrom = new Date(parseInt($(index + " .checkOutDate tbody td.t-start").attr("data-t-date")));
        var disableDateFrom = moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate);
        var disableDateTo = moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeEndDate);
        var elementSelector = ".booking-engine .checkInDate [data-t-date]";
        $(glblBwLastClickedObj).find(".checkInDate [data-t-date]").each(function () {
            //the following code has date format issue as datepicker cells always return 5:50 AM of IST - pls fix it before using
            var dateMoment = moment(moment(new Date(parseInt($(this).attr("data-t-date")))).format("YYYY-MM-DD"));
            if (dateMoment._d >= disableDateFrom
                && dateMoment._d <= disableDateTo) {
                $(this).addClass("t-disabled");
            }
        });
    }
}
function fnBwCheckInCalendarDisableDaysOfWeek() {
    if (typeof glblBwConfiguration.offer.disabledDaysOfWeek != "undefined") {
        var disabledDaysOfWeek = glblBwConfiguration.offer.disabledDaysOfWeek;
        for (var i = 0; i < disabledDaysOfWeek.length; i++) {
            var dayCalendarTableCellIndex = disabledDaysOfWeek[i];
            //to set sunday day value as per booking calendar table cell index
            if (dayCalendarTableCellIndex == 0) dayCalendarTableCellIndex = 7;
            $(".booking-engine .checkInDate tbody td:nth-child(" + dayCalendarTableCellIndex + ")").addClass("t-disabled");
        }
    }
}

//checkout calendar
//fnBwCheckOutCalendarDisableDates
function fnBwCheckOutCalendarSetAvailabilityPriceMarketingAssetAndOthers() {
    console.log("fnBwCheckOutCalendarSetAvailabilityPriceMarketingAssetAndOthers called");

    var checkInDate = moment(moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[0]).format("YYYY-MM-DD"));
    var nextDateToCheckInDate = checkInDate.clone().add(1, "days");
    var checkOutCalendarEndDate = fnBwGetCheckOutCalendarEndDate(checkInDate);

    var elementSelector = ".booking-engine .checkOutDate [data-t-date]";
    $(elementSelector).each(function () {
        if ($(this).attr("data-t-date") != "") {
            var dateMoment = moment(moment(new Date(parseInt($(this).attr("data-t-date")))).format("YYYY-MM-DD"));

            //assuming that current selected date is outside disabled date range
            var outsideDisabledDateRange = true;

            //code to check if current selected date is outside disabled date range
            if (typeof glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate != "undefined") {
                if (dateMoment.isValid()) {
                    var disableDateFromCheck = moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate);
                    var disableDateToCheck = moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeEndDate);
                    if (dateMoment._d >= disableDateFromCheck._d
                        && dateMoment._d <= disableDateToCheck._d) {
                        outsideDisabledDateRange = false;
                        if (!dateMoment.isSame(disableDateFromCheck))
                            $(this).addClass("t-disabled");
                    }
                }
            }
            if (dateMoment.isValid() && outsideDisabledDateRange) {
                if (dateMoment._d >= glblBwToday) {


                    if (dateMoment._d > checkOutCalendarEndDate._d) {
                        // console.log(dateMoment._d);
                        $(this).addClass("t-disabled");
                    }
                    else {

                        //disable dates in checkout calendar
                        if (glblBwConfiguration.offer.minNights > 1) {
                            var disableDateFrom = checkInDate.clone().add(1, "days");
                            var disableDateTo = checkInDate.clone().add(glblBwConfiguration.offer.minNights - 1, "days");
                            if (dateMoment._d >= disableDateFrom._d
                                && dateMoment._d <= disableDateTo._d) {
                                $(this).addClass("t-disabled");
                            }
                            var checkinAndLastDateDifference = parseInt(getDateDifference(checkInDate.format("YYYY-MM-DD"), checkOutCalendarEndDate.format("YYYY-MM-DD"), "YYYY-MM-DD"));
                            if (checkinAndLastDateDifference >= glblBwConfiguration.offer.minNights && dateMoment.format("YYYY-MM-DD") == checkOutCalendarEndDate.format("YYYY-MM-DD")) {
                                $(this).removeClass("t-disabled");
                            }  
                        }
                    }


                    if (glblBwArrDoNotUseSoldOutDatesForHotels.indexOf(glblBwConfiguration.hotelCode.toUpperCase()) == -1) {
                        if (glblBwConfiguration.AvailabilityAndPrice != null) {
                            var blThisDateSoldOut = false;
                            var blThisDateNotAvailableForCheckIn = false;
                            //check if today and any further dates available as per min nights required
                            //for (var i = 0; i < glblBwConfiguration.offer.minNights; i++) {
                            //    var dateMomentString = dateMoment.clone().add(i, "days").format("YYYY-MM-DD");

                            //    //if (glblBwConfiguration.AvailabilityAndPrice.indexOf(dateMomentString) != -1) {
                            //    //    if (i == 0) {
                            //    //       blThisDateSoldOut = true;
                            //    //    }
                            //    //    else {
                            //    //        blThisDateNotAvailableForCheckIn = true;
                            //    //    }
                            //    //}

                            //    var tempArrayDates = glblBwConfiguration.AvailabilityAndPrice.filter(function (item) {
                            //        return item.date == dateMoment.format("YYYY-MM-DD");
                            //    })[0];

                            //    if (typeof tempArrayDates != "undefined") {
                            //        if (tempArrayDates.restrictionType.toLowerCase() == "close") {
                            //          blThisDateSoldOut = true;
                            //        }
                            //    }

                            //}


                            var tempArrayDates = glblBwConfiguration.AvailabilityAndPrice.filter(function (item) {
                                return item.date == dateMoment.format("YYYY-MM-DD");
                            })[0];

                            if (typeof tempArrayDates != "undefined") {
                                if (tempArrayDates.restrictionType.toLowerCase() == "close") {
                                    if (!$(this).hasClass("t-end"))
                                        $(this).addClass("soldOutDate " + glblBwConfiguration.hotelCode + "" + dateMoment.format("YYYYMM") +"");
                                }
                                else {
                                    if (fnBwBoolShowPricesOnHotels()) {
                                        var tempHtml = $(this).html();
                                        if (tempHtml.indexOf('date-price') == -1) {
                                            $(this).html(tempHtml + "<span class='date-price'>" + fnBwNumberWithCommas(tempArrayDates.minimumPrice) + "</span>");
                                        }
                                    }
                                    if (fnBwBoolShowPricesOnHotelsBaliLombok()) {
                                        var tempHtml = $(this).html();
                                        let price = "";
                                        if (tempHtml.indexOf('date-price') == -1) {
                                            if (tempArrayDates.minimumPrice >= 1000000) {
                                                price = (tempArrayDates.minimumPrice / 1000000).toFixed(1) + 'M';
                                            }
                                            $(this).html(tempHtml + "<span class='date-price'> " + price + "</span>");
                                        }
                                    }

                                    if (glblBwConfiguration.hotelCode.toUpperCase() != "HBCOKVR") {
                                        if (tempArrayDates.restrictionType.toLowerCase() == "minstay"
                                            || tempArrayDates.restrictionType.toLowerCase() == "minstayoncheckin"
                                        ) {
                                            $(this).addClass("t-message-day minNightRequired");
                                            $(this).attr("restriction-type", "minstay");
                                            $(this).attr("duration-stay", parseInt(tempArrayDates.durationOfStay));
                                            $(".t-hover-day-content").remove();
                                            $(this).html($(this).html() + "<span class='t-message-day-content'>Min." + parseInt(tempArrayDates.durationOfStay) + " Nights Stay required</span><span class='t-message-day-restricted'></span>");


                                        }
                                    }
                                }
                            }

                        }

                    }
                }
            }
        }
    });

}
//#endregion


if (glblBwWinW < glblBwMobilDeviceMaxWidth) {
    glblBwIsMobile = true;
    glblBwNumCalendar = 12;
    glblBwBlCalendarAutoClose = false;
}

//Set and show global error messge on hotel change, night change and page load
function fnBwSetGlobalErrorMessage() {
    console.log("fnBwSetGlobalErrorMessage called");

    var htmlErrorMessage = "";
    var isValidForBooking = true;
    var defaultMinNight = 1;
    var tempArrayClosedDates = [];
    var tempArrayRestrictedDates = [];
    var tempArrayRestrictedOnCheckInDates = [];
    var blThisDateSoldOut = false;
    var blThisDateRestricted = false;
    var blThisDateRestrictedOnCheckIn = false;
    var blIsValidStay = true;
    glblBwConfiguration.ErrorMessage = "";

    $('.booking-engine .calender-dynamic-text').hide();
    $('.booking-engine .calender-dynamic-text').html("");
    $('.booking-engine .calender-dynamic-text-mobile').html("");

    var checkInDate = "";
    var checkOutDate = "";
    if (typeof glblBwLastClickedObj != "undefined") {
        checkInDate = moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[0]);
        checkOutDate = moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[1]);
    }
    else {
        checkInDate = moment($('.booking-engine .t-datepicker').tDatePicker('getDates')[0]);
        checkOutDate = moment($('.booking-engine .t-datepicker').tDatePicker('getDates')[1]);
    }


    var blIsNoRoom = false;
    var blIsMinStayRequired = false;

    var tempDate = moment(checkInDate).clone();

    var hotelofferingid = "";
    if (glblBwConfiguration.hotelCode.toUpperCase() == "HBCOKVR") {
        hotelofferingid = glblBwConfiguration.hotelCode + "-" + glblBwConfiguration.offer.minNights;
    }
    else {
        hotelofferingid = glblBwConfiguration.hotelCode;
    }





    var hotelAvailabilityAndPriceData = arrCalendarSoldOutDates.filter(function (item) {
        return item.hotelofferingid.toLowerCase() == hotelofferingid.toLowerCase();
    })[0];

    if (glblBwConfiguration.AvailabilityAndPrice != null) {

        while (tempDate._d >= checkInDate._d && tempDate._d < checkOutDate._d) {
            //console.log("tempDate=" + tempDate.format("YYYY-MM-DD"));
            var tempArrayDates = glblBwConfiguration.AvailabilityAndPrice.filter(function (item) {
                return item.date == tempDate.format("YYYY-MM-DD");
            })[0];

            if (typeof tempArrayDates != "undefined") {
                console.log("tempDate1 =" + tempDate.format("YYYY-MM-DD") + tempArrayDates.restrictionType + "--");
                if (tempArrayDates.restrictionType.toLowerCase() == "close") {
                    blThisDateSoldOut = true;
                    blIsValidStay = false;
                    tempArrayClosedDates.push(tempDate.format("YYYY-MM-DD"));
                }
                else if (tempArrayDates.restrictionType.toLowerCase() == "minstay"
                    && checkOutDate.diff(checkInDate, 'days') < parseInt(tempArrayDates.durationOfStay)
                ) {
                    blThisDateRestricted = true;
                    blIsValidStay = false;
                    tempArrayRestrictedDates.push(tempDate.format("YYYY-MM-DD"));
                    defaultMinNight = tempArrayDates.durationOfStay;

                }
                else if (tempDate.isSame(checkInDate)
                    && tempArrayDates.restrictionType.toLowerCase() == "minstayoncheckin".toLowerCase()
                    && checkOutDate.diff(checkInDate, 'days') < parseInt(tempArrayDates.durationOfStay)
                ) {
                    blThisDateRestrictedOnCheckIn = true;
                    blIsValidStay = false;
                    tempArrayRestrictedOnCheckInDates.push(tempDate.format("YYYY-MM-DD"));
                    defaultMinNight = tempArrayDates.durationOfStay;
                }
                //tempArrayRestrictedOnCheckInDates
            }

            tempDate.add(1, "days");
        }

    }



    var formatedSoldOutDate = fnBwConverTagsInNumberToSuperScript(moment(tempArrayClosedDates[0]).format(glblBwErrorMessageMomentDateFormat));
    var formatedRestrictedDate = fnBwConverTagsInNumberToSuperScript(moment(tempArrayRestrictedDates[0]).format(glblBwErrorMessageMomentDateFormat));
    var formatedRestrictedOnCheckInDate = fnBwConverTagsInNumberToSuperScript(moment(tempArrayRestrictedOnCheckInDates[0]).format(glblBwErrorMessageMomentDateFormat));

    if (blThisDateSoldOut) {
        if (tempArrayClosedDates.length > 1)
            htmlErrorMessage = "Rooms are not available on " + formatedSoldOutDate + " and other selected dates.";
        else
            htmlErrorMessage = "Rooms are not available on " + formatedSoldOutDate + ".";
    }
    else if (blThisDateRestricted) {
        htmlErrorMessage = formatedRestrictedDate + " is a restricted date. Minimum " + defaultMinNight + " nights stay required.";
    }
    else if (blThisDateRestrictedOnCheckIn) {
        htmlErrorMessage = formatedRestrictedOnCheckInDate + " is a restricted date. Minimum " + defaultMinNight + " nights stay required.";
    }
    else {
        //$('.booking-engine .t-datepicker').tDatePicker('hide');
        fnBwCloseAllDropDowns();
        htmlErrorMessage = "";
    }

    console.log(11111111111111111111);
    if (htmlErrorMessage != "") {
        if (typeof $(".booking-engine .calender-dynamic-text") != "undefined") {
            $(".booking-engine .calender-dynamic-text").remove();
        }
        $('.booking-engine .t-datepicker-days').append('<div class="calender-dynamic-text" style="display:none;"></div>');
        $('.booking-engine .calender-dynamic-text').show();
        $('.booking-engine .calender-dynamic-text').html(htmlErrorMessage);
        $('.booking-engine .calender-dynamic-text-mobile').html(htmlErrorMessage);
        $(".booking-engine .offerMsgWrap").html(htmlErrorMessage);
        //$(".booking-engine .offerMsgWrap").show();
        glblBwConfiguration.ErrorMessage = htmlErrorMessage;
        fnBwHoveCheckInCheckOutDateChange();
    }

}

function fnBwConverTagsInNumberToSuperScript(str) {
    return str.replace(/(\d+)(st|nd|rd|th)/, "$1<sup>$2</sup>");
}

function fnBwGetCheckOutCalendarEndDate(checkInDate) {
    console.log("fnBwGetCheckOutCalendarEndDate called");
    // console.log("fnBwGetCheckOutCalendarEndDate checkin date - ", checkInDate);
    var tempDate = moment(checkInDate);
    var maxCheckOutDate = moment(checkInDate).clone().add(361, "days");

    while (tempDate._d <= maxCheckOutDate._d) {
        tempDate.add(1, "days");
        //get weekday mon, tue etc
        tempDateDay = tempDate.day();

        if (tempDate._d > moment(glblBwConfiguration.offer.endDate)._d) {
            console.log("fnBwGetCheckOutCalendarEndDate - offer.endDate");
            break;
        }

        if (
            glblBwConfiguration.offer.disabledDaysOfWeek.length > 0 &&
            glblBwConfiguration.offer.disabledDaysOfWeek.indexOf(tempDateDay) != -1
        ) {
            console.log("fnBwGetCheckOutCalendarEndDate - Day of week");
            break;
        }

        if (
            glblBwConfiguration.offer.disabledDates.length > 0 &&
            glblBwConfiguration.offer.disabledDates.indexOf(tempDate.format("YYYY-MM-DD")) != -1
        ) {
            console.log("fnBwGetCheckOutCalendarEndDate - in disabled dates");
            break;
        }

        if (
            glblBwConfiguration.offer.disabledDateRange.exists &&
            tempDate._d >= moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate)._d &&
            tempDate._d <= moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeEndDate)._d
        ) {
            console.log("fnBwGetCheckOutCalendarEndDate - in disabled date range");
            break;
        }


        //if (glblBwConfiguration.AvailabilityAndPrice != null) {
        //    if (glblBwArrDoNotUseSoldOutDatesForHotels.indexOf(glblBwConfiguration.hotelCode.toUpperCase()) == -1) {
        //        var dateMomentString = tempDate.format("YYYY-MM-DD");
        //        if (glblBwConfiguration.AvailabilityAndPrice.indexOf(dateMomentString) != -1) {
        //            console.log("fnBwGetCheckOutCalendarEndDate - in not available dates");
        //            break;
        //        }
        //    }
        //}
    }
    console.log("fnBwGetCheckOutCalendarEndDate -- " + tempDate.format("YYYY-MM-DD"));
    return tempDate;
}

function fnBwShowCruisePopupScreen(_hotelcode) {
    $(".availability-cta .boxColumn").addClass('bEnginepopUp');
    $('body').css('overflow', 'hidden');
    $(".availability-cta .booking-engine").toggle();
    $('.bookingEnginePopOverlay').addClass('active');

    //setTimeout(function () {
    //    fnInitializeCruiseCalander(_hotelcode);
    //},100);

}


function fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget() {


    //$('.booking-engine .calender-dynamic-text').hide();
    //$('.booking-engine .calender-dynamic-text').html("");
    //$('.booking-engine .calanderBottomMessage').html("");


    //if (
    //    glblBwConfiguration.offer.disabledDateRange.exists &&
    //    moment(glblBwConfiguration.offer.disabledDateRangeTextToBeDisplayedTillDate)._d <= new Date()
    //) {
    //    var htmlMessage = glblBwConfiguration.offer.disabledDateRange.disabledDateRangeText;
    //    if (htmlMessage != "") {

    //        if (typeof $(".booking-engine .calender-dynamic-text") != "undefined") {
    //            $(".booking-engine .calender-dynamic-text").remove();
    //        }
    //        $('.booking-engine .t-datepicker-days:not(.layout2)').prepend('<div class="calender-dynamic-text" style="display:none;"></div>');

    //        $('.booking-engine:not(.layout2) .calender-dynamic-text').show();
    //        $('.booking-engine:not(.layout2) .calender-dynamic-text').html(htmlMessage);
    //        if ($('.booking-engine.layout2 .calanderBottomMessage').length > 0) {
    //            $('.booking-engine.layout2 .calanderBottomMessage').html(htmlMessage);
    //        }
    //    }
    //}

}

function fnBwIsAnyArray1DateExistInArray2(dateArray1, dateArray2) {
    var isMonthDateMatched = false;
    for (var i = 0; i < dateArray1.length; i++) {
        var strMonthAndDate1 = moment(dateArray1[i], "YYYY-MM-DD").format("YYYY-MM").toString();
        for (var j = 0; j < dateArray2.length; j++) {
            var strMonthAndDate2 = moment(dateArray2[j], "YYYY-MM-DD").format("YYYY-MM").toString();

            if (strMonthAndDate1 == strMonthAndDate2) {
                isMonthDateMatched = true;
            }
        }
    }

    return isMonthDateMatched;
}

function fnBwSetCheckOutDate() {


    if (glblBwConfiguration.hotelCode.toLocaleUpperCase() == "HBCOKVR") {

        if (glblBwConfiguration.offer.minNights > 1) {
            var checkInDate = moment(moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[0]).format("YYYY-MM-DD"));
            //update checkout date
            var checkOutDate = moment(moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[1]).format("YYYY-MM-DD"));

            var datedifference = checkOutDate.diff(checkInDate, 'days');
            if (glblBwConfiguration.offer.showNightBasedOfferDropdown
                ||
                datedifference < glblBwConfiguration.offer.minNights) {
                //alert(checkInDate.add(glblBwConfiguration.offer.minNights, 'days').format("YYYY-MM-DD"));
                $('.booking-engine .t-datepicker').tDatePicker('updateCI', checkInDate.format("YYYY-MM-DD"));
                $('.booking-engine .t-datepicker').tDatePicker('updateCO', checkInDate.add(glblBwConfiguration.offer.minNights, 'days').format("YYYY-MM-DD"));

                fnBwSetGlobalErrorMessage();
                //fnBwCloseAllDropDowns();
            }

        }
    }
    else {
        /*Add blank value on checkout calendar */
        $('.booking-engine .t-check-out .t-date-check-out').html('<label class="t-date-info-title">Check Out</label><span class="t-day-check-out"> </span><span class="t-month-check-out"> </span><span class="t-year-check-out"> </span></div>');
        $('.booking-engine .t-check-out input').val('');


        /*Remove required class from both checkin and checkout calendar */
        var elementSelector = ".booking-engine [data-t-date]";
        $(elementSelector).each(function () {
            if ($(this).hasClass("soldOutDate") == false || $(this).hasClass("t-disabled") == false) {
                $(this).removeClass("t-range t-highlighted t-end t-range t-range-limit");
                $(this).addClass("t-day");
            }
        });
    }
}

function fnBwDisplayInvalidNumberOfNightsSelectedMessage() {
    if (glblBwConfiguration.offer.showNightBasedOfferDropdown) {
        var checkInDate = moment(moment($('.booking-engine .t-datepicker').tDatePicker('getDates')[0]).format("YYYY-MM-DD"));
        var checkOutDate = moment(moment($('.booking-engine .t-datepicker').tDatePicker('getDates')[1]).format("YYYY-MM-DD"));
        var datedifference = checkOutDate.diff(checkInDate, 'days');
        if (datedifference != glblBwConfiguration.offer.minNights) {
            //display message
        }
    }
}

function fnBwCalendarAddNextPrevEventHandler() {

    $(".booking-engine .t-next,.booking-engine .t-prev").unbind();
    $(".booking-engine .t-next,.booking-engine .t-prev").click(function () {
        setTimeout(function () {

            fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget();

            //disable checkin calendar dates
            //if checkin calendar
            fnBwCheckInCalendarSetAvailabilityPriceMarketingAssetAndOthers();

            //disable checkout calendar dates
            //if checkout calendar
            fnBwCheckOutCalendarSetAvailabilityPriceMarketingAssetAndOthers();


            fnBwDisplayMarketingAssetsInCalendar();

            //this function change date  on hover for apperance purpose only
            fnBwHoveCheckInCheckOutDateChange();
        }, 1);
    });
}

function fnBwShowAdditionalHeaderForCalendarInMobile(objTDatepicker) {
    var objBE = $(objTDatepicker).closest('.booking-engine');
    $(objBE).find('.t-mobile-heading').show();
    $(objBE).find('.t-check-in-mobile').html($(objBE).find('.t-date-check-in').html());
    $(objBE).find('.t-check-out-mobile').html($(objBE).find('.t-date-check-out').html());
}

function fnBwHideAdditionalHeaderForCalendarInMobile() {
    $('.booking-engine .t-mobile-heading').hide();
    $('.booking-engine .t-datepicker').tDatePicker('hide');
}

function fnBwGetInitialCheckinDate() {
    var tempDate;
    var _startDate = moment(glblBwConfiguration.offer.startDate)._d;
    if (_startDate > glblBwToday)
        tempDate = moment(glblBwConfiguration.offer.startDate)
    else
        tempDate = moment().startOf('day');

    for (i = 0; i < 700; i++) {
        var blUseThisDate = true;
        var tempDateDay = tempDate.day();

        if (glblBwConfiguration.offer.disabledDaysOfWeek.length > 0 &&
            glblBwConfiguration.offer.disabledDaysOfWeek.indexOf(tempDateDay) != -1) {
            blUseThisDate = false;
        }

        if (glblBwConfiguration.offer.disabledDates.length > 0 &&
            glblBwConfiguration.offer.disabledDates.indexOf(tempDate.format("YYYY-MM-DD")) != -1) {
            blUseThisDate = false;
        }

        if (glblBwConfiguration.offer.disabledDateRange.exists &&
            tempDate._d >= moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate)._d &&
            tempDate._d <= moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeEndDate)._d) {
            blUseThisDate = false;
        }

        //check if today and any further dates available as per min nights required
        if (glblBwConfiguration.AvailabilityAndPrice != null) {
            if (glblBwArrDoNotUseSoldOutDatesForHotels.indexOf(glblBwConfiguration.hotelCode.toUpperCase()) == -1) {
                for (var i = 0; i < glblBwConfiguration.offer.minNights; i++) {
                    var dateMomentString = tempDate.clone().add(i, "days").format("YYYY-MM-DD");


                    var tempArrayDates = glblBwConfiguration.AvailabilityAndPrice.filter(function (item) {
                        return item.date == dateMomentString;
                    })[0];

                    if (typeof tempArrayDates != "undefined") {
                        if (tempArrayDates.restrictionType.toLowerCase() == "close") {
                            blUseThisDate = false;
                        }
                    }
                }
            }
        }

        if (blUseThisDate) {
            break;
        }
        tempDate.add(1, "days");
    }
    if (tempDate._d > moment(glblBwConfiguration.offer.endDate)._d) {
        var errMessage = "Either the booking engine has some problem or current offer is no more available. The website admin has been informed. Apologies for inconvenience.";
        fnBwSomeErrorOccredInBW(errMessage);
    }
    return tempDate;
}


function fnBwGuestShowHideGuestBasedOnAdultsOnClick() {
    /*guest reset*/

   

    setTimeout(function () {


        if ($('.booking-engine .DropDownExtraGuest').length > 0) {
            $(".extraAdult,.extraChild").show();
        }
        else {
            $(".extraAdult,.extraChild").hide();
            $(".extraAdult1").hide();
        }


        $(glblBwLastClickedObj).find('.noOfGuestWrap .addGuestDropDown .blockWrapper .block .roomGuestCount .choose.adult .number ul li.active').each(function () {

            $(this).closest('.number').find('li').removeClass('active');
            $(this).addClass('active');

            if ($('.DropDownExtraGuest').length > 0) {
                var _currIndex = $(this).index();
                var _this = $(this);
                var _childRemain = 3;
                $(this).closest('.block').find('.child .number ul li').hide();
                _childRemain = _childRemain - _currIndex - 1;
                for (i = 0; i <= _childRemain; i++) {
                    _this.closest('.block').find('.child .number ul li:eq(' + i + ')').show();
                }

                if ($(this).text() == 4) {
                    _this.closest('.block').find('.child .closeIcn').click();
                }
                
                if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDXBAZ" && $(this).text() <= 6) {
                   
                    $(this).closest('.block').find('.child .number ul li').show();
                    $(this).closest('.block').find('.child .number ul li.extraChild').hide();
                     
                }

            }


        });

    }, 10);

}


function fnBwGuestReset() {
/*guest reset*/

    $(glblBwLastClickedObj).find('.addGuestDropDown .blockWrapper .block').eq(0).find('.editBlock .closeIcn').click();
    //console.log('delet guest row: ' + i);

   

        $(glblBwLastClickedObj).find('.addGuestDropDown .individualRoomSection').eq(0).find('.adult .number li').removeClass('active');
        $(glblBwLastClickedObj).find('.individualRoomSection').eq(0).find('.adult .number li').eq(1).addClass('active');
        $(glblBwLastClickedObj).find('.individualRoomSection').eq(0).find('.child .number li').removeClass('active');
        $(glblBwLastClickedObj).find('.individualRoomSection').eq(0).find('.child .number li').css("display", "");
      
        $(glblBwLastClickedObj).find('.roomGuestCount').find('.adult .number li').removeClass('active');
        $(glblBwLastClickedObj).find('.roomGuestCount').find('.adult .number li').eq(1).addClass('active');
        $(glblBwLastClickedObj).find('.roomGuestCount').eq(0).find('.child .number li').removeClass('active');
        $(glblBwLastClickedObj).find('.roomGuestCount').eq(0).find('.child .number li').css("display", "");
        $(glblBwLastClickedObj).find('.roomGuestCount').find('.child .number li').css("display", "");
    
        $(glblBwLastClickedObj).find('.individualRoomSection').eq(0).find('.child .closeIcn').click();
        $(glblBwLastClickedObj).find('.roomGuestCount').eq(0).find('.child .closeIcn').click();
        $(glblBwLastClickedObj).find('.individualRoomSection').eq(0).find('.editBlock .edit').click();
      
        $(glblBwLastClickedObj).find('.block').eq(0).find('.child .closeIcn').click();
        $(glblBwLastClickedObj).find('.block').eq(0).find('.editBlock .edit').click();

    //setTimeout(function () { $(glblBwLastClickedObj).find('.actionWrap .actionButton').click(); }, 10);
    


   
}

function fnBwSetupBookingWidget(_hotelcode) {

    $(".booking-engine .offerMsgWrap").html("");
    $(".booking-engine .offerMsgWrap").hide();

    $(".booking-engine .checkInCheckOut").removeClass("cruiseCalenderDefaultScreen cruiseSelected");
    $(".booking-engine .checkInCheckOut").attr("onClick", "");
    $(".booking-engine.layout2 .selectEmbarkationBox").hide();
    $(".booking-engine .selectedEmbarkationDtls ").hide();

    /*select configuration by hotel code*/
    if (typeof arrBwConfiguration != "undefined") {
        glblBwConfiguration = arrBwConfiguration.filter(function (item) {
            return item.hotelCode.toLowerCase() == _hotelcode.toLowerCase();
        })[0];
    }


    if (glblBwConfiguration != null) {
        /*set hotel name and other details*/
        var objHotelNameCodesAndOtherDetails = JSON.parse(JSON.stringify(arrHotelNameCodesAndOtherDetails.filter(function (item) {
            return item.hotelCode.toLowerCase() == glblBwConfiguration.hotelCode.toLowerCase();
        })[0]));
        glblBwConfiguration.hotelName = objHotelNameCodesAndOtherDetails.hotelName;
        glblBwConfiguration.hotelCity = objHotelNameCodesAndOtherDetails.hotelCity;
        glblBwConfiguration.hotelCompleteName = objHotelNameCodesAndOtherDetails.hotelCompleteName;


        /*Remove cLasses and pointer events*/
        $('.booking-engine .checkInDate').removeClass('dateDisabled ');
        $('.booking-engine .checkOutDate').removeClass('dateDisabled');
        $(".booking-engine.bkhOffset .checkInDate").css("pointer-events", "auto");

        //Special Case philae and zahra
        if (_hotelcode.toLocaleUpperCase() == "HBASWZA" || _hotelcode.toLocaleUpperCase() == "HBASWPH") {
            $('.booking-engine .checkInDate').addClass('dateDisabled');
            $('.booking-engine .checkOutDate').addClass('dateDisabled');
            setTimeout(function () {
                fnInitializeCruiseCalander(_hotelcode);
            }, 5);

            if (typeof glblBwLastClickedObj != "undefined") {
                if (!glblBwLastClickedObj.hasClass("layout2")) {
                    fnBwShowCruisePopupScreen(_hotelcode);
                }
            }
        }
        //Special case for Kerala Vrinda
        else if (_hotelcode.toUpperCase() == "HBCOKVR") {
            /*temporary commented line number 2600*/
           // $('.booking-engine .checkOutDate').addClass('dateDisabled');
            if (typeof glblBwLastClickedObj != "undefined") {
                if (!glblBwLastClickedObj.hasClass("layout2")) {
                    fnBwShowCruisePopupScreen(_hotelcode);
                }
            }

            /*Add cLasses and pointer events*/
            $(".checkInCheckOut").addClass("cruiseSelected");
            $(".booking-engine.bkhOffset .checkInCheckIn").attr("onClick", "fnBwShowCruisePopupScreen()");
            $(".booking-engine.bkhOffset .checkInCheckOut").attr("onClick", "fnBwShowCruisePopupScreen()");
            $(".booking-engine.bkhOffset .checkInDate").css("pointer-events", "none");
            $(".booking-engine.bkhOffset .checkOutDate").css("pointer-events", "none");

        }



        glblBwConfiguration.offer = JSON.parse(JSON.stringify(arrBwMasterConfiguration.filter(function (item) {
            return item.offerCode.toLowerCase() == glblBwConfiguration.offerCode.toLowerCase();
        })[0]));

        fnBwSetAvailabilityAndPriceInConfiguration();


        /*Add disabledDateRange JSON to existing configuration as this is hotel specific not offer.
        /This is used to display dynamic message on calendar*/
        jsonDataBookingWidget.filter(function (item) {
            if (item.hotel_code == glblBwConfiguration.hotelCode) {
                var boolExists = true;
                if (item.from_date == "" || item.till_date == "") {
                    boolExists = false;
                }
                glblBwConfiguration.offer.disabledDateRange = { exists: boolExists, disabledDateRangeStartDate: item.from_date, disabledDateRangeEndDate: item.till_date, disabledDateRangeText: item.display_message, disabledDateRangeTextToBeDisplayedTillDate: item.till_date };

            }
        })[0];



        /*Add rpcBasisOnDurationOfStay and all required JSON to existing configuration as this is hotel specific not offer.*/
        //if (glblBwConfiguration.hotelCode.toUpperCase() == "HBCOKVR") {
        //    glblBwConfiguration.offer.showNightBasedOfferDropdown = true;
        //    glblBwConfiguration.offer.rpcVaryOnDurationOfStay = false;
        //    glblBwConfiguration.offer.rpcBasisOnDurationOfStay = [{ "label": "2 Nights and 3 Days", "minNights": 2, "blExactNights": true, "rpc": "", "blackedOutDateRanges": [], "ratePlanCodes": [] }, { "label": "3 Nights and 4 Days", "minNights": 3, "blExactNights": true, "rpc": "", "blackedOutDateRanges": [], "ratePlanCodes": [] }];
        //}

        //hide children based on configuration
        fnBwHideChildrenBasedOnConfiguration(glblBwConfiguration.offer.hideChildrenSelectionBox);

        //set offer end date to 1 less than what is given as last date is only for checkout
        //var momentTempEndDate = moment(glblBwConfiguration.offer.endDate);
        //momentTempEndDate = momentTempEndDate.subtract(1, 'days');
        //glblBwConfiguration.offer.endDate = momentTempEndDate.format("YYYY-MM-DD");





        //check if offer is expired
        if (glblBwConfiguration.offer.offerAvailableTillDate != null) {
            var offerAvailableTillDate = moment(glblBwConfiguration.offer.offerAvailableTillDate);
            if (offerAvailableTillDate.isValid() && offerAvailableTillDate._d < glblBwToday) {
                glblBwConfiguration.offer.startDate = "2000-01-01";
                glblBwConfiguration.offer.endDate = "2000-01-02";
            }
        }

        //add to discabled dated
        fnBwAddToDisabledDates();

        //add to disabled dates basis on enabled dates list
        fnBwAddToDisabledDatesBasisOnEnabledDatesList();

        console.log("_hotelcode---" + _hotelcode);       
        //change the following code as it is now using a patch to see if this is an offer page or not
        if ((_hotelcode == 'HBCCUOB' || _hotelcode == 'HBDXBOB' || _hotelcode == 'HBDXBAZ') && glblBwConfiguration.offer.offerCode.toLowerCase().indexOf('default') != -1) {
            $('.booking-engine .addGuestDropDown').addClass('DropDownExtraGuest'); 

            if (_hotelcode == 'HBDXBAZ') {
                $('.roomGuestCount').addClass('alzorah-guests');
            }
            else {
                $('.roomGuestCount').removeClass('alzorah-guests');
            }
        }
        else {
            $('.booking-engine .addGuestDropDown').removeClass('DropDownExtraGuest');
        }

       fnBwGuestReset();
        $('.booking-engine .allHotels li').removeClass('active');
        $('.booking-engine .allHotels li[data-hotelcode="' + _hotelcode + '"]').addClass('active');
        $('.booking-engine .hotelListDropDown').hide();
        var _layout2HotelNameHTML = "<abbr>" + glblBwConfiguration.hotelCity + "</abbr>" + glblBwConfiguration.hotelName;
        $('.booking-engine .hotelName .hotelLabel .name .mobileN').html(_layout2HotelNameHTML);
        var _hotelName = "";
        $('.booking-engine').find('.hotelName .hotelLabel .name .desktopN').html(glblBwConfiguration.hotelCompleteName);


        //Set default adult 
        fnBwSetDefaultAdult();

        //Add Disabled DateRange Text To Calender
        fnBwAddDisabledDateRangeTextToCalenderAndBookingWidget();

        //show or hide Night Based Offer Dropdown
        fnBwShowAndBindNightBasedOfferDropdown();

        //set promocode prefilled value
        fnBwPrefillPromocode();

        //initialize calendar
        fnBwInitializaCalendar();       
    }
    else {
        fnBwSomeErrorOccredInBW("configuration data for hotel code '" + _hotelcode + "' not found");
    }

}

//set price availability in glblBwConfiguration
function fnBwSetAvailabilityAndPriceInConfiguration() {

    var hotelofferingid = "";
    if (glblBwConfiguration.hotelCode.toUpperCase() == "HBCOKVR") {
        hotelofferingid = glblBwConfiguration.hotelCode + "-" + glblBwConfiguration.offer.minNights;
    }
    else {
        hotelofferingid = glblBwConfiguration.hotelCode;
    }

    console.log("hotelofferingid=" + hotelofferingid);

    var hotelAvailabilityAndPriceData = arrCalendarSoldOutDates.filter(function (item) {
        return item.hotelofferingid.toLowerCase() == hotelofferingid.toLowerCase();
    })[0];

    if (hotelAvailabilityAndPriceData != null)
        glblBwConfiguration.AvailabilityAndPrice = hotelAvailabilityAndPriceData.dates;
    else
        glblBwConfiguration.AvailabilityAndPrice = null;
}

function fnBwPrefillPromocode() {
    $(".booking-engine .promocodeDropDown .promocode").val("");
    $(".booking-engine .promocodeDropDown .promocode").prop('disabled', false);

    if (typeof glblBwConfiguration.offer.promoCodePreFilledValue != "undefined" && glblBwConfiguration.offer.promoCodePreFilledValue != "") {
        $(".booking-engine .promocodeDropDown .promocode").val(glblBwConfiguration.offer.promoCodePreFilledValue);
        if (typeof glblBwConfiguration.offer.promoCodePreFilledNotEditable != "undefined" && glblBwConfiguration.offer.promoCodePreFilledNotEditable === true) {
            $(".booking-engine .promocodeDropDown .promocode").prop('disabled', true);
        }
    }
}

function fnBwDoesCheckInCheckOutDatesFallInBlackedOutDateRange(blackedOutDateRanges) {

    console.log("fnBwDoesCheckInCheckOutDatesFallInBlackedOutDateRange called");
    if (typeof blackedOutDateRanges == 'undefined') {
        return false;
    }
    else {
        var momentCheckInDate = moment(glblBwCheckindate);
        var momentCheckOutDate = moment(glblBwCheckoutdate);
        var blBlackoutDayMatched = false;
        blackedOutDateRanges.forEach(function (item) {
            var momentBlackedOutRangeStartDate = moment(item.startDate);
            var momentBlackedOutRangeEndDate = moment(item.endDate);
            if (momentCheckInDate._d >= momentBlackedOutRangeStartDate._d && momentCheckInDate._d <= momentBlackedOutRangeEndDate._d) {
                console.log("checkin blackout day matched");
                //alert("blackout day matched error");
                blBlackoutDayMatched = true;
            }
            if (momentCheckOutDate._d >= momentBlackedOutRangeStartDate._d && momentCheckOutDate._d <= momentBlackedOutRangeEndDate._d) {
                console.log("checkout blackout day matched");
                //alert("blackout day matched error");
                blBlackoutDayMatched = true;
            }
        });

        if (blBlackoutDayMatched) {
            console.log("fnBwDoesCheckInCheckOutDatesFallInBlackedOutDateRange returning true");
            return true;
        }
        else {
            console.log("fnBwDoesCheckInCheckOutDatesFallInBlackedOutDateRange returning false");
            return false;
        }
    }
}

function fnBwHideChildrenBasedOnConfiguration(hideChildrenSelectionBox) {

    if (hideChildrenSelectionBox) {
        $(".booking-engine .choose.child,.roomChild").hide();

        setTimeout(function () {
            $('.booking-engine .child li').each(function () {
                $(this).removeClass("active");
            });

            $('.booking-engine .childAgeWrap li').each(function () {
                $(this).removeClass("active");
            });

            $('.booking-engine .childAgeWrap').hide();

        }, 5);

    }
    else {
        $(".booking-engine .choose.child,.roomChild").show();
            $('.booking-engine .child li').each(function () {

                // if (glblBwConfiguration.hotelCode.toLocaleUpperCase() == "HBHRGOB") {
                //     if ($(this).text().indexOf("2") != -1) {
                //         $(this).removeClass("active");
                //         $(this).hide();
                //     }
                // }
                // else {
                //     $(this).show();
                // }
               
            });

            $('.booking-engine .childAgeWrap.childAge2 li').each(function () {
                // if (glblBwConfiguration.hotelCode.toLocaleUpperCase() == "HBHRGOB") {
                //     $(this).removeClass("active");
                //     $('.booking-engine .childAgeWrap.childAge2').hide();

                //     $('.booking-engine .individualRoomSection .roomGuestCount .roomChild').each(function () {
                //         if ($(this).text().indexOf("2") != -1) {
                //             console.log($(this).text("  ,1 Children"));
                //         }
                //     });
                // }
                // else {
                //     //$('.booking-engine .childAgeWrap.childAge2').show();
                // }
            });
    }
}

function fnBwAddToDisabledDates() {

    if (typeof glblBwConfiguration.offer.blackedOutDateRanges != "undefined" && glblBwConfiguration.offer.blackedOutDateRanges.length > 0) {

        for (var bindex = 0; bindex < glblBwConfiguration.offer.blackedOutDateRanges.length; bindex++) {
            var _tempDisabledDates = fnBwEnumerateDateFromStartAndEndDates(glblBwConfiguration.offer.blackedOutDateRanges[bindex].startDate, glblBwConfiguration.offer.blackedOutDateRanges[bindex].endDate, []);

            for (var disdates = 0; disdates < _tempDisabledDates.length; disdates++) {                
                glblBwConfiguration.offer.disabledDates.push(_tempDisabledDates[disdates]);
            }
        }       
    }
}

function fnBwAddToDisabledDatesBasisOnEnabledDatesList() {

    if (typeof glblBwConfiguration.offer.enabledDateRanges != "undefined" && glblBwConfiguration.offer.enabledDateRanges.length > 0) {
        var tempMoment = moment(glblBwConfiguration.offer.startDate);
        var momentEndDate = moment(glblBwConfiguration.offer.endDate);
        while (tempMoment._d <= momentEndDate._d) {
            var blDateDisabled = true;
            glblBwConfiguration.offer.enabledDateRanges.forEach(function (item) {
                var momentEnabledRangeStartDate = moment(item.startDate);
                var momentEnabledRangeEndDate = moment(item.endDate);
                if (tempMoment._d >= momentEnabledRangeStartDate._d && tempMoment._d < momentEnabledRangeEndDate._d) {
                    blDateDisabled = false;
                }
            });
            if (blDateDisabled) {
                glblBwConfiguration.offer.disabledDates.push(tempMoment.format("YYYY-MM-DD"));
            }
            tempMoment.add(1, "days");
        }
    }
}

function fnBwShowAndBindNightBasedOfferDropdown() {

    console.log("fnBwShowAndBindNightBasedOfferDropdown called");

    if (glblBwConfiguration.offer.showNightBasedOfferDropdown) {
        //bind nights dropdown data

        var nightsDropdownHtml = "";
        var nightBasedOfferDropdownValues = glblBwConfiguration.offer.rpcBasisOnDurationOfStay;
        for (i = 0; i < nightBasedOfferDropdownValues.length; i++) {
            var active = (i == 0) ? "class='active'" : "";
            var minNights = nightBasedOfferDropdownValues[i].minNights;
            var blExactNights = nightBasedOfferDropdownValues[i].blExactNights;
            var additionalRpcArrayString = nightBasedOfferDropdownValues[i].additionalRpcArrayString;

            var nightsDropdownOption = "<li " + active + " blExactNights = " + blExactNights + " rpc = '" + nightBasedOfferDropdownValues[i].rpc + "' additionalRpcArrayString = '" + additionalRpcArrayString.replace(/'/g, "\"") + "' value='" + minNights + "'>" + nightBasedOfferDropdownValues[i].label + "</li>";
            nightsDropdownHtml += nightsDropdownOption;
        }
        console.log("nightsDropdownHtml", nightsDropdownHtml);

        $(".booking-engine .NumberOfNights .NumberOfNightsDropDown ul").html(nightsDropdownHtml);
        if (glblBwConfiguration.offer.thisOfferIsBasedOnExactDropdownSelection) {
            $(".booking-engine .NumberOfNights .NumberOfNightsDropDown ul").addClass("thisOfferIsBasedOnExactDropdownSelection");
        }


        //set globalConfig MinNights value
        $(".booking-engine .NumberOfNights .desktopN").html(nightBasedOfferDropdownValues[0].label);
        var minNights = nightBasedOfferDropdownValues[0].minNights;
        glblBwConfiguration.offer.minNights = minNights;
        glblBwConfiguration.offer.rpc = nightBasedOfferDropdownValues[0].rpc;
        $(".booking-engine.layout2 .NumberOfNights").show();

        //night based offer dropdown - on change
        $(".booking-engine .NumberOfNights .NumberOfNightsDropDown ul li").unbind();
        $(".booking-engine .NumberOfNights .NumberOfNightsDropDown ul li").click(function () {

            //2222222222222222222222222222222222222222222
            console.log(".booking - engine.NumberOfNights.NumberOfNightsDropDown ul li click called");



            $(".booking-engine .NumberOfNights .NumberOfNightsDropDown ul li").removeClass("active");

            $(".booking-engine .NumberOfNights .NumberOfNightsDropDown ul li").removeClass("active");
            $(this).addClass("active");

            $(".booking-engine .NumberOfNights .desktopN").html($(this).html());
            $(".booking-engine .NumberOfNights .NumberOfNightsDropDown").hide();
            $('.booking-engine .NumberOfNightsLabel').removeClass('active');
            glblBwConfiguration.offer.minNights = parseInt($(this).val());
            glblBwConfiguration.offer.blExactNights = ($(this).attr("blExactNights") == "true");
            glblBwConfiguration.offer.rpc = $(this).attr("rpc");
            glblBwConfiguration.offer.rpcBasisOnDurationOfStayIndex = $(this).index();
            // set price and availability in configuration
            fnBwSetAvailabilityAndPriceInConfiguration();
            fnBwInitializaCalendar();
        });

        //add code to add or remove container class
        $(".booking-engine.bkhOffset").parents().eq(0).removeClass("container");
        $(".booking-engine.bkhOffset").parents().eq(0).addClass("container-offer-page");
    }
    else {
        $(".booking-engine .NumberOfNights").hide();
        //add code to add or remove container class
        $(".booking-engine.bkhOffset").parents().eq(0).removeClass("container-offer-page");
        $(".booking-engine.bkhOffset").parents().eq(0).addClass("container");
    }
}

/*If array containg hotelcode then these hotels willwill be visible in booking widget else all*/
function fnBwRemoveFromHotelsDropdownHotelsNotInConfigData() {
    console.log("fnBwRemoveFromHotelsDropdownHotelsNotInConfigData called");
    $('.booking-engine .allHotels li').each(function () {
        var _hotelCode = $(this).attr('data-hotelcode');
        var tempArray = arrBwConfiguration.filter(function (item) {
            return item.hotelCode.toLowerCase() == _hotelCode.toLowerCase();
        });
        if (tempArray.length == 0)
            $(this).remove();
    });


    var isGlobalPage = false;

    var currentURLPath = document.location.pathname.toLocaleLowerCase();

    if (currentURLPath.startsWith("/special-offers")
        || currentURLPath.startsWith("/partner")
        || currentURLPath.startsWith("/conferences-and-events")
        || currentURLPath.startsWith("/alliances")
        || currentURLPath.startsWith("/mmt-staypackage")
    ) {
        isGlobalPage = true;
    }
    else if (typeof ConfigurationName != "undefined" && ConfigurationName == "") {
        isGlobalPage = true;
    }

    if (typeof glblIsAHotelSpecificPage != "undefined") {
        if (!glblIsAHotelSpecificPage) {
            isGlobalPage = true;
        }
    }


    $('.booking-engine').each(function (index) {
        if (!isGlobalPage) {
            $('.booking-engine .hotelName').addClass('NoClick');
        }
        else {
            if ($('.booking-engine:eq(' + index + ')').length > 0) {
                $('.booking-engine:eq(' + index + ') .allHotels ul').each(function () {
                    if ($(this).html().trim() == "") {

                        if ($(".booking-engine:eq(0) [data-hotelcode]").length < 20) {
                            $(this).parents(".hotelList").parents(".allHotels").parents(".hotelListDropDown").addClass('singleHotelList');
                        }

                        $(this).parents(".hotelBlock").remove();
                    }
                });

                var hotelListCount = $('.booking-engine:eq(' + index + ') .allHotels ul li').length;
                if (hotelListCount == 1) {
                    $('.booking-engine .hotelName').addClass('NoClick');
                }
            }
        }

    });

}


/*hotel list dropdown direction basis on booking widget position*/
var glblBwCheckOffsetPosOfBE;
var fnBwDropDownPosition;
function fnBwSetHorizontalBookingWidgetOffsetEvaluation() {
    if ($('.booking-engine.bkhOffset').length) {
        setTimeout(function () {
            glblBwCheckOffsetPosOfBE = $('.booking-engine.bkhOffset').offset().top;
            fnBwDropDownPosition();
            $(window).scroll(function () {
                fnBwDropDownPosition();
            });
        }, 300);
    }
    fnBwDropDownPosition = function () {
        // top/bottom positioning
        var _scrollTop = $(window).scrollTop();
        var _checkCurrPosOfBE = glblBwCheckOffsetPosOfBE - _scrollTop;

        if (_checkCurrPosOfBE > glblBwWinH / 2) {
            $('.booking-engine').addClass('reverse');
        } else {
            $('.booking-engine').removeClass('reverse');
        }
        // left/right positioning
        $('.booking-engine').each(function () {
            var _leftOffset = $(this).offset().left;
            var _currWidth = $(this).width();
            if (_leftOffset > (glblBwWinW / 2)) {
                $(this).addClass('right');
            } else {
                $(this).addClass('left');
            }
        });
    }

}
$(window).load(function () {
    fnBwSetHorizontalBookingWidgetOffsetEvaluation();
});

$(document).ready(function () {
    console.log("ready called");

    //bind event handlers
    fnBwBindEventHandlers();

    //code to remove hotels from hotels dropdown if they are not in config data
    fnBwRemoveFromHotelsDropdownHotelsNotInConfigData();
    //code to initialize the booking widget for default hotel

    //if (typeof PageSection != "undefined") {
    //    if (PageSection != "offer") {
    //        glblBwDefaultHotelCode = $(".booking-engine:eq(0) ul li[data-hotelcode]:eq(0)").data("hotelcode");
    //    }
    //}

    fnBwSetHotelSelectedByHotelCode(glblBwDefaultHotelCode);
    //this is fired in $(document).ready(function () {}); in backendtasks.js

    //function use for ExperienceDetailspage Only
    fnBwRemoveFromHotelsDropdownHotelsForExperienceDetailsPage();

});


function fnBwgetMarketingAssetsMessageByHotel(_hotelcode) {
    var arrData = [];

    if (typeof arrCalendarMarketingAssetsMessage != "undefined" && typeof _hotelcode != "undefined") {
        for (var i = 0; i < arrCalendarMarketingAssetsMessage.length; i++) {
            if (arrCalendarMarketingAssetsMessage[i].hotelcode.toLowerCase() == _hotelcode.toLowerCase()) {
                arrData.push(arrCalendarMarketingAssetsMessage[i]);
                break;
            }
        }
    }

    return arrData;
}


function fnBwDisplayDynamicMesageInCalendar() {

    console.log("fnBwDisplayDynamicMesageInCalendar called");
    $('.booking-engine .calender-dynamic-text').hide();
    $('.booking-engine .calender-dynamic-text-mobile').html("");

    if (
        glblBwConfiguration.offer.disabledDateRange.exists &&
        moment()._d < moment(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeTextToBeDisplayedTillDate)._d

    ) {
        var htmlMessage = glblBwConfiguration.offer.disabledDateRange.disabledDateRangeText;
        if (htmlMessage != "") {


            /*Get hotelcode of current active hotel*/
            var activeHotelCode = glblBwConfiguration.hotelCode;
            /*Get date array from json data by enemurating start and end date*/
            var arrHotelSpecificDateArray = fnBwEnumerateDateFromStartAndEndDates(glblBwConfiguration.offer.disabledDateRange.disabledDateRangeStartDate, glblBwConfiguration.offer.disabledDateRange.disabledDateRangeEndDate, []);

            /*Get date array from ViewPort either from Desktop or on scroll on mobile*/
            var momentDates = fnBwDisplayMonthINCalenderInViewport();

            /*bool check if any date and month available in calendar vieePort matched in array of hotel specific date array*/
            var isMonthDateMatched = fnBwIsAnyArray1DateExistInArray2(momentDates, arrHotelSpecificDateArray);


            if (isMonthDateMatched) {
                if (typeof $(".booking-engine .calender-dynamic-text") != "undefined") {
                    $(".booking-engine .calender-dynamic-text").remove();
                }
                $('.booking-engine .t-datepicker-days').append('<div class="calender-dynamic-text" style="display:none;"></div>');

                $('.booking-engine .calender-dynamic-text').show();
                $('.booking-engine .calender-dynamic-text').html(htmlMessage);

                $('.booking-engine .calender-dynamic-text-mobile').html(htmlMessage);
                //if ($('.booking-engine.layout2 .calanderBottomMessage').length > 0) {
                //    $('.booking-engine.layout2 .calanderBottomMessage').html(htmlMessage);
                //}
            }
        }
    }
    fnBwCheckInCalendarDisableDatesInDateRange();
}

function fnBwDisplayMarketingAssetsInCalendar() {

    console.log("fnBwDisplayMarketingAssetsInCalendar called");
    /* global variable declared at the start*/
    if (glblBwDisplayMA) {
        // $('.booking-engine .marketingAssetsMessage').html("");
        $(".booking-engine .calender-dynamic-text-ma").html("");
        $(".booking-engine .calender-price-msg").html("");

        /*Get hotelcode of current active hotel*/
        var activeHotelCode = glblBwConfiguration.hotelCode;

        /*Get json data of 1 hotel*/
        var jsonData = fnBwgetMarketingAssetsMessageByHotel(activeHotelCode);
        if (jsonData.length > 0) {

            /*Get date array from json data by enemurating start and end date*/
            var arrHotelSpecificDateArray = fnBwEnumerateDateFromStartAndEndDates(fnBwgetMarketingAssetsMessageByHotel(activeHotelCode)[0].start_date, fnBwgetMarketingAssetsMessageByHotel(activeHotelCode)[0].end_date, []);

            /*Get date array from ViewPort either from Desktop or on scroll on mobile*/
            var momentDates = fnBwDisplayMonthINCalenderInViewport();

            /*bool check if any date and month available in calendar vieePort matched in array of hotel specific date array*/
            var isMonthDateMatched = fnBwIsAnyArray1DateExistInArray2(momentDates, arrHotelSpecificDateArray);


            $(".booking-engine .calender-dynamic-text-ma").remove();
            $('.booking-engine .t-datepicker-days').prepend('<div class="calender-dynamic-text-ma"></div>');

            if (isMonthDateMatched) {
                fnBwDisplayMarketingFlag(arrHotelSpecificDateArray);
                var finalMessage = "<span>" + fnBwgetMarketingAssetsMessageByHotel(activeHotelCode)[0].display_message + "</span>";
                // $('.booking-engine .marketingAssetsMessage').html(finalMessage);
                $(".booking-engine .calender-dynamic-text-ma").html(finalMessage);
            }

        }
        $(".booking-engine .calender-price-msg").remove();
        /*$('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">All Prices are in INR and for a single guest</div>');*/

    }

    if (fnBwBoolShowPricesOnHotels()) {
        if (glblBwConfiguration.hotelCode.toUpperCase() == "HBJAIVA".toUpperCase()) {
            $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Closed due to monsoon in July and August. Reopening on 1st September.</div>');
        }
        else {
            if (glblBwConfiguration.hotelCode.toUpperCase() == "HBMRUTO".toUpperCase()) {
                $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">USD</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }
            else if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDXBAZ".toUpperCase()) {
                $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">AED</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }
            else if (glblBwConfiguration.hotelCode.toUpperCase() == "HTLMRCO".toUpperCase()) {
                $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">MAD</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }
            else if (glblBwConfiguration.hotelCode.toUpperCase() == "HBHRGOB".toUpperCase()) {
                $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">USD</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }
            else if (glblBwConfiguration.hotelCode.toUpperCase() == "HBMEDOB".toUpperCase()) {
                $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">USD</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }
            else if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDPSOB".toUpperCase() || glblBwConfiguration.hotelCode.toUpperCase() == "HBAMIOB".toUpperCase()) {
                $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">IDR</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }
            else {
                $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">INR</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }           
        }
    }

    if (fnBwBoolShowPricesOnHotelsBaliLombok()) {
        if (glblBwConfiguration.hotelCode.toUpperCase() == "HBJAIVA".toUpperCase()) {
            $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Closed due to monsoon in July and August. Reopening on 1st September.</div>');
        }
        else {        
             if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDPSOB".toUpperCase() || glblBwConfiguration.hotelCode.toUpperCase() == "HBAMIOB".toUpperCase()) {
                 $('.booking-engine .t-datepicker-days').prepend('<div class="calender-price-msg">Prices are in <span class="priceBold">IDR</span>, for a 01 night stay. Better offers may be available for longer stays.</div>');
            }          
        }
    }

    if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDXBAZ".toUpperCase()) {

        if (typeof $(".booking-engine .calender-dynamic-text") != "undefined") {
            $(".booking-engine .calender-dynamic-text").remove();
        }

        var htmlErrorMessage = glblBwConfiguration.offer.disabledDateRange.disabledDateRangeText;
        $('.booking-engine .t-datepicker-days').append('<div class="calender-dynamic-text" style="display:none;"></div>');
        $('.booking-engine .calender-dynamic-text').show();
        $('.booking-engine .calender-dynamic-text').html(htmlErrorMessage);
        $('.booking-engine .calender-dynamic-text-mobile').html(htmlErrorMessage);
        // $(".booking-engine .offerMsgWrap").html(htmlErrorMessage);
    }

    /* Display dynamic message till checking date is less than disabledDateRangeTextToBeDisplayedTillDate in arrOfferMasterList*/

    if (glblBwConfiguration.hotelCode.toUpperCase() != "HBDXBAZ".toUpperCase()) {
        fnBwDisplayDynamicMesageInCalendar();
    }
}

function fnBwDisplayMarketingFlag(arrDates) {
    setTimeout(function () {

        if (arrDates.length > 0) {
            $(".booking-engine [data-t-date]").each(function () {
                if (moment(moment(parseInt($(this).attr("data-t-date"))).format("YYYY-MM-DD"))._d >= glblBwToday) {
                    if (arrDates.indexOf(moment(parseInt($(this).attr("data-t-date"))).format("YYYY-MM-DD")) != -1) {
                        if (!$(this).hasClass("soldOutDate")) {
                            $(this).addClass("marketingFlag");
                        }
                    }
                }
            });
        }

    }, 10);
}

function scrollBindOnCalenderOpenINmobileView(objThis) {


    clearTimeout($.data(this, "scrollCheck"));

    $.data(this, "scrollCheck", setTimeout(function () {

        if ($(objThis).closest(".booking-engine").hasClass("booking-engine")) {
            fnBwDisplayMarketingAssetsInCalendar();
            // console.log(1);
        }
        else if ($(objThis).closest(".booking-engine-ev").hasClass("booking-engine-ev")) {
            fnEvBwDisplayMarketingAssetsInCalendar($(objThis).closest('.greyRow'));
            // console.log(2);
        }
    }, 250));
}


function fnBwCheckInView(elem, partial) {
    var container = $(".booking-engine .t-datepicker-day");
    var contHeight = container.height();
    var contTop = container.scrollTop();
    var contBottom = contTop + contHeight;

    var elemTop = $(elem).offset().top - container.offset().top;
    var elemBottom = elemTop + $(elem).height();

    var isTotal = (elemTop >= 0 && elemBottom <= contHeight);
    var isPart = ((elemTop < 0 && elemBottom > 0) || (elemTop > 0 && elemTop <= container.height())) && partial;


    return isTotal || isPart;
}

function fnBwDisplayMonthINCalenderInViewport() {

    var arrayMomentDate = [];

    if ($('.booking-engine .t-datepicker-day').length > 0) {
        var result = "";
        $.each($(".booking-engine .t-datepicker-day .t-table-wrap"), function (i, e) {
            result += "|" + fnBwCheckInView($(e), true);

        });
        //console.log(result);
        var arr1 = result.split('|');
        var month = "";
        for (var i = 0; i < arr1.length; i++) {

            if (arr1[i] == 'true') {

                month += $('.booking-engine .t-datepicker-day .t-table-wrap').eq(i - 1).find('.t-month').text() + ",";
            }
        }

        var arrayMonth = month.split(",");
        arrayMomentDate = [];

        if (arrayMonth.length > 0) {
            for (var i = 0; i < arrayMonth.length; i++) {
                if (arrayMonth[i] != "") {
                    var momentDate = moment(arrayMonth[i] + " 01", "MMM YYYY DD").format("YYYY-MM-DD");
                    arrayMomentDate.push(momentDate);

                }
            }
        }


    }

    return arrayMomentDate;
}

function fnBwEnumerateDateFromStartAndEndDates(startDate, endDate, datearrayToExclude) {

    var arr = [];
    var dt = new Date(startDate);
    while (dt <= new Date(endDate)) {
        if (datearrayToExclude.length > 0) {
            if (datearrayToExclude.indexOf(moment(new Date(dt)).clone().format("YYYY-MM-DD")) == -1) {
                arr.push(moment(new Date(dt)).clone().format("YYYY-MM-DD"));
            }
        }
        else {
            arr.push(moment(new Date(dt)).clone().format("YYYY-MM-DD"));
        }

        dt.setDate(dt.getDate() + 1);
    }
    return arr;
};
//backend tasks.js

/* Get hotelcode by synxis code for card abandoment pop up (Marketing asset)  */
function fnBwGetHotelCodeBySynxisCode(synxisCode) {

    /* Note hotelcode HBBOMOT is for Trident Nariman Point Mumbai
       This code is used on Offer /lp/hotels-in-mumbai/sugardoctormedicarellp
    */
    var hotelTrustCode = "";

    var arrSynxixCodeAndHotelCode = {
        "_5258": "HBDPSOB",
        "_5269": "HBBLROB",
        "_5272": "HBDELOG",
        "_5266": "HBAMIOB",
        "_5287": "HBMRUTO",
        "_5270": "HBBOMOB",
        "_5280": "HBDELOB",
        "_5283": "HBHRGOB",
        "_5256": "HBAGROB",
        "_5274": "HBDXBAZ",
        "_5289": "HBSLVOB",
        "_5282": "HBDXBOB",
        "_5257": "HBCCUOB",
        "_5265": "HBCOKVR",
        "_5264": "HBASWPH",
        "_5276": "HBJAIOB",
        "_5275": "HBIXCOB",
        "_5261": "HBUDROB",
        "_5285": "HBJAIVA",
        "_48143": "HBJAIVIND",
        "_5267": "HBASWZA",
        "_5286": "HBMEDOB",
        "_5255": "HBSLVWH"
    };

    if (arrSynxixCodeAndHotelCode["_" + synxisCode] != undefined)
        hotelTrustCode = arrSynxixCodeAndHotelCode["_" + synxisCode];
    else {
        console.log("hotelTrustCode -- " + hotelTrustCode);
    }

    return hotelTrustCode;
}

/*Convert number to comma separated*/
function fnBwNumberWithCommas(number) {
    var tempNum = "";
    if (typeof number != "undefined") {
        number = number.toString();
        number = number.replace(/,/g, '');
        var parts = number.toString().split(".");
        parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
        tempNum = parts.join(".");
    }
    else {
        tempNum = number;
    }

    return tempNum;
}

function fnBwIsDateLiesFromAndBetweenTwoDates(from, to, check, dateformat) {
    var isvalidDate = false;

    try {

        var momentcheck = moment(check, dateformat).clone(); //Dateformat for moment
        var momentFromDate = moment(from, dateformat).clone(); //Dateformat for moment
        var momentToDate = moment(to, dateformat).clone(); //Dateformat for moment
        if (momentcheck >= momentFromDate && momentcheck <= momentToDate) {
            isvalidDate = true;
        }
        else {
            isvalidDate = false;
        }
    }

    catch (exx) {
        isvalidDate = false;
    }

    return isvalidDate;
}

var tempRpcArrayTest;
function fnBwGetRpc() {
    //returns rpc by checking:
    //offer stay condition is matched or not
    //offer blackout dates are selected or not
    //debugger;
    var _ratePlanCode = "";
    var momentCheckInDate;
    var momentCheckOutDate;

    if (typeof glblBwLastClickedObj != "undefined") {
        momentCheckInDate = moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[0]).format("YYYY-MM-DD");
        momentCheckOutDate = moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[1]).format("YYYY-MM-DD");
    }
    else {
        momentCheckInDate = moment($('.booking-engine:eq(0) .t-datepicker').tDatePicker('getDates')[0]).format("YYYY-MM-DD");
        momentCheckOutDate = moment($('.booking-engine:eq(0) .t-datepicker').tDatePicker('getDates')[1]).format("YYYY-MM-DD");
    }


    glblBwCheckincheckoutdatedifference = parseInt(getDateDifference(momentCheckInDate, momentCheckOutDate, "YYYY-MM-DD"));


    if (glblBwConfiguration.offer.rpcVaryOnDurationOfStay == true) {
        //check date differnce
        //check from list of rate codes if any of this is valid
        var tempArray;


        /*If in CMS "Is Exact Night Required" checked */
        /*If item minNights matched with checin checkout days difference */
        tempArray = glblBwConfiguration.offer.rpcBasisOnDurationOfStay.filter(function (item) {
            return item.minNights == glblBwCheckincheckoutdatedifference;
        });

        /*If length of tempArray is greate than 0 ite means nights matched then get rate plan code and assign to variable _ratePlanCode */
        if (tempArray.length > 0) {
            _ratePlanCode = tempArray[0].rpc;

            if (typeof tempArray[0].blackedOutDateRanges != null) {
                if (fnBwDoesCheckInCheckOutDatesFallInBlackedOutDateRange(tempArray[0].blackedOutDateRanges)) {
                    _ratePlanCode = "";
                }
            }
        }

        /*If in CMS "Is Exact Night Required"  is unchecked */
        tempArray = glblBwConfiguration.offer.rpcBasisOnDurationOfStay.filter(function (item) {
            return (glblBwCheckincheckoutdatedifference >= item.minNights) && (item.blExactNights == false);
        });


        if (tempArray.length > 0) {
            _ratePlanCode = tempArray[0].rpc;
            tempArray[0].ratePlanCodes.filter(function (item) {
                if (moment(momentCheckOutDate)._d >= moment(item.startDate)._d
                    && moment(momentCheckOutDate)._d <= moment(item.endDate)._d
                    && moment(item.offerAvailableTillDate)._d >= moment(moment().format("YYYY-MM-DD"))._d
                    && item.hotels.indexOf(glblBwConfiguration.hotelCode) != -1

                ) {
                    _ratePlanCode = item.rpc;

                }

            })[0];


            /*If in CMS Nights dropdown contains "Rate Plan Code" */
            tempArray[0].ratePlanCodes.filter(function (item) {
                if (moment(momentCheckOutDate)._d >= moment(item.startDate)._d
                    && moment(momentCheckOutDate)._d <= moment(item.endDate)._d
                    && moment(item.offerAvailableTillDate)._d >= moment(moment().format("YYYY-MM-DD"))._d
                    && item.hotels.indexOf(glblBwConfiguration.hotelCode) != -1

                ) {
                    _ratePlanCode = item.rpc;

                }

            })[0];

            if (fnBwDoesCheckInCheckOutDatesFallInBlackedOutDateRange(tempArray[0].blackedOutDateRanges)) {
                _ratePlanCode = "";
            }
        }
    }
    else {

        if (moment(momentCheckOutDate)._d >= moment(glblBwConfiguration.offer.startDate)._d
            && moment(momentCheckOutDate)._d <= moment(glblBwConfiguration.offer.endDate).add(1, "days")._d
            && (moment(glblBwConfiguration.offer.offerAvailableTillDate)._d >= moment(moment().format("YYYY-MM-DD"))._d
                || glblBwConfiguration.offer.offerAvailableTillDate == "")
            && ((glblBwCheckincheckoutdatedifference == glblBwConfiguration.offer.minNights
                && glblBwConfiguration.offer.blExactNights == true)
                || glblBwCheckincheckoutdatedifference >= glblBwConfiguration.offer.minNights
                && glblBwConfiguration.offer.blExactNights == false)
        ) {
            _ratePlanCode = glblBwConfiguration.offer.rpc;
        }

    }



    if (glblBwConfiguration.offer.blackedOutDateRanges.length > 0) {
        if (fnBwDoesCheckInCheckOutDatesFallInBlackedOutDateRange(glblBwConfiguration.offer.blackedOutDateRanges)) {
            _ratePlanCode = "";
        }
    }


    /*Philae and Zahra code this piece of code is to be put in CMS*/
    if (glblBwConfiguration.hotelCode == "HBASWPH") {
        if (glblBwCheckincheckoutdatedifference == 4) {
            _ratePlanCode = "WEB-PUE4";
        }
        else if (glblBwCheckincheckoutdatedifference == 6) {
            _ratePlanCode = "WEB-PUE6";
        }
    }
    else if (glblBwConfiguration.hotelCode == "HBASWZA") {
        if (glblBwCheckincheckoutdatedifference == 3) {
            _ratePlanCode = "WEB-PUE3";
        }
        else if (glblBwCheckincheckoutdatedifference == 4) {
            _ratePlanCode = "WEB-PUE4";
        }
        else if (glblBwCheckincheckoutdatedifference == 5) {
            _ratePlanCode = "WEB-PUE5";
        }
        else if (glblBwCheckincheckoutdatedifference == 7) {
            _ratePlanCode = "WEB-PUE7";
        }
    }

    return _ratePlanCode;

}

/* Fn Set User Last Booking Search Data*/
function setUserLastSearchData(userLastSearchUrl) {
    try {

        var arrival = fnGetParameterByNameFromUrl("arrive", userLastSearchUrl).split(",")[0];
        var hoteltitle = getHotelTitleByHotelCode(getHotelCodeBySynxisCode(fnGetParameterByNameFromUrl("hotel", userLastSearchUrl).split(";")[0]));
        createCookieByDate("userLastSearchHotelTitle", hoteltitle, moment(arrival, "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
        createCookieByDate("userLastSearchData", userLastSearchUrl, moment(arrival, "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
        createCookieByDate("userBookingReminderCloseCount", 0, moment("2050-12-31", "YYYY-MM-DD").clone().format("YYYY-MM-DD"));

        deleteCookie("userBrowserSessionId");

    }
    catch (Exx) { }

}

function fnBwGetRpcByPromoCode() {

    var tempRpc = "";

    var momentCheckInDate;
    var momentCheckOutDate;

    if (typeof glblBwLastClickedObj != "undefined") {
        momentCheckInDate = moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[0]).format("YYYY-MM-DD");
        momentCheckOutDate = moment($(glblBwLastClickedObj).find('.t-datepicker').tDatePicker('getDates')[1]).format("YYYY-MM-DD");
    }
    else {
        momentCheckInDate = moment($('.booking-engine:eq(0) .t-datepicker').tDatePicker('getDates')[0]).format("YYYY-MM-DD");
        momentCheckOutDate = moment($('.booking-engine:eq(0) .t-datepicker').tDatePicker('getDates')[1]).format("YYYY-MM-DD");
    }

    glblBwCheckincheckoutdatedifference = parseInt(getDateDifference(momentCheckInDate, momentCheckOutDate, "YYYY-MM-DD"));


    if (typeof glblBwLastClickedObj != "undefined") {
        if (!(glblBwLastClickedObj).find(".NumberOfNightsDropDown .list ul").hasClass("thisOfferIsBasedOnExactDropdownSelection")) {
            var tempArrayPromoCode = arrBwPromoCodeConfiguration.filter(function (item) {
                return item.promoCode.toLocaleUpperCase() == $(glblBwLastClickedObj).find(".promocode").val().toLocaleUpperCase();
            })[0]; tempArrayPromoCode;

            if (typeof tempArrayPromoCode != "undefined" && typeof tempArrayPromoCode.rpcBasicOnDates != "undefined") {


                if (tempArrayPromoCode.rpcBasicOnDates.length > 0) {
                    var tempRpcBasicOnDates = tempArrayPromoCode.rpcBasicOnDates.filter(function (item) {
                        if (moment(momentCheckOutDate)._d >= moment(item.offerStartDate)._d
                            && moment(momentCheckOutDate)._d <= moment(item.offerEndDate)._d
                            && moment(item.offerAvailableTillDate)._d >= moment(moment().format("YYYY-MM-DD"))._d
                            && item.hotelCodes.indexOf(glblBwConfiguration.hotelCode) != -1
                            && (
                                (glblBwCheckincheckoutdatedifference >= parseInt(item.minNights) && (item.blExactNights == false))
                                ||
                                ((glblBwCheckincheckoutdatedifference == parseInt(item.minNights)))
                            )
                        ) {
                            return item;
                        }

                    })[0];

                    if (typeof tempRpcBasicOnDates != "undefined") {
                        tempRpc = tempRpcBasicOnDates.rpc;
                    }
                }
            }
        }
    }


    /*If Dropdown have nights and promocode is valid only respective offer page.*/
    if (typeof glblBwLastClickedObj != "undefined") {
        if ((glblBwLastClickedObj).find(".NumberOfNightsDropDown .list ul").hasClass("thisOfferIsBasedOnExactDropdownSelection")) {
            if ($(glblBwLastClickedObj).find(".promocode").val() != "") {
                var ddlIsExactNightRequired = (glblBwLastClickedObj).find(".NumberOfNightsDropDown .list li.active").attr("blexactnights");
                var ddlAdditionalRpcArrayString = (glblBwLastClickedObj).find(".NumberOfNightsDropDown .list li.active").attr("additionalrpcarraystring");
                var ddlRpc = (glblBwLastClickedObj).find(".NumberOfNightsDropDown .list li.active").attr("rpc");
                var ddlValue = (glblBwLastClickedObj).find(".NumberOfNightsDropDown .list li.active").attr("value");

                if (ddlIsExactNightRequired == "true" && glblBwCheckincheckoutdatedifference == parseInt(ddlValue)) {
                    tempRpc = ddlRpc;
                }
                else if (ddlIsExactNightRequired == "false" && glblBwCheckincheckoutdatedifference >= parseInt(ddlValue)) {
                    tempRpc = ddlRpc;
                }

                if (ddlAdditionalRpcArrayString != "") {
                    var arrAdditionalRpcObj = JSON.parse(ddlAdditionalRpcArrayString);
                    var _tempArray = arrAdditionalRpcObj.filter(function (item) {
                        if (item.blExactNights == true && glblBwCheckincheckoutdatedifference == item.minNights
                            || item.blExactNights == false && glblBwCheckincheckoutdatedifference >= item.minNights
                        ) {
                            console.log(item.blExactNights + "--" + item.minNights + "==" + glblBwCheckincheckoutdatedifference);
                            if (ddlRpc != "") {
                                tempRpc = ddlRpc + "," + item.rpc;
                            }
                        }
                    })[0];
                }

            }
        }
    }

    return tempRpc;

}






/*
jQuery Redirect v1.1.3

Copyright (c) 2013-2018 Miguel Galante
Copyright (c) 2011-2013 Nemanja Avramovic, www.avramovic.info

Licensed under CC BY-SA 4.0 License: http://creativecommons.org/licenses/by-sa/4.0/

This means everyone is allowed to:

Share - copy and redistribute the material in any medium or format
Adapt - remix, transform, and build upon the material for any purpose, even commercially.
Under following conditions:

Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike - If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
*/
; (function ($) {
    'use strict';

    //Defaults configuration
    var defaults = {
        url: null,
        values: null,
        method: "POST",
        target: null,
        traditional: false,
        redirectTop: false
    };

    /**
    * jQuery Redirect
    * @param {string} url - Url of the redirection
    * @param {Object} values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url.
    * @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST)
    * @param {string} target - (optional) The target of the form. "_blank" will open the url in a new window.
    * @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array.  This allows arrays to work with MVC.net among others.
    * @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window.
      *//**
* jQuery Redirect
* @param {string} opts - Options object
* @param {string} opts.url - Url of the redirection
* @param {Object} opts.values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url.
* @param {string} opts.method - (optional) The HTTP verb can be GET or POST (defaults to POST)
* @param {string} opts.target - (optional) The target of the form. "_blank" will open the url in a new window.
* @param {boolean} opts.traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array.  This allows arrays to work with MVC.net among others.
* @param {boolean} opts.redirectTop - (optional) If its called from a iframe, force to navigate the top window.
*/
    $.redirect = function (url, values, method, target, traditional, redirectTop) {
        var opts = url;
        if (typeof url !== "object") {
            var opts = {
                url: url,
                values: values,
                method: method,
                target: target,
                traditional: traditional,
                redirectTop: redirectTop
            };
        }

        var config = $.extend({}, defaults, opts);
        var generatedForm = $.redirect.getForm(config.url, config.values, config.method, config.target, config.traditional);
        $('body', config.redirectTop ? window.top.document : undefined).append(generatedForm.form);
        generatedForm.submit();
        generatedForm.form.remove();
    };

    $.redirect.getForm = function (url, values, method, target, traditional) {
        method = (method && ["GET", "POST", "PUT", "DELETE"].indexOf(method.toUpperCase()) !== -1) ? method.toUpperCase() : 'POST';

        url = url.split("#");
        var hash = url[1] ? ("#" + url[1]) : "";
        url = url[0];

        if (!values) {
            var obj = $.parseUrl(url);
            url = obj.url;
            values = obj.params;
        }

        values = removeNulls(values);

        var form = $('<form>')
            .attr("method", method)
            .attr("action", url + hash);


        if (target) {
            form.attr("target", target);
        }

        var submit = form[0].submit;
        iterateValues(values, [], form, null, traditional);

        return { form: form, submit: function () { submit.call(form[0]); } };
    }

    //Utility Functions
    /**
     * Url and QueryString Parser.
 * @param {string} url - a Url to parse.
 * @returns {object} an object with the parsed url with the following structure {url: URL, params:{KEY: VALUE }}
    */
    $.parseUrl = function (url) {

        if (url.indexOf('?') === -1) {
            return {
                url: url,
                params: {}
            };
        }
        var parts = url.split('?'),
            query_string = parts[1],
            elems = query_string.split('&');
        url = parts[0];

        var i, pair, obj = {};
        for (i = 0; i < elems.length; i += 1) {
            pair = elems[i].split('=');
            obj[pair[0]] = pair[1];
        }

        return {
            url: url,
            params: obj
        };
    };

    //Private Functions
    var getInput = function (name, value, parent, array, traditional) {
        var parentString;
        if (parent.length > 0) {
            parentString = parent[0];
            var i;
            for (i = 1; i < parent.length; i += 1) {
                parentString += "[" + parent[i] + "]";
            }

            if (array) {
                if (traditional)
                    name = parentString;
                else
                    name = parentString + "[" + name + "]";
            } else {
                name = parentString + "[" + name + "]";
            }
        }

        return $("<input>").attr("type", "hidden")
            .attr("name", name)
            .attr("value", value);
    };

    var iterateValues = function (values, parent, form, isArray, traditional) {
        var i, iterateParent = [];
        Object.keys(values).forEach(function (i) {
            if (typeof values[i] === "object") {
                iterateParent = parent.slice();
                iterateParent.push(i);
                iterateValues(values[i], iterateParent, form, Array.isArray(values[i]), traditional);
            } else {
                form.append(getInput(i, values[i], parent, isArray, traditional));
            }
        });
    };

    var removeNulls = function (values) {
        var propNames = Object.getOwnPropertyNames(values);
        for (var i = 0; i < propNames.length; i++) {
            var propName = propNames[i];
            if (values[propName] === null || values[propName] === undefined) {
                delete values[propName];
            } else if (typeof values[propName] === 'object') {
                values[propName] = removeNulls(values[propName]);
            } else if (values[propName].length < 1) {
                delete values[propName];
            }
        }
        return values;
    };
}(window.jQuery || window.Zepto || window.jqlite));

//#endregion




//Not in use
function fnBwSoldOutDates(hotelofferingid) {
    var foundData = false;
    var tempArray = arrCalendarSoldOutDates.filter(function (item) {
        if (item.hotelofferingid.toLowerCase() == hotelofferingid.toLowerCase()) {
            foundData = true;
            return item;
        }
    })[0];

    if (foundData) {
        if (tempArray.dates.length > 0) {
            return tempArray.dates;
        }
    }
    else {
        return [];
    }
}





/*Set Default Adult selection base on hotel */
function fnBwSetDefaultAdult() {


    var arrrDefaultAdults = ["HBBLROB", "HBDELOB", "HBBOMOB", "HBCCUOB", "HBDELOG"];
    if (!glBlBwRoomOrGuestSelected) {
        var defaultGuest = 2;
        if (arrrDefaultAdults.indexOf(glblBwConfiguration.hotelCode.toUpperCase()) != -1) {
            defaultGuest = 1;
        }
        else if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDXBAZ") {

            defaultGuest = 2;
        }

        $(".booking-engine").each(function () {
            var thisBookingEngine = this;
            $(this).find(".noOfGuestWrap .choose.adult .number ul li").each(function () {

                var guestCount = parseInt($(this).text());
                $(this).removeClass("active");
                if (guestCount == defaultGuest) {
                    guestCountFound = true;
                    console.log(guestCount + "\n");
                    $(this).addClass("active");
                    $(thisBookingEngine).find(".noOfGuestWrap .guestCount .value").html("0" + defaultGuest);
                }
            });
        });
    }

    if ($('.booking-engine .DropDownExtraGuest').length > 0) {
        $(".extraAdult,.extraChild").show();
        if (glblBwConfiguration.hotelCode.toUpperCase() == "HBDXBAZ") {
            $(".extraAdult1").show();          
        }
        else {
            $(".extraAdult1").hide();
        }
    
        
    }
    else {
        $(".extraAdult,.extraChild").hide();
        $(".extraAdult1").hide();
    }


    fnBwGuestShowHideGuestBasedOnAdultsOnClick();

}

function fnBwBoolShowPricesOnHotels(){

    if ((glblBwConfiguration.hotelCode.toUpperCase() == "HBDELOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBBLROB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBBOMOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBCCUOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBDELOG".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBJAIOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBAGROB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBJAIVA".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBJAIVIND".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBSLVOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBSLVWH".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBIXCOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBCOKVR".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBMRUTO".toUpperCase() 
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBHRGOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBDXBAZ".toUpperCase()
       // || glblBwConfiguration.hotelCode.toUpperCase() == "HBDPSOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBMEDOB".toUpperCase()
       // || glblBwConfiguration.hotelCode.toUpperCase() == "HBAMIOB".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HTLMRCO".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBCOKVR-3".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBCOKVR-2".toUpperCase()
        || glblBwConfiguration.hotelCode.toUpperCase() == "HBUDROB".toUpperCase())
        && glblBwConfiguration.offer.offerCode.toLowerCase().indexOf('default') != -1) {
        return true;
    }
    else {
        return false;
    }
}
function fnBwBoolShowPricesOnHotelsBaliLombok() {
    if ((glblBwConfiguration.hotelCode.toUpperCase() == "HBDPSOB".toUpperCase()     
         || glblBwConfiguration.hotelCode.toUpperCase() == "HBAMIOB".toUpperCase())
        && glblBwConfiguration.offer.offerCode.toLowerCase().indexOf('default') != -1) {
        return true;
    }
    else {
        return false;
    }
}

/* Booking Engine Clic tracking codes*/
function fnBwHotelDropdownClick(objThis) {
    console.log("fnBwHotelDropdownClick Clicked");   
    glblBwTrackingHotelDropdown++;
    fnPushBwClicksCount();
    fnPushTrackingBoolValues("hotel");
}

function fnBwClickDateCI(objThis) {
    console.log("fnBwClickDateCI Clicked");
    fnBwCiCoClick(objThis);
}
function fnBwClickDateCO(objThis) {
    console.log("fnBwClickDateCO Clicked");
    fnBwCiCoClick(objThis);
}

function fnBwCiCoClick(objThis) {
    glblBwTrackingCalendarDropdown++;
    fnPushBwClicksCount();
    console.log("fnBwCiCoClick Clicked");
    fnPushTrackingBoolValues("calendar");
}

function fnBwAddRoomClick(objThis) {
    console.log("fnBwAddRoomClick Clicked"); 
    glBlBwRoomOrGuestSelected = true;
    glblBwTrackingRoomDropdown++;
    fnPushBwClicksCount();
    fnPushTrackingBoolValues("room");
}

function fnBwGuestDropdownClick(objThis) {
    console.log("fnBwGuestDropdownClick Clicked");
    fnBwGuestShowHideGuestBasedOnAdultsOnClick();
  //  $(glblBwLastClickedObj).find('.noOfGuestWrap .addGuestDropDown .blockWrapper .roomGuestCount .adult .number ul li.active').click();

    glBlBwRoomOrGuestSelected = true;
    glblBwTrackingGuestDropdown++;
    fnPushBwClicksCount();
    fnPushTrackingBoolValues("guest");
}

function fnBwPromoCodeDropdownClick(objThis) {
    console.log("fnBwPromoCodeDropdownClick Clicked");
    glblBwTrackingPomoCodeDropdown++;
    fnPushBwClicksCount();
    fnPushTrackingBoolValues("promocode");
}

function fnBwViewAvailAbilityBeforeRedirectionClick(objThis) {
    console.log("fnBwViewAvailAbilityBeforeRedirectionClick Clicked");
    glblBwTrackingViewAvailablityClick++;
    fnPushBwClicksCount();
    fnPushTrackingBoolValues("viewavailability");
}

function fnPushBwClicksCount() {
    var arrBokingWidgetClickTracking = [{
        'hotelDropdown': glblBwTrackingHotelDropdown,
        'calendarDropdown': glblBwTrackingCalendarDropdown,
        'roomDropdown': glblBwTrackingRoomDropdown,
        'guestDropdown': glblBwTrackingGuestDropdown,
        'viewAvailablityClick': glblBwTrackingViewAvailablityClick,
        'promoCodeDropdown': glblBwTrackingPomoCodeDropdown
    }];

    if (document.location.href.indexOf("www.oberoihotels.com") != -1) {
        window.dataLayer = window.dataLayer || [];
        window.dataLayer.push({
            'OH_BokingWidgetClickTracking': arrBokingWidgetClickTracking
        });
    }
    // console.table(arrBokingWidgetClickTracking);
}


function fnPushTrackingBoolValues(sectionName) {

    var isHotelDropdownClicked = false;
    var isCalendarDropdownClicked = false;
    var isRoomDropdownClicked = false;
    var isGuestDropdownClicked = false;
    var isViewAvailablityClicked = false;
    var isPromoCodeDropdownClicked = false;

    if (sectionName == "hotel") {
        isHotelDropdownClicked = true;
    }
    else if (sectionName == "calendar") {
        isCalendarDropdownClicked = true;
    }
    else if (sectionName == "room") {
        isRoomDropdownClicked = true;
    }
    else if (sectionName == "guest") {
        isGuestDropdownClicked = true;
    }
    else if (sectionName == "viewavailability") {
        isViewAvailablityClicked = true;
    }
    else if (sectionName == "promocode") {
        isPromoCodeDropdownClicked = true;
    }

    var arrBokingWidgetSectionClickTracking = [{
        'isHotelDropdownClicked': isHotelDropdownClicked,
        'isCalendarDropdownClicked': isCalendarDropdownClicked,
        'isRoomDropdownClicked': isRoomDropdownClicked,
        'isGuestDropdownClicked': isGuestDropdownClicked,
        'isViewAvailablityClicked': isViewAvailablityClicked,
        'isPromoCodeDropdownClicked': isPromoCodeDropdownClicked
    }];
    if (document.location.href.indexOf("www.oberoihotels.com") != -1) {
        window.dataLayer = window.dataLayer || [];
        window.dataLayer.push({
            'OH_BokingWidgetSectionClickTracking': arrBokingWidgetSectionClickTracking
        });
    }

    // console.table(arrBokingWidgetSectionClickTracking);
}

function fnBwRemoveFromHotelsDropdownHotelsForExperienceDetailsPage() {
    console.log("fnBwRemoveFromHotelsDropdownHotelsForExperienceDetailsPage called");
    var currentUrl = document.location.pathname.toLocaleLowerCase();
    var splitCheckExpName = currentUrl.split('/')
   
    if (splitCheckExpName[2] == "experiences") {
        $('.booking-engine .hotelName').addClass('NoClick');
    }
    else if (splitCheckExpName[3] == "experiences") {
        $('.booking-engine .hotelName').addClass('NoClick');
    }
}
// for friends and family programme
var fr_href = location.href;
if (fr_href.match("one-of-us-programme")) {
    $('.booking-engine .hotelName').click(function () {
        const urlParams = new URLSearchParams(window.location.search);
        const myParam = urlParams.get('coupon_code')
        var promoCodeForGuest = myParam;
        $(".viewAvailabilityButton").css({
            "pointer-events": "auto",
            "opacity": "1",
            "cursor": "pointer"
        });
        $(".booking-engine .promocodeDropDown .promocode").val(promoCodeForGuest);
        $(".booking-engine .promocodeDropDown .promocode")[0].disabled = true;
        $(".booking-engine .promocodeDropDown .promocode")[1].disabled = true;
    });
};

$(window).load(function () {
    try {
        if (fnGetParameterByName("section") != "") {
            pageScrollTo(fnGetParameterByName("section"));
        }
    }
    catch (excsectionscroll) { }
});

$(document).ready(function () {
    
    /*add active class*/
    $(".header-wraper li a").each(function () {
        var anchorHref = $(this).attr('href').toLowerCase();
        var anchorPath = new URL(anchorHref, window.location.origin).pathname;
        if (window.location.pathname.toLowerCase()== anchorPath) {
            $(this).parent("li").addClass("active-tab");
           
        }
    });
    $(".main-menu li a").each(function () {
        var anchorHref = $(this).attr('href').toLowerCase();
        var anchorPath = new URL(anchorHref, window.location.origin).pathname;
        if (window.location.pathname.toLowerCase() == anchorPath) {
            $(this).parent("li").addClass("active");
        }
        if(window.location.pathname == "/"){
          $(this).parent("li").removeClass("active");
          $(".menu-container .main-menu .home-tab").addClass("active");
        }
    });
    
    if (document.URL.toLowerCase().indexOf("/hotels-in-") != -1 || document.URL.toLowerCase().indexOf("/kerala-backwaters") != -1 || document.URL.toLowerCase().indexOf("/nile-cruise-") != -1) {
        $("body").addClass("hotel-pages");
    }
    if (document.URL.toLowerCase().indexOf("/overview") != -1) {
        $("header, .top-nav").addClass("fullwidthheader");
    }
    if (window.location.pathname.toLowerCase() == "/") {
        $("header, .top-nav").addClass("fullwidthheader");
    }
    if (document.URL.toLowerCase().indexOf("/about-us") != -1) {
        $("body").addClass("about-us");
    }
    if (document.URL.toLowerCase().indexOf("/contact-us") != -1 || document.URL.toLowerCase().indexOf("/rooms-suites") != -1) {
        setCountryByIP();
    }
    if (window.location.pathname.toLowerCase() == "/experiences") {
        $("body").addClass("global-experiences");
    }
    if (window.location.pathname.toLowerCase() == "/special-offers" || window.location.pathname.toLowerCase() == "/special-offers/") {
        $("body").addClass("global-offers");       
    }
    if (window.location.pathname.toLowerCase().indexOf("/special-offers" != -1)) {      
        setCountryByIP();
    }
    if (window.location.pathname.toLowerCase() == "/magazines" || window.location.pathname.toLowerCase() == "/magazines/" ) {
        $("body").addClass("global-magazines");
        fnFilterEmagazineByCategory();
    }

    if (document.URL.indexOf("/hotels-in-agra") != -1) {
        setHotelSelectedByHotelCode("HBAGROB");
        setDirectionMapLatLongDetails("HBAGROB");
        fnGetTimeByZone("");
        fnLocalTemperature("1279259");
    }
    else if (document.URL.indexOf("/hotels-in-jaipur") != -1) {
        setHotelSelectedByHotelCode("HBJAIOB");
        setDirectionMapLatLongDetails("HBJAIOB");
        fnGetTimeByZone("");
        fnLocalTemperature("1269515");
    }
    else if (document.URL.indexOf("/hotels-in-ranthambhore") != -1) {
        setHotelSelectedByHotelCode("HBJAIVA");
        setDirectionMapLatLongDetails("HBJAIVA");
        fnGetTimeByZone("");
        fnLocalTemperature("1254241");
    }
    else if (document.URL.indexOf("/hotels-in-udaipur") != -1) {
        setHotelSelectedByHotelCode("HBUDROB");
        setDirectionMapLatLongDetails("HBUDROB");
        fnGetTimeByZone("");
        fnLocalTemperature("1253986");
    }
    else if (document.URL.indexOf("/hotels-in-bengaluru") != -1) {
        setHotelSelectedByHotelCode("HBBLROB");
        setDirectionMapLatLongDetails("HBBLROB");
        fnGetTimeByZone("");
        fnLocalTemperature("1277333");
    }
    else if (document.URL.indexOf("/kerala-backwaters") != -1) {
        setHotelSelectedByHotelCode("HBCOKVR");
        setDirectionMapLatLongDetails("HBCOKVR");
        fnGetTimeByZone("");
        fnLocalTemperature("1267254");
    }
    else if (document.URL.indexOf("/hotels-in-al-zorah") != -1) {
        setHotelSelectedByHotelCode("HBDXBAZ");
        setDirectionMapLatLongDetails("HBDXBAZ");
        fnGetTimeByZone("Arabian Standard Time");
        fnLocalTemperature("292932");
    }
    else if (document.URL.indexOf("/hotels-in-bali") != -1) {
        setHotelSelectedByHotelCode("HBDPSOB");
        setDirectionMapLatLongDetails("HBDPSOB");
        fnGetTimeByZone("North Asia East Standard Time");
        fnLocalTemperature("7406901");
    }
    else if (document.URL.indexOf("/hotels-in-chandigarh") != -1) {
        setHotelSelectedByHotelCode("HBIXCOB");
        setDirectionMapLatLongDetails("HBIXCOB");
        fnGetTimeByZone("");
        fnLocalTemperature("1274746");
    }
    else if (document.URL.indexOf("/hotels-in-delhi") != -1) {
        setHotelSelectedByHotelCode("HBDELOB");
        setDirectionMapLatLongDetails("HBDELOB");
        fnGetTimeByZone("");
        fnLocalTemperature("1261481");
    }
    else if (document.URL.indexOf("/hotels-in-dubai") != -1) {
        setHotelSelectedByHotelCode("HBDXBOB");
        setDirectionMapLatLongDetails("HBDXBOB");
        fnGetTimeByZone("Arabian Standard Time");
        fnLocalTemperature("292223");
    }
    else if (document.URL.indexOf("/hotels-in-gurgaon") != -1) {
        setHotelSelectedByHotelCode("HBDELOG");
        setDirectionMapLatLongDetails("HBDELOG");
        fnGetTimeByZone("");
        fnLocalTemperature("1270642");
    }
    else if (document.URL.indexOf("/hotels-in-kolkata") != -1) {
        setHotelSelectedByHotelCode("HBCCUOB");
        setDirectionMapLatLongDetails("HBCCUOB");
        fnGetTimeByZone("");
        fnLocalTemperature("1275004");
    }
    else if (document.URL.indexOf("/hotels-in-lombok") != -1) {
        setHotelSelectedByHotelCode("HBAMIOB");
        setDirectionMapLatLongDetails("HBAMIOB");
        fnGetTimeByZone("North Asia East Standard Time");
        fnLocalTemperature("1624997");
    }
    else if (document.URL.indexOf("/hotels-in-madina") != -1) {
        setHotelSelectedByHotelCode("HBMEDOB");
        setDirectionMapLatLongDetails("HBMEDOB");
        fnGetTimeByZone("Arabic Standard Time");
        fnLocalTemperature("109223");

    }
    else if (document.URL.indexOf("/hotels-in-mauritius") != -1) {
        setHotelSelectedByHotelCode("HBMRUTO");
        setDirectionMapLatLongDetails("HBMRUTO");
        fnGetTimeByZone("Mauritius Standard Time");
        fnLocalTemperature("934292");

    }
    else if (document.URL.indexOf("/hotels-in-morocco-marrakech") != -1) {
        setHotelSelectedByHotelCode("HTLMRCO");
        setDirectionMapLatLongDetails("HTLMRCO");
        //fnGetTimeByZone("Central European Standard Time");
        fnGetTimeByZone("Morocco Standard Time");
        fnLocalTemperature("6547285");
    }
    else if (document.URL.indexOf("/hotels-in-mumbai") != -1) {
        setHotelSelectedByHotelCode("HBBOMOB");
        setDirectionMapLatLongDetails("HBBOMOB");
        fnGetTimeByZone("");
        fnLocalTemperature("1275339");
    }
    else if (document.URL.indexOf("/hotels-in-sahl-hasheesh") != -1) {
        setHotelSelectedByHotelCode("HBHRGOB");
        setDirectionMapLatLongDetails("HBHRGOB");
        fnGetTimeByZone("Egypt Standard Time");
        fnLocalTemperature("361291");
    }
    else if (document.URL.indexOf("/hotels-in-shimla-cecil") != -1) {
        setHotelSelectedByHotelCode("HBSLVOB");
        setDirectionMapLatLongDetails("HBSLVOB");
        fnGetTimeByZone("");
        fnLocalTemperature("1256237");
    }
    else if (document.URL.indexOf("/hotels-in-shimla-wfh") != -1) {
        setHotelSelectedByHotelCode("HBSLVWH");
        setDirectionMapLatLongDetails("HBSLVWH");
        fnGetTimeByZone("");
        fnLocalTemperature("1256237");
    }
    else if (document.URL.indexOf("/hotels-in-bandhavgarh-vindhyavilas-resort") != -1) {
        setHotelSelectedByHotelCode("HBJAIVIND");
        setDirectionMapLatLongDetails("HBJAIVIND");
        fnGetTimeByZone("");
        fnLocalTemperature("1274747");
    }
    else if (document.URL.indexOf("/nile-cruise-philae") != -1) {

        setHotelSelectedByHotelCode("HBASWPH");
        setDirectionMapLatLongDetails("HBASWPH");
        fnGetTimeByZone("Egypt Standard Time");
        fnLocalTemperature("359792");

        if (document.URL.indexOf("/nile-cruise-philae/overview") != -1) {
            setHotelSelectedByHotelCode("");
        }
        else if (document.URL.indexOf("/nile-cruise-philae/special-offers") != -1) {
            setHotelSelectedByHotelCode("");
        }
        //hotelcode = "HBASWPH";
        //initializeCruiseEvent();       

    }
    else if (document.URL.indexOf("/nile-cruise-zahra") != -1) {
        
        setHotelSelectedByHotelCode("HBASWZA");
        setDirectionMapLatLongDetails("HBASWZA");
        fnLocalTemperature("360630");
        fnGetTimeByZone("Egypt Standard Time");
        if (document.URL.indexOf("/nile-cruise-zahra/overview") != -1) {
            setHotelSelectedByHotelCode("HBASWZA");
        }
        else if (document.URL.indexOf("/nile-cruise-zahra/special-offers") != -1) {
            setHotelSelectedByHotelCode("HBASWZA");
        }
      
       //hotelcode = "HBASWZA";
       // initializeCruiseEvent();

        
        //embNights = 5;
        //minnights = embNights;
        //$('.cruiseSelectionWrap .noOfNightsWrap .dropDownLabel .value').html('<abbr>0' + embNights + '</abbr> <span>Nights</span></div>');
        //$(".cruiseDropDown .optionWrap").each(function () { $(this).removeClass("active") });
        //$(".cruiseDropDown .optionWrap").each(function () { if ($(this).text().indexOf(embNights) != -1) { $(this).addClass("active") } });


        //fnSetCruiseDate();       

    }   

});




function setHotelSelectedByHotelCode(_hotelcode) {

    //try {

    //    var _cruize_this = "";
    //    $('.booking-engine').each(function () {
    //        var data_index = $(this).attr("data-index");

    //        if ($('.booking-engine:eq(' + data_index + ')').length > 0) {
    //            $('.booking-engine:eq(' + data_index + ') .allHotels li').each(function () {

    //                $(this).removeClass('active')

    //                if ($(this).attr('data-hotelcode') == _hotelcode) {
    //                    var _hotelName = $(this).html();
    //                    var _currIndex = $(this).closest('.booking-engine').attr('data-index');
    //                    var _cityName = $(this).attr('data-city');
    //                    var _dataHotelName = $(this).attr('data-hotelName');
    //                    var _layout2HotelNameHTML = '<abbr>' + _cityName + '</abbr>' + _dataHotelName;
    //                    $('.booking-engine:eq(' + _currIndex + ') .hotelListDropDown .hotelList .hotelBlock .list ul > li').removeClass('active');
    //                    $(this).addClass('active');

    //                    $(this).closest('.booking-engine').find('.hotelName .hotelLabel .name .mobileN').html(_layout2HotelNameHTML);
    //                    $(this).closest('.booking-engine').find('.hotelName .hotelLabel .name .desktopN').html(_hotelName);
    //                    $('.booking-engine:eq(' + _currIndex + ') .hotelListDropDown').hide();
    //                    $('.triggerDropDown').removeClass('active');
    //                    $('.booking-engine:eq(' + _currIndex + ')').find('.datesWrap:last-child').removeClass('disableCheckout');
    //                    //Cruise script
    //                    $('.cruiseSelectionWrap').hide();
    //                    var _embarkationPlaceName = $(this).attr('data-embarkationName');
    //                    var _noOfNights = $(this).attr('data-noOfNights');
    //                    if (_embarkationPlaceName) {
    //                        $('.booking-engine .checkInDate').addClass('dateDisabled');
    //                        $('.booking-engine .checkOutDate').addClass('dateDisabled');
    //                        $('.cruiseSelectionWrap').show();
    //                        var _dropDownValuesEmbarkationPlace = _embarkationPlaceName.split('|');
    //                        var _dropDownValuesNoOfNight = _noOfNights.split('|');
    //                        $('.cruiseSelectionWrap .embarkationWrap .cruiseDropDown .block').html('');
    //                        $('.cruiseSelectionWrap .noOfNightsWrap .cruiseDropDown .block').html('');
    //                        for (var i = 0; i < _dropDownValuesEmbarkationPlace.length; i++) {
    //                            $('.cruiseSelectionWrap .embarkationWrap .cruiseDropDown .block').append('<div class="optionWrap">' + _dropDownValuesEmbarkationPlace[i] + '</div>');
    //                            $('.cruiseSelectionWrap .embarkationWrap .dropDownLabel .value').html(_dropDownValuesEmbarkationPlace[0]);
    //                        }
    //                        for (var i = 0; i < _dropDownValuesNoOfNight.length; i++) {
    //                            $('.cruiseSelectionWrap .noOfNightsWrap .cruiseDropDown .block')
    //                                .append('<div class="optionWrap">' + _dropDownValuesNoOfNight[i] + ' Nights</div>');
    //                            $('.cruiseSelectionWrap .noOfNightsWrap .dropDownLabel .value').html('<abbr>' + _dropDownValuesNoOfNight[0] + '</abbr> <span>Nights</span></div>');
    //                        }


    //                    }


    //                }
    //            });
    //        }

    //    });



    //    if ($('.eventDetails').length > 0) {
    //        $('.eventDetails .allHotels li').each(function () {
    //            $(this).removeClass('active');
    //            if ($(this).attr('hotelcode') == _hotelcode) {
    //                $('.eventDetails .hotelName .name').html($(this).text());
    //                $(this).addClass('active');
    //            }
    //        });
    //    }


    //    if (document.URL.indexOf("/contact-us") != -1 && $('.select-box').length > 0) {
    //        $(".select-box").val(_hotelcode);
    //    }

    //    hotelcode = _hotelcode;
    //    hideShowChildrenSelection();
    //    addDynamicTextToCalender();
    //}
    //catch (Exxxx) {
    //    console.log("error");
    //}


}



function loadEmbedMap(location) {

    if ($("#showMap").length > 0) {
        $("#showMap").click(function () {
            var finalURL = "";
            var strURL = "https://maps.google.com/maps?q=$$LOCATION$$&t=&z=13&ie=UTF8&iwloc=&output=embed";           
            if (location != "") {
                finalURL = strURL.replace("$$LOCATION$$", location);
            }
            else {
                finalURL = strURL.replace("$$LOCATION$$", "amarvilas agra");
            }

            $('#map-embed').attr("src", finalURL);
            $('#map-embed').show();
            $('#map-image').hide();

        });
    }
}


var isDynamicMessagePageLoad = true;
/*  get dynamic text message from  JSON jsonDataBookingWidget (basic cshtml) */
function fnDisplayDynamicMessageInCalendar(_hotelcode) {
   
    var dynamicMessage = "";
    var dynamicMessageForLayou2 = "";
    $('.booking-engine .calender-dynamic-text').hide();
    $('.booking-engine .calender-dynamic-text').html("");
    $('.booking-engine .calanderBottomMessage').html("");

    var fromDate = "";
    var dateTill = "";


    

    if (typeof _hotelcode != "undefined") {
        if (typeof jsonDataBookingWidget != "undefined") {
            for (var i = 0; i < jsonDataBookingWidget.length; i++) {
                if (jsonDataBookingWidget[i].hotel_code.toLowerCase() == _hotelcode.toLowerCase()) {
                    dynamicMessage = jsonDataBookingWidget[i].display_message;
                    dynamicMessageForLayou2 = jsonDataBookingWidget[i].display_message;
                    fromDate = jsonDataBookingWidget[i].from_date;
                    dateTill = jsonDataBookingWidget[i].till_date;
                    break;
                }
            }
        }
    }

    setTimeout(function () {
        if (_hotelcode == "HBASWPH" || _hotelcode == "HBASWZA") {

            if ($(".booking-engine .checkInCheckOut").hasClass('cruiseCalenderDefaultScreen') || getJsonDataBookingWidgetValueByKey(_hotelcode, "display_message_in_dates").indexOf($(".booking-engine .t-input-check-in").val()) == -1) {
                dynamicMessage = "";
            }

        }
        else {
            if (dateTill != "") {

                


                var arrHotelSpecificDateArray = enumerateDateFromStartAndEndDate(fromDate, dateTill, []);

                /*Get date array from ViewPor either from Desktop or on scroll on mobile*/
                var momentDates = displayMonthINCalenderInViewport();

                var isMonthDateMatched = false;

                for (var i = 0; i < momentDates.length; i++) {

                    var strMonthAndDate1 = moment(momentDates[i], "YYYY-MM-DD").format("YYYY-MM").toString();
                    for (var j = 0; j < arrHotelSpecificDateArray.length; j++) {
                        var strMonthAndDate2 = moment(arrHotelSpecificDateArray[j], "YYYY-MM-DD").format("YYYY-MM").toString();
                        if (strMonthAndDate1 == strMonthAndDate2) {
                            isMonthDateMatched = true;
                        }
                    }
                }

                if (!isMonthDateMatched) {
                    dynamicMessage = "";
                }

                if (typeof $(".t-input-check-in") != "undefined") {
                    $(".t-input-check-in").each(function () {
                        if (moment(dateTill, "YYYY-MM-DD") < moment($(this).val(), "YYYY-MM-DD")) {
                            dynamicMessageForLayou2 = "";
                            dynamicMessage = "";

                            
                        }

                        //console.log("dateTill=====" + dateTill + "$(this).val() " + $(this).val() + "  dynamicMessageForLayou2" + dynamicMessageForLayou2);
                    });
                }

              

            }
        }



        $('.booking-engine .calender-dynamic-text').hide();
        $('.booking-engine .calender-dynamic-text').html("");
        $('.booking-engine .calanderBottomMessage').html("");

        if (dynamicMessage != "") {
           
            if ($('.hotelList ul li[data-hotelcode="' + _hotelcode + '"]').hasClass('active')) {

                //$('.calender-dynamic-text').show();
                //$('.calender-dynamic-text').html(htmlMessage);
                if (typeof $(".booking-engine .calender-dynamic-text") != "undefined") {
                    $(".booking-engine .calender-dynamic-text").remove();
                }
                $('.booking-engine .t-datepicker-days:not(.layout2)').prepend('<div class="calender-dynamic-text" style="display:none;"></div>');

                $('.booking-engine:not(.layout2) .calender-dynamic-text').show();
                $('.booking-engine:not(.layout2) .calender-dynamic-text').html(dynamicMessage);

            }
            
        }


        if (dynamicMessageForLayou2 != "") {

            if ($('.hotelList ul li[data-hotelcode="' + _hotelcode + '"]').hasClass('active')) {

                if ($('.booking-engine.layout2 .calanderBottomMessage').length > 0) {
                    $('.booking-engine.layout2 .calanderBottomMessage').html(dynamicMessageForLayou2);
                }

            }

        }
    }, 100);
    
    isDynamicMessageDisplayedOnPageLoad = false;

    return dynamicMessage;
}

/*  get dynamic text message from  JSON jsonDataBookingWidget (basic cshtml) only for Exotic vacation Page(EV)*/
function getDynamicMessageTextEV(_hotelcode) {
    var dynamicMessage = "";
    var dateTill = "";
    if (typeof _hotelcode != "undefined") {
        if (typeof jsonDataBookingWidget != "undefined") {
            for (var i = 0; i < jsonDataBookingWidget.length; i++) {
                if (jsonDataBookingWidget[i].hotel_code.toLowerCase() == _hotelcode.toLowerCase()) {
                    dynamicMessage = jsonDataBookingWidget[i].display_message_for_exotic_vacation;
                    dateTill = jsonDataBookingWidget[i].till_date;
                    break;
                }
            }
        }
    }
   
    if (dateTill != "") {
        $(".t-input-check-in").each(function () {
            if (moment(dateTill, "YYYY-MM-DD") < moment($(this).val(), "YYYY-MM-DD")) {
                dynamicMessage = "";               
            }
        });
       
    }

    return dynamicMessage;
}


function getJsonDataBookingWidgetValueByKey(hoteCode, keyName) {
    var keyValue = "";
    for (var i = 0; i < jsonDataBookingWidget.length; i++) {
        if (jsonDataBookingWidget[i].hotel_code == hoteCode) {
            if (keyName == "display_message_in_dates") {
                keyValue = jsonDataBookingWidget[i].display_message_in_dates;
            }            
            break;
        }
    }

    return keyValue;
}

function getHotelLatLongDetails(hotelcode) {
    var lat = "";
    var long = "";
    var directionmapimage = "";
    var image = "";
    var hoteltitle = "";
    var email = "";
    var phone = "";
    var url = "";
    var address = "";
    var isdetailfound = false;
    for (i = 0; i < arrHotelLatLongDetails.length; i++) {
        if (hotelcode == arrHotelLatLongDetails[i].hotelcode) {
            isdetailfound = true;
            lat = arrHotelLatLongDetails[i].lat;
            long = arrHotelLatLongDetails[i].lng;
            directionmapimage = arrHotelLatLongDetails[i].directionmapimage;
            image = arrHotelLatLongDetails[i].image;
            hoteltitle = arrHotelLatLongDetails[i].hoteltitle;
            email = arrHotelLatLongDetails[i].email;
            phone = arrHotelLatLongDetails[i].phone;
            url = arrHotelLatLongDetails[i].url;
            address = arrHotelLatLongDetails[i].address;
            break;
        }
    }

    return [isdetailfound, lat, long, directionmapimage, image, hoteltitle, email, phone, url, address];
}


function getHotelCodesByCountry(country) {
    var arrHotelsByCountry = [];
    var arrCountry = [];
    if (country != "") {
        arrCountry = country.split(",");
    }

    for (i = 0; i < arrHotelLatLongDetails.length; i++) {
        for (j = 0; j < arrCountry.length; j++) {

            if (arrCountry[j].toLowerCase() == arrHotelLatLongDetails[i].country.toLowerCase()) {             
                arrHotelsByCountry.push(arrHotelLatLongDetails[i].hotelcode);
            }
        }
    }

    return arrHotelsByCountry;
}

function setDirectionMapLatLongDetails(hotelcode) {
  
    setTimeout(function () {
        if (!isDirectionMapInitialised) {
            $("#dmap").hide();
        }

        var arrHotelDetails = getHotelLatLongDetails(hotelcode);

        if (arrHotelDetails[0]) {
            if ($("#hotelStarPoint").length > 0) {
                $("#hotelStarPoint").val(strip_html_tags(arrHotelDetails[5]));
            }
            if (typeof (sourceLat) !== 'undefined') {
                sourceLat = arrHotelDetails[1];
            }
            if (typeof (sourceLong) !== 'undefined') {
                sourceLong = arrHotelDetails[2];
            }

            if (typeof (sourceDirectionImage) !== 'undefined') {
                sourceDirectionImage = arrHotelDetails[3];
            }

            /*Set Image*/
            if ($('#map-image').length > 0) {
                
                var currentUrl = document.location.pathname;

                if (currentUrl == "/contact-us" || currentUrl == "/contact-us/") {

                    $('#map-embed').hide();
                    $('#map-image').attr("src", sourceDirectionImage);
                    $('#map-image').show();
                }
                else {
                    /*if (currentUrl.lastIndexOf('/overview') != -1) {
                       loadEmbedMap(location);            
                    }
                    else {
                    */
                    $('#map-embed').hide();
                    $('#map-image').show();
                    /*}*/
                }
            }
        }

    }, 10);
}

function fnLocalTemperature(locationid) {
    var formData = new FormData();
    formData.append("id", locationid);
    if (locationid != "") {
        if ($(".setLocalTemperature").length > 0) {
            $.ajax({
                data: formData,
                // dataType: "jsonp",
                type: "POST",
                dataType: "text",               
                processData: false,
                contentType: false,
                url: "/handlers/getTemprature.ashx",
                success: function (objJson) {
                    console.log('temp-' + objJson);
                    var data = JSON.parse(objJson);
                    console.log('temp1-' + data);
                    $(".setLocalTemperature").html(parseInt(data.main.temp) + " &#8451; / " + ConvertTempratureCtoF(data.main.temp) + " &#8457;");
                }
            });
        }
    }
}

function fnGetItinerariesDetails(nodeId) {
    if (nodeId != "") {
        $.ajax({
            url: "/handlers/get-sc-Itineraries-details.ashx?Id=" + nodeId,
            success: function (response) {
                $("#itinerariesDetailBlock").html(response);
                itinerarySliderInIt();
            }
        });
    }

}

function fnGetDestinationItems(nodeId) {
    //alert(1)
    if (nodeId != "") {
        $.ajax({
            url: "/handlers/get-sc-destinations-child-items.ashx?Id=" + nodeId,
            success: function (response) {
                if ($('.location-specific-content-slider .slider-div').hasClass("slick-initialized")) {
                    $('.location-specific-content-slider .slider-div').slick('unslick');
                    //$('.location-specific-content-slider .slider-div').slick('unslick').slick('reinit');
                    // $('.location-specific-content-slider .slider-div').slick('destroy');
                }
                $("#destinationItemsBlock").html(response);
                destinationSliderInit();
            }
        });
    }

}

function ConvertTempratureCtoF(temp) {
    if (temp != "") {
        return Math.round((temp * 9 / 5) + 32);
    }
    else {
        return temp;
    }
}

/*function fnLocalTime(zone)
{
    if (zone != "") {
        if ($(".setLocalTime").length > 0) {
            $(".setLocalTime").html(moment.tz(zone).format('hh:mm:ss A'));
        }
    }   
}*/

function fnGetTimeByZone(timezone) {
    if (timezone != "") {     
        if ($(".setLocalTime").length > 0) {
            var formData = [];

            formData.push({ name: "timezone", value: timezone });
            $.ajax({
                url: "/handlers/get-time.ashx",
               // dataType: "jsonp",
                data: formData,
                type: "POST",
                async: false,
                success: function (result) {
                    result = JSON.parse(result);
                    if (result.status) {
                        $(".setLocalTime").html(result.time);
                    }
                },
                error: function () {
                    alert("There has been an error on server. Please try after some time.");
                }
            });
        }
    }
    else {
        $(".setLocalTime").html(moment(new Date()).format('hh:mm A'));
    }
}


function fnFilterEmagazineByCategory() {

    var category = fnGetParameterByName("category").toLowerCase();
    if (category != "") {
        $("#themes-tab input[type=checkbox]").each(function () {
            if ($(this).next("span").text().toLowerCase() == category) {
                $(this).next("span").click();
                $(".single-tab").eq(0).click();
            }
        });
    }
}


function setCountryByIP() {
    var isValidCountryName = false;
    if ($("#tollFreeCountry option").length > 0) {
        var countryName = "";
        $.ajax({
            url: "/handlers/get-country-by-ip.ashx",
          //  dataType: "jsonp",
            type: "POST",
            async: false,
            success: function (result) {
                result = JSON.parse(result);
                if (result.status) {                 
                    countryName = result.country;
                    if (countryName == "") {
                        countryName = "india";
                    }
                    //countryName = "taiwan";

                    if (countryName != "india") {
                        /*Remove Selected Attribite*/
                        $("#tollFreeCountry option").each(function () {
                            $(this).removeAttr('selected');
                        });

                        /*Select specific country*/
                        $("#tollFreeCountry option").each(function () {
                            //  console.log($(this).attr("data-country") + "/" + countryName);
                            if ($(this).attr("data-country") == countryName) {
                                isValidCountryName = true;
                                $(this).attr('selected', 'selected');
                                setTimeout(function () {
                                    $("#tollFreeCountry").trigger("change");
                                }, 100);                               
                            }
                        });

                        if (!isValidCountryName) {
                            $("#tollFreeCountry option").each(function () {                              
                                if ($(this).attr("data-country") == "india") {
                                    $(this).attr('selected', 'selected');
                                    $("#tollFreeCountry").trigger("change");
                                }
                            });
                        }
                    }
                }
            },
            error: function () {
                $("#tollFreeCountry option").each(function () {
                    if ($(this).attr("data-country") == "india") {
                        $(this).attr('selected', 'selected');
                        $("#tollFreeCountry").trigger("change");
                    }
                });
            }
        });

    }
}


$(function () {
    fnShowUserMessageToFinishTheirBooking();
});

/*Show user message that hes was triying to book stay but leaved for any reason.*/ 
function fnShowUserMessageToFinishTheirBooking() {

    setTimeout(function () {
        if ($(".usermessagetofinishtheirbooking").length > 0) {

            var userNameWithSalutation = "Dear Guest"; //Mr. Kalra
            var nightsBookedWithText = ""; //1
            var hotelNameCA = "";
            var checkinDateCA = ""; //20th May 2019
            var checkoutDateCA = ""; //21th May 2019
            var guesCountsWithText = "";
            var userLastSearchData = "";
            var hotelImage = "";
            var numberOfRoomsWithText = "";


            if (IsMemberLoggedIn) {

                if (readCookie("UserSalutation") != "") {
                    userSalutation = readCookie("UserSalutation");
                }
                if (readCookie("UserLastName") != "") {
                    userLastName = readCookie("UserLastName");
                    IsMemberLoggedIn = true;
                }
            }

            if (readCookie("userLastSearchHotelTitle") != "") {
                hotelNameCA = readCookie("userLastSearchHotelTitle");
            }

            if (readCookie("userLastSearchData") != "") {
                userLastSearchData = readCookie("userLastSearchData");
                checkinDateCA = moment(fnGetParameterByNameFromUrl("arrive", userLastSearchData).split(",")[0], "YYYY-MM-DD").format("Do MMMM YYYY");
                checkoutDateCA = moment(fnGetParameterByNameFromUrl("depart", userLastSearchData).split(",")[0], "YYYY-MM-DD").format("Do MMMM YYYY");
                hotelImage = getHotelImageByHotelCode(getHotelCodeBySynxisCode(fnGetParameterByNameFromUrl("hotel", userLastSearchData).split(";")[0]));

                var dateDiff = parseInt(getDateDifference(moment(fnGetParameterByNameFromUrl("arrive", userLastSearchData).split(",")[0], "YYYY-MM-DD"), moment(fnGetParameterByNameFromUrl("depart", userLastSearchData).split(",")[0], "YYYY-MM-DD")));

                if (dateDiff > 1) {
                    nightsBookedWithText = dateDiff + " nights";
                }
                else {
                    nightsBookedWithText = dateDiff + " night";
                }


                var totalGuest = parseInt(sumArray(fnGetParameterByNameFromUrl("adult", userLastSearchData), ",")) + parseInt(sumArray(fnGetParameterByNameFromUrl("child", userLastSearchData), ","));

                if (totalGuest > 1) {
                    guesCountsWithText = totalGuest + " guests";
                }
                else {
                    guesCountsWithText = totalGuest + " guest";
                }
            }

            if (userSalutation != "" && userLastName != "") {
                userNameWithSalutation = "Dear " + userSalutation + " " + userLastName;
            }

            var roomsCount = parseInt(fnGetParameterByNameFromUrl("rooms", userLastSearchData));
            if (roomsCount > 1) {
                numberOfRoomsWithText = roomsCount + " rooms";
            }
            else {
                numberOfRoomsWithText = roomsCount + " room";
            }

            if (hotelNameCA != "" && userLastSearchData != "") {
                var userMessageTemplate = "";
                userMessageTemplate += "<span class='close-btn btn-user-booking-reminder-close'>X</span>";
                userMessageTemplate += "<div class='marketing-asset-booking-detail'> ";
                userMessageTemplate += "    <div class='hotel-image'><img src='" + hotelImage + "'></div>";
                userMessageTemplate += "    <div class='booking-detail'>";
                userMessageTemplate += "        <p> <strong> " + userNameWithSalutation + " </strong>, <br>On your previous visit you had shown interest in the following:<br><span>" + hotelNameCA + "</span><br> Stay for " + guesCountsWithText + " for " + nightsBookedWithText + " from " + checkinDateCA + "<br> If you'd like to continue with that booking, please <a id='ResumeAbondonCart' href='" + userLastSearchData + "'>click here.</a></p>";
                userMessageTemplate += "    </div>";
                userMessageTemplate += "</div>";

                if (readCookie("userBookingReminderCloseCount") != "") {
                    /*var name numberOfRemindersToFinishBooking is declared in home page.
                      Value is fetched from Home Page in CMS*/
                    if ((parseInt(readCookie("userBookingReminderCloseCount"))) < numberOfRemindersToFinishBooking) {
                        $(".usermessagetofinishtheirbooking").html(userMessageTemplate);

                        if (moment() >= moment(fnGetParameterByNameFromUrl("arrive", userLastSearchData).split(",")[0], "YYYY-MM-DD")) {
                            $(".usermessagetofinishtheirbooking").html("");
                        }

                        if (typeof (userBrowserSessionId) !== "undefined") {
                            if (readCookie("userBrowserSessionId") != "") {
                                $(".usermessagetofinishtheirbooking").html("");
                            }
                        }
                    }
                }
            }
            else {
                console.log("Else part user reminder");
            }
        }

        $(".btn-user-booking-reminder-close").click(function () {
            closeUserReminder();
        });
    }, 10);

}

function closeUserReminder() {
    if ($(".usermessagetofinishtheirbooking").length > 0) {
        if (readCookie("userBookingReminderCloseCount") != "") {
            var userBookingReminderCloseCount = 1;
            userBookingReminderCloseCount = parseInt(readCookie("userBookingReminderCloseCount"));
            userBookingReminderCloseCount++;
            createCookieByDate("userBookingReminderCloseCount", userBookingReminderCloseCount, moment("2050-12-31", "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
            if (typeof (userBrowserSessionId) !== "undefined") {
                document.cookie = "userBrowserSessionId=" + userBrowserSessionId + ";";
            }
        }
        else {
            createCookieByDate("userBookingReminderCloseCount", 0, moment("2050-12-31", "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
        }

        $(".usermessagetofinishtheirbooking").html("");
    }
}

$(window).load(function () {
    if (typeof hideUserReminderToFinishBookingAfter != "undefined") {
        setTimeout(function () {

            if ($(".usermessagetofinishtheirbooking").length > 0) {
                if ($(".usermessagetofinishtheirbooking").html() != "") {
                    closeUserReminder();                    
                }
            }

        }, hideUserReminderToFinishBookingAfter * 1000);
    }
});

var GV_countryCode = "";
function getCountryCode() {
    try {
        $.ajax({
            async: true,
            type: "GET",
            url: 'https://api.ipinfodb.com/v3/ip-country/?key=4ecf29ac33780e638478dd023b3179c45f257ef8a0e36e6393f1bc907e4ab87b&format=json',
            data: {},
            dataType: "json",
            success: function (e) {
                var t, s, o;
                t = e, s = JSON.stringify(t), o = JSON.parse(s), GV_countryCode = o.countryCode, createCookieWithDomainName("GV_countryCode", GV_countryCode, 60, ".oberoihotels.com")
            }
        });
    }
    catch (exip) { }
}

function createCookieWithDomainName(cookiname, cookivalue, timeinminutes, domainName) {
    var d = new Date();
    d.setTime(d.getTime() + (timeinminutes * 60 * 1000));
    var expires = "expires=" + d.toGMTString();
    var domain = "domain=" + domainName;
    document.cookie = cookiname + "=" + cookivalue + ";" + expires + ";" + expires + ";path=/";
}

function pushDataLayerVariables() {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
        'UD_CountryCode': GV_countryCode
    });
}

$(function () {

    if (readCookie("GV_countryCode") != "") {
        GV_countryCode = readCookie("GV_countryCode");
        pushDataLayerVariables();
    }
    else {
        getCountryCode();
        setTimeout(function () {
            pushDataLayerVariables();
        }, 2000);
    }

  
});

;
if ($("#btnNewsLetter").length > 0) {
    $("#btnNewsLetter").click(function () {
        $(".newsLetterErrorMessage").html("");
        $(".newsLetterSuccessMessage").html("");    

        $.ajax({
            dataType: "jsonp",
            url: "/handlers/subscription-news-letters.ashx",
            data: $("#formNewsLetter").serialize(),
            type: "POST",
            async: false,
            success: function (result) {
                result = JSON.parse(result);
                if (result.status) {
                    console.log(result);
                    if (result.isduplicate) {
                        $(".newsLetterErrorMessage").html(result.error_message);
                        $(".newsLetterErrorMessage").show(); 
                    }
                    else {
                        $("#formNewsLetter")[0].reset();
                        $(".newsLetterSuccessMessage").html(result.error_message);
                        $(".newsLetterSuccessMessage").show();     
                    }
                }
                else {
                    $(".newsLetterErrorMessage").html(result.error_message);                   
                    $(".newsLetterErrorMessage").show();    
                }
            },
            error: function () {
                alert("There has been an error on server. Please try after some time.");
            }
        });

    });
}

;
/* JS: request-a-proposal-form.js start*/
var seatingStyleList = "";
var eventname = [];
var eventvenu = [];
var seatingstyle = [];

var defaultEnddateRP = moment().clone().add(1, 'year')._d;
var defaultStartdateRP = new Date();


$(function () {  
   


    try {

    /*Set Hotel name from array*/

        $(".eventHotelTitle").html(getDestinationCountryTitle());  

        //var dynamicMessage = fnDisplayDynamicMessageInCalendar(hotelcode);
        //if (dynamicMessage != "") {
        //    $(".divDynamicMessage").html('<div class="calender-dynamic-text">' + dynamicMessage + '</div>');
        //}

        $(".btnRequestAProposal").click(function () {

            $(".errorMsg").html("");           
            $(this).toggleClass("active");
            if (!$(this).closest('.venue-details').next('.request-a-proposal-form-wrap').length) {
                
                /* Cut all HTMl and inser to class ".venue-details" */
                $('.request-a-proposal-form-wrap').insertAfter($(this).closest('.venue-details'));

                /* get name of events, venue and seating style from attribute */
                eventname.length = 0;
                eventvenu.length = 0;
                seatingstyle.length = 0;

                $('form[name="formRequestAProposal"] select[name="event_type"]').html("<option value=''>Select Event</option>");
                $('form[name="formRequestAProposal"] select[name = "venue"]').html("<option value=''>Select Venue</option>");               
                try {
                    eventname = $(this).attr("data-events").split(",");
                    eventvenu = $(this).attr("data-venue").split(",");
                    seatingstyle = $(this).attr("data-seating-type").split(",");
                }
                catch (Exx) {  /**/ }

                    initializeEventAndVenue(eventname, eventvenu, seatingstyle);
               
                setTimeout(function(){
                    $('.request-a-proposal-form').show();
                    $('html,body').animate({
                        scrollTop: $('.request-a-proposal-form-wrap').offset().top - 160
                    }, 600);
                },0);
            }
            else{

                var $t = $('.request-a-proposal-form');
                if ($t.is(':visible')) {
                    $t.slideUp();
                } else {
                    $t.slideDown();
                    $('html,body').animate({
                        scrollTop: $('.request-a-proposal-form-wrap').offset().top - 160
                    }, 600);
                }
            }
        });
              
      

        var winW = $(window).width();
        var dateCheckIn = new Date();
        var dateCheckOut = new Date((new Date()).valueOf() + 1000 * 3600 * 24);

        //if (hotelcode.indexOf("HBJAIVA") != -1) {
        //    if (moment() <= moment("2019-09-15", "YYYY-MM-DD")) {
        //        defaultStartdateRP = new Date(moment("2019-09-15", "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
        //        dateCheckIn = new Date(moment("2019-09-15", "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
        //        dateCheckOut = new Date(moment("2019-09-15", "YYYY-MM-DD").clone().add(1, "days").format("YYYY-MM-DD"));
        //    }
        //}

        //else if (hotelcode.indexOf("HBCOKVR") != -1) {
        //    if (moment() <= moment("2019-10-01", "YYYY-MM-DD")) {
        //        defaultStartdateRP = new Date(moment("2019-10-01", "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
        //        dateCheckIn = new Date(moment("2019-10-01", "YYYY-MM-DD").clone().format("YYYY-MM-DD"));
        //        dateCheckOut = new Date(moment("2019-10-01", "YYYY-MM-DD").clone().add(1, "days").format("YYYY-MM-DD"));
        //    }
        //}


        if (winW < 768) {
            $('#formRequestAProposal1 .t-datepicker').tDatePicker({
                autoClose: false,
                numCalendar: 12,
                iconDate: '',
                toDayShowTitle: false,
                nextDayHighlighted: false,
                iconArrowTop: false,
                dateCheckIn: dateCheckIn,
                dateCheckOut: dateCheckOut,
                startDate: defaultStartdateRP,
                endDate: defaultEnddateRP
            });

            $('.calender_1').tDatePicker({
                autoClose: false,
                numCalendar: 12,
                iconDate: '',
                toDayShowTitle: false,
                nextDayHighlighted: false,
                iconArrowTop: false,
                dateCheckIn: dateCheckIn,
                dateCheckOut: dateCheckOut,
                startDate: defaultStartdateRP,
                endDate: defaultEnddateRP
            }).on('beforeShowDay', function (event) {
             
                $('#formRequestAProposal1 .t-mobile-heading.calender_1_head').show();
                $('#formRequestAProposal1 .calender_1_head .t-check-in-mobile').html($('.t-date-check-in').html());
                $('#formRequestAProposal1 .calender_1_head .t-check-out-mobile').html($('.t-date-check-out').html());
            }).on('eventClickDay', function (event, dataDate) {
                $('.calender_1_head .t-check-in-mobile').html($('.t-dates.t-date-check-in').html());
                $('.calender_1_head .t-check-out-mobile').html($('.t-dates.t-date-check-out').html());

            }).on('onChangeCI', function (e, changeDateCI) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            }).on('clickDateCO', function (e, dateCO) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            });



            $('.calender_2').tDatePicker({
                autoClose: false,
                numCalendar: 12,
                iconDate: '',
                toDayShowTitle: false,
                nextDayHighlighted: false,
                iconArrowTop: false,
                dateCheckIn: dateCheckIn,
                dateCheckOut: dateCheckOut,
                startDate: defaultStartdateRP,
                 endDate: defaultEnddateRP
            }).on('beforeShowDay', function (event) {
               
                $('.t-mobile-heading.calender_2_head').show();
                $('.calender_2_head .t-check-in-mobile').html($('.t-date-check-in').html());
                $('.calender_2_head .t-check-out-mobile').html($('.t-date-check-out').html());
            }).on('eventClickDay', function (event, dataDate) {
                $('.calender_2_head .t-check-in-mobile').html($('.t-dates.t-date-check-in').html());
                $('.calender_2_head .t-check-out-mobile').html($('.t-dates.t-date-check-out').html());
            });
            $('.t-mobile-heading .backWrap').click(function () {
                $('.booking-engine .t-mobile-heading').hide();
                //the following code restores original checkout date so instead we need to call $('body').click()
                //$('.t-datepicker').tDatePicker('hide');
                $('body').click();
                console.log("new code fired");
            }).on('onChangeCI', function (e, changeDateCI) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            }).on('clickDateCO', function (e, dateCO) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            });;
        } else {
            $('#formRequestAProposal1 .t-datepicker').tDatePicker({
                autoClose: true,
                durationArrowTop: 200,
                numCalendar: 2,
                iconDate: '',
                dateCheckIn: dateCheckIn,
                dateCheckOut: dateCheckOut,
                startDate: defaultStartdateRP,
                endDate: defaultEnddateRP
            });
            $('.calender_1').tDatePicker({
                autoClose: true,
                durationArrowTop: 200,
                numCalendar: 2,
                iconDate: '',
                dateCheckIn: dateCheckIn,
                dateCheckOut: dateCheckOut,
                startDate: defaultStartdateRP,
                endDate: defaultEnddateRP
            }).on('onChangeCI', function (e, changeDateCI) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            }).on('clickDateCO', function (e, dateCO) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            });;
            $('.calender_2').tDatePicker({
                autoClose: true,
                durationArrowTop: 200,
                numCalendar: 2,
                iconDate: '',
                dateCheckIn: dateCheckIn,
                dateCheckOut: dateCheckOut,
                startDate: defaultStartdateRP,
                endDate: defaultEnddateRP
            }).on('onChangeCI', function (e, changeDateCI) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            }).on('clickDateCO', function (e, dateCO) {
                setTimeout(function () {
                    fnEnableCODatesRequestAproposal();
                }, 10);
            });;
        }
        //open drop down on click of parent div
        $('#formRequestAProposal1 .triggerDropDown').click(function () {
            $(this).nextAll('.dropDown').toggle();
        });
        $('#formRequestAProposal1 .t-mobile-heading .backWrap').click(function () {
            $('#formRequestAProposal1 .t-mobile-heading').hide();
            $('#formRequestAProposal1 .t-datepicker').tDatePicker('hide');
        });
        $(document).mouseup(function (e) {
            var container = $(".dropDown");
            if (!container.is(e.target) && container.has(e.target).length === 0) {
                container.hide();
            }
        });
        //select hotel name from drop down list
        $('#formRequestAProposal1 .hotelList .hotelBlock .list ul > li').click(function () {
            if (!$(this).hasClass('hasSubnav')) {
                var _hotelName = $(this).html();
                $('#formRequestAProposal1 .hotelList .hotelBlock .list ul > li').removeClass('active');
                $(this).addClass('active');
                $('#formRequestAProposal1 .hotelName .hotelLabel .name').html(_hotelName);
                $('#formRequestAProposal1 .hotelListDropDown').hide();
                $('#formRequestAProposal1 .triggerDropDown').removeClass('active');
            }
        });
        $('#formRequestAProposal1 .hotelList .hotelBlock .list ul li .subNav .head').click(function () {
            $(this).toggleClass('active');
            $(this).next().slideToggle();
        });
        $('#formRequestAProposal1 .hotelList .hotelBlock .list ul li .subNav .content .values').click(function () {
            $(this).closest('.content').find('.values').removeClass('active');
            $(this).addClass('active');
        });
        $('#formRequestAProposal1 .hotelList .hotelBlock .list ul li .subNav .content .actionWrap .button').click(function () {
            var _hotelName = $(this).closest('.subNav').parent().find('.label').html();
            $('#formRequestAProposal1 .hotelList .hotelBlock .list ul > li').removeClass('active');
            $(this).closest('.subNav').parent().addClass('active');
            $('#formRequestAProposal1 .triggerDropDown').removeClass('active');
            $('#formRequestAProposal1 .hotelName .hotelLabel .name').html(_hotelName);
            $('#formRequestAProposal1 .hotelListDropDown').hide();
            $('#formRequestAProposal1 .hotelList .hotelBlock .list ul li .subNav .head').removeClass('active');
            $('#formRequestAProposal1 .hotelList .hotelBlock .list ul li .subNav .content').hide();
        });
        //close popup on mobile
        $('#formRequestAProposal1 .mobileHeader .close, .t-mobile-heading .close').click(function () {
            $('.t-datepicker-day, .t-mobile-heading').hide();
            //the following code restores original checkout date so instead we need to call $('body').click()
            //$('.t-datepicker').tDatePicker('hide');
            $('body').click();
            console.log("new code fired");
            $('.dropDown').hide();
        });
        //seating style script
        $('#formRequestAProposal1 .seatingStyleWrap .optionsWrap ul li').click(function () {
            $('.seatingStyleWrap .optionsWrap ul li').removeClass('active');
            $(this).addClass('active');
           // initializeEventAndVenue();
        });
        $("#formRequestAProposal1 .accomodationWrap .label label").click(function () {
            $("label").removeClass("active");
            $(this).addClass("active");
        });
        $("#formRequestAProposal1 .accomodationWrap .label label.yes").click(function () {
            $('.request-a-proposal-form .sectionFormWrap .accomodationWrap .accomodationForm').show();
        });
        $("#formRequestAProposal1 .accomodationWrap .label label.no").click(function () {
            $('.request-a-proposal-form .sectionFormWrap .accomodationWrap .accomodationForm').hide();
        });
        nextScreenFunc = function (slideCount, fillPercentage) {
            $('#formRequestAProposal1 .sectionFormWrap').hide();
            $('#formRequestAProposal1 .sectionFormWrap:eq(' + slideCount + ')').show();
            $('#formRequestAProposal1 .timelineWrap ul li').removeClass('active completed');
            for (i = 0; i < slideCount; i++) {
                $('.timelineWrap ul li:eq(' + i + ')').addClass('completed');
            }
            for (i = 0; i <= slideCount; i++) {
                $('#formRequestAProposal1 .timelineWrap ul li:eq(' + i + ')').addClass('active');
            }
            $('#formRequestAProposal1 .timelineWrap .filler').css({
                'width': fillPercentage + '%'
            });
        };

    }
    catch (exxx) {
        /**/
    }
});


function initializeEventAndVenue(events, venus, seating) {
    $('form[name="formRequestAProposal"] select[name="event_type"]').html("<option value=''>"+glblRequestAProposalCommonDictionaryArray.SelectEvent+"</option>" + fnGetHotelEventOptions(events));
    $('form[name="formRequestAProposal"] select[name = "venue"]').html("<option value=''>"+glblRequestAProposalCommonDictionaryArray.SelectVenue+"</option>" + fnGetHotelVenueOptions(venus));

    $(".seatingStyleList li").each(function () {
        $(this).hide();
        $(this).removeClass("active");
        for (var i = 0; i < seating.length; i++) {
            if (seating[i] != "") {             

                var strSeatingStyle = seating[i].toLowerCase().trim();
                if (strSeatingStyle == "theater")
                {
                    strSeatingStyle = "theatre";
                }

                if ($(this).find(".text").attr("data-seating-style-text").toLowerCase().trim() == strSeatingStyle) {                  
                    $(this).show();
                }               
            }
        }
    });

}
try {

    //FORM SUBMITTION LOGIC
    $(".btnScreenOne").click(function () {
        fnSubmitRequestAProposalForm(this, "screen1");
    });

    $(".btnScreenTwo").click(function () {
        fnSubmitRequestAProposalForm(this, "screen2");
    });

    function fnGetHotelEventOptions(events) {
        var arrUniqueValue = [];
        var optValues = "";
        for (i = 0; i < events.length; i++) {
            if (events[i] != "") {
                optValues += "<option value='" + events[i] + "'>" + events[i] + "</option>";
            }
        }
        return optValues;
    }
    function fnGetHotelVenueOptions(evenvenu) {
        var arrUniqueValue = [];
        var optValues = "";
        for (i = 0; i < evenvenu.length; i++) {
            if (evenvenu[i] != "") {
                optValues += "<option value='" + evenvenu[i] + "'>" + evenvenu[i] + "</option>";
            }
        }
        return optValues;
    }

    function fnSubmitRequestAProposalForm(obj, screen) {
        var _currFormId = $(obj).closest('form').attr('id');

        var hotelcode = $('#' + _currFormId + ' .allHotels').find('li.active').attr('hotelcode');

        var errorMessage = [];
        var errorFields = [];
        $(".errorMsg").html("");


        var data = $("#" + _currFormId).serializeArray();
        data.push({ name: 'hotel', value: $(".eventHotelTitle").html() });
        data.push({ name: 'screen', value: screen });
        data.push({ name: 'checkin', value: $('.calender_1 .t-input-check-in').val().trim() });
        data.push({ name: 'checkout', value: $('.calender_1 .t-input-check-out').val().trim() });
        data.push({ name: 'accomodation_checkin', value: $('.calender_2 .t-input-check-in').val().trim() });
        data.push({ name: 'accomodation_checkout', value: $('.calender_2 .t-input-check-out').val().trim() });
        data.push({ name: 'seating_style', value: $('#' + _currFormId + ' .seatingStyleWrap li.active').text().trim() });


        $.ajax({
            dataType: "jsonp",
            url: "/handlers/form-request-a-proposal.ashx",
            data: data,
            type: "POST",
            async: false,
            success: function (result) {
                result = JSON.parse(result);
                if (result.status) {
                    if (result.next_screen == "screen2") {
                        nextScreenFunc(1, 50);
                    }
                    else if (result.next_screen == "finalscreen") {
                        nextScreenFunc(2, 100);
                    }
                }
                else {
                    errorMessage = result.error_message.split('.');
                    errorFields = result.error_field.split('.');

                    for (var i = 0; i < errorFields.length; i++) {

                        if (errorFields[i] != "") {

                            $(".errorMsg").show();
                            if (errorFields[i] == "query") {
                                $('#' + _currFormId + ' textarea[name="' + errorFields[i] + '"]').next(".errorMsg").html(errorMessage[i]);
                            }
                            else if (errorFields[i] == "salutation"
                                || errorFields[i] == "venue"
                                || errorFields[i] == "event_type"
                                || errorFields[i] == "category") {
                                $('#' + _currFormId + ' select[name="' + errorFields[i] + '"]').next(".errorMsg").html(errorMessage[i]);
                            }
                            else if (errorFields[i] == "additional_information") {
                                $('#' + _currFormId + ' textarea[name="' + errorFields[i] + '"]').next(".errorMsg").html(errorMessage[i]);
                            }
                            else if (errorFields[i] == "hotel") {

                                $('#' + _currFormId + ' .hotelName .errorMsg').html(errorMessage[i]);
                            }
                            else if (errorFields[i] == "checkout") {

                                $('#' + _currFormId + ' .calender_1  .errorMsg').html(errorMessage[i]);
                            }
                            else if (errorFields[i] == "checkout") {

                                $('#' + _currFormId + ' .calender_1  .errorMsg').html(errorMessage[i]);
                            }
                            else if (errorFields[i] == "accomodation_checkout") {

                                $('#' + _currFormId + ' .calender_2  .errorMsg').html(errorMessage[i]);
                            }
                            else if (errorFields[i] == "seating_style") {

                                $('#' + _currFormId + ' .errorMessageSeatingStyle').html(errorMessage[i]);
                            }
                            else {
                                $('#' + _currFormId + ' input[name="' + errorFields[i] + '"]').next(".errorMsg").html(errorMessage[i]);
                            }


                        }
                    }
                }

            },
            error: function () {
                alert("There has been an error on server. Please try after some time.");
            }
        });
    }

}
catch (exxx) {


}

function fnEnableCODatesRequestAproposal() {
    console.log(22);
    var disableDateFrom = new Date(defaultEnddateRP);
    var disableDateFromIncremented = new Date(defaultEnddateRP);
    $(".request-a-proposal-form .checkOutDate tbody td.t-day, .request-a-proposal-form .checkOutDate tbody td.t-start, .request-a-proposal-form .checkOutDate tbody td.t-end, .request-a-proposal-form .checkOutDate tbody td.t-range").each(function () {

        if (new Date(parseInt($(this).attr("data-t-date"))).toString() == disableDateFrom.toString()) {
            $(this).next(".t-disabled").removeClass("t-disabled");
        }
    });
}


/* get the index of first country from JSON data*/
function getDestinationCountryTitle() {
    var hotelTitle = "";
    var _hotelcode = glblCurrentPageHotelCode;
    for (var i = 0; i < arrHotelLatLongDetails.length; i++) {
        if (arrHotelLatLongDetails[i].hotelcode.toLowerCase() == _hotelcode.toLowerCase()) {
            hotelTitle = arrHotelLatLongDetails[i].hoteltitle;
            break;
        }
    }
    return hotelTitle;
}


/* JS: request-a-proposal-form.js end*/;
var google_client_id = "1096891622687-8o97qtq4ir4c04l9edklluoapep0334r.apps.googleusercontent.com";
var facebook_app_id = "2168130489900893";
var userSalutation = "";
var userFirstName = "User";
var userLastName = "User";  
var userEmail = "";

$(function () {
       
    setUserLoginDetails();   

    if (IsMemberLoggedIn) {   

        fnShowUserDetails(true);      
          
    }
    else
    {

        if (document.location.pathname.indexOf("/web-exclusive-rate") == -1) {
            $(".formLogin").show();
            $(".formRegistration").hide();
            $(".formForgotPassword").hide();
            $(".formResetPassword").hide();
        }



        if (document.location.pathname.indexOf("/web-exclusive-rate") != -1) {
            if ($(".webExclusiveTriger").length > 0) {
                $(".webExclusiveTriger").remove();
                setTimeout(function () {
                    if (!IsMemberLoggedIn) {

                        var useraction = fnGetParameterByName("ua").toLocaleLowerCase();
                        /*Registration*/
                        if (useraction == "login") {
                            $("#formLogin").show();
                            $("#formRegistration").hide();
                            $("#formForgotPassword").hide();
                            $("#formResetPassword").hide();
                        }
                        else if (useraction == "registration") {
                            $("#formLogin").hide();
                            $("#formRegistration").show();
                            $("#formForgotPassword").hide();
                            $("#formResetPassword").hide();
                        }
                        else if (useraction == "reset") {
                            $("#formLogin").hide();
                            $("#formRegistration").hide();
                            $("#formForgotPassword").hide();
                            $("#formResetPassword").show();
                        }
                    }

                }, 50);

            }
        }
    }

$("#formLogin #btnNavigateToSignUp").click(function(){
		$(".webExclusivesPopup").hide();
});	
	
});


try {
    setTimeout(function () {
        $(".description-col #btnNavigateToSignUp").click(function () {
            $("#formLogin").hide();
            $("#formRegistration").show();
            $("#formForgotPassword").hide();
            $("#formResetPassword").hide();
        });

        $("#btnNavigateToLogin").click(function () {
            $("#formLogin").show();
            $("#formRegistration").hide();
            $("#formForgotPassword").hide();
            $("#formResetPassword").hide();
        });

    },1000);

}
catch(LoginSignupExx)
{

}


function showForgotPassword()
{
    $("#formLogin").hide();
    $("#formRegistration").hide();
    $("#formForgotPassword").show();
    $("#formResetPassword").hide();
}

function fnLogout() {
    
    var data = [];
    $.ajax({
        dataType: "jsonp",
        url: "/handlers/oberoihotels-member-logout.ashx",
        data: data,
        type: "POST",
        async: false,
        success: function (result) {
          
            if (result == "success") {
               // alert("Loggout successfully");
                if (fnGetParameterByName("ua") == "") {
                    location.reload();
                }
                else
                {
                    document.location = "/web-exclusive-rate";
                }
            }
            else {
               
            }

        },
        error: function () {
            alert("There has been an error on server. Please try after some time.");
        }
    });  
}


function prefillRegistrationForm(id, email, first_name, last_name, LoginWith) {

    $('#formRegistration input[name="first_name"]').val(first_name);
    $('#formRegistration input[name="last_name"]').val(last_name);
    $('#formRegistration input[name="email"]').val(email);
    $('#formRegistration input[name="LoginWith"]').val(LoginWith);
    if (email != "") {
        $("#formRegistration input[name=email]").attr('readonly', 'readonly');
    }
    $('#formRegistration input[name="socialid"]').val(id);
}


//FB LOGIN/SIGNUP START
function getUserData() {

    FB.api('/me', { fields: 'id,email,name,first_name,last_name' },  function (response) {
        prefillRegistrationForm(response.id, response.email, response.first_name, response.last_name, "facebook");
    });   
}

try {

    if (document.location.host != "ohrnewsite.iabeta.in") {
        window.fbAsyncInit = function () {

            //SDK loaded, initialize it
            FB.init({
                appId: facebook_app_id,
                xfbml: true,
                version: 'v2.2'
            });

            //check user session and refresh it
            FB.getLoginStatus(function (response) {
                console.log(response);
                if (response.status === 'connected') {
                    getUserData();
                } else {
                }
            }, true);
        };


        // Load the SDK asynchronously
        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "https://connect.facebook.net/en_US/sdk.js";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    }
}
catch (Exxxx)
{

}
//FB LOGIN/SIGNUP END






//Login
$(".ohLoginBtn").click(function () {

    var _currFormId = $(this).closest('form').attr('id'); 

    validateUserAndLogin($('#' + _currFormId + ' input[name="email"]').val(), $('#' + _currFormId + ' input[name="password"]').val(), "oberoihotels");
});
$(".fbLoginBtn").click(function () {   

    FB.login(function (response) {
        if (response.authResponse) {
            signInCallback("facebook", response.authResponse.accessToken);
        }
        else {

        }
    }, { scope: 'email,public_profile', return_scopes: true });    

});
$('.googleLoginBtn').on('click', function () {

    if (fnGoogleUserLoggedIn()) {
        signInCallback("google", gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse(true).access_token);
    }
    else {
        auth2.grantOfflineAccess().then(fnValidateGoogleuUserSignin);
    }
})

//Signup
$(".ohSignupBtn").click(function () {
    var buttonRef = $(this);
    $(buttonRef).attr("disabled", true).attr("value", "Registering..");

    var _currFormId = $(this).closest('form').attr('id');
    console.log("registration");
    // validateUserAndLogin($('input[name="email"]').val(), $('input[name="password"]').val(), "oberoihotels");
    var errorMessage = [];
    var errorFields = [];
    var data = $("#" + _currFormId).serializeArray();
    //data.push({ name: 'LoginWith', value: LoginWith });
    $(".error-message").show();
    $(".error-message").html("");

    

    $.ajax({
        dataType: "jsonp",
        url: "/handlers/form-register-user.ashx",
        data: data,
        type: "POST",
        async: true,
        success: function (result) {
            $(buttonRef).attr("disabled", false).val("Register");
            result = JSON.parse(result);
            if (result.status) {
                if (result.error_message == "alreadyregistered") {
                    $('#' + _currFormId + ' .commonMessage').html("Email id already registered. Click login button to login.");
                }
                else if (result.ssoAccessToken == "") {
                    alert(result.error_message.replace("<br>",""));
                }
                else {
                    alert("Registration Successfull.");
                    window.location.reload();
                }
            }
            else {
                errorMessage = result.error_message.split('.');
                errorFields = result.error_field.split('.');

                for (var i = 0; i < errorFields.length; i++) {

                    if (errorFields[i] != "") {


                        if (errorFields[i] == "salutation" || errorFields[i] == "country") {
                            $('#' + _currFormId + ' select[name="' + errorFields[i] + '"]').next(".error-message").html(errorMessage[i]);
                        }
                        else if (errorFields[i] == "tnc_and_privacy_policy") {
                            $('#' + _currFormId + ' .error_tnc_and_privacy_policy').html(errorMessage[i]);
                        }
                        else {
                            $('#' + _currFormId + ' input[name="' + errorFields[i] + '"]').next(".error-message").html(errorMessage[i]);
                        }
                    }

                }
            }

        },
        error: function () {
            alert("There has been an error on server. Please try after some time.");
            $(buttonRef).attr("disabled", false).val("Register");
        }
    });

});
$("#fbSignupBtn").click(function () {
    
    FB.login(function (response) {
        if (response.authResponse) {
            getUserData();
        }
        else {

        }
    }, { scope: 'email,public_profile', return_scopes: true});

});



$('#googleSignupBtn').on('click', function () {

    if (fnGoogleUserLoggedIn()) {
        signUpCallback("google", gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse(true).access_token);
    }
    else {
        auth2.grantOfflineAccess().then(fnValidateGoogleuUser);
    }
})

//Forgot Passsword
$(".btnForgotPassword").click(function () {

    var _currFormId = $(this).closest('form').attr('id'); 

    $('#' + _currFormId + ' .error-message').show();
    $('#' + _currFormId + ' .error-message').html("");

    var formData = [];
    formData.push({
        name: "forgot_password_email", value: $('#' + _currFormId + ' input[name="forgot_password_email"]').val() });
    $.ajax({
        dataType: "jsonp",
        url: "/handlers/form-forgot-password.ashx",
        data: formData,
        type: "POST",
        async: false,
        success: function (result) {
            result = JSON.parse(result);
            if (result.status) {
                if (result.error_message == "notregistered") {
                    $('.forgot_password_message').html("Email id does not exist.");
                }
                else {
                    $(".btnForgotPassword").attr("disabled", "dissabled");
                    $('#' + _currFormId + ' input[name="forgot_password_email"]').val("");
                    $('.forgot_password_message').html(result.user_message);
                }
            }
            else {
                $('.forgot_password_message').html(result.error_message);
            }
        },
        error: function () {
            alert("There has been an error on server. Please try after some time.");
        }
    });

});

//Reset Password
$(".btnResetPassword").click(function () {

    var _currFormId = $(this).closest('form').attr('id');

    $(".error-message").show();
    $(".error-message").html("");

    var errorMessage = [];
    var errorFields = [];

    var formData = [];
    formData.push({ name: "reset_password", value: $('#' + _currFormId + ' input[name="reset_password"]').val() });
    formData.push({ name: "reset_confirm_password", value: $('#' + _currFormId + ' input[name="reset_confirm_password"]').val() });
    formData.push({ name: "resetcode", value: fnGetParameterByName("resetcode") });
    $.ajax({
        dataType: "jsonp",
        url: "/handlers/form-reset-password.ashx",
        data: formData,
        type: "POST",
        async: false,
        success: function (result) {
            result = JSON.parse(result);
            if (result.status) {
                if (result.error_message == "passwordreset") {
                    alert("Password has been reset");
                    window.location = "/web-exclusive-rate";
                }
                else if (result.error_message == "invalidaccess") {
                    alert("Invalid Access");
                }
            }
            else {
                errorMessage = result.error_message.split('.');
                errorFields = result.error_field.split('.');

                for (var i = 0; i < errorFields.length; i++) {

                    if (errorFields[i] != "") {

                        $('#' + _currFormId + ' input[name="' + errorFields[i] + '"]').next(".error-message").html(errorMessage[i]);
                    }
                }
            }
        },
        error: function () {
            alert("There has been an error on server. Please try after some time.");
        }
    });

});

//Functions
function validateUserAndLogin(email, password, LoginWith) {

    var buttonRef = $(".ohLoginBtn");
    $(buttonRef).attr("disabled", true).addClass('active');
    $('.login-loader').css('display','flex');
    var errorMessage = [];
    var errorFields = [];
    var formData = [];
    $("#formLogin .error-message").html("");
    formData.push({ name: "email", value: email });
    formData.push({ name: "password", value: password });
    formData.push({ name: "LoginWith", value: LoginWith });

    $.ajax({
        dataType: "jsonp",
        url: "/handlers/form-login.ashx",
        data: formData,
        type: "POST",
        async: true,
        success: function (result) {
            $(buttonRef).attr("disabled", false).removeClass('active');
            result = JSON.parse(result);
            if (result.status) {
                IsMemberLoggedIn = true;
               // alert("Logged in successfully");
                location.reload();
                window.location = "/web-exclusive-rate";
            }
            else {
                $("#formLogin .error-message").show();
                if (LoginWith == "oberoihotels") {
                    if (result.is_single_message) {
                        $('#formLogin input[name="password"]').next(".error-message").html(result.error_message);
                    }
                    else if (result.error_message == "iup") {
                        $('#formLogin input[name="password"]').next(".error-message").html("Either Username OR Password is invalid.");
                    }
                    else if (result.error_message == "nr") {
                        $('#formLogin input[name="password"]').next(".error-message").html("Email id does not exist!");
                    }
                    else {
                        errorMessage = result.error_message.split('.');
                        errorFields = result.error_field.split('.');
                        for (var i = 0; i < errorFields.length; i++) {

                            if (errorFields[i] != "") {
                                $('#formLogin input[name="' + errorFields[i] + '"]').next(".error-message").html(errorMessage[i]);
                            }
                        }
                    }
                }
                else {
                    if (result.error_message == "redirecttosignuppage" || result.error_message == "saveandredirect") {
                        console.log(44);
                        alert("login success");
                    }
                }
            }
        },
        error: function () {
            alert("There has been an error on server. Please try after some time.");
            $(buttonRef).attr("disabled", false).attr("value", "Login");
        }
    });
}
function fnValidateGoogleuUser() {
    signUpCallback("google", gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse(true).access_token);
}
function fnValidateGoogleuUserSignin() {
    setTimeout(function () {
        signInCallback("google", gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse(true).access_token);
    },500);
    
}
function startGoogleAuth() {

    if (document.location.host != "ohrnewsite.iabeta.in") {
        gapi.load('auth2', function () {
            auth2 = gapi.auth2.getAuthInstance({
                client_id: google_client_id,
                // Scopes to request in addition to 'profile' and 'email'
                scope: 'profile email',

            });
        });
    }
}
function signInCallback(LoginWith, code) {

    $(".error-message").html("");


    var formData = [];
    formData.push({ name: "LoginWith", value: LoginWith });
    formData.push({ name: "code", value: code });
    formData.push({ name: "loginORsignup", value: "login" });
    $.ajax({
        dataType: "jsonp",
        type: 'POST',
        url: '/handlers/oAuth.ashx',
        success: function (result) {
            result = JSON.parse(result);
            if (result.status) {
                if (result.error_message == "signinalreadyregistered") {
                 
                   // alert("Logged in successfully.");
                    IsMemberLoggedIn = true;            

                    fnShowUserDetails(false);

                   // location.reload();
                }
                else if (result.error_message == "signinnotregistered" || result.error_message == "ssotokenmissing") {
                    $('#formLogin input[name="email"]').next(".error-message").show();
                    $('#formLogin input[name="email"]').next(".error-message").html(result.user_message);
                }
            }
            else {
                $('#formLogin input[name="email"]').next(".error-message").show();
                $('#formLogin input[name="email"]').next(".error-message").html(result.user_message);
            }
        },
        async: false,
        data: formData
    });

}

function fnShowUserDetails(isPageLoad)
{    
    setUserLoginDetails();

    if ($(".webExclusivesUserDetails").length >= 2) {
        $(".webExclusivesUserDetails:eq(0)").html("<span class='we-welcome'>Welcome " + userSalutation + " <span class='we-user-name'>" + userLastName + "</span> </span><span class='we-text'>You have successfully signed in. <br/> You may now avail Web Exclusive Savings.</span> <span class='check-web-ex-offer-btn'><a  href='javascript:;'>Click here to view Web Exclusive Offers.</a></span> <span class='we-logout'><a href='javascript:fnLogout()'>Log out</a></span>");
        $(".webExclusivesUserDetails:eq(1)").html("<span class='we-welcome'>Welcome " + userSalutation + " <span class='we-user-name'>" + userLastName + "</span> </span><span class='we-text'>You have successfully signed in. Please visit our <a class='blue' href='https://www.oberoihotels.com/'>website</a> for more details or <a class='orange' href='javascript:;openBookingEngine()'>book now</a> for savings.</span> <span class='check-web-ex-offer-btn'><a  href='javascript:;'>Click here to view Web Exclusive Offers.</a></span> <span class='we-logout'><a href='javascript:fnLogout()'>Log out</a></span>");
    }
    else {
        if (document.location.pathname.indexOf("/web-exclusive-rate") != -1) {
            if (!isPageLoad) {
                $(".webExclusivesUserDetails").html("<span class='we-welcome'>Welcome " + userSalutation + " <span class='we-user-name'>" + userLastName + "</span> </span><span class='we-text'>You have successfully signed in. Please visit our <a class='blue' href='https://www.oberoihotels.com/'>website</a> for more details or <a class='orange' href='javascript:;openBookingEngine()'>book now</a> for savings.</span> <span class='check-web-ex-offer-btn'><a  href='javascript:;'>Click here to view Web Exclusive Offers.</a></span> <span class='we-logout'><a href='javascript:fnLogout()'>Log out</a></span>");
            }            
        }
        else
        {
            $(".webExclusivesUserDetails:eq(0)").html("<span class='we-welcome'>Welcome " + userSalutation + " <span class='we-user-name'>" + userLastName + "</span> </span><span class='we-text'>You have successfully signed in. <br/> You may now avail Web Exclusive Savings.</span> <span class='check-web-ex-offer-btn'><a ' href='javascript:;'>Click here to view Web Exclusive Offers.</a></span> <span class='we-logout'><a href='javascript:fnLogout()'>Log out</a></span>");
        }
    }

    $(".formLogin").hide();
    $(".formRegistration").hide();
    $(".formForgotPassword").hide();
    $(".formResetPassword").hide();

    $(".webExclusivesUserDetails .check-web-ex-offer-btn").click(function(){
        $('html,body').animate({
            scrollTop: $("#web-exclusive-offer-table").offset().top - 120
          }, 600);
    });
}
function signUpCallback(LoginWith, code) {

    $(".error-message").html("");

    var formData = [];
    formData.push({ name: "LoginWith", value: LoginWith });
    formData.push({ name: "code", value: code });
    formData.push({ name: "loginORsignup", value: "signup" });
    $.ajax({
        dataType: "jsonp",
        type: 'POST',
        url: '/handlers/oAuth.ashx',
        success: function (result) {
            result = JSON.parse(result);
            if (result.status) {
                if (result.error_message == "signupalreadyregistered") {
                    $('#formRegistration input[name="email"]').next(".error-message").show();
                    $('#formRegistration input[name="email"]').next(".error-message").html(result.user_message);

                }
                else if (result.error_message == "signupnotregistered") {
                    prefillRegistrationForm(result.socialid, result.email, result.first_name, result.last_name, LoginWith);
                    $("#ohSignupBtn").trigger("click");

                }
            }
            else {
                $('#formRegistration input[name="email"]').next(".error-message").show();
                $('#formRegistration input[name="email"]').next(".error-message").html("Email id does not exist! Click sign up button to register and avail web exclusive offers for members.");
            }
        },
        async: false,
        data: formData
    });

}
function fnGoogleUserLoggedIn() {
    if (gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse(true) != null) {
        return true;
    }
    else {
        return false;
    }
}

 /* Set users details in cookie for web exclusive rates*/
function setUserLoginDetails() {
    if (readCookie("UserSalutation") != "") {
        userSalutation = readCookie("UserSalutation");
    }
    if (readCookie("UserLastName") != "") {
        userLastName = readCookie("UserLastName");
        IsMemberLoggedIn = true;
    }

    if (readCookie("UserEmail") != "") {
        userEmail = readCookie("UserEmail");
    }

};
/*$(".search-nav ul li a").click(function(){
	var navId = $(this).data("search");
	$(".search-nav ul li a").removeClass("active");
	$(this).addClass("active");
	galleryInit();

	
	
	
	$(".search-result-box").css("display", "none");
			$("#" + navId).css("display", "block");
	galleryInit();
	
	})*/;
$(document).ready(function(){
	
	$(".mo-destination-tab li").click(function(){
		var moDataTab = $(this).attr('data-tab');

	$(this).addClass("active");
	$(this).siblings().removeClass("active");
 $(".mo-destination-tab-details-wrap").removeClass("mo-destination-tab-wrap-active");
$("#"+moDataTab).addClass("mo-destination-tab-wrap-active");
});

/*---------menu code start here-------------*/

$(".mo-menu-tab ul li").click(function(){
var dataTab = $(this).attr("data-menuTab");
var siblingDataTab = $(this).siblings().attr("data-menuTab");
var siblingTabTxt = $(this).siblings().text();

$(".mo-menu-switch-tab").attr("data-menuSwitchTab", siblingDataTab);

$(".mo-menu-tab ul li").removeClass("active");
$(this).addClass("active");
$(".mo-menu-list").removeClass("mo-menu-list-active");
$("."+dataTab).addClass("mo-menu-list-active");
$(".mo-menu-switch-tab-txt").text(siblingTabTxt);
});
$(".mo-menu-switch-tab").click(function(){
var moTabSwitchDataVal = $(this).attr("data-menuSwitchTab");
$("."+moTabSwitchDataVal).click();
});
var winWidth = $(window).width();


$(".moMenuLink").click(function(){
	var dataMoUrl = $(this).attr("data-moUrl");
    
	
	$(".mo-pop-up-box .mo-pop-up-desc .mo-hotels-button a").attr("href", dataMoUrl);
});

if(winWidth > 767 ){
	$(document).on("click", ".dhover.moMenuLink, .map-popup-btn.moMenuLink", function(){
		$(".mo-black-overlay").show();
	})
}
$(document).on("click", ".moMenuLink", function(){
	
	var dataMoUrl = $(this).attr("data-moUrl");
   
	if(winWidth < 767 ){
			$(".mo-black-overlay").show();
	}
	//$(".mo-black-overlay").show();
	$(".mo-pop-up-box .mo-pop-up-desc .mo-hotels-button a").attr("href", dataMoUrl);
});

if(winWidth<1025){

$(".mo-mendarin-menu").appendTo($(".hamburger-mob-menu-head-mo .menu-level-1-omo"));	

$(".mo-menu-info-box").insertAfter(".mo-mendarin-menu .menu-colm3");
$(".mo-menu-tab").insertBefore(".mo-mendarin-menu");

$(".hamburger-mob-menu-head-mo").click(function(){
 // $(this).find(".menu-level-1-omo.menu-list").addClass("actv");
});

$(".mo-mendarin-menu .menu-hdng").click(function(){
	$(".backto-menu span").addClass("actv4");
    $(".backto-menu span").removeClass("actv2");
});

$(".menu-container").on('click', '.backto-menu span.actv4', function() {
	$(".mo-mendarin-menu .menu-list").removeClass("actv");
   
	$(".backto-menu span").removeClass("actv4");
    $(".backto-menu span").addClass("actv2");
    $(".menu-container .main-menu>li, .menu-container .social-menu").css("opacity","1");
    $(".menu-container .backto-menu").hide();    

});

$(".oberoi-one-login-pop-up-close").click(function(){
 
 $(".o-one-login > a").trigger("click");   

});

}



// var moSlideHeight = $(".destination .destination-slider .destination-slide").height();

// $(".mo-destination-component").height(moSlideHeight);

// alert(moSlideHeight);


});


//function for home page data-src to src convert 
function fnAssignDataSrcToSrc(){
    $('.lazyImg').each(function(){
        var sourceuSrc = $(this).data('src');
        $(this).attr('src', sourceuSrc);
    })
}

// JavaScript Document
function moDesinationCarousel() {
	$(".mo-destination-slider").slick({
		infinite: true,
		centerMode: true,
		lazyLoad:'ondemand',
		centerPadding: '15%',
		responsive: [
		    {
		      breakpoint: 767,
		      settings: {
			   centerMode: false,
			   arrows: false,
		        }
		    }
		  ]
	});
	
$('.mo-destination-slider').on('afterChange', function(event, slick, currentSlide, nextSlide){
  var sel = $(this).find('.slick-active.destination-slide').attr('data-country');
	//console.log(sel);
	$('.mo-mandarin-destination-tab-details-wrap .countryList li').removeClass('activec');
	$('.mo-mandarin-destination-tab-details-wrap .countryList li[data-filter='+sel+']').addClass('activec');
	var moDestinationValTrim = sel.replace(/-/g, " ");
	$(".mo-mandarin-destination-tab-details-wrap .selectedCountry").text(moDestinationValTrim);
    fnAssignDataSrcToSrc();
});

		
var winWidth = $(window).width();

if(winWidth<768){	
	$(".mo-mandarin-destination-tab-details-wrap .selectedCountry").click(function(){
		$(".mo-mandarin-destination-tab-details-wrap .countryList").toggle();
		setTimeout(function(){
			$(window).scroll();
		},50)
	});

	$(".mo-mandarin-destination-tab-details-wrap .countryList li").click(function(){
		var countryValue = $(this).attr("data-filter");
		$('#moMandrainCountryFilter').attr("data-filter", countryValue);
		$(".mo-mandarin-destination-tab-details-wrap .selectedCountry").text($(this).text());
	
	});	
	
	$(document).click(function(event){
		$(".countryList").hide();
	});	
	$(".mo-mandarin-destination-tab-details-wrap .selectedCountry").click(function(event){
		event.stopPropagation();
	});

    $(".destinationTab .selectedCountry").click(function(){
        $(this).toggleClass("actv-fltr");
    });	
}
}


	
	function moGoToSlide(num)
	{
		$('.mo-destination-slider').slick('slickGoTo', num);
		
		$('.mo-mandarin-destination-tab-details-wrap .countryList li').removeClass('active');
		$('this').addClass('active');
	}

	$(".mo-mandarin-destination-tab-details-wrap .countryList li").click(function(){
	  $('.mo-mandarin-destination-tab-details-wrap .countryList li').removeClass('activec');
	  $(this).addClass('activec');
});

$(window).load(function(){
$('.mo-mandarin-destination-tab-details-wrap .slidesText p').each(function(){
var hi =	$(this).height();
	
	//console.log(hi);
	if(hi<=25)
		{
			$(this).parent().parent('.text-container').children('.slidesBtn').addClass('singleLine');
		}
	
});	
	
});


/*    MO Login Pop Up Code Starts   */

//selec box country COde

$(document).ready(function () {
    $('.selectBox').select2();
    fnOberoiOneOtpInputGP();
    $('.existing-user-global-popup').show();
    $(".signinGPSection").hide();
    $(".selectBox").change();
  
    if($(window).width() < 991 ){
        fnOberoiOneMobMenuDisplay();
        fnOberoiOneMobMenuSubMenuDisplay();
    }



});

$(document).on("change", ".selectBox", function () {
    var selectBoxVal = "";
    selectBoxVal = $(this).val();
    $(this).parent(".countryCodeWrap").find('.selectBoxValDisplay').html(selectBoxVal);
});

function fnOberoiOneOtpInputGP() {

    $('.otp-input-box').find('input').each(function () {
        $(this).attr('maxlength', 1);
        $(this).on('keyup', function (e) {
            var parent = $($(this).parent());

            if (e.keyCode === 8 || e.keyCode === 37) {
                var prev = parent.find('input.' + $(this).data('previous'));

                if (prev.length) {
                    $(prev).select();
                }
            } else if ((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 65 && e.keyCode <= 90) || (e.keyCode >= 96 && e.keyCode <= 105) || e.keyCode === 39) {
                var next = parent.find('input.' + $(this).data('next'));

                if (next.length) {
                    $(next).select();
                } else {
                    if (parent.data('autosubmit')) {
                        parent.submit();
                    }
                }
            }
        });
    });

}

 
$(document.body).on('click', '.omo-alliance-details .mo-enroll-now', function (e) {
    $('.mo-overlay').show();
    $('.global-oberoi-one-pop-up').show();
    $(".signinGPSection").hide();
    $(".signupGPSection").show();
    $(".global-oberoi-one-pop-up #loginAccount").removeClass("activeUserTab");
    $(".global-oberoi-one-pop-up #enrolAccount").addClass('activeUserTab');
});

$(document.body).on('click', '.about-o-one .btn-style1', function (e) {
    $('.mo-overlay').show();
    $('.global-oberoi-one-pop-up').show();
    $(".signinGPSection").show();
    $(".signupGPSection").hide();
    $(".global-oberoi-one-pop-up #loginAccount").addClass("activeUserTab");
    $(".global-oberoi-one-pop-up #enrolAccount").removeClass('activeUserTab');
});

$(document.body).on('click', '.global-oberoi-one-pop-up #loginAccount', function (e) {
    $(".signinGPSection").show();
    $(".signupGPSection").hide();
});

$(document.body).on('click', '.global-oberoi-one-pop-up .loginBox', function (e) {
    $(this).siblings().removeClass("activeUserTab");
    $(this).addClass("activeUserTab");
});

$(document.body).on('click', '.global-oberoi-one-pop-up #enrolAccount', function (e) {
    $(".signupGPSection").show();
    ; $(".signinGPSection").hide();

});

$(document.body).on('click', '.loginClickHref', function (e) {
    $(".signinGPSection").show();
    $(".signupGPSection").hide();
    $(".global-oberoi-one-pop-up #loginAccount").addClass("activeUserTab");
    $(".global-oberoi-one-pop-up #enrolAccount").removeClass('activeUserTab');

});


function fnOberoiOneSignUpUserGP() {

    var FormData = $("form[name='frmOberoiOneSignUpUserGP']").serializeArray();
    if (fnOberoOneigetUrlQuereyString()['precardedsfid'] != null || fnOberoOneigetUrlQuereyString()['precardedsfid'] != "") {
        FormData.push({ name: 'precardedsfid', value: fnOberoOneigetUrlQuereyString()['precardedsfid'] });
    }
    if (window.location.pathname == "/photo-context/dashboard/") {
        FormData.push({ name: 'synxisReturnURL', value: window.location.href });
    }

    var userEmailID = $("#txtEmailId").val().trim();
    var userName = $("#txtFirstName").val().trim();
    glblOberoiOneUserEmail = userEmailID;
    $('.enroll-user-global-popup .sbmt-btn').addClass('processing');
    $('.err-txt').html(" ");
    $.ajax(
        {
            url: handelerPrefix + '/handlers/oberoi-one/create-users.ashx',
            type: 'post',
            data: FormData,
            dataType: 'jsonp',
            success: function (response) {
                response = JSON.parse(response);
                console.log(response);
                glblOberoiOneUserEmail = userEmailID;

                if (response.success == true) {
                    if (response.execute_instruction == "redirect to dashboard") {
                        // window.location.replace("/oberoi-one/dashboard/");
                        createSessionCookie("OberoiOneUserLoggedInStatus", "true");
                        // createSessionCookie("OberoiOneUserDisplayNameWithSaluatation", response.Oberoi_One_Response_User_Data[0].Salutation + " " + response.Oberoi_One_Response_User_Data[0].LastName);

                        // createSessionCookie("OberoiOneLoggedMemberBasicInformation", JSON.stringify(response.Oberoi_One_Response_User_Data[0]));

                        window.dataLayer.push({
                            'oberoi_one_registration_button_click': true
                        }
                        );


                        //url for redirection.
                        if (window.location.pathname == "/photo-contest/dashboard/") {
                            location.reload();
                        }
                        else {
                            window.location = "/oberoi-one/dashboard/";
                        }
                    }
                    else if (response.execute_instruction == "email verification is pending") {
                        $('.signupGPSection .enroll-user-global-popup').hide();
                        $('.signupGPSection  #newUserRegisteredMessage').show();
                        $('.signupGPSection  #signUpCaseOtpVerification input[name="emailId"]').attr('value', userEmailID);
                        $('.signupGPSection #newUserRegisteredMessage .otp-txt').html("Thank you for enrolling for Oberoi One. <br> A verification email with a verification code and a link has been sent to your registered email ID.<br>If you cannot find the email in your primary inbox, please check your Promotions, Spam or similar folders.<br>Kindly enter the four digit code below <span class='underLine'>OR</span> click on the verification link to activate your membership.");

                        window.dataLayer.push({
                            'oberoi_one_registration_button_click': true
                        }
                        );
                        ga('send', 'event', 'Register Click', 'Click', window.location.href);
                        if ($(window).width() < 767) {
                            $('html,body').animate({
                                scrollTop: $("#newUserRegisteredMessage").offset().top - 250
                            }, 600);
                        }

                    }
                    else if (response.execute_instruction == "please contact oberoi customer care") {
                        $('.enroll-user-global-popup .err-txt').html(" ");
                        $('.enroll-user-global-popup .common-error').html('This email ID is registered with multiple profiles. Please contact the Programme Centre to enable our team to get in touch with you.');
                        $('.enroll-user-global-popup .common-error').show();
                    }
                }
                if (response.is_data_exist == true) {

                    $('.enroll-user-global-popup').hide();
                    $('.signupGPSection #newUserRegisteredMessage').show();
                    $('.signupGPSection #newUserRegisteredMessage .otp-txt').html("This email id is already registered. Kindly <a class='loginClickHref'>login</a> ");
                    $('.signupGPSection #newUserRegisteredMessage .otp-box').hide();

                    //$('.enroll-user-global-popup .err-txt').html(" ");
                    //$('.enroll-user-global-popup .common-error').html("This email id is already registered. Kindly <a class='loginClickHref'>login</a>");
                    //$('.enroll-user-global-popup .common-error').show();
                }
                else if (response.error == true) {
                    $('.enroll-user-global-popup .err-txt').html(" ");
                    for (var i = 0; i < response.oberoi_one_errors.length; i++) {
                        $('.enroll-user-global-popup .' + response.oberoi_one_errors[i].error_field).html(response.oberoi_one_errors[i].error_message);

                        $('.enroll-user-global-popup .err-txt').show();
                    }
                    if ($(window).width() < 767) {
                        $('html,body').animate({
                            scrollTop: $('.' + response.oberoi_one_errors[0].error_field).offset().top - 180
                        }, 600);
                    }
                }
                $('.enroll-user-global-popup .sbmt-btn').removeClass('processing');
            },
            error: function (objXHR, objStatus, objError) {
                $('.enroll-user-global-popup .err-txt').html(" ");
                if (objXHR.responseText.length > 50) {
                    $('.enroll-user-global-popup .common-error').html('There seems to be an issue.  Please try again after some time.');
                }

                $('.enroll-user-global-popup .common-error').show();
            }

        });
}

function fnOberoiOneLogInUserGP() {
    var FormData = $("form[name='frmOberoiOneLogInUserGP']").serializeArray();
    if (window.location.pathname == "/photo-context/dashboard/") {
        FormData.push({ name: 'synxisReturnURL', value: window.location.href });
    }
    var userEmailID = $(".existing-user-global-popup #txtSignInEmailId").val().trim();
    $(".existing-user-global-popup input[name='emailId']").val(userEmailID);
    glblOberoiOneUserEmail = userEmailID;
    $('.existing-user-global-popup .sbmt-btn').addClass('processing');
    $('.existing-user-global-popup .err-txt').html(" ");
    $.ajax(
        {
            url: handelerPrefix + '/handlers/oberoi-one/log-in.ashx',
            type: 'post',
            data: FormData,
            dataType: 'jsonp',
            success: function (response) {
                response = JSON.parse(response);
                console.log(response);
                $('.existing-user-global-popup .err-txt').html(" ");
                if (response.success == true) {
                    glblOberoiOneUserEmail = userEmailID;
                    if (response.execute_instruction == "email verification is pending") {

                        if (response.success_message == "user exists in new table")
                            $('.signinGPSection #UserEmailVerificationPending .otp-txt').html('Dear Guest, <br>You would have already received an email on ' + glblOberoiOneUserEmail + ', with a verification link and a verification code, to accept an invitation to join Oberoi One. You can click that verification link or enter the verification code in the box below. Should you wish to have the verification link resent to your email address, please click the resend link below.');

                        else
                            $('.signinGPSection #UserEmailVerificationPending .otp-txt').html('Dear Guest, <br>Thank you for being part of our Web Exclusives offers. Web Exclusives has now ended and we have introduced our distinctive guest recognition programme, Oberoi One. Once you enrol into Oberoi One you will continue to have access to exclusive member rates and also many more enhanced benefits.<br><br>You would have already received an email on ' + glblOberoiOneUserEmail + ', with a verification link and a verification code, to accept an invitation to join Oberoi One. You can click that verification link or enter the verification code in the box below. Should you wish to have the verification link resent to your email address, please click the resend link below.');

                        $('.existing-user-global-popup').hide();
                        $('.signinGPSection input[name="emailId"]').attr('value', glblOberoiOneUserEmail);
                        $('.signinGPSection #UserEmailVerificationPending').show();

                    }
                    else if (response.execute_instruction == "redirct to dashboard") {
                        createSessionCookie("OberoiOneUserLoggedInStatus", "true");
                        createSessionCookie("OberoiOneUserDisplayNameWithSaluatation", response.Oberoi_One_Response_User_Data[0].Salutation + " " + response.Oberoi_One_Response_User_Data[0].LastName);

                        // createSessionCookie("OberoiOneLoggedMemberBasicInformation", JSON.stringify(response.Oberoi_One_Response_User_Data[0]));

                        //url for redirection.
                        if (window.location.pathname == "/photo-contest/dashboard/") {
                            location.reload();
                        }
                        else {
                            window.location = "/oberoi-one/dashboard/";
                        }
                    }


                }
                else if (response.error == true) {

                    if (response.oberoi_one_errors != null) {
                        $('.signinGPSection .existing-user-global-popup .err-txt').html(" ");
                        for (var i = 0; i < response.oberoi_one_errors.length; i++) {
                            $('.' + response.oberoi_one_errors[i].error_field).html(response.oberoi_one_errors[i].error_message);

                            $('.signinGPSection .existing-user-global-popup .err-txt').show();
                        }
                    }
                    if (response.error_description != "") {

                        for (var i = 0; i < response.oberoi_one_errors.length; i++) {
                            $('.signinGPSection .existing-user-global-popup .common-error').html(response.oberoi_one_errors[i].error_message);
                        }
                        $('.signinGPSection .existing-user-global-popup .err-txt').show();
                    }


                    $('.signinGPSection .existing-user-global-popup .sbmt-btn').removeClass('processing');
                }

            },
            error: function (objXHR, objStatus, objError) {
                $('.existing-user-global-popup .err-txt').html(" ");
                if (objXHR.responseText.length > 50) {
                    $('.existing-user-global-popup .common-error').html('There seems to be an issue.  Please try again after some time.');
                }

                $('.existing-user-global-popup .common-error').show();
            }

        });
}

function fnOberoiOneResendOtpAndEmailGP(email, sectiontype) {

    var sectionClassName = "signupGPSection";
    if (sectiontype == "login") {
        sectionClassName = "signinGPSection"
    }
    var dataToSend = { email: email };
    if (window.location.pathname == "/photo-context/dashboard/") {

        dataToSend = { email: email, 'synxisReturnURL': window.location.href };
    }

    $("." + sectionClassName + " .resendLoader").css("display", "inline-block");
    $("." + sectionClassName + " .err-txt").html("");
    $.ajax(
        {
            url: handelerPrefix + "/handlers/oberoi-one/resend-verification-mail.ashx",
            type: 'post',
            data: dataToSend,
            dataType: 'jsonp',
            success: function (response) {
                response = JSON.parse(response);
                console.log(response);
                $('.' + sectionClassName + ' .resendOtpMessage').removeClass('green');
                $('.' + sectionClassName + ' .resendOtpMessage').hide();
                if (response.success == true) {
                    $('.' + sectionClassName + ' .resendOtpMessage').addClass('green').html(response.success_message);
                    $('.' + sectionClassName + ' .resendOtpMessage').show();
                    $("." + sectionClassName + " .resendLoader").hide();
                }
                else if (response.error == true) {
                    $('.' + sectionClassName + ' .resendOtpMessage').html('There seems to be an issue.  Please try again after some time.');
                    $('.' + sectionClassName + ' .resendOtpMessage').show();
                    $("." + sectionClassName + " .resendLoader").hide();
                }
            },
            error: function (objXHR, objStatus, objError) {
                console.log(objXHR.responseText);
            }

        });
}

function fnOberoiOneRecoverYourPasswordGP() {
    var FormData = $("form[name='frmOberoiOneRecoverYourPasswordGP']").serializeArray();
    if (window.location.pathname == "/photo-context/dashboard/") {
        FormData.push({ name: 'synxisReturnURL', value: window.location.href });
    }
    var userEmailID = $("#txtforgetpasswordemail").val().trim();
    $('.signinGPSection .password-recovery .sign-in-submit').addClass('processing');
    $.ajax(
        {
            url: handelerPrefix + '/handlers/oberoi-one/forget-password.ashx',
            type: 'post',
            data: FormData,
            dataType: 'jsonp',
            success: function (response) {
                response = JSON.parse(response);
                console.log(response);

                if (response.success == true) {
                    /**/
                    glblOberoiOneUserEmail = userEmailID;
                    $('.signinGPSection #UserPasswordRecoveryMessage .otp-txt').html('Dear Guest,<br> An email with the details of resetting your password has been sent to your registered email ID. <br> Please follow the instructions given in the email to create your new password. </div></br><div class="resend-otp"><a href="javascript:;" onclick="fnOberoiOneRecoverYourPasswordResendGP()" class="otp-resened-btn">Click here</a> to resend the email. <span class="resendLoader" style="display: none"><img src="/images/OberoiHotels/oberoi-one/resend-loader.gif"></span></div>');

                    $('.signinGPSection .password-recovery').hide();
                    $('.signinGPSection #UserPasswordRecoveryMessage').show();
                    $('.signinGPSection .password-recovery .sign-in-submit').removeClass('processing');
                }
                else if (response.error == true) {
                    if (response.oberoi_one_errors != null) {
                        $('.signinGPSection .password-recovery .err-txt').html(" ");
                        for (var i = 0; i < response.oberoi_one_errors.length; i++) {
                            $('.' + response.oberoi_one_errors[i].error_field).html(response.oberoi_one_errors[i].error_message);

                            $('.signinGPSection .password-recovery .err-txt').show();
                            $('.signinGPSection .password-recovery .sign-in-submit').removeClass('processing');
                        }
                    }
                    if (response.error_description != "") {
                        $('.signinGPSection .password-recovery .err-txt').html(" ");
                        $('.signinGPSection .password-recovery .txtforgetpasswordemail').html(response.error_description);
                        $('.signinGPSection .password-recovery .err-txt').show();
                        $('.signinGPSection .password-recovery .sign-in-submit').removeClass('processing');
                    }
                }
            },
            error: function (objXHR, objStatus, objError) {
                $('.password-recovery .common-error').html(objXHR.responseText);
            }

        });
}
function fnOberoiOneRecoverYourPasswordResendGP() {
    var FormData = $("form[name='frmOberoiOneRecoverYourPasswordGP']").serializeArray();
    if (window.location.pathname == "/photo-context/dashboard/") {
        FormData.push({ name: 'synxisReturnURL', value: window.location.href });
    }
    var userEmailID = $("#txtforgetpasswordemail").val().trim();
    $('.resendLoader').show('processing');
    $('.password-recovery .sign-in-submit').addClass('processing');
    $.ajax(
        {
            url: handelerPrefix + '/handlers/oberoi-one/forget-password.ashx',
            type: 'post',
            data: FormData,
            dataType: 'jsonp',
            success: function (response) {
                response = JSON.parse(response);
                console.log(response);

                if (response.success == true) {
                    /**/
                    glblOberoiOneUserEmail = userEmailID;
                    $('.resendOtpMessage').html(response.success_message).addClass('green').show();

                    $('.resendLoader').hide('processing');
                }
                else if (response.error == true) {

                }
            },
            error: function (objXHR, objStatus, objError) {

                $('.password-recovery .err-txt').html(" ");
                if (objXHR.responseText.length > 50) {
                    $('.password-recovery .common-error').html('There seems to be an issue.  Please try again after some time.');
                }

                $('.password-recovery .common-error').show();

            }

        });
}

function fnOberoiOneVerifyOtpGP(data) {

    var otpNumber = "";
    $('.err-txt').html("");
    var otpInputObj = "#oberoi-one-login-singn-up-form-container form[name='" + data + "'] .otp-input-box";
    otpNumber += $(otpInputObj + " input[name='digit-1']").val();
    otpNumber += $(otpInputObj + " input[name='digit-2']").val();
    otpNumber += $(otpInputObj + " input[name='digit-3']").val();
    otpNumber += $(otpInputObj + " input[name='digit-4']").val();

    var FormData = $("form[name=" + data + "]").serializeArray();
    FormData.push({ name: 'otpNumber', value: otpNumber });

    $("form[name='" + data + "'] .otp-txt-box .validate-otp").addClass('processing');
    $.ajax(
        {
            url: handelerPrefix + "/handlers/oberoi-one/verify-otp.ashx",
            type: 'post',
            data: FormData,
            dataType: 'jsonp',
            success: function (response) {
                response = JSON.parse(response);
                console.log(response);
                $('form[name="' + data + '"] .txtotpNumber').html('');
                if (response.success == true) {
                    createSessionCookie("OberoiOneUserLoggedInStatus", "true");
                    createSessionCookie("OberoiOneUserDisplayNameWithSaluatation", response.Oberoi_One_Response_User_Data[0].Salutation + " " + response.Oberoi_One_Response_User_Data[0].LastName);

                    createSessionCookie("OberoiOneLoggedMemberBasicInformation", JSON.stringify(response.Oberoi_One_Response_User_Data[0]));

                    //url for redirection.
                    if (window.location.pathname == "/photo-contest/dashboard/") {
                        location.reload();
                    }
                    else {
                        window.location = "/oberoi-one/dashboard/";
                    }
                }
                else if (response.error == true) {

                    $('form[name="' + data + '"] .txtotpNumber').html(response.error_description);
                    $("form[name='" + data + "'] .otp-txt-box .validate-otp").removeClass('processing');
                    $('form[name="' + data + '"] .err-txt').show();
                }
            },
            error: function (objXHR, objStatus, objError) {
                console.log(objXHR.responseText);
            }

        });
}
function fnOberoiOneShowPasswordRecoveryScreenGP() {
    $(".signinGPSection .sign-in-wrapper").hide();
    $(".signinGPSection .password-recovery").show();
}
function fnOberoiOneShowLoginScreenGP() {
    $(".signinGPSection .sign-in-wrapper").show();
    $(".signinGPSection .password-recovery").hide();
}
/*    MO Login Pop Up Code Ends   */



function fnOberoiOneMobMenuDisplay() {

$(document).on("click", ".o-one-user-name-short", function(){
    fnOberoiOneShowLogOutDropDown();
   $(".o-one-user-name").toggle(); 
   $(".o-one-login-user-dtls").toggleClass("active");
});

$(".o-one-mob-menu-close-btn").click(function(){
    $(".o-one-user-name").hide(); 
   $(".o-one-user-log-out-btn").hide(); 
   $(".o-one-login-user-dtls").removeClass("active");
});
$(".menu-close, #nav-icon").click(function(){
$(".menu-o-one-login-details .o-one-user-name").show();    
});

$(".o-one-menu-wrap .o-one-login-menu .o-one-login-user-dtls .o-one-user-name").prop('onclick', null).off('click');         
}

function fnOberoiOneMobMenuSubMenuDisplay() {
    $(".menu-container.mo-menu-conatiner .main-menu>li .menu-level-1.oberoi-one-menu-level-1 .menu-hdng").click(function(){
        $(".menu-container .backto-menu").hide();
        $(this).toggleClass("active");
     if($(this).hasClass("active")){ 
          
      $(this).next(".menu-list").addClass("actv"); 
    } 
    else{
        
        $(this).next(".menu-list").removeClass("actv"); 
    } 

    });

$(".menu-container").on('click', '.backto-menu span.actv2', function() {
  $(".menu-container .main-menu .oberoi-one-menu-level-1 .menu-hdng").removeClass("active");  
});

$(".menu-container .main-menu .mo-mendarin-menu .menu-hdng").click(function(){
  if($(".menu-container.mo-menu-conatiner .main-menu>li .menu-level-1 .mo-mendarin-menu .menu-list").hasClass("actv")){
    $(".menu-container .main-menu>li:not(.has-submenu), .menu-container .social-menu, .menu-container .main-menu>li.type2").css("opacity","0");
  }

  $("#menu").scrollTop(0); 

});

$(".menu-container .main-menu .mo-oberoi-menu-list .menu-hdng").click(function(){
    if($(".menu-container.mo-menu-conatiner .main-menu>li .menu-level-1 .mo-oberoi-menu-list .menu-list").hasClass("actv")){
      $(".menu-container .main-menu>li:not(.has-submenu), .menu-container .social-menu, .menu-container .main-menu>li.type2").css("opacity","0");
    }
    $("#menu").scrollTop(0);
  
  });

  $(".menu-container .menu-close").click(function(){
    $(".menu-container .main-menu>li, .menu-container .social-menu").css("opacity","1");
  });



$(".menu-container .main-menu .hamburger-mob-menu-head-mo > .menu-hdng").click(function(){
   $(".menu-container .backto-menu").hide();
    $(this).toggleClass("active");
    if($(this).hasClass("active")){ 
         
     $(this).next(".menu-list").addClass("actv"); 
   } 
   else{
       $(this).next(".menu-list").removeClass("actv"); 
   }     

 }); 




}



	
	

	;

$(".cookie-buttons-wrapper .button-box-1").click(function () {
    $(".cookie-black-popup-overlay, .cookie-settings-wrapper").hide();
});
$(".cookie-settings-wrapper .close-settings").click(function () {
    $(".cookie-black-popup-overlay , .cookie-settings-wrapper").hide();
});

$(window).scroll(function () {
    if ($(window).scroll(20)) {
        // $(".cookie-box-wrapper").show();
    }
});

$("#acceptcookie").click(function () {
    //$('.black-background-overlay').hide();
    //$('.rating-box-wrapper').hide()

    createCookie("cookieacceptclose", "yes","365");

});

$(document).ready(function () {

    $('.cookie-box-wrapper').hide();

    var acceptcookieid = readCookie("cookieacceptclose");
    if (acceptcookieid == "yes") {
        $('.cookie-box-wrapper').hide();
    }
    else { $('.cookie-box-wrapper').hide(); }
});

;
