{"version":3,"sources":["webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/IntentRecognitionEventArgs.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/IntentRecognitionCanceledEventArgs.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/NoMatchDetails.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/NoMatchReason.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/LanguageUnderstandingModel.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/IntentRecognitionResult.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/KeywordRecognitionModel.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/IntentRecognizer.js"],"names":["IntentRecognitionEventArgs","result","offset","sessionId","super","this","privResult","IntentRecognitionCanceledEventArgs","reason","errorDetails","errorCode","privReason","privErrorDetails","privErrorCode","NoMatchDetails","simpleSpeech","fromJSON","json","NotRecognized","RecognitionStatus","BabbleTimeout","InitialBabbleTimeout","InitialSilenceTimeout","NoMatchReason","LanguageUnderstandingModel","uri","throwIfNull","throwIfNullOrWhitespace","hostname","langModelImp","LanguageUnderstandingModelImpl","firstDot","host","indexOf","Error","region","substr","lastSegment","pathname","lastIndexOf","appId","subscriptionKey","searchParams","get","undefined","IntentRecognitionResult","intentId","resultId","text","duration","language","languageDetectionConfidence","properties","privIntentId","KeywordRecognitionModel","privDisposed","fileName","throwIfFileDoesNotExist","file","__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","done","then","apply","IntentRecognizer","speechConfig","audioConfig","throwIfNullOrUndefined","configImpl","privAddedIntents","privAddedLmIntents","privDisposedIntentRecognizer","privProperties","getProperty","SpeechServiceConnection_RecoLanguage","throwIfDisposed","SpeechServiceAuthorization_Token","setProperty","cb","err","Object","keys","length","privUmbrellaIntent","context","buildSpeechContext","privReco","speechContext","setSection","Intent","dynamicGrammar","addReferenceGrammar","ReferenceGrammars","intentReco","setIntents","recognizeOnceAsyncImpl","Interactive","startContinuousRecognitionAsyncImpl","Conversation","stopContinuousRecognitionAsyncImpl","model","simplePhrase","push","intentName","modelImpl","errorCb","dispose","authentication","connectionFactory","recognizerConfig","audioImpl","disposing","_super","create","call","refGrammers","addedLmIntent","grammer","id","key","SpeechServiceConnection_Key","provider"],"mappings":"sPAAA,kDAOO,MAAMA,UAAmC,OAQ5C,YAAYC,EAAQC,EAAQC,GACxBC,MAAMF,EAAQC,GACdE,KAAKC,WAAaL,EAStB,aACI,OAAOI,KAAKC,c,oCC3BpB,kDAOO,MAAMC,UAA2C,OAQpD,YAAYC,EAAQC,EAAcC,EAAWT,EAAQC,EAAQC,GACzDC,MAAMH,EAAQC,EAAQC,GACtBE,KAAKM,WAAaH,EAClBH,KAAKO,iBAAmBH,EACxBJ,KAAKQ,cAAgBH,EASzB,aACI,OAAOL,KAAKM,WAOhB,gBACI,OAAON,KAAKQ,cAShB,mBACI,OAAOR,KAAKO,oB,kCC/CpB,0EAQO,MAAME,EAMT,YAAYN,GACRH,KAAKM,WAAaH,EAWtB,kBAAkBP,GACd,MAAMc,EAAe,OAAmBC,SAASf,EAAOgB,MACxD,IAAIT,EAAS,OAAcU,cAC3B,OAAQH,EAAaI,mBACjB,KAAK,OAAkBC,cACnBZ,EAAS,OAAca,qBACvB,MACJ,KAAK,OAAkBC,sBACnBd,EAAS,OAAcc,sBACvB,MACJ,QACId,EAAS,OAAcU,cACvB,MAER,OAAO,IAAIJ,EAAeN,GAS9B,aACI,OAAOH,KAAKM,c,kCC5Cb,IAAIY,EANX,kCAOA,SAAWA,GAKPA,EAAcA,EAAc,iBAAmB,GAAK,gBAMpDA,EAAcA,EAAc,yBAA2B,GAAK,wBAM5DA,EAAcA,EAAc,wBAA0B,GAA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,OAAOC,KAAKzF,KAAK8E,oBAAqB,CACzD,MAAM8C,EAAgB5H,KAAK8E,mBAAmBrC,GAE9C,QAAcF,IAAVJ,EACAA,EAAQyF,EAAcZ,UAAU7E,WAGhC,GAAIA,IAAUyF,EAAcZ,UAAU7E,MAClC,MAAM,IAAIN,MAAM,gDAGxB,QAAeU,IAAXT,EACAA,EAAS8F,EAAcZ,UAAUlF,YAGjC,GAAIA,IAAW8F,EAAcZ,UAAUlF,OACnC,MAAM,IAAID,MAAM,mEAGxB,QAAwBU,IAApBH,EACAA,EAAkBwF,EAAcZ,UAAU5E,qBAG1C,GAAIA,IAAoBwF,EAAcZ,UAAU5E,gBAC5C,MAAM,IAAIP,MAAM,kDAGxB,MAAMgG,EAAU,QAAU1F,EAAQ,eAAiBM,EACnDkF,EAAYb,KAAKe,GAErB,MAAO,CACH5B,OAAQ,CACJ6B,GAAI3F,EACJ4F,SAA0BxF,IAApBH,EAAiCpC,KAAKgF,eAAeC,YAAY,OAAW,OAAW+C,8BAAgC5F,EAC7H6F,SAAU,QAEd7B,uBAAoB7D,IAAcvC,KAAK2F,mBAAsBgC,EAAc,CAAC,QAAUxF,EAAQ","file":"js/DescibeImage~df153360.5837001a.js","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { RecognitionEventArgs } from \"./Exports\";\n/**\n * Intent recognition result event arguments.\n * @class\n */\nexport class IntentRecognitionEventArgs extends RecognitionEventArgs {\n /**\n * Creates and initializes an instance of this class.\n * @constructor\n * @param result - The result of the intent recognition.\n * @param offset - The offset.\n * @param sessionId - The session id.\n */\n constructor(result, offset, sessionId) {\n super(offset, sessionId);\n this.privResult = result;\n }\n /**\n * Represents the intent recognition result.\n * @member IntentRecognitionEventArgs.prototype.result\n * @function\n * @public\n * @returns {IntentRecognitionResult} Represents the intent recognition result.\n */\n get result() {\n return this.privResult;\n }\n}\n\n//# sourceMappingURL=IntentRecognitionEventArgs.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { IntentRecognitionEventArgs } from \"./Exports\";\n/**\n * Define payload of intent recognition canceled result events.\n * @class IntentRecognitionCanceledEventArgs\n */\nexport class IntentRecognitionCanceledEventArgs extends IntentRecognitionEventArgs {\n /**\n * Creates and initializes an instance of this class.\n * @constructor\n * @param {CancellationReason} result - The result of the intent recognition.\n * @param {string} offset - The offset.\n * @param {IntentRecognitionResult} sessionId - The session id.\n */\n constructor(reason, errorDetails, errorCode, result, offset, sessionId) {\n super(result, offset, sessionId);\n this.privReason = reason;\n this.privErrorDetails = errorDetails;\n this.privErrorCode = errorCode;\n }\n /**\n * The reason the recognition was canceled.\n * @member IntentRecognitionCanceledEventArgs.prototype.reason\n * @function\n * @public\n * @returns {CancellationReason} Specifies the reason canceled.\n */\n get reason() {\n return this.privReason;\n }\n /**\n * The error code in case of an unsuccessful recognition.\n * Added in version 1.1.0.\n * @return An error code that represents the error reason.\n */\n get errorCode() {\n return this.privErrorCode;\n }\n /**\n * In case of an unsuccessful recognition, provides details of the occurred error.\n * @member IntentRecognitionCanceledEventArgs.prototype.errorDetails\n * @function\n * @public\n * @returns {string} A String that represents the error details.\n */\n get errorDetails() {\n return this.privErrorDetails;\n }\n}\n\n//# sourceMappingURL=IntentRecognitionCanceledEventArgs.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { RecognitionStatus, SimpleSpeechPhrase } from \"../../src/common.speech/Exports\";\nimport { NoMatchReason } from \"./Exports\";\n/**\n * Contains detailed information for NoMatch recognition results.\n * @class NoMatchDetails\n */\nexport class NoMatchDetails {\n /**\n * Creates and initializes an instance of this class.\n * @constructor\n * @param {NoMatchReason} reason - The no-match reason.\n */\n constructor(reason) {\n this.privReason = reason;\n }\n /**\n * Creates an instance of NoMatchDetails object for the NoMatch SpeechRecognitionResults.\n * @member NoMatchDetails.fromResult\n * @function\n * @public\n * @param {SpeechRecognitionResult | IntentRecognitionResult | TranslationRecognitionResult}\n * result - The recognition result that was not recognized.\n * @returns {NoMatchDetails} The no match details object being created.\n */\n static fromResult(result) {\n const simpleSpeech = SimpleSpeechPhrase.fromJSON(result.json);\n let reason = NoMatchReason.NotRecognized;\n switch (simpleSpeech.RecognitionStatus) {\n case RecognitionStatus.BabbleTimeout:\n reason = NoMatchReason.InitialBabbleTimeout;\n break;\n case RecognitionStatus.InitialSilenceTimeout:\n reason = NoMatchReason.InitialSilenceTimeout;\n break;\n default:\n reason = NoMatchReason.NotRecognized;\n break;\n }\n return new NoMatchDetails(reason);\n }\n /**\n * The reason the recognition was canceled.\n * @member NoMatchDetails.prototype.reason\n * @function\n * @public\n * @returns {NoMatchReason} Specifies the reason canceled.\n */\n get reason() {\n return this.privReason;\n }\n}\n\n//# sourceMappingURL=NoMatchDetails.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n/**\n * Defines the possible reasons a recognition result might not be recognized.\n * @class NoMatchReason\n */\nexport var NoMatchReason;\n(function (NoMatchReason) {\n /**\n * Indicates that speech was detected, but not recognized.\n * @member NoMatchReason.NotRecognized\n */\n NoMatchReason[NoMatchReason[\"NotRecognized\"] = 0] = \"NotRecognized\";\n /**\n * Indicates that the start of the audio stream contained only silence,\n * and the service timed out waiting for speech.\n * @member NoMatchReason.InitialSilenceTimeout\n */\n NoMatchReason[NoMatchReason[\"InitialSilenceTimeout\"] = 1] = \"InitialSilenceTimeout\";\n /**\n * Indicates that the start of the audio stream contained only noise,\n * and the service timed out waiting for speech.\n * @member NoMatchReason.InitialBabbleTimeout\n */\n NoMatchReason[NoMatchReason[\"InitialBabbleTimeout\"] = 2] = \"InitialBabbleTimeout\";\n})(NoMatchReason || (NoMatchReason = {}));\n\n//# sourceMappingURL=NoMatchReason.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { Contracts } from \"./Contracts\";\n/**\n * Language understanding model\n * @class LanguageUnderstandingModel\n */\nexport class LanguageUnderstandingModel {\n /**\n * Creates and initializes a new instance\n * @constructor\n */\n constructor() {\n }\n /**\n * Creates an language understanding model using the specified endpoint.\n * @member LanguageUnderstandingModel.fromEndpoint\n * @function\n * @public\n * @param {URL} uri - A String that represents the endpoint of the language understanding model.\n * @returns {LanguageUnderstandingModel} The language understanding model being created.\n */\n static fromEndpoint(uri) {\n Contracts.throwIfNull(uri, \"uri\");\n Contracts.throwIfNullOrWhitespace(uri.hostname, \"uri\");\n const langModelImp = new LanguageUnderstandingModelImpl();\n // Need to extract the app ID from the URL.\n // URL is in the format: https://.api.cognitive.microsoft.com/luis/v2.0/apps/?subscription-key=&timezoneOffset=-360\n // Start tearing the string apart.\n // region can be extracted from the host name.\n const firstDot = uri.host.indexOf(\".\");\n if (-1 === firstDot) {\n throw new Error(\"Could not determine region from endpoint\");\n }\n langModelImp.region = uri.host.substr(0, firstDot);\n // Now the app ID.\n const lastSegment = uri.pathname.lastIndexOf(\"/\") + 1;\n if (-1 === lastSegment) {\n throw new Error(\"Could not determine appId from endpoint\");\n }\n langModelImp.appId = uri.pathname.substr(lastSegment);\n // And finally the key.\n langModelImp.subscriptionKey = uri.searchParams.get(\"subscription-key\");\n if (undefined === langModelImp.subscriptionKey) {\n throw new Error(\"Could not determine subscription key from endpoint\");\n }\n return langModelImp;\n }\n /**\n * Creates an language understanding model using the application id of Language Understanding service.\n * @member LanguageUnderstandingModel.fromAppId\n * @function\n * @public\n * @param {string} appId - A String that represents the application id of Language Understanding service.\n * @returns {LanguageUnderstandingModel} The language understanding model being created.\n */\n static fromAppId(appId) {\n Contracts.throwIfNullOrWhitespace(appId, \"appId\");\n const langModelImp = new LanguageUnderstandingModelImpl();\n langModelImp.appId = appId;\n return langModelImp;\n }\n /**\n * Creates a language understanding model using hostname, subscription key and application\n * id of Language Understanding service.\n * @member LanguageUnderstandingModel.fromSubscription\n * @function\n * @public\n * @param {string} subscriptionKey - A String that represents the subscription key of\n * Language Understanding service.\n * @param {string} appId - A String that represents the application id of Language\n * Understanding service.\n * @param {LanguageUnderstandingModel} region - A String that represents the region\n * of the Language Understanding service (see the region page).\n * @returns {LanguageUnderstandingModel} The language understanding model being created.\n */\n static fromSubscription(subscriptionKey, appId, region) {\n Contracts.throwIfNullOrWhitespace(subscriptionKey, \"subscriptionKey\");\n Contracts.throwIfNullOrWhitespace(appId, \"appId\");\n Contracts.throwIfNullOrWhitespace(region, \"region\");\n const langModelImp = new LanguageUnderstandingModelImpl();\n langModelImp.appId = appId;\n langModelImp.region = region;\n langModelImp.subscriptionKey = subscriptionKey;\n return langModelImp;\n }\n}\n/**\n * @private\n * @class LanguageUnderstandingModelImpl\n */\n// tslint:disable-next-line:max-classes-per-file\nexport class LanguageUnderstandingModelImpl extends LanguageUnderstandingModel {\n}\n\n//# sourceMappingURL=LanguageUnderstandingModel.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { SpeechRecognitionResult } from \"./Exports\";\n/**\n * Intent recognition result.\n * @class\n */\nexport class IntentRecognitionResult extends SpeechRecognitionResult {\n /**\n * Creates and initializes an instance of this class.\n * @constructor\n * @param intentId - The intent id.\n * @param resultId - The result id.\n * @param reason - The reason.\n * @param text - The recognized text.\n * @param duration - The duration.\n * @param offset - The offset into the stream.\n * @param language - Primary Language detected, if provided.\n * @param languageDetectionConfidence - Primary Language confidence (\"Unknown,\" \"Low,\" \"Medium,\" \"High\"...), if provided.\n * @param errorDetails - Error details, if provided.\n * @param json - Additional Json, if provided.\n * @param properties - Additional properties, if provided.\n */\n constructor(intentId, resultId, reason, text, duration, offset, language, languageDetectionConfidence, errorDetails, json, properties) {\n super(resultId, reason, text, duration, offset, language, languageDetectionConfidence, undefined, errorDetails, json, properties);\n this.privIntentId = intentId;\n }\n /**\n * A String that represents the intent identifier being recognized.\n * @member IntentRecognitionResult.prototype.intentId\n * @function\n * @public\n * @returns {string} A String that represents the intent identifier being recognized.\n */\n get intentId() {\n return this.privIntentId;\n }\n}\n\n//# sourceMappingURL=IntentRecognitionResult.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { Contracts } from \"./Contracts\";\n/**\n * Represents a keyword recognition model for recognizing when\n * the user says a keyword to initiate further speech recognition.\n * @class KeywordRecognitionModel\n */\nexport class KeywordRecognitionModel {\n /**\n * Create and initializes a new instance.\n * @constructor\n */\n constructor() {\n this.privDisposed = false;\n }\n /**\n * Creates a keyword recognition model using the specified filename.\n * @member KeywordRecognitionModel.fromFile\n * @function\n * @public\n * @param {string} fileName - A string that represents file name for the keyword recognition model.\n * Note, the file can point to a zip file in which case the model\n * will be extracted from the zip.\n * @returns {KeywordRecognitionModel} The keyword recognition model being created.\n */\n static fromFile(fileName) {\n Contracts.throwIfFileDoesNotExist(fileName, \"fileName\");\n throw new Error(\"Not yet implemented.\");\n }\n /**\n * Creates a keyword recognition model using the specified filename.\n * @member KeywordRecognitionModel.fromStream\n * @function\n * @public\n * @param {string} file - A File that represents file for the keyword recognition model.\n * Note, the file can point to a zip file in which case the model will be extracted from the zip.\n * @returns {KeywordRecognitionModel} The keyword recognition model being created.\n */\n static fromStream(file) {\n Contracts.throwIfNull(file, \"file\");\n throw new Error(\"Not yet implemented.\");\n }\n /**\n * Dispose of associated resources.\n * @member KeywordRecognitionModel.prototype.close\n * @function\n * @public\n */\n close() {\n if (this.privDisposed) {\n return;\n }\n this.privDisposed = true;\n }\n}\n\n//# sourceMappingURL=KeywordRecognitionModel.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 { AddedLmIntent, IntentConnectionFactory, IntentServiceRecognizer, RecognitionMode, RecognizerConfig, } from \"../common.speech/Exports\";\nimport { marshalPromiseToCallbacks } from \"../common/Exports\";\nimport { Contracts } from \"./Contracts\";\nimport { PropertyId, Recognizer, } from \"./Exports\";\n/**\n * Intent recognizer.\n * @class\n */\nexport class IntentRecognizer extends Recognizer {\n /**\n * Initializes an instance of the IntentRecognizer.\n * @constructor\n * @param {SpeechConfig} speechConfig - The set of configuration properties.\n * @param {AudioConfig} audioConfig - An optional audio input config associated with the recognizer\n */\n constructor(speechConfig, audioConfig) {\n Contracts.throwIfNullOrUndefined(speechConfig, \"speechConfig\");\n const configImpl = speechConfig;\n Contracts.throwIfNullOrUndefined(configImpl, \"speechConfig\");\n super(audioConfig, configImpl.properties, new IntentConnectionFactory());\n this.privAddedIntents = [];\n this.privAddedLmIntents = {};\n this.privDisposedIntentRecognizer = false;\n this.privProperties = configImpl.properties;\n Contracts.throwIfNullOrWhitespace(this.properties.getProperty(PropertyId.SpeechServiceConnection_RecoLanguage), PropertyId[PropertyId.SpeechServiceConnection_RecoLanguage]);\n }\n /**\n * Gets the spoken language of recognition.\n * @member IntentRecognizer.prototype.speechRecognitionLanguage\n * @function\n * @public\n * @returns {string} the spoken language of recognition.\n */\n get speechRecognitionLanguage() {\n Contracts.throwIfDisposed(this.privDisposedIntentRecognizer);\n return this.properties.getProperty(PropertyId.SpeechServiceConnection_RecoLanguage);\n }\n /**\n * Gets the authorization token used to communicate with the service.\n * @member IntentRecognizer.prototype.authorizationToken\n * @function\n * @public\n * @returns {string} Authorization token.\n */\n get authorizationToken() {\n return this.properties.getProperty(PropertyId.SpeechServiceAuthorization_Token);\n }\n /**\n * Gets/Sets the authorization token used to communicate with the service.\n * Note: Please use a token derived from your LanguageUnderstanding subscription key for the Intent recognizer.\n * @member IntentRecognizer.prototype.authorizationToken\n * @function\n * @public\n * @param {string} value - Authorization token.\n */\n set authorizationToken(value) {\n this.properties.setProperty(PropertyId.SpeechServiceAuthorization_Token, value);\n }\n /**\n * The collection of properties and their values defined for this IntentRecognizer.\n * @member IntentRecognizer.prototype.properties\n * @function\n * @public\n * @returns {PropertyCollection} The collection of properties and their\n * values defined for this IntentRecognizer.\n */\n get properties() {\n return this.privProperties;\n }\n /**\n * Starts intent recognition, and stops after the first utterance is recognized.\n * The task returns the recognition text and intent as result.\n * Note: RecognizeOnceAsync() returns when the first utterance has been recognized,\n * so it is suitable only for single shot recognition like command or query.\n * For long-running recognition, use StartContinuousRecognitionAsync() instead.\n * @member IntentRecognizer.prototype.recognizeOnceAsync\n * @function\n * @public\n * @param cb - Callback that received the recognition has finished with an IntentRecognitionResult.\n * @param err - Callback invoked in case of an error.\n */\n recognizeOnceAsync(cb, err) {\n Contracts.throwIfDisposed(this.privDisposedIntentRecognizer);\n if (Object.keys(this.privAddedLmIntents).length !== 0 || undefined !== this.privUmbrellaIntent) {\n const context = this.buildSpeechContext();\n this.privReco.speechContext.setSection(\"intent\", context.Intent);\n this.privReco.dynamicGrammar.addReferenceGrammar(context.ReferenceGrammars);\n const intentReco = this.privReco;\n intentReco.setIntents(this.privAddedLmIntents, this.privUmbrellaIntent);\n }\n marshalPromiseToCallbacks(this.recognizeOnceAsyncImpl(RecognitionMode.Interactive), cb, err);\n }\n /**\n * Starts speech recognition, until stopContinuousRecognitionAsync() is called.\n * User must subscribe to events to receive recognition results.\n * @member IntentRecognizer.prototype.startContinuousRecognitionAsync\n * @function\n * @public\n * @param cb - Callback invoked once the recognition has started.\n * @param err - Callback invoked in case of an error.\n */\n startContinuousRecognitionAsync(cb, err) {\n if (Object.keys(this.privAddedLmIntents).length !== 0 || undefined !== this.privUmbrellaIntent) {\n const context = this.buildSpeechContext();\n this.privReco.speechContext.setSection(\"intent\", context.Intent);\n this.privReco.dynamicGrammar.addReferenceGrammar(context.ReferenceGrammars);\n const intentReco = this.privReco;\n intentReco.setIntents(this.privAddedLmIntents, this.privUmbrellaIntent);\n }\n marshalPromiseToCallbacks(this.startContinuousRecognitionAsyncImpl(RecognitionMode.Conversation), cb, err);\n }\n /**\n * Stops continuous intent recognition.\n * @member IntentRecognizer.prototype.stopContinuousRecognitionAsync\n * @function\n * @public\n * @param cb - Callback invoked once the recognition has stopped.\n * @param err - Callback invoked in case of an error.\n */\n stopContinuousRecognitionAsync(cb, err) {\n marshalPromiseToCallbacks(this.stopContinuousRecognitionAsyncImpl(), cb, err);\n }\n /**\n * Starts speech recognition with keyword spotting, until stopKeywordRecognitionAsync() is called.\n * User must subscribe to events to receive recognition results.\n * Note: Key word spotting functionality is only available on the Speech Devices SDK.\n * This functionality is currently not included in the SDK itself.\n * @member IntentRecognizer.prototype.startKeywordRecognitionAsync\n * @function\n * @public\n * @param {KeywordRecognitionModel} model - The keyword recognition model that specifies the keyword to be recognized.\n * @param cb - Callback invoked once the recognition has started.\n * @param err - Callback invoked in case of an error.\n */\n startKeywordRecognitionAsync(model, cb, err) {\n Contracts.throwIfNull(model, \"model\");\n if (!!err) {\n err(\"Not yet implemented.\");\n }\n }\n /**\n * Stops continuous speech recognition.\n * Note: Key word spotting functionality is only available on the Speech Devices SDK.\n * This functionality is currently not included in the SDK itself.\n * @member IntentRecognizer.prototype.stopKeywordRecognitionAsync\n * @function\n * @public\n * @param cb - Callback invoked once the recognition has stopped.\n * @param err - Callback invoked in case of an error.\n */\n stopKeywordRecognitionAsync(cb, err) {\n if (!!cb) {\n cb();\n }\n }\n /**\n * Adds a phrase that should be recognized as intent.\n * @member IntentRecognizer.prototype.addIntent\n * @function\n * @public\n * @param {string} intentId - A String that represents the identifier of the intent to be recognized.\n * @param {string} phrase - A String that specifies the phrase representing the intent.\n */\n addIntent(simplePhrase, intentId) {\n Contracts.throwIfDisposed(this.privDisposedIntentRecognizer);\n Contracts.throwIfNullOrWhitespace(intentId, \"intentId\");\n Contracts.throwIfNullOrWhitespace(simplePhrase, \"simplePhrase\");\n this.privAddedIntents.push([intentId, simplePhrase]);\n }\n /**\n * Adds an intent from Language Understanding service for recognition.\n * @member IntentRecognizer.prototype.addIntentWithLanguageModel\n * @function\n * @public\n * @param {string} intentId - A String that represents the identifier of the intent\n * to be recognized. Ignored if intentName is empty.\n * @param {string} model - The intent model from Language Understanding service.\n * @param {string} intentName - The intent name defined in the intent model. If it\n * is empty, all intent names defined in the model will be added.\n */\n addIntentWithLanguageModel(intentId, model, intentName) {\n Contracts.throwIfDisposed(this.privDisposedIntentRecognizer);\n Contracts.throwIfNullOrWhitespace(intentId, \"intentId\");\n Contracts.throwIfNull(model, \"model\");\n const modelImpl = model;\n Contracts.throwIfNullOrWhitespace(modelImpl.appId, \"model.appId\");\n this.privAddedLmIntents[intentId] = new AddedLmIntent(modelImpl, intentName);\n }\n /**\n * @summary Adds all intents from the specified Language Understanding Model.\n * @member IntentRecognizer.prototype.addAllIntents\n * @function\n * @public\n * @function\n * @public\n * @param {LanguageUnderstandingModel} model - The language understanding model containing the intents.\n * @param {string} intentId - A custom id String to be returned in the IntentRecognitionResult's getIntentId() method.\n */\n addAllIntents(model, intentId) {\n Contracts.throwIfNull(model, \"model\");\n const modelImpl = model;\n Contracts.throwIfNullOrWhitespace(modelImpl.appId, \"model.appId\");\n this.privUmbrellaIntent = new AddedLmIntent(modelImpl, intentId);\n }\n /**\n * closes all external resources held by an instance of this class.\n * @member IntentRecognizer.prototype.close\n * @function\n * @public\n */\n close(cb, errorCb) {\n Contracts.throwIfDisposed(this.privDisposedIntentRecognizer);\n marshalPromiseToCallbacks(this.dispose(true), cb, errorCb);\n }\n createRecognizerConfig(speechConfig) {\n return new RecognizerConfig(speechConfig, this.properties);\n }\n createServiceRecognizer(authentication, connectionFactory, audioConfig, recognizerConfig) {\n const audioImpl = audioConfig;\n return new IntentServiceRecognizer(authentication, connectionFactory, audioImpl, recognizerConfig, this);\n }\n dispose(disposing) {\n const _super = Object.create(null, {\n dispose: { get: () => super.dispose }\n });\n return __awaiter(this, void 0, void 0, function* () {\n if (this.privDisposedIntentRecognizer) {\n return;\n }\n if (disposing) {\n this.privDisposedIntentRecognizer = true;\n yield _super.dispose.call(this, disposing);\n }\n });\n }\n buildSpeechContext() {\n let appId;\n let region;\n let subscriptionKey;\n const refGrammers = [];\n if (undefined !== this.privUmbrellaIntent) {\n appId = this.privUmbrellaIntent.modelImpl.appId;\n region = this.privUmbrellaIntent.modelImpl.region;\n subscriptionKey = this.privUmbrellaIntent.modelImpl.subscriptionKey;\n }\n // Build the reference grammer array.\n for (const intentId of Object.keys(this.privAddedLmIntents)) {\n const addedLmIntent = this.privAddedLmIntents[intentId];\n // validate all the same model, region, and key...\n if (appId === undefined) {\n appId = addedLmIntent.modelImpl.appId;\n }\n else {\n if (appId !== addedLmIntent.modelImpl.appId) {\n throw new Error(\"Intents must all be from the same LUIS model\");\n }\n }\n if (region === undefined) {\n region = addedLmIntent.modelImpl.region;\n }\n else {\n if (region !== addedLmIntent.modelImpl.region) {\n throw new Error(\"Intents must all be from the same LUIS model in a single region\");\n }\n }\n if (subscriptionKey === undefined) {\n subscriptionKey = addedLmIntent.modelImpl.subscriptionKey;\n }\n else {\n if (subscriptionKey !== addedLmIntent.modelImpl.subscriptionKey) {\n throw new Error(\"Intents must all use the same subscription key\");\n }\n }\n const grammer = \"luis/\" + appId + \"-PRODUCTION#\" + intentId;\n refGrammers.push(grammer);\n }\n return {\n Intent: {\n id: appId,\n key: (subscriptionKey === undefined) ? this.privProperties.getProperty(PropertyId[PropertyId.SpeechServiceConnection_Key]) : subscriptionKey,\n provider: \"LUIS\",\n },\n ReferenceGrammars: (undefined === this.privUmbrellaIntent) ? refGrammers : [\"luis/\" + appId + \"-PRODUCTION\"],\n };\n }\n}\n\n//# sourceMappingURL=IntentRecognizer.js.map\n"],"sourceRoot":""}