require( ["SHARED/jquery", "ticketMenuControllers"], function ( $,  ticketMenuControllers)
{   function initializeCustomerRateListener() {
	          var rateIndicator = document.getElementsByClassName("rateIndic");
        if( rateIndicator != null ){
		  for(var i=0; i < rateIndicator.length ; i++) {
			rateIndicator[i].addEventListener("click", function() {
			var switchdiv = document.getElementsByClassName('switch')[0];
			  if(switchdiv != null) {
			  document.getElementById('ticketMenu').scrollIntoView();
			  switchdiv.style.animation='pulse 1s infinite';
			  setTimeout(function() { switchdiv.style.animation=null; },5000);
			}
		 });
	    }
     }
    }
    $( document ).ready(function() {
        var ticketMenuAppRoot = $('#ticketMenu');
        var ticketMenuApp = angular.module('ticketsChartsApp', ['ngSanitize']);
        ticketMenuApp.filter('decodeStr', function($sce) {
                        return function (str) {
                        if( str == null ){
                        return $sce.trustAsHtml("");
                        }
                        var textArea = document.createElement('textarea');
                        textArea.innerHTML = str;
                        return $sce.trustAsHtml(textArea.innerText);
                        }
                        });
        try {
            ticketMenuApp.controller('ticketMenuCtrl', ticketMenuControllers);
            angular.bootstrap(ticketMenuAppRoot, ['ticketsChartsApp']);
        } catch(e) {
            console.log(e);
        }
        initializeCustomerRateListener();
});
});
