<commit_before><!DOCTYPE html>
<html>
<head>
    <title>DECIBEL</title>
    <meta charset="utf-8" />
 <!--   <script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau-2.min.js"></script> -->
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px;">

<img src="deloitte-logo-print.png" class="logo_deloitte" alt="Deloitte" style="z-index:999;">
<img src="Decibel.png" class="logo_decibel" alt="Decibel" height="60px" Width="180px" style="z-index:999;">
<h2 class="head1"> Voice Enabled </h2>
<h2 class="head2"> Cognitive  </h2>
<h2 class="head3"> Platform  </h2>

<img src="mic.png" id="speakAgainsmall" class="sabutton" hidden="" title="Click to speak again">
<img src="bgfinal.png" class="bg_img" alt="background">
<div class="speak-home">
<button id="startBtn" class="stbutton" disabled="disabled" hidden="">Start</button>
<button id="stopBtn" class="spbutton" disabled="disabled" hidden="">Stop</button>
<center><img src="mic.png" id="speakAgainbig" alt="Mic" class="mic" title="Click to speak again"> </center>
</div>

<div style="float: center;margin-top: 90px;margin-left: 40px;">
    <table width="100%">
        <tr>            
            <td ><input  type="hidden" id="key" type="text" size="40" value="617b7a295ec54e6da5a018d641b24396" v></td>
        </tr>
     
        <tr>
            <td></td>
            <td>
                <button id="startBtn" disabled="disabled" hidden="">Start</button>
                <button id="stopBtn" disabled="disabled" hidden="">Stop</button>
							
            </td>
        </tr>
    </table>
</div>

<div id="vizContainer" style="width:1000px; height:350px; margin-top: 15px;margin-left: 21px;"></div>

<div>
    <div id="toggle-first-sidebar" style="text-align: right;position: absolute;width: 100%;right: 18px;top: 200px;cursor: pointer;">
        <img src="plus.png" width="30px" height="30px">
        <div class="first-sidebar-content" style="display: none; min-width: 200px">
        <div style="min-width: 300px;float: right;background-color: #fff;text-align: center;">
            
            <div><td>Recognized voice: <span id="hypothesisDiv"></span></td></div>
			<br>
			<br>
			<br>
			<br>
            </div>
        </div>
    </div>
    <div id="toggle-second-sidebar" style="text-align: right;position: absolute;width: 100%;right: 18px;top: 400px;cursor: pointer;">
        <img src="plus.png" width="30px" height="30px">
        <div class="second-sidebar-content" style="display: none; min-width: 200px"">
        <div style="min-width: 300px; float: right;background-color: #fff;text-align: center;">
            <div> 
			<td>
                <textarea id="phraseDiv" style="width:300px;height:100px"></textarea>
            </td></div>
			
            <div>  <td>Status: <span id="statusDiv"></span></td></div>
            <br>
			<br>
            </div>
        </div>
    </div>
