{"version":3,"sources":["webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/AgentConfig.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/AddedLmIntent.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/DialogConnectorFactory.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/DynamicGrammarBuilder.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/CognitiveTokenAuthentication.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/EnumTranslation.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/DialogServiceTurnState.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/DialogServiceTurnStateManager.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/DialogServiceAdapter.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/CognitiveSubscriptionKeyAuthentication.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/ConnectionFactoryBase.js"],"names":["AgentConfig","JSON","stringify","this","iPrivConfig","value","AddedLmIntent","modelImpl","intentName","_a","DialogConnectionFactory","super","arguments","create","config","authInfo","connectionId","applicationId","parameters","getProperty","Conversation_ApplicationId","dialogType","Conversation_DialogType","region","SpeechServiceConnection_Region","language","SpeechServiceConnection_RecoLanguage","requestTurnStatus","Conversation_Request_Bot_Status_Messages","queryParams","ConnectionId","Format","Simple","toLowerCase","Language","RequestBotStatusMessages","BotId","DialogTypes","CustomCommands","CustomCommandsAppId","resourceInfix","version","BotFramework","headers","token","headerName","endpoint","SpeechServiceConnection_Endpoint","hostSuffix","startsWith","host","SpeechServiceConnection_Host","Constants","BaseUrl","standardizedHost","endsWith","ApiKey","setCommonUrlParams","enableCompression","fromRecognizerConfig","DynamicGrammarBuilder","phrase","privPhrases","Array","concat","push","undefined","grammar","privGrammars","retObj","ReferenceGrammars","length","retPhrases","forEach","index","array","Text","Groups","Type","Items","AuthHeader","CognitiveTokenAuthentication","fetchCallback","fetchOnExpiryCallback","fetch","authFetchEventId","privFetchCallback","then","fetchOnExpiry","privFetchOnExpiryCallback","EnumTranslation","recognitionStatus","reason","Canceled","Success","RecognizedSpeech","NoMatch","InitialSilenceTimeout","BabbleTimeout","EndOfDictation","Error","EndOfStream","NoError","ServiceError","TooManyRequests","manager","requestId","privRequestId","privIsCompleted","privAudioStream","privTurnManager","resetTurnEndTimeout","payload","audioFormat","messageDataStreamType","TextToSpeechAudio","AudioOutputStream","createPullStream","format","AudioOutputFormat","getDefaultOutputFormat","isClosed","close","privTimeoutToken","clearTimeout","endAudioStream","setTimeout","CompleteTurn","privTurnMap","Map","id","has","turnState","set","get","complete","delete","__awaiter","thisArg","_arguments","P","generator","adopt","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","apply","ServiceRecognizerBase","authentication","connectionFactory","audioSource","recognizerConfig","dialogServiceConnector","sendAgentConfig","connection","agentConfig","agentConfigSent","privRecognizerConfig","PropertyId","DialogServiceConfig","botInfo","commandsCulture","onEvent","agentConfigJson","toJsonString","send","privRequestSession","sendAgentContext","guid","speechActivityTemplate","privDialogServiceConnector","properties","Conversation_Speech_Activity_Template","agentContext","channelData","context","interactionId","messagePayload","agentContextJson","handleResponseMessage","responseMessage","responsePayload","parse","textBody","messageType","responseRequestId","toUpperCase","activityPayload","fromJSON","turn","privTurnStateManager","GetTurn","conversationId","updateAgentConfig","pullAudioOutputStream","processActivityPayload","SpeechSynthesisOutputFormat","SpeechServiceConnection_SynthOutputFormat","activity","ActivityReceivedEventArgs","activityReceived","error","turnStatusReceived","TurnStatusReceivedEventArgs","Events","instance","privEvents","EventSource","receiveMessageOverride","receiveDialogMessageOverride","recognizeOverride","listenOnce","postConnectImplOverride","dialogConnectImpl","configConnectionOverride","configConnection","disconnectOverride","privDisconnect","privDialogAudioSource","privLastResult","message","interactionGuid","agentMessage","agentMessageJson","fetchConnection","cancelRecognition","sessionId","CancellationReason","terminateMessageLoop","connectionMessage","resultProps","PropertyCollection","processed","setProperty","SpeechServiceResponse_JsonResult","path","speechPhrase","SimpleSpeechPhrase","onPhraseRecognized","currentTurnAudioOffset","Offset","Duration","RecognitionStatus","args","fireEventForResult","recognized","hypothesis","SpeechHypothesis","offset","SpeechRecognitionResult","ResultReason","RecognizingSpeech","LanguageDetectionConfidence","onHypothesis","ev","SpeechRecognitionEventArgs","recognizing","audioRequestId","binaryBody","audioStream","write","cancellationReason","errorCode","isRecognizing","onStopRecognizing","canceled","cancelEvent","SpeechRecognitionCanceledEventArgs","privSuccessCallback","_b","recoMode","successCallback","errorCallback","recognitionMode","privErrorCallback","startNewRecognition","listenForServiceTelemetry","events","Speech_SessionId","conPromise","connectImpl","preAudioPromise","sendPreAudioMessages","node","attach","audioNodeId","deviceInfo","audioNode","ReplayableAudioNode","avgBytesPerSec","onAudioSourceAttachCompleted","SpeechServiceConfig","Context","audio","source","ConnectionFailure","sessionStartEventArgs","SessionEventArgs","privRecognizer","sessionStarted","audioSendPromise","sendAudio","RuntimeError","privConnectionLoop","startMessageLoop","communicationCustodian","loop","isDisposed","read","fromConnectionMessage","turnRequestId","audioSessionReqId","StartTurn","onServiceTurnStartResponse","speechStartDetected","SpeechDetected","speechStartEventArgs","RecognitionEventArgs","json","speechStopDetected","onServiceRecognized","speechStopEventArgs","speechEndDetected","turnEndRequestId","sessionStopEventArgs","onServiceTurnEndResponse","isSpeechEnded","sessionStopped","processTypeSpecificMessages","serviceEvents","ret","catch","promise","sendSpeechServiceConfig","serialize","sendWaveHeader","serviceResult","resultReason","implTranslateRecognitionResult","DisplayText","event","CognitiveSubscriptionKeyAuthentication","subscriptionKey","privAuthInfo","AuthKey","ConnectionFactoryBase","setUrlParameter","SpeechServiceConnection_EnableAudioLogging","EnableAudioLogging","SpeechServiceResponse_RequestWordLevelTimestamps","EnableWordLevelTimestamps","SpeechServiceResponse_ProfanityOption","Profanity","SpeechServiceConnection_InitialSilenceTimeoutMs","InitialSilenceTimeoutMs","SpeechServiceConnection_EndSilenceTimeoutMs","EndSilenceTimeoutMs","SpeechServiceResponse_StablePartialResultThreshold","StableIntermediateThreshold","serviceProperties","Object","keys","num","propId","parameterName","search","toLocaleLowerCase"],"mappings":"wPAAA,kCAKO,MAAMA,EACT,eACI,OAAOC,KAAKC,UAAUC,KAAKC,aAE/B,MACI,OAAOD,KAAKC,YAMhB,IAAIC,GACAF,KAAKC,YAAcC,K,oCCjB3B,kCAMO,MAAMC,EAOT,YAAYC,EAAWC,GACnBL,KAAKI,UAAYA,EACjBJ,KAAKK,WAAaA,K,oCCf1B,sCAEIC,EAFJ,wHAUO,MAAMC,UAAgC,OACzC,cACIC,SAASC,WACTT,KAAKU,OAAS,CAACC,EAAQC,EAAUC,KAC7B,MAAMC,EAAgBH,EAAOI,WAAWC,YAAY,OAAWC,2BAA4B,IACrFC,EAAaP,EAAOI,WAAWC,YAAY,OAAWG,yBACtDC,EAAST,EAAOI,WAAWC,YAAY,OAAWK,gCAClDC,EAAWX,EAAOI,WAAWC,YAAY,OAAWO,qCAAsC,SAC1FC,EAAoBb,EAAOI,WAAWC,YAAY,OAAWS,yCAA0C,QACvGC,EAAc,GACpBA,EAAY,OAAYC,cAAgBd,EACxCa,EAAY,OAAoBE,QAAUjB,EAAOI,WAAWC,YAAY,8BAA0B,OAAa,OAAaa,SAASC,cACrIJ,EAAY,OAAoBK,UAAYT,EAC5CI,EAAY,OAAoBM,0BAA4BR,EACxDV,IACAY,EAAY,OAAoBO,OAASnB,EACrCI,IAAe,OAAoBgB,YAAYC,iBAC/CT,EAAY,OAAYU,qBAAuBtB,IAGvD,MAAMuB,EAAgBnB,IAAe,OAAoBgB,YAAYC,eAAiB,YAChF,GACAG,EAAUpB,IAAe,OAAoBgB,YAA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B,OAAWO,gDAAiD,OAAoBC,wBAAyB3V,EAAQe,EAAaiB,GACnJ3C,KAAK8V,gBAAgB,OAAWS,4CAA6C,OAAoBC,oBAAqB7V,EAAQe,EAAaiB,GAC3I3C,KAAK8V,gBAAgB,OAAWW,mDAAoD,OAAoBC,4BAA6B/V,EAAQe,EAAaiB,GAC1J,MAAMgU,EAAoB7W,KAAK4L,MAAM/K,EAAOI,WAAWC,YAAY,mCAA+B,OAClG4V,OAAOC,KAAKF,GAAmBrS,QAAQ,CAACpE,EAAO4W,EAAKtS,KAChD9C,EAAYxB,GAASyW,EAAkBzW,KAG/C,gBAAgB6W,EAAQC,EAAerW,EAAQe,EAAaiB,GACxD,MAAMzC,EAAQS,EAAOI,WAAWC,YAAY+V,OAAQhT,IAChD7D,GAAWyC,IAAgD,IAApCA,EAASsU,OAAOD,KACvCtV,EAAYsV,GAAiB9W,EAAMgX","file":"js/RetellLecture~c6c7b204.5239d7ca.js","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n/**\n * Represents the JSON used in the agent.config message sent to the speech service.\n */\nexport class AgentConfig {\n toJsonString() {\n return JSON.stringify(this.iPrivConfig);\n }\n get() {\n return this.iPrivConfig;\n }\n /**\n * Setter for the agent.config object.\n * @param value a JSON serializable object.\n */\n set(value) {\n this.iPrivConfig = value;\n }\n}\n\n//# sourceMappingURL=AgentConfig.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n/**\n * @class AddedLmIntent\n */\n// tslint:disable-next-line:max-classes-per-file\nexport class AddedLmIntent {\n /**\n * Creates and initializes an instance of this class.\n * @constructor\n * @param modelImpl - The model.\n * @param intentName - The intent name.\n */\n constructor(modelImpl, intentName) {\n this.modelImpl = modelImpl;\n this.intentName = intentName;\n }\n}\n\n//# sourceMappingURL=AddedLmIntent.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nvar _a;\nimport { ProxyInfo, WebsocketConnection, } from \"../common.browser/Exports\";\nimport { OutputFormatPropertyName } from \"../common.speech/Exports\";\nimport { DialogServiceConfig, OutputFormat, PropertyId } from \"../sdk/Exports\";\nimport { ConnectionFactoryBase } from \"./ConnectionFactoryBase\";\nimport { WebsocketMessageFormatter } from \"./Exports\";\nimport { HeaderNames } from \"./HeaderNames\";\nimport { QueryParameterNames } from \"./QueryParameterNames\";\nexport class DialogConnectionFactory extends ConnectionFactoryBase {\n constructor() {\n super(...arguments);\n this.create = (config, authInfo, connectionId) => {\n const applicationId = config.parameters.getProperty(PropertyId.Conversation_ApplicationId, \"\");\n const dialogType = config.parameters.getProperty(PropertyId.Conversation_DialogType);\n const region = config.parameters.getProperty(PropertyId.SpeechServiceConnection_Region);\n const language = config.parameters.getProperty(PropertyId.SpeechServiceConnection_RecoLanguage, \"en-US\");\n const requestTurnStatus = config.parameters.getProperty(PropertyId.Conversation_Request_Bot_Status_Messages, \"true\");\n const queryParams = {};\n queryParams[HeaderNames.ConnectionId] = connectionId;\n queryParams[QueryParameterNames.Format] = config.parameters.getProperty(OutputFormatPropertyName, OutputFormat[OutputFormat.Simple]).toLowerCase();\n queryParams[QueryParameterNames.Language] = language;\n queryParams[QueryParameterNames.RequestBotStatusMessages] = requestTurnStatus;\n if (applicationId) {\n queryParams[QueryParameterNames.BotId] = applicationId;\n if (dialogType === DialogServiceConfig.DialogTypes.CustomCommands) {\n queryParams[HeaderNames.CustomCommandsAppId] = applicationId;\n }\n }\n const resourceInfix = dialogType === DialogServiceConfig.DialogTypes.CustomCommands ? \"commands/\"\n : \"\";\n const version = dialogType === DialogServiceConfig.DialogTypes.CustomCommands ? \"v1\"\n : dialogType === DialogServiceConfig.DialogTypes.BotFramework ? \"v3\"\n : \"v0\";\n const headers = {};\n if (authInfo.token != null && authInfo.token !== \"\") {\n headers[authInfo.headerName] = authInfo.token;\n }\n // The URL used for connection is chosen in a priority order of specification:\n // 1. If a custom endpoint is provided, that URL is used verbatim.\n // 2. If a custom host is provided (e.g. \"wss://my.custom.endpoint.com:1123\"), a URL is constructed from it.\n // 3. If no custom connection details are provided, a URL is constructed from default values.\n let endpoint = config.parameters.getProperty(PropertyId.SpeechServiceConnection_Endpoint, \"\");\n if (!endpoint) {\n const hostSuffix = (region && region.toLowerCase().startsWith(\"china\")) ? \".azure.cn\" : \".microsoft.com\";\n const host = config.parameters.getProperty(PropertyId.SpeechServiceConnection_Host, `wss://${region}.${DialogConnectionFactory.Constants.BaseUrl}${hostSuffix}`);\n const standardizedHost = host.endsWith(\"/\") ? host : host + \"/\";\n endpoint = `${standardizedHost}${resourceInfix}${DialogConnectionFactory.Constants.ApiKey}/${version}`;\n }\n this.setCommonUrlParams(config, queryParams, endpoint);\n const enableCompression = config.parameters.getProperty(\"SPEECH-EnableWebsocketCompression\", \"false\") === \"true\";\n return new WebsocketConnection(endpoint, queryParams, headers, new WebsocketMessageFormatter(), ProxyInfo.fromRecognizerConfig(config), enableCompression, connectionId);\n };\n }\n}\nDialogConnectionFactory.Constants = (_a = class {\n },\n _a.ApiKey = \"api\",\n _a.BaseUrl = \"convai.speech\",\n _a);\n\n//# sourceMappingURL=DialogConnectorFactory.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n/**\n * Responsible for building the object to be sent to the speech service to support dynamic grammars.\n * @class DynamicGrammarBuilder\n */\nexport class DynamicGrammarBuilder {\n // Adds one more reference phrases to the dynamic grammar to send.\n // All added phrases are generic phrases.\n addPhrase(phrase) {\n if (!this.privPhrases) {\n this.privPhrases = [];\n }\n if (phrase instanceof Array) {\n this.privPhrases = this.privPhrases.concat(phrase);\n }\n else {\n this.privPhrases.push(phrase);\n }\n }\n // Clears all phrases stored in the current object.\n clearPhrases() {\n this.privPhrases = undefined;\n }\n // Adds one or more reference grammars to the current grammar.\n addReferenceGrammar(grammar) {\n if (!this.privGrammars) {\n this.privGrammars = [];\n }\n if (grammar instanceof Array) {\n this.privGrammars = this.privGrammars.concat(grammar);\n }\n else {\n this.privGrammars.push(grammar);\n }\n }\n // clears all grammars stored on the recognizer.\n clearGrammars() {\n this.privGrammars = undefined;\n }\n // Generates an object that represents the dynamic grammar used by the Speech Service.\n // This is done by building an object with the correct layout based on the phrases and reference grammars added to this instance\n // of a DynamicGrammarBuilder\n generateGrammarObject() {\n if (this.privGrammars === undefined && this.privPhrases === undefined) {\n return undefined;\n }\n const retObj = {};\n retObj.ReferenceGrammars = this.privGrammars;\n if (undefined !== this.privPhrases && 0 !== this.privPhrases.length) {\n const retPhrases = [];\n this.privPhrases.forEach((value, index, array) => {\n retPhrases.push({\n Text: value,\n });\n });\n retObj.Groups = [{ Type: \"Generic\", Items: retPhrases }];\n }\n return retObj;\n }\n}\n\n//# sourceMappingURL=DynamicGrammarBuilder.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { ArgumentNullError } from \"../common/Exports\";\nimport { AuthInfo } from \"./IAuthentication\";\nconst AuthHeader = \"Authorization\";\nexport class CognitiveTokenAuthentication {\n constructor(fetchCallback, fetchOnExpiryCallback) {\n this.fetch = (authFetchEventId) => {\n return this.privFetchCallback(authFetchEventId).then((token) => new AuthInfo(AuthHeader, token));\n };\n this.fetchOnExpiry = (authFetchEventId) => {\n return this.privFetchOnExpiryCallback(authFetchEventId).then((token) => new AuthInfo(AuthHeader, token));\n };\n if (!fetchCallback) {\n throw new ArgumentNullError(\"fetchCallback\");\n }\n if (!fetchOnExpiryCallback) {\n throw new ArgumentNullError(\"fetchOnExpiryCallback\");\n }\n this.privFetchCallback = fetchCallback;\n this.privFetchOnExpiryCallback = fetchOnExpiryCallback;\n }\n}\n\n//# sourceMappingURL=CognitiveTokenAuthentication.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { CancellationErrorCode, CancellationReason, ResultReason } from \"../sdk/Exports\";\nimport { RecognitionStatus } from \"./Exports\";\nexport class EnumTranslation {\n static implTranslateRecognitionResult(recognitionStatus) {\n let reason = ResultReason.Canceled;\n switch (recognitionStatus) {\n case RecognitionStatus.Success:\n reason = ResultReason.RecognizedSpeech;\n break;\n case RecognitionStatus.NoMatch:\n case RecognitionStatus.InitialSilenceTimeout:\n case RecognitionStatus.BabbleTimeout:\n case RecognitionStatus.EndOfDictation:\n reason = ResultReason.NoMatch;\n break;\n case RecognitionStatus.Error:\n default:\n reason = ResultReason.Canceled;\n break;\n }\n return reason;\n }\n static implTranslateCancelResult(recognitionStatus) {\n let reason = CancellationReason.EndOfStream;\n switch (recognitionStatus) {\n case RecognitionStatus.Success:\n case RecognitionStatus.EndOfDictation:\n case RecognitionStatus.NoMatch:\n reason = CancellationReason.EndOfStream;\n break;\n case RecognitionStatus.InitialSilenceTimeout:\n case RecognitionStatus.BabbleTimeout:\n case RecognitionStatus.Error:\n default:\n reason = CancellationReason.Error;\n break;\n }\n return reason;\n }\n static implTranslateCancelErrorCode(recognitionStatus) {\n let reason = CancellationErrorCode.NoError;\n switch (recognitionStatus) {\n case RecognitionStatus.Error:\n reason = CancellationErrorCode.ServiceError;\n break;\n case RecognitionStatus.TooManyRequests:\n reason = CancellationErrorCode.TooManyRequests;\n break;\n default:\n reason = CancellationErrorCode.NoError;\n break;\n }\n return reason;\n }\n}\n\n//# sourceMappingURL=EnumTranslation.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { AudioOutputFormatImpl } from \"../sdk/Audio/AudioOutputFormat\";\nimport { AudioOutputStream } from \"../sdk/Audio/AudioOutputStream\";\nimport { MessageDataStreamType } from \"./ServiceMessages/ActivityResponsePayload\";\nexport class DialogServiceTurnState {\n constructor(manager, requestId) {\n this.privRequestId = requestId;\n this.privIsCompleted = false;\n this.privAudioStream = null;\n this.privTurnManager = manager;\n this.resetTurnEndTimeout();\n // tslint:disable-next-line:no-console\n // console.info(\"DialogServiceTurnState debugturn start:\" + this.privRequestId);\n }\n get audioStream() {\n // Called when is needed to stream.\n this.resetTurnEndTimeout();\n return this.privAudioStream;\n }\n processActivityPayload(payload, audioFormat) {\n if (payload.messageDataStreamType === MessageDataStreamType.TextToSpeechAudio) {\n this.privAudioStream = AudioOutputStream.createPullStream();\n this.privAudioStream.format = (audioFormat !== undefined) ? audioFormat : AudioOutputFormatImpl.getDefaultOutputFormat();\n // tslint:disable-next-line:no-console\n // console.info(\"Audio start debugturn:\" + this.privRequestId);\n }\n return this.privAudioStream;\n }\n endAudioStream() {\n if (this.privAudioStream !== null && !this.privAudioStream.isClosed) {\n this.privAudioStream.close();\n }\n }\n complete() {\n if (this.privTimeoutToken !== undefined) {\n clearTimeout(this.privTimeoutToken);\n }\n this.endAudioStream();\n }\n resetTurnEndTimeout() {\n if (this.privTimeoutToken !== undefined) {\n clearTimeout(this.privTimeoutToken);\n }\n // tslint:disable-next-line:no-console\n // console.info(\"Timeout reset debugturn:\" + this.privRequestId);\n this.privTimeoutToken = setTimeout(() => {\n // tslint:disable-next-line:no-console\n // console.info(\"Timeout complete debugturn:\" + this.privRequestId);\n this.privTurnManager.CompleteTurn(this.privRequestId);\n return;\n }, 2000);\n }\n}\n\n//# sourceMappingURL=DialogServiceTurnState.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { InvalidOperationError } from \"../common/Error\";\nimport { DialogServiceTurnState } from \"./DialogServiceTurnState\";\nexport class DialogServiceTurnStateManager {\n constructor() {\n this.privTurnMap = new Map();\n return;\n }\n StartTurn(id) {\n if (this.privTurnMap.has(id)) {\n throw new InvalidOperationError(\"Service error: There is already a turn with id:\" + id);\n }\n const turnState = new DialogServiceTurnState(this, id);\n this.privTurnMap.set(id, turnState);\n return this.privTurnMap.get(id);\n }\n GetTurn(id) {\n return this.privTurnMap.get(id);\n }\n CompleteTurn(id) {\n if (!this.privTurnMap.has(id)) {\n throw new InvalidOperationError(\"Service error: Received turn end for an unknown turn id:\" + id);\n }\n const turnState = this.privTurnMap.get(id);\n turnState.complete();\n this.privTurnMap.delete(id);\n return turnState;\n }\n}\n\n//# sourceMappingURL=DialogServiceTurnStateManager.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ReplayableAudioNode } from \"../common.browser/Exports\";\nimport { SendingAgentContextMessageEvent } from \"../common/DialogEvents\";\nimport { BackgroundEvent, createGuid, createNoDashGuid, Deferred, Events, EventSource, MessageType, ServiceEvent, } from \"../common/Exports\";\nimport { ActivityReceivedEventArgs, CancellationErrorCode, CancellationReason, DialogServiceConfig, PropertyCollection, PropertyId, RecognitionEventArgs, ResultReason, SessionEventArgs, SpeechRecognitionCanceledEventArgs, SpeechRecognitionEventArgs, SpeechRecognitionResult, SpeechSynthesisOutputFormat, TurnStatusReceivedEventArgs, } from \"../sdk/Exports\";\nimport { DialogServiceTurnStateManager } from \"./DialogServiceTurnStateManager\";\nimport { CancellationErrorCodePropertyName, EnumTranslation, RecognitionStatus, ServiceRecognizerBase, SimpleSpeechPhrase, SpeechDetected, SpeechHypothesis, } from \"./Exports\";\nimport { ActivityPayloadResponse } from \"./ServiceMessages/ActivityResponsePayload\";\nimport { SpeechConnectionMessage } from \"./SpeechConnectionMessage.Internal\";\nexport class DialogServiceAdapter extends ServiceRecognizerBase {\n constructor(authentication, connectionFactory, audioSource, recognizerConfig, dialogServiceConnector) {\n super(authentication, connectionFactory, audioSource, recognizerConfig, dialogServiceConnector);\n this.sendAgentConfig = (connection) => {\n if (this.agentConfig && !this.agentConfigSent) {\n if (this.privRecognizerConfig\n .parameters\n .getProperty(PropertyId.Conversation_DialogType) === DialogServiceConfig.DialogTypes.CustomCommands) {\n const config = this.agentConfig.get();\n config.botInfo.commandsCulture = this.privRecognizerConfig.parameters.getProperty(PropertyId.SpeechServiceConnection_RecoLanguage, \"en-us\");\n this.agentConfig.set(config);\n }\n this.onEvent(new SendingAgentContextMessageEvent(this.agentConfig));\n const agentConfigJson = this.agentConfig.toJsonString();\n // guard against sending this multiple times on one connection\n this.agentConfigSent = true;\n return connection.send(new SpeechConnectionMessage(MessageType.Text, \"agent.config\", this.privRequestSession.requestId, \"application/json\", agentConfigJson));\n }\n return;\n };\n this.sendAgentContext = (connection) => {\n const guid = createGuid();\n const speechActivityTemplate = this.privDialogServiceConnector.properties.getProperty(PropertyId.Conversation_Speech_Activity_Template);\n const agentContext = {\n channelData: \"\",\n context: {\n interactionId: guid\n },\n messagePayload: typeof speechActivityTemplate === undefined ? undefined : speechActivityTemplate,\n version: 0.5\n };\n const agentContextJson = JSON.stringify(agentContext);\n return connection.send(new SpeechConnectionMessage(MessageType.Text, \"speech.agent.context\", this.privRequestSession.requestId, \"application/json\", agentContextJson));\n };\n this.handleResponseMessage = (responseMessage) => {\n // \"response\" messages can contain either \"message\" (activity) or \"MessageStatus\" data. Fire the appropriate\n // event according to the message type that's specified.\n const responsePayload = JSON.parse(responseMessage.textBody);\n switch (responsePayload.messageType.toLowerCase()) {\n case \"message\":\n const responseRequestId = responseMessage.requestId.toUpperCase();\n const activityPayload = ActivityPayloadResponse.fromJSON(responseMessage.textBody);\n const turn = this.privTurnStateManager.GetTurn(responseRequestId);\n // update the conversation Id\n if (activityPayload.conversationId) {\n const updateAgentConfig = this.agentConfig.get();\n updateAgentConfig.botInfo.conversationId = activityPayload.conversationId;\n this.agentConfig.set(updateAgentConfig);\n }\n const pullAudioOutputStream = turn.processActivityPayload(activityPayload, SpeechSynthesisOutputFormat[this.privDialogServiceConnector.properties.getProperty(PropertyId.SpeechServiceConnection_SynthOutputFormat, undefined)]);\n const activity = new ActivityReceivedEventArgs(activityPayload.messagePayload, pullAudioOutputStream);\n if (!!this.privDialogServiceConnector.activityReceived) {\n try {\n this.privDialogServiceConnector.activityReceived(this.privDialogServiceConnector, activity);\n /* tslint:disable:no-empty */\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n break;\n case \"messagestatus\":\n if (!!this.privDialogServiceConnector.turnStatusReceived) {\n try {\n this.privDialogServiceConnector.turnStatusReceived(this.privDialogServiceConnector, new TurnStatusReceivedEventArgs(responseMessage.textBody));\n /* tslint:disable:no-empty */\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n break;\n default:\n Events.instance.onEvent(new BackgroundEvent(`Unexpected response of type ${responsePayload.messageType}. Ignoring.`));\n break;\n }\n };\n this.privEvents = new EventSource();\n this.privDialogServiceConnector = dialogServiceConnector;\n this.receiveMessageOverride = this.receiveDialogMessageOverride;\n this.privTurnStateManager = new DialogServiceTurnStateManager();\n this.recognizeOverride = this.listenOnce;\n this.postConnectImplOverride = this.dialogConnectImpl;\n this.configConnectionOverride = this.configConnection;\n this.disconnectOverride = this.privDisconnect;\n this.privDialogAudioSource = audioSource;\n this.agentConfigSent = false;\n this.privLastResult = null;\n }\n sendMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n const interactionGuid = createGuid();\n const requestId = createNoDashGuid();\n const agentMessage = {\n context: {\n interactionId: interactionGuid\n },\n messagePayload: JSON.parse(message),\n version: 0.5\n };\n const agentMessageJson = JSON.stringify(agentMessage);\n const connection = yield this.fetchConnection();\n yield connection.send(new SpeechConnectionMessage(MessageType.Text, \"agent\", requestId, \"application/json\", agentMessageJson));\n });\n }\n privDisconnect() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, CancellationReason.Error, CancellationErrorCode.NoError, \"Disconnecting\");\n this.terminateMessageLoop = true;\n this.agentConfigSent = false;\n return;\n });\n }\n processTypeSpecificMessages(connectionMessage) {\n return __awaiter(this, void 0, void 0, function* () {\n const resultProps = new PropertyCollection();\n if (connectionMessage.messageType === MessageType.Text) {\n resultProps.setProperty(PropertyId.SpeechServiceResponse_JsonResult, connectionMessage.textBody);\n }\n let result;\n let processed;\n switch (connectionMessage.path.toLowerCase()) {\n case \"speech.phrase\":\n const speechPhrase = SimpleSpeechPhrase.fromJSON(connectionMessage.textBody);\n this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset + speechPhrase.Offset + speechPhrase.Duration);\n if (speechPhrase.RecognitionStatus !== RecognitionStatus.TooManyRequests && speechPhrase.RecognitionStatus !== RecognitionStatus.Error) {\n const args = this.fireEventForResult(speechPhrase, resultProps);\n this.privLastResult = args.result;\n if (!!this.privDialogServiceConnector.recognized) {\n try {\n this.privDialogServiceConnector.recognized(this.privDialogServiceConnector, args);\n /* tslint:disable:no-empty */\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n }\n processed = true;\n break;\n case \"speech.hypothesis\":\n const hypothesis = SpeechHypothesis.fromJSON(connectionMessage.textBody);\n const offset = hypothesis.Offset + this.privRequestSession.currentTurnAudioOffset;\n result = new SpeechRecognitionResult(this.privRequestSession.requestId, ResultReason.RecognizingSpeech, hypothesis.Text, hypothesis.Duration, offset, hypothesis.Language, hypothesis.LanguageDetectionConfidence, undefined, undefined, connectionMessage.textBody, resultProps);\n this.privRequestSession.onHypothesis(offset);\n const ev = new SpeechRecognitionEventArgs(result, hypothesis.Duration, this.privRequestSession.sessionId);\n if (!!this.privDialogServiceConnector.recognizing) {\n try {\n this.privDialogServiceConnector.recognizing(this.privDialogServiceConnector, ev);\n /* tslint:disable:no-empty */\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n processed = true;\n break;\n case \"audio\":\n {\n const audioRequestId = connectionMessage.requestId.toUpperCase();\n const turn = this.privTurnStateManager.GetTurn(audioRequestId);\n try {\n // Empty binary message signals end of stream.\n if (!connectionMessage.binaryBody) {\n turn.endAudioStream();\n }\n else {\n turn.audioStream.write(connectionMessage.binaryBody);\n }\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n processed = true;\n break;\n case \"response\":\n {\n this.handleResponseMessage(connectionMessage);\n }\n processed = true;\n break;\n default:\n break;\n }\n return processed;\n });\n }\n // Cancels recognition.\n cancelRecognition(sessionId, requestId, cancellationReason, errorCode, error) {\n return __awaiter(this, void 0, void 0, function* () {\n this.terminateMessageLoop = true;\n if (!!this.privRequestSession.isRecognizing) {\n yield this.privRequestSession.onStopRecognizing();\n }\n if (!!this.privDialogServiceConnector.canceled) {\n const properties = new PropertyCollection();\n properties.setProperty(CancellationErrorCodePropertyName, CancellationErrorCode[errorCode]);\n const cancelEvent = new SpeechRecognitionCanceledEventArgs(cancellationReason, error, errorCode, undefined, sessionId);\n try {\n this.privDialogServiceConnector.canceled(this.privDialogServiceConnector, cancelEvent);\n /* tslint:disable:no-empty */\n }\n catch (_a) { }\n if (!!this.privSuccessCallback) {\n const result = new SpeechRecognitionResult(undefined, // ResultId\n ResultReason.Canceled, undefined, // Text\n undefined, // Duration\n undefined, // Offset\n undefined, // Language\n undefined, // Language Detection Confidence\n undefined, // Speaker Id\n error, undefined, // Json\n properties);\n try {\n this.privSuccessCallback(result);\n this.privSuccessCallback = undefined;\n /* tslint:disable:no-empty */\n }\n catch (_b) { }\n }\n }\n });\n }\n listenOnce(recoMode, successCallback, errorCallback) {\n return __awaiter(this, void 0, void 0, function* () {\n this.privRecognizerConfig.recognitionMode = recoMode;\n this.privSuccessCallback = successCallback;\n this.privErrorCallback = errorCallback;\n this.privRequestSession.startNewRecognition();\n this.privRequestSession.listenForServiceTelemetry(this.privDialogAudioSource.events);\n this.privRecognizerConfig.parameters.setProperty(PropertyId.Speech_SessionId, this.privRequestSession.sessionId);\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n const conPromise = this.connectImpl();\n const preAudioPromise = this.sendPreAudioMessages();\n const node = yield this.privDialogAudioSource.attach(this.privRequestSession.audioNodeId);\n const format = yield this.privDialogAudioSource.format;\n const deviceInfo = yield this.privDialogAudioSource.deviceInfo;\n const audioNode = new ReplayableAudioNode(node, format.avgBytesPerSec);\n yield this.privRequestSession.onAudioSourceAttachCompleted(audioNode, false);\n this.privRecognizerConfig.SpeechServiceConfig.Context.audio = { source: deviceInfo };\n try {\n yield conPromise;\n yield preAudioPromise;\n }\n catch (error) {\n yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, CancellationReason.Error, CancellationErrorCode.ConnectionFailure, error);\n return Promise.resolve();\n }\n const sessionStartEventArgs = new SessionEventArgs(this.privRequestSession.sessionId);\n if (!!this.privRecognizer.sessionStarted) {\n this.privRecognizer.sessionStarted(this.privRecognizer, sessionStartEventArgs);\n }\n const audioSendPromise = this.sendAudio(audioNode);\n // /* tslint:disable:no-empty */\n audioSendPromise.then(() => { }, (error) => __awaiter(this, void 0, void 0, function* () {\n yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, CancellationReason.Error, CancellationErrorCode.RuntimeError, error);\n }));\n });\n }\n // Establishes a websocket connection to the end point.\n dialogConnectImpl(connection) {\n this.privConnectionLoop = this.startMessageLoop();\n return connection;\n }\n receiveDialogMessageOverride() {\n // we won't rely on the cascading promises of the connection since we want to continually be available to receive messages\n const communicationCustodian = new Deferred();\n const loop = () => __awaiter(this, void 0, void 0, function* () {\n try {\n const isDisposed = this.isDisposed();\n const terminateMessageLoop = (!this.isDisposed() && this.terminateMessageLoop);\n if (isDisposed || terminateMessageLoop) {\n // We're done.\n communicationCustodian.resolve(undefined);\n return;\n }\n const connection = yield this.fetchConnection();\n const message = yield connection.read();\n if (!message) {\n return loop();\n }\n const connectionMessage = SpeechConnectionMessage.fromConnectionMessage(message);\n switch (connectionMessage.path.toLowerCase()) {\n case \"turn.start\":\n {\n const turnRequestId = connectionMessage.requestId.toUpperCase();\n const audioSessionReqId = this.privRequestSession.requestId.toUpperCase();\n // turn started by the service\n if (turnRequestId !== audioSessionReqId) {\n this.privTurnStateManager.StartTurn(turnRequestId);\n }\n else {\n this.privRequestSession.onServiceTurnStartResponse();\n }\n }\n break;\n case \"speech.startdetected\":\n const speechStartDetected = SpeechDetected.fromJSON(connectionMessage.textBody);\n const speechStartEventArgs = new RecognitionEventArgs(speechStartDetected.Offset, this.privRequestSession.sessionId);\n if (!!this.privRecognizer.speechStartDetected) {\n this.privRecognizer.speechStartDetected(this.privRecognizer, speechStartEventArgs);\n }\n break;\n case \"speech.enddetected\":\n let json;\n if (connectionMessage.textBody.length > 0) {\n json = connectionMessage.textBody;\n }\n else {\n // If the request was empty, the JSON returned is empty.\n json = \"{ Offset: 0 }\";\n }\n const speechStopDetected = SpeechDetected.fromJSON(json);\n this.privRequestSession.onServiceRecognized(speechStopDetected.Offset + this.privRequestSession.currentTurnAudioOffset);\n const speechStopEventArgs = new RecognitionEventArgs(speechStopDetected.Offset + this.privRequestSession.currentTurnAudioOffset, this.privRequestSession.sessionId);\n if (!!this.privRecognizer.speechEndDetected) {\n this.privRecognizer.speechEndDetected(this.privRecognizer, speechStopEventArgs);\n }\n break;\n case \"turn.end\":\n {\n const turnEndRequestId = connectionMessage.requestId.toUpperCase();\n const audioSessionReqId = this.privRequestSession.requestId.toUpperCase();\n // turn started by the service\n if (turnEndRequestId !== audioSessionReqId) {\n this.privTurnStateManager.CompleteTurn(turnEndRequestId);\n }\n else {\n // Audio session turn\n const sessionStopEventArgs = new SessionEventArgs(this.privRequestSession.sessionId);\n yield this.privRequestSession.onServiceTurnEndResponse(false);\n if (this.privRequestSession.isSpeechEnded) {\n if (!!this.privRecognizer.sessionStopped) {\n this.privRecognizer.sessionStopped(this.privRecognizer, sessionStopEventArgs);\n }\n }\n // report result to promise.\n if (!!this.privSuccessCallback && this.privLastResult) {\n try {\n this.privSuccessCallback(this.privLastResult);\n this.privLastResult = null;\n }\n catch (e) {\n if (!!this.privErrorCallback) {\n this.privErrorCallback(e);\n }\n }\n // Only invoke the call back once.\n // and if it's successful don't invoke the\n // error after that.\n this.privSuccessCallback = undefined;\n this.privErrorCallback = undefined;\n }\n }\n }\n break;\n default:\n if (!this.processTypeSpecificMessages(connectionMessage)) {\n if (!!this.serviceEvents) {\n this.serviceEvents.onEvent(new ServiceEvent(connectionMessage.path.toLowerCase(), connectionMessage.textBody));\n }\n }\n }\n const ret = loop();\n return ret;\n }\n catch (error) {\n this.terminateMessageLoop = true;\n communicationCustodian.resolve();\n }\n });\n loop().catch((reason) => {\n Events.instance.onEvent(new BackgroundEvent(reason));\n });\n return communicationCustodian.promise;\n }\n startMessageLoop() {\n return __awaiter(this, void 0, void 0, function* () {\n this.terminateMessageLoop = false;\n try {\n yield this.receiveDialogMessageOverride();\n }\n catch (error) {\n yield this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, CancellationReason.Error, CancellationErrorCode.RuntimeError, error);\n }\n return Promise.resolve();\n });\n }\n // Takes an established websocket connection to the endpoint and sends speech configuration information.\n configConnection(connection) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.terminateMessageLoop) {\n this.terminateMessageLoop = false;\n return Promise.reject(`Connection to service terminated.`);\n }\n yield this.sendSpeechServiceConfig(connection, this.privRequestSession, this.privRecognizerConfig.SpeechServiceConfig.serialize());\n yield this.sendAgentConfig(connection);\n return connection;\n });\n }\n sendPreAudioMessages() {\n return __awaiter(this, void 0, void 0, function* () {\n const connection = yield this.fetchConnection();\n yield this.sendAgentContext(connection);\n yield this.sendWaveHeader(connection);\n });\n }\n fireEventForResult(serviceResult, properties) {\n const resultReason = EnumTranslation.implTranslateRecognitionResult(serviceResult.RecognitionStatus);\n const offset = serviceResult.Offset + this.privRequestSession.currentTurnAudioOffset;\n const result = new SpeechRecognitionResult(this.privRequestSession.requestId, resultReason, serviceResult.DisplayText, serviceResult.Duration, offset, serviceResult.Language, serviceResult.LanguageDetectionConfidence, undefined, undefined, JSON.stringify(serviceResult), properties);\n const ev = new SpeechRecognitionEventArgs(result, offset, this.privRequestSession.sessionId);\n return ev;\n }\n onEvent(event) {\n this.privEvents.onEvent(event);\n Events.instance.onEvent(event);\n }\n}\n\n//# sourceMappingURL=DialogServiceAdapter.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { ArgumentNullError, } from \"../common/Exports\";\nimport { HeaderNames } from \"./HeaderNames\";\nimport { AuthInfo } from \"./IAuthentication\";\n/**\n * @class\n */\nexport class CognitiveSubscriptionKeyAuthentication {\n /**\n * Creates and initializes an instance of the CognitiveSubscriptionKeyAuthentication class.\n * @constructor\n * @param {string} subscriptionKey - The subscription key\n */\n constructor(subscriptionKey) {\n /**\n * Fetches the subscription key.\n * @member\n * @function\n * @public\n * @param {string} authFetchEventId - The id to fetch.\n */\n this.fetch = (authFetchEventId) => {\n return Promise.resolve(this.privAuthInfo);\n };\n /**\n * Fetches the subscription key.\n * @member\n * @function\n * @public\n * @param {string} authFetchEventId - The id to fetch.\n */\n this.fetchOnExpiry = (authFetchEventId) => {\n return Promise.resolve(this.privAuthInfo);\n };\n if (!subscriptionKey) {\n throw new ArgumentNullError(\"subscriptionKey\");\n }\n this.privAuthInfo = new AuthInfo(HeaderNames.AuthKey, subscriptionKey);\n }\n}\n\n//# sourceMappingURL=CognitiveSubscriptionKeyAuthentication.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { ServicePropertiesPropertyName, } from \"../common.speech/Exports\";\nimport { PropertyId } from \"../sdk/Exports\";\nimport { QueryParameterNames } from \"./QueryParameterNames\";\nexport class ConnectionFactoryBase {\n setCommonUrlParams(config, queryParams, endpoint) {\n this.setUrlParameter(PropertyId.SpeechServiceConnection_EnableAudioLogging, QueryParameterNames.EnableAudioLogging, config, queryParams, endpoint);\n this.setUrlParameter(PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps, QueryParameterNames.EnableWordLevelTimestamps, config, queryParams, endpoint);\n this.setUrlParameter(PropertyId.SpeechServiceResponse_ProfanityOption, QueryParameterNames.Profanity, config, queryParams, endpoint);\n this.setUrlParameter(PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs, QueryParameterNames.InitialSilenceTimeoutMs, config, queryParams, endpoint);\n this.setUrlParameter(PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs, QueryParameterNames.EndSilenceTimeoutMs, config, queryParams, endpoint);\n this.setUrlParameter(PropertyId.SpeechServiceResponse_StablePartialResultThreshold, QueryParameterNames.StableIntermediateThreshold, config, queryParams, endpoint);\n const serviceProperties = JSON.parse(config.parameters.getProperty(ServicePropertiesPropertyName, \"{}\"));\n Object.keys(serviceProperties).forEach((value, num, array) => {\n queryParams[value] = serviceProperties[value];\n });\n }\n setUrlParameter(propId, parameterName, config, queryParams, endpoint) {\n const value = config.parameters.getProperty(propId, undefined);\n if (value && (!endpoint || endpoint.search(parameterName) === -1)) {\n queryParams[parameterName] = value.toLocaleLowerCase();\n }\n }\n}\n\n//# sourceMappingURL=ConnectionFactoryBase.js.map\n"],"sourceRoot":""}