</div>

  
    <script src="scripts/require.min.js"></script>
    <script src="scripts/jquery.min.js"></script>
   

    <!-- SDK REFERENCE -->
    <script src="scripts/speech.browser.sdk-min.js"></script>

    <!-- SDK USAGE -->
    <script>
        // On doument load resolve the SDK dependecy
        function Initialize(onComplete) {
            require(["Speech.Browser.Sdk"], function(SDK) {
                onComplete(SDK);
            });
        }
        
        // Setup the recongizer
        function RecognizerSetup(SDK, recognitionMode, subscriptionKey) {
            var recognizerConfig = new SDK.RecognizerConfig(
                new SDK.SpeechConfig(
                    new SDK.Context(
                        new SDK.OS(navigator.userAgent, "Browser", null),
                        new SDK.Device("SpeechSample", "SpeechSample", "1.0.00000"))),
                recognitionMode
                ); 

           
            var authentication = new SDK.CognitiveSubscriptionKeyAuthentication(subscriptionKey);

            return SDK.CreateRecognizer(recognizerConfig, authentication);
        }

        // Start the recognition
        function RecognizerStart(SDK, recognizer) {
            recognizer.Recognize((event) => {
                /*
                 Alternative syntax for typescript devs.
                 if (event instanceof SDK.RecognitionTriggeredEvent)
                */
                switch (event.Name) {
                    case "RecognitionTriggeredEvent" :
                        UpdateStatus("Initializing");
                        break;
                    case "ListeningStartedEvent" :
                        UpdateStatus("Listening");
                        break;
                    case "RecognitionStartedEvent" :
                        UpdateStatus("Listening_Recognizing");
                        break;
                    case "SpeechStartDetectedEvent" :
                        UpdateStatus("Listening_DetectedSpeech_Recognizing");
                        console.log(JSON.stringify(event.Result)); // check console for other information in result
                        break;
                    case "SpeechHypothesisEvent" :
                        UpdateRecognizedHypothesis(event.Result.Text);
                        console.log(JSON.stringify(event.Result)); // check console for other information in result
                        break;
                    case "SpeechEndDetectedEvent" :
                        OnSpeechEndDetected();
                        UpdateStatus("Processing_Adding_Final_Touches");
                        console.log(JSON.stringify(event.Result)); // check console for other information in result
                        break;
                    case "SpeechSimplePhraseEvent" :
                        UpdateRecognizedPhrase(JSON.stringify(event.Result, null, 3));
                        break;
                    case "SpeechDetailedPhraseEvent" :
                        UpdateRecognizedPhrase(JSON.stringify(event.Result, null, 3));
                        break;
                    case "RecognitionEndedEvent" :
                        OnComplete();
                        UpdateStatus("Idle");
                        console.log(JSON.stringify(event)); // Debug information
                        break;
                }
            })
            .On(() => {
                // The request succeeded. Nothing to do here.
            },
            (error) => {
                console.error(error);
            });
        }

        // Stop the Recognition.
        function RecognizerStop(SDK, recognizer) {
            // recognizer.AudioSource.Detach(audioNodeId) can be also used here. (audioNodeId is part of ListeningStartedEvent)
            recognizer.AudioSource.TurnOff();
        }
    </script>

    <!-- Browser Hooks -->
    <script>
        var startBtn, stopBtn, hypothesisDiv, phraseDiv, statusDiv, key, languageOptions, formatOptions;
        var SDK;
        var recognizer;
        var previousSubscriptionKey;
        var input;
        var voices = speechSynthesis.getVoices();
        document.addEventListener("DOMContentLoaded", function () {
            createBtn = document.getElementById("createBtn");
            startBtn = document.getElementById("startBtn");
            stopBtn = document.getElementById("stopBtn");
            phraseDiv = document.getElementById("phraseDiv");
            hypothesisDiv = document.getElementById("hypothesisDiv");
            statusDiv = document.getElementById("statusDiv");
            key = document.getElementById("key");
         

            startBtn.addEventListener("click", function () {
                if (!recognizer || previousSubscriptionKey != key.value) {
                    previousSubscriptionKey = key.value;
                    Setup();
                }

                hypothesisDiv.innerHTML = "";
                phraseDiv.innerHTML = "";
                RecognizerStart(SDK, recognizer);
                startBtn.disabled = true;
                stopBtn.disabled = false;
            });
			
			speakAgainsmall.addEventListener("click", function () {
                if (!recognizer || previousSubscriptionKey != key.value) {
                    previousSubscriptionKey = key.value;
                    Setup();
                }

                hypothesisDiv.innerHTML = "";
                phraseDiv.innerHTML = "";
                RecognizerStart(SDK, recognizer);
                startBtn.disabled = true;
                stopBtn.disabled = false;
            });
			
			speakAgainbig.addEventListener("click", function () {
                if (!recognizer || previousSubscriptionKey != key.value) {
                    previousSubscriptionKey = key.value;
                    Setup();
                }

                hypothesisDiv.innerHTML = "";
                phraseDiv.innerHTML = "";
                RecognizerStart(SDK, recognizer);
                startBtn.disabled = true;
                stopBtn.disabled = false;
            });

            stopBtn.addEventListener("click", function () {
                RecognizerStop(SDK);
                startBtn.disabled = false;
                stopBtn.disabled = true;
            });

            Initialize(function (speechSdk) {
                SDK = speechSdk;
                startBtn.disabled = false;
                voiceoutput("Hello! I'm your voice assistant,how can i help you ?",1)
            });
        });
		
        function voiceoutput(text,flag){

            if('speechSynthesis' in window){
			var speech = new SpeechSynthesisUtterance(text);
			speech.lang = 'en-GB';
			speech.voice = voices[1];
			window.speechSynthesis.speak(speech);
			if (flag==1)
			{
            setTimeout(activatestart, 4000);
			}
			else if (flag == 2)
			{
			setTimeout(voiceoutput, 10000);
			}
           
			}
        } 
		
        // function voiceoutput_detection(text){

         //   if('speechSynthesis' in window){
		//	var speech = new SpeechSynthesisUtterance(text);
		//	speech.lang = 'en-US';
		//	speech.voice = voices[4]
		//	window.speechSynthesis.speak(speech);
         //   setTimeout(activatestart, 4000);
         //
        //    UpdateRecognizedHypothesisUserConfirmation(text);   
		//	}
        //} 
		
        function activatestart()
        {   
          
            $(startBtn).click() 
            $(startBtn).hide()
            $(stopBtn).hide()
			$(speakAgainsmall).hide()           
        }
		
        function Setup() {
            recognizer = RecognizerSetup(SDK, SDK.RecognitionMode.Interactive, key.value);
        }

        function UpdateStatus(status) {
            statusDiv.innerHTML = status;
        }
		
		
        function UpdateRecognizedHypothesis(text) {
            hypothesisDiv.innerHTML = text;        
            input = text;  
        }
		
        function OnSpeechEndDetected() {
            stopBtn.disabled = true;
        }
		
		var db;
		var fld;
		var val;
		
		
        function UpdateRecognizedPhrase(json) {
            $.get("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/631f2b5e-8875-48f2-984c-9e7e7c78a3e2?subscription-key=c642986d701f44b29227bc3b60fab71b&verbose=true&timezoneOffset=0&q="+input+"",
			//$.get("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/21b9dd19-9b03-4fb5-87a8-337112c474b7?subscription-key=c642986d701f44b29227bc3b60fab71b&verbose=true&timezoneOffset=0&q="+input+"",
			//$.get("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/5cac76d5-cdf5-4928-a48e-3fc400c5430a?subscription-key=c642986d701f44b29227bc3b60fab71b&timezoneOffset=0&verbose=true&q="+input+"",
                function(data){
                 phraseDiv.innerHTML =  JSON.stringify(data);
          if (data.entities.length === 0)
					{
						voiceoutput("Please provide a valid input",0); 
						if(viz) {$(speakAgainsmall).show();}
					}
				 else
					{		
						for (var t=0; t < data.entities.length; t++) 
						{	
							if ( data.entities[t].type === "Dashboard" && data.entities.length == 1)
							{ db = data.entities[t].entity; fld = 0; val = 0;}
							else if (data.entities[t].type === "Dashboard" ) 
							{ db = data.entities[t].entity; }
							else if (data.entities[t].type != "builtin.datetimeV2.daterange" &&  data.entities[t].type != "Dashboard" )
							{ fld = data.entities[t].type; val = data.entities[t].entity;} 
						}

						var var1 = dashboardcheck(db);
						
						if ( var1 === 0 ) 
						{ 
						voiceoutput("Please provide a valid dashboard name",0); 
						if(viz) {$(speakAgainsmall).show();}
						}

						else
						{
						var var2 = fieldcheck(db,fld);
						
							if ( var2 === 0 )
							{
							voiceoutput("Provided dimension does not belong to the dashboard");
							if(viz) {$(speakAgainsmall).show();}
							}
							else
							{
							
							initViz(db,fld,val,urlvalue);
							}
						}
					}
				 //}
                 //catch(err)
                 //{
                    
                // }
                 //JSON.stringify(data.entities[0].type )+ ":"+ JSON.stringify(data.entities[0].entity);
                });
		}
		
		var urlvalue;
		function dashboardcheck(e) {
			var dbvalue = 0;
			$.ajax({
			async: false,
			dataType : 'json',
			url: "https://sharat543.github.io/POCdashboards.json",
			type : 'GET',
			success: function(data) {
				for (var e1 = 0; e1 < data['dashboards'].length; e1++) {
				if (e === data['dashboards'][e1]['name'])
				{dbvalue = dbvalue + 1; urlvalue = data['dashboards'][e1]['site'];}
				else { dbvalue = dbvalue + 0; }
				}
			}});
			return dbvalue;
		}
		
		function fieldcheck(f1,f2) {
			var fldassign = 0;
			$.ajax({
			async: false,
			dataType : 'json',
			url: "https://sharat543.github.io/POCfields.json",
			type : 'GET',
			success: function(data) {
					for (var f3 = 0; f3 < data['fields'].length; f3++) {
					if (f1 === data['fields'][f3]['db'] && f2 === data['fields'][f3]['name'])
					{fldassign = fldassign + 1;}
					else if (f2 === 0)
					{ fldassign = fldassign + 1; }
					else { fldassign = fldassign + 0; }
					}
			}});
			
			return fldassign;
		}      
	<!-- added by Sarat -->
		var viz,url,sheet,workbook,sharray;
		if (viz) { // If a viz object exists, delete it.
                viz.dispose();
            }
			
		var counter=0;
		
		function initViz(d,f,v,u)
		{
			$(document).ready(function(){
			$("#vizContainer").attr("src","http://google.com");
			})
		}

        
		
		<!-- added by Sarat -->
		function selectfilter(field,value) {
			
			if ( field == 0 && value == 0 )
			{
				viz.revertAllAsync();
				$(speakAgainsmall).show();
			}
			else
			{	
				var derivedvalue = valueCase(value);
				var derivedfield = chooseSelectFilter(field);
				//alert(derivedfield+derivedvalue);
				if (derivedfield === "select") 
				{ 
					if ( activeSheet.getSheetType() === 'dashboard' )<commit_msg>sdfgsdf<commit_after><!DOCTYPE html>
<html>
<head>
    <title>DECIBEL</title>
    <meta charset="utf-8" />
 <!--   <script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau-2.min.js"></script> -->
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:13px;">

<img src="deloitte-logo-print.png" class="logo_deloitte" alt="Deloitte" style="z-index:999;">
<img src="Decibel.png" class="logo_decibel" alt="Decibel" height="60px" Width="180px" style="z-index:999;">
<h2 class="head1"> Voice Enabled </h2>
<h2 class="head2"> Cognitive  </h2>
<h2 class="head3"> Platform  </h2>

<img src="mic.png" id="speakAgainsmall" class="sabutton" hidden="" title="Click to speak again">
<img src="bgfinal.png" class="bg_img" alt="background">
<div class="speak-home">
<button id="startBtn" class="stbutton" disabled="disabled" hidden="">Start</button>
<button id="stopBtn" class="spbutton" disabled="disabled" hidden="">Stop</button>
<center><img src="mic.png" id="speakAgainbig" alt="Mic" class="mic" title="Click to speak again"> </center>
</div>

<div style="float: center;margin-top: 90px;margin-left: 40px;">
    <table width="100%">
        <tr>            
            <td ><input  type="hidden" id="key" type="text" size="40" value="617b7a295ec54e6da5a018d641b24396" v></td>
        </tr>
     
        <tr>
            <td></td>
            <td>
                <button id="startBtn" disabled="disabled" hidden="">Start</button>
                <button id="stopBtn" disabled="disabled" hidden="">Stop</button>
							
            </td>
        </tr>
    </table>
</div>

<div id="vizContainer" style="width:1000px; height:350px; margin-top: 15px;margin-left: 21px;"></div>

<div>
    <div id="toggle-first-sidebar" style="text-align: right;position: absolute;width: 100%;right: 18px;top: 200px;cursor: pointer;">
        <img src="plus.png" width="30px" height="30px">
        <div class="first-sidebar-content" style="display: none; min-width: 200px">
        <div style="min-width: 300px;float: right;background-color: #fff;text-align: center;">
            
            <div><td>Recognized voice: <span id="hypothesisDiv"></span></td></div>
			<br>
			<br>
			<br>
			<br>
            </div>
        </div>
    </div>
    <div id="toggle-second-sidebar" style="text-align: right;position: absolute;width: 100%;right: 18px;top: 400px;cursor: pointer;">
        <img src="plus.png" width="30px" height="30px">
        <div class="second-sidebar-content" style="display: none; min-width: 200px"">
        <div style="min-width: 300px; float: right;background-color: #fff;text-align: center;">
            <div> 
			<td>
                <textarea id="phraseDiv" style="width:300px;height:100px"></textarea>
            </td></div>
			
            <div>  <td>Status: <span id="statusDiv"></span></td></div>
            <br>
			<br>
            </div>
        </div>
    </div>
</div>

  
    <script src="scripts/require.min.js"></script>
    <script src="scripts/jquery.min.js"></script>
   

    <!-- SDK REFERENCE -->
    <script src="scripts/speech.browser.sdk-min.js"></script>

    <!-- SDK USAGE -->
    <script>
        // On doument load resolve the SDK dependecy
        function Initialize(onComplete) {
            require(["Speech.Browser.Sdk"], function(SDK) {
                onComplete(SDK);
            });
        }
        
        // Setup the recongizer
        function RecognizerSetup(SDK, recognitionMode, subscriptionKey) {
            var recognizerConfig = new SDK.RecognizerConfig(
                new SDK.SpeechConfig(
                    new SDK.Context(
                        new SDK.OS(navigator.userAgent, "Browser", null),
                        new SDK.Device("SpeechSample", "SpeechSample", "1.0.00000"))),
                recognitionMode
                ); 

           
            var authentication = new SDK.CognitiveSubscriptionKeyAuthentication(subscriptionKey);

            return SDK.CreateRecognizer(recognizerConfig, authentication);
        }

        // Start the recognition
        function RecognizerStart(SDK, recognizer) {
            recognizer.Recognize((event) => {
                /*
                 Alternative syntax for typescript devs.
                 if (event instanceof SDK.RecognitionTriggeredEvent)
                */
                switch (event.Name) {
                    case "RecognitionTriggeredEvent" :
                        UpdateStatus("Initializing");
                        break;
                    case "ListeningStartedEvent" :
                        UpdateStatus("Listening");
                        break;
                    case "RecognitionStartedEvent" :
                        UpdateStatus("Listening_Recognizing");
                        break;
                    case "SpeechStartDetectedEvent" :
                        UpdateStatus("Listening_DetectedSpeech_Recognizing");
                        console.log(JSON.stringify(event.Result)); // check console for other information in result
                        break;
                    case "SpeechHypothesisEvent" :
                        UpdateRecognizedHypothesis(event.Result.Text);
                        console.log(JSON.stringify(event.Result)); // check console for other information in result
                        break;
                    case "SpeechEndDetectedEvent" :
                        OnSpeechEndDetected();
                        UpdateStatus("Processing_Adding_Final_Touches");
                        console.log(JSON.stringify(event.Result)); // check console for other information in result
                        break;
                    case "SpeechSimplePhraseEvent" :
                        UpdateRecognizedPhrase(JSON.stringify(event.Result, null, 3));
                        break;
                    case "SpeechDetailedPhraseEvent" :
                        UpdateRecognizedPhrase(JSON.stringify(event.Result, null, 3));
                        break;
                    case "RecognitionEndedEvent" :
                        OnComplete();
                        UpdateStatus("Idle");
                        console.log(JSON.stringify(event)); // Debug information
                        break;
                }
            })
            .On(() => {
                // The request succeeded. Nothing to do here.
            },
            (error) => {
                console.error(error);
            });
        }

        // Stop the Recognition.
        function RecognizerStop(SDK, recognizer) {
            // recognizer.AudioSource.Detach(audioNodeId) can be also used here. (audioNodeId is part of ListeningStartedEvent)
            recognizer.AudioSource.TurnOff();
        }
    </script>

    <!-- Browser Hooks -->
    <script>
        var startBtn, stopBtn, hypothesisDiv, phraseDiv, statusDiv, key, languageOptions, formatOptions;
        var SDK;
        var recognizer;
        var previousSubscriptionKey;
        var input;
        var voices = speechSynthesis.getVoices();
        document.addEventListener("DOMContentLoaded", function () {
            createBtn = document.getElementById("createBtn");
            startBtn = document.getElementById("startBtn");
            stopBtn = document.getElementById("stopBtn");
            phraseDiv = document.getElementById("phraseDiv");
            hypothesisDiv = document.getElementById("hypothesisDiv");
            statusDiv = document.getElementById("statusDiv");
            key = document.getElementById("key");
         

            startBtn.addEventListener("click", function () {
                if (!recognizer || previousSubscriptionKey != key.value) {
                    previousSubscriptionKey = key.value;
                    Setup();
                }

                hypothesisDiv.innerHTML = "";
                phraseDiv.innerHTML = "";
                RecognizerStart(SDK, recognizer);
                startBtn.disabled = true;
                stopBtn.disabled = false;
            });
			
			speakAgainsmall.addEventListener("click", function () {
                if (!recognizer || previousSubscriptionKey != key.value) {
                    previousSubscriptionKey = key.value;
                    Setup();
                }

                hypothesisDiv.innerHTML = "";
                phraseDiv.innerHTML = "";
                RecognizerStart(SDK, recognizer);
                startBtn.disabled = true;
                stopBtn.disabled = false;
            });
			
			speakAgainbig.addEventListener("click", function () {
                if (!recognizer || previousSubscriptionKey != key.value) {
                    previousSubscriptionKey = key.value;
                    Setup();
                }

                hypothesisDiv.innerHTML = "";
                phraseDiv.innerHTML = "";
                RecognizerStart(SDK, recognizer);
                startBtn.disabled = true;
                stopBtn.disabled = false;
            });

            stopBtn.addEventListener("click", function () {
                RecognizerStop(SDK);
                startBtn.disabled = false;
                stopBtn.disabled = true;
            });

            Initialize(function (speechSdk) {
                SDK = speechSdk;
                startBtn.disabled = false;
                voiceoutput("Hello! I'm your voice assistant,how can i help you ?",1)
            });
        });
		
        function voiceoutput(text,flag){

            if('speechSynthesis' in window){
			var speech = new SpeechSynthesisUtterance(text);
			speech.lang = 'en-GB';
			speech.voice = voices[1];
			window.speechSynthesis.speak(speech);
			if (flag==1)
			{
            setTimeout(activatestart, 4000);
			}
			else if (flag == 2)
			{
			setTimeout(voiceoutput, 10000);
			}
           
			}
        } 
		
        // function voiceoutput_detection(text){

         //   if('speechSynthesis' in window){
		//	var speech = new SpeechSynthesisUtterance(text);
		//	speech.lang = 'en-US';
		//	speech.voice = voices[4]
		//	window.speechSynthesis.speak(speech);
         //   setTimeout(activatestart, 4000);
         //
        //    UpdateRecognizedHypothesisUserConfirmation(text);   
		//	}
        //} 
		
        function activatestart()
        {   
          
            $(startBtn).click() 
            $(startBtn).hide()
            $(stopBtn).hide()
			$(speakAgainsmall).hide()           
        }
		
        function Setup() {
            recognizer = RecognizerSetup(SDK, SDK.RecognitionMode.Interactive, key.value);
        }

        function UpdateStatus(status) {
            statusDiv.innerHTML = status;
        }
		
		
        function UpdateRecognizedHypothesis(text) {
            hypothesisDiv.innerHTML = text;        
            input = text;  
        }
		
        function OnSpeechEndDetected() {
            stopBtn.disabled = true;
        }
		
		var db;
		var fld;
		var val;
		
		
        function UpdateRecognizedPhrase(json) {
            $.get("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/631f2b5e-8875-48f2-984c-9e7e7c78a3e2?subscription-key=c642986d701f44b29227bc3b60fab71b&verbose=true&timezoneOffset=0&q="+input+"",
			//$.get("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/21b9dd19-9b03-4fb5-87a8-337112c474b7?subscription-key=c642986d701f44b29227bc3b60fab71b&verbose=true&timezoneOffset=0&q="+input+"",
			//$.get("https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/5cac76d5-cdf5-4928-a48e-3fc400c5430a?subscription-key=c642986d701f44b29227bc3b60fab71b&timezoneOffset=0&verbose=true&q="+input+"",
                function(data){
                 phraseDiv.innerHTML =  JSON.stringify(data);
          if (data.entities.length === 0)
					{
						voiceoutput("Please provide a valid input",0); 
						if(viz) {$(speakAgainsmall).show();}
					}
				 else
					{		
						for (var t=0; t < data.entities.length; t++) 
						{	
							if ( data.entities[t].type === "Dashboard" && data.entities.length == 1)
							{ db = data.entities[t].entity; fld = 0; val = 0;}
							else if (data.entities[t].type === "Dashboard" ) 
							{ db = data.entities[t].entity; }
							else if (data.entities[t].type != "builtin.datetimeV2.daterange" &&  data.entities[t].type != "Dashboard" )
							{ fld = data.entities[t].type; val = data.entities[t].entity;} 
						}

						var var1 = dashboardcheck(db);
						
						if ( var1 === 0 ) 
						{ 
						voiceoutput("Please provide a valid dashboard name",0); 
						if(viz) {$(speakAgainsmall).show();}
						}

						else
						{
						var var2 = fieldcheck(db,fld);
						
							if ( var2 === 0 )
							{
							voiceoutput("Provided dimension does not belong to the dashboard");
							if(viz) {$(speakAgainsmall).show();}
							}
							else
							{
							
							initViz(db,fld,val,urlvalue);
							}
						}
					}
				 //}
                 //catch(err)
                 //{
                    
                // }
                 //JSON.stringify(data.entities[0].type )+ ":"+ JSON.stringify(data.entities[0].entity);
                });
		}
		
		var urlvalue;
		function dashboardcheck(e) {
			var dbvalue = 0;
			$.ajax({
			async: false,
			dataType : 'json',
			url: "https://sharat543.github.io/POCdashboards.json",
			type : 'GET',
			success: function(data) {
				for (var e1 = 0; e1 < data['dashboards'].length; e1++) {
				if (e === data['dashboards'][e1]['name'])
				{dbvalue = dbvalue + 1; urlvalue = data['dashboards'][e1]['site'];}
				else { dbvalue = dbvalue + 0; }
				}
			}});
			return dbvalue;
		}
		
		function fieldcheck(f1,f2) {
			var fldassign = 0;
			$.ajax({
			async: false,
			dataType : 'json',
			url: "https://sharat543.github.io/POCfields.json",
			type : 'GET',
			success: function(data) {
					for (var f3 = 0; f3 < data['fields'].length; f3++) {
					if (f1 === data['fields'][f3]['db'] && f2 === data['fields'][f3]['name'])
					{fldassign = fldassign + 1;}
					else if (f2 === 0)
					{ fldassign = fldassign + 1; }
					else { fldassign = fldassign + 0; }
					}
			}});
			
			return fldassign;
		}      
	<!-- added by Sarat -->
		var viz,url,sheet,workbook,sharray;
		if (viz) { // If a viz object exists, delete it.
                viz.dispose();
            }
			
		var counter=0;
		
		function initViz(d,f,v,u)
		{
			$("#vizContainer").load("http://google.com");
		}

        
		
		<!-- added by Sarat -->
		function selectfilter(field,value) {
			
			if ( field == 0 && value == 0 )
			{
				viz.revertAllAsync();
				$(speakAgainsmall).show();
			}
			else
			{	
				var derivedvalue = valueCase(value);
				var derivedfield = chooseSelectFilter(field);
				//alert(derivedfield+derivedvalue);
				if (derivedfield === "select") 
				{ 
					if ( activeSheet.getSheetType() === 'dashboard' )
{'fraction_non_alphanumeric': 0.13864581600399267, 'fraction_numerical': 0.021760106471468973, 'mean_word_length': 1.9186249757234415, 'pattern_counts': {'":': 2, '<': 227, '<?xml version=': 0, '>': 227, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2806695', 'n_tokens_mistral': 10296, 'n_tokens_neox': 8675, 'n_words': 1545}